Submitted By: Joe Ciccone <jciccone@gmail.com>
Date: 2010-08-01
Initial Package Version: 5.7
Origin: Upstream
Upstream Status: From Upstream
Description: Updates NCurses with the periodic fixes posted at
             ftp://invisible-island.net/ncurses/5.7/

             This patch includes the following fixes:

             ncurses-5.7-20100424-patch.sh.bz2
             ncurses-5.7-20100501.patch.gz
             ncurses-5.7-20100515.patch.gz
             ncurses-5.7-20100522.patch.gz
             ncurses-5.7-20100529.patch.gz
             ncurses-5.7-20100605.patch.gz
             ncurses-5.7-20100612.patch.gz
             ncurses-5.7-20100619.patch.gz
             ncurses-5.7-20100626.patch.gz
             ncurses-5.7-20100703.patch.gz
             ncurses-5.7-20100717.patch.gz
             ncurses-5.7-20100724.patch.gz
             ncurses-5.7-20100731.patch.gz
             ncurses-5.7-20100807.patch.gz
             ncurses-5.7-20100814.patch.gz
             ncurses-5.7-20100828.patch.gz
             ncurses-5.7-20100904.patch.gz
             ncurses-5.7-20100911.patch.gz
             ncurses-5.7-20100918.patch.gz
             ncurses-5.7-20100925.patch.gz
             ncurses-5.7-20101002.patch.gz
             ncurses-5.7-20101009.patch.gz
             ncurses-5.7-20101023.patch.gz
             ncurses-5.7-20101106.patch.gz
             ncurses-5.7-20101113.patch.gz
             ncurses-5.7-20101120.patch.gz
             ncurses-5.7-20101127.patch.gz
             ncurses-5.7-20101128.patch.gz
             ncurses-5.7-20101204.patch.gz
             ncurses-5.7-20101211.patch.gz
             ncurses-5.7-20101225.patch.gz
             ncurses-5.7-20110101.patch.gz



diff -Naur ncurses-5.7.orig/Ada95/Makefile.in ncurses-5.7/Ada95/Makefile.in
--- ncurses-5.7.orig/Ada95/Makefile.in	2003-10-25 11:39:18.000000000 -0400
+++ ncurses-5.7/Ada95/Makefile.in	2011-01-08 18:18:29.554659961 -0500
@@ -1,5 +1,6 @@
+# $Id: Makefile.in,v 1.21 2010/11/27 21:45:27 tom Exp $
 ##############################################################################
-# Copyright (c) 1998 Free Software Foundation, Inc.                          #
+# Copyright (c) 1998-2003,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"), #
@@ -29,9 +30,10 @@
 #  Author:  Juergen Pfeifer, 1996
 #
 #  Version Control
-#  $Revision: 1.15 $
+#  $Revision: 1.21 $
 #
 SHELL		= /bin/sh
+VPATH		= @srcdir@
 THIS		= Makefile
 
 SUBDIRS         = @ADA_SUBDIRS@
@@ -61,7 +63,19 @@
 	for d in $(SUBDIRS); do \
 		(cd $$d ; $(MAKE) $(CF_MFLAGS) $@) ;\
 	done
-	rm -f Makefile
+	rm -rf lib
+	for lib_kind in static dynamic; do \
+		rm -rf $${lib_kind}-ali; \
+		rm -rf $${lib_kind}-obj; \
+	done
+	-rm -f config.cache config.log config.status include/ncurses_cfg.h
+	-rm -f Makefile
+
+tags :
+	@
+
+preinstall :
+	@
 
 install.data :
 	@
diff -Naur ncurses-5.7.orig/Ada95/aclocal.m4 ncurses-5.7/Ada95/aclocal.m4
--- ncurses-5.7.orig/Ada95/aclocal.m4	1969-12-31 19:00:00.000000000 -0500
+++ ncurses-5.7/Ada95/aclocal.m4	2011-01-08 18:18:29.470656442 -0500
@@ -0,0 +1,3447 @@
+dnl***************************************************************************
+dnl Copyright (c) 2010 Free Software Foundation, Inc.                        *
+dnl                                                                          *
+dnl Permission is hereby granted, free of charge, to any person obtaining a  *
+dnl copy of this software and associated documentation files (the            *
+dnl "Software"), to deal in the Software without restriction, including      *
+dnl without limitation the rights to use, copy, modify, merge, publish,      *
+dnl distribute, distribute with modifications, sublicense, and/or sell       *
+dnl copies of the Software, and to permit persons to whom the Software is    *
+dnl furnished to do so, subject to the following conditions:                 *
+dnl                                                                          *
+dnl The above copyright notice and this permission notice shall be included  *
+dnl in all copies or substantial portions of the Software.                   *
+dnl                                                                          *
+dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
+dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
+dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
+dnl IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
+dnl DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
+dnl OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
+dnl THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
+dnl                                                                          *
+dnl Except as contained in this notice, the name(s) of the above copyright   *
+dnl holders shall not be used in advertising or otherwise to promote the     *
+dnl sale, use or other dealings in this Software without prior written       *
+dnl authorization.                                                           *
+dnl***************************************************************************
+dnl
+dnl Author: Thomas E. Dickey
+dnl
+dnl $Id: aclocal.m4,v 1.18 2010/11/13 19:19:59 tom Exp $
+dnl Macros used in NCURSES Ada95 auto-configuration script.
+dnl
+dnl These macros are maintained separately from NCURSES.  The copyright on
+dnl this file applies to the aggregation of macros and does not affect use of
+dnl these macros in other applications.
+dnl
+dnl See http://invisible-island.net/autoconf/ for additional information.
+dnl
+dnl ---------------------------------------------------------------------------
+dnl ---------------------------------------------------------------------------
+dnl CF_ADA_INCLUDE_DIRS version: 6 updated: 2010/02/26 19:52:07
+dnl -------------------
+dnl Construct the list of include-options for the C programs in the Ada95
+dnl binding.
+AC_DEFUN([CF_ADA_INCLUDE_DIRS],
+[
+ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS"
+if test "$srcdir" != "."; then
+	ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS"
+fi
+if test "$GCC" != yes; then
+	ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
+elif test "$includedir" != "/usr/include"; then
+	if test "$includedir" = '${prefix}/include' ; then
+		if test $prefix != /usr ; then
+			ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
+		fi
+	else
+		ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
+	fi
+fi
+AC_SUBST(ACPPFLAGS)
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_ADD_ADAFLAGS version: 1 updated: 2010/06/19 15:22:18
+dnl ---------------
+dnl Add to $ADAFLAGS, which is substituted into makefile and scripts.
+AC_DEFUN([CF_ADD_ADAFLAGS],[
+ 	ADAFLAGS="$ADAFLAGS $1"
+	AC_SUBST(ADAFLAGS)
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_ADD_CFLAGS version: 10 updated: 2010/05/26 05:38:42
+dnl -------------
+dnl Copy non-preprocessor flags to $CFLAGS, preprocessor flags to $CPPFLAGS
+dnl The second parameter if given makes this macro verbose.
+dnl
+dnl Put any preprocessor definitions that use quoted strings in $EXTRA_CPPFLAGS,
+dnl to simplify use of $CPPFLAGS in compiler checks, etc., that are easily
+dnl confused by the quotes (which require backslashes to keep them usable).
+AC_DEFUN([CF_ADD_CFLAGS],
+[
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
+
+for cf_add_cflags in $1
+do
+case $cf_fix_cppflags in
+no)
+	case $cf_add_cflags in #(vi
+	-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
+		case $cf_add_cflags in
+		-D*)
+			cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[[^=]]*='\''\"[[^"]]*//'`
+
+			test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+				&& test -z "${cf_tst_cflags}" \
+				&& cf_fix_cppflags=yes
+
+			if test $cf_fix_cppflags = yes ; then
+				cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+				continue
+			elif test "${cf_tst_cflags}" = "\"'" ; then
+				cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+				continue
+			fi
+			;;
+		esac
+		case "$CPPFLAGS" in
+		*$cf_add_cflags) #(vi
+			;;
+		*) #(vi
+			case $cf_add_cflags in #(vi
+			-D*)
+				cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
+				CF_REMOVE_DEFINE(CPPFLAGS,$CPPFLAGS,$cf_tst_cppflags)
+				;;
+			esac
+			cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
+			;;
+		esac
+		;;
+	*)
+		cf_new_cflags="$cf_new_cflags $cf_add_cflags"
+		;;
+	esac
+	;;
+yes)
+	cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+	cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[[^"]]*"'\''//'`
+
+	test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+		&& test -z "${cf_tst_cflags}" \
+		&& cf_fix_cppflags=no
+	;;
+esac
+done
+
+if test -n "$cf_new_cflags" ; then
+	ifelse([$2],,,[CF_VERBOSE(add to \$CFLAGS $cf_new_cflags)])
+	CFLAGS="$CFLAGS $cf_new_cflags"
+fi
+
+if test -n "$cf_new_cppflags" ; then
+	ifelse([$2],,,[CF_VERBOSE(add to \$CPPFLAGS $cf_new_cppflags)])
+	CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
+fi
+
+if test -n "$cf_new_extra_cppflags" ; then
+	ifelse([$2],,,[CF_VERBOSE(add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags)])
+	EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+fi
+
+AC_SUBST(EXTRA_CPPFLAGS)
+
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_ADD_INCDIR version: 13 updated: 2010/05/26 16:44:57
+dnl -------------
+dnl Add an include-directory to $CPPFLAGS.  Don't add /usr/include, since it's
+dnl redundant.  We don't normally need to add -I/usr/local/include for gcc,
+dnl but old versions (and some misinstalled ones) need that.  To make things
+dnl worse, gcc 3.x may give error messages if -I/usr/local/include is added to
+dnl the include-path).
+AC_DEFUN([CF_ADD_INCDIR],
+[
+if test -n "$1" ; then
+  for cf_add_incdir in $1
+  do
+	while test $cf_add_incdir != /usr/include
+	do
+	  if test -d $cf_add_incdir
+	  then
+		cf_have_incdir=no
+		if test -n "$CFLAGS$CPPFLAGS" ; then
+		  # a loop is needed to ensure we can add subdirs of existing dirs
+		  for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
+			if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
+			  cf_have_incdir=yes; break
+			fi
+		  done
+		fi
+
+		if test "$cf_have_incdir" = no ; then
+		  if test "$cf_add_incdir" = /usr/local/include ; then
+			if test "$GCC" = yes
+			then
+			  cf_save_CPPFLAGS=$CPPFLAGS
+			  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
+			  AC_TRY_COMPILE([#include <stdio.h>],
+				  [printf("Hello")],
+				  [],
+				  [cf_have_incdir=yes])
+			  CPPFLAGS=$cf_save_CPPFLAGS
+			fi
+		  fi
+		fi
+
+		if test "$cf_have_incdir" = no ; then
+		  CF_VERBOSE(adding $cf_add_incdir to include-path)
+		  ifelse([$2],,CPPFLAGS,[$2])="$ifelse([$2],,CPPFLAGS,[$2]) -I$cf_add_incdir"
+
+		  cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
+		  test "$cf_top_incdir" = "$cf_add_incdir" && break
+		  cf_add_incdir="$cf_top_incdir"
+		else
+		  break
+		fi
+	  fi
+	done
+  done
+fi
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_ADD_LIB version: 2 updated: 2010/06/02 05:03:05
+dnl ----------
+dnl Add a library, used to enforce consistency.
+dnl
+dnl $1 = library to add, without the "-l"
+dnl $2 = variable to update (default $LIBS)
+AC_DEFUN([CF_ADD_LIB],[CF_ADD_LIBS(-l$1,ifelse($2,,LIBS,[$2]))])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_ADD_LIBDIR version: 9 updated: 2010/05/26 16:44:57
+dnl -------------
+dnl	Adds to the library-path
+dnl
+dnl	Some machines have trouble with multiple -L options.
+dnl
+dnl $1 is the (list of) directory(s) to add
+dnl $2 is the optional name of the variable to update (default LDFLAGS)
+dnl
+AC_DEFUN([CF_ADD_LIBDIR],
+[
+if test -n "$1" ; then
+  for cf_add_libdir in $1
+  do
+    if test $cf_add_libdir = /usr/lib ; then
+      :
+    elif test -d $cf_add_libdir
+    then
+      cf_have_libdir=no
+      if test -n "$LDFLAGS$LIBS" ; then
+        # a loop is needed to ensure we can add subdirs of existing dirs
+        for cf_test_libdir in $LDFLAGS $LIBS ; do
+          if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
+            cf_have_libdir=yes; break
+          fi
+        done
+      fi
+      if test "$cf_have_libdir" = no ; then
+        CF_VERBOSE(adding $cf_add_libdir to library-path)
+        ifelse([$2],,LDFLAGS,[$2])="-L$cf_add_libdir $ifelse([$2],,LDFLAGS,[$2])"
+      fi
+    fi
+  done
+fi
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_ADD_LIBS version: 1 updated: 2010/06/02 05:03:05
+dnl -----------
+dnl Add one or more libraries, used to enforce consistency.
+dnl
+dnl $1 = libraries to add, with the "-l", etc.
+dnl $2 = variable to update (default $LIBS)
+AC_DEFUN([CF_ADD_LIBS],[ifelse($2,,LIBS,[$2])="$1 [$]ifelse($2,,LIBS,[$2])"])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_ADD_SUBDIR_PATH version: 3 updated: 2010/07/03 20:58:12
+dnl ------------------
+dnl Append to a search-list for a nonstandard header/lib-file
+dnl	$1 = the variable to return as result
+dnl	$2 = the package name
+dnl	$3 = the subdirectory, e.g., bin, include or lib
+dnl $4 = the directory under which we will test for subdirectories
+dnl $5 = a directory that we do not want $4 to match
+AC_DEFUN([CF_ADD_SUBDIR_PATH],
+[
+test "$4" != "$5" && \
+test -d "$4" && \
+ifelse([$5],NONE,,[(test $5 = NONE || test "$4" != "$5") &&]) {
+	test -n "$verbose" && echo "	... testing for $3-directories under $4"
+	test -d $4/$3 &&          $1="[$]$1 $4/$3"
+	test -d $4/$3/$2 &&       $1="[$]$1 $4/$3/$2"
+	test -d $4/$3/$2/$3 &&    $1="[$]$1 $4/$3/$2/$3"
+	test -d $4/$2/$3 &&       $1="[$]$1 $4/$2/$3"
+	test -d $4/$2/$3/$2 &&    $1="[$]$1 $4/$2/$3/$2"
+}
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_ANSI_CC_CHECK version: 10 updated: 2010/10/23 15:52:32
+dnl ----------------
+dnl This is adapted from the macros 'fp_PROG_CC_STDC' and 'fp_C_PROTOTYPES'
+dnl in the sharutils 4.2 distribution.
+AC_DEFUN([CF_ANSI_CC_CHECK],
+[
+AC_CACHE_CHECK(for ${CC:-cc} option to accept ANSI C, cf_cv_ansi_cc,[
+cf_cv_ansi_cc=no
+cf_save_CFLAGS="$CFLAGS"
+cf_save_CPPFLAGS="$CPPFLAGS"
+# Don't try gcc -ansi; that turns off useful extensions and
+# breaks some systems' header files.
+# AIX			-qlanglvl=ansi
+# Ultrix and OSF/1	-std1
+# HP-UX			-Aa -D_HPUX_SOURCE
+# SVR4			-Xc
+# UnixWare 1.2		(cannot use -Xc, since ANSI/POSIX clashes)
+for cf_arg in "-DCC_HAS_PROTOS" \
+	"" \
+	-qlanglvl=ansi \
+	-std1 \
+	-Ae \
+	"-Aa -D_HPUX_SOURCE" \
+	-Xc
+do
+	CF_ADD_CFLAGS($cf_arg)
+	AC_TRY_COMPILE(
+[
+#ifndef CC_HAS_PROTOS
+#if !defined(__STDC__) || (__STDC__ != 1)
+choke me
+#endif
+#endif
+],[
+	int test (int i, double x);
+	struct s1 {int (*f) (int a);};
+	struct s2 {int (*f) (double a);};],
+	[cf_cv_ansi_cc="$cf_arg"; break])
+done
+CFLAGS="$cf_save_CFLAGS"
+CPPFLAGS="$cf_save_CPPFLAGS"
+])
+
+if test "$cf_cv_ansi_cc" != "no"; then
+if test ".$cf_cv_ansi_cc" != ".-DCC_HAS_PROTOS"; then
+	CF_ADD_CFLAGS($cf_cv_ansi_cc)
+else
+	AC_DEFINE(CC_HAS_PROTOS)
+fi
+fi
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_ANSI_CC_REQD version: 4 updated: 2008/03/23 14:48:54
+dnl ---------------
+dnl For programs that must use an ANSI compiler, obtain compiler options that
+dnl will make it recognize prototypes.  We'll do preprocessor checks in other
+dnl macros, since tools such as unproto can fake prototypes, but only part of
+dnl the preprocessor.
+AC_DEFUN([CF_ANSI_CC_REQD],
+[AC_REQUIRE([CF_ANSI_CC_CHECK])
+if test "$cf_cv_ansi_cc" = "no"; then
+	AC_MSG_ERROR(
+[Your compiler does not appear to recognize prototypes.
+You have the following choices:
+	a. adjust your compiler options
+	b. get an up-to-date compiler
+	c. use a wrapper such as unproto])
+fi
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_AR_FLAGS version: 5 updated: 2010/05/20 20:24:29
+dnl -----------
+dnl Check for suitable "ar" (archiver) options for updating an archive.
+AC_DEFUN([CF_AR_FLAGS],[
+AC_REQUIRE([CF_PROG_AR])
+
+AC_CACHE_CHECK(for options to update archives, cf_cv_ar_flags,[
+	cf_cv_ar_flags=unknown
+	for cf_ar_flags in -curv curv -crv crv -cqv cqv -rv rv
+	do
+
+		# check if $ARFLAGS already contains this choice
+		if test "x$ARFLAGS" != "x" ; then
+			cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"`
+			if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then
+				cf_cv_ar_flags=
+				break
+			fi
+		fi
+
+		rm -f conftest.$ac_cv_objext
+		rm -f conftest.a
+
+		cat >conftest.$ac_ext <<EOF
+#line __oline__ "configure"
+int	testdata[[3]] = { 123, 456, 789 };
+EOF
+		if AC_TRY_EVAL(ac_compile) ; then
+			echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&AC_FD_CC
+			$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext 2>&AC_FD_CC 1>/dev/null
+			if test -f conftest.a ; then
+				cf_cv_ar_flags=$cf_ar_flags
+				break
+			fi
+		else
+			CF_VERBOSE(cannot compile test-program)
+			break
+		fi
+	done
+	rm -f conftest.a conftest.$ac_ext conftest.$ac_cv_objext
+])
+
+if test -n "$ARFLAGS" ; then
+	if test -n "$cf_cv_ar_flags" ; then
+		ARFLAGS="$ARFLAGS $cf_cv_ar_flags"
+	fi
+else
+	ARFLAGS=$cf_cv_ar_flags
+fi
+
+AC_SUBST(ARFLAGS)
+])
+dnl ---------------------------------------------------------------------------
+dnl CF_BUILD_CC version: 6 updated: 2006/10/14 15:23:15
+dnl -----------
+dnl If we're cross-compiling, allow the user to override the tools and their
+dnl options.  The configure script is oriented toward identifying the host
+dnl compiler, etc., but we need a build compiler to generate parts of the
+dnl source.
+dnl
+dnl $1 = default for $CPPFLAGS
+dnl $2 = default for $LIBS
+AC_DEFUN([CF_BUILD_CC],[
+AC_REQUIRE([CF_PROG_EXT])
+if test "$cross_compiling" = yes ; then
+
+	# defaults that we might want to override
+	: ${BUILD_CFLAGS:=''}
+	: ${BUILD_CPPFLAGS:='ifelse([$1],,,[$1])'}
+	: ${BUILD_LDFLAGS:=''}
+	: ${BUILD_LIBS:='ifelse([$2],,,[$2])'}
+	: ${BUILD_EXEEXT:='$x'}
+	: ${BUILD_OBJEXT:='o'}
+
+	AC_ARG_WITH(build-cc,
+		[  --with-build-cc=XXX     the build C compiler ($BUILD_CC)],
+		[BUILD_CC="$withval"],
+		[AC_CHECK_PROGS(BUILD_CC, gcc cc cl)])
+	AC_MSG_CHECKING(for native build C compiler)
+	AC_MSG_RESULT($BUILD_CC)
+
+	AC_MSG_CHECKING(for native build C preprocessor)
+	AC_ARG_WITH(build-cpp,
+		[  --with-build-cpp=XXX    the build C preprocessor ($BUILD_CPP)],
+		[BUILD_CPP="$withval"],
+		[BUILD_CPP='${BUILD_CC} -E'])
+	AC_MSG_RESULT($BUILD_CPP)
+
+	AC_MSG_CHECKING(for native build C flags)
+	AC_ARG_WITH(build-cflags,
+		[  --with-build-cflags=XXX the build C compiler-flags ($BUILD_CFLAGS)],
+		[BUILD_CFLAGS="$withval"])
+	AC_MSG_RESULT($BUILD_CFLAGS)
+
+	AC_MSG_CHECKING(for native build C preprocessor-flags)
+	AC_ARG_WITH(build-cppflags,
+		[  --with-build-cppflags=XXX the build C preprocessor-flags ($BUILD_CPPFLAGS)],
+		[BUILD_CPPFLAGS="$withval"])
+	AC_MSG_RESULT($BUILD_CPPFLAGS)
+
+	AC_MSG_CHECKING(for native build linker-flags)
+	AC_ARG_WITH(build-ldflags,
+		[  --with-build-ldflags=XXX the build linker-flags ($BUILD_LDFLAGS)],
+		[BUILD_LDFLAGS="$withval"])
+	AC_MSG_RESULT($BUILD_LDFLAGS)
+
+	AC_MSG_CHECKING(for native build linker-libraries)
+	AC_ARG_WITH(build-libs,
+		[  --with-build-libs=XXX   the build libraries (${BUILD_LIBS})],
+		[BUILD_LIBS="$withval"])
+	AC_MSG_RESULT($BUILD_LIBS)
+
+	# this assumes we're on Unix.
+	BUILD_EXEEXT=
+	BUILD_OBJEXT=o
+
+	: ${BUILD_CC:='${CC}'}
+
+	if ( test "$BUILD_CC" = "$CC" || test "$BUILD_CC" = '${CC}' ) ; then
+		AC_MSG_ERROR([Cross-build requires two compilers.
+Use --with-build-cc to specify the native compiler.])
+	fi
+
+else
+	: ${BUILD_CC:='${CC}'}
+	: ${BUILD_CPP:='${CPP}'}
+	: ${BUILD_CFLAGS:='${CFLAGS}'}
+	: ${BUILD_CPPFLAGS:='${CPPFLAGS}'}
+	: ${BUILD_LDFLAGS:='${LDFLAGS}'}
+	: ${BUILD_LIBS:='${LIBS}'}
+	: ${BUILD_EXEEXT:='$x'}
+	: ${BUILD_OBJEXT:='o'}
+fi
+
+AC_SUBST(BUILD_CC)
+AC_SUBST(BUILD_CPP)
+AC_SUBST(BUILD_CFLAGS)
+AC_SUBST(BUILD_CPPFLAGS)
+AC_SUBST(BUILD_LDFLAGS)
+AC_SUBST(BUILD_LIBS)
+AC_SUBST(BUILD_EXEEXT)
+AC_SUBST(BUILD_OBJEXT)
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_CFG_DEFAULTS version: 7 updated: 2005/09/24 16:15:00
+dnl ---------------
+dnl Determine the default configuration into which we'll install ncurses.  This
+dnl can be overridden by the user's command-line options.  There's two items to
+dnl look for:
+dnl	1. the prefix (e.g., /usr)
+dnl	2. the header files (e.g., /usr/include/ncurses)
+dnl We'll look for a previous installation of ncurses and use the same defaults.
+dnl
+dnl We don't use AC_PREFIX_DEFAULT, because it gets evaluated too soon, and
+dnl we don't use AC_PREFIX_PROGRAM, because we cannot distinguish ncurses's
+dnl programs from a vendor's.
+AC_DEFUN([CF_CFG_DEFAULTS],
+[
+AC_MSG_CHECKING(for prefix)
+if test "x$prefix" = "xNONE" ; then
+	case "$cf_cv_system_name" in
+		# non-vendor systems don't have a conflict
+	openbsd*|freebsd*|linux*|cygwin*|k*bsd*-gnu)
+		prefix=/usr
+		;;
+	*)	prefix=$ac_default_prefix
+		;;
+	esac
+fi
+AC_MSG_RESULT($prefix)
+
+if test "x$prefix" = "xNONE" ; then
+AC_MSG_CHECKING(for default include-directory)
+test -n "$verbose" && echo 1>&AC_FD_MSG
+for cf_symbol in \
+	$includedir \
+	$includedir/ncurses \
+	$prefix/include \
+	$prefix/include/ncurses \
+	/usr/local/include \
+	/usr/local/include/ncurses \
+	/usr/include \
+	/usr/include/ncurses
+do
+	cf_dir=`eval echo $cf_symbol`
+	if test -f $cf_dir/curses.h ; then
+	if ( fgrep NCURSES_VERSION $cf_dir/curses.h 2>&1 >/dev/null ) ; then
+		includedir="$cf_symbol"
+		test -n "$verbose"  && echo $ac_n "	found " 1>&AC_FD_MSG
+		break
+	fi
+	fi
+	test -n "$verbose"  && echo "	tested $cf_dir" 1>&AC_FD_MSG
+done
+AC_MSG_RESULT($includedir)
+fi
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_CHECK_CACHE version: 11 updated: 2008/03/23 14:45:59
+dnl --------------
+dnl Check if we're accidentally using a cache from a different machine.
+dnl Derive the system name, as a check for reusing the autoconf cache.
+dnl
+dnl If we've packaged config.guess and config.sub, run that (since it does a
+dnl better job than uname).  Normally we'll use AC_CANONICAL_HOST, but allow
+dnl an extra parameter that we may override, e.g., for AC_CANONICAL_SYSTEM
+dnl which is useful in cross-compiles.
+dnl
+dnl Note: we would use $ac_config_sub, but that is one of the places where
+dnl autoconf 2.5x broke compatibility with autoconf 2.13
+AC_DEFUN([CF_CHECK_CACHE],
+[
+if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
+	ifelse([$1],,[AC_CANONICAL_HOST],[$1])
+	system_name="$host_os"
+else
+	system_name="`(uname -s -r) 2>/dev/null`"
+	if test -z "$system_name" ; then
+		system_name="`(hostname) 2>/dev/null`"
+	fi
+fi
+test -n "$system_name" && AC_DEFINE_UNQUOTED(SYSTEM_NAME,"$system_name")
+AC_CACHE_VAL(cf_cv_system_name,[cf_cv_system_name="$system_name"])
+
+test -z "$system_name" && system_name="$cf_cv_system_name"
+test -n "$cf_cv_system_name" && AC_MSG_RESULT(Configuring for $cf_cv_system_name)
+
+if test ".$system_name" != ".$cf_cv_system_name" ; then
+	AC_MSG_RESULT(Cached system name ($system_name) does not agree with actual ($cf_cv_system_name))
+	AC_MSG_ERROR("Please remove config.cache and try again.")
+fi
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_CURSES_HEADER version: 2 updated: 2010/04/28 06:02:16
+dnl ----------------
+dnl Find a "curses" header file, e.g,. "curses.h", or one of the more common
+dnl variations of ncurses' installs.
+dnl
+dnl $1 = ncurses when looking for ncurses, or is empty
+AC_DEFUN([CF_CURSES_HEADER],[
+AC_CACHE_CHECK(if we have identified curses headers,cf_cv_ncurses_header,[
+cf_cv_ncurses_header=none
+for cf_header in ifelse($1,,,[ \
+    $1/curses.h \
+	$1/ncurses.h]) \
+	curses.h \
+	ncurses.h ifelse($1,,[ncurses/curses.h ncurses/ncurses.h])
+do
+AC_TRY_COMPILE([#include <${cf_header}>],
+	[initscr(); tgoto("?", 0,0)],
+	[cf_cv_ncurses_header=$cf_header; break],[])
+done
+])
+
+if test "$cf_cv_ncurses_header" = none ; then
+	AC_MSG_ERROR(No curses header-files found)
+fi
+
+# cheat, to get the right #define's for HAVE_NCURSES_H, etc.
+AC_CHECK_HEADERS($cf_cv_ncurses_header)
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_DIRNAME version: 4 updated: 2002/12/21 19:25:52
+dnl ----------
+dnl "dirname" is not portable, so we fake it with a shell script.
+AC_DEFUN([CF_DIRNAME],[$1=`echo $2 | sed -e 's%/[[^/]]*$%%'`])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_FIND_LIBRARY version: 9 updated: 2008/03/23 14:48:54
+dnl ---------------
+dnl Look for a non-standard library, given parameters for AC_TRY_LINK.  We
+dnl prefer a standard location, and use -L options only if we do not find the
+dnl library in the standard library location(s).
+dnl	$1 = library name
+dnl	$2 = library class, usually the same as library name
+dnl	$3 = includes
+dnl	$4 = code fragment to compile/link
+dnl	$5 = corresponding function-name
+dnl	$6 = flag, nonnull if failure should not cause an error-exit
+dnl
+dnl Sets the variable "$cf_libdir" as a side-effect, so we can see if we had
+dnl to use a -L option.
+AC_DEFUN([CF_FIND_LIBRARY],
+[
+	eval 'cf_cv_have_lib_'$1'=no'
+	cf_libdir=""
+	AC_CHECK_FUNC($5,
+		eval 'cf_cv_have_lib_'$1'=yes',[
+		cf_save_LIBS="$LIBS"
+		AC_MSG_CHECKING(for $5 in -l$1)
+		LIBS="-l$1 $LIBS"
+		AC_TRY_LINK([$3],[$4],
+			[AC_MSG_RESULT(yes)
+			 eval 'cf_cv_have_lib_'$1'=yes'
+			],
+			[AC_MSG_RESULT(no)
+			CF_LIBRARY_PATH(cf_search,$2)
+			for cf_libdir in $cf_search
+			do
+				AC_MSG_CHECKING(for -l$1 in $cf_libdir)
+				LIBS="-L$cf_libdir -l$1 $cf_save_LIBS"
+				AC_TRY_LINK([$3],[$4],
+					[AC_MSG_RESULT(yes)
+			 		 eval 'cf_cv_have_lib_'$1'=yes'
+					 break],
+					[AC_MSG_RESULT(no)
+					 LIBS="$cf_save_LIBS"])
+			done
+			])
+		])
+eval 'cf_found_library=[$]cf_cv_have_lib_'$1
+ifelse($6,,[
+if test $cf_found_library = no ; then
+	AC_MSG_ERROR(Cannot link $1 library)
+fi
+])
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_FIND_LINKAGE version: 19 updated: 2010/05/29 16:31:02
+dnl ---------------
+dnl Find a library (specifically the linkage used in the code fragment),
+dnl searching for it if it is not already in the library path.
+dnl See also CF_ADD_SEARCHPATH.
+dnl
+dnl Parameters (4-on are optional):
+dnl     $1 = headers for library entrypoint
+dnl     $2 = code fragment for library entrypoint
+dnl     $3 = the library name without the "-l" option or ".so" suffix.
+dnl     $4 = action to perform if successful (default: update CPPFLAGS, etc)
+dnl     $5 = action to perform if not successful
+dnl     $6 = module name, if not the same as the library name
+dnl     $7 = extra libraries
+dnl
+dnl Sets these variables:
+dnl     $cf_cv_find_linkage_$3 - yes/no according to whether linkage is found
+dnl     $cf_cv_header_path_$3 - include-directory if needed
+dnl     $cf_cv_library_path_$3 - library-directory if needed
+dnl     $cf_cv_library_file_$3 - library-file if needed, e.g., -l$3
+AC_DEFUN([CF_FIND_LINKAGE],[
+
+# If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
+# will be set on completion of the AC_TRY_LINK below.
+cf_cv_header_path_$3=
+cf_cv_library_path_$3=
+
+CF_MSG_LOG([Starting [FIND_LINKAGE]($3,$6)])
+
+cf_save_LIBS="$LIBS"
+
+AC_TRY_LINK([$1],[$2],[
+	cf_cv_find_linkage_$3=yes
+	cf_cv_header_path_$3=/usr/include
+	cf_cv_library_path_$3=/usr/lib
+],[
+
+LIBS="-l$3 $7 $cf_save_LIBS"
+
+AC_TRY_LINK([$1],[$2],[
+	cf_cv_find_linkage_$3=yes
+	cf_cv_header_path_$3=/usr/include
+	cf_cv_library_path_$3=/usr/lib
+	cf_cv_library_file_$3="-l$3"
+],[
+	cf_cv_find_linkage_$3=no
+	LIBS="$cf_save_LIBS"
+
+    CF_VERBOSE(find linkage for $3 library)
+    CF_MSG_LOG([Searching for headers in [FIND_LINKAGE]($3,$6)])
+
+    cf_save_CPPFLAGS="$CPPFLAGS"
+    cf_test_CPPFLAGS="$CPPFLAGS"
+
+    CF_HEADER_PATH(cf_search,ifelse([$6],,[$3],[$6]))
+    for cf_cv_header_path_$3 in $cf_search
+    do
+      if test -d $cf_cv_header_path_$3 ; then
+        CF_VERBOSE(... testing $cf_cv_header_path_$3)
+        CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_$3"
+        AC_TRY_COMPILE([$1],[$2],[
+            CF_VERBOSE(... found $3 headers in $cf_cv_header_path_$3)
+            cf_cv_find_linkage_$3=maybe
+            cf_test_CPPFLAGS="$CPPFLAGS"
+            break],[
+            CPPFLAGS="$cf_save_CPPFLAGS"
+            ])
+      fi
+    done
+
+    if test "$cf_cv_find_linkage_$3" = maybe ; then
+
+      CF_MSG_LOG([Searching for $3 library in [FIND_LINKAGE]($3,$6)])
+
+      cf_save_LIBS="$LIBS"
+      cf_save_LDFLAGS="$LDFLAGS"
+
+      ifelse([$6],,,[
+        CPPFLAGS="$cf_test_CPPFLAGS"
+        LIBS="-l$3 $7 $cf_save_LIBS"
+        AC_TRY_LINK([$1],[$2],[
+            CF_VERBOSE(... found $3 library in system)
+            cf_cv_find_linkage_$3=yes])
+            CPPFLAGS="$cf_save_CPPFLAGS"
+            LIBS="$cf_save_LIBS"
+            ])
+
+      if test "$cf_cv_find_linkage_$3" != yes ; then
+        CF_LIBRARY_PATH(cf_search,$3)
+        for cf_cv_library_path_$3 in $cf_search
+        do
+          if test -d $cf_cv_library_path_$3 ; then
+            CF_VERBOSE(... testing $cf_cv_library_path_$3)
+            CPPFLAGS="$cf_test_CPPFLAGS"
+            LIBS="-l$3 $7 $cf_save_LIBS"
+            LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_$3"
+            AC_TRY_LINK([$1],[$2],[
+                CF_VERBOSE(... found $3 library in $cf_cv_library_path_$3)
+                cf_cv_find_linkage_$3=yes
+                cf_cv_library_file_$3="-l$3"
+                break],[
+                CPPFLAGS="$cf_save_CPPFLAGS"
+                LIBS="$cf_save_LIBS"
+                LDFLAGS="$cf_save_LDFLAGS"
+                ])
+          fi
+        done
+        CPPFLAGS="$cf_save_CPPFLAGS"
+        LDFLAGS="$cf_save_LDFLAGS"
+      fi
+
+    else
+      cf_cv_find_linkage_$3=no
+    fi
+    ],$7)
+])
+
+LIBS="$cf_save_LIBS"
+
+if test "$cf_cv_find_linkage_$3" = yes ; then
+ifelse([$4],,[
+	CF_ADD_INCDIR($cf_cv_header_path_$3)
+	CF_ADD_LIBDIR($cf_cv_library_path_$3)
+	CF_ADD_LIB($3)
+],[$4])
+else
+ifelse([$5],,AC_MSG_WARN(Cannot find $3 library),[$5])
+fi
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_GCC_ATTRIBUTES version: 14 updated: 2010/10/23 15:52:32
+dnl -----------------
+dnl Test for availability of useful gcc __attribute__ directives to quiet
+dnl compiler warnings.  Though useful, not all are supported -- and contrary
+dnl to documentation, unrecognized directives cause older compilers to barf.
+AC_DEFUN([CF_GCC_ATTRIBUTES],
+[
+if test "$GCC" = yes
+then
+cat > conftest.i <<EOF
+#ifndef GCC_PRINTF
+#define GCC_PRINTF 0
+#endif
+#ifndef GCC_SCANF
+#define GCC_SCANF 0
+#endif
+#ifndef GCC_NORETURN
+#define GCC_NORETURN /* nothing */
+#endif
+#ifndef GCC_UNUSED
+#define GCC_UNUSED /* nothing */
+#endif
+EOF
+if test "$GCC" = yes
+then
+	AC_CHECKING([for $CC __attribute__ directives])
+cat > conftest.$ac_ext <<EOF
+#line __oline__ "${as_me:-configure}"
+#include "confdefs.h"
+#include "conftest.h"
+#include "conftest.i"
+#if	GCC_PRINTF
+#define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
+#else
+#define GCC_PRINTFLIKE(fmt,var) /*nothing*/
+#endif
+#if	GCC_SCANF
+#define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
+#else
+#define GCC_SCANFLIKE(fmt,var)  /*nothing*/
+#endif
+extern void wow(char *,...) GCC_SCANFLIKE(1,2);
+extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
+extern void foo(void) GCC_NORETURN;
+int main(int argc GCC_UNUSED, char *argv[[]] GCC_UNUSED) { return 0; }
+EOF
+	cf_printf_attribute=no
+	cf_scanf_attribute=no
+	for cf_attribute in scanf printf unused noreturn
+	do
+		CF_UPPER(cf_ATTRIBUTE,$cf_attribute)
+		cf_directive="__attribute__(($cf_attribute))"
+		echo "checking for $CC $cf_directive" 1>&AC_FD_CC
+
+		case $cf_attribute in #(vi
+		printf) #(vi
+			cf_printf_attribute=yes
+			cat >conftest.h <<EOF
+#define GCC_$cf_ATTRIBUTE 1
+EOF
+			;;
+		scanf) #(vi
+			cf_scanf_attribute=yes
+			cat >conftest.h <<EOF
+#define GCC_$cf_ATTRIBUTE 1
+EOF
+			;;
+		*) #(vi
+			cat >conftest.h <<EOF
+#define GCC_$cf_ATTRIBUTE $cf_directive
+EOF
+			;;
+		esac
+
+		if AC_TRY_EVAL(ac_compile); then
+			test -n "$verbose" && AC_MSG_RESULT(... $cf_attribute)
+			cat conftest.h >>confdefs.h
+			case $cf_attribute in #(vi
+			printf) #(vi
+				if test "$cf_printf_attribute" = no ; then
+					cat >>confdefs.h <<EOF
+#define GCC_PRINTFLIKE(fmt,var) /* nothing */
+EOF
+				else
+					cat >>confdefs.h <<EOF
+#define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
+EOF
+				fi
+				;;
+			scanf) #(vi
+				if test "$cf_scanf_attribute" = no ; then
+					cat >>confdefs.h <<EOF
+#define GCC_SCANFLIKE(fmt,var) /* nothing */
+EOF
+				else
+					cat >>confdefs.h <<EOF
+#define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
+EOF
+				fi
+				;;
+			esac
+		fi
+	done
+else
+	fgrep define conftest.i >>confdefs.h
+fi
+rm -rf conftest*
+fi
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_GCC_VERSION version: 5 updated: 2010/04/24 11:02:31
+dnl --------------
+dnl Find version of gcc
+AC_DEFUN([CF_GCC_VERSION],[
+AC_REQUIRE([AC_PROG_CC])
+GCC_VERSION=none
+if test "$GCC" = yes ; then
+	AC_MSG_CHECKING(version of $CC)
+	GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[[^0-9.]]*//' -e 's/[[^0-9.]].*//'`"
+	test -z "$GCC_VERSION" && GCC_VERSION=unknown
+	AC_MSG_RESULT($GCC_VERSION)
+fi
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_GCC_WARNINGS version: 27 updated: 2010/10/23 15:52:32
+dnl ---------------
+dnl Check if the compiler supports useful warning options.  There's a few that
+dnl we don't use, simply because they're too noisy:
+dnl
+dnl	-Wconversion (useful in older versions of gcc, but not in gcc 2.7.x)
+dnl	-Wredundant-decls (system headers make this too noisy)
+dnl	-Wtraditional (combines too many unrelated messages, only a few useful)
+dnl	-Wwrite-strings (too noisy, but should review occasionally).  This
+dnl		is enabled for ncurses using "--enable-const".
+dnl	-pedantic
+dnl
+dnl Parameter:
+dnl	$1 is an optional list of gcc warning flags that a particular
+dnl		application might want to use, e.g., "no-unused" for
+dnl		-Wno-unused
+dnl Special:
+dnl	If $with_ext_const is "yes", add a check for -Wwrite-strings
+dnl
+AC_DEFUN([CF_GCC_WARNINGS],
+[
+AC_REQUIRE([CF_GCC_VERSION])
+CF_INTEL_COMPILER(GCC,INTEL_COMPILER,CFLAGS)
+
+cat > conftest.$ac_ext <<EOF
+#line __oline__ "${as_me:-configure}"
+int main(int argc, char *argv[[]]) { return (argv[[argc-1]] == 0) ; }
+EOF
+
+if test "$INTEL_COMPILER" = yes
+then
+# The "-wdXXX" options suppress warnings:
+# remark #1419: external declaration in primary source file
+# remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
+# remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
+# remark #193: zero used for undefined preprocessing identifier
+# remark #593: variable "curs_sb_left_arrow" was set but never used
+# remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
+# remark #869: parameter "tw" was never referenced
+# remark #981: operands are evaluated in unspecified order
+# warning #279: controlling expression is constant
+
+	AC_CHECKING([for $CC warning options])
+	cf_save_CFLAGS="$CFLAGS"
+	EXTRA_CFLAGS="-Wall"
+	for cf_opt in \
+		wd1419 \
+		wd1683 \
+		wd1684 \
+		wd193 \
+		wd593 \
+		wd279 \
+		wd810 \
+		wd869 \
+		wd981
+	do
+		CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
+		if AC_TRY_EVAL(ac_compile); then
+			test -n "$verbose" && AC_MSG_RESULT(... -$cf_opt)
+			EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
+		fi
+	done
+	CFLAGS="$cf_save_CFLAGS"
+
+elif test "$GCC" = yes
+then
+	AC_CHECKING([for $CC warning options])
+	cf_save_CFLAGS="$CFLAGS"
+	EXTRA_CFLAGS=
+	cf_warn_CONST=""
+	test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
+	for cf_opt in W Wall \
+		Wbad-function-cast \
+		Wcast-align \
+		Wcast-qual \
+		Winline \
+		Wmissing-declarations \
+		Wmissing-prototypes \
+		Wnested-externs \
+		Wpointer-arith \
+		Wshadow \
+		Wstrict-prototypes \
+		Wundef $cf_warn_CONST $1
+	do
+		CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
+		if AC_TRY_EVAL(ac_compile); then
+			test -n "$verbose" && AC_MSG_RESULT(... -$cf_opt)
+			case $cf_opt in #(vi
+			Wcast-qual) #(vi
+				CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
+				;;
+			Winline) #(vi
+				case $GCC_VERSION in
+				[[34]].*)
+					CF_VERBOSE(feature is broken in gcc $GCC_VERSION)
+					continue;;
+				esac
+				;;
+			esac
+			EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
+		fi
+	done
+	CFLAGS="$cf_save_CFLAGS"
+fi
+rm -rf conftest*
+
+AC_SUBST(EXTRA_CFLAGS)
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_GNAT_GENERICS version: 1 updated: 2010/11/13 14:15:18
+dnl ----------------
+AC_DEFUN([CF_GNAT_GENERICS],
+[
+AC_MSG_CHECKING(if GNAT supports generics)
+case $cf_gnat_version in #(vi
+3.[[1-9]]*|[[4-9]].*) #(vi
+	cf_gnat_generics=yes
+	;;
+*)
+	cf_gnat_generics=no
+	;;
+esac
+AC_MSG_RESULT($cf_gnat_generics)
+
+if test "$cf_gnat_generics" = yes
+then
+	cf_compile_generics=generics
+	cf_generic_objects="\${GENOBJS}"
+else
+	cf_compile_generics=
+	cf_generic_objects=
+fi
+
+AC_SUBST(cf_compile_generics)
+AC_SUBST(cf_generic_objects)
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_GNAT_PRAGMA_UNREF version: 1 updated: 2010/06/19 15:22:18
+dnl --------------------
+dnl Check if the gnat pragma "Unreferenced" works.
+AC_DEFUN([CF_GNAT_PRAGMA_UNREF],[
+AC_CACHE_CHECK(if GNAT pragma Unreferenced works,cf_cv_pragma_unreferenced,[
+CF_GNAT_TRY_LINK([procedure conftest;],
+[with Text_IO;
+with GNAT.OS_Lib;
+procedure conftest is
+   test : Integer;
+   pragma Unreferenced (test);
+begin
+   test := 1;
+   Text_IO.Put ("Hello World");
+   Text_IO.New_Line;
+   GNAT.OS_Lib.OS_Exit (0);
+end conftest;],
+	[cf_cv_pragma_unreferenced=yes],
+	[cf_cv_pragma_unreferenced=no])])
+
+# if the pragma is supported, use it (needed in the Trace code).
+if test $cf_cv_pragma_unreferenced = yes ; then
+	PRAGMA_UNREF=TRUE
+else
+	PRAGMA_UNREF=FALSE
+fi
+AC_SUBST(PRAGMA_UNREF)
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_GNAT_PROJECTS version: 1 updated: 2010/11/13 14:15:18
+dnl ----------------
+AC_DEFUN([CF_GNAT_PROJECTS],
+[
+AC_MSG_CHECKING(if GNAT supports project files)
+case $cf_gnat_version in #(vi
+3.[[0-9]]*) #(vi
+	cf_gnat_projects=no
+	;;
+*)
+	case $cf_cv_system_name in #(vi
+	cygwin*) #(vi
+		cf_gnat_projects=no
+		;;
+	*)
+		cf_gnat_projects=yes
+		;;
+	esac
+	;;
+esac
+AC_MSG_RESULT($cf_gnat_projects)
+
+if test "$cf_gnat_projects" = yes
+then
+	USE_OLD_MAKERULES="#"
+	USE_GNAT_PROJECTS=""
+else
+	USE_OLD_MAKERULES=""
+	USE_GNAT_PROJECTS="#"
+fi
+
+AC_SUBST(USE_OLD_MAKERULES)
+AC_SUBST(USE_GNAT_PROJECTS)
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_GNAT_TRY_LINK version: 2 updated: 2010/08/14 18:25:37
+dnl ----------------
+dnl Verify that a test program compiles/links with GNAT.
+dnl $cf_ada_make is set to the program that compiles/links
+dnl $ADAFLAGS may be set to the GNAT flags.
+dnl
+dnl $1 is the text of the spec
+dnl $2 is the text of the body
+dnl $3 is the shell command to execute if successful
+dnl $4 is the shell command to execute if not successful
+AC_DEFUN([CF_GNAT_TRY_LINK],
+[
+rm -rf conftest*
+cat >>conftest.ads <<CF_EOF
+$1
+CF_EOF
+cat >>conftest.adb <<CF_EOF
+$2
+CF_EOF
+if ( $cf_ada_make $ADAFLAGS conftest 1>&AC_FD_CC 2>&1 ) ; then
+ifelse($3,,      :,[      $3])
+ifelse($4,,,[else
+   $4])
+fi
+rm -rf conftest*
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_GNAT_TRY_RUN version: 4 updated: 2010/08/14 18:25:37
+dnl ---------------
+dnl Verify that a test program compiles and runs with GNAT
+dnl $cf_ada_make is set to the program that compiles/links
+dnl $ADAFLAGS may be set to the GNAT flags.
+dnl
+dnl $1 is the text of the spec
+dnl $2 is the text of the body
+dnl $3 is the shell command to execute if successful
+dnl $4 is the shell command to execute if not successful
+AC_DEFUN([CF_GNAT_TRY_RUN],
+[
+rm -rf conftest*
+cat >>conftest.ads <<CF_EOF
+$1
+CF_EOF
+cat >>conftest.adb <<CF_EOF
+$2
+CF_EOF
+if ( $cf_ada_make $ADAFLAGS conftest 1>&AC_FD_CC 2>&1 ) ; then
+   if ( ./conftest 1>&AC_FD_CC 2>&1 ) ; then
+ifelse($3,,      :,[      $3])
+ifelse($4,,,[   else
+      $4])
+   fi
+ifelse($4,,,[else
+   $4])
+fi
+rm -rf conftest*
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_GNAT_VERSION version: 16 updated: 2010/11/13 14:15:18
+dnl ---------------
+dnl Verify version of GNAT.
+AC_DEFUN([CF_GNAT_VERSION],
+[
+AC_MSG_CHECKING(for gnat version)
+cf_gnat_version=`${cf_ada_make:-gnatmake} -v 2>&1 | \
+	grep '[[0-9]].[[0-9]][[0-9]]*' |\
+    sed -e '2,$d' -e 's/[[^0-9 \.]]//g' -e 's/^[[ ]]*//' -e 's/ .*//'`
+AC_MSG_RESULT($cf_gnat_version)
+
+case $cf_gnat_version in #(vi
+3.1[[1-9]]*|3.[[2-9]]*|[[4-9]].*) #(vi
+	cf_cv_prog_gnat_correct=yes
+	;;
+*)
+	AC_MSG_WARN(Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding.)
+	cf_cv_prog_gnat_correct=no
+	;;
+esac
+
+CF_GNAT_GENERICS
+CF_GNAT_PROJECTS
+])
+dnl ---------------------------------------------------------------------------
+dnl CF_GNU_SOURCE version: 6 updated: 2005/07/09 13:23:07
+dnl -------------
+dnl Check if we must define _GNU_SOURCE to get a reasonable value for
+dnl _XOPEN_SOURCE, upon which many POSIX definitions depend.  This is a defect
+dnl (or misfeature) of glibc2, which breaks portability of many applications,
+dnl since it is interwoven with GNU extensions.
+dnl
+dnl Well, yes we could work around it...
+AC_DEFUN([CF_GNU_SOURCE],
+[
+AC_CACHE_CHECK(if we must define _GNU_SOURCE,cf_cv_gnu_source,[
+AC_TRY_COMPILE([#include <sys/types.h>],[
+#ifndef _XOPEN_SOURCE
+make an error
+#endif],
+	[cf_cv_gnu_source=no],
+	[cf_save="$CPPFLAGS"
+	 CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
+	 AC_TRY_COMPILE([#include <sys/types.h>],[
+#ifdef _XOPEN_SOURCE
+make an error
+#endif],
+	[cf_cv_gnu_source=no],
+	[cf_cv_gnu_source=yes])
+	CPPFLAGS="$cf_save"
+	])
+])
+test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_HEADER_PATH version: 12 updated: 2010/05/05 05:22:40
+dnl --------------
+dnl Construct a search-list of directories for a nonstandard header-file
+dnl
+dnl Parameters
+dnl	$1 = the variable to return as result
+dnl	$2 = the package name
+AC_DEFUN([CF_HEADER_PATH],
+[
+$1=
+
+# collect the current set of include-directories from compiler flags
+cf_header_path_list=""
+if test -n "${CFLAGS}${CPPFLAGS}" ; then
+	for cf_header_path in $CPPFLAGS $CFLAGS
+	do
+		case $cf_header_path in #(vi
+		-I*)
+			cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
+			CF_ADD_SUBDIR_PATH($1,$2,include,$cf_header_path,NONE)
+			cf_header_path_list="$cf_header_path_list [$]$1"
+			;;
+		esac
+	done
+fi
+
+# add the variations for the package we are looking for
+CF_SUBDIR_PATH($1,$2,include)
+
+test "$includedir" != NONE && \
+test "$includedir" != "/usr/include" && \
+test -d "$includedir" && {
+	test -d $includedir &&    $1="[$]$1 $includedir"
+	test -d $includedir/$2 && $1="[$]$1 $includedir/$2"
+}
+
+test "$oldincludedir" != NONE && \
+test "$oldincludedir" != "/usr/include" && \
+test -d "$oldincludedir" && {
+	test -d $oldincludedir    && $1="[$]$1 $oldincludedir"
+	test -d $oldincludedir/$2 && $1="[$]$1 $oldincludedir/$2"
+}
+
+$1="[$]$1 $cf_header_path_list"
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_HELP_MESSAGE version: 3 updated: 1998/01/14 10:56:23
+dnl ---------------
+dnl Insert text into the help-message, for readability, from AC_ARG_WITH.
+AC_DEFUN([CF_HELP_MESSAGE],
+[AC_DIVERT_HELP([$1])dnl
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_INCLUDE_DIRS version: 6 updated: 2009/01/06 19:37:40
+dnl ---------------
+dnl Construct the list of include-options according to whether we're building
+dnl in the source directory or using '--srcdir=DIR' option.  If we're building
+dnl with gcc, don't append the includedir if it happens to be /usr/include,
+dnl since that usually breaks gcc's shadow-includes.
+AC_DEFUN([CF_INCLUDE_DIRS],
+[
+CPPFLAGS="$CPPFLAGS -I. -I../include"
+if test "$srcdir" != "."; then
+	CPPFLAGS="$CPPFLAGS -I\${srcdir}/../include"
+fi
+if test "$GCC" != yes; then
+	CPPFLAGS="$CPPFLAGS -I\${includedir}"
+elif test "$includedir" != "/usr/include"; then
+	if test "$includedir" = '${prefix}/include' ; then
+		if test $prefix != /usr ; then
+			CPPFLAGS="$CPPFLAGS -I\${includedir}"
+		fi
+	else
+		CPPFLAGS="$CPPFLAGS -I\${includedir}"
+	fi
+fi
+AC_SUBST(CPPFLAGS)
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_INTEL_COMPILER version: 4 updated: 2010/05/26 05:38:42
+dnl -----------------
+dnl Check if the given compiler is really the Intel compiler for Linux.  It
+dnl tries to imitate gcc, but does not return an error when it finds a mismatch
+dnl between prototypes, e.g., as exercised by CF_MISSING_CHECK.
+dnl
+dnl This macro should be run "soon" after AC_PROG_CC or AC_PROG_CPLUSPLUS, to
+dnl ensure that it is not mistaken for gcc/g++.  It is normally invoked from
+dnl the wrappers for gcc and g++ warnings.
+dnl
+dnl $1 = GCC (default) or GXX
+dnl $2 = INTEL_COMPILER (default) or INTEL_CPLUSPLUS
+dnl $3 = CFLAGS (default) or CXXFLAGS
+AC_DEFUN([CF_INTEL_COMPILER],[
+ifelse([$2],,INTEL_COMPILER,[$2])=no
+
+if test "$ifelse([$1],,[$1],GCC)" = yes ; then
+	case $host_os in
+	linux*|gnu*)
+		AC_MSG_CHECKING(if this is really Intel ifelse([$1],GXX,C++,C) compiler)
+		cf_save_CFLAGS="$ifelse([$3],,CFLAGS,[$3])"
+		ifelse([$3],,CFLAGS,[$3])="$ifelse([$3],,CFLAGS,[$3]) -no-gcc"
+		AC_TRY_COMPILE([],[
+#ifdef __INTEL_COMPILER
+#else
+make an error
+#endif
+],[ifelse([$2],,INTEL_COMPILER,[$2])=yes
+cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc"
+],[])
+		ifelse([$3],,CFLAGS,[$3])="$cf_save_CFLAGS"
+		AC_MSG_RESULT($ifelse([$2],,INTEL_COMPILER,[$2]))
+		;;
+	esac
+fi
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_LARGEFILE version: 7 updated: 2007/06/02 11:58:50
+dnl ------------
+dnl Add checks for large file support.
+AC_DEFUN([CF_LARGEFILE],[
+ifdef([AC_FUNC_FSEEKO],[
+    AC_SYS_LARGEFILE
+    if test "$enable_largefile" != no ; then
+	AC_FUNC_FSEEKO
+
+	# Normally we would collect these definitions in the config.h,
+	# but (like _XOPEN_SOURCE), some environments rely on having these
+	# defined before any of the system headers are included.  Another
+	# case comes up with C++, e.g., on AIX the compiler compiles the
+	# header files by themselves before looking at the body files it is
+	# told to compile.  For ncurses, those header files do not include
+	# the config.h
+	test "$ac_cv_sys_large_files"      != no && CPPFLAGS="$CPPFLAGS -D_LARGE_FILES "
+	test "$ac_cv_sys_largefile_source" != no && CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE "
+	test "$ac_cv_sys_file_offset_bits" != no && CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits "
+
+	AC_CACHE_CHECK(whether to use struct dirent64, cf_cv_struct_dirent64,[
+		AC_TRY_COMPILE([
+#include <sys/types.h>
+#include <dirent.h>
+		],[
+		/* if transitional largefile support is setup, this is true */
+		extern struct dirent64 * readdir(DIR *);
+		struct dirent64 *x = readdir((DIR *)0);
+		struct dirent *y = readdir((DIR *)0);
+		int z = x - y;
+		],
+		[cf_cv_struct_dirent64=yes],
+		[cf_cv_struct_dirent64=no])
+	])
+	test "$cf_cv_struct_dirent64" = yes && AC_DEFINE(HAVE_STRUCT_DIRENT64)
+    fi
+])
+])
+dnl ---------------------------------------------------------------------------
+dnl CF_LD_RPATH_OPT version: 3 updated: 2010/06/02 05:03:05
+dnl ---------------
+dnl For the given system and compiler, find the compiler flags to pass to the
+dnl loader to use the "rpath" feature.
+AC_DEFUN([CF_LD_RPATH_OPT],
+[
+AC_REQUIRE([CF_CHECK_CACHE])
+
+LD_RPATH_OPT=
+AC_MSG_CHECKING(for an rpath option)
+case $cf_cv_system_name in #(vi
+irix*) #(vi
+	if test "$GCC" = yes; then
+		LD_RPATH_OPT="-Wl,-rpath,"
+	else
+		LD_RPATH_OPT="-rpath "
+	fi
+	;;
+linux*|gnu*|k*bsd*-gnu) #(vi
+	LD_RPATH_OPT="-Wl,-rpath,"
+	;;
+openbsd[[2-9]].*) #(vi
+	LD_RPATH_OPT="-Wl,-rpath,"
+	;;
+freebsd*) #(vi
+	LD_RPATH_OPT="-rpath "
+	;;
+netbsd*) #(vi
+	LD_RPATH_OPT="-Wl,-rpath,"
+	;;
+osf*|mls+*) #(vi
+	LD_RPATH_OPT="-rpath "
+	;;
+solaris2*) #(vi
+	LD_RPATH_OPT="-R"
+	;;
+*)
+	;;
+esac
+AC_MSG_RESULT($LD_RPATH_OPT)
+
+case "x$LD_RPATH_OPT" in #(vi
+x-R*)
+	AC_MSG_CHECKING(if we need a space after rpath option)
+	cf_save_LIBS="$LIBS"
+	CF_ADD_LIBS(${LD_RPATH_OPT}$libdir)
+	AC_TRY_LINK(, , cf_rpath_space=no, cf_rpath_space=yes)
+	LIBS="$cf_save_LIBS"
+	AC_MSG_RESULT($cf_rpath_space)
+	test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
+	;;
+esac
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_LIBRARY_PATH version: 9 updated: 2010/03/28 12:52:50
+dnl ---------------
+dnl Construct a search-list of directories for a nonstandard library-file
+dnl
+dnl Parameters
+dnl	$1 = the variable to return as result
+dnl	$2 = the package name
+AC_DEFUN([CF_LIBRARY_PATH],
+[
+$1=
+cf_library_path_list=""
+if test -n "${LDFLAGS}${LIBS}" ; then
+	for cf_library_path in $LDFLAGS $LIBS
+	do
+		case $cf_library_path in #(vi
+		-L*)
+			cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
+			CF_ADD_SUBDIR_PATH($1,$2,lib,$cf_library_path,NONE)
+			cf_library_path_list="$cf_library_path_list [$]$1"
+			;;
+		esac
+	done
+fi
+
+CF_SUBDIR_PATH($1,$2,lib)
+
+$1="$cf_library_path_list [$]$1"
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_LIB_PREFIX version: 8 updated: 2008/09/13 11:34:16
+dnl -------------
+dnl Compute the library-prefix for the given host system
+dnl $1 = variable to set
+AC_DEFUN([CF_LIB_PREFIX],
+[
+	case $cf_cv_system_name in #(vi
+	OS/2*|os2*) #(vi
+        LIB_PREFIX=''
+        ;;
+	*)	LIB_PREFIX='lib'
+        ;;
+	esac
+ifelse($1,,,[$1=$LIB_PREFIX])
+	AC_SUBST(LIB_PREFIX)
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_LIB_SONAME version: 5 updated: 2010/08/14 18:25:37
+dnl -------------
+dnl Find the and soname for the given shared library.  Set the cache variable
+dnl cf_cv_$3_soname to this, unless it is not found.  Then set the cache
+dnl variable to "unknown".
+dnl
+dnl $1 = headers
+dnl $2 = code
+dnl $3 = library name
+AC_DEFUN([CF_LIB_SONAME],
+[
+AC_CACHE_CHECK(for soname of $3 library,cf_cv_$3_soname,[
+
+cf_cv_$3_soname=unknown
+if test "$cross_compiling" != yes ; then
+cat >conftest.$ac_ext <<CF_EOF
+$1
+int main()
+{
+$2
+	${cf_cv_main_return:-return}(0);
+}
+CF_EOF
+cf_save_LIBS="$LIBS"
+	CF_ADD_LIB($3)
+	if AC_TRY_EVAL(ac_compile) ; then
+		if AC_TRY_EVAL(ac_link) ; then
+			cf_cv_$3_soname=`ldd conftest$ac_exeext 2>/dev/null | sed -e 's,^.*/,,' -e 's, .*$,,' | fgrep lib$3.`
+			test -z "$cf_cv_$3_soname" && cf_cv_$3_soname=unknown
+		fi
+	fi
+rm -rf conftest*
+LIBS="$cf_save_LIBS"
+fi
+])
+])
+dnl ---------------------------------------------------------------------------
+dnl CF_LIB_SUFFIX version: 16 updated: 2008/12/27 12:30:03
+dnl -------------
+dnl Compute the library file-suffix from the given model name
+dnl $1 = model name
+dnl $2 = variable to set (the nominal library suffix)
+dnl $3 = dependency variable to set (actual filename)
+dnl The variable $LIB_SUFFIX, if set, prepends the variable to set.
+AC_DEFUN([CF_LIB_SUFFIX],
+[
+	AC_REQUIRE([CF_SUBST_NCURSES_VERSION])
+	case $1 in #(vi
+	libtool) #(vi
+		$2='.la'
+		$3=[$]$2
+		;;
+	normal) #(vi
+		$2='.a'
+		$3=[$]$2
+		;;
+	debug) #(vi
+		$2='_g.a'
+		$3=[$]$2
+		;;
+	profile) #(vi
+		$2='_p.a'
+		$3=[$]$2
+		;;
+	shared) #(vi
+		case $cf_cv_system_name in
+		aix[[56]]*) #(vi
+			$2='.a'
+			$3=[$]$2
+			;;
+		cygwin*) #(vi
+			$2='.dll'
+			$3='.dll.a'
+			;;
+		darwin*) #(vi
+			$2='.dylib'
+			$3=[$]$2
+			;;
+		hpux*) #(vi
+			case $target in
+			ia64*) #(vi
+				$2='.so'
+				$3=[$]$2
+				;;
+			*) #(vi
+				$2='.sl'
+				$3=[$]$2
+				;;
+			esac
+			;;
+		*)	$2='.so'
+			$3=[$]$2
+			;;
+		esac
+	esac
+	test -n "$LIB_SUFFIX" && $2="${LIB_SUFFIX}[$]{$2}"
+	test -n "$LIB_SUFFIX" && $3="${LIB_SUFFIX}[$]{$3}"
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_LIB_TYPE version: 4 updated: 2000/10/20 22:57:49
+dnl -----------
+dnl Compute the string to append to -library from the given model name
+dnl $1 = model name
+dnl $2 = variable to set
+dnl The variable $LIB_SUFFIX, if set, prepends the variable to set.
+AC_DEFUN([CF_LIB_TYPE],
+[
+	case $1 in
+	libtool) $2=''   ;;
+	normal)  $2=''   ;;
+	debug)   $2='_g' ;;
+	profile) $2='_p' ;;
+	shared)  $2=''   ;;
+	esac
+	test -n "$LIB_SUFFIX" && $2="${LIB_SUFFIX}[$]{$2}"
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_LINK_DATAONLY version: 9 updated: 2009/01/01 20:21:38
+dnl ----------------
+dnl Some systems have a non-ANSI linker that doesn't pull in modules that have
+dnl only data (i.e., no functions), for example NeXT.  On those systems we'll
+dnl have to provide wrappers for global tables to ensure they're linked
+dnl properly.
+AC_DEFUN([CF_LINK_DATAONLY],
+[
+AC_MSG_CHECKING([if data-only library module links])
+AC_CACHE_VAL(cf_cv_link_dataonly,[
+	rm -f conftest.a
+	cat >conftest.$ac_ext <<EOF
+#line __oline__ "configure"
+int	testdata[[3]] = { 123, 456, 789 };
+EOF
+	if AC_TRY_EVAL(ac_compile) ; then
+		mv conftest.o data.o && \
+		( $AR $ARFLAGS conftest.a data.o ) 2>&AC_FD_CC 1>/dev/null
+	fi
+	rm -f conftest.$ac_ext data.o
+	cat >conftest.$ac_ext <<EOF
+#line __oline__ "configure"
+int	testfunc()
+{
+#if defined(NeXT)
+	${cf_cv_main_return:-return}(1);	/* I'm told this linker is broken */
+#else
+	extern int testdata[[3]];
+	return testdata[[0]] == 123
+	   &&  testdata[[1]] == 456
+	   &&  testdata[[2]] == 789;
+#endif
+}
+EOF
+	if AC_TRY_EVAL(ac_compile); then
+		mv conftest.o func.o && \
+		( $AR $ARFLAGS conftest.a func.o ) 2>&AC_FD_CC 1>/dev/null
+	fi
+	rm -f conftest.$ac_ext func.o
+	( eval $RANLIB conftest.a ) 2>&AC_FD_CC >/dev/null
+	cf_saveLIBS="$LIBS"
+	LIBS="conftest.a $LIBS"
+	AC_TRY_RUN([
+	int main()
+	{
+		extern int testfunc();
+		${cf_cv_main_return:-return} (!testfunc());
+	}
+	],
+	[cf_cv_link_dataonly=yes],
+	[cf_cv_link_dataonly=no],
+	[cf_cv_link_dataonly=unknown])
+	LIBS="$cf_saveLIBS"
+	])
+AC_MSG_RESULT($cf_cv_link_dataonly)
+
+if test "$cf_cv_link_dataonly" = no ; then
+	AC_DEFINE(BROKEN_LINKER)
+	BROKEN_LINKER=1
+fi
+
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_LINK_FUNCS version: 7 updated: 2006/12/16 12:33:30
+dnl -------------
+dnl Most Unix systems have both link and symlink, a few don't have symlink.
+dnl A few non-Unix systems implement symlink, but not link.
+dnl A few non-systems implement neither (or have nonfunctional versions).
+AC_DEFUN([CF_LINK_FUNCS],
+[
+AC_CHECK_FUNCS( \
+	remove \
+	unlink )
+
+if test "$cross_compiling" = yes ; then
+	AC_CHECK_FUNCS( \
+		link \
+		symlink )
+else
+	AC_CACHE_CHECK(if link/symlink functions work,cf_cv_link_funcs,[
+		cf_cv_link_funcs=
+		for cf_func in link symlink ; do
+			AC_TRY_RUN([
+#include <sys/types.h>
+#include <sys/stat.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+int main()
+{
+	int fail = 0;
+	char *src = "config.log";
+	char *dst = "conftest.chk";
+	struct stat src_sb;
+	struct stat dst_sb;
+
+	stat(src, &src_sb);
+	fail = ($cf_func("config.log", "conftest.chk") < 0)
+	    || (stat(dst, &dst_sb) < 0)
+	    || (dst_sb.st_mtime != src_sb.st_mtime);
+#ifdef HAVE_UNLINK
+	unlink(dst);
+#else
+	remove(dst);
+#endif
+	${cf_cv_main_return:-return} (fail);
+}
+			],[
+			cf_cv_link_funcs="$cf_cv_link_funcs $cf_func"
+			eval 'ac_cv_func_'$cf_func'=yes'],[
+			eval 'ac_cv_func_'$cf_func'=no'],[
+			eval 'ac_cv_func_'$cf_func'=error'])
+		done
+		test -z "$cf_cv_link_funcs" && cf_cv_link_funcs=no
+	])
+	test "$ac_cv_func_link"    = yes && AC_DEFINE(HAVE_LINK)
+	test "$ac_cv_func_symlink" = yes && AC_DEFINE(HAVE_SYMLINK)
+fi
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_MAIN_RETURN version: 1 updated: 2006/12/10 09:51:54
+dnl --------------
+dnl Check if a return from main to the shell actually returns the same exit
+dnl code.  This is true for almost any POSIX environment.
+dnl
+dnl Some very old environments did not flush stdout, etc., on an exit.  That
+dnl would be a useful case to test for also.
+AC_DEFUN([CF_MAIN_RETURN],
+[
+cf_cv_main_return=return
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_MAKEFLAGS version: 13 updated: 2010/10/23 15:52:32
+dnl ------------
+dnl Some 'make' programs support ${MAKEFLAGS}, some ${MFLAGS}, to pass 'make'
+dnl options to lower-levels.  It's very useful for "make -n" -- if we have it.
+dnl (GNU 'make' does both, something POSIX 'make', which happens to make the
+dnl ${MAKEFLAGS} variable incompatible because it adds the assignments :-)
+AC_DEFUN([CF_MAKEFLAGS],
+[
+AC_CACHE_CHECK(for makeflags variable, cf_cv_makeflags,[
+	cf_cv_makeflags=''
+	for cf_option in '-${MAKEFLAGS}' '${MFLAGS}'
+	do
+		cat >cf_makeflags.tmp <<CF_EOF
+SHELL = /bin/sh
+all :
+	@ echo '.$cf_option'
+CF_EOF
+		cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp 2>/dev/null | sed -e 's,[[ 	]]*$,,'`
+		case "$cf_result" in
+		.*k)
+			cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null`
+			case "$cf_result" in
+			.*CC=*)	cf_cv_makeflags=
+				;;
+			*)	cf_cv_makeflags=$cf_option
+				;;
+			esac
+			break
+			;;
+		.-)	;;
+		*)	echo "given option \"$cf_option\", no match \"$cf_result\""
+			;;
+		esac
+	done
+	rm -f cf_makeflags.tmp
+])
+
+AC_SUBST(cf_cv_makeflags)
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_MAKE_TAGS version: 6 updated: 2010/10/23 15:52:32
+dnl ------------
+dnl Generate tags/TAGS targets for makefiles.  Do not generate TAGS if we have
+dnl a monocase filesystem.
+AC_DEFUN([CF_MAKE_TAGS],[
+AC_REQUIRE([CF_MIXEDCASE_FILENAMES])
+
+AC_CHECK_PROGS(CTAGS, exctags ctags)
+AC_CHECK_PROGS(ETAGS, exetags etags)
+
+AC_CHECK_PROG(MAKE_LOWER_TAGS, ${CTAGS:-ctags}, yes, no)
+
+if test "$cf_cv_mixedcase" = yes ; then
+	AC_CHECK_PROG(MAKE_UPPER_TAGS, ${ETAGS:-etags}, yes, no)
+else
+	MAKE_UPPER_TAGS=no
+fi
+
+if test "$MAKE_UPPER_TAGS" = yes ; then
+	MAKE_UPPER_TAGS=
+else
+	MAKE_UPPER_TAGS="#"
+fi
+
+if test "$MAKE_LOWER_TAGS" = yes ; then
+	MAKE_LOWER_TAGS=
+else
+	MAKE_LOWER_TAGS="#"
+fi
+
+AC_SUBST(CTAGS)
+AC_SUBST(ETAGS)
+
+AC_SUBST(MAKE_UPPER_TAGS)
+AC_SUBST(MAKE_LOWER_TAGS)
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_MIXEDCASE_FILENAMES version: 3 updated: 2003/09/20 17:07:55
+dnl ----------------------
+dnl Check if the file-system supports mixed-case filenames.  If we're able to
+dnl create a lowercase name and see it as uppercase, it doesn't support that.
+AC_DEFUN([CF_MIXEDCASE_FILENAMES],
+[
+AC_CACHE_CHECK(if filesystem supports mixed-case filenames,cf_cv_mixedcase,[
+if test "$cross_compiling" = yes ; then
+	case $target_alias in #(vi
+	*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-mingw32*|*-uwin*) #(vi
+		cf_cv_mixedcase=no
+		;;
+	*)
+		cf_cv_mixedcase=yes
+		;;
+	esac
+else
+	rm -f conftest CONFTEST
+	echo test >conftest
+	if test -f CONFTEST ; then
+		cf_cv_mixedcase=no
+	else
+		cf_cv_mixedcase=yes
+	fi
+	rm -f conftest CONFTEST
+fi
+])
+test "$cf_cv_mixedcase" = yes && AC_DEFINE(MIXEDCASE_FILENAMES)
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_MKSTEMP version: 7 updated: 2010/08/14 18:25:37
+dnl ----------
+dnl Check for a working mkstemp.  This creates two files, checks that they are
+dnl successfully created and distinct (AmigaOS apparently fails on the last).
+AC_DEFUN([CF_MKSTEMP],[
+AC_CACHE_CHECK(for working mkstemp, cf_cv_func_mkstemp,[
+rm -rf conftest*
+AC_TRY_RUN([
+#include <sys/types.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <sys/stat.h>
+int main()
+{
+	char *tmpl = "conftestXXXXXX";
+	char name[2][80];
+	int n;
+	int result = 0;
+	int fd;
+	struct stat sb;
+
+	umask(077);
+	for (n = 0; n < 2; ++n) {
+		strcpy(name[n], tmpl);
+		if ((fd = mkstemp(name[n])) >= 0) {
+			if (!strcmp(name[n], tmpl)
+			 || stat(name[n], &sb) != 0
+			 || (sb.st_mode & S_IFMT) != S_IFREG
+			 || (sb.st_mode & 077) != 0) {
+				result = 1;
+			}
+			close(fd);
+		}
+	}
+	if (result == 0
+	 && !strcmp(name[0], name[1]))
+		result = 1;
+	${cf_cv_main_return:-return}(result);
+}
+],[cf_cv_func_mkstemp=yes
+],[cf_cv_func_mkstemp=no
+],[AC_CHECK_FUNC(mkstemp)
+])
+])
+if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then
+	AC_DEFINE(HAVE_MKSTEMP)
+fi
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_MSG_LOG version: 5 updated: 2010/10/23 15:52:32
+dnl ----------
+dnl Write a debug message to config.log, along with the line number in the
+dnl configure script.
+AC_DEFUN([CF_MSG_LOG],[
+echo "${as_me:-configure}:__oline__: testing $* ..." 1>&AC_FD_CC
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_NCURSES_ADDON version: 3 updated: 2010/10/23 15:54:49
+dnl ----------------
+dnl Configure an ncurses add-on, built outside the ncurses tree.
+AC_DEFUN([CF_NCURSES_ADDON],[
+
+AC_PROVIDE([CF_SUBST_NCURSES_VERSION])
+
+AC_MSG_CHECKING(if you want wide-character code)
+AC_ARG_ENABLE(widec,
+	[  --enable-widec          compile with wide-char/UTF-8 code],
+	[with_widec=$enableval],
+	[with_widec=no])
+AC_MSG_RESULT($with_widec)
+if test "$with_widec" = yes ; then
+	CF_UTF8_LIB 
+	CF_NCURSES_CONFIG(ncursesw)
+else
+	CF_NCURSES_CONFIG(ncurses)
+fi
+
+if test "$NCURSES_CONFIG" != none ; then
+
+cf_version=`$NCURSES_CONFIG --version`
+
+NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
+NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[[0-9]]\+\.//' -e 's/\..*//'`
+NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[[0-9]]\+\.[[0-9]]\+\.//'`
+
+# ABI version is not available from headers
+cf_cv_abi_version=`$NCURSES_CONFIG --abi-version`
+
+else
+
+for cf_name in MAJOR MINOR PATCH
+do
+cat >conftest.$ac_ext <<CF_EOF
+#include <${cf_cv_ncurses_header:-curses.h}>
+AUTOCONF_$cf_name NCURSES_VERSION_$cf_name
+CF_EOF
+	cf_try="$ac_cpp conftest.$ac_ext 2>&5 | fgrep AUTOCONF_$cf_name >conftest.out"
+	AC_TRY_EVAL(cf_try)
+	if test -f conftest.out ; then
+		cf_result=`cat conftest.out | sed -e "s/^.*AUTOCONF_$cf_name[[ 	]]\+//"`
+		eval NCURSES_$cf_name=$cf_result
+		cat conftest.$ac_ext
+		cat conftest.out
+	fi
+done
+
+cf_cv_abi_version=${NCURSES_MAJOR}
+
+fi
+
+cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR}
+
+dnl Show the computed version, for logging
+cf_cv_timestamp=`date`
+
+AC_MSG_RESULT(Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp))
+
+dnl We need these values in the generated headers
+AC_SUBST(NCURSES_MAJOR)
+AC_SUBST(NCURSES_MINOR)
+AC_SUBST(NCURSES_PATCH)
+
+dnl We need these values in the generated makefiles
+AC_SUBST(cf_cv_rel_version)
+AC_SUBST(cf_cv_abi_version)
+
+dnl FIXME - not needed for Ada95
+AC_SUBST(cf_cv_builtin_bool)
+AC_SUBST(cf_cv_header_stdbool_h)
+AC_SUBST(cf_cv_type_of_bool)dnl
+
+])
+dnl ---------------------------------------------------------------------------
+dnl CF_NCURSES_CC_CHECK version: 4 updated: 2007/07/29 10:39:05
+dnl -------------------
+dnl Check if we can compile with ncurses' header file
+dnl $1 is the cache variable to set
+dnl $2 is the header-file to include
+dnl $3 is the root name (ncurses or ncursesw)
+AC_DEFUN([CF_NCURSES_CC_CHECK],[
+	AC_TRY_COMPILE([
+]ifelse($3,ncursesw,[
+#define _XOPEN_SOURCE_EXTENDED
+#undef  HAVE_LIBUTF8_H	/* in case we used CF_UTF8_LIB */
+#define HAVE_LIBUTF8_H	/* to force ncurses' header file to use cchar_t */
+])[
+#include <$2>],[
+#ifdef NCURSES_VERSION
+]ifelse($3,ncursesw,[
+#ifndef WACS_BSSB
+	make an error
+#endif
+])[
+printf("%s\n", NCURSES_VERSION);
+#else
+#ifdef __NCURSES_H
+printf("old\n");
+#else
+	make an error
+#endif
+#endif
+	]
+	,[$1=$2]
+	,[$1=no])
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_NCURSES_CONFIG version: 8 updated: 2010/07/08 05:17:30
+dnl -----------------
+dnl Tie together the configure-script macros for ncurses.
+dnl Prefer the "-config" script from ncurses 6.x, to simplify analysis.
+dnl Allow that to be overridden using the $NCURSES_CONFIG environment variable.
+dnl
+dnl $1 is the root library name (default: "ncurses")
+AC_DEFUN([CF_NCURSES_CONFIG],
+[
+cf_ncuconfig_root=ifelse($1,,ncurses,$1)
+
+echo "Looking for ${cf_ncuconfig_root}-config"
+AC_PATH_PROGS(NCURSES_CONFIG,${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config,none)
+
+if test "$NCURSES_CONFIG" != none ; then
+
+CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
+CF_ADD_LIBS(`$NCURSES_CONFIG --libs`)
+
+# even with config script, some packages use no-override for curses.h
+CF_CURSES_HEADER(ifelse($1,,ncurses,$1))
+
+dnl like CF_NCURSES_CPPFLAGS
+AC_DEFINE(NCURSES)
+
+dnl like CF_NCURSES_LIBS
+CF_UPPER(cf_nculib_ROOT,HAVE_LIB$cf_ncuconfig_root)
+AC_DEFINE_UNQUOTED($cf_nculib_ROOT)
+
+dnl like CF_NCURSES_VERSION
+cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
+
+else
+
+CF_NCURSES_CPPFLAGS(ifelse($1,,ncurses,$1))
+CF_NCURSES_LIBS(ifelse($1,,ncurses,$1))
+
+fi
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_NCURSES_CPPFLAGS version: 19 updated: 2007/07/29 13:35:20
+dnl -------------------
+dnl Look for the SVr4 curses clone 'ncurses' in the standard places, adjusting
+dnl the CPPFLAGS variable so we can include its header.
+dnl
+dnl The header files may be installed as either curses.h, or ncurses.h (would
+dnl be obsolete, except that some packagers prefer this name to distinguish it
+dnl from a "native" curses implementation).  If not installed for overwrite,
+dnl the curses.h file would be in an ncurses subdirectory (e.g.,
+dnl /usr/include/ncurses), but someone may have installed overwriting the
+dnl vendor's curses.  Only very old versions (pre-1.9.2d, the first autoconf'd
+dnl version) of ncurses don't define either __NCURSES_H or NCURSES_VERSION in
+dnl the header.
+dnl
+dnl If the installer has set $CFLAGS or $CPPFLAGS so that the ncurses header
+dnl is already in the include-path, don't even bother with this, since we cannot
+dnl easily determine which file it is.  In this case, it has to be <curses.h>.
+dnl
+dnl The optional parameter gives the root name of the library, in case it is
+dnl not installed as the default curses library.  That is how the
+dnl wide-character version of ncurses is installed.
+AC_DEFUN([CF_NCURSES_CPPFLAGS],
+[AC_REQUIRE([CF_WITH_CURSES_DIR])
+
+AC_PROVIDE([CF_CURSES_CPPFLAGS])dnl
+cf_ncuhdr_root=ifelse($1,,ncurses,$1)
+
+test -n "$cf_cv_curses_dir" && \
+test "$cf_cv_curses_dir" != "no" && { \
+  CF_ADD_INCDIR($cf_cv_curses_dir/include $cf_cv_curses_dir/include/$cf_ncuhdr_root)
+}
+
+AC_CACHE_CHECK(for $cf_ncuhdr_root header in include-path, cf_cv_ncurses_h,[
+	cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
+	( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
+	for cf_header in $cf_header_list
+	do
+		CF_NCURSES_CC_CHECK(cf_cv_ncurses_h,$cf_header,$1)
+		test "$cf_cv_ncurses_h" != no && break
+	done
+])
+
+CF_NCURSES_HEADER
+CF_TERM_HEADER
+
+# some applications need this, but should check for NCURSES_VERSION
+AC_DEFINE(NCURSES)
+
+CF_NCURSES_VERSION
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_NCURSES_HEADER version: 2 updated: 2008/03/23 14:48:54
+dnl -----------------
+dnl Find a "curses" header file, e.g,. "curses.h", or one of the more common
+dnl variations of ncurses' installs.
+dnl
+dnl See also CF_CURSES_HEADER, which sets the same cache variable.
+AC_DEFUN([CF_NCURSES_HEADER],[
+
+if test "$cf_cv_ncurses_h" != no ; then
+	cf_cv_ncurses_header=$cf_cv_ncurses_h
+else
+
+AC_CACHE_CHECK(for $cf_ncuhdr_root include-path, cf_cv_ncurses_h2,[
+	test -n "$verbose" && echo
+	CF_HEADER_PATH(cf_search,$cf_ncuhdr_root)
+	test -n "$verbose" && echo search path $cf_search
+	cf_save2_CPPFLAGS="$CPPFLAGS"
+	for cf_incdir in $cf_search
+	do
+		CF_ADD_INCDIR($cf_incdir)
+		for cf_header in \
+			ncurses.h \
+			curses.h
+		do
+			CF_NCURSES_CC_CHECK(cf_cv_ncurses_h2,$cf_header,$1)
+			if test "$cf_cv_ncurses_h2" != no ; then
+				cf_cv_ncurses_h2=$cf_incdir/$cf_header
+				test -n "$verbose" && echo $ac_n "	... found $ac_c" 1>&AC_FD_MSG
+				break
+			fi
+			test -n "$verbose" && echo "	... tested $cf_incdir/$cf_header" 1>&AC_FD_MSG
+		done
+		CPPFLAGS="$cf_save2_CPPFLAGS"
+		test "$cf_cv_ncurses_h2" != no && break
+	done
+	test "$cf_cv_ncurses_h2" = no && AC_MSG_ERROR(not found)
+	])
+
+	CF_DIRNAME(cf_1st_incdir,$cf_cv_ncurses_h2)
+	cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
+	if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
+		cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
+	fi
+	CF_ADD_INCDIR($cf_1st_incdir)
+
+fi
+
+# Set definitions to allow ifdef'ing for ncurses.h
+
+case $cf_cv_ncurses_header in # (vi
+*ncurses.h)
+	AC_DEFINE(HAVE_NCURSES_H)
+	;;
+esac
+
+case $cf_cv_ncurses_header in # (vi
+ncurses/curses.h|ncurses/ncurses.h)
+	AC_DEFINE(HAVE_NCURSES_NCURSES_H)
+	;;
+ncursesw/curses.h|ncursesw/ncurses.h)
+	AC_DEFINE(HAVE_NCURSESW_NCURSES_H)
+	;;
+esac
+
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_NCURSES_LIBS version: 15 updated: 2010/10/23 15:54:49
+dnl ---------------
+dnl Look for the ncurses library.  This is a little complicated on Linux,
+dnl because it may be linked with the gpm (general purpose mouse) library.
+dnl Some distributions have gpm linked with (bsd) curses, which makes it
+dnl unusable with ncurses.  However, we don't want to link with gpm unless
+dnl ncurses has a dependency, since gpm is normally set up as a shared library,
+dnl and the linker will record a dependency.
+dnl
+dnl The optional parameter gives the root name of the library, in case it is
+dnl not installed as the default curses library.  That is how the
+dnl wide-character version of ncurses is installed.
+AC_DEFUN([CF_NCURSES_LIBS],
+[AC_REQUIRE([CF_NCURSES_CPPFLAGS])
+
+cf_nculib_root=ifelse($1,,ncurses,$1)
+	# This works, except for the special case where we find gpm, but
+	# ncurses is in a nonstandard location via $LIBS, and we really want
+	# to link gpm.
+cf_ncurses_LIBS=""
+cf_ncurses_SAVE="$LIBS"
+AC_CHECK_LIB(gpm,Gpm_Open,
+	[AC_CHECK_LIB(gpm,initscr,
+		[LIBS="$cf_ncurses_SAVE"],
+		[cf_ncurses_LIBS="-lgpm"])])
+
+case $host_os in #(vi
+freebsd*)
+	# This is only necessary if you are linking against an obsolete
+	# version of ncurses (but it should do no harm, since it's static).
+	if test "$cf_nculib_root" = ncurses ; then
+		AC_CHECK_LIB(mytinfo,tgoto,[cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"])
+	fi
+	;;
+esac
+
+CF_ADD_LIBS($cf_ncurses_LIBS)
+
+if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
+then
+	CF_ADD_LIBDIR($cf_cv_curses_dir/lib)
+	CF_ADD_LIBS(-l$cf_nculib_root)
+else
+	CF_FIND_LIBRARY($cf_nculib_root,$cf_nculib_root,
+		[#include <${cf_cv_ncurses_header:-curses.h}>],
+		[initscr()],
+		initscr)
+fi
+
+if test -n "$cf_ncurses_LIBS" ; then
+	AC_MSG_CHECKING(if we can link $cf_nculib_root without $cf_ncurses_LIBS)
+	cf_ncurses_SAVE="$LIBS"
+	for p in $cf_ncurses_LIBS ; do
+		q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
+		if test "$q" != "$LIBS" ; then
+			LIBS="$q"
+		fi
+	done
+	AC_TRY_LINK([#include <${cf_cv_ncurses_header:-curses.h}>],
+		[initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);],
+		[AC_MSG_RESULT(yes)],
+		[AC_MSG_RESULT(no)
+		 LIBS="$cf_ncurses_SAVE"])
+fi
+
+CF_UPPER(cf_nculib_ROOT,HAVE_LIB$cf_nculib_root)
+AC_DEFINE_UNQUOTED($cf_nculib_ROOT)
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_NCURSES_VERSION version: 13 updated: 2010/10/23 15:54:49
+dnl ------------------
+dnl Check for the version of ncurses, to aid in reporting bugs, etc.
+dnl Call CF_CURSES_CPPFLAGS first, or CF_NCURSES_CPPFLAGS.  We don't use
+dnl AC_REQUIRE since that does not work with the shell's if/then/else/fi.
+AC_DEFUN([CF_NCURSES_VERSION],
+[
+AC_REQUIRE([CF_CURSES_CPPFLAGS])dnl
+AC_CACHE_CHECK(for ncurses version, cf_cv_ncurses_version,[
+	cf_cv_ncurses_version=no
+	cf_tempfile=out$$
+	rm -f $cf_tempfile
+	AC_TRY_RUN([
+#include <${cf_cv_ncurses_header:-curses.h}>
+#include <stdio.h>
+int main()
+{
+	FILE *fp = fopen("$cf_tempfile", "w");
+#ifdef NCURSES_VERSION
+# ifdef NCURSES_VERSION_PATCH
+	fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
+# else
+	fprintf(fp, "%s\n", NCURSES_VERSION);
+# endif
+#else
+# ifdef __NCURSES_H
+	fprintf(fp, "old\n");
+# else
+	make an error
+# endif
+#endif
+	${cf_cv_main_return:-return}(0);
+}],[
+	cf_cv_ncurses_version=`cat $cf_tempfile`],,[
+
+	# This will not work if the preprocessor splits the line after the
+	# Autoconf token.  The 'unproto' program does that.
+	cat > conftest.$ac_ext <<EOF
+#include <${cf_cv_ncurses_header:-curses.h}>
+#undef Autoconf
+#ifdef NCURSES_VERSION
+Autoconf NCURSES_VERSION
+#else
+#ifdef __NCURSES_H
+Autoconf "old"
+#endif
+;
+#endif
+EOF
+	cf_try="$ac_cpp conftest.$ac_ext 2>&AC_FD_CC | grep '^Autoconf ' >conftest.out"
+	AC_TRY_EVAL(cf_try)
+	if test -f conftest.out ; then
+		cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[[^"]]*"%%' -e 's%".*%%'`
+		test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
+		rm -f conftest.out
+	fi
+])
+	rm -f $cf_tempfile
+])
+test "$cf_cv_ncurses_version" = no || AC_DEFINE(NCURSES)
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_NO_LEAKS_OPTION version: 4 updated: 2006/12/16 14:24:05
+dnl ------------------
+dnl see CF_WITH_NO_LEAKS
+AC_DEFUN([CF_NO_LEAKS_OPTION],[
+AC_MSG_CHECKING(if you want to use $1 for testing)
+AC_ARG_WITH($1,
+	[$2],
+	[AC_DEFINE($3)ifelse([$4],,[
+	 $4
+])
+	: ${with_cflags:=-g}
+	: ${with_no_leaks:=yes}
+	 with_$1=yes],
+	[with_$1=])
+AC_MSG_RESULT(${with_$1:-no})
+
+case .$with_cflags in #(vi
+.*-g*)
+	case .$CFLAGS in #(vi
+	.*-g*) #(vi
+		;;
+	*)
+		CF_ADD_CFLAGS([-g])
+		;;
+	esac
+	;;
+esac
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_NUMBER_SYNTAX version: 1 updated: 2003/09/20 18:12:49
+dnl ----------------
+dnl Check if the given variable is a number.  If not, report an error.
+dnl $1 is the variable
+dnl $2 is the message
+AC_DEFUN([CF_NUMBER_SYNTAX],[
+if test -n "$1" ; then
+  case $1 in #(vi
+  [[0-9]]*) #(vi
+ 	;;
+  *)
+	AC_MSG_ERROR($2 is not a number: $1)
+ 	;;
+  esac
+else
+  AC_MSG_ERROR($2 value is empty)
+fi
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_OBJ_SUBDIR version: 4 updated: 2002/02/23 20:38:31
+dnl -------------
+dnl Compute the object-directory name from the given model name
+AC_DEFUN([CF_OBJ_SUBDIR],
+[
+	case $1 in
+	libtool) $2='obj_lo'  ;;
+	normal)  $2='objects' ;;
+	debug)   $2='obj_g' ;;
+	profile) $2='obj_p' ;;
+	shared)
+		case $cf_cv_system_name in #(vi
+		cygwin) #(vi
+			$2='objects' ;;
+		*)
+			$2='obj_s' ;;
+		esac
+	esac
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_PATHSEP version: 5 updated: 2010/05/26 05:38:42
+dnl ----------
+dnl Provide a value for the $PATH and similar separator
+AC_DEFUN([CF_PATHSEP],
+[
+	case $cf_cv_system_name in
+	os2*)	PATH_SEPARATOR=';'  ;;
+	*)	PATH_SEPARATOR=':'  ;;
+	esac
+ifelse([$1],,,[$1=$PATH_SEPARATOR])
+	AC_SUBST(PATH_SEPARATOR)
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_PATH_SYNTAX version: 13 updated: 2010/05/26 05:38:42
+dnl --------------
+dnl Check the argument to see that it looks like a pathname.  Rewrite it if it
+dnl begins with one of the prefix/exec_prefix variables, and then again if the
+dnl result begins with 'NONE'.  This is necessary to work around autoconf's
+dnl delayed evaluation of those symbols.
+AC_DEFUN([CF_PATH_SYNTAX],[
+if test "x$prefix" != xNONE; then
+  cf_path_syntax="$prefix"
+else
+  cf_path_syntax="$ac_default_prefix"
+fi
+
+case ".[$]$1" in #(vi
+.\[$]\(*\)*|.\'*\'*) #(vi
+  ;;
+..|./*|.\\*) #(vi
+  ;;
+.[[a-zA-Z]]:[[\\/]]*) #(vi OS/2 EMX
+  ;;
+.\[$]{*prefix}*) #(vi
+  eval $1="[$]$1"
+  case ".[$]$1" in #(vi
+  .NONE/*)
+    $1=`echo [$]$1 | sed -e s%NONE%$cf_path_syntax%`
+    ;;
+  esac
+  ;; #(vi
+.no|.NONE/*)
+  $1=`echo [$]$1 | sed -e s%NONE%$cf_path_syntax%`
+  ;;
+*)
+  ifelse([$2],,[AC_MSG_ERROR([expected a pathname, not \"[$]$1\"])],$2)
+  ;;
+esac
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_PKG_CONFIG version: 3 updated: 2009/01/25 10:55:09
+dnl -------------
+dnl Check for the package-config program, unless disabled by command-line.
+AC_DEFUN([CF_PKG_CONFIG],
+[
+AC_MSG_CHECKING(if you want to use pkg-config)
+AC_ARG_WITH(pkg-config,
+	[  --with-pkg-config{=path} enable/disable use of pkg-config],
+	[cf_pkg_config=$withval],
+	[cf_pkg_config=yes])
+AC_MSG_RESULT($cf_pkg_config)
+
+case $cf_pkg_config in #(vi
+no) #(vi
+	PKG_CONFIG=none
+	;;
+yes) #(vi
+	AC_PATH_PROG(PKG_CONFIG, pkg-config, none)
+	;;
+*)
+	PKG_CONFIG=$withval
+	;;
+esac
+
+test -z "$PKG_CONFIG" && PKG_CONFIG=none
+if test "$PKG_CONFIG" != none ; then
+	CF_PATH_SYNTAX(PKG_CONFIG)
+fi
+
+AC_SUBST(PKG_CONFIG)
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_POSIX_C_SOURCE version: 8 updated: 2010/05/26 05:38:42
+dnl -----------------
+dnl Define _POSIX_C_SOURCE to the given level, and _POSIX_SOURCE if needed.
+dnl
+dnl	POSIX.1-1990				_POSIX_SOURCE
+dnl	POSIX.1-1990 and			_POSIX_SOURCE and
+dnl		POSIX.2-1992 C-Language			_POSIX_C_SOURCE=2
+dnl		Bindings Option
+dnl	POSIX.1b-1993				_POSIX_C_SOURCE=199309L
+dnl	POSIX.1c-1996				_POSIX_C_SOURCE=199506L
+dnl	X/Open 2000				_POSIX_C_SOURCE=200112L
+dnl
+dnl Parameters:
+dnl	$1 is the nominal value for _POSIX_C_SOURCE
+AC_DEFUN([CF_POSIX_C_SOURCE],
+[
+cf_POSIX_C_SOURCE=ifelse([$1],,199506L,[$1])
+
+cf_save_CFLAGS="$CFLAGS"
+cf_save_CPPFLAGS="$CPPFLAGS"
+
+CF_REMOVE_DEFINE(cf_trim_CFLAGS,$cf_save_CFLAGS,_POSIX_C_SOURCE)
+CF_REMOVE_DEFINE(cf_trim_CPPFLAGS,$cf_save_CPPFLAGS,_POSIX_C_SOURCE)
+
+AC_CACHE_CHECK(if we should define _POSIX_C_SOURCE,cf_cv_posix_c_source,[
+	CF_MSG_LOG(if the symbol is already defined go no further)
+	AC_TRY_COMPILE([#include <sys/types.h>],[
+#ifndef _POSIX_C_SOURCE
+make an error
+#endif],
+	[cf_cv_posix_c_source=no],
+	[cf_want_posix_source=no
+	 case .$cf_POSIX_C_SOURCE in #(vi
+	 .[[12]]??*) #(vi
+		cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
+		;;
+	 .2) #(vi
+		cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
+		cf_want_posix_source=yes
+		;;
+	 .*)
+		cf_want_posix_source=yes
+		;;
+	 esac
+	 if test "$cf_want_posix_source" = yes ; then
+		AC_TRY_COMPILE([#include <sys/types.h>],[
+#ifdef _POSIX_SOURCE
+make an error
+#endif],[],
+		cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE")
+	 fi
+	 CF_MSG_LOG(ifdef from value $cf_POSIX_C_SOURCE)
+	 CFLAGS="$cf_trim_CFLAGS"
+	 CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
+	 CF_MSG_LOG(if the second compile does not leave our definition intact error)
+	 AC_TRY_COMPILE([#include <sys/types.h>],[
+#ifndef _POSIX_C_SOURCE
+make an error
+#endif],,
+	 [cf_cv_posix_c_source=no])
+	 CFLAGS="$cf_save_CFLAGS"
+	 CPPFLAGS="$cf_save_CPPFLAGS"
+	])
+])
+
+if test "$cf_cv_posix_c_source" != no ; then
+	CFLAGS="$cf_trim_CFLAGS"
+	CPPFLAGS="$cf_trim_CPPFLAGS"
+	CF_ADD_CFLAGS($cf_cv_posix_c_source)
+fi
+
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_PROG_AR version: 1 updated: 2009/01/01 20:15:22
+dnl ----------
+dnl Check for archiver "ar".
+AC_DEFUN([CF_PROG_AR],[
+AC_CHECK_TOOL(AR, ar, ar)
+])
+dnl ---------------------------------------------------------------------------
+dnl CF_PROG_AWK version: 1 updated: 2006/09/16 11:40:59
+dnl -----------
+dnl Check for awk, ensure that the check found something.
+AC_DEFUN([CF_PROG_AWK],
+[
+AC_PROG_AWK
+test -z "$AWK" && AC_MSG_ERROR(No awk program found)
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_PROG_CC_C_O version: 3 updated: 2010/08/14 18:25:37
+dnl --------------
+dnl Analogous to AC_PROG_CC_C_O, but more useful: tests only $CC, ensures that
+dnl the output file can be renamed, and allows for a shell variable that can
+dnl be used later.  The parameter is either CC or CXX.  The result is the
+dnl cache variable:
+dnl	$cf_cv_prog_CC_c_o
+dnl	$cf_cv_prog_CXX_c_o
+AC_DEFUN([CF_PROG_CC_C_O],
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_MSG_CHECKING([whether [$]$1 understands -c and -o together])
+AC_CACHE_VAL(cf_cv_prog_$1_c_o,
+[
+cat > conftest.$ac_ext <<CF_EOF
+#include <stdio.h>
+int main()
+{
+	${cf_cv_main_return:-return}(0);
+}
+CF_EOF
+# We do the test twice because some compilers refuse to overwrite an
+# existing .o file with -o, though they will create one.
+ac_try='[$]$1 -c conftest.$ac_ext -o conftest2.$ac_objext >&AC_FD_CC'
+if AC_TRY_EVAL(ac_try) &&
+  test -f conftest2.$ac_objext && AC_TRY_EVAL(ac_try);
+then
+  eval cf_cv_prog_$1_c_o=yes
+else
+  eval cf_cv_prog_$1_c_o=no
+fi
+rm -rf conftest*
+])dnl
+if test $cf_cv_prog_$1_c_o = yes; then
+  AC_MSG_RESULT([yes])
+else
+  AC_MSG_RESULT([no])
+fi
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_PROG_EGREP version: 1 updated: 2006/09/16 11:40:59
+dnl -------------
+dnl AC_PROG_EGREP was introduced in autoconf 2.53.
+dnl This macro adds a check to ensure the script found something.
+AC_DEFUN([CF_PROG_EGREP],
+[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep],
+   [if echo a | (grep -E '(a|b)') >/dev/null 2>&1
+    then ac_cv_prog_egrep='grep -E'
+    else ac_cv_prog_egrep='egrep'
+    fi])
+ EGREP=$ac_cv_prog_egrep
+ AC_SUBST([EGREP])
+test -z "$EGREP" && AC_MSG_ERROR(No egrep program found)
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_PROG_EXT version: 10 updated: 2004/01/03 19:28:18
+dnl -----------
+dnl Compute $PROG_EXT, used for non-Unix ports, such as OS/2 EMX.
+AC_DEFUN([CF_PROG_EXT],
+[
+AC_REQUIRE([CF_CHECK_CACHE])
+case $cf_cv_system_name in
+os2*)
+    CFLAGS="$CFLAGS -Zmt"
+    CPPFLAGS="$CPPFLAGS -D__ST_MT_ERRNO__"
+    CXXFLAGS="$CXXFLAGS -Zmt"
+    # autoconf's macro sets -Zexe and suffix both, which conflict:w
+    LDFLAGS="$LDFLAGS -Zmt -Zcrtdll"
+    ac_cv_exeext=.exe
+    ;;
+esac
+
+AC_EXEEXT
+AC_OBJEXT
+
+PROG_EXT="$EXEEXT"
+AC_SUBST(PROG_EXT)
+test -n "$PROG_EXT" && AC_DEFINE_UNQUOTED(PROG_EXT,"$PROG_EXT")
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_PROG_GNAT version: 1 updated: 2010/06/19 15:22:18
+dnl ------------
+dnl Check for gnatmake, ensure that it is complete.
+AC_DEFUN([CF_PROG_GNAT],[
+cf_ada_make=gnatmake
+AC_CHECK_PROG(gnat_exists, $cf_ada_make, yes, no)
+if test "$ac_cv_prog_gnat_exists" = no; then
+   cf_ada_make=
+else
+   CF_GNAT_VERSION
+   AC_CHECK_PROG(M4_exists, m4, yes, no)
+   if test "$ac_cv_prog_M4_exists" = no; then
+      cf_cv_prog_gnat_correct=no
+      echo Ada95 binding required program m4 not found. Ada95 binding disabled.
+   fi
+   if test "$cf_cv_prog_gnat_correct" = yes; then
+      AC_MSG_CHECKING(if GNAT works)
+      CF_GNAT_TRY_RUN([procedure conftest;],
+[with Text_IO;
+with GNAT.OS_Lib;
+procedure conftest is
+begin
+   Text_IO.Put ("Hello World");
+   Text_IO.New_Line;
+   GNAT.OS_Lib.OS_Exit (0);
+end conftest;],[cf_cv_prog_gnat_correct=yes],[cf_cv_prog_gnat_correct=no])
+      AC_MSG_RESULT($cf_cv_prog_gnat_correct)
+   fi
+fi
+
+AC_SUBST(cf_ada_make)
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_PROG_LN_S version: 2 updated: 2010/08/14 18:25:37
+dnl ------------
+dnl Combine checks for "ln -s" and "ln -sf", updating $LN_S to include "-f"
+dnl option if it is supported.
+AC_DEFUN([CF_PROG_LN_S],[
+AC_PROG_LN_S
+AC_MSG_CHECKING(if $LN_S -f options work)
+
+rm -f conf$$.src conf$$dst
+echo >conf$$.dst
+echo first >conf$$.src
+if $LN_S -f conf$$.src conf$$.dst 2>/dev/null; then
+	cf_prog_ln_sf=yes
+else
+	cf_prog_ln_sf=no
+fi
+rm -f conf$$.dst conf$$src
+AC_MSG_RESULT($cf_prog_ln_sf)
+
+test "$cf_prog_ln_sf" = yes && LN_S="$LN_S -f"
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_REMOVE_DEFINE version: 3 updated: 2010/01/09 11:05:50
+dnl ----------------
+dnl Remove all -U and -D options that refer to the given symbol from a list
+dnl of C compiler options.  This works around the problem that not all
+dnl compilers process -U and -D options from left-to-right, so a -U option
+dnl cannot be used to cancel the effect of a preceding -D option.
+dnl
+dnl $1 = target (which could be the same as the source variable)
+dnl $2 = source (including '$')
+dnl $3 = symbol to remove
+define([CF_REMOVE_DEFINE],
+[
+$1=`echo "$2" | \
+	sed	-e 's/-[[UD]]'"$3"'\(=[[^ 	]]*\)\?[[ 	]]/ /g' \
+		-e 's/-[[UD]]'"$3"'\(=[[^ 	]]*\)\?[$]//g'`
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_REMOVE_LIB version: 1 updated: 2007/02/17 14:11:52
+dnl -------------
+dnl Remove the given library from the symbol
+dnl
+dnl $1 = target (which could be the same as the source variable)
+dnl $2 = source (including '$')
+dnl $3 = library to remove
+define([CF_REMOVE_LIB],
+[
+# remove $3 library from $2
+$1=`echo "$2" | sed -e 's/-l$3[[ 	]]//g' -e 's/-l$3[$]//'`
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_SHARED_OPTS version: 64 updated: 2010/06/05 16:51:16
+dnl --------------
+dnl --------------
+dnl Attempt to determine the appropriate CC/LD options for creating a shared
+dnl library.
+dnl
+dnl Note: ${LOCAL_LDFLAGS} is used to link executables that will run within the
+dnl build-tree, i.e., by making use of the libraries that are compiled in ../lib
+dnl We avoid compiling-in a ../lib path for the shared library since that can
+dnl lead to unexpected results at runtime.
+dnl ${LOCAL_LDFLAGS2} has the same intention but assumes that the shared libraries
+dnl are compiled in ../../lib
+dnl
+dnl The variable 'cf_cv_do_symlinks' is used to control whether we configure
+dnl to install symbolic links to the rel/abi versions of shared libraries.
+dnl
+dnl The variable 'cf_cv_shlib_version' controls whether we use the rel or abi
+dnl version when making symbolic links.
+dnl
+dnl The variable 'cf_cv_shlib_version_infix' controls whether shared library
+dnl version numbers are infix (ex: libncurses.<ver>.dylib) or postfix
+dnl (ex: libncurses.so.<ver>).
+dnl
+dnl Some loaders leave 'so_locations' lying around.  It's nice to clean up.
+AC_DEFUN([CF_SHARED_OPTS],
+[
+	AC_REQUIRE([CF_SUBST_NCURSES_VERSION])
+	AC_REQUIRE([CF_LD_RPATH_OPT])
+	LOCAL_LDFLAGS=
+	LOCAL_LDFLAGS2=
+	LD_SHARED_OPTS=
+	INSTALL_LIB="-m 644"
+
+	cf_cv_do_symlinks=no
+	cf_ld_rpath_opt=
+	test "$cf_cv_enable_rpath" = yes && cf_ld_rpath_opt="$LD_RPATH_OPT"
+
+	AC_MSG_CHECKING(if release/abi version should be used for shared libs)
+	AC_ARG_WITH(shlib-version,
+	[  --with-shlib-version=X  Specify rel or abi version for shared libs],
+	[test -z "$withval" && withval=auto
+	case $withval in #(vi
+	yes) #(vi
+		cf_cv_shlib_version=auto
+		;;
+	rel|abi|auto|no) #(vi
+		cf_cv_shlib_version=$withval
+		;;
+	*)
+		AC_MSG_ERROR([option value must be one of: rel, abi, auto or no])
+		;;
+	esac
+	],[cf_cv_shlib_version=auto])
+	AC_MSG_RESULT($cf_cv_shlib_version)
+
+	cf_cv_rm_so_locs=no
+
+	# Some less-capable ports of gcc support only -fpic
+	CC_SHARED_OPTS=
+	if test "$GCC" = yes
+	then
+		AC_MSG_CHECKING(which $CC option to use)
+		cf_save_CFLAGS="$CFLAGS"
+		for CC_SHARED_OPTS in -fPIC -fpic ''
+		do
+			CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS"
+			AC_TRY_COMPILE([#include <stdio.h>],[int x = 1],[break],[])
+		done
+		AC_MSG_RESULT($CC_SHARED_OPTS)
+		CFLAGS="$cf_save_CFLAGS"
+	fi
+
+	cf_cv_shlib_version_infix=no
+
+	case $cf_cv_system_name in #(vi
+	aix[[56]]*) #(vi
+		if test "$GCC" = yes; then
+			CC_SHARED_OPTS=
+			MK_SHARED_LIB='$(CC) -shared'
+		fi
+		;;
+	beos*) #(vi
+		MK_SHARED_LIB='${CC} ${CFLAGS} -o $[@] -Xlinker -soname=`basename $[@]` -nostart -e 0'
+		;;
+	cygwin*) #(vi
+		CC_SHARED_OPTS=
+		MK_SHARED_LIB='sh ../mk_shared_lib.sh [$]@ [$]{CC} [$]{CFLAGS}'
+		cf_cv_shlib_version=cygdll
+		cf_cv_shlib_version_infix=cygdll
+		cat >mk_shared_lib.sh <<-CF_EOF
+		#!/bin/sh
+		SHARED_LIB=\[$]1
+		IMPORT_LIB=\`echo "\[$]1" | sed -e 's/cyg/lib/' -e 's/[[0-9]]*\.dll[$]/.dll.a/'\`
+		shift
+		cat <<-EOF
+		Linking shared library
+		** SHARED_LIB \[$]SHARED_LIB
+		** IMPORT_LIB \[$]IMPORT_LIB
+EOF
+		exec \[$]* -shared -Wl,--out-implib=../lib/\[$]{IMPORT_LIB} -Wl,--export-all-symbols -o ../lib/\[$]{SHARED_LIB}
+CF_EOF
+		chmod +x mk_shared_lib.sh
+		;;
+	darwin*) #(vi
+		EXTRA_CFLAGS="-no-cpp-precomp"
+		CC_SHARED_OPTS="-dynamic"
+		MK_SHARED_LIB='${CC} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $[@]` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $[@]'
+		test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi
+		cf_cv_shlib_version_infix=yes
+		AC_CACHE_CHECK([if ld -search_paths_first works], cf_cv_ldflags_search_paths_first, [
+			cf_save_LDFLAGS=$LDFLAGS
+			LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
+			AC_TRY_LINK(, [int i;], cf_cv_ldflags_search_paths_first=yes, cf_cv_ldflags_search_paths_first=no)
+				LDFLAGS=$cf_save_LDFLAGS])
+		if test $cf_cv_ldflags_search_paths_first = yes; then
+			LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
+		fi
+		;;
+	hpux*) #(vi
+		# (tested with gcc 2.7.2 -- I don't have c89)
+		if test "$GCC" = yes; then
+			LD_SHARED_OPTS='-Xlinker +b -Xlinker ${libdir}'
+		else
+			CC_SHARED_OPTS='+Z'
+			LD_SHARED_OPTS='-Wl,+b,${libdir}'
+		fi
+		MK_SHARED_LIB='${LD} +b ${libdir} -b -o $[@]'
+		# HP-UX shared libraries must be executable, and should be
+		# readonly to exploit a quirk in the memory manager.
+		INSTALL_LIB="-m 555"
+		;;
+	irix*) #(vi
+		if test "$cf_cv_enable_rpath" = yes ; then
+			EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS"
+		fi
+		# tested with IRIX 5.2 and 'cc'.
+		if test "$GCC" != yes; then
+			CC_SHARED_OPTS='-KPIC'
+			MK_SHARED_LIB='${CC} -shared -rdata_shared -soname `basename $[@]` -o $[@]'
+		else
+			MK_SHARED_LIB='${CC} -shared -Wl,-soname,`basename $[@]` -o $[@]'
+		fi
+		cf_cv_rm_so_locs=yes
+		;;
+	linux*|gnu*|k*bsd*-gnu) #(vi
+		if test "$DFT_LWR_MODEL" = "shared" ; then
+			LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
+			LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
+		fi
+		if test "$cf_cv_enable_rpath" = yes ; then
+			EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS"
+		fi
+		CF_SHARED_SONAME
+		MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $[@]'
+		;;
+	openbsd[[2-9]].*) #(vi
+		if test "$DFT_LWR_MODEL" = "shared" ; then
+			LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
+			LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
+		fi
+		if test "$cf_cv_enable_rpath" = yes ; then
+			EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS"
+		fi
+		CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
+		CF_SHARED_SONAME
+		MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $[@]'
+		;;
+	nto-qnx*|openbsd*|freebsd[[12]].*) #(vi
+		CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
+		MK_SHARED_LIB='${LD} -Bshareable -o $[@]'
+		test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
+		;;
+	freebsd*) #(vi
+		CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
+		if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
+			LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
+			LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${libdir} $LOCAL_LDFLAGS"
+			EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS"
+		fi
+		CF_SHARED_SONAME
+		MK_SHARED_LIB='${LD} -shared -Bshareable -soname=`basename $[@]` -o $[@]'
+		;;
+	netbsd*) #(vi
+		CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
+		if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
+			LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
+			LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
+			EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS"
+			if test "$cf_cv_shlib_version" = auto; then
+			if test -f /usr/libexec/ld.elf_so; then
+				cf_cv_shlib_version=abi
+			else
+				cf_cv_shlib_version=rel
+			fi
+			fi
+			CF_SHARED_SONAME
+			MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $[@]'
+		else
+			MK_SHARED_LIB='${LD} -shared -Bshareable -o $[@]'
+		fi
+		;;
+	osf*|mls+*) #(vi
+		# tested with OSF/1 V3.2 and 'cc'
+		# tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't
+		# link with shared libs).
+		MK_SHARED_LIB='${LD} -set_version ${REL_VERSION}:${ABI_VERSION} -expect_unresolved "*" -shared -soname `basename $[@]`'
+		case $host_os in #(vi
+		osf4*)
+			MK_SHARED_LIB="${MK_SHARED_LIB} -msym"
+			;;
+		esac
+		MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $[@]'
+		if test "$DFT_LWR_MODEL" = "shared" ; then
+			LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
+			LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
+		fi
+		cf_cv_rm_so_locs=yes
+		;;
+	sco3.2v5*)  # (also uw2* and UW7: hops 13-Apr-98
+		# tested with osr5.0.5
+		if test "$GCC" != yes; then
+			CC_SHARED_OPTS='-belf -KPIC'
+		fi
+		MK_SHARED_LIB='${LD} -dy -G -h `basename $[@] .${REL_VERSION}`.${ABI_VERSION} -o [$]@'
+		if test "$cf_cv_enable_rpath" = yes ; then
+			# only way is to set LD_RUN_PATH but no switch for it
+			RUN_PATH=$libdir
+		fi
+		test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
+		LINK_PROGS='LD_RUN_PATH=${libdir}'
+		LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib'
+		;;
+	sunos4*) #(vi
+		# tested with SunOS 4.1.1 and gcc 2.7.0
+		if test "$GCC" != yes; then
+			CC_SHARED_OPTS='-KPIC'
+		fi
+		MK_SHARED_LIB='${LD} -assert pure-text -o $[@]'
+		test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
+		;;
+	solaris2*) #(vi
+		# tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2
+		# tested with SunOS 5.10 (solaris 10) and gcc 3.4.3
+		if test "$DFT_LWR_MODEL" = "shared" ; then
+			LOCAL_LDFLAGS="-R \$(LOCAL_LIBDIR):\${libdir}"
+			LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
+		fi
+		if test "$cf_cv_enable_rpath" = yes ; then
+			EXTRA_LDFLAGS="-R \${libdir} $EXTRA_LDFLAGS"
+		fi
+		CF_SHARED_SONAME
+		if test "$GCC" != yes; then
+			cf_save_CFLAGS="$CFLAGS"
+			for cf_shared_opts in -xcode=pic32 -xcode=pic13 -KPIC -Kpic -O
+			do
+				CFLAGS="$cf_shared_opts $cf_save_CFLAGS"
+				AC_TRY_COMPILE([#include <stdio.h>],[printf("Hello\n");],[break])
+			done
+			CFLAGS="$cf_save_CFLAGS"
+			CC_SHARED_OPTS=$cf_shared_opts
+			MK_SHARED_LIB='${CC} -dy -G -h '$cf_cv_shared_soname' -o $[@]'
+		else
+			MK_SHARED_LIB='${CC} -shared -dy -G -h '$cf_cv_shared_soname' -o $[@]'
+		fi
+		;;
+	sysv5uw7*|unix_sv*) #(vi
+		# tested with UnixWare 7.1.0 (gcc 2.95.2 and cc)
+		if test "$GCC" != yes; then
+			CC_SHARED_OPTS='-KPIC'
+		fi
+		MK_SHARED_LIB='${LD} -d y -G -o [$]@'
+		;;
+	*)
+		CC_SHARED_OPTS='unknown'
+		MK_SHARED_LIB='echo unknown'
+		;;
+	esac
+
+	# This works if the last tokens in $MK_SHARED_LIB are the -o target.
+	case "$cf_cv_shlib_version" in #(vi
+	rel|abi)
+		case "$MK_SHARED_LIB" in #(vi
+		*'-o $[@]') #(vi
+			test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes
+			;;
+		*)
+			AC_MSG_WARN(ignored --with-shlib-version)
+			;;
+		esac
+		;;
+	esac
+
+	if test -n "$cf_ld_rpath_opt" ; then
+		MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${libdir}"
+	fi
+
+	AC_SUBST(CC_SHARED_OPTS)
+	AC_SUBST(LD_RPATH_OPT)
+	AC_SUBST(LD_SHARED_OPTS)
+	AC_SUBST(MK_SHARED_LIB)
+	AC_SUBST(LINK_PROGS)
+	AC_SUBST(LINK_TESTS)
+	AC_SUBST(EXTRA_LDFLAGS)
+	AC_SUBST(LOCAL_LDFLAGS)
+	AC_SUBST(LOCAL_LDFLAGS2)
+	AC_SUBST(INSTALL_LIB)
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_SHARED_SONAME version: 3 updated: 2008/09/08 18:34:43
+dnl ----------------
+dnl utility macro for CF_SHARED_OPTS, constructs "$cf_cv_shared_soname" for
+dnl substitution into MK_SHARED_LIB string for the "-soname" (or similar)
+dnl option.
+dnl
+dnl $1 is the default that should be used for "$cf_cv_shlib_version".
+dnl If missing, use "rel".
+define([CF_SHARED_SONAME],
+[
+	test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=ifelse($1,,rel,$1)
+	if test "$cf_cv_shlib_version" = rel; then
+		cf_cv_shared_soname='`basename $[@] .${REL_VERSION}`.${ABI_VERSION}'
+	else
+		cf_cv_shared_soname='`basename $[@]`'
+	fi
+])
+dnl ---------------------------------------------------------------------------
+dnl CF_STRIP_G_OPT version: 3 updated: 2002/12/21 19:25:52
+dnl --------------
+dnl	Remove "-g" option from the compiler options
+AC_DEFUN([CF_STRIP_G_OPT],
+[$1=`echo ${$1} | sed -e 's%-g %%' -e 's%-g$%%'`])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_SUBDIR_PATH version: 6 updated: 2010/04/21 06:20:50
+dnl --------------
+dnl Construct a search-list for a nonstandard header/lib-file
+dnl	$1 = the variable to return as result
+dnl	$2 = the package name
+dnl	$3 = the subdirectory, e.g., bin, include or lib
+AC_DEFUN([CF_SUBDIR_PATH],
+[
+$1=
+
+CF_ADD_SUBDIR_PATH($1,$2,$3,/usr,$prefix)
+CF_ADD_SUBDIR_PATH($1,$2,$3,$prefix,NONE)
+CF_ADD_SUBDIR_PATH($1,$2,$3,/usr/local,$prefix)
+CF_ADD_SUBDIR_PATH($1,$2,$3,/opt,$prefix)
+CF_ADD_SUBDIR_PATH($1,$2,$3,[$]HOME,$prefix)
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_SUBST version: 4 updated: 2006/06/17 12:33:03
+dnl --------
+dnl	Shorthand macro for substituting things that the user may override
+dnl	with an environment variable.
+dnl
+dnl	$1 = long/descriptive name
+dnl	$2 = environment variable
+dnl	$3 = default value
+AC_DEFUN([CF_SUBST],
+[AC_CACHE_VAL(cf_cv_subst_$2,[
+AC_MSG_CHECKING(for $1 (symbol $2))
+CF_SUBST_IF([-z "[$]$2"], [$2], [$3])
+cf_cv_subst_$2=[$]$2
+AC_MSG_RESULT([$]$2)
+])
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_TERM_HEADER version: 2 updated: 2010/10/23 15:54:49
+dnl --------------
+dnl Look for term.h, which is part of X/Open curses.  It defines the interface
+dnl to terminfo database.  Usually it is in the same include-path as curses.h,
+dnl but some packagers change this, breaking various applications.
+AC_DEFUN([CF_TERM_HEADER],[
+AC_CACHE_CHECK(for terminfo header, cf_cv_term_header,[
+case ${cf_cv_ncurses_header} in #(vi
+*/ncurses.h|*/ncursesw.h) #(vi
+	cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[[^.]]*\.h$%term.h%'`
+	;;
+*)
+	cf_term_header=term.h
+	;;
+esac
+
+for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
+do
+AC_TRY_COMPILE([#include <stdio.h>
+#include <${cf_cv_ncurses_header:-curses.h}>
+#include <$cf_test>
+],[int x = auto_left_margin],[
+	cf_cv_term_header="$cf_test"],[
+	cf_cv_term_header=unknown
+	])
+	test "$cf_cv_term_header" != unknown && break
+done
+])
+
+# Set definitions to allow ifdef'ing to accommodate subdirectories
+
+case $cf_cv_term_header in # (vi
+*term.h)
+	AC_DEFINE(HAVE_TERM_H)
+	;;
+esac
+
+case $cf_cv_term_header in # (vi
+ncurses/term.h) #(vi
+	AC_DEFINE(HAVE_NCURSES_TERM_H)
+	;;
+ncursesw/term.h)
+	AC_DEFINE(HAVE_NCURSESW_TERM_H)
+	;;
+esac
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_TOP_BUILDDIR version: 1 updated: 2006/10/15 16:33:23
+dnl ---------------
+dnl Define a top_builddir symbol, for applications that need an absolute path.
+AC_DEFUN([CF_TOP_BUILDDIR],
+[
+top_builddir=`pwd`
+AC_SUBST(top_builddir)
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_UPPER version: 5 updated: 2001/01/29 23:40:59
+dnl --------
+dnl Make an uppercase version of a variable
+dnl $1=uppercase($2)
+AC_DEFUN([CF_UPPER],
+[
+$1=`echo "$2" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_UTF8_LIB version: 7 updated: 2010/06/20 09:24:28
+dnl -----------
+dnl Check for multibyte support, and if not found, utf8 compatibility library
+AC_DEFUN([CF_UTF8_LIB],
+[
+AC_CACHE_CHECK(for multibyte character support,cf_cv_utf8_lib,[
+	cf_save_LIBS="$LIBS"
+	AC_TRY_LINK([
+#include <stdlib.h>],[putwc(0,0);],
+	[cf_cv_utf8_lib=yes],
+	[CF_FIND_LINKAGE([
+#include <libutf8.h>],[putwc(0,0);],utf8,
+		[cf_cv_utf8_lib=add-on],
+		[cf_cv_utf8_lib=no])
+])])
+
+# HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
+# ncurses/ncursesw:
+if test "$cf_cv_utf8_lib" = "add-on" ; then
+	AC_DEFINE(HAVE_LIBUTF8_H)
+	CF_ADD_INCDIR($cf_cv_header_path_utf8)
+	CF_ADD_LIBDIR($cf_cv_library_path_utf8)
+	CF_ADD_LIBS($cf_cv_library_file_utf8)
+fi
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_VERBOSE version: 3 updated: 2007/07/29 09:55:12
+dnl ----------
+dnl Use AC_VERBOSE w/o the warnings
+AC_DEFUN([CF_VERBOSE],
+[test -n "$verbose" && echo "	$1" 1>&AC_FD_MSG
+CF_MSG_LOG([$1])
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_WEAK_SYMBOLS version: 1 updated: 2008/08/16 19:18:06
+dnl ---------------
+dnl Check for compiler-support for weak symbols.
+dnl This works with "recent" gcc.
+AC_DEFUN([CF_WEAK_SYMBOLS],[
+AC_CACHE_CHECK(if $CC supports weak symbols,cf_cv_weak_symbols,[
+
+AC_TRY_COMPILE([
+#include <stdio.h>],
+[
+#if defined(__GNUC__)
+#  if defined __USE_ISOC99
+#    define _cat_pragma(exp)	_Pragma(#exp)
+#    define _weak_pragma(exp)	_cat_pragma(weak name)
+#  else
+#    define _weak_pragma(exp)
+#  endif
+#  define _declare(name)	__extension__ extern __typeof__(name) name
+#  define weak_symbol(name)	_weak_pragma(name) _declare(name) __attribute__((weak))
+#endif
+
+weak_symbol(fopen);
+],[cf_cv_weak_symbols=yes],[cf_cv_weak_symbols=no])
+])
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_WITH_ADA_COMPILER version: 2 updated: 2010/06/26 17:35:58
+dnl --------------------
+dnl Command-line option to specify the Ada95 compiler.
+AC_DEFUN([CF_WITH_ADA_COMPILER],[
+AC_MSG_CHECKING(for ada-compiler)
+AC_ARG_WITH(ada-compiler,
+	[  --with-ada-compiler=CMD specify Ada95 compiler command (default gnatmake)],
+	[cf_ada_compiler=$withval],
+	[cf_ada_compiler=gnatmake])
+AC_SUBST(cf_ada_compiler)
+AC_MSG_RESULT($cf_ada_compiler)
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_WITH_ADA_INCLUDE version: 2 updated: 2010/06/26 17:35:58
+dnl -------------------
+dnl Command-line option to specify where Ada includes will install.
+AC_DEFUN([CF_WITH_ADA_INCLUDE],[
+AC_MSG_CHECKING(for ada-include)
+CF_WITH_PATH(ada-include,
+   [  --with-ada-include=DIR  Ada includes are in DIR],
+   ADA_INCLUDE,
+   PREFIX/share/ada/adainclude,
+   [$]prefix/share/ada/adainclude)
+AC_SUBST(ADA_INCLUDE)
+AC_MSG_RESULT($ADA_INCLUDE)
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_WITH_ADA_OBJECTS version: 2 updated: 2010/06/26 17:35:58
+dnl -------------------
+dnl Command-line option to specify where Ada objects will install.
+AC_DEFUN([CF_WITH_ADA_OBJECTS],[
+AC_MSG_CHECKING(for ada-objects)
+CF_WITH_PATH(ada-objects,
+   [  --with-ada-objects=DIR  Ada objects are in DIR],
+   ADA_OBJECTS,
+   PREFIX/lib/ada/adalib,
+   [$]prefix/lib/ada/adalib)
+AC_SUBST(ADA_OBJECTS)
+AC_MSG_RESULT($ADA_OBJECTS)
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_WITH_ADA_SHAREDLIB version: 2 updated: 2010/06/26 17:35:58
+dnl ---------------------
+dnl Command-line option to specify if an Ada95 shared-library should be built,
+dnl and optionally what its soname should be.
+AC_DEFUN([CF_WITH_ADA_SHAREDLIB],[
+AC_MSG_CHECKING(if an Ada95 shared-library should be built)
+AC_ARG_WITH(ada-sharedlib,
+	[  --with-ada-sharedlib=XX build Ada95 shared-library],
+	[with_ada_sharedlib=$withval],
+	[with_ada_sharedlib=no])
+AC_MSG_RESULT($with_ada_sharedlib)
+
+ADA_SHAREDLIB='lib$(LIB_NAME).so.1'
+MAKE_ADA_SHAREDLIB="#"
+
+if test "x$with_ada_sharedlib" != xno
+then
+	MAKE_ADA_SHAREDLIB=
+	if test "x$with_ada_sharedlib" != xyes
+	then
+		ADA_SHAREDLIB="$with_ada_sharedlib"
+	fi
+fi
+
+AC_SUBST(ADA_SHAREDLIB)
+AC_SUBST(MAKE_ADA_SHAREDLIB)
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_WITH_CURSES_DIR version: 2 updated: 2002/11/10 14:46:59
+dnl ------------------
+dnl Wrapper for AC_ARG_WITH to specify directory under which to look for curses
+dnl libraries.
+AC_DEFUN([CF_WITH_CURSES_DIR],[
+AC_ARG_WITH(curses-dir,
+	[  --with-curses-dir=DIR   directory in which (n)curses is installed],
+	[CF_PATH_SYNTAX(withval)
+	 cf_cv_curses_dir=$withval],
+	[cf_cv_curses_dir=no])
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_WITH_PATH version: 10 updated: 2010/10/23 15:44:18
+dnl ------------
+dnl Wrapper for AC_ARG_WITH to ensure that user supplies a pathname, not just
+dnl defaulting to yes/no.
+dnl
+dnl $1 = option name
+dnl $2 = help-text
+dnl $3 = environment variable to set
+dnl $4 = default value, shown in the help-message, must be a constant
+dnl $5 = default value, if it's an expression & cannot be in the help-message
+dnl
+AC_DEFUN([CF_WITH_PATH],
+[AC_ARG_WITH($1,[$2 ](default: ifelse([$4],,empty,[$4])),,
+ifelse([$4],,[withval="${$3}"],[withval="${$3:-ifelse([$5],,[$4],[$5])}"]))dnl
+if ifelse([$5],,true,[test -n "$5"]) ; then
+CF_PATH_SYNTAX(withval)
+fi
+$3="$withval"
+AC_SUBST($3)dnl
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_WITH_PTHREAD version: 3 updated: 2010/05/29 16:31:02
+dnl ---------------
+dnl Check for POSIX thread library.
+AC_DEFUN([CF_WITH_PTHREAD],
+[
+AC_MSG_CHECKING(if you want to link with the pthread library)
+AC_ARG_WITH(pthread,
+    [  --with-pthread          use POSIX thread library],
+    [with_pthread=$withval],
+    [with_pthread=no])
+AC_MSG_RESULT($with_pthread)
+
+if test "$with_pthread" != no ; then
+    AC_CHECK_HEADER(pthread.h,[
+        AC_DEFINE(HAVE_PTHREADS_H)
+
+        AC_MSG_CHECKING(if we can link with the pthread library)
+        cf_save_LIBS="$LIBS"
+        CF_ADD_LIB(pthread)
+        AC_TRY_LINK([
+#include <pthread.h>
+],[
+        int rc = pthread_create(0,0,0,0);
+],[with_pthread=yes],[with_pthread=no])
+        LIBS="$cf_save_LIBS"
+        AC_MSG_RESULT($with_pthread)
+
+        if test "$with_pthread" = yes ; then
+            CF_ADD_LIB(pthread)
+            AC_DEFINE(HAVE_LIBPTHREADS)
+        else
+            AC_MSG_ERROR(Cannot link with pthread library)
+        fi
+    ])
+fi
+])
+dnl ---------------------------------------------------------------------------
+dnl CF_XOPEN_SOURCE version: 34 updated: 2010/05/26 05:38:42
+dnl ---------------
+dnl Try to get _XOPEN_SOURCE defined properly that we can use POSIX functions,
+dnl or adapt to the vendor's definitions to get equivalent functionality,
+dnl without losing the common non-POSIX features.
+dnl
+dnl Parameters:
+dnl	$1 is the nominal value for _XOPEN_SOURCE
+dnl	$2 is the nominal value for _POSIX_C_SOURCE
+AC_DEFUN([CF_XOPEN_SOURCE],[
+
+cf_XOPEN_SOURCE=ifelse([$1],,500,[$1])
+cf_POSIX_C_SOURCE=ifelse([$2],,199506L,[$2])
+cf_xopen_source=
+
+case $host_os in #(vi
+aix[[456]]*) #(vi
+	cf_xopen_source="-D_ALL_SOURCE"
+	;;
+darwin[[0-8]].*) #(vi
+	cf_xopen_source="-D_APPLE_C_SOURCE"
+	;;
+darwin*) #(vi
+	cf_xopen_source="-D_DARWIN_C_SOURCE"
+	;;
+freebsd*|dragonfly*) #(vi
+	# 5.x headers associate
+	#	_XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
+	#	_XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
+	cf_POSIX_C_SOURCE=200112L
+	cf_XOPEN_SOURCE=600
+	cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
+	;;
+hpux11*) #(vi
+	cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
+	;;
+hpux*) #(vi
+	cf_xopen_source="-D_HPUX_SOURCE"
+	;;
+irix[[56]].*) #(vi
+	cf_xopen_source="-D_SGI_SOURCE"
+	;;
+linux*|gnu*|mint*|k*bsd*-gnu) #(vi
+	CF_GNU_SOURCE
+	;;
+mirbsd*) #(vi
+	# setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <arpa/inet.h>
+	;;
+netbsd*) #(vi
+	# setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
+	;;
+openbsd*) #(vi
+	# setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
+	;;
+osf[[45]]*) #(vi
+	cf_xopen_source="-D_OSF_SOURCE"
+	;;
+nto-qnx*) #(vi
+	cf_xopen_source="-D_QNX_SOURCE"
+	;;
+sco*) #(vi
+	# setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
+	;;
+solaris2.1[[0-9]]) #(vi
+	cf_xopen_source="-D__EXTENSIONS__ -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
+	;;
+solaris2.[[1-9]]) #(vi
+	cf_xopen_source="-D__EXTENSIONS__"
+	;;
+*)
+	AC_CACHE_CHECK(if we should define _XOPEN_SOURCE,cf_cv_xopen_source,[
+	AC_TRY_COMPILE([#include <sys/types.h>],[
+#ifndef _XOPEN_SOURCE
+make an error
+#endif],
+	[cf_cv_xopen_source=no],
+	[cf_save="$CPPFLAGS"
+	 CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
+	 AC_TRY_COMPILE([#include <sys/types.h>],[
+#ifdef _XOPEN_SOURCE
+make an error
+#endif],
+	[cf_cv_xopen_source=no],
+	[cf_cv_xopen_source=$cf_XOPEN_SOURCE])
+	CPPFLAGS="$cf_save"
+	])
+])
+	if test "$cf_cv_xopen_source" != no ; then
+		CF_REMOVE_DEFINE(CFLAGS,$CFLAGS,_XOPEN_SOURCE)
+		CF_REMOVE_DEFINE(CPPFLAGS,$CPPFLAGS,_XOPEN_SOURCE)
+		cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
+		CF_ADD_CFLAGS($cf_temp_xopen_source)
+	fi
+	CF_POSIX_C_SOURCE($cf_POSIX_C_SOURCE)
+	;;
+esac
+
+if test -n "$cf_xopen_source" ; then
+	CF_ADD_CFLAGS($cf_xopen_source)
+fi
+])
diff -Naur ncurses-5.7.orig/Ada95/configure ncurses-5.7/Ada95/configure
--- ncurses-5.7.orig/Ada95/configure	1969-12-31 19:00:00.000000000 -0500
+++ ncurses-5.7/Ada95/configure	2011-01-08 18:18:29.470656442 -0500
@@ -0,0 +1,12128 @@
+#! /bin/sh
+# From configure.in Revision: 1.21 .
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by Autoconf 2.52.20101001.
+#
+# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
+# Free Software Foundation, Inc.
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+  set -o posix
+fi
+
+# Name of the executable.
+as_me=`echo "$0" |sed 's,.*[\\/],,'`
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+  # We could just check for DJGPP; but this test a) works b) is more generic
+  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+  if test -f conf$$.exe; then
+    # Don't use ln at all; we don't have any links
+    as_ln_s='cp -p'
+  else
+    as_ln_s='ln -s'
+  fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s=ln
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
+
+as_executable_p="test -f"
+
+# Support unset when possible.
+if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+# NLS nuisances.
+$as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
+$as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
+$as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
+$as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
+$as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
+$as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
+$as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
+$as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
+
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" 	$as_nl"
+
+# CDPATH.
+$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
+
+# Name of the host.
+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+exec 6>&1
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+cross_compiling=no
+subdirs=
+MFLAGS= MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Maximum number of lines to put in a shell here document.
+# This variable seems obsolete.  It should probably be removed, and
+# only ac_max_sed_lines should be used.
+: ${ac_max_here_lines=38}
+
+ac_unique_file="gen/gen.c"
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
+
+# Identity of this package.
+PACKAGE_NAME=
+PACKAGE_TARNAME=
+PACKAGE_VERSION=
+PACKAGE_STRING=
+PACKAGE_BUGREPORT=
+
+ac_prev=
+for ac_option
+do
+  # If the previous option needs an argument, assign it.
+  if test -n "$ac_prev"; then
+    eval "$ac_prev=\$ac_option"
+    ac_prev=
+    continue
+  fi
+
+  ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case $ac_option in
+
+  -bindir | --bindir | --bindi | --bind | --bin | --bi)
+    ac_prev=bindir ;;
+  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+    bindir=$ac_optarg ;;
+
+  -build | --build | --buil | --bui | --bu)
+    ac_prev=build_alias ;;
+  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+    build_alias=$ac_optarg ;;
+
+  -cache-file | --cache-file | --cache-fil | --cache-fi \
+  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+    ac_prev=cache_file ;;
+  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+    cache_file=$ac_optarg ;;
+
+  --config-cache | -C)
+    cache_file=config.cache ;;
+
+  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+  | --da=*)
+    datadir=$ac_optarg ;;
+
+  -disable-* | --disable-*)
+    ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+   { (exit 1); exit 1; }; }
+    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+    eval "enable_$ac_feature=no" ;;
+
+  -enable-* | --enable-*)
+    ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+   { (exit 1); exit 1; }; }
+    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+    case $ac_option in
+      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
+      *) ac_optarg=yes ;;
+    esac
+    eval "enable_$ac_feature='$ac_optarg'" ;;
+
+  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+  | --exec | --exe | --ex)
+    ac_prev=exec_prefix ;;
+  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+  | --exec=* | --exe=* | --ex=*)
+    exec_prefix=$ac_optarg ;;
+
+  -gas | --gas | --ga | --g)
+    # Obsolete; use --with-gas.
+    with_gas=yes ;;
+
+  -help | --help | --hel | --he | -h)
+    ac_init_help=long ;;
+  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+    ac_init_help=recursive ;;
+  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+    ac_init_help=short ;;
+
+  -host | --host | --hos | --ho)
+    ac_prev=host_alias ;;
+  -host=* | --host=* | --hos=* | --ho=*)
+    host_alias=$ac_optarg ;;
+
+  -includedir | --includedir | --includedi | --included | --include \
+  | --includ | --inclu | --incl | --inc)
+    ac_prev=includedir ;;
+  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+  | --includ=* | --inclu=* | --incl=* | --inc=*)
+    includedir=$ac_optarg ;;
+
+  -infodir | --infodir | --infodi | --infod | --info | --inf)
+    ac_prev=infodir ;;
+  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+    infodir=$ac_optarg ;;
+
+  -libdir | --libdir | --libdi | --libd)
+    ac_prev=libdir ;;
+  -libdir=* | --libdir=* | --libdi=* | --libd=*)
+    libdir=$ac_optarg ;;
+
+  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+  | --libexe | --libex | --libe)
+    ac_prev=libexecdir ;;
+  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+  | --libexe=* | --libex=* | --libe=*)
+    libexecdir=$ac_optarg ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst \
+  | --locals | --local | --loca | --loc | --lo)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+    localstatedir=$ac_optarg ;;
+
+  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+    ac_prev=mandir ;;
+  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+    mandir=$ac_optarg ;;
+
+  -nfp | --nfp | --nf)
+    # Obsolete; use --without-fp.
+    with_fp=no ;;
+
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c)
+    no_create=yes ;;
+
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+    no_recursion=yes ;;
+
+  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+  | --oldin | --oldi | --old | --ol | --o)
+    ac_prev=oldincludedir ;;
+  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+    oldincludedir=$ac_optarg ;;
+
+  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+    ac_prev=prefix ;;
+  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+    prefix=$ac_optarg ;;
+
+  -program-prefix | --program-prefix | --program-prefi | --program-pref \
+  | --program-pre | --program-pr | --program-p)
+    ac_prev=program_prefix ;;
+  -program-prefix=* | --program-prefix=* | --program-prefi=* \
+  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+    program_prefix=$ac_optarg ;;
+
+  -program-suffix | --program-suffix | --program-suffi | --program-suff \
+  | --program-suf | --program-su | --program-s)
+    ac_prev=program_suffix ;;
+  -program-suffix=* | --program-suffix=* | --program-suffi=* \
+  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+    program_suffix=$ac_optarg ;;
+
+  -program-transform-name | --program-transform-name \
+  | --program-transform-nam | --program-transform-na \
+  | --program-transform-n | --program-transform- \
+  | --program-transform | --program-transfor \
+  | --program-transfo | --program-transf \
+  | --program-trans | --program-tran \
+  | --progr-tra | --program-tr | --program-t)
+    ac_prev=program_transform_name ;;
+  -program-transform-name=* | --program-transform-name=* \
+  | --program-transform-nam=* | --program-transform-na=* \
+  | --program-transform-n=* | --program-transform-=* \
+  | --program-transform=* | --program-transfor=* \
+  | --program-transfo=* | --program-transf=* \
+  | --program-trans=* | --program-tran=* \
+  | --progr-tra=* | --program-tr=* | --program-t=*)
+    program_transform_name=$ac_optarg ;;
+
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil)
+    silent=yes ;;
+
+  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+    ac_prev=sbindir ;;
+  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+  | --sbi=* | --sb=*)
+    sbindir=$ac_optarg ;;
+
+  -sharedstatedir | --sharedstatedir | --sharedstatedi \
+  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+  | --sharedst | --shareds | --shared | --share | --shar \
+  | --sha | --sh)
+    ac_prev=sharedstatedir ;;
+  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+  | --sha=* | --sh=*)
+    sharedstatedir=$ac_optarg ;;
+
+  -site | --site | --sit)
+    ac_prev=site ;;
+  -site=* | --site=* | --sit=*)
+    site=$ac_optarg ;;
+
+  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+    ac_prev=srcdir ;;
+  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+    srcdir=$ac_optarg ;;
+
+  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+  | --syscon | --sysco | --sysc | --sys | --sy)
+    ac_prev=sysconfdir ;;
+  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+    sysconfdir=$ac_optarg ;;
+
+  -target | --target | --targe | --targ | --tar | --ta | --t)
+    ac_prev=target_alias ;;
+  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+    target_alias=$ac_optarg ;;
+
+  -v | -verbose | --verbose | --verbos | --verbo | --verb)
+    verbose=yes ;;
+
+  -version | --version | --versio | --versi | --vers | -V)
+    ac_init_version=: ;;
+
+  -with-* | --with-*)
+    ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid package name: $ac_package" >&2
+   { (exit 1); exit 1; }; }
+    ac_package=`echo $ac_package| sed 's/-/_/g'`
+    case $ac_option in
+      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
+      *) ac_optarg=yes ;;
+    esac
+    eval "with_$ac_package='$ac_optarg'" ;;
+
+  -without-* | --without-*)
+    ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid package name: $ac_package" >&2
+   { (exit 1); exit 1; }; }
+    ac_package=`echo $ac_package | sed 's/-/_/g'`
+    eval "with_$ac_package=no" ;;
+
+  --x)
+    # Obsolete; use --with-x.
+    with_x=yes ;;
+
+  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+  | --x-incl | --x-inc | --x-in | --x-i)
+    ac_prev=x_includes ;;
+  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+    x_includes=$ac_optarg ;;
+
+  -x-libraries | --x-libraries | --x-librarie | --x-librari \
+  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+    ac_prev=x_libraries ;;
+  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+    x_libraries=$ac_optarg ;;
+
+  -*) { echo "$as_me: error: unrecognized option: $ac_option
+Try \`$0 --help' for more information." >&2
+   { (exit 1); exit 1; }; }
+    ;;
+
+  *=*)
+    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+   { (exit 1); exit 1; }; }
+    ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
+    eval "$ac_envvar='$ac_optarg'"
+    export $ac_envvar ;;
+
+  *)
+    # FIXME: should be removed in autoconf 3.0.
+    echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+    ;;
+
+  esac
+done
+
+if test -n "$ac_prev"; then
+  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+  { echo "$as_me: error: missing argument to $ac_option" >&2
+   { (exit 1); exit 1; }; }
+fi
+
+# Be sure to have absolute paths.
+for ac_var in exec_prefix prefix
+do
+  eval ac_val=$`echo $ac_var`
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
+    *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
+   { (exit 1); exit 1; }; };;
+  esac
+done
+
+# Be sure to have absolute paths.
+for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
+              localstatedir libdir includedir oldincludedir infodir mandir
+do
+  eval ac_val=$`echo $ac_var`
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* ) ;;
+    *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
+   { (exit 1); exit 1; }; };;
+  esac
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: should be removed in autoconf 3.0.
+if test "x$host_alias" != x; then
+  if test "x$build_alias" = x; then
+    cross_compiling=maybe
+    echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+    If a cross compiler is detected then cross compile mode will be used." >&2
+  elif test "x$build_alias" != "x$host_alias"; then
+    cross_compiling=yes
+  fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+  ac_srcdir_defaulted=yes
+  # Try the directory containing this script, then its parent.
+  ac_prog=$0
+  ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'`
+  test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
+  srcdir=$ac_confdir
+  if test ! -r $srcdir/$ac_unique_file; then
+    srcdir=..
+  fi
+else
+  ac_srcdir_defaulted=no
+fi
+if test ! -r $srcdir/$ac_unique_file; then
+  if test "$ac_srcdir_defaulted" = yes; then
+    { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2
+   { (exit 1); exit 1; }; }
+  else
+    { echo "$as_me: error: cannot find sources in $srcdir" >&2
+   { (exit 1); exit 1; }; }
+  fi
+fi
+srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
+ac_env_build_alias_set=${build_alias+set}
+ac_env_build_alias_value=$build_alias
+ac_cv_env_build_alias_set=${build_alias+set}
+ac_cv_env_build_alias_value=$build_alias
+ac_env_host_alias_set=${host_alias+set}
+ac_env_host_alias_value=$host_alias
+ac_cv_env_host_alias_set=${host_alias+set}
+ac_cv_env_host_alias_value=$host_alias
+ac_env_target_alias_set=${target_alias+set}
+ac_env_target_alias_value=$target_alias
+ac_cv_env_target_alias_set=${target_alias+set}
+ac_cv_env_target_alias_value=$target_alias
+ac_env_CC_set=${CC+set}
+ac_env_CC_value=$CC
+ac_cv_env_CC_set=${CC+set}
+ac_cv_env_CC_value=$CC
+ac_env_CFLAGS_set=${CFLAGS+set}
+ac_env_CFLAGS_value=$CFLAGS
+ac_cv_env_CFLAGS_set=${CFLAGS+set}
+ac_cv_env_CFLAGS_value=$CFLAGS
+ac_env_LDFLAGS_set=${LDFLAGS+set}
+ac_env_LDFLAGS_value=$LDFLAGS
+ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
+ac_cv_env_LDFLAGS_value=$LDFLAGS
+ac_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_env_CPPFLAGS_value=$CPPFLAGS
+ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_cv_env_CPPFLAGS_value=$CPPFLAGS
+ac_env_CPP_set=${CPP+set}
+ac_env_CPP_value=$CPP
+ac_cv_env_CPP_set=${CPP+set}
+ac_cv_env_CPP_value=$CPP
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+  # Omit some internal or obsolete options to make the list less imposing.
+  # This message is too long to be a string in the A/UX 3.1 sh.
+  cat <<EOF
+\`configure' configures this package to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE.  See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+  -h, --help              display this help and exit
+      --help=short        display options specific to this package
+      --help=recursive    display the short help of all the included packages
+  -V, --version           display version information and exit
+  -q, --quiet, --silent   do not print \`checking...' messages
+      --cache-file=FILE   cache test results in FILE [disabled]
+  -C, --config-cache      alias for \`--cache-file=config.cache'
+  -n, --no-create         do not create output files
+      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
+
+EOF
+
+  cat <<EOF
+Installation directories:
+  --prefix=PREFIX         install architecture-independent files in PREFIX
+                          [$ac_default_prefix]
+  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
+                          [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+  --bindir=DIR            user executables [EPREFIX/bin]
+  --sbindir=DIR           system admin executables [EPREFIX/sbin]
+  --libexecdir=DIR        program executables [EPREFIX/libexec]
+  --datadir=DIR           read-only architecture-independent data [PREFIX/share]
+  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
+  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
+  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
+  --libdir=DIR            object code libraries [EPREFIX/lib]
+  --includedir=DIR        C header files [PREFIX/include]
+  --oldincludedir=DIR     C header files for non-gcc [/usr/include]
+  --infodir=DIR           info documentation [PREFIX/info]
+  --mandir=DIR            man documentation [PREFIX/man]
+EOF
+
+  cat <<\EOF
+
+Program names:
+  --program-prefix=PREFIX            prepend PREFIX to installed program names
+  --program-suffix=SUFFIX            append SUFFIX to installed program names
+  --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
+
+System types:
+  --build=BUILD           configure for building on BUILD [guessed]
+  --host=HOST       build programs to run on HOST [BUILD]
+  --target=TARGET   configure for building compilers for TARGET [HOST]
+EOF
+fi
+
+if test -n "$ac_init_help"; then
+
+  cat <<\EOF
+
+Optional Packages:
+  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+
+Optional Features:
+  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
+  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
+
+  --with-system-type=XXX  test: override derived host system-type
+  --with-pkg-config{=path} enable/disable use of pkg-config
+  --enable-pc-files       generate and install .pc files for pkg-config
+  --without-tests         suppress build with test-programs
+  --enable-mixed-case     tic should assume mixed-case filenames
+  --with-install-prefix   prefixes actual install-location ($DESTDIR)
+Build-Tools Needed to Compile Temporary Applications for Cross-compiling:
+  --with-build-cc=XXX     the build C compiler ($BUILD_CC)
+  --with-build-cpp=XXX    the build C preprocessor ($BUILD_CPP)
+  --with-build-cflags=XXX the build C compiler-flags ($BUILD_CFLAGS)
+  --with-build-cppflags=XXX the build C preprocessor-flags ($BUILD_CPPFLAGS)
+  --with-build-ldflags=XXX the build linker-flags ($BUILD_LDFLAGS)
+  --with-build-libs=XXX   the build libraries (${BUILD_LIBS})
+Options to Specify the Libraries Built/Used:
+  --enable-widec          compile with wide-char/UTF-8 code
+  --with-curses-dir=DIR   directory in which (n)curses is installed
+  --with-shlib-version=X  Specify rel or abi version for shared libs
+Fine-Tuning Your Configuration:
+  --enable-broken_linker  compile with broken-linker support code
+  --disable-largefile     omit support for large files
+  --with-rcs-ids          compile-in RCS identifiers
+Extensions:
+  --disable-ext-funcs     disable function-extensions
+  --enable-const          compile with extra/non-standard const
+Development Code:
+  --without-develop       disable development options
+Experimental Code:
+  --with-pthread          use POSIX thread library
+  --enable-weak-symbols   enable weak-symbols for pthreads
+  --enable-reentrant      compile with experimental reentrant code
+  --with-wrap-prefix=XXX  override prefix used for public variables
+Testing/development Options:
+  --enable-echo           build: display "compiling" commands (default)
+  --enable-warnings       build: turn on GCC compiler warnings
+  --enable-assertions     test: turn on generation of assertion code
+  --enable-expanded       test: generate functions for certain macros
+  --disable-macros        test: use functions rather than macros
+  --with-trace            test: add trace() function to all models of ncurses
+Ada95 Binding Options:
+  --with-ada-compiler=CMD specify Ada95 compiler command (default gnatmake)
+  --with-ada-include=DIR  Ada includes are in DIR (default: PREFIX/share/ada/adainclude)
+  --with-ada-objects=DIR  Ada objects are in DIR (default: PREFIX/lib/ada/adalib)
+  --with-ada-sharedlib=XX build Ada95 shared-library
+
+Some influential environment variables:
+  CC          C compiler command
+  CFLAGS      C compiler flags
+  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
+              nonstandard directory <lib dir>
+  CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
+              headers in a nonstandard directory <include dir>
+  CPP         C preprocessor
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+EOF
+fi
+
+if test "$ac_init_help" = "recursive"; then
+  # If there are subdirs, report their specific --help.
+  ac_popdir=`pwd`
+  for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
+    cd $ac_subdir
+    # A "../" for each directory in /$ac_subdir.
+    ac_dots=`echo $ac_subdir |
+             sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
+
+    case $srcdir in
+    .) # No --srcdir option.  We are building in place.
+      ac_sub_srcdir=$srcdir ;;
+    [\\/]* | ?:[\\/]* ) # Absolute path.
+      ac_sub_srcdir=$srcdir/$ac_subdir ;;
+    *) # Relative path.
+      ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;;
+    esac
+
+    # Check for guested configure; otherwise get Cygnus style configure.
+    if test -f $ac_sub_srcdir/configure.gnu; then
+      echo
+      $SHELL $ac_sub_srcdir/configure.gnu  --help=recursive
+    elif test -f $ac_sub_srcdir/configure; then
+      echo
+      $SHELL $ac_sub_srcdir/configure  --help=recursive
+    elif test -f $ac_sub_srcdir/configure.ac ||
+           test -f $ac_sub_srcdir/configure.in; then
+      echo
+      $ac_configure --help
+    else
+      echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
+    fi
+    cd $ac_popdir
+  done
+fi
+
+test -n "$ac_init_help" && exit 0
+if $ac_init_version; then
+  cat <<\EOF
+
+Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
+Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+EOF
+  exit 0
+fi
+exec 5>config.log
+cat >&5 <<EOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by $as_me, which was
+generated by GNU Autoconf 2.52.20101001.  Invocation command line was
+
+  $ $0 $@
+
+EOF
+{
+cat <<_ASUNAME
+## ---------- ##
+## Platform.  ##
+## ---------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
+
+/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
+/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
+/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
+/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
+/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
+
+PATH = $PATH
+
+_ASUNAME
+} >&5
+
+cat >&5 <<EOF
+## ------------ ##
+## Core tests.  ##
+## ------------ ##
+
+EOF
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Also quote any args containing shell meta-characters.
+ac_configure_args=
+ac_sep=
+for ac_arg
+do
+  case $ac_arg in
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c) ;;
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
+  *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+    ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
+    ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
+    ac_sep=" " ;;
+  *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
+     ac_sep=" " ;;
+  esac
+  # Get rid of the leading space.
+done
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log.  We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+trap 'exit_status=$?
+  # Save into config.log some information that might help in debugging.
+  echo >&5
+  echo "## ----------------- ##" >&5
+  echo "## Cache variables.  ##" >&5
+  echo "## ----------------- ##" >&5
+  echo >&5
+  # The following way of writing the cache mishandles newlines in values,
+{
+  (set) 2>&1 |
+    case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
+    *ac_space=\ *)
+      sed -n \
+        "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
+    	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
+      ;;
+    *)
+      sed -n \
+        "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+      ;;
+    esac;
+} >&5
+  sed "/^$/d" confdefs.h >conftest.log
+  if test -s conftest.log; then
+    echo >&5
+    echo "## ------------ ##" >&5
+    echo "## confdefs.h.  ##" >&5
+    echo "## ------------ ##" >&5
+    echo >&5
+    cat conftest.log >&5
+  fi
+  (echo; echo) >&5
+  test "$ac_signal" != 0 &&
+    echo "$as_me: caught signal $ac_signal" >&5
+  echo "$as_me: exit $exit_status" >&5
+  rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
+    exit $exit_status
+     ' 0
+for ac_signal in 1 2 13 15; do
+  trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo >confdefs.h
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$CONFIG_SITE"; then
+  if test "x$prefix" != xNONE; then
+    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+  else
+    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+  fi
+fi
+for ac_site_file in $CONFIG_SITE; do
+  if test -r "$ac_site_file"; then
+    { echo "$as_me:882: loading site script $ac_site_file" >&5
+echo "$as_me: loading site script $ac_site_file" >&6;}
+    cat "$ac_site_file" >&5
+    . "$ac_site_file"
+  fi
+done
+
+if test -r "$cache_file"; then
+  # Some versions of bash will fail to source /dev/null (special
+  # files actually), so we avoid doing that.
+  if test -f "$cache_file"; then
+    { echo "$as_me:893: loading cache $cache_file" >&5
+echo "$as_me: loading cache $cache_file" >&6;}
+    case $cache_file in
+      [\\/]* | ?:[\\/]* ) . $cache_file;;
+      *)                      . ./$cache_file;;
+    esac
+  fi
+else
+  { echo "$as_me:901: creating cache $cache_file" >&5
+echo "$as_me: creating cache $cache_file" >&6;}
+  >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in `(set) 2>&1 |
+               sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
+  eval ac_old_set=\$ac_cv_env_${ac_var}_set
+  eval ac_new_set=\$ac_env_${ac_var}_set
+  eval ac_old_val="\$ac_cv_env_${ac_var}_value"
+  eval ac_new_val="\$ac_env_${ac_var}_value"
+  case $ac_old_set,$ac_new_set in
+    set,)
+      { echo "$as_me:917: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,set)
+      { echo "$as_me:921: error: \`$ac_var' was not set in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,);;
+    *)
+      if test "x$ac_old_val" != "x$ac_new_val"; then
+        { echo "$as_me:927: error: \`$ac_var' has changed since the previous run:" >&5
+echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+        { echo "$as_me:929:   former value:  $ac_old_val" >&5
+echo "$as_me:   former value:  $ac_old_val" >&2;}
+        { echo "$as_me:931:   current value: $ac_new_val" >&5
+echo "$as_me:   current value: $ac_new_val" >&2;}
+        ac_cache_corrupted=:
+      fi;;
+  esac
+  # Pass precious variables to config.status.  It doesn't matter if
+  # we pass some twice (in addition to the command line arguments).
+  if test "$ac_new_set" = set; then
+    case $ac_new_val in
+    *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+      ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
+      ac_configure_args="$ac_configure_args '$ac_arg'"
+      ;;
+    *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
+       ;;
+    esac
+  fi
+done
+if $ac_cache_corrupted; then
+  { echo "$as_me:950: error: changes in the environment can compromise the build" >&5
+echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+  { { echo "$as_me:952: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+ac_main_return=return
+
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+  *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T='	' ;;
+  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+  *)      ECHO_N= ECHO_C='\c' ECHO_T= ;;
+esac
+echo "#! $SHELL" >conftest.sh
+echo  "exit 0"   >>conftest.sh
+chmod +x conftest.sh
+if { (echo "$as_me:973: PATH=\".;.\"; conftest.sh") >&5
+  (PATH=".;."; conftest.sh) 2>&5
+  ac_status=$?
+  echo "$as_me:976: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  ac_path_separator=';'
+else
+  ac_path_separator=:
+fi
+PATH_SEPARATOR="$ac_path_separator"
+rm -f conftest.sh
+
+ac_config_headers="$ac_config_headers include/ncurses_cfg.h:include/ncurses_cfg.hin"
+
+top_builddir=`pwd`
+
+ac_aux_dir=
+for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
+  if test -f $ac_dir/install-sh; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install-sh -c"
+    break
+  elif test -f $ac_dir/install.sh; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install.sh -c"
+    break
+  elif test -f $ac_dir/shtool; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/shtool install -c"
+    break
+  fi
+done
+if test -z "$ac_aux_dir"; then
+  { { echo "$as_me:1006: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
+echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"
+ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
+
+# Make sure we can run config.sub.
+$ac_config_sub sun4 >/dev/null 2>&1 ||
+  { { echo "$as_me:1016: error: cannot run $ac_config_sub" >&5
+echo "$as_me: error: cannot run $ac_config_sub" >&2;}
+   { (exit 1); exit 1; }; }
+
+echo "$as_me:1020: checking build system type" >&5
+echo $ECHO_N "checking build system type... $ECHO_C" >&6
+if test "${ac_cv_build+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_build_alias=$build_alias
+test -z "$ac_cv_build_alias" &&
+  ac_cv_build_alias=`$ac_config_guess`
+test -z "$ac_cv_build_alias" &&
+  { { echo "$as_me:1029: error: cannot guess build type; you must specify one" >&5
+echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
+   { (exit 1); exit 1; }; }
+ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
+  { { echo "$as_me:1033: error: $ac_config_sub $ac_cv_build_alias failed." >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
+   { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:1038: result: $ac_cv_build" >&5
+echo "${ECHO_T}$ac_cv_build" >&6
+build=$ac_cv_build
+build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+echo "$as_me:1045: checking host system type" >&5
+echo $ECHO_N "checking host system type... $ECHO_C" >&6
+if test "${ac_cv_host+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_host_alias=$host_alias
+test -z "$ac_cv_host_alias" &&
+  ac_cv_host_alias=$ac_cv_build_alias
+ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
+  { { echo "$as_me:1054: error: $ac_config_sub $ac_cv_host_alias failed" >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:1059: result: $ac_cv_host" >&5
+echo "${ECHO_T}$ac_cv_host" >&6
+host=$ac_cv_host
+host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
+	echo "$as_me:1067: checking target system type" >&5
+echo $ECHO_N "checking target system type... $ECHO_C" >&6
+if test "${ac_cv_target+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_target_alias=$target_alias
+test "x$ac_cv_target_alias" = "x" &&
+  ac_cv_target_alias=$ac_cv_host_alias
+ac_cv_target=`$ac_config_sub $ac_cv_target_alias` ||
+  { { echo "$as_me:1076: error: $ac_config_sub $ac_cv_target_alias failed" >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:1081: result: $ac_cv_target" >&5
+echo "${ECHO_T}$ac_cv_target" >&6
+target=$ac_cv_target
+target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+# The aliases save the names the user supplied, while $host etc.
+# will get canonicalized.
+test -n "$target_alias" &&
+  test "$program_prefix$program_suffix$program_transform_name" = \
+    NONENONEs,x,x, &&
+  program_prefix=${target_alias}-
+	system_name="$host_os"
+else
+	system_name="`(uname -s -r) 2>/dev/null`"
+	if test -z "$system_name" ; then
+		system_name="`(hostname) 2>/dev/null`"
+	fi
+fi
+test -n "$system_name" && cat >>confdefs.h <<EOF
+#define SYSTEM_NAME "$system_name"
+EOF
+
+if test "${cf_cv_system_name+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cf_cv_system_name="$system_name"
+fi
+
+test -z "$system_name" && system_name="$cf_cv_system_name"
+test -n "$cf_cv_system_name" && echo "$as_me:1112: result: Configuring for $cf_cv_system_name" >&5
+echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
+
+if test ".$system_name" != ".$cf_cv_system_name" ; then
+	echo "$as_me:1116: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
+echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
+	{ { echo "$as_me:1118: error: \"Please remove config.cache and try again.\"" >&5
+echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+# Check whether --with-system-type or --without-system-type was given.
+if test "${with_system_type+set}" = set; then
+  withval="$with_system_type"
+  { echo "$as_me:1126: WARNING: overriding system type to $withval" >&5
+echo "$as_me: WARNING: overriding system type to $withval" >&2;}
+ cf_cv_system_name=$withval
+fi;
+
+###	Save the given $CFLAGS to allow user-override.
+cf_user_CFLAGS="$CFLAGS"
+
+###	Default install-location
+
+echo "$as_me:1136: checking for prefix" >&5
+echo $ECHO_N "checking for prefix... $ECHO_C" >&6
+if test "x$prefix" = "xNONE" ; then
+	case "$cf_cv_system_name" in
+		# non-vendor systems don't have a conflict
+	openbsd*|freebsd*|linux*|cygwin*|k*bsd*-gnu)
+		prefix=/usr
+		;;
+	*)	prefix=$ac_default_prefix
+		;;
+	esac
+fi
+echo "$as_me:1148: result: $prefix" >&5
+echo "${ECHO_T}$prefix" >&6
+
+if test "x$prefix" = "xNONE" ; then
+echo "$as_me:1152: checking for default include-directory" >&5
+echo $ECHO_N "checking for default include-directory... $ECHO_C" >&6
+test -n "$verbose" && echo 1>&6
+for cf_symbol in \
+	$includedir \
+	$includedir/ncurses \
+	$prefix/include \
+	$prefix/include/ncurses \
+	/usr/local/include \
+	/usr/local/include/ncurses \
+	/usr/include \
+	/usr/include/ncurses
+do
+	cf_dir=`eval echo $cf_symbol`
+	if test -f $cf_dir/curses.h ; then
+	if ( fgrep NCURSES_VERSION $cf_dir/curses.h 2>&1 >/dev/null ) ; then
+		includedir="$cf_symbol"
+		test -n "$verbose"  && echo $ac_n "	found " 1>&6
+		break
+	fi
+	fi
+	test -n "$verbose"  && echo "	tested $cf_dir" 1>&6
+done
+echo "$as_me:1175: result: $includedir" >&5
+echo "${ECHO_T}$includedir" >&6
+fi
+
+###	Checks for programs.
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+ac_main_return=return
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+echo "$as_me:1189: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_CC="${ac_tool_prefix}gcc"
+echo "$as_me:1204: found $ac_dir/$ac_word" >&5
+break
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  echo "$as_me:1212: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+  echo "$as_me:1215: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+  ac_ct_CC=$CC
+  # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+echo "$as_me:1224: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_ac_ct_CC="gcc"
+echo "$as_me:1239: found $ac_dir/$ac_word" >&5
+break
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  echo "$as_me:1247: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+  echo "$as_me:1250: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  CC=$ac_ct_CC
+else
+  CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+echo "$as_me:1263: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_CC="${ac_tool_prefix}cc"
+echo "$as_me:1278: found $ac_dir/$ac_word" >&5
+break
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  echo "$as_me:1286: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+  echo "$as_me:1289: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+  ac_ct_CC=$CC
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo "$as_me:1298: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_ac_ct_CC="cc"
+echo "$as_me:1313: found $ac_dir/$ac_word" >&5
+break
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  echo "$as_me:1321: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+  echo "$as_me:1324: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  CC=$ac_ct_CC
+else
+  CC="$ac_cv_prog_CC"
+fi
+
+fi
+if test -z "$CC"; then
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo "$as_me:1337: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  ac_prog_rejected=no
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  $as_executable_p "$ac_dir/$ac_word" || continue
+if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
+  ac_prog_rejected=yes
+  continue
+fi
+ac_cv_prog_CC="cc"
+echo "$as_me:1357: found $ac_dir/$ac_word" >&5
+break
+done
+
+if test $ac_prog_rejected = yes; then
+  # We found a bogon in the path, so make sure we never use it.
+  set dummy $ac_cv_prog_CC
+  shift
+  if test $# != 0; then
+    # We chose a different compiler from the bogus one.
+    # However, it has the same basename, so the bogon will be chosen
+    # first if we set CC to just the basename; use the full file name.
+    shift
+    set dummy "$ac_dir/$ac_word" ${1+"$@"}
+    shift
+    ac_cv_prog_CC="$@"
+  fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  echo "$as_me:1379: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+  echo "$as_me:1382: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in cl
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+echo "$as_me:1393: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+echo "$as_me:1408: found $ac_dir/$ac_word" >&5
+break
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  echo "$as_me:1416: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+  echo "$as_me:1419: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+    test -n "$CC" && break
+  done
+fi
+if test -z "$CC"; then
+  ac_ct_CC=$CC
+  for ac_prog in cl
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:1432: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_ac_ct_CC="$ac_prog"
+echo "$as_me:1447: found $ac_dir/$ac_word" >&5
+break
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  echo "$as_me:1455: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+  echo "$as_me:1458: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  test -n "$ac_ct_CC" && break
+done
+
+  CC=$ac_ct_CC
+fi
+
+fi
+
+test -z "$CC" && { { echo "$as_me:1470: error: no acceptable cc found in \$PATH" >&5
+echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
+   { (exit 1); exit 1; }; }
+
+# Provide some information about the compiler.
+echo "$as_me:1475:" \
+     "checking for C compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (eval echo "$as_me:1478: \"$ac_compiler --version </dev/null >&5\"") >&5
+  (eval $ac_compiler --version </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:1481: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (eval echo "$as_me:1483: \"$ac_compiler -v </dev/null >&5\"") >&5
+  (eval $ac_compiler -v </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:1486: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (eval echo "$as_me:1488: \"$ac_compiler -V </dev/null >&5\"") >&5
+  (eval $ac_compiler -V </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:1491: \$? = $ac_status" >&5
+  (exit $ac_status); }
+
+cat >conftest.$ac_ext <<_ACEOF
+#line 1495 "configure"
+#include "confdefs.h"
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.exe"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+echo "$as_me:1511: checking for C compiler default output" >&5
+echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
+ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+if { (eval echo "$as_me:1514: \"$ac_link_default\"") >&5
+  (eval $ac_link_default) 2>&5
+  ac_status=$?
+  echo "$as_me:1517: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  # Find the output, starting from the most likely.  This scheme is
+# not robust to junk in `.', hence go to wildcards (a.*) only as a last
+# resort.
+for ac_file in `ls a.exe conftest.exe 2>/dev/null;
+                ls a.out conftest 2>/dev/null;
+                ls a.* conftest.* 2>/dev/null`; do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
+    a.out ) # We found the default executable, but exeext='' is most
+            # certainly right.
+            break;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+          # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
+          export ac_cv_exeext
+          break;;
+    * ) break;;
+  esac
+done
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+{ { echo "$as_me:1540: error: C compiler cannot create executables" >&5
+echo "$as_me: error: C compiler cannot create executables" >&2;}
+   { (exit 77); exit 77; }; }
+fi
+
+ac_exeext=$ac_cv_exeext
+echo "$as_me:1546: result: $ac_file" >&5
+echo "${ECHO_T}$ac_file" >&6
+
+# Check the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:1551: checking whether the C compiler works" >&5
+echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
+# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
+# If not cross compiling, check that we can run a simple program.
+if test "$cross_compiling" != yes; then
+  if { ac_try='./$ac_file'
+  { (eval echo "$as_me:1557: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:1560: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+    cross_compiling=no
+  else
+    if test "$cross_compiling" = maybe; then
+	cross_compiling=yes
+    else
+	{ { echo "$as_me:1567: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'." >&5
+echo "$as_me: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'." >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+  fi
+fi
+echo "$as_me:1575: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+rm -f a.out a.exe conftest$ac_cv_exeext
+ac_clean_files=$ac_clean_files_save
+# Check the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:1582: checking whether we are cross compiling" >&5
+echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
+echo "$as_me:1584: result: $cross_compiling" >&5
+echo "${ECHO_T}$cross_compiling" >&6
+
+echo "$as_me:1587: checking for executable suffix" >&5
+echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
+if { (eval echo "$as_me:1589: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:1592: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+          export ac_cv_exeext
+          break;;
+    * ) break;;
+  esac
+done
+else
+  { { echo "$as_me:1608: error: cannot compute EXEEXT: cannot compile and link" >&5
+echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest$ac_cv_exeext
+echo "$as_me:1614: result: $ac_cv_exeext" >&5
+echo "${ECHO_T}$ac_cv_exeext" >&6
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+echo "$as_me:1620: checking for object suffix" >&5
+echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
+if test "${ac_cv_objext+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 1626 "configure"
+#include "confdefs.h"
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { (eval echo "$as_me:1638: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:1641: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
+    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+       break;;
+  esac
+done
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+{ { echo "$as_me:1653: error: cannot compute OBJEXT: cannot compile" >&5
+echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+echo "$as_me:1660: result: $ac_cv_objext" >&5
+echo "${ECHO_T}$ac_cv_objext" >&6
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+echo "$as_me:1664: checking whether we are using the GNU C compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
+if test "${ac_cv_c_compiler_gnu+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 1670 "configure"
+#include "confdefs.h"
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:1685: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:1688: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:1691: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:1694: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_compiler_gnu=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_compiler_gnu=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+echo "$as_me:1706: result: $ac_cv_c_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
+GCC=`test $ac_compiler_gnu = yes && echo yes`
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+CFLAGS="-g"
+echo "$as_me:1712: checking whether $CC accepts -g" >&5
+echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_g+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 1718 "configure"
+#include "confdefs.h"
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:1730: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:1733: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:1736: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:1739: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_prog_cc_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_prog_cc_g=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:1749: result: $ac_cv_prog_cc_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
+    CFLAGS="-g -O2"
+  else
+    CFLAGS="-g"
+  fi
+else
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
+fi
+# Some people use a C++ compiler to compile C.  Since we use `exit',
+# in C++ we need to declare it.  In case someone uses the same compiler
+# for both compiling C and C++ we need to have the C++ compiler decide
+# the declaration of exit, since it's the most demanding environment.
+cat >conftest.$ac_ext <<_ACEOF
+#ifndef __cplusplus
+  choke me
+#endif
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:1776: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:1779: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:1782: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:1785: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  for ac_declaration in \
+   ''\
+   '#include <stdlib.h>' \
+   'extern "C" void std::exit (int) throw (); using std::exit;' \
+   'extern "C" void std::exit (int); using std::exit;' \
+   'extern "C" void exit (int) throw ();' \
+   'extern "C" void exit (int);' \
+   'void exit (int);'
+do
+  cat >conftest.$ac_ext <<_ACEOF
+#line 1797 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+$ac_declaration
+int
+main ()
+{
+exit (42);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:1810: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:1813: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:1816: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:1819: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+continue
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+  cat >conftest.$ac_ext <<_ACEOF
+#line 1829 "configure"
+#include "confdefs.h"
+$ac_declaration
+int
+main ()
+{
+exit (42);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:1841: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:1844: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:1847: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:1850: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  break
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+done
+rm -rf conftest*
+if test -n "$ac_declaration"; then
+  echo '#ifdef __cplusplus' >>confdefs.h
+  echo $ac_declaration      >>confdefs.h
+  echo '#endif'             >>confdefs.h
+fi
+
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+ac_main_return=return
+
+GCC_VERSION=none
+if test "$GCC" = yes ; then
+	echo "$as_me:1880: checking version of $CC" >&5
+echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
+	GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
+	test -z "$GCC_VERSION" && GCC_VERSION=unknown
+	echo "$as_me:1884: result: $GCC_VERSION" >&5
+echo "${ECHO_T}$GCC_VERSION" >&6
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+ac_main_return=return
+echo "$as_me:1894: checking how to run the C preprocessor" >&5
+echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=
+fi
+if test -z "$CPP"; then
+  if test "${ac_cv_prog_CPP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+      # Double quotes because CPP needs to be expanded
+    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+#line 1915 "configure"
+#include "confdefs.h"
+#include <assert.h>
+                     Syntax error
+_ACEOF
+if { (eval echo "$as_me:1920: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  egrep -v '^ *\+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:1926: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether non-existent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+#line 1949 "configure"
+#include "confdefs.h"
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:1953: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  egrep -v '^ *\+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:1959: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  # Broken: success on invalid input.
+continue
+else
+  echo "$as_me: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  break
+fi
+
+    done
+    ac_cv_prog_CPP=$CPP
+
+fi
+  CPP=$ac_cv_prog_CPP
+else
+  ac_cv_prog_CPP=$CPP
+fi
+echo "$as_me:1996: result: $CPP" >&5
+echo "${ECHO_T}$CPP" >&6
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+#line 2006 "configure"
+#include "confdefs.h"
+#include <assert.h>
+                     Syntax error
+_ACEOF
+if { (eval echo "$as_me:2011: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  egrep -v '^ *\+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:2017: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether non-existent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+#line 2040 "configure"
+#include "confdefs.h"
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:2044: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  egrep -v '^ *\+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:2050: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  # Broken: success on invalid input.
+continue
+else
+  echo "$as_me: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  :
+else
+  { { echo "$as_me:2078: error: C preprocessor \"$CPP\" fails sanity check" >&5
+echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+ac_main_return=return
+
+if test $ac_cv_c_compiler_gnu = yes; then
+    echo "$as_me:2091: checking whether $CC needs -traditional" >&5
+echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6
+if test "${ac_cv_prog_gcc_traditional+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+    ac_pattern="Autoconf.*'x'"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 2098 "configure"
+#include "confdefs.h"
+#include <sgtty.h>
+int Autoconf = TIOCGETP;
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "$ac_pattern" >/dev/null 2>&1; then
+  ac_cv_prog_gcc_traditional=yes
+else
+  ac_cv_prog_gcc_traditional=no
+fi
+rm -rf conftest*
+
+  if test $ac_cv_prog_gcc_traditional = no; then
+    cat >conftest.$ac_ext <<_ACEOF
+#line 2113 "configure"
+#include "confdefs.h"
+#include <termio.h>
+int Autoconf = TCGETA;
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "$ac_pattern" >/dev/null 2>&1; then
+  ac_cv_prog_gcc_traditional=yes
+fi
+rm -rf conftest*
+
+  fi
+fi
+echo "$as_me:2126: result: $ac_cv_prog_gcc_traditional" >&5
+echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6
+  if test $ac_cv_prog_gcc_traditional = yes; then
+    CC="$CC -traditional"
+  fi
+fi
+
+echo "$as_me:2133: checking whether $CC understands -c and -o together" >&5
+echo $ECHO_N "checking whether $CC understands -c and -o together... $ECHO_C" >&6
+if test "${cf_cv_prog_CC_c_o+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+cat > conftest.$ac_ext <<CF_EOF
+#include <stdio.h>
+int main()
+{
+	${cf_cv_main_return:-return}(0);
+}
+CF_EOF
+# We do the test twice because some compilers refuse to overwrite an
+# existing .o file with -o, though they will create one.
+ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
+if { (eval echo "$as_me:2149: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:2152: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+  test -f conftest2.$ac_objext && { (eval echo "$as_me:2154: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:2157: \$? = $ac_status" >&5
+  (exit $ac_status); };
+then
+  eval cf_cv_prog_CC_c_o=yes
+else
+  eval cf_cv_prog_CC_c_o=no
+fi
+rm -rf conftest*
+
+fi
+if test $cf_cv_prog_CC_c_o = yes; then
+  echo "$as_me:2168: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+  echo "$as_me:2171: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+echo "$as_me:2175: checking for POSIXized ISC" >&5
+echo $ECHO_N "checking for POSIXized ISC... $ECHO_C" >&6
+if test -d /etc/conf/kconfig.d &&
+   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
+then
+  echo "$as_me:2180: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+  ISC=yes # If later tests want to check for ISC.
+
+cat >>confdefs.h <<\EOF
+#define _POSIX_SOURCE 1
+EOF
+
+  if test "$GCC" = yes; then
+    CC="$CC -posix"
+  else
+    CC="$CC -Xp"
+  fi
+else
+  echo "$as_me:2194: result: no" >&5
+echo "${ECHO_T}no" >&6
+  ISC=
+fi
+
+echo "$as_me:2199: checking for ${CC:-cc} option to accept ANSI C" >&5
+echo $ECHO_N "checking for ${CC:-cc} option to accept ANSI C... $ECHO_C" >&6
+if test "${cf_cv_ansi_cc+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+cf_cv_ansi_cc=no
+cf_save_CFLAGS="$CFLAGS"
+cf_save_CPPFLAGS="$CPPFLAGS"
+# Don't try gcc -ansi; that turns off useful extensions and
+# breaks some systems' header files.
+# AIX			-qlanglvl=ansi
+# Ultrix and OSF/1	-std1
+# HP-UX			-Aa -D_HPUX_SOURCE
+# SVR4			-Xc
+# UnixWare 1.2		(cannot use -Xc, since ANSI/POSIX clashes)
+for cf_arg in "-DCC_HAS_PROTOS" \
+	"" \
+	-qlanglvl=ansi \
+	-std1 \
+	-Ae \
+	"-Aa -D_HPUX_SOURCE" \
+	-Xc
+do
+
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
+
+for cf_add_cflags in $cf_arg
+do
+case $cf_fix_cppflags in
+no)
+	case $cf_add_cflags in #(vi
+	-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
+		case $cf_add_cflags in
+		-D*)
+			cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
+
+			test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+				&& test -z "${cf_tst_cflags}" \
+				&& cf_fix_cppflags=yes
+
+			if test $cf_fix_cppflags = yes ; then
+				cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+				continue
+			elif test "${cf_tst_cflags}" = "\"'" ; then
+				cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+				continue
+			fi
+			;;
+		esac
+		case "$CPPFLAGS" in
+		*$cf_add_cflags) #(vi
+			;;
+		*) #(vi
+			case $cf_add_cflags in #(vi
+			-D*)
+				cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
+
+CPPFLAGS=`echo "$CPPFLAGS" | \
+	sed	-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?[ 	]/ /g' \
+		-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?$//g'`
+
+				;;
+			esac
+			cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
+			;;
+		esac
+		;;
+	*)
+		cf_new_cflags="$cf_new_cflags $cf_add_cflags"
+		;;
+	esac
+	;;
+yes)
+	cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+	cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
+
+	test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+		&& test -z "${cf_tst_cflags}" \
+		&& cf_fix_cppflags=no
+	;;
+esac
+done
+
+if test -n "$cf_new_cflags" ; then
+
+	CFLAGS="$CFLAGS $cf_new_cflags"
+fi
+
+if test -n "$cf_new_cppflags" ; then
+
+	CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
+fi
+
+if test -n "$cf_new_extra_cppflags" ; then
+
+	EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+fi
+
+	cat >conftest.$ac_ext <<_ACEOF
+#line 2303 "configure"
+#include "confdefs.h"
+
+#ifndef CC_HAS_PROTOS
+#if !defined(__STDC__) || (__STDC__ != 1)
+choke me
+#endif
+#endif
+
+int
+main ()
+{
+
+	int test (int i, double x);
+	struct s1 {int (*f) (int a);};
+	struct s2 {int (*f) (double a);};
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:2324: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:2327: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:2330: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:2333: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_ansi_cc="$cf_arg"; break
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+done
+CFLAGS="$cf_save_CFLAGS"
+CPPFLAGS="$cf_save_CPPFLAGS"
+
+fi
+echo "$as_me:2346: result: $cf_cv_ansi_cc" >&5
+echo "${ECHO_T}$cf_cv_ansi_cc" >&6
+
+if test "$cf_cv_ansi_cc" != "no"; then
+if test ".$cf_cv_ansi_cc" != ".-DCC_HAS_PROTOS"; then
+
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
+
+for cf_add_cflags in $cf_cv_ansi_cc
+do
+case $cf_fix_cppflags in
+no)
+	case $cf_add_cflags in #(vi
+	-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
+		case $cf_add_cflags in
+		-D*)
+			cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
+
+			test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+				&& test -z "${cf_tst_cflags}" \
+				&& cf_fix_cppflags=yes
+
+			if test $cf_fix_cppflags = yes ; then
+				cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+				continue
+			elif test "${cf_tst_cflags}" = "\"'" ; then
+				cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+				continue
+			fi
+			;;
+		esac
+		case "$CPPFLAGS" in
+		*$cf_add_cflags) #(vi
+			;;
+		*) #(vi
+			case $cf_add_cflags in #(vi
+			-D*)
+				cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
+
+CPPFLAGS=`echo "$CPPFLAGS" | \
+	sed	-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?[ 	]/ /g' \
+		-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?$//g'`
+
+				;;
+			esac
+			cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
+			;;
+		esac
+		;;
+	*)
+		cf_new_cflags="$cf_new_cflags $cf_add_cflags"
+		;;
+	esac
+	;;
+yes)
+	cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+	cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
+
+	test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+		&& test -z "${cf_tst_cflags}" \
+		&& cf_fix_cppflags=no
+	;;
+esac
+done
+
+if test -n "$cf_new_cflags" ; then
+
+	CFLAGS="$CFLAGS $cf_new_cflags"
+fi
+
+if test -n "$cf_new_cppflags" ; then
+
+	CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
+fi
+
+if test -n "$cf_new_extra_cppflags" ; then
+
+	EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+fi
+
+else
+	cat >>confdefs.h <<\EOF
+#define CC_HAS_PROTOS 1
+EOF
+
+fi
+fi
+
+if test "$cf_cv_ansi_cc" = "no"; then
+	{ { echo "$as_me:2439: error: Your compiler does not appear to recognize prototypes.
+You have the following choices:
+	a. adjust your compiler options
+	b. get an up-to-date compiler
+	c. use a wrapper such as unproto" >&5
+echo "$as_me: error: Your compiler does not appear to recognize prototypes.
+You have the following choices:
+	a. adjust your compiler options
+	b. get an up-to-date compiler
+	c. use a wrapper such as unproto" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+case $cf_cv_system_name in
+os2*)
+    CFLAGS="$CFLAGS -Zmt"
+    CPPFLAGS="$CPPFLAGS -D__ST_MT_ERRNO__"
+    CXXFLAGS="$CXXFLAGS -Zmt"
+    # autoconf's macro sets -Zexe and suffix both, which conflict:w
+    LDFLAGS="$LDFLAGS -Zmt -Zcrtdll"
+    ac_cv_exeext=.exe
+    ;;
+esac
+
+PROG_EXT="$EXEEXT"
+
+test -n "$PROG_EXT" && cat >>confdefs.h <<EOF
+#define PROG_EXT "$PROG_EXT"
+EOF
+
+test "$program_prefix" != NONE &&
+  program_transform_name="s,^,$program_prefix,;$program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+  program_transform_name="s,\$,$program_suffix,;$program_transform_name"
+# Double any \ or $.  echo might interpret backslashes.
+# By default was `s,x,x', remove it if useless.
+cat <<\_ACEOF >conftest.sed
+s/[\\$]/&&/g;s/;s,x,x,$//
+_ACEOF
+program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
+rm conftest.sed
+
+for ac_prog in mawk gawk nawk awk
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:2486: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_AWK+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$AWK"; then
+  ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_AWK="$ac_prog"
+echo "$as_me:2501: found $ac_dir/$ac_word" >&5
+break
+done
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+  echo "$as_me:2509: result: $AWK" >&5
+echo "${ECHO_T}$AWK" >&6
+else
+  echo "$as_me:2512: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  test -n "$AWK" && break
+done
+
+test -z "$AWK" && { { echo "$as_me:2519: error: No awk program found" >&5
+echo "$as_me: error: No awk program found" >&2;}
+   { (exit 1); exit 1; }; }
+
+echo "$as_me:2523: checking for egrep" >&5
+echo $ECHO_N "checking for egrep... $ECHO_C" >&6
+if test "${ac_cv_prog_egrep+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if echo a | (grep -E '(a|b)') >/dev/null 2>&1
+    then ac_cv_prog_egrep='grep -E'
+    else ac_cv_prog_egrep='egrep'
+    fi
+fi
+echo "$as_me:2533: result: $ac_cv_prog_egrep" >&5
+echo "${ECHO_T}$ac_cv_prog_egrep" >&6
+ EGREP=$ac_cv_prog_egrep
+
+test -z "$EGREP" && { { echo "$as_me:2537: error: No egrep program found" >&5
+echo "$as_me: error: No egrep program found" >&2;}
+   { (exit 1); exit 1; }; }
+
+# Find a good install program.  We prefer a C program (faster),
+# so one script is as good as another.  But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# ./install, which can be erroneously created by make from ./install.sh.
+echo "$as_me:2553: checking for a BSD compatible install" >&5
+echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+    ac_save_IFS=$IFS; IFS=$ac_path_separator
+  for ac_dir in $PATH; do
+    IFS=$ac_save_IFS
+    # Account for people who put trailing slashes in PATH elements.
+    case $ac_dir/ in
+    / | ./ | .// | /cC/* \
+    | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
+    | /usr/ucb/* ) ;;
+    *)
+      # OSF1 and SCO ODT 3.0 have their own names for install.
+      # Don't use installbsd from OSF since it installs stuff as root
+      # by default.
+      for ac_prog in ginstall scoinst install; do
+        if $as_executable_p "$ac_dir/$ac_prog"; then
+	  if test $ac_prog = install &&
+            grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
+	    # AIX install.  It has an incompatible calling convention.
+	    :
+	  elif test $ac_prog = install &&
+	    grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
+	    # program-specific install script used by HP pwplus--don't use.
+	    :
+	  else
+	    ac_cv_path_install="$ac_dir/$ac_prog -c"
+	    break 2
+	  fi
+	fi
+      done
+      ;;
+    esac
+  done
+
+fi
+  if test "${ac_cv_path_install+set}" = set; then
+    INSTALL=$ac_cv_path_install
+  else
+    # As a last resort, use the slow shell script.  We don't cache a
+    # path for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the path is relative.
+    INSTALL=$ac_install_sh
+  fi
+fi
+echo "$as_me:2602: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&6
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+echo "$as_me:2613: checking whether ln -s works" >&5
+echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
+LN_S=$as_ln_s
+if test "$LN_S" = "ln -s"; then
+  echo "$as_me:2617: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+  echo "$as_me:2620: result: no, using $LN_S" >&5
+echo "${ECHO_T}no, using $LN_S" >&6
+fi
+
+echo "$as_me:2624: checking if $LN_S -f options work" >&5
+echo $ECHO_N "checking if $LN_S -f options work... $ECHO_C" >&6
+
+rm -f conf$$.src conf$$dst
+echo >conf$$.dst
+echo first >conf$$.src
+if $LN_S -f conf$$.src conf$$.dst 2>/dev/null; then
+	cf_prog_ln_sf=yes
+else
+	cf_prog_ln_sf=no
+fi
+rm -f conf$$.dst conf$$src
+echo "$as_me:2636: result: $cf_prog_ln_sf" >&5
+echo "${ECHO_T}$cf_prog_ln_sf" >&6
+
+test "$cf_prog_ln_sf" = yes && LN_S="$LN_S -f"
+
+echo "$as_me:2641: checking for long file names" >&5
+echo $ECHO_N "checking for long file names... $ECHO_C" >&6
+if test "${ac_cv_sys_long_file_names+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_sys_long_file_names=yes
+# Test for long file names in all the places we know might matter:
+#      .		the current directory, where building will happen
+#      $prefix/lib	where we will be installing things
+#      $exec_prefix/lib	likewise
+# eval it to expand exec_prefix.
+#      $TMPDIR		if set, where it might want to write temporary files
+# if $TMPDIR is not set:
+#      /tmp		where it might want to write temporary files
+#      /var/tmp		likewise
+#      /usr/tmp		likewise
+if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then
+  ac_tmpdirs=$TMPDIR
+else
+  ac_tmpdirs='/tmp /var/tmp /usr/tmp'
+fi
+for ac_dir in  . $ac_tmpdirs `eval echo $prefix/lib $exec_prefix/lib` ; do
+  test -d $ac_dir || continue
+  test -w $ac_dir || continue # It is less confusing to not echo anything here.
+  ac_xdir=$ac_dir/cf$$
+  (umask 077 && mkdir $ac_xdir 2>/dev/null) || continue
+  ac_tf1=$ac_xdir/conftest9012345
+  ac_tf2=$ac_xdir/conftest9012346
+  (echo 1 >$ac_tf1) 2>/dev/null
+  (echo 2 >$ac_tf2) 2>/dev/null
+  ac_val=`cat $ac_tf1 2>/dev/null`
+  if test ! -f $ac_tf1 || test "$ac_val" != 1; then
+    ac_cv_sys_long_file_names=no
+    rm -rf $ac_xdir 2>/dev/null
+    break
+  fi
+  rm -rf $ac_xdir 2>/dev/null
+done
+fi
+echo "$as_me:2680: result: $ac_cv_sys_long_file_names" >&5
+echo "${ECHO_T}$ac_cv_sys_long_file_names" >&6
+if test $ac_cv_sys_long_file_names = yes; then
+
+cat >>confdefs.h <<\EOF
+#define HAVE_LONG_FILE_NAMES 1
+EOF
+
+fi
+
+# if we find pkg-config, check if we should install the ".pc" files.
+
+echo "$as_me:2692: checking if you want to use pkg-config" >&5
+echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
+
+# Check whether --with-pkg-config or --without-pkg-config was given.
+if test "${with_pkg_config+set}" = set; then
+  withval="$with_pkg_config"
+  cf_pkg_config=$withval
+else
+  cf_pkg_config=yes
+fi;
+echo "$as_me:2702: result: $cf_pkg_config" >&5
+echo "${ECHO_T}$cf_pkg_config" >&6
+
+case $cf_pkg_config in #(vi
+no) #(vi
+	PKG_CONFIG=none
+	;;
+yes) #(vi
+	# Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+echo "$as_me:2712: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  if $as_executable_p "$ac_dir/$ac_word"; then
+   ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
+   echo "$as_me:2729: found $ac_dir/$ac_word" >&5
+   break
+fi
+done
+
+  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="none"
+  ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+
+if test -n "$PKG_CONFIG"; then
+  echo "$as_me:2741: result: $PKG_CONFIG" >&5
+echo "${ECHO_T}$PKG_CONFIG" >&6
+else
+  echo "$as_me:2744: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+	;;
+*)
+	PKG_CONFIG=$withval
+	;;
+esac
+
+test -z "$PKG_CONFIG" && PKG_CONFIG=none
+if test "$PKG_CONFIG" != none ; then
+
+if test "x$prefix" != xNONE; then
+  cf_path_syntax="$prefix"
+else
+  cf_path_syntax="$ac_default_prefix"
+fi
+
+case ".$PKG_CONFIG" in #(vi
+.\$\(*\)*|.\'*\'*) #(vi
+  ;;
+..|./*|.\\*) #(vi
+  ;;
+.[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
+  ;;
+.\${*prefix}*) #(vi
+  eval PKG_CONFIG="$PKG_CONFIG"
+  case ".$PKG_CONFIG" in #(vi
+  .NONE/*)
+    PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
+    ;;
+  esac
+  ;; #(vi
+.no|.NONE/*)
+  PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
+  ;;
+*)
+  { { echo "$as_me:2782: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
+echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
+   { (exit 1); exit 1; }; }
+  ;;
+esac
+
+fi
+
+if test "$PKG_CONFIG" != no ; then
+	echo "$as_me:2791: checking if we should install .pc files for $PKG_CONFIG" >&5
+echo $ECHO_N "checking if we should install .pc files for $PKG_CONFIG... $ECHO_C" >&6
+
+	# Leave this as something that can be overridden in the environment.
+	if test -z "$PKG_CONFIG_LIBDIR" ; then
+		PKG_CONFIG_LIBDIR=`echo "$PKG_CONFIG" | sed -e 's,/[^/]*/[^/]*$,,'`/lib/pkgconfig
+	fi
+	PKG_CONFIG_LIBDIR=`echo "$PKG_CONFIG_LIBDIR" | sed -e 's/^://' -e 's/:.*//'`
+	if test -n "$PKG_CONFIG_LIBDIR" && test -d "$PKG_CONFIG_LIBDIR" ; then
+
+# Check whether --enable-pc-files or --disable-pc-files was given.
+if test "${enable_pc_files+set}" = set; then
+  enableval="$enable_pc_files"
+  enable_pc_files=$enableval
+else
+  enable_pc_files=no
+fi;
+		echo "$as_me:2808: result: $enable_pc_files" >&5
+echo "${ECHO_T}$enable_pc_files" >&6
+	else
+		echo "$as_me:2811: result: no" >&5
+echo "${ECHO_T}no" >&6
+		{ echo "$as_me:2813: WARNING: did not find library $PKG_CONFIG_LIBDIR" >&5
+echo "$as_me: WARNING: did not find library $PKG_CONFIG_LIBDIR" >&2;}
+		enable_pc_files=no
+	fi
+fi
+
+echo "$as_me:2819: checking if you want to build test-programs" >&5
+echo $ECHO_N "checking if you want to build test-programs... $ECHO_C" >&6
+
+# Check whether --with-tests or --without-tests was given.
+if test "${with_tests+set}" = set; then
+  withval="$with_tests"
+  cf_with_tests=$withval
+else
+  cf_with_tests=yes
+fi;
+echo "$as_me:2829: result: $cf_with_tests" >&5
+echo "${ECHO_T}$cf_with_tests" >&6
+
+echo "$as_me:2832: checking if we should assume mixed-case filenames" >&5
+echo $ECHO_N "checking if we should assume mixed-case filenames... $ECHO_C" >&6
+
+# Check whether --enable-mixed-case or --disable-mixed-case was given.
+if test "${enable_mixed_case+set}" = set; then
+  enableval="$enable_mixed_case"
+  enable_mixedcase=$enableval
+else
+  enable_mixedcase=auto
+fi;
+echo "$as_me:2842: result: $enable_mixedcase" >&5
+echo "${ECHO_T}$enable_mixedcase" >&6
+if test "$enable_mixedcase" = "auto" ; then
+
+echo "$as_me:2846: checking if filesystem supports mixed-case filenames" >&5
+echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
+if test "${cf_cv_mixedcase+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+if test "$cross_compiling" = yes ; then
+	case $target_alias in #(vi
+	*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-mingw32*|*-uwin*) #(vi
+		cf_cv_mixedcase=no
+		;;
+	*)
+		cf_cv_mixedcase=yes
+		;;
+	esac
+else
+	rm -f conftest CONFTEST
+	echo test >conftest
+	if test -f CONFTEST ; then
+		cf_cv_mixedcase=no
+	else
+		cf_cv_mixedcase=yes
+	fi
+	rm -f conftest CONFTEST
+fi
+
+fi
+echo "$as_me:2873: result: $cf_cv_mixedcase" >&5
+echo "${ECHO_T}$cf_cv_mixedcase" >&6
+test "$cf_cv_mixedcase" = yes && cat >>confdefs.h <<\EOF
+#define MIXEDCASE_FILENAMES 1
+EOF
+
+else
+    cf_cv_mixedcase=$enable_mixedcase
+    if test "$enable_mixedcase" = "yes" ; then
+        cat >>confdefs.h <<\EOF
+#define MIXEDCASE_FILENAMES 1
+EOF
+
+    fi
+fi
+
+# do this after mixed-case option (tags/TAGS is not as important as tic).
+echo "$as_me:2890: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
+set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
+if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.make <<\EOF
+all:
+	@echo 'ac_maketemp="${MAKE}"'
+EOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
+if test -n "$ac_maketemp"; then
+  eval ac_cv_prog_make_${ac_make}_set=yes
+else
+  eval ac_cv_prog_make_${ac_make}_set=no
+fi
+rm -f conftest.make
+fi
+if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
+  echo "$as_me:2910: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+  SET_MAKE=
+else
+  echo "$as_me:2914: result: no" >&5
+echo "${ECHO_T}no" >&6
+  SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+for ac_prog in exctags ctags
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:2923: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CTAGS+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CTAGS"; then
+  ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
+else
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_CTAGS="$ac_prog"
+echo "$as_me:2938: found $ac_dir/$ac_word" >&5
+break
+done
+
+fi
+fi
+CTAGS=$ac_cv_prog_CTAGS
+if test -n "$CTAGS"; then
+  echo "$as_me:2946: result: $CTAGS" >&5
+echo "${ECHO_T}$CTAGS" >&6
+else
+  echo "$as_me:2949: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  test -n "$CTAGS" && break
+done
+
+for ac_prog in exetags etags
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:2960: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ETAGS+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ETAGS"; then
+  ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
+else
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_ETAGS="$ac_prog"
+echo "$as_me:2975: found $ac_dir/$ac_word" >&5
+break
+done
+
+fi
+fi
+ETAGS=$ac_cv_prog_ETAGS
+if test -n "$ETAGS"; then
+  echo "$as_me:2983: result: $ETAGS" >&5
+echo "${ECHO_T}$ETAGS" >&6
+else
+  echo "$as_me:2986: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  test -n "$ETAGS" && break
+done
+
+# Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
+set dummy ${CTAGS:-ctags}; ac_word=$2
+echo "$as_me:2995: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$MAKE_LOWER_TAGS"; then
+  ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
+else
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_MAKE_LOWER_TAGS="yes"
+echo "$as_me:3010: found $ac_dir/$ac_word" >&5
+break
+done
+
+  test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
+fi
+fi
+MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
+if test -n "$MAKE_LOWER_TAGS"; then
+  echo "$as_me:3019: result: $MAKE_LOWER_TAGS" >&5
+echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
+else
+  echo "$as_me:3022: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+if test "$cf_cv_mixedcase" = yes ; then
+	# Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
+set dummy ${ETAGS:-etags}; ac_word=$2
+echo "$as_me:3029: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$MAKE_UPPER_TAGS"; then
+  ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
+else
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_MAKE_UPPER_TAGS="yes"
+echo "$as_me:3044: found $ac_dir/$ac_word" >&5
+break
+done
+
+  test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
+fi
+fi
+MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
+if test -n "$MAKE_UPPER_TAGS"; then
+  echo "$as_me:3053: result: $MAKE_UPPER_TAGS" >&5
+echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
+else
+  echo "$as_me:3056: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+else
+	MAKE_UPPER_TAGS=no
+fi
+
+if test "$MAKE_UPPER_TAGS" = yes ; then
+	MAKE_UPPER_TAGS=
+else
+	MAKE_UPPER_TAGS="#"
+fi
+
+if test "$MAKE_LOWER_TAGS" = yes ; then
+	MAKE_LOWER_TAGS=
+else
+	MAKE_LOWER_TAGS="#"
+fi
+
+echo "$as_me:3076: checking for makeflags variable" >&5
+echo $ECHO_N "checking for makeflags variable... $ECHO_C" >&6
+if test "${cf_cv_makeflags+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+	cf_cv_makeflags=''
+	for cf_option in '-${MAKEFLAGS}' '${MFLAGS}'
+	do
+		cat >cf_makeflags.tmp <<CF_EOF
+SHELL = /bin/sh
+all :
+	@ echo '.$cf_option'
+CF_EOF
+		cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp 2>/dev/null | sed -e 's,[ 	]*$,,'`
+		case "$cf_result" in
+		.*k)
+			cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null`
+			case "$cf_result" in
+			.*CC=*)	cf_cv_makeflags=
+				;;
+			*)	cf_cv_makeflags=$cf_option
+				;;
+			esac
+			break
+			;;
+		.-)	;;
+		*)	echo "given option \"$cf_option\", no match \"$cf_result\""
+			;;
+		esac
+	done
+	rm -f cf_makeflags.tmp
+
+fi
+echo "$as_me:3110: result: $cf_cv_makeflags" >&5
+echo "${ECHO_T}$cf_cv_makeflags" >&6
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+echo "$as_me:3116: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_RANLIB+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$RANLIB"; then
+  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+echo "$as_me:3131: found $ac_dir/$ac_word" >&5
+break
+done
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+  echo "$as_me:3139: result: $RANLIB" >&5
+echo "${ECHO_T}$RANLIB" >&6
+else
+  echo "$as_me:3142: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+  ac_ct_RANLIB=$RANLIB
+  # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+echo "$as_me:3151: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_RANLIB"; then
+  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_ac_ct_RANLIB="ranlib"
+echo "$as_me:3166: found $ac_dir/$ac_word" >&5
+break
+done
+
+  test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB="':'"
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+  echo "$as_me:3175: result: $ac_ct_RANLIB" >&5
+echo "${ECHO_T}$ac_ct_RANLIB" >&6
+else
+  echo "$as_me:3178: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  RANLIB=$ac_ct_RANLIB
+else
+  RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ld; ac_word=$2
+echo "$as_me:3190: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_LD+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$LD"; then
+  ac_cv_prog_LD="$LD" # Let the user override the test.
+else
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_LD="${ac_tool_prefix}ld"
+echo "$as_me:3205: found $ac_dir/$ac_word" >&5
+break
+done
+
+fi
+fi
+LD=$ac_cv_prog_LD
+if test -n "$LD"; then
+  echo "$as_me:3213: result: $LD" >&5
+echo "${ECHO_T}$LD" >&6
+else
+  echo "$as_me:3216: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_LD"; then
+  ac_ct_LD=$LD
+  # Extract the first word of "ld", so it can be a program name with args.
+set dummy ld; ac_word=$2
+echo "$as_me:3225: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_LD+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_LD"; then
+  ac_cv_prog_ac_ct_LD="$ac_ct_LD" # Let the user override the test.
+else
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_ac_ct_LD="ld"
+echo "$as_me:3240: found $ac_dir/$ac_word" >&5
+break
+done
+
+  test -z "$ac_cv_prog_ac_ct_LD" && ac_cv_prog_ac_ct_LD="ld"
+fi
+fi
+ac_ct_LD=$ac_cv_prog_ac_ct_LD
+if test -n "$ac_ct_LD"; then
+  echo "$as_me:3249: result: $ac_ct_LD" >&5
+echo "${ECHO_T}$ac_ct_LD" >&6
+else
+  echo "$as_me:3252: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  LD=$ac_ct_LD
+else
+  LD="$ac_cv_prog_LD"
+fi
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ar; ac_word=$2
+echo "$as_me:3264: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_AR+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$AR"; then
+  ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_AR="${ac_tool_prefix}ar"
+echo "$as_me:3279: found $ac_dir/$ac_word" >&5
+break
+done
+
+fi
+fi
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+  echo "$as_me:3287: result: $AR" >&5
+echo "${ECHO_T}$AR" >&6
+else
+  echo "$as_me:3290: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_AR"; then
+  ac_ct_AR=$AR
+  # Extract the first word of "ar", so it can be a program name with args.
+set dummy ar; ac_word=$2
+echo "$as_me:3299: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_AR"; then
+  ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+else
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_ac_ct_AR="ar"
+echo "$as_me:3314: found $ac_dir/$ac_word" >&5
+break
+done
+
+  test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
+fi
+fi
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+  echo "$as_me:3323: result: $ac_ct_AR" >&5
+echo "${ECHO_T}$ac_ct_AR" >&6
+else
+  echo "$as_me:3326: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  AR=$ac_ct_AR
+else
+  AR="$ac_cv_prog_AR"
+fi
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ar; ac_word=$2
+echo "$as_me:3338: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_AR+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$AR"; then
+  ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_AR="${ac_tool_prefix}ar"
+echo "$as_me:3353: found $ac_dir/$ac_word" >&5
+break
+done
+
+fi
+fi
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+  echo "$as_me:3361: result: $AR" >&5
+echo "${ECHO_T}$AR" >&6
+else
+  echo "$as_me:3364: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_AR"; then
+  ac_ct_AR=$AR
+  # Extract the first word of "ar", so it can be a program name with args.
+set dummy ar; ac_word=$2
+echo "$as_me:3373: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_AR"; then
+  ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+else
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_ac_ct_AR="ar"
+echo "$as_me:3388: found $ac_dir/$ac_word" >&5
+break
+done
+
+  test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
+fi
+fi
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+  echo "$as_me:3397: result: $ac_ct_AR" >&5
+echo "${ECHO_T}$ac_ct_AR" >&6
+else
+  echo "$as_me:3400: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  AR=$ac_ct_AR
+else
+  AR="$ac_cv_prog_AR"
+fi
+
+echo "$as_me:3409: checking for options to update archives" >&5
+echo $ECHO_N "checking for options to update archives... $ECHO_C" >&6
+if test "${cf_cv_ar_flags+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+	cf_cv_ar_flags=unknown
+	for cf_ar_flags in -curv curv -crv crv -cqv cqv -rv rv
+	do
+
+		# check if $ARFLAGS already contains this choice
+		if test "x$ARFLAGS" != "x" ; then
+			cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"`
+			if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then
+				cf_cv_ar_flags=
+				break
+			fi
+		fi
+
+		rm -f conftest.$ac_cv_objext
+		rm -f conftest.a
+
+		cat >conftest.$ac_ext <<EOF
+#line 3432 "configure"
+int	testdata[3] = { 123, 456, 789 };
+EOF
+		if { (eval echo "$as_me:3435: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:3438: \$? = $ac_status" >&5
+  (exit $ac_status); } ; then
+			echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&5
+			$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext 2>&5 1>/dev/null
+			if test -f conftest.a ; then
+				cf_cv_ar_flags=$cf_ar_flags
+				break
+			fi
+		else
+			test -n "$verbose" && echo "	cannot compile test-program" 1>&6
+
+echo "${as_me:-configure}:3449: testing cannot compile test-program ..." 1>&5
+
+			break
+		fi
+	done
+	rm -f conftest.a conftest.$ac_ext conftest.$ac_cv_objext
+
+fi
+echo "$as_me:3457: result: $cf_cv_ar_flags" >&5
+echo "${ECHO_T}$cf_cv_ar_flags" >&6
+
+if test -n "$ARFLAGS" ; then
+	if test -n "$cf_cv_ar_flags" ; then
+		ARFLAGS="$ARFLAGS $cf_cv_ar_flags"
+	fi
+else
+	ARFLAGS=$cf_cv_ar_flags
+fi
+
+echo "$as_me:3468: checking if you have specified an install-prefix" >&5
+echo $ECHO_N "checking if you have specified an install-prefix... $ECHO_C" >&6
+
+# Check whether --with-install-prefix or --without-install-prefix was given.
+if test "${with_install_prefix+set}" = set; then
+  withval="$with_install_prefix"
+  case "$withval" in #(vi
+	yes|no) #(vi
+		;;
+	*)	DESTDIR="$withval"
+		;;
+	esac
+fi;
+echo "$as_me:3481: result: $DESTDIR" >&5
+echo "${ECHO_T}$DESTDIR" >&6
+
+###############################################################################
+
+# If we're cross-compiling, allow the user to override the tools and their
+# options.  The configure script is oriented toward identifying the host
+# compiler, etc., but we need a build compiler to generate parts of the source.
+
+if test "$cross_compiling" = yes ; then
+
+	# defaults that we might want to override
+	: ${BUILD_CFLAGS:=''}
+	: ${BUILD_CPPFLAGS:=''}
+	: ${BUILD_LDFLAGS:=''}
+	: ${BUILD_LIBS:=''}
+	: ${BUILD_EXEEXT:='$x'}
+	: ${BUILD_OBJEXT:='o'}
+
+# Check whether --with-build-cc or --without-build-cc was given.
+if test "${with_build_cc+set}" = set; then
+  withval="$with_build_cc"
+  BUILD_CC="$withval"
+else
+  for ac_prog in gcc cc cl
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:3509: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_BUILD_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$BUILD_CC"; then
+  ac_cv_prog_BUILD_CC="$BUILD_CC" # Let the user override the test.
+else
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_BUILD_CC="$ac_prog"
+echo "$as_me:3524: found $ac_dir/$ac_word" >&5
+break
+done
+
+fi
+fi
+BUILD_CC=$ac_cv_prog_BUILD_CC
+if test -n "$BUILD_CC"; then
+  echo "$as_me:3532: result: $BUILD_CC" >&5
+echo "${ECHO_T}$BUILD_CC" >&6
+else
+  echo "$as_me:3535: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  test -n "$BUILD_CC" && break
+done
+
+fi;
+	echo "$as_me:3543: checking for native build C compiler" >&5
+echo $ECHO_N "checking for native build C compiler... $ECHO_C" >&6
+	echo "$as_me:3545: result: $BUILD_CC" >&5
+echo "${ECHO_T}$BUILD_CC" >&6
+
+	echo "$as_me:3548: checking for native build C preprocessor" >&5
+echo $ECHO_N "checking for native build C preprocessor... $ECHO_C" >&6
+
+# Check whether --with-build-cpp or --without-build-cpp was given.
+if test "${with_build_cpp+set}" = set; then
+  withval="$with_build_cpp"
+  BUILD_CPP="$withval"
+else
+  BUILD_CPP='${BUILD_CC} -E'
+fi;
+	echo "$as_me:3558: result: $BUILD_CPP" >&5
+echo "${ECHO_T}$BUILD_CPP" >&6
+
+	echo "$as_me:3561: checking for native build C flags" >&5
+echo $ECHO_N "checking for native build C flags... $ECHO_C" >&6
+
+# Check whether --with-build-cflags or --without-build-cflags was given.
+if test "${with_build_cflags+set}" = set; then
+  withval="$with_build_cflags"
+  BUILD_CFLAGS="$withval"
+fi;
+	echo "$as_me:3569: result: $BUILD_CFLAGS" >&5
+echo "${ECHO_T}$BUILD_CFLAGS" >&6
+
+	echo "$as_me:3572: checking for native build C preprocessor-flags" >&5
+echo $ECHO_N "checking for native build C preprocessor-flags... $ECHO_C" >&6
+
+# Check whether --with-build-cppflags or --without-build-cppflags was given.
+if test "${with_build_cppflags+set}" = set; then
+  withval="$with_build_cppflags"
+  BUILD_CPPFLAGS="$withval"
+fi;
+	echo "$as_me:3580: result: $BUILD_CPPFLAGS" >&5
+echo "${ECHO_T}$BUILD_CPPFLAGS" >&6
+
+	echo "$as_me:3583: checking for native build linker-flags" >&5
+echo $ECHO_N "checking for native build linker-flags... $ECHO_C" >&6
+
+# Check whether --with-build-ldflags or --without-build-ldflags was given.
+if test "${with_build_ldflags+set}" = set; then
+  withval="$with_build_ldflags"
+  BUILD_LDFLAGS="$withval"
+fi;
+	echo "$as_me:3591: result: $BUILD_LDFLAGS" >&5
+echo "${ECHO_T}$BUILD_LDFLAGS" >&6
+
+	echo "$as_me:3594: checking for native build linker-libraries" >&5
+echo $ECHO_N "checking for native build linker-libraries... $ECHO_C" >&6
+
+# Check whether --with-build-libs or --without-build-libs was given.
+if test "${with_build_libs+set}" = set; then
+  withval="$with_build_libs"
+  BUILD_LIBS="$withval"
+fi;
+	echo "$as_me:3602: result: $BUILD_LIBS" >&5
+echo "${ECHO_T}$BUILD_LIBS" >&6
+
+	# this assumes we're on Unix.
+	BUILD_EXEEXT=
+	BUILD_OBJEXT=o
+
+	: ${BUILD_CC:='${CC}'}
+
+	if ( test "$BUILD_CC" = "$CC" || test "$BUILD_CC" = '${CC}' ) ; then
+		{ { echo "$as_me:3612: error: Cross-build requires two compilers.
+Use --with-build-cc to specify the native compiler." >&5
+echo "$as_me: error: Cross-build requires two compilers.
+Use --with-build-cc to specify the native compiler." >&2;}
+   { (exit 1); exit 1; }; }
+	fi
+
+else
+	: ${BUILD_CC:='${CC}'}
+	: ${BUILD_CPP:='${CPP}'}
+	: ${BUILD_CFLAGS:='${CFLAGS}'}
+	: ${BUILD_CPPFLAGS:='${CPPFLAGS}'}
+	: ${BUILD_LDFLAGS:='${LDFLAGS}'}
+	: ${BUILD_LIBS:='${LIBS}'}
+	: ${BUILD_EXEEXT:='$x'}
+	: ${BUILD_OBJEXT:='o'}
+fi
+
+###############################################################################
+
+### Options to allow the user to specify the set of libraries which are used.
+### Use "--without-normal --with-shared" to allow the default model to be
+### shared, for example.
+cf_list_models=""
+echo "$as_me:3636: checking for specified models" >&5
+echo $ECHO_N "checking for specified models... $ECHO_C" >&6
+test -z "$cf_list_models" && cf_list_models=normal
+echo "$as_me:3639: result: $cf_list_models" >&5
+echo "${ECHO_T}$cf_list_models" >&6
+
+### Use the first model as the default, and save its suffix for use in building
+### up test-applications.
+echo "$as_me:3644: checking for default model" >&5
+echo $ECHO_N "checking for default model... $ECHO_C" >&6
+DFT_LWR_MODEL=`echo "$cf_list_models" | $AWK '{print $1}'`
+echo "$as_me:3647: result: $DFT_LWR_MODEL" >&5
+echo "${ECHO_T}$DFT_LWR_MODEL" >&6
+
+DFT_UPR_MODEL=`echo "$DFT_LWR_MODEL" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
+
+# Check whether --with-curses-dir or --without-curses-dir was given.
+if test "${with_curses_dir+set}" = set; then
+  withval="$with_curses_dir"
+
+if test "x$prefix" != xNONE; then
+  cf_path_syntax="$prefix"
+else
+  cf_path_syntax="$ac_default_prefix"
+fi
+
+case ".$withval" in #(vi
+.\$\(*\)*|.\'*\'*) #(vi
+  ;;
+..|./*|.\\*) #(vi
+  ;;
+.[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
+  ;;
+.\${*prefix}*) #(vi
+  eval withval="$withval"
+  case ".$withval" in #(vi
+  .NONE/*)
+    withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
+    ;;
+  esac
+  ;; #(vi
+.no|.NONE/*)
+  withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
+  ;;
+*)
+  { { echo "$as_me:3681: error: expected a pathname, not \"$withval\"" >&5
+echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
+   { (exit 1); exit 1; }; }
+  ;;
+esac
+
+	 cf_cv_curses_dir=$withval
+else
+  cf_cv_curses_dir=no
+fi;
+
+echo "$as_me:3692: checking if you want wide-character code" >&5
+echo $ECHO_N "checking if you want wide-character code... $ECHO_C" >&6
+
+# Check whether --enable-widec or --disable-widec was given.
+if test "${enable_widec+set}" = set; then
+  enableval="$enable_widec"
+  with_widec=$enableval
+else
+  with_widec=no
+fi;
+echo "$as_me:3702: result: $with_widec" >&5
+echo "${ECHO_T}$with_widec" >&6
+if test "$with_widec" = yes ; then
+
+echo "$as_me:3706: checking for multibyte character support" >&5
+echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
+if test "${cf_cv_utf8_lib+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+	cf_save_LIBS="$LIBS"
+	cat >conftest.$ac_ext <<_ACEOF
+#line 3714 "configure"
+#include "confdefs.h"
+
+#include <stdlib.h>
+int
+main ()
+{
+putwc(0,0);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:3727: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:3730: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:3733: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:3736: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_utf8_lib=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+
+# If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
+# will be set on completion of the AC_TRY_LINK below.
+cf_cv_header_path_utf8=
+cf_cv_library_path_utf8=
+
+echo "${as_me:-configure}:3748: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
+
+cf_save_LIBS="$LIBS"
+
+cat >conftest.$ac_ext <<_ACEOF
+#line 3753 "configure"
+#include "confdefs.h"
+
+#include <libutf8.h>
+int
+main ()
+{
+putwc(0,0);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:3766: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:3769: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:3772: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:3775: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+
+	cf_cv_find_linkage_utf8=yes
+	cf_cv_header_path_utf8=/usr/include
+	cf_cv_library_path_utf8=/usr/lib
+
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+
+LIBS="-lutf8  $cf_save_LIBS"
+
+cat >conftest.$ac_ext <<_ACEOF
+#line 3789 "configure"
+#include "confdefs.h"
+
+#include <libutf8.h>
+int
+main ()
+{
+putwc(0,0);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:3802: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:3805: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:3808: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:3811: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+
+	cf_cv_find_linkage_utf8=yes
+	cf_cv_header_path_utf8=/usr/include
+	cf_cv_library_path_utf8=/usr/lib
+	cf_cv_library_file_utf8="-lutf8"
+
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+
+	cf_cv_find_linkage_utf8=no
+	LIBS="$cf_save_LIBS"
+
+    test -n "$verbose" && echo "	find linkage for utf8 library" 1>&6
+
+echo "${as_me:-configure}:3828: testing find linkage for utf8 library ..." 1>&5
+
+echo "${as_me:-configure}:3830: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
+
+    cf_save_CPPFLAGS="$CPPFLAGS"
+    cf_test_CPPFLAGS="$CPPFLAGS"
+
+cf_search=
+
+# collect the current set of include-directories from compiler flags
+cf_header_path_list=""
+if test -n "${CFLAGS}${CPPFLAGS}" ; then
+	for cf_header_path in $CPPFLAGS $CFLAGS
+	do
+		case $cf_header_path in #(vi
+		-I*)
+			cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
+
+test "$cf_header_path" != "NONE" && \
+test -d "$cf_header_path" && \
+ {
+	test -n "$verbose" && echo "	... testing for include-directories under $cf_header_path"
+	test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
+	test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
+	test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
+	test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
+	test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
+}
+
+			cf_header_path_list="$cf_header_path_list $cf_search"
+			;;
+		esac
+	done
+fi
+
+# add the variations for the package we are looking for
+
+cf_search=
+
+test "/usr" != "$prefix" && \
+test -d "/usr" && \
+(test $prefix = NONE || test "/usr" != "$prefix") && {
+	test -n "$verbose" && echo "	... testing for include-directories under /usr"
+	test -d /usr/include &&          cf_search="$cf_search /usr/include"
+	test -d /usr/include/utf8 &&       cf_search="$cf_search /usr/include/utf8"
+	test -d /usr/include/utf8/include &&    cf_search="$cf_search /usr/include/utf8/include"
+	test -d /usr/utf8/include &&       cf_search="$cf_search /usr/utf8/include"
+	test -d /usr/utf8/include/utf8 &&    cf_search="$cf_search /usr/utf8/include/utf8"
+}
+
+test "$prefix" != "NONE" && \
+test -d "$prefix" && \
+ {
+	test -n "$verbose" && echo "	... testing for include-directories under $prefix"
+	test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
+	test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
+	test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
+	test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
+	test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
+}
+
+test "/usr/local" != "$prefix" && \
+test -d "/usr/local" && \
+(test $prefix = NONE || test "/usr/local" != "$prefix") && {
+	test -n "$verbose" && echo "	... testing for include-directories under /usr/local"
+	test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
+	test -d /usr/local/include/utf8 &&       cf_search="$cf_search /usr/local/include/utf8"
+	test -d /usr/local/include/utf8/include &&    cf_search="$cf_search /usr/local/include/utf8/include"
+	test -d /usr/local/utf8/include &&       cf_search="$cf_search /usr/local/utf8/include"
+	test -d /usr/local/utf8/include/utf8 &&    cf_search="$cf_search /usr/local/utf8/include/utf8"
+}
+
+test "/opt" != "$prefix" && \
+test -d "/opt" && \
+(test $prefix = NONE || test "/opt" != "$prefix") && {
+	test -n "$verbose" && echo "	... testing for include-directories under /opt"
+	test -d /opt/include &&          cf_search="$cf_search /opt/include"
+	test -d /opt/include/utf8 &&       cf_search="$cf_search /opt/include/utf8"
+	test -d /opt/include/utf8/include &&    cf_search="$cf_search /opt/include/utf8/include"
+	test -d /opt/utf8/include &&       cf_search="$cf_search /opt/utf8/include"
+	test -d /opt/utf8/include/utf8 &&    cf_search="$cf_search /opt/utf8/include/utf8"
+}
+
+test "$HOME" != "$prefix" && \
+test -d "$HOME" && \
+(test $prefix = NONE || test "$HOME" != "$prefix") && {
+	test -n "$verbose" && echo "	... testing for include-directories under $HOME"
+	test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
+	test -d $HOME/include/utf8 &&       cf_search="$cf_search $HOME/include/utf8"
+	test -d $HOME/include/utf8/include &&    cf_search="$cf_search $HOME/include/utf8/include"
+	test -d $HOME/utf8/include &&       cf_search="$cf_search $HOME/utf8/include"
+	test -d $HOME/utf8/include/utf8 &&    cf_search="$cf_search $HOME/utf8/include/utf8"
+}
+
+test "$includedir" != NONE && \
+test "$includedir" != "/usr/include" && \
+test -d "$includedir" && {
+	test -d $includedir &&    cf_search="$cf_search $includedir"
+	test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
+}
+
+test "$oldincludedir" != NONE && \
+test "$oldincludedir" != "/usr/include" && \
+test -d "$oldincludedir" && {
+	test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
+	test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
+}
+
+cf_search="$cf_search $cf_header_path_list"
+
+    for cf_cv_header_path_utf8 in $cf_search
+    do
+      if test -d $cf_cv_header_path_utf8 ; then
+        test -n "$verbose" && echo "	... testing $cf_cv_header_path_utf8" 1>&6
+
+echo "${as_me:-configure}:3943: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
+
+        CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_utf8"
+        cat >conftest.$ac_ext <<_ACEOF
+#line 3947 "configure"
+#include "confdefs.h"
+
+#include <libutf8.h>
+int
+main ()
+{
+putwc(0,0);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:3960: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:3963: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:3966: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:3969: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+
+            test -n "$verbose" && echo "	... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
+
+echo "${as_me:-configure}:3974: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
+
+            cf_cv_find_linkage_utf8=maybe
+            cf_test_CPPFLAGS="$CPPFLAGS"
+            break
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+
+            CPPFLAGS="$cf_save_CPPFLAGS"
+
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+      fi
+    done
+
+    if test "$cf_cv_find_linkage_utf8" = maybe ; then
+
+echo "${as_me:-configure}:3992: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
+
+      cf_save_LIBS="$LIBS"
+      cf_save_LDFLAGS="$LDFLAGS"
+
+      if test "$cf_cv_find_linkage_utf8" != yes ; then
+
+cf_search=
+cf_library_path_list=""
+if test -n "${LDFLAGS}${LIBS}" ; then
+	for cf_library_path in $LDFLAGS $LIBS
+	do
+		case $cf_library_path in #(vi
+		-L*)
+			cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
+
+test "$cf_library_path" != "NONE" && \
+test -d "$cf_library_path" && \
+ {
+	test -n "$verbose" && echo "	... testing for lib-directories under $cf_library_path"
+	test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
+	test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
+	test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
+	test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
+	test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
+}
+
+			cf_library_path_list="$cf_library_path_list $cf_search"
+			;;
+		esac
+	done
+fi
+
+cf_search=
+
+test "/usr" != "$prefix" && \
+test -d "/usr" && \
+(test $prefix = NONE || test "/usr" != "$prefix") && {
+	test -n "$verbose" && echo "	... testing for lib-directories under /usr"
+	test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
+	test -d /usr/lib/utf8 &&       cf_search="$cf_search /usr/lib/utf8"
+	test -d /usr/lib/utf8/lib &&    cf_search="$cf_search /usr/lib/utf8/lib"
+	test -d /usr/utf8/lib &&       cf_search="$cf_search /usr/utf8/lib"
+	test -d /usr/utf8/lib/utf8 &&    cf_search="$cf_search /usr/utf8/lib/utf8"
+}
+
+test "$prefix" != "NONE" && \
+test -d "$prefix" && \
+ {
+	test -n "$verbose" && echo "	... testing for lib-directories under $prefix"
+	test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
+	test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
+	test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
+	test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
+	test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
+}
+
+test "/usr/local" != "$prefix" && \
+test -d "/usr/local" && \
+(test $prefix = NONE || test "/usr/local" != "$prefix") && {
+	test -n "$verbose" && echo "	... testing for lib-directories under /usr/local"
+	test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
+	test -d /usr/local/lib/utf8 &&       cf_search="$cf_search /usr/local/lib/utf8"
+	test -d /usr/local/lib/utf8/lib &&    cf_search="$cf_search /usr/local/lib/utf8/lib"
+	test -d /usr/local/utf8/lib &&       cf_search="$cf_search /usr/local/utf8/lib"
+	test -d /usr/local/utf8/lib/utf8 &&    cf_search="$cf_search /usr/local/utf8/lib/utf8"
+}
+
+test "/opt" != "$prefix" && \
+test -d "/opt" && \
+(test $prefix = NONE || test "/opt" != "$prefix") && {
+	test -n "$verbose" && echo "	... testing for lib-directories under /opt"
+	test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
+	test -d /opt/lib/utf8 &&       cf_search="$cf_search /opt/lib/utf8"
+	test -d /opt/lib/utf8/lib &&    cf_search="$cf_search /opt/lib/utf8/lib"
+	test -d /opt/utf8/lib &&       cf_search="$cf_search /opt/utf8/lib"
+	test -d /opt/utf8/lib/utf8 &&    cf_search="$cf_search /opt/utf8/lib/utf8"
+}
+
+test "$HOME" != "$prefix" && \
+test -d "$HOME" && \
+(test $prefix = NONE || test "$HOME" != "$prefix") && {
+	test -n "$verbose" && echo "	... testing for lib-directories under $HOME"
+	test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
+	test -d $HOME/lib/utf8 &&       cf_search="$cf_search $HOME/lib/utf8"
+	test -d $HOME/lib/utf8/lib &&    cf_search="$cf_search $HOME/lib/utf8/lib"
+	test -d $HOME/utf8/lib &&       cf_search="$cf_search $HOME/utf8/lib"
+	test -d $HOME/utf8/lib/utf8 &&    cf_search="$cf_search $HOME/utf8/lib/utf8"
+}
+
+cf_search="$cf_library_path_list $cf_search"
+
+        for cf_cv_library_path_utf8 in $cf_search
+        do
+          if test -d $cf_cv_library_path_utf8 ; then
+            test -n "$verbose" && echo "	... testing $cf_cv_library_path_utf8" 1>&6
+
+echo "${as_me:-configure}:4089: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
+
+            CPPFLAGS="$cf_test_CPPFLAGS"
+            LIBS="-lutf8  $cf_save_LIBS"
+            LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
+            cat >conftest.$ac_ext <<_ACEOF
+#line 4095 "configure"
+#include "confdefs.h"
+
+#include <libutf8.h>
+int
+main ()
+{
+putwc(0,0);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:4108: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:4111: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:4114: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:4117: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+
+                test -n "$verbose" && echo "	... found utf8 library in $cf_cv_library_path_utf8" 1>&6
+
+echo "${as_me:-configure}:4122: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
+
+                cf_cv_find_linkage_utf8=yes
+                cf_cv_library_file_utf8="-lutf8"
+                break
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+
+                CPPFLAGS="$cf_save_CPPFLAGS"
+                LIBS="$cf_save_LIBS"
+                LDFLAGS="$cf_save_LDFLAGS"
+
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+          fi
+        done
+        CPPFLAGS="$cf_save_CPPFLAGS"
+        LDFLAGS="$cf_save_LDFLAGS"
+      fi
+
+    else
+      cf_cv_find_linkage_utf8=no
+    fi
+
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+
+LIBS="$cf_save_LIBS"
+
+if test "$cf_cv_find_linkage_utf8" = yes ; then
+cf_cv_utf8_lib=add-on
+else
+cf_cv_utf8_lib=no
+fi
+
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:4164: result: $cf_cv_utf8_lib" >&5
+echo "${ECHO_T}$cf_cv_utf8_lib" >&6
+
+# HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
+# ncurses/ncursesw:
+if test "$cf_cv_utf8_lib" = "add-on" ; then
+	cat >>confdefs.h <<\EOF
+#define HAVE_LIBUTF8_H 1
+EOF
+
+if test -n "$cf_cv_header_path_utf8" ; then
+  for cf_add_incdir in $cf_cv_header_path_utf8
+  do
+	while test $cf_add_incdir != /usr/include
+	do
+	  if test -d $cf_add_incdir
+	  then
+		cf_have_incdir=no
+		if test -n "$CFLAGS$CPPFLAGS" ; then
+		  # a loop is needed to ensure we can add subdirs of existing dirs
+		  for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
+			if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
+			  cf_have_incdir=yes; break
+			fi
+		  done
+		fi
+
+		if test "$cf_have_incdir" = no ; then
+		  if test "$cf_add_incdir" = /usr/local/include ; then
+			if test "$GCC" = yes
+			then
+			  cf_save_CPPFLAGS=$CPPFLAGS
+			  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
+			  cat >conftest.$ac_ext <<_ACEOF
+#line 4198 "configure"
+#include "confdefs.h"
+#include <stdio.h>
+int
+main ()
+{
+printf("Hello")
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:4210: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:4213: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:4216: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:4219: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_have_incdir=yes
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+			  CPPFLAGS=$cf_save_CPPFLAGS
+			fi
+		  fi
+		fi
+
+		if test "$cf_have_incdir" = no ; then
+		  test -n "$verbose" && echo "	adding $cf_add_incdir to include-path" 1>&6
+
+echo "${as_me:-configure}:4236: testing adding $cf_add_incdir to include-path ..." 1>&5
+
+		  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
+
+		  cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
+		  test "$cf_top_incdir" = "$cf_add_incdir" && break
+		  cf_add_incdir="$cf_top_incdir"
+		else
+		  break
+		fi
+	  fi
+	done
+  done
+fi
+
+if test -n "$cf_cv_library_path_utf8" ; then
+  for cf_add_libdir in $cf_cv_library_path_utf8
+  do
+    if test $cf_add_libdir = /usr/lib ; then
+      :
+    elif test -d $cf_add_libdir
+    then
+      cf_have_libdir=no
+      if test -n "$LDFLAGS$LIBS" ; then
+        # a loop is needed to ensure we can add subdirs of existing dirs
+        for cf_test_libdir in $LDFLAGS $LIBS ; do
+          if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
+            cf_have_libdir=yes; break
+          fi
+        done
+      fi
+      if test "$cf_have_libdir" = no ; then
+        test -n "$verbose" && echo "	adding $cf_add_libdir to library-path" 1>&6
+
+echo "${as_me:-configure}:4270: testing adding $cf_add_libdir to library-path ..." 1>&5
+
+        LDFLAGS="-L$cf_add_libdir $LDFLAGS"
+      fi
+    fi
+  done
+fi
+
+	LIBS="$cf_cv_library_file_utf8 $LIBS"
+fi
+
+cf_ncuconfig_root=ncursesw
+
+echo "Looking for ${cf_ncuconfig_root}-config"
+for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:4288: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_NCURSES_CONFIG+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $NCURSES_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  if $as_executable_p "$ac_dir/$ac_word"; then
+   ac_cv_path_NCURSES_CONFIG="$ac_dir/$ac_word"
+   echo "$as_me:4305: found $ac_dir/$ac_word" >&5
+   break
+fi
+done
+
+  ;;
+esac
+fi
+NCURSES_CONFIG=$ac_cv_path_NCURSES_CONFIG
+
+if test -n "$NCURSES_CONFIG"; then
+  echo "$as_me:4316: result: $NCURSES_CONFIG" >&5
+echo "${ECHO_T}$NCURSES_CONFIG" >&6
+else
+  echo "$as_me:4319: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  test -n "$NCURSES_CONFIG" && break
+done
+test -n "$NCURSES_CONFIG" || NCURSES_CONFIG="none"
+
+if test "$NCURSES_CONFIG" != none ; then
+
+CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
+LIBS="`$NCURSES_CONFIG --libs` $LIBS"
+
+# even with config script, some packages use no-override for curses.h
+
+echo "$as_me:4334: checking if we have identified curses headers" >&5
+echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
+if test "${cf_cv_ncurses_header+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+cf_cv_ncurses_header=none
+for cf_header in  \
+    ncursesw/curses.h \
+	ncursesw/ncurses.h \
+	curses.h \
+	ncurses.h
+do
+cat >conftest.$ac_ext <<_ACEOF
+#line 4348 "configure"
+#include "confdefs.h"
+#include <${cf_header}>
+int
+main ()
+{
+initscr(); tgoto("?", 0,0)
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:4360: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:4363: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:4366: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:4369: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_ncurses_header=$cf_header; break
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+done
+
+fi
+echo "$as_me:4380: result: $cf_cv_ncurses_header" >&5
+echo "${ECHO_T}$cf_cv_ncurses_header" >&6
+
+if test "$cf_cv_ncurses_header" = none ; then
+	{ { echo "$as_me:4384: error: No curses header-files found" >&5
+echo "$as_me: error: No curses header-files found" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+# cheat, to get the right #define's for HAVE_NCURSES_H, etc.
+
+for ac_header in $cf_cv_ncurses_header
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+echo "$as_me:4394: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 4400 "configure"
+#include "confdefs.h"
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:4404: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  egrep -v '^ *\+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:4410: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  eval "$as_ac_Header=yes"
+else
+  echo "$as_me: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  eval "$as_ac_Header=no"
+fi
+rm -f conftest.err conftest.$ac_ext
+fi
+echo "$as_me:4429: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+EOF
+
+fi
+done
+
+cat >>confdefs.h <<\EOF
+#define NCURSES 1
+EOF
+
+cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
+
+cat >>confdefs.h <<EOF
+#define $cf_nculib_ROOT 1
+EOF
+
+cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
+
+else
+
+cf_ncuhdr_root=ncursesw
+
+test -n "$cf_cv_curses_dir" && \
+test "$cf_cv_curses_dir" != "no" && { \
+
+if test -n "$cf_cv_curses_dir/include $cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
+  for cf_add_incdir in $cf_cv_curses_dir/include $cf_cv_curses_dir/include/$cf_ncuhdr_root
+  do
+	while test $cf_add_incdir != /usr/include
+	do
+	  if test -d $cf_add_incdir
+	  then
+		cf_have_incdir=no
+		if test -n "$CFLAGS$CPPFLAGS" ; then
+		  # a loop is needed to ensure we can add subdirs of existing dirs
+		  for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
+			if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
+			  cf_have_incdir=yes; break
+			fi
+		  done
+		fi
+
+		if test "$cf_have_incdir" = no ; then
+		  if test "$cf_add_incdir" = /usr/local/include ; then
+			if test "$GCC" = yes
+			then
+			  cf_save_CPPFLAGS=$CPPFLAGS
+			  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
+			  cat >conftest.$ac_ext <<_ACEOF
+#line 4482 "configure"
+#include "confdefs.h"
+#include <stdio.h>
+int
+main ()
+{
+printf("Hello")
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:4494: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:4497: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:4500: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:4503: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_have_incdir=yes
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+			  CPPFLAGS=$cf_save_CPPFLAGS
+			fi
+		  fi
+		fi
+
+		if test "$cf_have_incdir" = no ; then
+		  test -n "$verbose" && echo "	adding $cf_add_incdir to include-path" 1>&6
+
+echo "${as_me:-configure}:4520: testing adding $cf_add_incdir to include-path ..." 1>&5
+
+		  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
+
+		  cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
+		  test "$cf_top_incdir" = "$cf_add_incdir" && break
+		  cf_add_incdir="$cf_top_incdir"
+		else
+		  break
+		fi
+	  fi
+	done
+  done
+fi
+
+}
+
+echo "$as_me:4537: checking for $cf_ncuhdr_root header in include-path" >&5
+echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
+if test "${cf_cv_ncurses_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+	cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
+	( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
+	for cf_header in $cf_header_list
+	do
+
+	cat >conftest.$ac_ext <<_ACEOF
+#line 4549 "configure"
+#include "confdefs.h"
+
+#define _XOPEN_SOURCE_EXTENDED
+#undef  HAVE_LIBUTF8_H	/* in case we used CF_UTF8_LIB */
+#define HAVE_LIBUTF8_H	/* to force ncurses' header file to use cchar_t */
+
+#include <$cf_header>
+int
+main ()
+{
+
+#ifdef NCURSES_VERSION
+
+#ifndef WACS_BSSB
+	make an error
+#endif
+
+printf("%s\n", NCURSES_VERSION);
+#else
+#ifdef __NCURSES_H
+printf("old\n");
+#else
+	make an error
+#endif
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:4581: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:4584: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:4587: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:4590: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_ncurses_h=$cf_header
+
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_ncurses_h=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+		test "$cf_cv_ncurses_h" != no && break
+	done
+
+fi
+echo "$as_me:4605: result: $cf_cv_ncurses_h" >&5
+echo "${ECHO_T}$cf_cv_ncurses_h" >&6
+
+if test "$cf_cv_ncurses_h" != no ; then
+	cf_cv_ncurses_header=$cf_cv_ncurses_h
+else
+
+echo "$as_me:4612: checking for $cf_ncuhdr_root include-path" >&5
+echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
+if test "${cf_cv_ncurses_h2+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+	test -n "$verbose" && echo
+
+cf_search=
+
+# collect the current set of include-directories from compiler flags
+cf_header_path_list=""
+if test -n "${CFLAGS}${CPPFLAGS}" ; then
+	for cf_header_path in $CPPFLAGS $CFLAGS
+	do
+		case $cf_header_path in #(vi
+		-I*)
+			cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
+
+test "$cf_header_path" != "NONE" && \
+test -d "$cf_header_path" && \
+ {
+	test -n "$verbose" && echo "	... testing for include-directories under $cf_header_path"
+	test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
+	test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
+	test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
+	test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
+	test -d $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
+}
+
+			cf_header_path_list="$cf_header_path_list $cf_search"
+			;;
+		esac
+	done
+fi
+
+# add the variations for the package we are looking for
+
+cf_search=
+
+test "/usr" != "$prefix" && \
+test -d "/usr" && \
+(test $prefix = NONE || test "/usr" != "$prefix") && {
+	test -n "$verbose" && echo "	... testing for include-directories under /usr"
+	test -d /usr/include &&          cf_search="$cf_search /usr/include"
+	test -d /usr/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
+	test -d /usr/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include"
+	test -d /usr/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/$cf_ncuhdr_root/include"
+	test -d /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
+}
+
+test "$prefix" != "NONE" && \
+test -d "$prefix" && \
+ {
+	test -n "$verbose" && echo "	... testing for include-directories under $prefix"
+	test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
+	test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
+	test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
+	test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
+	test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
+}
+
+test "/usr/local" != "$prefix" && \
+test -d "/usr/local" && \
+(test $prefix = NONE || test "/usr/local" != "$prefix") && {
+	test -n "$verbose" && echo "	... testing for include-directories under /usr/local"
+	test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
+	test -d /usr/local/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
+	test -d /usr/local/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include"
+	test -d /usr/local/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include"
+	test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
+}
+
+test "/opt" != "$prefix" && \
+test -d "/opt" && \
+(test $prefix = NONE || test "/opt" != "$prefix") && {
+	test -n "$verbose" && echo "	... testing for include-directories under /opt"
+	test -d /opt/include &&          cf_search="$cf_search /opt/include"
+	test -d /opt/include/$cf_ncuhdr_root &&       cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
+	test -d /opt/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include"
+	test -d /opt/$cf_ncuhdr_root/include &&       cf_search="$cf_search /opt/$cf_ncuhdr_root/include"
+	test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
+}
+
+test "$HOME" != "$prefix" && \
+test -d "$HOME" && \
+(test $prefix = NONE || test "$HOME" != "$prefix") && {
+	test -n "$verbose" && echo "	... testing for include-directories under $HOME"
+	test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
+	test -d $HOME/include/$cf_ncuhdr_root &&       cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
+	test -d $HOME/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include"
+	test -d $HOME/$cf_ncuhdr_root/include &&       cf_search="$cf_search $HOME/$cf_ncuhdr_root/include"
+	test -d $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
+}
+
+test "$includedir" != NONE && \
+test "$includedir" != "/usr/include" && \
+test -d "$includedir" && {
+	test -d $includedir &&    cf_search="$cf_search $includedir"
+	test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
+}
+
+test "$oldincludedir" != NONE && \
+test "$oldincludedir" != "/usr/include" && \
+test -d "$oldincludedir" && {
+	test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
+	test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
+}
+
+cf_search="$cf_search $cf_header_path_list"
+
+	test -n "$verbose" && echo search path $cf_search
+	cf_save2_CPPFLAGS="$CPPFLAGS"
+	for cf_incdir in $cf_search
+	do
+
+if test -n "$cf_incdir" ; then
+  for cf_add_incdir in $cf_incdir
+  do
+	while test $cf_add_incdir != /usr/include
+	do
+	  if test -d $cf_add_incdir
+	  then
+		cf_have_incdir=no
+		if test -n "$CFLAGS$CPPFLAGS" ; then
+		  # a loop is needed to ensure we can add subdirs of existing dirs
+		  for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
+			if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
+			  cf_have_incdir=yes; break
+			fi
+		  done
+		fi
+
+		if test "$cf_have_incdir" = no ; then
+		  if test "$cf_add_incdir" = /usr/local/include ; then
+			if test "$GCC" = yes
+			then
+			  cf_save_CPPFLAGS=$CPPFLAGS
+			  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
+			  cat >conftest.$ac_ext <<_ACEOF
+#line 4752 "configure"
+#include "confdefs.h"
+#include <stdio.h>
+int
+main ()
+{
+printf("Hello")
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:4764: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:4767: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:4770: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:4773: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_have_incdir=yes
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+			  CPPFLAGS=$cf_save_CPPFLAGS
+			fi
+		  fi
+		fi
+
+		if test "$cf_have_incdir" = no ; then
+		  test -n "$verbose" && echo "	adding $cf_add_incdir to include-path" 1>&6
+
+echo "${as_me:-configure}:4790: testing adding $cf_add_incdir to include-path ..." 1>&5
+
+		  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
+
+		  cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
+		  test "$cf_top_incdir" = "$cf_add_incdir" && break
+		  cf_add_incdir="$cf_top_incdir"
+		else
+		  break
+		fi
+	  fi
+	done
+  done
+fi
+
+		for cf_header in \
+			ncurses.h \
+			curses.h
+		do
+
+	cat >conftest.$ac_ext <<_ACEOF
+#line 4811 "configure"
+#include "confdefs.h"
+
+#include <$cf_header>
+int
+main ()
+{
+
+#ifdef NCURSES_VERSION
+
+printf("%s\n", NCURSES_VERSION);
+#else
+#ifdef __NCURSES_H
+printf("old\n");
+#else
+	make an error
+#endif
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:4835: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:4838: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:4841: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:4844: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_ncurses_h2=$cf_header
+
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_ncurses_h2=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+			if test "$cf_cv_ncurses_h2" != no ; then
+				cf_cv_ncurses_h2=$cf_incdir/$cf_header
+				test -n "$verbose" && echo $ac_n "	... found $ac_c" 1>&6
+				break
+			fi
+			test -n "$verbose" && echo "	... tested $cf_incdir/$cf_header" 1>&6
+		done
+		CPPFLAGS="$cf_save2_CPPFLAGS"
+		test "$cf_cv_ncurses_h2" != no && break
+	done
+	test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:4865: error: not found" >&5
+echo "$as_me: error: not found" >&2;}
+   { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:4870: result: $cf_cv_ncurses_h2" >&5
+echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
+
+	cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
+	cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
+	if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
+		cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
+	fi
+
+if test -n "$cf_1st_incdir" ; then
+  for cf_add_incdir in $cf_1st_incdir
+  do
+	while test $cf_add_incdir != /usr/include
+	do
+	  if test -d $cf_add_incdir
+	  then
+		cf_have_incdir=no
+		if test -n "$CFLAGS$CPPFLAGS" ; then
+		  # a loop is needed to ensure we can add subdirs of existing dirs
+		  for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
+			if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
+			  cf_have_incdir=yes; break
+			fi
+		  done
+		fi
+
+		if test "$cf_have_incdir" = no ; then
+		  if test "$cf_add_incdir" = /usr/local/include ; then
+			if test "$GCC" = yes
+			then
+			  cf_save_CPPFLAGS=$CPPFLAGS
+			  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
+			  cat >conftest.$ac_ext <<_ACEOF
+#line 4903 "configure"
+#include "confdefs.h"
+#include <stdio.h>
+int
+main ()
+{
+printf("Hello")
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:4915: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:4918: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:4921: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:4924: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_have_incdir=yes
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+			  CPPFLAGS=$cf_save_CPPFLAGS
+			fi
+		  fi
+		fi
+
+		if test "$cf_have_incdir" = no ; then
+		  test -n "$verbose" && echo "	adding $cf_add_incdir to include-path" 1>&6
+
+echo "${as_me:-configure}:4941: testing adding $cf_add_incdir to include-path ..." 1>&5
+
+		  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
+
+		  cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
+		  test "$cf_top_incdir" = "$cf_add_incdir" && break
+		  cf_add_incdir="$cf_top_incdir"
+		else
+		  break
+		fi
+	  fi
+	done
+  done
+fi
+
+fi
+
+# Set definitions to allow ifdef'ing for ncurses.h
+
+case $cf_cv_ncurses_header in # (vi
+*ncurses.h)
+	cat >>confdefs.h <<\EOF
+#define HAVE_NCURSES_H 1
+EOF
+
+	;;
+esac
+
+case $cf_cv_ncurses_header in # (vi
+ncurses/curses.h|ncurses/ncurses.h)
+	cat >>confdefs.h <<\EOF
+#define HAVE_NCURSES_NCURSES_H 1
+EOF
+
+	;;
+ncursesw/curses.h|ncursesw/ncurses.h)
+	cat >>confdefs.h <<\EOF
+#define HAVE_NCURSESW_NCURSES_H 1
+EOF
+
+	;;
+esac
+
+echo "$as_me:4984: checking for terminfo header" >&5
+echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
+if test "${cf_cv_term_header+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+case ${cf_cv_ncurses_header} in #(vi
+*/ncurses.h|*/ncursesw.h) #(vi
+	cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
+	;;
+*)
+	cf_term_header=term.h
+	;;
+esac
+
+for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
+do
+cat >conftest.$ac_ext <<_ACEOF
+#line 5002 "configure"
+#include "confdefs.h"
+#include <stdio.h>
+#include <${cf_cv_ncurses_header:-curses.h}>
+#include <$cf_test>
+
+int
+main ()
+{
+int x = auto_left_margin
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:5017: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:5020: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:5023: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:5026: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+
+	cf_cv_term_header="$cf_test"
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+
+	cf_cv_term_header=unknown
+
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+	test "$cf_cv_term_header" != unknown && break
+done
+
+fi
+echo "$as_me:5042: result: $cf_cv_term_header" >&5
+echo "${ECHO_T}$cf_cv_term_header" >&6
+
+# Set definitions to allow ifdef'ing to accommodate subdirectories
+
+case $cf_cv_term_header in # (vi
+*term.h)
+	cat >>confdefs.h <<\EOF
+#define HAVE_TERM_H 1
+EOF
+
+	;;
+esac
+
+case $cf_cv_term_header in # (vi
+ncurses/term.h) #(vi
+	cat >>confdefs.h <<\EOF
+#define HAVE_NCURSES_TERM_H 1
+EOF
+
+	;;
+ncursesw/term.h)
+	cat >>confdefs.h <<\EOF
+#define HAVE_NCURSESW_TERM_H 1
+EOF
+
+	;;
+esac
+
+# some applications need this, but should check for NCURSES_VERSION
+cat >>confdefs.h <<\EOF
+#define NCURSES 1
+EOF
+
+echo "$as_me:5076: checking for ncurses version" >&5
+echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
+if test "${cf_cv_ncurses_version+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+	cf_cv_ncurses_version=no
+	cf_tempfile=out$$
+	rm -f $cf_tempfile
+	if test "$cross_compiling" = yes; then
+
+	# This will not work if the preprocessor splits the line after the
+	# Autoconf token.  The 'unproto' program does that.
+	cat > conftest.$ac_ext <<EOF
+#include <${cf_cv_ncurses_header:-curses.h}>
+#undef Autoconf
+#ifdef NCURSES_VERSION
+Autoconf NCURSES_VERSION
+#else
+#ifdef __NCURSES_H
+Autoconf "old"
+#endif
+;
+#endif
+EOF
+	cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
+	{ (eval echo "$as_me:5102: \"$cf_try\"") >&5
+  (eval $cf_try) 2>&5
+  ac_status=$?
+  echo "$as_me:5105: \$? = $ac_status" >&5
+  (exit $ac_status); }
+	if test -f conftest.out ; then
+		cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
+		test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
+		rm -f conftest.out
+	fi
+
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 5115 "configure"
+#include "confdefs.h"
+
+#include <${cf_cv_ncurses_header:-curses.h}>
+#include <stdio.h>
+int main()
+{
+	FILE *fp = fopen("$cf_tempfile", "w");
+#ifdef NCURSES_VERSION
+# ifdef NCURSES_VERSION_PATCH
+	fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
+# else
+	fprintf(fp, "%s\n", NCURSES_VERSION);
+# endif
+#else
+# ifdef __NCURSES_H
+	fprintf(fp, "old\n");
+# else
+	make an error
+# endif
+#endif
+	${cf_cv_main_return:-return}(0);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:5140: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:5143: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:5145: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:5148: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+
+	cf_cv_ncurses_version=`cat $cf_tempfile`
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+	rm -f $cf_tempfile
+
+fi
+echo "$as_me:5162: result: $cf_cv_ncurses_version" >&5
+echo "${ECHO_T}$cf_cv_ncurses_version" >&6
+test "$cf_cv_ncurses_version" = no || cat >>confdefs.h <<\EOF
+#define NCURSES 1
+EOF
+
+cf_nculib_root=ncursesw
+	# This works, except for the special case where we find gpm, but
+	# ncurses is in a nonstandard location via $LIBS, and we really want
+	# to link gpm.
+cf_ncurses_LIBS=""
+cf_ncurses_SAVE="$LIBS"
+echo "$as_me:5174: checking for Gpm_Open in -lgpm" >&5
+echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
+if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lgpm  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line 5182 "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char Gpm_Open ();
+int
+main ()
+{
+Gpm_Open ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:5201: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:5204: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:5207: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:5210: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_gpm_Gpm_Open=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_gpm_Gpm_Open=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:5221: result: $ac_cv_lib_gpm_Gpm_Open" >&5
+echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
+if test $ac_cv_lib_gpm_Gpm_Open = yes; then
+  echo "$as_me:5224: checking for initscr in -lgpm" >&5
+echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
+if test "${ac_cv_lib_gpm_initscr+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lgpm  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line 5232 "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char initscr ();
+int
+main ()
+{
+initscr ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:5251: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:5254: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:5257: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:5260: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_gpm_initscr=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_gpm_initscr=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:5271: result: $ac_cv_lib_gpm_initscr" >&5
+echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
+if test $ac_cv_lib_gpm_initscr = yes; then
+  LIBS="$cf_ncurses_SAVE"
+else
+  cf_ncurses_LIBS="-lgpm"
+fi
+
+fi
+
+case $host_os in #(vi
+freebsd*)
+	# This is only necessary if you are linking against an obsolete
+	# version of ncurses (but it should do no harm, since it's static).
+	if test "$cf_nculib_root" = ncurses ; then
+		echo "$as_me:5286: checking for tgoto in -lmytinfo" >&5
+echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
+if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lmytinfo  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line 5294 "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char tgoto ();
+int
+main ()
+{
+tgoto ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:5313: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:5316: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:5319: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:5322: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_mytinfo_tgoto=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_mytinfo_tgoto=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:5333: result: $ac_cv_lib_mytinfo_tgoto" >&5
+echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
+if test $ac_cv_lib_mytinfo_tgoto = yes; then
+  cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
+fi
+
+	fi
+	;;
+esac
+
+LIBS="$cf_ncurses_LIBS $LIBS"
+
+if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
+then
+
+if test -n "$cf_cv_curses_dir/lib" ; then
+  for cf_add_libdir in $cf_cv_curses_dir/lib
+  do
+    if test $cf_add_libdir = /usr/lib ; then
+      :
+    elif test -d $cf_add_libdir
+    then
+      cf_have_libdir=no
+      if test -n "$LDFLAGS$LIBS" ; then
+        # a loop is needed to ensure we can add subdirs of existing dirs
+        for cf_test_libdir in $LDFLAGS $LIBS ; do
+          if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
+            cf_have_libdir=yes; break
+          fi
+        done
+      fi
+      if test "$cf_have_libdir" = no ; then
+        test -n "$verbose" && echo "	adding $cf_add_libdir to library-path" 1>&6
+
+echo "${as_me:-configure}:5367: testing adding $cf_add_libdir to library-path ..." 1>&5
+
+        LDFLAGS="-L$cf_add_libdir $LDFLAGS"
+      fi
+    fi
+  done
+fi
+
+	LIBS="-l$cf_nculib_root $LIBS"
+else
+
+	eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
+	cf_libdir=""
+	echo "$as_me:5380: checking for initscr" >&5
+echo $ECHO_N "checking for initscr... $ECHO_C" >&6
+if test "${ac_cv_func_initscr+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 5386 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char initscr (); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char initscr ();
+char (*f) ();
+
+int
+main ()
+{
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_initscr) || defined (__stub___initscr)
+choke me
+#else
+f = initscr;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:5417: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:5420: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:5423: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:5426: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_initscr=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_func_initscr=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:5436: result: $ac_cv_func_initscr" >&5
+echo "${ECHO_T}$ac_cv_func_initscr" >&6
+if test $ac_cv_func_initscr = yes; then
+  eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
+else
+
+		cf_save_LIBS="$LIBS"
+		echo "$as_me:5443: checking for initscr in -l$cf_nculib_root" >&5
+echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
+		LIBS="-l$cf_nculib_root $LIBS"
+		cat >conftest.$ac_ext <<_ACEOF
+#line 5447 "configure"
+#include "confdefs.h"
+#include <${cf_cv_ncurses_header:-curses.h}>
+int
+main ()
+{
+initscr()
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:5459: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:5462: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:5465: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:5468: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  echo "$as_me:5470: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+			 eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
+
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+echo "$as_me:5477: result: no" >&5
+echo "${ECHO_T}no" >&6
+
+cf_search=
+cf_library_path_list=""
+if test -n "${LDFLAGS}${LIBS}" ; then
+	for cf_library_path in $LDFLAGS $LIBS
+	do
+		case $cf_library_path in #(vi
+		-L*)
+			cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
+
+test "$cf_library_path" != "NONE" && \
+test -d "$cf_library_path" && \
+ {
+	test -n "$verbose" && echo "	... testing for lib-directories under $cf_library_path"
+	test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
+	test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
+	test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
+	test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
+	test -d $cf_library_path/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib/$cf_nculib_root"
+}
+
+			cf_library_path_list="$cf_library_path_list $cf_search"
+			;;
+		esac
+	done
+fi
+
+cf_search=
+
+test "/usr" != "$prefix" && \
+test -d "/usr" && \
+(test $prefix = NONE || test "/usr" != "$prefix") && {
+	test -n "$verbose" && echo "	... testing for lib-directories under /usr"
+	test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
+	test -d /usr/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/lib/$cf_nculib_root"
+	test -d /usr/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/lib/$cf_nculib_root/lib"
+	test -d /usr/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/$cf_nculib_root/lib"
+	test -d /usr/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/$cf_nculib_root/lib/$cf_nculib_root"
+}
+
+test "$prefix" != "NONE" && \
+test -d "$prefix" && \
+ {
+	test -n "$verbose" && echo "	... testing for lib-directories under $prefix"
+	test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
+	test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
+	test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
+	test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
+	test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
+}
+
+test "/usr/local" != "$prefix" && \
+test -d "/usr/local" && \
+(test $prefix = NONE || test "/usr/local" != "$prefix") && {
+	test -n "$verbose" && echo "	... testing for lib-directories under /usr/local"
+	test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
+	test -d /usr/local/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/local/lib/$cf_nculib_root"
+	test -d /usr/local/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib"
+	test -d /usr/local/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/local/$cf_nculib_root/lib"
+	test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root"
+}
+
+test "/opt" != "$prefix" && \
+test -d "/opt" && \
+(test $prefix = NONE || test "/opt" != "$prefix") && {
+	test -n "$verbose" && echo "	... testing for lib-directories under /opt"
+	test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
+	test -d /opt/lib/$cf_nculib_root &&       cf_search="$cf_search /opt/lib/$cf_nculib_root"
+	test -d /opt/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /opt/lib/$cf_nculib_root/lib"
+	test -d /opt/$cf_nculib_root/lib &&       cf_search="$cf_search /opt/$cf_nculib_root/lib"
+	test -d /opt/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root"
+}
+
+test "$HOME" != "$prefix" && \
+test -d "$HOME" && \
+(test $prefix = NONE || test "$HOME" != "$prefix") && {
+	test -n "$verbose" && echo "	... testing for lib-directories under $HOME"
+	test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
+	test -d $HOME/lib/$cf_nculib_root &&       cf_search="$cf_search $HOME/lib/$cf_nculib_root"
+	test -d $HOME/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib"
+	test -d $HOME/$cf_nculib_root/lib &&       cf_search="$cf_search $HOME/$cf_nculib_root/lib"
+	test -d $HOME/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root"
+}
+
+cf_search="$cf_library_path_list $cf_search"
+
+			for cf_libdir in $cf_search
+			do
+				echo "$as_me:5567: checking for -l$cf_nculib_root in $cf_libdir" >&5
+echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
+				LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
+				cat >conftest.$ac_ext <<_ACEOF
+#line 5571 "configure"
+#include "confdefs.h"
+#include <${cf_cv_ncurses_header:-curses.h}>
+int
+main ()
+{
+initscr()
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:5583: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:5586: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:5589: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:5592: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  echo "$as_me:5594: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+			 		 eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
+					 break
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+echo "$as_me:5601: result: no" >&5
+echo "${ECHO_T}no" >&6
+					 LIBS="$cf_save_LIBS"
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+			done
+
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+
+fi
+
+eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
+
+if test $cf_found_library = no ; then
+	{ { echo "$as_me:5616: error: Cannot link $cf_nculib_root library" >&5
+echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+fi
+
+if test -n "$cf_ncurses_LIBS" ; then
+	echo "$as_me:5624: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
+echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
+	cf_ncurses_SAVE="$LIBS"
+	for p in $cf_ncurses_LIBS ; do
+		q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
+		if test "$q" != "$LIBS" ; then
+			LIBS="$q"
+		fi
+	done
+	cat >conftest.$ac_ext <<_ACEOF
+#line 5634 "configure"
+#include "confdefs.h"
+#include <${cf_cv_ncurses_header:-curses.h}>
+int
+main ()
+{
+initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:5646: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:5649: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:5652: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:5655: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  echo "$as_me:5657: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+echo "$as_me:5662: result: no" >&5
+echo "${ECHO_T}no" >&6
+		 LIBS="$cf_ncurses_SAVE"
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+
+cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
+
+cat >>confdefs.h <<EOF
+#define $cf_nculib_ROOT 1
+EOF
+
+fi
+
+else
+
+cf_ncuconfig_root=ncurses
+
+echo "Looking for ${cf_ncuconfig_root}-config"
+for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:5686: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_NCURSES_CONFIG+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $NCURSES_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  if $as_executable_p "$ac_dir/$ac_word"; then
+   ac_cv_path_NCURSES_CONFIG="$ac_dir/$ac_word"
+   echo "$as_me:5703: found $ac_dir/$ac_word" >&5
+   break
+fi
+done
+
+  ;;
+esac
+fi
+NCURSES_CONFIG=$ac_cv_path_NCURSES_CONFIG
+
+if test -n "$NCURSES_CONFIG"; then
+  echo "$as_me:5714: result: $NCURSES_CONFIG" >&5
+echo "${ECHO_T}$NCURSES_CONFIG" >&6
+else
+  echo "$as_me:5717: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  test -n "$NCURSES_CONFIG" && break
+done
+test -n "$NCURSES_CONFIG" || NCURSES_CONFIG="none"
+
+if test "$NCURSES_CONFIG" != none ; then
+
+CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
+LIBS="`$NCURSES_CONFIG --libs` $LIBS"
+
+# even with config script, some packages use no-override for curses.h
+
+echo "$as_me:5732: checking if we have identified curses headers" >&5
+echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
+if test "${cf_cv_ncurses_header+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+cf_cv_ncurses_header=none
+for cf_header in  \
+    ncurses/curses.h \
+	ncurses/ncurses.h \
+	curses.h \
+	ncurses.h
+do
+cat >conftest.$ac_ext <<_ACEOF
+#line 5746 "configure"
+#include "confdefs.h"
+#include <${cf_header}>
+int
+main ()
+{
+initscr(); tgoto("?", 0,0)
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:5758: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:5761: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:5764: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:5767: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_ncurses_header=$cf_header; break
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+done
+
+fi
+echo "$as_me:5778: result: $cf_cv_ncurses_header" >&5
+echo "${ECHO_T}$cf_cv_ncurses_header" >&6
+
+if test "$cf_cv_ncurses_header" = none ; then
+	{ { echo "$as_me:5782: error: No curses header-files found" >&5
+echo "$as_me: error: No curses header-files found" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+# cheat, to get the right #define's for HAVE_NCURSES_H, etc.
+
+for ac_header in $cf_cv_ncurses_header
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+echo "$as_me:5792: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 5798 "configure"
+#include "confdefs.h"
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:5802: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  egrep -v '^ *\+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:5808: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  eval "$as_ac_Header=yes"
+else
+  echo "$as_me: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  eval "$as_ac_Header=no"
+fi
+rm -f conftest.err conftest.$ac_ext
+fi
+echo "$as_me:5827: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+EOF
+
+fi
+done
+
+cat >>confdefs.h <<\EOF
+#define NCURSES 1
+EOF
+
+cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
+
+cat >>confdefs.h <<EOF
+#define $cf_nculib_ROOT 1
+EOF
+
+cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
+
+else
+
+cf_ncuhdr_root=ncurses
+
+test -n "$cf_cv_curses_dir" && \
+test "$cf_cv_curses_dir" != "no" && { \
+
+if test -n "$cf_cv_curses_dir/include $cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
+  for cf_add_incdir in $cf_cv_curses_dir/include $cf_cv_curses_dir/include/$cf_ncuhdr_root
+  do
+	while test $cf_add_incdir != /usr/include
+	do
+	  if test -d $cf_add_incdir
+	  then
+		cf_have_incdir=no
+		if test -n "$CFLAGS$CPPFLAGS" ; then
+		  # a loop is needed to ensure we can add subdirs of existing dirs
+		  for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
+			if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
+			  cf_have_incdir=yes; break
+			fi
+		  done
+		fi
+
+		if test "$cf_have_incdir" = no ; then
+		  if test "$cf_add_incdir" = /usr/local/include ; then
+			if test "$GCC" = yes
+			then
+			  cf_save_CPPFLAGS=$CPPFLAGS
+			  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
+			  cat >conftest.$ac_ext <<_ACEOF
+#line 5880 "configure"
+#include "confdefs.h"
+#include <stdio.h>
+int
+main ()
+{
+printf("Hello")
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:5892: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:5895: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:5898: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:5901: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_have_incdir=yes
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+			  CPPFLAGS=$cf_save_CPPFLAGS
+			fi
+		  fi
+		fi
+
+		if test "$cf_have_incdir" = no ; then
+		  test -n "$verbose" && echo "	adding $cf_add_incdir to include-path" 1>&6
+
+echo "${as_me:-configure}:5918: testing adding $cf_add_incdir to include-path ..." 1>&5
+
+		  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
+
+		  cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
+		  test "$cf_top_incdir" = "$cf_add_incdir" && break
+		  cf_add_incdir="$cf_top_incdir"
+		else
+		  break
+		fi
+	  fi
+	done
+  done
+fi
+
+}
+
+echo "$as_me:5935: checking for $cf_ncuhdr_root header in include-path" >&5
+echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
+if test "${cf_cv_ncurses_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+	cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
+	( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
+	for cf_header in $cf_header_list
+	do
+
+	cat >conftest.$ac_ext <<_ACEOF
+#line 5947 "configure"
+#include "confdefs.h"
+
+#include <$cf_header>
+int
+main ()
+{
+
+#ifdef NCURSES_VERSION
+
+printf("%s\n", NCURSES_VERSION);
+#else
+#ifdef __NCURSES_H
+printf("old\n");
+#else
+	make an error
+#endif
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:5971: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:5974: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:5977: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:5980: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_ncurses_h=$cf_header
+
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_ncurses_h=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+		test "$cf_cv_ncurses_h" != no && break
+	done
+
+fi
+echo "$as_me:5995: result: $cf_cv_ncurses_h" >&5
+echo "${ECHO_T}$cf_cv_ncurses_h" >&6
+
+if test "$cf_cv_ncurses_h" != no ; then
+	cf_cv_ncurses_header=$cf_cv_ncurses_h
+else
+
+echo "$as_me:6002: checking for $cf_ncuhdr_root include-path" >&5
+echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
+if test "${cf_cv_ncurses_h2+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+	test -n "$verbose" && echo
+
+cf_search=
+
+# collect the current set of include-directories from compiler flags
+cf_header_path_list=""
+if test -n "${CFLAGS}${CPPFLAGS}" ; then
+	for cf_header_path in $CPPFLAGS $CFLAGS
+	do
+		case $cf_header_path in #(vi
+		-I*)
+			cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
+
+test "$cf_header_path" != "NONE" && \
+test -d "$cf_header_path" && \
+ {
+	test -n "$verbose" && echo "	... testing for include-directories under $cf_header_path"
+	test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
+	test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
+	test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
+	test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
+	test -d $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
+}
+
+			cf_header_path_list="$cf_header_path_list $cf_search"
+			;;
+		esac
+	done
+fi
+
+# add the variations for the package we are looking for
+
+cf_search=
+
+test "/usr" != "$prefix" && \
+test -d "/usr" && \
+(test $prefix = NONE || test "/usr" != "$prefix") && {
+	test -n "$verbose" && echo "	... testing for include-directories under /usr"
+	test -d /usr/include &&          cf_search="$cf_search /usr/include"
+	test -d /usr/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
+	test -d /usr/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include"
+	test -d /usr/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/$cf_ncuhdr_root/include"
+	test -d /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
+}
+
+test "$prefix" != "NONE" && \
+test -d "$prefix" && \
+ {
+	test -n "$verbose" && echo "	... testing for include-directories under $prefix"
+	test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
+	test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
+	test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
+	test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
+	test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
+}
+
+test "/usr/local" != "$prefix" && \
+test -d "/usr/local" && \
+(test $prefix = NONE || test "/usr/local" != "$prefix") && {
+	test -n "$verbose" && echo "	... testing for include-directories under /usr/local"
+	test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
+	test -d /usr/local/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
+	test -d /usr/local/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include"
+	test -d /usr/local/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include"
+	test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
+}
+
+test "/opt" != "$prefix" && \
+test -d "/opt" && \
+(test $prefix = NONE || test "/opt" != "$prefix") && {
+	test -n "$verbose" && echo "	... testing for include-directories under /opt"
+	test -d /opt/include &&          cf_search="$cf_search /opt/include"
+	test -d /opt/include/$cf_ncuhdr_root &&       cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
+	test -d /opt/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include"
+	test -d /opt/$cf_ncuhdr_root/include &&       cf_search="$cf_search /opt/$cf_ncuhdr_root/include"
+	test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
+}
+
+test "$HOME" != "$prefix" && \
+test -d "$HOME" && \
+(test $prefix = NONE || test "$HOME" != "$prefix") && {
+	test -n "$verbose" && echo "	... testing for include-directories under $HOME"
+	test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
+	test -d $HOME/include/$cf_ncuhdr_root &&       cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
+	test -d $HOME/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include"
+	test -d $HOME/$cf_ncuhdr_root/include &&       cf_search="$cf_search $HOME/$cf_ncuhdr_root/include"
+	test -d $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
+}
+
+test "$includedir" != NONE && \
+test "$includedir" != "/usr/include" && \
+test -d "$includedir" && {
+	test -d $includedir &&    cf_search="$cf_search $includedir"
+	test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
+}
+
+test "$oldincludedir" != NONE && \
+test "$oldincludedir" != "/usr/include" && \
+test -d "$oldincludedir" && {
+	test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
+	test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
+}
+
+cf_search="$cf_search $cf_header_path_list"
+
+	test -n "$verbose" && echo search path $cf_search
+	cf_save2_CPPFLAGS="$CPPFLAGS"
+	for cf_incdir in $cf_search
+	do
+
+if test -n "$cf_incdir" ; then
+  for cf_add_incdir in $cf_incdir
+  do
+	while test $cf_add_incdir != /usr/include
+	do
+	  if test -d $cf_add_incdir
+	  then
+		cf_have_incdir=no
+		if test -n "$CFLAGS$CPPFLAGS" ; then
+		  # a loop is needed to ensure we can add subdirs of existing dirs
+		  for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
+			if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
+			  cf_have_incdir=yes; break
+			fi
+		  done
+		fi
+
+		if test "$cf_have_incdir" = no ; then
+		  if test "$cf_add_incdir" = /usr/local/include ; then
+			if test "$GCC" = yes
+			then
+			  cf_save_CPPFLAGS=$CPPFLAGS
+			  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
+			  cat >conftest.$ac_ext <<_ACEOF
+#line 6142 "configure"
+#include "confdefs.h"
+#include <stdio.h>
+int
+main ()
+{
+printf("Hello")
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:6154: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:6157: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:6160: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:6163: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_have_incdir=yes
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+			  CPPFLAGS=$cf_save_CPPFLAGS
+			fi
+		  fi
+		fi
+
+		if test "$cf_have_incdir" = no ; then
+		  test -n "$verbose" && echo "	adding $cf_add_incdir to include-path" 1>&6
+
+echo "${as_me:-configure}:6180: testing adding $cf_add_incdir to include-path ..." 1>&5
+
+		  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
+
+		  cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
+		  test "$cf_top_incdir" = "$cf_add_incdir" && break
+		  cf_add_incdir="$cf_top_incdir"
+		else
+		  break
+		fi
+	  fi
+	done
+  done
+fi
+
+		for cf_header in \
+			ncurses.h \
+			curses.h
+		do
+
+	cat >conftest.$ac_ext <<_ACEOF
+#line 6201 "configure"
+#include "confdefs.h"
+
+#include <$cf_header>
+int
+main ()
+{
+
+#ifdef NCURSES_VERSION
+
+printf("%s\n", NCURSES_VERSION);
+#else
+#ifdef __NCURSES_H
+printf("old\n");
+#else
+	make an error
+#endif
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:6225: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:6228: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:6231: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:6234: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_ncurses_h2=$cf_header
+
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_ncurses_h2=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+			if test "$cf_cv_ncurses_h2" != no ; then
+				cf_cv_ncurses_h2=$cf_incdir/$cf_header
+				test -n "$verbose" && echo $ac_n "	... found $ac_c" 1>&6
+				break
+			fi
+			test -n "$verbose" && echo "	... tested $cf_incdir/$cf_header" 1>&6
+		done
+		CPPFLAGS="$cf_save2_CPPFLAGS"
+		test "$cf_cv_ncurses_h2" != no && break
+	done
+	test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:6255: error: not found" >&5
+echo "$as_me: error: not found" >&2;}
+   { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:6260: result: $cf_cv_ncurses_h2" >&5
+echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
+
+	cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
+	cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
+	if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
+		cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
+	fi
+
+if test -n "$cf_1st_incdir" ; then
+  for cf_add_incdir in $cf_1st_incdir
+  do
+	while test $cf_add_incdir != /usr/include
+	do
+	  if test -d $cf_add_incdir
+	  then
+		cf_have_incdir=no
+		if test -n "$CFLAGS$CPPFLAGS" ; then
+		  # a loop is needed to ensure we can add subdirs of existing dirs
+		  for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
+			if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
+			  cf_have_incdir=yes; break
+			fi
+		  done
+		fi
+
+		if test "$cf_have_incdir" = no ; then
+		  if test "$cf_add_incdir" = /usr/local/include ; then
+			if test "$GCC" = yes
+			then
+			  cf_save_CPPFLAGS=$CPPFLAGS
+			  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
+			  cat >conftest.$ac_ext <<_ACEOF
+#line 6293 "configure"
+#include "confdefs.h"
+#include <stdio.h>
+int
+main ()
+{
+printf("Hello")
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:6305: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:6308: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:6311: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:6314: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_have_incdir=yes
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+			  CPPFLAGS=$cf_save_CPPFLAGS
+			fi
+		  fi
+		fi
+
+		if test "$cf_have_incdir" = no ; then
+		  test -n "$verbose" && echo "	adding $cf_add_incdir to include-path" 1>&6
+
+echo "${as_me:-configure}:6331: testing adding $cf_add_incdir to include-path ..." 1>&5
+
+		  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
+
+		  cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
+		  test "$cf_top_incdir" = "$cf_add_incdir" && break
+		  cf_add_incdir="$cf_top_incdir"
+		else
+		  break
+		fi
+	  fi
+	done
+  done
+fi
+
+fi
+
+# Set definitions to allow ifdef'ing for ncurses.h
+
+case $cf_cv_ncurses_header in # (vi
+*ncurses.h)
+	cat >>confdefs.h <<\EOF
+#define HAVE_NCURSES_H 1
+EOF
+
+	;;
+esac
+
+case $cf_cv_ncurses_header in # (vi
+ncurses/curses.h|ncurses/ncurses.h)
+	cat >>confdefs.h <<\EOF
+#define HAVE_NCURSES_NCURSES_H 1
+EOF
+
+	;;
+ncursesw/curses.h|ncursesw/ncurses.h)
+	cat >>confdefs.h <<\EOF
+#define HAVE_NCURSESW_NCURSES_H 1
+EOF
+
+	;;
+esac
+
+echo "$as_me:6374: checking for terminfo header" >&5
+echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
+if test "${cf_cv_term_header+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+case ${cf_cv_ncurses_header} in #(vi
+*/ncurses.h|*/ncursesw.h) #(vi
+	cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
+	;;
+*)
+	cf_term_header=term.h
+	;;
+esac
+
+for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
+do
+cat >conftest.$ac_ext <<_ACEOF
+#line 6392 "configure"
+#include "confdefs.h"
+#include <stdio.h>
+#include <${cf_cv_ncurses_header:-curses.h}>
+#include <$cf_test>
+
+int
+main ()
+{
+int x = auto_left_margin
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:6407: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:6410: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:6413: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:6416: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+
+	cf_cv_term_header="$cf_test"
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+
+	cf_cv_term_header=unknown
+
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+	test "$cf_cv_term_header" != unknown && break
+done
+
+fi
+echo "$as_me:6432: result: $cf_cv_term_header" >&5
+echo "${ECHO_T}$cf_cv_term_header" >&6
+
+# Set definitions to allow ifdef'ing to accommodate subdirectories
+
+case $cf_cv_term_header in # (vi
+*term.h)
+	cat >>confdefs.h <<\EOF
+#define HAVE_TERM_H 1
+EOF
+
+	;;
+esac
+
+case $cf_cv_term_header in # (vi
+ncurses/term.h) #(vi
+	cat >>confdefs.h <<\EOF
+#define HAVE_NCURSES_TERM_H 1
+EOF
+
+	;;
+ncursesw/term.h)
+	cat >>confdefs.h <<\EOF
+#define HAVE_NCURSESW_TERM_H 1
+EOF
+
+	;;
+esac
+
+# some applications need this, but should check for NCURSES_VERSION
+cat >>confdefs.h <<\EOF
+#define NCURSES 1
+EOF
+
+echo "$as_me:6466: checking for ncurses version" >&5
+echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
+if test "${cf_cv_ncurses_version+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+	cf_cv_ncurses_version=no
+	cf_tempfile=out$$
+	rm -f $cf_tempfile
+	if test "$cross_compiling" = yes; then
+
+	# This will not work if the preprocessor splits the line after the
+	# Autoconf token.  The 'unproto' program does that.
+	cat > conftest.$ac_ext <<EOF
+#include <${cf_cv_ncurses_header:-curses.h}>
+#undef Autoconf
+#ifdef NCURSES_VERSION
+Autoconf NCURSES_VERSION
+#else
+#ifdef __NCURSES_H
+Autoconf "old"
+#endif
+;
+#endif
+EOF
+	cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
+	{ (eval echo "$as_me:6492: \"$cf_try\"") >&5
+  (eval $cf_try) 2>&5
+  ac_status=$?
+  echo "$as_me:6495: \$? = $ac_status" >&5
+  (exit $ac_status); }
+	if test -f conftest.out ; then
+		cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
+		test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
+		rm -f conftest.out
+	fi
+
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 6505 "configure"
+#include "confdefs.h"
+
+#include <${cf_cv_ncurses_header:-curses.h}>
+#include <stdio.h>
+int main()
+{
+	FILE *fp = fopen("$cf_tempfile", "w");
+#ifdef NCURSES_VERSION
+# ifdef NCURSES_VERSION_PATCH
+	fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
+# else
+	fprintf(fp, "%s\n", NCURSES_VERSION);
+# endif
+#else
+# ifdef __NCURSES_H
+	fprintf(fp, "old\n");
+# else
+	make an error
+# endif
+#endif
+	${cf_cv_main_return:-return}(0);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:6530: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:6533: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:6535: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:6538: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+
+	cf_cv_ncurses_version=`cat $cf_tempfile`
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+	rm -f $cf_tempfile
+
+fi
+echo "$as_me:6552: result: $cf_cv_ncurses_version" >&5
+echo "${ECHO_T}$cf_cv_ncurses_version" >&6
+test "$cf_cv_ncurses_version" = no || cat >>confdefs.h <<\EOF
+#define NCURSES 1
+EOF
+
+cf_nculib_root=ncurses
+	# This works, except for the special case where we find gpm, but
+	# ncurses is in a nonstandard location via $LIBS, and we really want
+	# to link gpm.
+cf_ncurses_LIBS=""
+cf_ncurses_SAVE="$LIBS"
+echo "$as_me:6564: checking for Gpm_Open in -lgpm" >&5
+echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
+if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lgpm  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line 6572 "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char Gpm_Open ();
+int
+main ()
+{
+Gpm_Open ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:6591: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:6594: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:6597: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:6600: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_gpm_Gpm_Open=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_gpm_Gpm_Open=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:6611: result: $ac_cv_lib_gpm_Gpm_Open" >&5
+echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
+if test $ac_cv_lib_gpm_Gpm_Open = yes; then
+  echo "$as_me:6614: checking for initscr in -lgpm" >&5
+echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
+if test "${ac_cv_lib_gpm_initscr+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lgpm  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line 6622 "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char initscr ();
+int
+main ()
+{
+initscr ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:6641: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:6644: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:6647: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:6650: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_gpm_initscr=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_gpm_initscr=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:6661: result: $ac_cv_lib_gpm_initscr" >&5
+echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
+if test $ac_cv_lib_gpm_initscr = yes; then
+  LIBS="$cf_ncurses_SAVE"
+else
+  cf_ncurses_LIBS="-lgpm"
+fi
+
+fi
+
+case $host_os in #(vi
+freebsd*)
+	# This is only necessary if you are linking against an obsolete
+	# version of ncurses (but it should do no harm, since it's static).
+	if test "$cf_nculib_root" = ncurses ; then
+		echo "$as_me:6676: checking for tgoto in -lmytinfo" >&5
+echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
+if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lmytinfo  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line 6684 "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char tgoto ();
+int
+main ()
+{
+tgoto ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:6703: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:6706: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:6709: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:6712: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_mytinfo_tgoto=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_mytinfo_tgoto=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:6723: result: $ac_cv_lib_mytinfo_tgoto" >&5
+echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
+if test $ac_cv_lib_mytinfo_tgoto = yes; then
+  cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
+fi
+
+	fi
+	;;
+esac
+
+LIBS="$cf_ncurses_LIBS $LIBS"
+
+if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
+then
+
+if test -n "$cf_cv_curses_dir/lib" ; then
+  for cf_add_libdir in $cf_cv_curses_dir/lib
+  do
+    if test $cf_add_libdir = /usr/lib ; then
+      :
+    elif test -d $cf_add_libdir
+    then
+      cf_have_libdir=no
+      if test -n "$LDFLAGS$LIBS" ; then
+        # a loop is needed to ensure we can add subdirs of existing dirs
+        for cf_test_libdir in $LDFLAGS $LIBS ; do
+          if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
+            cf_have_libdir=yes; break
+          fi
+        done
+      fi
+      if test "$cf_have_libdir" = no ; then
+        test -n "$verbose" && echo "	adding $cf_add_libdir to library-path" 1>&6
+
+echo "${as_me:-configure}:6757: testing adding $cf_add_libdir to library-path ..." 1>&5
+
+        LDFLAGS="-L$cf_add_libdir $LDFLAGS"
+      fi
+    fi
+  done
+fi
+
+	LIBS="-l$cf_nculib_root $LIBS"
+else
+
+	eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
+	cf_libdir=""
+	echo "$as_me:6770: checking for initscr" >&5
+echo $ECHO_N "checking for initscr... $ECHO_C" >&6
+if test "${ac_cv_func_initscr+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 6776 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char initscr (); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char initscr ();
+char (*f) ();
+
+int
+main ()
+{
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_initscr) || defined (__stub___initscr)
+choke me
+#else
+f = initscr;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:6807: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:6810: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:6813: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:6816: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_initscr=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_func_initscr=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:6826: result: $ac_cv_func_initscr" >&5
+echo "${ECHO_T}$ac_cv_func_initscr" >&6
+if test $ac_cv_func_initscr = yes; then
+  eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
+else
+
+		cf_save_LIBS="$LIBS"
+		echo "$as_me:6833: checking for initscr in -l$cf_nculib_root" >&5
+echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
+		LIBS="-l$cf_nculib_root $LIBS"
+		cat >conftest.$ac_ext <<_ACEOF
+#line 6837 "configure"
+#include "confdefs.h"
+#include <${cf_cv_ncurses_header:-curses.h}>
+int
+main ()
+{
+initscr()
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:6849: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:6852: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:6855: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:6858: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  echo "$as_me:6860: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+			 eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
+
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+echo "$as_me:6867: result: no" >&5
+echo "${ECHO_T}no" >&6
+
+cf_search=
+cf_library_path_list=""
+if test -n "${LDFLAGS}${LIBS}" ; then
+	for cf_library_path in $LDFLAGS $LIBS
+	do
+		case $cf_library_path in #(vi
+		-L*)
+			cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
+
+test "$cf_library_path" != "NONE" && \
+test -d "$cf_library_path" && \
+ {
+	test -n "$verbose" && echo "	... testing for lib-directories under $cf_library_path"
+	test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
+	test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
+	test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
+	test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
+	test -d $cf_library_path/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib/$cf_nculib_root"
+}
+
+			cf_library_path_list="$cf_library_path_list $cf_search"
+			;;
+		esac
+	done
+fi
+
+cf_search=
+
+test "/usr" != "$prefix" && \
+test -d "/usr" && \
+(test $prefix = NONE || test "/usr" != "$prefix") && {
+	test -n "$verbose" && echo "	... testing for lib-directories under /usr"
+	test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
+	test -d /usr/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/lib/$cf_nculib_root"
+	test -d /usr/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/lib/$cf_nculib_root/lib"
+	test -d /usr/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/$cf_nculib_root/lib"
+	test -d /usr/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/$cf_nculib_root/lib/$cf_nculib_root"
+}
+
+test "$prefix" != "NONE" && \
+test -d "$prefix" && \
+ {
+	test -n "$verbose" && echo "	... testing for lib-directories under $prefix"
+	test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
+	test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
+	test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
+	test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
+	test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
+}
+
+test "/usr/local" != "$prefix" && \
+test -d "/usr/local" && \
+(test $prefix = NONE || test "/usr/local" != "$prefix") && {
+	test -n "$verbose" && echo "	... testing for lib-directories under /usr/local"
+	test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
+	test -d /usr/local/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/local/lib/$cf_nculib_root"
+	test -d /usr/local/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib"
+	test -d /usr/local/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/local/$cf_nculib_root/lib"
+	test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root"
+}
+
+test "/opt" != "$prefix" && \
+test -d "/opt" && \
+(test $prefix = NONE || test "/opt" != "$prefix") && {
+	test -n "$verbose" && echo "	... testing for lib-directories under /opt"
+	test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
+	test -d /opt/lib/$cf_nculib_root &&       cf_search="$cf_search /opt/lib/$cf_nculib_root"
+	test -d /opt/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /opt/lib/$cf_nculib_root/lib"
+	test -d /opt/$cf_nculib_root/lib &&       cf_search="$cf_search /opt/$cf_nculib_root/lib"
+	test -d /opt/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root"
+}
+
+test "$HOME" != "$prefix" && \
+test -d "$HOME" && \
+(test $prefix = NONE || test "$HOME" != "$prefix") && {
+	test -n "$verbose" && echo "	... testing for lib-directories under $HOME"
+	test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
+	test -d $HOME/lib/$cf_nculib_root &&       cf_search="$cf_search $HOME/lib/$cf_nculib_root"
+	test -d $HOME/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib"
+	test -d $HOME/$cf_nculib_root/lib &&       cf_search="$cf_search $HOME/$cf_nculib_root/lib"
+	test -d $HOME/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root"
+}
+
+cf_search="$cf_library_path_list $cf_search"
+
+			for cf_libdir in $cf_search
+			do
+				echo "$as_me:6957: checking for -l$cf_nculib_root in $cf_libdir" >&5
+echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
+				LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
+				cat >conftest.$ac_ext <<_ACEOF
+#line 6961 "configure"
+#include "confdefs.h"
+#include <${cf_cv_ncurses_header:-curses.h}>
+int
+main ()
+{
+initscr()
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:6973: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:6976: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:6979: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:6982: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  echo "$as_me:6984: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+			 		 eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
+					 break
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+echo "$as_me:6991: result: no" >&5
+echo "${ECHO_T}no" >&6
+					 LIBS="$cf_save_LIBS"
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+			done
+
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+
+fi
+
+eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
+
+if test $cf_found_library = no ; then
+	{ { echo "$as_me:7006: error: Cannot link $cf_nculib_root library" >&5
+echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+fi
+
+if test -n "$cf_ncurses_LIBS" ; then
+	echo "$as_me:7014: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
+echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
+	cf_ncurses_SAVE="$LIBS"
+	for p in $cf_ncurses_LIBS ; do
+		q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
+		if test "$q" != "$LIBS" ; then
+			LIBS="$q"
+		fi
+	done
+	cat >conftest.$ac_ext <<_ACEOF
+#line 7024 "configure"
+#include "confdefs.h"
+#include <${cf_cv_ncurses_header:-curses.h}>
+int
+main ()
+{
+initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:7036: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:7039: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:7042: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:7045: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  echo "$as_me:7047: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+echo "$as_me:7052: result: no" >&5
+echo "${ECHO_T}no" >&6
+		 LIBS="$cf_ncurses_SAVE"
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+
+cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
+
+cat >>confdefs.h <<EOF
+#define $cf_nculib_ROOT 1
+EOF
+
+fi
+
+fi
+
+if test "$NCURSES_CONFIG" != none ; then
+
+cf_version=`$NCURSES_CONFIG --version`
+
+NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
+NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9]\+\.//' -e 's/\..*//'`
+NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9]\+\.[0-9]\+\.//'`
+
+# ABI version is not available from headers
+cf_cv_abi_version=`$NCURSES_CONFIG --abi-version`
+
+else
+
+for cf_name in MAJOR MINOR PATCH
+do
+cat >conftest.$ac_ext <<CF_EOF
+#include <${cf_cv_ncurses_header:-curses.h}>
+AUTOCONF_$cf_name NCURSES_VERSION_$cf_name
+CF_EOF
+	cf_try="$ac_cpp conftest.$ac_ext 2>&5 | fgrep AUTOCONF_$cf_name >conftest.out"
+	{ (eval echo "$as_me:7089: \"$cf_try\"") >&5
+  (eval $cf_try) 2>&5
+  ac_status=$?
+  echo "$as_me:7092: \$? = $ac_status" >&5
+  (exit $ac_status); }
+	if test -f conftest.out ; then
+		cf_result=`cat conftest.out | sed -e "s/^.*AUTOCONF_$cf_name[ 	]\+//"`
+		eval NCURSES_$cf_name=$cf_result
+		cat conftest.$ac_ext
+		cat conftest.out
+	fi
+done
+
+cf_cv_abi_version=${NCURSES_MAJOR}
+
+fi
+
+cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR}
+
+cf_cv_timestamp=`date`
+
+echo "$as_me:7110: result: Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&5
+echo "${ECHO_T}Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&6
+
+	case $cf_cv_system_name in #(vi
+	OS/2*|os2*) #(vi
+        LIB_PREFIX=''
+        ;;
+	*)	LIB_PREFIX='lib'
+        ;;
+	esac
+cf_prefix=$LIB_PREFIX
+
+LIB_PREFIX=$cf_prefix
+
+LIB_SUFFIX=
+
+###############################################################################
+
+if test X"$CC_G_OPT" = X"" ; then
+	CC_G_OPT='-g'
+	test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT=''
+fi
+
+echo "$as_me:7133: checking for default loader flags" >&5
+echo $ECHO_N "checking for default loader flags... $ECHO_C" >&6
+case $DFT_LWR_MODEL in
+normal)  LD_MODEL=''   ;;
+debug)   LD_MODEL=$CC_G_OPT ;;
+profile) LD_MODEL='-pg';;
+shared)  LD_MODEL=''   ;;
+esac
+echo "$as_me:7141: result: $LD_MODEL" >&5
+echo "${ECHO_T}$LD_MODEL" >&6
+
+LD_RPATH_OPT=
+echo "$as_me:7145: checking for an rpath option" >&5
+echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
+case $cf_cv_system_name in #(vi
+irix*) #(vi
+	if test "$GCC" = yes; then
+		LD_RPATH_OPT="-Wl,-rpath,"
+	else
+		LD_RPATH_OPT="-rpath "
+	fi
+	;;
+linux*|gnu*|k*bsd*-gnu) #(vi
+	LD_RPATH_OPT="-Wl,-rpath,"
+	;;
+openbsd[2-9].*) #(vi
+	LD_RPATH_OPT="-Wl,-rpath,"
+	;;
+freebsd*) #(vi
+	LD_RPATH_OPT="-rpath "
+	;;
+netbsd*) #(vi
+	LD_RPATH_OPT="-Wl,-rpath,"
+	;;
+osf*|mls+*) #(vi
+	LD_RPATH_OPT="-rpath "
+	;;
+solaris2*) #(vi
+	LD_RPATH_OPT="-R"
+	;;
+*)
+	;;
+esac
+echo "$as_me:7176: result: $LD_RPATH_OPT" >&5
+echo "${ECHO_T}$LD_RPATH_OPT" >&6
+
+case "x$LD_RPATH_OPT" in #(vi
+x-R*)
+	echo "$as_me:7181: checking if we need a space after rpath option" >&5
+echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
+	cf_save_LIBS="$LIBS"
+	LIBS="${LD_RPATH_OPT}$libdir $LIBS"
+	cat >conftest.$ac_ext <<_ACEOF
+#line 7186 "configure"
+#include "confdefs.h"
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:7198: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:7201: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:7204: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:7207: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_rpath_space=no
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_rpath_space=yes
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+	LIBS="$cf_save_LIBS"
+	echo "$as_me:7217: result: $cf_rpath_space" >&5
+echo "${ECHO_T}$cf_rpath_space" >&6
+	test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
+	;;
+esac
+
+	LOCAL_LDFLAGS=
+	LOCAL_LDFLAGS2=
+	LD_SHARED_OPTS=
+	INSTALL_LIB="-m 644"
+
+	cf_cv_do_symlinks=no
+	cf_ld_rpath_opt=
+	test "$cf_cv_enable_rpath" = yes && cf_ld_rpath_opt="$LD_RPATH_OPT"
+
+	echo "$as_me:7232: checking if release/abi version should be used for shared libs" >&5
+echo $ECHO_N "checking if release/abi version should be used for shared libs... $ECHO_C" >&6
+
+# Check whether --with-shlib-version or --without-shlib-version was given.
+if test "${with_shlib_version+set}" = set; then
+  withval="$with_shlib_version"
+  test -z "$withval" && withval=auto
+	case $withval in #(vi
+	yes) #(vi
+		cf_cv_shlib_version=auto
+		;;
+	rel|abi|auto|no) #(vi
+		cf_cv_shlib_version=$withval
+		;;
+	*)
+		{ { echo "$as_me:7247: error: option value must be one of: rel, abi, auto or no" >&5
+echo "$as_me: error: option value must be one of: rel, abi, auto or no" >&2;}
+   { (exit 1); exit 1; }; }
+		;;
+	esac
+
+else
+  cf_cv_shlib_version=auto
+fi;
+	echo "$as_me:7256: result: $cf_cv_shlib_version" >&5
+echo "${ECHO_T}$cf_cv_shlib_version" >&6
+
+	cf_cv_rm_so_locs=no
+
+	# Some less-capable ports of gcc support only -fpic
+	CC_SHARED_OPTS=
+	if test "$GCC" = yes
+	then
+		echo "$as_me:7265: checking which $CC option to use" >&5
+echo $ECHO_N "checking which $CC option to use... $ECHO_C" >&6
+		cf_save_CFLAGS="$CFLAGS"
+		for CC_SHARED_OPTS in -fPIC -fpic ''
+		do
+			CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS"
+			cat >conftest.$ac_ext <<_ACEOF
+#line 7272 "configure"
+#include "confdefs.h"
+#include <stdio.h>
+int
+main ()
+{
+int x = 1
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:7284: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:7287: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:7290: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:7293: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  break
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+		done
+		echo "$as_me:7302: result: $CC_SHARED_OPTS" >&5
+echo "${ECHO_T}$CC_SHARED_OPTS" >&6
+		CFLAGS="$cf_save_CFLAGS"
+	fi
+
+	cf_cv_shlib_version_infix=no
+
+	case $cf_cv_system_name in #(vi
+	aix[56]*) #(vi
+		if test "$GCC" = yes; then
+			CC_SHARED_OPTS=
+			MK_SHARED_LIB='$(CC) -shared'
+		fi
+		;;
+	beos*) #(vi
+		MK_SHARED_LIB='${CC} ${CFLAGS} -o $@ -Xlinker -soname=`basename $@` -nostart -e 0'
+		;;
+	cygwin*) #(vi
+		CC_SHARED_OPTS=
+		MK_SHARED_LIB='sh ../mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
+		cf_cv_shlib_version=cygdll
+		cf_cv_shlib_version_infix=cygdll
+		cat >mk_shared_lib.sh <<-CF_EOF
+		#!/bin/sh
+		SHARED_LIB=\$1
+		IMPORT_LIB=\`echo "\$1" | sed -e 's/cyg/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
+		shift
+		cat <<-EOF
+		Linking shared library
+		** SHARED_LIB \$SHARED_LIB
+		** IMPORT_LIB \$IMPORT_LIB
+EOF
+		exec \$* -shared -Wl,--out-implib=../lib/\${IMPORT_LIB} -Wl,--export-all-symbols -o ../lib/\${SHARED_LIB}
+CF_EOF
+		chmod +x mk_shared_lib.sh
+		;;
+	darwin*) #(vi
+		EXTRA_CFLAGS="-no-cpp-precomp"
+		CC_SHARED_OPTS="-dynamic"
+		MK_SHARED_LIB='${CC} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $@` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $@'
+		test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi
+		cf_cv_shlib_version_infix=yes
+		echo "$as_me:7344: checking if ld -search_paths_first works" >&5
+echo $ECHO_N "checking if ld -search_paths_first works... $ECHO_C" >&6
+if test "${cf_cv_ldflags_search_paths_first+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+			cf_save_LDFLAGS=$LDFLAGS
+			LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
+			cat >conftest.$ac_ext <<_ACEOF
+#line 7353 "configure"
+#include "confdefs.h"
+
+int
+main ()
+{
+int i;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:7365: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:7368: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:7371: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:7374: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_ldflags_search_paths_first=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_ldflags_search_paths_first=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+				LDFLAGS=$cf_save_LDFLAGS
+fi
+echo "$as_me:7385: result: $cf_cv_ldflags_search_paths_first" >&5
+echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6
+		if test $cf_cv_ldflags_search_paths_first = yes; then
+			LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
+		fi
+		;;
+	hpux*) #(vi
+		# (tested with gcc 2.7.2 -- I don't have c89)
+		if test "$GCC" = yes; then
+			LD_SHARED_OPTS='-Xlinker +b -Xlinker ${libdir}'
+		else
+			CC_SHARED_OPTS='+Z'
+			LD_SHARED_OPTS='-Wl,+b,${libdir}'
+		fi
+		MK_SHARED_LIB='${LD} +b ${libdir} -b -o $@'
+		# HP-UX shared libraries must be executable, and should be
+		# readonly to exploit a quirk in the memory manager.
+		INSTALL_LIB="-m 555"
+		;;
+	irix*) #(vi
+		if test "$cf_cv_enable_rpath" = yes ; then
+			EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS"
+		fi
+		# tested with IRIX 5.2 and 'cc'.
+		if test "$GCC" != yes; then
+			CC_SHARED_OPTS='-KPIC'
+			MK_SHARED_LIB='${CC} -shared -rdata_shared -soname `basename $@` -o $@'
+		else
+			MK_SHARED_LIB='${CC} -shared -Wl,-soname,`basename $@` -o $@'
+		fi
+		cf_cv_rm_so_locs=yes
+		;;
+	linux*|gnu*|k*bsd*-gnu) #(vi
+		if test "$DFT_LWR_MODEL" = "shared" ; then
+			LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
+			LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
+		fi
+		if test "$cf_cv_enable_rpath" = yes ; then
+			EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS"
+		fi
+
+	test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
+	if test "$cf_cv_shlib_version" = rel; then
+		cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
+	else
+		cf_cv_shared_soname='`basename $@`'
+	fi
+
+		MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
+		;;
+	openbsd[2-9].*) #(vi
+		if test "$DFT_LWR_MODEL" = "shared" ; then
+			LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
+			LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
+		fi
+		if test "$cf_cv_enable_rpath" = yes ; then
+			EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS"
+		fi
+		CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
+
+	test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
+	if test "$cf_cv_shlib_version" = rel; then
+		cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
+	else
+		cf_cv_shared_soname='`basename $@`'
+	fi
+
+		MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
+		;;
+	nto-qnx*|openbsd*|freebsd[12].*) #(vi
+		CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
+		MK_SHARED_LIB='${LD} -Bshareable -o $@'
+		test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
+		;;
+	freebsd*) #(vi
+		CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
+		if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
+			LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
+			LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${libdir} $LOCAL_LDFLAGS"
+			EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS"
+		fi
+
+	test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
+	if test "$cf_cv_shlib_version" = rel; then
+		cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
+	else
+		cf_cv_shared_soname='`basename $@`'
+	fi
+
+		MK_SHARED_LIB='${LD} -shared -Bshareable -soname=`basename $@` -o $@'
+		;;
+	netbsd*) #(vi
+		CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
+		if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
+			LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
+			LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
+			EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS"
+			if test "$cf_cv_shlib_version" = auto; then
+			if test -f /usr/libexec/ld.elf_so; then
+				cf_cv_shlib_version=abi
+			else
+				cf_cv_shlib_version=rel
+			fi
+			fi
+
+	test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
+	if test "$cf_cv_shlib_version" = rel; then
+		cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
+	else
+		cf_cv_shared_soname='`basename $@`'
+	fi
+
+			MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $@'
+		else
+			MK_SHARED_LIB='${LD} -shared -Bshareable -o $@'
+		fi
+		;;
+	osf*|mls+*) #(vi
+		# tested with OSF/1 V3.2 and 'cc'
+		# tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't
+		# link with shared libs).
+		MK_SHARED_LIB='${LD} -set_version ${REL_VERSION}:${ABI_VERSION} -expect_unresolved "*" -shared -soname `basename $@`'
+		case $host_os in #(vi
+		osf4*)
+			MK_SHARED_LIB="${MK_SHARED_LIB} -msym"
+			;;
+		esac
+		MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $@'
+		if test "$DFT_LWR_MODEL" = "shared" ; then
+			LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
+			LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
+		fi
+		cf_cv_rm_so_locs=yes
+		;;
+	sco3.2v5*)  # (also uw2* and UW7: hops 13-Apr-98
+		# tested with osr5.0.5
+		if test "$GCC" != yes; then
+			CC_SHARED_OPTS='-belf -KPIC'
+		fi
+		MK_SHARED_LIB='${LD} -dy -G -h `basename $@ .${REL_VERSION}`.${ABI_VERSION} -o $@'
+		if test "$cf_cv_enable_rpath" = yes ; then
+			# only way is to set LD_RUN_PATH but no switch for it
+			RUN_PATH=$libdir
+		fi
+		test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
+		LINK_PROGS='LD_RUN_PATH=${libdir}'
+		LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib'
+		;;
+	sunos4*) #(vi
+		# tested with SunOS 4.1.1 and gcc 2.7.0
+		if test "$GCC" != yes; then
+			CC_SHARED_OPTS='-KPIC'
+		fi
+		MK_SHARED_LIB='${LD} -assert pure-text -o $@'
+		test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
+		;;
+	solaris2*) #(vi
+		# tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2
+		# tested with SunOS 5.10 (solaris 10) and gcc 3.4.3
+		if test "$DFT_LWR_MODEL" = "shared" ; then
+			LOCAL_LDFLAGS="-R \$(LOCAL_LIBDIR):\${libdir}"
+			LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
+		fi
+		if test "$cf_cv_enable_rpath" = yes ; then
+			EXTRA_LDFLAGS="-R \${libdir} $EXTRA_LDFLAGS"
+		fi
+
+	test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
+	if test "$cf_cv_shlib_version" = rel; then
+		cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
+	else
+		cf_cv_shared_soname='`basename $@`'
+	fi
+
+		if test "$GCC" != yes; then
+			cf_save_CFLAGS="$CFLAGS"
+			for cf_shared_opts in -xcode=pic32 -xcode=pic13 -KPIC -Kpic -O
+			do
+				CFLAGS="$cf_shared_opts $cf_save_CFLAGS"
+				cat >conftest.$ac_ext <<_ACEOF
+#line 7565 "configure"
+#include "confdefs.h"
+#include <stdio.h>
+int
+main ()
+{
+printf("Hello\n");
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:7577: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:7580: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:7583: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:7586: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  break
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+			done
+			CFLAGS="$cf_save_CFLAGS"
+			CC_SHARED_OPTS=$cf_shared_opts
+			MK_SHARED_LIB='${CC} -dy -G -h '$cf_cv_shared_soname' -o $@'
+		else
+			MK_SHARED_LIB='${CC} -shared -dy -G -h '$cf_cv_shared_soname' -o $@'
+		fi
+		;;
+	sysv5uw7*|unix_sv*) #(vi
+		# tested with UnixWare 7.1.0 (gcc 2.95.2 and cc)
+		if test "$GCC" != yes; then
+			CC_SHARED_OPTS='-KPIC'
+		fi
+		MK_SHARED_LIB='${LD} -d y -G -o $@'
+		;;
+	*)
+		CC_SHARED_OPTS='unknown'
+		MK_SHARED_LIB='echo unknown'
+		;;
+	esac
+
+	# This works if the last tokens in $MK_SHARED_LIB are the -o target.
+	case "$cf_cv_shlib_version" in #(vi
+	rel|abi)
+		case "$MK_SHARED_LIB" in #(vi
+		*'-o $@') #(vi
+			test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes
+			;;
+		*)
+			{ echo "$as_me:7623: WARNING: ignored --with-shlib-version" >&5
+echo "$as_me: WARNING: ignored --with-shlib-version" >&2;}
+			;;
+		esac
+		;;
+	esac
+
+	if test -n "$cf_ld_rpath_opt" ; then
+		MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${libdir}"
+	fi
+
+###############################################################################
+
+	case $cf_cv_system_name in
+	os2*)	PATH_SEPARATOR=';'  ;;
+	*)	PATH_SEPARATOR=':'  ;;
+	esac
+
+###   use option --enable-broken-linker to force on use of broken-linker support
+echo "$as_me:7642: checking if you want broken-linker support code" >&5
+echo $ECHO_N "checking if you want broken-linker support code... $ECHO_C" >&6
+
+# Check whether --enable-broken_linker or --disable-broken_linker was given.
+if test "${enable_broken_linker+set}" = set; then
+  enableval="$enable_broken_linker"
+  with_broken_linker=$enableval
+else
+  with_broken_linker=${BROKEN_LINKER:-no}
+fi;
+echo "$as_me:7652: result: $with_broken_linker" >&5
+echo "${ECHO_T}$with_broken_linker" >&6
+
+BROKEN_LINKER=0
+if test "$with_broken_linker" = yes ; then
+	cat >>confdefs.h <<\EOF
+#define BROKEN_LINKER 1
+EOF
+
+	BROKEN_LINKER=1
+elif test "$DFT_LWR_MODEL" = shared ; then
+	case $cf_cv_system_name in #(vi
+	cygwin*)
+		cat >>confdefs.h <<\EOF
+#define BROKEN_LINKER 1
+EOF
+
+		BROKEN_LINKER=1
+		test -n "$verbose" && echo "	cygwin linker is broken anyway" 1>&6
+
+echo "${as_me:-configure}:7672: testing cygwin linker is broken anyway ..." 1>&5
+
+		;;
+	esac
+fi
+
+# Check to define _XOPEN_SOURCE "automatically"
+
+cf_XOPEN_SOURCE=500
+cf_POSIX_C_SOURCE=199506L
+cf_xopen_source=
+
+case $host_os in #(vi
+aix[456]*) #(vi
+	cf_xopen_source="-D_ALL_SOURCE"
+	;;
+darwin[0-8].*) #(vi
+	cf_xopen_source="-D_APPLE_C_SOURCE"
+	;;
+darwin*) #(vi
+	cf_xopen_source="-D_DARWIN_C_SOURCE"
+	;;
+freebsd*|dragonfly*) #(vi
+	# 5.x headers associate
+	#	_XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
+	#	_XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
+	cf_POSIX_C_SOURCE=200112L
+	cf_XOPEN_SOURCE=600
+	cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
+	;;
+hpux11*) #(vi
+	cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
+	;;
+hpux*) #(vi
+	cf_xopen_source="-D_HPUX_SOURCE"
+	;;
+irix[56].*) #(vi
+	cf_xopen_source="-D_SGI_SOURCE"
+	;;
+linux*|gnu*|mint*|k*bsd*-gnu) #(vi
+
+echo "$as_me:7713: checking if we must define _GNU_SOURCE" >&5
+echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
+if test "${cf_cv_gnu_source+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+cat >conftest.$ac_ext <<_ACEOF
+#line 7720 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+int
+main ()
+{
+
+#ifndef _XOPEN_SOURCE
+make an error
+#endif
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:7735: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:7738: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:7741: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:7744: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_gnu_source=no
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_save="$CPPFLAGS"
+	 CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
+	 cat >conftest.$ac_ext <<_ACEOF
+#line 7753 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+int
+main ()
+{
+
+#ifdef _XOPEN_SOURCE
+make an error
+#endif
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:7768: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:7771: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:7774: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:7777: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_gnu_source=no
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_gnu_source=yes
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+	CPPFLAGS="$cf_save"
+
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+fi
+echo "$as_me:7792: result: $cf_cv_gnu_source" >&5
+echo "${ECHO_T}$cf_cv_gnu_source" >&6
+test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
+
+	;;
+mirbsd*) #(vi
+	# setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <arpa/inet.h>
+	;;
+netbsd*) #(vi
+	# setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
+	;;
+openbsd*) #(vi
+	# setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
+	;;
+osf[45]*) #(vi
+	cf_xopen_source="-D_OSF_SOURCE"
+	;;
+nto-qnx*) #(vi
+	cf_xopen_source="-D_QNX_SOURCE"
+	;;
+sco*) #(vi
+	# setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
+	;;
+solaris2.1[0-9]) #(vi
+	cf_xopen_source="-D__EXTENSIONS__ -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
+	;;
+solaris2.[1-9]) #(vi
+	cf_xopen_source="-D__EXTENSIONS__"
+	;;
+*)
+	echo "$as_me:7822: checking if we should define _XOPEN_SOURCE" >&5
+echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
+if test "${cf_cv_xopen_source+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+	cat >conftest.$ac_ext <<_ACEOF
+#line 7829 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+int
+main ()
+{
+
+#ifndef _XOPEN_SOURCE
+make an error
+#endif
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:7844: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:7847: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:7850: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:7853: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_xopen_source=no
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_save="$CPPFLAGS"
+	 CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
+	 cat >conftest.$ac_ext <<_ACEOF
+#line 7862 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+int
+main ()
+{
+
+#ifdef _XOPEN_SOURCE
+make an error
+#endif
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:7877: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:7880: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:7883: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:7886: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_xopen_source=no
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_xopen_source=$cf_XOPEN_SOURCE
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+	CPPFLAGS="$cf_save"
+
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+fi
+echo "$as_me:7901: result: $cf_cv_xopen_source" >&5
+echo "${ECHO_T}$cf_cv_xopen_source" >&6
+	if test "$cf_cv_xopen_source" != no ; then
+
+CFLAGS=`echo "$CFLAGS" | \
+	sed	-e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ 	]*\)\?[ 	]/ /g' \
+		-e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ 	]*\)\?$//g'`
+
+CPPFLAGS=`echo "$CPPFLAGS" | \
+	sed	-e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ 	]*\)\?[ 	]/ /g' \
+		-e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ 	]*\)\?$//g'`
+
+		cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
+
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
+
+for cf_add_cflags in $cf_temp_xopen_source
+do
+case $cf_fix_cppflags in
+no)
+	case $cf_add_cflags in #(vi
+	-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
+		case $cf_add_cflags in
+		-D*)
+			cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
+
+			test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+				&& test -z "${cf_tst_cflags}" \
+				&& cf_fix_cppflags=yes
+
+			if test $cf_fix_cppflags = yes ; then
+				cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+				continue
+			elif test "${cf_tst_cflags}" = "\"'" ; then
+				cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+				continue
+			fi
+			;;
+		esac
+		case "$CPPFLAGS" in
+		*$cf_add_cflags) #(vi
+			;;
+		*) #(vi
+			case $cf_add_cflags in #(vi
+			-D*)
+				cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
+
+CPPFLAGS=`echo "$CPPFLAGS" | \
+	sed	-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?[ 	]/ /g' \
+		-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?$//g'`
+
+				;;
+			esac
+			cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
+			;;
+		esac
+		;;
+	*)
+		cf_new_cflags="$cf_new_cflags $cf_add_cflags"
+		;;
+	esac
+	;;
+yes)
+	cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+	cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
+
+	test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+		&& test -z "${cf_tst_cflags}" \
+		&& cf_fix_cppflags=no
+	;;
+esac
+done
+
+if test -n "$cf_new_cflags" ; then
+
+	CFLAGS="$CFLAGS $cf_new_cflags"
+fi
+
+if test -n "$cf_new_cppflags" ; then
+
+	CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
+fi
+
+if test -n "$cf_new_extra_cppflags" ; then
+
+	EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+fi
+
+	fi
+
+cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
+
+cf_save_CFLAGS="$CFLAGS"
+cf_save_CPPFLAGS="$CPPFLAGS"
+
+cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
+	sed	-e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ 	]*\)\?[ 	]/ /g' \
+		-e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ 	]*\)\?$//g'`
+
+cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
+	sed	-e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ 	]*\)\?[ 	]/ /g' \
+		-e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ 	]*\)\?$//g'`
+
+echo "$as_me:8008: checking if we should define _POSIX_C_SOURCE" >&5
+echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
+if test "${cf_cv_posix_c_source+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+echo "${as_me:-configure}:8014: testing if the symbol is already defined go no further ..." 1>&5
+
+	cat >conftest.$ac_ext <<_ACEOF
+#line 8017 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+int
+main ()
+{
+
+#ifndef _POSIX_C_SOURCE
+make an error
+#endif
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:8032: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:8035: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:8038: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:8041: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_posix_c_source=no
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_want_posix_source=no
+	 case .$cf_POSIX_C_SOURCE in #(vi
+	 .[12]??*) #(vi
+		cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
+		;;
+	 .2) #(vi
+		cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
+		cf_want_posix_source=yes
+		;;
+	 .*)
+		cf_want_posix_source=yes
+		;;
+	 esac
+	 if test "$cf_want_posix_source" = yes ; then
+		cat >conftest.$ac_ext <<_ACEOF
+#line 8062 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+int
+main ()
+{
+
+#ifdef _POSIX_SOURCE
+make an error
+#endif
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:8077: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:8080: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:8083: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:8086: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+	 fi
+
+echo "${as_me:-configure}:8097: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
+
+	 CFLAGS="$cf_trim_CFLAGS"
+	 CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
+
+echo "${as_me:-configure}:8102: testing if the second compile does not leave our definition intact error ..." 1>&5
+
+	 cat >conftest.$ac_ext <<_ACEOF
+#line 8105 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+int
+main ()
+{
+
+#ifndef _POSIX_C_SOURCE
+make an error
+#endif
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:8120: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:8123: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:8126: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:8129: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_posix_c_source=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+	 CFLAGS="$cf_save_CFLAGS"
+	 CPPFLAGS="$cf_save_CPPFLAGS"
+
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+fi
+echo "$as_me:8145: result: $cf_cv_posix_c_source" >&5
+echo "${ECHO_T}$cf_cv_posix_c_source" >&6
+
+if test "$cf_cv_posix_c_source" != no ; then
+	CFLAGS="$cf_trim_CFLAGS"
+	CPPFLAGS="$cf_trim_CPPFLAGS"
+
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
+
+for cf_add_cflags in $cf_cv_posix_c_source
+do
+case $cf_fix_cppflags in
+no)
+	case $cf_add_cflags in #(vi
+	-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
+		case $cf_add_cflags in
+		-D*)
+			cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
+
+			test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+				&& test -z "${cf_tst_cflags}" \
+				&& cf_fix_cppflags=yes
+
+			if test $cf_fix_cppflags = yes ; then
+				cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+				continue
+			elif test "${cf_tst_cflags}" = "\"'" ; then
+				cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+				continue
+			fi
+			;;
+		esac
+		case "$CPPFLAGS" in
+		*$cf_add_cflags) #(vi
+			;;
+		*) #(vi
+			case $cf_add_cflags in #(vi
+			-D*)
+				cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
+
+CPPFLAGS=`echo "$CPPFLAGS" | \
+	sed	-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?[ 	]/ /g' \
+		-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?$//g'`
+
+				;;
+			esac
+			cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
+			;;
+		esac
+		;;
+	*)
+		cf_new_cflags="$cf_new_cflags $cf_add_cflags"
+		;;
+	esac
+	;;
+yes)
+	cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+	cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
+
+	test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+		&& test -z "${cf_tst_cflags}" \
+		&& cf_fix_cppflags=no
+	;;
+esac
+done
+
+if test -n "$cf_new_cflags" ; then
+
+	CFLAGS="$CFLAGS $cf_new_cflags"
+fi
+
+if test -n "$cf_new_cppflags" ; then
+
+	CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
+fi
+
+if test -n "$cf_new_extra_cppflags" ; then
+
+	EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+fi
+
+fi
+
+	;;
+esac
+
+if test -n "$cf_xopen_source" ; then
+
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
+
+for cf_add_cflags in $cf_xopen_source
+do
+case $cf_fix_cppflags in
+no)
+	case $cf_add_cflags in #(vi
+	-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
+		case $cf_add_cflags in
+		-D*)
+			cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
+
+			test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+				&& test -z "${cf_tst_cflags}" \
+				&& cf_fix_cppflags=yes
+
+			if test $cf_fix_cppflags = yes ; then
+				cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+				continue
+			elif test "${cf_tst_cflags}" = "\"'" ; then
+				cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+				continue
+			fi
+			;;
+		esac
+		case "$CPPFLAGS" in
+		*$cf_add_cflags) #(vi
+			;;
+		*) #(vi
+			case $cf_add_cflags in #(vi
+			-D*)
+				cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
+
+CPPFLAGS=`echo "$CPPFLAGS" | \
+	sed	-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?[ 	]/ /g' \
+		-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?$//g'`
+
+				;;
+			esac
+			cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
+			;;
+		esac
+		;;
+	*)
+		cf_new_cflags="$cf_new_cflags $cf_add_cflags"
+		;;
+	esac
+	;;
+yes)
+	cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+	cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
+
+	test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+		&& test -z "${cf_tst_cflags}" \
+		&& cf_fix_cppflags=no
+	;;
+esac
+done
+
+if test -n "$cf_new_cflags" ; then
+
+	CFLAGS="$CFLAGS $cf_new_cflags"
+fi
+
+if test -n "$cf_new_cppflags" ; then
+
+	CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
+fi
+
+if test -n "$cf_new_extra_cppflags" ; then
+
+	EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+fi
+
+fi
+
+# Check whether --enable-largefile or --disable-largefile was given.
+if test "${enable_largefile+set}" = set; then
+  enableval="$enable_largefile"
+
+fi;
+if test "$enable_largefile" != no; then
+
+  echo "$as_me:8324: checking for special C compiler options needed for large files" >&5
+echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
+if test "${ac_cv_sys_largefile_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_sys_largefile_CC=no
+     if test "$GCC" != yes; then
+       ac_save_CC=$CC
+       while :; do
+     	 # IRIX 6.2 and later do not support large files by default,
+     	 # so use the C compiler's -n32 option if that helps.
+         cat >conftest.$ac_ext <<_ACEOF
+#line 8336 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+    We can't simply define LARGE_OFF_T to be 9223372036854775807,
+    since some C++ compilers masquerading as C compilers
+    incorrectly reject 9223372036854775807.  */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+		       && LARGE_OFF_T % 2147483647 == 1)
+		      ? 1 : -1];
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+     	 rm -f conftest.$ac_objext
+if { (eval echo "$as_me:8356: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:8359: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:8362: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:8365: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  break
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext
+     	 CC="$CC -n32"
+     	 rm -f conftest.$ac_objext
+if { (eval echo "$as_me:8375: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:8378: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:8381: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:8384: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_sys_largefile_CC=' -n32'; break
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext
+         break
+       done
+       CC=$ac_save_CC
+       rm -f conftest.$ac_ext
+    fi
+fi
+echo "$as_me:8398: result: $ac_cv_sys_largefile_CC" >&5
+echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
+  if test "$ac_cv_sys_largefile_CC" != no; then
+    CC=$CC$ac_cv_sys_largefile_CC
+  fi
+
+  echo "$as_me:8404: checking for _FILE_OFFSET_BITS value needed for large files" >&5
+echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
+if test "${ac_cv_sys_file_offset_bits+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  while :; do
+  ac_cv_sys_file_offset_bits=no
+  cat >conftest.$ac_ext <<_ACEOF
+#line 8412 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+    We can't simply define LARGE_OFF_T to be 9223372036854775807,
+    since some C++ compilers masquerading as C compilers
+    incorrectly reject 9223372036854775807.  */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+		       && LARGE_OFF_T % 2147483647 == 1)
+		      ? 1 : -1];
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:8432: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:8435: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:8438: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:8441: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  break
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+  cat >conftest.$ac_ext <<_ACEOF
+#line 8450 "configure"
+#include "confdefs.h"
+#define _FILE_OFFSET_BITS 64
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+    We can't simply define LARGE_OFF_T to be 9223372036854775807,
+    since some C++ compilers masquerading as C compilers
+    incorrectly reject 9223372036854775807.  */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+		       && LARGE_OFF_T % 2147483647 == 1)
+		      ? 1 : -1];
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:8471: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:8474: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:8477: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:8480: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_sys_file_offset_bits=64; break
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+  break
+done
+fi
+echo "$as_me:8491: result: $ac_cv_sys_file_offset_bits" >&5
+echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
+if test "$ac_cv_sys_file_offset_bits" != no; then
+
+cat >>confdefs.h <<EOF
+#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
+EOF
+
+fi
+rm -rf conftest*
+  echo "$as_me:8501: checking for _LARGE_FILES value needed for large files" >&5
+echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
+if test "${ac_cv_sys_large_files+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  while :; do
+  ac_cv_sys_large_files=no
+  cat >conftest.$ac_ext <<_ACEOF
+#line 8509 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+    We can't simply define LARGE_OFF_T to be 9223372036854775807,
+    since some C++ compilers masquerading as C compilers
+    incorrectly reject 9223372036854775807.  */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+		       && LARGE_OFF_T % 2147483647 == 1)
+		      ? 1 : -1];
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:8529: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:8532: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:8535: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:8538: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  break
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+  cat >conftest.$ac_ext <<_ACEOF
+#line 8547 "configure"
+#include "confdefs.h"
+#define _LARGE_FILES 1
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+    We can't simply define LARGE_OFF_T to be 9223372036854775807,
+    since some C++ compilers masquerading as C compilers
+    incorrectly reject 9223372036854775807.  */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+		       && LARGE_OFF_T % 2147483647 == 1)
+		      ? 1 : -1];
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:8568: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:8571: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:8574: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:8577: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_sys_large_files=1; break
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+  break
+done
+fi
+echo "$as_me:8588: result: $ac_cv_sys_large_files" >&5
+echo "${ECHO_T}$ac_cv_sys_large_files" >&6
+if test "$ac_cv_sys_large_files" != no; then
+
+cat >>confdefs.h <<EOF
+#define _LARGE_FILES $ac_cv_sys_large_files
+EOF
+
+fi
+rm -rf conftest*
+fi
+
+    if test "$enable_largefile" != no ; then
+	echo "$as_me:8601: checking for _LARGEFILE_SOURCE value needed for large files" >&5
+echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6
+if test "${ac_cv_sys_largefile_source+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  while :; do
+  ac_cv_sys_largefile_source=no
+  cat >conftest.$ac_ext <<_ACEOF
+#line 8609 "configure"
+#include "confdefs.h"
+#include <stdio.h>
+int
+main ()
+{
+return !fseeko;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:8621: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:8624: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:8627: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:8630: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  break
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+  cat >conftest.$ac_ext <<_ACEOF
+#line 8639 "configure"
+#include "confdefs.h"
+#define _LARGEFILE_SOURCE 1
+#include <stdio.h>
+int
+main ()
+{
+return !fseeko;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:8652: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:8655: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:8658: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:8661: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_sys_largefile_source=1; break
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+  break
+done
+fi
+echo "$as_me:8672: result: $ac_cv_sys_largefile_source" >&5
+echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6
+if test "$ac_cv_sys_largefile_source" != no; then
+
+cat >>confdefs.h <<EOF
+#define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
+EOF
+
+fi
+rm -rf conftest*
+
+# We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
+# in glibc 2.1.3, but that breaks too many other things.
+# If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
+echo "$as_me:8686: checking for fseeko" >&5
+echo $ECHO_N "checking for fseeko... $ECHO_C" >&6
+if test "${ac_cv_func_fseeko+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 8692 "configure"
+#include "confdefs.h"
+#include <stdio.h>
+int
+main ()
+{
+return fseeko && fseeko (stdin, 0, 0);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:8704: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:8707: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:8710: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:8713: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_fseeko=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_func_fseeko=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:8723: result: $ac_cv_func_fseeko" >&5
+echo "${ECHO_T}$ac_cv_func_fseeko" >&6
+if test $ac_cv_func_fseeko = yes; then
+
+cat >>confdefs.h <<\EOF
+#define HAVE_FSEEKO 1
+EOF
+
+fi
+
+	# Normally we would collect these definitions in the config.h,
+	# but (like _XOPEN_SOURCE), some environments rely on having these
+	# defined before any of the system headers are included.  Another
+	# case comes up with C++, e.g., on AIX the compiler compiles the
+	# header files by themselves before looking at the body files it is
+	# told to compile.  For ncurses, those header files do not include
+	# the config.h
+	test "$ac_cv_sys_large_files"      != no && CPPFLAGS="$CPPFLAGS -D_LARGE_FILES "
+	test "$ac_cv_sys_largefile_source" != no && CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE "
+	test "$ac_cv_sys_file_offset_bits" != no && CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits "
+
+	echo "$as_me:8744: checking whether to use struct dirent64" >&5
+echo $ECHO_N "checking whether to use struct dirent64... $ECHO_C" >&6
+if test "${cf_cv_struct_dirent64+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+		cat >conftest.$ac_ext <<_ACEOF
+#line 8751 "configure"
+#include "confdefs.h"
+
+#include <sys/types.h>
+#include <dirent.h>
+
+int
+main ()
+{
+
+		/* if transitional largefile support is setup, this is true */
+		extern struct dirent64 * readdir(DIR *);
+		struct dirent64 *x = readdir((DIR *)0);
+		struct dirent *y = readdir((DIR *)0);
+		int z = x - y;
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:8772: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:8775: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:8778: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:8781: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_struct_dirent64=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_struct_dirent64=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+fi
+echo "$as_me:8792: result: $cf_cv_struct_dirent64" >&5
+echo "${ECHO_T}$cf_cv_struct_dirent64" >&6
+	test "$cf_cv_struct_dirent64" = yes && cat >>confdefs.h <<\EOF
+#define HAVE_STRUCT_DIRENT64 1
+EOF
+
+    fi
+
+### Enable compiling-in rcs id's
+echo "$as_me:8801: checking if RCS identifiers should be compiled-in" >&5
+echo $ECHO_N "checking if RCS identifiers should be compiled-in... $ECHO_C" >&6
+
+# Check whether --with-rcs-ids or --without-rcs-ids was given.
+if test "${with_rcs_ids+set}" = set; then
+  withval="$with_rcs_ids"
+  with_rcs_ids=$withval
+else
+  with_rcs_ids=no
+fi;
+echo "$as_me:8811: result: $with_rcs_ids" >&5
+echo "${ECHO_T}$with_rcs_ids" >&6
+test "$with_rcs_ids" = yes && cat >>confdefs.h <<\EOF
+#define USE_RCS_IDS 1
+EOF
+
+###############################################################################
+
+### Note that some functions (such as const) are normally disabled anyway.
+echo "$as_me:8820: checking if you want to build with function extensions" >&5
+echo $ECHO_N "checking if you want to build with function extensions... $ECHO_C" >&6
+
+# Check whether --enable-ext-funcs or --disable-ext-funcs was given.
+if test "${enable_ext_funcs+set}" = set; then
+  enableval="$enable_ext_funcs"
+  with_ext_funcs=$enableval
+else
+  with_ext_funcs=yes
+fi;
+echo "$as_me:8830: result: $with_ext_funcs" >&5
+echo "${ECHO_T}$with_ext_funcs" >&6
+if test "$with_ext_funcs" = yes ; then
+	NCURSES_EXT_FUNCS=1
+	cat >>confdefs.h <<\EOF
+#define HAVE_USE_DEFAULT_COLORS 1
+EOF
+
+	cat >>confdefs.h <<\EOF
+#define NCURSES_EXT_FUNCS 1
+EOF
+
+else
+	NCURSES_EXT_FUNCS=0
+fi
+
+###   use option --enable-const to turn on use of const beyond that in XSI.
+echo "$as_me:8847: checking for extended use of const keyword" >&5
+echo $ECHO_N "checking for extended use of const keyword... $ECHO_C" >&6
+
+# Check whether --enable-const or --disable-const was given.
+if test "${enable_const+set}" = set; then
+  enableval="$enable_const"
+  with_ext_const=$enableval
+else
+  with_ext_const=no
+fi;
+echo "$as_me:8857: result: $with_ext_const" >&5
+echo "${ECHO_T}$with_ext_const" >&6
+NCURSES_CONST='/*nothing*/'
+if test "$with_ext_const" = yes ; then
+	NCURSES_CONST=const
+fi
+
+###############################################################################
+# These options are relatively safe to experiment with.
+
+echo "$as_me:8867: checking if you want all development code" >&5
+echo $ECHO_N "checking if you want all development code... $ECHO_C" >&6
+
+# Check whether --with-develop or --without-develop was given.
+if test "${with_develop+set}" = set; then
+  withval="$with_develop"
+  with_develop=$withval
+else
+  with_develop=no
+fi;
+echo "$as_me:8877: result: $with_develop" >&5
+echo "${ECHO_T}$with_develop" >&6
+
+###############################################################################
+# These are just experimental, probably should not be in a package:
+
+# This is still experimental (20080329), but should ultimately be moved to
+# the script-block --with-normal, etc.
+
+echo "$as_me:8886: checking if you want to link with the pthread library" >&5
+echo $ECHO_N "checking if you want to link with the pthread library... $ECHO_C" >&6
+
+# Check whether --with-pthread or --without-pthread was given.
+if test "${with_pthread+set}" = set; then
+  withval="$with_pthread"
+  with_pthread=$withval
+else
+  with_pthread=no
+fi;
+echo "$as_me:8896: result: $with_pthread" >&5
+echo "${ECHO_T}$with_pthread" >&6
+
+if test "$with_pthread" != no ; then
+    echo "$as_me:8900: checking for pthread.h" >&5
+echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6
+if test "${ac_cv_header_pthread_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 8906 "configure"
+#include "confdefs.h"
+#include <pthread.h>
+_ACEOF
+if { (eval echo "$as_me:8910: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  egrep -v '^ *\+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:8916: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_cv_header_pthread_h=yes
+else
+  echo "$as_me: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  ac_cv_header_pthread_h=no
+fi
+rm -f conftest.err conftest.$ac_ext
+fi
+echo "$as_me:8935: result: $ac_cv_header_pthread_h" >&5
+echo "${ECHO_T}$ac_cv_header_pthread_h" >&6
+if test $ac_cv_header_pthread_h = yes; then
+
+        cat >>confdefs.h <<\EOF
+#define HAVE_PTHREADS_H 1
+EOF
+
+        echo "$as_me:8943: checking if we can link with the pthread library" >&5
+echo $ECHO_N "checking if we can link with the pthread library... $ECHO_C" >&6
+        cf_save_LIBS="$LIBS"
+        LIBS="-lpthread $LIBS"
+        cat >conftest.$ac_ext <<_ACEOF
+#line 8948 "configure"
+#include "confdefs.h"
+
+#include <pthread.h>
+
+int
+main ()
+{
+
+        int rc = pthread_create(0,0,0,0);
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:8964: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:8967: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:8970: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:8973: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  with_pthread=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+with_pthread=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+        LIBS="$cf_save_LIBS"
+        echo "$as_me:8983: result: $with_pthread" >&5
+echo "${ECHO_T}$with_pthread" >&6
+
+        if test "$with_pthread" = yes ; then
+            LIBS="-lpthread $LIBS"
+            cat >>confdefs.h <<\EOF
+#define HAVE_LIBPTHREADS 1
+EOF
+
+        else
+            { { echo "$as_me:8993: error: Cannot link with pthread library" >&5
+echo "$as_me: error: Cannot link with pthread library" >&2;}
+   { (exit 1); exit 1; }; }
+        fi
+
+fi
+
+fi
+
+echo "$as_me:9002: checking if you want to use weak-symbols for pthreads" >&5
+echo $ECHO_N "checking if you want to use weak-symbols for pthreads... $ECHO_C" >&6
+
+# Check whether --enable-weak-symbols or --disable-weak-symbols was given.
+if test "${enable_weak_symbols+set}" = set; then
+  enableval="$enable_weak_symbols"
+  use_weak_symbols=$withval
+else
+  use_weak_symbols=no
+fi;
+echo "$as_me:9012: result: $use_weak_symbols" >&5
+echo "${ECHO_T}$use_weak_symbols" >&6
+if test "$use_weak_symbols" = yes ; then
+
+echo "$as_me:9016: checking if $CC supports weak symbols" >&5
+echo $ECHO_N "checking if $CC supports weak symbols... $ECHO_C" >&6
+if test "${cf_cv_weak_symbols+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+cat >conftest.$ac_ext <<_ACEOF
+#line 9023 "configure"
+#include "confdefs.h"
+
+#include <stdio.h>
+int
+main ()
+{
+
+#if defined(__GNUC__)
+#  if defined __USE_ISOC99
+#    define _cat_pragma(exp)	_Pragma(#exp)
+#    define _weak_pragma(exp)	_cat_pragma(weak name)
+#  else
+#    define _weak_pragma(exp)
+#  endif
+#  define _declare(name)	__extension__ extern __typeof__(name) name
+#  define weak_symbol(name)	_weak_pragma(name) _declare(name) __attribute__((weak))
+#endif
+
+weak_symbol(fopen);
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:9049: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:9052: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:9055: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:9058: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_weak_symbols=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_weak_symbols=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+fi
+echo "$as_me:9069: result: $cf_cv_weak_symbols" >&5
+echo "${ECHO_T}$cf_cv_weak_symbols" >&6
+
+else
+    cf_cv_weak_symbols=no
+fi
+
+if test $cf_cv_weak_symbols = yes ; then
+    cat >>confdefs.h <<\EOF
+#define USE_WEAK_SYMBOLS 1
+EOF
+
+fi
+
+PTHREAD=
+if test "$with_pthread" = "yes" ; then
+    cat >>confdefs.h <<\EOF
+#define USE_PTHREADS 1
+EOF
+
+    enable_reentrant=yes
+    if test $cf_cv_weak_symbols = yes ; then
+        PTHREAD=-lpthread
+    fi
+fi
+
+# Reentrant code has to be opaque; there's little advantage to making ncurses
+# opaque outside of that, so there is no --enable-opaque option.  We can use
+# this option without --with-pthreads, but this will be always set for
+# pthreads.
+echo "$as_me:9099: checking if you want experimental reentrant code" >&5
+echo $ECHO_N "checking if you want experimental reentrant code... $ECHO_C" >&6
+
+# Check whether --enable-reentrant or --disable-reentrant was given.
+if test "${enable_reentrant+set}" = set; then
+  enableval="$enable_reentrant"
+  with_reentrant=$enableval
+else
+  with_reentrant=no
+fi;
+echo "$as_me:9109: result: $with_reentrant" >&5
+echo "${ECHO_T}$with_reentrant" >&6
+if test "$with_reentrant" = yes ; then
+	cf_cv_enable_reentrant=1
+	if test $cf_cv_weak_symbols = yes ; then
+
+# remove pthread library from $LIBS
+LIBS=`echo "$LIBS" | sed -e 's/-lpthread[ 	]//g' -e 's/-lpthread$//'`
+
+	else
+		LIB_SUFFIX="t${LIB_SUFFIX}"
+	fi
+	cat >>confdefs.h <<\EOF
+#define USE_REENTRANT 1
+EOF
+
+else
+	cf_cv_enable_reentrant=0
+fi
+
+### Allow using a different wrap-prefix
+if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then
+	echo "$as_me:9131: checking for prefix used to wrap public variables" >&5
+echo $ECHO_N "checking for prefix used to wrap public variables... $ECHO_C" >&6
+
+# Check whether --with-wrap-prefix or --without-wrap-prefix was given.
+if test "${with_wrap_prefix+set}" = set; then
+  withval="$with_wrap_prefix"
+  NCURSES_WRAP_PREFIX=$withval
+else
+  NCURSES_WRAP_PREFIX=_nc_
+fi;
+	echo "$as_me:9141: result: $NCURSES_WRAP_PREFIX" >&5
+echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
+else
+	NCURSES_WRAP_PREFIX=_nc_
+fi
+
+cat >>confdefs.h <<EOF
+#define NCURSES_WRAP_PREFIX "$NCURSES_WRAP_PREFIX"
+EOF
+
+###############################################################################
+
+###	use option --disable-echo to suppress full display compiling commands
+echo "$as_me:9154: checking if you want to display full commands during build" >&5
+echo $ECHO_N "checking if you want to display full commands during build... $ECHO_C" >&6
+
+# Check whether --enable-echo or --disable-echo was given.
+if test "${enable_echo+set}" = set; then
+  enableval="$enable_echo"
+  with_echo=$enableval
+else
+  with_echo=yes
+fi;
+if test "$with_echo" = yes; then
+	ECHO_LINK=
+else
+	ECHO_LINK='@ echo linking $@ ... ;'
+fi
+echo "$as_me:9169: result: $with_echo" >&5
+echo "${ECHO_T}$with_echo" >&6
+
+###	use option --enable-warnings to turn on all gcc warnings
+echo "$as_me:9173: checking if you want to see compiler warnings" >&5
+echo $ECHO_N "checking if you want to see compiler warnings... $ECHO_C" >&6
+
+# Check whether --enable-warnings or --disable-warnings was given.
+if test "${enable_warnings+set}" = set; then
+  enableval="$enable_warnings"
+  with_warnings=$enableval
+fi;
+echo "$as_me:9181: result: $with_warnings" >&5
+echo "${ECHO_T}$with_warnings" >&6
+
+if test "x$with_warnings" = "xyes"; then
+ 	ADAFLAGS="$ADAFLAGS -gnatg"
+
+INTEL_COMPILER=no
+
+if test "$GCC" = yes ; then
+	case $host_os in
+	linux*|gnu*)
+		echo "$as_me:9192: checking if this is really Intel C compiler" >&5
+echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
+		cf_save_CFLAGS="$CFLAGS"
+		CFLAGS="$CFLAGS -no-gcc"
+		cat >conftest.$ac_ext <<_ACEOF
+#line 9197 "configure"
+#include "confdefs.h"
+
+int
+main ()
+{
+
+#ifdef __INTEL_COMPILER
+#else
+make an error
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:9214: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:9217: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:9220: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:9223: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  INTEL_COMPILER=yes
+cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc"
+
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+		CFLAGS="$cf_save_CFLAGS"
+		echo "$as_me:9234: result: $INTEL_COMPILER" >&5
+echo "${ECHO_T}$INTEL_COMPILER" >&6
+		;;
+	esac
+fi
+
+cat > conftest.$ac_ext <<EOF
+#line 9241 "${as_me:-configure}"
+int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
+EOF
+
+if test "$INTEL_COMPILER" = yes
+then
+# The "-wdXXX" options suppress warnings:
+# remark #1419: external declaration in primary source file
+# remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
+# remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
+# remark #193: zero used for undefined preprocessing identifier
+# remark #593: variable "curs_sb_left_arrow" was set but never used
+# remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
+# remark #869: parameter "tw" was never referenced
+# remark #981: operands are evaluated in unspecified order
+# warning #279: controlling expression is constant
+
+	{ echo "$as_me:9258: checking for $CC warning options..." >&5
+echo "$as_me: checking for $CC warning options..." >&6;}
+	cf_save_CFLAGS="$CFLAGS"
+	EXTRA_CFLAGS="-Wall"
+	for cf_opt in \
+		wd1419 \
+		wd1683 \
+		wd1684 \
+		wd193 \
+		wd593 \
+		wd279 \
+		wd810 \
+		wd869 \
+		wd981
+	do
+		CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
+		if { (eval echo "$as_me:9274: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:9277: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+			test -n "$verbose" && echo "$as_me:9279: result: ... -$cf_opt" >&5
+echo "${ECHO_T}... -$cf_opt" >&6
+			EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
+		fi
+	done
+	CFLAGS="$cf_save_CFLAGS"
+
+elif test "$GCC" = yes
+then
+	{ echo "$as_me:9288: checking for $CC warning options..." >&5
+echo "$as_me: checking for $CC warning options..." >&6;}
+	cf_save_CFLAGS="$CFLAGS"
+	EXTRA_CFLAGS=
+	cf_warn_CONST=""
+	test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
+	for cf_opt in W Wall \
+		Wbad-function-cast \
+		Wcast-align \
+		Wcast-qual \
+		Winline \
+		Wmissing-declarations \
+		Wmissing-prototypes \
+		Wnested-externs \
+		Wpointer-arith \
+		Wshadow \
+		Wstrict-prototypes \
+		Wundef $cf_warn_CONST Wdeclaration-after-statement Wextra Wno-unknown-pragmas Wswitch-enum
+	do
+		CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
+		if { (eval echo "$as_me:9308: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:9311: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+			test -n "$verbose" && echo "$as_me:9313: result: ... -$cf_opt" >&5
+echo "${ECHO_T}... -$cf_opt" >&6
+			case $cf_opt in #(vi
+			Wcast-qual) #(vi
+				CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
+				;;
+			Winline) #(vi
+				case $GCC_VERSION in
+				[34].*)
+					test -n "$verbose" && echo "	feature is broken in gcc $GCC_VERSION" 1>&6
+
+echo "${as_me:-configure}:9324: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
+
+					continue;;
+				esac
+				;;
+			esac
+			EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
+		fi
+	done
+	CFLAGS="$cf_save_CFLAGS"
+fi
+rm -rf conftest*
+
+fi
+
+if test "$GCC" = yes
+then
+cat > conftest.i <<EOF
+#ifndef GCC_PRINTF
+#define GCC_PRINTF 0
+#endif
+#ifndef GCC_SCANF
+#define GCC_SCANF 0
+#endif
+#ifndef GCC_NORETURN
+#define GCC_NORETURN /* nothing */
+#endif
+#ifndef GCC_UNUSED
+#define GCC_UNUSED /* nothing */
+#endif
+EOF
+if test "$GCC" = yes
+then
+	{ echo "$as_me:9357: checking for $CC __attribute__ directives..." >&5
+echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
+cat > conftest.$ac_ext <<EOF
+#line 9360 "${as_me:-configure}"
+#include "confdefs.h"
+#include "conftest.h"
+#include "conftest.i"
+#if	GCC_PRINTF
+#define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
+#else
+#define GCC_PRINTFLIKE(fmt,var) /*nothing*/
+#endif
+#if	GCC_SCANF
+#define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
+#else
+#define GCC_SCANFLIKE(fmt,var)  /*nothing*/
+#endif
+extern void wow(char *,...) GCC_SCANFLIKE(1,2);
+extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
+extern void foo(void) GCC_NORETURN;
+int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
+EOF
+	cf_printf_attribute=no
+	cf_scanf_attribute=no
+	for cf_attribute in scanf printf unused noreturn
+	do
+
+cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
+
+		cf_directive="__attribute__(($cf_attribute))"
+		echo "checking for $CC $cf_directive" 1>&5
+
+		case $cf_attribute in #(vi
+		printf) #(vi
+			cf_printf_attribute=yes
+			cat >conftest.h <<EOF
+#define GCC_$cf_ATTRIBUTE 1
+EOF
+			;;
+		scanf) #(vi
+			cf_scanf_attribute=yes
+			cat >conftest.h <<EOF
+#define GCC_$cf_ATTRIBUTE 1
+EOF
+			;;
+		*) #(vi
+			cat >conftest.h <<EOF
+#define GCC_$cf_ATTRIBUTE $cf_directive
+EOF
+			;;
+		esac
+
+		if { (eval echo "$as_me:9409: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:9412: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+			test -n "$verbose" && echo "$as_me:9414: result: ... $cf_attribute" >&5
+echo "${ECHO_T}... $cf_attribute" >&6
+			cat conftest.h >>confdefs.h
+			case $cf_attribute in #(vi
+			printf) #(vi
+				if test "$cf_printf_attribute" = no ; then
+					cat >>confdefs.h <<EOF
+#define GCC_PRINTFLIKE(fmt,var) /* nothing */
+EOF
+				else
+					cat >>confdefs.h <<EOF
+#define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
+EOF
+				fi
+				;;
+			scanf) #(vi
+				if test "$cf_scanf_attribute" = no ; then
+					cat >>confdefs.h <<EOF
+#define GCC_SCANFLIKE(fmt,var) /* nothing */
+EOF
+				else
+					cat >>confdefs.h <<EOF
+#define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
+EOF
+				fi
+				;;
+			esac
+		fi
+	done
+else
+	fgrep define conftest.i >>confdefs.h
+fi
+rm -rf conftest*
+fi
+
+###	use option --enable-assertions to turn on generation of assertion code
+echo "$as_me:9450: checking if you want to enable runtime assertions" >&5
+echo $ECHO_N "checking if you want to enable runtime assertions... $ECHO_C" >&6
+
+# Check whether --enable-assertions or --disable-assertions was given.
+if test "${enable_assertions+set}" = set; then
+  enableval="$enable_assertions"
+  with_assertions=$enableval
+else
+  with_assertions=no
+fi;
+echo "$as_me:9460: result: $with_assertions" >&5
+echo "${ECHO_T}$with_assertions" >&6
+if test -n "$GCC"
+then
+	if test "$with_assertions" = no
+	then
+		cat >>confdefs.h <<\EOF
+#define NDEBUG 1
+EOF
+
+		CPPFLAGS="$CPPFLAGS -DNDEBUG"
+	else
+		ADAFLAGS="$ADAFLAGS -gnata"
+	fi
+fi
+
+###	use option --disable-leaks to suppress "permanent" leaks, for testing
+cat >>confdefs.h <<\EOF
+#define HAVE_NC_ALLOC_H 1
+EOF
+
+###	use option --enable-expanded to generate certain macros as functions
+
+# Check whether --enable-expanded or --disable-expanded was given.
+if test "${enable_expanded+set}" = set; then
+  enableval="$enable_expanded"
+  test "$enableval" = yes && cat >>confdefs.h <<\EOF
+#define NCURSES_EXPANDED 1
+EOF
+
+fi;
+
+###	use option --disable-macros to suppress macros in favor of functions
+
+# Check whether --enable-macros or --disable-macros was given.
+if test "${enable_macros+set}" = set; then
+  enableval="$enable_macros"
+  test "$enableval" = no && cat >>confdefs.h <<\EOF
+#define NCURSES_NOMACROS 1
+EOF
+
+fi;
+
+# Normally we only add trace() to the debug-library.  Allow this to be
+# extended to all models of the ncurses library:
+cf_all_traces=no
+case "$CFLAGS $CPPFLAGS" in
+*-DTRACE*)
+	cf_all_traces=yes
+	;;
+esac
+
+echo "$as_me:9512: checking whether to add trace feature to all models" >&5
+echo $ECHO_N "checking whether to add trace feature to all models... $ECHO_C" >&6
+
+# Check whether --with-trace or --without-trace was given.
+if test "${with_trace+set}" = set; then
+  withval="$with_trace"
+  cf_with_trace=$withval
+else
+  cf_with_trace=$cf_all_traces
+fi;
+echo "$as_me:9522: result: $cf_with_trace" >&5
+echo "${ECHO_T}$cf_with_trace" >&6
+
+if test "$cf_with_trace" = yes ; then
+	ADA_TRACE=TRUE
+
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
+
+for cf_add_cflags in -DTRACE
+do
+case $cf_fix_cppflags in
+no)
+	case $cf_add_cflags in #(vi
+	-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
+		case $cf_add_cflags in
+		-D*)
+			cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
+
+			test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+				&& test -z "${cf_tst_cflags}" \
+				&& cf_fix_cppflags=yes
+
+			if test $cf_fix_cppflags = yes ; then
+				cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+				continue
+			elif test "${cf_tst_cflags}" = "\"'" ; then
+				cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+				continue
+			fi
+			;;
+		esac
+		case "$CPPFLAGS" in
+		*$cf_add_cflags) #(vi
+			;;
+		*) #(vi
+			case $cf_add_cflags in #(vi
+			-D*)
+				cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
+
+CPPFLAGS=`echo "$CPPFLAGS" | \
+	sed	-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?[ 	]/ /g' \
+		-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?$//g'`
+
+				;;
+			esac
+			cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
+			;;
+		esac
+		;;
+	*)
+		cf_new_cflags="$cf_new_cflags $cf_add_cflags"
+		;;
+	esac
+	;;
+yes)
+	cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+	cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
+
+	test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+		&& test -z "${cf_tst_cflags}" \
+		&& cf_fix_cppflags=no
+	;;
+esac
+done
+
+if test -n "$cf_new_cflags" ; then
+
+	CFLAGS="$CFLAGS $cf_new_cflags"
+fi
+
+if test -n "$cf_new_cppflags" ; then
+
+	CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
+fi
+
+if test -n "$cf_new_extra_cppflags" ; then
+
+	EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+fi
+
+else
+	ADA_TRACE=FALSE
+fi
+
+###	Checks for libraries.
+case $cf_cv_system_name in #(vi
+*mingw32*) #(vi
+	;;
+*)
+echo "$as_me:9615: checking for gettimeofday" >&5
+echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6
+if test "${ac_cv_func_gettimeofday+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 9621 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char gettimeofday (); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char gettimeofday ();
+char (*f) ();
+
+int
+main ()
+{
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_gettimeofday) || defined (__stub___gettimeofday)
+choke me
+#else
+f = gettimeofday;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:9652: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:9655: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:9658: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:9661: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_gettimeofday=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_func_gettimeofday=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:9671: result: $ac_cv_func_gettimeofday" >&5
+echo "${ECHO_T}$ac_cv_func_gettimeofday" >&6
+if test $ac_cv_func_gettimeofday = yes; then
+  cat >>confdefs.h <<\EOF
+#define HAVE_GETTIMEOFDAY 1
+EOF
+
+else
+
+echo "$as_me:9680: checking for gettimeofday in -lbsd" >&5
+echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6
+if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lbsd  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line 9688 "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char gettimeofday ();
+int
+main ()
+{
+gettimeofday ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:9707: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:9710: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:9713: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:9716: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_bsd_gettimeofday=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_bsd_gettimeofday=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:9727: result: $ac_cv_lib_bsd_gettimeofday" >&5
+echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6
+if test $ac_cv_lib_bsd_gettimeofday = yes; then
+  cat >>confdefs.h <<\EOF
+#define HAVE_GETTIMEOFDAY 1
+EOF
+
+	LIBS="$LIBS -lbsd"
+fi
+
+fi
+	;;
+esac
+
+###	Checks for header files.
+echo "$as_me:9742: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
+if test "${ac_cv_header_stdc+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 9748 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+_ACEOF
+if { (eval echo "$as_me:9756: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  egrep -v '^ *\+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:9762: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_cv_header_stdc=yes
+else
+  echo "$as_me: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  ac_cv_header_stdc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+  cat >conftest.$ac_ext <<_ACEOF
+#line 9784 "configure"
+#include "confdefs.h"
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "memchr" >/dev/null 2>&1; then
+  :
+else
+  ac_cv_header_stdc=no
+fi
+rm -rf conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+  cat >conftest.$ac_ext <<_ACEOF
+#line 9802 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "free" >/dev/null 2>&1; then
+  :
+else
+  ac_cv_header_stdc=no
+fi
+rm -rf conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+  if test "$cross_compiling" = yes; then
+  :
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 9823 "configure"
+#include "confdefs.h"
+#include <ctype.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
+                     || ('j' <= (c) && (c) <= 'r') \
+                     || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+        || toupper (i) != TOUPPER (i))
+      $ac_main_return(2);
+  $ac_main_return (0);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:9849: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:9852: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:9854: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:9857: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_header_stdc=no
+fi
+rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+fi
+echo "$as_me:9870: result: $ac_cv_header_stdc" >&5
+echo "${ECHO_T}$ac_cv_header_stdc" >&6
+if test $ac_cv_header_stdc = yes; then
+
+cat >>confdefs.h <<\EOF
+#define STDC_HEADERS 1
+EOF
+
+fi
+
+ac_header_dirent=no
+for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
+  as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
+echo "$as_me:9883: checking for $ac_hdr that defines DIR" >&5
+echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 9889 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <$ac_hdr>
+
+int
+main ()
+{
+if ((DIR *) 0)
+return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:9904: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:9907: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:9910: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:9913: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_Header=yes"
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+eval "$as_ac_Header=no"
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:9923: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
+EOF
+
+ac_header_dirent=$ac_hdr; break
+fi
+
+done
+# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
+if test $ac_header_dirent = dirent.h; then
+  echo "$as_me:9936: checking for opendir in -ldir" >&5
+echo $ECHO_N "checking for opendir in -ldir... $ECHO_C" >&6
+if test "${ac_cv_lib_dir_opendir+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldir  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line 9944 "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char opendir ();
+int
+main ()
+{
+opendir ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:9963: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:9966: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:9969: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:9972: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_dir_opendir=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_dir_opendir=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:9983: result: $ac_cv_lib_dir_opendir" >&5
+echo "${ECHO_T}$ac_cv_lib_dir_opendir" >&6
+if test $ac_cv_lib_dir_opendir = yes; then
+  LIBS="$LIBS -ldir"
+fi
+
+else
+  echo "$as_me:9990: checking for opendir in -lx" >&5
+echo $ECHO_N "checking for opendir in -lx... $ECHO_C" >&6
+if test "${ac_cv_lib_x_opendir+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lx  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line 9998 "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char opendir ();
+int
+main ()
+{
+opendir ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:10017: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:10020: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:10023: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:10026: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_x_opendir=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_x_opendir=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:10037: result: $ac_cv_lib_x_opendir" >&5
+echo "${ECHO_T}$ac_cv_lib_x_opendir" >&6
+if test $ac_cv_lib_x_opendir = yes; then
+  LIBS="$LIBS -lx"
+fi
+
+fi
+
+echo "$as_me:10045: checking whether time.h and sys/time.h may both be included" >&5
+echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
+if test "${ac_cv_header_time+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 10051 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <sys/time.h>
+#include <time.h>
+
+int
+main ()
+{
+if ((struct tm *) 0)
+return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:10067: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:10070: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:10073: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:10076: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_header_time=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_header_time=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:10086: result: $ac_cv_header_time" >&5
+echo "${ECHO_T}$ac_cv_header_time" >&6
+if test $ac_cv_header_time = yes; then
+
+cat >>confdefs.h <<\EOF
+#define TIME_WITH_SYS_TIME 1
+EOF
+
+fi
+
+###	checks for compiler characteristics
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+ac_main_return=return
+
+echo "$as_me:10104: checking for $CC option to accept ANSI C" >&5
+echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_stdc+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_prog_cc_stdc=no
+ac_save_CC=$CC
+cat >conftest.$ac_ext <<_ACEOF
+#line 10112 "configure"
+#include "confdefs.h"
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+     char **p;
+     int i;
+{
+  return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+  char *s;
+  va_list v;
+  va_start (v,p);
+  s = g (p, va_arg (v,int));
+  va_end (v);
+  return s;
+}
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
+  ;
+  return 0;
+}
+_ACEOF
+# Don't try gcc -ansi; that turns off useful extensions and
+# breaks some systems' header files.
+# AIX			-qlanglvl=ansi
+# Ultrix and OSF/1	-std1
+# HP-UX 10.20 and later	-Ae
+# HP-UX older versions	-Aa -D_HPUX_SOURCE
+# SVR4			-Xc -D__EXTENSIONS__
+for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  rm -f conftest.$ac_objext
+if { (eval echo "$as_me:10161: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:10164: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:10167: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:10170: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_prog_cc_stdc=$ac_arg
+break
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext
+done
+rm -f conftest.$ac_ext conftest.$ac_objext
+CC=$ac_save_CC
+
+fi
+
+case "x$ac_cv_prog_cc_stdc" in
+  x|xno)
+    echo "$as_me:10187: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6 ;;
+  *)
+    echo "$as_me:10190: result: $ac_cv_prog_cc_stdc" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
+    CC="$CC $ac_cv_prog_cc_stdc" ;;
+esac
+
+echo "$as_me:10195: checking for an ANSI C-conforming const" >&5
+echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
+if test "${ac_cv_c_const+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 10201 "configure"
+#include "confdefs.h"
+
+int
+main ()
+{
+/* FIXME: Include the comments suggested by Paul. */
+#ifndef __cplusplus
+  /* Ultrix mips cc rejects this.  */
+  typedef int charset[2];
+  const charset x;
+  /* SunOS 4.1.1 cc rejects this.  */
+  char const *const *ccp;
+  char **p;
+  /* NEC SVR4.0.2 mips cc rejects this.  */
+  struct point {int x, y;};
+  static struct point const zero = {0,0};
+  /* AIX XL C 1.02.0.0 rejects this.
+     It does not let you subtract one const X* pointer from another in
+     an arm of an if-expression whose if-part is not a constant
+     expression */
+  const char *g = "string";
+  ccp = &g + (g ? g-g : 0);
+  /* HPUX 7.0 cc rejects these. */
+  ++ccp;
+  p = (char**) ccp;
+  ccp = (char const *const *) p;
+  { /* SCO 3.2v4 cc rejects this.  */
+    char *t;
+    char const *s = 0 ? (char *) 0 : (char const *) 0;
+
+    *t++ = 0;
+  }
+  { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
+    int x[] = {25, 17};
+    const int *foo = &x[0];
+    ++foo;
+  }
+  { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
+    typedef const int *iptr;
+    iptr p = 0;
+    ++p;
+  }
+  { /* AIX XL C 1.02.0.0 rejects this saying
+       "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
+    struct s { int j; const int *ap[3]; };
+    struct s *b; b->j = 5;
+  }
+  { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
+    const int foo = 10;
+  }
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:10259: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:10262: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:10265: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:10268: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_c_const=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_c_const=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:10278: result: $ac_cv_c_const" >&5
+echo "${ECHO_T}$ac_cv_c_const" >&6
+if test $ac_cv_c_const = no; then
+
+cat >>confdefs.h <<\EOF
+#define const
+EOF
+
+fi
+
+###	Checks for external-data
+
+echo "$as_me:10290: checking if data-only library module links" >&5
+echo $ECHO_N "checking if data-only library module links... $ECHO_C" >&6
+if test "${cf_cv_link_dataonly+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+	rm -f conftest.a
+	cat >conftest.$ac_ext <<EOF
+#line 10298 "configure"
+int	testdata[3] = { 123, 456, 789 };
+EOF
+	if { (eval echo "$as_me:10301: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:10304: \$? = $ac_status" >&5
+  (exit $ac_status); } ; then
+		mv conftest.o data.o && \
+		( $AR $ARFLAGS conftest.a data.o ) 2>&5 1>/dev/null
+	fi
+	rm -f conftest.$ac_ext data.o
+	cat >conftest.$ac_ext <<EOF
+#line 10311 "configure"
+int	testfunc()
+{
+#if defined(NeXT)
+	${cf_cv_main_return:-return}(1);	/* I'm told this linker is broken */
+#else
+	extern int testdata[3];
+	return testdata[0] == 123
+	   &&  testdata[1] == 456
+	   &&  testdata[2] == 789;
+#endif
+}
+EOF
+	if { (eval echo "$as_me:10324: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:10327: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+		mv conftest.o func.o && \
+		( $AR $ARFLAGS conftest.a func.o ) 2>&5 1>/dev/null
+	fi
+	rm -f conftest.$ac_ext func.o
+	( eval $RANLIB conftest.a ) 2>&5 >/dev/null
+	cf_saveLIBS="$LIBS"
+	LIBS="conftest.a $LIBS"
+	if test "$cross_compiling" = yes; then
+  cf_cv_link_dataonly=unknown
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 10340 "configure"
+#include "confdefs.h"
+
+	int main()
+	{
+		extern int testfunc();
+		${cf_cv_main_return:-return} (!testfunc());
+	}
+
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:10351: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:10354: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:10356: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:10359: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_link_dataonly=yes
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_link_dataonly=no
+fi
+rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+	LIBS="$cf_saveLIBS"
+
+fi
+
+echo "$as_me:10374: result: $cf_cv_link_dataonly" >&5
+echo "${ECHO_T}$cf_cv_link_dataonly" >&6
+
+if test "$cf_cv_link_dataonly" = no ; then
+	cat >>confdefs.h <<\EOF
+#define BROKEN_LINKER 1
+EOF
+
+	BROKEN_LINKER=1
+fi
+
+###	Checks for library functions.
+
+echo "$as_me:10387: checking for working mkstemp" >&5
+echo $ECHO_N "checking for working mkstemp... $ECHO_C" >&6
+if test "${cf_cv_func_mkstemp+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+rm -rf conftest*
+if test "$cross_compiling" = yes; then
+  echo "$as_me:10395: checking for mkstemp" >&5
+echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6
+if test "${ac_cv_func_mkstemp+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 10401 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char mkstemp (); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char mkstemp ();
+char (*f) ();
+
+int
+main ()
+{
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_mkstemp) || defined (__stub___mkstemp)
+choke me
+#else
+f = mkstemp;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:10432: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:10435: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:10438: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:10441: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_mkstemp=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_func_mkstemp=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:10451: result: $ac_cv_func_mkstemp" >&5
+echo "${ECHO_T}$ac_cv_func_mkstemp" >&6
+
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 10456 "configure"
+#include "confdefs.h"
+
+#include <sys/types.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <sys/stat.h>
+int main()
+{
+	char *tmpl = "conftestXXXXXX";
+	char name[2][80];
+	int n;
+	int result = 0;
+	int fd;
+	struct stat sb;
+
+	umask(077);
+	for (n = 0; n < 2; ++n) {
+		strcpy(name[n], tmpl);
+		if ((fd = mkstemp(name[n])) >= 0) {
+			if (!strcmp(name[n], tmpl)
+			 || stat(name[n], &sb) != 0
+			 || (sb.st_mode & S_IFMT) != S_IFREG
+			 || (sb.st_mode & 077) != 0) {
+				result = 1;
+			}
+			close(fd);
+		}
+	}
+	if (result == 0
+	 && !strcmp(name[0], name[1]))
+		result = 1;
+	${cf_cv_main_return:-return}(result);
+}
+
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:10494: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:10497: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:10499: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:10502: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_func_mkstemp=yes
+
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_func_mkstemp=no
+
+fi
+rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+fi
+echo "$as_me:10517: result: $cf_cv_func_mkstemp" >&5
+echo "${ECHO_T}$cf_cv_func_mkstemp" >&6
+if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then
+	cat >>confdefs.h <<\EOF
+#define HAVE_MKSTEMP 1
+EOF
+
+fi
+
+echo "$as_me:10526: checking return type of signal handlers" >&5
+echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6
+if test "${ac_cv_type_signal+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 10532 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <signal.h>
+#ifdef signal
+# undef signal
+#endif
+#ifdef __cplusplus
+extern "C" void (*signal (int, void (*)(int)))(int);
+#else
+void (*signal ()) ();
+#endif
+
+int
+main ()
+{
+int i;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:10554: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:10557: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:10560: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:10563: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_type_signal=void
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_type_signal=int
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:10573: result: $ac_cv_type_signal" >&5
+echo "${ECHO_T}$ac_cv_type_signal" >&6
+
+cat >>confdefs.h <<EOF
+#define RETSIGTYPE $ac_cv_type_signal
+EOF
+
+if test -z "$cf_user_CFLAGS" && test "$with_no_leaks" = no ; then
+	CFLAGS=`echo ${CFLAGS} | sed -e 's%-g %%' -e 's%-g$%%'`
+	CXXFLAGS=`echo ${CXXFLAGS} | sed -e 's%-g %%' -e 's%-g$%%'`
+fi
+
+if test "$cf_with_ada" != "no" ; then
+
+cf_ada_make=gnatmake
+# Extract the first word of "$cf_ada_make", so it can be a program name with args.
+set dummy $cf_ada_make; ac_word=$2
+echo "$as_me:10590: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_gnat_exists+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$gnat_exists"; then
+  ac_cv_prog_gnat_exists="$gnat_exists" # Let the user override the test.
+else
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_gnat_exists="yes"
+echo "$as_me:10605: found $ac_dir/$ac_word" >&5
+break
+done
+
+  test -z "$ac_cv_prog_gnat_exists" && ac_cv_prog_gnat_exists="no"
+fi
+fi
+gnat_exists=$ac_cv_prog_gnat_exists
+if test -n "$gnat_exists"; then
+  echo "$as_me:10614: result: $gnat_exists" >&5
+echo "${ECHO_T}$gnat_exists" >&6
+else
+  echo "$as_me:10617: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+if test "$ac_cv_prog_gnat_exists" = no; then
+   cf_ada_make=
+else
+
+echo "$as_me:10625: checking for gnat version" >&5
+echo $ECHO_N "checking for gnat version... $ECHO_C" >&6
+cf_gnat_version=`${cf_ada_make:-gnatmake} -v 2>&1 | \
+	grep '[0-9].[0-9][0-9]*' |\
+    sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
+echo "$as_me:10630: result: $cf_gnat_version" >&5
+echo "${ECHO_T}$cf_gnat_version" >&6
+
+case $cf_gnat_version in #(vi
+3.1[1-9]*|3.[2-9]*|[4-9].*) #(vi
+	cf_cv_prog_gnat_correct=yes
+	;;
+*)
+	{ echo "$as_me:10638: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&5
+echo "$as_me: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&2;}
+	cf_cv_prog_gnat_correct=no
+	;;
+esac
+
+echo "$as_me:10644: checking if GNAT supports generics" >&5
+echo $ECHO_N "checking if GNAT supports generics... $ECHO_C" >&6
+case $cf_gnat_version in #(vi
+3.[1-9]*|[4-9].*) #(vi
+	cf_gnat_generics=yes
+	;;
+*)
+	cf_gnat_generics=no
+	;;
+esac
+echo "$as_me:10654: result: $cf_gnat_generics" >&5
+echo "${ECHO_T}$cf_gnat_generics" >&6
+
+if test "$cf_gnat_generics" = yes
+then
+	cf_compile_generics=generics
+	cf_generic_objects="\${GENOBJS}"
+else
+	cf_compile_generics=
+	cf_generic_objects=
+fi
+
+echo "$as_me:10666: checking if GNAT supports project files" >&5
+echo $ECHO_N "checking if GNAT supports project files... $ECHO_C" >&6
+case $cf_gnat_version in #(vi
+3.[0-9]*) #(vi
+	cf_gnat_projects=no
+	;;
+*)
+	case $cf_cv_system_name in #(vi
+	cygwin*) #(vi
+		cf_gnat_projects=no
+		;;
+	*)
+		cf_gnat_projects=yes
+		;;
+	esac
+	;;
+esac
+echo "$as_me:10683: result: $cf_gnat_projects" >&5
+echo "${ECHO_T}$cf_gnat_projects" >&6
+
+if test "$cf_gnat_projects" = yes
+then
+	USE_OLD_MAKERULES="#"
+	USE_GNAT_PROJECTS=""
+else
+	USE_OLD_MAKERULES=""
+	USE_GNAT_PROJECTS="#"
+fi
+
+   # Extract the first word of "m4", so it can be a program name with args.
+set dummy m4; ac_word=$2
+echo "$as_me:10697: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_M4_exists+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$M4_exists"; then
+  ac_cv_prog_M4_exists="$M4_exists" # Let the user override the test.
+else
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_M4_exists="yes"
+echo "$as_me:10712: found $ac_dir/$ac_word" >&5
+break
+done
+
+  test -z "$ac_cv_prog_M4_exists" && ac_cv_prog_M4_exists="no"
+fi
+fi
+M4_exists=$ac_cv_prog_M4_exists
+if test -n "$M4_exists"; then
+  echo "$as_me:10721: result: $M4_exists" >&5
+echo "${ECHO_T}$M4_exists" >&6
+else
+  echo "$as_me:10724: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+   if test "$ac_cv_prog_M4_exists" = no; then
+      cf_cv_prog_gnat_correct=no
+      echo Ada95 binding required program m4 not found. Ada95 binding disabled.
+   fi
+   if test "$cf_cv_prog_gnat_correct" = yes; then
+      echo "$as_me:10733: checking if GNAT works" >&5
+echo $ECHO_N "checking if GNAT works... $ECHO_C" >&6
+
+rm -rf conftest*
+cat >>conftest.ads <<CF_EOF
+procedure conftest;
+CF_EOF
+cat >>conftest.adb <<CF_EOF
+with Text_IO;
+with GNAT.OS_Lib;
+procedure conftest is
+begin
+   Text_IO.Put ("Hello World");
+   Text_IO.New_Line;
+   GNAT.OS_Lib.OS_Exit (0);
+end conftest;
+CF_EOF
+if ( $cf_ada_make $ADAFLAGS conftest 1>&5 2>&1 ) ; then
+   if ( ./conftest 1>&5 2>&1 ) ; then
+      cf_cv_prog_gnat_correct=yes
+   else
+      cf_cv_prog_gnat_correct=no
+   fi
+else
+   cf_cv_prog_gnat_correct=no
+fi
+rm -rf conftest*
+
+      echo "$as_me:10761: result: $cf_cv_prog_gnat_correct" >&5
+echo "${ECHO_T}$cf_cv_prog_gnat_correct" >&6
+   fi
+fi
+
+	if test	"$cf_cv_prog_gnat_correct" = yes; then
+
+ 	ADAFLAGS="$ADAFLAGS -O3 -gnatpn"
+
+echo "$as_me:10770: checking if GNAT pragma Unreferenced works" >&5
+echo $ECHO_N "checking if GNAT pragma Unreferenced works... $ECHO_C" >&6
+if test "${cf_cv_pragma_unreferenced+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+rm -rf conftest*
+cat >>conftest.ads <<CF_EOF
+procedure conftest;
+CF_EOF
+cat >>conftest.adb <<CF_EOF
+with Text_IO;
+with GNAT.OS_Lib;
+procedure conftest is
+   test : Integer;
+   pragma Unreferenced (test);
+begin
+   test := 1;
+   Text_IO.Put ("Hello World");
+   Text_IO.New_Line;
+   GNAT.OS_Lib.OS_Exit (0);
+end conftest;
+CF_EOF
+if ( $cf_ada_make $ADAFLAGS conftest 1>&5 2>&1 ) ; then
+      cf_cv_pragma_unreferenced=yes
+else
+   cf_cv_pragma_unreferenced=no
+fi
+rm -rf conftest*
+
+fi
+echo "$as_me:10801: result: $cf_cv_pragma_unreferenced" >&5
+echo "${ECHO_T}$cf_cv_pragma_unreferenced" >&6
+
+# if the pragma is supported, use it (needed in the Trace code).
+if test $cf_cv_pragma_unreferenced = yes ; then
+	PRAGMA_UNREF=TRUE
+else
+	PRAGMA_UNREF=FALSE
+fi
+
+echo "$as_me:10811: checking for ada-compiler" >&5
+echo $ECHO_N "checking for ada-compiler... $ECHO_C" >&6
+
+# Check whether --with-ada-compiler or --without-ada-compiler was given.
+if test "${with_ada_compiler+set}" = set; then
+  withval="$with_ada_compiler"
+  cf_ada_compiler=$withval
+else
+  cf_ada_compiler=gnatmake
+fi;
+
+echo "$as_me:10822: result: $cf_ada_compiler" >&5
+echo "${ECHO_T}$cf_ada_compiler" >&6
+
+		cf_ada_package=terminal_interface
+
+echo "$as_me:10827: checking for ada-include" >&5
+echo $ECHO_N "checking for ada-include... $ECHO_C" >&6
+
+# Check whether --with-ada-include or --without-ada-include was given.
+if test "${with_ada_include+set}" = set; then
+  withval="$with_ada_include"
+
+else
+  withval="${ADA_INCLUDE:-$prefix/share/ada/adainclude}"
+fi; if test -n "$prefix/share/ada/adainclude" ; then
+
+if test "x$prefix" != xNONE; then
+  cf_path_syntax="$prefix"
+else
+  cf_path_syntax="$ac_default_prefix"
+fi
+
+case ".$withval" in #(vi
+.\$\(*\)*|.\'*\'*) #(vi
+  ;;
+..|./*|.\\*) #(vi
+  ;;
+.[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
+  ;;
+.\${*prefix}*) #(vi
+  eval withval="$withval"
+  case ".$withval" in #(vi
+  .NONE/*)
+    withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
+    ;;
+  esac
+  ;; #(vi
+.no|.NONE/*)
+  withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
+  ;;
+*)
+  { { echo "$as_me:10863: error: expected a pathname, not \"$withval\"" >&5
+echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
+   { (exit 1); exit 1; }; }
+  ;;
+esac
+
+fi
+ADA_INCLUDE="$withval"
+
+echo "$as_me:10872: result: $ADA_INCLUDE" >&5
+echo "${ECHO_T}$ADA_INCLUDE" >&6
+
+echo "$as_me:10875: checking for ada-objects" >&5
+echo $ECHO_N "checking for ada-objects... $ECHO_C" >&6
+
+# Check whether --with-ada-objects or --without-ada-objects was given.
+if test "${with_ada_objects+set}" = set; then
+  withval="$with_ada_objects"
+
+else
+  withval="${ADA_OBJECTS:-$prefix/lib/ada/adalib}"
+fi; if test -n "$prefix/lib/ada/adalib" ; then
+
+if test "x$prefix" != xNONE; then
+  cf_path_syntax="$prefix"
+else
+  cf_path_syntax="$ac_default_prefix"
+fi
+
+case ".$withval" in #(vi
+.\$\(*\)*|.\'*\'*) #(vi
+  ;;
+..|./*|.\\*) #(vi
+  ;;
+.[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
+  ;;
+.\${*prefix}*) #(vi
+  eval withval="$withval"
+  case ".$withval" in #(vi
+  .NONE/*)
+    withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
+    ;;
+  esac
+  ;; #(vi
+.no|.NONE/*)
+  withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
+  ;;
+*)
+  { { echo "$as_me:10911: error: expected a pathname, not \"$withval\"" >&5
+echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
+   { (exit 1); exit 1; }; }
+  ;;
+esac
+
+fi
+ADA_OBJECTS="$withval"
+
+echo "$as_me:10920: result: $ADA_OBJECTS" >&5
+echo "${ECHO_T}$ADA_OBJECTS" >&6
+
+echo "$as_me:10923: checking if an Ada95 shared-library should be built" >&5
+echo $ECHO_N "checking if an Ada95 shared-library should be built... $ECHO_C" >&6
+
+# Check whether --with-ada-sharedlib or --without-ada-sharedlib was given.
+if test "${with_ada_sharedlib+set}" = set; then
+  withval="$with_ada_sharedlib"
+  with_ada_sharedlib=$withval
+else
+  with_ada_sharedlib=no
+fi;
+echo "$as_me:10933: result: $with_ada_sharedlib" >&5
+echo "${ECHO_T}$with_ada_sharedlib" >&6
+
+ADA_SHAREDLIB='lib$(LIB_NAME).so.1'
+MAKE_ADA_SHAREDLIB="#"
+
+if test "x$with_ada_sharedlib" != xno
+then
+	MAKE_ADA_SHAREDLIB=
+	if test "x$with_ada_sharedlib" != xyes
+	then
+		ADA_SHAREDLIB="$with_ada_sharedlib"
+	fi
+fi
+
+	fi
+fi
+
+################################################################################
+
+# not needed
+TINFO_ARGS2=
+
+### Construct the list of include-directories to be generated
+
+CPPFLAGS="$CPPFLAGS -I. -I../include"
+if test "$srcdir" != "."; then
+	CPPFLAGS="$CPPFLAGS -I\${srcdir}/../include"
+fi
+if test "$GCC" != yes; then
+	CPPFLAGS="$CPPFLAGS -I\${includedir}"
+elif test "$includedir" != "/usr/include"; then
+	if test "$includedir" = '${prefix}/include' ; then
+		if test $prefix != /usr ; then
+			CPPFLAGS="$CPPFLAGS -I\${includedir}"
+		fi
+	else
+		CPPFLAGS="$CPPFLAGS -I\${includedir}"
+	fi
+fi
+
+ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS"
+if test "$srcdir" != "."; then
+	ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS"
+fi
+if test "$GCC" != yes; then
+	ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
+elif test "$includedir" != "/usr/include"; then
+	if test "$includedir" = '${prefix}/include' ; then
+		if test $prefix != /usr ; then
+			ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
+		fi
+	else
+		ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
+	fi
+fi
+
+### Build up pieces for makefile rules
+echo "$as_me:10991: checking default library suffix" >&5
+echo $ECHO_N "checking default library suffix... $ECHO_C" >&6
+
+	case $DFT_LWR_MODEL in
+	libtool) DFT_ARG_SUFFIX=''   ;;
+	normal)  DFT_ARG_SUFFIX=''   ;;
+	debug)   DFT_ARG_SUFFIX='_g' ;;
+	profile) DFT_ARG_SUFFIX='_p' ;;
+	shared)  DFT_ARG_SUFFIX=''   ;;
+	esac
+	test -n "$LIB_SUFFIX" && DFT_ARG_SUFFIX="${LIB_SUFFIX}${DFT_ARG_SUFFIX}"
+echo "$as_me:11002: result: $DFT_ARG_SUFFIX" >&5
+echo "${ECHO_T}$DFT_ARG_SUFFIX" >&6
+
+echo "$as_me:11005: checking default library-dependency suffix" >&5
+echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6
+
+	case $DFT_LWR_MODEL in #(vi
+	libtool) #(vi
+		DFT_LIB_SUFFIX='.la'
+		DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
+		;;
+	normal) #(vi
+		DFT_LIB_SUFFIX='.a'
+		DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
+		;;
+	debug) #(vi
+		DFT_LIB_SUFFIX='_g.a'
+		DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
+		;;
+	profile) #(vi
+		DFT_LIB_SUFFIX='_p.a'
+		DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
+		;;
+	shared) #(vi
+		case $cf_cv_system_name in
+		aix[56]*) #(vi
+			DFT_LIB_SUFFIX='.a'
+			DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
+			;;
+		cygwin*) #(vi
+			DFT_LIB_SUFFIX='.dll'
+			DFT_DEP_SUFFIX='.dll.a'
+			;;
+		darwin*) #(vi
+			DFT_LIB_SUFFIX='.dylib'
+			DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
+			;;
+		hpux*) #(vi
+			case $target in
+			ia64*) #(vi
+				DFT_LIB_SUFFIX='.so'
+				DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
+				;;
+			*) #(vi
+				DFT_LIB_SUFFIX='.sl'
+				DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
+				;;
+			esac
+			;;
+		*)	DFT_LIB_SUFFIX='.so'
+			DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
+			;;
+		esac
+	esac
+	test -n "$LIB_SUFFIX" && DFT_LIB_SUFFIX="${LIB_SUFFIX}${DFT_LIB_SUFFIX}"
+	test -n "$LIB_SUFFIX" && DFT_DEP_SUFFIX="${LIB_SUFFIX}${DFT_DEP_SUFFIX}"
+echo "$as_me:11058: result: $DFT_DEP_SUFFIX" >&5
+echo "${ECHO_T}$DFT_DEP_SUFFIX" >&6
+
+echo "$as_me:11061: checking default object directory" >&5
+echo $ECHO_N "checking default object directory... $ECHO_C" >&6
+
+	case $DFT_LWR_MODEL in
+	libtool) DFT_OBJ_SUBDIR='obj_lo'  ;;
+	normal)  DFT_OBJ_SUBDIR='objects' ;;
+	debug)   DFT_OBJ_SUBDIR='obj_g' ;;
+	profile) DFT_OBJ_SUBDIR='obj_p' ;;
+	shared)
+		case $cf_cv_system_name in #(vi
+		cygwin) #(vi
+			DFT_OBJ_SUBDIR='objects' ;;
+		*)
+			DFT_OBJ_SUBDIR='obj_s' ;;
+		esac
+	esac
+echo "$as_me:11077: result: $DFT_OBJ_SUBDIR" >&5
+echo "${ECHO_T}$DFT_OBJ_SUBDIR" >&6
+
+### Set up low-level terminfo dependencies for makefiles.
+
+if test "$DFT_LWR_MODEL" = shared ; then
+	case $cf_cv_system_name in #(vi
+	cygwin*)
+		# "lib" files have ".dll.a" suffix, "cyg" files have ".dll"
+		;;
+	esac
+fi
+
+### Construct the list of subdirectories for which we'll customize makefiles
+### with the appropriate compile-rules.
+
+SUB_MAKEFILES="gen/adacurses${DFT_ARG_SUFFIX}-config:gen/adacurses-config.in"
+
+cat >>confdefs.h <<EOF
+#define NCURSES_PATHSEP '$PATH_SEPARATOR'
+EOF
+
+### Now that we're done running tests, add the compiler-warnings, if any
+
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
+
+for cf_add_cflags in $EXTRA_CFLAGS
+do
+case $cf_fix_cppflags in
+no)
+	case $cf_add_cflags in #(vi
+	-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
+		case $cf_add_cflags in
+		-D*)
+			cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
+
+			test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+				&& test -z "${cf_tst_cflags}" \
+				&& cf_fix_cppflags=yes
+
+			if test $cf_fix_cppflags = yes ; then
+				cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+				continue
+			elif test "${cf_tst_cflags}" = "\"'" ; then
+				cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+				continue
+			fi
+			;;
+		esac
+		case "$CPPFLAGS" in
+		*$cf_add_cflags) #(vi
+			;;
+		*) #(vi
+			case $cf_add_cflags in #(vi
+			-D*)
+				cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
+
+CPPFLAGS=`echo "$CPPFLAGS" | \
+	sed	-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?[ 	]/ /g' \
+		-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?$//g'`
+
+				;;
+			esac
+			cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
+			;;
+		esac
+		;;
+	*)
+		cf_new_cflags="$cf_new_cflags $cf_add_cflags"
+		;;
+	esac
+	;;
+yes)
+	cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+	cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
+
+	test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+		&& test -z "${cf_tst_cflags}" \
+		&& cf_fix_cppflags=no
+	;;
+esac
+done
+
+if test -n "$cf_new_cflags" ; then
+
+	CFLAGS="$CFLAGS $cf_new_cflags"
+fi
+
+if test -n "$cf_new_cppflags" ; then
+
+	CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
+fi
+
+if test -n "$cf_new_extra_cppflags" ; then
+
+	EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+fi
+
+################################################################################
+
+if test x"$enable_pc_files" = xyes ; then \
+SUB_MAKEFILES="$SUB_MAKEFILES misc/gen-pkgconfig:misc/gen-pkgconfig.in"
+MAKE_PC_FILES=
+else
+MAKE_PC_FILES="#"
+fi
+
+################################################################################
+
+TEST_ARG2=
+
+TEST_LIBS2=
+
+NCURSES_SHLIB2="sh -c"
+
+ADA_SUBDIRS="include gen src"
+if test "x$cf_with_tests" != "xno" ; then
+	ADA_SUBDIRS="$ADA_SUBDIRS samples"
+fi
+for cf_dir in $ADA_SUBDIRS
+do
+	SUB_MAKEFILES="$SUB_MAKEFILES $cf_dir/Makefile"
+done
+
+NCURSES_TREE="#"
+
+EXTERNAL_TREE=
+
+ac_config_files="$ac_config_files $SUB_MAKEFILES Makefile"
+ac_config_commands="$ac_config_commands default"
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems.  If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overriden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+{
+  (set) 2>&1 |
+    case `(ac_space=' '; set | grep ac_space) 2>&1` in
+    *ac_space=\ *)
+      # `set' does not quote correctly, so add quotes (double-quote
+      # substitution turns \\\\ into \\, and sed turns \\ into \).
+      sed -n \
+        "s/'/'\\\\''/g;
+    	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+      ;;
+    *)
+      # `set' quotes correctly as required by POSIX, so do not add quotes.
+      sed -n \
+        "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+      ;;
+    esac;
+} |
+  sed '
+     t clear
+     : clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+     : end' >>confcache
+if cmp -s $cache_file confcache; then :; else
+  if test -w $cache_file; then
+    test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
+    cat confcache >$cache_file
+  else
+    echo "not updating unwritable cache $cache_file"
+  fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+  ac_vpsub='/^[ 	]*VPATH[ 	]*=/{
+s/:*\$(srcdir):*/:/;
+s/:*\${srcdir}:*/:/;
+s/:*@srcdir@:*/:/;
+s/^\([^=]*=[ 	]*\):*/\1/;
+s/:*$//;
+s/^[^=]*=[ 	]*$//;
+}'
+fi
+
+DEFS=-DHAVE_CONFIG_H
+
+: ${CONFIG_STATUS=./config.status}
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ echo "$as_me:11290: creating $CONFIG_STATUS" >&5
+echo "$as_me: creating $CONFIG_STATUS" >&6;}
+cat >$CONFIG_STATUS <<_ACEOF
+#! $SHELL
+# Generated automatically by configure.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+SHELL=\${CONFIG_SHELL-$SHELL}
+ac_cs_invocation="\$0 \$@"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+  set -o posix
+fi
+
+# Name of the executable.
+as_me=`echo "$0" |sed 's,.*[\\/],,'`
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+  # We could just check for DJGPP; but this test a) works b) is more generic
+  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+  if test -f conf$$.exe; then
+    # Don't use ln at all; we don't have any links
+    as_ln_s='cp -p'
+  else
+    as_ln_s='ln -s'
+  fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s=ln
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
+
+as_executable_p="test -f"
+
+# Support unset when possible.
+if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+# NLS nuisances.
+$as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
+$as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
+$as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
+$as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
+$as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
+$as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
+$as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
+$as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
+
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" 	$as_nl"
+
+# CDPATH.
+$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
+
+exec 6>&1
+
+_ACEOF
+
+# Files that config.status was made for.
+if test -n "$ac_config_files"; then
+  echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_headers"; then
+  echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_links"; then
+  echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_commands"; then
+  echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
+fi
+
+cat >>$CONFIG_STATUS <<\EOF
+
+ac_cs_usage="\
+\`$as_me' instantiates files from templates according to the
+current configuration.
+
+Usage: $0 [OPTIONS] [FILE]...
+
+  -h, --help       print this help, then exit
+  -V, --version    print version number, then exit
+  -d, --debug      don't remove temporary files
+      --recheck    update $as_me by reconfiguring in the same conditions
+  --file=FILE[:TEMPLATE]
+                   instantiate the configuration file FILE
+  --header=FILE[:TEMPLATE]
+                   instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Configuration commands:
+$config_commands
+
+Report bugs to <dickey@invisible-island.net>."
+EOF
+
+cat >>$CONFIG_STATUS <<EOF
+ac_cs_version="\\
+config.status
+configured by $0, generated by GNU Autoconf 2.52.20101001,
+  with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
+Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+srcdir=$srcdir
+INSTALL="$INSTALL"
+EOF
+
+cat >>$CONFIG_STATUS <<\EOF
+# If no file are specified by the user, then we need to provide default
+# value.  By we need to know if files were specified by the user.
+ac_need_defaults=:
+while test $# != 0
+do
+  case $1 in
+  --*=*)
+    ac_option=`expr "x$1" : 'x\([^=]*\)='`
+    ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
+    shift
+    set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
+    shift
+    ;;
+  -*);;
+  *) # This is not an option, so the user has probably given explicit
+     # arguments.
+     ac_need_defaults=false;;
+  esac
+
+  case $1 in
+  # Handling of the options.
+EOF
+cat >>$CONFIG_STATUS <<EOF
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
+    exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
+EOF
+cat >>$CONFIG_STATUS <<\EOF
+  --version | --vers* | -V )
+    echo "$ac_cs_version"; exit 0 ;;
+  --he | --h)
+    # Conflict between --help and --header
+    { { echo "$as_me:11466: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&2;}
+   { (exit 1); exit 1; }; };;
+  --help | --hel | -h )
+    echo "$ac_cs_usage"; exit 0 ;;
+  --debug | --d* | -d )
+    debug=: ;;
+  --file | --fil | --fi | --f )
+    shift
+    CONFIG_FILES="$CONFIG_FILES $1"
+    ac_need_defaults=false;;
+  --header | --heade | --head | --hea )
+    shift
+    CONFIG_HEADERS="$CONFIG_HEADERS $1"
+    ac_need_defaults=false;;
+
+  # This is an error.
+  -*) { { echo "$as_me:11485: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&2;}
+   { (exit 1); exit 1; }; } ;;
+
+  *) ac_config_targets="$ac_config_targets $1" ;;
+
+  esac
+  shift
+done
+
+exec 5>>config.log
+cat >&5 << _ACEOF
+
+## ----------------------- ##
+## Running config.status.  ##
+## ----------------------- ##
+
+This file was extended by $as_me 2.52.20101001, executed with
+  CONFIG_FILES    = $CONFIG_FILES
+  CONFIG_HEADERS  = $CONFIG_HEADERS
+  CONFIG_LINKS    = $CONFIG_LINKS
+  CONFIG_COMMANDS = $CONFIG_COMMANDS
+  > $ac_cs_invocation
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+
+_ACEOF
+EOF
+
+cat >>$CONFIG_STATUS <<EOF
+#
+# INIT-COMMANDS section.
+#
+
+### Special initialization commands, used to pass information from the
+### configuration-run into config.status
+
+AWK="$AWK"
+DFT_ARG_SUFFIX="$DFT_ARG_SUFFIX"
+DFT_LWR_MODEL="$DFT_LWR_MODEL"
+ECHO_LINK="$ECHO_LINK"
+LIB_NAME="$LIB_NAME"
+LIB_SUFFIX="$LIB_SUFFIX"
+LN_S="$LN_S"
+NCURSES_MAJOR="$NCURSES_MAJOR"
+NCURSES_MINOR="$NCURSES_MINOR"
+NCURSES_PATCH="$NCURSES_PATCH"
+USE_OLD_MAKERULES="$USE_OLD_MAKERULES"
+cf_cv_abi_version="$cf_cv_abi_version"
+cf_cv_rel_version="$cf_cv_rel_version"
+cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
+cf_cv_shared_soname='$cf_cv_shared_soname'
+cf_cv_shlib_version="$cf_cv_shlib_version"
+cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix"
+cf_cv_system_name="$cf_cv_system_name"
+host="$host"
+target="$target"
+
+EOF
+
+cat >>$CONFIG_STATUS <<\EOF
+for ac_config_target in $ac_config_targets
+do
+  case "$ac_config_target" in
+  # Handling of arguments.
+  "$SUB_MAKEFILES" ) CONFIG_FILES="$CONFIG_FILES $SUB_MAKEFILES" ;;
+  "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+  "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
+  "include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;;
+  *) { { echo "$as_me:11555: error: invalid argument: $ac_config_target" >&5
+echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
+   { (exit 1); exit 1; }; };;
+  esac
+done
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used.  Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+  test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+  test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Create a temporary directory, and hook for its removal unless debugging.
+$debug ||
+{
+  trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
+  trap '{ (exit 1); exit 1; }' 1 2 13 15
+}
+
+# Create a (secure) tmp directory for tmp files.
+: ${TMPDIR=/tmp}
+{
+  tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
+  test -n "$tmp" && test -d "$tmp"
+}  ||
+{
+  tmp=$TMPDIR/cs$$-$RANDOM
+  (umask 077 && mkdir $tmp)
+} ||
+{
+   echo "$me: cannot create a temporary directory in $TMPDIR" >&2
+   { (exit 1); exit 1; }
+}
+
+EOF
+
+cat >>$CONFIG_STATUS <<EOF
+
+#
+# CONFIG_FILES section.
+#
+
+# No need to generate the scripts if there are no CONFIG_FILES.
+# This happens for instance when ./config.status config.h
+if test -n "\$CONFIG_FILES"; then
+  # Protect against being on the right side of a sed subst in config.status.
+  sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
+   s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
+s,@SHELL@,$SHELL,;t t
+s,@exec_prefix@,$exec_prefix,;t t
+s,@prefix@,$prefix,;t t
+s,@program_transform_name@,$program_transform_name,;t t
+s,@bindir@,$bindir,;t t
+s,@sbindir@,$sbindir,;t t
+s,@libexecdir@,$libexecdir,;t t
+s,@datadir@,$datadir,;t t
+s,@sysconfdir@,$sysconfdir,;t t
+s,@sharedstatedir@,$sharedstatedir,;t t
+s,@localstatedir@,$localstatedir,;t t
+s,@libdir@,$libdir,;t t
+s,@includedir@,$includedir,;t t
+s,@oldincludedir@,$oldincludedir,;t t
+s,@infodir@,$infodir,;t t
+s,@mandir@,$mandir,;t t
+s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
+s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
+s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
+s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
+s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
+s,@build_alias@,$build_alias,;t t
+s,@host_alias@,$host_alias,;t t
+s,@target_alias@,$target_alias,;t t
+s,@ECHO_C@,$ECHO_C,;t t
+s,@ECHO_N@,$ECHO_N,;t t
+s,@ECHO_T@,$ECHO_T,;t t
+s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
+s,@DEFS@,$DEFS,;t t
+s,@LIBS@,$LIBS,;t t
+s,@top_builddir@,$top_builddir,;t t
+s,@build@,$build,;t t
+s,@build_cpu@,$build_cpu,;t t
+s,@build_vendor@,$build_vendor,;t t
+s,@build_os@,$build_os,;t t
+s,@host@,$host,;t t
+s,@host_cpu@,$host_cpu,;t t
+s,@host_vendor@,$host_vendor,;t t
+s,@host_os@,$host_os,;t t
+s,@target@,$target,;t t
+s,@target_cpu@,$target_cpu,;t t
+s,@target_vendor@,$target_vendor,;t t
+s,@target_os@,$target_os,;t t
+s,@CC@,$CC,;t t
+s,@CFLAGS@,$CFLAGS,;t t
+s,@LDFLAGS@,$LDFLAGS,;t t
+s,@CPPFLAGS@,$CPPFLAGS,;t t
+s,@ac_ct_CC@,$ac_ct_CC,;t t
+s,@EXEEXT@,$EXEEXT,;t t
+s,@OBJEXT@,$OBJEXT,;t t
+s,@CPP@,$CPP,;t t
+s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
+s,@PROG_EXT@,$PROG_EXT,;t t
+s,@AWK@,$AWK,;t t
+s,@EGREP@,$EGREP,;t t
+s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
+s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
+s,@INSTALL_DATA@,$INSTALL_DATA,;t t
+s,@LN_S@,$LN_S,;t t
+s,@PKG_CONFIG@,$PKG_CONFIG,;t t
+s,@PKG_CONFIG_LIBDIR@,$PKG_CONFIG_LIBDIR,;t t
+s,@SET_MAKE@,$SET_MAKE,;t t
+s,@CTAGS@,$CTAGS,;t t
+s,@ETAGS@,$ETAGS,;t t
+s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
+s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
+s,@cf_cv_makeflags@,$cf_cv_makeflags,;t t
+s,@RANLIB@,$RANLIB,;t t
+s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
+s,@LD@,$LD,;t t
+s,@ac_ct_LD@,$ac_ct_LD,;t t
+s,@AR@,$AR,;t t
+s,@ac_ct_AR@,$ac_ct_AR,;t t
+s,@ARFLAGS@,$ARFLAGS,;t t
+s,@DESTDIR@,$DESTDIR,;t t
+s,@BUILD_CC@,$BUILD_CC,;t t
+s,@BUILD_CPP@,$BUILD_CPP,;t t
+s,@BUILD_CFLAGS@,$BUILD_CFLAGS,;t t
+s,@BUILD_CPPFLAGS@,$BUILD_CPPFLAGS,;t t
+s,@BUILD_LDFLAGS@,$BUILD_LDFLAGS,;t t
+s,@BUILD_LIBS@,$BUILD_LIBS,;t t
+s,@BUILD_EXEEXT@,$BUILD_EXEEXT,;t t
+s,@BUILD_OBJEXT@,$BUILD_OBJEXT,;t t
+s,@DFT_LWR_MODEL@,$DFT_LWR_MODEL,;t t
+s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
+s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
+s,@NCURSES_MAJOR@,$NCURSES_MAJOR,;t t
+s,@NCURSES_MINOR@,$NCURSES_MINOR,;t t
+s,@NCURSES_PATCH@,$NCURSES_PATCH,;t t
+s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
+s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
+s,@cf_cv_builtin_bool@,$cf_cv_builtin_bool,;t t
+s,@cf_cv_header_stdbool_h@,$cf_cv_header_stdbool_h,;t t
+s,@cf_cv_type_of_bool@,$cf_cv_type_of_bool,;t t
+s,@LIB_PREFIX@,$LIB_PREFIX,;t t
+s,@LIB_SUFFIX@,$LIB_SUFFIX,;t t
+s,@CC_G_OPT@,$CC_G_OPT,;t t
+s,@LD_MODEL@,$LD_MODEL,;t t
+s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
+s,@LD_RPATH_OPT@,$LD_RPATH_OPT,;t t
+s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
+s,@MK_SHARED_LIB@,$MK_SHARED_LIB,;t t
+s,@LINK_PROGS@,$LINK_PROGS,;t t
+s,@LINK_TESTS@,$LINK_TESTS,;t t
+s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
+s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
+s,@LOCAL_LDFLAGS2@,$LOCAL_LDFLAGS2,;t t
+s,@INSTALL_LIB@,$INSTALL_LIB,;t t
+s,@BROKEN_LINKER@,$BROKEN_LINKER,;t t
+s,@NCURSES_EXT_FUNCS@,$NCURSES_EXT_FUNCS,;t t
+s,@NCURSES_CONST@,$NCURSES_CONST,;t t
+s,@PTHREAD@,$PTHREAD,;t t
+s,@cf_cv_enable_reentrant@,$cf_cv_enable_reentrant,;t t
+s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
+s,@ECHO_LINK@,$ECHO_LINK,;t t
+s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
+s,@ADA_TRACE@,$ADA_TRACE,;t t
+s,@gnat_exists@,$gnat_exists,;t t
+s,@cf_compile_generics@,$cf_compile_generics,;t t
+s,@cf_generic_objects@,$cf_generic_objects,;t t
+s,@USE_OLD_MAKERULES@,$USE_OLD_MAKERULES,;t t
+s,@USE_GNAT_PROJECTS@,$USE_GNAT_PROJECTS,;t t
+s,@M4_exists@,$M4_exists,;t t
+s,@cf_ada_make@,$cf_ada_make,;t t
+s,@ADAFLAGS@,$ADAFLAGS,;t t
+s,@PRAGMA_UNREF@,$PRAGMA_UNREF,;t t
+s,@cf_ada_compiler@,$cf_ada_compiler,;t t
+s,@cf_ada_package@,$cf_ada_package,;t t
+s,@ADA_INCLUDE@,$ADA_INCLUDE,;t t
+s,@ADA_OBJECTS@,$ADA_OBJECTS,;t t
+s,@ADA_SHAREDLIB@,$ADA_SHAREDLIB,;t t
+s,@MAKE_ADA_SHAREDLIB@,$MAKE_ADA_SHAREDLIB,;t t
+s,@TINFO_ARGS2@,$TINFO_ARGS2,;t t
+s,@ACPPFLAGS@,$ACPPFLAGS,;t t
+s,@DFT_ARG_SUFFIX@,$DFT_ARG_SUFFIX,;t t
+s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
+s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
+s,@MAKE_PC_FILES@,$MAKE_PC_FILES,;t t
+s,@cross_compiling@,$cross_compiling,;t t
+s,@TEST_ARG2@,$TEST_ARG2,;t t
+s,@TEST_LIBS2@,$TEST_LIBS2,;t t
+s,@NCURSES_SHLIB2@,$NCURSES_SHLIB2,;t t
+s,@ADA_SUBDIRS@,$ADA_SUBDIRS,;t t
+s,@NCURSES_TREE@,$NCURSES_TREE,;t t
+s,@EXTERNAL_TREE@,$EXTERNAL_TREE,;t t
+CEOF
+
+EOF
+
+  cat >>$CONFIG_STATUS <<\EOF
+  # Split the substitutions into bite-sized pieces for seds with
+  # small command number limits, like on Digital OSF/1 and HP-UX.
+  ac_max_sed_lines=48
+  ac_sed_frag=1 # Number of current file.
+  ac_beg=1 # First line for current file.
+  ac_end=$ac_max_sed_lines # Line after last line for current file.
+  ac_more_lines=:
+  ac_sed_cmds=
+  while $ac_more_lines; do
+    if test $ac_beg -gt 1; then
+      sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
+    else
+      sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
+    fi
+    if test ! -s $tmp/subs.frag; then
+      ac_more_lines=false
+    else
+      # The purpose of the label and of the branching condition is to
+      # speed up the sed processing (if there are no `@' at all, there
+      # is no need to browse any of the substitutions).
+      # These are the two extra sed commands mentioned above.
+      (echo ':t
+  /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
+      if test -z "$ac_sed_cmds"; then
+  	ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
+      else
+  	ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
+      fi
+      ac_sed_frag=`expr $ac_sed_frag + 1`
+      ac_beg=$ac_end
+      ac_end=`expr $ac_end + $ac_max_sed_lines`
+    fi
+  done
+  if test -z "$ac_sed_cmds"; then
+    ac_sed_cmds=cat
+  fi
+fi # test -n "$CONFIG_FILES"
+
+EOF
+cat >>$CONFIG_STATUS <<\EOF
+for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
+  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+  case $ac_file in
+  - | *:- | *:-:* ) # input from stdin
+        cat >$tmp/stdin
+        ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+        ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+  *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+        ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+  * )   ac_file_in=$ac_file.in ;;
+  esac
+
+  # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
+  ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+         X"$ac_file" : 'X\(//\)[^/]' \| \
+         X"$ac_file" : 'X\(//\)$' \| \
+         X"$ac_file" : 'X\(/\)' \| \
+         .     : '\(.\)' 2>/dev/null ||
+echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+  if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+    { case "$ac_dir" in
+  [\\/]* | ?:[\\/]* ) as_incr_dir=;;
+  *)                      as_incr_dir=.;;
+esac
+as_dummy="$ac_dir"
+for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
+  case $as_mkdir_dir in
+    # Skip DOS drivespec
+    ?:) as_incr_dir=$as_mkdir_dir ;;
+    *)
+      as_incr_dir=$as_incr_dir/$as_mkdir_dir
+      test -d "$as_incr_dir" || mkdir "$as_incr_dir"
+    ;;
+  esac
+done; }
+
+    ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
+    # A "../" for each directory in $ac_dir_suffix.
+    ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
+  else
+    ac_dir_suffix= ac_dots=
+  fi
+
+  case $srcdir in
+  .)  ac_srcdir=.
+      if test -z "$ac_dots"; then
+         ac_top_srcdir=.
+      else
+         ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
+      fi ;;
+  [\\/]* | ?:[\\/]* )
+      ac_srcdir=$srcdir$ac_dir_suffix;
+      ac_top_srcdir=$srcdir ;;
+  *) # Relative path.
+    ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_dots$srcdir ;;
+  esac
+
+  case $INSTALL in
+  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+  *) ac_INSTALL=$ac_dots$INSTALL ;;
+  esac
+
+  if test x"$ac_file" != x-; then
+    { echo "$as_me:11866: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+    rm -f "$ac_file"
+  fi
+  # Let's still pretend it is `configure' which instantiates (i.e., don't
+  # use $as_me), people would be surprised to read:
+  #    /* config.h.  Generated automatically by config.status.  */
+  configure_input="Generated automatically from `echo $ac_file_in |
+                                                 sed 's,.*/,,'` by configure."
+
+  # First look for the input files in the build tree, otherwise in the
+  # src tree.
+  ac_file_inputs=`IFS=:
+    for f in $ac_file_in; do
+      case $f in
+      -) echo $tmp/stdin ;;
+      [\\/$]*)
+         # Absolute (can't be DOS-style, as IFS=:)
+         test -f "$f" || { { echo "$as_me:11884: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+   { (exit 1); exit 1; }; }
+         echo $f;;
+      *) # Relative
+         if test -f "$f"; then
+           # Build tree
+           echo $f
+         elif test -f "$srcdir/$f"; then
+           # Source tree
+           echo $srcdir/$f
+         else
+           # /dev/null tree
+           { { echo "$as_me:11897: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+   { (exit 1); exit 1; }; }
+         fi;;
+      esac
+    done` || { (exit 1); exit 1; }
+EOF
+cat >>$CONFIG_STATUS <<EOF
+  sed "$ac_vpsub
+$extrasub
+EOF
+cat >>$CONFIG_STATUS <<\EOF
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s,@configure_input@,$configure_input,;t t
+s,@srcdir@,$ac_srcdir,;t t
+s,@top_srcdir@,$ac_top_srcdir,;t t
+s,@INSTALL@,$ac_INSTALL,;t t
+" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
+  rm -f $tmp/stdin
+  if test x"$ac_file" != x-; then
+    mv $tmp/out $ac_file
+  else
+    cat $tmp/out
+    rm -f $tmp/out
+  fi
+
+done
+EOF
+cat >>$CONFIG_STATUS <<\EOF
+
+#
+# CONFIG_HEADER section.
+#
+
+# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
+# NAME is the cpp macro being defined and VALUE is the value it is being given.
+#
+# ac_d sets the value in "#define NAME VALUE" lines.
+ac_dA='s,^\([ 	]*\)#\([ 	]*define[ 	][ 	]*\)'
+ac_dB='[ 	].*$,\1#\2'
+ac_dC=' '
+ac_dD=',;t'
+# ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
+ac_iA='s,^\([ 	]*\)#\([ 	]*\)undef\([ 	][ 	]*\)'
+ac_iB='\([ 	]\),\1#\2define\3'
+ac_iC=' '
+ac_iD='\4,;t'
+# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
+ac_uA='s,^\([ 	]*\)#\([ 	]*\)undef\([ 	][ 	]*\)'
+ac_uB='$,\1#\2define\3'
+ac_uC=' '
+ac_uD=',;t'
+
+for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
+  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+  case $ac_file in
+  - | *:- | *:-:* ) # input from stdin
+        cat >$tmp/stdin
+        ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+        ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+  *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+        ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+  * )   ac_file_in=$ac_file.in ;;
+  esac
+
+  test x"$ac_file" != x- && { echo "$as_me:11963: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+
+  # First look for the input files in the build tree, otherwise in the
+  # src tree.
+  ac_file_inputs=`IFS=:
+    for f in $ac_file_in; do
+      case $f in
+      -) echo $tmp/stdin ;;
+      [\\/$]*)
+         # Absolute (can't be DOS-style, as IFS=:)
+         test -f "$f" || { { echo "$as_me:11974: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+   { (exit 1); exit 1; }; }
+         echo $f;;
+      *) # Relative
+         if test -f "$f"; then
+           # Build tree
+           echo $f
+         elif test -f "$srcdir/$f"; then
+           # Source tree
+           echo $srcdir/$f
+         else
+           # /dev/null tree
+           { { echo "$as_me:11987: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+   { (exit 1); exit 1; }; }
+         fi;;
+      esac
+    done` || { (exit 1); exit 1; }
+  # Remove the trailing spaces.
+  sed 's/[ 	]*$//' $ac_file_inputs >$tmp/in
+
+EOF
+
+# Transform confdefs.h into a list of #define's.  We won't use it as a sed
+# script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
+# be either 'cat' or 'sort'.
+cat confdefs.h | uniq >conftest.vals
+
+# Break up conftest.vals because some shells have a limit on
+# the size of here documents, and old seds have small limits too.
+
+rm -f conftest.tail
+echo '  rm -f conftest.frag' >> $CONFIG_STATUS
+while grep . conftest.vals >/dev/null
+do
+  # Write chunks of a limited-size here document to conftest.frag.
+  echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
+  sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
+  echo 'CEOF' >> $CONFIG_STATUS
+  sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
+  rm -f conftest.vals
+  mv conftest.tail conftest.vals
+done
+rm -f conftest.vals
+
+# Run sed to substitute the contents of conftest.frag into $tmp/in at the
+# marker @DEFS@.
+echo '  cat >> conftest.edit <<CEOF
+/@DEFS@/r conftest.frag
+/@DEFS@/d
+CEOF
+sed -f conftest.edit $tmp/in > $tmp/out
+rm -f $tmp/in
+mv $tmp/out $tmp/in
+rm -f conftest.edit conftest.frag
+' >> $CONFIG_STATUS
+
+cat >>$CONFIG_STATUS <<\EOF
+  # Let's still pretend it is `configure' which instantiates (i.e., don't
+  # use $as_me), people would be surprised to read:
+  #    /* config.h.  Generated automatically by config.status.  */
+  if test x"$ac_file" = x-; then
+    echo "/* Generated automatically by configure.  */" >$tmp/config.h
+  else
+    echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
+  fi
+  cat $tmp/in >>$tmp/config.h
+  rm -f $tmp/in
+  if test x"$ac_file" != x-; then
+    if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
+      { echo "$as_me:12045: $ac_file is unchanged" >&5
+echo "$as_me: $ac_file is unchanged" >&6;}
+    else
+      ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+         X"$ac_file" : 'X\(//\)[^/]' \| \
+         X"$ac_file" : 'X\(//\)$' \| \
+         X"$ac_file" : 'X\(/\)' \| \
+         .     : '\(.\)' 2>/dev/null ||
+echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+      if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+        { case "$ac_dir" in
+  [\\/]* | ?:[\\/]* ) as_incr_dir=;;
+  *)                      as_incr_dir=.;;
+esac
+as_dummy="$ac_dir"
+for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
+  case $as_mkdir_dir in
+    # Skip DOS drivespec
+    ?:) as_incr_dir=$as_mkdir_dir ;;
+    *)
+      as_incr_dir=$as_incr_dir/$as_mkdir_dir
+      test -d "$as_incr_dir" || mkdir "$as_incr_dir"
+    ;;
+  esac
+done; }
+
+      fi
+      rm -f $ac_file
+      mv $tmp/config.h $ac_file
+    fi
+  else
+    cat $tmp/config.h
+    rm -f $tmp/config.h
+  fi
+done
+EOF
+cat >>$CONFIG_STATUS <<\EOF
+#
+# CONFIG_COMMANDS section.
+#
+for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
+  ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
+  ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
+
+  case $ac_dest in
+    default )
+if test -z "$USE_OLD_MAKERULES" ; then
+	$AWK -f $srcdir/mk-1st.awk <$srcdir/src/modules >>src/Makefile
+fi
+ ;;
+  esac
+done
+EOF
+
+cat >>$CONFIG_STATUS <<\EOF
+
+{ (exit 0); exit 0; }
+EOF
+chmod +x $CONFIG_STATUS
+ac_clean_files=$ac_clean_files_save
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded.  So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status.  When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+  ac_cs_success=:
+  exec 5>/dev/null
+  $SHELL $CONFIG_STATUS || ac_cs_success=false
+  exec 5>>config.log
+  # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+  # would make configure fail if this is the last instruction.
+  $ac_cs_success || { (exit 1); exit 1; }
+fi
+${MAKE:-make} preinstall
diff -Naur ncurses-5.7.orig/Ada95/configure.in ncurses-5.7/Ada95/configure.in
--- ncurses-5.7.orig/Ada95/configure.in	1969-12-31 19:00:00.000000000 -0500
+++ ncurses-5.7/Ada95/configure.in	2011-01-08 18:18:29.450655703 -0500
@@ -0,0 +1,626 @@
+dnl***************************************************************************
+dnl Copyright (c) 2010 Free Software Foundation, Inc.                        *
+dnl                                                                          *
+dnl Permission is hereby granted, free of charge, to any person obtaining a  *
+dnl copy of this software and associated documentation files (the            *
+dnl "Software"), to deal in the Software without restriction, including      *
+dnl without limitation the rights to use, copy, modify, merge, publish,      *
+dnl distribute, distribute with modifications, sublicense, and/or sell       *
+dnl copies of the Software, and to permit persons to whom the Software is    *
+dnl furnished to do so, subject to the following conditions:                 *
+dnl                                                                          *
+dnl The above copyright notice and this permission notice shall be included  *
+dnl in all copies or substantial portions of the Software.                   *
+dnl                                                                          *
+dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
+dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
+dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
+dnl IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
+dnl DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
+dnl OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
+dnl THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
+dnl                                                                          *
+dnl Except as contained in this notice, the name(s) of the above copyright   *
+dnl holders shall not be used in advertising or otherwise to promote the     *
+dnl sale, use or other dealings in this Software without prior written       *
+dnl authorization.                                                           *
+dnl***************************************************************************
+dnl
+dnl Author: Thomas E. Dickey
+dnl
+dnl $Id: configure.in,v 1.21 2010/11/06 22:11:21 tom Exp $
+dnl Process this file with autoconf to produce a configure script.
+dnl
+dnl See http://invisible-island.net/autoconf/ for additional information.
+dnl
+dnl ---------------------------------------------------------------------------
+AC_PREREQ(2.13.20020210)
+AC_REVISION($Revision: 1.21 $)
+AC_INIT(gen/gen.c)
+AC_CONFIG_HEADER(include/ncurses_cfg.h:include/ncurses_cfg.hin)
+
+CF_TOP_BUILDDIR
+
+CF_CHECK_CACHE([AC_CANONICAL_SYSTEM])
+AC_ARG_WITH(system-type,
+[  --with-system-type=XXX  test: override derived host system-type],
+[AC_MSG_WARN(overriding system type to $withval)
+ cf_cv_system_name=$withval])
+
+###	Save the given $CFLAGS to allow user-override.
+cf_user_CFLAGS="$CFLAGS"
+
+###	Default install-location
+CF_CFG_DEFAULTS
+
+###	Checks for programs.
+AC_PROG_CC
+CF_GCC_VERSION
+
+AC_PROG_CPP
+AC_PROG_GCC_TRADITIONAL
+CF_PROG_CC_C_O(CC)
+AC_ISC_POSIX
+CF_ANSI_CC_REQD
+CF_PROG_EXT
+
+AC_ARG_PROGRAM
+
+CF_PROG_AWK
+CF_PROG_EGREP
+AC_PROG_INSTALL
+CF_PROG_LN_S
+
+AC_SYS_LONG_FILE_NAMES
+
+# if we find pkg-config, check if we should install the ".pc" files.
+CF_PKG_CONFIG
+
+if test "$PKG_CONFIG" != no ; then
+	AC_MSG_CHECKING(if we should install .pc files for $PKG_CONFIG)
+
+	# Leave this as something that can be overridden in the environment.
+	if test -z "$PKG_CONFIG_LIBDIR" ; then
+		PKG_CONFIG_LIBDIR=`echo "$PKG_CONFIG" | sed -e 's,/[[^/]]*/[[^/]]*$,,'`/lib/pkgconfig
+	fi
+	PKG_CONFIG_LIBDIR=`echo "$PKG_CONFIG_LIBDIR" | sed -e 's/^://' -e 's/:.*//'`
+	if test -n "$PKG_CONFIG_LIBDIR" && test -d "$PKG_CONFIG_LIBDIR" ; then
+		AC_ARG_ENABLE(pc-files,
+			[  --enable-pc-files       generate and install .pc files for pkg-config],
+			[enable_pc_files=$enableval],
+			[enable_pc_files=no])
+		AC_MSG_RESULT($enable_pc_files)
+	else
+		AC_MSG_RESULT(no)
+		AC_MSG_WARN(did not find library $PKG_CONFIG_LIBDIR)
+		enable_pc_files=no
+	fi
+fi
+AC_SUBST(PKG_CONFIG_LIBDIR)
+
+AC_MSG_CHECKING(if you want to build test-programs)
+AC_ARG_WITH(tests,
+	[  --without-tests         suppress build with test-programs],
+	[cf_with_tests=$withval],
+	[cf_with_tests=yes])
+AC_MSG_RESULT($cf_with_tests)
+
+AC_MSG_CHECKING(if we should assume mixed-case filenames)
+AC_ARG_ENABLE(mixed-case,
+	[  --enable-mixed-case     tic should assume mixed-case filenames],
+	[enable_mixedcase=$enableval],
+	[enable_mixedcase=auto])
+AC_MSG_RESULT($enable_mixedcase)
+if test "$enable_mixedcase" = "auto" ; then
+    CF_MIXEDCASE_FILENAMES
+else
+    cf_cv_mixedcase=$enable_mixedcase
+    if test "$enable_mixedcase" = "yes" ; then
+        AC_DEFINE(MIXEDCASE_FILENAMES)
+    fi
+fi
+
+# do this after mixed-case option (tags/TAGS is not as important as tic).
+AC_PROG_MAKE_SET
+CF_MAKE_TAGS
+CF_MAKEFLAGS
+
+dnl These are standard among *NIX systems, but not when cross-compiling
+AC_CHECK_TOOL(RANLIB, ranlib, ':')
+AC_CHECK_TOOL(LD, ld, ld)
+AC_CHECK_TOOL(AR, ar, ar)
+CF_AR_FLAGS
+
+dnl Special option for use by system-builders: the install-prefix is used to
+dnl adjust the location into which the actual install is done, so that an
+dnl archive can be built without modifying the host system's configuration.
+AC_MSG_CHECKING(if you have specified an install-prefix)
+AC_ARG_WITH(install-prefix,
+	[  --with-install-prefix   prefixes actual install-location ($DESTDIR)],
+	[case "$withval" in #(vi
+	yes|no) #(vi
+		;;
+	*)	DESTDIR="$withval"
+		;;
+	esac])
+AC_MSG_RESULT($DESTDIR)
+AC_SUBST(DESTDIR)
+
+###############################################################################
+CF_HELP_MESSAGE(Build-Tools Needed to Compile Temporary Applications for Cross-compiling:)
+# If we're cross-compiling, allow the user to override the tools and their
+# options.  The configure script is oriented toward identifying the host
+# compiler, etc., but we need a build compiler to generate parts of the source.
+CF_BUILD_CC
+
+###############################################################################
+CF_HELP_MESSAGE(Options to Specify the Libraries Built/Used:)
+
+### Options to allow the user to specify the set of libraries which are used.
+### Use "--without-normal --with-shared" to allow the default model to be
+### shared, for example.
+cf_list_models=""
+AC_MSG_CHECKING(for specified models)
+test -z "$cf_list_models" && cf_list_models=normal
+AC_MSG_RESULT($cf_list_models)
+
+### Use the first model as the default, and save its suffix for use in building
+### up test-applications.
+AC_MSG_CHECKING(for default model)
+DFT_LWR_MODEL=`echo "$cf_list_models" | $AWK '{print $1}'`
+AC_MSG_RESULT($DFT_LWR_MODEL)
+
+CF_UPPER(DFT_UPR_MODEL,$DFT_LWR_MODEL)dnl
+
+AC_SUBST(DFT_LWR_MODEL)dnl	the default model ("normal")
+AC_SUBST(DFT_UPR_MODEL)dnl	the default model ("NORMAL")
+
+CF_NCURSES_ADDON
+
+CF_LIB_PREFIX(cf_prefix)
+LIB_PREFIX=$cf_prefix
+AC_SUBST(LIB_PREFIX)
+
+LIB_SUFFIX=
+AC_SUBST(LIB_SUFFIX)
+
+###############################################################################
+
+dnl Not all ports of gcc support the -g option
+
+if test X"$CC_G_OPT" = X"" ; then
+	CC_G_OPT='-g'
+	test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT=''
+fi
+AC_SUBST(CC_G_OPT)
+
+AC_MSG_CHECKING(for default loader flags)
+case $DFT_LWR_MODEL in
+normal)  LD_MODEL=''   ;;
+debug)   LD_MODEL=$CC_G_OPT ;;
+profile) LD_MODEL='-pg';;
+shared)  LD_MODEL=''   ;;
+esac
+AC_SUBST(LD_MODEL)dnl		the type of link (e.g., -g or -pg)
+AC_MSG_RESULT($LD_MODEL)
+
+CF_SHARED_OPTS
+
+###############################################################################
+CF_HELP_MESSAGE(Fine-Tuning Your Configuration:)
+
+CF_PATHSEP
+
+###   use option --enable-broken-linker to force on use of broken-linker support
+AC_MSG_CHECKING(if you want broken-linker support code)
+AC_ARG_ENABLE(broken_linker,
+	[  --enable-broken_linker  compile with broken-linker support code],
+	[with_broken_linker=$enableval],
+	[with_broken_linker=${BROKEN_LINKER:-no}])
+AC_MSG_RESULT($with_broken_linker)
+
+BROKEN_LINKER=0
+if test "$with_broken_linker" = yes ; then
+	AC_DEFINE(BROKEN_LINKER)
+	BROKEN_LINKER=1
+elif test "$DFT_LWR_MODEL" = shared ; then
+	case $cf_cv_system_name in #(vi
+	cygwin*)
+		AC_DEFINE(BROKEN_LINKER)
+		BROKEN_LINKER=1
+		CF_VERBOSE(cygwin linker is broken anyway)
+		;;
+	esac
+fi
+AC_SUBST(BROKEN_LINKER)
+
+# Check to define _XOPEN_SOURCE "automatically"
+CF_XOPEN_SOURCE
+
+CF_LARGEFILE
+
+### Enable compiling-in rcs id's
+AC_MSG_CHECKING(if RCS identifiers should be compiled-in)
+AC_ARG_WITH(rcs-ids,
+	[  --with-rcs-ids          compile-in RCS identifiers],
+	[with_rcs_ids=$withval],
+	[with_rcs_ids=no])
+AC_MSG_RESULT($with_rcs_ids)
+test "$with_rcs_ids" = yes && AC_DEFINE(USE_RCS_IDS)
+
+###############################################################################
+CF_HELP_MESSAGE(Extensions:)
+
+### Note that some functions (such as const) are normally disabled anyway.
+AC_MSG_CHECKING(if you want to build with function extensions)
+AC_ARG_ENABLE(ext-funcs,
+	[  --disable-ext-funcs     disable function-extensions],
+	[with_ext_funcs=$enableval],
+	[with_ext_funcs=yes])
+AC_MSG_RESULT($with_ext_funcs)
+if test "$with_ext_funcs" = yes ; then
+	NCURSES_EXT_FUNCS=1
+	AC_DEFINE(HAVE_USE_DEFAULT_COLORS)
+	AC_DEFINE(NCURSES_EXT_FUNCS)
+else
+	NCURSES_EXT_FUNCS=0
+fi
+AC_SUBST(NCURSES_EXT_FUNCS)
+
+###   use option --enable-const to turn on use of const beyond that in XSI.
+AC_MSG_CHECKING(for extended use of const keyword)
+AC_ARG_ENABLE(const,
+	[  --enable-const          compile with extra/non-standard const],
+	[with_ext_const=$enableval],
+	[with_ext_const=no])
+AC_MSG_RESULT($with_ext_const)
+NCURSES_CONST='/*nothing*/'
+if test "$with_ext_const" = yes ; then
+	NCURSES_CONST=const
+fi
+AC_SUBST(NCURSES_CONST)
+
+###############################################################################
+# These options are relatively safe to experiment with.
+CF_HELP_MESSAGE(Development Code:)
+AC_MSG_CHECKING(if you want all development code)
+AC_ARG_WITH(develop,
+	[  --without-develop       disable development options],
+	[with_develop=$withval],
+	[with_develop=no])
+AC_MSG_RESULT($with_develop)
+
+###############################################################################
+# These are just experimental, probably should not be in a package:
+CF_HELP_MESSAGE(Experimental Code:)
+
+# This is still experimental (20080329), but should ultimately be moved to
+# the script-block --with-normal, etc.
+CF_WITH_PTHREAD
+
+AC_MSG_CHECKING(if you want to use weak-symbols for pthreads)
+AC_ARG_ENABLE(weak-symbols,
+    [  --enable-weak-symbols   enable weak-symbols for pthreads],
+    [use_weak_symbols=$withval],
+    [use_weak_symbols=no])
+AC_MSG_RESULT($use_weak_symbols)
+if test "$use_weak_symbols" = yes ; then
+    CF_WEAK_SYMBOLS
+else
+    cf_cv_weak_symbols=no
+fi
+
+if test $cf_cv_weak_symbols = yes ; then
+    AC_DEFINE(USE_WEAK_SYMBOLS)
+fi
+
+PTHREAD=
+if test "$with_pthread" = "yes" ; then
+    AC_DEFINE(USE_PTHREADS)
+    enable_reentrant=yes
+    if test $cf_cv_weak_symbols = yes ; then
+        PTHREAD=-lpthread
+    fi
+fi
+AC_SUBST(PTHREAD)
+
+# Reentrant code has to be opaque; there's little advantage to making ncurses
+# opaque outside of that, so there is no --enable-opaque option.  We can use
+# this option without --with-pthreads, but this will be always set for
+# pthreads.
+AC_MSG_CHECKING(if you want experimental reentrant code)
+AC_ARG_ENABLE(reentrant,
+	[  --enable-reentrant      compile with experimental reentrant code],
+	[with_reentrant=$enableval],
+	[with_reentrant=no])
+AC_MSG_RESULT($with_reentrant)
+if test "$with_reentrant" = yes ; then
+	cf_cv_enable_reentrant=1
+	if test $cf_cv_weak_symbols = yes ; then
+		CF_REMOVE_LIB(LIBS,$LIBS,pthread)
+	else
+		LIB_SUFFIX="t${LIB_SUFFIX}"
+	fi
+	AC_DEFINE(USE_REENTRANT)
+else
+	cf_cv_enable_reentrant=0
+fi
+AC_SUBST(cf_cv_enable_reentrant)
+
+### Allow using a different wrap-prefix
+if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then
+	AC_MSG_CHECKING(for prefix used to wrap public variables)
+	AC_ARG_WITH(wrap-prefix,
+		[  --with-wrap-prefix=XXX  override prefix used for public variables],
+		[NCURSES_WRAP_PREFIX=$withval],
+		[NCURSES_WRAP_PREFIX=_nc_])
+	AC_MSG_RESULT($NCURSES_WRAP_PREFIX)
+else
+	NCURSES_WRAP_PREFIX=_nc_
+fi
+AC_SUBST(NCURSES_WRAP_PREFIX)
+AC_DEFINE_UNQUOTED(NCURSES_WRAP_PREFIX,"$NCURSES_WRAP_PREFIX")
+
+###############################################################################
+CF_HELP_MESSAGE(Testing/development Options:)
+
+###	use option --disable-echo to suppress full display compiling commands
+AC_MSG_CHECKING(if you want to display full commands during build)
+AC_ARG_ENABLE(echo,
+	[  --enable-echo           build: display "compiling" commands (default)],
+	[with_echo=$enableval],
+	[with_echo=yes])
+if test "$with_echo" = yes; then
+	ECHO_LINK=
+else
+	ECHO_LINK='@ echo linking $@ ... ;'
+fi
+AC_MSG_RESULT($with_echo)
+AC_SUBST(ECHO_LINK)
+
+###	use option --enable-warnings to turn on all gcc warnings
+AC_MSG_CHECKING(if you want to see compiler warnings)
+AC_ARG_ENABLE(warnings,
+	[  --enable-warnings       build: turn on GCC compiler warnings],
+	[with_warnings=$enableval])
+AC_MSG_RESULT($with_warnings)
+
+if test "x$with_warnings" = "xyes"; then
+ 	ADAFLAGS="$ADAFLAGS -gnatg"
+	CF_GCC_WARNINGS(Wdeclaration-after-statement Wextra Wno-unknown-pragmas Wswitch-enum)
+fi
+CF_GCC_ATTRIBUTES
+
+###	use option --enable-assertions to turn on generation of assertion code
+AC_MSG_CHECKING(if you want to enable runtime assertions)
+AC_ARG_ENABLE(assertions,
+	[  --enable-assertions     test: turn on generation of assertion code],
+	[with_assertions=$enableval],
+	[with_assertions=no])
+AC_MSG_RESULT($with_assertions)
+if test -n "$GCC"
+then
+	if test "$with_assertions" = no
+	then
+		AC_DEFINE(NDEBUG)
+		CPPFLAGS="$CPPFLAGS -DNDEBUG"
+	else
+		ADAFLAGS="$ADAFLAGS -gnata"
+	fi
+fi
+
+###	use option --disable-leaks to suppress "permanent" leaks, for testing
+AC_DEFINE(HAVE_NC_ALLOC_H)
+
+###	use option --enable-expanded to generate certain macros as functions
+AC_ARG_ENABLE(expanded,
+	[  --enable-expanded       test: generate functions for certain macros],
+	[test "$enableval" = yes && AC_DEFINE(NCURSES_EXPANDED)])
+
+###	use option --disable-macros to suppress macros in favor of functions
+AC_ARG_ENABLE(macros,
+	[  --disable-macros        test: use functions rather than macros],
+	[test "$enableval" = no && AC_DEFINE(NCURSES_NOMACROS)])
+
+# Normally we only add trace() to the debug-library.  Allow this to be
+# extended to all models of the ncurses library:
+cf_all_traces=no
+case "$CFLAGS $CPPFLAGS" in
+*-DTRACE*)
+	cf_all_traces=yes
+	;;
+esac
+
+AC_MSG_CHECKING(whether to add trace feature to all models)
+AC_ARG_WITH(trace,
+[  --with-trace            test: add trace() function to all models of ncurses],
+[cf_with_trace=$withval],
+[cf_with_trace=$cf_all_traces])
+AC_MSG_RESULT($cf_with_trace)
+
+if test "$cf_with_trace" = yes ; then
+	ADA_TRACE=TRUE
+	CF_ADD_CFLAGS(-DTRACE)
+else
+	ADA_TRACE=FALSE
+fi
+
+AC_SUBST(ADA_TRACE)
+
+###	Checks for libraries.
+case $cf_cv_system_name in #(vi
+*mingw32*) #(vi
+	;;
+*)
+AC_CHECK_FUNC(gettimeofday,
+	AC_DEFINE(HAVE_GETTIMEOFDAY),[
+
+AC_CHECK_LIB(bsd, gettimeofday,
+	AC_DEFINE(HAVE_GETTIMEOFDAY)
+	LIBS="$LIBS -lbsd")])dnl CLIX: bzero, select, gettimeofday
+	;;
+esac
+
+###	Checks for header files.
+AC_STDC_HEADERS
+AC_HEADER_DIRENT
+AC_HEADER_TIME
+
+###	checks for compiler characteristics
+AC_LANG_C
+AC_C_CONST
+
+###	Checks for external-data
+CF_LINK_DATAONLY
+
+###	Checks for library functions.
+CF_MKSTEMP
+
+AC_TYPE_SIGNAL
+
+dnl We'll do our own -g libraries, unless the user's overridden via $CFLAGS
+if test -z "$cf_user_CFLAGS" && test "$with_no_leaks" = no ; then
+	CF_STRIP_G_OPT(CFLAGS)
+	CF_STRIP_G_OPT(CXXFLAGS)
+fi
+
+CF_HELP_MESSAGE(Ada95 Binding Options:)
+
+dnl Check for availability of GNU Ada Translator (GNAT).
+dnl At the moment we support no other Ada95 compiler.
+if test "$cf_with_ada" != "no" ; then
+	CF_PROG_GNAT
+	if test	"$cf_cv_prog_gnat_correct" = yes; then
+		CF_ADD_ADAFLAGS(-O3 -gnatpn)
+
+		CF_GNAT_PRAGMA_UNREF
+
+		CF_WITH_ADA_COMPILER
+
+		cf_ada_package=terminal_interface
+		AC_SUBST(cf_ada_package)
+
+		CF_WITH_ADA_INCLUDE
+		CF_WITH_ADA_OBJECTS
+		CF_WITH_ADA_SHAREDLIB
+	fi
+fi
+
+################################################################################
+
+# not needed
+TINFO_ARGS2=
+AC_SUBST(TINFO_ARGS2)
+
+### Construct the list of include-directories to be generated
+CF_INCLUDE_DIRS
+CF_ADA_INCLUDE_DIRS
+
+### Build up pieces for makefile rules
+AC_MSG_CHECKING(default library suffix)
+CF_LIB_TYPE($DFT_LWR_MODEL,DFT_ARG_SUFFIX)dnl
+AC_SUBST(DFT_ARG_SUFFIX)dnl the string to append to "-lncurses" ("")
+AC_MSG_RESULT($DFT_ARG_SUFFIX)
+
+AC_MSG_CHECKING(default library-dependency suffix)
+CF_LIB_SUFFIX($DFT_LWR_MODEL,DFT_LIB_SUFFIX,DFT_DEP_SUFFIX)dnl
+AC_SUBST(DFT_DEP_SUFFIX)dnl the corresponding library-suffix (".a")
+AC_MSG_RESULT($DFT_DEP_SUFFIX)
+
+AC_MSG_CHECKING(default object directory)
+CF_OBJ_SUBDIR($DFT_LWR_MODEL,DFT_OBJ_SUBDIR)dnl
+AC_SUBST(DFT_OBJ_SUBDIR)dnl the default object-directory ("obj")
+AC_MSG_RESULT($DFT_OBJ_SUBDIR)
+
+### Set up low-level terminfo dependencies for makefiles.
+
+if test "$DFT_LWR_MODEL" = shared ; then
+	case $cf_cv_system_name in #(vi
+	cygwin*)
+		# "lib" files have ".dll.a" suffix, "cyg" files have ".dll"
+		;;
+	esac
+fi
+
+### Construct the list of subdirectories for which we'll customize makefiles
+### with the appropriate compile-rules.
+
+SUB_MAKEFILES="gen/adacurses${DFT_ARG_SUFFIX}-config:gen/adacurses-config.in"
+
+AC_DEFINE_UNQUOTED(NCURSES_PATHSEP,'$PATH_SEPARATOR')
+
+### Now that we're done running tests, add the compiler-warnings, if any
+CF_ADD_CFLAGS($EXTRA_CFLAGS)
+
+################################################################################
+
+if test x"$enable_pc_files" = xyes ; then \
+SUB_MAKEFILES="$SUB_MAKEFILES misc/gen-pkgconfig:misc/gen-pkgconfig.in"
+MAKE_PC_FILES=
+else
+MAKE_PC_FILES="#"
+fi
+AC_SUBST(MAKE_PC_FILES)
+AC_SUBST(cross_compiling)
+
+################################################################################
+
+TEST_ARG2=
+AC_SUBST(TEST_ARG2)
+
+TEST_LIBS2=
+AC_SUBST(TEST_LIBS2)
+
+dnl for separate build, this is good enough for "sh $(top_srcdir)/misc/shlib"
+NCURSES_SHLIB2="sh -c"
+AC_SUBST(NCURSES_SHLIB2)
+
+ADA_SUBDIRS="include gen src"
+if test "x$cf_with_tests" != "xno" ; then
+	ADA_SUBDIRS="$ADA_SUBDIRS samples"
+fi
+for cf_dir in $ADA_SUBDIRS
+do
+	SUB_MAKEFILES="$SUB_MAKEFILES $cf_dir/Makefile"
+done
+AC_SUBST(ADA_SUBDIRS)
+
+NCURSES_TREE="#"
+AC_SUBST(NCURSES_TREE)
+
+EXTERNAL_TREE=
+AC_SUBST(EXTERNAL_TREE)
+
+AC_OUTPUT( \
+	$SUB_MAKEFILES \
+	Makefile,[
+if test -z "$USE_OLD_MAKERULES" ; then
+	$AWK -f $srcdir/mk-1st.awk <$srcdir/src/modules >>src/Makefile
+fi
+],[
+### Special initialization commands, used to pass information from the
+### configuration-run into config.status
+
+AWK="$AWK"
+DFT_ARG_SUFFIX="$DFT_ARG_SUFFIX"
+DFT_LWR_MODEL="$DFT_LWR_MODEL"
+ECHO_LINK="$ECHO_LINK"
+LIB_NAME="$LIB_NAME"
+LIB_SUFFIX="$LIB_SUFFIX"
+LN_S="$LN_S"
+NCURSES_MAJOR="$NCURSES_MAJOR"
+NCURSES_MINOR="$NCURSES_MINOR"
+NCURSES_PATCH="$NCURSES_PATCH"
+USE_OLD_MAKERULES="$USE_OLD_MAKERULES"
+cf_cv_abi_version="$cf_cv_abi_version"
+cf_cv_rel_version="$cf_cv_rel_version"
+cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
+cf_cv_shared_soname='$cf_cv_shared_soname'
+cf_cv_shlib_version="$cf_cv_shlib_version"
+cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix"
+cf_cv_system_name="$cf_cv_system_name"
+host="$host"
+target="$target"
+
+],cat)dnl
+${MAKE:-make} preinstall
diff -Naur ncurses-5.7.orig/Ada95/gen/Makefile.in ncurses-5.7/Ada95/gen/Makefile.in
--- ncurses-5.7.orig/Ada95/gen/Makefile.in	2008-10-04 18:58:31.000000000 -0400
+++ ncurses-5.7/Ada95/gen/Makefile.in	2011-01-08 18:18:29.554659961 -0500
@@ -1,5 +1,5 @@
 ##############################################################################
-# Copyright (c) 1998-2007,2008 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 "Software"), #
@@ -28,11 +28,12 @@
 #
 #  Author:  Juergen Pfeifer, 1996
 #
-#  $Id: Makefile.in,v 1.61 2008/10/04 22:58:31 tom Exp $
+#  $Id: Makefile.in,v 1.69 2010/11/27 21:45:27 tom Exp $
 #
 .SUFFIXES:
 
 SHELL		= /bin/sh
+VPATH		= @srcdir@
 THIS		= Makefile
 
 x		= @PROG_EXT@
@@ -43,9 +44,7 @@
 prefix		= @prefix@
 exec_prefix	= @exec_prefix@
 bindir		= @bindir@
-
-ADA_INCLUDE	= $(DESTDIR)@ADA_INCLUDE@
-ADA_OBJECTS	= $(DESTDIR)@ADA_OBJECTS@
+includedir	= @includedir@
 
 INSTALL		= @INSTALL@
 INSTALL_PROG	= @INSTALL_PROGRAM@
@@ -81,10 +80,12 @@
 M4		= m4
 M4FLAGS		= -DNCURSES_EXT_FUNCS=@NCURSES_EXT_FUNCS@
 
-ADACURSES_CONFIG = adacurses-config
+ADACURSES_CONFIG = adacurses@DFT_ARG_SUFFIX@-config
+
+WRAPPER		= @NCURSES_SHLIB2@
 
-WRAPPER		= sh $(top_srcdir)/misc/shlib
-GENERATE	= ./gen$x '@DFT_ARG_SUFFIX@'
+PROG_GENERATE	= ./generate$x
+GENERATE	= $(PROG_GENERATE) '@DFT_ARG_SUFFIX@'
 DEL_ADAMODE	= sed -e '/^\-\-\ \ \-\*\-\ ada\ \-\*\-.*/d'
 
 GNATHTML	= `type -p gnathtml || type -p gnathtml.pl`
@@ -166,126 +167,99 @@
 
 sources:
 
-$(ADA_INCLUDE) \
-$(ADA_OBJECTS) :
-	sh $(top_srcdir)/mkdirs.sh $@
-
-install \
-install.libs :: $(ADA_INCLUDE)
-	@echo installing package $(ALIB) in $(ADA_INCLUDE)
-	@$(top_srcdir)/tar-copy.sh '$(ALIB)*.ad?' $(ADA_SRCDIR) $(ADA_INCLUDE)
-	@$(top_srcdir)/tar-copy.sh '$(ALIB)[-.]*.ad?' $(ADA_SRCDIR) $(ADA_INCLUDE)
-	@test $(srcdir) != ./ && $(top_srcdir)/tar-copy.sh '$(ALIB)*.ad?' $(srcdir)/../src $(ADA_INCLUDE)
-	@test $(srcdir) != ./ && $(top_srcdir)/tar-copy.sh '$(ALIB)[-.]*.ad?' $(srcdir)/../src $(ADA_INCLUDE)
-
-install \
-install.libs :: $(ADA_OBJECTS)
-	@echo installing package $(ALIB) in $(ADA_OBJECTS)
-	@-chmod a-wx $(ADA_SRCDIR)/*.ali
-	@$(top_srcdir)/tar-copy.sh '$(ALIB)*.ali' $(ADA_SRCDIR) $(ADA_OBJECTS)
-	@$(top_srcdir)/tar-copy.sh '$(ALIB)[-.]*.ali' $(ADA_SRCDIR) $(ADA_OBJECTS)
-	@-chmod u+x $(ADA_SRCDIR)/*.ali
+$(DESTDIR)$(bindir) :
+	mkdir -p $@
 
 install \
-install.libs :: $(DESTDIR)$(bindir) adacurses-config
-	$(INSTALL_PROG) adacurses-config $(DESTDIR)$(bindir)/$(ADACURSES_CONFIG)
-
-uninstall \
-uninstall.libs ::
-	@echo removing package $(ALIB) from $(ADA_INCLUDE)
-	-@cd $(ADA_INCLUDE) && rm -f $(ALIB)[-.]*
-
-uninstall \
-uninstall.libs ::
-	@echo removing package $(ALIB) from $(ADA_OBJECTS)
-	-@cd $(ADA_OBJECTS) && rm -f $(ALIB)[-.]*
+install.libs :: $(DESTDIR)$(bindir) $(ADACURSES_CONFIG)
+	$(INSTALL_PROG) $(ADACURSES_CONFIG) $(DESTDIR)$(bindir)/$(ADACURSES_CONFIG)
 
 uninstall \
 uninstall.libs ::
 	-rm -f $(DESTDIR)$(bindir)/$(ADACURSES_CONFIG)
 
-gen$x:	gen.o
+$(PROG_GENERATE):  gen.o
 	@ECHO_LINK@ $(LINK) $(CFLAGS_NORMAL) gen.o $(LD_FLAGS) -o $@
 
 gen.o:	$(srcdir)/gen.c
 	$(HOST_CC) $(CFLAGS_NORMAL) -c -o $@ $(srcdir)/gen.c
 ################################################################################
-Character_Attribute_Set_Rep: gen$x
+Character_Attribute_Set_Rep: $(PROG_GENERATE)
 	$(WRAPPER) "$(GENERATE) B A" >$@
 
-Base_Defs: gen$x
+Base_Defs: $(PROG_GENERATE)
 	$(WRAPPER) "$(GENERATE) B B" >$@
 
-Color_Defs: gen$x
+Color_Defs: $(PROG_GENERATE)
 	$(WRAPPER) "$(GENERATE) B C" >$@
 
-Window_Offsets: gen$x
+Window_Offsets: $(PROG_GENERATE)
 	$(WRAPPER) "$(GENERATE) B D" >$@
 
-Key_Definitions: gen$x
+Key_Definitions: $(PROG_GENERATE)
 	$(WRAPPER) "$(GENERATE) B K" >$@
 
-Linker_Options: gen$x
+Linker_Options: $(PROG_GENERATE)
 	$(WRAPPER) "$(GENERATE) B L" >$@
 
-ACS_Map: gen$x
+ACS_Map: $(PROG_GENERATE)
 	$(WRAPPER) "$(GENERATE) B M" >$@
 
-Old_Keys: gen$x
+Old_Keys: $(PROG_GENERATE)
 	$(WRAPPER) "$(GENERATE) B O" >$@
 
-Public_Variables: gen$x
+Public_Variables: $(PROG_GENERATE)
 	$(WRAPPER) "$(GENERATE) B P" >$@
 
-AC_Rep: gen$x
+AC_Rep: $(PROG_GENERATE)
 	$(WRAPPER) "$(GENERATE) B R" >$@
 
-Version_Info: gen$x
+Version_Info: $(PROG_GENERATE)
 	$(WRAPPER) "$(GENERATE) B V" >$@
 
-Trace_Defs: gen$x
+Trace_Defs: $(PROG_GENERATE)
 	$(WRAPPER) "$(GENERATE) B T" >$@
 ################################################################################
-Menu_Opt_Rep: gen$x
+Menu_Opt_Rep: $(PROG_GENERATE)
 	$(WRAPPER) "$(GENERATE) M R" >$@
 
-Menu_Base_Defs: gen$x
+Menu_Base_Defs: $(PROG_GENERATE)
 	$(WRAPPER) "$(GENERATE) M B" >$@
 
-Menu_Linker_Options: gen$x
+Menu_Linker_Options: $(PROG_GENERATE)
 	$(WRAPPER) "$(GENERATE) M L" >$@
 
-Item_Rep: gen$x
+Item_Rep: $(PROG_GENERATE)
 	$(WRAPPER) "$(GENERATE) M I" >$@
 ################################################################################
-Form_Opt_Rep: gen$x
+Form_Opt_Rep: $(PROG_GENERATE)
 	$(WRAPPER) "$(GENERATE) F R" >$@
 
-Form_Base_Defs: gen$x
+Form_Base_Defs: $(PROG_GENERATE)
 	$(WRAPPER) "$(GENERATE) F B" >$@
 
-Form_Linker_Options: gen$x
+Form_Linker_Options: $(PROG_GENERATE)
 	$(WRAPPER) "$(GENERATE) F L" >$@
 
-Field_Rep: gen$x
+Field_Rep: $(PROG_GENERATE)
 	$(WRAPPER) "$(GENERATE) F I" >$@
 ################################################################################
-Mouse_Base_Defs: gen$x
+Mouse_Base_Defs: $(PROG_GENERATE)
 	$(WRAPPER) "$(GENERATE) P B" >$@
 
-Mouse_Event_Rep: gen$x
+Mouse_Event_Rep: $(PROG_GENERATE)
 	$(WRAPPER) "$(GENERATE) P M" >$@
 
-Mouse_Events: gen$x
+Mouse_Events: $(PROG_GENERATE)
 	$(WRAPPER) "$(GENERATE) B E" >$@
 
-Panel_Linker_Options: gen$x
+Panel_Linker_Options: $(PROG_GENERATE)
 	$(WRAPPER) "$(GENERATE) P L" >$@
 
-Chtype_Def: gen$x
+Chtype_Def: $(PROG_GENERATE)
 	$(WRAPPER) "$(GENERATE) E C" >$@
 
-Eti_Defs: gen$x
+Eti_Defs: $(PROG_GENERATE)
 	$(WRAPPER) "$(GENERATE) E E" >$@
 ################################################################################
 $(ADA_SRCDIR)/$(ABASE).ads: 	$(srcdir)/$(ABASE).ads.m4 \
@@ -387,7 +361,7 @@
 @MAKE_UPPER_TAGS@	etags *.[ch]
 
 mostlyclean ::
-	-rm -f a.out core gen$x *.o
+	-rm -f a.out core $(PROG_GENERATE) *.o
 	-rm -f $(GEN_FILES1)
 	-rm -f $(GEN_FILES2)
 	-rm -f $(GEN_FILES3)
@@ -398,7 +372,7 @@
 	-rm -f $(GEN_TARGETS) instab.tmp *.ad[bs] *.html *.ali *.tmp
 
 distclean :: clean
-	-rm -f adacurses-config
+	-rm -f $(ADACURSES_CONFIG)
 	-rm -f Makefile
 
 realclean :: distclean
diff -Naur ncurses-5.7.orig/Ada95/gen/adacurses-config.in ncurses-5.7/Ada95/gen/adacurses-config.in
--- ncurses-5.7.orig/Ada95/gen/adacurses-config.in	2007-04-07 17:06:50.000000000 -0400
+++ ncurses-5.7/Ada95/gen/adacurses-config.in	2011-01-08 18:13:50.275157232 -0500
@@ -1,35 +1,79 @@
 #! /bin/sh
-# $Id: adacurses-config.in,v 1.2 2007/04/07 21:06:50 tom Exp $
-#
-# This script will return the option to add to `gnatmake' for using
-# AdaCurses.
+# $Id: adacurses-config.in,v 1.6 2010/03/06 21:05:01 tom Exp $
+##############################################################################
+# Copyright (c) 2007-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 "Software"), #
+# to deal in the Software without restriction, including without limitation  #
+# the rights to use, copy, modify, merge, publish, distribute, distribute    #
+# with modifications, sublicense, and/or sell copies of the Software, and to #
+# permit persons to whom the Software is furnished to do so, subject to the  #
+# following conditions:                                                      #
+#                                                                            #
+# The above copyright notice and this permission notice shall be included in #
+# all copies or substantial portions of the Software.                        #
+#                                                                            #
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR #
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,   #
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL    #
+# THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER      #
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING    #
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER        #
+# DEALINGS IN THE SOFTWARE.                                                  #
+#                                                                            #
+# Except as contained in this notice, the name(s) of the above copyright     #
+# holders shall not be used in advertising or otherwise to promote the sale, #
+# use or other dealings in this Software without prior written               #
+# authorization.                                                             #
+##############################################################################
 #
+# This script returns the options to add to `gnatmake' for using AdaCurses.
+
+DESTDIR=@DESTDIR@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+
+ADA_INCLUDE=@ADA_INCLUDE@
+ADA_OBJECTS=@ADA_OBJECTS@
 
-prefix="@prefix@"
-exec_prefix="@exec_prefix@"
-libdir="@libdir@"
+VERSION=@NCURSES_MAJOR@.@NCURSES_MINOR@.@NCURSES_PATCH@
 
-VERSION="@NCURSES_MAJOR@.@NCURSES_MINOR@.@NCURSES_PATCH@"
+CFLAGS="-I$ADA_INCLUDE -aO$ADA_OBJECTS"
+LIBS="-L$ADA_OBJECTS -lAdaCurses"
 
-CFLAGS="-I$libdir/adacurses -L$libdir/adacurses"
-LIBS="-L$prefix/lib -lAdaCurses"
+THIS="adacurses"
 
 case "x$1" in
-    x--version)
-        echo AdaCurses $VERSION
-        ;;
-    x--cflags)
-        echo $CFLAGS
-        ;;
-    x--libs)
-        echo $LIBS
-        ;;
-    x)
-    	# if no parameter is given, give what gnatmake needs
-        echo $CFLAGS -largs $LIBS
-        ;;
-    *)
-        echo 'Usage: adacurses-config [--version | --cflags | --libs]' >&2
-        exit 1
-        ;;
+	x--version)
+		echo AdaCurses $VERSION
+		;;
+	x--cflags)
+		echo $CFLAGS
+		;;
+	x--libs)
+		echo $LIBS
+		;;
+	x)
+		# if no parameter is given, give what gnatmake needs
+		echo "$CFLAGS -i -largs $LIBS"
+		;;
+	x--help)
+		cat <<ENDHELP
+Usage: ${THIS}-config [options]
+
+Options:
+  --cflags           echos the C compiler flags needed to compile with ${THIS}
+  --libs             echos the libraries needed to link with ${THIS}
+
+  --version          echos the release+patchdate version of ${THIS}
+
+  --help             prints this message
+ENDHELP
+		;;
+	*)
+		echo 'Usage: adacurses@DFT_ARG_SUFFIX@-config [--version | --cflags | --libs]' >&2
+		exit 1
+		;;
 esac
diff -Naur ncurses-5.7.orig/Ada95/gen/gen.c ncurses-5.7/Ada95/gen/gen.c
--- ncurses-5.7.orig/Ada95/gen/gen.c	2008-10-04 17:59:37.000000000 -0400
+++ ncurses-5.7/Ada95/gen/gen.c	2011-01-08 18:18:29.158656474 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998,2007,2008 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            *
@@ -32,7 +32,7 @@
 
 /*
     Version Control
-    $Id: gen.c,v 1.49 2008/10/04 21:59:37 tom Exp $
+    $Id: gen.c,v 1.54 2010/09/04 21:19:50 tom Exp $
   --------------------------------------------------------------------------*/
 /*
   This program generates various record structures and constants from the
@@ -41,7 +41,12 @@
   to produce the real source.
   */
 
+#ifdef HAVE_CONFIG_H
 #include <ncurses_cfg.h>
+#else
+#include <ncurses.h>
+#define HAVE_USE_DEFAULT_COLORS 1
+#endif
 
 #include <stdlib.h>
 #include <stddef.h>
@@ -52,6 +57,7 @@
 #include <menu.h>
 #include <form.h>
 
+#define UChar(c)	((unsigned char)(c))
 #define RES_NAME "Reserved"
 
 static const char *model = "";
@@ -71,7 +77,7 @@
   int l = 0;
 
   *high = -1;
-  *low = 8 * len;
+  *low = (int)(8 * len);
 
   for (i = 0; i < len; i++, s++)
     {
@@ -90,9 +96,13 @@
 		}
 	      l++;
 	      if (little_endian)
-		*s >>= 1;
+		{
+		  *s >>= 1;
+		}
 	      else
-		*s <<= 1;
+		{
+		  *s = (char)(*s << 1);
+		}
 	    }
 	}
       else
@@ -108,11 +118,11 @@
  * bit size, i.e. they fit into an (u)int or a (u)short.
  */
 static void
-  gen_reps
-  (const name_attribute_pair * nap,	/* array of name_attribute_pair records */
-   const char *name,		/* name of the represented record type  */
-   int len,			/* size of the record in bytes          */
-   int bias)
+gen_reps(
+	  const name_attribute_pair * nap,	/* array of name_attribute_pair records */
+	  const char *name,	/* name of the represented record type  */
+	  int len,		/* size of the record in bytes          */
+	  int bias)
 {
   int i, n, l, cnt = 0, low, high;
   int width = strlen(RES_NAME) + 3;
@@ -124,7 +134,7 @@
   for (i = 0; nap[i].name != (char *)0; i++)
     {
       cnt++;
-      l = strlen(nap[i].name);
+      l = (int)strlen(nap[i].name);
       if (l > width)
 	width = l;
     }
@@ -162,7 +172,7 @@
 static void
 chtype_rep(const char *name, attr_t mask)
 {
-  attr_t x = -1;
+  attr_t x = (attr_t)-1;
   attr_t t = x & mask;
   int low, high;
   int l = find_pos((char *)&t, sizeof(t), &low, &high);
@@ -219,7 +229,7 @@
   mrep_rep("Z", &x);
 
   memset(&x, 0, sizeof(x));
-  x.bstate = -1;
+  x.bstate = (mmask_t) - 1;
   mrep_rep("Bstate", &x);
 
   printf("      end record;\n");
@@ -285,11 +295,12 @@
   chtype attr = A_ATTRIBUTES & ~A_COLOR;
   int start = -1;
   int len = 0;
-  int i, set;
+  int i;
+  chtype set;
   for (i = 0; i < (int)(8 * sizeof(chtype)); i++)
 
     {
-      set = attr & 1;
+      set = (attr & 1);
       if (set)
 	{
 	  if (start < 0)
@@ -435,13 +446,14 @@
   if (mode == 0)		/* Generate the new name */
     printf("   %-30s : constant Special_Key_Code := 8#%3o#;\n", name, value);
   else
-    {				/* generate the old name, but only if it doesn't conflict with the old
-				 * name (Ada95 isn't case sensitive!)
-				 */
+    {
       const char *s = old_name;
       const char *t = name;
 
-      while (*s && *t && (toupper(*s++) == toupper(*t++)));
+      /* generate the old name, but only if it doesn't conflict with the old
+       * name (Ada95 isn't case sensitive!)
+       */
+      while (*s && *t && (toupper(UChar(*s++)) == toupper(UChar(*t++))));
       if (*s || *t)
 	printf("   %-16s : Special_Key_Code renames %s;\n", old_name, name);
     }
@@ -761,7 +773,7 @@
   int c = a - &acs_map[0];
 
   printf("   %-24s : constant Character := ", name);
-  if (isprint(c) && (c != '`'))
+  if (isprint(UChar(c)) && (c != '`'))
     printf("'%c';\n", c);
   else
     printf("Character'Val (%d);\n", c);
@@ -778,7 +790,9 @@
 #if USE_REENTRANT || BROKEN_LINKER
   printf("   type C_ACS_Ptr is access C_ACS_Map;\n");
   printf("   function ACS_Map return C_ACS_Ptr;\n");
-  printf("   pragma Import (C, ACS_Map, \"_nc_acs_map\");\n");
+  printf("   pragma Import (C, ACS_Map, \""
+	 NCURSES_WRAP_PREFIX
+	 "acs_map\");\n");
 #else
   printf("   ACS_Map : C_ACS_Map;\n");
   printf("   pragma Import (C, ACS_Map, \"acs_map\");\n");
@@ -1034,7 +1048,7 @@
   printf("   function %s return %s\n", ada_func, ada_type);
   printf("   is\n");
   printf("      function Result return %s;\n", c_type);
-  printf("      pragma Import (C, Result, \"_nc_%s\");\n", c_var);
+  printf("      pragma Import (C, Result, \"" NCURSES_WRAP_PREFIX "%s\");\n", c_var);
   printf("   begin\n");
   if (strcmp(c_type, ada_type))
     printf("      return %s (Result);\n", ada_type);
@@ -1241,7 +1255,7 @@
     *etimin = code;
   if (code > *etimax)
     *etimax = code;
-  return strlen(buf);
+  return (int)strlen(buf);
 }
 
 static void
@@ -1483,7 +1497,7 @@
 	      }
 	    printf("   subtype Eti_Error is C_Int range %d .. %d;\n\n",
 		   etimin, etimax);
-	    printf(buf);
+	    printf("%s", buf);
 	  }
 	  break;
 	default:
diff -Naur ncurses-5.7.orig/Ada95/gen/terminal_interface-curses-aux.ads.m4 ncurses-5.7/Ada95/gen/terminal_interface-curses-aux.ads.m4
--- ncurses-5.7.orig/Ada95/gen/terminal_interface-curses-aux.ads.m4	2007-09-01 19:49:12.000000000 -0400
+++ ncurses-5.7/Ada95/gen/terminal_interface-curses-aux.ads.m4	2011-01-08 18:13:50.275157232 -0500
@@ -10,7 +10,7 @@
 --                                 S P E C                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+-- Copyright (c) 1998-2007,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -38,7 +38,7 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control:
---  $Revision: 1.16 $
+--  $Revision: 1.17 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 include(`Base_Defs')
@@ -94,7 +94,7 @@
      Unchecked_Conversion (Source => C_AttrType,
                            Target => Attributed_Character);
 
-   procedure Fill_String (Cp  : in  chars_ptr;
+   procedure Fill_String (Cp  : chars_ptr;
                           Str : out String);
    --  Fill the Str parameter with the string denoted by the chars_ptr
    --  C-Style string.
diff -Naur ncurses-5.7.orig/Ada95/gen/terminal_interface-curses-forms-field_types.ads.m4 ncurses-5.7/Ada95/gen/terminal_interface-curses-forms-field_types.ads.m4
--- ncurses-5.7.orig/Ada95/gen/terminal_interface-curses-forms-field_types.ads.m4	2003-10-25 11:39:18.000000000 -0400
+++ ncurses-5.7/Ada95/gen/terminal_interface-curses-forms-field_types.ads.m4	2011-01-08 18:13:50.275157232 -0500
@@ -10,7 +10,7 @@
 --                                 S P E C                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -38,7 +38,7 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control:
---  $Revision: 1.14 $
+--  $Revision: 1.15 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with Interfaces.C;
@@ -64,8 +64,8 @@
    type Field_Type_Access is access all Field_Type'Class;
 
    --  ANCHOR(`set_field_type()',`Set_Type')
-   procedure Set_Field_Type (Fld      : in Field;
-                             Fld_Type : in Field_Type) is abstract;
+   procedure Set_Field_Type (Fld      : Field;
+                             Fld_Type : Field_Type) is abstract;
    --  AKA
    --  But: we hide the vararg mechanism of the C interface. You always
    --       have to pass a single Field_Type parameter.
@@ -75,7 +75,7 @@
    --  MANPAGE(`form_field_validation.3x')
 
    --  ANCHOR(`field_type()',`Get_Type')
-   function Get_Type (Fld : in Field) return Field_Type_Access;
+   function Get_Type (Fld : Field) return Field_Type_Access;
    --  AKA
    --  ALIAS(`field_arg()')
    --  In Ada95 we can combine these. If you try to retrieve the field type
diff -Naur ncurses-5.7.orig/Ada95/gen/terminal_interface-curses-forms-field_user_data.ads.m4 ncurses-5.7/Ada95/gen/terminal_interface-curses-forms-field_user_data.ads.m4
--- ncurses-5.7.orig/Ada95/gen/terminal_interface-curses-forms-field_user_data.ads.m4	2003-10-25 11:39:18.000000000 -0400
+++ ncurses-5.7/Ada95/gen/terminal_interface-curses-forms-field_user_data.ads.m4	2011-01-08 18:13:50.275157232 -0500
@@ -10,7 +10,7 @@
 --                                 S P E C                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -38,7 +38,7 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control:
---  $Revision: 1.15 $
+--  $Revision: 1.16 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 
@@ -51,18 +51,18 @@
    --  MANPAGE(`form_field_userptr.3x')
 
    --  ANCHOR(`set_field_userptr',`Set_User_Data')
-   procedure Set_User_Data (Fld  : in Field;
-                            Data : in User_Access);
+   procedure Set_User_Data (Fld  : Field;
+                            Data : User_Access);
    --  AKA
    pragma Inline (Set_User_Data);
 
    --  ANCHOR(`field_userptr',`Get_User_Data')
-   procedure Get_User_Data (Fld  : in  Field;
+   procedure Get_User_Data (Fld  : Field;
                             Data : out User_Access);
    --  AKA
 
    --  ANCHOR(`field_userptr',`Get_User_Data')
-   function Get_User_Data (Fld  : in  Field) return User_Access;
+   function Get_User_Data (Fld  : Field) return User_Access;
    --  AKA
    --  Sama as function
    pragma Inline (Get_User_Data);
diff -Naur ncurses-5.7.orig/Ada95/gen/terminal_interface-curses-forms-form_user_data.ads.m4 ncurses-5.7/Ada95/gen/terminal_interface-curses-forms-form_user_data.ads.m4
--- ncurses-5.7.orig/Ada95/gen/terminal_interface-curses-forms-form_user_data.ads.m4	2003-10-25 11:39:18.000000000 -0400
+++ ncurses-5.7/Ada95/gen/terminal_interface-curses-forms-form_user_data.ads.m4	2011-01-08 18:13:50.279156798 -0500
@@ -10,7 +10,7 @@
 --                                 S P E C                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -38,7 +38,7 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control:
---  $Revision: 1.14 $
+--  $Revision: 1.15 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 
@@ -51,18 +51,18 @@
    --  MANPAGE(`form_userptr.3x')
 
    --  ANCHOR(`set_form_userptr',`Set_User_Data')
-   procedure Set_User_Data (Frm  : in Form;
-                            Data : in User_Access);
+   procedure Set_User_Data (Frm  : Form;
+                            Data : User_Access);
    --  AKA
    pragma Inline (Set_User_Data);
 
    --  ANCHOR(`form_userptr',`Get_User_Data')
-   procedure Get_User_Data (Frm  : in  Form;
+   procedure Get_User_Data (Frm  : Form;
                             Data : out User_Access);
    --  AKA
 
    --  ANCHOR(`form_userptr',`Get_User_Data')
-   function Get_User_Data (Frm  : in  Form) return User_Access;
+   function Get_User_Data (Frm  : Form) return User_Access;
    --  AKA
    --  Same as function
    pragma Inline (Get_User_Data);
diff -Naur ncurses-5.7.orig/Ada95/gen/terminal_interface-curses-forms.ads.m4 ncurses-5.7/Ada95/gen/terminal_interface-curses-forms.ads.m4
--- ncurses-5.7.orig/Ada95/gen/terminal_interface-curses-forms.ads.m4	2006-06-25 10:30:21.000000000 -0400
+++ ncurses-5.7/Ada95/gen/terminal_interface-curses-forms.ads.m4	2011-01-08 18:13:50.295157188 -0500
@@ -10,7 +10,7 @@
 --                                 S P E C                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998,2006 Free Software Foundation, Inc.                   --
+-- Copyright (c) 1998-2006,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -38,8 +38,8 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control:
---  $Revision: 1.29 $
---  $Date: 2006/06/25 14:30:21 $
+--  $Revision: 1.30 $
+--  $Date: 2009/12/26 17:31:35 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 include(`Form_Base_Defs')
@@ -89,7 +89,7 @@
    type Field_Array_Access is access Field_Array;
 
    procedure Free (FA          : in out Field_Array_Access;
-                   Free_Fields : in Boolean := False);
+                   Free_Fields : Boolean := False);
    --  Release the memory for an allocated field array
    --  If Free_Fields is True, call Delete() for all the fields in
    --  the array.
@@ -228,7 +228,7 @@
    REQ_NEXT_CHOICE  : Form_Request_Code renames F_Next_Choice;
    REQ_PREV_CHOICE  : Form_Request_Code renames F_Previous_Choice;
 
-   procedure Request_Name (Key  : in Form_Request_Code;
+   procedure Request_Name (Key  : Form_Request_Code;
                            Name : out String);
 
    function  Request_Name (Key : Form_Request_Code) return String;
@@ -287,8 +287,8 @@
    --  MANPAGE(`form_field_just.3x')
 
    --  ANCHOR(`set_field_just()',`Set_Justification')
-   procedure Set_Justification (Fld  : in Field;
-                                Just : in Field_Justification := None);
+   procedure Set_Justification (Fld  : Field;
+                                Just : Field_Justification := None);
    --  AKA
    pragma Inline (Set_Justification);
 
@@ -301,29 +301,29 @@
 
    --  ANCHOR(`set_field_buffer()',`Set_Buffer')
    procedure Set_Buffer
-     (Fld    : in Field;
-      Buffer : in Buffer_Number := Buffer_Number'First;
-      Str    : in String);
+     (Fld    : Field;
+      Buffer : Buffer_Number := Buffer_Number'First;
+      Str    : String);
    --  AKA
    --  Not inlined
 
    --  ANCHOR(`field_buffer()',`Get_Buffer')
    procedure Get_Buffer
-     (Fld    : in Field;
-      Buffer : in Buffer_Number := Buffer_Number'First;
+     (Fld    : Field;
+      Buffer : Buffer_Number := Buffer_Number'First;
       Str    : out String);
    --  AKA
 
    function Get_Buffer
-     (Fld    : in Field;
-      Buffer : in Buffer_Number := Buffer_Number'First) return String;
+     (Fld    : Field;
+      Buffer : Buffer_Number := Buffer_Number'First) return String;
    --  AKA
    --  Same but as function
    pragma Inline (Get_Buffer);
 
    --  ANCHOR(`set_field_status()',`Set_Status')
-   procedure Set_Status (Fld    : in Field;
-                         Status : in Boolean := True);
+   procedure Set_Status (Fld    : Field;
+                         Status : Boolean := True);
    --  AKA
    pragma Inline (Set_Status);
 
@@ -333,29 +333,29 @@
    pragma Inline (Changed);
 
    --  ANCHOR(`set_field_max()',`Set_Maximum_Size')
-   procedure Set_Maximum_Size (Fld : in Field;
-                               Max : in Natural := 0);
+   procedure Set_Maximum_Size (Fld : Field;
+                               Max : Natural := 0);
    --  AKA
    pragma Inline (Set_Maximum_Size);
 
    --  MANPAGE(`form_field_opts.3x')
 
    --  ANCHOR(`set_field_opts()',`Set_Options')
-   procedure Set_Options (Fld     : in Field;
-                          Options : in Field_Option_Set);
+   procedure Set_Options (Fld     : Field;
+                          Options : Field_Option_Set);
    --  AKA
    --  An overloaded version is defined later. Pragma Inline appears there
 
    --  ANCHOR(`field_opts_on()',`Switch_Options')
-   procedure Switch_Options (Fld     : in Field;
-                             Options : in Field_Option_Set;
+   procedure Switch_Options (Fld     : Field;
+                             Options : Field_Option_Set;
                              On      : Boolean := True);
    --  AKA
    --  ALIAS(`field_opts_off()')
    --  An overloaded version is defined later. Pragma Inline appears there
 
    --  ANCHOR(`field_opts()',`Get_Options')
-   procedure Get_Options (Fld     : in  Field;
+   procedure Get_Options (Fld     : Field;
                           Options : out Field_Option_Set);
    --  AKA
 
@@ -369,19 +369,19 @@
 
    --  ANCHOR(`set_field_fore()',`Set_Foreground')
    procedure Set_Foreground
-     (Fld   : in Field;
-      Fore  : in Character_Attribute_Set := Normal_Video;
-      Color : in Color_Pair := Color_Pair'First);
+     (Fld   : Field;
+      Fore  : Character_Attribute_Set := Normal_Video;
+      Color : Color_Pair := Color_Pair'First);
    --  AKA
    pragma Inline (Set_Foreground);
 
    --  ANCHOR(`field_fore()',`Foreground')
-   procedure Foreground (Fld  : in  Field;
+   procedure Foreground (Fld  : Field;
                          Fore : out Character_Attribute_Set);
    --  AKA
 
    --  ANCHOR(`field_fore()',`Foreground')
-   procedure Foreground (Fld   : in  Field;
+   procedure Foreground (Fld   : Field;
                          Fore  : out Character_Attribute_Set;
                          Color : out Color_Pair);
    --  AKA
@@ -389,32 +389,32 @@
 
    --  ANCHOR(`set_field_back()',`Set_Background')
    procedure Set_Background
-     (Fld   : in Field;
-      Back  : in Character_Attribute_Set := Normal_Video;
-      Color : in Color_Pair := Color_Pair'First);
+     (Fld   : Field;
+      Back  : Character_Attribute_Set := Normal_Video;
+      Color : Color_Pair := Color_Pair'First);
    --  AKA
    pragma Inline (Set_Background);
 
    --  ANCHOR(`field_back()',`Background')
-   procedure Background (Fld  : in  Field;
+   procedure Background (Fld  : Field;
                          Back : out Character_Attribute_Set);
    --  AKA
 
    --  ANCHOR(`field_back()',`Background')
-   procedure Background (Fld   : in  Field;
+   procedure Background (Fld   : Field;
                          Back  : out Character_Attribute_Set;
                          Color : out Color_Pair);
    --  AKA
    pragma Inline (Background);
 
    --  ANCHOR(`set_field_pad()',`Set_Pad_Character')
-   procedure Set_Pad_Character (Fld : in Field;
-                                Pad : in Character := Space);
+   procedure Set_Pad_Character (Fld : Field;
+                                Pad : Character := Space);
    --  AKA
    pragma Inline (Set_Pad_Character);
 
    --  ANCHOR(`field_pad()',`Pad_Character')
-   procedure Pad_Character (Fld : in  Field;
+   procedure Pad_Character (Fld : Field;
                             Pad : out Character);
    --  AKA
    pragma Inline (Pad_Character);
@@ -422,7 +422,7 @@
    --  MANPAGE(`form_field_info.3x')
 
    --  ANCHOR(`field_info()',`Info')
-   procedure Info (Fld                : in  Field;
+   procedure Info (Fld                : Field;
                    Lines              : out Line_Count;
                    Columns            : out Column_Count;
                    First_Row          : out Line_Position;
@@ -433,7 +433,7 @@
    pragma Inline (Info);
 
    --  ANCHOR(`dynamic_field_info()',`Dynamic_Info')
-   procedure Dynamic_Info (Fld     : in Field;
+   procedure Dynamic_Info (Fld     : Field;
                            Lines   : out Line_Count;
                            Columns : out Column_Count;
                            Max     : out Natural);
@@ -443,8 +443,8 @@
    --  MANPAGE(`form_win.3x')
 
    --  ANCHOR(`set_form_win()',`Set_Window')
-   procedure Set_Window (Frm : in Form;
-                         Win : in Window);
+   procedure Set_Window (Frm : Form;
+                         Win : Window);
    --  AKA
    pragma Inline (Set_Window);
 
@@ -454,8 +454,8 @@
    pragma Inline (Get_Window);
 
    --  ANCHOR(`set_form_sub()',`Set_Sub_Window')
-   procedure Set_Sub_Window (Frm : in Form;
-                             Win : in Window);
+   procedure Set_Sub_Window (Frm : Form;
+                             Win : Window);
    --  AKA
    pragma Inline (Set_Sub_Window);
 
@@ -465,7 +465,7 @@
    pragma Inline (Get_Sub_Window);
 
    --  ANCHOR(`scale_form()',`Scale')
-   procedure Scale (Frm     : in Form;
+   procedure Scale (Frm     : Form;
                     Lines   : out Line_Count;
                     Columns : out Column_Count);
    --  AKA
@@ -473,30 +473,30 @@
 
    --  MANPAGE(`form_hook.3x')
 
-   type Form_Hook_Function is access procedure (Frm : in Form);
+   type Form_Hook_Function is access procedure (Frm : Form);
    pragma Convention (C, Form_Hook_Function);
 
    --  ANCHOR(`set_field_init()',`Set_Field_Init_Hook')
-   procedure Set_Field_Init_Hook (Frm  : in Form;
-                                  Proc : in Form_Hook_Function);
+   procedure Set_Field_Init_Hook (Frm  : Form;
+                                  Proc : Form_Hook_Function);
    --  AKA
    pragma Inline (Set_Field_Init_Hook);
 
    --  ANCHOR(`set_field_term()',`Set_Field_Term_Hook')
-   procedure Set_Field_Term_Hook (Frm  : in Form;
-                                  Proc : in Form_Hook_Function);
+   procedure Set_Field_Term_Hook (Frm  : Form;
+                                  Proc : Form_Hook_Function);
    --  AKA
    pragma Inline (Set_Field_Term_Hook);
 
    --  ANCHOR(`set_form_init()',`Set_Form_Init_Hook')
-   procedure Set_Form_Init_Hook (Frm  : in Form;
-                                 Proc : in Form_Hook_Function);
+   procedure Set_Form_Init_Hook (Frm  : Form;
+                                 Proc : Form_Hook_Function);
    --  AKA
    pragma Inline (Set_Form_Init_Hook);
 
    --  ANCHOR(`set_form_term()',`Set_Form_Term_Hook')
-   procedure Set_Form_Term_Hook (Frm  : in Form;
-                                 Proc : in Form_Hook_Function);
+   procedure Set_Form_Term_Hook (Frm  : Form;
+                                 Proc : Form_Hook_Function);
    --  AKA
    pragma Inline (Set_Form_Term_Hook);
 
@@ -523,14 +523,14 @@
    --  MANPAGE(`form_field.3x')
 
    --  ANCHOR(`set_form_fields()',`Redefine')
-   procedure Redefine (Frm  : in Form;
-                       Flds : in Field_Array_Access);
+   procedure Redefine (Frm  : Form;
+                       Flds : Field_Array_Access);
    --  AKA
    pragma Inline (Redefine);
 
    --  ANCHOR(`set_form_fields()',`Set_Fields')
-   procedure Set_Fields (Frm  : in Form;
-                         Flds : in Field_Array_Access) renames Redefine;
+   procedure Set_Fields (Frm  : Form;
+                         Flds : Field_Array_Access) renames Redefine;
    --  AKA
    --  pragma Inline (Set_Fields);
 
@@ -546,9 +546,9 @@
    pragma Inline (Field_Count);
 
    --  ANCHOR(`move_field()',`Move')
-   procedure Move (Fld    : in Field;
-                   Line   : in Line_Position;
-                   Column : in Column_Position);
+   procedure Move (Fld    : Field;
+                   Line   : Line_Position;
+                   Column : Column_Position);
    --  AKA
    pragma Inline (Move);
 
@@ -574,21 +574,21 @@
    --  MANPAGE(`form_opts.3x')
 
    --  ANCHOR(`set_form_opts()',`Set_Options')
-   procedure Set_Options (Frm     : in Form;
-                          Options : in Form_Option_Set);
+   procedure Set_Options (Frm     : Form;
+                          Options : Form_Option_Set);
    --  AKA
    pragma Inline (Set_Options);
 
    --  ANCHOR(`form_opts_on()',`Switch_Options')
-   procedure Switch_Options (Frm     : in Form;
-                             Options : in Form_Option_Set;
+   procedure Switch_Options (Frm     : Form;
+                             Options : Form_Option_Set;
                              On      : Boolean := True);
    --  AKA
    --  ALIAS(`form_opts_off()')
    pragma Inline (Switch_Options);
 
    --  ANCHOR(`form_opts()',`Get_Options')
-   procedure Get_Options (Frm     : in  Form;
+   procedure Get_Options (Frm     : Form;
                           Options : out Form_Option_Set);
    --  AKA
 
@@ -600,8 +600,8 @@
    --  MANPAGE(`form_post.3x')
 
    --  ANCHOR(`post_form()',`Post')
-   procedure Post (Frm  : in Form;
-                   Post : in Boolean := True);
+   procedure Post (Frm  : Form;
+                   Post : Boolean := True);
    --  AKA
    --  ALIAS(`unpost_form()')
    pragma Inline (Post);
@@ -643,19 +643,19 @@
    type Page_Number is new Natural;
 
    --  ANCHOR(`set_current_field()',`Set_Current')
-   procedure Set_Current (Frm : in Form;
-                          Fld : in Field);
+   procedure Set_Current (Frm : Form;
+                          Fld : Field);
    --  AKA
    pragma Inline (Set_Current);
 
    --  ANCHOR(`current_field()',`Current')
-   function Current (Frm : in Form) return Field;
+   function Current (Frm : Form) return Field;
    --  AKA
    pragma Inline (Current);
 
    --  ANCHOR(`set_form_page()',`Set_Page')
-   procedure Set_Page (Frm  : in Form;
-                       Page : in Page_Number := Page_Number'First);
+   procedure Set_Page (Frm  : Form;
+                       Page : Page_Number := Page_Number'First);
    --  AKA
    pragma Inline (Set_Page);
 
@@ -675,8 +675,8 @@
    --  MANPAGE(`form_new_page.3x')
 
    --  ANCHOR(`set_new_page()',`Set_New_Page')
-   procedure Set_New_Page (Fld      : in Field;
-                           New_Page : in Boolean := True);
+   procedure Set_New_Page (Fld      : Field;
+                           New_Page : Boolean := True);
    --  AKA
    pragma Inline (Set_New_Page);
 
diff -Naur ncurses-5.7.orig/Ada95/gen/terminal_interface-curses-menus-item_user_data.ads.m4 ncurses-5.7/Ada95/gen/terminal_interface-curses-menus-item_user_data.ads.m4
--- ncurses-5.7.orig/Ada95/gen/terminal_interface-curses-menus-item_user_data.ads.m4	2006-06-25 10:30:22.000000000 -0400
+++ ncurses-5.7/Ada95/gen/terminal_interface-curses-menus-item_user_data.ads.m4	2011-01-08 18:13:50.295157188 -0500
@@ -10,7 +10,7 @@
 --                                 S P E C                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998,2006 Free Software Foundation, Inc.                   --
+-- Copyright (c) 1998-2006,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -38,8 +38,8 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control:
---  $Revision: 1.16 $
---  $Date: 2006/06/25 14:30:22 $
+--  $Revision: 1.17 $
+--  $Date: 2009/12/26 17:31:35 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 
@@ -56,18 +56,18 @@
    --  MANPAGE(`mitem_userptr.3x')
 
    --  ANCHOR(`set_item_userptr',`Set_User_Data')
-   procedure Set_User_Data (Itm  : in Item;
-                            Data : in User_Access);
+   procedure Set_User_Data (Itm  : Item;
+                            Data : User_Access);
    --  AKA
    pragma Inline (Set_User_Data);
 
    --  ANCHOR(`item_userptr',`Get_User_Data')
-   procedure Get_User_Data (Itm  : in  Item;
+   procedure Get_User_Data (Itm  : Item;
                             Data : out User_Access);
    --  AKA
 
    --  ANCHOR(`item_userptr',`Get_User_Data')
-   function Get_User_Data (Itm  : in  Item) return User_Access;
+   function Get_User_Data (Itm  : Item) return User_Access;
    --  AKA
    --  Same as function
    pragma Inline (Get_User_Data);
diff -Naur ncurses-5.7.orig/Ada95/gen/terminal_interface-curses-menus-menu_user_data.ads.m4 ncurses-5.7/Ada95/gen/terminal_interface-curses-menus-menu_user_data.ads.m4
--- ncurses-5.7.orig/Ada95/gen/terminal_interface-curses-menus-menu_user_data.ads.m4	2003-10-25 11:39:18.000000000 -0400
+++ ncurses-5.7/Ada95/gen/terminal_interface-curses-menus-menu_user_data.ads.m4	2011-01-08 18:13:50.295157188 -0500
@@ -10,7 +10,7 @@
 --                                 S P E C                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -38,7 +38,7 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control:
---  $Revision: 1.14 $
+--  $Revision: 1.15 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 
@@ -51,18 +51,18 @@
    --  MANPAGE(`menu_userptr.3x')
 
    --  ANCHOR(`set_menu_userptr',`Set_User_Data')
-   procedure Set_User_Data (Men  : in Menu;
-                            Data : in User_Access);
+   procedure Set_User_Data (Men  : Menu;
+                            Data : User_Access);
    --  AKA
    pragma Inline (Set_User_Data);
 
    --  ANCHOR(`menu_userptr',`Get_User_Data')
-   procedure Get_User_Data (Men  : in  Menu;
+   procedure Get_User_Data (Men  : Menu;
                             Data : out User_Access);
    --  AKA
 
    --  ANCHOR(`menu_userptr',`Get_User_Data')
-   function Get_User_Data (Men  : in  Menu) return User_Access;
+   function Get_User_Data (Men  : Menu) return User_Access;
    --  AKA
    --  Same as function
    pragma Inline (Get_User_Data);
diff -Naur ncurses-5.7.orig/Ada95/gen/terminal_interface-curses-menus.ads.m4 ncurses-5.7/Ada95/gen/terminal_interface-curses-menus.ads.m4
--- ncurses-5.7.orig/Ada95/gen/terminal_interface-curses-menus.ads.m4	2007-05-05 16:20:52.000000000 -0400
+++ ncurses-5.7/Ada95/gen/terminal_interface-curses-menus.ads.m4	2011-01-08 18:13:50.295157188 -0500
@@ -10,7 +10,7 @@
 --                                 S P E C                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998,2006 Free Software Foundation, Inc.                   --
+-- Copyright (c) 1998-2007,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -38,8 +38,8 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control:
---  $Revision: 1.27 $
---  $Date: 2007/05/05 20:20:52 $
+--  $Revision: 1.28 $
+--  $Date: 2009/12/26 18:35:22 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 include(`Menu_Base_Defs')
@@ -102,7 +102,7 @@
    REQ_NEXT_MATCH    : Menu_Request_Code renames M_Next_Match;
    REQ_PREV_MATCH    : Menu_Request_Code renames M_Previous_Match;
 
-   procedure Request_Name (Key  : in Menu_Request_Code;
+   procedure Request_Name (Key  : Menu_Request_Code;
                            Name : out String);
 
    function  Request_Name (Key : Menu_Request_Code) return String;
@@ -172,8 +172,8 @@
    --  MANPAGE(`mitem_value.3x')
 
    --  ANCHOR(`set_item_value()',`Set_Value')
-   procedure Set_Value (Itm   : in Item;
-                        Value : in Boolean := True);
+   procedure Set_Value (Itm   : Item;
+                        Value : Boolean := True);
    --  AKA
    pragma Inline (Set_Value);
 
@@ -192,14 +192,14 @@
    --  MANPAGE(`mitem_opts.3x')
 
    --  ANCHOR(`set_item_opts()',`Set_Options')
-   procedure Set_Options (Itm     : in Item;
-                          Options : in Item_Option_Set);
+   procedure Set_Options (Itm     : Item;
+                          Options : Item_Option_Set);
    --  AKA
    --  An overloaded Set_Options is defined later. Pragma Inline appears there
 
    --  ANCHOR(`item_opts_on()',`Switch_Options')
-   procedure Switch_Options (Itm     : in Item;
-                             Options : in Item_Option_Set;
+   procedure Switch_Options (Itm     : Item;
+                             Options : Item_Option_Set;
                              On      : Boolean := True);
    --  AKA
    --  ALIAS(`item_opts_off()')
@@ -207,7 +207,7 @@
    --  Pragma Inline appears there
 
    --  ANCHOR(`item_opts()',`Get_Options')
-   procedure Get_Options (Itm     : in  Item;
+   procedure Get_Options (Itm     : Item;
                           Options : out Item_Option_Set);
    --  AKA
 
@@ -219,7 +219,7 @@
    --  MANPAGE(`mitem_name.3x')
 
    --  ANCHOR(`item_name()',`Name')
-   procedure Name (Itm  : in Item;
+   procedure Name (Itm  : Item;
                    Name : out String);
    --  AKA
    function  Name (Itm : Item) return String;
@@ -228,7 +228,7 @@
    pragma Inline (Name);
 
    --  ANCHOR(`item_description();',`Description')
-   procedure Description (Itm         : in Item;
+   procedure Description (Itm         : Item;
                           Description : out String);
    --  AKA
 
@@ -240,8 +240,8 @@
    --  MANPAGE(`mitem_current.3x')
 
    --  ANCHOR(`set_current_item()',`Set_Current')
-   procedure Set_Current (Men : in Menu;
-                          Itm : in Item);
+   procedure Set_Current (Men : Menu;
+                          Itm : Item);
    --  AKA
    pragma Inline (Set_Current);
 
@@ -251,8 +251,8 @@
    pragma Inline (Current);
 
    --  ANCHOR(`set_top_row()',`Set_Top_Row')
-   procedure Set_Top_Row (Men  : in Menu;
-                          Line : in Line_Position);
+   procedure Set_Top_Row (Men  : Menu;
+                          Line : Line_Position);
    --  AKA
    pragma Inline (Set_Top_Row);
 
@@ -272,8 +272,8 @@
    --  MANPAGE(`menu_post.3x')
 
    --  ANCHOR(`post_menu()',`Post')
-   procedure Post (Men  : in Menu;
-                   Post : in Boolean := True);
+   procedure Post (Men  : Menu;
+                   Post : Boolean := True);
    --  AKA
    --  ALIAS(`unpost_menu()')
    pragma Inline (Post);
@@ -281,21 +281,21 @@
    --  MANPAGE(`menu_opts.3x')
 
    --  ANCHOR(`set_menu_opts()',`Set_Options')
-   procedure Set_Options (Men     : in Menu;
-                          Options : in Menu_Option_Set);
+   procedure Set_Options (Men     : Menu;
+                          Options : Menu_Option_Set);
    --  AKA
    pragma Inline (Set_Options);
 
    --  ANCHOR(`menu_opts_on()',`Switch_Options')
-   procedure Switch_Options (Men     : in Menu;
-                             Options : in Menu_Option_Set;
+   procedure Switch_Options (Men     : Menu;
+                             Options : Menu_Option_Set;
                              On      : Boolean := True);
    --  AKA
    --  ALIAS(`menu_opts_off()')
    pragma Inline (Switch_Options);
 
    --  ANCHOR(`menu_opts()',`Get_Options')
-   procedure Get_Options (Men     : in  Menu;
+   procedure Get_Options (Men     : Menu;
                           Options : out Menu_Option_Set);
    --  AKA
 
@@ -307,8 +307,8 @@
    --  MANPAGE(`menu_win.3x')
 
    --  ANCHOR(`set_menu_win()',`Set_Window')
-   procedure Set_Window (Men : in Menu;
-                         Win : in Window);
+   procedure Set_Window (Men : Menu;
+                         Win : Window);
    --  AKA
    pragma Inline (Set_Window);
 
@@ -318,8 +318,8 @@
    pragma Inline (Get_Window);
 
    --  ANCHOR(`set_menu_sub()',`Set_Sub_Window')
-   procedure Set_Sub_Window (Men : in Menu;
-                             Win : in Window);
+   procedure Set_Sub_Window (Men : Menu;
+                             Win : Window);
    --  AKA
    pragma Inline (Set_Sub_Window);
 
@@ -329,7 +329,7 @@
    pragma Inline (Get_Sub_Window);
 
    --  ANCHOR(`scale_menu()',`Scale')
-   procedure Scale (Men     : in Menu;
+   procedure Scale (Men     : Menu;
                     Lines   : out Line_Count;
                     Columns : out Column_Count);
    --  AKA
@@ -345,13 +345,13 @@
    --  MANPAGE(`menu_mark.3x')
 
    --  ANCHOR(`set_menu_mark()',`Set_Mark')
-   procedure Set_Mark (Men  : in Menu;
-                       Mark : in String);
+   procedure Set_Mark (Men  : Menu;
+                       Mark : String);
    --  AKA
    pragma Inline (Set_Mark);
 
    --  ANCHOR(`menu_mark()',`Mark')
-   procedure Mark (Men  : in  Menu;
+   procedure Mark (Men  : Menu;
                    Mark : out String);
    --  AKA
 
@@ -364,19 +364,19 @@
 
    --  ANCHOR(`set_menu_fore()',`Set_Foreground')
    procedure Set_Foreground
-     (Men   : in Menu;
-      Fore  : in Character_Attribute_Set := Normal_Video;
-      Color : in Color_Pair := Color_Pair'First);
+     (Men   : Menu;
+      Fore  : Character_Attribute_Set := Normal_Video;
+      Color : Color_Pair := Color_Pair'First);
    --  AKA
    pragma Inline (Set_Foreground);
 
    --  ANCHOR(`menu_fore()',`Foreground')
-   procedure Foreground (Men   : in  Menu;
+   procedure Foreground (Men   : Menu;
                          Fore  : out Character_Attribute_Set);
    --  AKA
 
    --  ANCHOR(`menu_fore()',`Foreground')
-   procedure Foreground (Men   : in  Menu;
+   procedure Foreground (Men   : Menu;
                          Fore  : out Character_Attribute_Set;
                          Color : out Color_Pair);
    --  AKA
@@ -384,19 +384,19 @@
 
    --  ANCHOR(`set_menu_back()',`Set_Background')
    procedure Set_Background
-     (Men   : in Menu;
-      Back  : in Character_Attribute_Set := Normal_Video;
-      Color : in Color_Pair := Color_Pair'First);
+     (Men   : Menu;
+      Back  : Character_Attribute_Set := Normal_Video;
+      Color : Color_Pair := Color_Pair'First);
    --  AKA
    pragma Inline (Set_Background);
 
    --  ANCHOR(`menu_back()',`Background')
-   procedure Background (Men  : in  Menu;
+   procedure Background (Men  : Menu;
                          Back : out Character_Attribute_Set);
    --  AKA
    --  ANCHOR(`menu_back()',`Background')
 
-   procedure Background (Men   : in  Menu;
+   procedure Background (Men   : Menu;
                          Back  : out Character_Attribute_Set;
                          Color : out Color_Pair);
    --  AKA
@@ -404,33 +404,33 @@
 
    --  ANCHOR(`set_menu_grey()',`Set_Grey')
    procedure Set_Grey
-     (Men   : in Menu;
-      Grey  : in Character_Attribute_Set := Normal_Video;
-      Color : in Color_Pair := Color_Pair'First);
+     (Men   : Menu;
+      Grey  : Character_Attribute_Set := Normal_Video;
+      Color : Color_Pair := Color_Pair'First);
    --  AKA
    pragma Inline (Set_Grey);
 
    --  ANCHOR(`menu_grey()',`Grey')
-   procedure Grey (Men  : in  Menu;
+   procedure Grey (Men  : Menu;
                    Grey : out Character_Attribute_Set);
    --  AKA
 
    --  ANCHOR(`menu_grey()',`Grey')
    procedure Grey
-     (Men   : in  Menu;
+     (Men   : Menu;
       Grey  : out Character_Attribute_Set;
       Color : out Color_Pair);
    --  AKA
    pragma Inline (Grey);
 
    --  ANCHOR(`set_menu_pad()',`Set_Pad_Character')
-   procedure Set_Pad_Character (Men : in Menu;
-                                Pad : in Character := Space);
+   procedure Set_Pad_Character (Men : Menu;
+                                Pad : Character := Space);
    --  AKA
    pragma Inline (Set_Pad_Character);
 
    --  ANCHOR(`menu_pad()',`Pad_Character')
-   procedure Pad_Character (Men : in  Menu;
+   procedure Pad_Character (Men : Menu;
                             Pad : out Character);
    --  AKA
    pragma Inline (Pad_Character);
@@ -438,15 +438,15 @@
    --  MANPAGE(`menu_spacing.3x')
 
    --  ANCHOR(`set_menu_spacing()',`Set_Spacing')
-   procedure Set_Spacing (Men   : in Menu;
-                          Descr : in Column_Position := 0;
-                          Row   : in Line_Position   := 0;
-                          Col   : in Column_Position := 0);
+   procedure Set_Spacing (Men   : Menu;
+                          Descr : Column_Position := 0;
+                          Row   : Line_Position   := 0;
+                          Col   : Column_Position := 0);
    --  AKA
    pragma Inline (Set_Spacing);
 
    --  ANCHOR(`menu_spacing()',`Spacing')
-   procedure Spacing (Men   : in Menu;
+   procedure Spacing (Men   : Menu;
                       Descr : out Column_Position;
                       Row   : out Line_Position;
                       Col   : out Column_Position);
@@ -463,7 +463,7 @@
    pragma Inline (Set_Pattern);
 
    --  ANCHOR(`menu_pattern()',`Pattern')
-   procedure Pattern (Men  : in  Menu;
+   procedure Pattern (Men  : Menu;
                       Text : out String);
    --  AKA
    pragma Inline (Pattern);
@@ -471,9 +471,9 @@
    --  MANPAGE(`menu_format.3x')
 
    --  ANCHOR(`set_menu_format()',`Set_Format')
-   procedure Set_Format (Men     : in Menu;
-                         Lines   : in Line_Count;
-                         Columns : in Column_Count);
+   procedure Set_Format (Men     : Menu;
+                         Lines   : Line_Count;
+                         Columns : Column_Count);
    --  Not implemented: 0 argument for Lines or Columns;
    --  instead use Format to get the current sizes
    --      The  default  format  is  16  rows,  1  column.    Calling
@@ -485,7 +485,7 @@
    pragma Inline (Set_Format);
 
    --  ANCHOR(`menu_format()',`Format')
-   procedure Format (Men     : in  Menu;
+   procedure Format (Men     : Menu;
                      Lines   : out Line_Count;
                      Columns : out Column_Count);
    --  AKA
@@ -493,30 +493,30 @@
 
    --  MANPAGE(`menu_hook.3x')
 
-   type Menu_Hook_Function is access procedure (Men : in Menu);
+   type Menu_Hook_Function is access procedure (Men : Menu);
    pragma Convention (C, Menu_Hook_Function);
 
    --  ANCHOR(`set_item_init()',`Set_Item_Init_Hook')
-   procedure Set_Item_Init_Hook (Men  : in Menu;
-                                 Proc : in Menu_Hook_Function);
+   procedure Set_Item_Init_Hook (Men  : Menu;
+                                 Proc : Menu_Hook_Function);
    --  AKA
    pragma Inline (Set_Item_Init_Hook);
 
    --  ANCHOR(`set_item_term()',`Set_Item_Term_Hook')
-   procedure Set_Item_Term_Hook (Men  : in Menu;
-                                 Proc : in Menu_Hook_Function);
+   procedure Set_Item_Term_Hook (Men  : Menu;
+                                 Proc : Menu_Hook_Function);
    --  AKA
    pragma Inline (Set_Item_Term_Hook);
 
    --  ANCHOR(`set_menu_init()',`Set_Menu_Init_Hook')
-   procedure Set_Menu_Init_Hook (Men  : in Menu;
-                                 Proc : in Menu_Hook_Function);
+   procedure Set_Menu_Init_Hook (Men  : Menu;
+                                 Proc : Menu_Hook_Function);
    --  AKA
    pragma Inline (Set_Menu_Init_Hook);
 
    --  ANCHOR(`set_menu_term()',`Set_Menu_Term_Hook')
-   procedure Set_Menu_Term_Hook (Men  : in Menu;
-                                 Proc : in Menu_Hook_Function);
+   procedure Set_Menu_Term_Hook (Men  : Menu;
+                                 Proc : Menu_Hook_Function);
    --  AKA
    pragma Inline (Set_Menu_Term_Hook);
 
@@ -543,13 +543,13 @@
    --  MANPAGE(`menu_items.3x')
 
    --  ANCHOR(`set_menu_items()',`Redefine')
-   procedure Redefine (Men   : in Menu;
-                       Items : in Item_Array_Access);
+   procedure Redefine (Men   : Menu;
+                       Items : Item_Array_Access);
    --  AKA
    pragma Inline (Redefine);
 
-   procedure Set_Items (Men   : in Menu;
-                        Items : in Item_Array_Access) renames Redefine;
+   procedure Set_Items (Men   : Menu;
+                        Items : Item_Array_Access) renames Redefine;
    --  pragma Inline (Set_Items);
 
    --  ANCHOR(`menu_items()',`Items')
diff -Naur ncurses-5.7.orig/Ada95/gen/terminal_interface-curses-mouse.ads.m4 ncurses-5.7/Ada95/gen/terminal_interface-curses-mouse.ads.m4
--- ncurses-5.7.orig/Ada95/gen/terminal_interface-curses-mouse.ads.m4	2006-06-25 10:30:22.000000000 -0400
+++ ncurses-5.7/Ada95/gen/terminal_interface-curses-mouse.ads.m4	2011-01-08 18:13:50.295157188 -0500
@@ -10,7 +10,7 @@
 --                                 S P E C                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998-2004,2006 Free Software Foundation, Inc.              --
+-- Copyright (c) 1998-2006,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -38,8 +38,8 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control:
---  $Revision: 1.27 $
---  $Date: 2006/06/25 14:30:22 $
+--  $Revision: 1.28 $
+--  $Date: 2009/12/26 17:38:58 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 include(`Mouse_Base_Defs')
@@ -95,8 +95,8 @@
    --  Return true if a mouse device is supported, false otherwise.
 
    procedure Register_Reportable_Event
-     (Button : in Mouse_Button;
-      State  : in Button_State;
+     (Button : Mouse_Button;
+      State  : Button_State;
       Mask   : in out Event_Mask);
    --  Stores the event described by the button and the state in the mask.
    --  Before you call this the first time, you should init the mask
@@ -104,8 +104,8 @@
    pragma Inline (Register_Reportable_Event);
 
    procedure Register_Reportable_Events
-     (Button : in Mouse_Button;
-      State  : in Button_States;
+     (Button : Mouse_Button;
+      State  : Button_States;
       Mask   : in out Event_Mask);
    --  Register all events described by the Button and the State bitmap.
    --  Before you call this the first time, you should init the mask
@@ -121,7 +121,7 @@
    --  AKA
    pragma Inline (Start_Mouse);
 
-   procedure End_Mouse (Mask : in Event_Mask := No_Events);
+   procedure End_Mouse (Mask : Event_Mask := No_Events);
    --  Terminates the mouse, restores the specified event mask
    pragma Inline (End_Mouse);
 
@@ -130,7 +130,7 @@
    --  AKA
    pragma Inline (Get_Mouse);
 
-   procedure Get_Event (Event  : in  Mouse_Event;
+   procedure Get_Event (Event  : Mouse_Event;
                         Y      : out Line_Position;
                         X      : out Column_Position;
                         Button : out Mouse_Button;
@@ -142,7 +142,7 @@
    pragma Inline (Get_Event);
 
    --  ANCHOR(`ungetmouse()',`Unget_Mouse')
-   procedure Unget_Mouse (Event : in Mouse_Event);
+   procedure Unget_Mouse (Event : Mouse_Event);
    --  AKA
    pragma Inline (Unget_Mouse);
 
diff -Naur ncurses-5.7.orig/Ada95/gen/terminal_interface-curses-panels-user_data.ads.m4 ncurses-5.7/Ada95/gen/terminal_interface-curses-panels-user_data.ads.m4
--- ncurses-5.7.orig/Ada95/gen/terminal_interface-curses-panels-user_data.ads.m4	2003-10-25 11:39:18.000000000 -0400
+++ ncurses-5.7/Ada95/gen/terminal_interface-curses-panels-user_data.ads.m4	2011-01-08 18:13:50.295157188 -0500
@@ -10,7 +10,7 @@
 --                                 S P E C                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -38,7 +38,7 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control:
---  $Revision: 1.14 $
+--  $Revision: 1.15 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 
@@ -51,18 +51,18 @@
    --  MANPAGE(`panel.3x')
 
    --  ANCHOR(`set_panel_userptr',`Set_User_Data')
-   procedure Set_User_Data (Pan  : in Panel;
-                            Data : in User_Access);
+   procedure Set_User_Data (Pan  : Panel;
+                            Data : User_Access);
    --  AKA
    pragma Inline (Set_User_Data);
 
    --  ANCHOR(`panel_userptr',`Get_User_Data')
-   procedure Get_User_Data (Pan  : in  Panel;
+   procedure Get_User_Data (Pan  : Panel;
                             Data : out User_Access);
    --  AKA
 
    --  ANCHOR(`panel_userptr',`Get_User_Data')
-   function Get_User_Data (Pan  : in  Panel) return User_Access;
+   function Get_User_Data (Pan  : Panel) return User_Access;
    --  AKA
    --  Same as function
    pragma Inline (Get_User_Data);
diff -Naur ncurses-5.7.orig/Ada95/gen/terminal_interface-curses-panels.ads.m4 ncurses-5.7/Ada95/gen/terminal_interface-curses-panels.ads.m4
--- ncurses-5.7.orig/Ada95/gen/terminal_interface-curses-panels.ads.m4	2006-06-25 10:30:22.000000000 -0400
+++ ncurses-5.7/Ada95/gen/terminal_interface-curses-panels.ads.m4	2011-01-08 18:13:50.295157188 -0500
@@ -10,7 +10,7 @@
 --                                 S P E C                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998,2006 Free Software Foundation, Inc.                   --
+-- Copyright (c) 1998-2006,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -38,8 +38,8 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control:
---  $Revision: 1.19 $
---  $Date: 2006/06/25 14:30:22 $
+--  $Revision: 1.20 $
+--  $Date: 2009/12/26 17:38:58 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with System;
@@ -74,17 +74,17 @@
    --  pragma Inline (New_Panel);
 
    --  ANCHOR(`bottom_panel()',`Bottom')
-   procedure Bottom (Pan : in Panel);
+   procedure Bottom (Pan : Panel);
    --  AKA
    pragma Inline (Bottom);
 
    --  ANCHOR(`top_panel()',`Top')
-   procedure Top (Pan : in Panel);
+   procedure Top (Pan : Panel);
    --  AKA
    pragma Inline (Top);
 
    --  ANCHOR(`show_panel()',`Show')
-   procedure Show (Pan : in Panel);
+   procedure Show (Pan : Panel);
    --  AKA
    pragma Inline (Show);
 
@@ -94,7 +94,7 @@
    pragma Import (C, Update_Panels, "update_panels");
 
    --  ANCHOR(`hide_panel()',`Hide')
-   procedure Hide (Pan : in Panel);
+   procedure Hide (Pan : Panel);
    --  AKA
    pragma Inline (Hide);
 
@@ -108,15 +108,15 @@
    --  pragma Inline (Panel_Window);
 
    --  ANCHOR(`replace_panel()',`Replace')
-   procedure Replace (Pan : in Panel;
-                      Win : in Window);
+   procedure Replace (Pan : Panel;
+                      Win : Window);
    --  AKA
    pragma Inline (Replace);
 
    --  ANCHOR(`move_panel()',`Move')
-   procedure Move (Pan    : in Panel;
-                   Line   : in Line_Position;
-                   Column : in Column_Position);
+   procedure Move (Pan    : Panel;
+                   Line   : Line_Position;
+                   Column : Column_Position);
    --  AKA
    pragma Inline (Move);
 
diff -Naur ncurses-5.7.orig/Ada95/gen/terminal_interface-curses.adb.m4 ncurses-5.7/Ada95/gen/terminal_interface-curses.adb.m4
--- ncurses-5.7.orig/Ada95/gen/terminal_interface-curses.adb.m4	2008-07-26 14:46:32.000000000 -0400
+++ ncurses-5.7/Ada95/gen/terminal_interface-curses.adb.m4	2011-01-08 18:13:50.299156775 -0500
@@ -9,7 +9,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998-2007,2008 Free Software Foundation, Inc.              --
+-- Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -37,8 +37,8 @@
 ------------------------------------------------------------------------------
 --  Author: Juergen Pfeifer, 1996
 --  Version Control:
---  $Revision: 1.5 $
---  $Date: 2008/07/26 18:46:32 $
+--  $Revision: 1.6 $
+--  $Date: 2009/12/26 17:38:58 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with System;
@@ -61,7 +61,7 @@
    pragma Convention (C, chtype_array);
 
 ------------------------------------------------------------------------------
-   function Key_Name (Key : in Real_Key_Code) return String
+   function Key_Name (Key : Real_Key_Code) return String
    is
       function Keyname (K : C_Int) return chars_ptr;
       pragma Import (C, Keyname, "keyname");
@@ -89,7 +89,7 @@
       end if;
    end Key_Name;
 
-   procedure Key_Name (Key  : in  Real_Key_Code;
+   procedure Key_Name (Key  :  Real_Key_Code;
                        Name : out String)
    is
    begin
@@ -132,9 +132,9 @@
       end if;
    end Is_End_Window;
 ------------------------------------------------------------------------------
-   procedure Move_Cursor (Win    : in Window := Standard_Window;
-                          Line   : in Line_Position;
-                          Column : in Column_Position)
+   procedure Move_Cursor (Win    : Window := Standard_Window;
+                          Line   : Line_Position;
+                          Column : Column_Position)
    is
       function Wmove (Win    : Window;
                       Line   : C_Int;
@@ -147,8 +147,8 @@
       end if;
    end Move_Cursor;
 ------------------------------------------------------------------------------
-   procedure Add (Win : in Window := Standard_Window;
-                  Ch  : in Attributed_Character)
+   procedure Add (Win : Window := Standard_Window;
+                  Ch  : Attributed_Character)
    is
       function Waddch (W  : Window;
                        Ch : C_Chtype) return C_Int;
@@ -159,8 +159,8 @@
       end if;
    end Add;
 
-   procedure Add (Win : in Window := Standard_Window;
-                  Ch  : in Character)
+   procedure Add (Win : Window := Standard_Window;
+                  Ch  : Character)
    is
    begin
       Add (Win,
@@ -170,10 +170,10 @@
    end Add;
 
    procedure Add
-     (Win    : in Window := Standard_Window;
-      Line   : in Line_Position;
-      Column : in Column_Position;
-      Ch     : in Attributed_Character)
+     (Win    : Window := Standard_Window;
+      Line   : Line_Position;
+      Column : Column_Position;
+      Ch     : Attributed_Character)
    is
       function mvwaddch (W  : Window;
                          Y  : C_Int;
@@ -189,10 +189,10 @@
    end Add;
 
    procedure Add
-     (Win    : in Window := Standard_Window;
-      Line   : in Line_Position;
-      Column : in Column_Position;
-      Ch     : in Character)
+     (Win    : Window := Standard_Window;
+      Line   : Line_Position;
+      Column : Column_Position;
+      Ch     : Character)
    is
    begin
       Add (Win,
@@ -204,8 +204,8 @@
    end Add;
 
    procedure Add_With_Immediate_Echo
-     (Win : in Window := Standard_Window;
-      Ch  : in Attributed_Character)
+     (Win : Window := Standard_Window;
+      Ch  : Attributed_Character)
    is
       function Wechochar (W  : Window;
                           Ch : C_Chtype) return C_Int;
@@ -217,8 +217,8 @@
    end Add_With_Immediate_Echo;
 
    procedure Add_With_Immediate_Echo
-     (Win : in Window := Standard_Window;
-      Ch  : in Character)
+     (Win : Window := Standard_Window;
+      Ch  : Character)
    is
    begin
       Add_With_Immediate_Echo
@@ -331,9 +331,9 @@
       return W;
    end Duplicate;
 
-   procedure Move_Window (Win    : in Window;
-                          Line   : in Line_Position;
-                          Column : in Column_Position)
+   procedure Move_Window (Win    : Window;
+                          Line   : Line_Position;
+                          Column : Column_Position)
    is
       function Mvwin (Win    : Window;
                       Line   : C_Int;
@@ -345,9 +345,9 @@
       end if;
    end Move_Window;
 
-   procedure Move_Derived_Window (Win    : in Window;
-                                  Line   : in Line_Position;
-                                  Column : in Column_Position)
+   procedure Move_Derived_Window (Win    : Window;
+                                  Line   : Line_Position;
+                                  Column : Column_Position)
    is
       function Mvderwin (Win    : Window;
                          Line   : C_Int;
@@ -359,8 +359,8 @@
       end if;
    end Move_Derived_Window;
 
-   procedure Set_Synch_Mode (Win  : in Window  := Standard_Window;
-                             Mode : in Boolean := False)
+   procedure Set_Synch_Mode (Win  : Window  := Standard_Window;
+                             Mode : Boolean := False)
    is
       function Syncok (Win  : Window;
                        Mode : Curses_Bool) return C_Int;
@@ -371,9 +371,9 @@
       end if;
    end Set_Synch_Mode;
 ------------------------------------------------------------------------------
-   procedure Add (Win : in Window := Standard_Window;
-                  Str : in String;
-                  Len : in Integer := -1)
+   procedure Add (Win : Window := Standard_Window;
+                  Str : String;
+                  Len : Integer := -1)
    is
       function Waddnstr (Win : Window;
                          Str : char_array;
@@ -390,11 +390,11 @@
    end Add;
 
    procedure Add
-     (Win    : in Window := Standard_Window;
-      Line   : in Line_Position;
-      Column : in Column_Position;
-      Str    : in String;
-      Len    : in Integer := -1)
+     (Win    : Window := Standard_Window;
+      Line   : Line_Position;
+      Column : Column_Position;
+      Str    : String;
+      Len    : Integer := -1)
    is
    begin
       Move_Cursor (Win, Line, Column);
@@ -402,9 +402,9 @@
    end Add;
 ------------------------------------------------------------------------------
    procedure Add
-     (Win : in Window := Standard_Window;
-      Str : in Attributed_String;
-      Len : in Integer := -1)
+     (Win : Window := Standard_Window;
+      Str : Attributed_String;
+      Len : Integer := -1)
    is
       function Waddchnstr (Win : Window;
                            Str : chtype_array;
@@ -425,11 +425,11 @@
    end Add;
 
    procedure Add
-     (Win    : in Window := Standard_Window;
-      Line   : in Line_Position;
-      Column : in Column_Position;
-      Str    : in Attributed_String;
-      Len    : in Integer := -1)
+     (Win    : Window := Standard_Window;
+      Line   : Line_Position;
+      Column : Column_Position;
+      Str    : Attributed_String;
+      Len    : Integer := -1)
    is
    begin
       Move_Cursor (Win, Line, Column);
@@ -437,15 +437,15 @@
    end Add;
 ------------------------------------------------------------------------------
    procedure Border
-     (Win                       : in Window := Standard_Window;
-      Left_Side_Symbol          : in Attributed_Character := Default_Character;
-      Right_Side_Symbol         : in Attributed_Character := Default_Character;
-      Top_Side_Symbol           : in Attributed_Character := Default_Character;
-      Bottom_Side_Symbol        : in Attributed_Character := Default_Character;
-      Upper_Left_Corner_Symbol  : in Attributed_Character := Default_Character;
-      Upper_Right_Corner_Symbol : in Attributed_Character := Default_Character;
-      Lower_Left_Corner_Symbol  : in Attributed_Character := Default_Character;
-      Lower_Right_Corner_Symbol : in Attributed_Character := Default_Character)
+     (Win                       : Window := Standard_Window;
+      Left_Side_Symbol          : Attributed_Character := Default_Character;
+      Right_Side_Symbol         : Attributed_Character := Default_Character;
+      Top_Side_Symbol           : Attributed_Character := Default_Character;
+      Bottom_Side_Symbol        : Attributed_Character := Default_Character;
+      Upper_Left_Corner_Symbol  : Attributed_Character := Default_Character;
+      Upper_Right_Corner_Symbol : Attributed_Character := Default_Character;
+      Lower_Left_Corner_Symbol  : Attributed_Character := Default_Character;
+      Lower_Right_Corner_Symbol : Attributed_Character := Default_Character)
    is
       function Wborder (W   : Window;
                         LS  : C_Chtype;
@@ -474,9 +474,9 @@
    end Border;
 
    procedure Box
-     (Win               : in Window := Standard_Window;
-      Vertical_Symbol   : in Attributed_Character := Default_Character;
-      Horizontal_Symbol : in Attributed_Character := Default_Character)
+     (Win               : Window := Standard_Window;
+      Vertical_Symbol   : Attributed_Character := Default_Character;
+      Horizontal_Symbol : Attributed_Character := Default_Character)
    is
    begin
       Border (Win,
@@ -485,9 +485,9 @@
    end Box;
 
    procedure Horizontal_Line
-     (Win         : in Window := Standard_Window;
-      Line_Size   : in Natural;
-      Line_Symbol : in Attributed_Character := Default_Character)
+     (Win         : Window := Standard_Window;
+      Line_Size   : Natural;
+      Line_Symbol : Attributed_Character := Default_Character)
    is
       function Whline (W   : Window;
                        Ch  : C_Chtype;
@@ -502,9 +502,9 @@
    end Horizontal_Line;
 
    procedure Vertical_Line
-     (Win         : in Window := Standard_Window;
-      Line_Size   : in Natural;
-      Line_Symbol : in Attributed_Character := Default_Character)
+     (Win         : Window := Standard_Window;
+      Line_Size   : Natural;
+      Line_Symbol : Attributed_Character := Default_Character)
    is
       function Wvline (W   : Window;
                        Ch  : C_Chtype;
@@ -534,7 +534,7 @@
       end if;
    end Get_Keystroke;
 
-   procedure Undo_Keystroke (Key : in Real_Key_Code)
+   procedure Undo_Keystroke (Key : Real_Key_Code)
    is
       function Ungetch (Ch : C_Int) return C_Int;
       pragma Import (C, Ungetch, "ungetch");
@@ -606,9 +606,9 @@
    end Standout;
 
    procedure Switch_Character_Attribute
-     (Win  : in Window := Standard_Window;
-      Attr : in Character_Attribute_Set := Normal_Video;
-      On   : in Boolean := True)
+     (Win  : Window := Standard_Window;
+      Attr : Character_Attribute_Set := Normal_Video;
+      On   : Boolean := True)
    is
       function Wattron (Win    : Window;
                         C_Attr : C_AttrType) return C_Int;
@@ -634,9 +634,9 @@
    end Switch_Character_Attribute;
 
    procedure Set_Character_Attributes
-     (Win   : in Window := Standard_Window;
-      Attr  : in Character_Attribute_Set := Normal_Video;
-      Color : in Color_Pair := Color_Pair'First)
+     (Win   : Window := Standard_Window;
+      Attr  : Character_Attribute_Set := Normal_Video;
+      Color : Color_Pair := Color_Pair'First)
    is
       function Wattrset (Win    : Window;
                          C_Attr : C_AttrType) return C_Int;
@@ -697,8 +697,8 @@
       end if;
    end Get_Character_Attribute;
 
-   procedure Set_Color (Win  : in Window := Standard_Window;
-                        Pair : in Color_Pair)
+   procedure Set_Color (Win  : Window := Standard_Window;
+                        Pair : Color_Pair)
    is
       function Wset_Color (Win   : Window;
                            Color : C_Short;
@@ -713,10 +713,10 @@
    end Set_Color;
 
    procedure Change_Attributes
-     (Win   : in Window := Standard_Window;
-      Count : in Integer := -1;
-      Attr  : in Character_Attribute_Set := Normal_Video;
-      Color : in Color_Pair := Color_Pair'First)
+     (Win   : Window := Standard_Window;
+      Count : Integer := -1;
+      Attr  : Character_Attribute_Set := Normal_Video;
+      Color : Color_Pair := Color_Pair'First)
    is
       function Wchgat (Win   : Window;
                        Cnt   : C_Int;
@@ -736,12 +736,12 @@
    end Change_Attributes;
 
    procedure Change_Attributes
-     (Win    : in Window := Standard_Window;
-      Line   : in Line_Position := Line_Position'First;
-      Column : in Column_Position := Column_Position'First;
-      Count  : in Integer := -1;
-      Attr   : in Character_Attribute_Set := Normal_Video;
-      Color  : in Color_Pair := Color_Pair'First)
+     (Win    : Window := Standard_Window;
+      Line   : Line_Position := Line_Position'First;
+      Column : Column_Position := Column_Position'First;
+      Count  : Integer := -1;
+      Attr   : Character_Attribute_Set := Normal_Video;
+      Color  : Color_Pair := Color_Pair'First)
    is
    begin
       Move_Cursor (Win, Line, Column);
@@ -768,7 +768,7 @@
       end if;
    end Flash_Screen;
 ------------------------------------------------------------------------------
-   procedure Set_Cbreak_Mode (SwitchOn : in Boolean := True)
+   procedure Set_Cbreak_Mode (SwitchOn : Boolean := True)
    is
       function Cbreak return C_Int;
       pragma Import (C, Cbreak, "cbreak");
@@ -787,7 +787,7 @@
       end if;
    end Set_Cbreak_Mode;
 
-   procedure Set_Raw_Mode (SwitchOn : in Boolean := True)
+   procedure Set_Raw_Mode (SwitchOn : Boolean := True)
    is
       function Raw return C_Int;
       pragma Import (C, Raw, "raw");
@@ -806,7 +806,7 @@
       end if;
    end Set_Raw_Mode;
 
-   procedure Set_Echo_Mode (SwitchOn : in Boolean := True)
+   procedure Set_Echo_Mode (SwitchOn : Boolean := True)
    is
       function Echo return C_Int;
       pragma Import (C, Echo, "echo");
@@ -825,8 +825,8 @@
       end if;
    end Set_Echo_Mode;
 
-   procedure Set_Meta_Mode (Win      : in Window := Standard_Window;
-                            SwitchOn : in Boolean := True)
+   procedure Set_Meta_Mode (Win      : Window := Standard_Window;
+                            SwitchOn : Boolean := True)
    is
       function Meta (W : Window; Mode : Curses_Bool) return C_Int;
       pragma Import (C, Meta, "meta");
@@ -836,8 +836,8 @@
       end if;
    end Set_Meta_Mode;
 
-   procedure Set_KeyPad_Mode (Win      : in Window := Standard_Window;
-                              SwitchOn : in Boolean := True)
+   procedure Set_KeyPad_Mode (Win      : Window := Standard_Window;
+                              SwitchOn : Boolean := True)
    is
       function Keypad (W : Window; Mode : Curses_Bool) return C_Int;
       pragma Import (C, Keypad, "keypad");
@@ -847,7 +847,7 @@
       end if;
    end Set_KeyPad_Mode;
 
-   function Get_KeyPad_Mode (Win : in Window := Standard_Window)
+   function Get_KeyPad_Mode (Win : Window := Standard_Window)
                              return Boolean
    is
       function Is_Keypad (W : Window) return Curses_Bool;
@@ -856,7 +856,7 @@
       return (Is_Keypad (Win) /= Curses_Bool_False);
    end Get_KeyPad_Mode;
 
-   procedure Half_Delay (Amount : in Half_Delay_Amount)
+   procedure Half_Delay (Amount : Half_Delay_Amount)
    is
       function Halfdelay (Amount : C_Int) return C_Int;
       pragma Import (C, Halfdelay, "halfdelay");
@@ -867,8 +867,8 @@
    end Half_Delay;
 
    procedure Set_Flush_On_Interrupt_Mode
-     (Win  : in Window := Standard_Window;
-      Mode : in Boolean := True)
+     (Win  : Window := Standard_Window;
+      Mode : Boolean := True)
    is
       function Intrflush (Win : Window; Mode : Curses_Bool) return C_Int;
       pragma Import (C, Intrflush, "intrflush");
@@ -879,8 +879,8 @@
    end Set_Flush_On_Interrupt_Mode;
 
    procedure Set_Queue_Interrupt_Mode
-     (Win   : in Window := Standard_Window;
-      Flush : in Boolean := True)
+     (Win   : Window := Standard_Window;
+      Flush : Boolean := True)
    is
       procedure Qiflush;
       pragma Import (C, Qiflush, "qiflush");
@@ -898,8 +898,8 @@
    end Set_Queue_Interrupt_Mode;
 
    procedure Set_NoDelay_Mode
-     (Win  : in Window := Standard_Window;
-      Mode : in Boolean := False)
+     (Win  : Window := Standard_Window;
+      Mode : Boolean := False)
    is
       function Nodelay (Win : Window; Mode : Curses_Bool) return C_Int;
       pragma Import (C, Nodelay, "nodelay");
@@ -909,9 +909,9 @@
       end if;
    end Set_NoDelay_Mode;
 
-   procedure Set_Timeout_Mode (Win    : in Window := Standard_Window;
-                               Mode   : in Timeout_Mode;
-                               Amount : in Natural)
+   procedure Set_Timeout_Mode (Win    : Window := Standard_Window;
+                               Mode   : Timeout_Mode;
+                               Amount : Natural)
    is
       procedure Wtimeout (Win : Window; Amount : C_Int);
       pragma Import (C, Wtimeout, "wtimeout");
@@ -931,8 +931,8 @@
    end Set_Timeout_Mode;
 
    procedure Set_Escape_Timer_Mode
-     (Win       : in Window := Standard_Window;
-      Timer_Off : in Boolean := False)
+     (Win       : Window := Standard_Window;
+      Timer_Off : Boolean := False)
    is
       function Notimeout (Win : Window; Mode : Curses_Bool) return C_Int;
       pragma Import (C, Notimeout, "notimeout");
@@ -944,7 +944,7 @@
    end Set_Escape_Timer_Mode;
 
 ------------------------------------------------------------------------------
-   procedure Set_NL_Mode (SwitchOn : in Boolean := True)
+   procedure Set_NL_Mode (SwitchOn : Boolean := True)
    is
       function NL return C_Int;
       pragma Import (C, NL, "nl");
@@ -964,8 +964,8 @@
    end Set_NL_Mode;
 
    procedure Clear_On_Next_Update
-     (Win      : in Window := Standard_Window;
-      Do_Clear : in Boolean := True)
+     (Win      : Window := Standard_Window;
+      Do_Clear : Boolean := True)
    is
       function Clear_Ok (W : Window; Flag : Curses_Bool) return C_Int;
       pragma Import (C, Clear_Ok, "clearok");
@@ -976,8 +976,8 @@
    end Clear_On_Next_Update;
 
    procedure Use_Insert_Delete_Line
-     (Win    : in Window := Standard_Window;
-      Do_Idl : in Boolean := True)
+     (Win    : Window := Standard_Window;
+      Do_Idl : Boolean := True)
    is
       function IDL_Ok (W : Window; Flag : Curses_Bool) return C_Int;
       pragma Import (C, IDL_Ok, "idlok");
@@ -988,8 +988,8 @@
    end Use_Insert_Delete_Line;
 
    procedure Use_Insert_Delete_Character
-     (Win    : in Window := Standard_Window;
-      Do_Idc : in Boolean := True)
+     (Win    : Window := Standard_Window;
+      Do_Idc : Boolean := True)
    is
       procedure IDC_Ok (W : Window; Flag : Curses_Bool);
       pragma Import (C, IDC_Ok, "idcok");
@@ -998,8 +998,8 @@
    end Use_Insert_Delete_Character;
 
    procedure Leave_Cursor_After_Update
-     (Win      : in Window := Standard_Window;
-      Do_Leave : in Boolean := True)
+     (Win      : Window := Standard_Window;
+      Do_Leave : Boolean := True)
    is
       function Leave_Ok (W : Window; Flag : Curses_Bool) return C_Int;
       pragma Import (C, Leave_Ok, "leaveok");
@@ -1010,8 +1010,8 @@
    end Leave_Cursor_After_Update;
 
    procedure Immediate_Update_Mode
-     (Win  : in Window := Standard_Window;
-      Mode : in Boolean := False)
+     (Win  : Window := Standard_Window;
+      Mode : Boolean := False)
    is
       procedure Immedok (Win : Window; Mode : Curses_Bool);
       pragma Import (C, Immedok, "immedok");
@@ -1020,8 +1020,8 @@
    end Immediate_Update_Mode;
 
    procedure Allow_Scrolling
-     (Win  : in Window  := Standard_Window;
-      Mode : in Boolean := False)
+     (Win  : Window  := Standard_Window;
+      Mode : Boolean := False)
    is
       function Scrollok (Win : Window; Mode : Curses_Bool) return C_Int;
       pragma Import (C, Scrollok, "scrollok");
@@ -1041,9 +1041,9 @@
    end Scrolling_Allowed;
 
    procedure Set_Scroll_Region
-     (Win         : in Window := Standard_Window;
-      Top_Line    : in Line_Position;
-      Bottom_Line : in Line_Position)
+     (Win         : Window := Standard_Window;
+      Top_Line    : Line_Position;
+      Bottom_Line : Line_Position)
    is
       function Wsetscrreg (Win : Window;
                            Lin : C_Int;
@@ -1066,7 +1066,7 @@
       end if;
    end Update_Screen;
 
-   procedure Refresh (Win : in Window := Standard_Window)
+   procedure Refresh (Win : Window := Standard_Window)
    is
       function Wrefresh (W : Window) return C_Int;
       pragma Import (C, Wrefresh, "wrefresh");
@@ -1077,7 +1077,7 @@
    end Refresh;
 
    procedure Refresh_Without_Update
-     (Win : in Window := Standard_Window)
+     (Win : Window := Standard_Window)
    is
       function Wnoutrefresh (W : Window) return C_Int;
       pragma Import (C, Wnoutrefresh, "wnoutrefresh");
@@ -1087,7 +1087,7 @@
       end if;
    end Refresh_Without_Update;
 
-   procedure Redraw (Win : in Window := Standard_Window)
+   procedure Redraw (Win : Window := Standard_Window)
    is
       function Redrawwin (Win : Window) return C_Int;
       pragma Import (C, Redrawwin, "redrawwin");
@@ -1098,9 +1098,9 @@
    end Redraw;
 
    procedure Redraw
-     (Win        : in Window := Standard_Window;
-      Begin_Line : in Line_Position;
-      Line_Count : in Positive)
+     (Win        : Window := Standard_Window;
+      Begin_Line : Line_Position;
+      Line_Count : Positive)
    is
       function Wredrawln (Win : Window; First : C_Int; Cnt : C_Int)
                           return C_Int;
@@ -1114,7 +1114,7 @@
    end Redraw;
 
 ------------------------------------------------------------------------------
-   procedure Erase (Win : in Window := Standard_Window)
+   procedure Erase (Win : Window := Standard_Window)
    is
       function Werase (W : Window) return C_Int;
       pragma Import (C, Werase, "werase");
@@ -1124,7 +1124,7 @@
       end if;
    end Erase;
 
-   procedure Clear (Win : in Window := Standard_Window)
+   procedure Clear (Win : Window := Standard_Window)
    is
       function Wclear (W : Window) return C_Int;
       pragma Import (C, Wclear, "wclear");
@@ -1134,7 +1134,7 @@
       end if;
    end Clear;
 
-   procedure Clear_To_End_Of_Screen (Win : in Window := Standard_Window)
+   procedure Clear_To_End_Of_Screen (Win : Window := Standard_Window)
    is
       function Wclearbot (W : Window) return C_Int;
       pragma Import (C, Wclearbot, "wclrtobot");
@@ -1144,7 +1144,7 @@
       end if;
    end Clear_To_End_Of_Screen;
 
-   procedure Clear_To_End_Of_Line (Win : in Window := Standard_Window)
+   procedure Clear_To_End_Of_Line (Win : Window := Standard_Window)
    is
       function Wcleareol (W : Window) return C_Int;
       pragma Import (C, Wcleareol, "wclrtoeol");
@@ -1155,18 +1155,18 @@
    end Clear_To_End_Of_Line;
 ------------------------------------------------------------------------------
    procedure Set_Background
-     (Win : in Window := Standard_Window;
-      Ch  : in Attributed_Character)
+     (Win : Window := Standard_Window;
+      Ch  : Attributed_Character)
    is
-      procedure WBackground (W : in Window; Ch : in C_Chtype);
+      procedure WBackground (W : Window; Ch : C_Chtype);
       pragma Import (C, WBackground, "wbkgdset");
    begin
       WBackground (Win, AttrChar_To_Chtype (Ch));
    end Set_Background;
 
    procedure Change_Background
-     (Win : in Window := Standard_Window;
-      Ch  : in Attributed_Character)
+     (Win : Window := Standard_Window;
+      Ch  : Attributed_Character)
    is
       function WChangeBkgd (W : Window; Ch : C_Chtype) return C_Int;
       pragma Import (C, WChangeBkgd, "wbkgd");
@@ -1185,10 +1185,10 @@
       return Chtype_To_AttrChar (Wgetbkgd (Win));
    end Get_Background;
 ------------------------------------------------------------------------------
-   procedure Change_Lines_Status (Win   : in Window := Standard_Window;
-                                  Start : in Line_Position;
-                                  Count : in Positive;
-                                  State : in Boolean)
+   procedure Change_Lines_Status (Win   : Window := Standard_Window;
+                                  Start : Line_Position;
+                                  Count : Positive;
+                                  State : Boolean)
    is
       function Wtouchln (Win : Window;
                          Sta : C_Int;
@@ -1202,7 +1202,7 @@
       end if;
    end Change_Lines_Status;
 
-   procedure Touch (Win : in Window := Standard_Window)
+   procedure Touch (Win : Window := Standard_Window)
    is
       Y : Line_Position;
       X : Column_Position;
@@ -1211,7 +1211,7 @@
       Change_Lines_Status (Win, 0, Positive (Y), True);
    end Touch;
 
-   procedure Untouch (Win : in Window := Standard_Window)
+   procedure Untouch (Win : Window := Standard_Window)
    is
       Y : Line_Position;
       X : Column_Position;
@@ -1220,9 +1220,9 @@
       Change_Lines_Status (Win, 0, Positive (Y), False);
    end Untouch;
 
-   procedure Touch (Win   : in Window := Standard_Window;
-                    Start : in Line_Position;
-                    Count : in Positive)
+   procedure Touch (Win   : Window := Standard_Window;
+                    Start : Line_Position;
+                    Count : Positive)
    is
    begin
       Change_Lines_Status (Win, Start, Count, True);
@@ -1256,15 +1256,15 @@
    end Is_Touched;
 ------------------------------------------------------------------------------
    procedure Copy
-     (Source_Window            : in Window;
-      Destination_Window       : in Window;
-      Source_Top_Row           : in Line_Position;
-      Source_Left_Column       : in Column_Position;
-      Destination_Top_Row      : in Line_Position;
-      Destination_Left_Column  : in Column_Position;
-      Destination_Bottom_Row   : in Line_Position;
-      Destination_Right_Column : in Column_Position;
-      Non_Destructive_Mode     : in Boolean := True)
+     (Source_Window            : Window;
+      Destination_Window       : Window;
+      Source_Top_Row           : Line_Position;
+      Source_Left_Column       : Column_Position;
+      Destination_Top_Row      : Line_Position;
+      Destination_Left_Column  : Column_Position;
+      Destination_Bottom_Row   : Line_Position;
+      Destination_Right_Column : Column_Position;
+      Non_Destructive_Mode     : Boolean := True)
    is
       function Copywin (Src : Window;
                         Dst : Window;
@@ -1292,8 +1292,8 @@
    end Copy;
 
    procedure Overwrite
-     (Source_Window      : in Window;
-      Destination_Window : in Window)
+     (Source_Window      : Window;
+      Destination_Window : Window)
    is
       function Overwrite (Src : Window; Dst : Window) return C_Int;
       pragma Import (C, Overwrite, "overwrite");
@@ -1304,8 +1304,8 @@
    end Overwrite;
 
    procedure Overlay
-     (Source_Window      : in Window;
-      Destination_Window : in Window)
+     (Source_Window      : Window;
+      Destination_Window : Window)
    is
       function Overlay (Src : Window; Dst : Window) return C_Int;
       pragma Import (C, Overlay, "overlay");
@@ -1317,8 +1317,8 @@
 
 ------------------------------------------------------------------------------
    procedure Insert_Delete_Lines
-     (Win   : in Window := Standard_Window;
-      Lines : in Integer       := 1) -- default is to insert one line above
+     (Win   : Window := Standard_Window;
+      Lines : Integer       := 1) -- default is to insert one line above
    is
       function Winsdelln (W : Window; N : C_Int) return C_Int;
       pragma Import (C, Winsdelln, "winsdelln");
@@ -1328,13 +1328,13 @@
       end if;
    end Insert_Delete_Lines;
 
-   procedure Delete_Line (Win : in Window := Standard_Window)
+   procedure Delete_Line (Win : Window := Standard_Window)
    is
    begin
       Insert_Delete_Lines (Win, -1);
    end Delete_Line;
 
-   procedure Insert_Line (Win : in Window := Standard_Window)
+   procedure Insert_Line (Win : Window := Standard_Window)
    is
    begin
       Insert_Delete_Lines (Win, 1);
@@ -1342,7 +1342,7 @@
 ------------------------------------------------------------------------------
 
    procedure Get_Size
-     (Win               : in Window := Standard_Window;
+     (Win               : Window := Standard_Window;
       Number_Of_Lines   : out Line_Count;
       Number_Of_Columns : out Column_Count)
    is
@@ -1362,7 +1362,7 @@
    end Get_Size;
 
    procedure Get_Window_Position
-     (Win             : in Window := Standard_Window;
+     (Win             : Window := Standard_Window;
       Top_Left_Line   : out Line_Position;
       Top_Left_Column : out Column_Position)
    is
@@ -1380,7 +1380,7 @@
    end Get_Window_Position;
 
    procedure Get_Cursor_Position
-     (Win    : in  Window := Standard_Window;
+     (Win    :  Window := Standard_Window;
       Line   : out Line_Position;
       Column : out Column_Position)
    is
@@ -1398,7 +1398,7 @@
    end Get_Cursor_Position;
 
    procedure Get_Origin_Relative_To_Parent
-     (Win                : in  Window;
+     (Win                :  Window;
       Top_Left_Line      : out Line_Position;
       Top_Left_Column    : out Column_Position;
       Is_Not_A_Subwindow : out Boolean)
@@ -1467,13 +1467,13 @@
    end Sub_Pad;
 
    procedure Refresh
-     (Pad                      : in Window;
-      Source_Top_Row           : in Line_Position;
-      Source_Left_Column       : in Column_Position;
-      Destination_Top_Row      : in Line_Position;
-      Destination_Left_Column  : in Column_Position;
-      Destination_Bottom_Row   : in Line_Position;
-      Destination_Right_Column : in Column_Position)
+     (Pad                      : Window;
+      Source_Top_Row           : Line_Position;
+      Source_Left_Column       : Column_Position;
+      Destination_Top_Row      : Line_Position;
+      Destination_Left_Column  : Column_Position;
+      Destination_Bottom_Row   : Line_Position;
+      Destination_Right_Column : Column_Position)
    is
       function Prefresh
         (Pad                      : Window;
@@ -1497,13 +1497,13 @@
    end Refresh;
 
    procedure Refresh_Without_Update
-     (Pad                      : in Window;
-      Source_Top_Row           : in Line_Position;
-      Source_Left_Column       : in Column_Position;
-      Destination_Top_Row      : in Line_Position;
-      Destination_Left_Column  : in Column_Position;
-      Destination_Bottom_Row   : in Line_Position;
-      Destination_Right_Column : in Column_Position)
+     (Pad                      : Window;
+      Source_Top_Row           : Line_Position;
+      Source_Left_Column       : Column_Position;
+      Destination_Top_Row      : Line_Position;
+      Destination_Left_Column  : Column_Position;
+      Destination_Bottom_Row   : Line_Position;
+      Destination_Right_Column : Column_Position)
    is
       function Pnoutrefresh
         (Pad                      : Window;
@@ -1527,8 +1527,8 @@
    end Refresh_Without_Update;
 
    procedure Add_Character_To_Pad_And_Echo_It
-     (Pad : in Window;
-      Ch  : in Attributed_Character)
+     (Pad : Window;
+      Ch  : Attributed_Character)
    is
       function Pechochar (Pad : Window; Ch : C_Chtype)
                           return C_Int;
@@ -1540,8 +1540,8 @@
    end Add_Character_To_Pad_And_Echo_It;
 
    procedure Add_Character_To_Pad_And_Echo_It
-     (Pad : in Window;
-      Ch  : in Character)
+     (Pad : Window;
+      Ch  : Character)
    is
    begin
       Add_Character_To_Pad_And_Echo_It
@@ -1551,8 +1551,8 @@
                                Attr  => Normal_Video));
    end Add_Character_To_Pad_And_Echo_It;
 ------------------------------------------------------------------------------
-   procedure Scroll (Win    : in Window := Standard_Window;
-                     Amount : in Integer := 1)
+   procedure Scroll (Win    : Window := Standard_Window;
+                     Amount : Integer := 1)
    is
       function Wscrl (Win : Window; N : C_Int) return C_Int;
       pragma Import (C, Wscrl, "wscrl");
@@ -1564,7 +1564,7 @@
    end Scroll;
 
 ------------------------------------------------------------------------------
-   procedure Delete_Character (Win : in Window := Standard_Window)
+   procedure Delete_Character (Win : Window := Standard_Window)
    is
       function Wdelch (Win : Window) return C_Int;
       pragma Import (C, Wdelch, "wdelch");
@@ -1575,9 +1575,9 @@
    end Delete_Character;
 
    procedure Delete_Character
-     (Win    : in Window := Standard_Window;
-      Line   : in Line_Position;
-      Column : in Column_Position)
+     (Win    : Window := Standard_Window;
+      Line   : Line_Position;
+      Column : Column_Position)
    is
       function Mvwdelch (Win : Window;
                          Lin : C_Int;
@@ -1611,8 +1611,8 @@
       return Chtype_To_AttrChar (Mvwinch (Win, C_Int (Line), C_Int (Column)));
    end Peek;
 ------------------------------------------------------------------------------
-   procedure Insert (Win : in Window := Standard_Window;
-                     Ch  : in Attributed_Character)
+   procedure Insert (Win : Window := Standard_Window;
+                     Ch  : Attributed_Character)
    is
       function Winsch (Win : Window; Ch : C_Chtype) return C_Int;
       pragma Import (C, Winsch, "winsch");
@@ -1623,10 +1623,10 @@
    end Insert;
 
    procedure Insert
-     (Win    : in Window := Standard_Window;
-      Line   : in Line_Position;
-      Column : in Column_Position;
-      Ch     : in Attributed_Character)
+     (Win    : Window := Standard_Window;
+      Line   : Line_Position;
+      Column : Column_Position;
+      Ch     : Attributed_Character)
    is
       function Mvwinsch (Win : Window;
                          Lin : C_Int;
@@ -1642,9 +1642,9 @@
       end if;
    end Insert;
 ------------------------------------------------------------------------------
-   procedure Insert (Win : in Window := Standard_Window;
-                     Str : in String;
-                     Len : in Integer := -1)
+   procedure Insert (Win : Window := Standard_Window;
+                     Str : String;
+                     Len : Integer := -1)
    is
       function Winsnstr (Win : Window;
                          Str : char_array;
@@ -1661,11 +1661,11 @@
    end Insert;
 
    procedure Insert
-     (Win    : in Window := Standard_Window;
-      Line   : in Line_Position;
-      Column : in Column_Position;
-      Str    : in String;
-      Len    : in Integer := -1)
+     (Win    : Window := Standard_Window;
+      Line   : Line_Position;
+      Column : Column_Position;
+      Str    : String;
+      Len    : Integer := -1)
    is
       function Mvwinsnstr (Win    : Window;
                            Line   : C_Int;
@@ -1684,9 +1684,9 @@
       end if;
    end Insert;
 ------------------------------------------------------------------------------
-   procedure Peek (Win : in  Window := Standard_Window;
+   procedure Peek (Win :  Window := Standard_Window;
                    Str : out String;
-                   Len : in  Integer := -1)
+                   Len :  Integer := -1)
    is
       function Winnstr (Win : Window;
                         Str : char_array;
@@ -1714,11 +1714,11 @@
    end Peek;
 
    procedure Peek
-     (Win    : in  Window := Standard_Window;
-      Line   : in  Line_Position;
-      Column : in  Column_Position;
+     (Win    :  Window := Standard_Window;
+      Line   :  Line_Position;
+      Column :  Column_Position;
       Str    : out String;
-      Len    : in  Integer := -1)
+      Len    :  Integer := -1)
    is
    begin
       Move_Cursor (Win, Line, Column);
@@ -1726,9 +1726,9 @@
    end Peek;
 ------------------------------------------------------------------------------
    procedure Peek
-     (Win : in  Window := Standard_Window;
+     (Win :  Window := Standard_Window;
       Str : out Attributed_String;
-      Len : in  Integer := -1)
+      Len :  Integer := -1)
    is
       function Winchnstr (Win : Window;
                           Str : chtype_array;             -- out
@@ -1763,20 +1763,20 @@
    end Peek;
 
    procedure Peek
-     (Win    : in  Window := Standard_Window;
-      Line   : in  Line_Position;
-      Column : in  Column_Position;
+     (Win    :  Window := Standard_Window;
+      Line   :  Line_Position;
+      Column :  Column_Position;
       Str    : out Attributed_String;
-      Len    : in Integer := -1)
+      Len    : Integer := -1)
    is
    begin
       Move_Cursor (Win, Line, Column);
       Peek (Win, Str, Len);
    end Peek;
 ------------------------------------------------------------------------------
-   procedure Get (Win : in  Window := Standard_Window;
+   procedure Get (Win :  Window := Standard_Window;
                   Str : out String;
-                  Len : in  Integer := -1)
+                  Len :  Integer := -1)
    is
       function Wgetnstr (Win : Window;
                          Str : char_array;
@@ -1804,11 +1804,11 @@
    end Get;
 
    procedure Get
-     (Win    : in  Window := Standard_Window;
-      Line   : in  Line_Position;
-      Column : in  Column_Position;
+     (Win    :  Window := Standard_Window;
+      Line   :  Line_Position;
+      Column :  Column_Position;
       Str    : out String;
-      Len    : in  Integer := -1)
+      Len    :  Integer := -1)
    is
    begin
       Move_Cursor (Win, Line, Column);
@@ -1816,7 +1816,7 @@
    end Get;
 ------------------------------------------------------------------------------
    procedure Init_Soft_Label_Keys
-     (Format : in Soft_Label_Key_Format := Three_Two_Three)
+     (Format : Soft_Label_Key_Format := Three_Two_Three)
    is
       function Slk_Init (Fmt : C_Int) return C_Int;
       pragma Import (C, Slk_Init, "slk_init");
@@ -1826,9 +1826,9 @@
       end if;
    end Init_Soft_Label_Keys;
 
-   procedure Set_Soft_Label_Key (Label : in Label_Number;
-                                 Text  : in String;
-                                 Fmt   : in Label_Justification := Left)
+   procedure Set_Soft_Label_Key (Label : Label_Number;
+                                 Text  : String;
+                                 Fmt   : Label_Justification := Left)
    is
       function Slk_Set (Label : C_Int;
                         Txt   : char_array;
@@ -1865,7 +1865,7 @@
       end if;
    end Refresh_Soft_Label_Keys_Without_Update;
 
-   procedure Get_Soft_Label_Key (Label : in Label_Number;
+   procedure Get_Soft_Label_Key (Label : Label_Number;
                                  Text  : out String)
    is
       function Slk_Label (Label : C_Int) return chars_ptr;
@@ -1874,7 +1874,7 @@
       Fill_String (Slk_Label (C_Int (Label)), Text);
    end Get_Soft_Label_Key;
 
-   function Get_Soft_Label_Key (Label : in Label_Number) return String
+   function Get_Soft_Label_Key (Label : Label_Number) return String
    is
       function Slk_Label (Label : C_Int) return chars_ptr;
       pragma Import (C, Slk_Label, "slk_label");
@@ -1913,8 +1913,8 @@
    end Touch_Soft_Label_Keys;
 
    procedure Switch_Soft_Label_Key_Attributes
-     (Attr : in Character_Attribute_Set;
-      On   : in Boolean := True)
+     (Attr : Character_Attribute_Set;
+      On   : Boolean := True)
    is
       function Slk_Attron (Ch : C_Chtype) return C_Int;
       pragma Import (C, Slk_Attron, "slk_attron");
@@ -1937,8 +1937,8 @@
    end Switch_Soft_Label_Key_Attributes;
 
    procedure Set_Soft_Label_Key_Attributes
-     (Attr  : in Character_Attribute_Set := Normal_Video;
-      Color : in Color_Pair := Color_Pair'First)
+     (Attr  : Character_Attribute_Set := Normal_Video;
+      Color : Color_Pair := Color_Pair'First)
    is
       function Slk_Attrset (Ch : C_Chtype) return C_Int;
       pragma Import (C, Slk_Attrset, "slk_attrset");
@@ -1972,9 +1972,9 @@
       return Chtype_To_AttrChar (Attr).Color;
    end Get_Soft_Label_Key_Attributes;
 
-   procedure Set_Soft_Label_Key_Color (Pair : in Color_Pair)
+   procedure Set_Soft_Label_Key_Color (Pair : Color_Pair)
    is
-      function Slk_Color (Color : in C_Short) return C_Int;
+      function Slk_Color (Color : C_Short) return C_Int;
       pragma Import (C, Slk_Color, "slk_color");
    begin
       if Slk_Color (C_Short (Pair)) = Curses_Err then
@@ -1983,8 +1983,8 @@
    end Set_Soft_Label_Key_Color;
 
 ------------------------------------------------------------------------------
-   procedure Enable_Key (Key    : in Special_Key_Code;
-                         Enable : in Boolean := True)
+   procedure Enable_Key (Key    : Special_Key_Code;
+                         Enable : Boolean := True)
    is
       function Keyok (Keycode : C_Int;
                       On_Off  : Curses_Bool) return C_Int;
@@ -1996,8 +1996,8 @@
       end if;
    end Enable_Key;
 ------------------------------------------------------------------------------
-   procedure Define_Key (Definition : in String;
-                         Key        : in Special_Key_Code)
+   procedure Define_Key (Definition : String;
+                         Key        : Special_Key_Code)
    is
       function Defkey (Def : char_array;
                        Key : C_Int) return C_Int;
@@ -2012,7 +2012,7 @@
       end if;
    end Define_Key;
 ------------------------------------------------------------------------------
-   procedure Un_Control (Ch  : in Attributed_Character;
+   procedure Un_Control (Ch  : Attributed_Character;
                          Str : out String)
    is
       function Unctrl (Ch : C_Chtype) return chars_ptr;
@@ -2021,7 +2021,7 @@
       Fill_String (Unctrl (AttrChar_To_Chtype (Ch)), Str);
    end Un_Control;
 
-   function Un_Control (Ch : in Attributed_Character) return String
+   function Un_Control (Ch : Attributed_Character) return String
    is
       function Unctrl (Ch : C_Chtype) return chars_ptr;
       pragma Import (C, Unctrl, "unctrl");
@@ -2029,7 +2029,7 @@
       return Fill_String (Unctrl (AttrChar_To_Chtype (Ch)));
    end Un_Control;
 
-   procedure Delay_Output (Msecs : in Natural)
+   procedure Delay_Output (Msecs : Natural)
    is
       function Delayoutput (Msecs : C_Int) return C_Int;
       pragma Import (C, Delayoutput, "delay_output");
@@ -2139,9 +2139,9 @@
       return Fill_String (Termname);
    end Terminal_Name;
 ------------------------------------------------------------------------------
-   procedure Init_Pair (Pair : in Redefinable_Color_Pair;
-                        Fore : in Color_Number;
-                        Back : in Color_Number)
+   procedure Init_Pair (Pair : Redefinable_Color_Pair;
+                        Fore : Color_Number;
+                        Back : Color_Number)
    is
       function Initpair (Pair : C_Short;
                          Fore : C_Short;
@@ -2161,7 +2161,7 @@
       end if;
    end Init_Pair;
 
-   procedure Pair_Content (Pair : in Color_Pair;
+   procedure Pair_Content (Pair : Color_Pair;
                            Fore : out Color_Number;
                            Back : out Color_Number)
    is
@@ -2193,10 +2193,10 @@
       end if;
    end Has_Colors;
 
-   procedure Init_Color (Color : in Color_Number;
-                         Red   : in RGB_Value;
-                         Green : in RGB_Value;
-                         Blue  : in RGB_Value)
+   procedure Init_Color (Color : Color_Number;
+                         Red   : RGB_Value;
+                         Green : RGB_Value;
+                         Blue  : RGB_Value)
    is
       function Initcolor (Col   : C_Short;
                           Red   : C_Short;
@@ -2222,7 +2222,7 @@
       end if;
    end Can_Change_Color;
 
-   procedure Color_Content (Color : in  Color_Number;
+   procedure Color_Content (Color :  Color_Number;
                             Red   : out RGB_Value;
                             Green : out RGB_Value;
                             Blue  : out RGB_Value)
@@ -2246,7 +2246,7 @@
    end Color_Content;
 
 ------------------------------------------------------------------------------
-   procedure Save_Curses_Mode (Mode : in Curses_Mode)
+   procedure Save_Curses_Mode (Mode : Curses_Mode)
    is
       function Def_Prog_Mode return C_Int;
       pragma Import (C, Def_Prog_Mode, "def_prog_mode");
@@ -2264,7 +2264,7 @@
       end if;
    end Save_Curses_Mode;
 
-   procedure Reset_Curses_Mode (Mode : in Curses_Mode)
+   procedure Reset_Curses_Mode (Mode : Curses_Mode)
    is
       function Reset_Prog_Mode return C_Int;
       pragma Import (C, Reset_Prog_Mode, "reset_prog_mode");
@@ -2302,8 +2302,8 @@
       end if;
    end Reset_Terminal_State;
 
-   procedure Rip_Off_Lines (Lines : in Integer;
-                            Proc  : in Stdscr_Init_Proc)
+   procedure Rip_Off_Lines (Lines : Integer;
+                            Proc  : Stdscr_Init_Proc)
    is
       function Ripoffline (Lines : C_Int;
                            Proc  : Stdscr_Init_Proc) return C_Int;
@@ -2327,7 +2327,7 @@
       end if;
    end Set_Cursor_Visibility;
 
-   procedure Nap_Milli_Seconds (Ms : in Natural)
+   procedure Nap_Milli_Seconds (Ms : Natural)
    is
       function Napms (Ms : C_Int) return C_Int;
       pragma Import (C, Napms, "napms");
@@ -2340,10 +2340,10 @@
 include(`Public_Variables')
 ------------------------------------------------------------------------------
    procedure Transform_Coordinates
-     (W      : in Window := Standard_Window;
+     (W      : Window := Standard_Window;
       Line   : in out Line_Position;
       Column : in out Column_Position;
-      Dir    : in Transform_Direction := From_Screen)
+      Dir    : Transform_Direction := From_Screen)
    is
       type Int_Access is access all C_Int;
       function Transform (W    : Window;
@@ -2431,7 +2431,7 @@
       end if;
    end Use_Extended_Names;
 ------------------------------------------------------------------------------
-   procedure Screen_Dump_To_File (Filename : in String)
+   procedure Screen_Dump_To_File (Filename : String)
    is
       function scr_dump (f : char_array) return C_Int;
       pragma Import (C, scr_dump, "scr_dump");
@@ -2444,7 +2444,7 @@
       end if;
    end Screen_Dump_To_File;
 
-   procedure Screen_Restore_From_File (Filename : in String)
+   procedure Screen_Restore_From_File (Filename : String)
    is
       function scr_restore (f : char_array) return C_Int;
       pragma Import (C, scr_restore, "scr_restore");
@@ -2457,7 +2457,7 @@
       end if;
    end Screen_Restore_From_File;
 
-   procedure Screen_Init_From_File (Filename : in String)
+   procedure Screen_Init_From_File (Filename : String)
    is
       function scr_init (f : char_array) return C_Int;
       pragma Import (C, scr_init, "scr_init");
@@ -2470,7 +2470,7 @@
       end if;
    end Screen_Init_From_File;
 
-   procedure Screen_Set_File (Filename : in String)
+   procedure Screen_Set_File (Filename : String)
    is
       function scr_set (f : char_array) return C_Int;
       pragma Import (C, scr_set, "scr_set");
diff -Naur ncurses-5.7.orig/Ada95/gen/terminal_interface-curses.ads.m4 ncurses-5.7/Ada95/gen/terminal_interface-curses.ads.m4
--- ncurses-5.7.orig/Ada95/gen/terminal_interface-curses.ads.m4	2007-05-05 16:33:52.000000000 -0400
+++ ncurses-5.7/Ada95/gen/terminal_interface-curses.ads.m4	2011-01-08 18:13:50.299156775 -0500
@@ -9,7 +9,7 @@
 --                                 S P E C                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998-2006,2007 Free Software Foundation, Inc.              --
+-- Copyright (c) 1998-2007,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -37,8 +37,8 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control:
---  $Revision: 1.41 $
---  $Date: 2007/05/05 20:33:52 $
+--  $Revision: 1.42 $
+--  $Date: 2009/12/26 17:38:58 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 include(`Base_Defs')
@@ -227,9 +227,9 @@
    --  MANPAGE(`curs_move.3x')
 
    --  ANCHOR(`wmove()',`Move_Cursor')
-   procedure Move_Cursor (Win    : in Window := Standard_Window;
-                          Line   : in Line_Position;
-                          Column : in Column_Position);
+   procedure Move_Cursor (Win    : Window := Standard_Window;
+                          Line   : Line_Position;
+                          Column : Column_Position);
    --  AKA
    --  ALIAS(`move()')
    pragma Inline (Move_Cursor);
@@ -237,43 +237,43 @@
    --  MANPAGE(`curs_addch.3x')
 
    --  ANCHOR(`waddch()',`Add')
-   procedure Add (Win :  in Window := Standard_Window;
-                  Ch  :  in Attributed_Character);
+   procedure Add (Win : Window := Standard_Window;
+                  Ch  : Attributed_Character);
    --  AKA
    --  ALIAS(`addch()')
 
-   procedure Add (Win :  in Window := Standard_Window;
-                  Ch  :  in Character);
+   procedure Add (Win : Window := Standard_Window;
+                  Ch  : Character);
    --  Add a single character at the current logical cursor position to
    --  the window. Use the current windows attributes.
 
    --  ANCHOR(`mvwaddch()',`Add')
    procedure Add
-     (Win    : in Window := Standard_Window;
-      Line   : in Line_Position;
-      Column : in Column_Position;
-      Ch     : in Attributed_Character);
+     (Win    : Window := Standard_Window;
+      Line   : Line_Position;
+      Column : Column_Position;
+      Ch     : Attributed_Character);
    --  AKA
    --  ALIAS(`mvaddch()')
 
    procedure Add
-     (Win    : in Window := Standard_Window;
-      Line   : in Line_Position;
-      Column : in Column_Position;
-      Ch     : in Character);
+     (Win    : Window := Standard_Window;
+      Line   : Line_Position;
+      Column : Column_Position;
+      Ch     : Character);
    --  Move to the position and add a single character into the window
    --  There are more Add routines, so the Inline pragma follows later
 
    --  ANCHOR(`wechochar()',`Add_With_Immediate_Echo')
    procedure Add_With_Immediate_Echo
-     (Win : in Window := Standard_Window;
-      Ch  : in Attributed_Character);
+     (Win : Window := Standard_Window;
+      Ch  : Attributed_Character);
    --  AKA
    --  ALIAS(`echochar()')
 
    procedure Add_With_Immediate_Echo
-     (Win : in Window := Standard_Window;
-      Ch  : in Character);
+     (Win : Window := Standard_Window;
+      Ch  : Character);
    --  Add a character and do an immediate refresh of the screen.
    pragma Inline (Add_With_Immediate_Echo);
 
@@ -331,52 +331,52 @@
    pragma Inline (Duplicate);
 
    --  ANCHOR(`mvwin()',`Move_Window')
-   procedure Move_Window (Win    : in Window;
-                          Line   : in Line_Position;
-                          Column : in Column_Position);
+   procedure Move_Window (Win    : Window;
+                          Line   : Line_Position;
+                          Column : Column_Position);
    --  AKA
    pragma Inline (Move_Window);
 
    --  ANCHOR(`mvderwin()',`Move_Derived_Window')
-   procedure Move_Derived_Window (Win    : in Window;
-                                  Line   : in Line_Position;
-                                  Column : in Column_Position);
+   procedure Move_Derived_Window (Win    : Window;
+                                  Line   : Line_Position;
+                                  Column : Column_Position);
    --  AKA
    pragma Inline (Move_Derived_Window);
 
    --  ANCHOR(`wsyncup()',`Synchronize_Upwards')
-   procedure Synchronize_Upwards (Win : in Window);
+   procedure Synchronize_Upwards (Win : Window);
    --  AKA
    pragma Import (C, Synchronize_Upwards, "wsyncup");
 
    --  ANCHOR(`wsyncdown()',`Synchronize_Downwards')
-   procedure Synchronize_Downwards (Win : in Window);
+   procedure Synchronize_Downwards (Win : Window);
    --  AKA
    pragma Import (C, Synchronize_Downwards, "wsyncdown");
 
    --  ANCHOR(`syncok()',`Set_Synch_Mode')
-   procedure Set_Synch_Mode (Win  : in Window := Standard_Window;
-                             Mode : in Boolean := False);
+   procedure Set_Synch_Mode (Win  : Window := Standard_Window;
+                             Mode : Boolean := False);
    --  AKA
    pragma Inline (Set_Synch_Mode);
 
    --  MANPAGE(`curs_addstr.3x')
 
    --  ANCHOR(`waddnstr()',`Add')
-   procedure Add (Win : in Window := Standard_Window;
-                  Str : in String;
-                  Len : in Integer := -1);
+   procedure Add (Win : Window := Standard_Window;
+                  Str : String;
+                  Len : Integer := -1);
    --  AKA
    --  ALIAS(`waddstr()')
    --  ALIAS(`addnstr()')
    --  ALIAS(`addstr()')
 
    --  ANCHOR(`mvwaddnstr()',`Add')
-   procedure Add (Win    : in Window := Standard_Window;
-                  Line   : in Line_Position;
-                  Column : in Column_Position;
-                  Str    : in String;
-                  Len    : in Integer := -1);
+   procedure Add (Win    : Window := Standard_Window;
+                  Line   : Line_Position;
+                  Column : Column_Position;
+                  Str    : String;
+                  Len    : Integer := -1);
    --  AKA
    --  ALIAS(`mvwaddstr()')
    --  ALIAS(`mvaddnstr()')
@@ -385,20 +385,20 @@
    --  MANPAGE(`curs_addchstr.3x')
 
    --  ANCHOR(`waddchnstr()',`Add')
-   procedure Add (Win : in Window := Standard_Window;
-                  Str : in Attributed_String;
-                  Len : in Integer := -1);
+   procedure Add (Win : Window := Standard_Window;
+                  Str : Attributed_String;
+                  Len : Integer := -1);
    --  AKA
    --  ALIAS(`waddchstr()')
    --  ALIAS(`addchnstr()')
    --  ALIAS(`addchstr()')
 
    --  ANCHOR(`mvwaddchnstr()',`Add')
-   procedure Add (Win    : in Window := Standard_Window;
-                  Line   : in Line_Position;
-                  Column : in Column_Position;
-                  Str    : in Attributed_String;
-                  Len    : in Integer := -1);
+   procedure Add (Win    : Window := Standard_Window;
+                  Line   : Line_Position;
+                  Column : Column_Position;
+                  Str    : Attributed_String;
+                  Len    : Integer := -1);
    --  AKA
    --  ALIAS(`mvwaddchstr()')
    --  ALIAS(`mvaddchnstr()')
@@ -411,15 +411,15 @@
 
    --  ANCHOR(`wborder()',`Border')
    procedure Border
-     (Win                       : in Window := Standard_Window;
-      Left_Side_Symbol          : in Attributed_Character := Default_Character;
-      Right_Side_Symbol         : in Attributed_Character := Default_Character;
-      Top_Side_Symbol           : in Attributed_Character := Default_Character;
-      Bottom_Side_Symbol        : in Attributed_Character := Default_Character;
-      Upper_Left_Corner_Symbol  : in Attributed_Character := Default_Character;
-      Upper_Right_Corner_Symbol : in Attributed_Character := Default_Character;
-      Lower_Left_Corner_Symbol  : in Attributed_Character := Default_Character;
-      Lower_Right_Corner_Symbol : in Attributed_Character := Default_Character
+     (Win                       : Window := Standard_Window;
+      Left_Side_Symbol          : Attributed_Character := Default_Character;
+      Right_Side_Symbol         : Attributed_Character := Default_Character;
+      Top_Side_Symbol           : Attributed_Character := Default_Character;
+      Bottom_Side_Symbol        : Attributed_Character := Default_Character;
+      Upper_Left_Corner_Symbol  : Attributed_Character := Default_Character;
+      Upper_Right_Corner_Symbol : Attributed_Character := Default_Character;
+      Lower_Left_Corner_Symbol  : Attributed_Character := Default_Character;
+      Lower_Right_Corner_Symbol : Attributed_Character := Default_Character
      );
    --  AKA
    --  ALIAS(`border()')
@@ -427,26 +427,26 @@
 
    --  ANCHOR(`box()',`Box')
    procedure Box
-     (Win               : in Window := Standard_Window;
-      Vertical_Symbol   : in Attributed_Character := Default_Character;
-      Horizontal_Symbol : in Attributed_Character := Default_Character);
+     (Win               : Window := Standard_Window;
+      Vertical_Symbol   : Attributed_Character := Default_Character;
+      Horizontal_Symbol : Attributed_Character := Default_Character);
    --  AKA
    pragma Inline (Box);
 
    --  ANCHOR(`whline()',`Horizontal_Line')
    procedure Horizontal_Line
-     (Win         : in Window := Standard_Window;
-      Line_Size   : in Natural;
-      Line_Symbol : in Attributed_Character := Default_Character);
+     (Win         : Window := Standard_Window;
+      Line_Size   : Natural;
+      Line_Symbol : Attributed_Character := Default_Character);
    --  AKA
    --  ALIAS(`hline()')
    pragma Inline (Horizontal_Line);
 
    --  ANCHOR(`wvline()',`Vertical_Line')
    procedure Vertical_Line
-     (Win         : in Window := Standard_Window;
-      Line_Size   : in Natural;
-      Line_Symbol : in Attributed_Character := Default_Character);
+     (Win         : Window := Standard_Window;
+      Line_Size   : Natural;
+      Line_Symbol : Attributed_Character := Default_Character);
    --  AKA
    --  ALIAS(`vline()')
    pragma Inline (Vertical_Line);
@@ -466,7 +466,7 @@
    pragma Inline (Get_Keystroke);
 
    --  ANCHOR(`ungetch()',`Undo_Keystroke')
-   procedure Undo_Keystroke (Key : in Real_Key_Code);
+   procedure Undo_Keystroke (Key : Real_Key_Code);
    --  AKA
    pragma Inline (Undo_Keystroke);
 
@@ -509,9 +509,9 @@
 
    --  ANCHOR(`wattron()',`Switch_Character_Attribute')
    procedure Switch_Character_Attribute
-     (Win  : in Window := Standard_Window;
-      Attr : in Character_Attribute_Set := Normal_Video;
-      On   : in Boolean := True); --  if False we switch Off.
+     (Win  : Window := Standard_Window;
+      Attr : Character_Attribute_Set := Normal_Video;
+      On   : Boolean := True); --  if False we switch Off.
    --  Switches those Attributes set to true in the list.
    --  AKA
    --  ALIAS(`wattroff()')
@@ -520,49 +520,49 @@
 
    --  ANCHOR(`wattrset()',`Set_Character_Attributes')
    procedure Set_Character_Attributes
-     (Win   : in Window := Standard_Window;
-      Attr  : in Character_Attribute_Set := Normal_Video;
-      Color : in Color_Pair := Color_Pair'First);
+     (Win   : Window := Standard_Window;
+      Attr  : Character_Attribute_Set := Normal_Video;
+      Color : Color_Pair := Color_Pair'First);
    --  AKA
    --  ALIAS(`attrset()')
    pragma Inline (Set_Character_Attributes);
 
    --  ANCHOR(`wattr_get()',`Get_Character_Attributes')
    function Get_Character_Attribute
-     (Win : in Window := Standard_Window) return Character_Attribute_Set;
+     (Win : Window := Standard_Window) return Character_Attribute_Set;
    --  AKA
    --  ALIAS(`attr_get()')
 
    --  ANCHOR(`wattr_get()',`Get_Character_Attribute')
    function Get_Character_Attribute
-     (Win : in Window := Standard_Window) return Color_Pair;
+     (Win : Window := Standard_Window) return Color_Pair;
    --  AKA
    pragma Inline (Get_Character_Attribute);
 
    --  ANCHOR(`wcolor_set()',`Set_Color')
-   procedure Set_Color (Win  : in Window := Standard_Window;
-                        Pair : in Color_Pair);
+   procedure Set_Color (Win  : Window := Standard_Window;
+                        Pair : Color_Pair);
    --  AKA
    --  ALIAS(`color_set()')
    pragma Inline (Set_Color);
 
    --  ANCHOR(`wchgat()',`Change_Attributes')
    procedure Change_Attributes
-     (Win   : in Window := Standard_Window;
-      Count : in Integer := -1;
-      Attr  : in Character_Attribute_Set := Normal_Video;
-      Color : in Color_Pair := Color_Pair'First);
+     (Win   : Window := Standard_Window;
+      Count : Integer := -1;
+      Attr  : Character_Attribute_Set := Normal_Video;
+      Color : Color_Pair := Color_Pair'First);
    --  AKA
    --  ALIAS(`chgat()')
 
    --  ANCHOR(`mvwchgat()',`Change_Attributes')
    procedure Change_Attributes
-     (Win    : in Window := Standard_Window;
-      Line   : in Line_Position := Line_Position'First;
-      Column : in Column_Position := Column_Position'First;
-      Count  : in Integer := -1;
-      Attr   : in Character_Attribute_Set := Normal_Video;
-      Color  : in Color_Pair := Color_Pair'First);
+     (Win    : Window := Standard_Window;
+      Line   : Line_Position := Line_Position'First;
+      Column : Column_Position := Column_Position'First;
+      Count  : Integer := -1;
+      Attr   : Character_Attribute_Set := Normal_Video;
+      Color  : Color_Pair := Color_Pair'First);
    --  AKA
    --  ALIAS(`mvchgat()')
    pragma Inline (Change_Attributes);
@@ -584,36 +584,36 @@
    --  | Not implemented : typeahead
    --
    --  ANCHOR(`cbreak()',`Set_Cbreak_Mode')
-   procedure Set_Cbreak_Mode (SwitchOn : in Boolean := True);
+   procedure Set_Cbreak_Mode (SwitchOn : Boolean := True);
    --  AKA
    --  ALIAS(`nocbreak()')
    pragma Inline (Set_Cbreak_Mode);
 
    --  ANCHOR(`raw()',`Set_Raw_Mode')
-   procedure Set_Raw_Mode (SwitchOn : in Boolean := True);
+   procedure Set_Raw_Mode (SwitchOn : Boolean := True);
    --  AKA
    --  ALIAS(`noraw()')
    pragma Inline (Set_Raw_Mode);
 
    --  ANCHOR(`echo()',`Set_Echo_Mode')
-   procedure Set_Echo_Mode (SwitchOn : in Boolean := True);
+   procedure Set_Echo_Mode (SwitchOn : Boolean := True);
    --  AKA
    --  ALIAS(`noecho()')
    pragma Inline (Set_Echo_Mode);
 
    --  ANCHOR(`meta()',`Set_Meta_Mode')
-   procedure Set_Meta_Mode (Win      : in Window := Standard_Window;
-                            SwitchOn : in Boolean := True);
+   procedure Set_Meta_Mode (Win      : Window := Standard_Window;
+                            SwitchOn : Boolean := True);
    --  AKA
    pragma Inline (Set_Meta_Mode);
 
    --  ANCHOR(`keypad()',`Set_KeyPad_Mode')
-   procedure Set_KeyPad_Mode (Win      : in Window := Standard_Window;
-                              SwitchOn : in Boolean := True);
+   procedure Set_KeyPad_Mode (Win      : Window := Standard_Window;
+                              SwitchOn : Boolean := True);
    --  AKA
    pragma Inline (Set_KeyPad_Mode);
 
-   function Get_KeyPad_Mode (Win : in Window := Standard_Window)
+   function Get_KeyPad_Mode (Win : Window := Standard_Window)
                              return Boolean;
    --  This has no pendant in C. There you've to look into the WINDOWS
    --  structure to get the value. Bad practice, not repeated in Ada.
@@ -621,38 +621,38 @@
    type Half_Delay_Amount is range 1 .. 255;
 
    --  ANCHOR(`halfdelay()',`Half_Delay')
-   procedure Half_Delay (Amount : in Half_Delay_Amount);
+   procedure Half_Delay (Amount : Half_Delay_Amount);
    --  AKA
    pragma Inline (Half_Delay);
 
    --  ANCHOR(`intrflush()',`Set_Flush_On_Interrupt_Mode')
    procedure Set_Flush_On_Interrupt_Mode
-     (Win  : in Window := Standard_Window;
-      Mode : in Boolean := True);
+     (Win  : Window := Standard_Window;
+      Mode : Boolean := True);
    --  AKA
    pragma Inline (Set_Flush_On_Interrupt_Mode);
 
    --  ANCHOR(`qiflush()',`Set_Queue_Interrupt_Mode')
    procedure Set_Queue_Interrupt_Mode
-     (Win   : in Window := Standard_Window;
-      Flush : in Boolean := True);
+     (Win   : Window := Standard_Window;
+      Flush : Boolean := True);
    --  AKA
    --  ALIAS(`noqiflush()')
    pragma Inline (Set_Queue_Interrupt_Mode);
 
    --  ANCHOR(`nodelay()',`Set_NoDelay_Mode')
    procedure Set_NoDelay_Mode
-     (Win  : in Window := Standard_Window;
-      Mode : in Boolean := False);
+     (Win  : Window := Standard_Window;
+      Mode : Boolean := False);
    --  AKA
    pragma Inline (Set_NoDelay_Mode);
 
    type Timeout_Mode is (Blocking, Non_Blocking, Delayed);
 
    --  ANCHOR(`wtimeout()',`Set_Timeout_Mode')
-   procedure Set_Timeout_Mode (Win    : in Window := Standard_Window;
-                               Mode   : in Timeout_Mode;
-                               Amount : in Natural); --  in Milliseconds
+   procedure Set_Timeout_Mode (Win    : Window := Standard_Window;
+                               Mode   : Timeout_Mode;
+                               Amount : Natural); --  in Milliseconds
    --  AKA
    --  ALIAS(`timeout()')
    --  Instead of overloading the semantic of the sign of amount, we
@@ -663,58 +663,58 @@
 
    --  ANCHOR(`notimeout()',`Set_Escape_Time_Mode')
    procedure Set_Escape_Timer_Mode
-     (Win       : in Window := Standard_Window;
-      Timer_Off : in Boolean := False);
+     (Win       : Window := Standard_Window;
+      Timer_Off : Boolean := False);
    --  AKA
    pragma Inline (Set_Escape_Timer_Mode);
 
    --  MANPAGE(`curs_outopts.3x')
 
    --  ANCHOR(`nl()',`Set_NL_Mode')
-   procedure Set_NL_Mode (SwitchOn : in Boolean := True);
+   procedure Set_NL_Mode (SwitchOn : Boolean := True);
    --  AKA
    --  ALIAS(`nonl()')
    pragma Inline (Set_NL_Mode);
 
    --  ANCHOR(`clearok()',`Clear_On_Next_Update')
    procedure Clear_On_Next_Update
-     (Win      : in Window := Standard_Window;
-      Do_Clear : in Boolean := True);
+     (Win      : Window := Standard_Window;
+      Do_Clear : Boolean := True);
    --  AKA
    pragma Inline (Clear_On_Next_Update);
 
    --  ANCHOR(`idlok()',`Use_Insert_Delete_Line')
    procedure Use_Insert_Delete_Line
-     (Win    : in Window := Standard_Window;
-      Do_Idl : in Boolean := True);
+     (Win    : Window := Standard_Window;
+      Do_Idl : Boolean := True);
    --  AKA
    pragma Inline (Use_Insert_Delete_Line);
 
    --  ANCHOR(`idcok()',`Use_Insert_Delete_Character')
    procedure Use_Insert_Delete_Character
-     (Win    : in Window := Standard_Window;
-      Do_Idc : in Boolean := True);
+     (Win    : Window := Standard_Window;
+      Do_Idc : Boolean := True);
    --  AKA
    pragma Inline (Use_Insert_Delete_Character);
 
    --  ANCHOR(`leaveok()',`Leave_Cursor_After_Update')
    procedure Leave_Cursor_After_Update
-     (Win      : in Window := Standard_Window;
-      Do_Leave : in Boolean := True);
+     (Win      : Window := Standard_Window;
+      Do_Leave : Boolean := True);
    --  AKA
    pragma Inline (Leave_Cursor_After_Update);
 
    --  ANCHOR(`immedok()',`Immediate_Update_Mode')
    procedure Immediate_Update_Mode
-     (Win  : in Window := Standard_Window;
-      Mode : in Boolean := False);
+     (Win  : Window := Standard_Window;
+      Mode : Boolean := False);
    --  AKA
    pragma Inline (Immediate_Update_Mode);
 
    --  ANCHOR(`scrollok()',`Allow_Scrolling')
    procedure Allow_Scrolling
-     (Win  : in Window := Standard_Window;
-      Mode : in Boolean := False);
+     (Win  : Window := Standard_Window;
+      Mode : Boolean := False);
    --  AKA
    pragma Inline (Allow_Scrolling);
 
@@ -724,9 +724,9 @@
 
    --  ANCHOR(`wsetscrreg()',`Set_Scroll_Region')
    procedure Set_Scroll_Region
-     (Win         : in Window := Standard_Window;
-      Top_Line    : in Line_Position;
-      Bottom_Line : in Line_Position);
+     (Win         : Window := Standard_Window;
+      Top_Line    : Line_Position;
+      Bottom_Line : Line_Position);
    --  AKA
    --  ALIAS(`setscrreg()')
    pragma Inline (Set_Scroll_Region);
@@ -739,7 +739,7 @@
    pragma Inline (Update_Screen);
 
    --  ANCHOR(`wrefresh()',`Refresh')
-   procedure Refresh (Win : in Window := Standard_Window);
+   procedure Refresh (Win : Window := Standard_Window);
    --  AKA
    --  There is an overloaded Refresh for Pads.
    --  The Inline pragma appears there
@@ -747,47 +747,47 @@
 
    --  ANCHOR(`wnoutrefresh()',`Refresh_Without_Update')
    procedure Refresh_Without_Update
-     (Win : in Window := Standard_Window);
+     (Win : Window := Standard_Window);
    --  AKA
    --  There is an overloaded Refresh_Without_Update for Pads.
    --  The Inline pragma appears there
 
    --  ANCHOR(`redrawwin()',`Redraw')
-   procedure Redraw (Win : in Window := Standard_Window);
+   procedure Redraw (Win : Window := Standard_Window);
    --  AKA
 
    --  ANCHOR(`wredrawln()',`Redraw')
-   procedure Redraw (Win        : in Window := Standard_Window;
-                     Begin_Line : in Line_Position;
-                     Line_Count : in Positive);
+   procedure Redraw (Win        : Window := Standard_Window;
+                     Begin_Line : Line_Position;
+                     Line_Count : Positive);
    --  AKA
    pragma Inline (Redraw);
 
    --  MANPAGE(`curs_clear.3x')
 
    --  ANCHOR(`werase()',`Erase')
-   procedure Erase (Win : in Window := Standard_Window);
+   procedure Erase (Win : Window := Standard_Window);
    --  AKA
    --  ALIAS(`erase()')
    pragma Inline (Erase);
 
    --  ANCHOR(`wclear()',`Clear')
    procedure Clear
-     (Win : in Window := Standard_Window);
+     (Win : Window := Standard_Window);
    --  AKA
    --  ALIAS(`clear()')
    pragma Inline (Clear);
 
    --  ANCHOR(`wclrtobot()',`Clear_To_End_Of_Screen')
    procedure Clear_To_End_Of_Screen
-     (Win : in Window := Standard_Window);
+     (Win : Window := Standard_Window);
    --  AKA
    --  ALIAS(`clrtobot()')
    pragma Inline (Clear_To_End_Of_Screen);
 
    --  ANCHOR(`wclrtoeol()',`Clear_To_End_Of_Line')
    procedure Clear_To_End_Of_Line
-     (Win : in Window := Standard_Window);
+     (Win : Window := Standard_Window);
    --  AKA
    --  ALIAS(`clrtoeol()')
    pragma Inline (Clear_To_End_Of_Line);
@@ -799,16 +799,16 @@
    --  because in C it is common to see bkgdset(A_BOLD) or
    --  bkgdset(COLOR_PAIR(n))
    procedure Set_Background
-     (Win : in Window := Standard_Window;
-      Ch  : in Attributed_Character);
+     (Win : Window := Standard_Window;
+      Ch  : Attributed_Character);
    --  AKA
    --  ALIAS(`bkgdset()')
    pragma Inline (Set_Background);
 
    --  ANCHOR(`wbkgd()',`Change_Background')
    procedure Change_Background
-     (Win : in Window := Standard_Window;
-      Ch  : in Attributed_Character);
+     (Win : Window := Standard_Window;
+      Ch  : Attributed_Character);
    --  AKA
    --  ALIAS(`bkgd()')
    pragma Inline (Change_Background);
@@ -824,26 +824,26 @@
    --  MANPAGE(`curs_touch.3x')
 
    --  ANCHOR(`untouchwin()',`Untouch')
-   procedure Untouch (Win : in Window := Standard_Window);
+   procedure Untouch (Win : Window := Standard_Window);
    --  AKA
    pragma Inline (Untouch);
 
    --  ANCHOR(`touchwin()',`Touch')
-   procedure Touch (Win : in Window := Standard_Window);
+   procedure Touch (Win : Window := Standard_Window);
    --  AKA
 
    --  ANCHOR(`touchline()',`Touch')
-   procedure Touch (Win   : in Window := Standard_Window;
-                    Start : in Line_Position;
-                    Count : in Positive);
+   procedure Touch (Win   : Window := Standard_Window;
+                    Start : Line_Position;
+                    Count : Positive);
    --  AKA
    pragma Inline (Touch);
 
    --  ANCHOR(`wtouchln()',`Change_Line_Status')
-   procedure Change_Lines_Status (Win   : in Window := Standard_Window;
-                                  Start : in Line_Position;
-                                  Count : in Positive;
-                                  State : in Boolean);
+   procedure Change_Lines_Status (Win   : Window := Standard_Window;
+                                  Start : Line_Position;
+                                  Count : Positive;
+                                  State : Boolean);
    --  AKA
    pragma Inline (Change_Lines_Status);
 
@@ -861,27 +861,27 @@
 
    --  ANCHOR(`copywin()',`Copy')
    procedure Copy
-     (Source_Window            : in Window;
-      Destination_Window       : in Window;
-      Source_Top_Row           : in Line_Position;
-      Source_Left_Column       : in Column_Position;
-      Destination_Top_Row      : in Line_Position;
-      Destination_Left_Column  : in Column_Position;
-      Destination_Bottom_Row   : in Line_Position;
-      Destination_Right_Column : in Column_Position;
-      Non_Destructive_Mode     : in Boolean := True);
+     (Source_Window            : Window;
+      Destination_Window       : Window;
+      Source_Top_Row           : Line_Position;
+      Source_Left_Column       : Column_Position;
+      Destination_Top_Row      : Line_Position;
+      Destination_Left_Column  : Column_Position;
+      Destination_Bottom_Row   : Line_Position;
+      Destination_Right_Column : Column_Position;
+      Non_Destructive_Mode     : Boolean := True);
    --  AKA
    pragma Inline (Copy);
 
    --  ANCHOR(`overwrite()',`Overwrite')
-   procedure Overwrite (Source_Window      : in Window;
-                        Destination_Window : in Window);
+   procedure Overwrite (Source_Window      : Window;
+                        Destination_Window : Window);
    --  AKA
    pragma Inline (Overwrite);
 
    --  ANCHOR(`overlay()',`Overlay')
-   procedure Overlay (Source_Window      : in Window;
-                      Destination_Window : in Window);
+   procedure Overlay (Source_Window      : Window;
+                      Destination_Window : Window);
    --  AKA
    pragma Inline (Overlay);
 
@@ -889,20 +889,20 @@
 
    --  ANCHOR(`winsdelln()',`Insert_Delete_Lines')
    procedure Insert_Delete_Lines
-     (Win   : in Window  := Standard_Window;
-      Lines : in Integer := 1); --  default is to insert one line above
+     (Win   : Window  := Standard_Window;
+      Lines : Integer := 1); --  default is to insert one line above
    --  AKA
    --  ALIAS(`insdelln()')
    pragma Inline (Insert_Delete_Lines);
 
    --  ANCHOR(`wdeleteln()',`Delete_Line')
-   procedure Delete_Line (Win : in Window := Standard_Window);
+   procedure Delete_Line (Win : Window := Standard_Window);
    --  AKA
    --  ALIAS(`deleteln()')
    pragma Inline (Delete_Line);
 
    --  ANCHOR(`winsertln()',`Insert_Line')
-   procedure Insert_Line (Win : in Window := Standard_Window);
+   procedure Insert_Line (Win : Window := Standard_Window);
    --  AKA
    --  ALIAS(`insertln()')
    pragma Inline (Insert_Line);
@@ -911,7 +911,7 @@
 
    --  ANCHOR(`getmaxyx()',`Get_Size')
    procedure Get_Size
-     (Win               : in Window := Standard_Window;
+     (Win               : Window := Standard_Window;
       Number_Of_Lines   : out Line_Count;
       Number_Of_Columns : out Column_Count);
    --  AKA
@@ -919,7 +919,7 @@
 
    --  ANCHOR(`getbegyx()',`Get_Window_Position')
    procedure Get_Window_Position
-     (Win             : in Window := Standard_Window;
+     (Win             : Window := Standard_Window;
       Top_Left_Line   : out Line_Position;
       Top_Left_Column : out Column_Position);
    --  AKA
@@ -927,7 +927,7 @@
 
    --  ANCHOR(`getyx()',`Get_Cursor_Position')
    procedure Get_Cursor_Position
-     (Win    : in  Window := Standard_Window;
+     (Win    : Window := Standard_Window;
       Line   : out Line_Position;
       Column : out Column_Position);
    --  AKA
@@ -935,7 +935,7 @@
 
    --  ANCHOR(`getparyx()',`Get_Origin_Relative_To_Parent')
    procedure Get_Origin_Relative_To_Parent
-     (Win                : in  Window;
+     (Win                : Window;
       Top_Left_Line      : out Line_Position;
       Top_Left_Column    : out Column_Position;
       Is_Not_A_Subwindow : out Boolean);
@@ -964,44 +964,44 @@
 
    --  ANCHOR(`prefresh()',`Refresh')
    procedure Refresh
-     (Pad                      : in Window;
-      Source_Top_Row           : in Line_Position;
-      Source_Left_Column       : in Column_Position;
-      Destination_Top_Row      : in Line_Position;
-      Destination_Left_Column  : in Column_Position;
-      Destination_Bottom_Row   : in Line_Position;
-      Destination_Right_Column : in Column_Position);
+     (Pad                      : Window;
+      Source_Top_Row           : Line_Position;
+      Source_Left_Column       : Column_Position;
+      Destination_Top_Row      : Line_Position;
+      Destination_Left_Column  : Column_Position;
+      Destination_Bottom_Row   : Line_Position;
+      Destination_Right_Column : Column_Position);
    --  AKA
    pragma Inline (Refresh);
 
    --  ANCHOR(`pnoutrefresh()',`Refresh_Without_Update')
    procedure Refresh_Without_Update
-     (Pad                      : in Window;
-      Source_Top_Row           : in Line_Position;
-      Source_Left_Column       : in Column_Position;
-      Destination_Top_Row      : in Line_Position;
-      Destination_Left_Column  : in Column_Position;
-      Destination_Bottom_Row   : in Line_Position;
-      Destination_Right_Column : in Column_Position);
+     (Pad                      : Window;
+      Source_Top_Row           : Line_Position;
+      Source_Left_Column       : Column_Position;
+      Destination_Top_Row      : Line_Position;
+      Destination_Left_Column  : Column_Position;
+      Destination_Bottom_Row   : Line_Position;
+      Destination_Right_Column : Column_Position);
    --  AKA
    pragma Inline (Refresh_Without_Update);
 
    --  ANCHOR(`pechochar()',`Add_Character_To_Pad_And_Echo_It')
    procedure Add_Character_To_Pad_And_Echo_It
-     (Pad : in Window;
-      Ch  : in Attributed_Character);
+     (Pad : Window;
+      Ch  : Attributed_Character);
    --  AKA
 
    procedure Add_Character_To_Pad_And_Echo_It
-     (Pad : in Window;
-      Ch  : in Character);
+     (Pad : Window;
+      Ch  : Character);
    pragma Inline (Add_Character_To_Pad_And_Echo_It);
 
    --  MANPAGE(`curs_scroll.3x')
 
    --  ANCHOR(`wscrl()',`Scroll')
-   procedure Scroll (Win    : in Window  := Standard_Window;
-                     Amount : in Integer := 1);
+   procedure Scroll (Win    : Window  := Standard_Window;
+                     Amount : Integer := 1);
    --  AKA
    --  ALIAS(`scroll()')
    --  ALIAS(`scrl()')
@@ -1010,15 +1010,15 @@
    --  MANPAGE(`curs_delch.3x')
 
    --  ANCHOR(`wdelch()',`Delete_Character')
-   procedure Delete_Character (Win : in Window := Standard_Window);
+   procedure Delete_Character (Win : Window := Standard_Window);
    --  AKA
    --  ALIAS(`delch()')
 
    --  ANCHOR(`mvwdelch()',`Delete_Character')
    procedure Delete_Character
-     (Win    : in Window := Standard_Window;
-      Line   : in Line_Position;
-      Column : in Column_Position);
+     (Win    : Window := Standard_Window;
+      Line   : Line_Position;
+      Column : Column_Position);
    --  AKA
    --  ALIAS(`mvdelch()')
    pragma Inline (Delete_Character);
@@ -1043,36 +1043,36 @@
    --  MANPAGE(`curs_insch.3x')
 
    --  ANCHOR(`winsch()',`Insert')
-   procedure Insert (Win : in Window := Standard_Window;
-                     Ch  : in Attributed_Character);
+   procedure Insert (Win : Window := Standard_Window;
+                     Ch  : Attributed_Character);
    --  AKA
    --  ALIAS(`insch()')
 
    --  ANCHOR(`mvwinsch()',`Insert')
-   procedure Insert (Win    : in Window := Standard_Window;
-                     Line   : in Line_Position;
-                     Column : in Column_Position;
-                     Ch     : in Attributed_Character);
+   procedure Insert (Win    : Window := Standard_Window;
+                     Line   : Line_Position;
+                     Column : Column_Position;
+                     Ch     : Attributed_Character);
    --  AKA
    --  ALIAS(`mvinsch()')
 
    --  MANPAGE(`curs_insstr.3x')
 
    --  ANCHOR(`winsnstr()',`Insert')
-   procedure Insert (Win : in Window := Standard_Window;
-                     Str : in String;
-                     Len : in Integer := -1);
+   procedure Insert (Win : Window := Standard_Window;
+                     Str : String;
+                     Len : Integer := -1);
    --  AKA
    --  ALIAS(`winsstr()')
    --  ALIAS(`insnstr()')
    --  ALIAS(`insstr()')
 
    --  ANCHOR(`mvwinsnstr()',`Insert')
-   procedure Insert (Win    : in Window := Standard_Window;
-                     Line   : in Line_Position;
-                     Column : in Column_Position;
-                     Str    : in String;
-                     Len    : in Integer := -1);
+   procedure Insert (Win    : Window := Standard_Window;
+                     Line   : Line_Position;
+                     Column : Column_Position;
+                     Str    : String;
+                     Len    : Integer := -1);
    --  AKA
    --  ALIAS(`mvwinsstr()')
    --  ALIAS(`mvinsnstr()')
@@ -1082,20 +1082,20 @@
    --  MANPAGE(`curs_instr.3x')
 
    --  ANCHOR(`winnstr()',`Peek')
-   procedure Peek (Win : in  Window := Standard_Window;
+   procedure Peek (Win : Window := Standard_Window;
                    Str : out String;
-                   Len : in  Integer := -1);
+                   Len : Integer := -1);
    --  AKA
    --  ALIAS(`winstr()')
    --  ALIAS(`innstr()')
    --  ALIAS(`instr()')
 
    --  ANCHOR(`mvwinnstr()',`Peek')
-   procedure Peek (Win    : in  Window := Standard_Window;
-                   Line   : in  Line_Position;
-                   Column : in  Column_Position;
+   procedure Peek (Win    : Window := Standard_Window;
+                   Line   : Line_Position;
+                   Column : Column_Position;
                    Str    : out String;
-                   Len    : in  Integer := -1);
+                   Len    : Integer := -1);
    --  AKA
    --  ALIAS(`mvwinstr()')
    --  ALIAS(`mvinnstr()')
@@ -1104,20 +1104,20 @@
    --  MANPAGE(`curs_inchstr.3x')
 
    --  ANCHOR(`winchnstr()',`Peek')
-   procedure Peek (Win : in  Window := Standard_Window;
+   procedure Peek (Win : Window := Standard_Window;
                    Str : out Attributed_String;
-                   Len : in  Integer := -1);
+                   Len : Integer := -1);
    --  AKA
    --  ALIAS(`winchstr()')
    --  ALIAS(`inchnstr()')
    --  ALIAS(`inchstr()')
 
    --  ANCHOR(`mvwinchnstr()',`Peek')
-   procedure Peek (Win    : in  Window := Standard_Window;
-                   Line   : in  Line_Position;
-                   Column : in  Column_Position;
+   procedure Peek (Win    : Window := Standard_Window;
+                   Line   : Line_Position;
+                   Column : Column_Position;
                    Str    : out Attributed_String;
-                   Len    : in  Integer := -1);
+                   Len    : Integer := -1);
    --  AKA
    --  ALIAS(`mvwinchstr()')
    --  ALIAS(`mvinchnstr()')
@@ -1127,9 +1127,9 @@
    --  MANPAGE(`curs_getstr.3x')
 
    --  ANCHOR(`wgetnstr()',`Get')
-   procedure Get (Win : in  Window := Standard_Window;
+   procedure Get (Win : Window := Standard_Window;
                   Str : out String;
-                  Len : in  Integer := -1);
+                  Len : Integer := -1);
    --  AKA
    --  ALIAS(`wgetstr()')
    --  ALIAS(`getnstr()')
@@ -1138,11 +1138,11 @@
    --  overflows.
 
    --  ANCHOR(`mvwgetnstr()',`Get')
-   procedure Get (Win    : in  Window := Standard_Window;
-                  Line   : in  Line_Position;
-                  Column : in  Column_Position;
+   procedure Get (Win    : Window := Standard_Window;
+                  Line   : Line_Position;
+                  Column : Column_Position;
                   Str    : out String;
-                  Len    : in  Integer := -1);
+                  Len    : Integer := -1);
    --  AKA
    --  ALIAS(`mvwgetstr()')
    --  ALIAS(`mvgetnstr()')
@@ -1162,14 +1162,14 @@
 
    --  ANCHOR(`slk_init()',`Init_Soft_Label_Keys')
    procedure Init_Soft_Label_Keys
-     (Format : in Soft_Label_Key_Format := Three_Two_Three);
+     (Format : Soft_Label_Key_Format := Three_Two_Three);
    --  AKA
    pragma Inline (Init_Soft_Label_Keys);
 
    --  ANCHOR(`slk_set()',`Set_Soft_Label_Key')
-   procedure Set_Soft_Label_Key (Label : in Label_Number;
-                                 Text  : in String;
-                                 Fmt   : in Label_Justification := Left);
+   procedure Set_Soft_Label_Key (Label : Label_Number;
+                                 Text  : String;
+                                 Fmt   : Label_Justification := Left);
    --  AKA
    --  We don't inline this procedure
 
@@ -1184,12 +1184,12 @@
    pragma Inline (Refresh_Soft_Label_Keys_Without_Update);
 
    --  ANCHOR(`slk_label()',`Get_Soft_Label_Key')
-   procedure Get_Soft_Label_Key (Label : in Label_Number;
+   procedure Get_Soft_Label_Key (Label : Label_Number;
                                  Text  : out String);
    --  AKA
 
    --  ANCHOR(`slk_label()',`Get_Soft_Label_Key')
-   function Get_Soft_Label_Key (Label : in Label_Number) return String;
+   function Get_Soft_Label_Key (Label : Label_Number) return String;
    --  AKA
    --  Same as function
    pragma Inline (Get_Soft_Label_Key);
@@ -1211,16 +1211,16 @@
 
    --  ANCHOR(`slk_attron()',`Switch_Soft_Label_Key_Attributes')
    procedure Switch_Soft_Label_Key_Attributes
-     (Attr : in Character_Attribute_Set;
-      On   : in Boolean := True);
+     (Attr : Character_Attribute_Set;
+      On   : Boolean := True);
    --  AKA
    --  ALIAS(`slk_attroff()')
    pragma Inline (Switch_Soft_Label_Key_Attributes);
 
    --  ANCHOR(`slk_attrset()',`Set_Soft_Label_Key_Attributes')
    procedure Set_Soft_Label_Key_Attributes
-     (Attr  : in Character_Attribute_Set := Normal_Video;
-      Color : in Color_Pair := Color_Pair'First);
+     (Attr  : Character_Attribute_Set := Normal_Video;
+      Color : Color_Pair := Color_Pair'First);
    --  AKA
    pragma Inline (Set_Soft_Label_Key_Attributes);
 
@@ -1234,7 +1234,7 @@
    pragma Inline (Get_Soft_Label_Key_Attributes);
 
    --  ANCHOR(`slk_color()',`Set_Soft_Label_Key_Color')
-   procedure Set_Soft_Label_Key_Color (Pair : in Color_Pair);
+   procedure Set_Soft_Label_Key_Color (Pair : Color_Pair);
    --  AKA
    pragma Inline (Set_Soft_Label_Key_Color);
 
@@ -1244,16 +1244,16 @@
    --  MANPAGE(`keyok.3x')
 
    --  ANCHOR(`keyok()',`Enable_Key')
-   procedure Enable_Key (Key    : in Special_Key_Code;
-                         Enable : in Boolean := True);
+   procedure Enable_Key (Key    : Special_Key_Code;
+                         Enable : Boolean := True);
    --  AKA
    pragma Inline (Enable_Key);
 
    --  MANPAGE(`define_key.3x')
 
    --  ANCHOR(`define_key()',`Define_Key')
-   procedure Define_Key (Definition : in String;
-                         Key        : in Special_Key_Code);
+   procedure Define_Key (Definition : String;
+                         Key        : Special_Key_Code);
    --  AKA
    pragma Inline (Define_Key);
 
@@ -1264,30 +1264,30 @@
    --
 
    --  ANCHOR(`keyname()',`Key_Name')
-   procedure Key_Name (Key  : in  Real_Key_Code;
+   procedure Key_Name (Key  : Real_Key_Code;
                        Name : out String);
    --  AKA
    --  The external name for a real keystroke.
 
    --  ANCHOR(`keyname()',`Key_Name')
-   function Key_Name (Key  : in  Real_Key_Code) return String;
+   function Key_Name (Key  : Real_Key_Code) return String;
    --  AKA
    --  Same as function
    --  We don't inline this routine
 
    --  ANCHOR(`unctrl()',`Un_Control')
-   procedure Un_Control (Ch  : in Attributed_Character;
+   procedure Un_Control (Ch  : Attributed_Character;
                          Str : out String);
    --  AKA
 
    --  ANCHOR(`unctrl()',`Un_Control')
-   function Un_Control (Ch  : in Attributed_Character) return String;
+   function Un_Control (Ch  : Attributed_Character) return String;
    --  AKA
    --  Same as function
    pragma Inline (Un_Control);
 
    --  ANCHOR(`delay_output()',`Delay_Output')
-   procedure Delay_Output (Msecs : in Natural);
+   procedure Delay_Output (Msecs : Natural);
    --  AKA
    pragma Inline (Delay_Output);
 
@@ -1362,14 +1362,14 @@
    pragma Import (C, Start_Color, "start_color");
 
    --  ANCHOR(`init_pair()',`Init_Pair')
-   procedure Init_Pair (Pair : in Redefinable_Color_Pair;
-                        Fore : in Color_Number;
-                        Back : in Color_Number);
+   procedure Init_Pair (Pair : Redefinable_Color_Pair;
+                        Fore : Color_Number;
+                        Back : Color_Number);
    --  AKA
    pragma Inline (Init_Pair);
 
    --  ANCHOR(`pair_content()',`Pair_Content')
-   procedure Pair_Content (Pair : in Color_Pair;
+   procedure Pair_Content (Pair : Color_Pair;
                            Fore : out Color_Number;
                            Back : out Color_Number);
    --  AKA
@@ -1381,10 +1381,10 @@
    pragma Inline (Has_Colors);
 
    --  ANCHOR(`init_color()',`Init_Color')
-   procedure Init_Color (Color : in Color_Number;
-                         Red   : in RGB_Value;
-                         Green : in RGB_Value;
-                         Blue  : in RGB_Value);
+   procedure Init_Color (Color : Color_Number;
+                         Red   : RGB_Value;
+                         Green : RGB_Value;
+                         Blue  : RGB_Value);
    --  AKA
    pragma Inline (Init_Color);
 
@@ -1394,7 +1394,7 @@
    pragma Inline (Can_Change_Color);
 
    --  ANCHOR(`color_content()',`Color_Content')
-   procedure Color_Content (Color : in  Color_Number;
+   procedure Color_Content (Color : Color_Number;
                             Red   : out RGB_Value;
                             Green : out RGB_Value;
                             Blue  : out RGB_Value);
@@ -1407,13 +1407,13 @@
    type Curses_Mode is (Curses, Shell);
 
    --  ANCHOR(`def_prog_mode()',`Save_Curses_Mode')
-   procedure Save_Curses_Mode (Mode : in Curses_Mode);
+   procedure Save_Curses_Mode (Mode : Curses_Mode);
    --  AKA
    --  ALIAS(`def_shell_mode()')
    pragma Inline (Save_Curses_Mode);
 
    --  ANCHOR(`reset_prog_mode()',`Reset_Curses_Mode')
-   procedure Reset_Curses_Mode (Mode : in Curses_Mode);
+   procedure Reset_Curses_Mode (Mode : Curses_Mode);
    --  AKA
    --  ALIAS(`reset_shell_mode()')
    pragma Inline (Reset_Curses_Mode);
@@ -1437,8 +1437,8 @@
    --        and -1 otherwise.
 
    --  ANCHOR(`ripoffline()',`Rip_Off_Lines')
-   procedure Rip_Off_Lines (Lines : in Integer;
-                            Proc  : in Stdscr_Init_Proc);
+   procedure Rip_Off_Lines (Lines : Integer;
+                            Proc  : Stdscr_Init_Proc);
    --  AKA
    --  N.B.: to be more precise, this uses a ncurses specific enhancement of
    --        ripoffline(), in which the Lines argument absolute value is the
@@ -1454,7 +1454,7 @@
    pragma Inline (Set_Cursor_Visibility);
 
    --  ANCHOR(`napms()',`Nap_Milli_Seconds')
-   procedure Nap_Milli_Seconds (Ms : in Natural);
+   procedure Nap_Milli_Seconds (Ms : Natural);
    --  AKA
    pragma Inline (Nap_Milli_Seconds);
 
@@ -1463,10 +1463,10 @@
    --  |=====================================================================
    type Transform_Direction is (From_Screen, To_Screen);
    procedure Transform_Coordinates
-     (W      : in Window := Standard_Window;
+     (W      : Window := Standard_Window;
       Line   : in out Line_Position;
       Column : in out Column_Position;
-      Dir    : in Transform_Direction := From_Screen);
+      Dir    : Transform_Direction := From_Screen);
    --  This procedure transforms screen coordinates into coordinates relative
    --  to the window and vice versa, depending on the Dir parameter.
    --  Screen coordinates are the position informations on the physical device.
@@ -1507,23 +1507,23 @@
    --  MANPAGE(`curs_scr_dump.3x')
 
    --  ANCHOR(`scr_dump()',`Screen_Dump_To_File')
-   procedure Screen_Dump_To_File (Filename : in String);
+   procedure Screen_Dump_To_File (Filename : String);
    --  AKA
 
    --  ANCHOR(`scr_restore()',`Screen_Restore_From_File')
-   procedure Screen_Restore_From_File (Filename : in String);
+   procedure Screen_Restore_From_File (Filename : String);
    --  AKA
 
    --  ANCHOR(`scr_init()',`Screen_Init_From_File')
-   procedure Screen_Init_From_File (Filename : in String);
+   procedure Screen_Init_From_File (Filename : String);
    --  AKA
 
    --  ANCHOR(`scr_set()',`Screen_Set_File')
-   procedure Screen_Set_File (Filename : in String);
+   procedure Screen_Set_File (Filename : String);
    --  AKA
 
    --  MANPAGE(`curs_print.3x')
-   --  Not implemented:  mcprint
+   --  Not implemented: mcprint
 
    --  MANPAGE(`curs_printw.3x')
    --  Not implemented: printw,  wprintw, mvprintw, mvwprintw, vwprintw,
diff -Naur ncurses-5.7.orig/Ada95/include/MKncurses_def.sh ncurses-5.7/Ada95/include/MKncurses_def.sh
--- ncurses-5.7.orig/Ada95/include/MKncurses_def.sh	1969-12-31 19:00:00.000000000 -0500
+++ ncurses-5.7/Ada95/include/MKncurses_def.sh	2011-01-08 18:13:50.299156775 -0500
@@ -0,0 +1,80 @@
+#! /bin/sh
+# $Id: MKncurses_def.sh,v 1.2 2003/10/25 16:19:46 tom Exp $
+##############################################################################
+# Copyright (c) 2000 Free Software Foundation, Inc.                          #
+#                                                                            #
+# Permission is hereby granted, free of charge, to any person obtaining a    #
+# copy of this software and associated documentation files (the "Software"), #
+# to deal in the Software without restriction, including without limitation  #
+# the rights to use, copy, modify, merge, publish, distribute, distribute    #
+# with modifications, sublicense, and/or sell copies of the Software, and to #
+# permit persons to whom the Software is furnished to do so, subject to the  #
+# following conditions:                                                      #
+#                                                                            #
+# The above copyright notice and this permission notice shall be included in #
+# all copies or substantial portions of the Software.                        #
+#                                                                            #
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR #
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,   #
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL    #
+# THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER      #
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING    #
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER        #
+# DEALINGS IN THE SOFTWARE.                                                  #
+#                                                                            #
+# Except as contained in this notice, the name(s) of the above copyright     #
+# holders shall not be used in advertising or otherwise to promote the sale, #
+# use or other dealings in this Software without prior written               #
+# authorization.                                                             #
+##############################################################################
+#
+# MKncurses_def.sh -- generate fallback definitions for ncurses_cfg.h
+#
+# Author: Thomas E. Dickey 2000
+#
+# Given the choice between constructs such as
+#
+#	#if defined(foo) && foo
+#	#if foo
+#
+# we chose the latter.  It is guaranteed by the language standard, and there
+# appear to be no broken compilers that do not honor that detail.  But some
+# people want to use gcc's -Wundef option (corresponding to one of the less
+# useful features in Watcom's compiler) to check for misspellings.  So we
+# generate a set of fallback definitions to quiet the warnings without making
+# the code ugly.
+#
+DEFS="${1-ncurses_defs}"
+cat <<EOF
+/*
+ * This file is generated by $0
+ */
+
+#ifndef NC_DEFINE_H
+#define NC_DEFINE_H 1
+
+EOF
+
+${AWK-awk} <$DEFS '
+!/^[@#]/ {
+	if ( NF == 1 )
+	{
+		print "#ifndef", $1
+		print "#define", $1, "0"
+		print "#endif"
+		print ""
+	} else if ( NF != 0 ) {
+		print "#ifndef", $1
+		printf "#define"
+		for (n = 1; n <= NF; n++) {
+			printf " %s", $n
+		}
+		print ""
+		print "#endif"
+		print ""
+	}
+}
+END	{
+print "#endif /* NC_DEFINE_H */"
+	}
+'
diff -Naur ncurses-5.7.orig/Ada95/include/Makefile.in ncurses-5.7/Ada95/include/Makefile.in
--- ncurses-5.7.orig/Ada95/include/Makefile.in	1969-12-31 19:00:00.000000000 -0500
+++ ncurses-5.7/Ada95/include/Makefile.in	2011-01-08 18:18:29.554659961 -0500
@@ -0,0 +1,90 @@
+# $Id: Makefile.in,v 1.2 2010/11/27 21:45:27 tom Exp $
+##############################################################################
+# 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.                                                             #
+##############################################################################
+#
+# Author: Thomas E. Dickey
+#
+# Makefile for ncurses source code.
+#
+# This makes header files used when building Ada95 as a separate tree.
+#
+# The variable 'srcdir' refers to the source-distribution, and can be set with
+# the configure script by "--srcdir=DIR".
+
+# turn off _all_ suffix rules; we'll generate our own
+.SUFFIXES:
+
+SHELL		= /bin/sh
+VPATH		= @srcdir@
+THIS		= Makefile
+
+DESTDIR		= @DESTDIR@
+srcdir		= @srcdir@
+prefix		= @prefix@
+exec_prefix	= @exec_prefix@
+includedir	= @includedir@
+
+INSTALL		= @INSTALL@
+INSTALL_DATA	= @INSTALL_DATA@
+
+AWK		= @AWK@
+
+# These files are generated by this makefile
+AUTO_SRC = \
+	ncurses_def.h
+
+################################################################################
+all \
+libs \
+depend \
+sources \
+install ::	$(AUTO_SRC)
+
+ncurses_def.h: $(srcdir)/ncurses_defs $(srcdir)/MKncurses_def.sh
+	AWK=$(AWK) sh $(srcdir)/MKncurses_def.sh $(srcdir)/ncurses_defs >$@
+
+tags:
+	ctags *.[ch]
+
+@MAKE_UPPER_TAGS@TAGS:
+@MAKE_UPPER_TAGS@	etags *.[ch]
+
+mostlyclean ::
+	-rm -f core tags TAGS *~ *.bak *.i *.ln *.atac trace
+
+clean :: mostlyclean
+	-rm -f $(AUTO_SRC)
+
+distclean :: clean
+	-rm -f Makefile
+
+realclean :: distclean
+
+###############################################################################
+# The remainder of this file is automatically generated during configuration
+###############################################################################
diff -Naur ncurses-5.7.orig/Ada95/include/ncurses_cfg.hin ncurses-5.7/Ada95/include/ncurses_cfg.hin
--- ncurses-5.7.orig/Ada95/include/ncurses_cfg.hin	1969-12-31 19:00:00.000000000 -0500
+++ ncurses-5.7/Ada95/include/ncurses_cfg.hin	2011-01-08 18:13:50.299156775 -0500
@@ -0,0 +1,72 @@
+/****************************************************************************
+ * Copyright (c) 1998-2004,2005 Free Software Foundation, Inc.              *
+ *                                                                          *
+ * Permission is hereby granted, free of charge, to any person obtaining a  *
+ * copy of this software and associated documentation files (the            *
+ * "Software"), to deal in the Software without restriction, including      *
+ * without limitation the rights to use, copy, modify, merge, publish,      *
+ * distribute, distribute with modifications, sublicense, and/or sell       *
+ * copies of the Software, and to permit persons to whom the Software is    *
+ * furnished to do so, subject to the following conditions:                 *
+ *                                                                          *
+ * The above copyright notice and this permission notice shall be included  *
+ * in all copies or substantial portions of the Software.                   *
+ *                                                                          *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
+ *                                                                          *
+ * Except as contained in this notice, the name(s) of the above copyright   *
+ * holders shall not be used in advertising or otherwise to promote the     *
+ * sale, use or other dealings in this Software without prior written       *
+ * authorization.                                                           *
+ ****************************************************************************/
+
+/****************************************************************************
+ *  Author: Thomas E. Dickey <dickey@clark.net> 1997                        *
+ ****************************************************************************/
+/*
+ * $Id: ncurses_cfg.hin,v 1.7 2005/01/02 01:26:58 tom Exp $
+ *
+ * This is a template-file used to generate the "ncurses_cfg.h" file.
+ *
+ * Rather than list every definition, the configuration script substitutes the
+ * definitions that it finds using 'sed'.  You need a patch (original date
+ * 971222) to autoconf 2.12 or 2.13 to do this.
+ *
+ * See:
+ *	http://invisible-island.net/autoconf/
+ *	ftp://invisible-island.net/autoconf/
+ */
+#ifndef NC_CONFIG_H
+#define NC_CONFIG_H
+@DEFS@
+
+#include <ncurses_def.h>
+
+	/* The C compiler may not treat these properly but C++ has to */
+#ifdef __cplusplus
+#undef const
+#undef inline
+#else
+#if defined(lint) || defined(TRACE)
+#undef inline
+#define inline /* nothing */
+#endif
+#endif
+
+	/* On HP-UX, the C compiler doesn't grok mbstate_t without
+	   -D_XOPEN_SOURCE=500. However, this causes problems on
+	   IRIX. So, we #define mbstate_t to int in configure.in
+	   only for the C compiler if needed. */
+#ifndef __cplusplus
+#ifdef NEED_MBSTATE_T_DEF
+#define mbstate_t int
+#endif
+#endif
+
+#endif /* NC_CONFIG_H */
diff -Naur ncurses-5.7.orig/Ada95/include/ncurses_defs ncurses-5.7/Ada95/include/ncurses_defs
--- ncurses-5.7.orig/Ada95/include/ncurses_defs	1969-12-31 19:00:00.000000000 -0500
+++ ncurses-5.7/Ada95/include/ncurses_defs	2011-01-08 18:13:50.299156775 -0500
@@ -0,0 +1,207 @@
+# $Id: ncurses_defs,v 1.41 2008/11/16 00:19:59 juergen Exp $
+##############################################################################
+# Copyright (c) 2000-2007,2008 Free Software Foundation, Inc.                #
+#                                                                            #
+# Permission is hereby granted, free of charge, to any person obtaining a    #
+# copy of this software and associated documentation files (the "Software"), #
+# to deal in the Software without restriction, including without limitation  #
+# the rights to use, copy, modify, merge, publish, distribute, distribute    #
+# with modifications, sublicense, and/or sell copies of the Software, and to #
+# permit persons to whom the Software is furnished to do so, subject to the  #
+# following conditions:                                                      #
+#                                                                            #
+# The above copyright notice and this permission notice shall be included in #
+# all copies or substantial portions of the Software.                        #
+#                                                                            #
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR #
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,   #
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL    #
+# THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER      #
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING    #
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER        #
+# DEALINGS IN THE SOFTWARE.                                                  #
+#                                                                            #
+# Except as contained in this notice, the name(s) of the above copyright     #
+# holders shall not be used in advertising or otherwise to promote the sale, #
+# use or other dealings in this Software without prior written               #
+# authorization.                                                             #
+##############################################################################
+#
+# See "MKncurses_def.sh" for an explanation.
+#
+# (hint: don't try to define NDEBUG ;-)
+
+BROKEN_LINKER
+BSD_TPUTS
+CC_HAS_PROTOS
+CPP_HAS_PARAM_INIT
+CURSES_ACS_ARRAY	acs_map
+CURSES_WACS_ARRAY	_nc_wacs
+DECL_ERRNO
+ETIP_NEEDS_MATH_H
+GCC_NORETURN	/* nothing */
+GCC_UNUSED	/* nothing */
+HAVE_BIG_CORE
+HAVE_BSD_CGETENT
+HAVE_BSD_SIGNAL_H
+HAVE_BTOWC 
+HAVE_BUILTIN_H
+HAVE_CHGAT	1
+HAVE_COLOR_SET	1
+HAVE_DIRENT_H
+HAVE_ERRNO
+HAVE_FCNTL_H
+HAVE_FILTER	1
+HAVE_FORM_H
+HAVE_GETBEGX	1
+HAVE_GETCURX	1
+HAVE_GETCWD
+HAVE_GETEGID
+HAVE_GETEUID
+HAVE_GETMAXX	1
+HAVE_GETNSTR
+HAVE_GETOPT_H
+HAVE_GETPARX	1
+HAVE_GETTIMEOFDAY
+HAVE_GETTTYNAM
+HAVE_GETWIN	1
+HAVE_GPM_H
+HAVE_GPP_BUILTIN_H
+HAVE_GXX_BUILTIN_H
+HAVE_HAS_KEY
+HAVE_IOSTREAM
+HAVE_ISASCII
+HAVE_ISSETUGID
+HAVE_LANGINFO_CODESET
+HAVE_LIBC_H
+HAVE_LIBDBMALLOC
+HAVE_LIBDMALLOC
+HAVE_LIBFORM
+HAVE_LIBGPM
+HAVE_LIBMENU
+HAVE_LIBMPATROL
+HAVE_LIBPANEL
+HAVE_LIMITS_H
+HAVE_LINK
+HAVE_LOCALE_H
+HAVE_LONG_FILE_NAMES
+HAVE_MBLEN
+HAVE_MBRLEN
+HAVE_MBRTOWC
+HAVE_MBSRTOWCS
+HAVE_MBSTOWCS
+HAVE_MBTOWC
+HAVE_MENU_H
+HAVE_MKSTEMP
+HAVE_MVVLINE	1
+HAVE_MVWVLINE	1
+HAVE_NANOSLEEP
+HAVE_NC_ALLOC_H
+HAVE_PANEL_H
+HAVE_POLL
+HAVE_POLL_H
+HAVE_PURIFY
+HAVE_PUTWC 
+HAVE_PUTWIN	1
+HAVE_REGEXPR_H_FUNCS
+HAVE_REGEXP_H_FUNCS
+HAVE_REGEX_H_FUNCS
+HAVE_REMOVE
+HAVE_RESIZETERM
+HAVE_RESIZE_TERM
+HAVE_RIPOFFLINE	1
+HAVE_SELECT
+HAVE_SETBUF
+HAVE_SETBUFFER
+HAVE_SETUPTERM	1
+HAVE_SETVBUF
+HAVE_SIGACTION
+HAVE_SIGVEC
+HAVE_SIZECHANGE
+HAVE_SLK_COLOR
+HAVE_SLK_INIT	1
+HAVE_STRDUP
+HAVE_STRSTR
+HAVE_SYMLINK
+HAVE_SYS_BSDTYPES_H
+HAVE_SYS_IOCTL_H
+HAVE_SYS_PARAM_H
+HAVE_SYS_POLL_H
+HAVE_SYS_SELECT_H
+HAVE_SYS_TERMIO_H
+HAVE_SYS_TIMES_H
+HAVE_SYS_TIME_H
+HAVE_SYS_TIME_SELECT
+HAVE_TCGETATTR
+HAVE_TCGETPGRP
+HAVE_TELL
+HAVE_TERMATTRS	1
+HAVE_TERMIOS_H
+HAVE_TERMIO_H
+HAVE_TERMNAME	1
+HAVE_TERM_H	1
+HAVE_TGETENT	1
+HAVE_TIGETNUM	1
+HAVE_TIGETSTR	1
+HAVE_TIMES
+HAVE_TTYENT_H
+HAVE_TYPEAHEAD	1
+HAVE_TYPEINFO
+HAVE_TYPE_ATTR_T
+HAVE_TYPE_SIGACTION
+HAVE_UNISTD_H
+HAVE_UNLINK
+HAVE_USE_DEFAULT_COLORS
+HAVE_VFSCANF
+HAVE_VSNPRINTF
+HAVE_VSSCANF
+HAVE_WCSRTOMBS
+HAVE_WCSTOMBS
+HAVE_WCTOB 
+HAVE_WCTOMB
+HAVE_WCTYPE_H
+HAVE_WINSSTR	1
+HAVE_WORKING_POLL
+HAVE_WRESIZE
+HAVE__DOSCAN
+MIXEDCASE_FILENAMES
+NCURSES_CHAR_EQ
+NCURSES_EXPANDED
+NCURSES_EXT_COLORS
+NCURSES_EXT_FUNCS
+NCURSES_NO_PADDING
+NCURSES_PATHSEP	':'
+NEED_PTEM_H
+NO_LEAKS
+PURE_TERMINFO
+RETSIGTYPE
+STDC_HEADERS
+SVR4_ACTION
+SVR4_TERMIO
+SYSTEM_NAME	"unknown"
+TERMINFO	"none"
+TERMPATH	"none"
+TIME_WITH_SYS_TIME
+TYPEOF_CHTYPE
+USE_COLORFGBG
+USE_DATABASE
+USE_GETCAP
+USE_GETCAP_CACHE
+USE_HARD_TABS
+USE_HASHED_DB
+USE_HASHMAP
+USE_HOME_TERMINFO
+USE_LINKS
+USE_MY_MEMMOVE
+USE_OK_BCOPY
+USE_RCS_IDS
+USE_REENTRANT
+USE_SAFE_SPRINTF
+USE_SCROLL_HINTS
+USE_SIGWINCH
+USE_SYMLINKS
+USE_SYSMOUSE
+USE_TERMCAP
+USE_WEAK_SYMBOLS
+USE_WIDEC_SUPPORT
+USE_XMC_SUPPORT
diff -Naur ncurses-5.7.orig/Ada95/make-tar.sh ncurses-5.7/Ada95/make-tar.sh
--- ncurses-5.7.orig/Ada95/make-tar.sh	1969-12-31 19:00:00.000000000 -0500
+++ ncurses-5.7/Ada95/make-tar.sh	2011-01-08 18:18:29.450655703 -0500
@@ -0,0 +1,90 @@
+#!/bin/sh
+# $Id: make-tar.sh,v 1.6 2010/11/06 19:59:07 tom Exp $
+##############################################################################
+# 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.                                                             #
+##############################################################################
+# Construct a tar-file containing only the Ada95 tree as well as its associated
+# documentation.  The reason for doing that is to simplify distributing the
+# ada binding as a separate package.
+
+TARGET=`pwd`
+
+: ${ROOTNAME:=ncurses-Ada95}
+: ${DESTDIR:=$TARGET}
+: ${TMPDIR:=/tmp}
+
+# This can be run from either the Ada95 subdirectory, or from the top-level
+# source directory.  We will put the tar file in the original directory.
+test -d ./Ada95 && cd ./Ada95
+
+BUILD=$TMPDIR/make-tar$$
+trap "cd /; rm -rf $BUILD; exit 0" 0 1 2 5 15
+
+umask 077
+if ! ( mkdir $BUILD )
+then
+	echo "? cannot make build directory $BUILD"
+fi
+
+umask 022
+mkdir $BUILD/$ROOTNAME
+
+cp -p -r * $BUILD/$ROOTNAME/ || exit
+
+# Add the config.* utility scripts from the top-level directory.
+for i in . ..
+do
+	for j in config.guess config.sub install-sh tar-copy.sh
+	do
+		test -f $i/$j && cp -p $i/$j $BUILD/$ROOTNAME/
+	done
+done
+
+# Add the ada documentation.
+mkdir $BUILD/$ROOTNAME/doc || exit
+cd ../doc/html || exit
+
+cp -p -r Ada* $BUILD/$ROOTNAME/doc/
+cp -p -r ada $BUILD/$ROOTNAME/doc/
+
+cd $BUILD || exit 
+
+# There is no need for this script in the tar file.
+rm -f $ROOTNAME/make-tar.sh
+
+# Remove build-artifacts.
+find . -name RCS -exec rm -rf {} \;
+find . -name "*.gz" -exec rm -rf {} \;
+
+# Make the files writable...
+chmod -R u+w .
+
+tar cf - $ROOTNAME | gzip >$DESTDIR/$ROOTNAME.tar.gz
+cd $DESTDIR
+
+pwd
+ls -l $ROOTNAME.tar.gz
diff -Naur ncurses-5.7.orig/Ada95/mk-1st.awk ncurses-5.7/Ada95/mk-1st.awk
--- ncurses-5.7.orig/Ada95/mk-1st.awk	1969-12-31 19:00:00.000000000 -0500
+++ ncurses-5.7/Ada95/mk-1st.awk	2011-01-08 18:13:50.299156775 -0500
@@ -0,0 +1,90 @@
+# $Id: mk-1st.awk,v 1.3 2010/06/26 23:37:46 tom Exp $
+##############################################################################
+# 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.                                                             #
+##############################################################################
+#
+# Author: Thomas E. Dickey
+#
+# Generate compile-rules for the Ada95 modules that we are using in libraries
+# or programs.  This script is used for older versions of gnatmake, which do
+# not build libraries reliably, e.g., gnatmake 3.15.
+#
+# Fields in src/modules:
+#	$1 = module name
+#	$2 = directory where spec-dependency ".ads" is found
+#	$3 = directory where body-dependency ".adb" is found
+#	$4 = unit to compile (spec or body)
+#
+BEGIN	{
+		printf "\n";
+		printf "# generated by Ada95/mk-1st.awk\n";
+	}
+	/^[#]/ {
+		next
+	}
+	/^$/ {
+		next
+	}
+	{
+		printf "\n";
+		printf "%s.o :", $1.o
+
+		if ( $2 == "none" ) {
+			pre_spec = "";
+		} else if ( $2 == "." ) {
+			pre_spec = "";
+			printf " \\\n\t\t%s.ads", $1;
+		} else {
+			pre_spec = sprintf("%s/", $2);
+			printf " \\\n\t\t%s%s.ads", pre_spec, $1;
+		}
+
+		if ( $3 == "none" ) {
+			pre_body = "";
+		} else if ( $3 == "." ) {
+			pre_body = "";
+			printf " \\\n\t\t%s.adb", $1;
+		} else {
+			pre_body = sprintf("%s/", $3);
+			printf " \\\n\t\t%s%s.adb", pre_body, $1;
+			printf " \\\n\t\t$(BASEDEPS)";
+		}
+
+		if ( $4 == "spec" ) {
+			suffix = "ads";
+			prefix = pre_spec;
+		} else {
+			suffix = "adb";
+			prefix = pre_body;
+		}
+
+		printf  "\n";
+		printf "\t$(ADA) $(ADAFLAGS) -c -o $@ %s%s.%s\n", prefix, $1, suffix
+	}
+END	{
+		print  ""
+	}
diff -Naur ncurses-5.7.orig/Ada95/samples/Makefile.in ncurses-5.7/Ada95/samples/Makefile.in
--- ncurses-5.7.orig/Ada95/samples/Makefile.in	2006-12-17 11:45:02.000000000 -0500
+++ ncurses-5.7/Ada95/samples/Makefile.in	2011-01-08 18:18:29.554659961 -0500
@@ -1,5 +1,5 @@
 ##############################################################################
-# Copyright (c) 1998-2004,2005 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 "Software"), #
@@ -28,11 +28,12 @@
 #
 #  Author:  Juergen Pfeifer, 1996
 #
-#  $Id: Makefile.in,v 1.34 2006/12/17 16:45:02 tom Exp $
+#  $Id: Makefile.in,v 1.40 2010/11/27 21:45:27 tom Exp $
 #
 .SUFFIXES:
 
 SHELL		= /bin/sh
+VPATH		= @srcdir@
 THIS		= Makefile
 
 x		= @PROG_EXT@
@@ -87,31 +88,9 @@
 ABASE        = $(ALIB)-curses
 
 CARGS        =-cargs $(ADAFLAGS)
-LARGS        =-largs @TEST_ARG2@ $(LD_FLAGS) -lAdaCurses
- 
-PROGS        = tour rain ncurses 
-
-TOUR_OBJS    =	tour.o sample.o sample-curses_demo.o sample-explanation.o 	\
-		sample-form_demo.o sample-function_key_setting.o 		\
-		sample-header_handler.o sample-helpers.o 			\
-		sample-keyboard_handler.o sample-manifest.o sample-menu_demo.o	\
-		sample-menu_demo-aux.o sample-text_io_demo.o			\
-		sample-curses_demo-attributes.o sample-curses_demo-mouse.o	\
-		sample-form_demo-aux.o sample-my_field_type.o
-
-RAIN_OBJS    =	rain.o status.o
-
-NCURSES_OBJS = ncurses.o        	ncurses2-getch_test.o \
-	ncurses2-acs_and_scroll.o       ncurses2-m.o \
-	ncurses2-acs_display.o          ncurses2-menu_test.o \
-	ncurses2-attr_test.o            ncurses2-overlap_test.o \
-	ncurses2-color_edit.o           ncurses2-slk_test.o \
-	ncurses2-color_test.o           ncurses2-test_sgr_attributes.o \
-	ncurses2-demo_forms.o           ncurses2-trace_set.o \
-	ncurses2-demo_pad.o             ncurses2-util.o \
-	ncurses2-demo_panels.o          ncurses2.o \
-	ncurses2-flushinp_test.o
+LARGS        =-largs @TEST_ARG2@ $(LD_FLAGS) -L../lib -lAdaCurses @TEST_LIBS2@
 
+PROGS        = tour rain ncurses
 
 all ::  tour$x rain$x ncurses$x
 	@echo made $@
@@ -145,7 +124,7 @@
 
 clean :: mostlyclean
 	rm -f *.o *.ali b_t*.* *.s $(PROGS) a.out core b_*_test.c *.xr[bs] \
-	explain.msg trace screendump 
+	explain.msg trace screendump b~*.ad[bs]
 
 distclean :: clean
 	rm -f Makefile
diff -Naur ncurses-5.7.orig/Ada95/samples/ncurses2-acs_and_scroll.adb ncurses-5.7/Ada95/samples/ncurses2-acs_and_scroll.adb
--- ncurses-5.7.orig/Ada95/samples/ncurses2-acs_and_scroll.adb	2008-07-26 14:47:42.000000000 -0400
+++ ncurses-5.7/Ada95/samples/ncurses2-acs_and_scroll.adb	2011-01-08 18:13:50.303157123 -0500
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 2000-2006,2008 Free Software Foundation, Inc.              --
+-- Copyright (c) 2000-2008,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,8 +35,8 @@
 ------------------------------------------------------------------------------
 --  Author: Eugene V. Melaragno <aldomel@ix.netcom.com> 2000
 --  Version Control
---  $Revision: 1.8 $
---  $Date: 2008/07/26 18:47:42 $
+--  $Revision: 1.9 $
+--  $Date: 2009/12/26 17:38:58 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 --  Windows and scrolling tester.
@@ -93,8 +93,6 @@
                           dx  : Column_Position);
    function delete_framed (fp : FrameA; showit : Boolean) return FrameA;
 
-   use Ada.Streams.Stream_IO;
-
    --  A linked list
    --  I  wish there was a standard library linked list. Oh well.
    type Frame is record
@@ -285,11 +283,11 @@
       else
          Add (Str => "All other");
       end if;
-      Add (str => " characters are echoed, window should ");
+      Add (Str => " characters are echoed, window should ");
       if not HaveScroll (curpw) then
          Add (Str => "not ");
       end if;
-      Add (str => "scroll");
+      Add (Str => "scroll");
 
       Clear_To_End_Of_Line;
    end transient;
diff -Naur ncurses-5.7.orig/Ada95/samples/ncurses2-color_edit.adb ncurses-5.7/Ada95/samples/ncurses2-color_edit.adb
--- ncurses-5.7.orig/Ada95/samples/ncurses2-color_edit.adb	2006-06-25 10:24:40.000000000 -0400
+++ ncurses-5.7/Ada95/samples/ncurses2-color_edit.adb	2011-01-08 18:13:50.303157123 -0500
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 2000-2004,2006 Free Software Foundation, Inc.              --
+-- Copyright (c) 2000-2006,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,8 +35,8 @@
 ------------------------------------------------------------------------------
 --  Author: Eugene V. Melaragno <aldomel@ix.netcom.com> 2000
 --  Version Control
---  $Revision: 1.5 $
---  $Date: 2006/06/25 14:24:40 $
+--  $Revision: 1.6 $
+--  $Date: 2009/12/26 17:38:58 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with ncurses2.util; use ncurses2.util;
@@ -171,7 +171,7 @@
             Set_Character_Attributes;
          end if;
          Set_Character_Attributes;
-         Add (ch => ')');
+         Add (Ch => ')');
       end loop;
       Add (Line => Line_Position (Number_Of_Colors + 3), Column => 0,
            Str => "Use up/down to select a color, left/right to change " &
diff -Naur ncurses-5.7.orig/Ada95/samples/ncurses2-genericputs.adb ncurses-5.7/Ada95/samples/ncurses2-genericputs.adb
--- ncurses-5.7.orig/Ada95/samples/ncurses2-genericputs.adb	2008-07-26 14:46:18.000000000 -0400
+++ ncurses-5.7/Ada95/samples/ncurses2-genericputs.adb	2011-01-08 18:13:50.303157123 -0500
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 2000-2006,2008 Free Software Foundation, Inc.              --
+-- Copyright (c) 2000-2008,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,8 +35,8 @@
 ------------------------------------------------------------------------------
 --  Author: Eugene V. Melaragno <aldomel@ix.netcom.com> 2000
 --  Version Control
---  $Revision: 1.3 $
---  $Date: 2008/07/26 18:46:18 $
+--  $Revision: 1.4 $
+--  $Date: 2009/12/26 17:38:58 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with Terminal_Interface.Curses; use Terminal_Interface.Curses;
@@ -44,9 +44,9 @@
 
 package body ncurses2.genericPuts is
 
-   procedure myGet (Win : in  Window := Standard_Window;
+   procedure myGet (Win : Window := Standard_Window;
                     Str : out BS.Bounded_String;
-                    Len : in  Integer := -1)
+                    Len : Integer := -1)
    is
       function Wgetnstr (Win : Window;
                          Str : char_array;
@@ -74,7 +74,7 @@
 
    procedure myPut (Str  : out BS.Bounded_String;
                     i    : Integer;
-                    Base : in     Number_Base := 10) is
+                    Base : Number_Base := 10) is
       package Int_IO is new Integer_IO (Integer); use Int_IO;
       tmp : String (1 .. BS.Max_Length);
    begin
@@ -89,7 +89,7 @@
    end myAdd;
 
    --  from ncurses-aux
-   procedure Fill_String (Cp  : in  chars_ptr;
+   procedure Fill_String (Cp  : chars_ptr;
                           Str : out BS.Bounded_String)
    is
       --  Fill the string with the characters referenced by the
diff -Naur ncurses-5.7.orig/Ada95/samples/ncurses2-genericputs.ads ncurses-5.7/Ada95/samples/ncurses2-genericputs.ads
--- ncurses-5.7.orig/Ada95/samples/ncurses2-genericputs.ads	2006-06-25 10:24:40.000000000 -0400
+++ ncurses-5.7/Ada95/samples/ncurses2-genericputs.ads	2011-01-08 18:13:50.303157123 -0500
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 2000,2006 Free Software Foundation, Inc.                   --
+-- Copyright (c) 2000-2006,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,8 +35,8 @@
 ------------------------------------------------------------------------------
 --  Author: Eugene V. Melaragno <aldomel@ix.netcom.com> 2000
 --  Version Control
---  $Revision: 1.2 $
---  $Date: 2006/06/25 14:24:40 $
+--  $Revision: 1.3 $
+--  $Date: 2009/12/26 17:38:58 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 
@@ -56,17 +56,17 @@
      Ada.Strings.Bounded.Generic_Bounded_Length (Max);
    use BS;
 
-   procedure myGet (Win : in  Terminal_Interface.Curses.Window
-                      := Terminal_Interface.Curses.Standard_Window;
+   procedure myGet (Win : Terminal_Interface.Curses.Window
+                       := Terminal_Interface.Curses.Standard_Window;
                     Str : out BS.Bounded_String;
-                    Len : in  Integer := -1);
+                    Len :  Integer := -1);
 
-   procedure myPut (Str : out BS.Bounded_String;
-                    i : Integer;
-                    Base : in Number_Base := 10);
+   procedure myPut (Str  : out BS.Bounded_String;
+                    i    : Integer;
+                    Base : Number_Base := 10);
    --  the default should be Ada.Text_IO.Integer_IO.Default_Base
    --  but Default_Base is hidden in the generic so doesn't exist!
    procedure myAdd (Str : BS.Bounded_String);
 
-   procedure Fill_String (Cp  : in  chars_ptr; Str : out BS.Bounded_String);
+   procedure Fill_String (Cp : chars_ptr; Str : out BS.Bounded_String);
 end ncurses2.genericPuts;
diff -Naur ncurses-5.7.orig/Ada95/samples/ncurses2-getch_test.adb ncurses-5.7/Ada95/samples/ncurses2-getch_test.adb
--- ncurses-5.7.orig/Ada95/samples/ncurses2-getch_test.adb	2008-07-26 14:46:58.000000000 -0400
+++ ncurses-5.7/Ada95/samples/ncurses2-getch_test.adb	2011-01-08 18:13:50.303157123 -0500
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 2000-2006,2008 Free Software Foundation, Inc.              --
+-- Copyright (c) 2000-2008,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,8 +35,8 @@
 ------------------------------------------------------------------------------
 --  Author: Eugene V. Melaragno <aldomel@ix.netcom.com> 2000
 --  Version Control
---  $Revision: 1.7 $
---  $Date: 2008/07/26 18:46:58 $
+--  $Revision: 1.8 $
+--  $Date: 2009/12/26 17:38:58 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 --  Character input test
@@ -205,7 +205,7 @@
                Add (Str => " I saw '");
                myAdd (Str => boundedbuf);
                Add (Str => "'.");
-               Add (ch => newl);
+               Add (Ch => newl);
             end if;
          end;
       elsif c = Character'Pos ('s') then
diff -Naur ncurses-5.7.orig/Ada95/samples/ncurses2-slk_test.adb ncurses-5.7/Ada95/samples/ncurses2-slk_test.adb
--- ncurses-5.7.orig/Ada95/samples/ncurses2-slk_test.adb	2006-06-25 10:24:40.000000000 -0400
+++ ncurses-5.7/Ada95/samples/ncurses2-slk_test.adb	2011-01-08 18:13:50.303157123 -0500
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 2000-2004,2006 Free Software Foundation, Inc.              --
+-- Copyright (c) 2000-2006,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,8 +35,8 @@
 ------------------------------------------------------------------------------
 --  Author: Eugene V. Melaragno <aldomel@ix.netcom.com> 2000
 --  Version Control
---  $Revision: 1.7 $
---  $Date: 2006/06/25 14:24:40 $
+--  $Revision: 1.8 $
+--  $Date: 2009/12/26 17:38:58 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with ncurses2.util; use ncurses2.util;
@@ -47,13 +47,13 @@
 with Terminal_Interface.Curses.Aux;
 
 procedure ncurses2.slk_test is
-   procedure myGet (Win : in  Window := Standard_Window;
+   procedure myGet (Win : Window := Standard_Window;
                     Str : out Ada.Strings.Unbounded.Unbounded_String;
-                    Len : in  Integer := -1);
+                    Len : Integer := -1);
 
-   procedure myGet (Win : in  Window := Standard_Window;
+   procedure myGet (Win : Window := Standard_Window;
                     Str : out Ada.Strings.Unbounded.Unbounded_String;
-                    Len : in  Integer := -1)
+                    Len : Integer := -1)
    is
       use Ada.Strings.Unbounded;
       use Interfaces.C;
diff -Naur ncurses-5.7.orig/Ada95/samples/sample-explanation.adb ncurses-5.7/Ada95/samples/sample-explanation.adb
--- ncurses-5.7.orig/Ada95/samples/sample-explanation.adb	2006-06-25 10:30:22.000000000 -0400
+++ ncurses-5.7/Ada95/samples/sample-explanation.adb	2011-01-08 18:13:50.303157123 -0500
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998-2004,2006 Free Software Foundation, Inc.              --
+-- Copyright (c) 1998-2006,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,8 +35,8 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control
---  $Revision: 1.20 $
---  $Date: 2006/06/25 14:30:22 $
+--  $Revision: 1.21 $
+--  $Date: 2009/12/26 17:38:58 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 --  Poor mans help system. This scans a sequential file for key lines and
@@ -73,8 +73,8 @@
          Line : String_Access;
       end record;
 
-   procedure Explain (Key : in String;
-                      Win : in Window);
+   procedure Explain (Key : String;
+                      Win : Window);
 
    procedure Release_String is
      new Ada.Unchecked_Deallocation (String,
@@ -86,14 +86,14 @@
    function Search (Key : String) return Help_Line_Access;
    procedure Release_Help (Root : in out Help_Line_Access);
 
-   procedure Explain (Key : in String)
+   procedure Explain (Key : String)
    is
    begin
       Explain (Key, Null_Window);
    end Explain;
 
-   procedure Explain (Key : in String;
-                      Win : in Window)
+   procedure Explain (Key : String;
+                      Win : Window)
    is
       --  Retrieve the text associated with this key and display it in this
       --  window. If no window argument is passed, the routine will create
@@ -360,7 +360,7 @@
       Explain (Context);
    end Explain_Context;
 
-   procedure Notepad (Key : in String)
+   procedure Notepad (Key : String)
    is
       H : constant Help_Line_Access := Search (Key);
       T : Help_Line_Access := H;
diff -Naur ncurses-5.7.orig/Ada95/samples/sample-explanation.ads ncurses-5.7/Ada95/samples/sample-explanation.ads
--- ncurses-5.7.orig/Ada95/samples/sample-explanation.ads	2003-10-25 11:39:18.000000000 -0400
+++ ncurses-5.7/Ada95/samples/sample-explanation.ads	2011-01-08 18:13:50.303157123 -0500
@@ -7,7 +7,7 @@
 --                                 S P E C                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,7 +35,7 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control
---  $Revision: 1.10 $
+--  $Revision: 1.11 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 --  Poor mans help system. This scans a sequential file for key lines and
@@ -44,13 +44,13 @@
 --
 package Sample.Explanation is
 
-   procedure Explain (Key : in String);
+   procedure Explain (Key : String);
    --  Retrieve the text associated with this key and display it.
 
    procedure Explain_Context;
    --  Explain the current context.
 
-   procedure Notepad (Key : in String);
+   procedure Notepad (Key : String);
    --  Put a note on the screen and maintain it with the context
 
    Explanation_Not_Found : exception;
diff -Naur ncurses-5.7.orig/Ada95/samples/sample-form_demo-aux.adb ncurses-5.7/Ada95/samples/sample-form_demo-aux.adb
--- ncurses-5.7.orig/Ada95/samples/sample-form_demo-aux.adb	2004-08-21 17:37:00.000000000 -0400
+++ ncurses-5.7/Ada95/samples/sample-form_demo-aux.adb	2011-01-08 18:13:50.303157123 -0500
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998,2004 Free Software Foundation, Inc.                   --
+-- Copyright (c) 1998-2004,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,8 +35,8 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control
---  $Revision: 1.16 $
---  $Date: 2004/08/21 21:37:00 $
+--  $Revision: 1.17 $
+--  $Date: 2009/12/26 17:38:58 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with Ada.Characters.Latin_1; use Ada.Characters.Latin_1;
@@ -48,7 +48,7 @@
 
 package body Sample.Form_Demo.Aux is
 
-   procedure Geometry (F  : in  Form;
+   procedure Geometry (F  : Form;
                        L  : out Line_Count;        -- Lines used for menu
                        C  : out Column_Count;      -- Columns used for menu
                        Y  : out Line_Position;     -- Proposed Line for menu
@@ -105,7 +105,7 @@
       return Pan;
    end Create;
 
-   procedure Destroy (F : in Form;
+   procedure Destroy (F : Form;
                       P : in out Panel)
    is
       W, S : Window;
diff -Naur ncurses-5.7.orig/Ada95/samples/sample-form_demo-aux.ads ncurses-5.7/Ada95/samples/sample-form_demo-aux.ads
--- ncurses-5.7.orig/Ada95/samples/sample-form_demo-aux.ads	2003-10-25 11:39:18.000000000 -0400
+++ ncurses-5.7/Ada95/samples/sample-form_demo-aux.ads	2011-01-08 18:13:50.303157123 -0500
@@ -7,7 +7,7 @@
 --                                 S P E C                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,7 +35,7 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control
---  $Revision: 1.9 $
+--  $Revision: 1.10 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with Terminal_Interface.Curses; use  Terminal_Interface.Curses;
@@ -44,7 +44,7 @@
 
 package Sample.Form_Demo.Aux is
 
-   procedure Geometry (F  : in  Form;
+   procedure Geometry (F  : Form;
                        L  : out Line_Count;
                        C  : out Column_Count;
                        Y  : out Line_Position;
@@ -59,7 +59,7 @@
    --  Create a panel decorated with a frame and the title at the specified
    --  position. The dimension of the panel is derived from the menus layout.
 
-   procedure Destroy (F : in Form;
+   procedure Destroy (F : Form;
                       P : in out Panel);
    --  Destroy all the windowing structures associated with this menu and
    --  panel.
diff -Naur ncurses-5.7.orig/Ada95/samples/sample-form_demo-handler.adb ncurses-5.7/Ada95/samples/sample-form_demo-handler.adb
--- ncurses-5.7.orig/Ada95/samples/sample-form_demo-handler.adb	2004-08-21 17:37:00.000000000 -0400
+++ ncurses-5.7/Ada95/samples/sample-form_demo-handler.adb	2011-01-08 18:13:50.303157123 -0500
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998,2004 Free Software Foundation, Inc.                   --
+-- Copyright (c) 1998-2004,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,8 +35,8 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control
---  $Revision: 1.13 $
---  $Date: 2004/08/21 21:37:00 $
+--  $Revision: 1.14 $
+--  $Date: 2009/12/26 17:38:58 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with Sample.Form_Demo.Aux;
@@ -45,8 +45,8 @@
 
    package Aux renames Sample.Form_Demo.Aux;
 
-   procedure Drive_Me (F     : in Form;
-                       Title : in String := "")
+   procedure Drive_Me (F     : Form;
+                       Title : String := "")
    is
       L : Line_Count;
       C : Column_Count;
@@ -57,10 +57,10 @@
       Drive_Me (F, Y, X, Title);
    end Drive_Me;
 
-   procedure Drive_Me (F     : in Form;
-                       Lin   : in Line_Position;
-                       Col   : in Column_Position;
-                       Title : in String := "")
+   procedure Drive_Me (F     : Form;
+                       Lin   : Line_Position;
+                       Col   : Column_Position;
+                       Title : String := "")
    is
       Pan : Panel := Aux.Create (F, Title, Lin, Col);
       V   : Cursor_Visibility := Normal;
diff -Naur ncurses-5.7.orig/Ada95/samples/sample-form_demo-handler.ads ncurses-5.7/Ada95/samples/sample-form_demo-handler.ads
--- ncurses-5.7.orig/Ada95/samples/sample-form_demo-handler.ads	2003-10-25 11:39:18.000000000 -0400
+++ ncurses-5.7/Ada95/samples/sample-form_demo-handler.ads	2011-01-08 18:13:50.303157123 -0500
@@ -7,7 +7,7 @@
 --                                 S P E C                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,7 +35,7 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control
---  $Revision: 1.9 $
+--  $Revision: 1.10 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with Terminal_Interface.Curses;
@@ -51,14 +51,14 @@
                              Pan : Panel) return Boolean;
 package Sample.Form_Demo.Handler is
 
-   procedure Drive_Me (F     : in Form;
-                       Lin   : in Line_Position;
-                       Col   : in Column_Position;
-                       Title : in String := "");
+   procedure Drive_Me (F     : Form;
+                       Lin   : Line_Position;
+                       Col   : Column_Position;
+                       Title : String := "");
    --  Position the menu at the given point and drive it.
 
-   procedure Drive_Me (F     : in Form;
-                       Title : in String := "");
+   procedure Drive_Me (F     : Form;
+                       Title : String := "");
    --  Center menu and drive it.
 
 end Sample.Form_Demo.Handler;
diff -Naur ncurses-5.7.orig/Ada95/samples/sample-function_key_setting.adb ncurses-5.7/Ada95/samples/sample-function_key_setting.adb
--- ncurses-5.7.orig/Ada95/samples/sample-function_key_setting.adb	2004-08-21 17:37:00.000000000 -0400
+++ ncurses-5.7/Ada95/samples/sample-function_key_setting.adb	2011-01-08 18:13:50.303157123 -0500
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998,2004 Free Software Foundation, Inc.                   --
+-- Copyright (c) 1998-2004,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,8 +35,8 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control
---  $Revision: 1.13 $
---  $Date: 2004/08/21 21:37:00 $
+--  $Revision: 1.14 $
+--  $Date: 2009/12/26 17:38:58 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with Ada.Unchecked_Deallocation;
@@ -81,8 +81,8 @@
 
    Top_Of_Stack : Env_Ptr := null;
 
-   procedure Push_Environment (Key   : in String;
-                               Reset : in Boolean := True)
+   procedure Push_Environment (Key   : String;
+                               Reset : Boolean := True)
    is
       P : constant Env_Ptr := new Key_Environment (Number_Of_Keys);
    begin
@@ -160,7 +160,7 @@
       end if;
    end Find_Context;
 
-   procedure Notepad_To_Context (Pan : in Panel)
+   procedure Notepad_To_Context (Pan : Panel)
    is
       W : Window;
    begin
diff -Naur ncurses-5.7.orig/Ada95/samples/sample-function_key_setting.ads ncurses-5.7/Ada95/samples/sample-function_key_setting.ads
--- ncurses-5.7.orig/Ada95/samples/sample-function_key_setting.ads	2003-10-25 11:39:18.000000000 -0400
+++ ncurses-5.7/Ada95/samples/sample-function_key_setting.ads	2011-01-08 18:13:50.303157123 -0500
@@ -7,7 +7,7 @@
 --                                 S P E C                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,7 +35,7 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control
---  $Revision: 1.9 $
+--  $Revision: 1.10 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with Terminal_Interface.Curses; use Terminal_Interface.Curses;
@@ -45,8 +45,8 @@
 --
 package Sample.Function_Key_Setting is
 
-   procedure Push_Environment (Key   : in String;
-                               Reset : in Boolean := True);
+   procedure Push_Environment (Key   : String;
+                               Reset : Boolean := True);
    --  Push the definition of the current function keys on an internal
    --  stack. If the reset flag is true, all labels are reset while
    --  pushed, so the new environment can assume a tabula rasa.
@@ -68,7 +68,7 @@
    --  Look for a context, return true if it is in the stack,
    --  false otherwise.
 
-   procedure Notepad_To_Context (Pan : in Panel);
+   procedure Notepad_To_Context (Pan : Panel);
    --  Add a panel representing a notepad to the current context.
 
    Function_Key_Stack_Error : exception;
diff -Naur ncurses-5.7.orig/Ada95/samples/sample-header_handler.adb ncurses-5.7/Ada95/samples/sample-header_handler.adb
--- ncurses-5.7.orig/Ada95/samples/sample-header_handler.adb	2006-06-25 10:30:22.000000000 -0400
+++ ncurses-5.7/Ada95/samples/sample-header_handler.adb	2011-01-08 18:13:50.303157123 -0500
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998-2004,2006 Free Software Foundation, Inc.              --
+-- Copyright (c) 1998-2006,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,8 +35,8 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control
---  $Revision: 1.16 $
---  $Date: 2006/06/25 14:30:22 $
+--  $Revision: 1.17 $
+--  $Date: 2009/12/26 17:38:58 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with Ada.Calendar; use Ada.Calendar;
@@ -65,7 +65,7 @@
                                 Columns : Column_Count) return Integer;
    pragma Convention (C, Init_Header_Window);
 
-   procedure Internal_Update_Header_Window (Do_Update : in Boolean);
+   procedure Internal_Update_Header_Window (Do_Update : Boolean);
 
    --  The initialization must be called before Init_Screen. It steals two
    --  lines from the top of the screen.
@@ -75,11 +75,11 @@
       Rip_Off_Lines (2, Init_Header_Window'Access);
    end Init_Header_Handler;
 
-   procedure N_Out (N : in Integer);
+   procedure N_Out (N : Integer);
 
    --  Emit a two digit number and ensure that a leading zero is generated if
    --  necessary.
-   procedure N_Out (N : in Integer)
+   procedure N_Out (N : Integer)
    is
    begin
       if N < 10 then
@@ -92,7 +92,7 @@
 
    --  Paint the header window. The input parameter is a flag indicating
    --  whether or not the screen should be updated physically after painting.
-   procedure Internal_Update_Header_Window (Do_Update : in Boolean)
+   procedure Internal_Update_Header_Window (Do_Update : Boolean)
    is
       type Month_Name_Array is
          array (Month_Number'First .. Month_Number'Last) of String (1 .. 9);
diff -Naur ncurses-5.7.orig/Ada95/samples/sample-helpers.adb ncurses-5.7/Ada95/samples/sample-helpers.adb
--- ncurses-5.7.orig/Ada95/samples/sample-helpers.adb	2008-07-26 14:48:08.000000000 -0400
+++ ncurses-5.7/Ada95/samples/sample-helpers.adb	2011-01-08 18:13:50.307157046 -0500
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998-2006,2008 Free Software Foundation, Inc.              --
+-- Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,8 +35,8 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control
---  $Revision: 1.12 $
---  $Date: 2008/07/26 18:48:08 $
+--  $Revision: 1.13 $
+--  $Date: 2009/12/26 17:38:58 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with Sample.Explanation; use Sample.Explanation;
@@ -46,8 +46,8 @@
 --
 package body Sample.Helpers is
 
-   procedure Window_Title (Win   : in Window;
-                           Title : in String)
+   procedure Window_Title (Win   : Window;
+                           Title : String)
    is
       Height : Line_Count;
       Width  : Column_Count;
diff -Naur ncurses-5.7.orig/Ada95/samples/sample-helpers.ads ncurses-5.7/Ada95/samples/sample-helpers.ads
--- ncurses-5.7.orig/Ada95/samples/sample-helpers.ads	2003-10-25 11:39:18.000000000 -0400
+++ ncurses-5.7/Ada95/samples/sample-helpers.ads	2011-01-08 18:13:50.307157046 -0500
@@ -7,7 +7,7 @@
 --                                 S P E C                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,7 +35,7 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control
---  $Revision: 1.9 $
+--  $Revision: 1.10 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with Terminal_Interface.Curses; use Terminal_Interface.Curses;
@@ -45,8 +45,8 @@
 --
 package Sample.Helpers is
 
-   procedure Window_Title (Win   : in Window;
-                           Title : in String);
+   procedure Window_Title (Win   : Window;
+                           Title : String);
    --  Put a title string into the first line of the window
 
    procedure Not_Implemented;
diff -Naur ncurses-5.7.orig/Ada95/samples/sample-menu_demo-aux.adb ncurses-5.7/Ada95/samples/sample-menu_demo-aux.adb
--- ncurses-5.7.orig/Ada95/samples/sample-menu_demo-aux.adb	2006-06-25 10:30:22.000000000 -0400
+++ ncurses-5.7/Ada95/samples/sample-menu_demo-aux.adb	2011-01-08 18:13:50.307157046 -0500
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998,2006 Free Software Foundation, Inc.                   --
+-- Copyright (c) 1998-2006,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,8 +35,8 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control
---  $Revision: 1.13 $
---  $Date: 2006/06/25 14:30:22 $
+--  $Revision: 1.14 $
+--  $Date: 2009/12/26 17:38:58 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with Ada.Characters.Latin_1; use Ada.Characters.Latin_1;
@@ -48,7 +48,7 @@
 
 package body Sample.Menu_Demo.Aux is
 
-   procedure Geometry (M  : in  Menu;
+   procedure Geometry (M  : Menu;
                        L  : out Line_Count;
                        C  : out Column_Count;
                        Y  : out Line_Position;
@@ -56,7 +56,7 @@
                        Fy : out Line_Position;
                        Fx : out Column_Position);
 
-   procedure Geometry (M  : in  Menu;
+   procedure Geometry (M  : Menu;
                        L  : out Line_Count;        -- Lines used for menu
                        C  : out Column_Count;      -- Columns used for menu
                        Y  : out Line_Position;     -- Proposed Line for menu
@@ -82,11 +82,11 @@
 
    end Geometry;
 
-   procedure Geometry (M : in  Menu;
+   procedure Geometry (M : Menu;
                        L : out Line_Count;        -- Lines used for menu
                        C : out Column_Count;      -- Columns used for menu
                        Y : out Line_Position;     -- Proposed Line for menu
-                       X  : out Column_Position)  -- Proposed Column for menu
+                       X : out Column_Position)   -- Proposed Column for menu
    is
       Fy : Line_Position;
       Fx : Column_Position;
@@ -134,7 +134,7 @@
       return Pan;
    end Create;
 
-   procedure Destroy (M : in Menu;
+   procedure Destroy (M : Menu;
                       P : in out Panel)
    is
       W, S : Window;
diff -Naur ncurses-5.7.orig/Ada95/samples/sample-menu_demo-aux.ads ncurses-5.7/Ada95/samples/sample-menu_demo-aux.ads
--- ncurses-5.7.orig/Ada95/samples/sample-menu_demo-aux.ads	2003-10-25 11:39:18.000000000 -0400
+++ ncurses-5.7/Ada95/samples/sample-menu_demo-aux.ads	2011-01-08 18:13:50.307157046 -0500
@@ -7,7 +7,7 @@
 --                                 S P E C                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,7 +35,7 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control
---  $Revision: 1.9 $
+--  $Revision: 1.10 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with Terminal_Interface.Curses; use  Terminal_Interface.Curses;
@@ -44,7 +44,7 @@
 
 package Sample.Menu_Demo.Aux is
 
-   procedure Geometry (M  : in  Menu;
+   procedure Geometry (M  : Menu;
                        L  : out Line_Count;
                        C  : out Column_Count;
                        Y  : out Line_Position;
@@ -59,7 +59,7 @@
    --  Create a panel decorated with a frame and the title at the specified
    --  position. The dimension of the panel is derived from the menus layout.
 
-   procedure Destroy (M : in Menu;
+   procedure Destroy (M : Menu;
                       P : in out Panel);
    --  Destroy all the windowing structures associated with this menu and
    --  panel.
diff -Naur ncurses-5.7.orig/Ada95/samples/sample-menu_demo-handler.adb ncurses-5.7/Ada95/samples/sample-menu_demo-handler.adb
--- ncurses-5.7.orig/Ada95/samples/sample-menu_demo-handler.adb	2004-08-21 17:37:00.000000000 -0400
+++ ncurses-5.7/Ada95/samples/sample-menu_demo-handler.adb	2011-01-08 18:13:50.307157046 -0500
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998,2004 Free Software Foundation, Inc.                   --
+-- Copyright (c) 1998-2004,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -15,7 +15,7 @@
 -- 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:                 --
+-- 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.                   --
@@ -35,8 +35,8 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control
---  $Revision: 1.15 $
---  $Date: 2004/08/21 21:37:00 $
+--  $Revision: 1.16 $
+--  $Date: 2009/12/26 17:38:58 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with Sample.Menu_Demo.Aux;
@@ -47,8 +47,8 @@
 
    package Aux renames Sample.Menu_Demo.Aux;
 
-   procedure Drive_Me (M     : in Menu;
-                       Title : in String := "")
+   procedure Drive_Me (M     : Menu;
+                       Title : String := "")
    is
       L : Line_Count;
       C : Column_Count;
@@ -59,10 +59,10 @@
       Drive_Me (M, Y, X, Title);
    end Drive_Me;
 
-   procedure Drive_Me (M     : in Menu;
-                       Lin   : in Line_Position;
-                       Col   : in Column_Position;
-                       Title : in String := "")
+   procedure Drive_Me (M     : Menu;
+                       Lin   : Line_Position;
+                       Col   : Column_Position;
+                       Title : String := "")
    is
       Mask : Event_Mask := No_Events;
       Old  : Event_Mask;
diff -Naur ncurses-5.7.orig/Ada95/samples/sample-menu_demo-handler.ads ncurses-5.7/Ada95/samples/sample-menu_demo-handler.ads
--- ncurses-5.7.orig/Ada95/samples/sample-menu_demo-handler.ads	2003-10-25 11:39:18.000000000 -0400
+++ ncurses-5.7/Ada95/samples/sample-menu_demo-handler.ads	2011-01-08 18:13:50.307157046 -0500
@@ -7,7 +7,7 @@
 --                                 S P E C                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,7 +35,7 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control
---  $Revision: 1.9 $
+--  $Revision: 1.10 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with Terminal_Interface.Curses;
@@ -51,14 +51,14 @@
                              Pan : Panel) return Boolean;
 package Sample.Menu_Demo.Handler is
 
-   procedure Drive_Me (M     : in Menu;
-                       Lin   : in Line_Position;
-                       Col   : in Column_Position;
-                       Title : in String := "");
+   procedure Drive_Me (M     : Menu;
+                       Lin   : Line_Position;
+                       Col   : Column_Position;
+                       Title : String := "");
    --  Position the menu at the given point and drive it.
 
-   procedure Drive_Me (M     : in Menu;
-                       Title : in String := "");
+   procedure Drive_Me (M     : Menu;
+                       Title : String := "");
    --  Center menu and drive it.
 
 end Sample.Menu_Demo.Handler;
diff -Naur ncurses-5.7.orig/Ada95/src/Makefile.in ncurses-5.7/Ada95/src/Makefile.in
--- ncurses-5.7.orig/Ada95/src/Makefile.in	2007-09-15 14:22:24.000000000 -0400
+++ ncurses-5.7/Ada95/src/Makefile.in	2011-01-08 18:18:29.554659961 -0500
@@ -1,5 +1,5 @@
 ##############################################################################
-# Copyright (c) 1998-2003,2004 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 "Software"), #
@@ -28,25 +28,33 @@
 #
 #  Author:  Juergen Pfeifer, 1996
 #
-#  $Id: Makefile.in,v 1.31 2007/09/15 18:22:24 tom Exp $
+#  $Id: Makefile.in,v 1.53 2010/11/27 22:14:16 tom Exp $
 #
 .SUFFIXES:
 
 SHELL		= /bin/sh
+VPATH		= @srcdir@
 THIS		= Makefile
 
 MODEL		= ../../@DFT_OBJ_SUBDIR@
+
 DESTDIR		= @DESTDIR@
+
+top_srcdir	= @top_srcdir@
 srcdir		= @srcdir@
 prefix		= @prefix@
 exec_prefix	= @exec_prefix@
-ADA_INCLUDE	= @ADA_INCLUDE@
+libdir		= ${exec_prefix}/lib
+
+LIBDIR		= $(DESTDIR)$(libdir)
+ADA_INCLUDE	= $(DESTDIR)@ADA_INCLUDE@
+ADA_OBJECTS	= $(DESTDIR)@ADA_OBJECTS@
 
 INSTALL		= @INSTALL@
-INSTALL_DATA	= @INSTALL_DATA@
+INSTALL_LIB	= @INSTALL@ @INSTALL_LIB@
 
 AR		= @AR@
-AR_OPTS		= @AR_OPTS@
+ARFLAGS		= @ARFLAGS@
 AWK		= @AWK@
 LN_S		= @LN_S@
 
@@ -69,60 +77,58 @@
 LDFLAGS		= @LDFLAGS@ @LD_MODEL@ @LIBS@
 
 RANLIB		= @RANLIB@
+
 ################################################################################
 ADA             = @cf_ada_compiler@
 ADAPREP		= gnatprep
 ADAFLAGS        = @ADAFLAGS@ -I. -I$(srcdir)
 
+LIB_NAME	= AdaCurses
+SONAME		= @ADA_SHAREDLIB@
+
+GNAT_PROJECT	= $(srcdir)/library.gpr
+
+# build/source are the Ada95 tree
+BUILD_DIR	= ..
+SOURCE_DIR	= ..
+
+BUILD_DIR_LIB	= $(BUILD_DIR)/lib
+SOURCE_DIR_SRC	= $(SOURCE_DIR)/src
+
 ADAMAKE         = @cf_ada_make@
-ADAMAKEFLAGS    = 
+ADAMAKEFLAGS    = \
+	-P$(GNAT_PROJECT) \
+	-XBUILD_DIR=`cd $(BUILD_DIR);pwd` \
+	-XSOURCE_DIR=`cd $(SOURCE_DIR);pwd` \
+	-XSOURCE_DIR2=`cd $(srcdir);pwd` \
+	-XLIB_NAME=$(LIB_NAME) \
+	-XSONAME=$(SONAME)
 
 CARGS           = -cargs $(ADAFLAGS)
 LARGS           =
 
+STATIC_LIBNAME	= lib$(LIB_NAME).a
+SHARED_LIBNAME	= $(SONAME)
+SHARED_SYMLINK	= lib$(LIB_NAME).so
+
 ALIB            = @cf_ada_package@
 ABASE           = $(ALIB)-curses
-
-LIBALIS=$(ALIB).ali              			\
-	$(ABASE)-aux.ali         			\
-	$(ABASE).ali             		        \
-	$(ABASE)-terminfo.ali				\
-	$(ABASE)-termcap.ali				\
-	$(ABASE)-putwin.ali				\
-	$(ABASE)-trace.ali				\
-	$(ABASE)-mouse.ali       			\
-	$(ABASE)-panels.ali      			\
-	$(ABASE)-menus.ali       			\
-	$(ABASE)-forms.ali       			\
-	$(ABASE)-forms-field_types.ali	        	\
-	$(ABASE)-forms-field_types-alpha.ali      	\
-	$(ABASE)-forms-field_types-alphanumeric.ali     \
-	$(ABASE)-forms-field_types-intfield.ali      	\
-	$(ABASE)-forms-field_types-numeric.ali      	\
-	$(ABASE)-forms-field_types-regexp.ali      	\
-	$(ABASE)-forms-field_types-enumeration.ali      \
-	$(ABASE)-forms-field_types-ipv4_address.ali     \
-	$(ABASE)-forms-field_types-user.ali	      	\
-	$(ABASE)-forms-field_types-user-choice.ali     	\
-	$(ABASE)-text_io.ali     			\
-	$(ABASE)-text_io-aux.ali
-
-# Ada Library files for generic packages. Since gnat 3.10 they are
-# also compiled
-GENALIS=$(ABASE)-menus-menu_user_data.ali		\
-	$(ABASE)-menus-item_user_data.ali		\
-	$(ABASE)-forms-form_user_data.ali		\
-	$(ABASE)-forms-field_user_data.ali		\
-	$(ABASE)-forms-field_types-enumeration-ada.ali	\
-	$(ABASE)-panels-user_data.ali			\
-	$(ABASE)-text_io-integer_io.ali			\
-	$(ABASE)-text_io-float_io.ali			\
-	$(ABASE)-text_io-fixed_io.ali			\
-	$(ABASE)-text_io-decimal_io.ali			\
-	$(ABASE)-text_io-enumeration_io.ali		\
-	$(ABASE)-text_io-modular_io.ali			\
-	$(ABASE)-text_io-complex_io.ali
-
+################################################################################
+GENERATED_SOURCES=$(ABASE).ads         			\
+		  $(ABASE).adb         			\
+	          $(ABASE)-aux.ads   			\
+	          $(ABASE)-trace.ads   			\
+	          $(ABASE)-menus.ads   			\
+	          $(ABASE)-forms.ads   			\
+	          $(ABASE)-mouse.ads 			\
+	          $(ABASE)-panels.ads			\
+	          $(ABASE)-menus-menu_user_data.ads	\
+	          $(ABASE)-menus-item_user_data.ads	\
+	          $(ABASE)-forms-form_user_data.ads	\
+	          $(ABASE)-forms-field_types.ads	\
+	          $(ABASE)-forms-field_user_data.ads	\
+	          $(ABASE)-panels-user_data.ads
+################################################################################
 LIBOBJS=$(ALIB).o                			\
 	$(ABASE)-aux.o           			\
 	$(ABASE).o               			\
@@ -163,34 +169,41 @@
 	$(ABASE)-text_io-modular_io.o			\
 	$(ABASE)-text_io-complex_io.o
 
-
-all ::  libAdaCurses.a
+all ::  $(BUILD_DIR_LIB)/$(STATIC_LIBNAME)
 	@echo done
 
-libAdaCurses.a :: dotouch $(LIBOBJS) @cf_generic_objects@
-	$(AR) $(AR_OPTS) $@ $(LIBOBJS) @cf_generic_objects@
-
-dotouch :
-	@sh -c 'for f in $(LIBALIS) $(GENALIS); do test -f $$f || touch $$f; done'
+$(ADA_INCLUDE) \
+$(ADA_OBJECTS) \
+$(LIBDIR) \
+$(BUILD_DIR_LIB) :
+	mkdir -p $@
 
 sources :
 	@echo made $@
 
 libs \
 install \
-install.libs \
+install.libs :: \
+		$(BUILD_DIR_LIB)/$(STATIC_LIBNAME)
+	@echo made $(STATIC_LIBNAME)
+
+install \
+install.libs :: \
+		$(BUILD_DIR_LIB)/$(STATIC_LIBNAME) \
+		$(ADA_OBJECTS)
+	@$(INSTALL_LIB) \
+		$(BUILD_DIR_LIB)/$(STATIC_LIBNAME) \
+		$(ADA_OBJECTS)
+
 uninstall \
 uninstall.libs ::
-	@echo made $@
-
-generics: $(GENALIS)
-	@echo made $@
+	@rm -f $(ADA_OBJECTS)/$(STATIC_LIBNAME)
 
 mostlyclean ::
 	rm -f *.o *.ali b_t*.* *.s $(PROGS) a.out core b_*_test.c *.xr[bs] *.a
 
 clean :: mostlyclean
-	rm -f $(LIBALIS) $(GENALIS) $(LIBOBJS) $(GENOBJS) $(ABASE)-trace.adb
+	rm -f $(ABASE)-trace.adb
 
 distclean :: clean
 	rm -f Makefile
@@ -199,190 +212,93 @@
 
 BASEDEPS=$(ABASE).ads $(ABASE)-aux.ads $(ABASE).adb
 
-$(ALIB).o: $(srcdir)/$(ALIB).ads
-	$(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ALIB).ads
-
-
-$(ABASE)-aux.o: $(srcdir)/$(ABASE)-aux.adb $(BASEDEPS)
-	$(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-aux.adb
-
-
-$(ABASE).o: $(ABASE).adb $(BASEDEPS)
-	$(ADA) $(ADAFLAGS) -c -o $@ $(ABASE).adb
-
+$(ABASE)-trace.adb : $(srcdir)/$(ABASE)-trace.adb_p
+	rm -f $@
+	$(ADAPREP) -DADA_TRACE=@ADA_TRACE@ -DPRAGMA_UNREF=@PRAGMA_UNREF@ $(srcdir)/$(ABASE)-trace.adb_p $@
 
-$(ABASE)-terminfo.o: \
-		$(srcdir)/$(ABASE)-terminfo.ads \
-		$(srcdir)/$(ABASE)-terminfo.adb $(BASEDEPS)
-	$(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-terminfo.adb
+###############################################################################
 
+@USE_OLD_MAKERULES@$(BUILD_DIR_LIB)/$(STATIC_LIBNAME) :: \
+@USE_OLD_MAKERULES@		$(BUILD_DIR_LIB) \
+@USE_OLD_MAKERULES@		$(LIBOBJS) @cf_generic_objects@
+@USE_OLD_MAKERULES@	$(AR) $(ARFLAGS) $@ $(LIBOBJS) @cf_generic_objects@
+
+$(BUILD_DIR)/static-ali : ; mkdir -p $@
+$(BUILD_DIR)/static-obj : ; mkdir -p $@
+
+STATIC_DIRS = \
+	$(BUILD_DIR_LIB) \
+	$(BUILD_DIR)/static-ali \
+	$(BUILD_DIR)/static-obj
+
+@USE_GNAT_PROJECTS@$(BUILD_DIR_LIB)/$(STATIC_LIBNAME) :: \
+@USE_GNAT_PROJECTS@		$(ABASE)-trace.adb \
+@USE_GNAT_PROJECTS@		$(STATIC_DIRS)
+@USE_GNAT_PROJECTS@	$(ADAMAKE) $(ADAMAKEFLAGS) -XLIB_KIND=static
+@USE_GNAT_PROJECTS@
+@USE_GNAT_PROJECTS@install \
+@USE_GNAT_PROJECTS@install.libs :: \
+@USE_GNAT_PROJECTS@		$(ADA_OBJECTS)
+@USE_GNAT_PROJECTS@	$(INSTALL_LIB) \
+@USE_GNAT_PROJECTS@		$(BUILD_DIR)/static-ali/*.ali \
+@USE_GNAT_PROJECTS@		$(ADA_OBJECTS)
 
-$(ABASE)-termcap.o: \
-		$(srcdir)/$(ABASE)-termcap.ads \
-		$(srcdir)/$(ABASE)-termcap.adb $(BASEDEPS)
-	$(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-termcap.adb
+uninstall \
+uninstall.libs ::
+	@rm -f $(ADA_OBJECTS)/$(STATIC_LIBNAME)
 
+@USE_GNAT_PROJECTS@uninstall \
+@USE_GNAT_PROJECTS@uninstall.libs ::
+@USE_GNAT_PROJECTS@	@$(SHELL) -c 'for name in $(BUILD_DIR)/static-ali/*.ali ; do rm -f $(ADA_OBJECTS)/`basename $$name`; done'
+
+$(BUILD_DIR)/dynamic-ali : ; mkdir -p $@
+$(BUILD_DIR)/dynamic-obj : ; mkdir -p $@
+
+SHARED_DIRS = \
+	$(BUILD_DIR_LIB) \
+	$(BUILD_DIR)/dynamic-ali \
+	$(BUILD_DIR)/dynamic-obj
+
+@MAKE_ADA_SHAREDLIB@all \
+@MAKE_ADA_SHAREDLIB@$(BUILD_DIR_LIB)/$(SHARED_LIBNAME) :: $(ABASE)-trace.adb $(SHARED_DIRS)
+@MAKE_ADA_SHAREDLIB@	$(ADAMAKE) $(ADAMAKEFLAGS) -XLIB_KIND=dynamic
 
-$(ABASE)-putwin.o: \
-		$(srcdir)/$(ABASE)-putwin.ads \
-		$(srcdir)/$(ABASE)-putwin.adb $(BASEDEPS)
-	$(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-putwin.adb
+install \
+install.libs :: $(ADA_INCLUDE)
+	$(INSTALL_LIB) \
+		$(SOURCE_DIR_SRC)/*.ad[sb] \
+		$(ADA_INCLUDE)
 
+install \
+install.libs :: $(ADA_INCLUDE)
+	$(INSTALL_LIB) \
+		$(GENERATED_SOURCES) \
+		$(ADA_INCLUDE)
 
-$(ABASE)-trace.adb : $(srcdir)/$(ABASE)-trace.adb_p
-	rm -f $@
-	$(ADAPREP) -DADA_TRACE=@ADA_TRACE@ -DPRAGMA_UNREF=@PRAGMA_UNREF@ $(srcdir)/$(ABASE)-trace.adb_p $@
+uninstall \
+uninstall.libs ::
+	$(SHELL) -c 'for name in $(SOURCE_DIR_SRC)/*.ad[sb] $(GENERATED_SOURCES); do rm -f $(ADA_INCLUDE)/`basename $$name`; done'
 
-$(ABASE)-trace.o: \
-		$(ABASE)-trace.ads \
-		$(ABASE)-trace.adb $(BASEDEPS)
-	$(ADA) $(ADAFLAGS) -c -o $@ $(ABASE)-trace.adb
-
-
-$(ABASE)-mouse.o: \
-		$(ABASE)-mouse.ads \
-		$(srcdir)/$(ABASE)-mouse.adb $(BASEDEPS)
-	$(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-mouse.adb
-
-
-$(ABASE)-panels.o: \
-		$(ABASE)-panels.ads \
-		$(srcdir)/$(ABASE)-panels.adb $(BASEDEPS)
-	$(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-panels.adb
-
-
-$(ABASE)-menus.o: \
-		$(ABASE)-menus.ads \
-		$(srcdir)/$(ABASE)-menus.adb $(BASEDEPS)
-	$(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-menus.adb
-
-
-$(ABASE)-forms.o: \
-		$(ABASE)-forms.ads \
-		$(srcdir)/$(ABASE)-forms.adb $(BASEDEPS)
-	$(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-forms.adb
-
-$(ABASE)-forms-field_types.o: \
-		$(ABASE)-forms-field_types.ads \
-		$(srcdir)/$(ABASE)-forms-field_types.adb $(BASEDEPS)
-	$(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-forms-field_types.adb
-
-$(ABASE)-forms-field_types-alpha.o: \
-		$(srcdir)/$(ABASE)-forms-field_types-alpha.ads \
-		$(srcdir)/$(ABASE)-forms-field_types-alpha.adb $(BASEDEPS)
-	$(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-forms-field_types-alpha.adb
-
-$(ABASE)-forms-field_types-alphanumeric.o: \
-		$(srcdir)/$(ABASE)-forms-field_types-alphanumeric.ads \
-		$(srcdir)/$(ABASE)-forms-field_types-alphanumeric.adb $(BASEDEPS)
-	$(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-forms-field_types-alphanumeric.adb
-
-$(ABASE)-forms-field_types-intfield.o: \
-		$(srcdir)/$(ABASE)-forms-field_types-intfield.ads \
-		$(srcdir)/$(ABASE)-forms-field_types-intfield.adb $(BASEDEPS)
-	$(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-forms-field_types-intfield.adb
-
-$(ABASE)-forms-field_types-numeric.o: \
-		$(srcdir)/$(ABASE)-forms-field_types-numeric.ads \
-		$(srcdir)/$(ABASE)-forms-field_types-numeric.adb $(BASEDEPS)
-	$(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-forms-field_types-numeric.adb
-
-$(ABASE)-forms-field_types-regexp.o: \
-		$(srcdir)/$(ABASE)-forms-field_types-regexp.ads \
-		$(srcdir)/$(ABASE)-forms-field_types-regexp.adb $(BASEDEPS)
-	$(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-forms-field_types-regexp.adb
-
-$(ABASE)-forms-field_types-enumeration.o: \
-		$(srcdir)/$(ABASE)-forms-field_types-enumeration.ads \
-		$(srcdir)/$(ABASE)-forms-field_types-enumeration.adb $(BASEDEPS)
-	$(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-forms-field_types-enumeration.adb
-
-$(ABASE)-forms-field_types-ipv4_address.o: \
-		$(srcdir)/$(ABASE)-forms-field_types-ipv4_address.ads \
-		$(srcdir)/$(ABASE)-forms-field_types-ipv4_address.adb $(BASEDEPS)
-	$(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-forms-field_types-ipv4_address.adb
-
-$(ABASE)-forms-field_types-user.o: \
-		$(srcdir)/$(ABASE)-forms-field_types-user.ads \
-		$(srcdir)/$(ABASE)-forms-field_types-user.adb $(BASEDEPS)
-	$(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-forms-field_types-user.adb
-
-$(ABASE)-forms-field_types-user-choice.o: \
-		$(srcdir)/$(ABASE)-forms-field_types-user-choice.ads \
-		$(srcdir)/$(ABASE)-forms-field_types-user-choice.adb $(BASEDEPS)
-	$(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-forms-field_types-user-choice.adb
-
-$(ABASE)-text_io.o: \
-		$(srcdir)/$(ABASE)-text_io.ads \
-		$(srcdir)/$(ABASE)-text_io.adb $(BASEDEPS)
-	$(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-text_io.adb
-
-$(ABASE)-text_io-aux.o: \
-		$(srcdir)/$(ABASE)-text_io-aux.ads \
-		$(srcdir)/$(ABASE)-text_io-aux.adb $(BASEDEPS)
-	$(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-text_io-aux.adb
-
-$(ABASE)-menus-menu_user_data.o: \
-		$(ABASE)-menus-menu_user_data.ads \
-		$(srcdir)/$(ABASE)-menus-menu_user_data.adb $(BASEDEPS)
-	$(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-menus-menu_user_data.adb
-
-$(ABASE)-menus-item_user_data.o: \
-		$(ABASE)-menus-item_user_data.ads \
-		$(srcdir)/$(ABASE)-menus-item_user_data.adb $(BASEDEPS)
-	$(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-menus-item_user_data.adb
-
-$(ABASE)-forms-form_user_data.o: \
-		$(ABASE)-forms-form_user_data.ads \
-		$(srcdir)/$(ABASE)-forms-form_user_data.adb $(BASEDEPS)
-	$(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-forms-form_user_data.adb
-
-$(ABASE)-forms-field_user_data.o: \
-		$(ABASE)-forms-field_user_data.ads \
-		$(srcdir)/$(ABASE)-forms-field_user_data.adb $(BASEDEPS)
-	$(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-forms-field_user_data.adb
-
-$(ABASE)-forms-field_types-enumeration-ada.o: \
-		$(srcdir)/$(ABASE)-forms-field_types-enumeration-ada.ads \
-		$(srcdir)/$(ABASE)-forms-field_types-enumeration-ada.adb $(BASEDEPS)
-	$(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-forms-field_types-enumeration-ada.adb
-
-$(ABASE)-panels-user_data.o: \
-		$(ABASE)-panels-user_data.ads \
-		$(srcdir)/$(ABASE)-panels-user_data.adb $(BASEDEPS)
-	$(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-panels-user_data.adb
-
-$(ABASE)-text_io-integer_io.o: \
-		$(srcdir)/$(ABASE)-text_io-integer_io.ads \
-		$(srcdir)/$(ABASE)-text_io-integer_io.adb $(BASEDEPS)
-	$(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-text_io-integer_io.adb
-
-$(ABASE)-text_io-float_io.o: \
-		$(srcdir)/$(ABASE)-text_io-float_io.ads \
-		$(srcdir)/$(ABASE)-text_io-float_io.adb $(BASEDEPS)
-	$(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-text_io-float_io.adb
-
-$(ABASE)-text_io-fixed_io.o: \
-		$(srcdir)/$(ABASE)-text_io-fixed_io.ads \
-		$(srcdir)/$(ABASE)-text_io-fixed_io.adb $(BASEDEPS)
-	$(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-text_io-fixed_io.adb
-
-$(ABASE)-text_io-decimal_io.o: \
-		$(srcdir)/$(ABASE)-text_io-decimal_io.ads \
-		$(srcdir)/$(ABASE)-text_io-decimal_io.adb $(BASEDEPS)
-	$(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-text_io-decimal_io.adb
-
-$(ABASE)-text_io-enumeration_io.o: \
-		$(srcdir)/$(ABASE)-text_io-enumeration_io.ads \
-		$(srcdir)/$(ABASE)-text_io-enumeration_io.adb $(BASEDEPS)
-	$(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-text_io-enumeration_io.adb
-
-$(ABASE)-text_io-modular_io.o: \
-		$(srcdir)/$(ABASE)-text_io-modular_io.ads \
-		$(srcdir)/$(ABASE)-text_io-modular_io.adb $(BASEDEPS)
-	$(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-text_io-modular_io.adb
-
-$(ABASE)-text_io-complex_io.o: \
-		$(srcdir)/$(ABASE)-text_io-complex_io.ads \
-		$(srcdir)/$(ABASE)-text_io-complex_io.adb $(BASEDEPS)
-	$(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-text_io-complex_io.adb
+@MAKE_ADA_SHAREDLIB@install \
+@MAKE_ADA_SHAREDLIB@install.libs :: $(ADA_OBJECTS)
+@MAKE_ADA_SHAREDLIB@	$(INSTALL_LIB) \
+@MAKE_ADA_SHAREDLIB@		$(BUILD_DIR)/dynamic-ali/* \
+@MAKE_ADA_SHAREDLIB@		$(ADA_OBJECTS)
+@MAKE_ADA_SHAREDLIB@	$(INSTALL_LIB) \
+@MAKE_ADA_SHAREDLIB@		$(BUILD_DIR_LIB)/$(SHARED_LIBNAME) \
+@MAKE_ADA_SHAREDLIB@		$(LIBDIR)
+@MAKE_ADA_SHAREDLIB@	cd $(LIBDIR) && ln -s $(SHARED_LIBNAME) $(SHARED_SYMLINK)
+@MAKE_ADA_SHAREDLIB@
+@MAKE_ADA_SHAREDLIB@uninstall \
+@MAKE_ADA_SHAREDLIB@uninstall.libs ::
+@MAKE_ADA_SHAREDLIB@	$(SHELL) -c 'for name in $(BUILD_DIR)/dynamic-ali/* ; do rm -f $(ADA_OBJECTS)/`basename $$name`; done'
+@MAKE_ADA_SHAREDLIB@
+@MAKE_ADA_SHAREDLIB@uninstall \
+@MAKE_ADA_SHAREDLIB@uninstall.libs ::
+@MAKE_ADA_SHAREDLIB@	rm -f $(LIBDIR)/$(SHARED_SYMLINK)
+@MAKE_ADA_SHAREDLIB@	rm -f $(LIBDIR)/$(SHARED_LIBNAME)
+
+clean ::
+	rm -rf $(BUILD_DIR)/*-ali
+	rm -rf $(BUILD_DIR)/*-obj
+	rm -rf $(BUILD_DIR_LIB)
diff -Naur ncurses-5.7.orig/Ada95/src/library.gpr ncurses-5.7/Ada95/src/library.gpr
--- ncurses-5.7.orig/Ada95/src/library.gpr	1969-12-31 19:00:00.000000000 -0500
+++ ncurses-5.7/Ada95/src/library.gpr	2011-01-08 18:18:29.558656121 -0500
@@ -0,0 +1,55 @@
+------------------------------------------------------------------------------
+-- 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: library.gpr,v 1.5 2010/11/27 22:15:04 tom Exp $
+-- http://gcc.gnu.org/onlinedocs/gnat_ugn_unw/Library-Projects.html
+-- http://www.adaworld.com/debian/debian-ada-policy.html
+project Library is
+  Build_Dir := External ("BUILD_DIR");
+  Source_Dir := External ("SOURCE_DIR");
+  Source_Dir2 := External ("SOURCE_DIR2");
+  Kind := External ("LIB_KIND");
+  for Library_Name use External ("LIB_NAME");
+  for Library_Version use External ("SONAME");
+
+  for Library_Kind use Kind;
+  for Library_Dir use Build_Dir & "/lib";
+  for Object_Dir use Build_Dir & "/" & Kind & "-obj";
+  for Library_ALI_Dir use Build_Dir & "/" & Kind & "-ali";
+  for Source_Dirs use (Source_Dir & "/src",
+                       Source_Dir2,
+                       Build_Dir & "/src");
+  package Compiler is
+     for Default_Switches ("Ada") use
+       ("-g",
+        "-O2",
+        "-gnatafno",
+        "-gnatVa",   -- All validity checks
+        "-gnatwa");  -- Activate all optional errors
+  end Compiler;
+
+end Library;
diff -Naur ncurses-5.7.orig/Ada95/src/modules ncurses-5.7/Ada95/src/modules
--- ncurses-5.7.orig/Ada95/src/modules	1969-12-31 19:00:00.000000000 -0500
+++ ncurses-5.7/Ada95/src/modules	2011-01-08 18:13:50.307157046 -0500
@@ -0,0 +1,70 @@
+# $Id: modules,v 1.3 2010/06/26 23:33:14 tom Exp $
+##############################################################################
+# 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.                                                             #
+##############################################################################
+#
+# Author: Thomas E. Dickey	2010
+#
+
+# Library objects
+# rootname				depend-spec	depend-body	unit
+$(ALIB)					$(srcdir)	none		spec
+$(ABASE)-aux				none		$(srcdir)	body
+$(ABASE)				none		.		body
+$(ABASE)-terminfo			$(srcdir)	$(srcdir)	body
+$(ABASE)-termcap			$(srcdir)	$(srcdir)	body
+$(ABASE)-putwin				$(srcdir)	$(srcdir)	body
+$(ABASE)-trace				.		.		body
+$(ABASE)-mouse				.		$(srcdir)	body
+$(ABASE)-panels				.		$(srcdir)	body
+$(ABASE)-menus				.		$(srcdir)	body
+$(ABASE)-forms				.		$(srcdir)	body
+$(ABASE)-forms-field_types		.		$(srcdir)	body
+$(ABASE)-forms-field_types-alpha	$(srcdir)	$(srcdir)	body
+$(ABASE)-forms-field_types-alphanumeric	$(srcdir)	$(srcdir)	body
+$(ABASE)-forms-field_types-intfield	$(srcdir)	$(srcdir)	body
+$(ABASE)-forms-field_types-numeric	$(srcdir)	$(srcdir)	body
+$(ABASE)-forms-field_types-regexp	$(srcdir)	$(srcdir)	body
+$(ABASE)-forms-field_types-enumeration	$(srcdir)	$(srcdir)	body
+$(ABASE)-forms-field_types-ipv4_address	$(srcdir)	$(srcdir)	body
+$(ABASE)-forms-field_types-user		$(srcdir)	$(srcdir)	body
+$(ABASE)-forms-field_types-user-choice	$(srcdir)	$(srcdir)	body
+$(ABASE)-text_io			$(srcdir)	$(srcdir)	body
+$(ABASE)-text_io-aux			$(srcdir)	$(srcdir)	body
+$(ABASE)-menus-menu_user_data		.		$(srcdir)	body
+$(ABASE)-menus-item_user_data		.		$(srcdir)	body
+$(ABASE)-forms-form_user_data		.		$(srcdir)	body
+$(ABASE)-forms-field_user_data		.		$(srcdir)	body
+$(ABASE)-forms-field_types-enumeration-ada $(srcdir)	$(srcdir)	body
+$(ABASE)-panels-user_data		.		$(srcdir)	body
+$(ABASE)-text_io-integer_io		$(srcdir)	$(srcdir)	body
+$(ABASE)-text_io-float_io		$(srcdir)	$(srcdir)	body
+$(ABASE)-text_io-fixed_io		$(srcdir)	$(srcdir)	body
+$(ABASE)-text_io-decimal_io		$(srcdir)	$(srcdir)	body
+$(ABASE)-text_io-enumeration_io		$(srcdir)	$(srcdir)	body
+$(ABASE)-text_io-modular_io		$(srcdir)	$(srcdir)	body
+$(ABASE)-text_io-complex_io		$(srcdir)	$(srcdir)	body
diff -Naur ncurses-5.7.orig/Ada95/src/terminal_interface-curses-aux.adb ncurses-5.7/Ada95/src/terminal_interface-curses-aux.adb
--- ncurses-5.7.orig/Ada95/src/terminal_interface-curses-aux.adb	2003-10-25 11:39:18.000000000 -0400
+++ ncurses-5.7/Ada95/src/terminal_interface-curses-aux.adb	2011-01-08 18:13:50.307157046 -0500
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,13 +35,13 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control:
---  $Revision: 1.10 $
+--  $Revision: 1.11 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 package body Terminal_Interface.Curses.Aux is
    --
    --  Some helpers
-   procedure Fill_String (Cp  : in  chars_ptr;
+   procedure Fill_String (Cp  : chars_ptr;
                           Str : out String)
    is
       --  Fill the string with the characters referenced by the
diff -Naur ncurses-5.7.orig/Ada95/src/terminal_interface-curses-forms-field_types-alpha.adb ncurses-5.7/Ada95/src/terminal_interface-curses-forms-field_types-alpha.adb
--- ncurses-5.7.orig/Ada95/src/terminal_interface-curses-forms-field_types-alpha.adb	2008-07-26 14:50:25.000000000 -0400
+++ ncurses-5.7/Ada95/src/terminal_interface-curses-forms-field_types-alpha.adb	2011-01-08 18:13:50.307157046 -0500
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998,2008 Free Software Foundation, Inc.                   --
+-- Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,16 +35,16 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control:
---  $Revision: 1.9 $
---  $Date: 2008/07/26 18:50:25 $
+--  $Revision: 1.10 $
+--  $Date: 2009/12/26 17:38:58 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
 
 package body Terminal_Interface.Curses.Forms.Field_Types.Alpha is
 
-   procedure Set_Field_Type (Fld : in Field;
-                             Typ : in Alpha_Field)
+   procedure Set_Field_Type (Fld : Field;
+                             Typ : Alpha_Field)
    is
       C_Alpha_Field_Type : C_Field_Type;
       pragma Import (C, C_Alpha_Field_Type, "TYPE_ALPHA");
diff -Naur ncurses-5.7.orig/Ada95/src/terminal_interface-curses-forms-field_types-alpha.ads ncurses-5.7/Ada95/src/terminal_interface-curses-forms-field_types-alpha.ads
--- ncurses-5.7.orig/Ada95/src/terminal_interface-curses-forms-field_types-alpha.ads	2003-10-25 11:39:18.000000000 -0400
+++ ncurses-5.7/Ada95/src/terminal_interface-curses-forms-field_types-alpha.ads	2011-01-08 18:13:50.307157046 -0500
@@ -7,7 +7,7 @@
 --                                 S P E C                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,7 +35,7 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control:
---  $Revision: 1.11 $
+--  $Revision: 1.12 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 package Terminal_Interface.Curses.Forms.Field_Types.Alpha is
@@ -46,8 +46,8 @@
         Minimum_Field_Width : Natural := 0;
      end record;
 
-   procedure Set_Field_Type (Fld : in Field;
-                             Typ : in Alpha_Field);
+   procedure Set_Field_Type (Fld : Field;
+                             Typ : Alpha_Field);
    pragma Inline (Set_Field_Type);
 
 end Terminal_Interface.Curses.Forms.Field_Types.Alpha;
diff -Naur ncurses-5.7.orig/Ada95/src/terminal_interface-curses-forms-field_types-alphanumeric.adb ncurses-5.7/Ada95/src/terminal_interface-curses-forms-field_types-alphanumeric.adb
--- ncurses-5.7.orig/Ada95/src/terminal_interface-curses-forms-field_types-alphanumeric.adb	2008-07-26 14:50:15.000000000 -0400
+++ ncurses-5.7/Ada95/src/terminal_interface-curses-forms-field_types-alphanumeric.adb	2011-01-08 18:13:50.307157046 -0500
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998,2008 Free Software Foundation, Inc.                   --
+-- Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,16 +35,16 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control:
---  $Revision: 1.9 $
---  $Date: 2008/07/26 18:50:15 $
+--  $Revision: 1.10 $
+--  $Date: 2009/12/26 17:38:58 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
 
 package body Terminal_Interface.Curses.Forms.Field_Types.AlphaNumeric is
 
-   procedure Set_Field_Type (Fld : in Field;
-                             Typ : in AlphaNumeric_Field)
+   procedure Set_Field_Type (Fld : Field;
+                             Typ : AlphaNumeric_Field)
    is
       C_AlphaNumeric_Field_Type : C_Field_Type;
       pragma Import (C, C_AlphaNumeric_Field_Type, "TYPE_ALNUM");
diff -Naur ncurses-5.7.orig/Ada95/src/terminal_interface-curses-forms-field_types-alphanumeric.ads ncurses-5.7/Ada95/src/terminal_interface-curses-forms-field_types-alphanumeric.ads
--- ncurses-5.7.orig/Ada95/src/terminal_interface-curses-forms-field_types-alphanumeric.ads	2003-10-25 11:39:18.000000000 -0400
+++ ncurses-5.7/Ada95/src/terminal_interface-curses-forms-field_types-alphanumeric.ads	2011-01-08 18:13:50.307157046 -0500
@@ -7,7 +7,7 @@
 --                                 S P E C                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,7 +35,7 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control:
---  $Revision: 1.11 $
+--  $Revision: 1.12 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 package Terminal_Interface.Curses.Forms.Field_Types.AlphaNumeric is
@@ -47,8 +47,8 @@
         Minimum_Field_Width : Natural := 0;
      end record;
 
-   procedure Set_Field_Type (Fld : in Field;
-                             Typ : in AlphaNumeric_Field);
+   procedure Set_Field_Type (Fld : Field;
+                             Typ : AlphaNumeric_Field);
    pragma Inline (Set_Field_Type);
 
 end Terminal_Interface.Curses.Forms.Field_Types.AlphaNumeric;
diff -Naur ncurses-5.7.orig/Ada95/src/terminal_interface-curses-forms-field_types-enumeration.adb ncurses-5.7/Ada95/src/terminal_interface-curses-forms-field_types-enumeration.adb
--- ncurses-5.7.orig/Ada95/src/terminal_interface-curses-forms-field_types-enumeration.adb	2003-10-25 11:39:18.000000000 -0400
+++ ncurses-5.7/Ada95/src/terminal_interface-curses-forms-field_types-enumeration.adb	2011-01-08 18:13:50.307157046 -0500
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,7 +35,7 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control:
---  $Revision: 1.7 $
+--  $Revision: 1.8 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with Ada.Unchecked_Deallocation;
@@ -88,8 +88,8 @@
       Enum.Arr := null;
    end Release;
 
-   procedure Set_Field_Type (Fld : in Field;
-                             Typ : in Enumeration_Field)
+   procedure Set_Field_Type (Fld : Field;
+                             Typ : Enumeration_Field)
    is
       C_Enum_Type : C_Field_Type;
       pragma Import (C, C_Enum_Type, "TYPE_ENUM");
diff -Naur ncurses-5.7.orig/Ada95/src/terminal_interface-curses-forms-field_types-enumeration.ads ncurses-5.7/Ada95/src/terminal_interface-curses-forms-field_types-enumeration.ads
--- ncurses-5.7.orig/Ada95/src/terminal_interface-curses-forms-field_types-enumeration.ads	2003-10-25 11:39:18.000000000 -0400
+++ ncurses-5.7/Ada95/src/terminal_interface-curses-forms-field_types-enumeration.ads	2011-01-08 18:13:50.311157027 -0500
@@ -7,7 +7,7 @@
 --                                 S P E C                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,7 +35,7 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control:
---  $Revision: 1.11 $
+--  $Revision: 1.12 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with Interfaces.C.Strings;
@@ -81,8 +81,8 @@
    --  The next type defintions are all ncurses extensions. They are typically
    --  not available in other curses implementations.
 
-   procedure Set_Field_Type (Fld : in Field;
-                             Typ : in Enumeration_Field);
+   procedure Set_Field_Type (Fld : Field;
+                             Typ : Enumeration_Field);
    pragma Inline (Set_Field_Type);
 
 private
diff -Naur ncurses-5.7.orig/Ada95/src/terminal_interface-curses-forms-field_types-intfield.adb ncurses-5.7/Ada95/src/terminal_interface-curses-forms-field_types-intfield.adb
--- ncurses-5.7.orig/Ada95/src/terminal_interface-curses-forms-field_types-intfield.adb	2008-07-26 14:50:06.000000000 -0400
+++ ncurses-5.7/Ada95/src/terminal_interface-curses-forms-field_types-intfield.adb	2011-01-08 18:13:50.311157027 -0500
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998,2008 Free Software Foundation, Inc.                   --
+-- Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,16 +35,16 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control:
---  $Revision: 1.9 $
---  $Date: 2008/07/26 18:50:06 $
+--  $Revision: 1.10 $
+--  $Date: 2009/12/26 17:38:58 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
 
 package body Terminal_Interface.Curses.Forms.Field_Types.IntField is
 
-   procedure Set_Field_Type (Fld : in Field;
-                             Typ : in Integer_Field)
+   procedure Set_Field_Type (Fld : Field;
+                             Typ : Integer_Field)
    is
       C_Integer_Field_Type : C_Field_Type;
       pragma Import (C, C_Integer_Field_Type, "TYPE_INTEGER");
diff -Naur ncurses-5.7.orig/Ada95/src/terminal_interface-curses-forms-field_types-intfield.ads ncurses-5.7/Ada95/src/terminal_interface-curses-forms-field_types-intfield.ads
--- ncurses-5.7.orig/Ada95/src/terminal_interface-curses-forms-field_types-intfield.ads	2003-10-25 11:39:18.000000000 -0400
+++ ncurses-5.7/Ada95/src/terminal_interface-curses-forms-field_types-intfield.ads	2011-01-08 18:13:50.311157027 -0500
@@ -7,7 +7,7 @@
 --                                 S P E C                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,7 +35,7 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control:
---  $Revision: 1.11 $
+--  $Revision: 1.12 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 package Terminal_Interface.Curses.Forms.Field_Types.IntField is
@@ -48,8 +48,8 @@
          Upper_Limit : Integer;
       end record;
 
-   procedure Set_Field_Type (Fld : in Field;
-                             Typ : in Integer_Field);
+   procedure Set_Field_Type (Fld : Field;
+                             Typ : Integer_Field);
    pragma Inline (Set_Field_Type);
 
 end Terminal_Interface.Curses.Forms.Field_Types.IntField;
diff -Naur ncurses-5.7.orig/Ada95/src/terminal_interface-curses-forms-field_types-ipv4_address.adb ncurses-5.7/Ada95/src/terminal_interface-curses-forms-field_types-ipv4_address.adb
--- ncurses-5.7.orig/Ada95/src/terminal_interface-curses-forms-field_types-ipv4_address.adb	2008-07-26 14:49:47.000000000 -0400
+++ ncurses-5.7/Ada95/src/terminal_interface-curses-forms-field_types-ipv4_address.adb	2011-01-08 18:13:50.311157027 -0500
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998,2008 Free Software Foundation, Inc.                   --
+-- Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,16 +35,16 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control:
---  $Revision: 1.9 $
---  $Date: 2008/07/26 18:49:47 $
+--  $Revision: 1.10 $
+--  $Date: 2009/12/26 17:38:58 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
 
 package body Terminal_Interface.Curses.Forms.Field_Types.IPV4_Address is
 
-   procedure Set_Field_Type (Fld : in Field;
-                             Typ : in Internet_V4_Address_Field)
+   procedure Set_Field_Type (Fld : Field;
+                             Typ : Internet_V4_Address_Field)
    is
       C_IPV4_Field_Type : C_Field_Type;
       pragma Import (C, C_IPV4_Field_Type, "TYPE_IPV4");
diff -Naur ncurses-5.7.orig/Ada95/src/terminal_interface-curses-forms-field_types-ipv4_address.ads ncurses-5.7/Ada95/src/terminal_interface-curses-forms-field_types-ipv4_address.ads
--- ncurses-5.7.orig/Ada95/src/terminal_interface-curses-forms-field_types-ipv4_address.ads	2003-10-25 11:39:18.000000000 -0400
+++ ncurses-5.7/Ada95/src/terminal_interface-curses-forms-field_types-ipv4_address.ads	2011-01-08 18:13:50.311157027 -0500
@@ -7,7 +7,7 @@
 --                                 S P E C                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,7 +35,7 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control:
---  $Revision: 1.11 $
+--  $Revision: 1.12 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 package Terminal_Interface.Curses.Forms.Field_Types.IPV4_Address is
@@ -44,8 +44,8 @@
 
    type Internet_V4_Address_Field is new Field_Type with null record;
 
-   procedure Set_Field_Type (Fld : in Field;
-                             Typ : in Internet_V4_Address_Field);
+   procedure Set_Field_Type (Fld : Field;
+                             Typ : Internet_V4_Address_Field);
    pragma Inline (Set_Field_Type);
 
 end Terminal_Interface.Curses.Forms.Field_Types.IPV4_Address;
diff -Naur ncurses-5.7.orig/Ada95/src/terminal_interface-curses-forms-field_types-numeric.adb ncurses-5.7/Ada95/src/terminal_interface-curses-forms-field_types-numeric.adb
--- ncurses-5.7.orig/Ada95/src/terminal_interface-curses-forms-field_types-numeric.adb	2008-07-26 14:49:57.000000000 -0400
+++ ncurses-5.7/Ada95/src/terminal_interface-curses-forms-field_types-numeric.adb	2011-01-08 18:13:50.311157027 -0500
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998,2008 Free Software Foundation, Inc.                   --
+-- Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,8 +35,8 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control:
---  $Revision: 1.10 $
---  $Date: 2008/07/26 18:49:57 $
+--  $Revision: 1.11 $
+--  $Date: 2009/12/26 17:38:58 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with Interfaces.C;
@@ -44,8 +44,8 @@
 
 package body Terminal_Interface.Curses.Forms.Field_Types.Numeric is
 
-   procedure Set_Field_Type (Fld : in Field;
-                             Typ : in Numeric_Field)
+   procedure Set_Field_Type (Fld : Field;
+                             Typ : Numeric_Field)
    is
       type Double is new Interfaces.C.double;
 
diff -Naur ncurses-5.7.orig/Ada95/src/terminal_interface-curses-forms-field_types-numeric.ads ncurses-5.7/Ada95/src/terminal_interface-curses-forms-field_types-numeric.ads
--- ncurses-5.7.orig/Ada95/src/terminal_interface-curses-forms-field_types-numeric.ads	2003-10-25 11:39:18.000000000 -0400
+++ ncurses-5.7/Ada95/src/terminal_interface-curses-forms-field_types-numeric.ads	2011-01-08 18:13:50.311157027 -0500
@@ -7,7 +7,7 @@
 --                                 S P E C                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,7 +35,7 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control:
---  $Revision: 1.11 $
+--  $Revision: 1.12 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 package Terminal_Interface.Curses.Forms.Field_Types.Numeric is
@@ -48,8 +48,8 @@
          Upper_Limit : Float;
       end record;
 
-   procedure Set_Field_Type (Fld : in Field;
-                             Typ : in Numeric_Field);
+   procedure Set_Field_Type (Fld : Field;
+                             Typ : Numeric_Field);
    pragma Inline (Set_Field_Type);
 
 end Terminal_Interface.Curses.Forms.Field_Types.Numeric;
diff -Naur ncurses-5.7.orig/Ada95/src/terminal_interface-curses-forms-field_types-regexp.adb ncurses-5.7/Ada95/src/terminal_interface-curses-forms-field_types-regexp.adb
--- ncurses-5.7.orig/Ada95/src/terminal_interface-curses-forms-field_types-regexp.adb	2003-10-25 11:39:18.000000000 -0400
+++ ncurses-5.7/Ada95/src/terminal_interface-curses-forms-field_types-regexp.adb	2011-01-08 18:13:50.311157027 -0500
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,7 +35,7 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control:
---  $Revision: 1.8 $
+--  $Revision: 1.9 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with Interfaces.C; use Interfaces.C;
@@ -43,8 +43,8 @@
 
 package body Terminal_Interface.Curses.Forms.Field_Types.RegExp is
 
-   procedure Set_Field_Type (Fld : in Field;
-                             Typ : in Regular_Expression_Field)
+   procedure Set_Field_Type (Fld : Field;
+                             Typ : Regular_Expression_Field)
    is
       type Char_Ptr is access all Interfaces.C.char;
 
diff -Naur ncurses-5.7.orig/Ada95/src/terminal_interface-curses-forms-field_types-regexp.ads ncurses-5.7/Ada95/src/terminal_interface-curses-forms-field_types-regexp.ads
--- ncurses-5.7.orig/Ada95/src/terminal_interface-curses-forms-field_types-regexp.ads	2003-10-25 11:39:18.000000000 -0400
+++ ncurses-5.7/Ada95/src/terminal_interface-curses-forms-field_types-regexp.ads	2011-01-08 18:13:50.311157027 -0500
@@ -7,7 +7,7 @@
 --                                 S P E C                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,7 +35,7 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control:
---  $Revision: 1.11 $
+--  $Revision: 1.12 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 package Terminal_Interface.Curses.Forms.Field_Types.RegExp is
@@ -48,8 +48,8 @@
          Regular_Expression : String_Access;
       end record;
 
-   procedure Set_Field_Type (Fld : in Field;
-                             Typ : in Regular_Expression_Field);
+   procedure Set_Field_Type (Fld : Field;
+                             Typ : Regular_Expression_Field);
    pragma Inline (Set_Field_Type);
 
 end Terminal_Interface.Curses.Forms.Field_Types.RegExp;
diff -Naur ncurses-5.7.orig/Ada95/src/terminal_interface-curses-forms-field_types-user.adb ncurses-5.7/Ada95/src/terminal_interface-curses-forms-field_types-user.adb
--- ncurses-5.7.orig/Ada95/src/terminal_interface-curses-forms-field_types-user.adb	2008-07-26 14:49:28.000000000 -0400
+++ ncurses-5.7/Ada95/src/terminal_interface-curses-forms-field_types-user.adb	2011-01-08 18:13:50.311157027 -0500
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998-2006,2008 Free Software Foundation, Inc.              --
+-- Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,8 +35,8 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control:
---  $Revision: 1.15 $
---  $Date: 2008/07/26 18:49:28 $
+--  $Revision: 1.16 $
+--  $Date: 2009/12/26 17:38:58 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with Ada.Unchecked_Conversion;
@@ -44,8 +44,8 @@
 
 package body Terminal_Interface.Curses.Forms.Field_Types.User is
 
-   procedure Set_Field_Type (Fld : in Field;
-                             Typ : in User_Defined_Field_Type)
+   procedure Set_Field_Type (Fld : Field;
+                             Typ : User_Defined_Field_Type)
    is
       function Allocate_Arg (T : User_Defined_Field_Type'Class)
                              return Argument_Access;
diff -Naur ncurses-5.7.orig/Ada95/src/terminal_interface-curses-forms-field_types-user.ads ncurses-5.7/Ada95/src/terminal_interface-curses-forms-field_types-user.ads
--- ncurses-5.7.orig/Ada95/src/terminal_interface-curses-forms-field_types-user.ads	2008-07-26 14:49:38.000000000 -0400
+++ ncurses-5.7/Ada95/src/terminal_interface-curses-forms-field_types-user.ads	2011-01-08 18:13:50.311157027 -0500
@@ -7,7 +7,7 @@
 --                                 S P E C                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998,2008 Free Software Foundation, Inc.                   --
+-- Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,8 +35,8 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control:
---  $Revision: 1.12 $
---  $Date: 2008/07/26 18:49:38 $
+--  $Revision: 1.13 $
+--  $Date: 2009/12/26 17:38:58 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with Interfaces.C;
@@ -67,8 +67,8 @@
    --  If True is returned, the character is considered as valid for the
    --  field, otherwise as invalid.
 
-   procedure Set_Field_Type (Fld : in Field;
-                             Typ : in User_Defined_Field_Type);
+   procedure Set_Field_Type (Fld : Field;
+                             Typ : User_Defined_Field_Type);
    --  This should work for all types derived from User_Defined_Field_Type.
    --  No need to reimplement it for your derived type.
 
diff -Naur ncurses-5.7.orig/Ada95/src/terminal_interface-curses-forms-field_types.adb ncurses-5.7/Ada95/src/terminal_interface-curses-forms-field_types.adb
--- ncurses-5.7.orig/Ada95/src/terminal_interface-curses-forms-field_types.adb	2008-07-26 14:50:33.000000000 -0400
+++ ncurses-5.7/Ada95/src/terminal_interface-curses-forms-field_types.adb	2011-01-08 18:13:50.311157027 -0500
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998-2006,2008 Free Software Foundation, Inc.              --
+-- Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,8 +35,8 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control:
---  $Revision: 1.20 $
---  $Date: 2008/07/26 18:50:33 $
+--  $Revision: 1.21 $
+--  $Date: 2009/12/26 17:38:58 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
@@ -68,7 +68,7 @@
    --  |
    --  |
    --  |
-   function Get_Type (Fld : in Field) return Field_Type_Access
+   function Get_Type (Fld : Field) return Field_Type_Access
    is
       Low_Level : constant C_Field_Type := Get_Fieldtype (Fld);
       Arg : Argument_Access;
@@ -116,7 +116,7 @@
       return Usr;
    end Copy_Arg;
 
-   procedure Free_Arg (Usr : in System.Address)
+   procedure Free_Arg (Usr : System.Address)
    is
       procedure Free_Type is new Ada.Unchecked_Deallocation
         (Field_Type'Class, Field_Type_Access);
diff -Naur ncurses-5.7.orig/Ada95/src/terminal_interface-curses-forms-field_user_data.adb ncurses-5.7/Ada95/src/terminal_interface-curses-forms-field_user_data.adb
--- ncurses-5.7.orig/Ada95/src/terminal_interface-curses-forms-field_user_data.adb	2003-10-25 11:39:18.000000000 -0400
+++ ncurses-5.7/Ada95/src/terminal_interface-curses-forms-field_user_data.adb	2011-01-08 18:13:50.311157027 -0500
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,7 +35,7 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control:
---  $Revision: 1.12 $
+--  $Revision: 1.13 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with Terminal_Interface.Curses.Aux; use  Terminal_Interface.Curses.Aux;
@@ -51,8 +51,8 @@
    --  |
    use type Interfaces.C.int;
 
-   procedure Set_User_Data (Fld  : in Field;
-                            Data : in User_Access)
+   procedure Set_User_Data (Fld  : Field;
+                            Data : User_Access)
    is
       function Set_Field_Userptr (Fld : Field;
                                   Usr : User_Access) return C_Int;
@@ -67,7 +67,7 @@
    --  |
    --  |
    --  |
-   function Get_User_Data (Fld  : in  Field) return User_Access
+   function Get_User_Data (Fld  : Field) return User_Access
    is
       function Field_Userptr (Fld : Field) return User_Access;
       pragma Import (C, Field_Userptr, "field_userptr");
@@ -75,7 +75,7 @@
       return Field_Userptr (Fld);
    end Get_User_Data;
 
-   procedure Get_User_Data (Fld  : in  Field;
+   procedure Get_User_Data (Fld  : Field;
                             Data : out User_Access)
    is
    begin
diff -Naur ncurses-5.7.orig/Ada95/src/terminal_interface-curses-forms-form_user_data.adb ncurses-5.7/Ada95/src/terminal_interface-curses-forms-form_user_data.adb
--- ncurses-5.7.orig/Ada95/src/terminal_interface-curses-forms-form_user_data.adb	2003-10-25 11:39:18.000000000 -0400
+++ ncurses-5.7/Ada95/src/terminal_interface-curses-forms-form_user_data.adb	2011-01-08 18:13:50.311157027 -0500
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,7 +35,7 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control:
---  $Revision: 1.12 $
+--  $Revision: 1.13 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 --  |
@@ -52,8 +52,8 @@
    --  |
    --  |
    --  |
-   procedure Set_User_Data (Frm  : in Form;
-                            Data : in User_Access)
+   procedure Set_User_Data (Frm  : Form;
+                            Data : User_Access)
    is
       function Set_Form_Userptr (Frm  : Form;
                                  Data : User_Access)  return C_Int;
@@ -68,7 +68,7 @@
    --  |
    --  |
    --  |
-   function Get_User_Data (Frm  : in  Form) return User_Access
+   function Get_User_Data (Frm  : Form) return User_Access
    is
       function Form_Userptr (Frm : Form) return User_Access;
       pragma Import (C, Form_Userptr, "form_userptr");
@@ -76,7 +76,7 @@
       return Form_Userptr (Frm);
    end Get_User_Data;
 
-   procedure Get_User_Data (Frm  : in  Form;
+   procedure Get_User_Data (Frm  : Form;
                             Data : out User_Access)
    is
    begin
diff -Naur ncurses-5.7.orig/Ada95/src/terminal_interface-curses-forms.adb ncurses-5.7/Ada95/src/terminal_interface-curses-forms.adb
--- ncurses-5.7.orig/Ada95/src/terminal_interface-curses-forms.adb	2008-07-26 14:50:44.000000000 -0400
+++ ncurses-5.7/Ada95/src/terminal_interface-curses-forms.adb	2011-01-08 18:13:50.315157326 -0500
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998-2004,2008 Free Software Foundation, Inc.              --
+-- Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,8 +35,8 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control:
---  $Revision: 1.26 $
---  $Date: 2008/07/26 18:50:44 $
+--  $Revision: 1.27 $
+--  $Date: 2009/12/26 17:38:58 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with Ada.Unchecked_Deallocation;
@@ -78,7 +78,7 @@
      Ada.Unchecked_Conversion (C_Int,
                                Form_Option_Set);
 
-   procedure Request_Name (Key  : in Form_Request_Code;
+   procedure Request_Name (Key  : Form_Request_Code;
                                 Name : out String)
    is
       function Form_Request_Name (Key : C_Int) return chars_ptr;
@@ -190,8 +190,8 @@
    --  |
    --  |
    --  |
-   procedure Set_Justification (Fld  : in Field;
-                                Just : in Field_Justification := None)
+   procedure Set_Justification (Fld  : Field;
+                                Just : Field_Justification := None)
    is
       function Set_Field_Just (Fld  : Field;
                                Just : C_Int) return C_Int;
@@ -223,9 +223,9 @@
    --  |
    --  |
    procedure Set_Buffer
-     (Fld    : in Field;
-      Buffer : in Buffer_Number := Buffer_Number'First;
-      Str    : in String)
+     (Fld    : Field;
+      Buffer : Buffer_Number := Buffer_Number'First;
+      Str    : String)
    is
       type Char_Ptr is access all Interfaces.C.char;
       function Set_Fld_Buffer (Fld    : Field;
@@ -248,8 +248,8 @@
    --  |
    --  |
    procedure Get_Buffer
-     (Fld    : in Field;
-      Buffer : in Buffer_Number := Buffer_Number'First;
+     (Fld    : Field;
+      Buffer : Buffer_Number := Buffer_Number'First;
       Str    : out String)
    is
       function Field_Buffer (Fld : Field;
@@ -260,8 +260,8 @@
    end Get_Buffer;
 
    function Get_Buffer
-     (Fld    : in Field;
-      Buffer : in Buffer_Number := Buffer_Number'First) return String
+     (Fld    : Field;
+      Buffer : Buffer_Number := Buffer_Number'First) return String
    is
       function Field_Buffer (Fld : Field;
                              B   : C_Int) return chars_ptr;
@@ -272,8 +272,8 @@
    --  |
    --  |
    --  |
-   procedure Set_Status (Fld    : in Field;
-                         Status : in Boolean := True)
+   procedure Set_Status (Fld    : Field;
+                         Status : Boolean := True)
    is
       function Set_Fld_Status (Fld : Field;
                                St  : C_Int) return C_Int;
@@ -304,8 +304,8 @@
    --  |
    --  |
    --  |
-   procedure Set_Maximum_Size (Fld : in Field;
-                               Max : in Natural := 0)
+   procedure Set_Maximum_Size (Fld : Field;
+                               Max : Natural := 0)
    is
       function Set_Field_Max (Fld : Field;
                               M   : C_Int) return C_Int;
@@ -324,8 +324,8 @@
    --  |
    --  |
    --  |
-   procedure Set_Options (Fld     : in Field;
-                          Options : in Field_Option_Set)
+   procedure Set_Options (Fld     : Field;
+                          Options : Field_Option_Set)
    is
       function Set_Field_Opts (Fld : Field;
                                Opt : C_Int) return C_Int;
@@ -342,8 +342,8 @@
    --  |
    --  |
    --  |
-   procedure Switch_Options (Fld     : in Field;
-                             Options : in Field_Option_Set;
+   procedure Switch_Options (Fld     : Field;
+                             Options : Field_Option_Set;
                              On      : Boolean := True)
    is
       function Field_Opts_On (Fld : Field;
@@ -368,7 +368,7 @@
    --  |
    --  |
    --  |
-   procedure Get_Options (Fld     : in  Field;
+   procedure Get_Options (Fld     : Field;
                           Options : out Field_Option_Set)
    is
       function Field_Opts (Fld : Field) return C_Int;
@@ -397,9 +397,9 @@
    --  |
    --  |
    procedure Set_Foreground
-     (Fld   : in Field;
-      Fore  : in Character_Attribute_Set := Normal_Video;
-      Color : in Color_Pair := Color_Pair'First)
+     (Fld   : Field;
+      Fore  : Character_Attribute_Set := Normal_Video;
+      Color : Color_Pair := Color_Pair'First)
    is
       function Set_Field_Fore (Fld  : Field;
                                Attr : C_Chtype) return C_Int;
@@ -418,7 +418,7 @@
    --  |
    --  |
    --  |
-   procedure Foreground (Fld  : in  Field;
+   procedure Foreground (Fld  : Field;
                          Fore : out Character_Attribute_Set)
    is
       function Field_Fore (Fld : Field) return C_Chtype;
@@ -427,7 +427,7 @@
       Fore := Chtype_To_AttrChar (Field_Fore (Fld)).Attr;
    end Foreground;
 
-   procedure Foreground (Fld   : in  Field;
+   procedure Foreground (Fld   : Field;
                          Fore  : out Character_Attribute_Set;
                          Color : out Color_Pair)
    is
@@ -441,9 +441,9 @@
    --  |
    --  |
    procedure Set_Background
-     (Fld   : in Field;
-      Back  : in Character_Attribute_Set := Normal_Video;
-      Color : in Color_Pair := Color_Pair'First)
+     (Fld   : Field;
+      Back  : Character_Attribute_Set := Normal_Video;
+      Color : Color_Pair := Color_Pair'First)
    is
       function Set_Field_Back (Fld  : Field;
                                Attr : C_Chtype) return C_Int;
@@ -462,7 +462,7 @@
    --  |
    --  |
    --  |
-   procedure Background (Fld  : in  Field;
+   procedure Background (Fld  : Field;
                          Back : out Character_Attribute_Set)
    is
       function Field_Back (Fld : Field) return C_Chtype;
@@ -471,7 +471,7 @@
       Back := Chtype_To_AttrChar (Field_Back (Fld)).Attr;
    end Background;
 
-   procedure Background (Fld   : in  Field;
+   procedure Background (Fld   : Field;
                          Back  : out Character_Attribute_Set;
                          Color : out Color_Pair)
    is
@@ -484,8 +484,8 @@
    --  |
    --  |
    --  |
-   procedure Set_Pad_Character (Fld : in Field;
-                                Pad : in Character := Space)
+   procedure Set_Pad_Character (Fld : Field;
+                                Pad : Character := Space)
    is
       function Set_Field_Pad (Fld : Field;
                               Ch  : C_Int) return C_Int;
@@ -501,7 +501,7 @@
    --  |
    --  |
    --  |
-   procedure Pad_Character (Fld : in  Field;
+   procedure Pad_Character (Fld : Field;
                             Pad : out Character)
    is
       function Field_Pad (Fld : Field) return C_Int;
@@ -516,7 +516,7 @@
    --  |
    --  |
    --  |
-   procedure Info (Fld                : in  Field;
+   procedure Info (Fld                : Field;
                    Lines              : out Line_Count;
                    Columns            : out Column_Count;
                    First_Row          : out Line_Position;
@@ -550,7 +550,7 @@
 --  |
 --  |
 --  |
-   procedure Dynamic_Info (Fld     : in Field;
+   procedure Dynamic_Info (Fld     : Field;
                            Lines   : out Line_Count;
                            Columns : out Column_Count;
                            Max     : out Natural)
@@ -579,8 +579,8 @@
    --  |
    --  |
    --  |
-   procedure Set_Window (Frm : in Form;
-                         Win : in Window)
+   procedure Set_Window (Frm : Form;
+                         Win : Window)
    is
       function Set_Form_Win (Frm : Form;
                              Win : Window) return C_Int;
@@ -607,8 +607,8 @@
    --  |
    --  |
    --  |
-   procedure Set_Sub_Window (Frm : in Form;
-                             Win : in Window)
+   procedure Set_Sub_Window (Frm : Form;
+                             Win : Window)
    is
       function Set_Form_Sub (Frm : Form;
                              Win : Window) return C_Int;
@@ -635,7 +635,7 @@
    --  |
    --  |
    --  |
-   procedure Scale (Frm     : in Form;
+   procedure Scale (Frm     : Form;
                     Lines   : out Line_Count;
                     Columns : out Column_Count)
    is
@@ -659,8 +659,8 @@
    --  |
    --  |
    --  |
-   procedure Set_Field_Init_Hook (Frm  : in Form;
-                                  Proc : in Form_Hook_Function)
+   procedure Set_Field_Init_Hook (Frm  : Form;
+                                  Proc : Form_Hook_Function)
    is
       function Set_Field_Init (Frm  : Form;
                                Proc : Form_Hook_Function) return C_Int;
@@ -675,8 +675,8 @@
    --  |
    --  |
    --  |
-   procedure Set_Field_Term_Hook (Frm  : in Form;
-                                  Proc : in Form_Hook_Function)
+   procedure Set_Field_Term_Hook (Frm  : Form;
+                                  Proc : Form_Hook_Function)
    is
       function Set_Field_Term (Frm  : Form;
                                Proc : Form_Hook_Function) return C_Int;
@@ -691,8 +691,8 @@
    --  |
    --  |
    --  |
-   procedure Set_Form_Init_Hook (Frm  : in Form;
-                                 Proc : in Form_Hook_Function)
+   procedure Set_Form_Init_Hook (Frm  : Form;
+                                 Proc : Form_Hook_Function)
    is
       function Set_Form_Init (Frm  : Form;
                               Proc : Form_Hook_Function) return C_Int;
@@ -707,8 +707,8 @@
    --  |
    --  |
    --  |
-   procedure Set_Form_Term_Hook (Frm  : in Form;
-                                 Proc : in Form_Hook_Function)
+   procedure Set_Form_Term_Hook (Frm  : Form;
+                                 Proc : Form_Hook_Function)
    is
       function Set_Form_Term (Frm  : Form;
                               Proc : Form_Hook_Function) return C_Int;
@@ -727,8 +727,8 @@
    --  |
    --  |
    --  |
-   procedure Redefine (Frm  : in Form;
-                       Flds : in Field_Array_Access)
+   procedure Redefine (Frm  : Form;
+                       Flds : Field_Array_Access)
    is
       function Set_Frm_Fields (Frm   : Form;
                                Items : System.Address) return C_Int;
@@ -779,9 +779,9 @@
    --  |
    --  |
    --  |
-   procedure Move (Fld    : in Field;
-                   Line   : in Line_Position;
-                   Column : in Column_Position)
+   procedure Move (Fld    : Field;
+                   Line   : Line_Position;
+                   Column : Column_Position)
    is
       function Move (Fld : Field; L, C : C_Int) return C_Int;
       pragma Import (C, Move, "move_field");
@@ -839,8 +839,8 @@
    --  |
    --  |
    --  |
-   procedure Set_Options (Frm     : in Form;
-                          Options : in Form_Option_Set)
+   procedure Set_Options (Frm     : Form;
+                          Options : Form_Option_Set)
    is
       function Set_Form_Opts (Frm : Form;
                               Opt : C_Int) return C_Int;
@@ -857,8 +857,8 @@
    --  |
    --  |
    --  |
-   procedure Switch_Options (Frm     : in Form;
-                             Options : in Form_Option_Set;
+   procedure Switch_Options (Frm     : Form;
+                             Options : Form_Option_Set;
                              On      : Boolean := True)
    is
       function Form_Opts_On (Frm : Form;
@@ -883,7 +883,7 @@
    --  |
    --  |
    --  |
-   procedure Get_Options (Frm     : in  Form;
+   procedure Get_Options (Frm     : Form;
                           Options : out Form_Option_Set)
    is
       function Form_Opts (Frm : Form) return C_Int;
@@ -910,8 +910,8 @@
    --  |
    --  |
    --  |
-   procedure Post (Frm  : in Form;
-                   Post : in Boolean := True)
+   procedure Post (Frm  : Form;
+                   Post : Boolean := True)
    is
       function M_Post (Frm : Form) return C_Int;
       pragma Import (C, M_Post, "post_form");
@@ -1020,8 +1020,8 @@
    --  |
    --  |
    --  |
-   procedure Set_Current (Frm : in Form;
-                          Fld : in Field)
+   procedure Set_Current (Frm : Form;
+                          Fld : Field)
    is
       function Set_Current_Fld (Frm : Form; Fld : Field) return C_Int;
       pragma Import (C, Set_Current_Fld, "set_current_field");
@@ -1035,7 +1035,7 @@
    --  |
    --  |
    --  |
-   function Current (Frm : in Form) return Field
+   function Current (Frm : Form) return Field
    is
       function Current_Fld (Frm : Form) return Field;
       pragma Import (C, Current_Fld, "current_field");
@@ -1050,8 +1050,8 @@
    --  |
    --  |
    --  |
-   procedure Set_Page (Frm  : in Form;
-                       Page : in Page_Number := Page_Number'First)
+   procedure Set_Page (Frm  : Form;
+                       Page : Page_Number := Page_Number'First)
    is
       function Set_Frm_Page (Frm : Form; Pg : C_Int) return C_Int;
       pragma Import (C, Set_Frm_Page, "set_form_page");
@@ -1099,8 +1099,8 @@
    --  |
    --  |
    --  |
-   procedure Set_New_Page (Fld      : in Field;
-                           New_Page : in Boolean := True)
+   procedure Set_New_Page (Fld      : Field;
+                           New_Page : Boolean := True)
    is
       function Set_Page (Fld : Field; Flg : C_Int) return C_Int;
       pragma Import (C, Set_Page, "set_new_page");
@@ -1129,7 +1129,7 @@
    end Is_New_Page;
 
    procedure Free (FA          : in out Field_Array_Access;
-                   Free_Fields : in Boolean := False)
+                   Free_Fields : Boolean := False)
    is
       procedure Release is new Ada.Unchecked_Deallocation
         (Field_Array, Field_Array_Access);
diff -Naur ncurses-5.7.orig/Ada95/src/terminal_interface-curses-menus-item_user_data.adb ncurses-5.7/Ada95/src/terminal_interface-curses-menus-item_user_data.adb
--- ncurses-5.7.orig/Ada95/src/terminal_interface-curses-menus-item_user_data.adb	2003-10-25 11:39:18.000000000 -0400
+++ ncurses-5.7/Ada95/src/terminal_interface-curses-menus-item_user_data.adb	2011-01-08 18:13:50.315157326 -0500
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,7 +35,7 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control:
---  $Revision: 1.11 $
+--  $Revision: 1.12 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with Interfaces.C;
@@ -45,8 +45,8 @@
 
    use type Interfaces.C.int;
 
-   procedure Set_User_Data (Itm  : in Item;
-                            Data : in User_Access)
+   procedure Set_User_Data (Itm  : Item;
+                            Data : User_Access)
    is
       function Set_Item_Userptr (Itm  : Item;
                                  Addr : User_Access)  return C_Int;
@@ -59,7 +59,7 @@
       end if;
    end Set_User_Data;
 
-   function Get_User_Data (Itm  : in  Item) return User_Access
+   function Get_User_Data (Itm  : Item) return User_Access
    is
       function Item_Userptr (Itm : Item) return User_Access;
       pragma Import (C, Item_Userptr, "item_userptr");
@@ -67,7 +67,7 @@
       return Item_Userptr (Itm);
    end Get_User_Data;
 
-   procedure Get_User_Data (Itm  : in  Item;
+   procedure Get_User_Data (Itm  : Item;
                             Data : out User_Access)
    is
    begin
diff -Naur ncurses-5.7.orig/Ada95/src/terminal_interface-curses-menus-menu_user_data.adb ncurses-5.7/Ada95/src/terminal_interface-curses-menus-menu_user_data.adb
--- ncurses-5.7.orig/Ada95/src/terminal_interface-curses-menus-menu_user_data.adb	2003-10-25 11:39:18.000000000 -0400
+++ ncurses-5.7/Ada95/src/terminal_interface-curses-menus-menu_user_data.adb	2011-01-08 18:13:50.315157326 -0500
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,7 +35,7 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control:
---  $Revision: 1.12 $
+--  $Revision: 1.13 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
@@ -44,8 +44,8 @@
 
    use type Interfaces.C.int;
 
-   procedure Set_User_Data (Men  : in Menu;
-                            Data : in User_Access)
+   procedure Set_User_Data (Men  : Menu;
+                            Data : User_Access)
    is
       function Set_Menu_Userptr (Men  : Menu;
                                  Data : User_Access)  return C_Int;
@@ -58,7 +58,7 @@
       end if;
    end Set_User_Data;
 
-   function Get_User_Data (Men  : in  Menu) return User_Access
+   function Get_User_Data (Men  : Menu) return User_Access
    is
       function Menu_Userptr (Men : Menu) return User_Access;
       pragma Import (C, Menu_Userptr, "menu_userptr");
@@ -66,7 +66,7 @@
       return Menu_Userptr (Men);
    end Get_User_Data;
 
-   procedure Get_User_Data (Men  : in  Menu;
+   procedure Get_User_Data (Men  : Menu;
                             Data : out User_Access)
    is
    begin
diff -Naur ncurses-5.7.orig/Ada95/src/terminal_interface-curses-menus.adb ncurses-5.7/Ada95/src/terminal_interface-curses-menus.adb
--- ncurses-5.7.orig/Ada95/src/terminal_interface-curses-menus.adb	2008-07-26 14:50:58.000000000 -0400
+++ ncurses-5.7/Ada95/src/terminal_interface-curses-menus.adb	2011-01-08 18:13:50.315157326 -0500
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998-2004,2008 Free Software Foundation, Inc.              --
+-- Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,8 +35,8 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control:
---  $Revision: 1.26 $
---  $Date: 2008/07/26 18:50:58 $
+--  $Revision: 1.27 $
+--  $Date: 2009/12/26 17:38:58 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with Ada.Unchecked_Deallocation;
@@ -74,7 +74,7 @@
                                Item_Option_Set);
 
 ------------------------------------------------------------------------------
-   procedure Request_Name (Key  : in Menu_Request_Code;
+   procedure Request_Name (Key  : Menu_Request_Code;
                            Name : out String)
    is
       function Request_Name (Key : C_Int) return chars_ptr;
@@ -149,8 +149,8 @@
       Itm := Null_Item;
    end Delete;
 -------------------------------------------------------------------------------
-   procedure Set_Value (Itm   : in Item;
-                        Value : in Boolean := True)
+   procedure Set_Value (Itm   : Item;
+                        Value : Boolean := True)
    is
       function Set_Item_Val (Itm : Item;
                              Val : C_Int) return C_Int;
@@ -188,8 +188,8 @@
       end if;
    end Visible;
 -------------------------------------------------------------------------------
-   procedure Set_Options (Itm     : in Item;
-                          Options : in Item_Option_Set)
+   procedure Set_Options (Itm     : Item;
+                          Options : Item_Option_Set)
    is
       function Set_Item_Opts (Itm : Item;
                               Opt : C_Int) return C_Int;
@@ -204,8 +204,8 @@
       end if;
    end Set_Options;
 
-   procedure Switch_Options (Itm     : in Item;
-                             Options : in Item_Option_Set;
+   procedure Switch_Options (Itm     : Item;
+                             Options : Item_Option_Set;
                              On      : Boolean := True)
    is
       function Item_Opts_On (Itm : Item;
@@ -228,7 +228,7 @@
       end if;
    end Switch_Options;
 
-   procedure Get_Options (Itm     : in  Item;
+   procedure Get_Options (Itm     : Item;
                           Options : out Item_Option_Set)
    is
       function Item_Opts (Itm : Item) return C_Int;
@@ -247,7 +247,7 @@
       return Ios;
    end Get_Options;
 -------------------------------------------------------------------------------
-   procedure Name (Itm  : in Item;
+   procedure Name (Itm  : Item;
                    Name : out String)
    is
       function Itemname (Itm : Item) return chars_ptr;
@@ -256,7 +256,7 @@
       Fill_String (Itemname (Itm), Name);
    end Name;
 
-   function Name (Itm : in Item) return String
+   function Name (Itm : Item) return String
    is
       function Itemname (Itm : Item) return chars_ptr;
       pragma Import (C, Itemname, "item_name");
@@ -264,7 +264,7 @@
       return Fill_String (Itemname (Itm));
    end Name;
 
-   procedure Description (Itm         : in Item;
+   procedure Description (Itm         : Item;
                           Description : out String)
    is
       function Descname (Itm  : Item) return chars_ptr;
@@ -273,7 +273,7 @@
       Fill_String (Descname (Itm), Description);
    end Description;
 
-   function Description (Itm : in Item) return String
+   function Description (Itm : Item) return String
    is
       function Descname (Itm  : Item) return chars_ptr;
       pragma Import (C, Descname, "item_description");
@@ -281,8 +281,8 @@
       return Fill_String (Descname (Itm));
    end Description;
 -------------------------------------------------------------------------------
-   procedure Set_Current (Men : in Menu;
-                          Itm : in Item)
+   procedure Set_Current (Men : Menu;
+                          Itm : Item)
    is
       function Set_Curr_Item (Men : Menu;
                               Itm : Item) return C_Int;
@@ -308,8 +308,8 @@
       return Res;
    end Current;
 
-   procedure Set_Top_Row (Men  : in Menu;
-                          Line : in Line_Position)
+   procedure Set_Top_Row (Men  : Menu;
+                          Line : Line_Position)
    is
       function Set_Toprow (Men  : Menu;
                            Line : C_Int) return C_Int;
@@ -348,8 +348,8 @@
       return Positive (Natural (Res) + Positive'First);
    end Get_Index;
 -------------------------------------------------------------------------------
-   procedure Post (Men  : in Menu;
-                   Post : in Boolean := True)
+   procedure Post (Men  : Menu;
+                   Post : Boolean := True)
    is
       function M_Post (Men : Menu) return C_Int;
       pragma Import (C, M_Post, "post_menu");
@@ -368,8 +368,8 @@
       end if;
    end Post;
 -------------------------------------------------------------------------------
-   procedure Set_Options (Men     : in Menu;
-                          Options : in Menu_Option_Set)
+   procedure Set_Options (Men     : Menu;
+                          Options : Menu_Option_Set)
    is
       function Set_Menu_Opts (Men : Menu;
                               Opt : C_Int) return C_Int;
@@ -384,9 +384,9 @@
       end if;
    end Set_Options;
 
-   procedure Switch_Options (Men     : in Menu;
-                             Options : in Menu_Option_Set;
-                             On      : in Boolean := True)
+   procedure Switch_Options (Men     : Menu;
+                             Options : Menu_Option_Set;
+                             On      : Boolean := True)
    is
       function Menu_Opts_On (Men : Menu;
                              Opt : C_Int) return C_Int;
@@ -408,8 +408,8 @@
       end if;
    end Switch_Options;
 
-   procedure Get_Options (Men     : in  Menu;
-                               Options : out Menu_Option_Set)
+   procedure Get_Options (Men     : Menu;
+                          Options : out Menu_Option_Set)
    is
       function Menu_Opts (Men : Menu) return C_Int;
       pragma Import (C, Menu_Opts, "menu_opts");
@@ -427,8 +427,8 @@
       return Mos;
    end Get_Options;
 -------------------------------------------------------------------------------
-   procedure Set_Window (Men : in Menu;
-                         Win : in Window)
+   procedure Set_Window (Men : Menu;
+                         Win : Window)
    is
       function Set_Menu_Win (Men : Menu;
                              Win : Window) return C_Int;
@@ -451,8 +451,8 @@
       return W;
    end Get_Window;
 
-   procedure Set_Sub_Window (Men : in Menu;
-                             Win : in Window)
+   procedure Set_Sub_Window (Men : Menu;
+                             Win : Window)
    is
       function Set_Menu_Sub (Men : Menu;
                              Win : Window) return C_Int;
@@ -475,7 +475,7 @@
       return W;
    end Get_Sub_Window;
 
-   procedure Scale (Men     : in Menu;
+   procedure Scale (Men     : Menu;
                     Lines   : out Line_Count;
                     Columns : out Column_Count)
    is
@@ -507,8 +507,8 @@
    end Position_Cursor;
 
 -------------------------------------------------------------------------------
-   procedure Set_Mark (Men  : in Menu;
-                       Mark : in String)
+   procedure Set_Mark (Men  : Menu;
+                       Mark : String)
    is
       type Char_Ptr is access all Interfaces.C.char;
       function Set_Mark (Men  : Menu;
@@ -526,7 +526,7 @@
       end if;
    end Set_Mark;
 
-   procedure Mark (Men  : in  Menu;
+   procedure Mark (Men  : Menu;
                    Mark : out String)
    is
       function Get_Menu_Mark (Men : Menu) return chars_ptr;
@@ -545,9 +545,9 @@
 
 -------------------------------------------------------------------------------
    procedure Set_Foreground
-     (Men   : in Menu;
-      Fore  : in Character_Attribute_Set := Normal_Video;
-      Color : in Color_Pair := Color_Pair'First)
+     (Men   : Menu;
+      Fore  : Character_Attribute_Set := Normal_Video;
+      Color : Color_Pair := Color_Pair'First)
    is
       function Set_Menu_Fore (Men  : Menu;
                               Attr : C_Chtype) return C_Int;
@@ -563,7 +563,7 @@
       end if;
    end Set_Foreground;
 
-   procedure Foreground (Men  : in  Menu;
+   procedure Foreground (Men  : Menu;
                          Fore : out Character_Attribute_Set)
    is
       function Menu_Fore (Men : Menu) return C_Chtype;
@@ -572,7 +572,7 @@
       Fore := Chtype_To_AttrChar (Menu_Fore (Men)).Attr;
    end Foreground;
 
-   procedure Foreground (Men   : in  Menu;
+   procedure Foreground (Men   : Menu;
                          Fore  : out Character_Attribute_Set;
                          Color : out Color_Pair)
    is
@@ -584,9 +584,9 @@
    end Foreground;
 
    procedure Set_Background
-     (Men   : in Menu;
-      Back  : in Character_Attribute_Set := Normal_Video;
-      Color : in Color_Pair := Color_Pair'First)
+     (Men   : Menu;
+      Back  : Character_Attribute_Set := Normal_Video;
+      Color : Color_Pair := Color_Pair'First)
    is
       function Set_Menu_Back (Men  : Menu;
                               Attr : C_Chtype) return C_Int;
@@ -602,7 +602,7 @@
       end if;
    end Set_Background;
 
-   procedure Background (Men  : in  Menu;
+   procedure Background (Men  : Menu;
                          Back : out Character_Attribute_Set)
    is
       function Menu_Back (Men : Menu) return C_Chtype;
@@ -611,7 +611,7 @@
       Back := Chtype_To_AttrChar (Menu_Back (Men)).Attr;
    end Background;
 
-   procedure Background (Men   : in  Menu;
+   procedure Background (Men   : Menu;
                          Back  : out Character_Attribute_Set;
                          Color : out Color_Pair)
    is
@@ -622,9 +622,9 @@
       Color := Chtype_To_AttrChar (Menu_Back (Men)).Color;
    end Background;
 
-   procedure Set_Grey (Men   : in Menu;
-                       Grey  : in Character_Attribute_Set := Normal_Video;
-                       Color : in Color_Pair := Color_Pair'First)
+   procedure Set_Grey (Men   : Menu;
+                       Grey  : Character_Attribute_Set := Normal_Video;
+                       Color : Color_Pair := Color_Pair'First)
    is
       function Set_Menu_Grey (Men  : Menu;
                               Attr : C_Chtype) return C_Int;
@@ -641,7 +641,7 @@
       end if;
    end Set_Grey;
 
-   procedure Grey (Men  : in  Menu;
+   procedure Grey (Men  : Menu;
                    Grey : out Character_Attribute_Set)
    is
       function Menu_Grey (Men : Menu) return C_Chtype;
@@ -650,7 +650,7 @@
       Grey := Chtype_To_AttrChar (Menu_Grey (Men)).Attr;
    end Grey;
 
-   procedure Grey (Men  : in  Menu;
+   procedure Grey (Men  : Menu;
                    Grey : out Character_Attribute_Set;
                    Color : out Color_Pair)
    is
@@ -661,8 +661,8 @@
       Color := Chtype_To_AttrChar (Menu_Grey (Men)).Color;
    end Grey;
 
-   procedure Set_Pad_Character (Men : in Menu;
-                                Pad : in Character := Space)
+   procedure Set_Pad_Character (Men : Menu;
+                                Pad : Character := Space)
    is
       function Set_Menu_Pad (Men : Menu;
                              Ch  : C_Int) return C_Int;
@@ -676,7 +676,7 @@
       end if;
    end Set_Pad_Character;
 
-   procedure Pad_Character (Men : in  Menu;
+   procedure Pad_Character (Men : Menu;
                             Pad : out Character)
    is
       function Menu_Pad (Men : Menu) return C_Int;
@@ -685,10 +685,10 @@
       Pad := Character'Val (Menu_Pad (Men));
    end Pad_Character;
 -------------------------------------------------------------------------------
-   procedure Set_Spacing (Men   : in Menu;
-                          Descr : in Column_Position := 0;
-                          Row   : in Line_Position   := 0;
-                          Col   : in Column_Position := 0)
+   procedure Set_Spacing (Men   : Menu;
+                          Descr : Column_Position := 0;
+                          Row   : Line_Position   := 0;
+                          Col   : Column_Position := 0)
    is
       function Set_Spacing (Men     : Menu;
                             D, R, C : C_Int) return C_Int;
@@ -704,7 +704,7 @@
       end if;
    end Set_Spacing;
 
-   procedure Spacing (Men   : in Menu;
+   procedure Spacing (Men   : Menu;
                       Descr : out Column_Position;
                       Row   : out Line_Position;
                       Col   : out Column_Position)
@@ -752,7 +752,7 @@
       end case;
    end Set_Pattern;
 
-   procedure Pattern (Men  : in  Menu;
+   procedure Pattern (Men  : Menu;
                       Text : out String)
    is
       function Get_Pattern (Men : Menu) return chars_ptr;
@@ -761,9 +761,9 @@
       Fill_String (Get_Pattern (Men), Text);
    end Pattern;
 -------------------------------------------------------------------------------
-   procedure Set_Format (Men     : in Menu;
-                         Lines   : in Line_Count;
-                         Columns : in Column_Count)
+   procedure Set_Format (Men     : Menu;
+                         Lines   : Line_Count;
+                         Columns : Column_Count)
    is
       function Set_Menu_Fmt (Men : Menu;
                              Lin : C_Int;
@@ -779,7 +779,7 @@
       end if;
    end Set_Format;
 
-   procedure Format (Men     : in  Menu;
+   procedure Format (Men     : Menu;
                      Lines   : out Line_Count;
                      Columns : out Column_Count)
    is
@@ -799,8 +799,8 @@
       end if;
    end Format;
 -------------------------------------------------------------------------------
-   procedure Set_Item_Init_Hook (Men  : in Menu;
-                                 Proc : in Menu_Hook_Function)
+   procedure Set_Item_Init_Hook (Men  : Menu;
+                                 Proc : Menu_Hook_Function)
    is
       function Set_Item_Init (Men  : Menu;
                               Proc : Menu_Hook_Function) return C_Int;
@@ -813,8 +813,8 @@
       end if;
    end Set_Item_Init_Hook;
 
-   procedure Set_Item_Term_Hook (Men  : in Menu;
-                                 Proc : in Menu_Hook_Function)
+   procedure Set_Item_Term_Hook (Men  : Menu;
+                                 Proc : Menu_Hook_Function)
    is
       function Set_Item_Term (Men  : Menu;
                               Proc : Menu_Hook_Function) return C_Int;
@@ -827,8 +827,8 @@
       end if;
    end Set_Item_Term_Hook;
 
-   procedure Set_Menu_Init_Hook (Men  : in Menu;
-                                 Proc : in Menu_Hook_Function)
+   procedure Set_Menu_Init_Hook (Men  : Menu;
+                                 Proc : Menu_Hook_Function)
    is
       function Set_Menu_Init (Men  : Menu;
                               Proc : Menu_Hook_Function) return C_Int;
@@ -841,8 +841,8 @@
       end if;
    end Set_Menu_Init_Hook;
 
-   procedure Set_Menu_Term_Hook (Men  : in Menu;
-                                 Proc : in Menu_Hook_Function)
+   procedure Set_Menu_Term_Hook (Men  : Menu;
+                                 Proc : Menu_Hook_Function)
    is
       function Set_Menu_Term (Men  : Menu;
                               Proc : Menu_Hook_Function) return C_Int;
@@ -887,8 +887,8 @@
       return Menu_Term (Men);
    end Get_Menu_Term_Hook;
 -------------------------------------------------------------------------------
-   procedure Redefine (Men   : in Menu;
-                       Items : in Item_Array_Access)
+   procedure Redefine (Men   : Menu;
+                       Items : Item_Array_Access)
    is
       function Set_Items (Men   : Menu;
                           Items : System.Address) return C_Int;
@@ -990,7 +990,7 @@
    end Driver;
 
    procedure Free (IA         : in out Item_Array_Access;
-                   Free_Items : in Boolean := False)
+                   Free_Items : Boolean := False)
    is
       procedure Release is new Ada.Unchecked_Deallocation
         (Item_Array, Item_Array_Access);
diff -Naur ncurses-5.7.orig/Ada95/src/terminal_interface-curses-mouse.adb ncurses-5.7/Ada95/src/terminal_interface-curses-mouse.adb
--- ncurses-5.7.orig/Ada95/src/terminal_interface-curses-mouse.adb	2008-07-26 14:51:11.000000000 -0400
+++ ncurses-5.7/Ada95/src/terminal_interface-curses-mouse.adb	2011-01-08 18:13:50.315157326 -0500
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998-2004,2008 Free Software Foundation, Inc.              --
+-- Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,8 +35,8 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control:
---  $Revision: 1.22 $
---  $Date: 2008/07/26 18:51:11 $
+--  $Revision: 1.24 $
+--  $Date: 2009/12/26 17:38:58 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
@@ -50,7 +50,7 @@
    function Has_Mouse return Boolean
    is
       function Mouse_Avail return C_Int;
-      pragma Import (C, Mouse_Avail, "_nc_has_mouse");
+      pragma Import (C, Mouse_Avail, "has_mouse");
    begin
       if Has_Key (Key_Mouse) or else Mouse_Avail /= 0 then
          return True;
@@ -74,8 +74,8 @@
       return Event;
    end Get_Mouse;
 
-   procedure Register_Reportable_Event (Button : in Mouse_Button;
-                                        State  : in Button_State;
+   procedure Register_Reportable_Event (Button : Mouse_Button;
+                                        State  : Button_State;
                                         Mask   : in out Event_Mask)
    is
       Button_Nr : constant Natural := Mouse_Button'Pos (Button);
@@ -92,8 +92,8 @@
       end if;
    end Register_Reportable_Event;
 
-   procedure Register_Reportable_Events (Button : in Mouse_Button;
-                                         State  : in Button_States;
+   procedure Register_Reportable_Events (Button : Mouse_Button;
+                                         State  : Button_States;
                                          Mask   : in out Event_Mask)
    is
    begin
@@ -120,7 +120,7 @@
       return Old;
    end Start_Mouse;
 
-   procedure End_Mouse (Mask : in Event_Mask := No_Events)
+   procedure End_Mouse (Mask : Event_Mask := No_Events)
    is
    begin
       if Mask /= No_Events then
@@ -128,11 +128,11 @@
       end if;
    end End_Mouse;
 
-   procedure Dispatch_Event (Mask   : in  Event_Mask;
+   procedure Dispatch_Event (Mask   : Event_Mask;
                              Button : out Mouse_Button;
                              State  : out Button_State);
 
-   procedure Dispatch_Event (Mask   : in  Event_Mask;
+   procedure Dispatch_Event (Mask   : Event_Mask;
                              Button : out Mouse_Button;
                              State  : out Button_State) is
       L : Event_Mask;
@@ -168,7 +168,7 @@
       end if;
    end Dispatch_Event;
 
-   procedure Get_Event (Event  : in  Mouse_Event;
+   procedure Get_Event (Event  : Mouse_Event;
                         Y      : out Line_Position;
                         X      : out Column_Position;
                         Button : out Mouse_Button;
@@ -181,7 +181,7 @@
       Dispatch_Event (Mask, Button, State);
    end Get_Event;
 
-   procedure Unget_Mouse (Event : in Mouse_Event)
+   procedure Unget_Mouse (Event : Mouse_Event)
    is
       function Ungetmouse (Ev : Mouse_Event) return C_Int;
       pragma Import (C, Ungetmouse, "ungetmouse");
diff -Naur ncurses-5.7.orig/Ada95/src/terminal_interface-curses-panels-user_data.adb ncurses-5.7/Ada95/src/terminal_interface-curses-panels-user_data.adb
--- ncurses-5.7.orig/Ada95/src/terminal_interface-curses-panels-user_data.adb	2003-10-25 11:39:18.000000000 -0400
+++ ncurses-5.7/Ada95/src/terminal_interface-curses-panels-user_data.adb	2011-01-08 18:13:50.315157326 -0500
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,7 +35,7 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control:
---  $Revision: 1.11 $
+--  $Revision: 1.12 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with Interfaces.C;
@@ -48,8 +48,8 @@
 
    use type Interfaces.C.int;
 
-   procedure Set_User_Data (Pan  : in Panel;
-                            Data : in User_Access)
+   procedure Set_User_Data (Pan  : Panel;
+                            Data : User_Access)
    is
       function Set_Panel_Userptr (Pan  : Panel;
                                   Addr : User_Access) return C_Int;
@@ -60,7 +60,7 @@
       end if;
    end Set_User_Data;
 
-   function Get_User_Data (Pan  : in  Panel) return User_Access
+   function Get_User_Data (Pan  : Panel) return User_Access
    is
       function Panel_Userptr (Pan : Panel) return User_Access;
       pragma Import (C, Panel_Userptr, "panel_userptr");
@@ -68,7 +68,7 @@
       return Panel_Userptr (Pan);
    end Get_User_Data;
 
-   procedure Get_User_Data (Pan  : in  Panel;
+   procedure Get_User_Data (Pan  : Panel;
                             Data : out User_Access)
    is
    begin
diff -Naur ncurses-5.7.orig/Ada95/src/terminal_interface-curses-panels.adb ncurses-5.7/Ada95/src/terminal_interface-curses-panels.adb
--- ncurses-5.7.orig/Ada95/src/terminal_interface-curses-panels.adb	2004-08-21 17:37:00.000000000 -0400
+++ ncurses-5.7/Ada95/src/terminal_interface-curses-panels.adb	2011-01-08 18:13:50.315157326 -0500
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998,2004 Free Software Foundation, Inc.                   --
+-- Copyright (c) 1998-2004,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,8 +35,8 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control:
---  $Revision: 1.13 $
---  $Date: 2004/08/21 21:37:00 $
+--  $Revision: 1.14 $
+--  $Date: 2009/12/26 17:38:58 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
@@ -60,7 +60,7 @@
       return Pan;
    end Create;
 
-   procedure Bottom (Pan : in Panel)
+   procedure Bottom (Pan : Panel)
    is
       function Bottompanel (Pan : Panel) return C_Int;
       pragma Import (C, Bottompanel, "bottom_panel");
@@ -70,7 +70,7 @@
       end if;
    end Bottom;
 
-   procedure Top (Pan : in Panel)
+   procedure Top (Pan : Panel)
    is
       function Toppanel (Pan : Panel) return C_Int;
       pragma Import (C, Toppanel, "top_panel");
@@ -80,7 +80,7 @@
       end if;
    end Top;
 
-   procedure Show (Pan : in Panel)
+   procedure Show (Pan : Panel)
    is
       function Showpanel (Pan : Panel) return C_Int;
       pragma Import (C, Showpanel, "show_panel");
@@ -90,7 +90,7 @@
       end if;
    end Show;
 
-   procedure Hide (Pan : in Panel)
+   procedure Hide (Pan : Panel)
    is
       function Hidepanel (Pan : Panel) return C_Int;
       pragma Import (C, Hidepanel, "hide_panel");
@@ -113,8 +113,8 @@
       return Win;
    end Get_Window;
 
-   procedure Replace (Pan : in Panel;
-                      Win : in Window)
+   procedure Replace (Pan : Panel;
+                      Win : Window)
    is
       function Replace_Pan (Pan : Panel;
                             Win : Window) return C_Int;
@@ -125,9 +125,9 @@
       end if;
    end Replace;
 
-   procedure Move (Pan    : in Panel;
-                   Line   : in Line_Position;
-                   Column : in Column_Position)
+   procedure Move (Pan    : Panel;
+                   Line   : Line_Position;
+                   Column : Column_Position)
    is
       function Move (Pan    : Panel;
                      Line   : C_Int;
diff -Naur ncurses-5.7.orig/Ada95/src/terminal_interface-curses-termcap.adb ncurses-5.7/Ada95/src/terminal_interface-curses-termcap.adb
--- ncurses-5.7.orig/Ada95/src/terminal_interface-curses-termcap.adb	2006-06-25 10:30:22.000000000 -0400
+++ ncurses-5.7/Ada95/src/terminal_interface-curses-termcap.adb	2011-01-08 18:13:50.315157326 -0500
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 2000-2004,2006 Free Software Foundation, Inc.              --
+-- Copyright (c) 2000-2006,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,8 +35,8 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control:
---  $Revision: 1.11 $
---  $Date: 2006/06/25 14:30:22 $
+--  $Revision: 1.12 $
+--  $Date: 2009/12/26 17:38:58 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 
@@ -82,7 +82,7 @@
    end Get_Flag;
 
 ------------------------------------------------------------------------------
-   procedure Get_Number (Name   : in  String;
+   procedure Get_Number (Name   : String;
                          Value  : out Integer;
                          Result : out Boolean)
    is
diff -Naur ncurses-5.7.orig/Ada95/src/terminal_interface-curses-terminfo.adb ncurses-5.7/Ada95/src/terminal_interface-curses-terminfo.adb
--- ncurses-5.7.orig/Ada95/src/terminal_interface-curses-terminfo.adb	2006-06-25 10:30:22.000000000 -0400
+++ ncurses-5.7/Ada95/src/terminal_interface-curses-terminfo.adb	2011-01-08 18:13:50.315157326 -0500
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998-2000,2006 Free Software Foundation, Inc.              --
+-- Copyright (c) 1998-2006,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,8 +35,8 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control:
---  $Revision: 1.5 $
---  $Date: 2006/06/25 14:30:22 $
+--  $Revision: 1.6 $
+--  $Date: 2009/12/26 17:38:58 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 
@@ -47,9 +47,9 @@
 
 package body Terminal_Interface.Curses.Terminfo is
 
-   function Is_MinusOne_Pointer (P : in chars_ptr) return Boolean;
+   function Is_MinusOne_Pointer (P : chars_ptr) return Boolean;
 
-   function Is_MinusOne_Pointer (P : in chars_ptr) return Boolean is
+   function Is_MinusOne_Pointer (P : chars_ptr) return Boolean is
       type Weird_Address is new System.Storage_Elements.Integer_Address;
       Invalid_Pointer : constant Weird_Address := -1;
       function To_Weird is new Ada.Unchecked_Conversion
diff -Naur ncurses-5.7.orig/Ada95/src/terminal_interface-curses-text_io-aux.adb ncurses-5.7/Ada95/src/terminal_interface-curses-text_io-aux.adb
--- ncurses-5.7.orig/Ada95/src/terminal_interface-curses-text_io-aux.adb	2006-06-25 10:24:40.000000000 -0400
+++ ncurses-5.7/Ada95/src/terminal_interface-curses-text_io-aux.adb	2011-01-08 18:13:50.315157326 -0500
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998,2006 Free Software Foundation, Inc.                   --
+-- Copyright (c) 1998-2006,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,18 +35,18 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control:
---  $Revision: 1.12 $
---  $Date: 2006/06/25 14:24:40 $
+--  $Revision: 1.13 $
+--  $Date: 2009/12/26 17:38:58 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 package body Terminal_Interface.Curses.Text_IO.Aux is
 
    procedure Put_Buf
-     (Win    : in Window;
-      Buf    : in String;
-      Width  : in Field;
-      Signal : in Boolean := True;
-      Ljust  : in Boolean := False)
+     (Win    : Window;
+      Buf    : String;
+      Width  : Field;
+      Signal : Boolean := True;
+      Ljust  : Boolean := False)
    is
       L   : Field;
       Len : Field;
diff -Naur ncurses-5.7.orig/Ada95/src/terminal_interface-curses-text_io-aux.ads ncurses-5.7/Ada95/src/terminal_interface-curses-text_io-aux.ads
--- ncurses-5.7.orig/Ada95/src/terminal_interface-curses-text_io-aux.ads	2006-06-25 10:24:40.000000000 -0400
+++ ncurses-5.7/Ada95/src/terminal_interface-curses-text_io-aux.ads	2011-01-08 18:13:50.315157326 -0500
@@ -7,7 +7,7 @@
 --                                 S P E C                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998,2006 Free Software Foundation, Inc.                   --
+-- Copyright (c) 1998-2006,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,8 +35,8 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control:
---  $Revision: 1.13 $
---  $Date: 2006/06/25 14:24:40 $
+--  $Revision: 1.14 $
+--  $Date: 2009/12/26 17:38:58 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 private package Terminal_Interface.Curses.Text_IO.Aux is
@@ -46,10 +46,10 @@
    --  and enumeration types.
    --
    procedure Put_Buf
-     (Win    : in Window;               -- The output window
-      Buf    : in String;               -- The buffer containing the text
-      Width  : in Field;                -- The width of the output field
-      Signal : in Boolean := True;      -- If true, we raise Layout_Error
-      Ljust  : in Boolean := False);    -- The Buf is left justified
+     (Win    : Window;               -- The output window
+      Buf    : String;               -- The buffer containing the text
+      Width  : Field;                -- The width of the output field
+      Signal : Boolean := True;      -- If true, we raise Layout_Error
+      Ljust  : Boolean := False);    -- The Buf is left justified
 
 end Terminal_Interface.Curses.Text_IO.Aux;
diff -Naur ncurses-5.7.orig/Ada95/src/terminal_interface-curses-text_io-complex_io.adb ncurses-5.7/Ada95/src/terminal_interface-curses-text_io-complex_io.adb
--- ncurses-5.7.orig/Ada95/src/terminal_interface-curses-text_io-complex_io.adb	2003-10-25 11:39:18.000000000 -0400
+++ ncurses-5.7/Ada95/src/terminal_interface-curses-text_io-complex_io.adb	2011-01-08 18:13:50.315157326 -0500
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,7 +35,7 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control:
---  $Revision: 1.10 $
+--  $Revision: 1.11 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with Terminal_Interface.Curses.Text_IO.Float_IO;
@@ -46,11 +46,11 @@
      Terminal_Interface.Curses.Text_IO.Float_IO (Complex_Types.Real'Base);
 
    procedure Put
-     (Win  : in Window;
-      Item : in Complex;
-      Fore : in Field := Default_Fore;
-      Aft  : in Field := Default_Aft;
-      Exp  : in Field := Default_Exp)
+     (Win  : Window;
+      Item : Complex;
+      Fore : Field := Default_Fore;
+      Aft  : Field := Default_Aft;
+      Exp  : Field := Default_Exp)
    is
    begin
       Put (Win, '(');
@@ -61,10 +61,10 @@
    end Put;
 
    procedure Put
-     (Item : in Complex;
-      Fore : in Field := Default_Fore;
-      Aft  : in Field := Default_Aft;
-      Exp  : in Field := Default_Exp)
+     (Item : Complex;
+      Fore : Field := Default_Fore;
+      Aft  : Field := Default_Aft;
+      Exp  : Field := Default_Exp)
    is
    begin
       Put (Get_Window, Item, Fore, Aft, Exp);
diff -Naur ncurses-5.7.orig/Ada95/src/terminal_interface-curses-text_io-complex_io.ads ncurses-5.7/Ada95/src/terminal_interface-curses-text_io-complex_io.ads
--- ncurses-5.7.orig/Ada95/src/terminal_interface-curses-text_io-complex_io.ads	2003-10-25 11:39:18.000000000 -0400
+++ ncurses-5.7/Ada95/src/terminal_interface-curses-text_io-complex_io.ads	2011-01-08 18:13:50.315157326 -0500
@@ -7,7 +7,7 @@
 --                                 S P E C                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,7 +35,7 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control:
---  $Revision: 1.10 $
+--  $Revision: 1.11 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with Ada.Numerics.Generic_Complex_Types;
@@ -52,17 +52,17 @@
    Default_Exp  : Field := 3;
 
    procedure Put
-     (Win  : in Window;
-      Item : in Complex;
-      Fore : in Field := Default_Fore;
-      Aft  : in Field := Default_Aft;
-      Exp  : in Field := Default_Exp);
+     (Win  : Window;
+      Item : Complex;
+      Fore : Field := Default_Fore;
+      Aft  : Field := Default_Aft;
+      Exp  : Field := Default_Exp);
 
    procedure Put
-     (Item : in Complex;
-      Fore : in Field := Default_Fore;
-      Aft  : in Field := Default_Aft;
-      Exp  : in Field := Default_Exp);
+     (Item : Complex;
+      Fore : Field := Default_Fore;
+      Aft  : Field := Default_Aft;
+      Exp  : Field := Default_Exp);
 
 private
    pragma Inline (Put);
diff -Naur ncurses-5.7.orig/Ada95/src/terminal_interface-curses-text_io-decimal_io.adb ncurses-5.7/Ada95/src/terminal_interface-curses-text_io-decimal_io.adb
--- ncurses-5.7.orig/Ada95/src/terminal_interface-curses-text_io-decimal_io.adb	2003-10-25 11:39:18.000000000 -0400
+++ ncurses-5.7/Ada95/src/terminal_interface-curses-text_io-decimal_io.adb	2011-01-08 18:13:50.319157261 -0500
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,7 +35,7 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control:
---  $Revision: 1.10 $
+--  $Revision: 1.11 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with Ada.Text_IO;
@@ -47,11 +47,11 @@
    package DIO is new Ada.Text_IO.Decimal_IO (Num);
 
    procedure Put
-     (Win  : in Window;
-      Item : in Num;
-      Fore : in Field := Default_Fore;
-      Aft  : in Field := Default_Aft;
-      Exp  : in Field := Default_Exp)
+     (Win  : Window;
+      Item : Num;
+      Fore : Field := Default_Fore;
+      Aft  : Field := Default_Aft;
+      Exp  : Field := Default_Exp)
    is
       Buf : String (1 .. Field'Last);
       Len : Field := Fore + 1 + Aft;
@@ -64,10 +64,10 @@
    end Put;
 
    procedure Put
-     (Item  : in Num;
-      Fore : in Field := Default_Fore;
-      Aft  : in Field := Default_Aft;
-      Exp  : in Field := Default_Exp) is
+     (Item : Num;
+      Fore : Field := Default_Fore;
+      Aft  : Field := Default_Aft;
+      Exp  : Field := Default_Exp) is
    begin
       Put (Get_Window, Item, Fore, Aft, Exp);
    end Put;
diff -Naur ncurses-5.7.orig/Ada95/src/terminal_interface-curses-text_io-decimal_io.ads ncurses-5.7/Ada95/src/terminal_interface-curses-text_io-decimal_io.ads
--- ncurses-5.7.orig/Ada95/src/terminal_interface-curses-text_io-decimal_io.ads	2003-10-25 11:39:18.000000000 -0400
+++ ncurses-5.7/Ada95/src/terminal_interface-curses-text_io-decimal_io.ads	2011-01-08 18:13:50.319157261 -0500
@@ -7,7 +7,7 @@
 --                                 S P E C                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,7 +35,7 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control:
---  $Revision: 1.11 $
+--  $Revision: 1.12 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 generic
@@ -48,17 +48,17 @@
    Default_Exp  : Field := 0;
 
    procedure Put
-     (Win  : in Window;
-      Item : in Num;
-      Fore : in Field := Default_Fore;
-      Aft  : in Field := Default_Aft;
-      Exp  : in Field := Default_Exp);
+     (Win  : Window;
+      Item : Num;
+      Fore : Field := Default_Fore;
+      Aft  : Field := Default_Aft;
+      Exp  : Field := Default_Exp);
 
    procedure Put
-     (Item  : in Num;
-      Fore : in Field := Default_Fore;
-      Aft  : in Field := Default_Aft;
-      Exp  : in Field := Default_Exp);
+     (Item : Num;
+      Fore : Field := Default_Fore;
+      Aft  : Field := Default_Aft;
+      Exp  : Field := Default_Exp);
 
 private
    pragma Inline (Put);
diff -Naur ncurses-5.7.orig/Ada95/src/terminal_interface-curses-text_io-enumeration_io.adb ncurses-5.7/Ada95/src/terminal_interface-curses-text_io-enumeration_io.adb
--- ncurses-5.7.orig/Ada95/src/terminal_interface-curses-text_io-enumeration_io.adb	2003-10-25 11:39:18.000000000 -0400
+++ ncurses-5.7/Ada95/src/terminal_interface-curses-text_io-enumeration_io.adb	2011-01-08 18:13:50.319157261 -0500
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,7 +35,7 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control:
---  $Revision: 1.10 $
+--  $Revision: 1.11 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with Ada.Text_IO;
@@ -48,10 +48,10 @@
    package EIO is new Ada.Text_IO.Enumeration_IO (Enum);
 
    procedure Put
-     (Win   : in Window;
-      Item  : in Enum;
-      Width : in Field := Default_Width;
-      Set   : in Type_Set := Default_Setting)
+     (Win   : Window;
+      Item  : Enum;
+      Width : Field := Default_Width;
+      Set   : Type_Set := Default_Setting)
    is
       Buf  : String (1 .. Field'Last);
       Tset : Ada.Text_IO.Type_Set;
@@ -69,9 +69,9 @@
    end Put;
 
    procedure Put
-     (Item  : in Enum;
-      Width : in Field := Default_Width;
-      Set   : in Type_Set := Default_Setting)
+     (Item  : Enum;
+      Width : Field := Default_Width;
+      Set   : Type_Set := Default_Setting)
    is
    begin
       Put (Get_Window, Item, Width, Set);
diff -Naur ncurses-5.7.orig/Ada95/src/terminal_interface-curses-text_io-enumeration_io.ads ncurses-5.7/Ada95/src/terminal_interface-curses-text_io-enumeration_io.ads
--- ncurses-5.7.orig/Ada95/src/terminal_interface-curses-text_io-enumeration_io.ads	2003-10-25 11:39:18.000000000 -0400
+++ ncurses-5.7/Ada95/src/terminal_interface-curses-text_io-enumeration_io.ads	2011-01-08 18:13:50.319157261 -0500
@@ -7,7 +7,7 @@
 --                                 S P E C                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,7 +35,7 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control:
---  $Revision: 1.11 $
+--  $Revision: 1.12 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 generic
@@ -47,15 +47,15 @@
    Default_Setting : Type_Set := Mixed_Case;
 
    procedure Put
-     (Win   : in Window;
-      Item  : in Enum;
-      Width : in Field := Default_Width;
-      Set   : in Type_Set := Default_Setting);
+     (Win   : Window;
+      Item  : Enum;
+      Width : Field := Default_Width;
+      Set   : Type_Set := Default_Setting);
 
    procedure Put
-     (Item  : in Enum;
-      Width : in Field := Default_Width;
-      Set   : in Type_Set := Default_Setting);
+     (Item  : Enum;
+      Width : Field := Default_Width;
+      Set   : Type_Set := Default_Setting);
 
 private
    pragma Inline (Put);
diff -Naur ncurses-5.7.orig/Ada95/src/terminal_interface-curses-text_io-fixed_io.adb ncurses-5.7/Ada95/src/terminal_interface-curses-text_io-fixed_io.adb
--- ncurses-5.7.orig/Ada95/src/terminal_interface-curses-text_io-fixed_io.adb	2003-10-25 11:39:18.000000000 -0400
+++ ncurses-5.7/Ada95/src/terminal_interface-curses-text_io-fixed_io.adb	2011-01-08 18:13:50.319157261 -0500
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,7 +35,7 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control:
---  $Revision: 1.10 $
+--  $Revision: 1.11 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with Ada.Text_IO;
@@ -47,11 +47,11 @@
    package FIXIO is new Ada.Text_IO.Fixed_IO (Num);
 
    procedure Put
-     (Win  : in Window;
-      Item : in Num;
-      Fore : in Field := Default_Fore;
-      Aft  : in Field := Default_Aft;
-      Exp  : in Field := Default_Exp)
+     (Win  : Window;
+      Item : Num;
+      Fore : Field := Default_Fore;
+      Aft  : Field := Default_Aft;
+      Exp  : Field := Default_Exp)
    is
       Buf : String (1 .. Field'Last);
       Len : Field := Fore + 1 + Aft;
@@ -64,10 +64,10 @@
    end Put;
 
    procedure Put
-     (Item  : in Num;
-      Fore : in Field := Default_Fore;
-      Aft  : in Field := Default_Aft;
-      Exp  : in Field := Default_Exp) is
+     (Item : Num;
+      Fore : Field := Default_Fore;
+      Aft  : Field := Default_Aft;
+      Exp  : Field := Default_Exp) is
    begin
       Put (Get_Window, Item, Fore, Aft, Exp);
    end Put;
diff -Naur ncurses-5.7.orig/Ada95/src/terminal_interface-curses-text_io-fixed_io.ads ncurses-5.7/Ada95/src/terminal_interface-curses-text_io-fixed_io.ads
--- ncurses-5.7.orig/Ada95/src/terminal_interface-curses-text_io-fixed_io.ads	2003-10-25 11:39:18.000000000 -0400
+++ ncurses-5.7/Ada95/src/terminal_interface-curses-text_io-fixed_io.ads	2011-01-08 18:13:50.319157261 -0500
@@ -7,7 +7,7 @@
 --                                 S P E C                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,7 +35,7 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control:
---  $Revision: 1.11 $
+--  $Revision: 1.12 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 generic
@@ -48,17 +48,17 @@
    Default_Exp  : Field := 0;
 
    procedure Put
-     (Win  : in Window;
-      Item : in Num;
-      Fore : in Field := Default_Fore;
-      Aft  : in Field := Default_Aft;
-      Exp  : in Field := Default_Exp);
+     (Win  : Window;
+      Item : Num;
+      Fore : Field := Default_Fore;
+      Aft  : Field := Default_Aft;
+      Exp  : Field := Default_Exp);
 
    procedure Put
-     (Item  : in Num;
-      Fore : in Field := Default_Fore;
-      Aft  : in Field := Default_Aft;
-      Exp  : in Field := Default_Exp);
+     (Item : Num;
+      Fore : Field := Default_Fore;
+      Aft  : Field := Default_Aft;
+      Exp  : Field := Default_Exp);
 
 private
    pragma Inline (Put);
diff -Naur ncurses-5.7.orig/Ada95/src/terminal_interface-curses-text_io-float_io.adb ncurses-5.7/Ada95/src/terminal_interface-curses-text_io-float_io.adb
--- ncurses-5.7.orig/Ada95/src/terminal_interface-curses-text_io-float_io.adb	2003-10-25 11:39:18.000000000 -0400
+++ ncurses-5.7/Ada95/src/terminal_interface-curses-text_io-float_io.adb	2011-01-08 18:13:50.319157261 -0500
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,7 +35,7 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control:
---  $Revision: 1.10 $
+--  $Revision: 1.11 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with Ada.Text_IO;
@@ -47,11 +47,11 @@
    package FIO is new Ada.Text_IO.Float_IO (Num);
 
    procedure Put
-     (Win  : in Window;
-      Item : in Num;
-      Fore : in Field := Default_Fore;
-      Aft  : in Field := Default_Aft;
-      Exp  : in Field := Default_Exp)
+     (Win  : Window;
+      Item : Num;
+      Fore : Field := Default_Fore;
+      Aft  : Field := Default_Aft;
+      Exp  : Field := Default_Exp)
    is
       Buf : String (1 .. Field'Last);
       Len : Field := Fore + 1 + Aft;
@@ -64,10 +64,10 @@
    end Put;
 
    procedure Put
-     (Item : in Num;
-      Fore : in Field := Default_Fore;
-      Aft  : in Field := Default_Aft;
-      Exp  : in Field := Default_Exp)
+     (Item : Num;
+      Fore : Field := Default_Fore;
+      Aft  : Field := Default_Aft;
+      Exp  : Field := Default_Exp)
    is
    begin
       Put (Get_Window, Item, Fore, Aft, Exp);
diff -Naur ncurses-5.7.orig/Ada95/src/terminal_interface-curses-text_io-float_io.ads ncurses-5.7/Ada95/src/terminal_interface-curses-text_io-float_io.ads
--- ncurses-5.7.orig/Ada95/src/terminal_interface-curses-text_io-float_io.ads	2003-10-25 11:39:18.000000000 -0400
+++ ncurses-5.7/Ada95/src/terminal_interface-curses-text_io-float_io.ads	2011-01-08 18:13:50.319157261 -0500
@@ -7,7 +7,7 @@
 --                                 S P E C                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,7 +35,7 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control:
---  $Revision: 1.11 $
+--  $Revision: 1.12 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 generic
@@ -48,17 +48,17 @@
    Default_Exp  : Field := 3;
 
    procedure Put
-     (Win  : in Window;
-      Item : in Num;
-      Fore : in Field := Default_Fore;
-      Aft  : in Field := Default_Aft;
-      Exp  : in Field := Default_Exp);
+     (Win  : Window;
+      Item : Num;
+      Fore : Field := Default_Fore;
+      Aft  : Field := Default_Aft;
+      Exp  : Field := Default_Exp);
 
    procedure Put
-     (Item  : in Num;
-      Fore : in Field := Default_Fore;
-      Aft  : in Field := Default_Aft;
-      Exp  : in Field := Default_Exp);
+     (Item : Num;
+      Fore : Field := Default_Fore;
+      Aft  : Field := Default_Aft;
+      Exp  : Field := Default_Exp);
 
 private
    pragma Inline (Put);
diff -Naur ncurses-5.7.orig/Ada95/src/terminal_interface-curses-text_io-integer_io.adb ncurses-5.7/Ada95/src/terminal_interface-curses-text_io-integer_io.adb
--- ncurses-5.7.orig/Ada95/src/terminal_interface-curses-text_io-integer_io.adb	2003-10-25 11:39:18.000000000 -0400
+++ ncurses-5.7/Ada95/src/terminal_interface-curses-text_io-integer_io.adb	2011-01-08 18:13:50.319157261 -0500
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,7 +35,7 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control:
---  $Revision: 1.10 $
+--  $Revision: 1.11 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with Ada.Text_IO;
@@ -47,10 +47,10 @@
    package IIO is new Ada.Text_IO.Integer_IO (Num);
 
    procedure Put
-     (Win   : in Window;
-      Item  : in Num;
-      Width : in Field := Default_Width;
-      Base  : in Number_Base := Default_Base)
+     (Win   : Window;
+      Item  : Num;
+      Width : Field := Default_Width;
+      Base  : Number_Base := Default_Base)
    is
       Buf : String (1 .. Field'Last);
    begin
@@ -59,9 +59,9 @@
    end Put;
 
    procedure Put
-     (Item  : in Num;
-      Width : in Field := Default_Width;
-      Base  : in Number_Base := Default_Base)
+     (Item  : Num;
+      Width : Field := Default_Width;
+      Base  : Number_Base := Default_Base)
    is
    begin
       Put (Get_Window, Item, Width, Base);
diff -Naur ncurses-5.7.orig/Ada95/src/terminal_interface-curses-text_io-integer_io.ads ncurses-5.7/Ada95/src/terminal_interface-curses-text_io-integer_io.ads
--- ncurses-5.7.orig/Ada95/src/terminal_interface-curses-text_io-integer_io.ads	2003-10-25 11:39:18.000000000 -0400
+++ ncurses-5.7/Ada95/src/terminal_interface-curses-text_io-integer_io.ads	2011-01-08 18:13:50.319157261 -0500
@@ -7,7 +7,7 @@
 --                                 S P E C                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,7 +35,7 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control:
---  $Revision: 1.11 $
+--  $Revision: 1.12 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 generic
@@ -47,15 +47,15 @@
    Default_Base  : Number_Base := 10;
 
    procedure Put
-     (Win   : in Window;
-      Item  : in Num;
-      Width : in Field := Default_Width;
-      Base  : in Number_Base := Default_Base);
+     (Win   : Window;
+      Item  : Num;
+      Width : Field := Default_Width;
+      Base  : Number_Base := Default_Base);
 
    procedure Put
-     (Item  : in Num;
-      Width : in Field := Default_Width;
-      Base  : in Number_Base := Default_Base);
+     (Item  : Num;
+      Width : Field := Default_Width;
+      Base  : Number_Base := Default_Base);
 
 private
    pragma Inline (Put);
diff -Naur ncurses-5.7.orig/Ada95/src/terminal_interface-curses-text_io-modular_io.adb ncurses-5.7/Ada95/src/terminal_interface-curses-text_io-modular_io.adb
--- ncurses-5.7.orig/Ada95/src/terminal_interface-curses-text_io-modular_io.adb	2003-10-25 11:39:18.000000000 -0400
+++ ncurses-5.7/Ada95/src/terminal_interface-curses-text_io-modular_io.adb	2011-01-08 18:13:50.319157261 -0500
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,7 +35,7 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control:
---  $Revision: 1.10 $
+--  $Revision: 1.11 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with Ada.Text_IO;
@@ -47,10 +47,10 @@
    package MIO is new Ada.Text_IO.Modular_IO (Num);
 
    procedure Put
-     (Win   : in Window;
-      Item  : in Num;
-      Width : in Field := Default_Width;
-      Base  : in Number_Base := Default_Base)
+     (Win   : Window;
+      Item  : Num;
+      Width : Field := Default_Width;
+      Base  : Number_Base := Default_Base)
    is
       Buf : String (1 .. Field'Last);
    begin
@@ -59,9 +59,9 @@
    end Put;
 
    procedure Put
-     (Item  : in Num;
-      Width : in Field := Default_Width;
-      Base  : in Number_Base := Default_Base)
+     (Item  : Num;
+      Width : Field := Default_Width;
+      Base  : Number_Base := Default_Base)
    is
    begin
       Put (Get_Window, Item, Width, Base);
diff -Naur ncurses-5.7.orig/Ada95/src/terminal_interface-curses-text_io-modular_io.ads ncurses-5.7/Ada95/src/terminal_interface-curses-text_io-modular_io.ads
--- ncurses-5.7.orig/Ada95/src/terminal_interface-curses-text_io-modular_io.ads	2003-10-25 11:39:18.000000000 -0400
+++ ncurses-5.7/Ada95/src/terminal_interface-curses-text_io-modular_io.ads	2011-01-08 18:13:50.319157261 -0500
@@ -7,7 +7,7 @@
 --                                 S P E C                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,7 +35,7 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control:
---  $Revision: 1.11 $
+--  $Revision: 1.12 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 generic
@@ -47,15 +47,15 @@
    Default_Base  : Number_Base := 10;
 
    procedure Put
-     (Win   : in Window;
-      Item  : in Num;
-      Width : in Field := Default_Width;
-      Base  : in Number_Base := Default_Base);
+     (Win   : Window;
+      Item  : Num;
+      Width : Field := Default_Width;
+      Base  : Number_Base := Default_Base);
 
    procedure Put
-     (Item  : in Num;
-      Width : in Field := Default_Width;
-      Base  : in Number_Base := Default_Base);
+     (Item  : Num;
+      Width : Field := Default_Width;
+      Base  : Number_Base := Default_Base);
 
 private
    pragma Inline (Put);
diff -Naur ncurses-5.7.orig/Ada95/src/terminal_interface-curses-text_io.adb ncurses-5.7/Ada95/src/terminal_interface-curses-text_io.adb
--- ncurses-5.7.orig/Ada95/src/terminal_interface-curses-text_io.adb	2006-06-25 10:24:40.000000000 -0400
+++ ncurses-5.7/Ada95/src/terminal_interface-curses-text_io.adb	2011-01-08 18:13:50.319157261 -0500
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998-2004,2006 Free Software Foundation, Inc.              --
+-- Copyright (c) 1998-2006,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,15 +35,15 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control:
---  $Revision: 1.18 $
---  $Date: 2006/06/25 14:24:40 $
+--  $Revision: 1.19 $
+--  $Date: 2009/12/26 17:40:46 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 package body Terminal_Interface.Curses.Text_IO is
 
    Default_Window : Window := Null_Window;
 
-   procedure Set_Window (Win : in Window)
+   procedure Set_Window (Win : Window)
    is
    begin
       Default_Window := Win;
@@ -60,7 +60,7 @@
    end Get_Window;
    pragma Inline (Get_Window);
 
-   procedure Flush (Win : in Window)
+   procedure Flush (Win : Window)
    is
    begin
       Refresh (Win);
@@ -81,7 +81,7 @@
    --  A scroll-window is interpreted as an page with unbounded page length,
    --  i.e. it returns the conventional 0 as page length.
 
-   function Line_Length (Win : in Window) return Count
+   function Line_Length (Win : Window) return Count
    is
       N_Lines : Line_Count;
       N_Cols  : Column_Count;
@@ -99,7 +99,7 @@
       return Line_Length (Get_Window);
    end Line_Length;
 
-   function Page_Length (Win : in Window) return Count
+   function Page_Length (Win : Window) return Count
    is
       N_Lines : Line_Count;
       N_Cols  : Column_Count;
@@ -124,7 +124,7 @@
    ------------------------------------
    -- Column, Line, and Page Control --
    ------------------------------------
-   procedure New_Line (Win : in Window; Spacing : in Positive_Count := 1)
+   procedure New_Line (Win : Window; Spacing : Positive_Count := 1)
    is
       P_Size : constant Count := Page_Length (Win);
    begin
@@ -141,13 +141,13 @@
       end loop;
    end New_Line;
 
-   procedure New_Line (Spacing : in Positive_Count := 1)
+   procedure New_Line (Spacing : Positive_Count := 1)
    is
    begin
       New_Line (Get_Window, Spacing);
    end New_Line;
 
-   procedure New_Page (Win : in Window)
+   procedure New_Page (Win : Window)
    is
    begin
       Clear (Win);
@@ -159,7 +159,7 @@
       New_Page (Get_Window);
    end New_Page;
 
-   procedure Set_Col (Win : in Window;  To : in Positive_Count)
+   procedure Set_Col (Win : Window;  To : Positive_Count)
    is
       Y  : Line_Position;
       X1 : Column_Position;
@@ -187,13 +187,13 @@
       end if;
    end Set_Col;
 
-   procedure Set_Col (To : in Positive_Count)
+   procedure Set_Col (To : Positive_Count)
    is
    begin
       Set_Col (Get_Window, To);
    end Set_Col;
 
-   procedure Set_Line (Win : in Window; To : in Positive_Count)
+   procedure Set_Line (Win : Window; To : Positive_Count)
    is
       Y1 : Line_Position;
       Y2 : Line_Position;
@@ -216,13 +216,13 @@
       end if;
    end Set_Line;
 
-   procedure Set_Line (To : in Positive_Count)
+   procedure Set_Line (To : Positive_Count)
    is
    begin
       Set_Line (Get_Window, To);
    end Set_Line;
 
-   function Col (Win : in Window) return Positive_Count
+   function Col (Win : Window) return Positive_Count
    is
       Y : Line_Position;
       X : Column_Position;
@@ -242,7 +242,7 @@
       return Col (Get_Window);
    end Col;
 
-   function Line (Win : in Window) return Positive_Count
+   function Line (Win : Window) return Positive_Count
    is
       Y : Line_Position;
       X : Column_Position;
@@ -266,7 +266,7 @@
    -- Characters Output --
    -----------------------
 
-   procedure Put (Win  : in Window; Item : in Character)
+   procedure Put (Win  : Window; Item : Character)
    is
       P_Size : constant Count := Page_Length (Win);
       Y : Line_Position;
@@ -284,7 +284,7 @@
       Add (Win, Item);
    end Put;
 
-   procedure Put (Item : in Character)
+   procedure Put (Item : Character)
    is
    begin
       Put (Get_Window, Item);
@@ -294,7 +294,7 @@
    -- Strings-Output --
    --------------------
 
-   procedure Put (Win  : in Window; Item : in String)
+   procedure Put (Win  : Window; Item : String)
    is
       P_Size : constant Count := Page_Length (Win);
       Y : Line_Position;
@@ -312,15 +312,15 @@
       Add (Win, Item);
    end Put;
 
-   procedure Put (Item : in String)
+   procedure Put (Item : String)
    is
    begin
       Put (Get_Window, Item);
    end Put;
 
    procedure Put_Line
-     (Win  : in Window;
-      Item : in String)
+     (Win  : Window;
+      Item : String)
    is
    begin
       Put (Win, Item);
@@ -328,7 +328,7 @@
    end Put_Line;
 
    procedure Put_Line
-     (Item : in String)
+     (Item : String)
    is
    begin
       Put_Line (Get_Window, Item);
diff -Naur ncurses-5.7.orig/Ada95/src/terminal_interface-curses-text_io.ads ncurses-5.7/Ada95/src/terminal_interface-curses-text_io.ads
--- ncurses-5.7.orig/Ada95/src/terminal_interface-curses-text_io.ads	2003-10-25 11:39:18.000000000 -0400
+++ ncurses-5.7/Ada95/src/terminal_interface-curses-text_io.ads	2011-01-08 18:13:50.319157261 -0500
@@ -7,7 +7,7 @@
 --                                 S P E C                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,7 +35,7 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control:
---  $Revision: 1.13 $
+--  $Revision: 1.14 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with Ada.Text_IO;
@@ -56,13 +56,13 @@
    --  type parameter. They will operate on a default window, which can
    --  be set by the user. It is initially equal to Standard_Window.
 
-   procedure Set_Window (Win : in Window);
+   procedure Set_Window (Win : Window);
    --  Set Win as the default window
 
    function Get_Window return Window;
    --  Get the current default window
 
-   procedure Flush (Win : in Window);
+   procedure Flush (Win : Window);
    procedure Flush;
 
    --------------------------------------------
@@ -74,53 +74,53 @@
    --  A scroll-window is interpreted as an page with unbounded page length,
    --  i.e. it returns the conventional 0 as page length.
 
-   function Line_Length (Win : in Window) return Count;
+   function Line_Length (Win : Window) return Count;
    function Line_Length return Count;
 
-   function Page_Length (Win : in Window) return Count;
+   function Page_Length (Win : Window) return Count;
    function Page_Length return Count;
 
    ------------------------------------
    -- Column, Line, and Page Control --
    ------------------------------------
-   procedure New_Line (Win : in Window; Spacing : in Positive_Count := 1);
-   procedure New_Line (Spacing : in Positive_Count := 1);
+   procedure New_Line (Win : Window; Spacing : Positive_Count := 1);
+   procedure New_Line (Spacing : Positive_Count := 1);
 
-   procedure New_Page (Win : in Window);
+   procedure New_Page (Win : Window);
    procedure New_Page;
 
-   procedure Set_Col (Win : in Window;  To : in Positive_Count);
-   procedure Set_Col (To : in Positive_Count);
+   procedure Set_Col (Win : Window;  To : Positive_Count);
+   procedure Set_Col (To : Positive_Count);
 
-   procedure Set_Line (Win : in Window; To : in Positive_Count);
-   procedure Set_Line (To : in Positive_Count);
+   procedure Set_Line (Win : Window; To : Positive_Count);
+   procedure Set_Line (To : Positive_Count);
 
-   function Col (Win : in Window) return Positive_Count;
+   function Col (Win : Window) return Positive_Count;
    function Col return Positive_Count;
 
-   function Line (Win : in Window) return Positive_Count;
+   function Line (Win : Window) return Positive_Count;
    function Line return Positive_Count;
 
    -----------------------
    -- Characters-Output --
    -----------------------
 
-   procedure Put (Win  : in Window; Item : in Character);
-   procedure Put (Item : in Character);
+   procedure Put (Win  : Window; Item : Character);
+   procedure Put (Item : Character);
 
    --------------------
    -- Strings-Output --
    --------------------
 
-   procedure Put (Win  : in Window; Item : in String);
-   procedure Put (Item : in String);
+   procedure Put (Win  : Window; Item : String);
+   procedure Put (Item : String);
 
    procedure Put_Line
-     (Win  : in Window;
-      Item : in String);
+     (Win  : Window;
+      Item : String);
 
    procedure Put_Line
-     (Item : in String);
+     (Item : String);
 
    --  Exceptions
 
diff -Naur ncurses-5.7.orig/Ada95/src/terminal_interface-curses-trace.adb_p ncurses-5.7/Ada95/src/terminal_interface-curses-trace.adb_p
--- ncurses-5.7.orig/Ada95/src/terminal_interface-curses-trace.adb_p	2004-08-21 17:45:53.000000000 -0400
+++ ncurses-5.7/Ada95/src/terminal_interface-curses-trace.adb_p	2011-01-08 18:13:50.319157261 -0500
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 2000,2004 Free Software Foundation, Inc.                   --
+-- Copyright (c) 2000-2004,2009 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,7 +35,7 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control:
---  $Revision: 1.5 $
+--  $Revision: 1.6 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 #if ADA_TRACE then
@@ -69,7 +69,7 @@
       pragma Import (C, tracef, "_tracef");
       Txt    : char_array (0 .. str'Length);
       Length : size_t;
-      formatstr : constant String := "%s" &  ASCII.Nul;
+      formatstr : constant String := "%s" &  ASCII.NUL;
       formattxt : char_array (0 .. formatstr'Length);
    begin
       To_C (formatstr, formattxt, Length);
diff -Naur ncurses-5.7.orig/INSTALL ncurses-5.7/INSTALL
--- ncurses-5.7.orig/INSTALL	2008-11-02 16:13:51.000000000 -0500
+++ ncurses-5.7/INSTALL	2011-01-08 18:18:29.418656418 -0500
@@ -1,5 +1,5 @@
 -------------------------------------------------------------------------------
--- Copyright (c) 1998-2006,2008 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             --
@@ -25,7 +25,7 @@
 -- sale, use or other dealings in this Software without prior written        --
 -- authorization.                                                            --
 -------------------------------------------------------------------------------
--- $Id: INSTALL,v 1.135 2008/11/02 21:13:51 tom Exp $
+-- $Id: INSTALL,v 1.148 2010/10/23 22:41:32 tom Exp $
 ---------------------------------------------------------------------
              How to install Ncurses/Terminfo on your system
 ---------------------------------------------------------------------
@@ -39,9 +39,8 @@
 including `c++', `form', `man', `menu', 'misc', `ncurses', `panel', `progs',
 and `test'.  See the README file for a roadmap to the package.
 
-If you are a Linux or FreeBSD or NetBSD distribution integrator or packager,
-please read and act on the section titled IF YOU ARE A SYSTEM INTEGRATOR
-below.
+If you are a distribution integrator or packager, please read and act on the
+section titled IF YOU ARE A SYSTEM INTEGRATOR below.
 
 If you are converting from BSD curses and do not have root access, be sure
 to read the BSD CONVERSION NOTES section below.
@@ -58,10 +57,6 @@
 If you want to build the Ada95 binding, go to the Ada95 directory and
 follow the instructions there.  The Ada95 binding is not covered below.
 
-If you are using anything but (a) Linux, or (b) one of the 4.4BSD-based
-i386 Unixes, go read the Portability section in the TO-DO file before you
-do anything else.
-
 
 REQUIREMENTS:
 ------------
@@ -86,14 +81,14 @@
 
     The --prefix option to configure changes the root directory for installing
     ncurses.  The default is normally in subdirectories of /usr/local, except
-    for systems where ncurses is normally installed as a system library, e.g.,
-    Linux, the various BSD systems and Cygwin.  Use --prefix=/usr to replace
-    your default curses distribution.
+    for systems where ncurses is normally installed as a system library (see
+    "IF YOU ARE A SYSTEM INTEGRATOR").  Use --prefix=/usr to replace your
+    default curses distribution.
 
     The package gets installed beneath the --prefix directory as follows:
 
     In $(prefix)/bin:          tic, infocmp, captoinfo, tset,
-				reset, clear, tput, toe
+				reset, clear, tput, toe, tabs
     In $(prefix)/lib:          libncurses*.* libcurses.a
     In $(prefix)/share/terminfo: compiled terminal descriptions
     In $(prefix)/include:      C header files
@@ -105,12 +100,12 @@
 
     Do not use commands such as
 
-    	make install prefix=XXX
+	make install prefix=XXX
 
     to change the prefix after configuration, since the prefix value is used
     for some absolute pathnames such as TERMINFO.  Instead do this
 
-    	make install DESTDIR=XXX
+	make install DESTDIR=XXX
 
     See also the discussion of --with-install-prefix.
 
@@ -147,7 +142,7 @@
     library interfaces are not binary-compatible with the non-wide-character
     version.  Building and running the wide-character code relies on a fairly
     recent implementation of libiconv.  We have built this configuration on
-    Linux using libiconv, sometimes requiring libutf8.
+    various systems using libiconv, sometimes requiring libutf8.
 
     If you configure using the --with-pthread option, a "t" is appended to
     the library names (e.g., libncursest.a, libncursestw.a).
@@ -170,8 +165,8 @@
 	./configure --with-shared --without-normal --without-debug
 
     Rules for generating shared libraries are highly dependent upon the choice
-    of host system and compiler.  We've been testing shared libraries on Linux
-    and SunOS with gcc, but more work needs to be done to make shared libraries
+    of host system and compiler.  We've been testing shared libraries on
+    several systems, but more work needs to be done to make shared libraries
     work on other systems.
 
     If you have libtool installed, you can type
@@ -338,6 +333,17 @@
     --disable-largefile
 	Disable compiler flags needed to use large-file interfaces.
 
+    --disable-libtool-version
+	when using --with-libtool, control how the major/minor version numbers
+	are used for constructing the library name.
+
+	The default uses the -version-number feature of libtool, which makes
+	the library names compatible (though not identical) with the standard
+	build using --with-shared.
+
+	Use --disable-libtool-version to use the libtool -version-info feature.
+	This corresponds to the setting used before patch 20100515.
+
     --disable-leaks
 	For testing, compile-in code that frees memory that normally would not
 	be freed, to simplify analysis of memory-leaks.
@@ -389,6 +395,12 @@
 	application.  These are (for example $TERMINFO) those that allow the
 	search path for the terminfo or termcap entry to be customized.
 
+    --disable-rpath-hack
+	Normally the configure script helps link libraries found in unusual
+	places by adding an rpath option to the link command.  If you are
+	building packages, this feature may be redundant.  Use this option
+	to suppress the feature.
+
     --disable-scroll-hints
 	Compile without scroll-hints code.  This option is ignored when
 	hashmap scrolling is configured, which is the default.
@@ -513,6 +525,10 @@
 	may not be accurate, or that your stty settings have disabled the use
 	of tabs.
 
+    --enable-interop
+	Compile-in experimental interop bindings.  These provide generic types
+	for the form-library.
+
     --enable-mixed-case
 	Controls whether the filesystem on which the terminfo database resides
 	supports mixed-case filenames (normal for UNIX, but not on other
@@ -525,6 +541,15 @@
 	terminfo entries.  This is the default, unless you have disabled the
 	extended functions.
 
+    --enable-pc-files
+	If pkg-config is found (see --with-pkg-config), generate ".pc" files
+	for each of the libraries, and install them in pkg-config's library
+	directory.
+
+    --enable-pthreads-eintr
+	add logic in threaded configuration to ensure that a read(2) system
+	call can be interrupted for SIGWINCH.
+
     --enable-reentrant
 	Compile experimental configuration which improves reentrant use of the
 	library by reducing global and static variables.  This option is also
@@ -565,6 +590,11 @@
 	is not strictly compatible.  This option allows one to implement this
 	alteration without patching the source code.
 
+    --enable-sp-funcs
+	Compile-in support for extended functions which accept a SCREEN pointer,
+	reducing the need for juggling the global SP value with set_term() and
+	delscreen().
+
     --enable-symlinks
 	If your system supports symbolic links, make tic use symbolic links
 	rather than hard links to save diskspace when writing aliases in the
@@ -576,6 +606,11 @@
 	capabilities as user-defined strings.  This option is the default,
 	unless you have disabled the extended functions.
 
+    --enable-term-driver
+	Enable experimental terminal-driver.  This is currently used for the
+	MinGW port, by providing a way to substitute the low-level terminfo
+	library with different terminal drivers.
+
     --enable-termcap
 	Compile in support for reading terminal descriptions from termcap if no
 	match is found in the terminfo database.  See also the --enable-getcap
@@ -630,12 +665,19 @@
     --with-ada-objects=DIR
 	Tell where to install the Ada objects (default:  PREFIX/lib/ada/adalib)
 
+    --with-ada-sharedlib
+	Build a shared library for Ada95 binding, if the compiler permits.
+
     --with-bool=TYPE
 	If --without-cxx is specified, override the type used for the "bool"
 	declared in curses.h (normally the type is automatically chosen to
 	correspond with that in <stdbool.h>, or defaults to platform-specific
 	sizes).
 
+    --with-build-cpp=XXX
+	This option is provided by the same macro used for $BUILD_CC, etc.,
+	but is not directly used by ncurses.
+
     --with-build-cc=XXX
 	If cross-compiling, specify a host C compiler, which is needed to
 	compile a few utilities which generate source modules for ncurses.
@@ -682,6 +724,10 @@
 	to use a terminfo database which is compatible with the native
 	applications.
 
+    --with-ccharw-max=XXX
+	Override the size of the wide-character array in cchar_t structures.
+	Changing this will alter the binary interface.  This defaults to 5.
+
     --with-chtype=TYPE
 	Override type of chtype, which stores the video attributes and (if
 	--enable-widec is not given) a character.  Prior to ncurses 5.5, this
@@ -719,7 +765,7 @@
 	use Alessandro Rubini's GPM library to provide mouse support on the
 	Linux console.  Prior to ncurses 5.5, this introduced a dependency on
 	the GPM library.
-	
+
 	Currently ncurses uses the dlsym() function to bind to the library at
 	runtime, so it is only necessary that the library be present when
 	ncurses is built, to obtain the filename (or soname) used in the
@@ -736,7 +782,7 @@
 	Use a hashed database for storing terminfo data rather than storing
 	each compiled entry in a separate binary file within a directory
 	tree.
-	
+
 	In particular, this uses the Berkeley database 1.8.5 interface, as
 	provided by that and its successors db 2, 3, and 4.  The actual
 	interface is slightly different in the successor versions of the
@@ -807,9 +853,9 @@
 
     --with-manpage-renames=XXX
 	Tell the configure script that you wish to rename the manpages while
-	installing.  Currently the only distribution which does this is
-	the Linux Debian.  The option value specifies the name of a file
-	that lists the renamed files, e.g., $srcdir/man/man_db.renames
+	installing.  Currently the only distribution which does this is Debian.
+	The option value specifies the name of a file that lists the renamed
+	files, e.g., $srcdir/man/man_db.renames
 
     --with-manpage-symlinks
 	Tell the configure script that you wish to make symbolic links in the
@@ -850,6 +896,9 @@
 	those using termcap, do not use the higher speeds.  Your application
 	(or system, in general) may or may not.
 
+    --with-pkg-config=[DIR]
+	Check for pkg-config, optionally specifying its path.
+
     --with-profile
 	Generate profile-libraries These are named by adding "_p" to the root,
 	e.g., libncurses_p.a
@@ -885,7 +934,7 @@
 	loads the system's copy of the ncurses shared libraries.  In that
 	case, using the misc/shlib script may be helpful, since it sets
 	$LD_LIBRARY_PATH to point to the build tree, e.g.,
-		./misc/shlib make install 	
+		./misc/shlib make install
 
     --with-shlib-version=XXX
 	Specify whether to use the release or ABI version for shared libraries.
@@ -946,6 +995,17 @@
 	For testing, compile with debug option.
 	This also sets the --disable-leaks option.
 
+    --with-wrap-prefix=XXX
+	When using the --enable-reentrant option, ncurses redefines variables
+	that would be global in curses, e.g., LINES, as a macro that calls a
+	"wrapping" function which fetches the data from the current SCREEN
+	structure.  Normally that function is named by prepending "_nc_" to the
+	variable's name.  The function is technically private (since portable
+	applications would not refer directly to it).  But according to one
+	line of reasoning, it is not the same type of "private" as functions
+	which applications should not call even via a macro.  This configure
+	option lets you choose the prefix for these wrapped variables.
+
     --without-ada
 	Suppress the configure script's check for Ada95, do not build the
 	Ada95 binding and related demo.
@@ -975,11 +1035,18 @@
     --without-dlsym
 	Do not use dlsym() to load GPM dynamically.
 
+    --without-manpages
+	Tell the configure script to suppress the install of ncurses' manpages.
+
     --without-progs
 	Tell the configure script to suppress the build of ncurses' application
 	programs (e.g., tic).  The test applications will still be built if you
 	type "make", though not if you simply do "make install".
 
+    --without-tests
+	Tell the configure script to suppress the build of ncurses' test
+	programs.
+
     --without-xterm-new
 	Tell the configure script to use "xterm-old" for the entry used in
 	the terminfo database.  This will work with variations such as
@@ -1011,7 +1078,7 @@
 	  of the ncurses library used for the tic program as well as some
 	  others such as tack.  There is no API change, but makefiles would be
 	  changed to use the tic-library built separately.
-	  
+
 	  tack, distributed separately from ncurses, uses some of the internal
 	  _nc_XXX functions, which are declared in the tic.h header file.
 
@@ -1158,7 +1225,7 @@
 	  still used in this release to allow compiling with not-so-old
 	  compilers.
 
-	+ form and menu libraries now work with wide-character data. 
+	+ form and menu libraries now work with wide-character data.
 	  Applications which bypassed the form library and manipulated the
 	  FIELD.buf data directly will not work properly with libformw, since
 	  that no longer points to an array of char.  The set_field_buffer()
@@ -1438,8 +1505,8 @@
 
     4.0 (December 24, 1996)
 
-	We bumped to version 4.0 because the newly released dynamic loader
-	(ld.so.1.8.5) on Linux did not load shared libraries whose ABI and REL
+	We bumped to version 4.0 because the newly released Linux dynamic
+	loader (ld.so.1.8.5) did not load shared libraries whose ABI and REL
 	versions were inconsistent.  At that point, ncurses ABI was 3.4 and the
 	REL was 1.9.9g, so we made them consistent.
 
@@ -1496,10 +1563,10 @@
 
     Configuration and Installation:
 
-    	On platforms where ncurses is assumed to be installed in /usr/lib,
+	On platforms where ncurses is assumed to be installed in /usr/lib,
 	the configure script uses "/usr" as a default:
 
-		Linux, FreeBSD, NetBSD, OpenBSD, Cygwin
+		GNU/Linux, FreeBSD, NetBSD, OpenBSD, Cygwin
 
 	For other platforms, the default is "/usr/local".  See the discussion
 	of the "--disable-overwrite" option.
@@ -1562,7 +1629,7 @@
 		bsdos	-- BSD/OS
 
 	If you are responsible for integrating ncurses for one of these
-	distribution, please either use the recommended name or get back
+	distributions, please either use the recommended name or get back
 	to us explaining why you don't want to, so we can work out nomenclature
 	that will make users' lives easier rather than harder.
 
@@ -1584,7 +1651,8 @@
 	tree is accessible (that is, in single-user mode or at OS installation
 	time) the ncurses library can be compiled to include an array of
 	pre-fetched fallback entries.  This must be done on a machine which
-	has ncurses' infocmp and terminfo database installed.
+	has ncurses' infocmp and terminfo database installed (as well as
+	ncurses' tic and infocmp programs).
 
 	These entries are checked by setupterm() only when the conventional
 	fetches from the terminfo tree and the termcap fallback (if configured)
@@ -1689,8 +1757,8 @@
 	with this by making tic use symbolic links.
 
 USING NCURSES WITH GPM:
-	Ncurses 4.1 and up can be configured to use GPM (General Purpose
-	Mouse) which is used on Linux console.  Be aware that GPM is commonly
+	Ncurses 4.1 and up can be configured to use GPM (General Purpose Mouse)
+	which is used with Linux console.  Be aware that GPM is commonly
 	installed as a shared library which contains a wrapper for the curses
 	wgetch() function (libcurses.o).  Some integrators have simplified
 	linking applications by combining all or part of libcurses.so into the
@@ -1735,6 +1803,10 @@
 	option), ncurses uses the development platform's tic to do the
 	"make install.data" portion.
 
+	The system's tic program is used to install the terminal database,
+	even for cross-compiles.  For best results, the tic program should
+	be from the most current version of ncurses.
+
 BUGS:
 	Send any feedback to the ncurses mailing list at
 	bug-ncurses@gnu.org. To subscribe send mail to
diff -Naur ncurses-5.7.orig/MANIFEST ncurses-5.7/MANIFEST
--- ncurses-5.7.orig/MANIFEST	2008-10-25 19:47:24.000000000 -0400
+++ ncurses-5.7/MANIFEST	2011-01-08 18:18:29.374655641 -0500
@@ -3,6 +3,9 @@
 ./Ada95/Makefile.in
 ./Ada95/README
 ./Ada95/TODO
+./Ada95/aclocal.m4
+./Ada95/configure
+./Ada95/configure.in
 ./Ada95/gen/Makefile.in
 ./Ada95/gen/adacurses-config.in
 ./Ada95/gen/gen.c
@@ -23,6 +26,12 @@
 ./Ada95/gen/terminal_interface-curses-trace.ads.m4
 ./Ada95/gen/terminal_interface-curses.adb.m4
 ./Ada95/gen/terminal_interface-curses.ads.m4
+./Ada95/include/MKncurses_def.sh
+./Ada95/include/Makefile.in
+./Ada95/include/ncurses_cfg.hin
+./Ada95/include/ncurses_defs
+./Ada95/make-tar.sh
+./Ada95/mk-1st.awk
 ./Ada95/samples/Makefile.in
 ./Ada95/samples/README
 ./Ada95/samples/explain.txt
@@ -109,6 +118,8 @@
 ./Ada95/samples/tour.adb
 ./Ada95/samples/tour.ads
 ./Ada95/src/Makefile.in
+./Ada95/src/library.gpr
+./Ada95/src/modules
 ./Ada95/src/terminal_interface-curses-aux.adb
 ./Ada95/src/terminal_interface-curses-forms-field_types-alpha.adb
 ./Ada95/src/terminal_interface-curses-forms-field_types-alpha.ads
@@ -172,6 +183,7 @@
 ./Makefile.os2
 ./NEWS
 ./README
+./README.MinGW
 ./README.emx
 ./TO-DO
 ./aclocal.m4
@@ -311,6 +323,7 @@
 ./doc/html/announce.html
 ./doc/html/hackguide.html
 ./doc/html/index.html
+./doc/html/man/adacurses-config.1.html
 ./doc/html/man/captoinfo.1m.html
 ./doc/html/man/clear.1.html
 ./doc/html/man/curs_add_wch.3x.html
@@ -350,6 +363,7 @@
 ./doc/html/man/curs_inwstr.3x.html
 ./doc/html/man/curs_kernel.3x.html
 ./doc/html/man/curs_legacy.3x.html
+./doc/html/man/curs_memleaks.3x.html
 ./doc/html/man/curs_mouse.3x.html
 ./doc/html/man/curs_move.3x.html
 ./doc/html/man/curs_opaque.3x.html
@@ -363,6 +377,7 @@
 ./doc/html/man/curs_scr_dump.3x.html
 ./doc/html/man/curs_scroll.3x.html
 ./doc/html/man/curs_slk.3x.html
+./doc/html/man/curs_sp_funcs.3x.html
 ./doc/html/man/curs_termattrs.3x.html
 ./doc/html/man/curs_termcap.3x.html
 ./doc/html/man/curs_terminfo.3x.html
@@ -370,6 +385,7 @@
 ./doc/html/man/curs_touch.3x.html
 ./doc/html/man/curs_trace.3x.html
 ./doc/html/man/curs_util.3x.html
+./doc/html/man/curs_variables.3x.html
 ./doc/html/man/curs_window.3x.html
 ./doc/html/man/default_colors.3x.html
 ./doc/html/man/define_key.3x.html
@@ -395,6 +411,7 @@
 ./doc/html/man/form_post.3x.html
 ./doc/html/man/form_requestname.3x.html
 ./doc/html/man/form_userptr.3x.html
+./doc/html/man/form_variables.3x.html
 ./doc/html/man/form_win.3x.html
 ./doc/html/man/index.html
 ./doc/html/man/infocmp.1m.html
@@ -427,10 +444,13 @@
 ./doc/html/man/mitem_value.3x.html
 ./doc/html/man/mitem_visible.3x.html
 ./doc/html/man/ncurses.3x.html
+./doc/html/man/ncurses5-config.1.html
 ./doc/html/man/panel.3x.html
 ./doc/html/man/resizeterm.3x.html
+./doc/html/man/tabs.1.html
 ./doc/html/man/term.5.html
 ./doc/html/man/term.7.html
+./doc/html/man/term_variables.3x.html
 ./doc/html/man/terminfo.5.html
 ./doc/html/man/tic.1m.html
 ./doc/html/man/toe.1m.html
@@ -479,12 +499,15 @@
 ./form/fty_alnum.c
 ./form/fty_alpha.c
 ./form/fty_enum.c
+./form/fty_generic.c
 ./form/fty_int.c
 ./form/fty_ipv4.c
 ./form/fty_num.c
 ./form/fty_regex.c
 ./form/headers
 ./form/llib-lform
+./form/llib-lformt
+./form/llib-lformtw
 ./form/llib-lformw
 ./form/modules
 ./include/Caps
@@ -507,16 +530,20 @@
 ./include/hashed_db.h
 ./include/headers
 ./include/nc_alloc.h
+./include/nc_mingw.h
 ./include/nc_panel.h
 ./include/nc_tparm.h
 ./include/ncurses_cfg.hin
 ./include/ncurses_defs
-./include/ncurses_dll.h
+./include/ncurses_dll.h.in
+./include/ncurses_mingw.h
 ./include/term_entry.h
 ./include/termcap.h.in
 ./include/tic.h
 ./include/unctrl.h.in
 ./install-sh
+./man/MKada_config.in
+./man/MKncu_config.in
 ./man/MKterminfo.sh
 ./man/Makefile.in
 ./man/captoinfo.1m
@@ -572,6 +599,7 @@
 ./man/curs_scr_dump.3x
 ./man/curs_scroll.3x
 ./man/curs_slk.3x
+./man/curs_sp_funcs.3x
 ./man/curs_termattrs.3x
 ./man/curs_termcap.3x
 ./man/curs_terminfo.3x
@@ -579,6 +607,7 @@
 ./man/curs_touch.3x
 ./man/curs_trace.3x
 ./man/curs_util.3x
+./man/curs_variables.3x
 ./man/curs_window.3x
 ./man/default_colors.3x
 ./man/define_key.3x
@@ -604,6 +633,7 @@
 ./man/form_post.3x
 ./man/form_requestname.3x
 ./man/form_userptr.3x
+./man/form_variables.3x
 ./man/form_win.3x
 ./man/infocmp.1m
 ./man/infotocap.1m
@@ -640,8 +670,10 @@
 ./man/ncurses.3x
 ./man/panel.3x
 ./man/resizeterm.3x
+./man/tabs.1
 ./man/term.5
 ./man/term.7
+./man/term_variables.3x
 ./man/terminfo.head
 ./man/terminfo.tail
 ./man/tic.1m
@@ -654,6 +686,8 @@
 ./menu/eti.h
 ./menu/headers
 ./menu/llib-lmenu
+./menu/llib-lmenut
+./menu/llib-lmenutw
 ./menu/llib-lmenuw
 ./menu/m_attribs.c
 ./menu/m_cursor.c
@@ -694,13 +728,12 @@
 ./misc/emx.src
 ./misc/form.def
 ./misc/form.ref
+./misc/gen-pkgconfig.in
 ./misc/gen_edit.sh
-./misc/jpf-indent
 ./misc/makedef.cmd
 ./misc/makellib
 ./misc/menu.def
 ./misc/menu.ref
-./misc/ncu-indent
 ./misc/ncurses-config.in
 ./misc/ncurses.def
 ./misc/ncurses.ref
@@ -718,8 +751,8 @@
 ./mk-0th.awk
 ./mk-1st.awk
 ./mk-2nd.awk
+./mk-dlls.sh.in
 ./mk-hdr.awk
-./mkdirs.sh
 ./ncurses/Makefile.in
 ./ncurses/README
 ./ncurses/README.IZ
@@ -748,6 +781,7 @@
 ./ncurses/base/lib_delch.c
 ./ncurses/base/lib_delwin.c
 ./ncurses/base/lib_dft_fgbg.c
+./ncurses/base/lib_driver.c
 ./ncurses/base/lib_echo.c
 ./ncurses/base/lib_endwin.c
 ./ncurses/base/lib_erase.c
@@ -813,10 +847,12 @@
 ./ncurses/base/version.c
 ./ncurses/base/vsscanf.c
 ./ncurses/base/wresize.c
+./ncurses/build.priv.h
 ./ncurses/curses.priv.h
 ./ncurses/fifo_defs.h
 ./ncurses/llib-lncurses
 ./ncurses/llib-lncursest
+./ncurses/llib-lncursestw
 ./ncurses/llib-lncursesw
 ./ncurses/modules
 ./ncurses/tinfo/MKcaptab.awk
@@ -863,6 +899,7 @@
 ./ncurses/tinfo/lib_tparm.c
 ./ncurses/tinfo/lib_tputs.c
 ./ncurses/tinfo/lib_ttyflags.c
+./ncurses/tinfo/make_hash.c
 ./ncurses/tinfo/make_keys.c
 ./ncurses/tinfo/name_match.c
 ./ncurses/tinfo/parse_entry.c
@@ -870,6 +907,7 @@
 ./ncurses/tinfo/read_termcap.c
 ./ncurses/tinfo/setbuf.c
 ./ncurses/tinfo/strings.c
+./ncurses/tinfo/tinfo_driver.c
 ./ncurses/tinfo/trim_sgr0.c
 ./ncurses/tinfo/use_screen.c
 ./ncurses/tinfo/write_entry.c
@@ -895,6 +933,7 @@
 ./ncurses/tty/tty_display.h
 ./ncurses/tty/tty_input.h
 ./ncurses/tty/tty_update.c
+./ncurses/wcwidth.h
 ./ncurses/widechar/charable.c
 ./ncurses/widechar/lib_add_wch.c
 ./ncurses/widechar/lib_box_set.c
@@ -915,9 +954,14 @@
 ./ncurses/widechar/lib_vline_set.c
 ./ncurses/widechar/lib_wacs.c
 ./ncurses/widechar/lib_wunctrl.c
+./ncurses/win32con/gettimeofday.c
+./ncurses/win32con/wcwidth.c
+./ncurses/win32con/win_driver.c
 ./panel/Makefile.in
 ./panel/headers
 ./panel/llib-lpanel
+./panel/llib-lpanelt
+./panel/llib-lpaneltw
 ./panel/llib-lpanelw
 ./panel/modules
 ./panel/p_above.c
@@ -947,11 +991,12 @@
 ./progs/infocmp.c
 ./progs/modules
 ./progs/progs.priv.h
+./progs/tabs.c
 ./progs/tic.c
 ./progs/toe.c
 ./progs/tput.c
+./progs/transform.c
 ./progs/tset.c
-./tar-copy.sh
 ./test/Makefile.in
 ./test/README
 ./test/aclocal.m4
@@ -963,6 +1008,7 @@
 ./test/cardfile.c
 ./test/cardfile.dat
 ./test/chgat.c
+./test/clip_printw.c
 ./test/color_set.c
 ./test/configure
 ./test/configure.in
@@ -973,6 +1019,7 @@
 ./test/demo_menus.c
 ./test/demo_panels.c
 ./test/demo_termcap.c
+./test/demo_terminfo.c
 ./test/ditto.c
 ./test/dots.c
 ./test/dots_mvcur.c
@@ -990,13 +1037,16 @@
 ./test/inch_wide.c
 ./test/inchs.c
 ./test/ins_wide.c
+./test/insdelln.c
 ./test/inserts.c
 ./test/key_names.c
 ./test/keynames.c
 ./test/knight.c
+./test/linedata.h
 ./test/linux-color.dat
 ./test/listused.sh
 ./test/lrtest.c
+./test/make-tar.sh
 ./test/mk-test.awk
 ./test/modules
 ./test/movewindow.c
@@ -1011,6 +1061,10 @@
 ./test/savescreen.sh
 ./test/tclock.c
 ./test/test.priv.h
+./test/test_add_wchstr.c
+./test/test_addchstr.c
+./test/test_addstr.c
+./test/test_addwstr.c
 ./test/test_arrays.c
 ./test/test_get_wstr.c
 ./test/test_getstr.c
@@ -1026,4 +1080,5 @@
 ./test/worm.c
 ./test/xmas.c
 ./test/xterm-16color.dat
+./test/xterm-256color.dat
 ./test/xterm-88color.dat
diff -Naur ncurses-5.7.orig/Makefile.in ncurses-5.7/Makefile.in
--- ncurses-5.7.orig/Makefile.in	2005-01-29 14:30:06.000000000 -0500
+++ ncurses-5.7/Makefile.in	2011-01-08 18:18:29.558656121 -0500
@@ -1,6 +1,6 @@
-# $Id: Makefile.in,v 1.24 2005/01/29 19:30:06 tom Exp $
+# $Id: Makefile.in,v 1.30 2010/11/27 21:45:27 tom Exp $
 ##############################################################################
-# Copyright (c) 1998-2004,2005 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 "Software"), #
@@ -32,6 +32,7 @@
 # Master Makefile for ncurses library.
 
 SHELL = /bin/sh
+VPATH		= @srcdir@
 
 DESTDIR=@DESTDIR@
 CF_MFLAGS = @cf_cv_makeflags@ DESTDIR="$(DESTDIR)"
@@ -42,6 +43,9 @@
 NCURSES_MINOR	= @NCURSES_MINOR@
 NCURSES_PATCH	= @NCURSES_PATCH@
 
+top_srcdir	= @top_srcdir@
+srcdir		= @srcdir@
+
 prefix		= @prefix@
 exec_prefix	= @exec_prefix@
 
@@ -83,6 +87,13 @@
 		fgrep NCURSES_VERSION $(includedir)/curses.h >/dev/null || \
 		echo '** Will overwrite non-ncurses curses.h'
 
+dlls:	libs
+	$(SHELL) $(srcdir)/mk-dlls.sh
+
+distclean \
+realclean ::
+	-rm -f mk-dlls.sh mingw_arch
+
 # Put the common rules here so that we can easily construct the list of
 # directories to visit.
 all \
diff -Naur ncurses-5.7.orig/NEWS ncurses-5.7/NEWS
--- ncurses-5.7.orig/NEWS	2008-11-01 20:56:22.000000000 -0400
+++ ncurses-5.7/NEWS	2011-01-08 18:18:29.782781749 -0500
@@ -1,5 +1,5 @@
 -------------------------------------------------------------------------------
--- Copyright (c) 1998-2007,2008 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             --
@@ -25,7 +25,7 @@
 -- sale, use or other dealings in this Software without prior written        --
 -- authorization.                                                            --
 -------------------------------------------------------------------------------
--- $Id: NEWS,v 1.1320 2008/11/02 00:56:22 tom Exp $
+-- $Id: NEWS,v 1.1626 2011/01/01 23:11:55 tom Exp $
 -------------------------------------------------------------------------------
 
 This is a log of changes that ncurses has gone through since Zeyd started
@@ -45,6 +45,928 @@
 Changes through 1.9.9e did not credit all contributions;
 it is not possible to add this information.
 
+20110101
+	+ fix remaining strict compiler warnings in ncurses library ABI=5,
+	  except those dealing with function pointers, etc.
+
+20101225
+	+ modify nc_tparm.h, adding guards against repeated inclusion, and
+	  allowing TPARM_ARG to be overridden.
+	+ fix some strict compiler warnings in ncurses library.
+
+20101211
+	+ suppress ncv in screen entry, allowing underline (patch by Alejandro
+	  R Sedeno).
+	+ also suppress ncv in konsole-base -TD
+	+ fixes in wins_nwstr() and related functions to ensure that special
+	  characters, i.e., control characters are handled properly with the
+	  wide-character configuration.
+	+ correct a comparison in wins_nwstr() (Redhat #661506).
+	+ correct help-messages in some of the test-programs, which still
+	  referred to quitting with 'q'.
+
+20101204
+	+ add special case to _nc_infotocap() to recognize the setaf/setab
+	  strings from xterm+256color and xterm+88color, and provide a reduced
+	  version which works with termcap.
+	+ remove obsolete emacs "Local Variables" section from documentation
+	  (request by Sven Joachim).
+	+ update doc/html/index.html to include NCURSES-Programming-HOWTO.html 
+	  (report by Sven Joachim).
+
+20101128
+	+ modify test/configure and test/Makefile.in to handle this special
+	  case of building within a build-tree (Debian #34182):
+		mkdir -p build && cd build && ../test/configure && make
+
+20101127
+	+ miscellaneous build-fixes for Ada95 and test-directories when built
+	  out-of-tree.
+	+ use VPATH in makefiles to simplify out-of-tree builds (Debian #34182).
+	+ fix typo in rmso for tek4106 entry -Goran Weinholt
+
+20101120
+	+ improve checks in test/configure for X libraries, from xterm #267
+	  changes.
+	+ modify test/configure to allow it to use the build-tree's libraries
+	  e.g., when using that to configure the test-programs without the
+	  rpath feature (request by Sven Joachim).
+	+ repurpose "gnome" terminfo entries as "vte", retaining "gnome" items
+	  for compatibility, but generally deprecating those since the VTE
+	  library is what actually defines the behavior of "gnome", etc.,
+	  since 2003 -TD
+
+20101113
+	+ compiler warning fixes for test programs.
+	+ various build-fixes for test-programs with pdcurses.
+	+ updated configure checks for X packages in test/configure from xterm
+	  #267 changes.
+	+ add configure check to gnatmake, to accommodate cygwin.
+
+20101106
+	+ correct list of sub-directories needed in Ada95 tree for building as
+	  a separate package.
+	+ modify scripts in test-directory to improve builds as a separate
+	  package.
+
+20101023
+	+ correct parsing of relative tab-stops in tabs program (report by
+	  Philip Ganchev).
+	+ adjust configure script so that "t" is not added to library suffix
+	  when weak-symbols are used, allowing the pthread configuration to
+	  more closely match the non-thread naming (report by Werner Fink).
+	+ modify configure check for tic program, used for fallbacks, to a
+	  warning if not found.  This makes it simpler to use additonal
+	  scripts to bootstrap the fallbacks code using tic from the build
+	  tree (report by Werner Fink).
+	+ fix several places in configure script using ${variable-value} form.
+	+ modify configure macro CF_LDFLAGS_STATIC to accommodate some loaders
+	  which do not support selectively linking against static libraries
+	  (report by John P. Hartmann)
+	+ fix an unescaped dash in man/tset.1 (report by Sven Joachim).
+
+20101009
+	+ correct comparison used for setting 16-colors in linux-16color
+	  entry (Novell #644831) -TD
+	+ improve linux-16color entry, using "dim" for color-8 which makes it
+	  gray rather than black like color-0 -TD
+	+ drop misc/ncu-indent and misc/jpf-indent; they are provided by an
+	  external package "cindent".
+
+20101002
+	+ improve linkages in html manpages, adding references to the newer
+	  pages, e.g., *_variables, curs_sp_funcs, curs_threads.
+	+ add checks in tic for inconsistent cursor-movement controls, and for
+	  inconsistent printer-controls.
+	+ fill in no-parameter forms of cursor-movement where a parameterized
+	  form is available -TD
+	+ fill in missing cursor controls where the form of the controls is
+	  ANSI -TD
+	+ fix inconsistent punctuation in form_variables manpage (patch by
+	  Sven Joachim).
+	+ add parameterized cursor-controls to linux-basic (report by Dae) -TD
+	> patch by Juergen Pfeifer:
+	+ document how to build 32-bit libraries in README.MinGW 
+	+ fixes to filename computation in mk-dlls.sh.in 
+	+ use POSIX locale in mk-dlls.sh.in rather than en_US (report by Sven
+	  Joachim).
+	+ add a check in mk-dlls.sh.in to obtain the size of a pointer to
+	  distinguish between 32-bit and 64-bit hosts.  The result is stored
+	  in mingw_arch
+
+20100925
+	+ add "XT" capability to entries for terminals that support both
+	  xterm-style mouse- and title-controls, for "screen" which
+	  special-cases TERM beginning with "xterm" or "rxvt" -TD
+	> patch by Juergen Pfeifer:
+	+ use 64-Bit MinGW toolchain (recommended package from TDM, see
+	  README.MinGW).
+	+ support pthreads when using the TDM MinGW toolchain
+
+20100918
+	+ regenerated html manpages.
+	+ minor fixes for symlinks to curs_legacy.3x and curs_slk.3x manpages.
+	+ add manpage for sp-funcs.
+	+ add sp-funcs to test/listused.sh, for documentation aids.
+
+20100911
+	+ add manpages for summarizing public variables of curses-, terminfo-
+	  and form-libraries.
+	+ minor fixes to manpages for consistency (patch by Jason McIntyre).
+	+ modify tic's -I/-C dump to reformat acsc strings into canonical form
+	  (sorted, unique mapping) (cf: 971004).
+	+ add configure check for pthread_kill(), needed for some old
+	  platforms.
+
+20100904
+	+ add configure option --without-tests, to suppress building test
+	  programs (request by Frederic L W Meunier).
+
+20100828
+	+ modify nsterm, xnuppc and tek4115 to make sgr/sgr0 consistent -TD
+	+ add check in terminfo source-reader to provide more informative
+	  message when someone attempts to run tic on a compiled terminal
+	  description (prompted by Debian #593920).
+	+ note in infotocap and captoinfo manpages that they read terminal
+	  descriptions from text-files (Debian #593920).
+	+ improve acsc string for vt52, show arrow keys (patch by Benjamin
+	  Sittler).
+
+20100814
+	+ document in manpages that "mv" functions first use wmove() to check
+	  the window pointer and whether the position lies within the window
+	  (suggested by Poul-Henning Kamp).
+	+ fixes to curs_color.3x, curs_kernel.3x and wresize.3x manpages (patch
+	  by Tim van der Molen).
+	+ modify configure script to transform library names for tic- and
+	  tinfo-libraries so that those build properly with Mac OS X shared
+	  library configuration.
+	+ modify configure script to ensure that it removes conftest.dSYM
+	  directory leftover on checks with Mac OS X.
+	+ modify configure script to cleanup after check for symbolic links.
+
+20100807
+	+ correct a typo in mk-1st.awk (patch by Gabriele Balducci)
+	  (cf: 20100724)
+	+ improve configure checks for location of tic and infocmp programs
+	  used for installing database and for generating fallback data,
+	  e.g., for cross-compiling.
+	+ add Markus Kuhn's wcwidth function for compiling MinGW
+	+ add special case to CF_REGEX for cross-compiling to MinGW target.
+
+20100731
+	+ modify initialization check for win32con driver to eliminate need for
+	  special case for TERM "unknown", using terminal database if available
+	  (prompted by discussion with Roumen Petrov).
+	+ for MinGW port, ensure that terminal driver is setup if tgetent()
+	  is called (patch by Roumen Petrov).
+	+ document tabs "-0" and "-8" options in manpage.
+	+ fix Debian "lintian" issues with manpages reported in
+	  http://lintian.debian.org/full/csmall@debian.org.html#ncurses
+
+20100724
+	+ add a check in tic for missing set_tab if clear_all_tabs given.
+	+ improve use of symbolic links in makefiles by using "-f" option if
+	  it is supported, to eliminate temporary removal of the target
+	  (prompted by http://www.t2-project.org/packages/ncurses.html)
+	+ minor improvement to test/ncurses.c, reset color pairs in 'd' test
+	  after exit from 'm' main-menu command.
+	+ improved ncu-indent, from mawk changes, allows more than one of
+	  GCC_NORETURN, GCC_PRINTFLIKE and GCC_SCANFLIKE on a single line.
+
+20100717
+	+ add hard-reset for rs2 to wsvt25 to help ensure that reset ends
+	  the alternate character set (patch by Nicholas Marriott)
+	+ remove tar-copy.sh and related configure/Makefile chunks, since the
+	  Ada95 binding is now installed using rules in Ada95/src.
+
+20100703
+	+ continue integrating changes to use gnatmake project files in Ada95
+	  + add/use configure check to turn on project rules for Ada95/src.
+	+ revert the vfork change from 20100130, since it does not work.
+
+20100626
+	+ continue integrating changes to use gnatmake project files in Ada95
+	  + old gnatmake (3.15) does not produce libraries using project-file;
+	    work around by adding script to generate alternate makefile.
+
+20100619
+	+ continue integrating changes to use gnatmake project files in Ada95
+	  + add configure --with-ada-sharedlib option, for the test_make rule.
+	  + move Ada95-related logic into aclocal.m4, since additional checks
+	    will be needed to distinguish old/new implementations of gnat.
+
+20100612
+	+ start integrating changes to use gnatmake project files in Ada95 tree
+	  + add test_make / test_clean / test_install rules in Ada95/src
+	  + change install-path for adainclude directory to /usr/share/ada (was
+	    /usr/lib/ada).
+	+ update Ada95/configure.
+	+ add mlterm+256color entry, for mlterm 3.0.0 -TD
+	+ modify test/configure to use macros to ensure consistent order
+	  of updating LIBS variable.
+
+20100605
+	+ change search order of options for Solaris in CF_SHARED_OPTS, to
+	  work with 64-bit compiles.
+	+ correct quoting of assignment in CF_SHARED_OPTS case for aix
+	  (cf: 20081227)
+
+20100529
+	+ regenerated html documentation.
+	+ modify test/configure to support pkg-config for checking X libraries
+	  used by PDCurses.
+	+ add/use configure macro CF_ADD_LIB to force consistency of
+	  assignments to $LIBS, etc.
+	+ fix configure script for combining --with-pthread
+	  and --enable-weak-symbols options.
+
+20100522
+	+ correct cross-compiling configure check for CF_MKSTEMP macro, by
+	  adding a check cache variable set by AC_CHECK_FUNC (report by
+	  Pierre Labastie).
+	+ simplify include-dependencies of make_hash and make_keys, to reduce
+	  the need for setting BUILD_CPPFLAGS in cross-compiling when the
+	  build- and target-machines differ.
+	+ repair broken-linker configuration by restoring a definition of SP
+	  variable to curses.priv.h, and adjusting for cases where sp-funcs
+	  are used.
+	+ improve configure macro CF_AR_FLAGS, allowing ARFLAGS environment
+	  variable to override (prompted by report by Pablo Cazallas).
+
+20100515
+	+ add configure option --enable-pthreads-eintr to control whether the
+	  new EINTR feature is enabled.
+	+ modify logic in pthread configuration to allow EINTR to interrupt
+	  a read operation in wgetch() (Novell #540571, patch by Werner Fink).
+	+ drop mkdirs.sh, use "mkdir -p".
+	+ add configure option --disable-libtool-version, to use the
+	  "-version-number" feature which was added in libtool 1.5 (report by
+	  Peter Haering).  The default value for the option uses the newer
+	  feature, which makes libraries generated using libtool compatible
+	  with the standard builds of ncurses.
+	+ updated test/configure to match configure script macros.
+	+ fixes for configure script from lynx changes:
+	  + improve CF_FIND_LINKAGE logic for the case where a function is
+	    found in predefined libraries.
+	  + revert part of change to CF_HEADER (cf: 20100424)
+
+20100501
+	+ correct limit-check in wredrawln, accounting for begy/begx values
+	  (patch by David Benjamin).
+	+ fix most compiler warnings from clang.
+	+ amend build-fix for OpenSolaris, to ensure that a system header is
+	  included in curses.h before testing feature symbols, since they
+	  may be defined by that route.
+
+20100424
+	+ fix some strict compiler warnings in ncurses library.
+	+ modify configure macro CF_HEADER_PATH to not look for variations in
+	  the predefined include directories.
+	+ improve configure macros CF_GCC_VERSION and CF_GCC_WARNINGS to work
+	  with gcc 4.x's c89 alias, which gives warning messages for cases
+	  where older versions would produce an error.
+
+20100417
+	+ modify _nc_capcmp() to work with cancelled strings.
+	+ correct translation of "^" in _nc_infotocap(), used to transform
+	  terminfo to termcap strings 
+	+ add configure --disable-rpath-hack, to allow disabling the feature
+	  which adds rpath options for libraries in unusual places.
+	+ improve CF_RPATH_HACK_2 by checking if the rpath option for a given
+	  directory was already added.
+	+ improve CF_RPATH_HACK_2 by using ldd to provide a standard list of
+	  directories (which will be ignored).
+
+20100410
+	+ improve win_driver.c handling of mouse:
+	  + discard motion events
+	  + avoid calling _nc_timed_wait when there is a mouse event
+	  + handle 4th and "rightmost" buttons.
+	+ quote substitutions in CF_RPATH_HACK_2 configure macro, needed for
+	  cases where there are embedded blanks in the rpath option.
+
+20100403
+	+ add configure check for exctags vs ctags, to work around pkgsrc.
+	+ simplify logic in _nc_get_screensize() to make it easier to see how
+	  environment variables may override system- and terminfo-values
+	  (prompted by discussion with Igor Bujna).
+	+ make debug-traces for COLOR_PAIR and PAIR_NUMBER less verbose.
+	+ improve handling of color-pairs embedded in attributes for the
+	  extended-colors configuration.
+	+ modify MKlib_gen.sh to build link_test with sp-funcs.
+	+ build-fixes for OpenSolaris aka Solaris 11, for wide-character
+	  configuration as well as for rpath feature in *-config scripts.
+
+20100327
+	+ refactor CF_SHARED_OPTS configure macro, making CF_RPATH_HACK more
+	  reusable.
+	+ improve configure CF_REGEX, similar fixes.
+	+ improve configure CF_FIND_LINKAGE, adding add check between system
+	  (default) and explicit paths, where we can find the entrypoint in the
+	  given library.
+	+ add check if Gpm_Open() returns a -2, e.g., for "xterm".  This is
+	  normally suppressed but can be overridden using $NCURSES_GPM_TERMS.
+	  Ensure that Gpm_Close() is called in this case.
+
+20100320
+	+ rename atari and st52 terminfo entries to atari-old, st52-old, use
+	  newer entries from FreeMiNT by Guido Flohr (from patch/report by Alan
+	  Hourihane).
+
+20100313
+	+ modify install-rule for manpages so that *-config manpages will
+	  install when building with --srcdir (report by Sven Joachim).
+	+ modify CF_DISABLE_LEAKS configure macro so that the --enable-leaks
+	  option is not the same as --disable-leaks (GenToo #305889).
+	+ modify #define's for build-compiler to suppress cchar_t symbol from
+	  compile of make_hash and make_keys, improving cross-compilation of
+	  ncursesw (report by Bernhard Rosenkraenzer).
+	+ modify CF_MAN_PAGES configure macro to replace all occurrences of
+	  TPUT in tput.1's manpage (Debian #573597, report/analysis by Anders
+	  Kaseorg).
+
+20100306
+	+ generate manpages for the *-config scripts, adapted from help2man
+	  (suggested by Sven Joachim).
+	+ use va_copy() in _nc_printf_string() to avoid conflicting use of
+	  va_list value in _nc_printf_length() (report by Wim Lewis).
+
+20100227
+	+ add Ada95/configure script, to use in tar-file created by
+	  Ada95/make-tar.sh
+	+ fix typo in wresize.3x (patch by Tim van der Molen).
+	+ modify screen-bce.XXX entries to exclude ech, since screen's color
+	  model does not clear with color for that feature -TD
+
+20100220
+	+ add make-tar.sh scripts to Ada95 and test subdirectories to help with
+	  making those separately distributable.
+	+ build-fix for static libraries without dlsym (Debian #556378).
+	+ fix a syntax error in man/form_field_opts.3x (patch by Ingo
+	  Schwarze).
+
+20100213
+	+ add several screen-bce.XXX entries -TD
+
+20100206
+	+ update mrxvt terminfo entry -TD
+	+ modify win_driver.c to support mouse single-clicks.
+	+ correct name for termlib in ncurses*-config, e.g., if it is renamed
+	  to provide a single file for ncurses/ncursesw libraries (patch by
+	  Miroslav Lichvar).
+
+20100130
+	+ use vfork in test/ditto.c if available (request by Mike Frysinger).
+	+ miscellaneous cleanup of manpages.
+	+ fix typo in curs_bkgd.3x (patch by Tim van der Molen).
+	+ build-fix for --srcdir (patch by Miroslav Lichvar).
+
+20100123
+	+ for term-driver configuration, ensure that the driver pointer is
+	  initialized in setupterm so that terminfo/termcap programs work.
+	+ amend fix for Debian #542031 to ensure that wattrset() returns only
+	  OK or ERR, rather than the attribute value (report by Miroslav
+	  Lichvar).
+	+ reorder WINDOWLIST to put WINDOW data after SCREEN pointer, making
+	  _nc_screen_of() compatible between normal/wide libraries again (patch
+	  by Miroslav Lichvar)
+	+ review/fix include-dependencies in modules files (report by Miroslav
+	  Lichvar).
+
+20100116
+	+ modify win_driver.c to initialize acs_map for win32 console, so
+	  that line-drawing works.
+	+ modify win_driver.c to initialize TERMINAL struct so that programs
+	  such as test/lrtest.c and test/ncurses.c which test string
+	  capabilities can run.
+	+ modify term-driver modules to eliminate forward-reference
+	  declarations.
+
+20100109
+	+ modify configure macro CF_XOPEN_SOURCE, etc., to use CF_ADD_CFLAGS
+	  consistently to add new -D's while removing duplicates.
+	+ modify a few configure macros to consistently put new options
+	  before older in the list.
+	+ add tiparm(), based on review of X/Open Curses Issue 7.
+	+ minor documentation cleanup.
+	+ update config.guess, config.sub from
+		http://savannah.gnu.org/projects/config
+	  (caveat - its maintainer put 2010 copyright date on files dated 2009)
+
+20100102
+	+ minor improvement to tic's checking of similar SGR's to allow for the
+	  most common case of SGR 0.
+	+ modify getmouse() to act as its documentation implied, returning on
+	  each call the preceding event until none are left.  When no more
+	  events remain, it will return ERR.
+
+20091227
+	+ change order of lookup in progs/tput.c, looking for terminfo data
+	  first.  This fixes a confusion between termcap "sg" and terminfo
+	  "sgr" or "sgr0", originally from 990123 changes, but exposed by
+	  20091114 fixes for hashing.  With this change, only "dl" and "ed" are
+	  ambiguous (Mandriva #56272).
+
+20091226
+	+ add bterm terminfo entry, based on bogl 0.1.18 -TD
+	+ minor fix to rxvt+pcfkeys terminfo entry -TD
+	+ build-fixes for Ada95 tree for gnat 4.4 "style".
+
+20091219
+	+ remove old check in mvderwin() which prevented moving a derived
+	  window whose origin happened to coincide with its parent's origin
+	  (report by Katarina Machalkova).
+	+ improve test/ncurses.c to put mouse droppings in the proper window.
+	+ update minix terminfo entry -TD
+	+ add bw (auto-left-margin) to nsterm* entries (Benjamin Sittler)
+
+20091212
+	+ correct transfer of multicolumn characters in multirow
+	  field_buffer(), which stopped at the end of the first row due to
+	  filling of unused entries in a cchar_t array with nulls.
+	+ updated nsterm* entries (Benjamin Sittler, Emanuele Giaquinta)
+	+ modify _nc_viscbuf2() and _tracecchar_t2() to show wide-character
+	  nulls.
+	+ use strdup() in set_menu_mark(), restore .marklen struct member on
+	  failure.
+	+ eliminate clause 3 from the UCB copyrights in read_termcap.c and
+	  tset.c per
+		ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change
+	  (patch by Nicholas Marriott).
+	+ replace a malloc in tic.c with strdup, checking for failure (patch by
+	  Nicholas Marriott).
+	+ update config.guess, config.sub from
+		http://savannah.gnu.org/projects/config
+
+20091205
+	+ correct layout of working window used to extract data in
+	  wide-character configured by set_field_buffer (patch by Rafael
+	  Garrido Fernandez)
+	+ improve some limit-checks related to filename length in reading and
+	  writing terminfo entries.
+	+ ensure that filename is always filled in when attempting to read
+	  a terminfo entry, so that infocmp can report the filename (patch
+	  by Nicholas Marriott).
+
+20091128
+	+ modify mk-1st.awk to allow tinfo library to be built when term-driver
+	  is enabled.
+	+ add error-check to configure script to ensure that sp-funcs is
+	  enabled if term-driver is, since some internal interfaces rely upon
+	  this.
+
+20091121
+	+ fix case where progs/tput is used while sp-funcs is configure; this
+	  requires save/restore of out-character function from _nc_prescreen
+	  rather than the SCREEN structure (report by Charles Wilson).
+	+ fix typo in man/curs_trace.3x which caused incorrect symbolic links
+	+ improved configure macros CF_GCC_ATTRIBUTES, CF_PROG_LINT.
+
+20091114
+
+	+ updated man/curs_trace.3x
+	+ limit hashing for termcap-names to 2-characters (Ubuntu #481740).
+	+ change a variable name in lib_newwin.c to make it clearer which
+	  value is being freed on error (patch by Nicholas Marriott).
+
+20091107
+	+ improve test/ncurses.c color-cycling test by reusing attribute-
+	  and color-cycling logic from the video-attributes screen.
+	+ add ifdef'd with NCURSES_INTEROP_FUNCS experimental bindings in form
+	  library which help make it compatible with interop applications
+	  (patch by Juergen Pfeifer).
+	+ add configure option --enable-interop, for integrating changes
+	  for generic/interop support to form-library by Juergen Pfeifer
+
+20091031
+	+ modify use of $CC environment variable which is defined by X/Open
+	  as a curses feature, to ignore it if it is not a single character
+	  (prompted by discussion with Benjamin C W Sittler).
+	+ add START_TRACE in slk_init
+	+ fix a regression in _nc_ripoffline which made test/ncurses.c not show
+	  soft-keys, broken in 20090927 merging.
+	+ change initialization of "hidden" flag for soft-keys from true to
+	  false, broken in 20090704 merging (Ubuntu #464274).
+	+ update nsterm entries (patch by Benjamin C W Sittler, prompted by
+	  discussion with Fabian Groffen in GenToo #206201).
+	+ add test/xterm-256color.dat
+
+20091024
+	+ quiet some pedantic gcc warnings.
+	+ modify _nc_wgetch() to check for a -1 in the fifo, e.g., after a
+	  SIGWINCH, and discard that value, to avoid confusing application
+	  (patch by Eygene Ryabinkin, FreeBSD bin/136223).
+
+20091017
+	+ modify handling of $PKG_CONFIG_LIBDIR to use only the first item in
+	  a possibly colon-separated list (Debian #550716).
+
+20091010
+	+ supply a null-terminator to buffer in _nc_viswibuf().
+	+ fix a sign-extension bug in unget_wch() (report by Mike Gran).
+	+ minor fixes to error-returns in default function for tputs, as well
+	  as in lib_screen.c
+
+20091003
+	+ add WACS_xxx definitions to wide-character configuration for thick-
+	  and double-lines (discussion with Slava Zanko).
+	+ remove unnecessary kcan assignment to ^C from putty (Sven Joachim)
+	+ add ccc and initc capabilities to xterm-16color -TD
+	> patch by Benjamin C W Sittler:
+	+ add linux-16color
+	+ correct initc capability of linux-c-nc end-of-range
+	+ similar change for dg+ccc and dgunix+ccc
+
+20090927
+	+ move leak-checking for comp_captab.c into _nc_leaks_tinfo() since
+	  that module since 20090711 is in libtinfo.
+	+ add configure option --enable-term-driver, to allow compiling with
+	  terminal-driver.  That is used in MinGW port, and (being somewhat
+	  more complicated) is an experimental alternative to the conventional
+	  termlib internals.  Currently, it requires the sp-funcs feature to
+	  be enabled.
+	+ completed integrating "sp-funcs" by Juergen Pfeifer in ncurses
+	  library (some work remains for forms library).
+
+20090919
+	+ document return code from define_key (report by Mike Gran).
+	+ make some symbolic links in the terminfo directory-tree shorter
+	  (patch by Daniel Jacobowitz, forwarded by Sven Joachim).).
+	+ fix some groff warnings in terminfo.5, etc., from recent Debian
+	  changes.
+	+ change ncv and op capabilities in sun-color terminfo entry to match
+	  Sun's entry for this (report by Laszlo Peter).
+	+ improve interix smso terminfo capability by using reverse rather than
+	  bold (report by Kristof Zelechovski).
+
+20090912
+	+ add some test programs (and make these use the same special keys
+	  by sharing linedata.h functions):
+	  test/test_addstr.c
+	  test/test_addwstr.c
+	  test/test_addchstr.c
+	  test/test_add_wchstr.c
+	+ correct internal _nc_insert_ch() to use _nc_insert_wch() when
+	  inserting wide characters, since the wins_wch() function that it used
+	  did not update the cursor position (report by Ciprian Craciun).
+
+20090906
+	+ fix typo s/is_timeout/is_notimeout/ which made "man is_notimeout" not
+	  work.
+	+ add null-pointer checks to other opaque-functions.
+	+ add is_pad() and is_subwin() functions for opaque access to WINDOW
+	  (discussion with Mark Dickinson).
+	+ correct merge to lib_newterm.c, which broke when sp-funcs was
+	  enabled.
+
+20090905
+	+ build-fix for building outside source-tree (report by Sven Joachim).
+	+ fix Debian lintian warning for man/tabs.1 by making section number
+	  agree with file-suffix (report by Sven Joachim).
+	+ continue integrating "sp-funcs" by Juergen Pfeifer (incomplete).
+
+20090829
+	+ workaround for bug in g++ 4.1-4.4 warnings for wattrset() macro on
+	  amd64 (Debian #542031).
+	+ fix typo in curs_mouse.3x (Debian #429198).
+
+20090822
+	+ continue integrating "sp-funcs" by Juergen Pfeifer (incomplete).
+
+20090815
+	+ correct use of terminfo capabilities for initializing soft-keys,
+	  broken in 20090509 merging.
+	+ modify wgetch() to ensure it checks SIGWINCH when it gets an error
+	  in non-blocking mode (patch by Clemens Ladisch).
+	+ use PATH_SEPARATOR symbol when substituting into run_tic.sh, to
+	  help with builds on non-Unix platforms such as OS/2 EMX.
+	+ modify scripting for misc/run_tic.sh to test configure script's
+	  $cross_compiling variable directly rather than comparing host/build
+	  compiler names (prompted by comment in GenToo #249363).
+	+ fix configure script option --with-database, which was coded as an
+	  enable-type switch.
+	+ build-fixes for --srcdir (report by Frederic L W Meunier).
+
+20090808
+	+ separate _nc_find_entry() and _nc_find_type_entry() from
+	  implementation details of hash function.
+
+20090803
+	+ add tabs.1 to man/man_db.renames
+	+ modify lib_addch.c to compensate for removal of wide-character test
+	  from unctrl() in 20090704 (Debian #539735).
+
+20090801
+	+ improve discussion in INSTALL for use of system's tic/infocmp for
+	  cross-compiling and building fallbacks.
+	+ modify test/demo_termcap.c to correspond better to options in
+	  test/demo_terminfo.c
+	+ continue integrating "sp-funcs" by Juergen Pfeifer (incomplete).
+	+ fix logic for 'V' in test/ncurses.c tests f/F.
+
+20090728
+	+ correct logic in tigetnum(), which caused tput program to treat all
+	  string capabilities as numeric (report by Rajeev V Pillai,
+	  cf: 20090711).
+
+20090725
+	+ continue integrating "sp-funcs" by Juergen Pfeifer (incomplete).
+
+20090718
+	+ fix a null-pointer check in _nc_format_slks() in lib_slk.c, from
+	  20070704 changes.
+	+ modify _nc_find_type_entry() to use hashing.
+	+ make CCHARW_MAX value configurable, noting that changing this would
+	  change the size of cchar_t, and would be ABI-incompatible.
+	+ modify test-programs, e.g,.  test/view.c, to address subtle
+	  differences between Tru64/Solaris and HPUX/AIX getcchar() return
+	  values.
+	+ modify length returned by getcchar() to count the trailing null
+	  which is documented in X/Open (cf: 20020427).
+	+ fixes for test programs to build/work on HPUX and AIX, etc.
+
+20090711
+	+ improve performance of tigetstr, etc., by using hashing code from tic.
+	+ minor fixes for memory-leak checking.
+	+ add test/demo_terminfo, for comparison with demo_termcap
+
+20090704
+	+ remove wide-character checks from unctrl() (patch by Clemens Ladisch).
+	+ revise wadd_wch() and wecho_wchar() to eliminate dependency on
+	  unctrl().
+	+ continue integrating "sp-funcs" by Juergen Pfeifer (incomplete).
+
+20090627
+	+ update llib-lncurses[wt] to use sp-funcs.
+	+ various code-fixes to build/work with --disable-macros configure
+	  option.
+	+ add several new files from Juergen Pfeifer which will be used when
+	  integration of "sp-funcs" is complete.  This includes a port to
+	  MinGW.
+
+20090613
+	+ move definition for NCURSES_WRAPPED_VAR back to ncurses_dll.h, to
+	  make includes of term.h without curses.h work (report by "Nix").
+	+ continue integrating "sp-funcs" by Juergen Pfeifer (incomplete).
+
+20090607
+	+ fix a regression in lib_tputs.c, from ongoing merges.
+
+20090606
+	+ continue integrating "sp-funcs" by Juergen Pfeifer (incomplete).
+
+20090530
+	+ fix an infinite recursion when adding a legacy-coding 8-bit value
+	  using insch() (report by Clemens Ladisch).
+	+ free home-terminfo string in del_curterm() (patch by Dan Weber).
+	+ continue integrating "sp-funcs" by Juergen Pfeifer (incomplete).
+
+20090523
+	+ continue integrating "sp-funcs" by Juergen Pfeifer (incomplete).
+
+20090516
+	+ work around antique BSD game's manipulation of stdscr, etc., versus
+	  SCREEN's copy of the pointer (Debian #528411).
+	+ add a cast to wattrset macro to avoid compiler warning when comparing
+	  its result against ERR (adapted from patch by Matt Kraii, Debian
+	  #528374).
+
+20090510
+	+ continue integrating "sp-funcs" by Juergen Pfeifer (incomplete).
+
+20090502
+	+ continue integrating "sp-funcs" by Juergen Pfeifer (incomplete).
+	+ add vwmterm terminfo entry (patch by Bryan Christ).
+
+20090425
+	+ continue integrating "sp-funcs" by Juergen Pfeifer (incomplete).
+
+20090419
+	+ build fix for _nc_free_and_exit() change in 20090418 (report by
+	  Christian Ebert).
+
+20090418
+	+ continue integrating "sp-funcs" by Juergen Pfeifer (incomplete).
+
+20090411
+	+ continue integrating "sp-funcs" by Juergen Pfeifer (incomplete).
+	  This change finishes merging for menu and panel libraries, does
+	  part of the form library.
+
+20090404
+	+ suppress configure check for static/dynamic linker flags for gcc on
+	  Darwin (report by Nelson Beebe).
+
+20090328
+	+ extend ansi.sys pfkey capability from kf1-kf10 to kf1-kf48, moving
+	  function key definitions from emx-base for consistency -TD
+	+ correct missing final 'p' in pfkey capability of ansi.sys-old (report
+	  by Kalle Olavi Niemitalo).
+	+ improve test/ncurses.c 'F' test, show combining characters in color.
+	+ quiet a false report by cppcheck in c++/cursesw.cc by eliminating
+	  a temporary variable.
+	+ use _nc_doalloc() rather than realloc() in a few places in ncurses
+	  library to avoid leak in out-of-memory condition (reports by William
+	  Egert and Martin Ettl based on cppcheck tool).
+	+ add --with-ncurses-wrap-prefix option to test/configure (discussion
+	  with Charles Wilson).
+	+ use ncurses*-config scripts if available for test/configure.
+	+ update test/aclocal.m4 and test/configure
+	> patches by Charles Wilson:
+	+ modify CF_WITH_LIBTOOL configure check to allow unreleased libtool
+	  version numbers (e.g.  which include alphabetic chars, as well as
+	  digits, after the final '.').
+	+ improve use of -no-undefined option for libtool by setting an
+	  intermediate variable LT_UNDEF in the configure script, and then
+	  using that in the libtool link-commands.
+	+ fix an missing use of NCURSES_PUBLIC_VAR() in tinfo/MKcodes.awk
+	  from 2009031 changes.
+	+ improve mk-1st.awk script by writing separate cases for the
+	  LIBTOOL_LINK command, depending on which library (ncurses, ticlib,
+	  termlib) is to be linked.
+	+ modify configure.in to allow broken-linker configurations, not just
+	  enable-reentrant, to set public wrap prefix.
+
+20090321
+	+ add TICS_LIST and SHLIB_LIST to allow libtool 2.2.6 on Cygwin to
+	  build with tic and term libraries (patch by Charles Wilson).
+	+ add -no-undefined option to libtool for Cygwin, MinGW, U/Win and AIX
+	  (report by Charles Wilson).
+	+ fix definition for c++/Makefile.in's SHLIB_LIST, which did not list
+	  the form, menu or panel libraries (patch by Charles Wilson).
+	+ add configure option --with-wrap-prefix to allow setting the prefix
+	  for functions used to wrap global variables to something other than
+	  "_nc_" (discussion with Charles Wilson).
+
+20090314
+	+ modify scripts to generate ncurses*-config and pc-files to add
+	  dependency for tinfo library (patch by Charles Wilson).
+	+ improve comparison of program-names when checking for linked flavors
+	  such as "reset" by ignoring the executable suffix (reports by Charles
+	  Wilson, Samuel Thibault and Cedric Bretaudeau on Cygwin mailing
+	  list).
+	+ suppress configure check for static/dynamic linker flags for gcc on
+	  Solaris 10, since gcc is confused by absence of static libc, and
+	  does not switch back to dynamic mode before finishing the libraries
+	  (reports by Joel Bertrand, Alan Pae).
+	+ minor fixes to Intel compiler warning checks in configure script.
+	+ modify _nc_leaks_tinfo() so leak-checking in test/railroad.c works.
+	+ modify set_curterm() to make broken-linker configuration work with
+	  changes from 20090228 (report by Charles Wilson).
+
+20090228
+	+ continue integrating "sp-funcs" by Juergen Pfeifer (incomplete).
+	+ modify declaration of cur_term when broken-linker is used, but
+	  enable-reentrant is not, to match pre-5.7 (report by Charles Wilson).
+
+20090221
+	+ continue integrating "sp-funcs" by Juergen Pfeifer (incomplete).
+
+20090214
+	+ add configure script --enable-sp-funcs to enable the new set of
+	  extended functions.
+	+ start integrating patches by Juergen Pfeifer:
+	  + add extended functions which specify the SCREEN pointer for several
+	    curses functions which use the global SP (these are incomplete;
+	    some internals work is needed to complete these).
+	  + add special cases to configure script for MinGW port.
+
+20090207
+	+ update several configure macros from lynx changes
+	  + append (not prepend) to CFLAGS/CPPFLAGS
+	  + change variable from PATHSEP to PATH_SEPARATOR
+	+ improve install-rules for pc-files (patch by Miroslav Lichvar).
+	  + make it work with $DESTDIR
+	  + create the pkg-config library directory if needed.
+
+20090124
+	+ modify init_pair() to allow caller to create extra color pairs beyond
+	  the color_pairs limit, which use default colors (request by Emanuele
+	  Giaquinta).
+	+ add misc/terminfo.tmp and misc/*.pc to "sources" rule.
+	+ fix typo "==" where "=" is needed in ncurses-config.in and
+	  gen-pkgconfig.in files (Debian #512161).
+
+20090117
+	+ add -shared option to MK_SHARED_LIB when -Bsharable is used, for
+	  *BSD's, without which "main" might be one of the shared library's
+	  dependencies (report/analysis by Ken Dickey).
+	+ modify waddch_literal(), updating line-pointer after a multicolumn
+	  character is found to not fit on the current row, and wrapping is
+	  done.  Since the line-pointer was not updated, the wrapped
+	  multicolumn character was written to the beginning of the current row
+	  (cf: 20041023, reported by "Nick" regarding problem with ncmpc
+	  http://musicpd.org/mantis/bug_view_page.php?bug_id=1930).
+
+20090110
+	+ add screen.Eterm terminfo entry (GenToo #124887) -TD
+	+ modify adacurses-config to look for ".ali" files in the adalib
+	  directory.
+	+ correct install for Ada95, which omitted libAdaCurses.a used in
+	  adacurses-config
+	+ change install for adacurses-config to provide additional flavors
+	  such as adacursesw-config, for ncursesw (GenToo #167849).
+
+20090105
+	+ remove undeveloped feature in ncurses-config.in for setting
+	  prefix variable.
+	+ recent change to ncurses-config.in did not take into account the
+	  --disable-overwrite option, which sets $includedir to the
+	  subdirectory and using just that for a -I option does not work - fix
+	  (report by Frederic L W Meunier).
+
+20090104
+	+ modify gen-pkgconfig.in to eliminate a dependency on rpath when
+	  deciding whether to add $LIBS to --libs output; that should be shown
+	  for the ncurses and tinfo libraries without taking rpath into
+	  account.
+	+ fix an overlooked change from $AR_OPTS to $ARFLAGS in mk-1st.awk,
+	  used in static libraries (report by Marty Jack).
+
+20090103
+	+ add a configure-time check to pick a suitable value for
+	  CC_SHARED_OPTS for Solaris (report by Dagobert Michelsen).
+	+ add configure --with-pkg-config and --enable-pc-files options, along
+	  with misc/gen-pkgconfig.in which can be used to generate ".pc" files
+	  for pkg-config (request by Jan Engelhardt).
+	+ use $includedir symbol in misc/ncurses-config.in, add --includedir
+	  option.
+	+ change makefiles to use $ARFLAGS rather than $AR_OPTS, provide a
+	  configure check to detect whether a "-" is needed before "ar"
+	  options.
+	+ update config.guess, config.sub from
+		http://savannah.gnu.org/projects/config
+
+20081227
+	+ modify mk-1st.awk to work with extra categories for tinfo library.
+	+ modify configure script to allow building shared libraries with gcc
+	  on AIX 5 or 6 (adapted from patch by Lital Natan).
+
+20081220
+	+ modify to omit the opaque-functions from lib_gen.o when
+	  --disable-ext-funcs is used.
+	+ add test/clip_printw.c to illustrate how to use printw without
+	  wrapping.
+	+ modify ncurses 'F' test to demo wborder_set() with colored lines.
+	+ modify ncurses 'f' test to demo wborder() with colored lines.
+
+20081213
+	+ add check for failure to open hashed-database needed for db4.6
+	  (GenToo #245370).
+	+ corrected --without-manpages option; previous change only suppressed
+	  the auxiliary rules install.man and uninstall.man
+	+ add case for FreeMINT to configure macro CF_XOPEN_SOURCE (patch from
+	  GenToo #250454).
+	+ fixes from NetBSD port at
+	  http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/devel/ncurses/patches
+	  patch-ac (build-fix for DragonFly)
+	  patch-ae (use INSTALL_SCRIPT for installing misc/ncurses*-config).
+	+ improve configure script macros CF_HEADER_PATH and CF_LIBRARY_PATH
+	  by adding CFLAGS, CPPFLAGS and LDFLAGS, LIBS values to the
+	  search-lists.
+	+ correct title string for keybound manpage (patch by Frederic Culot,
+	  OpenBSD documentation/6019),
+
+20081206
+	+ move del_curterm() call from _nc_freeall() to _nc_leaks_tinfo() to
+	  work for progs/clear, progs/tabs, etc.
+	+ correct buffer-size after internal resizing of wide-character
+	  set_field_buffer(), broken in 20081018 changes (report by Mike Gran).
+	+ add "-i" option to test/filter.c to tell it to use initscr() rather
+	  than newterm(), to investigate report on comp.unix.programmer that
+	  ncurses would clear the screen in that case (it does not - the issue
+	  was xterm's alternate screen feature).
+	+ add check in mouse-driver to disable connection if GPM returns a
+	  zero, indicating that the connection is closed (Debian #506717,
+	  adapted from patch by Samuel Thibault).
+
+20081129
+	+ improve a workaround in adding wide-characters, when a control
+	  character is found.  The library (cf: 20040207) uses unctrl() to
+	  obtain a printable version of the control character, but was not
+	  passing color or video attributes.
+	+ improve test/ncurses.c 'a' test, using unctrl() more consistently to
+	  display meta-characters.
+	+ turn on _XOPEN_CURSES definition in curses.h
+	+ add eterm-color entry (report by Vincent Lefevre) -TD
+	+ correct use of key_name() in test/ncurses.c 'A' test, which only
+	  displays wide-characters, not key-codes since 20070612 (report by
+	  Ricardo Cantu).
+
+20081122
+	+ change _nc_has_mouse() to has_mouse(), reflect its use in C++ and
+	  Ada95 (patch by Juergen Pfeifer).
+	+ document in TO-DO an issue with Cygwin's package for GNAT (report
+	  by Mike Dennison).
+	+ improve error-checking of command-line options in "tabs" program.
+
+20081115
+	+ change several terminfo entries to make consistent use of ANSI
+	  clear-all-tabs -TD
+	+ add "tabs" program (prompted by Debian #502260).
+	+ add configure --without-manpages option (request by Mike Frysinger).
+
 20081102 5.7 release for upload to ftp.gnu.org
 
 20081025
@@ -77,7 +999,7 @@
 	  overlooked til now.
 
 20081011
-	+ update html documentation.
+	+ regenerated html documentation.
 	+ add -m and -s options to test/keynames.c and test/key_names.c to test
 	  the meta() function with keyname() or key_name(), respectively.
 	+ correct return value of key_name() on error; it is null.
@@ -2204,7 +3126,7 @@
 	  (request by Mike Aubury).
 	+ add symbol to curses.h which can be used to suppress include of
 	  stdbool.h, e.g.,
-	  	#define NCURSES_ENABLE_STDBOOL_H 0
+		#define NCURSES_ENABLE_STDBOOL_H 0
 		#include <curses.h>
 	  (discussion on XFree86 mailing list).
 
diff -Naur ncurses-5.7.orig/README.MinGW ncurses-5.7/README.MinGW
--- ncurses-5.7.orig/README.MinGW	1969-12-31 19:00:00.000000000 -0500
+++ ncurses-5.7/README.MinGW	2011-01-08 18:18:29.746780939 -0500
@@ -0,0 +1,147 @@
+-------------------------------------------------------------------------------
+-- 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             --
+-- "Software"), to deal in the Software without restriction, including       --
+-- without limitation the rights to use, copy, modify, merge, publish,       --
+-- distribute, distribute with modifications, sublicense, and/or sell copies --
+-- of the Software, and to permit persons to whom the Software is furnished  --
+-- to do so, subject to the following conditions:                            --
+--                                                                           --
+-- The above copyright notice and this permission notice shall be included   --
+-- in all copies or substantial portions of the Software.                    --
+--                                                                           --
+-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS   --
+-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF                --
+-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN --
+-- NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,       --
+-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR     --
+-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE --
+-- USE OR OTHER DEALINGS IN THE SOFTWARE.                                    --
+--                                                                           --
+-- Except as contained in this notice, the name(s) of the above copyright    --
+-- holders shall not be used in advertising or otherwise to promote the      --
+-- sale, use or other dealings in this Software without prior written        --
+-- authorization.                                                            --
+-------------------------------------------------------------------------------
+-- $Id: README.MinGW,v 1.4 2010/12/18 21:07:03 tom Exp $
+-- Author: Juergen Pfeifer
+-------------------------------------------------------------------------------
+
+This is work in progress, but it's in an state where one can see it
+works at least on the Windows Console.
+
+You should install the MSYS package, so that you've a shell environment that
+allows you to run the scripts, especially configure etc.  You can get that
+from http://www.mingw.org
+
+To build ncurses for native Windows, you need the MinGW toolchain.  The
+original MinGW toolchain from the above site is only for 32-Bit Windows.  As
+Windows Server - and also regular workstations - are moving to 64-Bit, it
+seems to be reasonable to have a toolchain that supports both architectures. 
+I recommend to use the TDM gcc toolchain which you can find at
+http://tdm-gcc.tdragon.net/download.  Go to the download section and select
+the bundle installer for tdm64 (MinGW-w64).  This installs a multilib version
+of the gcc toolchain that can compile for native 32- and 64-Bit Windows
+versions.  It also comes with a working pthread implementation.
+
+The latest config and build scripts we use for MinGW have only been tested
+for the gcc-4.4 compiler toolchain (or better).
+
+Using MinGW is a pragmatic decision, it's the easiest way to port this
+heavily UNIX based sourcebase to native Windows. The goal is of course
+to provide the includes, libraries and DLLs to be used with the more
+common traditional development environments on Windows, mainly with
+Microsoft Visual Studio.
+
+If you start a bash from the MSYS environment, please make sure that the
+Microsoft Development tools are in your PATH right after the MinGW
+tools. The LIB.EXE tool is the only one needed. You need this only if 
+you want to build DLLs that work with native Windows programs. If you 
+don't have any Microsoft  Development tools on your machine, consider 
+at least to get the free "Visual C++ 2010 Express Edition". 
+It contains the LIB.EXE tool. You may also use this compiler to test 
+writing native Windows programs using the ncurses DLLs without using 
+MinGW then for writing apps.
+
+It is necessary to unset the TERM environment variable, to activate the
+Windows console-driver.
+
+Please also make sure that MSYS links to the correct directory containing
+your MinGW toolchain. For TDM this is usually C:\MinGW64. In your Windows
+CMD.EXE command shell go to the MSYS root directory (most probably 
+C:\MSYS or C:\MSYS\1.0) and verify, that there is a junction point mingw
+that points to the MinGW toolchain directory. If not, delete the mingw
+directory and use the mklink command (or the linkd.exe utility on older
+Windows) to create the junction point.
+
+This code requires WindowsNT 5.1 or better, which means on the client
+Windows XP or better, on the server Windows Server 2003 or better.
+
+In order to build ncurses for the planned interop layer with .NET, we
+recommend to use these options with configure
+
+	  --disable-home-terminfo
+	  --enable-reentrant
+	  --enable-sp-funcs
+	  --enable-term-driver
+	  --enable-interop
+	  --with-pthread         (if using TDM toolchain as recommended)
+
+This is the configuration commandline as I'm using it at the moment:
+
+./configure \
+	--prefix=/mingw \
+	--without-cxx-binding \
+	--without-ada \
+	--enable-warnings \
+	--enable-assertions \
+	--enable-reentrant \
+	--with-debug \
+	--with-normal \
+	--disable-home-terminfo \
+	--enable-sp-funcs \
+	--enable-term-driver \
+	--enable-interop \
+	--with-pthread
+
+If you are on a 64-Bit Windows system and want to build a 32-Bit version
+of ncurses, you may use this commandline for configuration (when using
+the TDM toolchain):
+
+CC="gcc -m32" LD="ld -m32" ./configure \
+	--prefix=/mingw \
+	--without-cxx-binding \
+	--without-ada \
+	--enable-warnings \
+	--enable-assertions \
+	--enable-reentrant \
+	--with-debug \
+	--with-normal \
+	--disable-home-terminfo \
+	--enable-sp-funcs \
+	--enable-term-driver \
+	--enable-interop \
+	--with-pthread
+
+All the options above are - like the whole Windows support -
+experimental.
+
+In order to build the DLLs, after your regular make you must call
+
+   make dlls
+
+A lot is still TODO, e.g.:
+
+  - Wide Character support
+    The Win32Con driver should actually only use Unicode in the
+    future.
+  - Thread support (locking). If using TDM toolchain this is done by
+    configuring pthreads.
+  - A GUI console driver
+  - Support for Terminals attached via a serial port (via terminfo)
+  - Support for networked Terminal connections (via terminfo)
+
+To support terminfo, we need to have an ioctl() simulation for the
+serial and networked Terminals.
diff -Naur ncurses-5.7.orig/TO-DO ncurses-5.7/TO-DO
--- ncurses-5.7.orig/TO-DO	2008-10-11 15:22:27.000000000 -0400
+++ ncurses-5.7/TO-DO	2011-01-08 18:13:50.327157337 -0500
@@ -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             --
@@ -25,7 +25,7 @@
 -- sale, use or other dealings in this Software without prior written        --
 -- authorization.                                                            --
 -------------------------------------------------------------------------------
--- $Id: TO-DO,v 1.51 2008/10/11 19:22:27 tom Exp $
+-- $Id: TO-DO,v 1.54 2010/01/09 16:48:05 tom Exp $
 -------------------------------------------------------------------------------
 
 SHORT-TERM TO-DO ITEMS:
@@ -45,7 +45,7 @@
 + Scrolling optimization has holes:  for example, it forces repaints of the
   screen between calls to refresh().
 
-+ SVr4 uses slightly different rules for determining when softkeys are shown. 
++ SVr4 uses slightly different rules for determining when softkeys are shown.
   For example, they are initially displayed (before the ncurses 'e' test
   activates them), and a touchwin can apparently also force them to be
   displayed.
@@ -58,7 +58,7 @@
 + The window classes defined in the c++ subdirectory need documentation.  Some
   C++ programmer could earn a lot of good karma by doing this...
 
-+ vid_attr() should support the set_a_attributes (sgr1) string, but does not. 
++ vid_attr() should support the set_a_attributes (sgr1) string, but does not.
   There appear to be no terminals that require that functionality.
 
 + the configure --disable-ext-funcs option does not work for Ada95 tree.
@@ -66,6 +66,24 @@
 + the --with-pthread configuration builds for Cygwin, but does not work
   properly (test/worm.c shows all of the worms in the same location).
 
++ the Ada95 tree requires a small fix to build on Cygwin, since the GNAT port
+  to that platform provides an incomplete Interrupts.Names package.  For
+  instance (your gcc version may be different):
+        /usr/lib/gcc/i686-pc-cygwin/3.4.4/adainclude/a-intnam.ads
+
+  cut here...
+-------------------------------------------------------------------------------
+--- a-intnam.ads.orig   2003-10-21 13:41:51.000000000 +0000
++++ a-intnam.ads        2007-05-05 22:40:02.609375000 +0000
+@@ -44,5 +44,6 @@
+
+    DUMMY_INTERRUPT_1 : constant Interrupt_ID := 1;
+    DUMMY_INTERRUPT_2 : constant Interrupt_ID := 2;
++   SIGINT : constant Interrupt_ID := 2;
+
+ end Ada.Interrupts.Names;
+-------------------------------------------------------------------------------
+
 + the --enable-rpath configure option builds for the corresponding platforms;
   however combining it with --with-ticlib and --with-termlib does not always
   produce libraries that can be run without setting environment variables.
@@ -78,21 +96,20 @@
   trip over a known problem with the signal-handling code which causes abrupt
   termination of ncurses applications following resume from a ^Z suspend (this
   problem was first seen running lynx).  You will not see this problem if you
-  are running Linux or one of the 4.4BSD derivatives like FreeBSD, NetBSD, or
-  BSDI.  For details, see the analysis in the header comment of
-  ncurses/tty/lib_tstp.c .
+  are using one of the 4.4BSD derivatives like such as, NetBSD, or BSDI, or
+  systems using that convention.  For details, see the analysis in the header
+  comment of ncurses/tty/lib_tstp.c .
 
 + In theory, vwprintw and vwscanf are supposed to use the older varargs.h
   interface for handling variadic argument lists (and are deprecated by X/Open
-  for that reason).  Linux doesn't have varargs.h, it has the newer
-  X/Open-standard stdargs.h equivalent.  So these functions use stdargs
-  instead.  This is unlikely to be a problem unless you're building ncurses on
-  a System V old enough to only have varargs.h.  (Solaris 2.5.1 used the
-  stdarg.h binding as well).
-
-+ If you're using a BSD earlier than 4.4BSD, or a Linux old enough not to have
-  a native vsscanf(3) in its library, vwscanw() will not work.  You lose.  (It
-  should work on any System V, however).  If you want to fix this, add an
+  for that reason).  Many newer systems do no have varargs.h, instead they have
+  only the newer X/Open-standard stdargs.h equivalent.  So these functions use
+  stdargs instead.  This is unlikely to be a problem unless you're building
+  ncurses on a System V old enough to only have varargs.h.  (Solaris 2.5.1 used
+  the stdarg.h binding as well).
+
++ If you're using a system old enough not to have a native vsscanf(3) in its
+  library, vwscanw() will not work.  If you want to fix this, add an
   implementation to ncurses/vsscanf.c.
 
 + The C++ binding fails to build with a few C++ compilers.
@@ -122,7 +139,7 @@
 2. DOS port
 
 Only a few of the files in the library depend on the terminfo format.
-It should be possible to further kernelize the package, then rewrite 
+It should be possible to further kernelize the package, then rewrite
 a small number of core files to produce a functionally-compatible
 port that would do updates to a memory-mapped screen area.  The first
 result of this would be a DOS port.
@@ -195,10 +212,10 @@
 		move_insert, dest_tabs_magic_smso, transparent_underline,
 		needs_xon_xoff, hard_cursor.
 	Numerics: lines_of_memory, buttons.
-	Strings: pkey_key, pkey_local, pkey_xmit, underline_char, 
-		enter_xon_mode,	exit_xon_mode, xon_character, xoff_character, 
+	Strings: pkey_key, pkey_local, pkey_xmit, underline_char,
+		enter_xon_mode,	exit_xon_mode, xon_character, xoff_character,
 		display_clock, remove_clock, user[0-5], display_pc_char,
-		enter_scancode_mode, exit_scancode_mode, pc_term_options, 
+		enter_scancode_mode, exit_scancode_mode, pc_term_options,
 		scancode_escape, alt_scancode_esc.
 
 These are the potentially important ones for ncurses.  Notes:
diff -Naur ncurses-5.7.orig/aclocal.m4 ncurses-5.7/aclocal.m4
--- ncurses-5.7.orig/aclocal.m4	2008-10-25 18:15:32.000000000 -0400
+++ ncurses-5.7/aclocal.m4	2011-01-08 18:18:29.482656259 -0500
@@ -1,5 +1,5 @@
 dnl***************************************************************************
-dnl Copyright (c) 1998-2007,2008 Free Software Foundation, Inc.              *
+dnl Copyright (c) 1998-2009,2010 Free Software Foundation, Inc.              *
 dnl                                                                          *
 dnl Permission is hereby granted, free of charge, to any person obtaining a  *
 dnl copy of this software and associated documentation files (the            *
@@ -28,7 +28,7 @@
 dnl
 dnl Author: Thomas E. Dickey 1995-on
 dnl
-dnl $Id: aclocal.m4,v 1.470 2008/10/25 22:15:32 tom Exp $
+dnl $Id: aclocal.m4,v 1.547 2010/11/13 19:17:50 tom Exp $
 dnl Macros used in NCURSES auto-configuration script.
 dnl
 dnl These macros are maintained separately from NCURSES.  The copyright on
@@ -62,13 +62,13 @@
   fi
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_ADA_INCLUDE_DIRS version: 5 updated: 2006/10/14 15:23:15
+dnl CF_ADA_INCLUDE_DIRS version: 6 updated: 2010/02/26 19:52:07
 dnl -------------------
 dnl Construct the list of include-options for the C programs in the Ada95
 dnl binding.
 AC_DEFUN([CF_ADA_INCLUDE_DIRS],
 [
-ACPPFLAGS="-I. -I../../include $ACPPFLAGS"
+ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS"
 if test "$srcdir" != "."; then
 	ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS"
 fi
@@ -86,7 +86,15 @@
 AC_SUBST(ACPPFLAGS)
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_ADD_CFLAGS version: 7 updated: 2004/04/25 17:48:30
+dnl CF_ADD_ADAFLAGS version: 1 updated: 2010/06/19 15:22:18
+dnl ---------------
+dnl Add to $ADAFLAGS, which is substituted into makefile and scripts.
+AC_DEFUN([CF_ADD_ADAFLAGS],[
+ 	ADAFLAGS="$ADAFLAGS $1"
+	AC_SUBST(ADAFLAGS)
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_ADD_CFLAGS version: 10 updated: 2010/05/26 05:38:42
 dnl -------------
 dnl Copy non-preprocessor flags to $CFLAGS, preprocessor flags to $CPPFLAGS
 dnl The second parameter if given makes this macro verbose.
@@ -112,8 +120,8 @@
 			cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[[^=]]*='\''\"[[^"]]*//'`
 
 			test "${cf_add_cflags}" != "${cf_tst_cflags}" \
-			&& test -z "${cf_tst_cflags}" \
-			&& cf_fix_cppflags=yes
+				&& test -z "${cf_tst_cflags}" \
+				&& cf_fix_cppflags=yes
 
 			if test $cf_fix_cppflags = yes ; then
 				cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
@@ -128,6 +136,12 @@
 		*$cf_add_cflags) #(vi
 			;;
 		*) #(vi
+			case $cf_add_cflags in #(vi
+			-D*)
+				cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
+				CF_REMOVE_DEFINE(CPPFLAGS,$CPPFLAGS,$cf_tst_cppflags)
+				;;
+			esac
 			cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
 			;;
 		esac
@@ -143,24 +157,24 @@
 	cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[[^"]]*"'\''//'`
 
 	test "${cf_add_cflags}" != "${cf_tst_cflags}" \
-	&& test -z "${cf_tst_cflags}" \
-	&& cf_fix_cppflags=no
+		&& test -z "${cf_tst_cflags}" \
+		&& cf_fix_cppflags=no
 	;;
 esac
 done
 
 if test -n "$cf_new_cflags" ; then
-	ifelse($2,,,[CF_VERBOSE(add to \$CFLAGS $cf_new_cflags)])
+	ifelse([$2],,,[CF_VERBOSE(add to \$CFLAGS $cf_new_cflags)])
 	CFLAGS="$CFLAGS $cf_new_cflags"
 fi
 
 if test -n "$cf_new_cppflags" ; then
-	ifelse($2,,,[CF_VERBOSE(add to \$CPPFLAGS $cf_new_cppflags)])
-	CPPFLAGS="$cf_new_cppflags $CPPFLAGS"
+	ifelse([$2],,,[CF_VERBOSE(add to \$CPPFLAGS $cf_new_cppflags)])
+	CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
 fi
 
 if test -n "$cf_new_extra_cppflags" ; then
-	ifelse($2,,,[CF_VERBOSE(add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags)])
+	ifelse([$2],,,[CF_VERBOSE(add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags)])
 	EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
 fi
 
@@ -168,7 +182,7 @@
 
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_ADD_INCDIR version: 9 updated: 2008/02/09 13:15:34
+dnl CF_ADD_INCDIR version: 13 updated: 2010/05/26 16:44:57
 dnl -------------
 dnl Add an include-directory to $CPPFLAGS.  Don't add /usr/include, since it's
 dnl redundant.  We don't normally need to add -I/usr/local/include for gcc,
@@ -195,7 +209,7 @@
 		fi
 
 		if test "$cf_have_incdir" = no ; then
-          if test "$cf_add_incdir" = /usr/local/include ; then
+		  if test "$cf_add_incdir" = /usr/local/include ; then
 			if test "$GCC" = yes
 			then
 			  cf_save_CPPFLAGS=$CPPFLAGS
@@ -211,11 +225,11 @@
 
 		if test "$cf_have_incdir" = no ; then
 		  CF_VERBOSE(adding $cf_add_incdir to include-path)
-		  ifelse($2,,CPPFLAGS,$2)="-I$cf_add_incdir $ifelse($2,,CPPFLAGS,[$]$2)"
+		  ifelse([$2],,CPPFLAGS,[$2])="$ifelse([$2],,CPPFLAGS,[$2]) -I$cf_add_incdir"
 
-          cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
-          test "$cf_top_incdir" = "$cf_add_incdir" && break
-          cf_add_incdir="$cf_top_incdir"
+		  cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
+		  test "$cf_top_incdir" = "$cf_add_incdir" && break
+		  cf_add_incdir="$cf_top_incdir"
 		else
 		  break
 		fi
@@ -225,7 +239,15 @@
 fi
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_ADD_LIBDIR version: 6 updated: 2008/02/09 13:15:34
+dnl CF_ADD_LIB version: 2 updated: 2010/06/02 05:03:05
+dnl ----------
+dnl Add a library, used to enforce consistency.
+dnl
+dnl $1 = library to add, without the "-l"
+dnl $2 = variable to update (default $LIBS)
+AC_DEFUN([CF_ADD_LIB],[CF_ADD_LIBS(-l$1,ifelse($2,,LIBS,[$2]))])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_ADD_LIBDIR version: 9 updated: 2010/05/26 16:44:57
 dnl -------------
 dnl	Adds to the library-path
 dnl
@@ -254,14 +276,22 @@
       fi
       if test "$cf_have_libdir" = no ; then
         CF_VERBOSE(adding $cf_add_libdir to library-path)
-        ifelse($2,,LDFLAGS,$2)="-L$cf_add_libdir $ifelse($2,,LDFLAGS,[$]$2)"
+        ifelse([$2],,LDFLAGS,[$2])="-L$cf_add_libdir $ifelse([$2],,LDFLAGS,[$2])"
       fi
     fi
   done
 fi
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_ADD_SUBDIR_PATH version: 2 updated: 2007/07/29 10:12:59
+dnl CF_ADD_LIBS version: 1 updated: 2010/06/02 05:03:05
+dnl -----------
+dnl Add one or more libraries, used to enforce consistency.
+dnl
+dnl $1 = libraries to add, with the "-l", etc.
+dnl $2 = variable to update (default $LIBS)
+AC_DEFUN([CF_ADD_LIBS],[ifelse($2,,LIBS,[$2])="$1 [$]ifelse($2,,LIBS,[$2])"])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_ADD_SUBDIR_PATH version: 3 updated: 2010/07/03 20:58:12
 dnl ------------------
 dnl Append to a search-list for a nonstandard header/lib-file
 dnl	$1 = the variable to return as result
@@ -273,7 +303,7 @@
 [
 test "$4" != "$5" && \
 test -d "$4" && \
-ifelse([$5],NONE,,[(test $5 = NONE || test -d $5) &&]) {
+ifelse([$5],NONE,,[(test $5 = NONE || test "$4" != "$5") &&]) {
 	test -n "$verbose" && echo "	... testing for $3-directories under $4"
 	test -d $4/$3 &&          $1="[$]$1 $4/$3"
 	test -d $4/$3/$2 &&       $1="[$]$1 $4/$3/$2"
@@ -283,13 +313,13 @@
 }
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_ANSI_CC_CHECK version: 9 updated: 2001/12/30 17:53:34
+dnl CF_ANSI_CC_CHECK version: 10 updated: 2010/10/23 15:52:32
 dnl ----------------
 dnl This is adapted from the macros 'fp_PROG_CC_STDC' and 'fp_C_PROTOTYPES'
 dnl in the sharutils 4.2 distribution.
 AC_DEFUN([CF_ANSI_CC_CHECK],
 [
-AC_CACHE_CHECK(for ${CC-cc} option to accept ANSI C, cf_cv_ansi_cc,[
+AC_CACHE_CHECK(for ${CC:-cc} option to accept ANSI C, cf_cv_ansi_cc,[
 cf_cv_ansi_cc=no
 cf_save_CFLAGS="$CFLAGS"
 cf_save_CPPFLAGS="$CPPFLAGS"
@@ -353,7 +383,89 @@
 fi
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_AWK_BIG_PRINTF version: 2 updated: 2008/10/04 17:16:18
+dnl CF_ARG_DISABLE version: 3 updated: 1999/03/30 17:24:31
+dnl --------------
+dnl Allow user to disable a normally-on option.
+AC_DEFUN([CF_ARG_DISABLE],
+[CF_ARG_OPTION($1,[$2],[$3],[$4],yes)])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_ARG_OPTION version: 4 updated: 2010/05/26 05:38:42
+dnl -------------
+dnl Restricted form of AC_ARG_ENABLE that ensures user doesn't give bogus
+dnl values.
+dnl
+dnl Parameters:
+dnl $1 = option name
+dnl $2 = help-string
+dnl $3 = action to perform if option is not default
+dnl $4 = action if perform if option is default
+dnl $5 = default option value (either 'yes' or 'no')
+AC_DEFUN([CF_ARG_OPTION],
+[AC_ARG_ENABLE([$1],[$2],[test "$enableval" != ifelse([$5],no,yes,no) && enableval=ifelse([$5],no,no,yes)
+  if test "$enableval" != "$5" ; then
+ifelse([$3],,[    :]dnl
+,[    $3]) ifelse([$4],,,[
+  else
+    $4])
+  fi],[enableval=$5 ifelse([$4],,,[
+  $4
+])dnl
+  ])])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_AR_FLAGS version: 5 updated: 2010/05/20 20:24:29
+dnl -----------
+dnl Check for suitable "ar" (archiver) options for updating an archive.
+AC_DEFUN([CF_AR_FLAGS],[
+AC_REQUIRE([CF_PROG_AR])
+
+AC_CACHE_CHECK(for options to update archives, cf_cv_ar_flags,[
+	cf_cv_ar_flags=unknown
+	for cf_ar_flags in -curv curv -crv crv -cqv cqv -rv rv
+	do
+
+		# check if $ARFLAGS already contains this choice
+		if test "x$ARFLAGS" != "x" ; then
+			cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"`
+			if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then
+				cf_cv_ar_flags=
+				break
+			fi
+		fi
+
+		rm -f conftest.$ac_cv_objext
+		rm -f conftest.a
+
+		cat >conftest.$ac_ext <<EOF
+#line __oline__ "configure"
+int	testdata[[3]] = { 123, 456, 789 };
+EOF
+		if AC_TRY_EVAL(ac_compile) ; then
+			echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&AC_FD_CC
+			$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext 2>&AC_FD_CC 1>/dev/null
+			if test -f conftest.a ; then
+				cf_cv_ar_flags=$cf_ar_flags
+				break
+			fi
+		else
+			CF_VERBOSE(cannot compile test-program)
+			break
+		fi
+	done
+	rm -f conftest.a conftest.$ac_ext conftest.$ac_cv_objext
+])
+
+if test -n "$ARFLAGS" ; then
+	if test -n "$cf_cv_ar_flags" ; then
+		ARFLAGS="$ARFLAGS $cf_cv_ar_flags"
+	fi
+else
+	ARFLAGS=$cf_cv_ar_flags
+fi
+
+AC_SUBST(ARFLAGS)
+])
+dnl ---------------------------------------------------------------------------
+dnl CF_AWK_BIG_PRINTF version: 3 updated: 2008/12/27 12:30:03
 dnl -----------------
 dnl Check if awk can handle big strings using printf.  Some older versions of
 dnl awk choke on large strings passed via "%s".
@@ -362,19 +474,19 @@
 dnl $2 = variable to set with result
 AC_DEFUN([CF_AWK_BIG_PRINTF],
 [
-    case x$AWK in #(vi
-    x)
-        eval $2=no
-        ;;
-    *) #(vi
-        if ( ${AWK} 'BEGIN { xx = "x"; while (length(xx) < $1) { xx = xx "x"; }; printf("%s\n", xx); }' \
-            | $AWK '{ printf "%d\n", length([$]0); }' | $AWK 'BEGIN { eqls=0; recs=0; } { recs++; if ([$]0 == 12000) eqls++; } END { if (recs != 1 || eqls != 1) exit 1; }' 2>/dev/null >/dev/null ) ; then
-            eval $2=yes
-        else
-            eval $2=no
-        fi
-        ;;
-    esac
+	case x$AWK in #(vi
+	x)
+		eval $2=no
+		;;
+	*) #(vi
+		if ( ${AWK} 'BEGIN { xx = "x"; while (length(xx) < $1) { xx = xx "x"; }; printf("%s\n", xx); }' \
+			| $AWK '{ printf "%d\n", length([$]0); }' | $AWK 'BEGIN { eqls=0; recs=0; } { recs++; if ([$]0 == 12000) eqls++; } END { if (recs != 1 || eqls != 1) exit 1; }' 2>/dev/null >/dev/null ) ; then
+			eval $2=yes
+		else
+			eval $2=no
+		fi
+		;;
+	esac
 ])dnl
 dnl ---------------------------------------------------------------------------
 dnl CF_BOOL_DECL version: 8 updated: 2004/01/30 15:51:18
@@ -695,7 +807,7 @@
 fi
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_CHECK_ERRNO version: 10 updated: 2008/08/22 16:33:22
+dnl CF_CHECK_ERRNO version: 11 updated: 2010/05/26 05:38:42
 dnl --------------
 dnl Check for data that is usually declared in <stdio.h> or <errno.h>, e.g.,
 dnl the 'errno' variable.  Define a DECL_xxx symbol if we must declare it
@@ -713,7 +825,7 @@
 #include <stdio.h>
 #include <sys/types.h>
 #include <errno.h> ],
-    ifelse($2,,int,$2) x = (ifelse($2,,int,$2)) $1,
+    ifelse([$2],,int,[$2]) x = (ifelse([$2],,int,[$2])) $1,
     [cf_cv_dcl_$1=yes],
     [cf_cv_dcl_$1=no])
 ])
@@ -724,7 +836,7 @@
 fi
 
 # It's possible (for near-UNIX clones) that the data doesn't exist
-CF_CHECK_EXTERN_DATA($1,ifelse($2,,int,$2))
+CF_CHECK_EXTERN_DATA($1,ifelse([$2],,int,[$2]))
 ])dnl
 dnl ---------------------------------------------------------------------------
 dnl CF_CHECK_EXTERN_DATA version: 3 updated: 2001/12/30 18:03:23
@@ -752,7 +864,7 @@
 
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_CHECK_GPM_WGETCH version: 1 updated: 2007/04/28 14:38:06
+dnl CF_CHECK_GPM_WGETCH version: 2 updated: 2010/08/14 18:25:37
 dnl -------------------
 dnl Check if GPM is already linked with curses.  If so - and if the linkage
 dnl is not "weak" - warn about this because it can create problems linking
@@ -786,7 +898,7 @@
 			test -z "$cf_cv_check_gpm_wgetch" && cf_cv_check_gpm_wgetch=no
 		fi
 	fi
-	rm -f conftest*
+	rm -rf conftest*
 	LIBS="$cf_save_LIBS"
 fi
 ])
@@ -887,7 +999,7 @@
 test "$cf_cv_cpp_static_cast" = yes && AC_DEFINE(CPP_HAS_STATIC_CAST)
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_C_INLINE version: 2 updated: 2007/08/11 14:09:50
+dnl CF_C_INLINE version: 3 updated: 2010/05/01 15:14:41
 dnl -----------
 dnl Check if the C compiler supports "inline".
 dnl $1 is the name of a shell variable to set if inline is supported
@@ -902,7 +1014,7 @@
     :
   elif test "$GCC" = yes
   then
-    AC_CACHE_CHECK(if gcc supports options to tune inlining,cf_cv_gcc_inline,[
+    AC_CACHE_CHECK(if $CC supports options to tune inlining,cf_cv_gcc_inline,[
       cf_save_CFLAGS=$CFLAGS
       CFLAGS="$CFLAGS --param max-inline-insns-single=$2"
       AC_TRY_COMPILE([inline int foo(void) { return 1; }],
@@ -945,7 +1057,7 @@
 AC_SUBST(DIRS_TO_MAKE)
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_DISABLE_LEAKS version: 4 updated: 2006/12/16 15:10:42
+dnl CF_DISABLE_LEAKS version: 6 updated: 2010/07/23 04:14:32
 dnl ----------------
 dnl Combine no-leak checks with the libraries or tools that are used for the
 dnl checks.
@@ -958,27 +1070,71 @@
 AC_MSG_CHECKING(if you want to perform memory-leak testing)
 AC_ARG_ENABLE(leaks,
 	[  --disable-leaks         test: free permanent memory, analyze leaks],
-	[with_no_leaks=yes],
+	[if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi],
 	: ${with_no_leaks:=no})
 AC_MSG_RESULT($with_no_leaks)
 
 if test "$with_no_leaks" = yes ; then
 	AC_DEFINE(NO_LEAKS)
+	AC_DEFINE(YY_NO_LEAKS)
+fi
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_DISABLE_LIBTOOL_VERSION version: 1 updated: 2010/05/15 15:45:59
+dnl --------------------------
+dnl Check if we should use the libtool 1.5 feature "-version-number" instead of
+dnl the older "-version-info" feature.  The newer feature allows us to use
+dnl version numbering on shared libraries which make them compatible with
+dnl various systems.
+AC_DEFUN([CF_DISABLE_LIBTOOL_VERSION],
+[
+AC_MSG_CHECKING(if libtool -version-number should be used)
+CF_ARG_DISABLE(libtool-version,
+	[  --disable-libtool-version  enable to use libtool's incompatible naming scheme],
+	[cf_libtool_version=no],
+	[cf_libtool_version=yes])
+AC_MSG_RESULT($cf_libtool_version)
+
+if test "$cf_libtool_version" = yes ; then
+	LIBTOOL_VERSION="-version-number"
+else
+	LIBTOOL_VERSION="-version-info"
 fi
+
+AC_SUBST(LIBTOOL_VERSION)
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_ENABLE_RPATH version: 1 updated: 2008/09/13 10:22:30
+dnl CF_DISABLE_RPATH_HACK version: 1 updated: 2010/04/11 10:54:00
+dnl ---------------------
+dnl The rpath-hack makes it simpler to build programs, particularly with the
+dnl *BSD ports which may have essential libraries in unusual places.  But it
+dnl can interfere with building an executable for the base system.  Use this
+dnl option in that case.
+AC_DEFUN([CF_DISABLE_RPATH_HACK],
+[
+AC_MSG_CHECKING(if rpath should be not be set)
+CF_ARG_DISABLE(rpath-hack,
+	[  --disable-rpath-hack    don't add rpath options for additional libraries],
+	[cf_disable_rpath_hack=yes],
+	[cf_disable_rpath_hack=no])
+AC_MSG_RESULT($cf_disable_rpath_hack)
+if test "$cf_disable_rpath_hack" = no ; then
+	CF_RPATH_HACK
+fi
+])
+dnl ---------------------------------------------------------------------------
+dnl CF_ENABLE_RPATH version: 2 updated: 2010/03/27 18:39:42
 dnl ---------------
 dnl Check if the rpath option should be used, setting cache variable
-dnl cf_cv_ld_rpath if so.
+dnl cf_cv_enable_rpath if so.
 AC_DEFUN([CF_ENABLE_RPATH],
 [
 AC_MSG_CHECKING(if rpath option should be used)
 AC_ARG_ENABLE(rpath,
 [  --enable-rpath          use rpath option when generating shared libraries],
-[cf_cv_ld_rpath=$enableval],
-[cf_cv_ld_rpath=no])
-AC_MSG_RESULT($cf_cv_ld_rpath)
+[cf_cv_enable_rpath=$enableval],
+[cf_cv_enable_rpath=no])
+AC_MSG_RESULT($cf_cv_enable_rpath)
 ])dnl
 dnl ---------------------------------------------------------------------------
 dnl CF_ERRNO version: 5 updated: 1997/11/30 12:44:39
@@ -1019,7 +1175,7 @@
 CXXFLAGS="$cf_save_CXXFLAGS"
 ])
 dnl ---------------------------------------------------------------------------
-dnl CF_FIND_LINKAGE version: 12 updated: 2007/07/29 20:13:53
+dnl CF_FIND_LINKAGE version: 19 updated: 2010/05/29 16:31:02
 dnl ---------------
 dnl Find a library (specifically the linkage used in the code fragment),
 dnl searching for it if it is not already in the library path.
@@ -1048,10 +1204,26 @@
 
 CF_MSG_LOG([Starting [FIND_LINKAGE]($3,$6)])
 
-AC_TRY_LINK([$1],[$2],
-    cf_cv_find_linkage_$3=yes,[
-    cf_cv_find_linkage_$3=no
+cf_save_LIBS="$LIBS"
+
+AC_TRY_LINK([$1],[$2],[
+	cf_cv_find_linkage_$3=yes
+	cf_cv_header_path_$3=/usr/include
+	cf_cv_library_path_$3=/usr/lib
+],[
+
+LIBS="-l$3 $7 $cf_save_LIBS"
 
+AC_TRY_LINK([$1],[$2],[
+	cf_cv_find_linkage_$3=yes
+	cf_cv_header_path_$3=/usr/include
+	cf_cv_library_path_$3=/usr/lib
+	cf_cv_library_file_$3="-l$3"
+],[
+	cf_cv_find_linkage_$3=no
+	LIBS="$cf_save_LIBS"
+
+    CF_VERBOSE(find linkage for $3 library)
     CF_MSG_LOG([Searching for headers in [FIND_LINKAGE]($3,$6)])
 
     cf_save_CPPFLAGS="$CPPFLAGS"
@@ -1110,7 +1282,6 @@
                 ])
           fi
         done
-        LIBS="$cf_save_LIBS"
         CPPFLAGS="$cf_save_CPPFLAGS"
         LDFLAGS="$cf_save_LDFLAGS"
       fi
@@ -1119,19 +1290,22 @@
       cf_cv_find_linkage_$3=no
     fi
     ],$7)
+])
+
+LIBS="$cf_save_LIBS"
 
 if test "$cf_cv_find_linkage_$3" = yes ; then
 ifelse([$4],,[
-  CF_ADD_INCDIR($cf_cv_header_path_$3)
-  CF_ADD_LIBDIR($cf_cv_library_path_$3)
-  LIBS="-l$3 $LIBS"
+	CF_ADD_INCDIR($cf_cv_header_path_$3)
+	CF_ADD_LIBDIR($cf_cv_library_path_$3)
+	CF_ADD_LIB($3)
 ],[$4])
 else
 ifelse([$5],,AC_MSG_WARN(Cannot find $3 library),[$5])
 fi
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_FUNC_DLSYM version: 1 updated: 2004/06/16 20:52:45
+dnl CF_FUNC_DLSYM version: 2 updated: 2010/05/29 16:31:02
 dnl -------------
 dnl Test for dlsym() and related functions, as well as libdl.
 dnl
@@ -1148,7 +1322,7 @@
 	cf_have_libdl=yes])])
 
 if test "$cf_have_dlsym" = yes ; then
-	test "$cf_have_libdl" = yes && LIBS="-ldl $LIBS"
+	test "$cf_have_libdl" = yes && CF_ADD_LIB(dl)
 
 	AC_MSG_CHECKING(whether able to link to dl*() functions)
 	AC_TRY_LINK([#include <dlfcn.h>],[
@@ -1231,7 +1405,7 @@
 test "$cf_cv_func_nanosleep" = "yes" && AC_DEFINE(HAVE_NANOSLEEP)
 ])
 dnl ---------------------------------------------------------------------------
-dnl CF_FUNC_OPENPTY version: 2 updated: 2008/04/12 19:49:01
+dnl CF_FUNC_OPENPTY version: 3 updated: 2010/05/29 16:31:02
 dnl ---------------
 dnl Check for openpty() function, along with <pty.h> header.  It may need the
 dnl "util" library as well.
@@ -1240,7 +1414,7 @@
 AC_CHECK_LIB(util,openpty,cf_cv_lib_util=yes,cf_cv_lib_util=no)
 AC_CACHE_CHECK(for openpty header,cf_cv_func_openpty,[
     cf_save_LIBS="$LIBS"
-    test $cf_cv_lib_util = yes && LIBS="-lutil $LIBS"
+    test $cf_cv_lib_util = yes && CF_ADD_LIB(util)
     for cf_header in pty.h libutil.h util.h
     do
     AC_TRY_LINK([
@@ -1362,7 +1536,7 @@
 
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_GCC_ATTRIBUTES version: 11 updated: 2007/07/29 09:55:12
+dnl CF_GCC_ATTRIBUTES version: 14 updated: 2010/10/23 15:52:32
 dnl -----------------
 dnl Test for availability of useful gcc __attribute__ directives to quiet
 dnl compiler warnings.  Though useful, not all are supported -- and contrary
@@ -1389,7 +1563,7 @@
 then
 	AC_CHECKING([for $CC __attribute__ directives])
 cat > conftest.$ac_ext <<EOF
-#line __oline__ "${as_me-configure}"
+#line __oline__ "${as_me:-configure}"
 #include "confdefs.h"
 #include "conftest.h"
 #include "conftest.i"
@@ -1408,26 +1582,61 @@
 extern void foo(void) GCC_NORETURN;
 int main(int argc GCC_UNUSED, char *argv[[]] GCC_UNUSED) { return 0; }
 EOF
+	cf_printf_attribute=no
+	cf_scanf_attribute=no
 	for cf_attribute in scanf printf unused noreturn
 	do
 		CF_UPPER(cf_ATTRIBUTE,$cf_attribute)
 		cf_directive="__attribute__(($cf_attribute))"
 		echo "checking for $CC $cf_directive" 1>&AC_FD_CC
-		case $cf_attribute in
-		scanf|printf)
-		cat >conftest.h <<EOF
+
+		case $cf_attribute in #(vi
+		printf) #(vi
+			cf_printf_attribute=yes
+			cat >conftest.h <<EOF
 #define GCC_$cf_ATTRIBUTE 1
 EOF
 			;;
-		*)
-		cat >conftest.h <<EOF
+		scanf) #(vi
+			cf_scanf_attribute=yes
+			cat >conftest.h <<EOF
+#define GCC_$cf_ATTRIBUTE 1
+EOF
+			;;
+		*) #(vi
+			cat >conftest.h <<EOF
 #define GCC_$cf_ATTRIBUTE $cf_directive
 EOF
 			;;
 		esac
+
 		if AC_TRY_EVAL(ac_compile); then
 			test -n "$verbose" && AC_MSG_RESULT(... $cf_attribute)
 			cat conftest.h >>confdefs.h
+			case $cf_attribute in #(vi
+			printf) #(vi
+				if test "$cf_printf_attribute" = no ; then
+					cat >>confdefs.h <<EOF
+#define GCC_PRINTFLIKE(fmt,var) /* nothing */
+EOF
+				else
+					cat >>confdefs.h <<EOF
+#define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
+EOF
+				fi
+				;;
+			scanf) #(vi
+				if test "$cf_scanf_attribute" = no ; then
+					cat >>confdefs.h <<EOF
+#define GCC_SCANFLIKE(fmt,var) /* nothing */
+EOF
+				else
+					cat >>confdefs.h <<EOF
+#define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
+EOF
+				fi
+				;;
+			esac
 		fi
 	done
 else
@@ -1437,7 +1646,7 @@
 fi
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_GCC_VERSION version: 4 updated: 2005/08/27 09:53:42
+dnl CF_GCC_VERSION version: 5 updated: 2010/04/24 11:02:31
 dnl --------------
 dnl Find version of gcc
 AC_DEFUN([CF_GCC_VERSION],[
@@ -1445,13 +1654,13 @@
 GCC_VERSION=none
 if test "$GCC" = yes ; then
 	AC_MSG_CHECKING(version of $CC)
-	GCC_VERSION="`${CC} --version| sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[[^0-9.]]*//' -e 's/[[^0-9.]].*//'`"
+	GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[[^0-9.]]*//' -e 's/[[^0-9.]].*//'`"
 	test -z "$GCC_VERSION" && GCC_VERSION=unknown
 	AC_MSG_RESULT($GCC_VERSION)
 fi
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_GCC_WARNINGS version: 23 updated: 2008/07/26 17:54:02
+dnl CF_GCC_WARNINGS version: 27 updated: 2010/10/23 15:52:32
 dnl ---------------
 dnl Check if the compiler supports useful warning options.  There's a few that
 dnl we don't use, simply because they're too noisy:
@@ -1476,7 +1685,7 @@
 CF_INTEL_COMPILER(GCC,INTEL_COMPILER,CFLAGS)
 
 cat > conftest.$ac_ext <<EOF
-#line __oline__ "${as_me-configure}"
+#line __oline__ "${as_me:-configure}"
 int main(int argc, char *argv[[]]) { return (argv[[argc-1]] == 0) ; }
 EOF
 
@@ -1484,7 +1693,6 @@
 then
 # The "-wdXXX" options suppress warnings:
 # remark #1419: external declaration in primary source file
-# remark #1682: implicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
 # remark #193: zero used for undefined preprocessing identifier
@@ -1492,19 +1700,18 @@
 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
 # remark #869: parameter "tw" was never referenced
 # remark #981: operands are evaluated in unspecified order
-# warning #269: invalid format string conversion
+# warning #279: controlling expression is constant
 
 	AC_CHECKING([for $CC warning options])
 	cf_save_CFLAGS="$CFLAGS"
 	EXTRA_CFLAGS="-Wall"
 	for cf_opt in \
 		wd1419 \
-		wd1682 \
 		wd1683 \
 		wd1684 \
 		wd193 \
-		wd279 \
 		wd593 \
+		wd279 \
 		wd810 \
 		wd869 \
 		wd981
@@ -1521,10 +1728,10 @@
 then
 	AC_CHECKING([for $CC warning options])
 	cf_save_CFLAGS="$CFLAGS"
-	EXTRA_CFLAGS="-W -Wall"
+	EXTRA_CFLAGS=
 	cf_warn_CONST=""
 	test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
-	for cf_opt in \
+	for cf_opt in W Wall \
 		Wbad-function-cast \
 		Wcast-align \
 		Wcast-qual \
@@ -1557,12 +1764,104 @@
 	done
 	CFLAGS="$cf_save_CFLAGS"
 fi
-rm -f conftest*
+rm -rf conftest*
 
 AC_SUBST(EXTRA_CFLAGS)
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_GNAT_TRY_LINK version: 1 updated: 2004/08/21 19:02:08
+dnl CF_GNAT_GENERICS version: 1 updated: 2010/11/13 14:15:18
+dnl ----------------
+AC_DEFUN([CF_GNAT_GENERICS],
+[
+AC_MSG_CHECKING(if GNAT supports generics)
+case $cf_gnat_version in #(vi
+3.[[1-9]]*|[[4-9]].*) #(vi
+	cf_gnat_generics=yes
+	;;
+*)
+	cf_gnat_generics=no
+	;;
+esac
+AC_MSG_RESULT($cf_gnat_generics)
+
+if test "$cf_gnat_generics" = yes
+then
+	cf_compile_generics=generics
+	cf_generic_objects="\${GENOBJS}"
+else
+	cf_compile_generics=
+	cf_generic_objects=
+fi
+
+AC_SUBST(cf_compile_generics)
+AC_SUBST(cf_generic_objects)
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_GNAT_PRAGMA_UNREF version: 1 updated: 2010/06/19 15:22:18
+dnl --------------------
+dnl Check if the gnat pragma "Unreferenced" works.
+AC_DEFUN([CF_GNAT_PRAGMA_UNREF],[
+AC_CACHE_CHECK(if GNAT pragma Unreferenced works,cf_cv_pragma_unreferenced,[
+CF_GNAT_TRY_LINK([procedure conftest;],
+[with Text_IO;
+with GNAT.OS_Lib;
+procedure conftest is
+   test : Integer;
+   pragma Unreferenced (test);
+begin
+   test := 1;
+   Text_IO.Put ("Hello World");
+   Text_IO.New_Line;
+   GNAT.OS_Lib.OS_Exit (0);
+end conftest;],
+	[cf_cv_pragma_unreferenced=yes],
+	[cf_cv_pragma_unreferenced=no])])
+
+# if the pragma is supported, use it (needed in the Trace code).
+if test $cf_cv_pragma_unreferenced = yes ; then
+	PRAGMA_UNREF=TRUE
+else
+	PRAGMA_UNREF=FALSE
+fi
+AC_SUBST(PRAGMA_UNREF)
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_GNAT_PROJECTS version: 1 updated: 2010/11/13 14:15:18
+dnl ----------------
+AC_DEFUN([CF_GNAT_PROJECTS],
+[
+AC_MSG_CHECKING(if GNAT supports project files)
+case $cf_gnat_version in #(vi
+3.[[0-9]]*) #(vi
+	cf_gnat_projects=no
+	;;
+*)
+	case $cf_cv_system_name in #(vi
+	cygwin*) #(vi
+		cf_gnat_projects=no
+		;;
+	*)
+		cf_gnat_projects=yes
+		;;
+	esac
+	;;
+esac
+AC_MSG_RESULT($cf_gnat_projects)
+
+if test "$cf_gnat_projects" = yes
+then
+	USE_OLD_MAKERULES="#"
+	USE_GNAT_PROJECTS=""
+else
+	USE_OLD_MAKERULES=""
+	USE_GNAT_PROJECTS="#"
+fi
+
+AC_SUBST(USE_OLD_MAKERULES)
+AC_SUBST(USE_GNAT_PROJECTS)
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_GNAT_TRY_LINK version: 2 updated: 2010/08/14 18:25:37
 dnl ----------------
 dnl Verify that a test program compiles/links with GNAT.
 dnl $cf_ada_make is set to the program that compiles/links
@@ -1574,7 +1873,7 @@
 dnl $4 is the shell command to execute if not successful
 AC_DEFUN([CF_GNAT_TRY_LINK],
 [
-rm -f conftest*
+rm -rf conftest*
 cat >>conftest.ads <<CF_EOF
 $1
 CF_EOF
@@ -1586,10 +1885,10 @@
 ifelse($4,,,[else
    $4])
 fi
-rm -f conftest*
+rm -rf conftest*
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_GNAT_TRY_RUN version: 3 updated: 2004/08/21 19:02:08
+dnl CF_GNAT_TRY_RUN version: 4 updated: 2010/08/14 18:25:37
 dnl ---------------
 dnl Verify that a test program compiles and runs with GNAT
 dnl $cf_ada_make is set to the program that compiles/links
@@ -1601,7 +1900,7 @@
 dnl $4 is the shell command to execute if not successful
 AC_DEFUN([CF_GNAT_TRY_RUN],
 [
-rm -f conftest*
+rm -rf conftest*
 cat >>conftest.ads <<CF_EOF
 $1
 CF_EOF
@@ -1617,36 +1916,32 @@
 ifelse($4,,,[else
    $4])
 fi
-rm -f conftest*
+rm -rf conftest*
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_GNAT_VERSION version: 12 updated: 2006/10/14 15:23:15
+dnl CF_GNAT_VERSION version: 16 updated: 2010/11/13 14:15:18
 dnl ---------------
 dnl Verify version of GNAT.
 AC_DEFUN([CF_GNAT_VERSION],
 [
 AC_MSG_CHECKING(for gnat version)
-cf_gnat_version=`${cf_ada_make-gnatmake} -v 2>&1 | grep '[[0-9]].[[0-9]][[0-9]]*' |\
-  sed -e '2,$d' -e 's/[[^0-9 \.]]//g' -e 's/^[[ ]]*//' -e 's/ .*//'`
+cf_gnat_version=`${cf_ada_make:-gnatmake} -v 2>&1 | \
+	grep '[[0-9]].[[0-9]][[0-9]]*' |\
+    sed -e '2,$d' -e 's/[[^0-9 \.]]//g' -e 's/^[[ ]]*//' -e 's/ .*//'`
 AC_MSG_RESULT($cf_gnat_version)
 
-case $cf_gnat_version in
-  3.1[[1-9]]*|3.[[2-9]]*|[[4-9]].*)
-    cf_cv_prog_gnat_correct=yes
-    ;;
-  *) echo Unsupported GNAT version $cf_gnat_version. Required is 3.11 or better. Disabling Ada95 binding.
-     cf_cv_prog_gnat_correct=no
-     ;;
-esac
-case $cf_gnat_version in
-  3.[[1-9]]*|[[4-9]].*)
-      cf_compile_generics=generics
-      cf_generic_objects="\${GENOBJS}"
-      ;;
-  *)  cf_compile_generics=
-      cf_generic_objects=
-      ;;
+case $cf_gnat_version in #(vi
+3.1[[1-9]]*|3.[[2-9]]*|[[4-9]].*) #(vi
+	cf_cv_prog_gnat_correct=yes
+	;;
+*)
+	AC_MSG_WARN(Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding.)
+	cf_cv_prog_gnat_correct=no
+	;;
 esac
+
+CF_GNAT_GENERICS
+CF_GNAT_PROJECTS
 ])
 dnl ---------------------------------------------------------------------------
 dnl CF_GNU_SOURCE version: 6 updated: 2005/07/09 13:23:07
@@ -1679,7 +1974,7 @@
 test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_GPP_LIBRARY version: 8 updated: 2003/02/02 01:41:46
+dnl CF_GPP_LIBRARY version: 10 updated: 2010/05/29 16:31:02
 dnl --------------
 dnl If we're trying to use g++, test if libg++ is installed (a rather common
 dnl problem :-).  If we have the compiler but no library, we'll be able to
@@ -1698,13 +1993,13 @@
 if test "$GXX" = yes; then
 	AC_MSG_CHECKING([for lib$cf_gpp_libname])
 	cf_save="$LIBS"
-	LIBS="$LIBS -l$cf_gpp_libname"
+	CF_ADD_LIB($cf_gpp_libname)
 	AC_TRY_LINK([
 #include <$cf_gpp_libname/builtin.h>
 	],
 	[two_arg_error_handler_t foo2 = lib_error_handler],
 	[cf_cxx_library=yes
-	 CXXLIBS="$CXXLIBS -l$cf_gpp_libname"
+	 CF_ADD_LIB($cf_gpp_libname,CXXLIBS)
 	 if test "$cf_gpp_libname" = cpp ; then
 	    AC_DEFINE(HAVE_GPP_BUILTIN_H)
 	 else
@@ -1715,7 +2010,7 @@
 	],
 	[two_arg_error_handler_t foo2 = lib_error_handler],
 	[cf_cxx_library=yes
-	 CXXLIBS="$CXXLIBS -l$cf_gpp_libname"
+	 CF_ADD_LIB($cf_gpp_libname,CXXLIBS)
 	 AC_DEFINE(HAVE_BUILTIN_H)],
 	[cf_cxx_library=no])])
 	LIBS="$cf_save"
@@ -1723,7 +2018,7 @@
 fi
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_GXX_VERSION version: 5 updated: 2005/08/27 09:53:42
+dnl CF_GXX_VERSION version: 6 updated: 2010/10/23 15:44:18
 dnl --------------
 dnl Check for version of g++
 AC_DEFUN([CF_GXX_VERSION],[
@@ -1731,13 +2026,13 @@
 GXX_VERSION=none
 if test "$GXX" = yes; then
 	AC_MSG_CHECKING(version of g++)
-	GXX_VERSION="`${CXX-g++} --version| sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[[^0-9.]]*//' -e 's/[[^0-9.]].*//'`"
+	GXX_VERSION="`${CXX:-g++} --version| sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[[^0-9.]]*//' -e 's/[[^0-9.]].*//'`"
 	test -z "$GXX_VERSION" && GXX_VERSION=unknown
 	AC_MSG_RESULT($GXX_VERSION)
 fi
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_GXX_WARNINGS version: 5 updated: 2005/08/13 14:54:38
+dnl CF_GXX_WARNINGS version: 6 updated: 2010/08/14 18:25:37
 dnl ---------------
 dnl Check if the compiler supports useful warning options.
 dnl
@@ -1848,12 +2143,12 @@
 	CXXFLAGS="$cf_save_CXXFLAGS"
 fi
 
-rm -f conftest*
+rm -rf conftest*
 AC_LANG_RESTORE
 AC_SUBST(EXTRA_CXXFLAGS)
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_HASHED_DB version: 3 updated: 2007/11/24 17:43:37
+dnl CF_HASHED_DB version: 4 updated: 2010/05/29 16:31:02
 dnl ------------
 dnl Look for an instance of the Berkeley hashed database.
 dnl
@@ -1880,7 +2175,7 @@
 	if test "$cf_cv_hashed_db_libs" = unknown ; then
 		AC_MSG_ERROR(Cannot determine library for db)
 	elif test "$cf_cv_hashed_db_libs" != default ; then
-		LIBS="-l$cf_cv_hashed_db_libs $LIBS"
+		CF_ADD_LIB($cf_cv_hashed_db_libs)
 	fi
 fi
 ],[
@@ -1888,7 +2183,7 @@
 ])
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_HASHED_DB_LIBS version: 8 updated: 2008/08/04 06:18:06
+dnl CF_HASHED_DB_LIBS version: 9 updated: 2010/05/29 16:31:02
 dnl -----------------
 dnl Given that we have the header and version for hashed database, find the
 dnl library information.
@@ -1900,7 +2195,7 @@
 do
 	cf_save_libs="$LIBS"
 	if test -n "$cf_db_libs"; then
-		LIBS="-l$cf_db_libs $LIBS"
+		CF_ADD_LIB($cf_db_libs)
 	fi
 	CF_MSG_LOG(checking for library "$cf_db_libs")
 	AC_TRY_LINK([
@@ -1998,11 +2293,35 @@
 ])
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_HEADER_PATH version: 8 updated: 2002/11/10 14:46:59
+dnl CF_HEADER_PATH version: 12 updated: 2010/05/05 05:22:40
 dnl --------------
-dnl Construct a search-list for a nonstandard header-file
+dnl Construct a search-list of directories for a nonstandard header-file
+dnl
+dnl Parameters
+dnl	$1 = the variable to return as result
+dnl	$2 = the package name
 AC_DEFUN([CF_HEADER_PATH],
-[CF_SUBDIR_PATH($1,$2,include)
+[
+$1=
+
+# collect the current set of include-directories from compiler flags
+cf_header_path_list=""
+if test -n "${CFLAGS}${CPPFLAGS}" ; then
+	for cf_header_path in $CPPFLAGS $CFLAGS
+	do
+		case $cf_header_path in #(vi
+		-I*)
+			cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
+			CF_ADD_SUBDIR_PATH($1,$2,include,$cf_header_path,NONE)
+			cf_header_path_list="$cf_header_path_list [$]$1"
+			;;
+		esac
+	done
+fi
+
+# add the variations for the package we are looking for
+CF_SUBDIR_PATH($1,$2,include)
+
 test "$includedir" != NONE && \
 test "$includedir" != "/usr/include" && \
 test -d "$includedir" && {
@@ -2017,6 +2336,7 @@
 	test -d $oldincludedir/$2 && $1="[$]$1 $oldincludedir/$2"
 }
 
+$1="[$]$1 $cf_header_path_list"
 ])dnl
 dnl ---------------------------------------------------------------------------
 dnl CF_HELP_MESSAGE version: 3 updated: 1998/01/14 10:56:23
@@ -2026,7 +2346,7 @@
 [AC_DIVERT_HELP([$1])dnl
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_INCLUDE_DIRS version: 5 updated: 2006/10/14 15:23:15
+dnl CF_INCLUDE_DIRS version: 6 updated: 2009/01/06 19:37:40
 dnl ---------------
 dnl Construct the list of include-options according to whether we're building
 dnl in the source directory or using '--srcdir=DIR' option.  If we're building
@@ -2034,9 +2354,9 @@
 dnl since that usually breaks gcc's shadow-includes.
 AC_DEFUN([CF_INCLUDE_DIRS],
 [
-CPPFLAGS="-I. -I../include $CPPFLAGS"
+CPPFLAGS="$CPPFLAGS -I. -I../include"
 if test "$srcdir" != "."; then
-	CPPFLAGS="-I\${srcdir}/../include $CPPFLAGS"
+	CPPFLAGS="$CPPFLAGS -I\${srcdir}/../include"
 fi
 if test "$GCC" != yes; then
 	CPPFLAGS="$CPPFLAGS -I\${includedir}"
@@ -2052,7 +2372,7 @@
 AC_SUBST(CPPFLAGS)
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_INTEL_COMPILER version: 3 updated: 2005/08/06 18:37:29
+dnl CF_INTEL_COMPILER version: 4 updated: 2010/05/26 05:38:42
 dnl -----------------
 dnl Check if the given compiler is really the Intel compiler for Linux.  It
 dnl tries to imitate gcc, but does not return an error when it finds a mismatch
@@ -2066,24 +2386,24 @@
 dnl $2 = INTEL_COMPILER (default) or INTEL_CPLUSPLUS
 dnl $3 = CFLAGS (default) or CXXFLAGS
 AC_DEFUN([CF_INTEL_COMPILER],[
-ifelse($2,,INTEL_COMPILER,[$2])=no
+ifelse([$2],,INTEL_COMPILER,[$2])=no
 
-if test "$ifelse($1,,[$1],GCC)" = yes ; then
+if test "$ifelse([$1],,[$1],GCC)" = yes ; then
 	case $host_os in
 	linux*|gnu*)
-		AC_MSG_CHECKING(if this is really Intel ifelse($1,GXX,C++,C) compiler)
-		cf_save_CFLAGS="$ifelse($3,,CFLAGS,[$3])"
-		ifelse($3,,CFLAGS,[$3])="$ifelse($3,,CFLAGS,[$3]) -no-gcc"
+		AC_MSG_CHECKING(if this is really Intel ifelse([$1],GXX,C++,C) compiler)
+		cf_save_CFLAGS="$ifelse([$3],,CFLAGS,[$3])"
+		ifelse([$3],,CFLAGS,[$3])="$ifelse([$3],,CFLAGS,[$3]) -no-gcc"
 		AC_TRY_COMPILE([],[
 #ifdef __INTEL_COMPILER
 #else
 make an error
 #endif
-],[ifelse($2,,INTEL_COMPILER,[$2])=yes
+],[ifelse([$2],,INTEL_COMPILER,[$2])=yes
 cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc"
 ],[])
-		ifelse($3,,CFLAGS,[$3])="$cf_save_CFLAGS"
-		AC_MSG_RESULT($ifelse($2,,INTEL_COMPILER,[$2]))
+		ifelse([$3],,CFLAGS,[$3])="$cf_save_CFLAGS"
+		AC_MSG_RESULT($ifelse([$2],,INTEL_COMPILER,[$2]))
 		;;
 	esac
 fi
@@ -2143,7 +2463,7 @@
 ])
 ])
 dnl ---------------------------------------------------------------------------
-dnl CF_LDFLAGS_STATIC version: 4 updated: 2008/10/18 17:58:20
+dnl CF_LDFLAGS_STATIC version: 8 updated: 2010/10/23 14:39:56
 dnl -----------------
 dnl Check for compiler/linker flags used to temporarily force usage of static
 dnl libraries.  This depends on the compiler and platform.  Use this to help
@@ -2153,7 +2473,7 @@
 
 if test "$GCC" = yes ; then
 	case $cf_cv_system_name in #(
-	OS/2*|os2*|aix[[45]]*) 	#( vi
+	OS/2*|os2*|aix[[4]]*|solaris2.1[[0-9]]|darwin*) 	#( vi
 		LDFLAGS_STATIC=
 		LDFLAGS_SHARED=
 		;;
@@ -2164,7 +2484,7 @@
     esac
 else
 	case $cf_cv_system_name in #(
-	aix[[45]]*) 	#( from ld manpage
+	aix[[456]]*) 	#( from ld manpage
 		LDFLAGS_STATIC=-bstatic
 		LDFLAGS_SHARED=-bdynamic
 		;;
@@ -2179,7 +2499,7 @@
 		;;
 	osf[[45]]*)	#( from ld manpage osf4.0d, osf5.1
 		# alternative "-oldstyle_liblookup" (not in cc manpage)
-		LDFLAGS_STATIC=-noso 
+		LDFLAGS_STATIC=-noso
 		LDFLAGS_SHARED=-so_archive
 		;;
 	solaris2*)
@@ -2189,15 +2509,134 @@
 	esac
 fi
 
+if test -n "$LDFLAGS_STATIC" && test -n "$LDFLAGS_SHARED"
+then
+	AC_MSG_CHECKING(if linker supports switching between static/dynamic)
+
+	rm -f libconftest.a
+	cat >conftest.$ac_ext <<EOF
+#line __oline__ "configure"
+#include <stdio.h>
+int cf_ldflags_static(FILE *fp) { return fflush(fp); }
+EOF
+	if AC_TRY_EVAL(ac_compile) ; then
+		( $AR $ARFLAGS libconftest.a conftest.o ) 2>&AC_FD_CC 1>/dev/null
+		( eval $RANLIB libconftest.a ) 2>&AC_FD_CC >/dev/null
+	fi
+	rm -f conftest.*
+
+	cf_save_LIBS="$LIBS"
+
+	LIBS="$LDFLAGS_STATIC -L`pwd` -lconftest $LDFLAGS_DYNAMIC $LIBS"
+	AC_TRY_LINK([
+#line __oline__ "configure"
+#include <stdio.h>
+int cf_ldflags_static(FILE *fp);
+],[
+	return cf_ldflags_static(stdin);
+],[cf_ldflags_static=yes],[cf_ldflags_static=no])
+
+	rm -f libconftest.*
+	LIBS="$cf_save_LIBS"
+
+	AC_MSG_RESULT($cf_ldflags_static)
+
+	if test $cf_ldflags_static != yes
+	then
+		LDFLAGS_STATIC=
+		LDFLAGS_SHARED=
+	fi
+else
+	LDFLAGS_STATIC=
+	LDFLAGS_SHARED=
+fi
+
 AC_SUBST(LDFLAGS_STATIC)
 AC_SUBST(LDFLAGS_SHARED)
 ])
 dnl ---------------------------------------------------------------------------
-dnl CF_LIBRARY_PATH version: 7 updated: 2002/11/10 14:46:59
+dnl CF_LD_RPATH_OPT version: 3 updated: 2010/06/02 05:03:05
+dnl ---------------
+dnl For the given system and compiler, find the compiler flags to pass to the
+dnl loader to use the "rpath" feature.
+AC_DEFUN([CF_LD_RPATH_OPT],
+[
+AC_REQUIRE([CF_CHECK_CACHE])
+
+LD_RPATH_OPT=
+AC_MSG_CHECKING(for an rpath option)
+case $cf_cv_system_name in #(vi
+irix*) #(vi
+	if test "$GCC" = yes; then
+		LD_RPATH_OPT="-Wl,-rpath,"
+	else
+		LD_RPATH_OPT="-rpath "
+	fi
+	;;
+linux*|gnu*|k*bsd*-gnu) #(vi
+	LD_RPATH_OPT="-Wl,-rpath,"
+	;;
+openbsd[[2-9]].*) #(vi
+	LD_RPATH_OPT="-Wl,-rpath,"
+	;;
+freebsd*) #(vi
+	LD_RPATH_OPT="-rpath "
+	;;
+netbsd*) #(vi
+	LD_RPATH_OPT="-Wl,-rpath,"
+	;;
+osf*|mls+*) #(vi
+	LD_RPATH_OPT="-rpath "
+	;;
+solaris2*) #(vi
+	LD_RPATH_OPT="-R"
+	;;
+*)
+	;;
+esac
+AC_MSG_RESULT($LD_RPATH_OPT)
+
+case "x$LD_RPATH_OPT" in #(vi
+x-R*)
+	AC_MSG_CHECKING(if we need a space after rpath option)
+	cf_save_LIBS="$LIBS"
+	CF_ADD_LIBS(${LD_RPATH_OPT}$libdir)
+	AC_TRY_LINK(, , cf_rpath_space=no, cf_rpath_space=yes)
+	LIBS="$cf_save_LIBS"
+	AC_MSG_RESULT($cf_rpath_space)
+	test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
+	;;
+esac
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_LIBRARY_PATH version: 9 updated: 2010/03/28 12:52:50
 dnl ---------------
-dnl Construct a search-list for a nonstandard library-file
+dnl Construct a search-list of directories for a nonstandard library-file
+dnl
+dnl Parameters
+dnl	$1 = the variable to return as result
+dnl	$2 = the package name
 AC_DEFUN([CF_LIBRARY_PATH],
-[CF_SUBDIR_PATH($1,$2,lib)])dnl
+[
+$1=
+cf_library_path_list=""
+if test -n "${LDFLAGS}${LIBS}" ; then
+	for cf_library_path in $LDFLAGS $LIBS
+	do
+		case $cf_library_path in #(vi
+		-L*)
+			cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
+			CF_ADD_SUBDIR_PATH($1,$2,lib,$cf_library_path,NONE)
+			cf_library_path_list="$cf_library_path_list [$]$1"
+			;;
+		esac
+	done
+fi
+
+CF_SUBDIR_PATH($1,$2,lib)
+
+$1="$cf_library_path_list [$]$1"
+])dnl
 dnl ---------------------------------------------------------------------------
 dnl CF_LIB_PREFIX version: 8 updated: 2008/09/13 11:34:16
 dnl -------------
@@ -2216,7 +2655,7 @@
 	AC_SUBST(LIB_PREFIX)
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_LIB_RULES version: 53 updated: 2008/09/20 19:51:59
+dnl CF_LIB_RULES version: 61 updated: 2010/10/23 16:10:30
 dnl ------------
 dnl Append definitions and rules for the given models to the subdirectory
 dnl Makefiles, and the recursion rule for the top-level Makefile.  If the
@@ -2239,6 +2678,23 @@
 	TINFO_SUFFIX=.dll
 fi
 
+if test -n "$TINFO_SUFFIX" ; then
+	case $TINFO_SUFFIX in
+	tw*)
+		TINFO_NAME="${TINFO_NAME}tw"
+		TINFO_SUFFIX=`echo $TINFO_SUFFIX | sed 's/^tw//'`
+		;;
+	t*)
+		TINFO_NAME="${TINFO_NAME}t"
+		TINFO_SUFFIX=`echo $TINFO_SUFFIX | sed 's/^t//'`
+		;;
+	w*)
+		TINFO_NAME="${TINFO_NAME}w"
+		TINFO_SUFFIX=`echo $TINFO_SUFFIX | sed 's/^w//'`
+		;;
+	esac
+fi
+
 for cf_dir in $SRC_SUBDIRS
 do
 	if test ! -d $srcdir/$cf_dir ; then
@@ -2257,6 +2713,14 @@
 					case "$cf_cv_system_name" in #(vi
 					darwin*)
 					case .${LIB_SUFFIX} in
+					.tw*)
+						cf_suffix=`echo $cf_suffix | sed 's/^tw//'`
+						cf_suffix=tw'.${REL_VERSION}'"$cf_suffix"
+						;;
+					.t*)
+						cf_suffix=`echo $cf_suffix | sed 's/^t//'`
+						cf_suffix=t'.${REL_VERSION}'"$cf_suffix"
+						;;
 					.w*)
 						cf_suffix=`echo $cf_suffix | sed 's/^w//'`
 						cf_suffix=w'.${REL_VERSION}'"$cf_suffix"
@@ -2273,6 +2737,14 @@
 					case "$cf_cv_system_name" in #(vi
 					darwin*)
 					case .${LIB_SUFFIX} in
+					.tw*)
+						cf_suffix=`echo $cf_suffix | sed 's/^tw//'`
+						cf_suffix=tw'.${ABI_VERSION}'"$cf_suffix"
+						;;
+					.t*)
+						cf_suffix=`echo $cf_suffix | sed 's/^t//'`
+						cf_suffix=t'.${ABI_VERSION}'"$cf_suffix"
+						;;
 					.w*)
 						cf_suffix=`echo $cf_suffix | sed 's/^w//'`
 						cf_suffix=w'.${ABI_VERSION}'"$cf_suffix"
@@ -2393,6 +2865,16 @@
  			if test "$cf_cv_shlib_version_infix" = yes ; then
 			if test -n "$LIB_SUFFIX" ; then
 				case $LIB_SUFFIX in
+				tw*)
+					cf_libname=`echo $cf_libname | sed 's/tw$//'`
+					cf_suffix=`echo $cf_suffix | sed 's/^tw//'`
+					cf_dir_suffix=tw
+					;;
+				t*)
+					cf_libname=`echo $cf_libname | sed 's/t$//'`
+					cf_suffix=`echo $cf_suffix | sed 's/^t//'`
+					cf_dir_suffix=t
+					;;
 				w*)
 					cf_libname=`echo $cf_libname | sed 's/w$//'`
 					cf_suffix=`echo $cf_suffix | sed 's/^w//'`
@@ -2410,17 +2892,19 @@
 				prefix=$cf_prefix \
 				suffix=$cf_suffix \
 				subset=$cf_subset \
+				SymLink="$LN_S" \
 				TermlibRoot=$TINFO_NAME \
 				TermlibSuffix=$TINFO_SUFFIX \
 				ShlibVer=$cf_cv_shlib_version \
 				ShlibVerInfix=$cf_cv_shlib_version_infix \
-				ReLink=${cf_cv_do_relink-no} \
+				ReLink=${cf_cv_do_relink:-no} \
 				DoLinks=$cf_cv_do_symlinks \
 				rmSoLocs=$cf_cv_rm_so_locs \
 				ldconfig="$LDCONFIG" \
 				overwrite=$WITH_OVERWRITE \
 				depend="$cf_depend" \
 				host="$host" \
+				libtool_version="$LIBTOOL_VERSION" \
 				$srcdir/$cf_dir/modules >>$cf_dir/Makefile
 
 			cf_suffix="$old_cf_suffix"
@@ -2504,18 +2988,28 @@
 install.libs uninstall.libs \\
 install.data uninstall.data ::
 $MAKE_TERMINFO	cd misc && \${MAKE} \${CF_MFLAGS} \[$]@
+CF_EOF
+
+if test "x$cf_with_manpages" = xyes; then
+cat >> Makefile <<CF_EOF
 
 install.man \\
 uninstall.man ::
 	cd man && \${MAKE} \${CF_MFLAGS} \[$]@
+CF_EOF
+fi
+
+cat >> Makefile <<CF_EOF
 
 distclean ::
 	rm -f config.cache config.log config.status Makefile include/ncurses_cfg.h
 	rm -f headers.sh headers.sed mk_shared_lib.sh
+	rm -f edit_man.* man_alias.*
 	rm -rf \${DIRS_TO_MAKE}
 CF_EOF
 
 # Special case: tack's manpage lives in its own directory.
+if test "x$cf_with_manpages" = xyes; then
 if test -d tack ; then
 if test -f $srcdir/$tack.h; then
 cat >> Makefile <<CF_EOF
@@ -2526,6 +3020,7 @@
 CF_EOF
 fi
 fi
+fi
 
 dnl If we're installing into a subdirectory of /usr/include, etc., we should
 dnl prepend the subdirectory's name to the "#include" paths.  It won't hurt
@@ -2551,8 +3046,8 @@
 DST=\[$]1
 REF=\[$]2
 SRC=\[$]3
-TMPSRC=\${TMPDIR-/tmp}/\`basename \$SRC\`\$\$
-TMPSED=\${TMPDIR-/tmp}/headers.sed\$\$
+TMPSRC=\${TMPDIR:-/tmp}/\`basename \$SRC\`\$\$
+TMPSED=\${TMPDIR:-/tmp}/headers.sed\$\$
 echo installing \$SRC in \$DST
 CF_EOF
 
@@ -2639,10 +3134,10 @@
 		fi
 	fi
 done
-
+AC_SUBST(LIBS_TO_MAKE)
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_LIB_SONAME version: 3 updated: 2006/12/16 15:55:46
+dnl CF_LIB_SONAME version: 5 updated: 2010/08/14 18:25:37
 dnl -------------
 dnl Find the and soname for the given shared library.  Set the cache variable
 dnl cf_cv_$3_soname to this, unless it is not found.  Then set the cache
@@ -2666,20 +3161,20 @@
 }
 CF_EOF
 cf_save_LIBS="$LIBS"
-	LIBS="-l$3 $LIBS"
+	CF_ADD_LIB($3)
 	if AC_TRY_EVAL(ac_compile) ; then
 		if AC_TRY_EVAL(ac_link) ; then
 			cf_cv_$3_soname=`ldd conftest$ac_exeext 2>/dev/null | sed -e 's,^.*/,,' -e 's, .*$,,' | fgrep lib$3.`
 			test -z "$cf_cv_$3_soname" && cf_cv_$3_soname=unknown
 		fi
 	fi
-rm -f conftest*
+rm -rf conftest*
 LIBS="$cf_save_LIBS"
 fi
 ])
 ])
 dnl ---------------------------------------------------------------------------
-dnl CF_LIB_SUFFIX version: 15 updated: 2008/09/13 11:54:48
+dnl CF_LIB_SUFFIX version: 16 updated: 2008/12/27 12:30:03
 dnl -------------
 dnl Compute the library file-suffix from the given model name
 dnl $1 = model name
@@ -2689,40 +3184,44 @@
 AC_DEFUN([CF_LIB_SUFFIX],
 [
 	AC_REQUIRE([CF_SUBST_NCURSES_VERSION])
-	case $1 in
-	libtool)
+	case $1 in #(vi
+	libtool) #(vi
 		$2='.la'
 		$3=[$]$2
 		;;
-	normal)
+	normal) #(vi
 		$2='.a'
 		$3=[$]$2
 		;;
-	debug)
+	debug) #(vi
 		$2='_g.a'
 		$3=[$]$2
 		;;
-	profile)
+	profile) #(vi
 		$2='_p.a'
 		$3=[$]$2
 		;;
-	shared)
+	shared) #(vi
 		case $cf_cv_system_name in
-		cygwin*)
+		aix[[56]]*) #(vi
+			$2='.a'
+			$3=[$]$2
+			;;
+		cygwin*) #(vi
 			$2='.dll'
 			$3='.dll.a'
 			;;
-		darwin*)
+		darwin*) #(vi
 			$2='.dylib'
 			$3=[$]$2
 			;;
-		hpux*)
+		hpux*) #(vi
 			case $target in
-			ia64*)
+			ia64*) #(vi
 				$2='.so'
 				$3=[$]$2
 				;;
-			*)
+			*) #(vi
 				$2='.sl'
 				$3=[$]$2
 				;;
@@ -2755,7 +3254,7 @@
 	test -n "$LIB_SUFFIX" && $2="${LIB_SUFFIX}[$]{$2}"
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_LINK_DATAONLY version: 8 updated: 2006/12/16 12:33:30
+dnl CF_LINK_DATAONLY version: 9 updated: 2009/01/01 20:21:38
 dnl ----------------
 dnl Some systems have a non-ANSI linker that doesn't pull in modules that have
 dnl only data (i.e., no functions), for example NeXT.  On those systems we'll
@@ -2772,7 +3271,7 @@
 EOF
 	if AC_TRY_EVAL(ac_compile) ; then
 		mv conftest.o data.o && \
-		( $AR $AR_OPTS conftest.a data.o ) 2>&AC_FD_CC 1>/dev/null
+		( $AR $ARFLAGS conftest.a data.o ) 2>&AC_FD_CC 1>/dev/null
 	fi
 	rm -f conftest.$ac_ext data.o
 	cat >conftest.$ac_ext <<EOF
@@ -2791,7 +3290,7 @@
 EOF
 	if AC_TRY_EVAL(ac_compile); then
 		mv conftest.o func.o && \
-		( $AR $AR_OPTS conftest.a func.o ) 2>&AC_FD_CC 1>/dev/null
+		( $AR $ARFLAGS conftest.a func.o ) 2>&AC_FD_CC 1>/dev/null
 	fi
 	rm -f conftest.$ac_ext func.o
 	( eval $RANLIB conftest.a ) 2>&AC_FD_CC >/dev/null
@@ -2887,7 +3386,7 @@
 cf_cv_main_return=return
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_MAKEFLAGS version: 12 updated: 2006/10/21 08:27:03
+dnl CF_MAKEFLAGS version: 13 updated: 2010/10/23 15:52:32
 dnl ------------
 dnl Some 'make' programs support ${MAKEFLAGS}, some ${MFLAGS}, to pass 'make'
 dnl options to lower-levels.  It's very useful for "make -n" -- if we have it.
@@ -2904,10 +3403,10 @@
 all :
 	@ echo '.$cf_option'
 CF_EOF
-		cf_result=`${MAKE-make} -k -f cf_makeflags.tmp 2>/dev/null | sed -e 's,[[ 	]]*$,,'`
+		cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp 2>/dev/null | sed -e 's,[[ 	]]*$,,'`
 		case "$cf_result" in
 		.*k)
-			cf_result=`${MAKE-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null`
+			cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null`
 			case "$cf_result" in
 			.*CC=*)	cf_cv_makeflags=
 				;;
@@ -2927,16 +3426,20 @@
 AC_SUBST(cf_cv_makeflags)
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_MAKE_TAGS version: 2 updated: 2000/10/04 09:18:40
+dnl CF_MAKE_TAGS version: 6 updated: 2010/10/23 15:52:32
 dnl ------------
 dnl Generate tags/TAGS targets for makefiles.  Do not generate TAGS if we have
 dnl a monocase filesystem.
 AC_DEFUN([CF_MAKE_TAGS],[
 AC_REQUIRE([CF_MIXEDCASE_FILENAMES])
-AC_CHECK_PROG(MAKE_LOWER_TAGS, ctags, yes, no)
+
+AC_CHECK_PROGS(CTAGS, exctags ctags)
+AC_CHECK_PROGS(ETAGS, exetags etags)
+
+AC_CHECK_PROG(MAKE_LOWER_TAGS, ${CTAGS:-ctags}, yes, no)
 
 if test "$cf_cv_mixedcase" = yes ; then
-	AC_CHECK_PROG(MAKE_UPPER_TAGS, etags, yes, no)
+	AC_CHECK_PROG(MAKE_UPPER_TAGS, ${ETAGS:-etags}, yes, no)
 else
 	MAKE_UPPER_TAGS=no
 fi
@@ -2946,17 +3449,21 @@
 else
 	MAKE_UPPER_TAGS="#"
 fi
-AC_SUBST(MAKE_UPPER_TAGS)
 
 if test "$MAKE_LOWER_TAGS" = yes ; then
 	MAKE_LOWER_TAGS=
 else
 	MAKE_LOWER_TAGS="#"
 fi
+
+AC_SUBST(CTAGS)
+AC_SUBST(ETAGS)
+
+AC_SUBST(MAKE_UPPER_TAGS)
 AC_SUBST(MAKE_LOWER_TAGS)
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_MANPAGE_FORMAT version: 7 updated: 2003/12/20 19:30:34
+dnl CF_MANPAGE_FORMAT version: 9 updated: 2010/10/23 16:10:30
 dnl -----------------
 dnl Option to allow user to override automatic configuration of manpage format.
 dnl There are several special cases:
@@ -2998,7 +3505,7 @@
   cf_catonly=yes
   cf_example=date
 
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}${PATHSEP}"
+  IFS="${IFS:- 	}"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
   for cf_dir in $MANPATH; do
     test -z "$cf_dir" && cf_dir=/usr/man
     for cf_name in $cf_dir/man*/$cf_example.[[01]]* $cf_dir/cat*/$cf_example.[[01]]* $cf_dir/man*/$cf_example $cf_dir/cat*/$cf_example
@@ -3112,7 +3619,7 @@
 AC_SUBST(MANPAGE_RENAMES)
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_MANPAGE_SYMLINKS version: 4 updated: 2003/12/13 18:01:58
+dnl CF_MANPAGE_SYMLINKS version: 5 updated: 2010/07/24 17:12:40
 dnl -------------------
 dnl Some people expect each tool to make all aliases for manpages in the
 dnl man-directory.  This accommodates the older, less-capable implementations
@@ -3128,11 +3635,14 @@
 
 AC_MSG_RESULT($MANPAGE_ALIASES)
 
-if test "$LN_S" = "ln -s"; then
+case "x$LN_S" in #(vi
+xln*) #(vi
 	cf_use_symlinks=yes
-else
+	;;
+*)
 	cf_use_symlinks=no
-fi
+	;;
+esac
 
 MANPAGE_SYMLINKS=no
 if test "$MANPAGE_ALIASES" = yes ; then
@@ -3171,7 +3681,7 @@
 AC_MSG_RESULT($MANPAGE_TBL)
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_MAN_PAGES version: 35 updated: 2007/03/31 11:47:29
+dnl CF_MAN_PAGES version: 39 updated: 2010/10/23 15:44:18
 dnl ------------
 dnl Try to determine if the man-pages on the system are compressed, and if
 dnl so, what format is used.  Use this information to construct a script that
@@ -3214,7 +3724,7 @@
 	cf_so_strip="Z"
 	cf_compress=compress
   ;;
-*gzip*) #(vi
+*gzip*)
 	cf_so_strip="gz"
 	cf_compress=gzip
   ;;
@@ -3237,14 +3747,12 @@
 NCURSES_OSPEED="$NCURSES_OSPEED"
 TERMINFO="$TERMINFO"
 
-MKDIRS="sh `cd $srcdir && pwd`/mkdirs.sh"
-
 INSTALL="$INSTALL"
 INSTALL_DATA="$INSTALL_DATA"
 
 transform="$program_transform_name"
 
-TMP=\${TMPDIR-/tmp}/man\$\$
+TMP=\${TMPDIR:=/tmp}/man\$\$
 trap "rm -f \$TMP" 0 1 2 5 15
 
 form=\[$]1
@@ -3282,7 +3790,7 @@
 	section=\`expr "\$i" : '.*\\.\\([[0-9]]\\)[[xm]]*'\`;
 	if test \$verb = installing ; then
 	if test ! -d \$cf_subdir\${section} ; then
-		\$MKDIRS \$cf_subdir\$section
+		mkdir -p \$cf_subdir\$section
 	fi
 	fi
 
@@ -3302,7 +3810,7 @@
 		cf_NAME=`echo "$cf_name" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
 		cf_name=`echo $cf_name|sed "$program_transform_name"`
 cat >>$cf_edit_man <<-CF_EOF
-		s,@$cf_NAME@,$cf_name,
+		s,@$cf_NAME@,$cf_name,g
 CF_EOF
 	done
 	])
@@ -3431,8 +3939,21 @@
 							fi
 						fi
 						echo .. \$verb alias \$cf_alias\${suffix}
+CF_EOF
+case "x$LN_S" in #(vi
+*-f) #(vi
+cat >>$cf_edit_man <<CF_EOF
+						$LN_S \$cf_target \$cf_alias\${suffix}
+CF_EOF
+	;;
+*)
+cat >>$cf_edit_man <<CF_EOF
 						rm -f \$cf_alias\${suffix}
 						$LN_S \$cf_target \$cf_alias\${suffix}
+CF_EOF
+	;;
+esac
+cat >>$cf_edit_man <<CF_EOF
 					elif test "\$cf_target" != "\$cf_alias\${suffix}" ; then
 						echo ".so \$cf_source" >\$TMP
 CF_EOF
@@ -3491,7 +4012,7 @@
 
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_MATH_LIB version: 5 updated: 2000/05/28 01:39:10
+dnl CF_MATH_LIB version: 8 updated: 2010/05/29 16:31:02
 dnl -----------
 dnl Checks for libraries.  At least one UNIX system, Apple Macintosh
 dnl Rhapsody 5.5, does not have -lm.  We cannot use the simpler
@@ -3504,13 +4025,13 @@
 	#include <stdio.h>
 	#include <math.h>
 	],
-	[double x = rand(); printf("result = %g\n", ]ifelse($2,,sin(x),$2)[)],
+	[double x = rand(); printf("result = %g\n", ]ifelse([$2],,sin(x),$2)[)],
 	[cf_cv_need_libm=no],
 	[cf_cv_need_libm=yes])])
 if test "$cf_cv_need_libm" = yes
 then
 ifelse($1,,[
-	LIBS="$LIBS -lm"
+	CF_ADD_LIB(m)
 ],[$1=-lm])
 fi
 ])
@@ -3545,13 +4066,13 @@
 test "$cf_cv_mixedcase" = yes && AC_DEFINE(MIXEDCASE_FILENAMES)
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_MKSTEMP version: 5 updated: 2006/12/16 12:33:30
+dnl CF_MKSTEMP version: 7 updated: 2010/08/14 18:25:37
 dnl ----------
 dnl Check for a working mkstemp.  This creates two files, checks that they are
 dnl successfully created and distinct (AmigaOS apparently fails on the last).
 AC_DEFUN([CF_MKSTEMP],[
 AC_CACHE_CHECK(for working mkstemp, cf_cv_func_mkstemp,[
-rm -f conftest*
+rm -rf conftest*
 AC_TRY_RUN([
 #include <sys/types.h>
 #include <stdlib.h>
@@ -3590,17 +4111,17 @@
 ],[AC_CHECK_FUNC(mkstemp)
 ])
 ])
-if test "$cf_cv_func_mkstemp" = yes ; then
+if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then
 	AC_DEFINE(HAVE_MKSTEMP)
 fi
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_MSG_LOG version: 4 updated: 2007/07/29 09:55:12
+dnl CF_MSG_LOG version: 5 updated: 2010/10/23 15:52:32
 dnl ----------
 dnl Write a debug message to config.log, along with the line number in the
 dnl configure script.
 AC_DEFUN([CF_MSG_LOG],[
-echo "${as_me-configure}:__oline__: testing $* ..." 1>&AC_FD_CC
+echo "${as_me:-configure}:__oline__: testing $* ..." 1>&AC_FD_CC
 ])dnl
 dnl ---------------------------------------------------------------------------
 dnl CF_NCURSES_ABI_6 version: 1 updated: 2005/09/17 18:42:49
@@ -3687,20 +4208,20 @@
 	esac
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_PATHSEP version: 3 updated: 2001/01/12 01:23:53
+dnl CF_PATHSEP version: 5 updated: 2010/05/26 05:38:42
 dnl ----------
 dnl Provide a value for the $PATH and similar separator
 AC_DEFUN([CF_PATHSEP],
 [
 	case $cf_cv_system_name in
-	os2*)	PATHSEP=';'  ;;
-	*)	PATHSEP=':'  ;;
+	os2*)	PATH_SEPARATOR=';'  ;;
+	*)	PATH_SEPARATOR=':'  ;;
 	esac
-ifelse($1,,,[$1=$PATHSEP])
-	AC_SUBST(PATHSEP)
+ifelse([$1],,,[$1=$PATH_SEPARATOR])
+	AC_SUBST(PATH_SEPARATOR)
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_PATH_SYNTAX version: 12 updated: 2008/03/23 14:45:59
+dnl CF_PATH_SYNTAX version: 13 updated: 2010/05/26 05:38:42
 dnl --------------
 dnl Check the argument to see that it looks like a pathname.  Rewrite it if it
 dnl begins with one of the prefix/exec_prefix variables, and then again if the
@@ -3732,12 +4253,44 @@
   $1=`echo [$]$1 | sed -e s%NONE%$cf_path_syntax%`
   ;;
 *)
-  ifelse($2,,[AC_MSG_ERROR([expected a pathname, not \"[$]$1\"])],$2)
+  ifelse([$2],,[AC_MSG_ERROR([expected a pathname, not \"[$]$1\"])],$2)
   ;;
 esac
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_POSIX_C_SOURCE version: 6 updated: 2005/07/14 20:25:10
+dnl CF_PKG_CONFIG version: 3 updated: 2009/01/25 10:55:09
+dnl -------------
+dnl Check for the package-config program, unless disabled by command-line.
+AC_DEFUN([CF_PKG_CONFIG],
+[
+AC_MSG_CHECKING(if you want to use pkg-config)
+AC_ARG_WITH(pkg-config,
+	[  --with-pkg-config{=path} enable/disable use of pkg-config],
+	[cf_pkg_config=$withval],
+	[cf_pkg_config=yes])
+AC_MSG_RESULT($cf_pkg_config)
+
+case $cf_pkg_config in #(vi
+no) #(vi
+	PKG_CONFIG=none
+	;;
+yes) #(vi
+	AC_PATH_PROG(PKG_CONFIG, pkg-config, none)
+	;;
+*)
+	PKG_CONFIG=$withval
+	;;
+esac
+
+test -z "$PKG_CONFIG" && PKG_CONFIG=none
+if test "$PKG_CONFIG" != none ; then
+	CF_PATH_SYNTAX(PKG_CONFIG)
+fi
+
+AC_SUBST(PKG_CONFIG)
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_POSIX_C_SOURCE version: 8 updated: 2010/05/26 05:38:42
 dnl -----------------
 dnl Define _POSIX_C_SOURCE to the given level, and _POSIX_SOURCE if needed.
 dnl
@@ -3753,7 +4306,7 @@
 dnl	$1 is the nominal value for _POSIX_C_SOURCE
 AC_DEFUN([CF_POSIX_C_SOURCE],
 [
-cf_POSIX_C_SOURCE=ifelse($1,,199506L,$1)
+cf_POSIX_C_SOURCE=ifelse([$1],,199506L,[$1])
 
 cf_save_CFLAGS="$CFLAGS"
 cf_save_CPPFLAGS="$CPPFLAGS"
@@ -3805,17 +4358,12 @@
 if test "$cf_cv_posix_c_source" != no ; then
 	CFLAGS="$cf_trim_CFLAGS"
 	CPPFLAGS="$cf_trim_CPPFLAGS"
-	if test "$cf_cv_cc_u_d_options" = yes ; then
-		cf_temp_posix_c_source=`echo "$cf_cv_posix_c_source" | \
-				sed -e 's/-D/-U/g' -e 's/=[[^ 	]]*//g'`
-		CPPFLAGS="$CPPFLAGS $cf_temp_posix_c_source"
-	fi
-	CPPFLAGS="$CPPFLAGS $cf_cv_posix_c_source"
+	CF_ADD_CFLAGS($cf_cv_posix_c_source)
 fi
 
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_PREDEFINE version: 1 updated: 2003/07/26 17:53:56
+dnl CF_PREDEFINE version: 2 updated: 2010/05/26 16:44:57
 dnl ------------
 dnl Add definitions to CPPFLAGS to ensure they're predefined for all compiles.
 dnl
@@ -3832,7 +4380,7 @@
 AC_MSG_RESULT($cf_result)
 
 if test "$cf_result" = yes ; then
-	CPPFLAGS="$CPPFLAGS ifelse($2,,-D$1,[-D$1=$2])"
+	CPPFLAGS="$CPPFLAGS ifelse([$2],,-D$1,[-D$1=$2])"
 elif test "x$2" != "x" ; then
 	AC_MSG_CHECKING(checking for compatible value versus $2)
 	AC_TRY_COMPILE([#include <sys/types.h>
@@ -3872,6 +4420,13 @@
 
 ])dnl
 dnl ---------------------------------------------------------------------------
+dnl CF_PROG_AR version: 1 updated: 2009/01/01 20:15:22
+dnl ----------
+dnl Check for archiver "ar".
+AC_DEFUN([CF_PROG_AR],[
+AC_CHECK_TOOL(AR, ar, ar)
+])
+dnl ---------------------------------------------------------------------------
 dnl CF_PROG_AWK version: 1 updated: 2006/09/16 11:40:59
 dnl -----------
 dnl Check for awk, ensure that the check found something.
@@ -3881,7 +4436,7 @@
 test -z "$AWK" && AC_MSG_ERROR(No awk program found)
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_PROG_CC_C_O version: 2 updated: 2006/12/16 15:55:46
+dnl CF_PROG_CC_C_O version: 3 updated: 2010/08/14 18:25:37
 dnl --------------
 dnl Analogous to AC_PROG_CC_C_O, but more useful: tests only $CC, ensures that
 dnl the output file can be renamed, and allows for a shell variable that can
@@ -3911,7 +4466,7 @@
 else
   eval cf_cv_prog_$1_c_o=no
 fi
-rm -f conftest*
+rm -rf conftest*
 ])dnl
 if test $cf_cv_prog_$1_c_o = yes; then
   AC_MSG_RESULT([yes])
@@ -3985,6 +4540,39 @@
 test -n "$PROG_EXT" && AC_DEFINE_UNQUOTED(PROG_EXT,"$PROG_EXT")
 ])dnl
 dnl ---------------------------------------------------------------------------
+dnl CF_PROG_GNAT version: 1 updated: 2010/06/19 15:22:18
+dnl ------------
+dnl Check for gnatmake, ensure that it is complete.
+AC_DEFUN([CF_PROG_GNAT],[
+cf_ada_make=gnatmake
+AC_CHECK_PROG(gnat_exists, $cf_ada_make, yes, no)
+if test "$ac_cv_prog_gnat_exists" = no; then
+   cf_ada_make=
+else
+   CF_GNAT_VERSION
+   AC_CHECK_PROG(M4_exists, m4, yes, no)
+   if test "$ac_cv_prog_M4_exists" = no; then
+      cf_cv_prog_gnat_correct=no
+      echo Ada95 binding required program m4 not found. Ada95 binding disabled.
+   fi
+   if test "$cf_cv_prog_gnat_correct" = yes; then
+      AC_MSG_CHECKING(if GNAT works)
+      CF_GNAT_TRY_RUN([procedure conftest;],
+[with Text_IO;
+with GNAT.OS_Lib;
+procedure conftest is
+begin
+   Text_IO.Put ("Hello World");
+   Text_IO.New_Line;
+   GNAT.OS_Lib.OS_Exit (0);
+end conftest;],[cf_cv_prog_gnat_correct=yes],[cf_cv_prog_gnat_correct=no])
+      AC_MSG_RESULT($cf_cv_prog_gnat_correct)
+   fi
+fi
+
+AC_SUBST(cf_ada_make)
+])dnl
+dnl ---------------------------------------------------------------------------
 dnl CF_PROG_INSTALL version: 5 updated: 2002/12/21 22:46:07
 dnl ---------------
 dnl Force $INSTALL to be an absolute-path.  Otherwise, edit_man.sh and the
@@ -4003,7 +4591,7 @@
 esac
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_PROG_LDCONFIG version: 1 updated: 2003/09/20 17:07:55
+dnl CF_PROG_LDCONFIG version: 2 updated: 2008/12/13 14:08:40
 dnl ----------------
 dnl Check for ldconfig, needed to fixup shared libraries that would be built
 dnl and then used in the install.
@@ -4012,7 +4600,7 @@
   LDCONFIG=:
 else
 case "$cf_cv_system_name" in #(vi
-freebsd*) #(vi
+dragonfly*|freebsd*) #(vi
   test -z "$LDCONFIG" && LDCONFIG="/sbin/ldconfig -R"
   ;;
 *) LDPATH=$PATH:/sbin:/usr/sbin
@@ -4023,49 +4611,117 @@
 AC_SUBST(LDCONFIG)
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_PROG_LINT version: 1 updated: 2006/09/16 11:40:59
+dnl CF_PROG_LINT version: 2 updated: 2009/08/12 04:43:14
 dnl ------------
 AC_DEFUN([CF_PROG_LINT],
 [
-AC_CHECK_PROGS(LINT, tdlint lint alint)
+AC_CHECK_PROGS(LINT, tdlint lint alint splint lclint)
 AC_SUBST(LINT_OPTS)
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_REGEX version: 3 updated: 1997/11/01 14:26:01
+dnl CF_PROG_LN_S version: 2 updated: 2010/08/14 18:25:37
+dnl ------------
+dnl Combine checks for "ln -s" and "ln -sf", updating $LN_S to include "-f"
+dnl option if it is supported.
+AC_DEFUN([CF_PROG_LN_S],[
+AC_PROG_LN_S
+AC_MSG_CHECKING(if $LN_S -f options work)
+
+rm -f conf$$.src conf$$dst
+echo >conf$$.dst
+echo first >conf$$.src
+if $LN_S -f conf$$.src conf$$.dst 2>/dev/null; then
+	cf_prog_ln_sf=yes
+else
+	cf_prog_ln_sf=no
+fi
+rm -f conf$$.dst conf$$src
+AC_MSG_RESULT($cf_prog_ln_sf)
+
+test "$cf_prog_ln_sf" = yes && LN_S="$LN_S -f"
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_REGEX version: 8 updated: 2010/08/07 14:09:44
 dnl --------
 dnl Attempt to determine if we've got one of the flavors of regular-expression
 dnl code that we can support.
 AC_DEFUN([CF_REGEX],
 [
-AC_MSG_CHECKING([for regular-expression headers])
-AC_CACHE_VAL(cf_cv_regex,[
-AC_TRY_LINK([#include <sys/types.h>
-#include <regex.h>],[
-	regex_t *p;
-	int x = regcomp(p, "", 0);
-	int y = regexec(p, "", 0, 0, 0);
-	regfree(p);
-	],[cf_cv_regex="regex.h"],[
-	AC_TRY_LINK([#include <regexp.h>],[
-		char *p = compile("", "", "", 0);
-		int x = step("", "");
-	],[cf_cv_regex="regexp.h"],[
-		cf_save_LIBS="$LIBS"
-		LIBS="-lgen $LIBS"
-		AC_TRY_LINK([#include <regexpr.h>],[
-			char *p = compile("", "", "");
+
+cf_regex_func=no
+
+cf_regex_libs="regex re"
+case $host_os in #(vi
+mingw*)
+	cf_regex_libs="regex.dll $cf_regex_libs"
+	;;
+esac
+
+AC_CHECK_FUNC(regcomp,[cf_regex_func=regcomp],[
+	for cf_regex_lib in $cf_regex_libs
+	do
+		AC_CHECK_LIB($cf_regex_lib,regcomp,[
+				CF_ADD_LIB($cf_regex_lib)
+				cf_regex_func=regcomp
+				break])
+	done
+])
+
+if test "$cf_regex_func" = no ; then
+	AC_CHECK_FUNC(compile,[cf_regex_func=compile],[
+		AC_CHECK_LIB(gen,compile,[
+				CF_ADD_LIB(gen)
+				cf_regex_func=compile])])
+fi
+
+if test "$cf_regex_func" = no ; then
+	AC_MSG_WARN(cannot find regular expression library)
+fi
+
+AC_CACHE_CHECK(for regular-expression headers,cf_cv_regex_hdrs,[
+
+cf_cv_regex_hdrs=no
+case $cf_regex_func in #(vi
+compile) #(vi
+	for cf_regex_hdr in regexp.h regexpr.h
+	do
+		AC_TRY_LINK([#include <$cf_regex_hdr>],[
+			char *p = compile("", "", "", 0);
 			int x = step("", "");
-		],[cf_cv_regex="regexpr.h"],[LIBS="$cf_save_LIBS"])])])
+		],[
+			cf_cv_regex_hdrs=$cf_regex_hdr
+			break
+		])
+	done
+	;;
+*)
+	for cf_regex_hdr in regex.h
+	do
+		AC_TRY_LINK([#include <sys/types.h>
+#include <$cf_regex_hdr>],[
+			regex_t *p;
+			int x = regcomp(p, "", 0);
+			int y = regexec(p, "", 0, 0, 0);
+			regfree(p);
+		],[
+			cf_cv_regex_hdrs=$cf_regex_hdr
+			break
+		])
+	done
+	;;
+esac
+
 ])
-AC_MSG_RESULT($cf_cv_regex)
-case $cf_cv_regex in
-	regex.h)   AC_DEFINE(HAVE_REGEX_H_FUNCS) ;;
-	regexp.h)  AC_DEFINE(HAVE_REGEXP_H_FUNCS) ;;
-	regexpr.h) AC_DEFINE(HAVE_REGEXPR_H_FUNCS) ;;
+
+case $cf_cv_regex_hdrs in #(vi
+    no)	       AC_MSG_WARN(no regular expression header found) ;; #(vi
+    regex.h)   AC_DEFINE(HAVE_REGEX_H_FUNCS) ;; #(vi
+    regexp.h)  AC_DEFINE(HAVE_REGEXP_H_FUNCS) ;; #(vi
+    regexpr.h) AC_DEFINE(HAVE_REGEXPR_H_FUNCS) ;;
 esac
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_REMOVE_DEFINE version: 2 updated: 2005/07/09 16:12:18
+dnl CF_REMOVE_DEFINE version: 3 updated: 2010/01/09 11:05:50
 dnl ----------------
 dnl Remove all -U and -D options that refer to the given symbol from a list
 dnl of C compiler options.  This works around the problem that not all
@@ -4077,10 +4733,9 @@
 dnl $3 = symbol to remove
 define([CF_REMOVE_DEFINE],
 [
-# remove $3 symbol from $2
 $1=`echo "$2" | \
-	sed	-e 's/-[[UD]]$3\(=[[^ 	]]*\)\?[[ 	]]/ /g' \
-		-e 's/-[[UD]]$3\(=[[^ 	]]*\)\?[$]//g'`
+	sed	-e 's/-[[UD]]'"$3"'\(=[[^ 	]]*\)\?[[ 	]]/ /g' \
+		-e 's/-[[UD]]'"$3"'\(=[[^ 	]]*\)\?[$]//g'`
 ])dnl
 dnl ---------------------------------------------------------------------------
 dnl CF_REMOVE_LIB version: 1 updated: 2007/02/17 14:11:52
@@ -4096,58 +4751,95 @@
 $1=`echo "$2" | sed -e 's/-l$3[[ 	]]//g' -e 's/-l$3[$]//'`
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_RPATH_HACK version: 4 updated: 2008/09/13 12:53:26
+dnl CF_RPATH_HACK version: 8 updated: 2010/04/17 15:38:58
 dnl -------------
 AC_DEFUN([CF_RPATH_HACK],
 [
-AC_REQUIRE([CF_SHARED_OPTS])
+AC_REQUIRE([CF_LD_RPATH_OPT])
 AC_MSG_CHECKING(for updated LDFLAGS)
-if test -n "$LDFLAGS" ; then
-AC_MSG_RESULT(maybe)
-CF_VERBOSE(...checking LDFLAGS $LDFLAGS)
-CF_VERBOSE(...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS)
-case "$EXTRA_LDFLAGS" in #(vi
--Wl,-rpath,*) #(vi
-	cf_rpath_hack="-Wl,-rpath,"
-	;;
--R\ *)
-	cf_rpath_hack="-R "
-	;;
--R*)
-	cf_rpath_hack="-R"
-	;;
-*)
-	cf_rpath_hack=
-	;;
-esac
-if test -n "$cf_rpath_hack" ; then
-	cf_rpath_dst=
-	for cf_rpath_src in $LDFLAGS
-	do
-		CF_VERBOSE(Filtering $cf_rpath_src)
-		case $cf_rpath_src in #(vi
-		-L*) #(vi
-			if test "$cf_rpath_hack" = "-R " ; then
-				cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e 's%-L%-R %'`
-			else
-				cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e s%-L%$cf_rpath_hack%`
-			fi
-			CF_VERBOSE(...Filter $cf_rpath_tmp)
-			EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
-			;;
-		esac
-		cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
-	done
-	LDFLAGS=$cf_rpath_dst
-	CF_VERBOSE(...checked LDFLAGS $LDFLAGS)
+if test -n "$LD_RPATH_OPT" ; then
+	AC_MSG_RESULT(maybe)
+
+	AC_CHECK_PROGS(cf_ldd_prog,ldd,no)
+	cf_rpath_list="/usr/lib /lib"
+	if test "$cf_ldd_prog" != no
+	then
+AC_TRY_LINK([#include <stdio.h>],
+		[printf("Hello");],
+		[cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[[ 	]]/%/%' -e 's%/[[^/]][[^/]]*$%%' |sort -u`])
+	fi
+
+	CF_VERBOSE(...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS)
+
+	CF_RPATH_HACK_2(LDFLAGS)
+	CF_RPATH_HACK_2(LIBS)
+
 	CF_VERBOSE(...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS)
 fi
-else
-AC_MSG_RESULT(no)
-fi
+AC_SUBST(EXTRA_LDFLAGS)
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_RPATH_HACK_2 version: 6 updated: 2010/04/17 16:31:24
+dnl ---------------
+dnl Do one set of substitutions for CF_RPATH_HACK, adding an rpath option to
+dnl EXTRA_LDFLAGS for each -L option found.
+dnl
+dnl $cf_rpath_list contains a list of directories to ignore.
+dnl
+dnl $1 = variable name to update.  The LDFLAGS variable should be the only one,
+dnl      but LIBS often has misplaced -L options.
+AC_DEFUN([CF_RPATH_HACK_2],
+[
+CF_VERBOSE(...checking $1 [$]$1)
+
+cf_rpath_dst=
+for cf_rpath_src in [$]$1
+do
+	case $cf_rpath_src in #(vi
+	-L*) #(vi
+
+		# check if this refers to a directory which we will ignore
+		cf_rpath_skip=no
+		if test -n "$cf_rpath_list"
+		then
+			for cf_rpath_item in $cf_rpath_list
+			do
+				if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
+				then
+					cf_rpath_skip=yes
+					break
+				fi
+			done
+		fi
+
+		if test "$cf_rpath_skip" = no
+		then
+			# transform the option
+			if test "$LD_RPATH_OPT" = "-R " ; then
+				cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
+			else
+				cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
+			fi
+
+			# if we have not already added this, add it now
+			cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
+			if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
+			then
+				CF_VERBOSE(...Filter $cf_rpath_src ->$cf_rpath_tmp)
+				EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
+			fi
+		fi
+		;;
+	esac
+	cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
+done
+$1=$cf_rpath_dst
+
+CF_VERBOSE(...checked $1 [$]$1)
+AC_SUBST(EXTRA_LDFLAGS)
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_SHARED_OPTS version: 53 updated: 2008/10/25 18:14:20
+dnl CF_SHARED_OPTS version: 64 updated: 2010/06/05 16:51:16
 dnl --------------
 dnl --------------
 dnl Attempt to determine the appropriate CC/LD options for creating a shared
@@ -4174,12 +4866,15 @@
 AC_DEFUN([CF_SHARED_OPTS],
 [
 	AC_REQUIRE([CF_SUBST_NCURSES_VERSION])
+	AC_REQUIRE([CF_LD_RPATH_OPT])
 	LOCAL_LDFLAGS=
 	LOCAL_LDFLAGS2=
 	LD_SHARED_OPTS=
 	INSTALL_LIB="-m 644"
 
 	cf_cv_do_symlinks=no
+	cf_ld_rpath_opt=
+	test "$cf_cv_enable_rpath" = yes && cf_ld_rpath_opt="$LD_RPATH_OPT"
 
 	AC_MSG_CHECKING(if release/abi version should be used for shared libs)
 	AC_ARG_WITH(shlib-version,
@@ -4218,11 +4913,17 @@
 
 	cf_cv_shlib_version_infix=no
 
-	case $cf_cv_system_name in
-	beos*)
+	case $cf_cv_system_name in #(vi
+	aix[[56]]*) #(vi
+		if test "$GCC" = yes; then
+			CC_SHARED_OPTS=
+			MK_SHARED_LIB='$(CC) -shared'
+		fi
+		;;
+	beos*) #(vi
 		MK_SHARED_LIB='${CC} ${CFLAGS} -o $[@] -Xlinker -soname=`basename $[@]` -nostart -e 0'
 		;;
-	cygwin*)
+	cygwin*) #(vi
 		CC_SHARED_OPTS=
 		MK_SHARED_LIB='sh ../mk_shared_lib.sh [$]@ [$]{CC} [$]{CFLAGS}'
 		cf_cv_shlib_version=cygdll
@@ -4239,9 +4940,9 @@
 EOF
 		exec \[$]* -shared -Wl,--out-implib=../lib/\[$]{IMPORT_LIB} -Wl,--export-all-symbols -o ../lib/\[$]{SHARED_LIB}
 CF_EOF
-		chmod +x mk_shared_lib.sh 
+		chmod +x mk_shared_lib.sh
 		;;
-	darwin*)
+	darwin*) #(vi
 		EXTRA_CFLAGS="-no-cpp-precomp"
 		CC_SHARED_OPTS="-dynamic"
 		MK_SHARED_LIB='${CC} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $[@]` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $[@]'
@@ -4256,7 +4957,7 @@
 			LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
 		fi
 		;;
-	hpux*)
+	hpux*) #(vi
 		# (tested with gcc 2.7.2 -- I don't have c89)
 		if test "$GCC" = yes; then
 			LD_SHARED_OPTS='-Xlinker +b -Xlinker ${libdir}'
@@ -4269,15 +4970,9 @@
 		# readonly to exploit a quirk in the memory manager.
 		INSTALL_LIB="-m 555"
 		;;
-	irix*)
-		if test "$cf_cv_ld_rpath" = yes ; then
-			if test "$GCC" = yes; then
-				cf_ld_rpath_opt="-Wl,-rpath,"
-				EXTRA_LDFLAGS="-Wl,-rpath,\${libdir} $EXTRA_LDFLAGS"
-			else
-				cf_ld_rpath_opt="-rpath "
-				EXTRA_LDFLAGS="-rpath \${libdir} $EXTRA_LDFLAGS"
-			fi
+	irix*) #(vi
+		if test "$cf_cv_enable_rpath" = yes ; then
+			EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS"
 		fi
 		# tested with IRIX 5.2 and 'cc'.
 		if test "$GCC" != yes; then
@@ -4288,54 +4983,50 @@
 		fi
 		cf_cv_rm_so_locs=yes
 		;;
-	linux*|gnu*|k*bsd*-gnu)
+	linux*|gnu*|k*bsd*-gnu) #(vi
 		if test "$DFT_LWR_MODEL" = "shared" ; then
-			LOCAL_LDFLAGS="-Wl,-rpath,\$(LOCAL_LIBDIR)"
+			LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
 			LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
 		fi
-		if test "$cf_cv_ld_rpath" = yes ; then
-			cf_ld_rpath_opt="-Wl,-rpath,"
-			EXTRA_LDFLAGS="-Wl,-rpath,\${libdir} $EXTRA_LDFLAGS"
+		if test "$cf_cv_enable_rpath" = yes ; then
+			EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS"
 		fi
 		CF_SHARED_SONAME
 		MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $[@]'
 		;;
-	openbsd[[2-9]].*)
+	openbsd[[2-9]].*) #(vi
 		if test "$DFT_LWR_MODEL" = "shared" ; then
-			LOCAL_LDFLAGS="-Wl,-rpath,\$(LOCAL_LIBDIR)"
+			LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
 			LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
 		fi
-		if test "$cf_cv_ld_rpath" = yes ; then
-			cf_ld_rpath_opt="-Wl,-rpath,"
-			EXTRA_LDFLAGS="-Wl,-rpath,\${libdir} $EXTRA_LDFLAGS"
+		if test "$cf_cv_enable_rpath" = yes ; then
+			EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS"
 		fi
 		CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
 		CF_SHARED_SONAME
-		MK_SHARED_LIB='${CC} ${CFLAGS} -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $[@]'
+		MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $[@]'
 		;;
-	nto-qnx*|openbsd*|freebsd[[12]].*)
+	nto-qnx*|openbsd*|freebsd[[12]].*) #(vi
 		CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
 		MK_SHARED_LIB='${LD} -Bshareable -o $[@]'
 		test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
 		;;
-	freebsd*)
+	freebsd*) #(vi
 		CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
-		if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_ld_rpath" = yes ; then
-			LOCAL_LDFLAGS="-rpath \$(LOCAL_LIBDIR)"
-			LOCAL_LDFLAGS2="-rpath \${libdir} $LOCAL_LDFLAGS"
-			cf_ld_rpath_opt="-rpath "
-			EXTRA_LDFLAGS="-rpath \${libdir} $EXTRA_LDFLAGS"
+		if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
+			LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
+			LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${libdir} $LOCAL_LDFLAGS"
+			EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS"
 		fi
 		CF_SHARED_SONAME
-		MK_SHARED_LIB='${LD} -Bshareable -soname=`basename $[@]` -o $[@]'
+		MK_SHARED_LIB='${LD} -shared -Bshareable -soname=`basename $[@]` -o $[@]'
 		;;
-	netbsd*)
+	netbsd*) #(vi
 		CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
-		test "$cf_cv_ld_rpath" = yes && cf_ld_rpath_opt="-Wl,-rpath,"
-		if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_ld_rpath" = yes ; then
-			LOCAL_LDFLAGS="-Wl,-rpath,\$(LOCAL_LIBDIR)"
+		if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
+			LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
 			LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
-			EXTRA_LDFLAGS="-Wl,-rpath,\${libdir} $EXTRA_LDFLAGS"
+			EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS"
 			if test "$cf_cv_shlib_version" = auto; then
 			if test -f /usr/libexec/ld.elf_so; then
 				cf_cv_shlib_version=abi
@@ -4346,37 +5037,33 @@
 			CF_SHARED_SONAME
 			MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $[@]'
 		else
-			MK_SHARED_LIB='${LD} -Bshareable -o $[@]'
+			MK_SHARED_LIB='${LD} -shared -Bshareable -o $[@]'
 		fi
 		;;
-	osf*|mls+*)
+	osf*|mls+*) #(vi
 		# tested with OSF/1 V3.2 and 'cc'
 		# tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't
 		# link with shared libs).
 		MK_SHARED_LIB='${LD} -set_version ${REL_VERSION}:${ABI_VERSION} -expect_unresolved "*" -shared -soname `basename $[@]`'
-		case $host_os in
+		case $host_os in #(vi
 		osf4*)
 			MK_SHARED_LIB="${MK_SHARED_LIB} -msym"
 			;;
 		esac
 		MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $[@]'
 		if test "$DFT_LWR_MODEL" = "shared" ; then
-			LOCAL_LDFLAGS="-Wl,-rpath,\$(LOCAL_LIBDIR)"
+			LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
 			LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
 		fi
-		if test "$cf_cv_ld_rpath" = yes ; then
-			cf_ld_rpath_opt="-rpath"
-			# EXTRA_LDFLAGS="$LOCAL_LDFLAGS $EXTRA_LDFLAGS"
-		fi
 		cf_cv_rm_so_locs=yes
 		;;
-	sco3.2v5*)  # (also uw2* and UW7) hops 13-Apr-98
+	sco3.2v5*)  # (also uw2* and UW7: hops 13-Apr-98
 		# tested with osr5.0.5
 		if test "$GCC" != yes; then
 			CC_SHARED_OPTS='-belf -KPIC'
 		fi
 		MK_SHARED_LIB='${LD} -dy -G -h `basename $[@] .${REL_VERSION}`.${ABI_VERSION} -o [$]@'
-		if test "$cf_cv_ld_rpath" = yes ; then
+		if test "$cf_cv_enable_rpath" = yes ; then
 			# only way is to set LD_RUN_PATH but no switch for it
 			RUN_PATH=$libdir
 		fi
@@ -4384,7 +5071,7 @@
 		LINK_PROGS='LD_RUN_PATH=${libdir}'
 		LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib'
 		;;
-	sunos4*)
+	sunos4*) #(vi
 		# tested with SunOS 4.1.1 and gcc 2.7.0
 		if test "$GCC" != yes; then
 			CC_SHARED_OPTS='-KPIC'
@@ -4392,26 +5079,32 @@
 		MK_SHARED_LIB='${LD} -assert pure-text -o $[@]'
 		test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
 		;;
-	solaris2*)
+	solaris2*) #(vi
 		# tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2
 		# tested with SunOS 5.10 (solaris 10) and gcc 3.4.3
 		if test "$DFT_LWR_MODEL" = "shared" ; then
 			LOCAL_LDFLAGS="-R \$(LOCAL_LIBDIR):\${libdir}"
 			LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
 		fi
-		if test "$cf_cv_ld_rpath" = yes ; then
-			cf_ld_rpath_opt="-R"
-			EXTRA_LDFLAGS="$LOCAL_LDFLAGS $EXTRA_LDFLAGS"
+		if test "$cf_cv_enable_rpath" = yes ; then
+			EXTRA_LDFLAGS="-R \${libdir} $EXTRA_LDFLAGS"
 		fi
 		CF_SHARED_SONAME
 		if test "$GCC" != yes; then
-			CC_SHARED_OPTS='-xcode=pic32'
+			cf_save_CFLAGS="$CFLAGS"
+			for cf_shared_opts in -xcode=pic32 -xcode=pic13 -KPIC -Kpic -O
+			do
+				CFLAGS="$cf_shared_opts $cf_save_CFLAGS"
+				AC_TRY_COMPILE([#include <stdio.h>],[printf("Hello\n");],[break])
+			done
+			CFLAGS="$cf_save_CFLAGS"
+			CC_SHARED_OPTS=$cf_shared_opts
 			MK_SHARED_LIB='${CC} -dy -G -h '$cf_cv_shared_soname' -o $[@]'
 		else
 			MK_SHARED_LIB='${CC} -shared -dy -G -h '$cf_cv_shared_soname' -o $[@]'
 		fi
 		;;
-	sysv5uw7*|unix_sv*)
+	sysv5uw7*|unix_sv*) #(vi
 		# tested with UnixWare 7.1.0 (gcc 2.95.2 and cc)
 		if test "$GCC" != yes; then
 			CC_SHARED_OPTS='-KPIC'
@@ -4428,7 +5121,7 @@
 	case "$cf_cv_shlib_version" in #(vi
 	rel|abi)
 		case "$MK_SHARED_LIB" in #(vi
-		*'-o $[@]')
+		*'-o $[@]') #(vi
 			test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes
 			;;
 		*)
@@ -4439,17 +5132,11 @@
 	esac
 
 	if test -n "$cf_ld_rpath_opt" ; then
-		AC_MSG_CHECKING(if we need a space after rpath option)
-		cf_save_LIBS="$LIBS"
-		LIBS="$LIBS ${cf_ld_rpath_opt}$libdir"
-		AC_TRY_LINK(, , cf_rpath_space=no, cf_rpath_space=yes)
-		LIBS="$cf_save_LIBS"
-		AC_MSG_RESULT($cf_rpath_space)
-		test "$cf_rpath_space" = yes && cf_ld_rpath_opt="$cf_ld_rpath_opt "
 		MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${libdir}"
 	fi
 
 	AC_SUBST(CC_SHARED_OPTS)
+	AC_SUBST(LD_RPATH_OPT)
 	AC_SUBST(LD_SHARED_OPTS)
 	AC_SUBST(MK_SHARED_LIB)
 	AC_SUBST(LINK_PROGS)
@@ -4642,7 +5329,7 @@
 fi
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_SRC_MODULES version: 18 updated: 2005/05/28 12:58:54
+dnl CF_SRC_MODULES version: 21 updated: 2010/09/04 17:37:40
 dnl --------------
 dnl For each parameter, test if the source-directory exists, and if it contains
 dnl a 'modules' file.  If so, add to the list $cf_cv_src_modules which we'll
@@ -4717,19 +5404,28 @@
 AC_SUBST(TEST_ARG2)
 AC_SUBST(TEST_DEP2)
 
-SRC_SUBDIRS="man include"
+SRC_SUBDIRS=
+if test "x$cf_with_manpages" != xno ; then
+	SRC_SUBDIRS="$SRC_SUBDIRS man"
+fi
+SRC_SUBDIRS="$SRC_SUBDIRS include"
 for cf_dir in $cf_cv_src_modules
 do
 	SRC_SUBDIRS="$SRC_SUBDIRS $cf_dir"
 done
-SRC_SUBDIRS="$SRC_SUBDIRS test"
+if test "x$cf_with_tests" != "xno" ; then
+	SRC_SUBDIRS="$SRC_SUBDIRS test"
+fi
 test -z "$MAKE_TERMINFO" && SRC_SUBDIRS="$SRC_SUBDIRS misc"
 test "$cf_with_cxx_binding" != no && SRC_SUBDIRS="$SRC_SUBDIRS c++"
 
 ADA_SUBDIRS=
 if test "$cf_cv_prog_gnat_correct" = yes && test -f $srcdir/Ada95/Makefile.in; then
-   SRC_SUBDIRS="$SRC_SUBDIRS Ada95"
-   ADA_SUBDIRS="gen src samples"
+	SRC_SUBDIRS="$SRC_SUBDIRS Ada95"
+	ADA_SUBDIRS="gen src"
+	if test "x$cf_with_tests" != "xno" ; then
+		ADA_SUBDIRS="$ADA_SUBDIRS samples"
+	fi
 fi
 
 SUB_MAKEFILES=
@@ -4739,15 +5435,15 @@
 done
 
 if test -n "$ADA_SUBDIRS"; then
-   for cf_dir in $ADA_SUBDIRS
-   do
-      SUB_MAKEFILES="$SUB_MAKEFILES Ada95/$cf_dir/Makefile"
-   done
-   AC_SUBST(ADA_SUBDIRS)
+	for cf_dir in $ADA_SUBDIRS
+	do
+		SUB_MAKEFILES="$SUB_MAKEFILES Ada95/$cf_dir/Makefile"
+	done
+	AC_SUBST(ADA_SUBDIRS)
 fi
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_STDCPP_LIBRARY version: 5 updated: 2000/08/12 23:18:52
+dnl CF_STDCPP_LIBRARY version: 7 updated: 2010/05/29 16:31:02
 dnl -----------------
 dnl Check for -lstdc++, which is GNU's standard C++ library.
 AC_DEFUN([CF_STDCPP_LIBRARY],
@@ -4763,7 +5459,7 @@
 esac
 AC_CACHE_CHECK(for library $cf_stdcpp_libname,cf_cv_libstdcpp,[
 	cf_save="$LIBS"
-	LIBS="$LIBS -l$cf_stdcpp_libname"
+	CF_ADD_LIB($cf_stdcpp_libname)
 AC_TRY_LINK([
 #include <strstream.h>],[
 char buf[80];
@@ -4773,7 +5469,7 @@
 	[cf_cv_libstdcpp=no])
 	LIBS="$cf_save"
 ])
-test "$cf_cv_libstdcpp" = yes && CXXLIBS="$CXXLIBS -l$cf_stdcpp_libname"
+test "$cf_cv_libstdcpp" = yes && CF_ADD_LIB($cf_stdcpp_libname,CXXLIBS)
 fi
 ])dnl
 dnl ---------------------------------------------------------------------------
@@ -4846,14 +5542,15 @@
 fi
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_SUBDIR_PATH version: 5 updated: 2007/07/29 09:55:12
+dnl CF_SUBDIR_PATH version: 6 updated: 2010/04/21 06:20:50
 dnl --------------
 dnl Construct a search-list for a nonstandard header/lib-file
 dnl	$1 = the variable to return as result
 dnl	$2 = the package name
 dnl	$3 = the subdirectory, e.g., bin, include or lib
 AC_DEFUN([CF_SUBDIR_PATH],
-[$1=""
+[
+$1=
 
 CF_ADD_SUBDIR_PATH($1,$2,$3,/usr,$prefix)
 CF_ADD_SUBDIR_PATH($1,$2,$3,$prefix,NONE)
@@ -5048,7 +5745,7 @@
 $1=`echo "$2" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_UTF8_LIB version: 5 updated: 2008/10/17 19:37:52
+dnl CF_UTF8_LIB version: 7 updated: 2010/06/20 09:24:28
 dnl -----------
 dnl Check for multibyte support, and if not found, utf8 compatibility library
 AC_DEFUN([CF_UTF8_LIB],
@@ -5070,10 +5767,40 @@
 	AC_DEFINE(HAVE_LIBUTF8_H)
 	CF_ADD_INCDIR($cf_cv_header_path_utf8)
 	CF_ADD_LIBDIR($cf_cv_library_path_utf8)
-	LIBS="-lutf8 $LIBS"
+	CF_ADD_LIBS($cf_cv_library_file_utf8)
 fi
 ])dnl
 dnl ---------------------------------------------------------------------------
+dnl CF_VA_COPY version: 2 updated: 2010/03/04 05:37:29
+dnl ----------
+dnl check for va_copy, part of stdarg.h
+dnl Also, workaround for glibc's __va_copy, by checking for both.
+AC_DEFUN([CF_VA_COPY],[
+AC_CACHE_CHECK(for va_copy, cf_cv_have_va_copy,[
+AC_TRY_LINK([
+#include <stdarg.h>
+],[
+	static va_list dst;
+	static va_list src;
+	va_copy(dst, src)],
+	cf_cv_have_va_copy=yes,
+	cf_cv_have_va_copy=no)])
+
+test "$cf_cv_have_va_copy" = yes && AC_DEFINE(HAVE_VA_COPY)
+
+AC_CACHE_CHECK(for __va_copy, cf_cv_have___va_copy,[
+AC_TRY_LINK([
+#include <stdarg.h>
+],[
+	static va_list dst;
+	static va_list src;
+	__va_copy(dst, src)],
+	cf_cv_have___va_copy=yes,
+	cf_cv_have___va_copy=no)])
+
+test "$cf_cv_have___va_copy" = yes && AC_DEFINE(HAVE___VA_COPY)
+])
+dnl ---------------------------------------------------------------------------
 dnl CF_VERBOSE version: 3 updated: 2007/07/29 09:55:12
 dnl ----------
 dnl Use AC_VERBOSE w/o the warnings
@@ -5082,7 +5809,7 @@
 CF_MSG_LOG([$1])
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_WCHAR_TYPE version: 2 updated: 2004/01/17 19:18:20
+dnl CF_WCHAR_TYPE version: 3 updated: 2010/05/26 16:44:57
 dnl -------------
 dnl Check if type wide-character type $1 is declared, and if so, which header
 dnl file is needed.  The second parameter is used to set a shell variable when
@@ -5118,7 +5845,7 @@
 	NEED_WCHAR_H=1
 fi
 
-ifelse($2,,,[
+ifelse([$2],,,[
 # if we do not find $1 in either place, use substitution to provide a fallback.
 if test "$cf_cv_$1" = unknown ; then
 	$2=1
@@ -5178,7 +5905,76 @@
 ])
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_WITH_DBMALLOC version: 6 updated: 2006/12/16 14:24:05
+dnl CF_WITH_ADA_COMPILER version: 2 updated: 2010/06/26 17:35:58
+dnl --------------------
+dnl Command-line option to specify the Ada95 compiler.
+AC_DEFUN([CF_WITH_ADA_COMPILER],[
+AC_MSG_CHECKING(for ada-compiler)
+AC_ARG_WITH(ada-compiler,
+	[  --with-ada-compiler=CMD specify Ada95 compiler command (default gnatmake)],
+	[cf_ada_compiler=$withval],
+	[cf_ada_compiler=gnatmake])
+AC_SUBST(cf_ada_compiler)
+AC_MSG_RESULT($cf_ada_compiler)
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_WITH_ADA_INCLUDE version: 2 updated: 2010/06/26 17:35:58
+dnl -------------------
+dnl Command-line option to specify where Ada includes will install.
+AC_DEFUN([CF_WITH_ADA_INCLUDE],[
+AC_MSG_CHECKING(for ada-include)
+CF_WITH_PATH(ada-include,
+   [  --with-ada-include=DIR  Ada includes are in DIR],
+   ADA_INCLUDE,
+   PREFIX/share/ada/adainclude,
+   [$]prefix/share/ada/adainclude)
+AC_SUBST(ADA_INCLUDE)
+AC_MSG_RESULT($ADA_INCLUDE)
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_WITH_ADA_OBJECTS version: 2 updated: 2010/06/26 17:35:58
+dnl -------------------
+dnl Command-line option to specify where Ada objects will install.
+AC_DEFUN([CF_WITH_ADA_OBJECTS],[
+AC_MSG_CHECKING(for ada-objects)
+CF_WITH_PATH(ada-objects,
+   [  --with-ada-objects=DIR  Ada objects are in DIR],
+   ADA_OBJECTS,
+   PREFIX/lib/ada/adalib,
+   [$]prefix/lib/ada/adalib)
+AC_SUBST(ADA_OBJECTS)
+AC_MSG_RESULT($ADA_OBJECTS)
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_WITH_ADA_SHAREDLIB version: 2 updated: 2010/06/26 17:35:58
+dnl ---------------------
+dnl Command-line option to specify if an Ada95 shared-library should be built,
+dnl and optionally what its soname should be.
+AC_DEFUN([CF_WITH_ADA_SHAREDLIB],[
+AC_MSG_CHECKING(if an Ada95 shared-library should be built)
+AC_ARG_WITH(ada-sharedlib,
+	[  --with-ada-sharedlib=XX build Ada95 shared-library],
+	[with_ada_sharedlib=$withval],
+	[with_ada_sharedlib=no])
+AC_MSG_RESULT($with_ada_sharedlib)
+
+ADA_SHAREDLIB='lib$(LIB_NAME).so.1'
+MAKE_ADA_SHAREDLIB="#"
+
+if test "x$with_ada_sharedlib" != xno
+then
+	MAKE_ADA_SHAREDLIB=
+	if test "x$with_ada_sharedlib" != xyes
+	then
+		ADA_SHAREDLIB="$with_ada_sharedlib"
+	fi
+fi
+
+AC_SUBST(ADA_SHAREDLIB)
+AC_SUBST(MAKE_ADA_SHAREDLIB)
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_WITH_DBMALLOC version: 7 updated: 2010/06/21 17:26:47
 dnl ----------------
 dnl Configure-option for dbmalloc.  The optional parameter is used to override
 dnl the updating of $LIBS, e.g., to avoid conflict with subsequent tests.
@@ -5189,11 +5985,11 @@
 
 if test "$with_dbmalloc" = yes ; then
 	AC_CHECK_HEADER(dbmalloc.h,
-		[AC_CHECK_LIB(dbmalloc,[debug_malloc]ifelse($1,,[],[,$1]))])
+		[AC_CHECK_LIB(dbmalloc,[debug_malloc]ifelse([$1],,[],[,$1]))])
 fi
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_WITH_DMALLOC version: 6 updated: 2006/12/16 14:24:05
+dnl CF_WITH_DMALLOC version: 7 updated: 2010/06/21 17:26:47
 dnl ---------------
 dnl Configure-option for dmalloc.  The optional parameter is used to override
 dnl the updating of $LIBS, e.g., to avoid conflict with subsequent tests.
@@ -5204,7 +6000,7 @@
 
 if test "$with_dmalloc" = yes ; then
 	AC_CHECK_HEADER(dmalloc.h,
-		[AC_CHECK_LIB(dmalloc,[dmalloc_debug]ifelse($1,,[],[,$1]))])
+		[AC_CHECK_LIB(dmalloc,[dmalloc_debug]ifelse([$1],,[],[,$1]))])
 fi
 ])dnl
 dnl ---------------------------------------------------------------------------
@@ -5241,7 +6037,7 @@
 fi
 ])
 dnl ---------------------------------------------------------------------------
-dnl CF_WITH_LIBTOOL version: 19 updated: 2008/03/29 15:46:43
+dnl CF_WITH_LIBTOOL version: 26 updated: 2010/10/23 15:55:24
 dnl ---------------
 dnl Provide a configure option to incorporate libtool.  Define several useful
 dnl symbols for the makefile rules.
@@ -5261,22 +6057,23 @@
 dnl		echo cannot find libtool.m4 file
 dnl		exit 1
 dnl	fi
-dnl	
+dnl
 dnl	LOCAL=aclocal.m4
 dnl	ORIG=aclocal.m4.orig
-dnl	
+dnl
 dnl	trap "mv $ORIG $LOCAL" 0 1 2 5 15
 dnl	rm -f $ORIG
 dnl	mv $LOCAL $ORIG
-dnl	
+dnl
 dnl	# sed the LIBTOOL= assignment to omit the current directory?
-dnl	sed -e 's/^LIBTOOL=.*/LIBTOOL=${LIBTOOL-libtool}/' $ACLOCAL/libtool.m4 >>$LOCAL
+dnl	sed -e 's/^LIBTOOL=.*/LIBTOOL=${LIBTOOL:-libtool}/' $ACLOCAL/libtool.m4 >>$LOCAL
 dnl	cat $ORIG >>$LOCAL
-dnl	
+dnl
 dnl	autoconf-257 $*
 dnl
 AC_DEFUN([CF_WITH_LIBTOOL],
 [
+AC_REQUIRE([CF_DISABLE_LIBTOOL_VERSION])
 ifdef([AC_PROG_LIBTOOL],,[
 LIBTOOL=
 ])
@@ -5306,17 +6103,17 @@
 	AC_PROG_LIBTOOL
 	# missing_content_AC_PROG_LIBTOOL}}
 ],[
- 	if test "$with_libtool" != "yes" ; then
+	if test "$with_libtool" != "yes" ; then
 		CF_PATH_SYNTAX(with_libtool)
 		LIBTOOL=$with_libtool
 	else
- 		AC_PATH_PROG(LIBTOOL,libtool)
- 	fi
- 	if test -z "$LIBTOOL" ; then
- 		AC_MSG_ERROR(Cannot find libtool)
- 	fi
+		AC_PATH_PROG(LIBTOOL,libtool)
+	fi
+	if test -z "$LIBTOOL" ; then
+		AC_MSG_ERROR(Cannot find libtool)
+	fi
 ])dnl
-	LIB_CREATE='${LIBTOOL} --mode=link ${CC} -rpath ${DESTDIR}${libdir} -version-info `cut -f1 ${srcdir}/VERSION` ${LIBTOOL_OPTS} -o'
+	LIB_CREATE='${LIBTOOL} --mode=link ${CC} -rpath ${DESTDIR}${libdir} ${LIBTOOL_VERSION} `cut -f1 ${srcdir}/VERSION` ${LIBTOOL_OPTS} ${LT_UNDEF} -o'
 	LIB_OBJECT='${OBJECTS:.o=.lo}'
 	LIB_SUFFIX=.la
 	LIB_CLEAN='${LIBTOOL} --mode=clean'
@@ -5331,16 +6128,25 @@
 
 	# Save the version in a cache variable - this is not entirely a good
 	# thing, but the version string from libtool is very ugly, and for
-	# bug reports it might be useful to have the original string.
+	# bug reports it might be useful to have the original string. "("
 	cf_cv_libtool_version=`$LIBTOOL --version 2>&1 | sed -e '/^$/d' |sed -e '2,$d' -e 's/([[^)]]*)//g' -e 's/^[[^1-9]]*//' -e 's/[[^0-9.]].*//'`
 	AC_MSG_RESULT($cf_cv_libtool_version)
 	if test -z "$cf_cv_libtool_version" ; then
 		AC_MSG_ERROR(This is not GNU libtool)
 	fi
 
+	# special hack to add -no-undefined (which libtool should do for itself)
+	LT_UNDEF=
+	case "$cf_cv_system_name" in #(vi
+	cygwin*|mingw32*|uwin*|aix[[456]]) #(vi
+		LT_UNDEF=-no-undefined
+		;;
+	esac
+	AC_SUBST([LT_UNDEF])
+
 	# special hack to add --tag option for C++ compiler
-	case $cf_cv_libtool_version in
-	1.[[5-9]]*|[[2-9]]*)
+	case $cf_cv_libtool_version in #(vi
+	1.[[5-9]]*|[[2-9]].[[0-9.a-z]]*) #(vi
 		LIBTOOL_CXX="$LIBTOOL --tag=CXX"
 		LIBTOOL="$LIBTOOL --tag=CC"
 		;;
@@ -5372,7 +6178,7 @@
 
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_WITH_PATH version: 8 updated: 2007/05/13 13:16:35
+dnl CF_WITH_PATH version: 10 updated: 2010/10/23 15:44:18
 dnl ------------
 dnl Wrapper for AC_ARG_WITH to ensure that user supplies a pathname, not just
 dnl defaulting to yes/no.
@@ -5384,16 +6190,16 @@
 dnl $5 = default value, if it's an expression & cannot be in the help-message
 dnl
 AC_DEFUN([CF_WITH_PATH],
-[AC_ARG_WITH($1,[$2 ](default: ifelse($4,,empty,$4)),,
-ifelse($4,,[withval="${$3}"],[withval="${$3-ifelse($5,,$4,$5)}"]))dnl
-if ifelse($5,,true,[test -n "$5"]) ; then
+[AC_ARG_WITH($1,[$2 ](default: ifelse([$4],,empty,[$4])),,
+ifelse([$4],,[withval="${$3}"],[withval="${$3:-ifelse([$5],,[$4],[$5])}"]))dnl
+if ifelse([$5],,true,[test -n "$5"]) ; then
 CF_PATH_SYNTAX(withval)
 fi
 $3="$withval"
 AC_SUBST($3)dnl
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_WITH_PATHLIST version: 5 updated: 2001/12/10 01:28:30
+dnl CF_WITH_PATHLIST version: 7 updated: 2010/10/23 16:10:30
 dnl ----------------
 dnl Process an option specifying a list of colon-separated paths.
 dnl
@@ -5407,9 +6213,9 @@
 AC_DEFUN([CF_WITH_PATHLIST],[
 AC_REQUIRE([CF_PATHSEP])
 AC_ARG_WITH($1,[$2 ](default: ifelse($4,,empty,$4)),,
-ifelse($4,,[withval=${$3}],[withval=${$3-ifelse($5,,$4,$5)}]))dnl
+ifelse($4,,[withval=${$3}],[withval=${$3:-ifelse($5,,$4,$5)}]))dnl
 
-IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${PATHSEP}"
+IFS="${IFS:- 	}"; ac_save_ifs="$IFS"; IFS="${PATH_SEPARATOR}"
 cf_dst_path=
 for cf_src_path in $withval
 do
@@ -5435,7 +6241,7 @@
 
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_WITH_PTHREAD version: 2 updated: 2008/08/23 18:26:05
+dnl CF_WITH_PTHREAD version: 3 updated: 2010/05/29 16:31:02
 dnl ---------------
 dnl Check for POSIX thread library.
 AC_DEFUN([CF_WITH_PTHREAD],
@@ -5453,7 +6259,7 @@
 
         AC_MSG_CHECKING(if we can link with the pthread library)
         cf_save_LIBS="$LIBS"
-        LIBS="-lpthread $LIBS"
+        CF_ADD_LIB(pthread)
         AC_TRY_LINK([
 #include <pthread.h>
 ],[
@@ -5463,7 +6269,7 @@
         AC_MSG_RESULT($with_pthread)
 
         if test "$with_pthread" = yes ; then
-            LIBS="-lpthread $LIBS"
+            CF_ADD_LIB(pthread)
             AC_DEFINE(HAVE_LIBPTHREADS)
         else
             AC_MSG_ERROR(Cannot link with pthread library)
@@ -5535,7 +6341,7 @@
 	[USE_VALGRIND])
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_XOPEN_SOURCE version: 26 updated: 2008/07/27 11:26:57
+dnl CF_XOPEN_SOURCE version: 34 updated: 2010/05/26 05:38:42
 dnl ---------------
 dnl Try to get _XOPEN_SOURCE defined properly that we can use POSIX functions,
 dnl or adapt to the vendor's definitions to get equivalent functionality,
@@ -5546,14 +6352,19 @@
 dnl	$2 is the nominal value for _POSIX_C_SOURCE
 AC_DEFUN([CF_XOPEN_SOURCE],[
 
-AC_REQUIRE([CF_PROG_CC_U_D])
-
-cf_XOPEN_SOURCE=ifelse($1,,500,$1)
-cf_POSIX_C_SOURCE=ifelse($2,,199506L,$2)
+cf_XOPEN_SOURCE=ifelse([$1],,500,[$1])
+cf_POSIX_C_SOURCE=ifelse([$2],,199506L,[$2])
+cf_xopen_source=
 
 case $host_os in #(vi
-aix[[45]]*) #(vi
-	CPPFLAGS="$CPPFLAGS -D_ALL_SOURCE"
+aix[[456]]*) #(vi
+	cf_xopen_source="-D_ALL_SOURCE"
+	;;
+darwin[[0-8]].*) #(vi
+	cf_xopen_source="-D_APPLE_C_SOURCE"
+	;;
+darwin*) #(vi
+	cf_xopen_source="-D_DARWIN_C_SOURCE"
 	;;
 freebsd*|dragonfly*) #(vi
 	# 5.x headers associate
@@ -5561,15 +6372,18 @@
 	#	_XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
 	cf_POSIX_C_SOURCE=200112L
 	cf_XOPEN_SOURCE=600
-	CPPFLAGS="$CPPFLAGS -D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
+	cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
+	;;
+hpux11*) #(vi
+	cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
 	;;
 hpux*) #(vi
-	CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE"
+	cf_xopen_source="-D_HPUX_SOURCE"
 	;;
 irix[[56]].*) #(vi
-	CPPFLAGS="$CPPFLAGS -D_SGI_SOURCE"
+	cf_xopen_source="-D_SGI_SOURCE"
 	;;
-linux*|gnu*|k*bsd*-gnu) #(vi
+linux*|gnu*|mint*|k*bsd*-gnu) #(vi
 	CF_GNU_SOURCE
 	;;
 mirbsd*) #(vi
@@ -5582,16 +6396,19 @@
 	# setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
 	;;
 osf[[45]]*) #(vi
-	CPPFLAGS="$CPPFLAGS -D_OSF_SOURCE"
+	cf_xopen_source="-D_OSF_SOURCE"
 	;;
 nto-qnx*) #(vi
-	CPPFLAGS="$CPPFLAGS -D_QNX_SOURCE"
+	cf_xopen_source="-D_QNX_SOURCE"
 	;;
 sco*) #(vi
 	# setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
 	;;
-solaris*) #(vi
-	CPPFLAGS="$CPPFLAGS -D__EXTENSIONS__"
+solaris2.1[[0-9]]) #(vi
+	cf_xopen_source="-D__EXTENSIONS__ -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
+	;;
+solaris2.[[1-9]]) #(vi
+	cf_xopen_source="-D__EXTENSIONS__"
 	;;
 *)
 	AC_CACHE_CHECK(if we should define _XOPEN_SOURCE,cf_cv_xopen_source,[
@@ -5614,11 +6431,14 @@
 	if test "$cf_cv_xopen_source" != no ; then
 		CF_REMOVE_DEFINE(CFLAGS,$CFLAGS,_XOPEN_SOURCE)
 		CF_REMOVE_DEFINE(CPPFLAGS,$CPPFLAGS,_XOPEN_SOURCE)
-		test "$cf_cv_cc_u_d_options" = yes && \
-			CPPFLAGS="$CPPFLAGS -U_XOPEN_SOURCE"
-		CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_cv_xopen_source"
+		cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
+		CF_ADD_CFLAGS($cf_temp_xopen_source)
 	fi
 	CF_POSIX_C_SOURCE($cf_POSIX_C_SOURCE)
 	;;
 esac
+
+if test -n "$cf_xopen_source" ; then
+	CF_ADD_CFLAGS($cf_xopen_source)
+fi
 ])
diff -Naur ncurses-5.7.orig/announce.html.in ncurses-5.7/announce.html.in
--- ncurses-5.7.orig/announce.html.in	2008-11-01 21:03:05.000000000 -0400
+++ ncurses-5.7/announce.html.in	2011-01-08 18:18:29.634657268 -0500
@@ -1,8 +1,8 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.0//EN">
 <!--
-  $Id: announce.html.in,v 1.70 2008/11/02 01:03:05 tom Exp $
+  $Id: announce.html.in,v 1.71 2010/12/04 18:47:13 tom Exp $
   ****************************************************************************
-  * 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            *
@@ -578,11 +578,3 @@
 archive</A>&nbsp;.
 </BODY>
 </HTML>
-<!--
-# The following sets edit modes for GNU EMACS
-# Local Variables:
-# mode:html
-# case-fold-search:nil
-# fill-column:70
-# End:
--->
diff -Naur ncurses-5.7.orig/c++/Makefile.in ncurses-5.7/c++/Makefile.in
--- ncurses-5.7.orig/c++/Makefile.in	2007-04-28 11:29:12.000000000 -0400
+++ ncurses-5.7/c++/Makefile.in	2011-01-08 18:18:29.558656121 -0500
@@ -1,6 +1,6 @@
-# $Id: Makefile.in,v 1.84 2007/04/28 15:29:12 tom Exp $
+# $Id: Makefile.in,v 1.93 2010/11/27 21:45:27 tom Exp $
 ##############################################################################
-# Copyright (c) 1998-2006,2007 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 "Software"), #
@@ -35,6 +35,7 @@
 .SUFFIXES:
 
 SHELL		= /bin/sh
+VPATH		= @srcdir@
 
 CF_MFLAGS 	= @cf_cv_makeflags@
 @SET_MAKE@
@@ -55,16 +56,18 @@
 LIBTOOL_LINK	= @LIB_LINK@
 LIBTOOL_INSTALL	= @LIB_INSTALL@
 LIBTOOL_UNINSTALL = @LIB_UNINSTALL@
+LIBTOOL_VERSION = @LIBTOOL_VERSION@
+LT_UNDEF	= @LT_UNDEF@
 
 INSTALL		= @INSTALL@
 INSTALL_LIB	= @INSTALL@ @INSTALL_LIB@
 INSTALL_DATA	= @INSTALL_DATA@
 
 AR		= @AR@
-AR_OPTS		= @AR_OPTS@
+ARFLAGS		= @ARFLAGS@
 
 CXX_AR		= @CXX_AR@
-CXX_AR_OPTS	= @CXX_AR_OPTS@
+CXX_ARFLAGS	= @CXX_ARFLAGS@
 RANLIB		= @LIB_PREP@
 
 CXX		= @CXX@
@@ -75,6 +78,9 @@
 INCDIR		= ../include
 CPPFLAGS	= -I../c++ -I$(INCDIR) -I$(srcdir) -DHAVE_CONFIG_H @CPPFLAGS@
 
+CTAGS		= @CTAGS@
+ETAGS		= @ETAGS@
+
 CC		= ${CXX}
 CCFLAGS		= $(CPPFLAGS) $(CXXFLAGS)
 
@@ -95,7 +101,7 @@
 
 LINK		= @LINK_PROGS@ $(LIBTOOL_LINK) @CXXLDFLAGS@
 SHLIB_DIRS	= -L../lib
-SHLIB_LIST	= $(SHLIB_DIRS) -lncurses@LIB_SUFFIX@ @SHLIB_LIST@
+SHLIB_LIST	= $(SHLIB_DIRS) -lform@LIB_SUFFIX@ -lmenu@LIB_SUFFIX@ -lpanel@LIB_SUFFIX@ -lncurses@LIB_SUFFIX@ @SHLIB_LIST@
 
 LIBROOT		= ncurses++
 
@@ -103,18 +109,21 @@
 LIBNAME_NORMAL	= @LIB_PREFIX@$(LIBROOT)@LIB_SUFFIX@.a
 LIBNAME		= @LIB_PREFIX@$(LIBROOT)@CXX_LIB_SUFFIX@
 
+MY_LIBRARY	= ../lib/$(LIBNAME)
+
 LINK_FLAGS	= @EXTRA_LDFLAGS@ -L../lib -l$(LIBROOT)@LIB_SUFFIX@
 
-LINK_LIBTOOL	= @EXTRA_LDFLAGS@ -L../lib ../lib/$(LIBNAME)
+LINK_LIBTOOL	= @EXTRA_LDFLAGS@ -L../lib $(MY_LIBRARY)
 LINK_NORMAL	= $(LINK_FLAGS)
 LINK_DEBUG	= $(LINK_FLAGS)
 LINK_PROFILE	= $(LINK_FLAGS)
 LINK_SHARED	= $(LINK_FLAGS)
 
+TEST_LIBS	= @TEST_LIBS@
 TEST_ARGS	= @LDFLAGS_STATIC@ @TEST_ARGS@ @LDFLAGS_SHARED@ 
 
 LDFLAGS		= $(TEST_ARGS) @LDFLAGS@ \
-	@LD_MODEL@ @LIBS@ @LOCAL_LDFLAGS@ $(CXXLIBS)
+	@LD_MODEL@ $(TEST_LIBS) @LIBS@ @LOCAL_LDFLAGS@ $(CXXLIBS)
 
 LDFLAGS_LIBTOOL	= $(LDFLAGS) $(CFLAGS_LIBTOOL)
 LDFLAGS_NORMAL	= $(LDFLAGS) $(CFLAGS_NORMAL)
@@ -128,16 +137,16 @@
 		etip.h
 
 all \
-libs ::		$(AUTO_SRC) ../lib/$(LIBNAME)
+libs ::		$(AUTO_SRC) $(MY_LIBRARY)
 
-all ::		demo$x
+@MAKE_TESTS@all ::		demo$x
 
 sources :	$(AUTO_SRC)
 
 depend :
 
 tags:
-	ctags *.[h] *.cc
+	$(CTAGS) *.[h] *.cc
 
 # Build a conventional library for installing, since a shared library would
 # pull in all of the ncurses libraries (panel, menu, form, ncurses) as direct
@@ -153,14 +162,14 @@
 	$(MODEL)/cursesmain$o
 
 ../lib/$(LIBNAME_NORMAL) : $(LIB_OBJS)
-	$(CXX_AR) $(CXX_AR_OPTS) $@ $?
+	$(CXX_AR) $(CXX_ARFLAGS) $@ $?
 	$(RANLIB) $@
 
 ../lib/$(LIBNAME_LIBTOOL) : $(LIB_OBJS)
 	cd ../lib && $(LIBTOOL_LINK) $(CXX) $(CXXFLAGS) \
 		-o $(LIBNAME) $(LIB_OBJS:$o=.lo) \
 		-rpath $(INSTALL_PREFIX)$(libdir) \
-		-version-info $(NCURSES_MAJOR):$(NCURSES_MINOR) $(SHLIB_LIST)
+		$(LIBTOOL_VERSION) $(NCURSES_MAJOR):$(NCURSES_MINOR) $(LT_UNDEF) $(SHLIB_LIST)
 
 OBJS_DEMO = $(MODEL)/demo$o
 
@@ -168,7 +177,7 @@
 	$(cursesf_h) $(cursesm_h) $(cursesapp_h)
 
 demo$x:	$(OBJS_DEMO) \
-	../lib/$(LIBNAME)  \
+	$(MY_LIBRARY)  \
 	@TEST_DEPS@
 	@ECHO_LINK@ $(LINK) -o $@ $(OBJS_DEMO) $(LDFLAGS_DEFAULT)
 
@@ -177,11 +186,11 @@
 	sh $(srcdir)/edit_cfg.sh ../include/ncurses_cfg.h $@
 
 $(DESTDIR)$(libdir) :
-	sh $(srcdir)/../mkdirs.sh $@
+	mkdir -p $@
 
 install \
-install.libs:: ../lib/$(LIBNAME) $(DESTDIR)$(libdir)
-	$(LIBTOOL_INSTALL) $(INSTALL_LIB) ../lib/$(LIBNAME) $(DESTDIR)$(libdir)/$(LIBNAME)
+install.libs:: $(MY_LIBRARY) $(DESTDIR)$(libdir)
+	$(LIBTOOL_INSTALL) $(INSTALL_LIB) $(MY_LIBRARY) $(DESTDIR)$(libdir)/$(LIBNAME)
 
 uninstall \
 uninstall.libs::
@@ -193,7 +202,7 @@
 clean :: mostlyclean
 	-sh -c "if test -n '$x' ; then $(MAKE) clean x=''; fi"
 	-rm -rf $(MODEL)/SunWS_cache
-	-$(LIBTOOL_CLEAN) rm -f demo$x $(AUTO_SRC) ../lib/$(LIBNAME) $(LIB_OBJS) $(OBJS_DEMO)
+	-$(LIBTOOL_CLEAN) rm -f demo$x $(AUTO_SRC) $(MY_LIBRARY) $(LIB_OBJS) $(OBJS_DEMO)
 	-rm -rf .libs
 
 distclean :: clean
diff -Naur ncurses-5.7.orig/c++/cursesw.cc ncurses-5.7/c++/cursesw.cc
--- ncurses-5.7.orig/c++/cursesw.cc	2007-12-15 18:01:57.000000000 -0500
+++ ncurses-5.7/c++/cursesw.cc	2011-01-08 18:13:50.331157346 -0500
@@ -1,6 +1,6 @@
 // * this is for making emacs happy: -*-Mode: C++;-*-
 /****************************************************************************
- * Copyright (c) 2007 Free Software Foundation, Inc.                        *
+ * Copyright (c) 2007-2008,2009 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -42,7 +42,7 @@
 #include "internal.h"
 #include "cursesw.h"
 
-MODULE_ID("$Id: cursesw.cc,v 1.49 2007/12/15 23:01:57 tom Exp $")
+MODULE_ID("$Id: cursesw.cc,v 1.51 2009/03/28 21:31:37 tom Exp $")
 
 #define COLORS_NEED_INITIALIZATION  -1
 #define COLORS_NOT_INITIALIZED       0
@@ -287,7 +287,6 @@
 {
     initialize();
     w = win;
-    assert((w->_maxx +1 ) == ncols);
 }
 
 int _nc_xx_ripoff_init(WINDOW *w, int ncols)
@@ -296,8 +295,7 @@
 
     RIPOFFINIT init = *prip++;
     if (init) {
-	NCursesWindow* W = new NCursesWindow(w,ncols);
-	res = init(*W);
+	res = init(*(new NCursesWindow(w,ncols)));
     }
     return res;
 }
@@ -464,7 +462,7 @@
 #if HAVE_HAS_KEY
 bool NCursesWindow::has_mouse() const
 {
-    return ((::has_key(KEY_MOUSE) || ::_nc_has_mouse())
+    return ((::has_key(KEY_MOUSE) || ::has_mouse())
 	     ? TRUE : FALSE);
 }
 #endif
diff -Naur ncurses-5.7.orig/c++/demo.cc ncurses-5.7/c++/demo.cc
--- ncurses-5.7.orig/c++/demo.cc	2008-08-04 13:16:57.000000000 -0400
+++ ncurses-5.7/c++/demo.cc	2011-01-08 18:13:50.331157346 -0500
@@ -35,7 +35,7 @@
  *   Demo code for NCursesMenu and NCursesForm written by
  *   Juergen Pfeifer
  *
- * $Id: demo.cc,v 1.38 2008/08/04 17:16:57 tom Exp $
+ * $Id: demo.cc,v 1.39 2008/12/07 02:07:34 juergen Exp $
  */
 
 #include "internal.h"
@@ -43,7 +43,13 @@
 #include "cursesm.h"
 #include "cursesf.h"
 
+#ifdef __MINGW32__
+#undef KEY_EVENT
+#endif
+
+#ifndef __MINGW32__
 extern "C" unsigned int sleep(unsigned int);
+#endif
 
 #undef index // needed for NeXT
 
diff -Naur ncurses-5.7.orig/c++/internal.h ncurses-5.7/c++/internal.h
--- ncurses-5.7.orig/c++/internal.h	2008-10-25 17:35:44.000000000 -0400
+++ ncurses-5.7/c++/internal.h	2011-01-08 18:13:50.331157346 -0500
@@ -31,7 +31,7 @@
  *   Author: Juergen Pfeifer, 1997                                          *
  ****************************************************************************/
 
-// $Id: internal.h,v 1.16 2008/10/25 21:35:44 tom Exp $
+// $Id: internal.h,v 1.17 2008/12/07 02:07:34 juergen Exp $
 
 #ifndef NCURSES_CPLUS_INTERNAL_H
 #define NCURSES_CPLUS_INTERNAL_H 1
@@ -44,6 +44,11 @@
 #define MODULE_ID(id) /*nothing*/
 #endif
 
+#ifdef __MINGW32__
+#include <nc_mingw.h>
+#undef KEY_EVENT
+#endif
+
 #ifndef _QNX_SOURCE
 #include <stdlib.h>
 #include <string.h>
diff -Naur ncurses-5.7.orig/config.guess ncurses-5.7/config.guess
--- ncurses-5.7.orig/config.guess	2008-08-30 16:25:07.000000000 -0400
+++ ncurses-5.7/config.guess	2011-01-08 18:13:50.331157346 -0500
@@ -1,10 +1,10 @@
 #! /bin/sh
 # Attempt to guess a canonical system name.
 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
 #   Free Software Foundation, Inc.
 
-timestamp='2008-04-14'
+timestamp='2009-12-30'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -27,16 +27,16 @@
 # the same distribution terms that you use for the rest of that program.
 
 
-# Originally written by Per Bothner <per@bothner.com>.
-# Please send patches to <config-patches@gnu.org>.  Submit a context
-# diff and a properly formatted ChangeLog entry.
+# Originally written by Per Bothner.  Please send patches (context
+# diff format) to <config-patches@gnu.org> and include a ChangeLog
+# entry.
 #
 # This script attempts to guess a canonical system name similar to
 # config.sub.  If it succeeds, it prints the system name on stdout, and
 # exits with 0.  Otherwise, it exits with 1.
 #
-# The plan is that this can be called by configure scripts if you
-# don't specify an explicit build system type.
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
 
 me=`echo "$0" | sed -e 's,.*/,,'`
 
@@ -56,8 +56,9 @@
 GNU config.guess ($timestamp)
 
 Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
-2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
+Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -170,7 +171,7 @@
 	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
 		eval $set_cc_for_build
 		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
-			| grep __ELF__ >/dev/null
+			| grep -q __ELF__
 		then
 		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
 		    # Return netbsd for either.  FIX?
@@ -324,14 +325,33 @@
 	case `/usr/bin/uname -p` in
 	    sparc) echo sparc-icl-nx7; exit ;;
 	esac ;;
+    s390x:SunOS:*:*)
+	echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit ;;
     sun4H:SunOS:5.*:*)
 	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
 	exit ;;
     sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
 	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
 	exit ;;
+    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
+	echo i386-pc-auroraux${UNAME_RELEASE}
+	exit ;;
     i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
-	echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	eval $set_cc_for_build
+	SUN_ARCH="i386"
+	# If there is a compiler, see if it is configured for 64-bit objects.
+	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
+	# This test works for both compilers.
+	if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+	    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
+		(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+		grep IS_64BIT_ARCH >/dev/null
+	    then
+		SUN_ARCH="x86_64"
+	    fi
+	fi
+	echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
 	exit ;;
     sun4*:SunOS:6*:*)
 	# According to config.sub, this is the proper way to canonicalize
@@ -640,7 +660,7 @@
 	    # => hppa64-hp-hpux11.23
 
 	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
-		grep __LP64__ >/dev/null
+		grep -q __LP64__
 	    then
 		HP_ARCH="hppa2.0w"
 	    else
@@ -791,12 +811,12 @@
     i*:PW*:*)
 	echo ${UNAME_MACHINE}-pc-pw32
 	exit ;;
-    *:Interix*:[3456]*)
+    *:Interix*:*)
     	case ${UNAME_MACHINE} in
 	    x86)
 		echo i586-pc-interix${UNAME_RELEASE}
 		exit ;;
-	    EM64T | authenticamd)
+	    authenticamd | genuineintel | EM64T)
 		echo x86_64-unknown-interix${UNAME_RELEASE}
 		exit ;;
 	    IA64)
@@ -806,6 +826,9 @@
     [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
 	echo i${UNAME_MACHINE}-pc-mks
 	exit ;;
+    8664:Windows_NT:*)
+	echo x86_64-pc-mks
+	exit ;;
     i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
 	# How do we know it's Interix rather than the generic POSIX subsystem?
 	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
@@ -835,6 +858,20 @@
     i*86:Minix:*:*)
 	echo ${UNAME_MACHINE}-pc-minix
 	exit ;;
+    alpha:Linux:*:*)
+	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+	  EV5)   UNAME_MACHINE=alphaev5 ;;
+	  EV56)  UNAME_MACHINE=alphaev56 ;;
+	  PCA56) UNAME_MACHINE=alphapca56 ;;
+	  PCA57) UNAME_MACHINE=alphapca56 ;;
+	  EV6)   UNAME_MACHINE=alphaev6 ;;
+	  EV67)  UNAME_MACHINE=alphaev67 ;;
+	  EV68*) UNAME_MACHINE=alphaev68 ;;
+        esac
+	objdump --private-headers /bin/sh | grep -q ld.so.1
+	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+	exit ;;
     arm*:Linux:*:*)
 	eval $set_cc_for_build
 	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
@@ -857,6 +894,17 @@
     frv:Linux:*:*)
     	echo frv-unknown-linux-gnu
 	exit ;;
+    i*86:Linux:*:*)
+	LIBC=gnu
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+	#ifdef __dietlibc__
+	LIBC=dietlibc
+	#endif
+EOF
+	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
+	echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+	exit ;;
     ia64:Linux:*:*)
 	echo ${UNAME_MACHINE}-unknown-linux-gnu
 	exit ;;
@@ -866,74 +914,33 @@
     m68*:Linux:*:*)
 	echo ${UNAME_MACHINE}-unknown-linux-gnu
 	exit ;;
-    mips:Linux:*:*)
+    mips:Linux:*:* | mips64:Linux:*:*)
 	eval $set_cc_for_build
 	sed 's/^	//' << EOF >$dummy.c
 	#undef CPU
-	#undef mips
-	#undef mipsel
+	#undef ${UNAME_MACHINE}
+	#undef ${UNAME_MACHINE}el
 	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
-	CPU=mipsel
+	CPU=${UNAME_MACHINE}el
 	#else
 	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
-	CPU=mips
+	CPU=${UNAME_MACHINE}
 	#else
 	CPU=
 	#endif
 	#endif
 EOF
-	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
-	    /^CPU/{
-		s: ::g
-		p
-	    }'`"
-	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
-	;;
-    mips64:Linux:*:*)
-	eval $set_cc_for_build
-	sed 's/^	//' << EOF >$dummy.c
-	#undef CPU
-	#undef mips64
-	#undef mips64el
-	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
-	CPU=mips64el
-	#else
-	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
-	CPU=mips64
-	#else
-	CPU=
-	#endif
-	#endif
-EOF
-	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
-	    /^CPU/{
-		s: ::g
-		p
-	    }'`"
+	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
 	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
 	;;
     or32:Linux:*:*)
 	echo or32-unknown-linux-gnu
 	exit ;;
-    ppc:Linux:*:*)
-	echo powerpc-unknown-linux-gnu
-	exit ;;
-    ppc64:Linux:*:*)
-	echo powerpc64-unknown-linux-gnu
+    padre:Linux:*:*)
+	echo sparc-unknown-linux-gnu
 	exit ;;
-    alpha:Linux:*:*)
-	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
-	  EV5)   UNAME_MACHINE=alphaev5 ;;
-	  EV56)  UNAME_MACHINE=alphaev56 ;;
-	  PCA56) UNAME_MACHINE=alphapca56 ;;
-	  PCA57) UNAME_MACHINE=alphapca56 ;;
-	  EV6)   UNAME_MACHINE=alphaev6 ;;
-	  EV67)  UNAME_MACHINE=alphaev67 ;;
-	  EV68*) UNAME_MACHINE=alphaev68 ;;
-        esac
-	objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
-	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
-	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+    parisc64:Linux:*:* | hppa64:Linux:*:*)
+	echo hppa64-unknown-linux-gnu
 	exit ;;
     parisc:Linux:*:* | hppa:Linux:*:*)
 	# Look for CPU level
@@ -943,8 +950,11 @@
 	  *)    echo hppa-unknown-linux-gnu ;;
 	esac
 	exit ;;
-    parisc64:Linux:*:* | hppa64:Linux:*:*)
-	echo hppa64-unknown-linux-gnu
+    ppc64:Linux:*:*)
+	echo powerpc64-unknown-linux-gnu
+	exit ;;
+    ppc:Linux:*:*)
+	echo powerpc-unknown-linux-gnu
 	exit ;;
     s390:Linux:*:* | s390x:Linux:*:*)
 	echo ${UNAME_MACHINE}-ibm-linux
@@ -967,66 +977,6 @@
     xtensa*:Linux:*:*)
     	echo ${UNAME_MACHINE}-unknown-linux-gnu
 	exit ;;
-    i*86:Linux:*:*)
-	# The BFD linker knows what the default object file format is, so
-	# first see if it will tell us. cd to the root directory to prevent
-	# problems with other programs or directories called `ld' in the path.
-	# Set LC_ALL=C to ensure ld outputs messages in English.
-	ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
-			 | sed -ne '/supported targets:/!d
-				    s/[ 	][ 	]*/ /g
-				    s/.*supported targets: *//
-				    s/ .*//
-				    p'`
-        case "$ld_supported_targets" in
-	  elf32-i386)
-		TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
-		;;
-	  a.out-i386-linux)
-		echo "${UNAME_MACHINE}-pc-linux-gnuaout"
-		exit ;;
-	  "")
-		# Either a pre-BFD a.out linker (linux-gnuoldld) or
-		# one that does not give us useful --help.
-		echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
-		exit ;;
-	esac
-	# Determine whether the default compiler is a.out or elf
-	eval $set_cc_for_build
-	sed 's/^	//' << EOF >$dummy.c
-	#include <features.h>
-	#ifdef __ELF__
-	# ifdef __GLIBC__
-	#  if __GLIBC__ >= 2
-	LIBC=gnu
-	#  else
-	LIBC=gnulibc1
-	#  endif
-	# else
-	LIBC=gnulibc1
-	# endif
-	#else
-	#if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
-	LIBC=gnu
-	#else
-	LIBC=gnuaout
-	#endif
-	#endif
-	#ifdef __dietlibc__
-	LIBC=dietlibc
-	#endif
-EOF
-	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
-	    /^LIBC/{
-		s: ::g
-		p
-	    }'`"
-	test x"${LIBC}" != x && {
-		echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
-		exit
-	}
-	test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
-	;;
     i*86:DYNIX/ptx:4*:*)
 	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
 	# earlier versions are messed up and put the nodename in both
@@ -1055,7 +1005,7 @@
     i*86:syllable:*:*)
 	echo ${UNAME_MACHINE}-pc-syllable
 	exit ;;
-    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
+    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
 	echo i386-unknown-lynxos${UNAME_RELEASE}
 	exit ;;
     i*86:*DOS:*:*)
@@ -1099,8 +1049,11 @@
     pc:*:*:*)
 	# Left here for compatibility:
         # uname -m prints for DJGPP always 'pc', but it prints nothing about
-        # the processor, so we play safe by assuming i386.
-	echo i386-pc-msdosdjgpp
+        # the processor, so we play safe by assuming i586.
+	# Note: whatever this is, it MUST be the same as what config.sub
+	# prints for the "djgpp" host, or else GDB configury will decide that
+	# this is a cross-build.
+	echo i586-pc-msdosdjgpp
         exit ;;
     Intel:Mach:3*:*)
 	echo i386-pc-mach3
@@ -1138,6 +1091,16 @@
     3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
         /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
           && { echo i486-ncr-sysv4; exit; } ;;
+    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
+	OS_REL='.3'
+	test -r /etc/.relid \
+	    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+	    && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
+	/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
+	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
     m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
 	echo m68k-unknown-lynxos${UNAME_RELEASE}
 	exit ;;
@@ -1150,7 +1113,7 @@
     rs6000:LynxOS:2.*:*)
 	echo rs6000-unknown-lynxos${UNAME_RELEASE}
 	exit ;;
-    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
+    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
 	echo powerpc-unknown-lynxos${UNAME_RELEASE}
 	exit ;;
     SM[BE]S:UNIX_SV:*:*)
@@ -1243,6 +1206,16 @@
     *:Darwin:*:*)
 	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
 	case $UNAME_PROCESSOR in
+	    i386)
+		eval $set_cc_for_build
+		if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+		  if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+		      (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+		      grep IS_64BIT_ARCH >/dev/null
+		  then
+		      UNAME_PROCESSOR="x86_64"
+		  fi
+		fi ;;
 	    unknown) UNAME_PROCESSOR=powerpc ;;
 	esac
 	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
@@ -1324,6 +1297,9 @@
     i*86:rdos:*:*)
 	echo ${UNAME_MACHINE}-pc-rdos
 	exit ;;
+    i*86:AROS:*:*)
+	echo ${UNAME_MACHINE}-pc-aros
+	exit ;;
 esac
 
 #echo '(No uname command or uname output not recognized.)' 1>&2
diff -Naur ncurses-5.7.orig/config.sub ncurses-5.7/config.sub
--- ncurses-5.7.orig/config.sub	2008-08-30 16:25:02.000000000 -0400
+++ ncurses-5.7/config.sub	2011-01-08 18:13:50.331157346 -0500
@@ -1,10 +1,10 @@
 #! /bin/sh
 # Configuration validation subroutine script.
 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
 #   Free Software Foundation, Inc.
 
-timestamp='2008-06-16'
+timestamp='2009-12-31'
 
 # This file is (in principle) common to ALL GNU software.
 # The presence of a machine in this file suggests that SOME GNU software
@@ -32,13 +32,16 @@
 
 
 # Please send patches to <config-patches@gnu.org>.  Submit a context
-# diff and a properly formatted ChangeLog entry.
+# diff and a properly formatted GNU ChangeLog entry.
 #
 # Configuration subroutine to validate and canonicalize a configuration type.
 # Supply the specified configuration type as an argument.
 # If it is invalid, we print an error message on stderr and exit with code 1.
 # Otherwise, we print the canonical config type on stdout and succeed.
 
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
 # This file is supposed to be the same for all GNU packages
 # and recognize all the CPU types, system types and aliases
 # that are meaningful with *any* GNU software.
@@ -72,8 +75,9 @@
 version="\
 GNU config.sub ($timestamp)
 
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
-2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
+Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -122,6 +126,7 @@
 case $maybe_os in
   nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
   uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+  kopensolaris*-gnu* | \
   storm-chaos* | os2-emx* | rtmk-nova*)
     os=-$maybe_os
     basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
@@ -148,10 +153,13 @@
 	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
 	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
 	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
-	-apple | -axis | -knuth | -cray)
+	-apple | -axis | -knuth | -cray | -microblaze)
 		os=
 		basic_machine=$1
 		;;
+        -bluegene*)
+	        os=-cnk
+		;;
 	-sim | -cisco | -oki | -wec | -winbond)
 		os=
 		basic_machine=$1
@@ -249,6 +257,7 @@
 	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
 	| i370 | i860 | i960 | ia64 \
 	| ip2k | iq2000 \
+	| lm32 \
 	| m32c | m32r | m32rle | m68000 | m68k | m88k \
 	| maxq | mb | microblaze | mcore | mep | metag \
 	| mips | mipsbe | mipseb | mipsel | mipsle \
@@ -270,6 +279,7 @@
 	| mipsisa64sr71k | mipsisa64sr71kel \
 	| mipstx39 | mipstx39el \
 	| mn10200 | mn10300 \
+	| moxie \
 	| mt \
 	| msp430 \
 	| nios | nios2 \
@@ -278,20 +288,22 @@
 	| pdp10 | pdp11 | pj | pjl \
 	| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
 	| pyramid \
+	| rx \
 	| score \
-	| sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+	| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
 	| sh64 | sh64le \
 	| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
 	| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
 	| spu | strongarm \
 	| tahoe | thumb | tic4x | tic80 | tron \
+	| ubicom32 \
 	| v850 | v850e \
 	| we32k \
 	| x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
-	| z8k)
+	| z8k | z80)
 		basic_machine=$basic_machine-unknown
 		;;
-	m6811 | m68hc11 | m6812 | m68hc12)
+	m6811 | m68hc11 | m6812 | m68hc12 | picochip)
 		# Motorola 68HC11/12.
 		basic_machine=$basic_machine-unknown
 		os=-none
@@ -331,9 +343,10 @@
 	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
 	| i*86-* | i860-* | i960-* | ia64-* \
 	| ip2k-* | iq2000-* \
+	| lm32-* \
 	| m32c-* | m32r-* | m32rle-* \
 	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
-	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
+	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
 	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
 	| mips16-* \
 	| mips64-* | mips64el-* \
@@ -361,8 +374,8 @@
 	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
 	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
 	| pyramid-* \
-	| romp-* | rs6000-* \
-	| sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
+	| romp-* | rs6000-* | rx-* \
+	| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
 	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
 	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
 	| sparclite-* \
@@ -370,12 +383,13 @@
 	| tahoe-* | thumb-* \
 	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
 	| tron-* \
+	| ubicom32-* \
 	| v850-* | v850e-* | vax-* \
 	| we32k-* \
 	| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
 	| xstormy16-* | xtensa*-* \
 	| ymp-* \
-	| z8k-*)
+	| z8k-* | z80-*)
 		;;
 	# Recognize the basic CPU types without company name, with glob match.
 	xtensa*)
@@ -443,6 +457,10 @@
 		basic_machine=m68k-apollo
 		os=-bsd
 		;;
+	aros)
+		basic_machine=i386-pc
+		os=-aros
+		;;
 	aux)
 		basic_machine=m68k-apple
 		os=-aux
@@ -459,6 +477,10 @@
 		basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
 		os=-linux
 		;;
+	bluegene*)
+		basic_machine=powerpc-ibm
+		os=-cnk
+		;;
 	c90)
 		basic_machine=c90-cray
 		os=-unicos
@@ -711,6 +733,9 @@
 		basic_machine=ns32k-utek
 		os=-sysv
 		;;
+        microblaze)
+		basic_machine=microblaze-xilinx
+		;;
 	mingw32)
 		basic_machine=i386-pc
 		os=-mingw32
@@ -1140,6 +1165,10 @@
 		basic_machine=z8k-unknown
 		os=-sim
 		;;
+	z80-*-coff)
+		basic_machine=z80-unknown
+		os=-sim
+		;;
 	none)
 		basic_machine=none-none
 		os=-none
@@ -1178,7 +1207,7 @@
 	we32k)
 		basic_machine=we32k-att
 		;;
-	sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
+	sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
 		basic_machine=sh-unknown
 		;;
 	sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
@@ -1228,6 +1257,9 @@
         # First match some system type aliases
         # that might get confused with valid system types.
 	# -solaris* is a basic system type, with this one exception.
+        -auroraux)
+	        os=-auroraux
+		;;
 	-solaris1 | -solaris1.*)
 		os=`echo $os | sed -e 's|solaris1|sunos4|'`
 		;;
@@ -1248,10 +1280,11 @@
 	# Each alternative MUST END IN A *, to match a version number.
 	# -sysv* is not here because it comes later, after sysvr4.
 	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
-	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
-	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
+	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
+	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
+	      | -sym* | -kopensolaris* \
 	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
-	      | -aos* \
+	      | -aos* | -aros* \
 	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
 	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
 	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
@@ -1270,7 +1303,7 @@
 	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
 	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
 	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
-	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
+	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
 	# Remember, each alternative MUST END IN *, to match a version number.
 		;;
 	-qnx*)
@@ -1403,6 +1436,8 @@
 	-dicos*)
 		os=-dicos
 		;;
+        -nacl*)
+	        ;;
 	-none)
 		;;
 	*)
@@ -1600,7 +1635,7 @@
 			-sunos*)
 				vendor=sun
 				;;
-			-aix*)
+			-cnk*|-aix*)
 				vendor=ibm
 				;;
 			-beos*)
diff -Naur ncurses-5.7.orig/configure ncurses-5.7/configure
--- ncurses-5.7.orig/configure	2008-10-25 20:04:38.000000000 -0400
+++ ncurses-5.7/configure	2011-01-08 18:18:29.566655997 -0500
@@ -1,7 +1,7 @@
 #! /bin/sh
-# From configure.in Revision: 1.454 .
+# From configure.in Revision: 1.514 .
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by Autoconf 2.52.20080325.
+# Generated by Autoconf 2.52.20101001.
 #
 # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
 # Free Software Foundation, Inc.
@@ -697,8 +697,12 @@
   --without-cxx           do not adjust ncurses bool to match C++
   --without-cxx-binding   do not build C++ binding and demo
   --without-ada           suppress check for Ada95, don't build demo
+  --without-manpages      suppress install of manpages
   --without-progs         suppress build with programs (e.g., tic)
+  --without-tests         suppress build with test-programs
   --without-curses-h      install curses.h as ncurses.h only
+  --with-pkg-config{=path} enable/disable use of pkg-config
+  --enable-pc-files       generate and install .pc files for pkg-config
   --enable-mixed-case     tic should assume mixed-case filenames
   --with-install-prefix   prefixes actual install-location ($DESTDIR)
 Build-Tools Needed to Compile Temporary Applications for Cross-compiling:
@@ -709,6 +713,7 @@
   --with-build-ldflags=XXX the build linker-flags ($BUILD_LDFLAGS)
   --with-build-libs=XXX   the build libraries (${BUILD_LIBS})
 Options to Specify the Libraries Built/Used:
+  --disable-libtool-version  enable to use libtool's incompatible naming scheme
   --with-libtool          generate libraries with libtool
   --with-shared           generate shared-libraries
   --with-normal           generate normal-libraries (default)
@@ -722,6 +727,7 @@
   --enable-rpath          use rpath option when generating shared libraries
   --disable-relink        relink shared libraries during install
   --with-shlib-version=X  Specify rel or abi version for shared libs
+  --disable-rpath-hack    don't add rpath options for additional libraries
 Fine-Tuning Your Configuration:
   --disable-overwrite     leave out the link to -lcurses
   --disable-database      do not use terminfo, only fallbacks/termcap
@@ -752,6 +758,7 @@
   --with-chtype=TYPE      override type of chtype
   --with-ospeed=TYPE      override type of ospeed variable
   --with-mmask-t=TYPE     override type of mmask_t
+  --with-ccharw-max=XXX   override size CCHARW_MAX
   --with-rcs-ids          compile-in RCS identifiers
 Options to Specify How Manpages are Installed:
   --with-manpage-format   specify manpage-format: gzip/compress/BSDI/normal and
@@ -762,6 +769,8 @@
   --with-manpage-tbl      specify manpage processing with tbl
 Extensions:
   --disable-ext-funcs     disable function-extensions
+  --enable-sp-funcs       enable experimental SCREEN-extensions
+  --enable-term-driver    enable experimental terminal-driver
   --enable-const          compile with extra/non-standard const
   --enable-ext-colors     compile for 256-color support
   --enable-ext-mouse      compile for extended mouse-encoding
@@ -776,10 +785,13 @@
 Experimental Code:
   --disable-assumed-color do not assume anything about default-colors
   --disable-hashmap       compile without hashmap scrolling-optimization
-  --enable-colorfgbg      compile with $COLORFGBG code
+  --enable-colorfgbg      compile-in experimental $COLORFGBG code
+  --enable-interop        compile-in experimental interop bindings
   --with-pthread          use POSIX thread library
+  --enable-pthreads-eintr enable EINTR in wgetch with pthreads
   --enable-weak-symbols   enable weak-symbols for pthreads
   --enable-reentrant      compile with experimental reentrant code
+  --with-wrap-prefix=XXX  override prefix used for public variables
   --enable-safe-sprintf   compile with experimental safe-sprintf code
   --disable-scroll-hints  compile without scroll-hints code
   --enable-wgetch-events  compile with experimental wgetch-events code
@@ -796,8 +808,9 @@
   --with-trace            test: add trace() function to all models of ncurses
 Ada95 Binding Options:
   --with-ada-compiler=CMD specify Ada95 compiler command (default gnatmake)
-  --with-ada-include=DIR  Ada includes are in DIR (default: PREFIX/lib/ada/adainclude)
+  --with-ada-include=DIR  Ada includes are in DIR (default: PREFIX/share/ada/adainclude)
   --with-ada-objects=DIR  Ada objects are in DIR (default: PREFIX/lib/ada/adalib)
+  --with-ada-sharedlib=XX build Ada95 shared-library
 
 Some influential environment variables:
   CC          C compiler command
@@ -870,7 +883,7 @@
 running configure, to aid debugging if configure makes a mistake.
 
 It was created by $as_me, which was
-generated by GNU Autoconf 2.52.20080325.  Invocation command line was
+generated by GNU Autoconf 2.52.20101001.  Invocation command line was
 
   $ $0 $@
 
@@ -994,7 +1007,7 @@
 fi
 for ac_site_file in $CONFIG_SITE; do
   if test -r "$ac_site_file"; then
-    { echo "$as_me:997: loading site script $ac_site_file" >&5
+    { echo "$as_me:1010: loading site script $ac_site_file" >&5
 echo "$as_me: loading site script $ac_site_file" >&6;}
     cat "$ac_site_file" >&5
     . "$ac_site_file"
@@ -1005,7 +1018,7 @@
   # Some versions of bash will fail to source /dev/null (special
   # files actually), so we avoid doing that.
   if test -f "$cache_file"; then
-    { echo "$as_me:1008: loading cache $cache_file" >&5
+    { echo "$as_me:1021: loading cache $cache_file" >&5
 echo "$as_me: loading cache $cache_file" >&6;}
     case $cache_file in
       [\\/]* | ?:[\\/]* ) . $cache_file;;
@@ -1013,7 +1026,7 @@
     esac
   fi
 else
-  { echo "$as_me:1016: creating cache $cache_file" >&5
+  { echo "$as_me:1029: creating cache $cache_file" >&5
 echo "$as_me: creating cache $cache_file" >&6;}
   >$cache_file
 fi
@@ -1029,21 +1042,21 @@
   eval ac_new_val="\$ac_env_${ac_var}_value"
   case $ac_old_set,$ac_new_set in
     set,)
-      { echo "$as_me:1032: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+      { echo "$as_me:1045: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
       ac_cache_corrupted=: ;;
     ,set)
-      { echo "$as_me:1036: error: \`$ac_var' was not set in the previous run" >&5
+      { echo "$as_me:1049: error: \`$ac_var' was not set in the previous run" >&5
 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
       ac_cache_corrupted=: ;;
     ,);;
     *)
       if test "x$ac_old_val" != "x$ac_new_val"; then
-        { echo "$as_me:1042: error: \`$ac_var' has changed since the previous run:" >&5
+        { echo "$as_me:1055: error: \`$ac_var' has changed since the previous run:" >&5
 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
-        { echo "$as_me:1044:   former value:  $ac_old_val" >&5
+        { echo "$as_me:1057:   former value:  $ac_old_val" >&5
 echo "$as_me:   former value:  $ac_old_val" >&2;}
-        { echo "$as_me:1046:   current value: $ac_new_val" >&5
+        { echo "$as_me:1059:   current value: $ac_new_val" >&5
 echo "$as_me:   current value: $ac_new_val" >&2;}
         ac_cache_corrupted=:
       fi;;
@@ -1062,9 +1075,9 @@
   fi
 done
 if $ac_cache_corrupted; then
-  { echo "$as_me:1065: error: changes in the environment can compromise the build" >&5
+  { echo "$as_me:1078: error: changes in the environment can compromise the build" >&5
 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
-  { { echo "$as_me:1067: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+  { { echo "$as_me:1080: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
    { (exit 1); exit 1; }; }
 fi
@@ -1085,10 +1098,10 @@
 echo "#! $SHELL" >conftest.sh
 echo  "exit 0"   >>conftest.sh
 chmod +x conftest.sh
-if { (echo "$as_me:1088: PATH=\".;.\"; conftest.sh") >&5
+if { (echo "$as_me:1101: PATH=\".;.\"; conftest.sh") >&5
   (PATH=".;."; conftest.sh) 2>&5
   ac_status=$?
-  echo "$as_me:1091: \$? = $ac_status" >&5
+  echo "$as_me:1104: \$? = $ac_status" >&5
   (exit $ac_status); }; then
   ac_path_separator=';'
 else
@@ -1101,7 +1114,7 @@
 
 top_builddir=`pwd`
 
-echo "$as_me:1104: checking for egrep" >&5
+echo "$as_me:1117: checking for egrep" >&5
 echo $ECHO_N "checking for egrep... $ECHO_C" >&6
 if test "${ac_cv_prog_egrep+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1111,11 +1124,11 @@
     else ac_cv_prog_egrep='egrep'
     fi
 fi
-echo "$as_me:1114: result: $ac_cv_prog_egrep" >&5
+echo "$as_me:1127: result: $ac_cv_prog_egrep" >&5
 echo "${ECHO_T}$ac_cv_prog_egrep" >&6
  EGREP=$ac_cv_prog_egrep
 
-test -z "$EGREP" && { { echo "$as_me:1118: error: No egrep program found" >&5
+test -z "$EGREP" && { { echo "$as_me:1131: error: No egrep program found" >&5
 echo "$as_me: error: No egrep program found" >&2;}
    { (exit 1); exit 1; }; }
 
@@ -1125,7 +1138,7 @@
 cf_cv_abi_version=${NCURSES_MAJOR}
 cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR}
 cf_cv_timestamp=`date`
-echo "$as_me:1128: result: Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&5
+echo "$as_me:1141: result: Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&5
 echo "${ECHO_T}Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&6
 
 test -z "$cf_cv_rel_version" && cf_cv_rel_version=0.0
@@ -1133,7 +1146,7 @@
 # Check whether --with-rel-version or --without-rel-version was given.
 if test "${with_rel_version+set}" = set; then
   withval="$with_rel_version"
-  { echo "$as_me:1136: WARNING: overriding release version $cf_cv_rel_version to $withval" >&5
+  { echo "$as_me:1149: WARNING: overriding release version $cf_cv_rel_version to $withval" >&5
 echo "$as_me: WARNING: overriding release version $cf_cv_rel_version to $withval" >&2;}
  cf_cv_rel_version=$withval
 fi;
@@ -1146,13 +1159,13 @@
   [0-9]*) #(vi
  	;;
   *)
-	{ { echo "$as_me:1149: error: Release major-version is not a number: $NCURSES_MAJOR" >&5
+	{ { echo "$as_me:1162: error: Release major-version is not a number: $NCURSES_MAJOR" >&5
 echo "$as_me: error: Release major-version is not a number: $NCURSES_MAJOR" >&2;}
    { (exit 1); exit 1; }; }
  	;;
   esac
 else
-  { { echo "$as_me:1155: error: Release major-version value is empty" >&5
+  { { echo "$as_me:1168: error: Release major-version value is empty" >&5
 echo "$as_me: error: Release major-version value is empty" >&2;}
    { (exit 1); exit 1; }; }
 fi
@@ -1162,13 +1175,13 @@
   [0-9]*) #(vi
  	;;
   *)
-	{ { echo "$as_me:1165: error: Release minor-version is not a number: $NCURSES_MINOR" >&5
+	{ { echo "$as_me:1178: error: Release minor-version is not a number: $NCURSES_MINOR" >&5
 echo "$as_me: error: Release minor-version is not a number: $NCURSES_MINOR" >&2;}
    { (exit 1); exit 1; }; }
  	;;
   esac
 else
-  { { echo "$as_me:1171: error: Release minor-version value is empty" >&5
+  { { echo "$as_me:1184: error: Release minor-version value is empty" >&5
 echo "$as_me: error: Release minor-version value is empty" >&2;}
    { (exit 1); exit 1; }; }
 fi
@@ -1178,7 +1191,7 @@
 # Check whether --with-abi-version or --without-abi-version was given.
 if test "${with_abi_version+set}" = set; then
   withval="$with_abi_version"
-  { echo "$as_me:1181: WARNING: overriding ABI version $cf_cv_abi_version to $withval" >&5
+  { echo "$as_me:1194: WARNING: overriding ABI version $cf_cv_abi_version to $withval" >&5
 echo "$as_me: WARNING: overriding ABI version $cf_cv_abi_version to $withval" >&2;}
  cf_cv_abi_version=$withval
 fi;
@@ -1188,13 +1201,13 @@
   [0-9]*) #(vi
  	;;
   *)
-	{ { echo "$as_me:1191: error: ABI version is not a number: $cf_cv_abi_version" >&5
+	{ { echo "$as_me:1204: error: ABI version is not a number: $cf_cv_abi_version" >&5
 echo "$as_me: error: ABI version is not a number: $cf_cv_abi_version" >&2;}
    { (exit 1); exit 1; }; }
  	;;
   esac
 else
-  { { echo "$as_me:1197: error: ABI version value is empty" >&5
+  { { echo "$as_me:1210: error: ABI version value is empty" >&5
 echo "$as_me: error: ABI version value is empty" >&2;}
    { (exit 1); exit 1; }; }
 fi
@@ -1216,7 +1229,7 @@
   fi
 done
 if test -z "$ac_aux_dir"; then
-  { { echo "$as_me:1219: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
+  { { echo "$as_me:1232: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
    { (exit 1); exit 1; }; }
 fi
@@ -1226,11 +1239,11 @@
 
 # Make sure we can run config.sub.
 $ac_config_sub sun4 >/dev/null 2>&1 ||
-  { { echo "$as_me:1229: error: cannot run $ac_config_sub" >&5
+  { { echo "$as_me:1242: error: cannot run $ac_config_sub" >&5
 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
    { (exit 1); exit 1; }; }
 
-echo "$as_me:1233: checking build system type" >&5
+echo "$as_me:1246: checking build system type" >&5
 echo $ECHO_N "checking build system type... $ECHO_C" >&6
 if test "${ac_cv_build+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1239,23 +1252,23 @@
 test -z "$ac_cv_build_alias" &&
   ac_cv_build_alias=`$ac_config_guess`
 test -z "$ac_cv_build_alias" &&
-  { { echo "$as_me:1242: error: cannot guess build type; you must specify one" >&5
+  { { echo "$as_me:1255: error: cannot guess build type; you must specify one" >&5
 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
    { (exit 1); exit 1; }; }
 ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
-  { { echo "$as_me:1246: error: $ac_config_sub $ac_cv_build_alias failed." >&5
+  { { echo "$as_me:1259: error: $ac_config_sub $ac_cv_build_alias failed." >&5
 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
    { (exit 1); exit 1; }; }
 
 fi
-echo "$as_me:1251: result: $ac_cv_build" >&5
+echo "$as_me:1264: result: $ac_cv_build" >&5
 echo "${ECHO_T}$ac_cv_build" >&6
 build=$ac_cv_build
 build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
 build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
 build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
 
-echo "$as_me:1258: checking host system type" >&5
+echo "$as_me:1271: checking host system type" >&5
 echo $ECHO_N "checking host system type... $ECHO_C" >&6
 if test "${ac_cv_host+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1264,12 +1277,12 @@
 test -z "$ac_cv_host_alias" &&
   ac_cv_host_alias=$ac_cv_build_alias
 ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
-  { { echo "$as_me:1267: error: $ac_config_sub $ac_cv_host_alias failed" >&5
+  { { echo "$as_me:1280: error: $ac_config_sub $ac_cv_host_alias failed" >&5
 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
    { (exit 1); exit 1; }; }
 
 fi
-echo "$as_me:1272: result: $ac_cv_host" >&5
+echo "$as_me:1285: result: $ac_cv_host" >&5
 echo "${ECHO_T}$ac_cv_host" >&6
 host=$ac_cv_host
 host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
@@ -1277,7 +1290,7 @@
 host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
 
 if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
-	echo "$as_me:1280: checking target system type" >&5
+	echo "$as_me:1293: checking target system type" >&5
 echo $ECHO_N "checking target system type... $ECHO_C" >&6
 if test "${ac_cv_target+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1286,12 +1299,12 @@
 test "x$ac_cv_target_alias" = "x" &&
   ac_cv_target_alias=$ac_cv_host_alias
 ac_cv_target=`$ac_config_sub $ac_cv_target_alias` ||
-  { { echo "$as_me:1289: error: $ac_config_sub $ac_cv_target_alias failed" >&5
+  { { echo "$as_me:1302: error: $ac_config_sub $ac_cv_target_alias failed" >&5
 echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;}
    { (exit 1); exit 1; }; }
 
 fi
-echo "$as_me:1294: result: $ac_cv_target" >&5
+echo "$as_me:1307: result: $ac_cv_target" >&5
 echo "${ECHO_T}$ac_cv_target" >&6
 target=$ac_cv_target
 target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
@@ -1322,13 +1335,13 @@
 fi
 
 test -z "$system_name" && system_name="$cf_cv_system_name"
-test -n "$cf_cv_system_name" && echo "$as_me:1325: result: Configuring for $cf_cv_system_name" >&5
+test -n "$cf_cv_system_name" && echo "$as_me:1338: result: Configuring for $cf_cv_system_name" >&5
 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
 
 if test ".$system_name" != ".$cf_cv_system_name" ; then
-	echo "$as_me:1329: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
+	echo "$as_me:1342: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
-	{ { echo "$as_me:1331: error: \"Please remove config.cache and try again.\"" >&5
+	{ { echo "$as_me:1344: error: \"Please remove config.cache and try again.\"" >&5
 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
    { (exit 1); exit 1; }; }
 fi
@@ -1336,7 +1349,7 @@
 # Check whether --with-system-type or --without-system-type was given.
 if test "${with_system_type+set}" = set; then
   withval="$with_system_type"
-  { echo "$as_me:1339: WARNING: overriding system type to $withval" >&5
+  { echo "$as_me:1352: WARNING: overriding system type to $withval" >&5
 echo "$as_me: WARNING: overriding system type to $withval" >&2;}
  cf_cv_system_name=$withval
 fi;
@@ -1346,7 +1359,7 @@
 
 ###	Default install-location
 
-echo "$as_me:1349: checking for prefix" >&5
+echo "$as_me:1362: checking for prefix" >&5
 echo $ECHO_N "checking for prefix... $ECHO_C" >&6
 if test "x$prefix" = "xNONE" ; then
 	case "$cf_cv_system_name" in
@@ -1358,11 +1371,11 @@
 		;;
 	esac
 fi
-echo "$as_me:1361: result: $prefix" >&5
+echo "$as_me:1374: result: $prefix" >&5
 echo "${ECHO_T}$prefix" >&6
 
 if test "x$prefix" = "xNONE" ; then
-echo "$as_me:1365: checking for default include-directory" >&5
+echo "$as_me:1378: checking for default include-directory" >&5
 echo $ECHO_N "checking for default include-directory... $ECHO_C" >&6
 test -n "$verbose" && echo 1>&6
 for cf_symbol in \
@@ -1385,7 +1398,7 @@
 	fi
 	test -n "$verbose"  && echo "	tested $cf_dir" 1>&6
 done
-echo "$as_me:1388: result: $includedir" >&5
+echo "$as_me:1401: result: $includedir" >&5
 echo "${ECHO_T}$includedir" >&6
 fi
 
@@ -1399,7 +1412,7 @@
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
 set dummy ${ac_tool_prefix}gcc; ac_word=$2
-echo "$as_me:1402: checking for $ac_word" >&5
+echo "$as_me:1415: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_CC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1414,7 +1427,7 @@
   test -z "$ac_dir" && ac_dir=.
   $as_executable_p "$ac_dir/$ac_word" || continue
 ac_cv_prog_CC="${ac_tool_prefix}gcc"
-echo "$as_me:1417: found $ac_dir/$ac_word" >&5
+echo "$as_me:1430: found $ac_dir/$ac_word" >&5
 break
 done
 
@@ -1422,10 +1435,10 @@
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  echo "$as_me:1425: result: $CC" >&5
+  echo "$as_me:1438: result: $CC" >&5
 echo "${ECHO_T}$CC" >&6
 else
-  echo "$as_me:1428: result: no" >&5
+  echo "$as_me:1441: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -1434,7 +1447,7 @@
   ac_ct_CC=$CC
   # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
-echo "$as_me:1437: checking for $ac_word" >&5
+echo "$as_me:1450: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1449,7 +1462,7 @@
   test -z "$ac_dir" && ac_dir=.
   $as_executable_p "$ac_dir/$ac_word" || continue
 ac_cv_prog_ac_ct_CC="gcc"
-echo "$as_me:1452: found $ac_dir/$ac_word" >&5
+echo "$as_me:1465: found $ac_dir/$ac_word" >&5
 break
 done
 
@@ -1457,10 +1470,10 @@
 fi
 ac_ct_CC=$ac_cv_prog_ac_ct_CC
 if test -n "$ac_ct_CC"; then
-  echo "$as_me:1460: result: $ac_ct_CC" >&5
+  echo "$as_me:1473: result: $ac_ct_CC" >&5
 echo "${ECHO_T}$ac_ct_CC" >&6
 else
-  echo "$as_me:1463: result: no" >&5
+  echo "$as_me:1476: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -1473,7 +1486,7 @@
   if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
 set dummy ${ac_tool_prefix}cc; ac_word=$2
-echo "$as_me:1476: checking for $ac_word" >&5
+echo "$as_me:1489: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_CC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1488,7 +1501,7 @@
   test -z "$ac_dir" && ac_dir=.
   $as_executable_p "$ac_dir/$ac_word" || continue
 ac_cv_prog_CC="${ac_tool_prefix}cc"
-echo "$as_me:1491: found $ac_dir/$ac_word" >&5
+echo "$as_me:1504: found $ac_dir/$ac_word" >&5
 break
 done
 
@@ -1496,10 +1509,10 @@
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  echo "$as_me:1499: result: $CC" >&5
+  echo "$as_me:1512: result: $CC" >&5
 echo "${ECHO_T}$CC" >&6
 else
-  echo "$as_me:1502: result: no" >&5
+  echo "$as_me:1515: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -1508,7 +1521,7 @@
   ac_ct_CC=$CC
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
-echo "$as_me:1511: checking for $ac_word" >&5
+echo "$as_me:1524: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1523,7 +1536,7 @@
   test -z "$ac_dir" && ac_dir=.
   $as_executable_p "$ac_dir/$ac_word" || continue
 ac_cv_prog_ac_ct_CC="cc"
-echo "$as_me:1526: found $ac_dir/$ac_word" >&5
+echo "$as_me:1539: found $ac_dir/$ac_word" >&5
 break
 done
 
@@ -1531,10 +1544,10 @@
 fi
 ac_ct_CC=$ac_cv_prog_ac_ct_CC
 if test -n "$ac_ct_CC"; then
-  echo "$as_me:1534: result: $ac_ct_CC" >&5
+  echo "$as_me:1547: result: $ac_ct_CC" >&5
 echo "${ECHO_T}$ac_ct_CC" >&6
 else
-  echo "$as_me:1537: result: no" >&5
+  echo "$as_me:1550: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -1547,7 +1560,7 @@
 if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
-echo "$as_me:1550: checking for $ac_word" >&5
+echo "$as_me:1563: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_CC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1567,7 +1580,7 @@
   continue
 fi
 ac_cv_prog_CC="cc"
-echo "$as_me:1570: found $ac_dir/$ac_word" >&5
+echo "$as_me:1583: found $ac_dir/$ac_word" >&5
 break
 done
 
@@ -1589,10 +1602,10 @@
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  echo "$as_me:1592: result: $CC" >&5
+  echo "$as_me:1605: result: $CC" >&5
 echo "${ECHO_T}$CC" >&6
 else
-  echo "$as_me:1595: result: no" >&5
+  echo "$as_me:1608: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -1603,7 +1616,7 @@
   do
     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-echo "$as_me:1606: checking for $ac_word" >&5
+echo "$as_me:1619: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_CC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1618,7 +1631,7 @@
   test -z "$ac_dir" && ac_dir=.
   $as_executable_p "$ac_dir/$ac_word" || continue
 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
-echo "$as_me:1621: found $ac_dir/$ac_word" >&5
+echo "$as_me:1634: found $ac_dir/$ac_word" >&5
 break
 done
 
@@ -1626,10 +1639,10 @@
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  echo "$as_me:1629: result: $CC" >&5
+  echo "$as_me:1642: result: $CC" >&5
 echo "${ECHO_T}$CC" >&6
 else
-  echo "$as_me:1632: result: no" >&5
+  echo "$as_me:1645: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -1642,7 +1655,7 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-echo "$as_me:1645: checking for $ac_word" >&5
+echo "$as_me:1658: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1657,7 +1670,7 @@
   test -z "$ac_dir" && ac_dir=.
   $as_executable_p "$ac_dir/$ac_word" || continue
 ac_cv_prog_ac_ct_CC="$ac_prog"
-echo "$as_me:1660: found $ac_dir/$ac_word" >&5
+echo "$as_me:1673: found $ac_dir/$ac_word" >&5
 break
 done
 
@@ -1665,10 +1678,10 @@
 fi
 ac_ct_CC=$ac_cv_prog_ac_ct_CC
 if test -n "$ac_ct_CC"; then
-  echo "$as_me:1668: result: $ac_ct_CC" >&5
+  echo "$as_me:1681: result: $ac_ct_CC" >&5
 echo "${ECHO_T}$ac_ct_CC" >&6
 else
-  echo "$as_me:1671: result: no" >&5
+  echo "$as_me:1684: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -1680,32 +1693,32 @@
 
 fi
 
-test -z "$CC" && { { echo "$as_me:1683: error: no acceptable cc found in \$PATH" >&5
+test -z "$CC" && { { echo "$as_me:1696: error: no acceptable cc found in \$PATH" >&5
 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
    { (exit 1); exit 1; }; }
 
 # Provide some information about the compiler.
-echo "$as_me:1688:" \
+echo "$as_me:1701:" \
      "checking for C compiler version" >&5
 ac_compiler=`set X $ac_compile; echo $2`
-{ (eval echo "$as_me:1691: \"$ac_compiler --version </dev/null >&5\"") >&5
+{ (eval echo "$as_me:1704: \"$ac_compiler --version </dev/null >&5\"") >&5
   (eval $ac_compiler --version </dev/null >&5) 2>&5
   ac_status=$?
-  echo "$as_me:1694: \$? = $ac_status" >&5
+  echo "$as_me:1707: \$? = $ac_status" >&5
   (exit $ac_status); }
-{ (eval echo "$as_me:1696: \"$ac_compiler -v </dev/null >&5\"") >&5
+{ (eval echo "$as_me:1709: \"$ac_compiler -v </dev/null >&5\"") >&5
   (eval $ac_compiler -v </dev/null >&5) 2>&5
   ac_status=$?
-  echo "$as_me:1699: \$? = $ac_status" >&5
+  echo "$as_me:1712: \$? = $ac_status" >&5
   (exit $ac_status); }
-{ (eval echo "$as_me:1701: \"$ac_compiler -V </dev/null >&5\"") >&5
+{ (eval echo "$as_me:1714: \"$ac_compiler -V </dev/null >&5\"") >&5
   (eval $ac_compiler -V </dev/null >&5) 2>&5
   ac_status=$?
-  echo "$as_me:1704: \$? = $ac_status" >&5
+  echo "$as_me:1717: \$? = $ac_status" >&5
   (exit $ac_status); }
 
 cat >conftest.$ac_ext <<_ACEOF
-#line 1708 "configure"
+#line 1721 "configure"
 #include "confdefs.h"
 
 int
@@ -1721,13 +1734,13 @@
 # Try to create an executable without -o first, disregard a.out.
 # It will help us diagnose broken compilers, and finding out an intuition
 # of exeext.
-echo "$as_me:1724: checking for C compiler default output" >&5
+echo "$as_me:1737: checking for C compiler default output" >&5
 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
-if { (eval echo "$as_me:1727: \"$ac_link_default\"") >&5
+if { (eval echo "$as_me:1740: \"$ac_link_default\"") >&5
   (eval $ac_link_default) 2>&5
   ac_status=$?
-  echo "$as_me:1730: \$? = $ac_status" >&5
+  echo "$as_me:1743: \$? = $ac_status" >&5
   (exit $ac_status); }; then
   # Find the output, starting from the most likely.  This scheme is
 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
@@ -1736,7 +1749,7 @@
                 ls a.out conftest 2>/dev/null;
                 ls a.* conftest.* 2>/dev/null`; do
   case $ac_file in
-    *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;;
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
     a.out ) # We found the default executable, but exeext='' is most
             # certainly right.
             break;;
@@ -1750,34 +1763,34 @@
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-{ { echo "$as_me:1753: error: C compiler cannot create executables" >&5
+{ { echo "$as_me:1766: error: C compiler cannot create executables" >&5
 echo "$as_me: error: C compiler cannot create executables" >&2;}
    { (exit 77); exit 77; }; }
 fi
 
 ac_exeext=$ac_cv_exeext
-echo "$as_me:1759: result: $ac_file" >&5
+echo "$as_me:1772: result: $ac_file" >&5
 echo "${ECHO_T}$ac_file" >&6
 
 # Check the compiler produces executables we can run.  If not, either
 # the compiler is broken, or we cross compile.
-echo "$as_me:1764: checking whether the C compiler works" >&5
+echo "$as_me:1777: checking whether the C compiler works" >&5
 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
 # If not cross compiling, check that we can run a simple program.
 if test "$cross_compiling" != yes; then
   if { ac_try='./$ac_file'
-  { (eval echo "$as_me:1770: \"$ac_try\"") >&5
+  { (eval echo "$as_me:1783: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:1773: \$? = $ac_status" >&5
+  echo "$as_me:1786: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
     cross_compiling=no
   else
     if test "$cross_compiling" = maybe; then
 	cross_compiling=yes
     else
-	{ { echo "$as_me:1780: error: cannot run C compiled programs.
+	{ { echo "$as_me:1793: error: cannot run C compiled programs.
 If you meant to cross compile, use \`--host'." >&5
 echo "$as_me: error: cannot run C compiled programs.
 If you meant to cross compile, use \`--host'." >&2;}
@@ -1785,24 +1798,24 @@
     fi
   fi
 fi
-echo "$as_me:1788: result: yes" >&5
+echo "$as_me:1801: result: yes" >&5
 echo "${ECHO_T}yes" >&6
 
 rm -f a.out a.exe conftest$ac_cv_exeext
 ac_clean_files=$ac_clean_files_save
 # Check the compiler produces executables we can run.  If not, either
 # the compiler is broken, or we cross compile.
-echo "$as_me:1795: checking whether we are cross compiling" >&5
+echo "$as_me:1808: checking whether we are cross compiling" >&5
 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
-echo "$as_me:1797: result: $cross_compiling" >&5
+echo "$as_me:1810: result: $cross_compiling" >&5
 echo "${ECHO_T}$cross_compiling" >&6
 
-echo "$as_me:1800: checking for executable suffix" >&5
+echo "$as_me:1813: checking for executable suffix" >&5
 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
-if { (eval echo "$as_me:1802: \"$ac_link\"") >&5
+if { (eval echo "$as_me:1815: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:1805: \$? = $ac_status" >&5
+  echo "$as_me:1818: \$? = $ac_status" >&5
   (exit $ac_status); }; then
   # If both `conftest.exe' and `conftest' are `present' (well, observable)
 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
@@ -1810,7 +1823,7 @@
 # `rm'.
 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
   case $ac_file in
-    *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;;
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
           export ac_cv_exeext
           break;;
@@ -1818,25 +1831,25 @@
   esac
 done
 else
-  { { echo "$as_me:1821: error: cannot compute EXEEXT: cannot compile and link" >&5
+  { { echo "$as_me:1834: error: cannot compute EXEEXT: cannot compile and link" >&5
 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
    { (exit 1); exit 1; }; }
 fi
 
 rm -f conftest$ac_cv_exeext
-echo "$as_me:1827: result: $ac_cv_exeext" >&5
+echo "$as_me:1840: result: $ac_cv_exeext" >&5
 echo "${ECHO_T}$ac_cv_exeext" >&6
 
 rm -f conftest.$ac_ext
 EXEEXT=$ac_cv_exeext
 ac_exeext=$EXEEXT
-echo "$as_me:1833: checking for object suffix" >&5
+echo "$as_me:1846: checking for object suffix" >&5
 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
 if test "${ac_cv_objext+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 1839 "configure"
+#line 1852 "configure"
 #include "confdefs.h"
 
 int
@@ -1848,14 +1861,14 @@
 }
 _ACEOF
 rm -f conftest.o conftest.obj
-if { (eval echo "$as_me:1851: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:1864: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:1854: \$? = $ac_status" >&5
+  echo "$as_me:1867: \$? = $ac_status" >&5
   (exit $ac_status); }; then
   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
   case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb ) ;;
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
        break;;
   esac
@@ -1863,24 +1876,24 @@
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-{ { echo "$as_me:1866: error: cannot compute OBJEXT: cannot compile" >&5
+{ { echo "$as_me:1879: error: cannot compute OBJEXT: cannot compile" >&5
 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
    { (exit 1); exit 1; }; }
 fi
 
 rm -f conftest.$ac_cv_objext conftest.$ac_ext
 fi
-echo "$as_me:1873: result: $ac_cv_objext" >&5
+echo "$as_me:1886: result: $ac_cv_objext" >&5
 echo "${ECHO_T}$ac_cv_objext" >&6
 OBJEXT=$ac_cv_objext
 ac_objext=$OBJEXT
-echo "$as_me:1877: checking whether we are using the GNU C compiler" >&5
+echo "$as_me:1890: checking whether we are using the GNU C compiler" >&5
 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
 if test "${ac_cv_c_compiler_gnu+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 1883 "configure"
+#line 1896 "configure"
 #include "confdefs.h"
 
 int
@@ -1895,16 +1908,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:1898: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:1911: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:1901: \$? = $ac_status" >&5
+  echo "$as_me:1914: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:1904: \"$ac_try\"") >&5
+  { (eval echo "$as_me:1917: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:1907: \$? = $ac_status" >&5
+  echo "$as_me:1920: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_compiler_gnu=yes
 else
@@ -1916,19 +1929,19 @@
 ac_cv_c_compiler_gnu=$ac_compiler_gnu
 
 fi
-echo "$as_me:1919: result: $ac_cv_c_compiler_gnu" >&5
+echo "$as_me:1932: result: $ac_cv_c_compiler_gnu" >&5
 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
 GCC=`test $ac_compiler_gnu = yes && echo yes`
 ac_test_CFLAGS=${CFLAGS+set}
 ac_save_CFLAGS=$CFLAGS
 CFLAGS="-g"
-echo "$as_me:1925: checking whether $CC accepts -g" >&5
+echo "$as_me:1938: checking whether $CC accepts -g" >&5
 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
 if test "${ac_cv_prog_cc_g+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 1931 "configure"
+#line 1944 "configure"
 #include "confdefs.h"
 
 int
@@ -1940,16 +1953,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:1943: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:1956: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:1946: \$? = $ac_status" >&5
+  echo "$as_me:1959: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:1949: \"$ac_try\"") >&5
+  { (eval echo "$as_me:1962: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:1952: \$? = $ac_status" >&5
+  echo "$as_me:1965: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_prog_cc_g=yes
 else
@@ -1959,7 +1972,7 @@
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:1962: result: $ac_cv_prog_cc_g" >&5
+echo "$as_me:1975: result: $ac_cv_prog_cc_g" >&5
 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
 if test "$ac_test_CFLAGS" = set; then
   CFLAGS=$ac_save_CFLAGS
@@ -1986,16 +1999,16 @@
 #endif
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:1989: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:2002: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:1992: \$? = $ac_status" >&5
+  echo "$as_me:2005: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:1995: \"$ac_try\"") >&5
+  { (eval echo "$as_me:2008: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:1998: \$? = $ac_status" >&5
+  echo "$as_me:2011: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   for ac_declaration in \
    ''\
@@ -2007,7 +2020,7 @@
    'void exit (int);'
 do
   cat >conftest.$ac_ext <<_ACEOF
-#line 2010 "configure"
+#line 2023 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 $ac_declaration
@@ -2020,16 +2033,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:2023: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:2036: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:2026: \$? = $ac_status" >&5
+  echo "$as_me:2039: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:2029: \"$ac_try\"") >&5
+  { (eval echo "$as_me:2042: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:2032: \$? = $ac_status" >&5
+  echo "$as_me:2045: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
@@ -2039,7 +2052,7 @@
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
   cat >conftest.$ac_ext <<_ACEOF
-#line 2042 "configure"
+#line 2055 "configure"
 #include "confdefs.h"
 $ac_declaration
 int
@@ -2051,16 +2064,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:2054: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:2067: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:2057: \$? = $ac_status" >&5
+  echo "$as_me:2070: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:2060: \"$ac_try\"") >&5
+  { (eval echo "$as_me:2073: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:2063: \$? = $ac_status" >&5
+  echo "$as_me:2076: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   break
 else
@@ -2069,7 +2082,7 @@
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 done
-rm -f conftest*
+rm -rf conftest*
 if test -n "$ac_declaration"; then
   echo '#ifdef __cplusplus' >>confdefs.h
   echo $ac_declaration      >>confdefs.h
@@ -2090,11 +2103,11 @@
 
 GCC_VERSION=none
 if test "$GCC" = yes ; then
-	echo "$as_me:2093: checking version of $CC" >&5
+	echo "$as_me:2106: checking version of $CC" >&5
 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
-	GCC_VERSION="`${CC} --version| sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
+	GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
 	test -z "$GCC_VERSION" && GCC_VERSION=unknown
-	echo "$as_me:2097: result: $GCC_VERSION" >&5
+	echo "$as_me:2110: result: $GCC_VERSION" >&5
 echo "${ECHO_T}$GCC_VERSION" >&6
 fi
 
@@ -2104,7 +2117,7 @@
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 ac_main_return=return
-echo "$as_me:2107: checking how to run the C preprocessor" >&5
+echo "$as_me:2120: checking how to run the C preprocessor" >&5
 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
@@ -2125,18 +2138,18 @@
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp. "Syntax error" is here to catch this case.
   cat >conftest.$ac_ext <<_ACEOF
-#line 2128 "configure"
+#line 2141 "configure"
 #include "confdefs.h"
 #include <assert.h>
                      Syntax error
 _ACEOF
-if { (eval echo "$as_me:2133: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:2146: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
   egrep -v '^ *\+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:2139: \$? = $ac_status" >&5
+  echo "$as_me:2152: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -2159,17 +2172,17 @@
   # OK, works on sane cases.  Now check whether non-existent headers
   # can be detected and how.
   cat >conftest.$ac_ext <<_ACEOF
-#line 2162 "configure"
+#line 2175 "configure"
 #include "confdefs.h"
 #include <ac_nonexistent.h>
 _ACEOF
-if { (eval echo "$as_me:2166: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:2179: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
   egrep -v '^ *\+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:2172: \$? = $ac_status" >&5
+  echo "$as_me:2185: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -2206,7 +2219,7 @@
 else
   ac_cv_prog_CPP=$CPP
 fi
-echo "$as_me:2209: result: $CPP" >&5
+echo "$as_me:2222: result: $CPP" >&5
 echo "${ECHO_T}$CPP" >&6
 ac_preproc_ok=false
 for ac_c_preproc_warn_flag in '' yes
@@ -2216,18 +2229,18 @@
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp. "Syntax error" is here to catch this case.
   cat >conftest.$ac_ext <<_ACEOF
-#line 2219 "configure"
+#line 2232 "configure"
 #include "confdefs.h"
 #include <assert.h>
                      Syntax error
 _ACEOF
-if { (eval echo "$as_me:2224: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:2237: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
   egrep -v '^ *\+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:2230: \$? = $ac_status" >&5
+  echo "$as_me:2243: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -2250,17 +2263,17 @@
   # OK, works on sane cases.  Now check whether non-existent headers
   # can be detected and how.
   cat >conftest.$ac_ext <<_ACEOF
-#line 2253 "configure"
+#line 2266 "configure"
 #include "confdefs.h"
 #include <ac_nonexistent.h>
 _ACEOF
-if { (eval echo "$as_me:2257: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:2270: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
   egrep -v '^ *\+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:2263: \$? = $ac_status" >&5
+  echo "$as_me:2276: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -2288,7 +2301,7 @@
 if $ac_preproc_ok; then
   :
 else
-  { { echo "$as_me:2291: error: C preprocessor \"$CPP\" fails sanity check" >&5
+  { { echo "$as_me:2304: error: C preprocessor \"$CPP\" fails sanity check" >&5
 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
    { (exit 1); exit 1; }; }
 fi
@@ -2301,14 +2314,14 @@
 ac_main_return=return
 
 if test $ac_cv_c_compiler_gnu = yes; then
-    echo "$as_me:2304: checking whether $CC needs -traditional" >&5
+    echo "$as_me:2317: checking whether $CC needs -traditional" >&5
 echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6
 if test "${ac_cv_prog_gcc_traditional+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
     ac_pattern="Autoconf.*'x'"
   cat >conftest.$ac_ext <<_ACEOF
-#line 2311 "configure"
+#line 2324 "configure"
 #include "confdefs.h"
 #include <sgtty.h>
 int Autoconf = TIOCGETP;
@@ -2319,11 +2332,11 @@
 else
   ac_cv_prog_gcc_traditional=no
 fi
-rm -f conftest*
+rm -rf conftest*
 
   if test $ac_cv_prog_gcc_traditional = no; then
     cat >conftest.$ac_ext <<_ACEOF
-#line 2326 "configure"
+#line 2339 "configure"
 #include "confdefs.h"
 #include <termio.h>
 int Autoconf = TCGETA;
@@ -2332,18 +2345,18 @@
   egrep "$ac_pattern" >/dev/null 2>&1; then
   ac_cv_prog_gcc_traditional=yes
 fi
-rm -f conftest*
+rm -rf conftest*
 
   fi
 fi
-echo "$as_me:2339: result: $ac_cv_prog_gcc_traditional" >&5
+echo "$as_me:2352: result: $ac_cv_prog_gcc_traditional" >&5
 echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6
   if test $ac_cv_prog_gcc_traditional = yes; then
     CC="$CC -traditional"
   fi
 fi
 
-echo "$as_me:2346: checking whether $CC understands -c and -o together" >&5
+echo "$as_me:2359: checking whether $CC understands -c and -o together" >&5
 echo $ECHO_N "checking whether $CC understands -c and -o together... $ECHO_C" >&6
 if test "${cf_cv_prog_CC_c_o+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -2359,38 +2372,38 @@
 # We do the test twice because some compilers refuse to overwrite an
 # existing .o file with -o, though they will create one.
 ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
-if { (eval echo "$as_me:2362: \"$ac_try\"") >&5
+if { (eval echo "$as_me:2375: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:2365: \$? = $ac_status" >&5
+  echo "$as_me:2378: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-  test -f conftest2.$ac_objext && { (eval echo "$as_me:2367: \"$ac_try\"") >&5
+  test -f conftest2.$ac_objext && { (eval echo "$as_me:2380: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:2370: \$? = $ac_status" >&5
+  echo "$as_me:2383: \$? = $ac_status" >&5
   (exit $ac_status); };
 then
   eval cf_cv_prog_CC_c_o=yes
 else
   eval cf_cv_prog_CC_c_o=no
 fi
-rm -f conftest*
+rm -rf conftest*
 
 fi
 if test $cf_cv_prog_CC_c_o = yes; then
-  echo "$as_me:2381: result: yes" >&5
+  echo "$as_me:2394: result: yes" >&5
 echo "${ECHO_T}yes" >&6
 else
-  echo "$as_me:2384: result: no" >&5
+  echo "$as_me:2397: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
-echo "$as_me:2388: checking for POSIXized ISC" >&5
+echo "$as_me:2401: checking for POSIXized ISC" >&5
 echo $ECHO_N "checking for POSIXized ISC... $ECHO_C" >&6
 if test -d /etc/conf/kconfig.d &&
    grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
 then
-  echo "$as_me:2393: result: yes" >&5
+  echo "$as_me:2406: result: yes" >&5
 echo "${ECHO_T}yes" >&6
   ISC=yes # If later tests want to check for ISC.
 
@@ -2404,13 +2417,13 @@
     CC="$CC -Xp"
   fi
 else
-  echo "$as_me:2407: result: no" >&5
+  echo "$as_me:2420: result: no" >&5
 echo "${ECHO_T}no" >&6
   ISC=
 fi
 
-echo "$as_me:2412: checking for ${CC-cc} option to accept ANSI C" >&5
-echo $ECHO_N "checking for ${CC-cc} option to accept ANSI C... $ECHO_C" >&6
+echo "$as_me:2425: checking for ${CC:-cc} option to accept ANSI C" >&5
+echo $ECHO_N "checking for ${CC:-cc} option to accept ANSI C... $ECHO_C" >&6
 if test "${cf_cv_ansi_cc+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -2450,8 +2463,8 @@
 			cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
 
 			test "${cf_add_cflags}" != "${cf_tst_cflags}" \
-			&& test -z "${cf_tst_cflags}" \
-			&& cf_fix_cppflags=yes
+				&& test -z "${cf_tst_cflags}" \
+				&& cf_fix_cppflags=yes
 
 			if test $cf_fix_cppflags = yes ; then
 				cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
@@ -2466,6 +2479,16 @@
 		*$cf_add_cflags) #(vi
 			;;
 		*) #(vi
+			case $cf_add_cflags in #(vi
+			-D*)
+				cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
+
+CPPFLAGS=`echo "$CPPFLAGS" | \
+	sed	-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?[ 	]/ /g' \
+		-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?$//g'`
+
+				;;
+			esac
 			cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
 			;;
 		esac
@@ -2481,8 +2504,8 @@
 	cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
 
 	test "${cf_add_cflags}" != "${cf_tst_cflags}" \
-	&& test -z "${cf_tst_cflags}" \
-	&& cf_fix_cppflags=no
+		&& test -z "${cf_tst_cflags}" \
+		&& cf_fix_cppflags=no
 	;;
 esac
 done
@@ -2494,7 +2517,7 @@
 
 if test -n "$cf_new_cppflags" ; then
 
-	CPPFLAGS="$cf_new_cppflags $CPPFLAGS"
+	CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
 fi
 
 if test -n "$cf_new_extra_cppflags" ; then
@@ -2503,7 +2526,7 @@
 fi
 
 	cat >conftest.$ac_ext <<_ACEOF
-#line 2506 "configure"
+#line 2529 "configure"
 #include "confdefs.h"
 
 #ifndef CC_HAS_PROTOS
@@ -2524,16 +2547,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:2527: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:2550: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:2530: \$? = $ac_status" >&5
+  echo "$as_me:2553: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:2533: \"$ac_try\"") >&5
+  { (eval echo "$as_me:2556: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:2536: \$? = $ac_status" >&5
+  echo "$as_me:2559: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_ansi_cc="$cf_arg"; break
 else
@@ -2546,7 +2569,7 @@
 CPPFLAGS="$cf_save_CPPFLAGS"
 
 fi
-echo "$as_me:2549: result: $cf_cv_ansi_cc" >&5
+echo "$as_me:2572: result: $cf_cv_ansi_cc" >&5
 echo "${ECHO_T}$cf_cv_ansi_cc" >&6
 
 if test "$cf_cv_ansi_cc" != "no"; then
@@ -2568,8 +2591,8 @@
 			cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
 
 			test "${cf_add_cflags}" != "${cf_tst_cflags}" \
-			&& test -z "${cf_tst_cflags}" \
-			&& cf_fix_cppflags=yes
+				&& test -z "${cf_tst_cflags}" \
+				&& cf_fix_cppflags=yes
 
 			if test $cf_fix_cppflags = yes ; then
 				cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
@@ -2584,6 +2607,16 @@
 		*$cf_add_cflags) #(vi
 			;;
 		*) #(vi
+			case $cf_add_cflags in #(vi
+			-D*)
+				cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
+
+CPPFLAGS=`echo "$CPPFLAGS" | \
+	sed	-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?[ 	]/ /g' \
+		-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?$//g'`
+
+				;;
+			esac
 			cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
 			;;
 		esac
@@ -2599,8 +2632,8 @@
 	cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
 
 	test "${cf_add_cflags}" != "${cf_tst_cflags}" \
-	&& test -z "${cf_tst_cflags}" \
-	&& cf_fix_cppflags=no
+		&& test -z "${cf_tst_cflags}" \
+		&& cf_fix_cppflags=no
 	;;
 esac
 done
@@ -2612,7 +2645,7 @@
 
 if test -n "$cf_new_cppflags" ; then
 
-	CPPFLAGS="$cf_new_cppflags $CPPFLAGS"
+	CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
 fi
 
 if test -n "$cf_new_extra_cppflags" ; then
@@ -2629,7 +2662,7 @@
 fi
 
 if test "$cf_cv_ansi_cc" = "no"; then
-	{ { echo "$as_me:2632: error: Your compiler does not appear to recognize prototypes.
+	{ { echo "$as_me:2665: error: Your compiler does not appear to recognize prototypes.
 You have the following choices:
 	a. adjust your compiler options
 	b. get an up-to-date compiler
@@ -2663,13 +2696,13 @@
   LDCONFIG=:
 else
 case "$cf_cv_system_name" in #(vi
-freebsd*) #(vi
+dragonfly*|freebsd*) #(vi
   test -z "$LDCONFIG" && LDCONFIG="/sbin/ldconfig -R"
   ;;
 *) LDPATH=$PATH:/sbin:/usr/sbin
   # Extract the first word of "ldconfig", so it can be a program name with args.
 set dummy ldconfig; ac_word=$2
-echo "$as_me:2672: checking for $ac_word" >&5
+echo "$as_me:2705: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_path_LDCONFIG+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -2686,7 +2719,7 @@
   test -z "$ac_dir" && ac_dir=.
   if $as_executable_p "$ac_dir/$ac_word"; then
    ac_cv_path_LDCONFIG="$ac_dir/$ac_word"
-   echo "$as_me:2689: found $ac_dir/$ac_word" >&5
+   echo "$as_me:2722: found $ac_dir/$ac_word" >&5
    break
 fi
 done
@@ -2697,10 +2730,10 @@
 LDCONFIG=$ac_cv_path_LDCONFIG
 
 if test -n "$LDCONFIG"; then
-  echo "$as_me:2700: result: $LDCONFIG" >&5
+  echo "$as_me:2733: result: $LDCONFIG" >&5
 echo "${ECHO_T}$LDCONFIG" >&6
 else
-  echo "$as_me:2703: result: no" >&5
+  echo "$as_me:2736: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -2708,7 +2741,7 @@
 esac
 fi
 
-echo "$as_me:2711: checking if you want to ensure bool is consistent with C++" >&5
+echo "$as_me:2744: checking if you want to ensure bool is consistent with C++" >&5
 echo $ECHO_N "checking if you want to ensure bool is consistent with C++... $ECHO_C" >&6
 
 # Check whether --with-cxx or --without-cxx was given.
@@ -2718,7 +2751,7 @@
 else
   cf_with_cxx=yes
 fi;
-echo "$as_me:2721: result: $cf_with_cxx" >&5
+echo "$as_me:2754: result: $cf_with_cxx" >&5
 echo "${ECHO_T}$cf_with_cxx" >&6
 if test "X$cf_with_cxx" = Xno ; then
 	CXX=""
@@ -2736,7 +2769,7 @@
   do
     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-echo "$as_me:2739: checking for $ac_word" >&5
+echo "$as_me:2772: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_CXX+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -2751,7 +2784,7 @@
   test -z "$ac_dir" && ac_dir=.
   $as_executable_p "$ac_dir/$ac_word" || continue
 ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
-echo "$as_me:2754: found $ac_dir/$ac_word" >&5
+echo "$as_me:2787: found $ac_dir/$ac_word" >&5
 break
 done
 
@@ -2759,10 +2792,10 @@
 fi
 CXX=$ac_cv_prog_CXX
 if test -n "$CXX"; then
-  echo "$as_me:2762: result: $CXX" >&5
+  echo "$as_me:2795: result: $CXX" >&5
 echo "${ECHO_T}$CXX" >&6
 else
-  echo "$as_me:2765: result: no" >&5
+  echo "$as_me:2798: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -2775,7 +2808,7 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-echo "$as_me:2778: checking for $ac_word" >&5
+echo "$as_me:2811: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -2790,7 +2823,7 @@
   test -z "$ac_dir" && ac_dir=.
   $as_executable_p "$ac_dir/$ac_word" || continue
 ac_cv_prog_ac_ct_CXX="$ac_prog"
-echo "$as_me:2793: found $ac_dir/$ac_word" >&5
+echo "$as_me:2826: found $ac_dir/$ac_word" >&5
 break
 done
 
@@ -2798,10 +2831,10 @@
 fi
 ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
 if test -n "$ac_ct_CXX"; then
-  echo "$as_me:2801: result: $ac_ct_CXX" >&5
+  echo "$as_me:2834: result: $ac_ct_CXX" >&5
 echo "${ECHO_T}$ac_ct_CXX" >&6
 else
-  echo "$as_me:2804: result: no" >&5
+  echo "$as_me:2837: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -2813,32 +2846,32 @@
 fi
 
 # Provide some information about the compiler.
-echo "$as_me:2816:" \
+echo "$as_me:2849:" \
      "checking for C++ compiler version" >&5
 ac_compiler=`set X $ac_compile; echo $2`
-{ (eval echo "$as_me:2819: \"$ac_compiler --version </dev/null >&5\"") >&5
+{ (eval echo "$as_me:2852: \"$ac_compiler --version </dev/null >&5\"") >&5
   (eval $ac_compiler --version </dev/null >&5) 2>&5
   ac_status=$?
-  echo "$as_me:2822: \$? = $ac_status" >&5
+  echo "$as_me:2855: \$? = $ac_status" >&5
   (exit $ac_status); }
-{ (eval echo "$as_me:2824: \"$ac_compiler -v </dev/null >&5\"") >&5
+{ (eval echo "$as_me:2857: \"$ac_compiler -v </dev/null >&5\"") >&5
   (eval $ac_compiler -v </dev/null >&5) 2>&5
   ac_status=$?
-  echo "$as_me:2827: \$? = $ac_status" >&5
+  echo "$as_me:2860: \$? = $ac_status" >&5
   (exit $ac_status); }
-{ (eval echo "$as_me:2829: \"$ac_compiler -V </dev/null >&5\"") >&5
+{ (eval echo "$as_me:2862: \"$ac_compiler -V </dev/null >&5\"") >&5
   (eval $ac_compiler -V </dev/null >&5) 2>&5
   ac_status=$?
-  echo "$as_me:2832: \$? = $ac_status" >&5
+  echo "$as_me:2865: \$? = $ac_status" >&5
   (exit $ac_status); }
 
-echo "$as_me:2835: checking whether we are using the GNU C++ compiler" >&5
+echo "$as_me:2868: checking whether we are using the GNU C++ compiler" >&5
 echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6
 if test "${ac_cv_cxx_compiler_gnu+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 2841 "configure"
+#line 2874 "configure"
 #include "confdefs.h"
 
 int
@@ -2853,16 +2886,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:2856: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:2889: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:2859: \$? = $ac_status" >&5
+  echo "$as_me:2892: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:2862: \"$ac_try\"") >&5
+  { (eval echo "$as_me:2895: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:2865: \$? = $ac_status" >&5
+  echo "$as_me:2898: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_compiler_gnu=yes
 else
@@ -2874,19 +2907,19 @@
 ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
 
 fi
-echo "$as_me:2877: result: $ac_cv_cxx_compiler_gnu" >&5
+echo "$as_me:2910: result: $ac_cv_cxx_compiler_gnu" >&5
 echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6
 GXX=`test $ac_compiler_gnu = yes && echo yes`
 ac_test_CXXFLAGS=${CXXFLAGS+set}
 ac_save_CXXFLAGS=$CXXFLAGS
 CXXFLAGS="-g"
-echo "$as_me:2883: checking whether $CXX accepts -g" >&5
+echo "$as_me:2916: checking whether $CXX accepts -g" >&5
 echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6
 if test "${ac_cv_prog_cxx_g+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 2889 "configure"
+#line 2922 "configure"
 #include "confdefs.h"
 
 int
@@ -2898,16 +2931,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:2901: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:2934: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:2904: \$? = $ac_status" >&5
+  echo "$as_me:2937: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:2907: \"$ac_try\"") >&5
+  { (eval echo "$as_me:2940: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:2910: \$? = $ac_status" >&5
+  echo "$as_me:2943: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_prog_cxx_g=yes
 else
@@ -2917,7 +2950,7 @@
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:2920: result: $ac_cv_prog_cxx_g" >&5
+echo "$as_me:2953: result: $ac_cv_prog_cxx_g" >&5
 echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6
 if test "$ac_test_CXXFLAGS" = set; then
   CXXFLAGS=$ac_save_CXXFLAGS
@@ -2944,7 +2977,7 @@
    'void exit (int);'
 do
   cat >conftest.$ac_ext <<_ACEOF
-#line 2947 "configure"
+#line 2980 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 $ac_declaration
@@ -2957,16 +2990,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:2960: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:2993: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:2963: \$? = $ac_status" >&5
+  echo "$as_me:2996: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:2966: \"$ac_try\"") >&5
+  { (eval echo "$as_me:2999: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:2969: \$? = $ac_status" >&5
+  echo "$as_me:3002: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
@@ -2976,7 +3009,7 @@
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
   cat >conftest.$ac_ext <<_ACEOF
-#line 2979 "configure"
+#line 3012 "configure"
 #include "confdefs.h"
 $ac_declaration
 int
@@ -2988,16 +3021,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:2991: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:3024: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:2994: \$? = $ac_status" >&5
+  echo "$as_me:3027: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:2997: \"$ac_try\"") >&5
+  { (eval echo "$as_me:3030: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:3000: \$? = $ac_status" >&5
+  echo "$as_me:3033: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   break
 else
@@ -3006,7 +3039,7 @@
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 done
-rm -f conftest*
+rm -rf conftest*
 if test -n "$ac_declaration"; then
   echo '#ifdef __cplusplus' >>confdefs.h
   echo $ac_declaration      >>confdefs.h
@@ -3024,7 +3057,7 @@
 	if test "$CXX" = "g++" ; then
 		# Extract the first word of "g++", so it can be a program name with args.
 set dummy g++; ac_word=$2
-echo "$as_me:3027: checking for $ac_word" >&5
+echo "$as_me:3060: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_path_CXX+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -3041,7 +3074,7 @@
   test -z "$ac_dir" && ac_dir=.
   if $as_executable_p "$ac_dir/$ac_word"; then
    ac_cv_path_CXX="$ac_dir/$ac_word"
-   echo "$as_me:3044: found $ac_dir/$ac_word" >&5
+   echo "$as_me:3077: found $ac_dir/$ac_word" >&5
    break
 fi
 done
@@ -3052,16 +3085,16 @@
 CXX=$ac_cv_path_CXX
 
 if test -n "$CXX"; then
-  echo "$as_me:3055: result: $CXX" >&5
+  echo "$as_me:3088: result: $CXX" >&5
 echo "${ECHO_T}$CXX" >&6
 else
-  echo "$as_me:3058: result: no" >&5
+  echo "$as_me:3091: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
 	fi
 	if test "$CXX" = "g++" ; then
-		{ echo "$as_me:3064: WARNING: ignoring hardcoded g++" >&5
+		{ echo "$as_me:3097: WARNING: ignoring hardcoded g++" >&5
 echo "$as_me: WARNING: ignoring hardcoded g++" >&2;}
 		cf_with_cxx=no; CXX=""; GXX="";
 	fi
@@ -3069,11 +3102,11 @@
 
 GXX_VERSION=none
 if test "$GXX" = yes; then
-	echo "$as_me:3072: checking version of g++" >&5
+	echo "$as_me:3105: checking version of g++" >&5
 echo $ECHO_N "checking version of g++... $ECHO_C" >&6
-	GXX_VERSION="`${CXX-g++} --version| sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
+	GXX_VERSION="`${CXX:-g++} --version| sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
 	test -z "$GXX_VERSION" && GXX_VERSION=unknown
-	echo "$as_me:3076: result: $GXX_VERSION" >&5
+	echo "$as_me:3109: result: $GXX_VERSION" >&5
 echo "${ECHO_T}$GXX_VERSION" >&6
 fi
 
@@ -3081,12 +3114,12 @@
 1*|2.[0-6]*)
 	# GXX=""; CXX=""; ac_cv_prog_gxx=no
 	# cf_cxx_library=no
-	{ echo "$as_me:3084: WARNING: templates do not work" >&5
+	{ echo "$as_me:3117: WARNING: templates do not work" >&5
 echo "$as_me: WARNING: templates do not work" >&2;}
 	;;
 esac
 
-echo "$as_me:3089: checking if you want to build C++ binding and demo" >&5
+echo "$as_me:3122: checking if you want to build C++ binding and demo" >&5
 echo $ECHO_N "checking if you want to build C++ binding and demo... $ECHO_C" >&6
 
 # Check whether --with-cxx-binding or --without-cxx-binding was given.
@@ -3096,10 +3129,10 @@
 else
   cf_with_cxx_binding=$cf_with_cxx
 fi;
-echo "$as_me:3099: result: $cf_with_cxx_binding" >&5
+echo "$as_me:3132: result: $cf_with_cxx_binding" >&5
 echo "${ECHO_T}$cf_with_cxx_binding" >&6
 
-echo "$as_me:3102: checking if you want to build with Ada95" >&5
+echo "$as_me:3135: checking if you want to build with Ada95" >&5
 echo $ECHO_N "checking if you want to build with Ada95... $ECHO_C" >&6
 
 # Check whether --with-ada or --without-ada was given.
@@ -3109,10 +3142,23 @@
 else
   cf_with_ada=yes
 fi;
-echo "$as_me:3112: result: $cf_with_ada" >&5
+echo "$as_me:3145: result: $cf_with_ada" >&5
 echo "${ECHO_T}$cf_with_ada" >&6
 
-echo "$as_me:3115: checking if you want to build programs such as tic" >&5
+echo "$as_me:3148: checking if you want to install manpages" >&5
+echo $ECHO_N "checking if you want to install manpages... $ECHO_C" >&6
+
+# Check whether --with-manpages or --without-manpages was given.
+if test "${with_manpages+set}" = set; then
+  withval="$with_manpages"
+  cf_with_manpages=$withval
+else
+  cf_with_manpages=yes
+fi;
+echo "$as_me:3158: result: $cf_with_manpages" >&5
+echo "${ECHO_T}$cf_with_manpages" >&6
+
+echo "$as_me:3161: checking if you want to build programs such as tic" >&5
 echo $ECHO_N "checking if you want to build programs such as tic... $ECHO_C" >&6
 
 # Check whether --with-progs or --without-progs was given.
@@ -3122,10 +3168,23 @@
 else
   cf_with_progs=yes
 fi;
-echo "$as_me:3125: result: $cf_with_progs" >&5
+echo "$as_me:3171: result: $cf_with_progs" >&5
 echo "${ECHO_T}$cf_with_progs" >&6
 
-echo "$as_me:3128: checking if you wish to install curses.h" >&5
+echo "$as_me:3174: checking if you want to build test-programs" >&5
+echo $ECHO_N "checking if you want to build test-programs... $ECHO_C" >&6
+
+# Check whether --with-tests or --without-tests was given.
+if test "${with_tests+set}" = set; then
+  withval="$with_tests"
+  cf_with_tests=$withval
+else
+  cf_with_tests=yes
+fi;
+echo "$as_me:3184: result: $cf_with_tests" >&5
+echo "${ECHO_T}$cf_with_tests" >&6
+
+echo "$as_me:3187: checking if you wish to install curses.h" >&5
 echo $ECHO_N "checking if you wish to install curses.h... $ECHO_C" >&6
 
 # Check whether --with-curses-h or --without-curses-h was given.
@@ -3135,7 +3194,7 @@
 else
   with_curses_h=yes
 fi;
-echo "$as_me:3138: result: $with_curses_h" >&5
+echo "$as_me:3197: result: $with_curses_h" >&5
 echo "${ECHO_T}$with_curses_h" >&6
 
 modules_to_build="ncurses"
@@ -3161,7 +3220,7 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-echo "$as_me:3164: checking for $ac_word" >&5
+echo "$as_me:3223: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_AWK+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -3176,7 +3235,7 @@
   test -z "$ac_dir" && ac_dir=.
   $as_executable_p "$ac_dir/$ac_word" || continue
 ac_cv_prog_AWK="$ac_prog"
-echo "$as_me:3179: found $ac_dir/$ac_word" >&5
+echo "$as_me:3238: found $ac_dir/$ac_word" >&5
 break
 done
 
@@ -3184,21 +3243,21 @@
 fi
 AWK=$ac_cv_prog_AWK
 if test -n "$AWK"; then
-  echo "$as_me:3187: result: $AWK" >&5
+  echo "$as_me:3246: result: $AWK" >&5
 echo "${ECHO_T}$AWK" >&6
 else
-  echo "$as_me:3190: result: no" >&5
+  echo "$as_me:3249: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
   test -n "$AWK" && break
 done
 
-test -z "$AWK" && { { echo "$as_me:3197: error: No awk program found" >&5
+test -z "$AWK" && { { echo "$as_me:3256: error: No awk program found" >&5
 echo "$as_me: error: No awk program found" >&2;}
    { (exit 1); exit 1; }; }
 
-echo "$as_me:3201: checking for egrep" >&5
+echo "$as_me:3260: checking for egrep" >&5
 echo $ECHO_N "checking for egrep... $ECHO_C" >&6
 if test "${ac_cv_prog_egrep+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -3208,11 +3267,11 @@
     else ac_cv_prog_egrep='egrep'
     fi
 fi
-echo "$as_me:3211: result: $ac_cv_prog_egrep" >&5
+echo "$as_me:3270: result: $ac_cv_prog_egrep" >&5
 echo "${ECHO_T}$ac_cv_prog_egrep" >&6
  EGREP=$ac_cv_prog_egrep
 
-test -z "$EGREP" && { { echo "$as_me:3215: error: No egrep program found" >&5
+test -z "$EGREP" && { { echo "$as_me:3274: error: No egrep program found" >&5
 echo "$as_me: error: No egrep program found" >&2;}
    { (exit 1); exit 1; }; }
 
@@ -3228,7 +3287,7 @@
 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
-echo "$as_me:3231: checking for a BSD compatible install" >&5
+echo "$as_me:3290: checking for a BSD compatible install" >&5
 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
 if test -z "$INSTALL"; then
 if test "${ac_cv_path_install+set}" = set; then
@@ -3277,7 +3336,7 @@
     INSTALL=$ac_install_sh
   fi
 fi
-echo "$as_me:3280: result: $INSTALL" >&5
+echo "$as_me:3339: result: $INSTALL" >&5
 echo "${ECHO_T}$INSTALL" >&6
 
 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
@@ -3298,11 +3357,11 @@
   ;;
 esac
 
-for ac_prog in tdlint lint alint
+for ac_prog in tdlint lint alint splint lclint
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-echo "$as_me:3305: checking for $ac_word" >&5
+echo "$as_me:3364: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_LINT+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -3317,7 +3376,7 @@
   test -z "$ac_dir" && ac_dir=.
   $as_executable_p "$ac_dir/$ac_word" || continue
 ac_cv_prog_LINT="$ac_prog"
-echo "$as_me:3320: found $ac_dir/$ac_word" >&5
+echo "$as_me:3379: found $ac_dir/$ac_word" >&5
 break
 done
 
@@ -3325,28 +3384,45 @@
 fi
 LINT=$ac_cv_prog_LINT
 if test -n "$LINT"; then
-  echo "$as_me:3328: result: $LINT" >&5
+  echo "$as_me:3387: result: $LINT" >&5
 echo "${ECHO_T}$LINT" >&6
 else
-  echo "$as_me:3331: result: no" >&5
+  echo "$as_me:3390: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
   test -n "$LINT" && break
 done
 
-echo "$as_me:3338: checking whether ln -s works" >&5
+echo "$as_me:3397: checking whether ln -s works" >&5
 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
 LN_S=$as_ln_s
 if test "$LN_S" = "ln -s"; then
-  echo "$as_me:3342: result: yes" >&5
+  echo "$as_me:3401: result: yes" >&5
 echo "${ECHO_T}yes" >&6
 else
-  echo "$as_me:3345: result: no, using $LN_S" >&5
+  echo "$as_me:3404: result: no, using $LN_S" >&5
 echo "${ECHO_T}no, using $LN_S" >&6
 fi
 
-echo "$as_me:3349: checking for long file names" >&5
+echo "$as_me:3408: checking if $LN_S -f options work" >&5
+echo $ECHO_N "checking if $LN_S -f options work... $ECHO_C" >&6
+
+rm -f conf$$.src conf$$dst
+echo >conf$$.dst
+echo first >conf$$.src
+if $LN_S -f conf$$.src conf$$.dst 2>/dev/null; then
+	cf_prog_ln_sf=yes
+else
+	cf_prog_ln_sf=no
+fi
+rm -f conf$$.dst conf$$src
+echo "$as_me:3420: result: $cf_prog_ln_sf" >&5
+echo "${ECHO_T}$cf_prog_ln_sf" >&6
+
+test "$cf_prog_ln_sf" = yes && LN_S="$LN_S -f"
+
+echo "$as_me:3425: checking for long file names" >&5
 echo $ECHO_N "checking for long file names... $ECHO_C" >&6
 if test "${ac_cv_sys_long_file_names+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -3385,7 +3461,7 @@
   rm -rf $ac_xdir 2>/dev/null
 done
 fi
-echo "$as_me:3388: result: $ac_cv_sys_long_file_names" >&5
+echo "$as_me:3464: result: $ac_cv_sys_long_file_names" >&5
 echo "${ECHO_T}$ac_cv_sys_long_file_names" >&6
 if test $ac_cv_sys_long_file_names = yes; then
 
@@ -3395,7 +3471,136 @@
 
 fi
 
-echo "$as_me:3398: checking if we should assume mixed-case filenames" >&5
+# if we find pkg-config, check if we should install the ".pc" files.
+
+echo "$as_me:3476: checking if you want to use pkg-config" >&5
+echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
+
+# Check whether --with-pkg-config or --without-pkg-config was given.
+if test "${with_pkg_config+set}" = set; then
+  withval="$with_pkg_config"
+  cf_pkg_config=$withval
+else
+  cf_pkg_config=yes
+fi;
+echo "$as_me:3486: result: $cf_pkg_config" >&5
+echo "${ECHO_T}$cf_pkg_config" >&6
+
+case $cf_pkg_config in #(vi
+no) #(vi
+	PKG_CONFIG=none
+	;;
+yes) #(vi
+	# Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+echo "$as_me:3496: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  if $as_executable_p "$ac_dir/$ac_word"; then
+   ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
+   echo "$as_me:3513: found $ac_dir/$ac_word" >&5
+   break
+fi
+done
+
+  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="none"
+  ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+
+if test -n "$PKG_CONFIG"; then
+  echo "$as_me:3525: result: $PKG_CONFIG" >&5
+echo "${ECHO_T}$PKG_CONFIG" >&6
+else
+  echo "$as_me:3528: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+	;;
+*)
+	PKG_CONFIG=$withval
+	;;
+esac
+
+test -z "$PKG_CONFIG" && PKG_CONFIG=none
+if test "$PKG_CONFIG" != none ; then
+
+if test "x$prefix" != xNONE; then
+  cf_path_syntax="$prefix"
+else
+  cf_path_syntax="$ac_default_prefix"
+fi
+
+case ".$PKG_CONFIG" in #(vi
+.\$\(*\)*|.\'*\'*) #(vi
+  ;;
+..|./*|.\\*) #(vi
+  ;;
+.[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
+  ;;
+.\${*prefix}*) #(vi
+  eval PKG_CONFIG="$PKG_CONFIG"
+  case ".$PKG_CONFIG" in #(vi
+  .NONE/*)
+    PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
+    ;;
+  esac
+  ;; #(vi
+.no|.NONE/*)
+  PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
+  ;;
+*)
+  { { echo "$as_me:3566: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
+echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
+   { (exit 1); exit 1; }; }
+  ;;
+esac
+
+fi
+
+if test "$PKG_CONFIG" != no ; then
+	echo "$as_me:3575: checking if we should install .pc files for $PKG_CONFIG" >&5
+echo $ECHO_N "checking if we should install .pc files for $PKG_CONFIG... $ECHO_C" >&6
+
+	# Leave this as something that can be overridden in the environment.
+	if test -z "$PKG_CONFIG_LIBDIR" ; then
+		PKG_CONFIG_LIBDIR=`echo "$PKG_CONFIG" | sed -e 's,/[^/]*/[^/]*$,,'`/lib/pkgconfig
+	fi
+	PKG_CONFIG_LIBDIR=`echo "$PKG_CONFIG_LIBDIR" | sed -e 's/^://' -e 's/:.*//'`
+	if test -n "$PKG_CONFIG_LIBDIR" && test -d "$PKG_CONFIG_LIBDIR" ; then
+
+# Check whether --enable-pc-files or --disable-pc-files was given.
+if test "${enable_pc_files+set}" = set; then
+  enableval="$enable_pc_files"
+  enable_pc_files=$enableval
+else
+  enable_pc_files=no
+fi;
+		echo "$as_me:3592: result: $enable_pc_files" >&5
+echo "${ECHO_T}$enable_pc_files" >&6
+	else
+		echo "$as_me:3595: result: no" >&5
+echo "${ECHO_T}no" >&6
+		{ echo "$as_me:3597: WARNING: did not find library $PKG_CONFIG_LIBDIR" >&5
+echo "$as_me: WARNING: did not find library $PKG_CONFIG_LIBDIR" >&2;}
+		enable_pc_files=no
+	fi
+fi
+
+echo "$as_me:3603: checking if we should assume mixed-case filenames" >&5
 echo $ECHO_N "checking if we should assume mixed-case filenames... $ECHO_C" >&6
 
 # Check whether --enable-mixed-case or --disable-mixed-case was given.
@@ -3405,11 +3610,11 @@
 else
   enable_mixedcase=auto
 fi;
-echo "$as_me:3408: result: $enable_mixedcase" >&5
+echo "$as_me:3613: result: $enable_mixedcase" >&5
 echo "${ECHO_T}$enable_mixedcase" >&6
 if test "$enable_mixedcase" = "auto" ; then
 
-echo "$as_me:3412: checking if filesystem supports mixed-case filenames" >&5
+echo "$as_me:3617: checking if filesystem supports mixed-case filenames" >&5
 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
 if test "${cf_cv_mixedcase+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -3436,7 +3641,7 @@
 fi
 
 fi
-echo "$as_me:3439: result: $cf_cv_mixedcase" >&5
+echo "$as_me:3644: result: $cf_cv_mixedcase" >&5
 echo "${ECHO_T}$cf_cv_mixedcase" >&6
 test "$cf_cv_mixedcase" = yes && cat >>confdefs.h <<\EOF
 #define MIXEDCASE_FILENAMES 1
@@ -3453,7 +3658,7 @@
 fi
 
 # do this after mixed-case option (tags/TAGS is not as important as tic).
-echo "$as_me:3456: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "$as_me:3661: checking whether ${MAKE-make} sets \${MAKE}" >&5
 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
@@ -3473,18 +3678,92 @@
 rm -f conftest.make
 fi
 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
-  echo "$as_me:3476: result: yes" >&5
+  echo "$as_me:3681: result: yes" >&5
 echo "${ECHO_T}yes" >&6
   SET_MAKE=
 else
-  echo "$as_me:3480: result: no" >&5
+  echo "$as_me:3685: result: no" >&5
 echo "${ECHO_T}no" >&6
   SET_MAKE="MAKE=${MAKE-make}"
 fi
 
-# Extract the first word of "ctags", so it can be a program name with args.
-set dummy ctags; ac_word=$2
-echo "$as_me:3487: checking for $ac_word" >&5
+for ac_prog in exctags ctags
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:3694: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CTAGS+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CTAGS"; then
+  ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
+else
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_CTAGS="$ac_prog"
+echo "$as_me:3709: found $ac_dir/$ac_word" >&5
+break
+done
+
+fi
+fi
+CTAGS=$ac_cv_prog_CTAGS
+if test -n "$CTAGS"; then
+  echo "$as_me:3717: result: $CTAGS" >&5
+echo "${ECHO_T}$CTAGS" >&6
+else
+  echo "$as_me:3720: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  test -n "$CTAGS" && break
+done
+
+for ac_prog in exetags etags
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:3731: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ETAGS+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ETAGS"; then
+  ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
+else
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_ETAGS="$ac_prog"
+echo "$as_me:3746: found $ac_dir/$ac_word" >&5
+break
+done
+
+fi
+fi
+ETAGS=$ac_cv_prog_ETAGS
+if test -n "$ETAGS"; then
+  echo "$as_me:3754: result: $ETAGS" >&5
+echo "${ECHO_T}$ETAGS" >&6
+else
+  echo "$as_me:3757: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  test -n "$ETAGS" && break
+done
+
+# Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
+set dummy ${CTAGS:-ctags}; ac_word=$2
+echo "$as_me:3766: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -3499,7 +3778,7 @@
   test -z "$ac_dir" && ac_dir=.
   $as_executable_p "$ac_dir/$ac_word" || continue
 ac_cv_prog_MAKE_LOWER_TAGS="yes"
-echo "$as_me:3502: found $ac_dir/$ac_word" >&5
+echo "$as_me:3781: found $ac_dir/$ac_word" >&5
 break
 done
 
@@ -3508,17 +3787,17 @@
 fi
 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
 if test -n "$MAKE_LOWER_TAGS"; then
-  echo "$as_me:3511: result: $MAKE_LOWER_TAGS" >&5
+  echo "$as_me:3790: result: $MAKE_LOWER_TAGS" >&5
 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
 else
-  echo "$as_me:3514: result: no" >&5
+  echo "$as_me:3793: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
 if test "$cf_cv_mixedcase" = yes ; then
-	# Extract the first word of "etags", so it can be a program name with args.
-set dummy etags; ac_word=$2
-echo "$as_me:3521: checking for $ac_word" >&5
+	# Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
+set dummy ${ETAGS:-etags}; ac_word=$2
+echo "$as_me:3800: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -3533,7 +3812,7 @@
   test -z "$ac_dir" && ac_dir=.
   $as_executable_p "$ac_dir/$ac_word" || continue
 ac_cv_prog_MAKE_UPPER_TAGS="yes"
-echo "$as_me:3536: found $ac_dir/$ac_word" >&5
+echo "$as_me:3815: found $ac_dir/$ac_word" >&5
 break
 done
 
@@ -3542,10 +3821,10 @@
 fi
 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
 if test -n "$MAKE_UPPER_TAGS"; then
-  echo "$as_me:3545: result: $MAKE_UPPER_TAGS" >&5
+  echo "$as_me:3824: result: $MAKE_UPPER_TAGS" >&5
 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
 else
-  echo "$as_me:3548: result: no" >&5
+  echo "$as_me:3827: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -3565,7 +3844,7 @@
 	MAKE_LOWER_TAGS="#"
 fi
 
-echo "$as_me:3568: checking for makeflags variable" >&5
+echo "$as_me:3847: checking for makeflags variable" >&5
 echo $ECHO_N "checking for makeflags variable... $ECHO_C" >&6
 if test "${cf_cv_makeflags+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -3579,10 +3858,10 @@
 all :
 	@ echo '.$cf_option'
 CF_EOF
-		cf_result=`${MAKE-make} -k -f cf_makeflags.tmp 2>/dev/null | sed -e 's,[ 	]*$,,'`
+		cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp 2>/dev/null | sed -e 's,[ 	]*$,,'`
 		case "$cf_result" in
 		.*k)
-			cf_result=`${MAKE-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null`
+			cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null`
 			case "$cf_result" in
 			.*CC=*)	cf_cv_makeflags=
 				;;
@@ -3599,13 +3878,13 @@
 	rm -f cf_makeflags.tmp
 
 fi
-echo "$as_me:3602: result: $cf_cv_makeflags" >&5
+echo "$as_me:3881: result: $cf_cv_makeflags" >&5
 echo "${ECHO_T}$cf_cv_makeflags" >&6
 
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
-echo "$as_me:3608: checking for $ac_word" >&5
+echo "$as_me:3887: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_RANLIB+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -3620,7 +3899,7 @@
   test -z "$ac_dir" && ac_dir=.
   $as_executable_p "$ac_dir/$ac_word" || continue
 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
-echo "$as_me:3623: found $ac_dir/$ac_word" >&5
+echo "$as_me:3902: found $ac_dir/$ac_word" >&5
 break
 done
 
@@ -3628,10 +3907,10 @@
 fi
 RANLIB=$ac_cv_prog_RANLIB
 if test -n "$RANLIB"; then
-  echo "$as_me:3631: result: $RANLIB" >&5
+  echo "$as_me:3910: result: $RANLIB" >&5
 echo "${ECHO_T}$RANLIB" >&6
 else
-  echo "$as_me:3634: result: no" >&5
+  echo "$as_me:3913: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -3640,7 +3919,7 @@
   ac_ct_RANLIB=$RANLIB
   # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
-echo "$as_me:3643: checking for $ac_word" >&5
+echo "$as_me:3922: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -3655,7 +3934,7 @@
   test -z "$ac_dir" && ac_dir=.
   $as_executable_p "$ac_dir/$ac_word" || continue
 ac_cv_prog_ac_ct_RANLIB="ranlib"
-echo "$as_me:3658: found $ac_dir/$ac_word" >&5
+echo "$as_me:3937: found $ac_dir/$ac_word" >&5
 break
 done
 
@@ -3664,10 +3943,10 @@
 fi
 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
 if test -n "$ac_ct_RANLIB"; then
-  echo "$as_me:3667: result: $ac_ct_RANLIB" >&5
+  echo "$as_me:3946: result: $ac_ct_RANLIB" >&5
 echo "${ECHO_T}$ac_ct_RANLIB" >&6
 else
-  echo "$as_me:3670: result: no" >&5
+  echo "$as_me:3949: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -3679,7 +3958,7 @@
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ld; ac_word=$2
-echo "$as_me:3682: checking for $ac_word" >&5
+echo "$as_me:3961: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_LD+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -3694,7 +3973,7 @@
   test -z "$ac_dir" && ac_dir=.
   $as_executable_p "$ac_dir/$ac_word" || continue
 ac_cv_prog_LD="${ac_tool_prefix}ld"
-echo "$as_me:3697: found $ac_dir/$ac_word" >&5
+echo "$as_me:3976: found $ac_dir/$ac_word" >&5
 break
 done
 
@@ -3702,10 +3981,10 @@
 fi
 LD=$ac_cv_prog_LD
 if test -n "$LD"; then
-  echo "$as_me:3705: result: $LD" >&5
+  echo "$as_me:3984: result: $LD" >&5
 echo "${ECHO_T}$LD" >&6
 else
-  echo "$as_me:3708: result: no" >&5
+  echo "$as_me:3987: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -3714,7 +3993,7 @@
   ac_ct_LD=$LD
   # Extract the first word of "ld", so it can be a program name with args.
 set dummy ld; ac_word=$2
-echo "$as_me:3717: checking for $ac_word" >&5
+echo "$as_me:3996: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_ac_ct_LD+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -3729,7 +4008,7 @@
   test -z "$ac_dir" && ac_dir=.
   $as_executable_p "$ac_dir/$ac_word" || continue
 ac_cv_prog_ac_ct_LD="ld"
-echo "$as_me:3732: found $ac_dir/$ac_word" >&5
+echo "$as_me:4011: found $ac_dir/$ac_word" >&5
 break
 done
 
@@ -3738,10 +4017,10 @@
 fi
 ac_ct_LD=$ac_cv_prog_ac_ct_LD
 if test -n "$ac_ct_LD"; then
-  echo "$as_me:3741: result: $ac_ct_LD" >&5
+  echo "$as_me:4020: result: $ac_ct_LD" >&5
 echo "${ECHO_T}$ac_ct_LD" >&6
 else
-  echo "$as_me:3744: result: no" >&5
+  echo "$as_me:4023: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -3753,7 +4032,7 @@
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ar; ac_word=$2
-echo "$as_me:3756: checking for $ac_word" >&5
+echo "$as_me:4035: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_AR+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -3768,7 +4047,7 @@
   test -z "$ac_dir" && ac_dir=.
   $as_executable_p "$ac_dir/$ac_word" || continue
 ac_cv_prog_AR="${ac_tool_prefix}ar"
-echo "$as_me:3771: found $ac_dir/$ac_word" >&5
+echo "$as_me:4050: found $ac_dir/$ac_word" >&5
 break
 done
 
@@ -3776,10 +4055,10 @@
 fi
 AR=$ac_cv_prog_AR
 if test -n "$AR"; then
-  echo "$as_me:3779: result: $AR" >&5
+  echo "$as_me:4058: result: $AR" >&5
 echo "${ECHO_T}$AR" >&6
 else
-  echo "$as_me:3782: result: no" >&5
+  echo "$as_me:4061: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -3788,7 +4067,7 @@
   ac_ct_AR=$AR
   # Extract the first word of "ar", so it can be a program name with args.
 set dummy ar; ac_word=$2
-echo "$as_me:3791: checking for $ac_word" >&5
+echo "$as_me:4070: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -3803,7 +4082,7 @@
   test -z "$ac_dir" && ac_dir=.
   $as_executable_p "$ac_dir/$ac_word" || continue
 ac_cv_prog_ac_ct_AR="ar"
-echo "$as_me:3806: found $ac_dir/$ac_word" >&5
+echo "$as_me:4085: found $ac_dir/$ac_word" >&5
 break
 done
 
@@ -3812,10 +4091,10 @@
 fi
 ac_ct_AR=$ac_cv_prog_ac_ct_AR
 if test -n "$ac_ct_AR"; then
-  echo "$as_me:3815: result: $ac_ct_AR" >&5
+  echo "$as_me:4094: result: $ac_ct_AR" >&5
 echo "${ECHO_T}$ac_ct_AR" >&6
 else
-  echo "$as_me:3818: result: no" >&5
+  echo "$as_me:4097: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -3824,25 +4103,140 @@
   AR="$ac_cv_prog_AR"
 fi
 
-if test "${cf_cv_subst_AR_OPTS+set}" = set; then
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ar; ac_word=$2
+echo "$as_me:4109: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_AR+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
+  if test -n "$AR"; then
+  ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_AR="${ac_tool_prefix}ar"
+echo "$as_me:4124: found $ac_dir/$ac_word" >&5
+break
+done
+
+fi
+fi
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+  echo "$as_me:4132: result: $AR" >&5
+echo "${ECHO_T}$AR" >&6
+else
+  echo "$as_me:4135: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
 
-echo "$as_me:3831: checking for archiver options (symbol AR_OPTS)" >&5
-echo $ECHO_N "checking for archiver options (symbol AR_OPTS)... $ECHO_C" >&6
+fi
+if test -z "$ac_cv_prog_AR"; then
+  ac_ct_AR=$AR
+  # Extract the first word of "ar", so it can be a program name with args.
+set dummy ar; ac_word=$2
+echo "$as_me:4144: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_AR"; then
+  ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+else
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_ac_ct_AR="ar"
+echo "$as_me:4159: found $ac_dir/$ac_word" >&5
+break
+done
 
-if test -z "$AR_OPTS" ; then
-	AR_OPTS=rv
+  test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
+fi
+fi
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+  echo "$as_me:4168: result: $ac_ct_AR" >&5
+echo "${ECHO_T}$ac_ct_AR" >&6
+else
+  echo "$as_me:4171: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
 
+  AR=$ac_ct_AR
+else
+  AR="$ac_cv_prog_AR"
 fi
 
-cf_cv_subst_AR_OPTS=$AR_OPTS
-echo "$as_me:3840: result: $AR_OPTS" >&5
-echo "${ECHO_T}$AR_OPTS" >&6
+echo "$as_me:4180: checking for options to update archives" >&5
+echo $ECHO_N "checking for options to update archives... $ECHO_C" >&6
+if test "${cf_cv_ar_flags+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+	cf_cv_ar_flags=unknown
+	for cf_ar_flags in -curv curv -crv crv -cqv cqv -rv rv
+	do
+
+		# check if $ARFLAGS already contains this choice
+		if test "x$ARFLAGS" != "x" ; then
+			cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"`
+			if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then
+				cf_cv_ar_flags=
+				break
+			fi
+		fi
+
+		rm -f conftest.$ac_cv_objext
+		rm -f conftest.a
+
+		cat >conftest.$ac_ext <<EOF
+#line 4203 "configure"
+int	testdata[3] = { 123, 456, 789 };
+EOF
+		if { (eval echo "$as_me:4206: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:4209: \$? = $ac_status" >&5
+  (exit $ac_status); } ; then
+			echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&5
+			$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext 2>&5 1>/dev/null
+			if test -f conftest.a ; then
+				cf_cv_ar_flags=$cf_ar_flags
+				break
+			fi
+		else
+			test -n "$verbose" && echo "	cannot compile test-program" 1>&6
+
+echo "${as_me:-configure}:4220: testing cannot compile test-program ..." 1>&5
+
+			break
+		fi
+	done
+	rm -f conftest.a conftest.$ac_ext conftest.$ac_cv_objext
+
+fi
+echo "$as_me:4228: result: $cf_cv_ar_flags" >&5
+echo "${ECHO_T}$cf_cv_ar_flags" >&6
 
+if test -n "$ARFLAGS" ; then
+	if test -n "$cf_cv_ar_flags" ; then
+		ARFLAGS="$ARFLAGS $cf_cv_ar_flags"
+	fi
+else
+	ARFLAGS=$cf_cv_ar_flags
 fi
 
-echo "$as_me:3845: checking if you have specified an install-prefix" >&5
+echo "$as_me:4239: checking if you have specified an install-prefix" >&5
 echo $ECHO_N "checking if you have specified an install-prefix... $ECHO_C" >&6
 
 # Check whether --with-install-prefix or --without-install-prefix was given.
@@ -3855,7 +4249,7 @@
 		;;
 	esac
 fi;
-echo "$as_me:3858: result: $DESTDIR" >&5
+echo "$as_me:4252: result: $DESTDIR" >&5
 echo "${ECHO_T}$DESTDIR" >&6
 
 ###############################################################################
@@ -3883,7 +4277,7 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-echo "$as_me:3886: checking for $ac_word" >&5
+echo "$as_me:4280: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_BUILD_CC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -3898,7 +4292,7 @@
   test -z "$ac_dir" && ac_dir=.
   $as_executable_p "$ac_dir/$ac_word" || continue
 ac_cv_prog_BUILD_CC="$ac_prog"
-echo "$as_me:3901: found $ac_dir/$ac_word" >&5
+echo "$as_me:4295: found $ac_dir/$ac_word" >&5
 break
 done
 
@@ -3906,10 +4300,10 @@
 fi
 BUILD_CC=$ac_cv_prog_BUILD_CC
 if test -n "$BUILD_CC"; then
-  echo "$as_me:3909: result: $BUILD_CC" >&5
+  echo "$as_me:4303: result: $BUILD_CC" >&5
 echo "${ECHO_T}$BUILD_CC" >&6
 else
-  echo "$as_me:3912: result: no" >&5
+  echo "$as_me:4306: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -3917,12 +4311,12 @@
 done
 
 fi;
-	echo "$as_me:3920: checking for native build C compiler" >&5
+	echo "$as_me:4314: checking for native build C compiler" >&5
 echo $ECHO_N "checking for native build C compiler... $ECHO_C" >&6
-	echo "$as_me:3922: result: $BUILD_CC" >&5
+	echo "$as_me:4316: result: $BUILD_CC" >&5
 echo "${ECHO_T}$BUILD_CC" >&6
 
-	echo "$as_me:3925: checking for native build C preprocessor" >&5
+	echo "$as_me:4319: checking for native build C preprocessor" >&5
 echo $ECHO_N "checking for native build C preprocessor... $ECHO_C" >&6
 
 # Check whether --with-build-cpp or --without-build-cpp was given.
@@ -3932,10 +4326,10 @@
 else
   BUILD_CPP='${BUILD_CC} -E'
 fi;
-	echo "$as_me:3935: result: $BUILD_CPP" >&5
+	echo "$as_me:4329: result: $BUILD_CPP" >&5
 echo "${ECHO_T}$BUILD_CPP" >&6
 
-	echo "$as_me:3938: checking for native build C flags" >&5
+	echo "$as_me:4332: checking for native build C flags" >&5
 echo $ECHO_N "checking for native build C flags... $ECHO_C" >&6
 
 # Check whether --with-build-cflags or --without-build-cflags was given.
@@ -3943,10 +4337,10 @@
   withval="$with_build_cflags"
   BUILD_CFLAGS="$withval"
 fi;
-	echo "$as_me:3946: result: $BUILD_CFLAGS" >&5
+	echo "$as_me:4340: result: $BUILD_CFLAGS" >&5
 echo "${ECHO_T}$BUILD_CFLAGS" >&6
 
-	echo "$as_me:3949: checking for native build C preprocessor-flags" >&5
+	echo "$as_me:4343: checking for native build C preprocessor-flags" >&5
 echo $ECHO_N "checking for native build C preprocessor-flags... $ECHO_C" >&6
 
 # Check whether --with-build-cppflags or --without-build-cppflags was given.
@@ -3954,10 +4348,10 @@
   withval="$with_build_cppflags"
   BUILD_CPPFLAGS="$withval"
 fi;
-	echo "$as_me:3957: result: $BUILD_CPPFLAGS" >&5
+	echo "$as_me:4351: result: $BUILD_CPPFLAGS" >&5
 echo "${ECHO_T}$BUILD_CPPFLAGS" >&6
 
-	echo "$as_me:3960: checking for native build linker-flags" >&5
+	echo "$as_me:4354: checking for native build linker-flags" >&5
 echo $ECHO_N "checking for native build linker-flags... $ECHO_C" >&6
 
 # Check whether --with-build-ldflags or --without-build-ldflags was given.
@@ -3965,10 +4359,10 @@
   withval="$with_build_ldflags"
   BUILD_LDFLAGS="$withval"
 fi;
-	echo "$as_me:3968: result: $BUILD_LDFLAGS" >&5
+	echo "$as_me:4362: result: $BUILD_LDFLAGS" >&5
 echo "${ECHO_T}$BUILD_LDFLAGS" >&6
 
-	echo "$as_me:3971: checking for native build linker-libraries" >&5
+	echo "$as_me:4365: checking for native build linker-libraries" >&5
 echo $ECHO_N "checking for native build linker-libraries... $ECHO_C" >&6
 
 # Check whether --with-build-libs or --without-build-libs was given.
@@ -3976,7 +4370,7 @@
   withval="$with_build_libs"
   BUILD_LIBS="$withval"
 fi;
-	echo "$as_me:3979: result: $BUILD_LIBS" >&5
+	echo "$as_me:4373: result: $BUILD_LIBS" >&5
 echo "${ECHO_T}$BUILD_LIBS" >&6
 
 	# this assumes we're on Unix.
@@ -3986,7 +4380,7 @@
 	: ${BUILD_CC:='${CC}'}
 
 	if ( test "$BUILD_CC" = "$CC" || test "$BUILD_CC" = '${CC}' ) ; then
-		{ { echo "$as_me:3989: error: Cross-build requires two compilers.
+		{ { echo "$as_me:4383: error: Cross-build requires two compilers.
 Use --with-build-cc to specify the native compiler." >&5
 echo "$as_me: error: Cross-build requires two compilers.
 Use --with-build-cc to specify the native compiler." >&2;}
@@ -4011,6 +4405,32 @@
 ### shared, for example.
 cf_list_models=""
 
+echo "$as_me:4408: checking if libtool -version-number should be used" >&5
+echo $ECHO_N "checking if libtool -version-number should be used... $ECHO_C" >&6
+
+# Check whether --enable-libtool-version or --disable-libtool-version was given.
+if test "${enable_libtool_version+set}" = set; then
+  enableval="$enable_libtool_version"
+  test "$enableval" != no && enableval=yes
+  if test "$enableval" != "yes" ; then
+    cf_libtool_version=no
+  else
+    cf_libtool_version=yes
+  fi
+else
+  enableval=yes
+  cf_libtool_version=yes
+
+fi;
+echo "$as_me:4425: result: $cf_libtool_version" >&5
+echo "${ECHO_T}$cf_libtool_version" >&6
+
+if test "$cf_libtool_version" = yes ; then
+	LIBTOOL_VERSION="-version-number"
+else
+	LIBTOOL_VERSION="-version-info"
+fi
+
 LIBTOOL=
 
 # common library maintenance symbols that are convenient for libtool scripts:
@@ -4027,7 +4447,7 @@
 LIB_INSTALL=
 LIB_UNINSTALL=
 
-echo "$as_me:4030: checking if you want to build libraries with libtool" >&5
+echo "$as_me:4450: checking if you want to build libraries with libtool" >&5
 echo $ECHO_N "checking if you want to build libraries with libtool... $ECHO_C" >&6
 
 # Check whether --with-libtool or --without-libtool was given.
@@ -4037,11 +4457,11 @@
 else
   with_libtool=no
 fi;
-echo "$as_me:4040: result: $with_libtool" >&5
+echo "$as_me:4460: result: $with_libtool" >&5
 echo "${ECHO_T}$with_libtool" >&6
 if test "$with_libtool" != "no"; then
 
- 	if test "$with_libtool" != "yes" ; then
+	if test "$with_libtool" != "yes" ; then
 
 if test "x$prefix" != xNONE; then
   cf_path_syntax="$prefix"
@@ -4068,7 +4488,7 @@
   with_libtool=`echo $with_libtool | sed -e s%NONE%$cf_path_syntax%`
   ;;
 *)
-  { { echo "$as_me:4071: error: expected a pathname, not \"$with_libtool\"" >&5
+  { { echo "$as_me:4491: error: expected a pathname, not \"$with_libtool\"" >&5
 echo "$as_me: error: expected a pathname, not \"$with_libtool\"" >&2;}
    { (exit 1); exit 1; }; }
   ;;
@@ -4076,9 +4496,9 @@
 
 		LIBTOOL=$with_libtool
 	else
- 		# Extract the first word of "libtool", so it can be a program name with args.
+		# Extract the first word of "libtool", so it can be a program name with args.
 set dummy libtool; ac_word=$2
-echo "$as_me:4081: checking for $ac_word" >&5
+echo "$as_me:4501: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_path_LIBTOOL+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -4095,7 +4515,7 @@
   test -z "$ac_dir" && ac_dir=.
   if $as_executable_p "$ac_dir/$ac_word"; then
    ac_cv_path_LIBTOOL="$ac_dir/$ac_word"
-   echo "$as_me:4098: found $ac_dir/$ac_word" >&5
+   echo "$as_me:4518: found $ac_dir/$ac_word" >&5
    break
 fi
 done
@@ -4106,20 +4526,20 @@
 LIBTOOL=$ac_cv_path_LIBTOOL
 
 if test -n "$LIBTOOL"; then
-  echo "$as_me:4109: result: $LIBTOOL" >&5
+  echo "$as_me:4529: result: $LIBTOOL" >&5
 echo "${ECHO_T}$LIBTOOL" >&6
 else
-  echo "$as_me:4112: result: no" >&5
+  echo "$as_me:4532: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
- 	fi
- 	if test -z "$LIBTOOL" ; then
- 		{ { echo "$as_me:4118: error: Cannot find libtool" >&5
+	fi
+	if test -z "$LIBTOOL" ; then
+		{ { echo "$as_me:4538: error: Cannot find libtool" >&5
 echo "$as_me: error: Cannot find libtool" >&2;}
    { (exit 1); exit 1; }; }
- 	fi
-	LIB_CREATE='${LIBTOOL} --mode=link ${CC} -rpath ${DESTDIR}${libdir} -version-info `cut -f1 ${srcdir}/VERSION` ${LIBTOOL_OPTS} -o'
+	fi
+	LIB_CREATE='${LIBTOOL} --mode=link ${CC} -rpath ${DESTDIR}${libdir} ${LIBTOOL_VERSION} `cut -f1 ${srcdir}/VERSION` ${LIBTOOL_OPTS} ${LT_UNDEF} -o'
 	LIB_OBJECT='${OBJECTS:.o=.lo}'
 	LIB_SUFFIX=.la
 	LIB_CLEAN='${LIBTOOL} --mode=clean'
@@ -4130,24 +4550,32 @@
 	LIB_PREP=:
 
 	# Show the version of libtool
-	echo "$as_me:4133: checking version of libtool" >&5
+	echo "$as_me:4553: checking version of libtool" >&5
 echo $ECHO_N "checking version of libtool... $ECHO_C" >&6
 
 	# Save the version in a cache variable - this is not entirely a good
 	# thing, but the version string from libtool is very ugly, and for
-	# bug reports it might be useful to have the original string.
+	# bug reports it might be useful to have the original string. "("
 	cf_cv_libtool_version=`$LIBTOOL --version 2>&1 | sed -e '/^$/d' |sed -e '2,$d' -e 's/([^)]*)//g' -e 's/^[^1-9]*//' -e 's/[^0-9.].*//'`
-	echo "$as_me:4140: result: $cf_cv_libtool_version" >&5
+	echo "$as_me:4560: result: $cf_cv_libtool_version" >&5
 echo "${ECHO_T}$cf_cv_libtool_version" >&6
 	if test -z "$cf_cv_libtool_version" ; then
-		{ { echo "$as_me:4143: error: This is not GNU libtool" >&5
+		{ { echo "$as_me:4563: error: This is not GNU libtool" >&5
 echo "$as_me: error: This is not GNU libtool" >&2;}
    { (exit 1); exit 1; }; }
 	fi
 
+	# special hack to add -no-undefined (which libtool should do for itself)
+	LT_UNDEF=
+	case "$cf_cv_system_name" in #(vi
+	cygwin*|mingw32*|uwin*|aix[456]) #(vi
+		LT_UNDEF=-no-undefined
+		;;
+	esac
+
 	# special hack to add --tag option for C++ compiler
-	case $cf_cv_libtool_version in
-	1.[5-9]*|[2-9]*)
+	case $cf_cv_libtool_version in #(vi
+	1.[5-9]*|[2-9].[0-9.a-z]*) #(vi
 		LIBTOOL_CXX="$LIBTOOL --tag=CXX"
 		LIBTOOL="$LIBTOOL --tag=CC"
 		;;
@@ -4168,7 +4596,7 @@
 
 else
 
-echo "$as_me:4171: checking if you want to build shared libraries" >&5
+echo "$as_me:4599: checking if you want to build shared libraries" >&5
 echo $ECHO_N "checking if you want to build shared libraries... $ECHO_C" >&6
 
 # Check whether --with-shared or --without-shared was given.
@@ -4178,11 +4606,11 @@
 else
   with_shared=no
 fi;
-echo "$as_me:4181: result: $with_shared" >&5
+echo "$as_me:4609: result: $with_shared" >&5
 echo "${ECHO_T}$with_shared" >&6
 test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared"
 
-echo "$as_me:4185: checking if you want to build static libraries" >&5
+echo "$as_me:4613: checking if you want to build static libraries" >&5
 echo $ECHO_N "checking if you want to build static libraries... $ECHO_C" >&6
 
 # Check whether --with-normal or --without-normal was given.
@@ -4192,11 +4620,11 @@
 else
   with_normal=yes
 fi;
-echo "$as_me:4195: result: $with_normal" >&5
+echo "$as_me:4623: result: $with_normal" >&5
 echo "${ECHO_T}$with_normal" >&6
 test "$with_normal" = "yes" && cf_list_models="$cf_list_models normal"
 
-echo "$as_me:4199: checking if you want to build debug libraries" >&5
+echo "$as_me:4627: checking if you want to build debug libraries" >&5
 echo $ECHO_N "checking if you want to build debug libraries... $ECHO_C" >&6
 
 # Check whether --with-debug or --without-debug was given.
@@ -4206,11 +4634,11 @@
 else
   with_debug=yes
 fi;
-echo "$as_me:4209: result: $with_debug" >&5
+echo "$as_me:4637: result: $with_debug" >&5
 echo "${ECHO_T}$with_debug" >&6
 test "$with_debug" = "yes" && cf_list_models="$cf_list_models debug"
 
-echo "$as_me:4213: checking if you want to build profiling libraries" >&5
+echo "$as_me:4641: checking if you want to build profiling libraries" >&5
 echo $ECHO_N "checking if you want to build profiling libraries... $ECHO_C" >&6
 
 # Check whether --with-profile or --without-profile was given.
@@ -4220,7 +4648,7 @@
 else
   with_profile=no
 fi;
-echo "$as_me:4223: result: $with_profile" >&5
+echo "$as_me:4651: result: $with_profile" >&5
 echo "${ECHO_T}$with_profile" >&6
 test "$with_profile" = "yes" && cf_list_models="$cf_list_models profile"
 
@@ -4228,19 +4656,19 @@
 
 ###############################################################################
 
-echo "$as_me:4231: checking for specified models" >&5
+echo "$as_me:4659: checking for specified models" >&5
 echo $ECHO_N "checking for specified models... $ECHO_C" >&6
 test -z "$cf_list_models" && cf_list_models=normal
 test "$with_libtool" != "no" && cf_list_models=libtool
-echo "$as_me:4235: result: $cf_list_models" >&5
+echo "$as_me:4663: result: $cf_list_models" >&5
 echo "${ECHO_T}$cf_list_models" >&6
 
 ### Use the first model as the default, and save its suffix for use in building
 ### up test-applications.
-echo "$as_me:4240: checking for default model" >&5
+echo "$as_me:4668: checking for default model" >&5
 echo $ECHO_N "checking for default model... $ECHO_C" >&6
 DFT_LWR_MODEL=`echo "$cf_list_models" | $AWK '{print $1}'`
-echo "$as_me:4243: result: $DFT_LWR_MODEL" >&5
+echo "$as_me:4671: result: $DFT_LWR_MODEL" >&5
 echo "${ECHO_T}$DFT_LWR_MODEL" >&6
 
 DFT_UPR_MODEL=`echo "$DFT_LWR_MODEL" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
@@ -4269,7 +4697,7 @@
 
 ###############################################################################
 
-echo "$as_me:4272: checking if you want to build a separate terminfo library" >&5
+echo "$as_me:4700: checking if you want to build a separate terminfo library" >&5
 echo $ECHO_N "checking if you want to build a separate terminfo library... $ECHO_C" >&6
 
 # Check whether --with-termlib or --without-termlib was given.
@@ -4279,10 +4707,10 @@
 else
   with_termlib=no
 fi;
-echo "$as_me:4282: result: $with_termlib" >&5
+echo "$as_me:4710: result: $with_termlib" >&5
 echo "${ECHO_T}$with_termlib" >&6
 
-echo "$as_me:4285: checking if you want to build a separate tic library" >&5
+echo "$as_me:4713: checking if you want to build a separate tic library" >&5
 echo $ECHO_N "checking if you want to build a separate tic library... $ECHO_C" >&6
 
 # Check whether --with-ticlib or --without-ticlib was given.
@@ -4292,13 +4720,13 @@
 else
   with_ticlib=no
 fi;
-echo "$as_me:4295: result: $with_ticlib" >&5
+echo "$as_me:4723: result: $with_ticlib" >&5
 echo "${ECHO_T}$with_ticlib" >&6
 
 ### Checks for special libraries, must be done up-front.
 SHLIB_LIST=""
 
-echo "$as_me:4301: checking if you want to link with the GPM mouse library" >&5
+echo "$as_me:4729: checking if you want to link with the GPM mouse library" >&5
 echo $ECHO_N "checking if you want to link with the GPM mouse library... $ECHO_C" >&6
 
 # Check whether --with-gpm or --without-gpm was given.
@@ -4308,27 +4736,27 @@
 else
   with_gpm=maybe
 fi;
-echo "$as_me:4311: result: $with_gpm" >&5
+echo "$as_me:4739: result: $with_gpm" >&5
 echo "${ECHO_T}$with_gpm" >&6
 
 if test "$with_gpm" != no ; then
-	echo "$as_me:4315: checking for gpm.h" >&5
+	echo "$as_me:4743: checking for gpm.h" >&5
 echo $ECHO_N "checking for gpm.h... $ECHO_C" >&6
 if test "${ac_cv_header_gpm_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 4321 "configure"
+#line 4749 "configure"
 #include "confdefs.h"
 #include <gpm.h>
 _ACEOF
-if { (eval echo "$as_me:4325: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:4753: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
   egrep -v '^ *\+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:4331: \$? = $ac_status" >&5
+  echo "$as_me:4759: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -4347,7 +4775,7 @@
 fi
 rm -f conftest.err conftest.$ac_ext
 fi
-echo "$as_me:4350: result: $ac_cv_header_gpm_h" >&5
+echo "$as_me:4778: result: $ac_cv_header_gpm_h" >&5
 echo "${ECHO_T}$ac_cv_header_gpm_h" >&6
 if test $ac_cv_header_gpm_h = yes; then
 
@@ -4358,14 +4786,14 @@
 		if test "$with_gpm" != yes && test "$with_gpm" != maybe ; then
 			test -n "$verbose" && echo "	assuming we really have GPM library" 1>&6
 
-echo "${as_me-configure}:4361: testing assuming we really have GPM library ..." 1>&5
+echo "${as_me:-configure}:4789: testing assuming we really have GPM library ..." 1>&5
 
 			cat >>confdefs.h <<\EOF
 #define HAVE_LIBGPM 1
 EOF
 
 		else
-			echo "$as_me:4368: checking for Gpm_Open in -lgpm" >&5
+			echo "$as_me:4796: checking for Gpm_Open in -lgpm" >&5
 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -4373,7 +4801,7 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lgpm  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 4376 "configure"
+#line 4804 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -4392,16 +4820,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:4395: \"$ac_link\"") >&5
+if { (eval echo "$as_me:4823: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:4398: \$? = $ac_status" >&5
+  echo "$as_me:4826: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:4401: \"$ac_try\"") >&5
+  { (eval echo "$as_me:4829: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:4404: \$? = $ac_status" >&5
+  echo "$as_me:4832: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_gpm_Gpm_Open=yes
 else
@@ -4412,13 +4840,13 @@
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:4415: result: $ac_cv_lib_gpm_Gpm_Open" >&5
+echo "$as_me:4843: result: $ac_cv_lib_gpm_Gpm_Open" >&5
 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
   :
 else
 
-				{ { echo "$as_me:4421: error: Cannot link with GPM library" >&5
+				{ { echo "$as_me:4849: error: Cannot link with GPM library" >&5
 echo "$as_me: error: Cannot link with GPM library" >&2;}
    { (exit 1); exit 1; }; }
 		fi
@@ -4428,7 +4856,7 @@
 
 else
 
-		test "$with_gpm" != maybe && { echo "$as_me:4431: WARNING: Cannot find GPM header" >&5
+		test "$with_gpm" != maybe && { echo "$as_me:4859: WARNING: Cannot find GPM header" >&5
 echo "$as_me: WARNING: Cannot find GPM header" >&2;}
 		with_gpm=no
 
@@ -4437,7 +4865,7 @@
 fi
 
 if test "$with_gpm" != no ; then
-	echo "$as_me:4440: checking if you want to load GPM dynamically" >&5
+	echo "$as_me:4868: checking if you want to load GPM dynamically" >&5
 echo $ECHO_N "checking if you want to load GPM dynamically... $ECHO_C" >&6
 
 # Check whether --with-dlsym or --without-dlsym was given.
@@ -4447,18 +4875,18 @@
 else
   with_dlsym=yes
 fi;
-	echo "$as_me:4450: result: $with_dlsym" >&5
+	echo "$as_me:4878: result: $with_dlsym" >&5
 echo "${ECHO_T}$with_dlsym" >&6
 	if test "$with_dlsym" = yes ; then
 
 cf_have_dlsym=no
-echo "$as_me:4455: checking for dlsym" >&5
+echo "$as_me:4883: checking for dlsym" >&5
 echo $ECHO_N "checking for dlsym... $ECHO_C" >&6
 if test "${ac_cv_func_dlsym+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 4461 "configure"
+#line 4889 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char dlsym (); below.  */
@@ -4489,16 +4917,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:4492: \"$ac_link\"") >&5
+if { (eval echo "$as_me:4920: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:4495: \$? = $ac_status" >&5
+  echo "$as_me:4923: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:4498: \"$ac_try\"") >&5
+  { (eval echo "$as_me:4926: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:4501: \$? = $ac_status" >&5
+  echo "$as_me:4929: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_func_dlsym=yes
 else
@@ -4508,14 +4936,14 @@
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:4511: result: $ac_cv_func_dlsym" >&5
+echo "$as_me:4939: result: $ac_cv_func_dlsym" >&5
 echo "${ECHO_T}$ac_cv_func_dlsym" >&6
 if test $ac_cv_func_dlsym = yes; then
   cf_have_dlsym=yes
 else
 
 cf_have_libdl=no
-echo "$as_me:4518: checking for dlsym in -ldl" >&5
+echo "$as_me:4946: checking for dlsym in -ldl" >&5
 echo $ECHO_N "checking for dlsym in -ldl... $ECHO_C" >&6
 if test "${ac_cv_lib_dl_dlsym+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -4523,7 +4951,7 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-ldl  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 4526 "configure"
+#line 4954 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -4542,16 +4970,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:4545: \"$ac_link\"") >&5
+if { (eval echo "$as_me:4973: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:4548: \$? = $ac_status" >&5
+  echo "$as_me:4976: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:4551: \"$ac_try\"") >&5
+  { (eval echo "$as_me:4979: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:4554: \$? = $ac_status" >&5
+  echo "$as_me:4982: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_dl_dlsym=yes
 else
@@ -4562,7 +4990,7 @@
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:4565: result: $ac_cv_lib_dl_dlsym" >&5
+echo "$as_me:4993: result: $ac_cv_lib_dl_dlsym" >&5
 echo "${ECHO_T}$ac_cv_lib_dl_dlsym" >&6
 if test $ac_cv_lib_dl_dlsym = yes; then
 
@@ -4575,10 +5003,10 @@
 if test "$cf_have_dlsym" = yes ; then
 	test "$cf_have_libdl" = yes && LIBS="-ldl $LIBS"
 
-	echo "$as_me:4578: checking whether able to link to dl*() functions" >&5
+	echo "$as_me:5006: checking whether able to link to dl*() functions" >&5
 echo $ECHO_N "checking whether able to link to dl*() functions... $ECHO_C" >&6
 	cat >conftest.$ac_ext <<_ACEOF
-#line 4581 "configure"
+#line 5009 "configure"
 #include "confdefs.h"
 #include <dlfcn.h>
 int
@@ -4596,16 +5024,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:4599: \"$ac_link\"") >&5
+if { (eval echo "$as_me:5027: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:4602: \$? = $ac_status" >&5
+  echo "$as_me:5030: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:4605: \"$ac_try\"") >&5
+  { (eval echo "$as_me:5033: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:4608: \$? = $ac_status" >&5
+  echo "$as_me:5036: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
 		cat >>confdefs.h <<\EOF
@@ -4616,15 +5044,15 @@
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
 
-		{ { echo "$as_me:4619: error: Cannot link test program for libdl" >&5
+		{ { echo "$as_me:5047: error: Cannot link test program for libdl" >&5
 echo "$as_me: error: Cannot link test program for libdl" >&2;}
    { (exit 1); exit 1; }; }
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-	echo "$as_me:4624: result: ok" >&5
+	echo "$as_me:5052: result: ok" >&5
 echo "${ECHO_T}ok" >&6
 else
-	{ { echo "$as_me:4627: error: Cannot find dlsym function" >&5
+	{ { echo "$as_me:5055: error: Cannot find dlsym function" >&5
 echo "$as_me: error: Cannot find dlsym function" >&2;}
    { (exit 1); exit 1; }; }
 fi
@@ -4632,12 +5060,12 @@
 		if test "$with_gpm" != yes ; then
 			test -n "$verbose" && echo "	assuming soname for gpm is $with_gpm" 1>&6
 
-echo "${as_me-configure}:4635: testing assuming soname for gpm is $with_gpm ..." 1>&5
+echo "${as_me:-configure}:5063: testing assuming soname for gpm is $with_gpm ..." 1>&5
 
 			cf_cv_gpm_soname="$with_gpm"
 		else
 
-echo "$as_me:4640: checking for soname of gpm library" >&5
+echo "$as_me:5068: checking for soname of gpm library" >&5
 echo $ECHO_N "checking for soname of gpm library... $ECHO_C" >&6
 if test "${cf_cv_gpm_soname+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -4655,26 +5083,26 @@
 CF_EOF
 cf_save_LIBS="$LIBS"
 	LIBS="-lgpm $LIBS"
-	if { (eval echo "$as_me:4658: \"$ac_compile\"") >&5
+	if { (eval echo "$as_me:5086: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:4661: \$? = $ac_status" >&5
+  echo "$as_me:5089: \$? = $ac_status" >&5
   (exit $ac_status); } ; then
-		if { (eval echo "$as_me:4663: \"$ac_link\"") >&5
+		if { (eval echo "$as_me:5091: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:4666: \$? = $ac_status" >&5
+  echo "$as_me:5094: \$? = $ac_status" >&5
   (exit $ac_status); } ; then
 			cf_cv_gpm_soname=`ldd conftest$ac_exeext 2>/dev/null | sed -e 's,^.*/,,' -e 's, .*$,,' | fgrep libgpm.`
 			test -z "$cf_cv_gpm_soname" && cf_cv_gpm_soname=unknown
 		fi
 	fi
-rm -f conftest*
+rm -rf conftest*
 LIBS="$cf_save_LIBS"
 fi
 
 fi
-echo "$as_me:4677: result: $cf_cv_gpm_soname" >&5
+echo "$as_me:5105: result: $cf_cv_gpm_soname" >&5
 echo "${ECHO_T}$cf_cv_gpm_soname" >&6
 
 		fi
@@ -4685,12 +5113,13 @@
 		SHLIB_LIST="-ldl $SHLIB_LIST"
 	else
 		SHLIB_LIST="-lgpm $SHLIB_LIST"
+		TEST_LIBS="-lgpm $TEST_LIBS"
 	fi
 	cat >>confdefs.h <<\EOF
 #define HAVE_LIBGPM 1
 EOF
 
-echo "$as_me:4693: checking for Gpm_Wgetch in -lgpm" >&5
+echo "$as_me:5122: checking for Gpm_Wgetch in -lgpm" >&5
 echo $ECHO_N "checking for Gpm_Wgetch in -lgpm... $ECHO_C" >&6
 if test "${ac_cv_lib_gpm_Gpm_Wgetch+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -4698,7 +5127,7 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lgpm  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 4701 "configure"
+#line 5130 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -4717,16 +5146,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:4720: \"$ac_link\"") >&5
+if { (eval echo "$as_me:5149: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:4723: \$? = $ac_status" >&5
+  echo "$as_me:5152: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:4726: \"$ac_try\"") >&5
+  { (eval echo "$as_me:5155: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:4729: \$? = $ac_status" >&5
+  echo "$as_me:5158: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_gpm_Gpm_Wgetch=yes
 else
@@ -4737,11 +5166,11 @@
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:4740: result: $ac_cv_lib_gpm_Gpm_Wgetch" >&5
+echo "$as_me:5169: result: $ac_cv_lib_gpm_Gpm_Wgetch" >&5
 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Wgetch" >&6
 if test $ac_cv_lib_gpm_Gpm_Wgetch = yes; then
 
-echo "$as_me:4744: checking if GPM is weakly bound to curses library" >&5
+echo "$as_me:5173: checking if GPM is weakly bound to curses library" >&5
 echo $ECHO_N "checking if GPM is weakly bound to curses library... $ECHO_C" >&6
 if test "${cf_cv_check_gpm_wgetch+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -4765,31 +5194,31 @@
 	# to rely on the static library, noting that some packagers may not
 	# include it.
 	LIBS="-static -lgpm -dynamic $LIBS"
-	if { (eval echo "$as_me:4768: \"$ac_compile\"") >&5
+	if { (eval echo "$as_me:5197: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:4771: \$? = $ac_status" >&5
+  echo "$as_me:5200: \$? = $ac_status" >&5
   (exit $ac_status); } ; then
-		if { (eval echo "$as_me:4773: \"$ac_link\"") >&5
+		if { (eval echo "$as_me:5202: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:4776: \$? = $ac_status" >&5
+  echo "$as_me:5205: \$? = $ac_status" >&5
   (exit $ac_status); } ; then
 			cf_cv_check_gpm_wgetch=`nm conftest$ac_exeext | egrep '\<wgetch\>' | egrep '\<[vVwW]\>'`
 			test -n "$cf_cv_check_gpm_wgetch" && cf_cv_check_gpm_wgetch=yes
 			test -z "$cf_cv_check_gpm_wgetch" && cf_cv_check_gpm_wgetch=no
 		fi
 	fi
-	rm -f conftest*
+	rm -rf conftest*
 	LIBS="$cf_save_LIBS"
 fi
 
 fi
-echo "$as_me:4788: result: $cf_cv_check_gpm_wgetch" >&5
+echo "$as_me:5217: result: $cf_cv_check_gpm_wgetch" >&5
 echo "${ECHO_T}$cf_cv_check_gpm_wgetch" >&6
 
 if test "$cf_cv_check_gpm_wgetch" != yes ; then
-	{ echo "$as_me:4792: WARNING: GPM library is already linked with curses - read the FAQ" >&5
+	{ echo "$as_me:5221: WARNING: GPM library is already linked with curses - read the FAQ" >&5
 echo "$as_me: WARNING: GPM library is already linked with curses - read the FAQ" >&2;}
 fi
 
@@ -4799,7 +5228,7 @@
 
 # not everyone has "test -c"
 if test -c /dev/sysmouse 2>/dev/null ; then
-echo "$as_me:4802: checking if you want to use sysmouse" >&5
+echo "$as_me:5231: checking if you want to use sysmouse" >&5
 echo $ECHO_N "checking if you want to use sysmouse... $ECHO_C" >&6
 
 # Check whether --with-sysmouse or --without-sysmouse was given.
@@ -4811,7 +5240,7 @@
 fi;
 	if test "$cf_with_sysmouse" != no ; then
 	cat >conftest.$ac_ext <<_ACEOF
-#line 4814 "configure"
+#line 5243 "configure"
 #include "confdefs.h"
 
 #include <osreldate.h>
@@ -4834,16 +5263,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:4837: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:5266: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:4840: \$? = $ac_status" >&5
+  echo "$as_me:5269: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:4843: \"$ac_try\"") >&5
+  { (eval echo "$as_me:5272: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:4846: \$? = $ac_status" >&5
+  echo "$as_me:5275: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_with_sysmouse=yes
 else
@@ -4853,7 +5282,7 @@
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 	fi
-echo "$as_me:4856: result: $cf_with_sysmouse" >&5
+echo "$as_me:5285: result: $cf_with_sysmouse" >&5
 echo "${ECHO_T}$cf_with_sysmouse" >&6
 test "$cf_with_sysmouse" = yes && cat >>confdefs.h <<\EOF
 #define USE_SYSMOUSE 1
@@ -4871,7 +5300,7 @@
 	test -n "$GXX" && test "${ac_cv_prog_cxx_g}" != yes && CXX_G_OPT=''
 fi
 
-echo "$as_me:4874: checking for default loader flags" >&5
+echo "$as_me:5303: checking for default loader flags" >&5
 echo $ECHO_N "checking for default loader flags... $ECHO_C" >&6
 case $DFT_LWR_MODEL in
 libtool) LD_MODEL=''   ;;
@@ -4880,26 +5309,26 @@
 profile) LD_MODEL='-pg';;
 shared)  LD_MODEL=''   ;;
 esac
-echo "$as_me:4883: result: $LD_MODEL" >&5
+echo "$as_me:5312: result: $LD_MODEL" >&5
 echo "${ECHO_T}$LD_MODEL" >&6
 
 case $DFT_LWR_MODEL in
 shared)
 
-echo "$as_me:4889: checking if rpath option should be used" >&5
+echo "$as_me:5318: checking if rpath option should be used" >&5
 echo $ECHO_N "checking if rpath option should be used... $ECHO_C" >&6
 
 # Check whether --enable-rpath or --disable-rpath was given.
 if test "${enable_rpath+set}" = set; then
   enableval="$enable_rpath"
-  cf_cv_ld_rpath=$enableval
+  cf_cv_enable_rpath=$enableval
 else
-  cf_cv_ld_rpath=no
+  cf_cv_enable_rpath=no
 fi;
-echo "$as_me:4899: result: $cf_cv_ld_rpath" >&5
-echo "${ECHO_T}$cf_cv_ld_rpath" >&6
+echo "$as_me:5328: result: $cf_cv_enable_rpath" >&5
+echo "${ECHO_T}$cf_cv_enable_rpath" >&6
 
-echo "$as_me:4902: checking if shared libraries should be relinked during install" >&5
+echo "$as_me:5331: checking if shared libraries should be relinked during install" >&5
 echo $ECHO_N "checking if shared libraries should be relinked during install... $ECHO_C" >&6
 
 # Check whether --enable-relink or --disable-relink was given.
@@ -4909,19 +5338,100 @@
 else
   cf_cv_do_relink=yes
 fi;
-echo "$as_me:4912: result: $cf_cv_do_relink" >&5
+echo "$as_me:5341: result: $cf_cv_do_relink" >&5
 echo "${ECHO_T}$cf_cv_do_relink" >&6
 	;;
 esac
 
-	LOCAL_LDFLAGS=
-	LOCAL_LDFLAGS2=
-	LD_SHARED_OPTS=
-	INSTALL_LIB="-m 644"
-
-	cf_cv_do_symlinks=no
+LD_RPATH_OPT=
+echo "$as_me:5347: checking for an rpath option" >&5
+echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
+case $cf_cv_system_name in #(vi
+irix*) #(vi
+	if test "$GCC" = yes; then
+		LD_RPATH_OPT="-Wl,-rpath,"
+	else
+		LD_RPATH_OPT="-rpath "
+	fi
+	;;
+linux*|gnu*|k*bsd*-gnu) #(vi
+	LD_RPATH_OPT="-Wl,-rpath,"
+	;;
+openbsd[2-9].*) #(vi
+	LD_RPATH_OPT="-Wl,-rpath,"
+	;;
+freebsd*) #(vi
+	LD_RPATH_OPT="-rpath "
+	;;
+netbsd*) #(vi
+	LD_RPATH_OPT="-Wl,-rpath,"
+	;;
+osf*|mls+*) #(vi
+	LD_RPATH_OPT="-rpath "
+	;;
+solaris2*) #(vi
+	LD_RPATH_OPT="-R"
+	;;
+*)
+	;;
+esac
+echo "$as_me:5378: result: $LD_RPATH_OPT" >&5
+echo "${ECHO_T}$LD_RPATH_OPT" >&6
+
+case "x$LD_RPATH_OPT" in #(vi
+x-R*)
+	echo "$as_me:5383: checking if we need a space after rpath option" >&5
+echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
+	cf_save_LIBS="$LIBS"
+	LIBS="${LD_RPATH_OPT}$libdir $LIBS"
+	cat >conftest.$ac_ext <<_ACEOF
+#line 5388 "configure"
+#include "confdefs.h"
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:5400: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:5403: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:5406: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:5409: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_rpath_space=no
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_rpath_space=yes
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+	LIBS="$cf_save_LIBS"
+	echo "$as_me:5419: result: $cf_rpath_space" >&5
+echo "${ECHO_T}$cf_rpath_space" >&6
+	test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
+	;;
+esac
+
+	LOCAL_LDFLAGS=
+	LOCAL_LDFLAGS2=
+	LD_SHARED_OPTS=
+	INSTALL_LIB="-m 644"
+
+	cf_cv_do_symlinks=no
+	cf_ld_rpath_opt=
+	test "$cf_cv_enable_rpath" = yes && cf_ld_rpath_opt="$LD_RPATH_OPT"
 
-	echo "$as_me:4924: checking if release/abi version should be used for shared libs" >&5
+	echo "$as_me:5434: checking if release/abi version should be used for shared libs" >&5
 echo $ECHO_N "checking if release/abi version should be used for shared libs... $ECHO_C" >&6
 
 # Check whether --with-shlib-version or --without-shlib-version was given.
@@ -4936,7 +5446,7 @@
 		cf_cv_shlib_version=$withval
 		;;
 	*)
-		{ { echo "$as_me:4939: error: option value must be one of: rel, abi, auto or no" >&5
+		{ { echo "$as_me:5449: error: option value must be one of: rel, abi, auto or no" >&5
 echo "$as_me: error: option value must be one of: rel, abi, auto or no" >&2;}
    { (exit 1); exit 1; }; }
 		;;
@@ -4945,7 +5455,7 @@
 else
   cf_cv_shlib_version=auto
 fi;
-	echo "$as_me:4948: result: $cf_cv_shlib_version" >&5
+	echo "$as_me:5458: result: $cf_cv_shlib_version" >&5
 echo "${ECHO_T}$cf_cv_shlib_version" >&6
 
 	cf_cv_rm_so_locs=no
@@ -4954,14 +5464,14 @@
 	CC_SHARED_OPTS=
 	if test "$GCC" = yes
 	then
-		echo "$as_me:4957: checking which $CC option to use" >&5
+		echo "$as_me:5467: checking which $CC option to use" >&5
 echo $ECHO_N "checking which $CC option to use... $ECHO_C" >&6
 		cf_save_CFLAGS="$CFLAGS"
 		for CC_SHARED_OPTS in -fPIC -fpic ''
 		do
 			CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS"
 			cat >conftest.$ac_ext <<_ACEOF
-#line 4964 "configure"
+#line 5474 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int
@@ -4973,16 +5483,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:4976: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:5486: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:4979: \$? = $ac_status" >&5
+  echo "$as_me:5489: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:4982: \"$ac_try\"") >&5
+  { (eval echo "$as_me:5492: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:4985: \$? = $ac_status" >&5
+  echo "$as_me:5495: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   break
 else
@@ -4991,18 +5501,24 @@
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 		done
-		echo "$as_me:4994: result: $CC_SHARED_OPTS" >&5
+		echo "$as_me:5504: result: $CC_SHARED_OPTS" >&5
 echo "${ECHO_T}$CC_SHARED_OPTS" >&6
 		CFLAGS="$cf_save_CFLAGS"
 	fi
 
 	cf_cv_shlib_version_infix=no
 
-	case $cf_cv_system_name in
-	beos*)
+	case $cf_cv_system_name in #(vi
+	aix[56]*) #(vi
+		if test "$GCC" = yes; then
+			CC_SHARED_OPTS=
+			MK_SHARED_LIB='$(CC) -shared'
+		fi
+		;;
+	beos*) #(vi
 		MK_SHARED_LIB='${CC} ${CFLAGS} -o $@ -Xlinker -soname=`basename $@` -nostart -e 0'
 		;;
-	cygwin*)
+	cygwin*) #(vi
 		CC_SHARED_OPTS=
 		MK_SHARED_LIB='sh ../mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
 		cf_cv_shlib_version=cygdll
@@ -5021,13 +5537,13 @@
 CF_EOF
 		chmod +x mk_shared_lib.sh
 		;;
-	darwin*)
+	darwin*) #(vi
 		EXTRA_CFLAGS="-no-cpp-precomp"
 		CC_SHARED_OPTS="-dynamic"
 		MK_SHARED_LIB='${CC} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $@` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $@'
 		test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi
 		cf_cv_shlib_version_infix=yes
-		echo "$as_me:5030: checking if ld -search_paths_first works" >&5
+		echo "$as_me:5546: checking if ld -search_paths_first works" >&5
 echo $ECHO_N "checking if ld -search_paths_first works... $ECHO_C" >&6
 if test "${cf_cv_ldflags_search_paths_first+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -5036,7 +5552,7 @@
 			cf_save_LDFLAGS=$LDFLAGS
 			LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
 			cat >conftest.$ac_ext <<_ACEOF
-#line 5039 "configure"
+#line 5555 "configure"
 #include "confdefs.h"
 
 int
@@ -5048,16 +5564,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:5051: \"$ac_link\"") >&5
+if { (eval echo "$as_me:5567: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:5054: \$? = $ac_status" >&5
+  echo "$as_me:5570: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:5057: \"$ac_try\"") >&5
+  { (eval echo "$as_me:5573: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:5060: \$? = $ac_status" >&5
+  echo "$as_me:5576: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_ldflags_search_paths_first=yes
 else
@@ -5068,13 +5584,13 @@
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 				LDFLAGS=$cf_save_LDFLAGS
 fi
-echo "$as_me:5071: result: $cf_cv_ldflags_search_paths_first" >&5
+echo "$as_me:5587: result: $cf_cv_ldflags_search_paths_first" >&5
 echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6
 		if test $cf_cv_ldflags_search_paths_first = yes; then
 			LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
 		fi
 		;;
-	hpux*)
+	hpux*) #(vi
 		# (tested with gcc 2.7.2 -- I don't have c89)
 		if test "$GCC" = yes; then
 			LD_SHARED_OPTS='-Xlinker +b -Xlinker ${libdir}'
@@ -5087,15 +5603,9 @@
 		# readonly to exploit a quirk in the memory manager.
 		INSTALL_LIB="-m 555"
 		;;
-	irix*)
-		if test "$cf_cv_ld_rpath" = yes ; then
-			if test "$GCC" = yes; then
-				cf_ld_rpath_opt="-Wl,-rpath,"
-				EXTRA_LDFLAGS="-Wl,-rpath,\${libdir} $EXTRA_LDFLAGS"
-			else
-				cf_ld_rpath_opt="-rpath "
-				EXTRA_LDFLAGS="-rpath \${libdir} $EXTRA_LDFLAGS"
-			fi
+	irix*) #(vi
+		if test "$cf_cv_enable_rpath" = yes ; then
+			EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS"
 		fi
 		# tested with IRIX 5.2 and 'cc'.
 		if test "$GCC" != yes; then
@@ -5106,14 +5616,13 @@
 		fi
 		cf_cv_rm_so_locs=yes
 		;;
-	linux*|gnu*|k*bsd*-gnu)
+	linux*|gnu*|k*bsd*-gnu) #(vi
 		if test "$DFT_LWR_MODEL" = "shared" ; then
-			LOCAL_LDFLAGS="-Wl,-rpath,\$(LOCAL_LIBDIR)"
+			LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
 			LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
 		fi
-		if test "$cf_cv_ld_rpath" = yes ; then
-			cf_ld_rpath_opt="-Wl,-rpath,"
-			EXTRA_LDFLAGS="-Wl,-rpath,\${libdir} $EXTRA_LDFLAGS"
+		if test "$cf_cv_enable_rpath" = yes ; then
+			EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS"
 		fi
 
 	test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
@@ -5125,14 +5634,13 @@
 
 		MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
 		;;
-	openbsd[2-9].*)
+	openbsd[2-9].*) #(vi
 		if test "$DFT_LWR_MODEL" = "shared" ; then
-			LOCAL_LDFLAGS="-Wl,-rpath,\$(LOCAL_LIBDIR)"
+			LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
 			LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
 		fi
-		if test "$cf_cv_ld_rpath" = yes ; then
-			cf_ld_rpath_opt="-Wl,-rpath,"
-			EXTRA_LDFLAGS="-Wl,-rpath,\${libdir} $EXTRA_LDFLAGS"
+		if test "$cf_cv_enable_rpath" = yes ; then
+			EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS"
 		fi
 		CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
 
@@ -5143,20 +5651,19 @@
 		cf_cv_shared_soname='`basename $@`'
 	fi
 
-		MK_SHARED_LIB='${CC} ${CFLAGS} -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
+		MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
 		;;
-	nto-qnx*|openbsd*|freebsd[12].*)
+	nto-qnx*|openbsd*|freebsd[12].*) #(vi
 		CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
 		MK_SHARED_LIB='${LD} -Bshareable -o $@'
 		test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
 		;;
-	freebsd*)
+	freebsd*) #(vi
 		CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
-		if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_ld_rpath" = yes ; then
-			LOCAL_LDFLAGS="-rpath \$(LOCAL_LIBDIR)"
-			LOCAL_LDFLAGS2="-rpath \${libdir} $LOCAL_LDFLAGS"
-			cf_ld_rpath_opt="-rpath "
-			EXTRA_LDFLAGS="-rpath \${libdir} $EXTRA_LDFLAGS"
+		if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
+			LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
+			LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${libdir} $LOCAL_LDFLAGS"
+			EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS"
 		fi
 
 	test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
@@ -5166,15 +5673,14 @@
 		cf_cv_shared_soname='`basename $@`'
 	fi
 
-		MK_SHARED_LIB='${LD} -Bshareable -soname=`basename $@` -o $@'
+		MK_SHARED_LIB='${LD} -shared -Bshareable -soname=`basename $@` -o $@'
 		;;
-	netbsd*)
+	netbsd*) #(vi
 		CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
-		test "$cf_cv_ld_rpath" = yes && cf_ld_rpath_opt="-Wl,-rpath,"
-		if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_ld_rpath" = yes ; then
-			LOCAL_LDFLAGS="-Wl,-rpath,\$(LOCAL_LIBDIR)"
+		if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
+			LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
 			LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
-			EXTRA_LDFLAGS="-Wl,-rpath,\${libdir} $EXTRA_LDFLAGS"
+			EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS"
 			if test "$cf_cv_shlib_version" = auto; then
 			if test -f /usr/libexec/ld.elf_so; then
 				cf_cv_shlib_version=abi
@@ -5192,37 +5698,33 @@
 
 			MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $@'
 		else
-			MK_SHARED_LIB='${LD} -Bshareable -o $@'
+			MK_SHARED_LIB='${LD} -shared -Bshareable -o $@'
 		fi
 		;;
-	osf*|mls+*)
+	osf*|mls+*) #(vi
 		# tested with OSF/1 V3.2 and 'cc'
 		# tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't
 		# link with shared libs).
 		MK_SHARED_LIB='${LD} -set_version ${REL_VERSION}:${ABI_VERSION} -expect_unresolved "*" -shared -soname `basename $@`'
-		case $host_os in
+		case $host_os in #(vi
 		osf4*)
 			MK_SHARED_LIB="${MK_SHARED_LIB} -msym"
 			;;
 		esac
 		MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $@'
 		if test "$DFT_LWR_MODEL" = "shared" ; then
-			LOCAL_LDFLAGS="-Wl,-rpath,\$(LOCAL_LIBDIR)"
+			LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
 			LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
 		fi
-		if test "$cf_cv_ld_rpath" = yes ; then
-			cf_ld_rpath_opt="-rpath"
-			# EXTRA_LDFLAGS="$LOCAL_LDFLAGS $EXTRA_LDFLAGS"
-		fi
 		cf_cv_rm_so_locs=yes
 		;;
-	sco3.2v5*)  # (also uw2* and UW7) hops 13-Apr-98
+	sco3.2v5*)  # (also uw2* and UW7: hops 13-Apr-98
 		# tested with osr5.0.5
 		if test "$GCC" != yes; then
 			CC_SHARED_OPTS='-belf -KPIC'
 		fi
 		MK_SHARED_LIB='${LD} -dy -G -h `basename $@ .${REL_VERSION}`.${ABI_VERSION} -o $@'
-		if test "$cf_cv_ld_rpath" = yes ; then
+		if test "$cf_cv_enable_rpath" = yes ; then
 			# only way is to set LD_RUN_PATH but no switch for it
 			RUN_PATH=$libdir
 		fi
@@ -5230,7 +5732,7 @@
 		LINK_PROGS='LD_RUN_PATH=${libdir}'
 		LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib'
 		;;
-	sunos4*)
+	sunos4*) #(vi
 		# tested with SunOS 4.1.1 and gcc 2.7.0
 		if test "$GCC" != yes; then
 			CC_SHARED_OPTS='-KPIC'
@@ -5238,16 +5740,15 @@
 		MK_SHARED_LIB='${LD} -assert pure-text -o $@'
 		test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
 		;;
-	solaris2*)
+	solaris2*) #(vi
 		# tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2
 		# tested with SunOS 5.10 (solaris 10) and gcc 3.4.3
 		if test "$DFT_LWR_MODEL" = "shared" ; then
 			LOCAL_LDFLAGS="-R \$(LOCAL_LIBDIR):\${libdir}"
 			LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
 		fi
-		if test "$cf_cv_ld_rpath" = yes ; then
-			cf_ld_rpath_opt="-R"
-			EXTRA_LDFLAGS="$LOCAL_LDFLAGS $EXTRA_LDFLAGS"
+		if test "$cf_cv_enable_rpath" = yes ; then
+			EXTRA_LDFLAGS="-R \${libdir} $EXTRA_LDFLAGS"
 		fi
 
 	test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
@@ -5258,13 +5759,49 @@
 	fi
 
 		if test "$GCC" != yes; then
-			CC_SHARED_OPTS='-xcode=pic32'
+			cf_save_CFLAGS="$CFLAGS"
+			for cf_shared_opts in -xcode=pic32 -xcode=pic13 -KPIC -Kpic -O
+			do
+				CFLAGS="$cf_shared_opts $cf_save_CFLAGS"
+				cat >conftest.$ac_ext <<_ACEOF
+#line 5767 "configure"
+#include "confdefs.h"
+#include <stdio.h>
+int
+main ()
+{
+printf("Hello\n");
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:5779: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:5782: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:5785: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:5788: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  break
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+			done
+			CFLAGS="$cf_save_CFLAGS"
+			CC_SHARED_OPTS=$cf_shared_opts
 			MK_SHARED_LIB='${CC} -dy -G -h '$cf_cv_shared_soname' -o $@'
 		else
 			MK_SHARED_LIB='${CC} -shared -dy -G -h '$cf_cv_shared_soname' -o $@'
 		fi
 		;;
-	sysv5uw7*|unix_sv*)
+	sysv5uw7*|unix_sv*) #(vi
 		# tested with UnixWare 7.1.0 (gcc 2.95.2 and cc)
 		if test "$GCC" != yes; then
 			CC_SHARED_OPTS='-KPIC'
@@ -5281,11 +5818,11 @@
 	case "$cf_cv_shlib_version" in #(vi
 	rel|abi)
 		case "$MK_SHARED_LIB" in #(vi
-		*'-o $@')
+		*'-o $@') #(vi
 			test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes
 			;;
 		*)
-			{ echo "$as_me:5288: WARNING: ignored --with-shlib-version" >&5
+			{ echo "$as_me:5825: WARNING: ignored --with-shlib-version" >&5
 echo "$as_me: WARNING: ignored --with-shlib-version" >&2;}
 			;;
 		esac
@@ -5293,62 +5830,248 @@
 	esac
 
 	if test -n "$cf_ld_rpath_opt" ; then
-		echo "$as_me:5296: checking if we need a space after rpath option" >&5
-echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
-		cf_save_LIBS="$LIBS"
-		LIBS="$LIBS ${cf_ld_rpath_opt}$libdir"
-		cat >conftest.$ac_ext <<_ACEOF
-#line 5301 "configure"
-#include "confdefs.h"
+		MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${libdir}"
+	fi
+
+if test "$CC_SHARED_OPTS" = "unknown"; then
+	for model in $cf_list_models; do
+		if test "$model" = "shared"; then
+			{ { echo "$as_me:5839: error: Shared libraries are not supported in this version" >&5
+echo "$as_me: error: Shared libraries are not supported in this version" >&2;}
+   { (exit 1); exit 1; }; }
+		fi
+	done
+fi
+
+### If we're building with rpath, try to link non-standard libs that way too.
+if test "$DFT_LWR_MODEL" = "shared"; then
+
+echo "$as_me:5849: checking if rpath should be not be set" >&5
+echo $ECHO_N "checking if rpath should be not be set... $ECHO_C" >&6
+
+# Check whether --enable-rpath-hack or --disable-rpath-hack was given.
+if test "${enable_rpath_hack+set}" = set; then
+  enableval="$enable_rpath_hack"
+  test "$enableval" != no && enableval=yes
+  if test "$enableval" != "yes" ; then
+    cf_disable_rpath_hack=yes
+  else
+    cf_disable_rpath_hack=no
+  fi
+else
+  enableval=yes
+  cf_disable_rpath_hack=no
+
+fi;
+echo "$as_me:5866: result: $cf_disable_rpath_hack" >&5
+echo "${ECHO_T}$cf_disable_rpath_hack" >&6
+if test "$cf_disable_rpath_hack" = no ; then
+
+echo "$as_me:5870: checking for updated LDFLAGS" >&5
+echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6
+if test -n "$LD_RPATH_OPT" ; then
+	echo "$as_me:5873: result: maybe" >&5
+echo "${ECHO_T}maybe" >&6
+
+	for ac_prog in ldd
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:5880: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$cf_ldd_prog"; then
+  ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test.
+else
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_cf_ldd_prog="$ac_prog"
+echo "$as_me:5895: found $ac_dir/$ac_word" >&5
+break
+done
+
+fi
+fi
+cf_ldd_prog=$ac_cv_prog_cf_ldd_prog
+if test -n "$cf_ldd_prog"; then
+  echo "$as_me:5903: result: $cf_ldd_prog" >&5
+echo "${ECHO_T}$cf_ldd_prog" >&6
+else
+  echo "$as_me:5906: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  test -n "$cf_ldd_prog" && break
+done
+test -n "$cf_ldd_prog" || cf_ldd_prog="no"
 
+	cf_rpath_list="/usr/lib /lib"
+	if test "$cf_ldd_prog" != no
+	then
+cat >conftest.$ac_ext <<_ACEOF
+#line 5918 "configure"
+#include "confdefs.h"
+#include <stdio.h>
 int
 main ()
 {
-
+printf("Hello");
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:5313: \"$ac_link\"") >&5
+if { (eval echo "$as_me:5930: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:5316: \$? = $ac_status" >&5
+  echo "$as_me:5933: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:5319: \"$ac_try\"") >&5
+  { (eval echo "$as_me:5936: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:5322: \$? = $ac_status" >&5
+  echo "$as_me:5939: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  cf_rpath_space=no
+  cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[ 	]/%/%' -e 's%/[^/][^/]*$%%' |sort -u`
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-cf_rpath_space=yes
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-		LIBS="$cf_save_LIBS"
-		echo "$as_me:5332: result: $cf_rpath_space" >&5
-echo "${ECHO_T}$cf_rpath_space" >&6
-		test "$cf_rpath_space" = yes && cf_ld_rpath_opt="$cf_ld_rpath_opt "
-		MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${libdir}"
 	fi
 
-if test "$CC_SHARED_OPTS" = "unknown"; then
-	for model in $cf_list_models; do
-		if test "$model" = "shared"; then
-			{ { echo "$as_me:5341: error: Shared libraries are not supported in this version" >&5
-echo "$as_me: error: Shared libraries are not supported in this version" >&2;}
-   { (exit 1); exit 1; }; }
+	test -n "$verbose" && echo "	...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
+
+echo "${as_me:-configure}:5951: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
+
+test -n "$verbose" && echo "	...checking LDFLAGS $LDFLAGS" 1>&6
+
+echo "${as_me:-configure}:5955: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
+
+cf_rpath_dst=
+for cf_rpath_src in $LDFLAGS
+do
+	case $cf_rpath_src in #(vi
+	-L*) #(vi
+
+		# check if this refers to a directory which we will ignore
+		cf_rpath_skip=no
+		if test -n "$cf_rpath_list"
+		then
+			for cf_rpath_item in $cf_rpath_list
+			do
+				if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
+				then
+					cf_rpath_skip=yes
+					break
+				fi
+			done
 		fi
-	done
+
+		if test "$cf_rpath_skip" = no
+		then
+			# transform the option
+			if test "$LD_RPATH_OPT" = "-R " ; then
+				cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
+			else
+				cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
+			fi
+
+			# if we have not already added this, add it now
+			cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
+			if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
+			then
+				test -n "$verbose" && echo "	...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
+
+echo "${as_me:-configure}:5992: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
+
+				EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
+			fi
+		fi
+		;;
+	esac
+	cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
+done
+LDFLAGS=$cf_rpath_dst
+
+test -n "$verbose" && echo "	...checked LDFLAGS $LDFLAGS" 1>&6
+
+echo "${as_me:-configure}:6005: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
+
+test -n "$verbose" && echo "	...checking LIBS $LIBS" 1>&6
+
+echo "${as_me:-configure}:6009: testing ...checking LIBS $LIBS ..." 1>&5
+
+cf_rpath_dst=
+for cf_rpath_src in $LIBS
+do
+	case $cf_rpath_src in #(vi
+	-L*) #(vi
+
+		# check if this refers to a directory which we will ignore
+		cf_rpath_skip=no
+		if test -n "$cf_rpath_list"
+		then
+			for cf_rpath_item in $cf_rpath_list
+			do
+				if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
+				then
+					cf_rpath_skip=yes
+					break
+				fi
+			done
+		fi
+
+		if test "$cf_rpath_skip" = no
+		then
+			# transform the option
+			if test "$LD_RPATH_OPT" = "-R " ; then
+				cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
+			else
+				cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
+			fi
+
+			# if we have not already added this, add it now
+			cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
+			if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
+			then
+				test -n "$verbose" && echo "	...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
+
+echo "${as_me:-configure}:6046: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
+
+				EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
+			fi
+		fi
+		;;
+	esac
+	cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
+done
+LIBS=$cf_rpath_dst
+
+test -n "$verbose" && echo "	...checked LIBS $LIBS" 1>&6
+
+echo "${as_me:-configure}:6059: testing ...checked LIBS $LIBS ..." 1>&5
+
+	test -n "$verbose" && echo "	...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
+
+echo "${as_me:-configure}:6063: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
+
+fi
+
+fi
+
 fi
 
 ###############################################################################
 
 ###	use option --disable-overwrite to leave out the link to -lcurses
-echo "$as_me:5351: checking if you wish to install ncurses overwriting curses" >&5
+echo "$as_me:6074: checking if you wish to install ncurses overwriting curses" >&5
 echo $ECHO_N "checking if you wish to install ncurses overwriting curses... $ECHO_C" >&6
 
 # Check whether --enable-overwrite or --disable-overwrite was given.
@@ -5358,10 +6081,10 @@
 else
   if test "$prefix" = "/usr" ; then with_overwrite=yes; else with_overwrite=no; fi
 fi;
-echo "$as_me:5361: result: $with_overwrite" >&5
+echo "$as_me:6084: result: $with_overwrite" >&5
 echo "${ECHO_T}$with_overwrite" >&6
 
-echo "$as_me:5364: checking if external terminfo-database is used" >&5
+echo "$as_me:6087: checking if external terminfo-database is used" >&5
 echo $ECHO_N "checking if external terminfo-database is used... $ECHO_C" >&6
 
 # Check whether --enable-database or --disable-database was given.
@@ -5371,7 +6094,7 @@
 else
   use_database=yes
 fi;
-echo "$as_me:5374: result: $use_database" >&5
+echo "$as_me:6097: result: $use_database" >&5
 echo "${ECHO_T}$use_database" >&6
 
 case $host_os in #(vi
@@ -5384,8 +6107,8 @@
 esac
 
 	case $cf_cv_system_name in
-	os2*)	PATHSEP=';'  ;;
-	*)	PATHSEP=':'  ;;
+	os2*)	PATH_SEPARATOR=';'  ;;
+	*)	PATH_SEPARATOR=':'  ;;
 	esac
 
 if test "$use_database" != no ; then
@@ -5393,18 +6116,18 @@
 #define USE_DATABASE 1
 EOF
 
-	echo "$as_me:5396: checking which terminfo source-file will be installed" >&5
+	echo "$as_me:6119: checking which terminfo source-file will be installed" >&5
 echo $ECHO_N "checking which terminfo source-file will be installed... $ECHO_C" >&6
 
-# Check whether --enable-database or --disable-database was given.
-if test "${enable_database+set}" = set; then
-  enableval="$enable_database"
+# Check whether --with-database or --without-database was given.
+if test "${with_database+set}" = set; then
+  withval="$with_database"
   TERMINFO_SRC=$withval
 fi;
-	echo "$as_me:5404: result: $TERMINFO_SRC" >&5
+	echo "$as_me:6127: result: $TERMINFO_SRC" >&5
 echo "${ECHO_T}$TERMINFO_SRC" >&6
 
-	echo "$as_me:5407: checking whether to use hashed database instead of directory/tree" >&5
+	echo "$as_me:6130: checking whether to use hashed database instead of directory/tree" >&5
 echo $ECHO_N "checking whether to use hashed database instead of directory/tree... $ECHO_C" >&6
 
 # Check whether --with-hashed-db or --without-hashed-db was given.
@@ -5414,13 +6137,13 @@
 else
   with_hashed_db=no
 fi;
-	echo "$as_me:5417: result: $with_hashed_db" >&5
+	echo "$as_me:6140: result: $with_hashed_db" >&5
 echo "${ECHO_T}$with_hashed_db" >&6
 else
 	with_hashed_db=no
 fi
 
-echo "$as_me:5423: checking for list of fallback descriptions" >&5
+echo "$as_me:6146: checking for list of fallback descriptions" >&5
 echo $ECHO_N "checking for list of fallback descriptions... $ECHO_C" >&6
 
 # Check whether --with-fallbacks or --without-fallbacks was given.
@@ -5430,11 +6153,11 @@
 else
   with_fallback=
 fi;
-echo "$as_me:5433: result: $with_fallback" >&5
+echo "$as_me:6156: result: $with_fallback" >&5
 echo "${ECHO_T}$with_fallback" >&6
 FALLBACK_LIST=`echo "$with_fallback" | sed -e 's/,/ /g'`
 
-echo "$as_me:5437: checking if you want modern xterm or antique" >&5
+echo "$as_me:6160: checking if you want modern xterm or antique" >&5
 echo $ECHO_N "checking if you want modern xterm or antique... $ECHO_C" >&6
 
 # Check whether --with-xterm-new or --without-xterm-new was given.
@@ -5448,7 +6171,7 @@
 no)	with_xterm_new=xterm-old;;
 *)	with_xterm_new=xterm-new;;
 esac
-echo "$as_me:5451: result: $with_xterm_new" >&5
+echo "$as_me:6174: result: $with_xterm_new" >&5
 echo "${ECHO_T}$with_xterm_new" >&6
 WHICH_XTERM=$with_xterm_new
 
@@ -5458,7 +6181,7 @@
 	MAKE_TERMINFO="#"
 else
 
-echo "$as_me:5461: checking for list of terminfo directories" >&5
+echo "$as_me:6184: checking for list of terminfo directories" >&5
 echo $ECHO_N "checking for list of terminfo directories... $ECHO_C" >&6
 
 # Check whether --with-terminfo-dirs or --without-terminfo-dirs was given.
@@ -5466,9 +6189,9 @@
   withval="$with_terminfo_dirs"
 
 else
-  withval=${TERMINFO_DIRS-${datadir}/terminfo}
+  withval=${TERMINFO_DIRS:-${datadir}/terminfo}
 fi;
-IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${PATHSEP}"
+IFS="${IFS:- 	}"; ac_save_ifs="$IFS"; IFS="${PATH_SEPARATOR}"
 cf_dst_path=
 for cf_src_path in $withval
 do
@@ -5498,7 +6221,7 @@
   cf_src_path=`echo $cf_src_path | sed -e s%NONE%$cf_path_syntax%`
   ;;
 *)
-  { { echo "$as_me:5501: error: expected a pathname, not \"$cf_src_path\"" >&5
+  { { echo "$as_me:6224: error: expected a pathname, not \"$cf_src_path\"" >&5
 echo "$as_me: error: expected a pathname, not \"$cf_src_path\"" >&2;}
    { (exit 1); exit 1; }; }
   ;;
@@ -5511,13 +6234,13 @@
 
 eval 'TERMINFO_DIRS="$cf_dst_path"'
 
-echo "$as_me:5514: result: $TERMINFO_DIRS" >&5
+echo "$as_me:6237: result: $TERMINFO_DIRS" >&5
 echo "${ECHO_T}$TERMINFO_DIRS" >&6
 test -n "$TERMINFO_DIRS" && cat >>confdefs.h <<EOF
 #define TERMINFO_DIRS "$TERMINFO_DIRS"
 EOF
 
-echo "$as_me:5520: checking for default terminfo directory" >&5
+echo "$as_me:6243: checking for default terminfo directory" >&5
 echo $ECHO_N "checking for default terminfo directory... $ECHO_C" >&6
 
 # Check whether --with-default-terminfo-dir or --without-default-terminfo-dir was given.
@@ -5525,7 +6248,7 @@
   withval="$with_default_terminfo_dir"
 
 else
-  withval="${TERMINFO-${datadir}/terminfo}"
+  withval="${TERMINFO:-${datadir}/terminfo}"
 fi; if test -n "${datadir}/terminfo" ; then
 
 if test "x$prefix" != xNONE; then
@@ -5553,7 +6276,7 @@
   withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
   ;;
 *)
-  { { echo "$as_me:5556: error: expected a pathname, not \"$withval\"" >&5
+  { { echo "$as_me:6279: error: expected a pathname, not \"$withval\"" >&5
 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
    { (exit 1); exit 1; }; }
   ;;
@@ -5562,7 +6285,7 @@
 fi
 TERMINFO="$withval"
 
-echo "$as_me:5565: result: $TERMINFO" >&5
+echo "$as_me:6288: result: $TERMINFO" >&5
 echo "${ECHO_T}$TERMINFO" >&6
 cat >>confdefs.h <<EOF
 #define TERMINFO "$TERMINFO"
@@ -5572,7 +6295,7 @@
 
 ###	use option --disable-big-core to make tic run on small machines
 ###	We need 4Mb, check if we can allocate 50% more than that.
-echo "$as_me:5575: checking if big-core option selected" >&5
+echo "$as_me:6298: checking if big-core option selected" >&5
 echo $ECHO_N "checking if big-core option selected... $ECHO_C" >&6
 
 # Check whether --enable-big-core or --disable-big-core was given.
@@ -5584,7 +6307,7 @@
   with_big_core=no
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 5587 "configure"
+#line 6310 "configure"
 #include "confdefs.h"
 
 #include <stdlib.h>
@@ -5598,15 +6321,15 @@
 }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:5601: \"$ac_link\"") >&5
+if { (eval echo "$as_me:6324: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:5604: \$? = $ac_status" >&5
+  echo "$as_me:6327: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:5606: \"$ac_try\"") >&5
+  { (eval echo "$as_me:6329: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:5609: \$? = $ac_status" >&5
+  echo "$as_me:6332: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   with_big_core=yes
 else
@@ -5618,7 +6341,7 @@
 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 fi;
-echo "$as_me:5621: result: $with_big_core" >&5
+echo "$as_me:6344: result: $with_big_core" >&5
 echo "${ECHO_T}$with_big_core" >&6
 test "$with_big_core" = "yes" && cat >>confdefs.h <<\EOF
 #define HAVE_BIG_CORE 1
@@ -5627,7 +6350,7 @@
 ### ISO C only guarantees 512-char strings, we have tables which load faster
 ### when constructed using "big" strings.  More than the C compiler, the awk
 ### program is a limit on most vendor UNIX systems.  Check that we can build.
-echo "$as_me:5630: checking if big-strings option selected" >&5
+echo "$as_me:6353: checking if big-strings option selected" >&5
 echo $ECHO_N "checking if big-strings option selected... $ECHO_C" >&6
 
 # Check whether --enable-big-strings or --disable-big-strings was given.
@@ -5636,29 +6359,29 @@
   with_big_strings=$enableval
 else
 
-    case x$AWK in #(vi
-    x)
-        eval with_big_strings=no
-        ;;
-    *) #(vi
-        if ( ${AWK} 'BEGIN { xx = "x"; while (length(xx) < 12000) { xx = xx "x"; }; printf("%s\n", xx); }' \
-            | $AWK '{ printf "%d\n", length($0); }' | $AWK 'BEGIN { eqls=0; recs=0; } { recs++; if ($0 == 12000) eqls++; } END { if (recs != 1 || eqls != 1) exit 1; }' 2>/dev/null >/dev/null ) ; then
-            eval with_big_strings=yes
-        else
-            eval with_big_strings=no
-        fi
-        ;;
-    esac
+	case x$AWK in #(vi
+	x)
+		eval with_big_strings=no
+		;;
+	*) #(vi
+		if ( ${AWK} 'BEGIN { xx = "x"; while (length(xx) < 12000) { xx = xx "x"; }; printf("%s\n", xx); }' \
+			| $AWK '{ printf "%d\n", length($0); }' | $AWK 'BEGIN { eqls=0; recs=0; } { recs++; if ($0 == 12000) eqls++; } END { if (recs != 1 || eqls != 1) exit 1; }' 2>/dev/null >/dev/null ) ; then
+			eval with_big_strings=yes
+		else
+			eval with_big_strings=no
+		fi
+		;;
+	esac
 
 fi;
-echo "$as_me:5654: result: $with_big_strings" >&5
+echo "$as_me:6377: result: $with_big_strings" >&5
 echo "${ECHO_T}$with_big_strings" >&6
 
 USE_BIG_STRINGS=0
 test "$with_big_strings" = "yes" && USE_BIG_STRINGS=1
 
 ###	use option --enable-termcap to compile in the termcap fallback support
-echo "$as_me:5661: checking if you want termcap-fallback support" >&5
+echo "$as_me:6384: checking if you want termcap-fallback support" >&5
 echo $ECHO_N "checking if you want termcap-fallback support... $ECHO_C" >&6
 
 # Check whether --enable-termcap or --disable-termcap was given.
@@ -5668,13 +6391,13 @@
 else
   with_termcap=no
 fi;
-echo "$as_me:5671: result: $with_termcap" >&5
+echo "$as_me:6394: result: $with_termcap" >&5
 echo "${ECHO_T}$with_termcap" >&6
 
 if test "$with_termcap" != "yes" ; then
 	if test "$use_database" = no ; then
 		if test -z "$with_fallback" ; then
-			{ { echo "$as_me:5677: error: You have disabled the database w/o specifying fallbacks" >&5
+			{ { echo "$as_me:6400: error: You have disabled the database w/o specifying fallbacks" >&5
 echo "$as_me: error: You have disabled the database w/o specifying fallbacks" >&2;}
    { (exit 1); exit 1; }; }
 		fi
@@ -5686,7 +6409,7 @@
 else
 
 if test "$with_ticlib" != no ; then
-	{ { echo "$as_me:5689: error: Options --with-ticlib and --enable-termcap cannot be combined" >&5
+	{ { echo "$as_me:6412: error: Options --with-ticlib and --enable-termcap cannot be combined" >&5
 echo "$as_me: error: Options --with-ticlib and --enable-termcap cannot be combined" >&2;}
    { (exit 1); exit 1; }; }
 fi
@@ -5695,7 +6418,7 @@
 #define USE_TERMCAP 1
 EOF
 
-echo "$as_me:5698: checking for list of termcap files" >&5
+echo "$as_me:6421: checking for list of termcap files" >&5
 echo $ECHO_N "checking for list of termcap files... $ECHO_C" >&6
 
 # Check whether --with-termpath or --without-termpath was given.
@@ -5703,9 +6426,9 @@
   withval="$with_termpath"
 
 else
-  withval=${TERMPATH-/etc/termcap:/usr/share/misc/termcap}
+  withval=${TERMPATH:-/etc/termcap:/usr/share/misc/termcap}
 fi;
-IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${PATHSEP}"
+IFS="${IFS:- 	}"; ac_save_ifs="$IFS"; IFS="${PATH_SEPARATOR}"
 cf_dst_path=
 for cf_src_path in $withval
 do
@@ -5735,7 +6458,7 @@
   cf_src_path=`echo $cf_src_path | sed -e s%NONE%$cf_path_syntax%`
   ;;
 *)
-  { { echo "$as_me:5738: error: expected a pathname, not \"$cf_src_path\"" >&5
+  { { echo "$as_me:6461: error: expected a pathname, not \"$cf_src_path\"" >&5
 echo "$as_me: error: expected a pathname, not \"$cf_src_path\"" >&2;}
    { (exit 1); exit 1; }; }
   ;;
@@ -5748,14 +6471,14 @@
 
 eval 'TERMPATH="$cf_dst_path"'
 
-echo "$as_me:5751: result: $TERMPATH" >&5
+echo "$as_me:6474: result: $TERMPATH" >&5
 echo "${ECHO_T}$TERMPATH" >&6
 test -n "$TERMPATH" && cat >>confdefs.h <<EOF
 #define TERMPATH "$TERMPATH"
 EOF
 
 ###	use option --enable-getcap to use a hacked getcap for reading termcaps
-echo "$as_me:5758: checking if fast termcap-loader is needed" >&5
+echo "$as_me:6481: checking if fast termcap-loader is needed" >&5
 echo $ECHO_N "checking if fast termcap-loader is needed... $ECHO_C" >&6
 
 # Check whether --enable-getcap or --disable-getcap was given.
@@ -5765,13 +6488,13 @@
 else
   with_getcap=no
 fi;
-echo "$as_me:5768: result: $with_getcap" >&5
+echo "$as_me:6491: result: $with_getcap" >&5
 echo "${ECHO_T}$with_getcap" >&6
 test "$with_getcap" = "yes" && cat >>confdefs.h <<\EOF
 #define USE_GETCAP 1
 EOF
 
-echo "$as_me:5774: checking if translated termcaps will be cached in ~/.terminfo" >&5
+echo "$as_me:6497: checking if translated termcaps will be cached in ~/.terminfo" >&5
 echo $ECHO_N "checking if translated termcaps will be cached in ~/.terminfo... $ECHO_C" >&6
 
 # Check whether --enable-getcap-cache or --disable-getcap-cache was given.
@@ -5781,7 +6504,7 @@
 else
   with_getcap_cache=no
 fi;
-echo "$as_me:5784: result: $with_getcap_cache" >&5
+echo "$as_me:6507: result: $with_getcap_cache" >&5
 echo "${ECHO_T}$with_getcap_cache" >&6
 test "$with_getcap_cache" = "yes" && cat >>confdefs.h <<\EOF
 #define USE_GETCAP_CACHE 1
@@ -5790,7 +6513,7 @@
 fi
 
 ###   Use option --disable-home-terminfo to completely remove ~/.terminfo
-echo "$as_me:5793: checking if ~/.terminfo is wanted" >&5
+echo "$as_me:6516: checking if ~/.terminfo is wanted" >&5
 echo $ECHO_N "checking if ~/.terminfo is wanted... $ECHO_C" >&6
 
 # Check whether --enable-home-terminfo or --disable-home-terminfo was given.
@@ -5800,13 +6523,13 @@
 else
   with_home_terminfo=yes
 fi;
-echo "$as_me:5803: result: $with_home_terminfo" >&5
+echo "$as_me:6526: result: $with_home_terminfo" >&5
 echo "${ECHO_T}$with_home_terminfo" >&6
 test "$with_home_terminfo" = "yes" && cat >>confdefs.h <<\EOF
 #define USE_HOME_TERMINFO 1
 EOF
 
-echo "$as_me:5809: checking if you want to use restricted environment when running as root" >&5
+echo "$as_me:6532: checking if you want to use restricted environment when running as root" >&5
 echo $ECHO_N "checking if you want to use restricted environment when running as root... $ECHO_C" >&6
 
 # Check whether --enable-root-environ or --disable-root-environ was given.
@@ -5816,7 +6539,7 @@
 else
   with_root_environ=yes
 fi;
-echo "$as_me:5819: result: $with_root_environ" >&5
+echo "$as_me:6542: result: $with_root_environ" >&5
 echo "${ECHO_T}$with_root_environ" >&6
 test "$with_root_environ" = yes && cat >>confdefs.h <<\EOF
 #define USE_ROOT_ENVIRON 1
@@ -5830,13 +6553,13 @@
 	unlink
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:5833: checking for $ac_func" >&5
+echo "$as_me:6556: checking for $ac_func" >&5
 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
 if eval "test \"\${$as_ac_var+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 5839 "configure"
+#line 6562 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func (); below.  */
@@ -5867,16 +6590,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:5870: \"$ac_link\"") >&5
+if { (eval echo "$as_me:6593: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:5873: \$? = $ac_status" >&5
+  echo "$as_me:6596: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:5876: \"$ac_try\"") >&5
+  { (eval echo "$as_me:6599: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:5879: \$? = $ac_status" >&5
+  echo "$as_me:6602: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   eval "$as_ac_var=yes"
 else
@@ -5886,7 +6609,7 @@
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:5889: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "$as_me:6612: result: `eval echo '${'$as_ac_var'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<EOF
@@ -5903,13 +6626,13 @@
 		symlink
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:5906: checking for $ac_func" >&5
+echo "$as_me:6629: checking for $ac_func" >&5
 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
 if eval "test \"\${$as_ac_var+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 5912 "configure"
+#line 6635 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func (); below.  */
@@ -5940,16 +6663,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:5943: \"$ac_link\"") >&5
+if { (eval echo "$as_me:6666: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:5946: \$? = $ac_status" >&5
+  echo "$as_me:6669: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:5949: \"$ac_try\"") >&5
+  { (eval echo "$as_me:6672: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:5952: \$? = $ac_status" >&5
+  echo "$as_me:6675: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   eval "$as_ac_var=yes"
 else
@@ -5959,7 +6682,7 @@
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:5962: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "$as_me:6685: result: `eval echo '${'$as_ac_var'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<EOF
@@ -5970,7 +6693,7 @@
 done
 
 else
-	echo "$as_me:5973: checking if link/symlink functions work" >&5
+	echo "$as_me:6696: checking if link/symlink functions work" >&5
 echo $ECHO_N "checking if link/symlink functions work... $ECHO_C" >&6
 if test "${cf_cv_link_funcs+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -5983,7 +6706,7 @@
 			eval 'ac_cv_func_'$cf_func'=error'
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 5986 "configure"
+#line 6709 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -6013,15 +6736,15 @@
 
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:6016: \"$ac_link\"") >&5
+if { (eval echo "$as_me:6739: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:6019: \$? = $ac_status" >&5
+  echo "$as_me:6742: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:6021: \"$ac_try\"") >&5
+  { (eval echo "$as_me:6744: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:6024: \$? = $ac_status" >&5
+  echo "$as_me:6747: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
 			cf_cv_link_funcs="$cf_cv_link_funcs $cf_func"
@@ -6039,7 +6762,7 @@
 		test -z "$cf_cv_link_funcs" && cf_cv_link_funcs=no
 
 fi
-echo "$as_me:6042: result: $cf_cv_link_funcs" >&5
+echo "$as_me:6765: result: $cf_cv_link_funcs" >&5
 echo "${ECHO_T}$cf_cv_link_funcs" >&6
 	test "$ac_cv_func_link"    = yes && cat >>confdefs.h <<\EOF
 #define HAVE_LINK 1
@@ -6057,7 +6780,7 @@
 # soft links (symbolic links) are useful for some systems where hard links do
 # not work, or to make it simpler to copy terminfo trees around.
 if test "$ac_cv_func_symlink" = yes ; then
-    echo "$as_me:6060: checking if tic should use symbolic links" >&5
+    echo "$as_me:6783: checking if tic should use symbolic links" >&5
 echo $ECHO_N "checking if tic should use symbolic links... $ECHO_C" >&6
 
 # Check whether --enable-symlinks or --disable-symlinks was given.
@@ -6067,21 +6790,21 @@
 else
   with_symlinks=no
 fi;
-    echo "$as_me:6070: result: $with_symlinks" >&5
+    echo "$as_me:6793: result: $with_symlinks" >&5
 echo "${ECHO_T}$with_symlinks" >&6
 fi
 
 # If we have hard links and did not choose to use soft links instead, there is
 # no reason to make this choice optional - use the hard links.
 if test "$with_symlinks" = no ; then
-    echo "$as_me:6077: checking if tic should use hard links" >&5
+    echo "$as_me:6800: checking if tic should use hard links" >&5
 echo $ECHO_N "checking if tic should use hard links... $ECHO_C" >&6
     if test "$ac_cv_func_link" = yes ; then
 	with_links=yes
     else
 	with_links=no
     fi
-    echo "$as_me:6084: result: $with_links" >&5
+    echo "$as_me:6807: result: $with_links" >&5
 echo "${ECHO_T}$with_links" >&6
 fi
 
@@ -6094,7 +6817,7 @@
 EOF
 
 ###   use option --enable-broken-linker to force on use of broken-linker support
-echo "$as_me:6097: checking if you want broken-linker support code" >&5
+echo "$as_me:6820: checking if you want broken-linker support code" >&5
 echo $ECHO_N "checking if you want broken-linker support code... $ECHO_C" >&6
 
 # Check whether --enable-broken_linker or --disable-broken_linker was given.
@@ -6102,9 +6825,9 @@
   enableval="$enable_broken_linker"
   with_broken_linker=$enableval
 else
-  with_broken_linker=${BROKEN_LINKER-no}
+  with_broken_linker=${BROKEN_LINKER:-no}
 fi;
-echo "$as_me:6107: result: $with_broken_linker" >&5
+echo "$as_me:6830: result: $with_broken_linker" >&5
 echo "${ECHO_T}$with_broken_linker" >&6
 
 BROKEN_LINKER=0
@@ -6124,14 +6847,14 @@
 		BROKEN_LINKER=1
 		test -n "$verbose" && echo "	cygwin linker is broken anyway" 1>&6
 
-echo "${as_me-configure}:6127: testing cygwin linker is broken anyway ..." 1>&5
+echo "${as_me:-configure}:6850: testing cygwin linker is broken anyway ..." 1>&5
 
 		;;
 	esac
 fi
 
 ###   use option --enable-bsdpad to have tputs process BSD-style prefix padding
-echo "$as_me:6134: checking if tputs should process BSD-style prefix padding" >&5
+echo "$as_me:6857: checking if tputs should process BSD-style prefix padding" >&5
 echo $ECHO_N "checking if tputs should process BSD-style prefix padding... $ECHO_C" >&6
 
 # Check whether --enable-bsdpad or --disable-bsdpad was given.
@@ -6141,7 +6864,7 @@
 else
   with_bsdpad=no
 fi;
-echo "$as_me:6144: result: $with_bsdpad" >&5
+echo "$as_me:6867: result: $with_bsdpad" >&5
 echo "${ECHO_T}$with_bsdpad" >&6
 test "$with_bsdpad" = yes && cat >>confdefs.h <<\EOF
 #define BSD_TPUTS 1
@@ -6158,91 +6881,47 @@
 
 # Check to define _XOPEN_SOURCE "automatically"
 
-echo "$as_me:6161: checking if $CC -U and -D options work together" >&5
-echo $ECHO_N "checking if $CC -U and -D options work together... $ECHO_C" >&6
-if test "${cf_cv_cc_u_d_options+set}" = set; then
+cf_XOPEN_SOURCE=500
+cf_POSIX_C_SOURCE=199506L
+cf_xopen_source=
+
+case $host_os in #(vi
+aix[456]*) #(vi
+	cf_xopen_source="-D_ALL_SOURCE"
+	;;
+darwin[0-8].*) #(vi
+	cf_xopen_source="-D_APPLE_C_SOURCE"
+	;;
+darwin*) #(vi
+	cf_xopen_source="-D_DARWIN_C_SOURCE"
+	;;
+freebsd*|dragonfly*) #(vi
+	# 5.x headers associate
+	#	_XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
+	#	_XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
+	cf_POSIX_C_SOURCE=200112L
+	cf_XOPEN_SOURCE=600
+	cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
+	;;
+hpux11*) #(vi
+	cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
+	;;
+hpux*) #(vi
+	cf_xopen_source="-D_HPUX_SOURCE"
+	;;
+irix[56].*) #(vi
+	cf_xopen_source="-D_SGI_SOURCE"
+	;;
+linux*|gnu*|mint*|k*bsd*-gnu) #(vi
+
+echo "$as_me:6917: checking if we must define _GNU_SOURCE" >&5
+echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
+if test "${cf_cv_gnu_source+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-	cf_save_CPPFLAGS="$CPPFLAGS"
-	CPPFLAGS="-UU_D_OPTIONS -DU_D_OPTIONS -DD_U_OPTIONS -UD_U_OPTIONS"
-	cat >conftest.$ac_ext <<_ACEOF
-#line 6170 "configure"
-#include "confdefs.h"
-
-int
-main ()
-{
-
-#ifndef U_D_OPTIONS
-make an undefined-error
-#endif
-#ifdef  D_U_OPTIONS
-make a defined-error
-#endif
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:6189: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:6192: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:6195: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:6198: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-
-	cf_cv_cc_u_d_options=yes
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-
-	cf_cv_cc_u_d_options=no
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-	CPPFLAGS="$cf_save_CPPFLAGS"
-
-fi
-echo "$as_me:6212: result: $cf_cv_cc_u_d_options" >&5
-echo "${ECHO_T}$cf_cv_cc_u_d_options" >&6
-
-cf_XOPEN_SOURCE=500
-cf_POSIX_C_SOURCE=199506L
-
-case $host_os in #(vi
-aix[45]*) #(vi
-	CPPFLAGS="$CPPFLAGS -D_ALL_SOURCE"
-	;;
-freebsd*|dragonfly*) #(vi
-	# 5.x headers associate
-	#	_XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
-	#	_XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
-	cf_POSIX_C_SOURCE=200112L
-	cf_XOPEN_SOURCE=600
-	CPPFLAGS="$CPPFLAGS -D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
-	;;
-hpux*) #(vi
-	CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE"
-	;;
-irix[56].*) #(vi
-	CPPFLAGS="$CPPFLAGS -D_SGI_SOURCE"
-	;;
-linux*|gnu*|k*bsd*-gnu) #(vi
-
-echo "$as_me:6238: checking if we must define _GNU_SOURCE" >&5
-echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
-if test "${cf_cv_gnu_source+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-cat >conftest.$ac_ext <<_ACEOF
-#line 6245 "configure"
+cat >conftest.$ac_ext <<_ACEOF
+#line 6924 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 int
@@ -6257,16 +6936,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:6260: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:6939: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:6263: \$? = $ac_status" >&5
+  echo "$as_me:6942: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:6266: \"$ac_try\"") >&5
+  { (eval echo "$as_me:6945: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:6269: \$? = $ac_status" >&5
+  echo "$as_me:6948: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_gnu_source=no
 else
@@ -6275,7 +6954,7 @@
 cf_save="$CPPFLAGS"
 	 CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
 	 cat >conftest.$ac_ext <<_ACEOF
-#line 6278 "configure"
+#line 6957 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 int
@@ -6290,16 +6969,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:6293: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:6972: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:6296: \$? = $ac_status" >&5
+  echo "$as_me:6975: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:6299: \"$ac_try\"") >&5
+  { (eval echo "$as_me:6978: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:6302: \$? = $ac_status" >&5
+  echo "$as_me:6981: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_gnu_source=no
 else
@@ -6314,7 +6993,7 @@
 rm -f conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:6317: result: $cf_cv_gnu_source" >&5
+echo "$as_me:6996: result: $cf_cv_gnu_source" >&5
 echo "${ECHO_T}$cf_cv_gnu_source" >&6
 test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
 
@@ -6329,26 +7008,29 @@
 	# setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
 	;;
 osf[45]*) #(vi
-	CPPFLAGS="$CPPFLAGS -D_OSF_SOURCE"
+	cf_xopen_source="-D_OSF_SOURCE"
 	;;
 nto-qnx*) #(vi
-	CPPFLAGS="$CPPFLAGS -D_QNX_SOURCE"
+	cf_xopen_source="-D_QNX_SOURCE"
 	;;
 sco*) #(vi
 	# setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
 	;;
-solaris*) #(vi
-	CPPFLAGS="$CPPFLAGS -D__EXTENSIONS__"
+solaris2.1[0-9]) #(vi
+	cf_xopen_source="-D__EXTENSIONS__ -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
+	;;
+solaris2.[1-9]) #(vi
+	cf_xopen_source="-D__EXTENSIONS__"
 	;;
 *)
-	echo "$as_me:6344: checking if we should define _XOPEN_SOURCE" >&5
+	echo "$as_me:7026: checking if we should define _XOPEN_SOURCE" >&5
 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
 if test "${cf_cv_xopen_source+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 	cat >conftest.$ac_ext <<_ACEOF
-#line 6351 "configure"
+#line 7033 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 int
@@ -6363,16 +7045,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:6366: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:7048: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:6369: \$? = $ac_status" >&5
+  echo "$as_me:7051: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:6372: \"$ac_try\"") >&5
+  { (eval echo "$as_me:7054: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:6375: \$? = $ac_status" >&5
+  echo "$as_me:7057: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_xopen_source=no
 else
@@ -6381,7 +7063,7 @@
 cf_save="$CPPFLAGS"
 	 CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
 	 cat >conftest.$ac_ext <<_ACEOF
-#line 6384 "configure"
+#line 7066 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 int
@@ -6396,16 +7078,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:6399: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:7081: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:6402: \$? = $ac_status" >&5
+  echo "$as_me:7084: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:6405: \"$ac_try\"") >&5
+  { (eval echo "$as_me:7087: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:6408: \$? = $ac_status" >&5
+  echo "$as_me:7090: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_xopen_source=no
 else
@@ -6420,23 +7102,98 @@
 rm -f conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:6423: result: $cf_cv_xopen_source" >&5
+echo "$as_me:7105: result: $cf_cv_xopen_source" >&5
 echo "${ECHO_T}$cf_cv_xopen_source" >&6
 	if test "$cf_cv_xopen_source" != no ; then
 
-# remove _XOPEN_SOURCE symbol from $CFLAGS
 CFLAGS=`echo "$CFLAGS" | \
-	sed	-e 's/-[UD]_XOPEN_SOURCE\(=[^ 	]*\)\?[ 	]/ /g' \
-		-e 's/-[UD]_XOPEN_SOURCE\(=[^ 	]*\)\?$//g'`
+	sed	-e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ 	]*\)\?[ 	]/ /g' \
+		-e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ 	]*\)\?$//g'`
+
+CPPFLAGS=`echo "$CPPFLAGS" | \
+	sed	-e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ 	]*\)\?[ 	]/ /g' \
+		-e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ 	]*\)\?$//g'`
+
+		cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
+
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
+
+for cf_add_cflags in $cf_temp_xopen_source
+do
+case $cf_fix_cppflags in
+no)
+	case $cf_add_cflags in #(vi
+	-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
+		case $cf_add_cflags in
+		-D*)
+			cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
+
+			test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+				&& test -z "${cf_tst_cflags}" \
+				&& cf_fix_cppflags=yes
+
+			if test $cf_fix_cppflags = yes ; then
+				cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+				continue
+			elif test "${cf_tst_cflags}" = "\"'" ; then
+				cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+				continue
+			fi
+			;;
+		esac
+		case "$CPPFLAGS" in
+		*$cf_add_cflags) #(vi
+			;;
+		*) #(vi
+			case $cf_add_cflags in #(vi
+			-D*)
+				cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
 
-# remove _XOPEN_SOURCE symbol from $CPPFLAGS
 CPPFLAGS=`echo "$CPPFLAGS" | \
-	sed	-e 's/-[UD]_XOPEN_SOURCE\(=[^ 	]*\)\?[ 	]/ /g' \
-		-e 's/-[UD]_XOPEN_SOURCE\(=[^ 	]*\)\?$//g'`
+	sed	-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?[ 	]/ /g' \
+		-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?$//g'`
+
+				;;
+			esac
+			cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
+			;;
+		esac
+		;;
+	*)
+		cf_new_cflags="$cf_new_cflags $cf_add_cflags"
+		;;
+	esac
+	;;
+yes)
+	cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+	cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
+
+	test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+		&& test -z "${cf_tst_cflags}" \
+		&& cf_fix_cppflags=no
+	;;
+esac
+done
+
+if test -n "$cf_new_cflags" ; then
+
+	CFLAGS="$CFLAGS $cf_new_cflags"
+fi
+
+if test -n "$cf_new_cppflags" ; then
+
+	CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
+fi
+
+if test -n "$cf_new_extra_cppflags" ; then
+
+	EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+fi
 
-		test "$cf_cv_cc_u_d_options" = yes && \
-			CPPFLAGS="$CPPFLAGS -U_XOPEN_SOURCE"
-		CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_cv_xopen_source"
 	fi
 
 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
@@ -6444,26 +7201,24 @@
 cf_save_CFLAGS="$CFLAGS"
 cf_save_CPPFLAGS="$CPPFLAGS"
 
-# remove _POSIX_C_SOURCE symbol from $cf_save_CFLAGS
 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
-	sed	-e 's/-[UD]_POSIX_C_SOURCE\(=[^ 	]*\)\?[ 	]/ /g' \
-		-e 's/-[UD]_POSIX_C_SOURCE\(=[^ 	]*\)\?$//g'`
+	sed	-e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ 	]*\)\?[ 	]/ /g' \
+		-e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ 	]*\)\?$//g'`
 
-# remove _POSIX_C_SOURCE symbol from $cf_save_CPPFLAGS
 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
-	sed	-e 's/-[UD]_POSIX_C_SOURCE\(=[^ 	]*\)\?[ 	]/ /g' \
-		-e 's/-[UD]_POSIX_C_SOURCE\(=[^ 	]*\)\?$//g'`
+	sed	-e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ 	]*\)\?[ 	]/ /g' \
+		-e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ 	]*\)\?$//g'`
 
-echo "$as_me:6457: checking if we should define _POSIX_C_SOURCE" >&5
+echo "$as_me:7212: checking if we should define _POSIX_C_SOURCE" >&5
 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
 if test "${cf_cv_posix_c_source+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-echo "${as_me-configure}:6463: testing if the symbol is already defined go no further ..." 1>&5
+echo "${as_me:-configure}:7218: testing if the symbol is already defined go no further ..." 1>&5
 
 	cat >conftest.$ac_ext <<_ACEOF
-#line 6466 "configure"
+#line 7221 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 int
@@ -6478,16 +7233,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:6481: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:7236: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:6484: \$? = $ac_status" >&5
+  echo "$as_me:7239: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:6487: \"$ac_try\"") >&5
+  { (eval echo "$as_me:7242: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:6490: \$? = $ac_status" >&5
+  echo "$as_me:7245: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_posix_c_source=no
 else
@@ -6508,7 +7263,7 @@
 	 esac
 	 if test "$cf_want_posix_source" = yes ; then
 		cat >conftest.$ac_ext <<_ACEOF
-#line 6511 "configure"
+#line 7266 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 int
@@ -6523,16 +7278,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:6526: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:7281: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:6529: \$? = $ac_status" >&5
+  echo "$as_me:7284: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:6532: \"$ac_try\"") >&5
+  { (eval echo "$as_me:7287: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:6535: \$? = $ac_status" >&5
+  echo "$as_me:7290: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
@@ -6543,15 +7298,15 @@
 rm -f conftest.$ac_objext conftest.$ac_ext
 	 fi
 
-echo "${as_me-configure}:6546: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
+echo "${as_me:-configure}:7301: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
 
 	 CFLAGS="$cf_trim_CFLAGS"
 	 CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
 
-echo "${as_me-configure}:6551: testing if the second compile does not leave our definition intact error ..." 1>&5
+echo "${as_me:-configure}:7306: testing if the second compile does not leave our definition intact error ..." 1>&5
 
 	 cat >conftest.$ac_ext <<_ACEOF
-#line 6554 "configure"
+#line 7309 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 int
@@ -6566,16 +7321,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:6569: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:7324: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:6572: \$? = $ac_status" >&5
+  echo "$as_me:7327: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:6575: \"$ac_try\"") >&5
+  { (eval echo "$as_me:7330: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:6578: \$? = $ac_status" >&5
+  echo "$as_me:7333: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
@@ -6591,124 +7346,279 @@
 rm -f conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:6594: result: $cf_cv_posix_c_source" >&5
+echo "$as_me:7349: result: $cf_cv_posix_c_source" >&5
 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
 
 if test "$cf_cv_posix_c_source" != no ; then
 	CFLAGS="$cf_trim_CFLAGS"
 	CPPFLAGS="$cf_trim_CPPFLAGS"
-	if test "$cf_cv_cc_u_d_options" = yes ; then
-		cf_temp_posix_c_source=`echo "$cf_cv_posix_c_source" | \
-				sed -e 's/-D/-U/g' -e 's/=[^ 	]*//g'`
-		CPPFLAGS="$CPPFLAGS $cf_temp_posix_c_source"
-	fi
-	CPPFLAGS="$CPPFLAGS $cf_cv_posix_c_source"
-fi
 
-	;;
-esac
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
 
-# Work around breakage on OS X
+for cf_add_cflags in $cf_cv_posix_c_source
+do
+case $cf_fix_cppflags in
+no)
+	case $cf_add_cflags in #(vi
+	-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
+		case $cf_add_cflags in
+		-D*)
+			cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
 
-echo "$as_me:6613: checking if SIGWINCH is defined" >&5
-echo $ECHO_N "checking if SIGWINCH is defined... $ECHO_C" >&6
-if test "${cf_cv_define_sigwinch+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
+			test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+				&& test -z "${cf_tst_cflags}" \
+				&& cf_fix_cppflags=yes
 
-	cat >conftest.$ac_ext <<_ACEOF
-#line 6620 "configure"
-#include "confdefs.h"
+			if test $cf_fix_cppflags = yes ; then
+				cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+				continue
+			elif test "${cf_tst_cflags}" = "\"'" ; then
+				cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+				continue
+			fi
+			;;
+		esac
+		case "$CPPFLAGS" in
+		*$cf_add_cflags) #(vi
+			;;
+		*) #(vi
+			case $cf_add_cflags in #(vi
+			-D*)
+				cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
 
-#include <sys/types.h>
-#include <sys/signal.h>
+CPPFLAGS=`echo "$CPPFLAGS" | \
+	sed	-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?[ 	]/ /g' \
+		-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?$//g'`
 
-int
-main ()
-{
-int x = SIGWINCH
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:6635: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:6638: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:6641: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:6644: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  cf_cv_define_sigwinch=yes
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-cat >conftest.$ac_ext <<_ACEOF
-#line 6651 "configure"
-#include "confdefs.h"
+				;;
+			esac
+			cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
+			;;
+		esac
+		;;
+	*)
+		cf_new_cflags="$cf_new_cflags $cf_add_cflags"
+		;;
+	esac
+	;;
+yes)
+	cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
 
-#undef _XOPEN_SOURCE
-#undef _POSIX_SOURCE
-#undef _POSIX_C_SOURCE
-#include <sys/types.h>
-#include <sys/signal.h>
+	cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
 
-int
-main ()
-{
-int x = SIGWINCH
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:6669: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:6672: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:6675: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:6678: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  cf_cv_define_sigwinch=maybe
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-cf_cv_define_sigwinch=no
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+	test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+		&& test -z "${cf_tst_cflags}" \
+		&& cf_fix_cppflags=no
+	;;
+esac
+done
+
+if test -n "$cf_new_cflags" ; then
 
+	CFLAGS="$CFLAGS $cf_new_cflags"
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
 
+if test -n "$cf_new_cppflags" ; then
+
+	CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
 fi
-echo "$as_me:6692: result: $cf_cv_define_sigwinch" >&5
-echo "${ECHO_T}$cf_cv_define_sigwinch" >&6
 
-if test "$cf_cv_define_sigwinch" = maybe ; then
-echo "$as_me:6696: checking for actual SIGWINCH definition" >&5
-echo $ECHO_N "checking for actual SIGWINCH definition... $ECHO_C" >&6
-if test "${cf_cv_fixup_sigwinch+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
+if test -n "$cf_new_extra_cppflags" ; then
 
-cf_cv_fixup_sigwinch=unknown
-cf_sigwinch=32
-while test $cf_sigwinch != 1
-do
-	cat >conftest.$ac_ext <<_ACEOF
-#line 6707 "configure"
-#include "confdefs.h"
+	EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+fi
 
-#undef _XOPEN_SOURCE
-#undef _POSIX_SOURCE
+fi
+
+	;;
+esac
+
+if test -n "$cf_xopen_source" ; then
+
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
+
+for cf_add_cflags in $cf_xopen_source
+do
+case $cf_fix_cppflags in
+no)
+	case $cf_add_cflags in #(vi
+	-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
+		case $cf_add_cflags in
+		-D*)
+			cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
+
+			test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+				&& test -z "${cf_tst_cflags}" \
+				&& cf_fix_cppflags=yes
+
+			if test $cf_fix_cppflags = yes ; then
+				cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+				continue
+			elif test "${cf_tst_cflags}" = "\"'" ; then
+				cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+				continue
+			fi
+			;;
+		esac
+		case "$CPPFLAGS" in
+		*$cf_add_cflags) #(vi
+			;;
+		*) #(vi
+			case $cf_add_cflags in #(vi
+			-D*)
+				cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
+
+CPPFLAGS=`echo "$CPPFLAGS" | \
+	sed	-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?[ 	]/ /g' \
+		-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?$//g'`
+
+				;;
+			esac
+			cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
+			;;
+		esac
+		;;
+	*)
+		cf_new_cflags="$cf_new_cflags $cf_add_cflags"
+		;;
+	esac
+	;;
+yes)
+	cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+	cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
+
+	test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+		&& test -z "${cf_tst_cflags}" \
+		&& cf_fix_cppflags=no
+	;;
+esac
+done
+
+if test -n "$cf_new_cflags" ; then
+
+	CFLAGS="$CFLAGS $cf_new_cflags"
+fi
+
+if test -n "$cf_new_cppflags" ; then
+
+	CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
+fi
+
+if test -n "$cf_new_extra_cppflags" ; then
+
+	EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+fi
+
+fi
+
+# Work around breakage on OS X
+
+echo "$as_me:7523: checking if SIGWINCH is defined" >&5
+echo $ECHO_N "checking if SIGWINCH is defined... $ECHO_C" >&6
+if test "${cf_cv_define_sigwinch+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+	cat >conftest.$ac_ext <<_ACEOF
+#line 7530 "configure"
+#include "confdefs.h"
+
+#include <sys/types.h>
+#include <sys/signal.h>
+
+int
+main ()
+{
+int x = SIGWINCH
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:7545: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:7548: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:7551: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:7554: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_define_sigwinch=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cat >conftest.$ac_ext <<_ACEOF
+#line 7561 "configure"
+#include "confdefs.h"
+
+#undef _XOPEN_SOURCE
+#undef _POSIX_SOURCE
+#undef _POSIX_C_SOURCE
+#include <sys/types.h>
+#include <sys/signal.h>
+
+int
+main ()
+{
+int x = SIGWINCH
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:7579: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:7582: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:7585: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:7588: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_define_sigwinch=maybe
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_define_sigwinch=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+fi
+echo "$as_me:7602: result: $cf_cv_define_sigwinch" >&5
+echo "${ECHO_T}$cf_cv_define_sigwinch" >&6
+
+if test "$cf_cv_define_sigwinch" = maybe ; then
+echo "$as_me:7606: checking for actual SIGWINCH definition" >&5
+echo $ECHO_N "checking for actual SIGWINCH definition... $ECHO_C" >&6
+if test "${cf_cv_fixup_sigwinch+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+cf_cv_fixup_sigwinch=unknown
+cf_sigwinch=32
+while test $cf_sigwinch != 1
+do
+	cat >conftest.$ac_ext <<_ACEOF
+#line 7617 "configure"
+#include "confdefs.h"
+
+#undef _XOPEN_SOURCE
+#undef _POSIX_SOURCE
 #undef _POSIX_C_SOURCE
 #include <sys/types.h>
 #include <sys/signal.h>
@@ -6726,16 +7636,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:6729: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:7639: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:6732: \$? = $ac_status" >&5
+  echo "$as_me:7642: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:6735: \"$ac_try\"") >&5
+  { (eval echo "$as_me:7645: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:6738: \$? = $ac_status" >&5
+  echo "$as_me:7648: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_fixup_sigwinch=$cf_sigwinch
 	 break
@@ -6749,7 +7659,7 @@
 done
 
 fi
-echo "$as_me:6752: result: $cf_cv_fixup_sigwinch" >&5
+echo "$as_me:7662: result: $cf_cv_fixup_sigwinch" >&5
 echo "${ECHO_T}$cf_cv_fixup_sigwinch" >&6
 
 	if test "$cf_cv_fixup_sigwinch" != unknown ; then
@@ -6759,13 +7669,13 @@
 
 # Checks for CODESET support.
 
-  echo "$as_me:6762: checking for nl_langinfo and CODESET" >&5
+  echo "$as_me:7672: checking for nl_langinfo and CODESET" >&5
 echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6
 if test "${am_cv_langinfo_codeset+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 6768 "configure"
+#line 7678 "configure"
 #include "confdefs.h"
 #include <langinfo.h>
 int
@@ -6777,16 +7687,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:6780: \"$ac_link\"") >&5
+if { (eval echo "$as_me:7690: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:6783: \$? = $ac_status" >&5
+  echo "$as_me:7693: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:6786: \"$ac_try\"") >&5
+  { (eval echo "$as_me:7696: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:6789: \$? = $ac_status" >&5
+  echo "$as_me:7699: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   am_cv_langinfo_codeset=yes
 else
@@ -6797,7 +7707,7 @@
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 
 fi
-echo "$as_me:6800: result: $am_cv_langinfo_codeset" >&5
+echo "$as_me:7710: result: $am_cv_langinfo_codeset" >&5
 echo "${ECHO_T}$am_cv_langinfo_codeset" >&6
   if test $am_cv_langinfo_codeset = yes; then
 
@@ -6811,7 +7721,7 @@
 NCURSES_OK_WCHAR_T=
 NCURSES_OK_WINT_T=
 
-echo "$as_me:6814: checking if you want wide-character code" >&5
+echo "$as_me:7724: checking if you want wide-character code" >&5
 echo $ECHO_N "checking if you want wide-character code... $ECHO_C" >&6
 
 # Check whether --enable-widec or --disable-widec was given.
@@ -6821,7 +7731,7 @@
 else
   with_widec=no
 fi;
-echo "$as_me:6824: result: $with_widec" >&5
+echo "$as_me:7734: result: $with_widec" >&5
 echo "${ECHO_T}$with_widec" >&6
 if test "$with_widec" = yes ; then
 	LIB_SUFFIX="w${LIB_SUFFIX}"
@@ -6829,10 +7739,15 @@
 #define USE_WIDEC_SUPPORT 1
 EOF
 
-echo "$as_me:6832: checking if we must define _XOPEN_SOURCE_EXTENDED" >&5
+	case "$CFLAGS $CPPFLAGS" in #(vi
+	*-D_XOPEN_SOURCE=500) #(vi
+		;;
+	*)
+
+echo "$as_me:7747: checking if we must define _XOPEN_SOURCE_EXTENDED" >&5
 echo $ECHO_N "checking if we must define _XOPEN_SOURCE_EXTENDED... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line 6835 "configure"
+#line 7750 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 
@@ -6848,16 +7763,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:6851: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:7766: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:6854: \$? = $ac_status" >&5
+  echo "$as_me:7769: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:6857: \"$ac_try\"") >&5
+  { (eval echo "$as_me:7772: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:6860: \$? = $ac_status" >&5
+  echo "$as_me:7775: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_result=no
 else
@@ -6866,16 +7781,16 @@
 cf_result=yes
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:6869: result: $cf_result" >&5
+echo "$as_me:7784: result: $cf_result" >&5
 echo "${ECHO_T}$cf_result" >&6
 
 if test "$cf_result" = yes ; then
 	CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"
 elif test "x" != "x" ; then
-	echo "$as_me:6875: checking checking for compatible value versus " >&5
+	echo "$as_me:7790: checking checking for compatible value versus " >&5
 echo $ECHO_N "checking checking for compatible value versus ... $ECHO_C" >&6
 	cat >conftest.$ac_ext <<_ACEOF
-#line 6878 "configure"
+#line 7793 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 
@@ -6891,16 +7806,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:6894: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:7809: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:6897: \$? = $ac_status" >&5
+  echo "$as_me:7812: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:6900: \"$ac_try\"") >&5
+  { (eval echo "$as_me:7815: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:6903: \$? = $ac_status" >&5
+  echo "$as_me:7818: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_result=yes
 else
@@ -6909,7 +7824,7 @@
 cf_result=no
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
-	echo "$as_me:6912: result: $cf_result" >&5
+	echo "$as_me:7827: result: $cf_result" >&5
 echo "${ECHO_T}$cf_result" >&6
 	if test "$cf_result" = no ; then
 		# perhaps we can override it - try...
@@ -6917,19 +7832,22 @@
 	fi
 fi
 
+		;;
+	esac
+
 	# with_overwrite=no
 	NCURSES_CH_T=cchar_t
 
 for ac_func in putwc btowc wctob mbtowc wctomb mblen mbrlen mbrtowc wcsrtombs mbsrtowcs wcstombs mbstowcs
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:6926: checking for $ac_func" >&5
+echo "$as_me:7844: checking for $ac_func" >&5
 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
 if eval "test \"\${$as_ac_var+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 6932 "configure"
+#line 7850 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func (); below.  */
@@ -6960,16 +7878,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:6963: \"$ac_link\"") >&5
+if { (eval echo "$as_me:7881: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:6966: \$? = $ac_status" >&5
+  echo "$as_me:7884: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:6969: \"$ac_try\"") >&5
+  { (eval echo "$as_me:7887: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:6972: \$? = $ac_status" >&5
+  echo "$as_me:7890: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   eval "$as_ac_var=yes"
 else
@@ -6979,7 +7897,7 @@
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:6982: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "$as_me:7900: result: `eval echo '${'$as_ac_var'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<EOF
@@ -6991,7 +7909,7 @@
 
 	if test "$ac_cv_func_putwc" != yes ; then
 
-echo "$as_me:6994: checking for multibyte character support" >&5
+echo "$as_me:7912: checking for multibyte character support" >&5
 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
 if test "${cf_cv_utf8_lib+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -6999,7 +7917,7 @@
 
 	cf_save_LIBS="$LIBS"
 	cat >conftest.$ac_ext <<_ACEOF
-#line 7002 "configure"
+#line 7920 "configure"
 #include "confdefs.h"
 
 #include <stdlib.h>
@@ -7012,16 +7930,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:7015: \"$ac_link\"") >&5
+if { (eval echo "$as_me:7933: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:7018: \$? = $ac_status" >&5
+  echo "$as_me:7936: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:7021: \"$ac_try\"") >&5
+  { (eval echo "$as_me:7939: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:7024: \$? = $ac_status" >&5
+  echo "$as_me:7942: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_utf8_lib=yes
 else
@@ -7033,10 +7951,48 @@
 cf_cv_header_path_utf8=
 cf_cv_library_path_utf8=
 
-echo "${as_me-configure}:7036: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
+echo "${as_me:-configure}:7954: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
+
+cf_save_LIBS="$LIBS"
+
+cat >conftest.$ac_ext <<_ACEOF
+#line 7959 "configure"
+#include "confdefs.h"
+
+#include <libutf8.h>
+int
+main ()
+{
+putwc(0,0);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:7972: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:7975: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:7978: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:7981: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+
+	cf_cv_find_linkage_utf8=yes
+	cf_cv_header_path_utf8=/usr/include
+	cf_cv_library_path_utf8=/usr/lib
+
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+
+LIBS="-lutf8  $cf_save_LIBS"
 
 cat >conftest.$ac_ext <<_ACEOF
-#line 7039 "configure"
+#line 7995 "configure"
 #include "confdefs.h"
 
 #include <libutf8.h>
@@ -7049,34 +8005,74 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:7052: \"$ac_link\"") >&5
+if { (eval echo "$as_me:8008: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:7055: \$? = $ac_status" >&5
+  echo "$as_me:8011: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:7058: \"$ac_try\"") >&5
+  { (eval echo "$as_me:8014: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:7061: \$? = $ac_status" >&5
+  echo "$as_me:8017: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  cf_cv_find_linkage_utf8=yes
+
+	cf_cv_find_linkage_utf8=yes
+	cf_cv_header_path_utf8=/usr/include
+	cf_cv_library_path_utf8=/usr/lib
+	cf_cv_library_file_utf8="-lutf8"
+
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
 
-    cf_cv_find_linkage_utf8=no
+	cf_cv_find_linkage_utf8=no
+	LIBS="$cf_save_LIBS"
+
+    test -n "$verbose" && echo "	find linkage for utf8 library" 1>&6
+
+echo "${as_me:-configure}:8034: testing find linkage for utf8 library ..." 1>&5
 
-echo "${as_me-configure}:7070: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
+echo "${as_me:-configure}:8036: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
 
     cf_save_CPPFLAGS="$CPPFLAGS"
     cf_test_CPPFLAGS="$CPPFLAGS"
 
-    cf_search=""
+cf_search=
+
+# collect the current set of include-directories from compiler flags
+cf_header_path_list=""
+if test -n "${CFLAGS}${CPPFLAGS}" ; then
+	for cf_header_path in $CPPFLAGS $CFLAGS
+	do
+		case $cf_header_path in #(vi
+		-I*)
+			cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
+
+test "$cf_header_path" != "NONE" && \
+test -d "$cf_header_path" && \
+ {
+	test -n "$verbose" && echo "	... testing for include-directories under $cf_header_path"
+	test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
+	test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
+	test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
+	test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
+	test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
+}
+
+			cf_header_path_list="$cf_header_path_list $cf_search"
+			;;
+		esac
+	done
+fi
+
+# add the variations for the package we are looking for
+
+cf_search=
 
 test "/usr" != "$prefix" && \
 test -d "/usr" && \
-(test $prefix = NONE || test -d $prefix) && {
+(test $prefix = NONE || test "/usr" != "$prefix") && {
 	test -n "$verbose" && echo "	... testing for include-directories under /usr"
 	test -d /usr/include &&          cf_search="$cf_search /usr/include"
 	test -d /usr/include/utf8 &&       cf_search="$cf_search /usr/include/utf8"
@@ -7098,7 +8094,7 @@
 
 test "/usr/local" != "$prefix" && \
 test -d "/usr/local" && \
-(test $prefix = NONE || test -d $prefix) && {
+(test $prefix = NONE || test "/usr/local" != "$prefix") && {
 	test -n "$verbose" && echo "	... testing for include-directories under /usr/local"
 	test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
 	test -d /usr/local/include/utf8 &&       cf_search="$cf_search /usr/local/include/utf8"
@@ -7109,7 +8105,7 @@
 
 test "/opt" != "$prefix" && \
 test -d "/opt" && \
-(test $prefix = NONE || test -d $prefix) && {
+(test $prefix = NONE || test "/opt" != "$prefix") && {
 	test -n "$verbose" && echo "	... testing for include-directories under /opt"
 	test -d /opt/include &&          cf_search="$cf_search /opt/include"
 	test -d /opt/include/utf8 &&       cf_search="$cf_search /opt/include/utf8"
@@ -7120,7 +8116,7 @@
 
 test "$HOME" != "$prefix" && \
 test -d "$HOME" && \
-(test $prefix = NONE || test -d $prefix) && {
+(test $prefix = NONE || test "$HOME" != "$prefix") && {
 	test -n "$verbose" && echo "	... testing for include-directories under $HOME"
 	test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
 	test -d $HOME/include/utf8 &&       cf_search="$cf_search $HOME/include/utf8"
@@ -7143,16 +8139,18 @@
 	test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
 }
 
+cf_search="$cf_search $cf_header_path_list"
+
     for cf_cv_header_path_utf8 in $cf_search
     do
       if test -d $cf_cv_header_path_utf8 ; then
         test -n "$verbose" && echo "	... testing $cf_cv_header_path_utf8" 1>&6
 
-echo "${as_me-configure}:7151: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
+echo "${as_me:-configure}:8149: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
 
         CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_utf8"
         cat >conftest.$ac_ext <<_ACEOF
-#line 7155 "configure"
+#line 8153 "configure"
 #include "confdefs.h"
 
 #include <libutf8.h>
@@ -7165,21 +8163,21 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:7168: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:8166: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:7171: \$? = $ac_status" >&5
+  echo "$as_me:8169: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:7174: \"$ac_try\"") >&5
+  { (eval echo "$as_me:8172: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:7177: \$? = $ac_status" >&5
+  echo "$as_me:8175: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
             test -n "$verbose" && echo "	... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
 
-echo "${as_me-configure}:7182: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
+echo "${as_me:-configure}:8180: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
 
             cf_cv_find_linkage_utf8=maybe
             cf_test_CPPFLAGS="$CPPFLAGS"
@@ -7197,17 +8195,44 @@
 
     if test "$cf_cv_find_linkage_utf8" = maybe ; then
 
-echo "${as_me-configure}:7200: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
+echo "${as_me:-configure}:8198: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
 
       cf_save_LIBS="$LIBS"
       cf_save_LDFLAGS="$LDFLAGS"
 
       if test "$cf_cv_find_linkage_utf8" != yes ; then
-        cf_search=""
+
+cf_search=
+cf_library_path_list=""
+if test -n "${LDFLAGS}${LIBS}" ; then
+	for cf_library_path in $LDFLAGS $LIBS
+	do
+		case $cf_library_path in #(vi
+		-L*)
+			cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
+
+test "$cf_library_path" != "NONE" && \
+test -d "$cf_library_path" && \
+ {
+	test -n "$verbose" && echo "	... testing for lib-directories under $cf_library_path"
+	test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
+	test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
+	test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
+	test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
+	test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
+}
+
+			cf_library_path_list="$cf_library_path_list $cf_search"
+			;;
+		esac
+	done
+fi
+
+cf_search=
 
 test "/usr" != "$prefix" && \
 test -d "/usr" && \
-(test $prefix = NONE || test -d $prefix) && {
+(test $prefix = NONE || test "/usr" != "$prefix") && {
 	test -n "$verbose" && echo "	... testing for lib-directories under /usr"
 	test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
 	test -d /usr/lib/utf8 &&       cf_search="$cf_search /usr/lib/utf8"
@@ -7229,7 +8254,7 @@
 
 test "/usr/local" != "$prefix" && \
 test -d "/usr/local" && \
-(test $prefix = NONE || test -d $prefix) && {
+(test $prefix = NONE || test "/usr/local" != "$prefix") && {
 	test -n "$verbose" && echo "	... testing for lib-directories under /usr/local"
 	test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
 	test -d /usr/local/lib/utf8 &&       cf_search="$cf_search /usr/local/lib/utf8"
@@ -7240,7 +8265,7 @@
 
 test "/opt" != "$prefix" && \
 test -d "/opt" && \
-(test $prefix = NONE || test -d $prefix) && {
+(test $prefix = NONE || test "/opt" != "$prefix") && {
 	test -n "$verbose" && echo "	... testing for lib-directories under /opt"
 	test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
 	test -d /opt/lib/utf8 &&       cf_search="$cf_search /opt/lib/utf8"
@@ -7251,7 +8276,7 @@
 
 test "$HOME" != "$prefix" && \
 test -d "$HOME" && \
-(test $prefix = NONE || test -d $prefix) && {
+(test $prefix = NONE || test "$HOME" != "$prefix") && {
 	test -n "$verbose" && echo "	... testing for lib-directories under $HOME"
 	test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
 	test -d $HOME/lib/utf8 &&       cf_search="$cf_search $HOME/lib/utf8"
@@ -7260,18 +8285,20 @@
 	test -d $HOME/utf8/lib/utf8 &&    cf_search="$cf_search $HOME/utf8/lib/utf8"
 }
 
+cf_search="$cf_library_path_list $cf_search"
+
         for cf_cv_library_path_utf8 in $cf_search
         do
           if test -d $cf_cv_library_path_utf8 ; then
             test -n "$verbose" && echo "	... testing $cf_cv_library_path_utf8" 1>&6
 
-echo "${as_me-configure}:7268: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
+echo "${as_me:-configure}:8295: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
 
             CPPFLAGS="$cf_test_CPPFLAGS"
             LIBS="-lutf8  $cf_save_LIBS"
             LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
             cat >conftest.$ac_ext <<_ACEOF
-#line 7274 "configure"
+#line 8301 "configure"
 #include "confdefs.h"
 
 #include <libutf8.h>
@@ -7284,21 +8311,21 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:7287: \"$ac_link\"") >&5
+if { (eval echo "$as_me:8314: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:7290: \$? = $ac_status" >&5
+  echo "$as_me:8317: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:7293: \"$ac_try\"") >&5
+  { (eval echo "$as_me:8320: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:7296: \$? = $ac_status" >&5
+  echo "$as_me:8323: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
                 test -n "$verbose" && echo "	... found utf8 library in $cf_cv_library_path_utf8" 1>&6
 
-echo "${as_me-configure}:7301: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
+echo "${as_me:-configure}:8328: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
 
                 cf_cv_find_linkage_utf8=yes
                 cf_cv_library_file_utf8="-lutf8"
@@ -7315,7 +8342,6 @@
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
           fi
         done
-        LIBS="$cf_save_LIBS"
         CPPFLAGS="$cf_save_CPPFLAGS"
         LDFLAGS="$cf_save_LDFLAGS"
       fi
@@ -7327,6 +8353,11 @@
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+
+LIBS="$cf_save_LIBS"
+
 if test "$cf_cv_find_linkage_utf8" = yes ; then
 cf_cv_utf8_lib=add-on
 else
@@ -7336,7 +8367,7 @@
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:7339: result: $cf_cv_utf8_lib" >&5
+echo "$as_me:8370: result: $cf_cv_utf8_lib" >&5
 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
 
 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
@@ -7364,13 +8395,13 @@
 		fi
 
 		if test "$cf_have_incdir" = no ; then
-          if test "$cf_add_incdir" = /usr/local/include ; then
+		  if test "$cf_add_incdir" = /usr/local/include ; then
 			if test "$GCC" = yes
 			then
 			  cf_save_CPPFLAGS=$CPPFLAGS
 			  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
 			  cat >conftest.$ac_ext <<_ACEOF
-#line 7373 "configure"
+#line 8404 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int
@@ -7382,16 +8413,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:7385: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:8416: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:7388: \$? = $ac_status" >&5
+  echo "$as_me:8419: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:7391: \"$ac_try\"") >&5
+  { (eval echo "$as_me:8422: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:7394: \$? = $ac_status" >&5
+  echo "$as_me:8425: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
@@ -7408,13 +8439,13 @@
 		if test "$cf_have_incdir" = no ; then
 		  test -n "$verbose" && echo "	adding $cf_add_incdir to include-path" 1>&6
 
-echo "${as_me-configure}:7411: testing adding $cf_add_incdir to include-path ..." 1>&5
+echo "${as_me:-configure}:8442: testing adding $cf_add_incdir to include-path ..." 1>&5
 
-		  CPPFLAGS="-I$cf_add_incdir $CPPFLAGS"
+		  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
 
-          cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
-          test "$cf_top_incdir" = "$cf_add_incdir" && break
-          cf_add_incdir="$cf_top_incdir"
+		  cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
+		  test "$cf_top_incdir" = "$cf_add_incdir" && break
+		  cf_add_incdir="$cf_top_incdir"
 		else
 		  break
 		fi
@@ -7442,7 +8473,7 @@
       if test "$cf_have_libdir" = no ; then
         test -n "$verbose" && echo "	adding $cf_add_libdir to library-path" 1>&6
 
-echo "${as_me-configure}:7445: testing adding $cf_add_libdir to library-path ..." 1>&5
+echo "${as_me:-configure}:8476: testing adding $cf_add_libdir to library-path ..." 1>&5
 
         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
       fi
@@ -7450,7 +8481,7 @@
   done
 fi
 
-	LIBS="-lutf8 $LIBS"
+	LIBS="$cf_cv_library_file_utf8 $LIBS"
 fi
 
 		if test "$cf_cv_utf8_lib" != no ; then
@@ -7459,14 +8490,14 @@
 	fi
 
 # This is needed on Tru64 5.0 to declare mbstate_t
-echo "$as_me:7462: checking if we must include wchar.h to declare mbstate_t" >&5
+echo "$as_me:8493: checking if we must include wchar.h to declare mbstate_t" >&5
 echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
 if test "${cf_cv_mbstate_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 cat >conftest.$ac_ext <<_ACEOF
-#line 7469 "configure"
+#line 8500 "configure"
 #include "confdefs.h"
 
 #include <stdlib.h>
@@ -7484,23 +8515,23 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:7487: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:8518: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:7490: \$? = $ac_status" >&5
+  echo "$as_me:8521: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:7493: \"$ac_try\"") >&5
+  { (eval echo "$as_me:8524: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:7496: \$? = $ac_status" >&5
+  echo "$as_me:8527: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_mbstate_t=no
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
 cat >conftest.$ac_ext <<_ACEOF
-#line 7503 "configure"
+#line 8534 "configure"
 #include "confdefs.h"
 
 #include <stdlib.h>
@@ -7519,16 +8550,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:7522: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:8553: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:7525: \$? = $ac_status" >&5
+  echo "$as_me:8556: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:7528: \"$ac_try\"") >&5
+  { (eval echo "$as_me:8559: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:7531: \$? = $ac_status" >&5
+  echo "$as_me:8562: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_mbstate_t=yes
 else
@@ -7540,7 +8571,7 @@
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:7543: result: $cf_cv_mbstate_t" >&5
+echo "$as_me:8574: result: $cf_cv_mbstate_t" >&5
 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
 
 if test "$cf_cv_mbstate_t" = yes ; then
@@ -7557,14 +8588,14 @@
 fi
 
 # This is needed on Tru64 5.0 to declare wchar_t
-echo "$as_me:7560: checking if we must include wchar.h to declare wchar_t" >&5
+echo "$as_me:8591: checking if we must include wchar.h to declare wchar_t" >&5
 echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
 if test "${cf_cv_wchar_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 cat >conftest.$ac_ext <<_ACEOF
-#line 7567 "configure"
+#line 8598 "configure"
 #include "confdefs.h"
 
 #include <stdlib.h>
@@ -7582,23 +8613,23 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:7585: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:8616: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:7588: \$? = $ac_status" >&5
+  echo "$as_me:8619: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:7591: \"$ac_try\"") >&5
+  { (eval echo "$as_me:8622: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:7594: \$? = $ac_status" >&5
+  echo "$as_me:8625: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_wchar_t=no
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
 cat >conftest.$ac_ext <<_ACEOF
-#line 7601 "configure"
+#line 8632 "configure"
 #include "confdefs.h"
 
 #include <stdlib.h>
@@ -7617,16 +8648,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:7620: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:8651: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:7623: \$? = $ac_status" >&5
+  echo "$as_me:8654: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:7626: \"$ac_try\"") >&5
+  { (eval echo "$as_me:8657: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:7629: \$? = $ac_status" >&5
+  echo "$as_me:8660: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_wchar_t=yes
 else
@@ -7638,7 +8669,7 @@
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:7641: result: $cf_cv_wchar_t" >&5
+echo "$as_me:8672: result: $cf_cv_wchar_t" >&5
 echo "${ECHO_T}$cf_cv_wchar_t" >&6
 
 if test "$cf_cv_wchar_t" = yes ; then
@@ -7660,14 +8691,14 @@
 fi
 
 # This is needed on Tru64 5.0 to declare wint_t
-echo "$as_me:7663: checking if we must include wchar.h to declare wint_t" >&5
+echo "$as_me:8694: checking if we must include wchar.h to declare wint_t" >&5
 echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
 if test "${cf_cv_wint_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 cat >conftest.$ac_ext <<_ACEOF
-#line 7670 "configure"
+#line 8701 "configure"
 #include "confdefs.h"
 
 #include <stdlib.h>
@@ -7685,23 +8716,23 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:7688: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:8719: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:7691: \$? = $ac_status" >&5
+  echo "$as_me:8722: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:7694: \"$ac_try\"") >&5
+  { (eval echo "$as_me:8725: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:7697: \$? = $ac_status" >&5
+  echo "$as_me:8728: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_wint_t=no
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
 cat >conftest.$ac_ext <<_ACEOF
-#line 7704 "configure"
+#line 8735 "configure"
 #include "confdefs.h"
 
 #include <stdlib.h>
@@ -7720,16 +8751,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:7723: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:8754: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:7726: \$? = $ac_status" >&5
+  echo "$as_me:8757: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:7729: \"$ac_try\"") >&5
+  { (eval echo "$as_me:8760: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:7732: \$? = $ac_status" >&5
+  echo "$as_me:8763: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_wint_t=yes
 else
@@ -7741,7 +8772,7 @@
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:7744: result: $cf_cv_wint_t" >&5
+echo "$as_me:8775: result: $cf_cv_wint_t" >&5
 echo "${ECHO_T}$cf_cv_wint_t" >&6
 
 if test "$cf_cv_wint_t" = yes ; then
@@ -7780,7 +8811,7 @@
 	;;
 esac
 
-echo "$as_me:7783: checking whether to enable _LP64 definition in curses.h" >&5
+echo "$as_me:8814: checking whether to enable _LP64 definition in curses.h" >&5
 echo $ECHO_N "checking whether to enable _LP64 definition in curses.h... $ECHO_C" >&6
 
 # Check whether --enable-lp64 or --disable-lp64 was given.
@@ -7790,7 +8821,7 @@
 else
   with_lp64=$default_with_lp64
 fi;
-echo "$as_me:7793: result: $with_lp64" >&5
+echo "$as_me:8824: result: $with_lp64" >&5
 echo "${ECHO_T}$with_lp64" >&6
 
 if test "$with_lp64" = yes ; then
@@ -7806,7 +8837,7 @@
 fi;
 if test "$enable_largefile" != no; then
 
-  echo "$as_me:7809: checking for special C compiler options needed for large files" >&5
+  echo "$as_me:8840: checking for special C compiler options needed for large files" >&5
 echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
 if test "${ac_cv_sys_largefile_CC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -7818,7 +8849,7 @@
      	 # IRIX 6.2 and later do not support large files by default,
      	 # so use the C compiler's -n32 option if that helps.
          cat >conftest.$ac_ext <<_ACEOF
-#line 7821 "configure"
+#line 8852 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
  /* Check that off_t can represent 2**63 - 1 correctly.
@@ -7838,16 +8869,16 @@
 }
 _ACEOF
      	 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:7841: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:8872: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:7844: \$? = $ac_status" >&5
+  echo "$as_me:8875: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:7847: \"$ac_try\"") >&5
+  { (eval echo "$as_me:8878: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:7850: \$? = $ac_status" >&5
+  echo "$as_me:8881: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   break
 else
@@ -7857,16 +8888,16 @@
 rm -f conftest.$ac_objext
      	 CC="$CC -n32"
      	 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:7860: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:8891: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:7863: \$? = $ac_status" >&5
+  echo "$as_me:8894: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:7866: \"$ac_try\"") >&5
+  { (eval echo "$as_me:8897: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:7869: \$? = $ac_status" >&5
+  echo "$as_me:8900: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_sys_largefile_CC=' -n32'; break
 else
@@ -7880,13 +8911,13 @@
        rm -f conftest.$ac_ext
     fi
 fi
-echo "$as_me:7883: result: $ac_cv_sys_largefile_CC" >&5
+echo "$as_me:8914: result: $ac_cv_sys_largefile_CC" >&5
 echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
   if test "$ac_cv_sys_largefile_CC" != no; then
     CC=$CC$ac_cv_sys_largefile_CC
   fi
 
-  echo "$as_me:7889: checking for _FILE_OFFSET_BITS value needed for large files" >&5
+  echo "$as_me:8920: checking for _FILE_OFFSET_BITS value needed for large files" >&5
 echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
 if test "${ac_cv_sys_file_offset_bits+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -7894,7 +8925,7 @@
   while :; do
   ac_cv_sys_file_offset_bits=no
   cat >conftest.$ac_ext <<_ACEOF
-#line 7897 "configure"
+#line 8928 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
  /* Check that off_t can represent 2**63 - 1 correctly.
@@ -7914,16 +8945,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:7917: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:8948: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:7920: \$? = $ac_status" >&5
+  echo "$as_me:8951: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:7923: \"$ac_try\"") >&5
+  { (eval echo "$as_me:8954: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:7926: \$? = $ac_status" >&5
+  echo "$as_me:8957: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   break
 else
@@ -7932,7 +8963,7 @@
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
   cat >conftest.$ac_ext <<_ACEOF
-#line 7935 "configure"
+#line 8966 "configure"
 #include "confdefs.h"
 #define _FILE_OFFSET_BITS 64
 #include <sys/types.h>
@@ -7953,16 +8984,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:7956: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:8987: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:7959: \$? = $ac_status" >&5
+  echo "$as_me:8990: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:7962: \"$ac_try\"") >&5
+  { (eval echo "$as_me:8993: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:7965: \$? = $ac_status" >&5
+  echo "$as_me:8996: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_sys_file_offset_bits=64; break
 else
@@ -7973,7 +9004,7 @@
   break
 done
 fi
-echo "$as_me:7976: result: $ac_cv_sys_file_offset_bits" >&5
+echo "$as_me:9007: result: $ac_cv_sys_file_offset_bits" >&5
 echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
 if test "$ac_cv_sys_file_offset_bits" != no; then
 
@@ -7982,8 +9013,8 @@
 EOF
 
 fi
-rm -f conftest*
-  echo "$as_me:7986: checking for _LARGE_FILES value needed for large files" >&5
+rm -rf conftest*
+  echo "$as_me:9017: checking for _LARGE_FILES value needed for large files" >&5
 echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
 if test "${ac_cv_sys_large_files+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -7991,7 +9022,7 @@
   while :; do
   ac_cv_sys_large_files=no
   cat >conftest.$ac_ext <<_ACEOF
-#line 7994 "configure"
+#line 9025 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
  /* Check that off_t can represent 2**63 - 1 correctly.
@@ -8011,16 +9042,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:8014: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:9045: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:8017: \$? = $ac_status" >&5
+  echo "$as_me:9048: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:8020: \"$ac_try\"") >&5
+  { (eval echo "$as_me:9051: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:8023: \$? = $ac_status" >&5
+  echo "$as_me:9054: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   break
 else
@@ -8029,7 +9060,7 @@
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
   cat >conftest.$ac_ext <<_ACEOF
-#line 8032 "configure"
+#line 9063 "configure"
 #include "confdefs.h"
 #define _LARGE_FILES 1
 #include <sys/types.h>
@@ -8050,16 +9081,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:8053: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:9084: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:8056: \$? = $ac_status" >&5
+  echo "$as_me:9087: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:8059: \"$ac_try\"") >&5
+  { (eval echo "$as_me:9090: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:8062: \$? = $ac_status" >&5
+  echo "$as_me:9093: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_sys_large_files=1; break
 else
@@ -8070,7 +9101,7 @@
   break
 done
 fi
-echo "$as_me:8073: result: $ac_cv_sys_large_files" >&5
+echo "$as_me:9104: result: $ac_cv_sys_large_files" >&5
 echo "${ECHO_T}$ac_cv_sys_large_files" >&6
 if test "$ac_cv_sys_large_files" != no; then
 
@@ -8079,11 +9110,11 @@
 EOF
 
 fi
-rm -f conftest*
+rm -rf conftest*
 fi
 
     if test "$enable_largefile" != no ; then
-	echo "$as_me:8086: checking for _LARGEFILE_SOURCE value needed for large files" >&5
+	echo "$as_me:9117: checking for _LARGEFILE_SOURCE value needed for large files" >&5
 echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6
 if test "${ac_cv_sys_largefile_source+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -8091,7 +9122,7 @@
   while :; do
   ac_cv_sys_largefile_source=no
   cat >conftest.$ac_ext <<_ACEOF
-#line 8094 "configure"
+#line 9125 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int
@@ -8103,16 +9134,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:8106: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:9137: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:8109: \$? = $ac_status" >&5
+  echo "$as_me:9140: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:8112: \"$ac_try\"") >&5
+  { (eval echo "$as_me:9143: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:8115: \$? = $ac_status" >&5
+  echo "$as_me:9146: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   break
 else
@@ -8121,7 +9152,7 @@
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
   cat >conftest.$ac_ext <<_ACEOF
-#line 8124 "configure"
+#line 9155 "configure"
 #include "confdefs.h"
 #define _LARGEFILE_SOURCE 1
 #include <stdio.h>
@@ -8134,16 +9165,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:8137: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:9168: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:8140: \$? = $ac_status" >&5
+  echo "$as_me:9171: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:8143: \"$ac_try\"") >&5
+  { (eval echo "$as_me:9174: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:8146: \$? = $ac_status" >&5
+  echo "$as_me:9177: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_sys_largefile_source=1; break
 else
@@ -8154,7 +9185,7 @@
   break
 done
 fi
-echo "$as_me:8157: result: $ac_cv_sys_largefile_source" >&5
+echo "$as_me:9188: result: $ac_cv_sys_largefile_source" >&5
 echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6
 if test "$ac_cv_sys_largefile_source" != no; then
 
@@ -8163,18 +9194,18 @@
 EOF
 
 fi
-rm -f conftest*
+rm -rf conftest*
 
 # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
 # in glibc 2.1.3, but that breaks too many other things.
 # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
-echo "$as_me:8171: checking for fseeko" >&5
+echo "$as_me:9202: checking for fseeko" >&5
 echo $ECHO_N "checking for fseeko... $ECHO_C" >&6
 if test "${ac_cv_func_fseeko+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 8177 "configure"
+#line 9208 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int
@@ -8186,16 +9217,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:8189: \"$ac_link\"") >&5
+if { (eval echo "$as_me:9220: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:8192: \$? = $ac_status" >&5
+  echo "$as_me:9223: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:8195: \"$ac_try\"") >&5
+  { (eval echo "$as_me:9226: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:8198: \$? = $ac_status" >&5
+  echo "$as_me:9229: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_func_fseeko=yes
 else
@@ -8205,7 +9236,7 @@
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:8208: result: $ac_cv_func_fseeko" >&5
+echo "$as_me:9239: result: $ac_cv_func_fseeko" >&5
 echo "${ECHO_T}$ac_cv_func_fseeko" >&6
 if test $ac_cv_func_fseeko = yes; then
 
@@ -8226,14 +9257,14 @@
 	test "$ac_cv_sys_largefile_source" != no && CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE "
 	test "$ac_cv_sys_file_offset_bits" != no && CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits "
 
-	echo "$as_me:8229: checking whether to use struct dirent64" >&5
+	echo "$as_me:9260: checking whether to use struct dirent64" >&5
 echo $ECHO_N "checking whether to use struct dirent64... $ECHO_C" >&6
 if test "${cf_cv_struct_dirent64+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 		cat >conftest.$ac_ext <<_ACEOF
-#line 8236 "configure"
+#line 9267 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -8254,16 +9285,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:8257: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:9288: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:8260: \$? = $ac_status" >&5
+  echo "$as_me:9291: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:8263: \"$ac_try\"") >&5
+  { (eval echo "$as_me:9294: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:8266: \$? = $ac_status" >&5
+  echo "$as_me:9297: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_struct_dirent64=yes
 else
@@ -8274,7 +9305,7 @@
 rm -f conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:8277: result: $cf_cv_struct_dirent64" >&5
+echo "$as_me:9308: result: $cf_cv_struct_dirent64" >&5
 echo "${ECHO_T}$cf_cv_struct_dirent64" >&6
 	test "$cf_cv_struct_dirent64" = yes && cat >>confdefs.h <<\EOF
 #define HAVE_STRUCT_DIRENT64 1
@@ -8283,7 +9314,7 @@
     fi
 
 ###   use option --disable-tparm-varargs to make tparm() conform to X/Open
-echo "$as_me:8286: checking if you want tparm not to use X/Open fixed-parameter list" >&5
+echo "$as_me:9317: checking if you want tparm not to use X/Open fixed-parameter list" >&5
 echo $ECHO_N "checking if you want tparm not to use X/Open fixed-parameter list... $ECHO_C" >&6
 
 # Check whether --enable-tparm-varargs or --disable-tparm-varargs was given.
@@ -8293,14 +9324,14 @@
 else
   with_tparm_varargs=yes
 fi;
-echo "$as_me:8296: result: $with_tparm_varargs" >&5
+echo "$as_me:9327: result: $with_tparm_varargs" >&5
 echo "${ECHO_T}$with_tparm_varargs" >&6
 NCURSES_TPARM_VARARGS=0
 test "$with_tparm_varargs" = yes && NCURSES_TPARM_VARARGS=1
 
 ###   use option --disable-tic-depends to make libtic not explicitly depend on ncurses/ncursesw
 if test "$with_ticlib" != no ; then
-echo "$as_me:8303: checking if you want tic library to use explicit dependency on ncurses$LIB_SUFFIX library" >&5
+echo "$as_me:9334: checking if you want tic library to use explicit dependency on ncurses$LIB_SUFFIX library" >&5
 echo $ECHO_N "checking if you want tic library to use explicit dependency on ncurses$LIB_SUFFIX library... $ECHO_C" >&6
 
 # Check whether --enable-tic-depends or --disable-tic-depends was given.
@@ -8310,14 +9341,14 @@
 else
   with_tic_depends=yes
 fi;
-echo "$as_me:8313: result: $with_tic_depends" >&5
+echo "$as_me:9344: result: $with_tic_depends" >&5
 echo "${ECHO_T}$with_tic_depends" >&6
 else
 	with_tic_depends=no
 fi
 
 ###   use option --with-bool to override bool's type
-echo "$as_me:8320: checking for type of bool" >&5
+echo "$as_me:9351: checking for type of bool" >&5
 echo $ECHO_N "checking for type of bool... $ECHO_C" >&6
 
 # Check whether --with-bool or --without-bool was given.
@@ -8327,10 +9358,10 @@
 else
   NCURSES_BOOL=auto
 fi;
-echo "$as_me:8330: result: $NCURSES_BOOL" >&5
+echo "$as_me:9361: result: $NCURSES_BOOL" >&5
 echo "${ECHO_T}$NCURSES_BOOL" >&6
 
-echo "$as_me:8333: checking for alternate terminal capabilities file" >&5
+echo "$as_me:9364: checking for alternate terminal capabilities file" >&5
 echo $ECHO_N "checking for alternate terminal capabilities file... $ECHO_C" >&6
 
 # Check whether --with-caps or --without-caps was given.
@@ -8341,11 +9372,11 @@
   TERMINFO_CAPS=Caps
 fi;
 test -f "${srcdir}/include/${TERMINFO_CAPS}" || TERMINFO_CAPS=Caps
-echo "$as_me:8344: result: $TERMINFO_CAPS" >&5
+echo "$as_me:9375: result: $TERMINFO_CAPS" >&5
 echo "${ECHO_T}$TERMINFO_CAPS" >&6
 
 ###   use option --with-chtype to override chtype's type
-echo "$as_me:8348: checking for type of chtype" >&5
+echo "$as_me:9379: checking for type of chtype" >&5
 echo $ECHO_N "checking for type of chtype... $ECHO_C" >&6
 
 # Check whether --with-chtype or --without-chtype was given.
@@ -8355,11 +9386,11 @@
 else
   NCURSES_CHTYPE=auto
 fi;
-echo "$as_me:8358: result: $NCURSES_CHTYPE" >&5
+echo "$as_me:9389: result: $NCURSES_CHTYPE" >&5
 echo "${ECHO_T}$NCURSES_CHTYPE" >&6
 
 ###   use option --with-ospeed to override ospeed's type
-echo "$as_me:8362: checking for type of ospeed" >&5
+echo "$as_me:9393: checking for type of ospeed" >&5
 echo $ECHO_N "checking for type of ospeed... $ECHO_C" >&6
 
 # Check whether --with-ospeed or --without-ospeed was given.
@@ -8369,11 +9400,11 @@
 else
   NCURSES_OSPEED=short
 fi;
-echo "$as_me:8372: result: $NCURSES_OSPEED" >&5
+echo "$as_me:9403: result: $NCURSES_OSPEED" >&5
 echo "${ECHO_T}$NCURSES_OSPEED" >&6
 
 ###   use option --with-mmask-t to override mmask_t's type
-echo "$as_me:8376: checking for type of mmask_t" >&5
+echo "$as_me:9407: checking for type of mmask_t" >&5
 echo $ECHO_N "checking for type of mmask_t... $ECHO_C" >&6
 
 # Check whether --with-mmask-t or --without-mmask-t was given.
@@ -8383,11 +9414,25 @@
 else
   NCURSES_MMASK_T=auto
 fi;
-echo "$as_me:8386: result: $NCURSES_MMASK_T" >&5
+echo "$as_me:9417: result: $NCURSES_MMASK_T" >&5
 echo "${ECHO_T}$NCURSES_MMASK_T" >&6
 
+###   use option --with-ccharw-max to override CCHARW_MAX size
+echo "$as_me:9421: checking for size CCHARW_MAX" >&5
+echo $ECHO_N "checking for size CCHARW_MAX... $ECHO_C" >&6
+
+# Check whether --with-ccharw-max or --without-ccharw-max was given.
+if test "${with_ccharw_max+set}" = set; then
+  withval="$with_ccharw_max"
+  NCURSES_CCHARW_MAX="$withval"
+else
+  NCURSES_CCHARW_MAX=5
+fi;
+echo "$as_me:9431: result: $NCURSES_CCHARW_MAX" >&5
+echo "${ECHO_T}$NCURSES_CCHARW_MAX" >&6
+
 ### Enable compiling-in rcs id's
-echo "$as_me:8390: checking if RCS identifiers should be compiled-in" >&5
+echo "$as_me:9435: checking if RCS identifiers should be compiled-in" >&5
 echo $ECHO_N "checking if RCS identifiers should be compiled-in... $ECHO_C" >&6
 
 # Check whether --with-rcs-ids or --without-rcs-ids was given.
@@ -8397,7 +9442,7 @@
 else
   with_rcs_ids=no
 fi;
-echo "$as_me:8400: result: $with_rcs_ids" >&5
+echo "$as_me:9445: result: $with_rcs_ids" >&5
 echo "${ECHO_T}$with_rcs_ids" >&6
 test "$with_rcs_ids" = yes && cat >>confdefs.h <<\EOF
 #define USE_RCS_IDS 1
@@ -8405,7 +9450,7 @@
 
 ###############################################################################
 
-echo "$as_me:8408: checking format of man-pages" >&5
+echo "$as_me:9453: checking format of man-pages" >&5
 echo $ECHO_N "checking format of man-pages... $ECHO_C" >&6
 
 # Check whether --with-manpage-format or --without-manpage-format was given.
@@ -8433,7 +9478,7 @@
   cf_catonly=yes
   cf_example=date
 
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}${PATHSEP}"
+  IFS="${IFS:- 	}"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
   for cf_dir in $MANPATH; do
     test -z "$cf_dir" && cf_dir=/usr/man
     for cf_name in $cf_dir/man*/$cf_example.[01]* $cf_dir/cat*/$cf_example.[01]* $cf_dir/man*/$cf_example $cf_dir/cat*/$cf_example
@@ -8494,14 +9539,14 @@
   ;;
 esac
 
-echo "$as_me:8497: result: $MANPAGE_FORMAT" >&5
+echo "$as_me:9542: result: $MANPAGE_FORMAT" >&5
 echo "${ECHO_T}$MANPAGE_FORMAT" >&6
 if test -n "$cf_unknown" ; then
-  { echo "$as_me:8500: WARNING: Unexpected manpage-format $cf_unknown" >&5
+  { echo "$as_me:9545: WARNING: Unexpected manpage-format $cf_unknown" >&5
 echo "$as_me: WARNING: Unexpected manpage-format $cf_unknown" >&2;}
 fi
 
-echo "$as_me:8504: checking for manpage renaming" >&5
+echo "$as_me:9549: checking for manpage renaming" >&5
 echo $ECHO_N "checking for manpage renaming... $ECHO_C" >&6
 
 # Check whether --with-manpage-renames or --without-manpage-renames was given.
@@ -8529,7 +9574,7 @@
   if test -f $srcdir/man/$MANPAGE_RENAMES ; then
     MANPAGE_RENAMES=`cd $srcdir/man && pwd`/$MANPAGE_RENAMES
   elif test ! -f $MANPAGE_RENAMES ; then
-    { { echo "$as_me:8532: error: not a filename: $MANPAGE_RENAMES" >&5
+    { { echo "$as_me:9577: error: not a filename: $MANPAGE_RENAMES" >&5
 echo "$as_me: error: not a filename: $MANPAGE_RENAMES" >&2;}
    { (exit 1); exit 1; }; }
   fi
@@ -8543,10 +9588,10 @@
   fi
 fi
 
-echo "$as_me:8546: result: $MANPAGE_RENAMES" >&5
+echo "$as_me:9591: result: $MANPAGE_RENAMES" >&5
 echo "${ECHO_T}$MANPAGE_RENAMES" >&6
 
-echo "$as_me:8549: checking if manpage aliases will be installed" >&5
+echo "$as_me:9594: checking if manpage aliases will be installed" >&5
 echo $ECHO_N "checking if manpage aliases will be installed... $ECHO_C" >&6
 
 # Check whether --with-manpage-aliases or --without-manpage-aliases was given.
@@ -8557,18 +9602,21 @@
   MANPAGE_ALIASES=yes
 fi;
 
-echo "$as_me:8560: result: $MANPAGE_ALIASES" >&5
+echo "$as_me:9605: result: $MANPAGE_ALIASES" >&5
 echo "${ECHO_T}$MANPAGE_ALIASES" >&6
 
-if test "$LN_S" = "ln -s"; then
+case "x$LN_S" in #(vi
+xln*) #(vi
 	cf_use_symlinks=yes
-else
+	;;
+*)
 	cf_use_symlinks=no
-fi
+	;;
+esac
 
 MANPAGE_SYMLINKS=no
 if test "$MANPAGE_ALIASES" = yes ; then
-echo "$as_me:8571: checking if manpage symlinks should be used" >&5
+echo "$as_me:9619: checking if manpage symlinks should be used" >&5
 echo $ECHO_N "checking if manpage symlinks should be used... $ECHO_C" >&6
 
 # Check whether --with-manpage-symlinks or --without-manpage-symlinks was given.
@@ -8581,17 +9629,17 @@
 
 if test "$$cf_use_symlinks" = no; then
 if test "$MANPAGE_SYMLINKS" = yes ; then
-	{ echo "$as_me:8584: WARNING: cannot make symlinks" >&5
+	{ echo "$as_me:9632: WARNING: cannot make symlinks" >&5
 echo "$as_me: WARNING: cannot make symlinks" >&2;}
 	MANPAGE_SYMLINKS=no
 fi
 fi
 
-echo "$as_me:8590: result: $MANPAGE_SYMLINKS" >&5
+echo "$as_me:9638: result: $MANPAGE_SYMLINKS" >&5
 echo "${ECHO_T}$MANPAGE_SYMLINKS" >&6
 fi
 
-echo "$as_me:8594: checking for manpage tbl" >&5
+echo "$as_me:9642: checking for manpage tbl" >&5
 echo $ECHO_N "checking for manpage tbl... $ECHO_C" >&6
 
 # Check whether --with-manpage-tbl or --without-manpage-tbl was given.
@@ -8602,7 +9650,7 @@
   MANPAGE_TBL=no
 fi;
 
-echo "$as_me:8605: result: $MANPAGE_TBL" >&5
+echo "$as_me:9653: result: $MANPAGE_TBL" >&5
 echo "${ECHO_T}$MANPAGE_TBL" >&6
 
   if test "$prefix" = "NONE" ; then
@@ -8635,7 +9683,7 @@
 	cf_so_strip="Z"
 	cf_compress=compress
   ;;
-*gzip*) #(vi
+*gzip*)
 	cf_so_strip="gz"
 	cf_compress=gzip
   ;;
@@ -8658,14 +9706,12 @@
 NCURSES_OSPEED="$NCURSES_OSPEED"
 TERMINFO="$TERMINFO"
 
-MKDIRS="sh `cd $srcdir && pwd`/mkdirs.sh"
-
 INSTALL="$INSTALL"
 INSTALL_DATA="$INSTALL_DATA"
 
 transform="$program_transform_name"
 
-TMP=\${TMPDIR-/tmp}/man\$\$
+TMP=\${TMPDIR:=/tmp}/man\$\$
 trap "rm -f \$TMP" 0 1 2 5 15
 
 form=\$1
@@ -8703,7 +9749,7 @@
 	section=\`expr "\$i" : '.*\\.\\([0-9]\\)[xm]*'\`;
 	if test \$verb = installing ; then
 	if test ! -d \$cf_subdir\${section} ; then
-		\$MKDIRS \$cf_subdir\$section
+		mkdir -p \$cf_subdir\$section
 	fi
 	fi
 
@@ -8718,12 +9764,12 @@
 		s,@NCURSES_OSPEED@,\$NCURSES_OSPEED,g
 CF_EOF
 
-	for cf_name in  captoinfo clear infocmp infotocap tic toe tput
+	for cf_name in  captoinfo clear infocmp infotocap tabs tic toe tput tset
 	do
 		cf_NAME=`echo "$cf_name" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
 		cf_name=`echo $cf_name|sed "$program_transform_name"`
 cat >>$cf_edit_man <<-CF_EOF
-		s,@$cf_NAME@,$cf_name,
+		s,@$cf_NAME@,$cf_name,g
 CF_EOF
 	done
 
@@ -8852,8 +9898,21 @@
 							fi
 						fi
 						echo .. \$verb alias \$cf_alias\${suffix}
-						rm -f \$cf_alias\${suffix}
-						$LN_S \$cf_target \$cf_alias\${suffix}
+CF_EOF
+case "x$LN_S" in #(vi
+*-f) #(vi
+cat >>$cf_edit_man <<CF_EOF
+						$LN_S \$cf_target \$cf_alias\${suffix}
+CF_EOF
+	;;
+*)
+cat >>$cf_edit_man <<CF_EOF
+						rm -f \$cf_alias\${suffix}
+						$LN_S \$cf_target \$cf_alias\${suffix}
+CF_EOF
+	;;
+esac
+cat >>$cf_edit_man <<CF_EOF
 					elif test "\$cf_target" != "\$cf_alias\${suffix}" ; then
 						echo ".so \$cf_source" >\$TMP
 CF_EOF
@@ -8913,7 +9972,7 @@
 ###############################################################################
 
 ### Note that some functions (such as const) are normally disabled anyway.
-echo "$as_me:8916: checking if you want to build with function extensions" >&5
+echo "$as_me:9975: checking if you want to build with function extensions" >&5
 echo $ECHO_N "checking if you want to build with function extensions... $ECHO_C" >&6
 
 # Check whether --enable-ext-funcs or --disable-ext-funcs was given.
@@ -8923,7 +9982,7 @@
 else
   with_ext_funcs=yes
 fi;
-echo "$as_me:8926: result: $with_ext_funcs" >&5
+echo "$as_me:9985: result: $with_ext_funcs" >&5
 echo "${ECHO_T}$with_ext_funcs" >&6
 if test "$with_ext_funcs" = yes ; then
 	NCURSES_EXT_FUNCS=1
@@ -8944,6 +10003,10 @@
 EOF
 
 	cat >>confdefs.h <<\EOF
+#define HAVE_TERM_ENTRY_H 1
+EOF
+
+	cat >>confdefs.h <<\EOF
 #define HAVE_USE_DEFAULT_COLORS 1
 EOF
 
@@ -8955,12 +10018,62 @@
 #define NCURSES_EXT_FUNCS 1
 EOF
 
+	GENERATED_EXT_FUNCS=generated
 else
 	NCURSES_EXT_FUNCS=0
+	GENERATED_EXT_FUNCS=
+fi
+
+echo "$as_me:10027: checking if you want to build with experimental SCREEN extensions" >&5
+echo $ECHO_N "checking if you want to build with experimental SCREEN extensions... $ECHO_C" >&6
+
+# Check whether --enable-sp-funcs or --disable-sp-funcs was given.
+if test "${enable_sp_funcs+set}" = set; then
+  enableval="$enable_sp_funcs"
+  with_sp_funcs=$enableval
+else
+  with_sp_funcs=no
+fi;
+echo "$as_me:10037: result: $with_sp_funcs" >&5
+echo "${ECHO_T}$with_sp_funcs" >&6
+if test "$with_sp_funcs" = yes ; then
+	NCURSES_SP_FUNCS=1
+	cat >>confdefs.h <<\EOF
+#define NCURSES_SP_FUNCS 1
+EOF
+
+	GENERATED_SP_FUNCS=generated
+else
+	NCURSES_SP_FUNCS=0
+	GENERATED_SP_FUNCS=
+fi
+
+echo "$as_me:10051: checking if you want to build with experimental terminal-driver" >&5
+echo $ECHO_N "checking if you want to build with experimental terminal-driver... $ECHO_C" >&6
+
+# Check whether --enable-term-driver or --disable-term-driver was given.
+if test "${enable_term_driver+set}" = set; then
+  enableval="$enable_term_driver"
+  with_term_driver=$enableval
+else
+  with_term_driver=no
+fi;
+echo "$as_me:10061: result: $with_term_driver" >&5
+echo "${ECHO_T}$with_term_driver" >&6
+if test "$with_term_driver" = yes ; then
+	cat >>confdefs.h <<\EOF
+#define USE_TERM_DRIVER 1
+EOF
+
+	if test "$with_sp_funcs" != yes ; then
+		{ { echo "$as_me:10069: error: The term-driver option relies upon sp-funcs" >&5
+echo "$as_me: error: The term-driver option relies upon sp-funcs" >&2;}
+   { (exit 1); exit 1; }; }
+	fi
 fi
 
 ###   use option --enable-const to turn on use of const beyond that in XSI.
-echo "$as_me:8963: checking for extended use of const keyword" >&5
+echo "$as_me:10076: checking for extended use of const keyword" >&5
 echo $ECHO_N "checking for extended use of const keyword... $ECHO_C" >&6
 
 # Check whether --enable-const or --disable-const was given.
@@ -8970,7 +10083,7 @@
 else
   with_ext_const=no
 fi;
-echo "$as_me:8973: result: $with_ext_const" >&5
+echo "$as_me:10086: result: $with_ext_const" >&5
 echo "${ECHO_T}$with_ext_const" >&6
 NCURSES_CONST='/*nothing*/'
 if test "$with_ext_const" = yes ; then
@@ -8978,7 +10091,7 @@
 fi
 
 ###   use option --enable-ext-colors to turn on use of colors beyond 16.
-echo "$as_me:8981: checking if you want to use extended colors" >&5
+echo "$as_me:10094: checking if you want to use extended colors" >&5
 echo $ECHO_N "checking if you want to use extended colors... $ECHO_C" >&6
 
 # Check whether --enable-ext-colors or --disable-ext-colors was given.
@@ -8988,12 +10101,12 @@
 else
   with_ext_colors=no
 fi;
-echo "$as_me:8991: result: $with_ext_colors" >&5
+echo "$as_me:10104: result: $with_ext_colors" >&5
 echo "${ECHO_T}$with_ext_colors" >&6
 NCURSES_EXT_COLORS=0
 if test "$with_ext_colors" = yes ; then
 	if test "$with_widec" != yes ; then
-		{ { echo "$as_me:8996: error: This option applies only to wide-character library" >&5
+		{ { echo "$as_me:10109: error: This option applies only to wide-character library" >&5
 echo "$as_me: error: This option applies only to wide-character library" >&2;}
    { (exit 1); exit 1; }; }
 	else
@@ -9004,7 +10117,7 @@
 	5.*)
 		cf_cv_rel_version=6.0
 		cf_cv_abi_version=6
-		{ echo "$as_me:9007: WARNING: Overriding ABI version to $cf_cv_abi_version" >&5
+		{ echo "$as_me:10120: WARNING: Overriding ABI version to $cf_cv_abi_version" >&5
 echo "$as_me: WARNING: Overriding ABI version to $cf_cv_abi_version" >&2;}
 		;;
 	esac
@@ -9019,7 +10132,7 @@
 fi
 
 ###   use option --enable-ext-mouse to modify coding to support 5-button mice
-echo "$as_me:9022: checking if you want to use extended mouse encoding" >&5
+echo "$as_me:10135: checking if you want to use extended mouse encoding" >&5
 echo $ECHO_N "checking if you want to use extended mouse encoding... $ECHO_C" >&6
 
 # Check whether --enable-ext-mouse or --disable-ext-mouse was given.
@@ -9029,7 +10142,7 @@
 else
   with_ext_mouse=no
 fi;
-echo "$as_me:9032: result: $with_ext_mouse" >&5
+echo "$as_me:10145: result: $with_ext_mouse" >&5
 echo "${ECHO_T}$with_ext_mouse" >&6
 NCURSES_MOUSE_VERSION=1
 if test "$with_ext_mouse" = yes ; then
@@ -9040,7 +10153,7 @@
 	5.*)
 		cf_cv_rel_version=6.0
 		cf_cv_abi_version=6
-		{ echo "$as_me:9043: WARNING: Overriding ABI version to $cf_cv_abi_version" >&5
+		{ echo "$as_me:10156: WARNING: Overriding ABI version to $cf_cv_abi_version" >&5
 echo "$as_me: WARNING: Overriding ABI version to $cf_cv_abi_version" >&2;}
 		;;
 	esac
@@ -9048,7 +10161,7 @@
 
 fi
 
-echo "$as_me:9051: checking if you want \$NCURSES_NO_PADDING code" >&5
+echo "$as_me:10164: checking if you want \$NCURSES_NO_PADDING code" >&5
 echo $ECHO_N "checking if you want \$NCURSES_NO_PADDING code... $ECHO_C" >&6
 
 # Check whether --enable-no-padding or --disable-no-padding was given.
@@ -9058,19 +10171,19 @@
 else
   with_no_padding=$with_ext_funcs
 fi;
-echo "$as_me:9061: result: $with_no_padding" >&5
+echo "$as_me:10174: result: $with_no_padding" >&5
 echo "${ECHO_T}$with_no_padding" >&6
 test "$with_no_padding" = yes && cat >>confdefs.h <<\EOF
 #define NCURSES_NO_PADDING 1
 EOF
 
-echo "$as_me:9067: checking for ANSI C header files" >&5
+echo "$as_me:10180: checking for ANSI C header files" >&5
 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
 if test "${ac_cv_header_stdc+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 9073 "configure"
+#line 10186 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -9078,13 +10191,13 @@
 #include <float.h>
 
 _ACEOF
-if { (eval echo "$as_me:9081: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:10194: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
   egrep -v '^ *\+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:9087: \$? = $ac_status" >&5
+  echo "$as_me:10200: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -9106,7 +10219,7 @@
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
   cat >conftest.$ac_ext <<_ACEOF
-#line 9109 "configure"
+#line 10222 "configure"
 #include "confdefs.h"
 #include <string.h>
 
@@ -9117,14 +10230,14 @@
 else
   ac_cv_header_stdc=no
 fi
-rm -f conftest*
+rm -rf conftest*
 
 fi
 
 if test $ac_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
   cat >conftest.$ac_ext <<_ACEOF
-#line 9127 "configure"
+#line 10240 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 
@@ -9135,7 +10248,7 @@
 else
   ac_cv_header_stdc=no
 fi
-rm -f conftest*
+rm -rf conftest*
 
 fi
 
@@ -9145,7 +10258,7 @@
   :
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 9148 "configure"
+#line 10261 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #if ((' ' & 0x0FF) == 0x020)
@@ -9171,15 +10284,15 @@
 }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:9174: \"$ac_link\"") >&5
+if { (eval echo "$as_me:10287: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:9177: \$? = $ac_status" >&5
+  echo "$as_me:10290: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:9179: \"$ac_try\"") >&5
+  { (eval echo "$as_me:10292: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9182: \$? = $ac_status" >&5
+  echo "$as_me:10295: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
@@ -9192,7 +10305,7 @@
 fi
 fi
 fi
-echo "$as_me:9195: result: $ac_cv_header_stdc" >&5
+echo "$as_me:10308: result: $ac_cv_header_stdc" >&5
 echo "${ECHO_T}$ac_cv_header_stdc" >&6
 if test $ac_cv_header_stdc = yes; then
 
@@ -9208,28 +10321,28 @@
                   inttypes.h stdint.h unistd.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-echo "$as_me:9211: checking for $ac_header" >&5
+echo "$as_me:10324: checking for $ac_header" >&5
 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
 if eval "test \"\${$as_ac_Header+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 9217 "configure"
+#line 10330 "configure"
 #include "confdefs.h"
 $ac_includes_default
 #include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:9223: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:10336: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:9226: \$? = $ac_status" >&5
+  echo "$as_me:10339: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:9229: \"$ac_try\"") >&5
+  { (eval echo "$as_me:10342: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9232: \$? = $ac_status" >&5
+  echo "$as_me:10345: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   eval "$as_ac_Header=yes"
 else
@@ -9239,7 +10352,7 @@
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:9242: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "$as_me:10355: result: `eval echo '${'$as_ac_Header'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
   cat >>confdefs.h <<EOF
@@ -9249,13 +10362,13 @@
 fi
 done
 
-echo "$as_me:9252: checking for signed char" >&5
+echo "$as_me:10365: checking for signed char" >&5
 echo $ECHO_N "checking for signed char... $ECHO_C" >&6
 if test "${ac_cv_type_signed_char+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 9258 "configure"
+#line 10371 "configure"
 #include "confdefs.h"
 $ac_includes_default
 int
@@ -9270,16 +10383,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:9273: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:10386: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:9276: \$? = $ac_status" >&5
+  echo "$as_me:10389: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:9279: \"$ac_try\"") >&5
+  { (eval echo "$as_me:10392: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9282: \$? = $ac_status" >&5
+  echo "$as_me:10395: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_type_signed_char=yes
 else
@@ -9289,10 +10402,10 @@
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:9292: result: $ac_cv_type_signed_char" >&5
+echo "$as_me:10405: result: $ac_cv_type_signed_char" >&5
 echo "${ECHO_T}$ac_cv_type_signed_char" >&6
 
-echo "$as_me:9295: checking size of signed char" >&5
+echo "$as_me:10408: checking size of signed char" >&5
 echo $ECHO_N "checking size of signed char... $ECHO_C" >&6
 if test "${ac_cv_sizeof_signed_char+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -9301,7 +10414,7 @@
   if test "$cross_compiling" = yes; then
   # Depending upon the size, compute the lo and hi bounds.
 cat >conftest.$ac_ext <<_ACEOF
-#line 9304 "configure"
+#line 10417 "configure"
 #include "confdefs.h"
 $ac_includes_default
 int
@@ -9313,21 +10426,21 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:9316: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:10429: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:9319: \$? = $ac_status" >&5
+  echo "$as_me:10432: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:9322: \"$ac_try\"") >&5
+  { (eval echo "$as_me:10435: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9325: \$? = $ac_status" >&5
+  echo "$as_me:10438: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_lo=0 ac_mid=0
   while :; do
     cat >conftest.$ac_ext <<_ACEOF
-#line 9330 "configure"
+#line 10443 "configure"
 #include "confdefs.h"
 $ac_includes_default
 int
@@ -9339,16 +10452,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:9342: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:10455: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:9345: \$? = $ac_status" >&5
+  echo "$as_me:10458: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:9348: \"$ac_try\"") >&5
+  { (eval echo "$as_me:10461: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9351: \$? = $ac_status" >&5
+  echo "$as_me:10464: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_hi=$ac_mid; break
 else
@@ -9364,7 +10477,7 @@
 ac_hi=-1 ac_mid=-1
   while :; do
     cat >conftest.$ac_ext <<_ACEOF
-#line 9367 "configure"
+#line 10480 "configure"
 #include "confdefs.h"
 $ac_includes_default
 int
@@ -9376,16 +10489,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:9379: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:10492: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:9382: \$? = $ac_status" >&5
+  echo "$as_me:10495: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:9385: \"$ac_try\"") >&5
+  { (eval echo "$as_me:10498: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9388: \$? = $ac_status" >&5
+  echo "$as_me:10501: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_lo=$ac_mid; break
 else
@@ -9401,7 +10514,7 @@
 while test "x$ac_lo" != "x$ac_hi"; do
   ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
   cat >conftest.$ac_ext <<_ACEOF
-#line 9404 "configure"
+#line 10517 "configure"
 #include "confdefs.h"
 $ac_includes_default
 int
@@ -9413,16 +10526,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:9416: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:10529: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:9419: \$? = $ac_status" >&5
+  echo "$as_me:10532: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:9422: \"$ac_try\"") >&5
+  { (eval echo "$as_me:10535: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9425: \$? = $ac_status" >&5
+  echo "$as_me:10538: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_hi=$ac_mid
 else
@@ -9435,12 +10548,12 @@
 ac_cv_sizeof_signed_char=$ac_lo
 else
   if test "$cross_compiling" = yes; then
-  { { echo "$as_me:9438: error: cannot run test program while cross compiling" >&5
+  { { echo "$as_me:10551: error: cannot run test program while cross compiling" >&5
 echo "$as_me: error: cannot run test program while cross compiling" >&2;}
    { (exit 1); exit 1; }; }
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 9443 "configure"
+#line 10556 "configure"
 #include "confdefs.h"
 $ac_includes_default
 int
@@ -9456,15 +10569,15 @@
 }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:9459: \"$ac_link\"") >&5
+if { (eval echo "$as_me:10572: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:9462: \$? = $ac_status" >&5
+  echo "$as_me:10575: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:9464: \"$ac_try\"") >&5
+  { (eval echo "$as_me:10577: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9467: \$? = $ac_status" >&5
+  echo "$as_me:10580: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_sizeof_signed_char=`cat conftest.val`
 else
@@ -9480,7 +10593,7 @@
   ac_cv_sizeof_signed_char=0
 fi
 fi
-echo "$as_me:9483: result: $ac_cv_sizeof_signed_char" >&5
+echo "$as_me:10596: result: $ac_cv_sizeof_signed_char" >&5
 echo "${ECHO_T}$ac_cv_sizeof_signed_char" >&6
 cat >>confdefs.h <<EOF
 #define SIZEOF_SIGNED_CHAR $ac_cv_sizeof_signed_char
@@ -9491,7 +10604,7 @@
 else
 	NCURSES_SBOOL="char"
 fi
-echo "$as_me:9494: checking if you want to use signed Boolean array in term.h" >&5
+echo "$as_me:10607: checking if you want to use signed Boolean array in term.h" >&5
 echo $ECHO_N "checking if you want to use signed Boolean array in term.h... $ECHO_C" >&6
 
 # Check whether --enable-signed-char or --disable-signed-char was given.
@@ -9501,12 +10614,12 @@
 else
   with_signed_char=no
 fi;
-echo "$as_me:9504: result: $with_signed_char" >&5
+echo "$as_me:10617: result: $with_signed_char" >&5
 echo "${ECHO_T}$with_signed_char" >&6
 test "$with_signed_char" != yes && NCURSES_SBOOL="char"
 
 ###   use option --enable-sigwinch to turn on use of SIGWINCH logic
-echo "$as_me:9509: checking if you want SIGWINCH handler" >&5
+echo "$as_me:10622: checking if you want SIGWINCH handler" >&5
 echo $ECHO_N "checking if you want SIGWINCH handler... $ECHO_C" >&6
 
 # Check whether --enable-sigwinch or --disable-sigwinch was given.
@@ -9516,14 +10629,14 @@
 else
   with_sigwinch=$with_ext_funcs
 fi;
-echo "$as_me:9519: result: $with_sigwinch" >&5
+echo "$as_me:10632: result: $with_sigwinch" >&5
 echo "${ECHO_T}$with_sigwinch" >&6
 test "$with_sigwinch" = yes && cat >>confdefs.h <<\EOF
 #define USE_SIGWINCH 1
 EOF
 
 ###   use option --enable-tcap-names to allow user to define new capabilities
-echo "$as_me:9526: checking if you want user-definable terminal capabilities like termcap" >&5
+echo "$as_me:10639: checking if you want user-definable terminal capabilities like termcap" >&5
 echo $ECHO_N "checking if you want user-definable terminal capabilities like termcap... $ECHO_C" >&6
 
 # Check whether --enable-tcap-names or --disable-tcap-names was given.
@@ -9533,7 +10646,7 @@
 else
   with_tcap_names=$with_ext_funcs
 fi;
-echo "$as_me:9536: result: $with_tcap_names" >&5
+echo "$as_me:10649: result: $with_tcap_names" >&5
 echo "${ECHO_T}$with_tcap_names" >&6
 NCURSES_XNAMES=0
 test "$with_tcap_names" = yes && NCURSES_XNAMES=1
@@ -9541,7 +10654,7 @@
 ###############################################################################
 # These options are relatively safe to experiment with.
 
-echo "$as_me:9544: checking if you want all development code" >&5
+echo "$as_me:10657: checking if you want all development code" >&5
 echo $ECHO_N "checking if you want all development code... $ECHO_C" >&6
 
 # Check whether --with-develop or --without-develop was given.
@@ -9551,11 +10664,11 @@
 else
   with_develop=no
 fi;
-echo "$as_me:9554: result: $with_develop" >&5
+echo "$as_me:10667: result: $with_develop" >&5
 echo "${ECHO_T}$with_develop" >&6
 
 ###   use option --enable-hard-tabs to turn on use of hard-tabs optimize
-echo "$as_me:9558: checking if you want hard-tabs code" >&5
+echo "$as_me:10671: checking if you want hard-tabs code" >&5
 echo $ECHO_N "checking if you want hard-tabs code... $ECHO_C" >&6
 
 # Check whether --enable-hard-tabs or --disable-hard-tabs was given.
@@ -9565,14 +10678,14 @@
 else
   enable_hard_tabs=$with_develop
 fi;
-echo "$as_me:9568: result: $enable_hard_tabs" >&5
+echo "$as_me:10681: result: $enable_hard_tabs" >&5
 echo "${ECHO_T}$enable_hard_tabs" >&6
 test "$enable_hard_tabs" = yes && cat >>confdefs.h <<\EOF
 #define USE_HARD_TABS 1
 EOF
 
 ###   use option --enable-xmc-glitch to turn on use of magic-cookie optimize
-echo "$as_me:9575: checking if you want limited support for xmc" >&5
+echo "$as_me:10688: checking if you want limited support for xmc" >&5
 echo $ECHO_N "checking if you want limited support for xmc... $ECHO_C" >&6
 
 # Check whether --enable-xmc-glitch or --disable-xmc-glitch was given.
@@ -9582,7 +10695,7 @@
 else
   enable_xmc_glitch=$with_develop
 fi;
-echo "$as_me:9585: result: $enable_xmc_glitch" >&5
+echo "$as_me:10698: result: $enable_xmc_glitch" >&5
 echo "${ECHO_T}$enable_xmc_glitch" >&6
 test "$enable_xmc_glitch" = yes && cat >>confdefs.h <<\EOF
 #define USE_XMC_SUPPORT 1
@@ -9591,7 +10704,7 @@
 ###############################################################################
 # These are just experimental, probably should not be in a package:
 
-echo "$as_me:9594: checking if you do not want to assume colors are white-on-black" >&5
+echo "$as_me:10707: checking if you do not want to assume colors are white-on-black" >&5
 echo $ECHO_N "checking if you do not want to assume colors are white-on-black... $ECHO_C" >&6
 
 # Check whether --enable-assumed-color or --disable-assumed-color was given.
@@ -9601,14 +10714,14 @@
 else
   with_assumed_color=yes
 fi;
-echo "$as_me:9604: result: $with_assumed_color" >&5
+echo "$as_me:10717: result: $with_assumed_color" >&5
 echo "${ECHO_T}$with_assumed_color" >&6
 test "$with_assumed_color" = yes && cat >>confdefs.h <<\EOF
 #define USE_ASSUMED_COLOR 1
 EOF
 
 ###   use option --enable-hashmap to turn on use of hashmap scrolling logic
-echo "$as_me:9611: checking if you want hashmap scrolling-optimization code" >&5
+echo "$as_me:10724: checking if you want hashmap scrolling-optimization code" >&5
 echo $ECHO_N "checking if you want hashmap scrolling-optimization code... $ECHO_C" >&6
 
 # Check whether --enable-hashmap or --disable-hashmap was given.
@@ -9618,14 +10731,14 @@
 else
   with_hashmap=yes
 fi;
-echo "$as_me:9621: result: $with_hashmap" >&5
+echo "$as_me:10734: result: $with_hashmap" >&5
 echo "${ECHO_T}$with_hashmap" >&6
 test "$with_hashmap" = yes && cat >>confdefs.h <<\EOF
 #define USE_HASHMAP 1
 EOF
 
 ###   use option --enable-colorfgbg to turn on use of $COLORFGBG environment
-echo "$as_me:9628: checking if you want colorfgbg code" >&5
+echo "$as_me:10741: checking if you want colorfgbg code" >&5
 echo $ECHO_N "checking if you want colorfgbg code... $ECHO_C" >&6
 
 # Check whether --enable-colorfgbg or --disable-colorfgbg was given.
@@ -9635,16 +10748,33 @@
 else
   with_colorfgbg=no
 fi;
-echo "$as_me:9638: result: $with_colorfgbg" >&5
+echo "$as_me:10751: result: $with_colorfgbg" >&5
 echo "${ECHO_T}$with_colorfgbg" >&6
 test "$with_colorfgbg" = yes && cat >>confdefs.h <<\EOF
 #define USE_COLORFGBG 1
 EOF
 
+###   use option --enable-interop to turn on use of bindings used for interop
+echo "$as_me:10758: checking if you want interop bindings" >&5
+echo $ECHO_N "checking if you want interop bindings... $ECHO_C" >&6
+
+# Check whether --enable-interop or --disable-interop was given.
+if test "${enable_interop+set}" = set; then
+  enableval="$enable_interop"
+  with_exp_interop=$enableval
+else
+  with_exp_interop=no
+fi;
+echo "$as_me:10768: result: $with_exp_interop" >&5
+echo "${ECHO_T}$with_exp_interop" >&6
+
+NCURSES_INTEROP_FUNCS=0
+test "$with_exp_interop" = yes && NCURSES_INTEROP_FUNCS=1
+
 # This is still experimental (20080329), but should ultimately be moved to
 # the script-block --with-normal, etc.
 
-echo "$as_me:9647: checking if you want to link with the pthread library" >&5
+echo "$as_me:10777: checking if you want to link with the pthread library" >&5
 echo $ECHO_N "checking if you want to link with the pthread library... $ECHO_C" >&6
 
 # Check whether --with-pthread or --without-pthread was given.
@@ -9654,27 +10784,27 @@
 else
   with_pthread=no
 fi;
-echo "$as_me:9657: result: $with_pthread" >&5
+echo "$as_me:10787: result: $with_pthread" >&5
 echo "${ECHO_T}$with_pthread" >&6
 
 if test "$with_pthread" != no ; then
-    echo "$as_me:9661: checking for pthread.h" >&5
+    echo "$as_me:10791: checking for pthread.h" >&5
 echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6
 if test "${ac_cv_header_pthread_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 9667 "configure"
+#line 10797 "configure"
 #include "confdefs.h"
 #include <pthread.h>
 _ACEOF
-if { (eval echo "$as_me:9671: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:10801: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
   egrep -v '^ *\+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:9677: \$? = $ac_status" >&5
+  echo "$as_me:10807: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -9693,7 +10823,7 @@
 fi
 rm -f conftest.err conftest.$ac_ext
 fi
-echo "$as_me:9696: result: $ac_cv_header_pthread_h" >&5
+echo "$as_me:10826: result: $ac_cv_header_pthread_h" >&5
 echo "${ECHO_T}$ac_cv_header_pthread_h" >&6
 if test $ac_cv_header_pthread_h = yes; then
 
@@ -9701,12 +10831,12 @@
 #define HAVE_PTHREADS_H 1
 EOF
 
-        echo "$as_me:9704: checking if we can link with the pthread library" >&5
+        echo "$as_me:10834: checking if we can link with the pthread library" >&5
 echo $ECHO_N "checking if we can link with the pthread library... $ECHO_C" >&6
         cf_save_LIBS="$LIBS"
         LIBS="-lpthread $LIBS"
         cat >conftest.$ac_ext <<_ACEOF
-#line 9709 "configure"
+#line 10839 "configure"
 #include "confdefs.h"
 
 #include <pthread.h>
@@ -9722,16 +10852,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:9725: \"$ac_link\"") >&5
+if { (eval echo "$as_me:10855: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:9728: \$? = $ac_status" >&5
+  echo "$as_me:10858: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:9731: \"$ac_try\"") >&5
+  { (eval echo "$as_me:10861: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9734: \$? = $ac_status" >&5
+  echo "$as_me:10864: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   with_pthread=yes
 else
@@ -9741,7 +10871,7 @@
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
         LIBS="$cf_save_LIBS"
-        echo "$as_me:9744: result: $with_pthread" >&5
+        echo "$as_me:10874: result: $with_pthread" >&5
 echo "${ECHO_T}$with_pthread" >&6
 
         if test "$with_pthread" = yes ; then
@@ -9751,7 +10881,7 @@
 EOF
 
         else
-            { { echo "$as_me:9754: error: Cannot link with pthread library" >&5
+            { { echo "$as_me:10884: error: Cannot link with pthread library" >&5
 echo "$as_me: error: Cannot link with pthread library" >&2;}
    { (exit 1); exit 1; }; }
         fi
@@ -9760,28 +10890,109 @@
 
 fi
 
-echo "$as_me:9763: checking if you want to use weak-symbols for pthreads" >&5
+if test "x$with_pthread" != xno; then
+	echo "$as_me:10894: checking for pthread_kill" >&5
+echo $ECHO_N "checking for pthread_kill... $ECHO_C" >&6
+if test "${ac_cv_func_pthread_kill+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 10900 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char pthread_kill (); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char pthread_kill ();
+char (*f) ();
+
+int
+main ()
+{
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_pthread_kill) || defined (__stub___pthread_kill)
+choke me
+#else
+f = pthread_kill;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:10931: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:10934: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:10937: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:10940: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_pthread_kill=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_func_pthread_kill=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:10950: result: $ac_cv_func_pthread_kill" >&5
+echo "${ECHO_T}$ac_cv_func_pthread_kill" >&6
+if test $ac_cv_func_pthread_kill = yes; then
+
+		echo "$as_me:10954: checking if you want to allow EINTR in wgetch with pthreads" >&5
+echo $ECHO_N "checking if you want to allow EINTR in wgetch with pthreads... $ECHO_C" >&6
+
+# Check whether --enable-pthreads-eintr or --disable-pthreads-eintr was given.
+if test "${enable_pthreads_eintr+set}" = set; then
+  enableval="$enable_pthreads_eintr"
+  use_pthreads_eintr=$enableval
+else
+  use_pthreads_eintr=no
+fi;
+		echo "$as_me:10964: result: $use_pthreads_eintr" >&5
+echo "${ECHO_T}$use_pthreads_eintr" >&6
+		if test $use_pthreads_eintr = yes ; then
+			cat >>confdefs.h <<\EOF
+#define USE_PTHREADS_EINTR 1
+EOF
+
+		fi
+fi
+
+	echo "$as_me:10974: checking if you want to use weak-symbols for pthreads" >&5
 echo $ECHO_N "checking if you want to use weak-symbols for pthreads... $ECHO_C" >&6
 
 # Check whether --enable-weak-symbols or --disable-weak-symbols was given.
 if test "${enable_weak_symbols+set}" = set; then
   enableval="$enable_weak_symbols"
-  use_weak_symbols=$withval
+  use_weak_symbols=$enableval
 else
   use_weak_symbols=no
 fi;
-echo "$as_me:9773: result: $use_weak_symbols" >&5
+	echo "$as_me:10984: result: $use_weak_symbols" >&5
 echo "${ECHO_T}$use_weak_symbols" >&6
-if test "$use_weak_symbols" = yes ; then
+	if test "$use_weak_symbols" = yes ; then
 
-echo "$as_me:9777: checking if $CC supports weak symbols" >&5
+echo "$as_me:10988: checking if $CC supports weak symbols" >&5
 echo $ECHO_N "checking if $CC supports weak symbols... $ECHO_C" >&6
 if test "${cf_cv_weak_symbols+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 cat >conftest.$ac_ext <<_ACEOF
-#line 9784 "configure"
+#line 10995 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -9807,16 +11018,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:9810: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:11021: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:9813: \$? = $ac_status" >&5
+  echo "$as_me:11024: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:9816: \"$ac_try\"") >&5
+  { (eval echo "$as_me:11027: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9819: \$? = $ac_status" >&5
+  echo "$as_me:11030: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_weak_symbols=yes
 else
@@ -9827,18 +11038,19 @@
 rm -f conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:9830: result: $cf_cv_weak_symbols" >&5
+echo "$as_me:11041: result: $cf_cv_weak_symbols" >&5
 echo "${ECHO_T}$cf_cv_weak_symbols" >&6
 
-else
-    cf_cv_weak_symbols=no
-fi
+	else
+		cf_cv_weak_symbols=no
+	fi
 
-if test $cf_cv_weak_symbols = yes ; then
-    cat >>confdefs.h <<\EOF
+	if test $cf_cv_weak_symbols = yes ; then
+		cat >>confdefs.h <<\EOF
 #define USE_WEAK_SYMBOLS 1
 EOF
 
+	fi
 fi
 
 PTHREAD=
@@ -9857,7 +11069,7 @@
 # opaque outside of that, so there is no --enable-opaque option.  We can use
 # this option without --with-pthreads, but this will be always set for
 # pthreads.
-echo "$as_me:9860: checking if you want experimental reentrant code" >&5
+echo "$as_me:11072: checking if you want experimental reentrant code" >&5
 echo $ECHO_N "checking if you want experimental reentrant code... $ECHO_C" >&6
 
 # Check whether --enable-reentrant or --disable-reentrant was given.
@@ -9867,21 +11079,23 @@
 else
   with_reentrant=no
 fi;
-echo "$as_me:9870: result: $with_reentrant" >&5
+echo "$as_me:11082: result: $with_reentrant" >&5
 echo "${ECHO_T}$with_reentrant" >&6
 if test "$with_reentrant" = yes ; then
 	cf_cv_enable_reentrant=1
 	cf_cv_enable_opaque="NCURSES_INTERNALS"
 	NCURSES_OPAQUE=1
 	NCURSES_SIZE_T=int
-    if test $cf_cv_weak_symbols = yes ; then
+	if test $cf_cv_weak_symbols = yes ; then
 
 # remove pthread library from $LIBS
 LIBS=`echo "$LIBS" | sed -e 's/-lpthread[ 	]//g' -e 's/-lpthread$//'`
 
-    else
-        LIB_SUFFIX="t${LIB_SUFFIX}"
-    fi
+		TEST_LIBS="-lpthread $TEST_LIBS"
+		TEST_LIBS2="-lpthread $TEST_LIBS2"
+	else
+		LIB_SUFFIX="t${LIB_SUFFIX}"
+	fi
 	cat >>confdefs.h <<\EOF
 #define USE_REENTRANT 1
 EOF
@@ -9891,7 +11105,7 @@
 	5.*)
 		cf_cv_rel_version=6.0
 		cf_cv_abi_version=6
-		{ echo "$as_me:9894: WARNING: Overriding ABI version to $cf_cv_abi_version" >&5
+		{ echo "$as_me:11108: WARNING: Overriding ABI version to $cf_cv_abi_version" >&5
 echo "$as_me: WARNING: Overriding ABI version to $cf_cv_abi_version" >&2;}
 		;;
 	esac
@@ -9904,7 +11118,29 @@
 	NCURSES_SIZE_T=short
 fi
 
-echo "$as_me:9907: checking if you want experimental safe-sprintf code" >&5
+### Allow using a different wrap-prefix
+if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then
+	echo "$as_me:11123: checking for prefix used to wrap public variables" >&5
+echo $ECHO_N "checking for prefix used to wrap public variables... $ECHO_C" >&6
+
+# Check whether --with-wrap-prefix or --without-wrap-prefix was given.
+if test "${with_wrap_prefix+set}" = set; then
+  withval="$with_wrap_prefix"
+  NCURSES_WRAP_PREFIX=$withval
+else
+  NCURSES_WRAP_PREFIX=_nc_
+fi;
+	echo "$as_me:11133: result: $NCURSES_WRAP_PREFIX" >&5
+echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
+else
+	NCURSES_WRAP_PREFIX=_nc_
+fi
+
+cat >>confdefs.h <<EOF
+#define NCURSES_WRAP_PREFIX "$NCURSES_WRAP_PREFIX"
+EOF
+
+echo "$as_me:11143: checking if you want experimental safe-sprintf code" >&5
 echo $ECHO_N "checking if you want experimental safe-sprintf code... $ECHO_C" >&6
 
 # Check whether --enable-safe-sprintf or --disable-safe-sprintf was given.
@@ -9914,7 +11150,7 @@
 else
   with_safe_sprintf=no
 fi;
-echo "$as_me:9917: result: $with_safe_sprintf" >&5
+echo "$as_me:11153: result: $with_safe_sprintf" >&5
 echo "${ECHO_T}$with_safe_sprintf" >&6
 test "$with_safe_sprintf" = yes && cat >>confdefs.h <<\EOF
 #define USE_SAFE_SPRINTF 1
@@ -9923,7 +11159,7 @@
 ###   use option --disable-scroll-hints to turn off use of scroll-hints scrolling logic
 # when hashmap is used scroll hints are useless
 if test "$with_hashmap" = no ; then
-echo "$as_me:9926: checking if you want to experiment without scrolling-hints code" >&5
+echo "$as_me:11162: checking if you want to experiment without scrolling-hints code" >&5
 echo $ECHO_N "checking if you want to experiment without scrolling-hints code... $ECHO_C" >&6
 
 # Check whether --enable-scroll-hints or --disable-scroll-hints was given.
@@ -9933,7 +11169,7 @@
 else
   with_scroll_hints=yes
 fi;
-echo "$as_me:9936: result: $with_scroll_hints" >&5
+echo "$as_me:11172: result: $with_scroll_hints" >&5
 echo "${ECHO_T}$with_scroll_hints" >&6
 test "$with_scroll_hints" = yes && cat >>confdefs.h <<\EOF
 #define USE_SCROLL_HINTS 1
@@ -9941,7 +11177,7 @@
 
 fi
 
-echo "$as_me:9944: checking if you want experimental wgetch-events code" >&5
+echo "$as_me:11180: checking if you want experimental wgetch-events code" >&5
 echo $ECHO_N "checking if you want experimental wgetch-events code... $ECHO_C" >&6
 
 # Check whether --enable-wgetch-events or --disable-wgetch-events was given.
@@ -9951,7 +11187,7 @@
 else
   with_wgetch_events=no
 fi;
-echo "$as_me:9954: result: $with_wgetch_events" >&5
+echo "$as_me:11190: result: $with_wgetch_events" >&5
 echo "${ECHO_T}$with_wgetch_events" >&6
 test "$with_wgetch_events" = yes && cat >>confdefs.h <<\EOF
 #define NCURSES_WGETCH_EVENTS 1
@@ -9960,7 +11196,7 @@
 ###############################################################################
 
 ###	use option --disable-echo to suppress full display compiling commands
-echo "$as_me:9963: checking if you want to display full commands during build" >&5
+echo "$as_me:11199: checking if you want to display full commands during build" >&5
 echo $ECHO_N "checking if you want to display full commands during build... $ECHO_C" >&6
 
 # Check whether --enable-echo or --disable-echo was given.
@@ -9977,11 +11213,11 @@
 	test -n "$LIBTOOL" && LIBTOOL="$LIBTOOL --silent"
 	test -n "$LIBTOOL_CXX" && LIBTOOL_CXX="$LIBTOOL_CXX --silent"
 fi
-echo "$as_me:9980: result: $with_echo" >&5
+echo "$as_me:11216: result: $with_echo" >&5
 echo "${ECHO_T}$with_echo" >&6
 
 ###	use option --enable-warnings to turn on all gcc warnings
-echo "$as_me:9984: checking if you want to see compiler warnings" >&5
+echo "$as_me:11220: checking if you want to see compiler warnings" >&5
 echo $ECHO_N "checking if you want to see compiler warnings... $ECHO_C" >&6
 
 # Check whether --enable-warnings or --disable-warnings was given.
@@ -9989,10 +11225,11 @@
   enableval="$enable_warnings"
   with_warnings=$enableval
 fi;
-echo "$as_me:9992: result: $with_warnings" >&5
+echo "$as_me:11228: result: $with_warnings" >&5
 echo "${ECHO_T}$with_warnings" >&6
 
 if test "x$with_warnings" = "xyes"; then
+
  	ADAFLAGS="$ADAFLAGS -gnatg"
 
 INTEL_COMPILER=no
@@ -10000,12 +11237,12 @@
 if test "$GCC" = yes ; then
 	case $host_os in
 	linux*|gnu*)
-		echo "$as_me:10003: checking if this is really Intel C compiler" >&5
+		echo "$as_me:11240: checking if this is really Intel C compiler" >&5
 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
 		cf_save_CFLAGS="$CFLAGS"
 		CFLAGS="$CFLAGS -no-gcc"
 		cat >conftest.$ac_ext <<_ACEOF
-#line 10008 "configure"
+#line 11245 "configure"
 #include "confdefs.h"
 
 int
@@ -10022,16 +11259,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:10025: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:11262: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:10028: \$? = $ac_status" >&5
+  echo "$as_me:11265: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:10031: \"$ac_try\"") >&5
+  { (eval echo "$as_me:11268: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:10034: \$? = $ac_status" >&5
+  echo "$as_me:11271: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   INTEL_COMPILER=yes
 cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc"
@@ -10042,14 +11279,14 @@
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 		CFLAGS="$cf_save_CFLAGS"
-		echo "$as_me:10045: result: $INTEL_COMPILER" >&5
+		echo "$as_me:11282: result: $INTEL_COMPILER" >&5
 echo "${ECHO_T}$INTEL_COMPILER" >&6
 		;;
 	esac
 fi
 
 cat > conftest.$ac_ext <<EOF
-#line 10052 "${as_me-configure}"
+#line 11289 "${as_me:-configure}"
 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
 EOF
 
@@ -10057,7 +11294,6 @@
 then
 # The "-wdXXX" options suppress warnings:
 # remark #1419: external declaration in primary source file
-# remark #1682: implicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
 # remark #193: zero used for undefined preprocessing identifier
@@ -10065,31 +11301,30 @@
 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
 # remark #869: parameter "tw" was never referenced
 # remark #981: operands are evaluated in unspecified order
-# warning #269: invalid format string conversion
+# warning #279: controlling expression is constant
 
-	{ echo "$as_me:10070: checking for $CC warning options..." >&5
+	{ echo "$as_me:11306: checking for $CC warning options..." >&5
 echo "$as_me: checking for $CC warning options..." >&6;}
 	cf_save_CFLAGS="$CFLAGS"
 	EXTRA_CFLAGS="-Wall"
 	for cf_opt in \
 		wd1419 \
-		wd1682 \
 		wd1683 \
 		wd1684 \
 		wd193 \
-		wd279 \
 		wd593 \
+		wd279 \
 		wd810 \
 		wd869 \
 		wd981
 	do
 		CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
-		if { (eval echo "$as_me:10087: \"$ac_compile\"") >&5
+		if { (eval echo "$as_me:11322: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:10090: \$? = $ac_status" >&5
+  echo "$as_me:11325: \$? = $ac_status" >&5
   (exit $ac_status); }; then
-			test -n "$verbose" && echo "$as_me:10092: result: ... -$cf_opt" >&5
+			test -n "$verbose" && echo "$as_me:11327: result: ... -$cf_opt" >&5
 echo "${ECHO_T}... -$cf_opt" >&6
 			EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
 		fi
@@ -10098,13 +11333,13 @@
 
 elif test "$GCC" = yes
 then
-	{ echo "$as_me:10101: checking for $CC warning options..." >&5
+	{ echo "$as_me:11336: checking for $CC warning options..." >&5
 echo "$as_me: checking for $CC warning options..." >&6;}
 	cf_save_CFLAGS="$CFLAGS"
-	EXTRA_CFLAGS="-W -Wall"
+	EXTRA_CFLAGS=
 	cf_warn_CONST=""
 	test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
-	for cf_opt in \
+	for cf_opt in W Wall \
 		Wbad-function-cast \
 		Wcast-align \
 		Wcast-qual \
@@ -10118,12 +11353,12 @@
 		Wundef $cf_warn_CONST Wdeclaration-after-statement Wextra Wno-unknown-pragmas Wswitch-enum
 	do
 		CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
-		if { (eval echo "$as_me:10121: \"$ac_compile\"") >&5
+		if { (eval echo "$as_me:11356: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:10124: \$? = $ac_status" >&5
+  echo "$as_me:11359: \$? = $ac_status" >&5
   (exit $ac_status); }; then
-			test -n "$verbose" && echo "$as_me:10126: result: ... -$cf_opt" >&5
+			test -n "$verbose" && echo "$as_me:11361: result: ... -$cf_opt" >&5
 echo "${ECHO_T}... -$cf_opt" >&6
 			case $cf_opt in #(vi
 			Wcast-qual) #(vi
@@ -10134,7 +11369,7 @@
 				[34].*)
 					test -n "$verbose" && echo "	feature is broken in gcc $GCC_VERSION" 1>&6
 
-echo "${as_me-configure}:10137: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
+echo "${as_me:-configure}:11372: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
 
 					continue;;
 				esac
@@ -10145,7 +11380,7 @@
 	done
 	CFLAGS="$cf_save_CFLAGS"
 fi
-rm -f conftest*
+rm -rf conftest*
 
 	if test "$cf_with_cxx" = yes ; then
 
@@ -10154,12 +11389,12 @@
 if test "$GCC" = yes ; then
 	case $host_os in
 	linux*|gnu*)
-		echo "$as_me:10157: checking if this is really Intel C++ compiler" >&5
+		echo "$as_me:11392: checking if this is really Intel C++ compiler" >&5
 echo $ECHO_N "checking if this is really Intel C++ compiler... $ECHO_C" >&6
 		cf_save_CFLAGS="$CXXFLAGS"
 		CXXFLAGS="$CXXFLAGS -no-gcc"
 		cat >conftest.$ac_ext <<_ACEOF
-#line 10162 "configure"
+#line 11397 "configure"
 #include "confdefs.h"
 
 int
@@ -10176,16 +11411,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:10179: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:11414: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:10182: \$? = $ac_status" >&5
+  echo "$as_me:11417: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:10185: \"$ac_try\"") >&5
+  { (eval echo "$as_me:11420: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:10188: \$? = $ac_status" >&5
+  echo "$as_me:11423: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   INTEL_CPLUSPLUS=yes
 cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc"
@@ -10196,7 +11431,7 @@
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 		CXXFLAGS="$cf_save_CFLAGS"
-		echo "$as_me:10199: result: $INTEL_CPLUSPLUS" >&5
+		echo "$as_me:11434: result: $INTEL_CPLUSPLUS" >&5
 echo "${ECHO_T}$INTEL_CPLUSPLUS" >&6
 		;;
 	esac
@@ -10210,7 +11445,7 @@
 ac_main_return=return
 
 cat > conftest.$ac_ext <<EOF
-#line 10213 "configure"
+#line 11448 "configure"
 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
 EOF
 
@@ -10228,7 +11463,7 @@
 # remark #981: operands are evaluated in unspecified order
 # warning #269: invalid format string conversion
 
-	{ echo "$as_me:10231: checking for $CC warning options..." >&5
+	{ echo "$as_me:11466: checking for $CC warning options..." >&5
 echo "$as_me: checking for $CC warning options..." >&6;}
 	cf_save_CXXFLAGS="$CXXFLAGS"
 	EXTRA_CXXFLAGS="-Wall"
@@ -10245,12 +11480,12 @@
 		wd981
 	do
 		CXXFLAGS="$cf_save_CXXFLAGS $EXTRA_CXXFLAGS -$cf_opt"
-		if { (eval echo "$as_me:10248: \"$ac_compile\"") >&5
+		if { (eval echo "$as_me:11483: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:10251: \$? = $ac_status" >&5
+  echo "$as_me:11486: \$? = $ac_status" >&5
   (exit $ac_status); }; then
-			test -n "$verbose" && echo "$as_me:10253: result: ... -$cf_opt" >&5
+			test -n "$verbose" && echo "$as_me:11488: result: ... -$cf_opt" >&5
 echo "${ECHO_T}... -$cf_opt" >&6
 			EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS -$cf_opt"
 		fi
@@ -10259,7 +11494,7 @@
 
 elif test "$GXX" = yes
 then
-	{ echo "$as_me:10262: checking for $CXX warning options..." >&5
+	{ echo "$as_me:11497: checking for $CXX warning options..." >&5
 echo "$as_me: checking for $CXX warning options..." >&6;}
 	cf_save_CXXFLAGS="$CXXFLAGS"
 	EXTRA_CXXFLAGS="-W -Wall"
@@ -10288,23 +11523,23 @@
 		Wundef $cf_gxx_extra_warnings Wno-unused
 	do
 		CXXFLAGS="$cf_save_CXXFLAGS $EXTRA_CXXFLAGS -Werror -$cf_opt"
-		if { (eval echo "$as_me:10291: \"$ac_compile\"") >&5
+		if { (eval echo "$as_me:11526: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:10294: \$? = $ac_status" >&5
+  echo "$as_me:11529: \$? = $ac_status" >&5
   (exit $ac_status); }; then
-			test -n "$verbose" && echo "$as_me:10296: result: ... -$cf_opt" >&5
+			test -n "$verbose" && echo "$as_me:11531: result: ... -$cf_opt" >&5
 echo "${ECHO_T}... -$cf_opt" >&6
 			EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS -$cf_opt"
 		else
-			test -n "$verbose" && echo "$as_me:10300: result: ... no -$cf_opt" >&5
+			test -n "$verbose" && echo "$as_me:11535: result: ... no -$cf_opt" >&5
 echo "${ECHO_T}... no -$cf_opt" >&6
 		fi
 	done
 	CXXFLAGS="$cf_save_CXXFLAGS"
 fi
 
-rm -f conftest*
+rm -rf conftest*
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -10333,10 +11568,10 @@
 EOF
 if test "$GCC" = yes
 then
-	{ echo "$as_me:10336: checking for $CC __attribute__ directives..." >&5
+	{ echo "$as_me:11571: checking for $CC __attribute__ directives..." >&5
 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
 cat > conftest.$ac_ext <<EOF
-#line 10339 "${as_me-configure}"
+#line 11574 "${as_me:-configure}"
 #include "confdefs.h"
 #include "conftest.h"
 #include "conftest.i"
@@ -10355,6 +11590,8 @@
 extern void foo(void) GCC_NORETURN;
 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
 EOF
+	cf_printf_attribute=no
+	cf_scanf_attribute=no
 	for cf_attribute in scanf printf unused noreturn
 	do
 
@@ -10362,26 +11599,59 @@
 
 		cf_directive="__attribute__(($cf_attribute))"
 		echo "checking for $CC $cf_directive" 1>&5
-		case $cf_attribute in
-		scanf|printf)
-		cat >conftest.h <<EOF
+
+		case $cf_attribute in #(vi
+		printf) #(vi
+			cf_printf_attribute=yes
+			cat >conftest.h <<EOF
 #define GCC_$cf_ATTRIBUTE 1
 EOF
 			;;
-		*)
-		cat >conftest.h <<EOF
+		scanf) #(vi
+			cf_scanf_attribute=yes
+			cat >conftest.h <<EOF
+#define GCC_$cf_ATTRIBUTE 1
+EOF
+			;;
+		*) #(vi
+			cat >conftest.h <<EOF
 #define GCC_$cf_ATTRIBUTE $cf_directive
 EOF
 			;;
 		esac
-		if { (eval echo "$as_me:10377: \"$ac_compile\"") >&5
+
+		if { (eval echo "$as_me:11623: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:10380: \$? = $ac_status" >&5
+  echo "$as_me:11626: \$? = $ac_status" >&5
   (exit $ac_status); }; then
-			test -n "$verbose" && echo "$as_me:10382: result: ... $cf_attribute" >&5
+			test -n "$verbose" && echo "$as_me:11628: result: ... $cf_attribute" >&5
 echo "${ECHO_T}... $cf_attribute" >&6
 			cat conftest.h >>confdefs.h
+			case $cf_attribute in #(vi
+			printf) #(vi
+				if test "$cf_printf_attribute" = no ; then
+					cat >>confdefs.h <<EOF
+#define GCC_PRINTFLIKE(fmt,var) /* nothing */
+EOF
+				else
+					cat >>confdefs.h <<EOF
+#define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
+EOF
+				fi
+				;;
+			scanf) #(vi
+				if test "$cf_scanf_attribute" = no ; then
+					cat >>confdefs.h <<EOF
+#define GCC_SCANFLIKE(fmt,var) /* nothing */
+EOF
+				else
+					cat >>confdefs.h <<EOF
+#define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
+EOF
+				fi
+				;;
+			esac
 		fi
 	done
 else
@@ -10391,7 +11661,7 @@
 fi
 
 ###	use option --enable-assertions to turn on generation of assertion code
-echo "$as_me:10394: checking if you want to enable runtime assertions" >&5
+echo "$as_me:11664: checking if you want to enable runtime assertions" >&5
 echo $ECHO_N "checking if you want to enable runtime assertions... $ECHO_C" >&6
 
 # Check whether --enable-assertions or --disable-assertions was given.
@@ -10401,7 +11671,7 @@
 else
   with_assertions=no
 fi;
-echo "$as_me:10404: result: $with_assertions" >&5
+echo "$as_me:11674: result: $with_assertions" >&5
 echo "${ECHO_T}$with_assertions" >&6
 if test -n "$GCC"
 then
@@ -10413,13 +11683,15 @@
 
 		CPPFLAGS="$CPPFLAGS -DNDEBUG"
 	else
-		ADAFLAGS="$ADAFLAGS -gnata"
+
+ 	ADAFLAGS="$ADAFLAGS -gnata"
+
 	fi
 fi
 
 ###	use option --disable-leaks to suppress "permanent" leaks, for testing
 
-echo "$as_me:10422: checking if you want to use dmalloc for testing" >&5
+echo "$as_me:11694: checking if you want to use dmalloc for testing" >&5
 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
 
 # Check whether --with-dmalloc or --without-dmalloc was given.
@@ -10435,7 +11707,7 @@
 else
   with_dmalloc=
 fi;
-echo "$as_me:10438: result: ${with_dmalloc:-no}" >&5
+echo "$as_me:11710: result: ${with_dmalloc:-no}" >&5
 echo "${ECHO_T}${with_dmalloc:-no}" >&6
 
 case .$with_cflags in #(vi
@@ -10461,8 +11733,8 @@
 			cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
 
 			test "${cf_add_cflags}" != "${cf_tst_cflags}" \
-			&& test -z "${cf_tst_cflags}" \
-			&& cf_fix_cppflags=yes
+				&& test -z "${cf_tst_cflags}" \
+				&& cf_fix_cppflags=yes
 
 			if test $cf_fix_cppflags = yes ; then
 				cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
@@ -10477,6 +11749,16 @@
 		*$cf_add_cflags) #(vi
 			;;
 		*) #(vi
+			case $cf_add_cflags in #(vi
+			-D*)
+				cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
+
+CPPFLAGS=`echo "$CPPFLAGS" | \
+	sed	-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?[ 	]/ /g' \
+		-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?$//g'`
+
+				;;
+			esac
 			cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
 			;;
 		esac
@@ -10492,8 +11774,8 @@
 	cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
 
 	test "${cf_add_cflags}" != "${cf_tst_cflags}" \
-	&& test -z "${cf_tst_cflags}" \
-	&& cf_fix_cppflags=no
+		&& test -z "${cf_tst_cflags}" \
+		&& cf_fix_cppflags=no
 	;;
 esac
 done
@@ -10505,7 +11787,7 @@
 
 if test -n "$cf_new_cppflags" ; then
 
-	CPPFLAGS="$cf_new_cppflags $CPPFLAGS"
+	CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
 fi
 
 if test -n "$cf_new_extra_cppflags" ; then
@@ -10519,23 +11801,23 @@
 esac
 
 if test "$with_dmalloc" = yes ; then
-	echo "$as_me:10522: checking for dmalloc.h" >&5
+	echo "$as_me:11804: checking for dmalloc.h" >&5
 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
 if test "${ac_cv_header_dmalloc_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 10528 "configure"
+#line 11810 "configure"
 #include "confdefs.h"
 #include <dmalloc.h>
 _ACEOF
-if { (eval echo "$as_me:10532: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:11814: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
   egrep -v '^ *\+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:10538: \$? = $ac_status" >&5
+  echo "$as_me:11820: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -10554,11 +11836,11 @@
 fi
 rm -f conftest.err conftest.$ac_ext
 fi
-echo "$as_me:10557: result: $ac_cv_header_dmalloc_h" >&5
+echo "$as_me:11839: result: $ac_cv_header_dmalloc_h" >&5
 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
 if test $ac_cv_header_dmalloc_h = yes; then
 
-echo "$as_me:10561: checking for dmalloc_debug in -ldmalloc" >&5
+echo "$as_me:11843: checking for dmalloc_debug in -ldmalloc" >&5
 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -10566,7 +11848,7 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-ldmalloc  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 10569 "configure"
+#line 11851 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -10585,16 +11867,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:10588: \"$ac_link\"") >&5
+if { (eval echo "$as_me:11870: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:10591: \$? = $ac_status" >&5
+  echo "$as_me:11873: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:10594: \"$ac_try\"") >&5
+  { (eval echo "$as_me:11876: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:10597: \$? = $ac_status" >&5
+  echo "$as_me:11879: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_dmalloc_dmalloc_debug=yes
 else
@@ -10605,7 +11887,7 @@
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:10608: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
+echo "$as_me:11890: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
 if test $ac_cv_lib_dmalloc_dmalloc_debug = yes; then
   cat >>confdefs.h <<EOF
@@ -10620,7 +11902,7 @@
 
 fi
 
-echo "$as_me:10623: checking if you want to use dbmalloc for testing" >&5
+echo "$as_me:11905: checking if you want to use dbmalloc for testing" >&5
 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
 
 # Check whether --with-dbmalloc or --without-dbmalloc was given.
@@ -10636,7 +11918,7 @@
 else
   with_dbmalloc=
 fi;
-echo "$as_me:10639: result: ${with_dbmalloc:-no}" >&5
+echo "$as_me:11921: result: ${with_dbmalloc:-no}" >&5
 echo "${ECHO_T}${with_dbmalloc:-no}" >&6
 
 case .$with_cflags in #(vi
@@ -10662,8 +11944,8 @@
 			cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
 
 			test "${cf_add_cflags}" != "${cf_tst_cflags}" \
-			&& test -z "${cf_tst_cflags}" \
-			&& cf_fix_cppflags=yes
+				&& test -z "${cf_tst_cflags}" \
+				&& cf_fix_cppflags=yes
 
 			if test $cf_fix_cppflags = yes ; then
 				cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
@@ -10678,6 +11960,16 @@
 		*$cf_add_cflags) #(vi
 			;;
 		*) #(vi
+			case $cf_add_cflags in #(vi
+			-D*)
+				cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
+
+CPPFLAGS=`echo "$CPPFLAGS" | \
+	sed	-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?[ 	]/ /g' \
+		-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?$//g'`
+
+				;;
+			esac
 			cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
 			;;
 		esac
@@ -10693,8 +11985,8 @@
 	cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
 
 	test "${cf_add_cflags}" != "${cf_tst_cflags}" \
-	&& test -z "${cf_tst_cflags}" \
-	&& cf_fix_cppflags=no
+		&& test -z "${cf_tst_cflags}" \
+		&& cf_fix_cppflags=no
 	;;
 esac
 done
@@ -10706,7 +11998,7 @@
 
 if test -n "$cf_new_cppflags" ; then
 
-	CPPFLAGS="$cf_new_cppflags $CPPFLAGS"
+	CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
 fi
 
 if test -n "$cf_new_extra_cppflags" ; then
@@ -10720,23 +12012,23 @@
 esac
 
 if test "$with_dbmalloc" = yes ; then
-	echo "$as_me:10723: checking for dbmalloc.h" >&5
+	echo "$as_me:12015: checking for dbmalloc.h" >&5
 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
 if test "${ac_cv_header_dbmalloc_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 10729 "configure"
+#line 12021 "configure"
 #include "confdefs.h"
 #include <dbmalloc.h>
 _ACEOF
-if { (eval echo "$as_me:10733: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:12025: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
   egrep -v '^ *\+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:10739: \$? = $ac_status" >&5
+  echo "$as_me:12031: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -10755,11 +12047,11 @@
 fi
 rm -f conftest.err conftest.$ac_ext
 fi
-echo "$as_me:10758: result: $ac_cv_header_dbmalloc_h" >&5
+echo "$as_me:12050: result: $ac_cv_header_dbmalloc_h" >&5
 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
 if test $ac_cv_header_dbmalloc_h = yes; then
 
-echo "$as_me:10762: checking for debug_malloc in -ldbmalloc" >&5
+echo "$as_me:12054: checking for debug_malloc in -ldbmalloc" >&5
 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -10767,7 +12059,7 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-ldbmalloc  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 10770 "configure"
+#line 12062 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -10786,16 +12078,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:10789: \"$ac_link\"") >&5
+if { (eval echo "$as_me:12081: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:10792: \$? = $ac_status" >&5
+  echo "$as_me:12084: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:10795: \"$ac_try\"") >&5
+  { (eval echo "$as_me:12087: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:10798: \$? = $ac_status" >&5
+  echo "$as_me:12090: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_dbmalloc_debug_malloc=yes
 else
@@ -10806,7 +12098,7 @@
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:10809: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
+echo "$as_me:12101: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
 if test $ac_cv_lib_dbmalloc_debug_malloc = yes; then
   cat >>confdefs.h <<EOF
@@ -10821,7 +12113,7 @@
 
 fi
 
-echo "$as_me:10824: checking if you want to use valgrind for testing" >&5
+echo "$as_me:12116: checking if you want to use valgrind for testing" >&5
 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
 
 # Check whether --with-valgrind or --without-valgrind was given.
@@ -10837,7 +12129,7 @@
 else
   with_valgrind=
 fi;
-echo "$as_me:10840: result: ${with_valgrind:-no}" >&5
+echo "$as_me:12132: result: ${with_valgrind:-no}" >&5
 echo "${ECHO_T}${with_valgrind:-no}" >&6
 
 case .$with_cflags in #(vi
@@ -10863,8 +12155,8 @@
 			cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
 
 			test "${cf_add_cflags}" != "${cf_tst_cflags}" \
-			&& test -z "${cf_tst_cflags}" \
-			&& cf_fix_cppflags=yes
+				&& test -z "${cf_tst_cflags}" \
+				&& cf_fix_cppflags=yes
 
 			if test $cf_fix_cppflags = yes ; then
 				cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
@@ -10879,6 +12171,16 @@
 		*$cf_add_cflags) #(vi
 			;;
 		*) #(vi
+			case $cf_add_cflags in #(vi
+			-D*)
+				cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
+
+CPPFLAGS=`echo "$CPPFLAGS" | \
+	sed	-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?[ 	]/ /g' \
+		-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?$//g'`
+
+				;;
+			esac
 			cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
 			;;
 		esac
@@ -10894,8 +12196,8 @@
 	cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
 
 	test "${cf_add_cflags}" != "${cf_tst_cflags}" \
-	&& test -z "${cf_tst_cflags}" \
-	&& cf_fix_cppflags=no
+		&& test -z "${cf_tst_cflags}" \
+		&& cf_fix_cppflags=no
 	;;
 esac
 done
@@ -10907,7 +12209,7 @@
 
 if test -n "$cf_new_cppflags" ; then
 
-	CPPFLAGS="$cf_new_cppflags $CPPFLAGS"
+	CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
 fi
 
 if test -n "$cf_new_extra_cppflags" ; then
@@ -10920,17 +12222,17 @@
 	;;
 esac
 
-echo "$as_me:10923: checking if you want to perform memory-leak testing" >&5
+echo "$as_me:12225: checking if you want to perform memory-leak testing" >&5
 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
 
 # Check whether --enable-leaks or --disable-leaks was given.
 if test "${enable_leaks+set}" = set; then
   enableval="$enable_leaks"
-  with_no_leaks=yes
+  if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
 else
   : ${with_no_leaks:=no}
 fi;
-echo "$as_me:10933: result: $with_no_leaks" >&5
+echo "$as_me:12235: result: $with_no_leaks" >&5
 echo "${ECHO_T}$with_no_leaks" >&6
 
 if test "$with_no_leaks" = yes ; then
@@ -10938,6 +12240,10 @@
 #define NO_LEAKS 1
 EOF
 
+	cat >>confdefs.h <<\EOF
+#define YY_NO_LEAKS 1
+EOF
+
 fi
 
 cat >>confdefs.h <<\EOF
@@ -10975,7 +12281,7 @@
 	;;
 esac
 
-echo "$as_me:10978: checking whether to add trace feature to all models" >&5
+echo "$as_me:12284: checking whether to add trace feature to all models" >&5
 echo $ECHO_N "checking whether to add trace feature to all models... $ECHO_C" >&6
 
 # Check whether --with-trace or --without-trace was given.
@@ -10985,7 +12291,7 @@
 else
   cf_with_trace=$cf_all_traces
 fi;
-echo "$as_me:10988: result: $cf_with_trace" >&5
+echo "$as_me:12294: result: $cf_with_trace" >&5
 echo "${ECHO_T}$cf_with_trace" >&6
 
 if test "$cf_with_trace" = yes ; then
@@ -11008,8 +12314,8 @@
 			cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
 
 			test "${cf_add_cflags}" != "${cf_tst_cflags}" \
-			&& test -z "${cf_tst_cflags}" \
-			&& cf_fix_cppflags=yes
+				&& test -z "${cf_tst_cflags}" \
+				&& cf_fix_cppflags=yes
 
 			if test $cf_fix_cppflags = yes ; then
 				cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
@@ -11024,6 +12330,16 @@
 		*$cf_add_cflags) #(vi
 			;;
 		*) #(vi
+			case $cf_add_cflags in #(vi
+			-D*)
+				cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
+
+CPPFLAGS=`echo "$CPPFLAGS" | \
+	sed	-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?[ 	]/ /g' \
+		-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?$//g'`
+
+				;;
+			esac
 			cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
 			;;
 		esac
@@ -11039,8 +12355,8 @@
 	cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
 
 	test "${cf_add_cflags}" != "${cf_tst_cflags}" \
-	&& test -z "${cf_tst_cflags}" \
-	&& cf_fix_cppflags=no
+		&& test -z "${cf_tst_cflags}" \
+		&& cf_fix_cppflags=no
 	;;
 esac
 done
@@ -11052,7 +12368,7 @@
 
 if test -n "$cf_new_cppflags" ; then
 
-	CPPFLAGS="$cf_new_cppflags $CPPFLAGS"
+	CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
 fi
 
 if test -n "$cf_new_extra_cppflags" ; then
@@ -11066,13 +12382,17 @@
 fi
 
 ###	Checks for libraries.
-echo "$as_me:11069: checking for gettimeofday" >&5
+case $cf_cv_system_name in #(vi
+*mingw32*) #(vi
+	;;
+*)
+echo "$as_me:12389: checking for gettimeofday" >&5
 echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6
 if test "${ac_cv_func_gettimeofday+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 11075 "configure"
+#line 12395 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char gettimeofday (); below.  */
@@ -11103,16 +12423,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:11106: \"$ac_link\"") >&5
+if { (eval echo "$as_me:12426: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:11109: \$? = $ac_status" >&5
+  echo "$as_me:12429: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:11112: \"$ac_try\"") >&5
+  { (eval echo "$as_me:12432: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11115: \$? = $ac_status" >&5
+  echo "$as_me:12435: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_func_gettimeofday=yes
 else
@@ -11122,7 +12442,7 @@
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:11125: result: $ac_cv_func_gettimeofday" >&5
+echo "$as_me:12445: result: $ac_cv_func_gettimeofday" >&5
 echo "${ECHO_T}$ac_cv_func_gettimeofday" >&6
 if test $ac_cv_func_gettimeofday = yes; then
   cat >>confdefs.h <<\EOF
@@ -11131,7 +12451,7 @@
 
 else
 
-echo "$as_me:11134: checking for gettimeofday in -lbsd" >&5
+echo "$as_me:12454: checking for gettimeofday in -lbsd" >&5
 echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6
 if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -11139,7 +12459,7 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lbsd  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 11142 "configure"
+#line 12462 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -11158,16 +12478,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:11161: \"$ac_link\"") >&5
+if { (eval echo "$as_me:12481: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:11164: \$? = $ac_status" >&5
+  echo "$as_me:12484: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:11167: \"$ac_try\"") >&5
+  { (eval echo "$as_me:12487: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11170: \$? = $ac_status" >&5
+  echo "$as_me:12490: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_bsd_gettimeofday=yes
 else
@@ -11178,26 +12498,28 @@
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:11181: result: $ac_cv_lib_bsd_gettimeofday" >&5
+echo "$as_me:12501: result: $ac_cv_lib_bsd_gettimeofday" >&5
 echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6
 if test $ac_cv_lib_bsd_gettimeofday = yes; then
   cat >>confdefs.h <<\EOF
 #define HAVE_GETTIMEOFDAY 1
 EOF
 
-	LIBS="$LIBS -lbsd"
+	LIBS="-lbsd $LIBS"
 fi
 
 fi
+	;;
+esac
 
-echo "$as_me:11193: checking if -lm needed for math functions" >&5
+echo "$as_me:12515: checking if -lm needed for math functions" >&5
 echo $ECHO_N "checking if -lm needed for math functions... $ECHO_C" >&6
 if test "${cf_cv_need_libm+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 	cat >conftest.$ac_ext <<_ACEOF
-#line 11200 "configure"
+#line 12522 "configure"
 #include "confdefs.h"
 
 	#include <stdio.h>
@@ -11212,16 +12534,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:11215: \"$ac_link\"") >&5
+if { (eval echo "$as_me:12537: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:11218: \$? = $ac_status" >&5
+  echo "$as_me:12540: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:11221: \"$ac_try\"") >&5
+  { (eval echo "$as_me:12543: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11224: \$? = $ac_status" >&5
+  echo "$as_me:12546: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_need_libm=no
 else
@@ -11231,7 +12553,7 @@
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:11234: result: $cf_cv_need_libm" >&5
+echo "$as_me:12556: result: $cf_cv_need_libm" >&5
 echo "${ECHO_T}$cf_cv_need_libm" >&6
 if test "$cf_cv_need_libm" = yes
 then
@@ -11239,13 +12561,13 @@
 fi
 
 ###	Checks for header files.
-echo "$as_me:11242: checking for ANSI C header files" >&5
+echo "$as_me:12564: checking for ANSI C header files" >&5
 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
 if test "${ac_cv_header_stdc+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 11248 "configure"
+#line 12570 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -11253,13 +12575,13 @@
 #include <float.h>
 
 _ACEOF
-if { (eval echo "$as_me:11256: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:12578: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
   egrep -v '^ *\+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:11262: \$? = $ac_status" >&5
+  echo "$as_me:12584: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -11281,7 +12603,7 @@
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
   cat >conftest.$ac_ext <<_ACEOF
-#line 11284 "configure"
+#line 12606 "configure"
 #include "confdefs.h"
 #include <string.h>
 
@@ -11292,14 +12614,14 @@
 else
   ac_cv_header_stdc=no
 fi
-rm -f conftest*
+rm -rf conftest*
 
 fi
 
 if test $ac_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
   cat >conftest.$ac_ext <<_ACEOF
-#line 11302 "configure"
+#line 12624 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 
@@ -11310,7 +12632,7 @@
 else
   ac_cv_header_stdc=no
 fi
-rm -f conftest*
+rm -rf conftest*
 
 fi
 
@@ -11320,7 +12642,7 @@
   :
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 11323 "configure"
+#line 12645 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #if ((' ' & 0x0FF) == 0x020)
@@ -11346,15 +12668,15 @@
 }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:11349: \"$ac_link\"") >&5
+if { (eval echo "$as_me:12671: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:11352: \$? = $ac_status" >&5
+  echo "$as_me:12674: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:11354: \"$ac_try\"") >&5
+  { (eval echo "$as_me:12676: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11357: \$? = $ac_status" >&5
+  echo "$as_me:12679: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
@@ -11367,7 +12689,7 @@
 fi
 fi
 fi
-echo "$as_me:11370: result: $ac_cv_header_stdc" >&5
+echo "$as_me:12692: result: $ac_cv_header_stdc" >&5
 echo "${ECHO_T}$ac_cv_header_stdc" >&6
 if test $ac_cv_header_stdc = yes; then
 
@@ -11380,13 +12702,13 @@
 ac_header_dirent=no
 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
   as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
-echo "$as_me:11383: checking for $ac_hdr that defines DIR" >&5
+echo "$as_me:12705: checking for $ac_hdr that defines DIR" >&5
 echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6
 if eval "test \"\${$as_ac_Header+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 11389 "configure"
+#line 12711 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <$ac_hdr>
@@ -11401,16 +12723,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:11404: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:12726: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:11407: \$? = $ac_status" >&5
+  echo "$as_me:12729: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:11410: \"$ac_try\"") >&5
+  { (eval echo "$as_me:12732: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11413: \$? = $ac_status" >&5
+  echo "$as_me:12735: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   eval "$as_ac_Header=yes"
 else
@@ -11420,7 +12742,7 @@
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:11423: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "$as_me:12745: result: `eval echo '${'$as_ac_Header'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
   cat >>confdefs.h <<EOF
@@ -11433,7 +12755,7 @@
 done
 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
 if test $ac_header_dirent = dirent.h; then
-  echo "$as_me:11436: checking for opendir in -ldir" >&5
+  echo "$as_me:12758: checking for opendir in -ldir" >&5
 echo $ECHO_N "checking for opendir in -ldir... $ECHO_C" >&6
 if test "${ac_cv_lib_dir_opendir+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -11441,7 +12763,7 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-ldir  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 11444 "configure"
+#line 12766 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -11460,16 +12782,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:11463: \"$ac_link\"") >&5
+if { (eval echo "$as_me:12785: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:11466: \$? = $ac_status" >&5
+  echo "$as_me:12788: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:11469: \"$ac_try\"") >&5
+  { (eval echo "$as_me:12791: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11472: \$? = $ac_status" >&5
+  echo "$as_me:12794: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_dir_opendir=yes
 else
@@ -11480,14 +12802,14 @@
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:11483: result: $ac_cv_lib_dir_opendir" >&5
+echo "$as_me:12805: result: $ac_cv_lib_dir_opendir" >&5
 echo "${ECHO_T}$ac_cv_lib_dir_opendir" >&6
 if test $ac_cv_lib_dir_opendir = yes; then
   LIBS="$LIBS -ldir"
 fi
 
 else
-  echo "$as_me:11490: checking for opendir in -lx" >&5
+  echo "$as_me:12812: checking for opendir in -lx" >&5
 echo $ECHO_N "checking for opendir in -lx... $ECHO_C" >&6
 if test "${ac_cv_lib_x_opendir+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -11495,7 +12817,7 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lx  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 11498 "configure"
+#line 12820 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -11514,16 +12836,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:11517: \"$ac_link\"") >&5
+if { (eval echo "$as_me:12839: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:11520: \$? = $ac_status" >&5
+  echo "$as_me:12842: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:11523: \"$ac_try\"") >&5
+  { (eval echo "$as_me:12845: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11526: \$? = $ac_status" >&5
+  echo "$as_me:12848: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_x_opendir=yes
 else
@@ -11534,7 +12856,7 @@
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:11537: result: $ac_cv_lib_x_opendir" >&5
+echo "$as_me:12859: result: $ac_cv_lib_x_opendir" >&5
 echo "${ECHO_T}$ac_cv_lib_x_opendir" >&6
 if test $ac_cv_lib_x_opendir = yes; then
   LIBS="$LIBS -lx"
@@ -11542,13 +12864,13 @@
 
 fi
 
-echo "$as_me:11545: checking whether time.h and sys/time.h may both be included" >&5
+echo "$as_me:12867: checking whether time.h and sys/time.h may both be included" >&5
 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
 if test "${ac_cv_header_time+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 11551 "configure"
+#line 12873 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/time.h>
@@ -11564,16 +12886,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:11567: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:12889: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:11570: \$? = $ac_status" >&5
+  echo "$as_me:12892: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:11573: \"$ac_try\"") >&5
+  { (eval echo "$as_me:12895: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11576: \$? = $ac_status" >&5
+  echo "$as_me:12898: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_header_time=yes
 else
@@ -11583,7 +12905,7 @@
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:11586: result: $ac_cv_header_time" >&5
+echo "$as_me:12908: result: $ac_cv_header_time" >&5
 echo "${ECHO_T}$ac_cv_header_time" >&6
 if test $ac_cv_header_time = yes; then
 
@@ -11593,134 +12915,378 @@
 
 fi
 
-echo "$as_me:11596: checking for regular-expression headers" >&5
-echo $ECHO_N "checking for regular-expression headers... $ECHO_C" >&6
-if test "${cf_cv_regex+set}" = set; then
+cf_regex_func=no
+
+cf_regex_libs="regex re"
+case $host_os in #(vi
+mingw*)
+	cf_regex_libs="regex.dll $cf_regex_libs"
+	;;
+esac
+
+echo "$as_me:12927: checking for regcomp" >&5
+echo $ECHO_N "checking for regcomp... $ECHO_C" >&6
+if test "${ac_cv_func_regcomp+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-
-cat >conftest.$ac_ext <<_ACEOF
-#line 11603 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 12933 "configure"
 #include "confdefs.h"
-#include <sys/types.h>
-#include <regex.h>
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char regcomp (); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char regcomp ();
+char (*f) ();
+
 int
 main ()
 {
-
-	regex_t *p;
-	int x = regcomp(p, "", 0);
-	int y = regexec(p, "", 0, 0, 0);
-	regfree(p);
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_regcomp) || defined (__stub___regcomp)
+choke me
+#else
+f = regcomp;
+#endif
 
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:11621: \"$ac_link\"") >&5
+if { (eval echo "$as_me:12964: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:11624: \$? = $ac_status" >&5
+  echo "$as_me:12967: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:11627: \"$ac_try\"") >&5
+  { (eval echo "$as_me:12970: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11630: \$? = $ac_status" >&5
+  echo "$as_me:12973: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  cf_cv_regex="regex.h"
+  ac_cv_func_regcomp=yes
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
+ac_cv_func_regcomp=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:12983: result: $ac_cv_func_regcomp" >&5
+echo "${ECHO_T}$ac_cv_func_regcomp" >&6
+if test $ac_cv_func_regcomp = yes; then
+  cf_regex_func=regcomp
+else
 
-	cat >conftest.$ac_ext <<_ACEOF
-#line 11638 "configure"
+	for cf_regex_lib in $cf_regex_libs
+	do
+		as_ac_Lib=`echo "ac_cv_lib_$cf_regex_lib''_regcomp" | $as_tr_sh`
+echo "$as_me:12992: checking for regcomp in -l$cf_regex_lib" >&5
+echo $ECHO_N "checking for regcomp in -l$cf_regex_lib... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Lib+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-l$cf_regex_lib  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line 13000 "configure"
 #include "confdefs.h"
-#include <regexp.h>
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char regcomp ();
 int
 main ()
 {
-
-		char *p = compile("", "", "", 0);
-		int x = step("", "");
-
+regcomp ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:11653: \"$ac_link\"") >&5
+if { (eval echo "$as_me:13019: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:11656: \$? = $ac_status" >&5
+  echo "$as_me:13022: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:11659: \"$ac_try\"") >&5
+  { (eval echo "$as_me:13025: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11662: \$? = $ac_status" >&5
+  echo "$as_me:13028: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  cf_cv_regex="regexp.h"
+  eval "$as_ac_Lib=yes"
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
+eval "$as_ac_Lib=no"
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:13039: result: `eval echo '${'$as_ac_Lib'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
+if test `eval echo '${'$as_ac_Lib'}'` = yes; then
+
+				LIBS="-l$cf_regex_lib $LIBS"
+				cf_regex_func=regcomp
+				break
+fi
 
-		cf_save_LIBS="$LIBS"
-		LIBS="-lgen $LIBS"
-		cat >conftest.$ac_ext <<_ACEOF
-#line 11672 "configure"
+	done
+
+fi
+
+if test "$cf_regex_func" = no ; then
+	echo "$as_me:13053: checking for compile" >&5
+echo $ECHO_N "checking for compile... $ECHO_C" >&6
+if test "${ac_cv_func_compile+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 13059 "configure"
 #include "confdefs.h"
-#include <regexpr.h>
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char compile (); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char compile ();
+char (*f) ();
+
 int
 main ()
 {
-
-			char *p = compile("", "", "");
-			int x = step("", "");
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_compile) || defined (__stub___compile)
+choke me
+#else
+f = compile;
+#endif
 
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:11687: \"$ac_link\"") >&5
+if { (eval echo "$as_me:13090: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:11690: \$? = $ac_status" >&5
+  echo "$as_me:13093: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:11693: \"$ac_try\"") >&5
+  { (eval echo "$as_me:13096: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11696: \$? = $ac_status" >&5
+  echo "$as_me:13099: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  cf_cv_regex="regexpr.h"
+  ac_cv_func_compile=yes
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-LIBS="$cf_save_LIBS"
-fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+ac_cv_func_compile=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+echo "$as_me:13109: result: $ac_cv_func_compile" >&5
+echo "${ECHO_T}$ac_cv_func_compile" >&6
+if test $ac_cv_func_compile = yes; then
+  cf_regex_func=compile
+else
+
+		echo "$as_me:13115: checking for compile in -lgen" >&5
+echo $ECHO_N "checking for compile in -lgen... $ECHO_C" >&6
+if test "${ac_cv_lib_gen_compile+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lgen  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line 13123 "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char compile ();
+int
+main ()
+{
+compile ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:13142: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:13145: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:13148: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:13151: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_gen_compile=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_gen_compile=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:13162: result: $ac_cv_lib_gen_compile" >&5
+echo "${ECHO_T}$ac_cv_lib_gen_compile" >&6
+if test $ac_cv_lib_gen_compile = yes; then
+
+				LIBS="-lgen $LIBS"
+				cf_regex_func=compile
+fi
+
+fi
+
+fi
+
+if test "$cf_regex_func" = no ; then
+	{ echo "$as_me:13175: WARNING: cannot find regular expression library" >&5
+echo "$as_me: WARNING: cannot find regular expression library" >&2;}
+fi
+
+echo "$as_me:13179: checking for regular-expression headers" >&5
+echo $ECHO_N "checking for regular-expression headers... $ECHO_C" >&6
+if test "${cf_cv_regex_hdrs+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+cf_cv_regex_hdrs=no
+case $cf_regex_func in #(vi
+compile) #(vi
+	for cf_regex_hdr in regexp.h regexpr.h
+	do
+		cat >conftest.$ac_ext <<_ACEOF
+#line 13191 "configure"
+#include "confdefs.h"
+#include <$cf_regex_hdr>
+int
+main ()
+{
+
+			char *p = compile("", "", "", 0);
+			int x = step("", "");
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:13206: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:13209: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:13212: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:13215: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+
+			cf_cv_regex_hdrs=$cf_regex_hdr
+			break
+
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+	done
+	;;
+*)
+	for cf_regex_hdr in regex.h
+	do
+		cat >conftest.$ac_ext <<_ACEOF
+#line 13232 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <$cf_regex_hdr>
+int
+main ()
+{
+
+			regex_t *p;
+			int x = regcomp(p, "", 0);
+			int y = regexec(p, "", 0, 0, 0);
+			regfree(p);
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:13250: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:13253: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:13256: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:13259: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+
+			cf_cv_regex_hdrs=$cf_regex_hdr
+			break
+
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+	done
+	;;
+esac
 
 fi
+echo "$as_me:13275: result: $cf_cv_regex_hdrs" >&5
+echo "${ECHO_T}$cf_cv_regex_hdrs" >&6
 
-echo "$as_me:11712: result: $cf_cv_regex" >&5
-echo "${ECHO_T}$cf_cv_regex" >&6
-case $cf_cv_regex in
-	regex.h)   cat >>confdefs.h <<\EOF
+case $cf_cv_regex_hdrs in #(vi
+    no)	       { echo "$as_me:13279: WARNING: no regular expression header found" >&5
+echo "$as_me: WARNING: no regular expression header found" >&2;} ;; #(vi
+    regex.h)   cat >>confdefs.h <<\EOF
 #define HAVE_REGEX_H_FUNCS 1
 EOF
- ;;
-	regexp.h)  cat >>confdefs.h <<\EOF
+ ;; #(vi
+    regexp.h)  cat >>confdefs.h <<\EOF
 #define HAVE_REGEXP_H_FUNCS 1
 EOF
- ;;
-	regexpr.h) cat >>confdefs.h <<\EOF
+ ;; #(vi
+    regexpr.h) cat >>confdefs.h <<\EOF
 #define HAVE_REGEXPR_H_FUNCS 1
 EOF
  ;;
@@ -11745,23 +13311,23 @@
 
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-echo "$as_me:11748: checking for $ac_header" >&5
+echo "$as_me:13314: checking for $ac_header" >&5
 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
 if eval "test \"\${$as_ac_Header+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 11754 "configure"
+#line 13320 "configure"
 #include "confdefs.h"
 #include <$ac_header>
 _ACEOF
-if { (eval echo "$as_me:11758: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:13324: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
   egrep -v '^ *\+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:11764: \$? = $ac_status" >&5
+  echo "$as_me:13330: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -11780,7 +13346,7 @@
 fi
 rm -f conftest.err conftest.$ac_ext
 fi
-echo "$as_me:11783: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "$as_me:13349: result: `eval echo '${'$as_ac_Header'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
   cat >>confdefs.h <<EOF
@@ -11794,7 +13360,7 @@
 # Note: even non-Posix ISC needs <sys/bsdtypes.h> to declare fd_set
 if test "$ISC" = yes ; then
 
-echo "$as_me:11797: checking for main in -lcposix" >&5
+echo "$as_me:13363: checking for main in -lcposix" >&5
 echo $ECHO_N "checking for main in -lcposix... $ECHO_C" >&6
 if test "${ac_cv_lib_cposix_main+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -11802,7 +13368,7 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lcposix  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 11805 "configure"
+#line 13371 "configure"
 #include "confdefs.h"
 
 int
@@ -11814,16 +13380,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:11817: \"$ac_link\"") >&5
+if { (eval echo "$as_me:13383: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:11820: \$? = $ac_status" >&5
+  echo "$as_me:13386: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:11823: \"$ac_try\"") >&5
+  { (eval echo "$as_me:13389: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11826: \$? = $ac_status" >&5
+  echo "$as_me:13392: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_cposix_main=yes
 else
@@ -11834,7 +13400,7 @@
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:11837: result: $ac_cv_lib_cposix_main" >&5
+echo "$as_me:13403: result: $ac_cv_lib_cposix_main" >&5
 echo "${ECHO_T}$ac_cv_lib_cposix_main" >&6
 if test $ac_cv_lib_cposix_main = yes; then
   cat >>confdefs.h <<EOF
@@ -11845,7 +13411,7 @@
 
 fi
 
-	echo "$as_me:11848: checking for bzero in -linet" >&5
+	echo "$as_me:13414: checking for bzero in -linet" >&5
 echo $ECHO_N "checking for bzero in -linet... $ECHO_C" >&6
 if test "${ac_cv_lib_inet_bzero+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -11853,7 +13419,7 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-linet  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 11856 "configure"
+#line 13422 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -11872,16 +13438,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:11875: \"$ac_link\"") >&5
+if { (eval echo "$as_me:13441: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:11878: \$? = $ac_status" >&5
+  echo "$as_me:13444: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:11881: \"$ac_try\"") >&5
+  { (eval echo "$as_me:13447: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11884: \$? = $ac_status" >&5
+  echo "$as_me:13450: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_inet_bzero=yes
 else
@@ -11892,21 +13458,21 @@
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:11895: result: $ac_cv_lib_inet_bzero" >&5
+echo "$as_me:13461: result: $ac_cv_lib_inet_bzero" >&5
 echo "${ECHO_T}$ac_cv_lib_inet_bzero" >&6
 if test $ac_cv_lib_inet_bzero = yes; then
-  LIBS="$LIBS -linet"
+  LIBS="-linet $LIBS"
 fi
 fi
 
-echo "$as_me:11902: checking if sys/time.h works with sys/select.h" >&5
+echo "$as_me:13468: checking if sys/time.h works with sys/select.h" >&5
 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
 if test "${cf_cv_sys_time_select+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 cat >conftest.$ac_ext <<_ACEOF
-#line 11909 "configure"
+#line 13475 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -11926,16 +13492,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:11929: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:13495: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:11932: \$? = $ac_status" >&5
+  echo "$as_me:13498: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:11935: \"$ac_try\"") >&5
+  { (eval echo "$as_me:13501: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11938: \$? = $ac_status" >&5
+  echo "$as_me:13504: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_sys_time_select=yes
 else
@@ -11947,7 +13513,7 @@
 
 fi
 
-echo "$as_me:11950: result: $cf_cv_sys_time_select" >&5
+echo "$as_me:13516: result: $cf_cv_sys_time_select" >&5
 echo "${ECHO_T}$cf_cv_sys_time_select" >&6
 test "$cf_cv_sys_time_select" = yes && cat >>confdefs.h <<\EOF
 #define HAVE_SYS_TIME_SELECT 1
@@ -11961,7 +13527,7 @@
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 ac_main_return=return
 
-echo "$as_me:11964: checking for $CC option to accept ANSI C" >&5
+echo "$as_me:13530: checking for $CC option to accept ANSI C" >&5
 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
 if test "${ac_cv_prog_cc_stdc+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -11969,7 +13535,7 @@
   ac_cv_prog_cc_stdc=no
 ac_save_CC=$CC
 cat >conftest.$ac_ext <<_ACEOF
-#line 11972 "configure"
+#line 13538 "configure"
 #include "confdefs.h"
 #include <stdarg.h>
 #include <stdio.h>
@@ -12018,16 +13584,16 @@
 do
   CC="$ac_save_CC $ac_arg"
   rm -f conftest.$ac_objext
-if { (eval echo "$as_me:12021: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:13587: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:12024: \$? = $ac_status" >&5
+  echo "$as_me:13590: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:12027: \"$ac_try\"") >&5
+  { (eval echo "$as_me:13593: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:12030: \$? = $ac_status" >&5
+  echo "$as_me:13596: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_prog_cc_stdc=$ac_arg
 break
@@ -12044,21 +13610,21 @@
 
 case "x$ac_cv_prog_cc_stdc" in
   x|xno)
-    echo "$as_me:12047: result: none needed" >&5
+    echo "$as_me:13613: result: none needed" >&5
 echo "${ECHO_T}none needed" >&6 ;;
   *)
-    echo "$as_me:12050: result: $ac_cv_prog_cc_stdc" >&5
+    echo "$as_me:13616: result: $ac_cv_prog_cc_stdc" >&5
 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
     CC="$CC $ac_cv_prog_cc_stdc" ;;
 esac
 
-echo "$as_me:12055: checking for an ANSI C-conforming const" >&5
+echo "$as_me:13621: checking for an ANSI C-conforming const" >&5
 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
 if test "${ac_cv_c_const+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 12061 "configure"
+#line 13627 "configure"
 #include "confdefs.h"
 
 int
@@ -12116,16 +13682,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:12119: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:13685: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:12122: \$? = $ac_status" >&5
+  echo "$as_me:13688: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:12125: \"$ac_try\"") >&5
+  { (eval echo "$as_me:13691: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:12128: \$? = $ac_status" >&5
+  echo "$as_me:13694: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_c_const=yes
 else
@@ -12135,7 +13701,7 @@
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:12138: result: $ac_cv_c_const" >&5
+echo "$as_me:13704: result: $ac_cv_c_const" >&5
 echo "${ECHO_T}$ac_cv_c_const" >&6
 if test $ac_cv_c_const = no; then
 
@@ -12145,7 +13711,7 @@
 
 fi
 
-echo "$as_me:12148: checking for inline" >&5
+echo "$as_me:13714: checking for inline" >&5
 echo $ECHO_N "checking for inline... $ECHO_C" >&6
 if test "${ac_cv_c_inline+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -12153,7 +13719,7 @@
   ac_cv_c_inline=no
 for ac_kw in inline __inline__ __inline; do
   cat >conftest.$ac_ext <<_ACEOF
-#line 12156 "configure"
+#line 13722 "configure"
 #include "confdefs.h"
 #ifndef __cplusplus
 static $ac_kw int static_foo () {return 0; }
@@ -12162,16 +13728,16 @@
 
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:12165: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:13731: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:12168: \$? = $ac_status" >&5
+  echo "$as_me:13734: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:12171: \"$ac_try\"") >&5
+  { (eval echo "$as_me:13737: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:12174: \$? = $ac_status" >&5
+  echo "$as_me:13740: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_c_inline=$ac_kw; break
 else
@@ -12182,7 +13748,7 @@
 done
 
 fi
-echo "$as_me:12185: result: $ac_cv_c_inline" >&5
+echo "$as_me:13751: result: $ac_cv_c_inline" >&5
 echo "${ECHO_T}$ac_cv_c_inline" >&6
 case $ac_cv_c_inline in
   inline | yes) ;;
@@ -12205,8 +13771,8 @@
     :
   elif test "$GCC" = yes
   then
-    echo "$as_me:12208: checking if gcc supports options to tune inlining" >&5
-echo $ECHO_N "checking if gcc supports options to tune inlining... $ECHO_C" >&6
+    echo "$as_me:13774: checking if $CC supports options to tune inlining" >&5
+echo $ECHO_N "checking if $CC supports options to tune inlining... $ECHO_C" >&6
 if test "${cf_cv_gcc_inline+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -12214,7 +13780,7 @@
       cf_save_CFLAGS=$CFLAGS
       CFLAGS="$CFLAGS --param max-inline-insns-single=1200"
       cat >conftest.$ac_ext <<_ACEOF
-#line 12217 "configure"
+#line 13783 "configure"
 #include "confdefs.h"
 inline int foo(void) { return 1; }
 int
@@ -12226,16 +13792,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:12229: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:13795: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:12232: \$? = $ac_status" >&5
+  echo "$as_me:13798: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:12235: \"$ac_try\"") >&5
+  { (eval echo "$as_me:13801: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:12238: \$? = $ac_status" >&5
+  echo "$as_me:13804: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_gcc_inline=yes
 else
@@ -12247,7 +13813,7 @@
       CFLAGS=$cf_save_CFLAGS
 
 fi
-echo "$as_me:12250: result: $cf_cv_gcc_inline" >&5
+echo "$as_me:13816: result: $cf_cv_gcc_inline" >&5
 echo "${ECHO_T}$cf_cv_gcc_inline" >&6
     if test "$cf_cv_gcc_inline" = yes ; then
 
@@ -12267,8 +13833,8 @@
 			cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
 
 			test "${cf_add_cflags}" != "${cf_tst_cflags}" \
-			&& test -z "${cf_tst_cflags}" \
-			&& cf_fix_cppflags=yes
+				&& test -z "${cf_tst_cflags}" \
+				&& cf_fix_cppflags=yes
 
 			if test $cf_fix_cppflags = yes ; then
 				cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
@@ -12283,6 +13849,16 @@
 		*$cf_add_cflags) #(vi
 			;;
 		*) #(vi
+			case $cf_add_cflags in #(vi
+			-D*)
+				cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
+
+CPPFLAGS=`echo "$CPPFLAGS" | \
+	sed	-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?[ 	]/ /g' \
+		-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?$//g'`
+
+				;;
+			esac
 			cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
 			;;
 		esac
@@ -12298,8 +13874,8 @@
 	cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
 
 	test "${cf_add_cflags}" != "${cf_tst_cflags}" \
-	&& test -z "${cf_tst_cflags}" \
-	&& cf_fix_cppflags=no
+		&& test -z "${cf_tst_cflags}" \
+		&& cf_fix_cppflags=no
 	;;
 esac
 done
@@ -12311,7 +13887,7 @@
 
 if test -n "$cf_new_cppflags" ; then
 
-	CPPFLAGS="$cf_new_cppflags $CPPFLAGS"
+	CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
 fi
 
 if test -n "$cf_new_extra_cppflags" ; then
@@ -12323,7 +13899,7 @@
   fi
 fi
 
-echo "$as_me:12326: checking for signal global datatype" >&5
+echo "$as_me:13902: checking for signal global datatype" >&5
 echo $ECHO_N "checking for signal global datatype... $ECHO_C" >&6
 if test "${cf_cv_sig_atomic_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -12335,7 +13911,7 @@
 		"int"
 	do
 	cat >conftest.$ac_ext <<_ACEOF
-#line 12338 "configure"
+#line 13914 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -12358,16 +13934,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:12361: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:13937: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:12364: \$? = $ac_status" >&5
+  echo "$as_me:13940: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:12367: \"$ac_try\"") >&5
+  { (eval echo "$as_me:13943: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:12370: \$? = $ac_status" >&5
+  echo "$as_me:13946: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_sig_atomic_t=$cf_type
 else
@@ -12381,7 +13957,7 @@
 
 fi
 
-echo "$as_me:12384: result: $cf_cv_sig_atomic_t" >&5
+echo "$as_me:13960: result: $cf_cv_sig_atomic_t" >&5
 echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6
 test "$cf_cv_sig_atomic_t" != no && cat >>confdefs.h <<EOF
 #define SIG_ATOMIC_T $cf_cv_sig_atomic_t
@@ -12389,7 +13965,7 @@
 
 if test $NCURSES_CHTYPE = auto ; then
 
-echo "$as_me:12392: checking for type of chtype" >&5
+echo "$as_me:13968: checking for type of chtype" >&5
 echo $ECHO_N "checking for type of chtype... $ECHO_C" >&6
 if test "${cf_cv_typeof_chtype+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -12399,7 +13975,7 @@
   cf_cv_typeof_chtype=long
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 12402 "configure"
+#line 13978 "configure"
 #include "confdefs.h"
 
 #define WANT_BITS 31
@@ -12434,15 +14010,15 @@
 
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:12437: \"$ac_link\"") >&5
+if { (eval echo "$as_me:14013: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:12440: \$? = $ac_status" >&5
+  echo "$as_me:14016: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:12442: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14018: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:12445: \$? = $ac_status" >&5
+  echo "$as_me:14021: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_typeof_chtype=`cat cf_test.out`
 else
@@ -12457,7 +14033,7 @@
 
 fi
 
-echo "$as_me:12460: result: $cf_cv_typeof_chtype" >&5
+echo "$as_me:14036: result: $cf_cv_typeof_chtype" >&5
 echo "${ECHO_T}$cf_cv_typeof_chtype" >&6
 
 cat >>confdefs.h <<EOF
@@ -12469,14 +14045,14 @@
 fi
 test "$cf_cv_typeof_chtype" = unsigned && cf_cv_typeof_chtype=""
 
-echo "$as_me:12472: checking if unsigned literals are legal" >&5
+echo "$as_me:14048: checking if unsigned literals are legal" >&5
 echo $ECHO_N "checking if unsigned literals are legal... $ECHO_C" >&6
 if test "${cf_cv_unsigned_literals+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 	cat >conftest.$ac_ext <<_ACEOF
-#line 12479 "configure"
+#line 14055 "configure"
 #include "confdefs.h"
 
 int
@@ -12488,16 +14064,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:12491: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:14067: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:12494: \$? = $ac_status" >&5
+  echo "$as_me:14070: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:12497: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14073: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:12500: \$? = $ac_status" >&5
+  echo "$as_me:14076: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_unsigned_literals=yes
 else
@@ -12509,7 +14085,7 @@
 
 fi
 
-echo "$as_me:12512: result: $cf_cv_unsigned_literals" >&5
+echo "$as_me:14088: result: $cf_cv_unsigned_literals" >&5
 echo "${ECHO_T}$cf_cv_unsigned_literals" >&6
 
 cf_cv_1UL="1"
@@ -12525,14 +14101,14 @@
 
 ###	Checks for external-data
 
-echo "$as_me:12528: checking if external errno is declared" >&5
+echo "$as_me:14104: checking if external errno is declared" >&5
 echo $ECHO_N "checking if external errno is declared... $ECHO_C" >&6
 if test "${cf_cv_dcl_errno+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
     cat >conftest.$ac_ext <<_ACEOF
-#line 12535 "configure"
+#line 14111 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_STDLIB_H
@@ -12550,16 +14126,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:12553: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:14129: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:12556: \$? = $ac_status" >&5
+  echo "$as_me:14132: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:12559: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14135: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:12562: \$? = $ac_status" >&5
+  echo "$as_me:14138: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_dcl_errno=yes
 else
@@ -12570,7 +14146,7 @@
 rm -f conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:12573: result: $cf_cv_dcl_errno" >&5
+echo "$as_me:14149: result: $cf_cv_dcl_errno" >&5
 echo "${ECHO_T}$cf_cv_dcl_errno" >&6
 
 if test "$cf_cv_dcl_errno" = no ; then
@@ -12585,14 +14161,14 @@
 
 # It's possible (for near-UNIX clones) that the data doesn't exist
 
-echo "$as_me:12588: checking if external errno exists" >&5
+echo "$as_me:14164: checking if external errno exists" >&5
 echo $ECHO_N "checking if external errno exists... $ECHO_C" >&6
 if test "${cf_cv_have_errno+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
     cat >conftest.$ac_ext <<_ACEOF
-#line 12595 "configure"
+#line 14171 "configure"
 #include "confdefs.h"
 
 #undef errno
@@ -12607,16 +14183,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:12610: \"$ac_link\"") >&5
+if { (eval echo "$as_me:14186: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:12613: \$? = $ac_status" >&5
+  echo "$as_me:14189: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:12616: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14192: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:12619: \$? = $ac_status" >&5
+  echo "$as_me:14195: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_have_errno=yes
 else
@@ -12627,7 +14203,7 @@
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 
 fi
-echo "$as_me:12630: result: $cf_cv_have_errno" >&5
+echo "$as_me:14206: result: $cf_cv_have_errno" >&5
 echo "${ECHO_T}$cf_cv_have_errno" >&6
 
 if test "$cf_cv_have_errno" = yes ; then
@@ -12640,7 +14216,7 @@
 
 fi
 
-echo "$as_me:12643: checking if data-only library module links" >&5
+echo "$as_me:14219: checking if data-only library module links" >&5
 echo $ECHO_N "checking if data-only library module links... $ECHO_C" >&6
 if test "${cf_cv_link_dataonly+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -12648,20 +14224,20 @@
 
 	rm -f conftest.a
 	cat >conftest.$ac_ext <<EOF
-#line 12651 "configure"
+#line 14227 "configure"
 int	testdata[3] = { 123, 456, 789 };
 EOF
-	if { (eval echo "$as_me:12654: \"$ac_compile\"") >&5
+	if { (eval echo "$as_me:14230: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:12657: \$? = $ac_status" >&5
+  echo "$as_me:14233: \$? = $ac_status" >&5
   (exit $ac_status); } ; then
 		mv conftest.o data.o && \
-		( $AR $AR_OPTS conftest.a data.o ) 2>&5 1>/dev/null
+		( $AR $ARFLAGS conftest.a data.o ) 2>&5 1>/dev/null
 	fi
 	rm -f conftest.$ac_ext data.o
 	cat >conftest.$ac_ext <<EOF
-#line 12664 "configure"
+#line 14240 "configure"
 int	testfunc()
 {
 #if defined(NeXT)
@@ -12674,13 +14250,13 @@
 #endif
 }
 EOF
-	if { (eval echo "$as_me:12677: \"$ac_compile\"") >&5
+	if { (eval echo "$as_me:14253: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:12680: \$? = $ac_status" >&5
+  echo "$as_me:14256: \$? = $ac_status" >&5
   (exit $ac_status); }; then
 		mv conftest.o func.o && \
-		( $AR $AR_OPTS conftest.a func.o ) 2>&5 1>/dev/null
+		( $AR $ARFLAGS conftest.a func.o ) 2>&5 1>/dev/null
 	fi
 	rm -f conftest.$ac_ext func.o
 	( eval $RANLIB conftest.a ) 2>&5 >/dev/null
@@ -12690,7 +14266,7 @@
   cf_cv_link_dataonly=unknown
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 12693 "configure"
+#line 14269 "configure"
 #include "confdefs.h"
 
 	int main()
@@ -12701,15 +14277,15 @@
 
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:12704: \"$ac_link\"") >&5
+if { (eval echo "$as_me:14280: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:12707: \$? = $ac_status" >&5
+  echo "$as_me:14283: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:12709: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14285: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:12712: \$? = $ac_status" >&5
+  echo "$as_me:14288: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_link_dataonly=yes
 else
@@ -12724,7 +14300,7 @@
 
 fi
 
-echo "$as_me:12727: result: $cf_cv_link_dataonly" >&5
+echo "$as_me:14303: result: $cf_cv_link_dataonly" >&5
 echo "${ECHO_T}$cf_cv_link_dataonly" >&6
 
 if test "$cf_cv_link_dataonly" = no ; then
@@ -12759,13 +14335,13 @@
 
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:12762: checking for $ac_func" >&5
+echo "$as_me:14338: checking for $ac_func" >&5
 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
 if eval "test \"\${$as_ac_var+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 12768 "configure"
+#line 14344 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func (); below.  */
@@ -12796,16 +14372,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:12799: \"$ac_link\"") >&5
+if { (eval echo "$as_me:14375: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:12802: \$? = $ac_status" >&5
+  echo "$as_me:14378: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:12805: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14381: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:12808: \$? = $ac_status" >&5
+  echo "$as_me:14384: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   eval "$as_ac_var=yes"
 else
@@ -12815,7 +14391,7 @@
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:12818: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "$as_me:14394: result: `eval echo '${'$as_ac_var'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<EOF
@@ -12827,14 +14403,14 @@
 
 if test "$with_getcap" = "yes" ; then
 
-echo "$as_me:12830: checking for terminal-capability database functions" >&5
+echo "$as_me:14406: checking for terminal-capability database functions" >&5
 echo $ECHO_N "checking for terminal-capability database functions... $ECHO_C" >&6
 if test "${cf_cv_cgetent+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 cat >conftest.$ac_ext <<_ACEOF
-#line 12837 "configure"
+#line 14413 "configure"
 #include "confdefs.h"
 
 #include <stdlib.h>
@@ -12854,16 +14430,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:12857: \"$ac_link\"") >&5
+if { (eval echo "$as_me:14433: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:12860: \$? = $ac_status" >&5
+  echo "$as_me:14436: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:12863: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14439: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:12866: \$? = $ac_status" >&5
+  echo "$as_me:14442: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_cgetent=yes
 else
@@ -12875,7 +14451,7 @@
 
 fi
 
-echo "$as_me:12878: result: $cf_cv_cgetent" >&5
+echo "$as_me:14454: result: $cf_cv_cgetent" >&5
 echo "${ECHO_T}$cf_cv_cgetent" >&6
 test "$cf_cv_cgetent" = yes && cat >>confdefs.h <<\EOF
 #define HAVE_BSD_CGETENT 1
@@ -12883,14 +14459,14 @@
 
 fi
 
-echo "$as_me:12886: checking for isascii" >&5
+echo "$as_me:14462: checking for isascii" >&5
 echo $ECHO_N "checking for isascii... $ECHO_C" >&6
 if test "${cf_cv_have_isascii+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 	cat >conftest.$ac_ext <<_ACEOF
-#line 12893 "configure"
+#line 14469 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 int
@@ -12902,16 +14478,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:12905: \"$ac_link\"") >&5
+if { (eval echo "$as_me:14481: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:12908: \$? = $ac_status" >&5
+  echo "$as_me:14484: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:12911: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14487: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:12914: \$? = $ac_status" >&5
+  echo "$as_me:14490: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_have_isascii=yes
 else
@@ -12922,17 +14498,17 @@
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 
 fi
-echo "$as_me:12925: result: $cf_cv_have_isascii" >&5
+echo "$as_me:14501: result: $cf_cv_have_isascii" >&5
 echo "${ECHO_T}$cf_cv_have_isascii" >&6
 test "$cf_cv_have_isascii" = yes && cat >>confdefs.h <<\EOF
 #define HAVE_ISASCII 1
 EOF
 
 if test "$ac_cv_func_sigaction" = yes; then
-echo "$as_me:12932: checking whether sigaction needs _POSIX_SOURCE" >&5
+echo "$as_me:14508: checking whether sigaction needs _POSIX_SOURCE" >&5
 echo $ECHO_N "checking whether sigaction needs _POSIX_SOURCE... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
-#line 12935 "configure"
+#line 14511 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -12946,16 +14522,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:12949: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:14525: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:12952: \$? = $ac_status" >&5
+  echo "$as_me:14528: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:12955: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14531: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:12958: \$? = $ac_status" >&5
+  echo "$as_me:14534: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   sigact_bad=no
 else
@@ -12963,7 +14539,7 @@
 cat conftest.$ac_ext >&5
 
 cat >conftest.$ac_ext <<_ACEOF
-#line 12966 "configure"
+#line 14542 "configure"
 #include "confdefs.h"
 
 #define _POSIX_SOURCE
@@ -12978,16 +14554,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:12981: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:14557: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:12984: \$? = $ac_status" >&5
+  echo "$as_me:14560: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:12987: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14563: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:12990: \$? = $ac_status" >&5
+  echo "$as_me:14566: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   sigact_bad=yes
 	 cat >>confdefs.h <<\EOF
@@ -13002,11 +14578,11 @@
 rm -f conftest.$ac_objext conftest.$ac_ext
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:13005: result: $sigact_bad" >&5
+echo "$as_me:14581: result: $sigact_bad" >&5
 echo "${ECHO_T}$sigact_bad" >&6
 fi
 
-echo "$as_me:13009: checking if nanosleep really works" >&5
+echo "$as_me:14585: checking if nanosleep really works" >&5
 echo $ECHO_N "checking if nanosleep really works... $ECHO_C" >&6
 if test "${cf_cv_func_nanosleep+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -13016,7 +14592,7 @@
   cf_cv_func_nanosleep=unknown
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 13019 "configure"
+#line 14595 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -13041,15 +14617,15 @@
 
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:13044: \"$ac_link\"") >&5
+if { (eval echo "$as_me:14620: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:13047: \$? = $ac_status" >&5
+  echo "$as_me:14623: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:13049: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14625: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:13052: \$? = $ac_status" >&5
+  echo "$as_me:14628: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_func_nanosleep=yes
 else
@@ -13061,7 +14637,7 @@
 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 fi
-echo "$as_me:13064: result: $cf_cv_func_nanosleep" >&5
+echo "$as_me:14640: result: $cf_cv_func_nanosleep" >&5
 echo "${ECHO_T}$cf_cv_func_nanosleep" >&6
 
 test "$cf_cv_func_nanosleep" = "yes" && cat >>confdefs.h <<\EOF
@@ -13075,23 +14651,23 @@
 
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-echo "$as_me:13078: checking for $ac_header" >&5
+echo "$as_me:14654: checking for $ac_header" >&5
 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
 if eval "test \"\${$as_ac_Header+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 13084 "configure"
+#line 14660 "configure"
 #include "confdefs.h"
 #include <$ac_header>
 _ACEOF
-if { (eval echo "$as_me:13088: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:14664: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
   egrep -v '^ *\+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:13094: \$? = $ac_status" >&5
+  echo "$as_me:14670: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -13110,7 +14686,7 @@
 fi
 rm -f conftest.err conftest.$ac_ext
 fi
-echo "$as_me:13113: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "$as_me:14689: result: `eval echo '${'$as_ac_Header'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
   cat >>confdefs.h <<EOF
@@ -13125,23 +14701,23 @@
 for ac_header in sys/termio.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-echo "$as_me:13128: checking for $ac_header" >&5
+echo "$as_me:14704: checking for $ac_header" >&5
 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
 if eval "test \"\${$as_ac_Header+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 13134 "configure"
+#line 14710 "configure"
 #include "confdefs.h"
 #include <$ac_header>
 _ACEOF
-if { (eval echo "$as_me:13138: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:14714: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
   egrep -v '^ *\+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:13144: \$? = $ac_status" >&5
+  echo "$as_me:14720: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -13160,7 +14736,7 @@
 fi
 rm -f conftest.err conftest.$ac_ext
 fi
-echo "$as_me:13163: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "$as_me:14739: result: `eval echo '${'$as_ac_Header'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
   cat >>confdefs.h <<EOF
@@ -13178,10 +14754,10 @@
 	*)	termios_bad=maybe ;;
 	esac
 	if test "$termios_bad" = maybe ; then
-	echo "$as_me:13181: checking whether termios.h needs _POSIX_SOURCE" >&5
+	echo "$as_me:14757: checking whether termios.h needs _POSIX_SOURCE" >&5
 echo $ECHO_N "checking whether termios.h needs _POSIX_SOURCE... $ECHO_C" >&6
 	cat >conftest.$ac_ext <<_ACEOF
-#line 13184 "configure"
+#line 14760 "configure"
 #include "confdefs.h"
 #include <termios.h>
 int
@@ -13193,16 +14769,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:13196: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:14772: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:13199: \$? = $ac_status" >&5
+  echo "$as_me:14775: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:13202: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14778: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:13205: \$? = $ac_status" >&5
+  echo "$as_me:14781: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   termios_bad=no
 else
@@ -13210,7 +14786,7 @@
 cat conftest.$ac_ext >&5
 
 		cat >conftest.$ac_ext <<_ACEOF
-#line 13213 "configure"
+#line 14789 "configure"
 #include "confdefs.h"
 
 #define _POSIX_SOURCE
@@ -13224,16 +14800,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:13227: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:14803: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:13230: \$? = $ac_status" >&5
+  echo "$as_me:14806: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:13233: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14809: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:13236: \$? = $ac_status" >&5
+  echo "$as_me:14812: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   termios_bad=unknown
 else
@@ -13248,19 +14824,19 @@
 
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
-	echo "$as_me:13251: result: $termios_bad" >&5
+	echo "$as_me:14827: result: $termios_bad" >&5
 echo "${ECHO_T}$termios_bad" >&6
 	fi
 fi
 
-echo "$as_me:13256: checking for tcgetattr" >&5
+echo "$as_me:14832: checking for tcgetattr" >&5
 echo $ECHO_N "checking for tcgetattr... $ECHO_C" >&6
 if test "${cf_cv_have_tcgetattr+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 cat >conftest.$ac_ext <<_ACEOF
-#line 13263 "configure"
+#line 14839 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -13288,16 +14864,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:13291: \"$ac_link\"") >&5
+if { (eval echo "$as_me:14867: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:13294: \$? = $ac_status" >&5
+  echo "$as_me:14870: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:13297: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14873: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:13300: \$? = $ac_status" >&5
+  echo "$as_me:14876: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_have_tcgetattr=yes
 else
@@ -13307,20 +14883,20 @@
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:13310: result: $cf_cv_have_tcgetattr" >&5
+echo "$as_me:14886: result: $cf_cv_have_tcgetattr" >&5
 echo "${ECHO_T}$cf_cv_have_tcgetattr" >&6
 test "$cf_cv_have_tcgetattr" = yes && cat >>confdefs.h <<\EOF
 #define HAVE_TCGETATTR 1
 EOF
 
-echo "$as_me:13316: checking for vsscanf function or workaround" >&5
+echo "$as_me:14892: checking for vsscanf function or workaround" >&5
 echo $ECHO_N "checking for vsscanf function or workaround... $ECHO_C" >&6
 if test "${cf_cv_func_vsscanf+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 cat >conftest.$ac_ext <<_ACEOF
-#line 13323 "configure"
+#line 14899 "configure"
 #include "confdefs.h"
 
 #include <stdarg.h>
@@ -13336,16 +14912,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:13339: \"$ac_link\"") >&5
+if { (eval echo "$as_me:14915: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:13342: \$? = $ac_status" >&5
+  echo "$as_me:14918: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:13345: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14921: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:13348: \$? = $ac_status" >&5
+  echo "$as_me:14924: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_func_vsscanf=vsscanf
 else
@@ -13353,7 +14929,7 @@
 cat conftest.$ac_ext >&5
 
 cat >conftest.$ac_ext <<_ACEOF
-#line 13356 "configure"
+#line 14932 "configure"
 #include "confdefs.h"
 
 #include <stdarg.h>
@@ -13375,16 +14951,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:13378: \"$ac_link\"") >&5
+if { (eval echo "$as_me:14954: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:13381: \$? = $ac_status" >&5
+  echo "$as_me:14957: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:13384: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14960: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:13387: \$? = $ac_status" >&5
+  echo "$as_me:14963: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_func_vsscanf=vfscanf
 else
@@ -13392,7 +14968,7 @@
 cat conftest.$ac_ext >&5
 
 cat >conftest.$ac_ext <<_ACEOF
-#line 13395 "configure"
+#line 14971 "configure"
 #include "confdefs.h"
 
 #include <stdarg.h>
@@ -13414,16 +14990,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:13417: \"$ac_link\"") >&5
+if { (eval echo "$as_me:14993: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:13420: \$? = $ac_status" >&5
+  echo "$as_me:14996: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:13423: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14999: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:13426: \$? = $ac_status" >&5
+  echo "$as_me:15002: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_func_vsscanf=_doscan
 else
@@ -13438,7 +15014,7 @@
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:13441: result: $cf_cv_func_vsscanf" >&5
+echo "$as_me:15017: result: $cf_cv_func_vsscanf" >&5
 echo "${ECHO_T}$cf_cv_func_vsscanf" >&6
 
 case $cf_cv_func_vsscanf in #(vi
@@ -13456,21 +15032,21 @@
 ;;
 esac
 
-echo "$as_me:13459: checking for working mkstemp" >&5
+echo "$as_me:15035: checking for working mkstemp" >&5
 echo $ECHO_N "checking for working mkstemp... $ECHO_C" >&6
 if test "${cf_cv_func_mkstemp+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-rm -f conftest*
+rm -rf conftest*
 if test "$cross_compiling" = yes; then
-  echo "$as_me:13467: checking for mkstemp" >&5
+  echo "$as_me:15043: checking for mkstemp" >&5
 echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6
 if test "${ac_cv_func_mkstemp+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 13473 "configure"
+#line 15049 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char mkstemp (); below.  */
@@ -13501,16 +15077,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:13504: \"$ac_link\"") >&5
+if { (eval echo "$as_me:15080: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:13507: \$? = $ac_status" >&5
+  echo "$as_me:15083: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:13510: \"$ac_try\"") >&5
+  { (eval echo "$as_me:15086: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:13513: \$? = $ac_status" >&5
+  echo "$as_me:15089: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_func_mkstemp=yes
 else
@@ -13520,12 +15096,12 @@
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:13523: result: $ac_cv_func_mkstemp" >&5
+echo "$as_me:15099: result: $ac_cv_func_mkstemp" >&5
 echo "${ECHO_T}$ac_cv_func_mkstemp" >&6
 
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 13528 "configure"
+#line 15104 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -13563,15 +15139,15 @@
 
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:13566: \"$ac_link\"") >&5
+if { (eval echo "$as_me:15142: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:13569: \$? = $ac_status" >&5
+  echo "$as_me:15145: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:13571: \"$ac_try\"") >&5
+  { (eval echo "$as_me:15147: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:13574: \$? = $ac_status" >&5
+  echo "$as_me:15150: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_func_mkstemp=yes
 
@@ -13586,9 +15162,9 @@
 fi
 
 fi
-echo "$as_me:13589: result: $cf_cv_func_mkstemp" >&5
+echo "$as_me:15165: result: $cf_cv_func_mkstemp" >&5
 echo "${ECHO_T}$cf_cv_func_mkstemp" >&6
-if test "$cf_cv_func_mkstemp" = yes ; then
+if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then
 	cat >>confdefs.h <<\EOF
 #define HAVE_MKSTEMP 1
 EOF
@@ -13604,21 +15180,21 @@
 fi
 
 if test "$cross_compiling" = yes ; then
-	{ echo "$as_me:13607: WARNING: cross compiling: assume setvbuf params not reversed" >&5
+	{ echo "$as_me:15183: WARNING: cross compiling: assume setvbuf params not reversed" >&5
 echo "$as_me: WARNING: cross compiling: assume setvbuf params not reversed" >&2;}
 else
-	echo "$as_me:13610: checking whether setvbuf arguments are reversed" >&5
+	echo "$as_me:15186: checking whether setvbuf arguments are reversed" >&5
 echo $ECHO_N "checking whether setvbuf arguments are reversed... $ECHO_C" >&6
 if test "${ac_cv_func_setvbuf_reversed+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   if test "$cross_compiling" = yes; then
-  { { echo "$as_me:13616: error: cannot run test program while cross compiling" >&5
+  { { echo "$as_me:15192: error: cannot run test program while cross compiling" >&5
 echo "$as_me: error: cannot run test program while cross compiling" >&2;}
    { (exit 1); exit 1; }; }
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 13621 "configure"
+#line 15197 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 /* If setvbuf has the reversed format, exit 0. */
@@ -13635,15 +15211,15 @@
 }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:13638: \"$ac_link\"") >&5
+if { (eval echo "$as_me:15214: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:13641: \$? = $ac_status" >&5
+  echo "$as_me:15217: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:13643: \"$ac_try\"") >&5
+  { (eval echo "$as_me:15219: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:13646: \$? = $ac_status" >&5
+  echo "$as_me:15222: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_func_setvbuf_reversed=yes
 else
@@ -13656,7 +15232,7 @@
 fi
 rm -f core core.* *.core
 fi
-echo "$as_me:13659: result: $ac_cv_func_setvbuf_reversed" >&5
+echo "$as_me:15235: result: $ac_cv_func_setvbuf_reversed" >&5
 echo "${ECHO_T}$ac_cv_func_setvbuf_reversed" >&6
 if test $ac_cv_func_setvbuf_reversed = yes; then
 
@@ -13667,13 +15243,13 @@
 fi
 
 fi
-echo "$as_me:13670: checking return type of signal handlers" >&5
+echo "$as_me:15246: checking return type of signal handlers" >&5
 echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6
 if test "${ac_cv_type_signal+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 13676 "configure"
+#line 15252 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <signal.h>
@@ -13695,16 +15271,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:13698: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:15274: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:13701: \$? = $ac_status" >&5
+  echo "$as_me:15277: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:13704: \"$ac_try\"") >&5
+  { (eval echo "$as_me:15280: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:13707: \$? = $ac_status" >&5
+  echo "$as_me:15283: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_type_signal=void
 else
@@ -13714,21 +15290,21 @@
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:13717: result: $ac_cv_type_signal" >&5
+echo "$as_me:15293: result: $ac_cv_type_signal" >&5
 echo "${ECHO_T}$ac_cv_type_signal" >&6
 
 cat >>confdefs.h <<EOF
 #define RETSIGTYPE $ac_cv_type_signal
 EOF
 
-echo "$as_me:13724: checking for type sigaction_t" >&5
+echo "$as_me:15300: checking for type sigaction_t" >&5
 echo $ECHO_N "checking for type sigaction_t... $ECHO_C" >&6
 if test "${cf_cv_type_sigaction+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 	cat >conftest.$ac_ext <<_ACEOF
-#line 13731 "configure"
+#line 15307 "configure"
 #include "confdefs.h"
 
 #include <signal.h>
@@ -13741,16 +15317,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:13744: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:15320: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:13747: \$? = $ac_status" >&5
+  echo "$as_me:15323: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:13750: \"$ac_try\"") >&5
+  { (eval echo "$as_me:15326: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:13753: \$? = $ac_status" >&5
+  echo "$as_me:15329: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_type_sigaction=yes
 else
@@ -13761,13 +15337,13 @@
 rm -f conftest.$ac_objext conftest.$ac_ext
 fi
 
-echo "$as_me:13764: result: $cf_cv_type_sigaction" >&5
+echo "$as_me:15340: result: $cf_cv_type_sigaction" >&5
 echo "${ECHO_T}$cf_cv_type_sigaction" >&6
 test "$cf_cv_type_sigaction" = yes && cat >>confdefs.h <<\EOF
 #define HAVE_TYPE_SIGACTION 1
 EOF
 
-echo "$as_me:13770: checking declaration of size-change" >&5
+echo "$as_me:15346: checking declaration of size-change" >&5
 echo $ECHO_N "checking declaration of size-change... $ECHO_C" >&6
 if test "${cf_cv_sizechange+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -13782,7 +15358,7 @@
     CPPFLAGS="$cf_save_CPPFLAGS"
     test -n "$cf_opts" && CPPFLAGS="$CPPFLAGS -D$cf_opts"
     cat >conftest.$ac_ext <<_ACEOF
-#line 13785 "configure"
+#line 15361 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #ifdef HAVE_TERMIOS_H
@@ -13826,123 +15402,509 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:13829: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:15405: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:15408: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:15411: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:15414: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_sizechange=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_sizechange=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+	CPPFLAGS="$cf_save_CPPFLAGS"
+	if test "$cf_cv_sizechange" = yes ; then
+		echo "size-change succeeded ($cf_opts)" >&5
+		test -n "$cf_opts" && cf_cv_sizechange="$cf_opts"
+		break
+	fi
+done
+
+fi
+echo "$as_me:15433: result: $cf_cv_sizechange" >&5
+echo "${ECHO_T}$cf_cv_sizechange" >&6
+if test "$cf_cv_sizechange" != no ; then
+	cat >>confdefs.h <<\EOF
+#define HAVE_SIZECHANGE 1
+EOF
+
+	case $cf_cv_sizechange in #(vi
+	NEED*)
+		cat >>confdefs.h <<EOF
+#define $cf_cv_sizechange  1
+EOF
+
+		;;
+	esac
+fi
+
+echo "$as_me:15450: checking for memmove" >&5
+echo $ECHO_N "checking for memmove... $ECHO_C" >&6
+if test "${ac_cv_func_memmove+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 15456 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char memmove (); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char memmove ();
+char (*f) ();
+
+int
+main ()
+{
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_memmove) || defined (__stub___memmove)
+choke me
+#else
+f = memmove;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:15487: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:15490: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:15493: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:15496: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_memmove=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_func_memmove=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:15506: result: $ac_cv_func_memmove" >&5
+echo "${ECHO_T}$ac_cv_func_memmove" >&6
+if test $ac_cv_func_memmove = yes; then
+  :
+else
+
+echo "$as_me:15512: checking for bcopy" >&5
+echo $ECHO_N "checking for bcopy... $ECHO_C" >&6
+if test "${ac_cv_func_bcopy+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 15518 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char bcopy (); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char bcopy ();
+char (*f) ();
+
+int
+main ()
+{
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_bcopy) || defined (__stub___bcopy)
+choke me
+#else
+f = bcopy;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:15549: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:15552: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:15555: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:15558: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_bcopy=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_func_bcopy=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:15568: result: $ac_cv_func_bcopy" >&5
+echo "${ECHO_T}$ac_cv_func_bcopy" >&6
+if test $ac_cv_func_bcopy = yes; then
+
+	echo "$as_me:15572: checking if bcopy does overlapping moves" >&5
+echo $ECHO_N "checking if bcopy does overlapping moves... $ECHO_C" >&6
+if test "${cf_cv_good_bcopy+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+		if test "$cross_compiling" = yes; then
+  cf_cv_good_bcopy=unknown
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 15582 "configure"
+#include "confdefs.h"
+
+int main() {
+	static char data[] = "abcdefghijklmnopqrstuwwxyz";
+	char temp[40];
+	bcopy(data, temp, sizeof(data));
+	bcopy(temp+10, temp, 15);
+	bcopy(temp+5, temp+15, 10);
+	${cf_cv_main_return:-return} (strcmp(temp, "klmnopqrstuwwxypqrstuwwxyz"));
+}
+
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:15596: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:15599: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:15601: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:15604: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_good_bcopy=yes
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_good_bcopy=no
+fi
+rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+fi
+echo "$as_me:15617: result: $cf_cv_good_bcopy" >&5
+echo "${ECHO_T}$cf_cv_good_bcopy" >&6
+
+else
+  cf_cv_good_bcopy=no
+fi
+
+	if test "$cf_cv_good_bcopy" = yes ; then
+		cat >>confdefs.h <<\EOF
+#define USE_OK_BCOPY 1
+EOF
+
+	else
+		cat >>confdefs.h <<\EOF
+#define USE_MY_MEMMOVE 1
+EOF
+
+	fi
+
+fi
+
+echo "$as_me:15638: checking if poll really works" >&5
+echo $ECHO_N "checking if poll really works... $ECHO_C" >&6
+if test "${cf_cv_working_poll+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+if test "$cross_compiling" = yes; then
+  cf_cv_working_poll=unknown
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 15648 "configure"
+#include "confdefs.h"
+
+#include <stdio.h>
+#ifdef HAVE_POLL_H
+#include <poll.h>
+#else
+#include <sys/poll.h>
+#endif
+int main() {
+	struct pollfd myfds;
+	int ret;
+
+	myfds.fd = 0;
+	myfds.events = POLLIN;
+
+	ret = poll(&myfds, 1, 100);
+	${cf_cv_main_return:-return}(ret != 0);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:15669: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:15672: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:15674: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:15677: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_working_poll=yes
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_working_poll=no
+fi
+rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+echo "$as_me:15689: result: $cf_cv_working_poll" >&5
+echo "${ECHO_T}$cf_cv_working_poll" >&6
+test "$cf_cv_working_poll" = "yes" && cat >>confdefs.h <<\EOF
+#define HAVE_WORKING_POLL 1
+EOF
+
+echo "$as_me:15695: checking for va_copy" >&5
+echo $ECHO_N "checking for va_copy... $ECHO_C" >&6
+if test "${cf_cv_have_va_copy+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+cat >conftest.$ac_ext <<_ACEOF
+#line 15702 "configure"
+#include "confdefs.h"
+
+#include <stdarg.h>
+
+int
+main ()
+{
+
+	static va_list dst;
+	static va_list src;
+	va_copy(dst, src)
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:15719: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:15722: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:15725: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:15728: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_have_va_copy=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_have_va_copy=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:15738: result: $cf_cv_have_va_copy" >&5
+echo "${ECHO_T}$cf_cv_have_va_copy" >&6
+
+test "$cf_cv_have_va_copy" = yes && cat >>confdefs.h <<\EOF
+#define HAVE_VA_COPY 1
+EOF
+
+echo "$as_me:15745: checking for __va_copy" >&5
+echo $ECHO_N "checking for __va_copy... $ECHO_C" >&6
+if test "${cf_cv_have___va_copy+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+cat >conftest.$ac_ext <<_ACEOF
+#line 15752 "configure"
+#include "confdefs.h"
+
+#include <stdarg.h>
+
+int
+main ()
+{
+
+	static va_list dst;
+	static va_list src;
+	__va_copy(dst, src)
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:15769: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:15772: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:15775: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:15778: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_have___va_copy=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_have___va_copy=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:15788: result: $cf_cv_have___va_copy" >&5
+echo "${ECHO_T}$cf_cv_have___va_copy" >&6
+
+test "$cf_cv_have___va_copy" = yes && cat >>confdefs.h <<\EOF
+#define HAVE___VA_COPY 1
+EOF
+
+echo "$as_me:15795: checking for pid_t" >&5
+echo $ECHO_N "checking for pid_t... $ECHO_C" >&6
+if test "${ac_cv_type_pid_t+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 15801 "configure"
+#include "confdefs.h"
+$ac_includes_default
+int
+main ()
+{
+if ((pid_t *) 0)
+  return 0;
+if (sizeof (pid_t))
+  return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:15816: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:13832: \$? = $ac_status" >&5
+  echo "$as_me:15819: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:13835: \"$ac_try\"") >&5
+  { (eval echo "$as_me:15822: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:13838: \$? = $ac_status" >&5
+  echo "$as_me:15825: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  cf_cv_sizechange=yes
+  ac_cv_type_pid_t=yes
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-cf_cv_sizechange=no
+ac_cv_type_pid_t=no
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
-
-	CPPFLAGS="$cf_save_CPPFLAGS"
-	if test "$cf_cv_sizechange" = yes ; then
-		echo "size-change succeeded ($cf_opts)" >&5
-		test -n "$cf_opts" && cf_cv_sizechange="$cf_opts"
-		break
-	fi
-done
-
 fi
-echo "$as_me:13857: result: $cf_cv_sizechange" >&5
-echo "${ECHO_T}$cf_cv_sizechange" >&6
-if test "$cf_cv_sizechange" != no ; then
-	cat >>confdefs.h <<\EOF
-#define HAVE_SIZECHANGE 1
-EOF
+echo "$as_me:15835: result: $ac_cv_type_pid_t" >&5
+echo "${ECHO_T}$ac_cv_type_pid_t" >&6
+if test $ac_cv_type_pid_t = yes; then
+  :
+else
 
-	case $cf_cv_sizechange in #(vi
-	NEED*)
-		cat >>confdefs.h <<EOF
-#define $cf_cv_sizechange  1
+cat >>confdefs.h <<EOF
+#define pid_t int
 EOF
 
-		;;
-	esac
 fi
 
-echo "$as_me:13874: checking for memmove" >&5
-echo $ECHO_N "checking for memmove... $ECHO_C" >&6
-if test "${ac_cv_func_memmove+set}" = set; then
+for ac_header in unistd.h vfork.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+echo "$as_me:15850: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 13880 "configure"
+#line 15856 "configure"
 #include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char memmove (); below.  */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char memmove ();
-char (*f) ();
-
-int
-main ()
-{
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined (__stub_memmove) || defined (__stub___memmove)
-choke me
-#else
-f = memmove;
-#endif
-
-  ;
-  return 0;
-}
+#include <$ac_header>
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:13911: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:13914: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:13917: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+if { (eval echo "$as_me:15860: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
-  echo "$as_me:13920: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_func_memmove=yes
+  egrep -v '^ *\+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:15866: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  eval "$as_ac_Header=yes"
 else
   echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-ac_cv_func_memmove=no
+  cat conftest.$ac_ext >&5
+  eval "$as_ac_Header=no"
 fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_ext
 fi
-echo "$as_me:13930: result: $ac_cv_func_memmove" >&5
-echo "${ECHO_T}$ac_cv_func_memmove" >&6
-if test $ac_cv_func_memmove = yes; then
-  :
-else
+echo "$as_me:15885: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+EOF
 
-echo "$as_me:13936: checking for bcopy" >&5
-echo $ECHO_N "checking for bcopy... $ECHO_C" >&6
-if test "${ac_cv_func_bcopy+set}" = set; then
+fi
+done
+
+for ac_func in fork vfork
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:15898: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 13942 "configure"
+#line 15904 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char bcopy (); below.  */
+    which can conflict with char $ac_func (); below.  */
 #include <assert.h>
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
@@ -13950,7 +15912,7 @@
 #endif
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
-char bcopy ();
+char $ac_func ();
 char (*f) ();
 
 int
@@ -13959,10 +15921,10 @@
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined (__stub_bcopy) || defined (__stub___bcopy)
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
 choke me
 #else
-f = bcopy;
+f = $ac_func;
 #endif
 
   ;
@@ -13970,155 +15932,259 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:13973: \"$ac_link\"") >&5
+if { (eval echo "$as_me:15935: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:13976: \$? = $ac_status" >&5
+  echo "$as_me:15938: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:13979: \"$ac_try\"") >&5
+  { (eval echo "$as_me:15941: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:13982: \$? = $ac_status" >&5
+  echo "$as_me:15944: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_func_bcopy=yes
+  eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-ac_cv_func_bcopy=no
+eval "$as_ac_var=no"
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:13992: result: $ac_cv_func_bcopy" >&5
-echo "${ECHO_T}$ac_cv_func_bcopy" >&6
-if test $ac_cv_func_bcopy = yes; then
+echo "$as_me:15954: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+EOF
 
-	echo "$as_me:13996: checking if bcopy does overlapping moves" >&5
-echo $ECHO_N "checking if bcopy does overlapping moves... $ECHO_C" >&6
-if test "${cf_cv_good_bcopy+set}" = set; then
+fi
+done
+
+ac_cv_func_fork_works=$ac_cv_func_fork
+if test "x$ac_cv_func_fork" = xyes; then
+  echo "$as_me:15966: checking for working fork" >&5
+echo $ECHO_N "checking for working fork... $ECHO_C" >&6
+if test "${ac_cv_func_fork_works+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-
-		if test "$cross_compiling" = yes; then
-  cf_cv_good_bcopy=unknown
+  if test "$cross_compiling" = yes; then
+  ac_cv_func_fork_works=cross
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 14006 "configure"
-#include "confdefs.h"
-
-int main() {
-	static char data[] = "abcdefghijklmnopqrstuwwxyz";
-	char temp[40];
-	bcopy(data, temp, sizeof(data));
-	bcopy(temp+10, temp, 15);
-	bcopy(temp+5, temp+15, 10);
-	${cf_cv_main_return:-return} (strcmp(temp, "klmnopqrstuwwxypqrstuwwxyz"));
-}
-
+/* By Rüdiger Kuhlmann. */
+      #include <sys/types.h>
+      #if HAVE_UNISTD_H
+      # include <unistd.h>
+      #endif
+      /* Some systems only have a dummy stub for fork() */
+      int main ()
+      {
+        if (fork() < 0)
+          $ac_main_return (1);
+        $ac_main_return (0);
+      }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:14020: \"$ac_link\"") >&5
+if { (eval echo "$as_me:15989: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:14023: \$? = $ac_status" >&5
+  echo "$as_me:15992: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:14025: \"$ac_try\"") >&5
+  { (eval echo "$as_me:15994: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:14028: \$? = $ac_status" >&5
+  echo "$as_me:15997: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  cf_cv_good_bcopy=yes
+  ac_cv_func_fork_works=yes
 else
   echo "$as_me: program exited with status $ac_status" >&5
 echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-cf_cv_good_bcopy=no
+ac_cv_func_fork_works=no
 fi
 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
-
 fi
-echo "$as_me:14041: result: $cf_cv_good_bcopy" >&5
-echo "${ECHO_T}$cf_cv_good_bcopy" >&6
+echo "$as_me:16009: result: $ac_cv_func_fork_works" >&5
+echo "${ECHO_T}$ac_cv_func_fork_works" >&6
 
-else
-  cf_cv_good_bcopy=no
 fi
-
-	if test "$cf_cv_good_bcopy" = yes ; then
-		cat >>confdefs.h <<\EOF
-#define USE_OK_BCOPY 1
-EOF
-
-	else
-		cat >>confdefs.h <<\EOF
-#define USE_MY_MEMMOVE 1
-EOF
-
-	fi
-
+if test "x$ac_cv_func_fork_works" = xcross; then
+  case $host in
+    *-*-amigaos* | *-*-msdosdjgpp*)
+      # Override, as these systems have only a dummy fork() stub
+      ac_cv_func_fork_works=no
+      ;;
+    *)
+      ac_cv_func_fork_works=yes
+      ;;
+  esac
+  { echo "$as_me:16023: WARNING: CROSS: Result $ac_cv_func_fork_works guessed due to cross-compiling." >&5
+echo "$as_me: WARNING: CROSS: Result $ac_cv_func_fork_works guessed due to cross-compiling." >&2;}
 fi
-
-echo "$as_me:14062: checking if poll really works" >&5
-echo $ECHO_N "checking if poll really works... $ECHO_C" >&6
-if test "${cf_cv_working_poll+set}" = set; then
+ac_cv_func_vfork_works=$ac_cv_func_vfork
+if test "x$ac_cv_func_vfork" = xyes; then
+  echo "$as_me:16028: checking for working vfork" >&5
+echo $ECHO_N "checking for working vfork... $ECHO_C" >&6
+if test "${ac_cv_func_vfork_works+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-
-if test "$cross_compiling" = yes; then
-  cf_cv_working_poll=unknown
+  if test "$cross_compiling" = yes; then
+  ac_cv_func_vfork_works=cross
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 14072 "configure"
+#line 16037 "configure"
 #include "confdefs.h"
-
+/* Thanks to Paul Eggert for this test.  */
 #include <stdio.h>
-#ifdef HAVE_POLL_H
-#include <poll.h>
-#else
-#include <sys/poll.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#if HAVE_UNISTD_H
+# include <unistd.h>
 #endif
-int main() {
-	struct pollfd myfds;
-	int ret;
+#if HAVE_VFORK_H
+# include <vfork.h>
+#endif
+/* On some sparc systems, changes by the child to local and incoming
+   argument registers are propagated back to the parent.  The compiler
+   is told about this with #include <vfork.h>, but some compilers
+   (e.g. gcc -O) don't grok <vfork.h>.  Test for this by using a
+   static variable whose address is put into a register that is
+   clobbered by the vfork.  */
+static
+#ifdef __cplusplus
+sparc_address_test (int arg)
+# else
+sparc_address_test (arg) int arg;
+#endif
+{
+  static pid_t child;
+  if (!child) {
+    child = vfork ();
+    if (child < 0) {
+      perror ("vfork");
+      _exit(2);
+    }
+    if (!child) {
+      arg = getpid();
+      write(-1, "", 0);
+      _exit (arg);
+    }
+  }
+}
 
-	myfds.fd = 0;
-	myfds.events = POLLIN;
+int
+main ()
+{
+  pid_t parent = getpid ();
+  pid_t child;
 
-	ret = poll(&myfds, 1, 100);
-	${cf_cv_main_return:-return}(ret != 0);
+  sparc_address_test ();
+
+  child = vfork ();
+
+  if (child == 0) {
+    /* Here is another test for sparc vfork register problems.  This
+       test uses lots of local variables, at least as many local
+       variables as main has allocated so far including compiler
+       temporaries.  4 locals are enough for gcc 1.40.3 on a Solaris
+       4.1.3 sparc, but we use 8 to be safe.  A buggy compiler should
+       reuse the register of parent for one of the local variables,
+       since it will think that parent can't possibly be used any more
+       in this routine.  Assigning to the local variable will thus
+       munge parent in the parent process.  */
+    pid_t
+      p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(),
+      p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid();
+    /* Convince the compiler that p..p7 are live; otherwise, it might
+       use the same hardware register for all 8 local variables.  */
+    if (p != p1 || p != p2 || p != p3 || p != p4
+	|| p != p5 || p != p6 || p != p7)
+      _exit(1);
+
+    /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent
+       from child file descriptors.  If the child closes a descriptor
+       before it execs or exits, this munges the parent's descriptor
+       as well.  Test for this by closing stdout in the child.  */
+    _exit(close(fileno(stdout)) != 0);
+  } else {
+    int status;
+    struct stat st;
+
+    while (wait(&status) != child)
+      ;
+    $ac_main_return(
+	 /* Was there some problem with vforking?  */
+	 child < 0
+
+	 /* Did the child fail?  (This shouldn't happen.)  */
+	 || status
+
+	 /* Did the vfork/compiler bug occur?  */
+	 || parent != getpid()
+
+	 /* Did the file descriptor bug occur?  */
+	 || fstat(fileno(stdout), &st) != 0
+	 );
+  }
 }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:14093: \"$ac_link\"") >&5
+if { (eval echo "$as_me:16134: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:14096: \$? = $ac_status" >&5
+  echo "$as_me:16137: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:14098: \"$ac_try\"") >&5
+  { (eval echo "$as_me:16139: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:14101: \$? = $ac_status" >&5
+  echo "$as_me:16142: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  cf_cv_working_poll=yes
+  ac_cv_func_vfork_works=yes
 else
   echo "$as_me: program exited with status $ac_status" >&5
 echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-cf_cv_working_poll=no
+ac_cv_func_vfork_works=no
 fi
 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 fi
-echo "$as_me:14113: result: $cf_cv_working_poll" >&5
-echo "${ECHO_T}$cf_cv_working_poll" >&6
-test "$cf_cv_working_poll" = "yes" && cat >>confdefs.h <<\EOF
-#define HAVE_WORKING_POLL 1
+echo "$as_me:16154: result: $ac_cv_func_vfork_works" >&5
+echo "${ECHO_T}$ac_cv_func_vfork_works" >&6
+
+fi;
+if test "x$ac_cv_func_fork_works" = xcross; then
+  ac_cv_func_vfork_works=ac_cv_func_vfork
+  { echo "$as_me:16160: WARNING: CROSS: Result $ac_cv_func_vfork_works guessed due to cross-compiling." >&5
+echo "$as_me: WARNING: CROSS: Result $ac_cv_func_vfork_works guessed due to cross-compiling." >&2;}
+fi
+
+if test "x$ac_cv_func_vfork_works" = xyes; then
+
+cat >>confdefs.h <<\EOF
+#define HAVE_WORKING_VFORK 1
+EOF
+
+else
+
+cat >>confdefs.h <<\EOF
+#define vfork fork
+EOF
+
+fi
+if test "x$ac_cv_func_fork_works" = xyes; then
+
+cat >>confdefs.h <<\EOF
+#define HAVE_WORKING_FORK 1
 EOF
 
+fi
+
 # special check for test/ditto.c
 
-echo "$as_me:14121: checking for openpty in -lutil" >&5
+echo "$as_me:16187: checking for openpty in -lutil" >&5
 echo $ECHO_N "checking for openpty in -lutil... $ECHO_C" >&6
 if test "${ac_cv_lib_util_openpty+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -14126,7 +16192,7 @@
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lutil  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 14129 "configure"
+#line 16195 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -14145,16 +16211,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:14148: \"$ac_link\"") >&5
+if { (eval echo "$as_me:16214: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:14151: \$? = $ac_status" >&5
+  echo "$as_me:16217: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:14154: \"$ac_try\"") >&5
+  { (eval echo "$as_me:16220: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:14157: \$? = $ac_status" >&5
+  echo "$as_me:16223: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_util_openpty=yes
 else
@@ -14165,7 +16231,7 @@
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:14168: result: $ac_cv_lib_util_openpty" >&5
+echo "$as_me:16234: result: $ac_cv_lib_util_openpty" >&5
 echo "${ECHO_T}$ac_cv_lib_util_openpty" >&6
 if test $ac_cv_lib_util_openpty = yes; then
   cf_cv_lib_util=yes
@@ -14173,7 +16239,7 @@
   cf_cv_lib_util=no
 fi
 
-echo "$as_me:14176: checking for openpty header" >&5
+echo "$as_me:16242: checking for openpty header" >&5
 echo $ECHO_N "checking for openpty header... $ECHO_C" >&6
 if test "${cf_cv_func_openpty+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -14184,7 +16250,7 @@
     for cf_header in pty.h libutil.h util.h
     do
     cat >conftest.$ac_ext <<_ACEOF
-#line 14187 "configure"
+#line 16253 "configure"
 #include "confdefs.h"
 
 #include <$cf_header>
@@ -14201,16 +16267,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:14204: \"$ac_link\"") >&5
+if { (eval echo "$as_me:16270: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:14207: \$? = $ac_status" >&5
+  echo "$as_me:16273: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:14210: \"$ac_try\"") >&5
+  { (eval echo "$as_me:16276: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:14213: \$? = $ac_status" >&5
+  echo "$as_me:16279: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
         cf_cv_func_openpty=$cf_header
@@ -14228,7 +16294,7 @@
     LIBS="$cf_save_LIBS"
 
 fi
-echo "$as_me:14231: result: $cf_cv_func_openpty" >&5
+echo "$as_me:16297: result: $cf_cv_func_openpty" >&5
 echo "${ECHO_T}$cf_cv_func_openpty" >&6
 
 if test "$cf_cv_func_openpty" != no ; then
@@ -14274,13 +16340,13 @@
 		fi
 
 		if test "$cf_have_incdir" = no ; then
-          if test "$cf_add_incdir" = /usr/local/include ; then
+		  if test "$cf_add_incdir" = /usr/local/include ; then
 			if test "$GCC" = yes
 			then
 			  cf_save_CPPFLAGS=$CPPFLAGS
 			  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
 			  cat >conftest.$ac_ext <<_ACEOF
-#line 14283 "configure"
+#line 16349 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int
@@ -14292,16 +16358,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:14295: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:16361: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:14298: \$? = $ac_status" >&5
+  echo "$as_me:16364: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:14301: \"$ac_try\"") >&5
+  { (eval echo "$as_me:16367: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:14304: \$? = $ac_status" >&5
+  echo "$as_me:16370: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
@@ -14318,13 +16384,13 @@
 		if test "$cf_have_incdir" = no ; then
 		  test -n "$verbose" && echo "	adding $cf_add_incdir to include-path" 1>&6
 
-echo "${as_me-configure}:14321: testing adding $cf_add_incdir to include-path ..." 1>&5
+echo "${as_me:-configure}:16387: testing adding $cf_add_incdir to include-path ..." 1>&5
 
-		  CPPFLAGS="-I$cf_add_incdir $CPPFLAGS"
+		  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
 
-          cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
-          test "$cf_top_incdir" = "$cf_add_incdir" && break
-          cf_add_incdir="$cf_top_incdir"
+		  cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
+		  test "$cf_top_incdir" = "$cf_add_incdir" && break
+		  cf_add_incdir="$cf_top_incdir"
 		else
 		  break
 		fi
@@ -14352,7 +16418,7 @@
       if test "$cf_have_libdir" = no ; then
         test -n "$verbose" && echo "	adding $cf_add_libdir to library-path" 1>&6
 
-echo "${as_me-configure}:14355: testing adding $cf_add_libdir to library-path ..." 1>&5
+echo "${as_me:-configure}:16421: testing adding $cf_add_libdir to library-path ..." 1>&5
 
         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
       fi
@@ -14363,23 +16429,23 @@
     fi
 esac
 
-echo "$as_me:14366: checking for db.h" >&5
+echo "$as_me:16432: checking for db.h" >&5
 echo $ECHO_N "checking for db.h... $ECHO_C" >&6
 if test "${ac_cv_header_db_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 14372 "configure"
+#line 16438 "configure"
 #include "confdefs.h"
 #include <db.h>
 _ACEOF
-if { (eval echo "$as_me:14376: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:16442: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
   egrep -v '^ *\+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:14382: \$? = $ac_status" >&5
+  echo "$as_me:16448: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -14398,11 +16464,11 @@
 fi
 rm -f conftest.err conftest.$ac_ext
 fi
-echo "$as_me:14401: result: $ac_cv_header_db_h" >&5
+echo "$as_me:16467: result: $ac_cv_header_db_h" >&5
 echo "${ECHO_T}$ac_cv_header_db_h" >&6
 if test $ac_cv_header_db_h = yes; then
 
-echo "$as_me:14405: checking for version of db" >&5
+echo "$as_me:16471: checking for version of db" >&5
 echo $ECHO_N "checking for version of db... $ECHO_C" >&6
 if test "${cf_cv_hashed_db_version+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -14413,10 +16479,10 @@
 for cf_db_version in 1 2 3 4 5
 do
 
-echo "${as_me-configure}:14416: testing checking for db version $cf_db_version ..." 1>&5
+echo "${as_me:-configure}:16482: testing checking for db version $cf_db_version ..." 1>&5
 
 	cat >conftest.$ac_ext <<_ACEOF
-#line 14419 "configure"
+#line 16485 "configure"
 #include "confdefs.h"
 
 $ac_includes_default
@@ -14446,16 +16512,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:14449: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:16515: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:14452: \$? = $ac_status" >&5
+  echo "$as_me:16518: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:14455: \"$ac_try\"") >&5
+  { (eval echo "$as_me:16521: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:14458: \$? = $ac_status" >&5
+  echo "$as_me:16524: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
 	cf_cv_hashed_db_version=$cf_db_version
@@ -14469,16 +16535,16 @@
 done
 
 fi
-echo "$as_me:14472: result: $cf_cv_hashed_db_version" >&5
+echo "$as_me:16538: result: $cf_cv_hashed_db_version" >&5
 echo "${ECHO_T}$cf_cv_hashed_db_version" >&6
 
 if test "$cf_cv_hashed_db_version" = unknown ; then
-	{ { echo "$as_me:14476: error: Cannot determine version of db" >&5
+	{ { echo "$as_me:16542: error: Cannot determine version of db" >&5
 echo "$as_me: error: Cannot determine version of db" >&2;}
    { (exit 1); exit 1; }; }
 else
 
-echo "$as_me:14481: checking for db libraries" >&5
+echo "$as_me:16547: checking for db libraries" >&5
 echo $ECHO_N "checking for db libraries... $ECHO_C" >&6
 if test "${cf_cv_hashed_db_libs+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -14492,10 +16558,10 @@
 		LIBS="-l$cf_db_libs $LIBS"
 	fi
 
-echo "${as_me-configure}:14495: testing checking for library "$cf_db_libs" ..." 1>&5
+echo "${as_me:-configure}:16561: testing checking for library "$cf_db_libs" ..." 1>&5
 
 	cat >conftest.$ac_ext <<_ACEOF
-#line 14498 "configure"
+#line 16564 "configure"
 #include "confdefs.h"
 
 $ac_includes_default
@@ -14550,16 +16616,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:14553: \"$ac_link\"") >&5
+if { (eval echo "$as_me:16619: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:14556: \$? = $ac_status" >&5
+  echo "$as_me:16622: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:14559: \"$ac_try\"") >&5
+  { (eval echo "$as_me:16625: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:14562: \$? = $ac_status" >&5
+  echo "$as_me:16628: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
 	if test -n "$cf_db_libs" ; then
@@ -14579,11 +16645,11 @@
 done
 
 fi
-echo "$as_me:14582: result: $cf_cv_hashed_db_libs" >&5
+echo "$as_me:16648: result: $cf_cv_hashed_db_libs" >&5
 echo "${ECHO_T}$cf_cv_hashed_db_libs" >&6
 
 	if test "$cf_cv_hashed_db_libs" = unknown ; then
-		{ { echo "$as_me:14586: error: Cannot determine library for db" >&5
+		{ { echo "$as_me:16652: error: Cannot determine library for db" >&5
 echo "$as_me: error: Cannot determine library for db" >&2;}
    { (exit 1); exit 1; }; }
 	elif test "$cf_cv_hashed_db_libs" != default ; then
@@ -14593,7 +16659,7 @@
 
 else
 
-	{ { echo "$as_me:14596: error: Cannot find db.h" >&5
+	{ { echo "$as_me:16662: error: Cannot find db.h" >&5
 echo "$as_me: error: Cannot find db.h" >&2;}
    { (exit 1); exit 1; }; }
 
@@ -14608,7 +16674,7 @@
 
 # Just in case, check if the C compiler has a bool type.
 
-echo "$as_me:14611: checking if we should include stdbool.h" >&5
+echo "$as_me:16677: checking if we should include stdbool.h" >&5
 echo $ECHO_N "checking if we should include stdbool.h... $ECHO_C" >&6
 
 if test "${cf_cv_header_stdbool_h+set}" = set; then
@@ -14616,7 +16682,7 @@
 else
 
 	cat >conftest.$ac_ext <<_ACEOF
-#line 14619 "configure"
+#line 16685 "configure"
 #include "confdefs.h"
 
 int
@@ -14628,23 +16694,23 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:14631: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:16697: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:14634: \$? = $ac_status" >&5
+  echo "$as_me:16700: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:14637: \"$ac_try\"") >&5
+  { (eval echo "$as_me:16703: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:14640: \$? = $ac_status" >&5
+  echo "$as_me:16706: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_header_stdbool_h=0
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
 cat >conftest.$ac_ext <<_ACEOF
-#line 14647 "configure"
+#line 16713 "configure"
 #include "confdefs.h"
 
 #ifndef __BEOS__
@@ -14660,16 +16726,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:14663: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:16729: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:14666: \$? = $ac_status" >&5
+  echo "$as_me:16732: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:14669: \"$ac_try\"") >&5
+  { (eval echo "$as_me:16735: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:14672: \$? = $ac_status" >&5
+  echo "$as_me:16738: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_header_stdbool_h=1
 else
@@ -14683,13 +16749,13 @@
 fi
 
 if test "$cf_cv_header_stdbool_h" = 1
-then	echo "$as_me:14686: result: yes" >&5
+then	echo "$as_me:16752: result: yes" >&5
 echo "${ECHO_T}yes" >&6
-else	echo "$as_me:14688: result: no" >&5
+else	echo "$as_me:16754: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
-echo "$as_me:14692: checking for builtin bool type" >&5
+echo "$as_me:16758: checking for builtin bool type" >&5
 echo $ECHO_N "checking for builtin bool type... $ECHO_C" >&6
 
 if test "${cf_cv_cc_bool_type+set}" = set; then
@@ -14697,7 +16763,7 @@
 else
 
 	cat >conftest.$ac_ext <<_ACEOF
-#line 14700 "configure"
+#line 16766 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -14712,16 +16778,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:14715: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:16781: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:14718: \$? = $ac_status" >&5
+  echo "$as_me:16784: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:14721: \"$ac_try\"") >&5
+  { (eval echo "$as_me:16787: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:14724: \$? = $ac_status" >&5
+  echo "$as_me:16790: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_cc_bool_type=1
 else
@@ -14734,9 +16800,9 @@
 fi
 
 if test "$cf_cv_cc_bool_type" = 1
-then	echo "$as_me:14737: result: yes" >&5
+then	echo "$as_me:16803: result: yes" >&5
 echo "${ECHO_T}yes" >&6
-else	echo "$as_me:14739: result: no" >&5
+else	echo "$as_me:16805: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -14758,16 +16824,16 @@
 	cf_stdcpp_libname=stdc++
 	;;
 esac
-echo "$as_me:14761: checking for library $cf_stdcpp_libname" >&5
+echo "$as_me:16827: checking for library $cf_stdcpp_libname" >&5
 echo $ECHO_N "checking for library $cf_stdcpp_libname... $ECHO_C" >&6
 if test "${cf_cv_libstdcpp+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 	cf_save="$LIBS"
-	LIBS="$LIBS -l$cf_stdcpp_libname"
+	LIBS="-l$cf_stdcpp_libname $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 14770 "configure"
+#line 16836 "configure"
 #include "confdefs.h"
 
 #include <strstream.h>
@@ -14783,16 +16849,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:14786: \"$ac_link\"") >&5
+if { (eval echo "$as_me:16852: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:14789: \$? = $ac_status" >&5
+  echo "$as_me:16855: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:14792: \"$ac_try\"") >&5
+  { (eval echo "$as_me:16858: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:14795: \$? = $ac_status" >&5
+  echo "$as_me:16861: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_libstdcpp=yes
 else
@@ -14804,12 +16870,12 @@
 	LIBS="$cf_save"
 
 fi
-echo "$as_me:14807: result: $cf_cv_libstdcpp" >&5
+echo "$as_me:16873: result: $cf_cv_libstdcpp" >&5
 echo "${ECHO_T}$cf_cv_libstdcpp" >&6
-test "$cf_cv_libstdcpp" = yes && CXXLIBS="$CXXLIBS -l$cf_stdcpp_libname"
+test "$cf_cv_libstdcpp" = yes && CXXLIBS="-l$cf_stdcpp_libname $CXXLIBS"
 fi
 
-	echo "$as_me:14812: checking whether $CXX understands -c and -o together" >&5
+	echo "$as_me:16878: checking whether $CXX understands -c and -o together" >&5
 echo $ECHO_N "checking whether $CXX understands -c and -o together... $ECHO_C" >&6
 if test "${cf_cv_prog_CXX_c_o+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -14825,29 +16891,29 @@
 # We do the test twice because some compilers refuse to overwrite an
 # existing .o file with -o, though they will create one.
 ac_try='$CXX -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
-if { (eval echo "$as_me:14828: \"$ac_try\"") >&5
+if { (eval echo "$as_me:16894: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:14831: \$? = $ac_status" >&5
+  echo "$as_me:16897: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-  test -f conftest2.$ac_objext && { (eval echo "$as_me:14833: \"$ac_try\"") >&5
+  test -f conftest2.$ac_objext && { (eval echo "$as_me:16899: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:14836: \$? = $ac_status" >&5
+  echo "$as_me:16902: \$? = $ac_status" >&5
   (exit $ac_status); };
 then
   eval cf_cv_prog_CXX_c_o=yes
 else
   eval cf_cv_prog_CXX_c_o=no
 fi
-rm -f conftest*
+rm -rf conftest*
 
 fi
 if test $cf_cv_prog_CXX_c_o = yes; then
-  echo "$as_me:14847: result: yes" >&5
+  echo "$as_me:16913: result: yes" >&5
 echo "${ECHO_T}yes" >&6
 else
-  echo "$as_me:14850: result: no" >&5
+  echo "$as_me:16916: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -14867,12 +16933,12 @@
 	;;
 esac
 if test "$GXX" = yes; then
-	echo "$as_me:14870: checking for lib$cf_gpp_libname" >&5
+	echo "$as_me:16936: checking for lib$cf_gpp_libname" >&5
 echo $ECHO_N "checking for lib$cf_gpp_libname... $ECHO_C" >&6
 	cf_save="$LIBS"
-	LIBS="$LIBS -l$cf_gpp_libname"
+	LIBS="-l$cf_gpp_libname $LIBS"
 	cat >conftest.$ac_ext <<_ACEOF
-#line 14875 "configure"
+#line 16941 "configure"
 #include "confdefs.h"
 
 #include <$cf_gpp_libname/builtin.h>
@@ -14886,19 +16952,19 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:14889: \"$ac_link\"") >&5
+if { (eval echo "$as_me:16955: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:14892: \$? = $ac_status" >&5
+  echo "$as_me:16958: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:14895: \"$ac_try\"") >&5
+  { (eval echo "$as_me:16961: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:14898: \$? = $ac_status" >&5
+  echo "$as_me:16964: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cxx_library=yes
-	 CXXLIBS="$CXXLIBS -l$cf_gpp_libname"
+	 CXXLIBS="-l$cf_gpp_libname $CXXLIBS"
 	 if test "$cf_gpp_libname" = cpp ; then
 	    cat >>confdefs.h <<\EOF
 #define HAVE_GPP_BUILTIN_H 1
@@ -14914,7 +16980,7 @@
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
 cat >conftest.$ac_ext <<_ACEOF
-#line 14917 "configure"
+#line 16983 "configure"
 #include "confdefs.h"
 
 #include <builtin.h>
@@ -14928,19 +16994,19 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:14931: \"$ac_link\"") >&5
+if { (eval echo "$as_me:16997: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:14934: \$? = $ac_status" >&5
+  echo "$as_me:17000: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:14937: \"$ac_try\"") >&5
+  { (eval echo "$as_me:17003: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:14940: \$? = $ac_status" >&5
+  echo "$as_me:17006: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cxx_library=yes
-	 CXXLIBS="$CXXLIBS -l$cf_gpp_libname"
+	 CXXLIBS="-l$cf_gpp_libname $CXXLIBS"
 	 cat >>confdefs.h <<\EOF
 #define HAVE_BUILTIN_H 1
 EOF
@@ -14954,7 +17020,7 @@
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 	LIBS="$cf_save"
-	echo "$as_me:14957: result: $cf_cxx_library" >&5
+	echo "$as_me:17023: result: $cf_cxx_library" >&5
 echo "${ECHO_T}$cf_cxx_library" >&6
 fi
 
@@ -14970,7 +17036,7 @@
 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
 ac_main_return=return
-echo "$as_me:14973: checking how to run the C++ preprocessor" >&5
+echo "$as_me:17039: checking how to run the C++ preprocessor" >&5
 echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6
 if test -z "$CXXCPP"; then
   if test "${ac_cv_prog_CXXCPP+set}" = set; then
@@ -14987,18 +17053,18 @@
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp. "Syntax error" is here to catch this case.
   cat >conftest.$ac_ext <<_ACEOF
-#line 14990 "configure"
+#line 17056 "configure"
 #include "confdefs.h"
 #include <assert.h>
                      Syntax error
 _ACEOF
-if { (eval echo "$as_me:14995: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:17061: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
   egrep -v '^ *\+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:15001: \$? = $ac_status" >&5
+  echo "$as_me:17067: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_cxx_preproc_warn_flag
@@ -15021,17 +17087,17 @@
   # OK, works on sane cases.  Now check whether non-existent headers
   # can be detected and how.
   cat >conftest.$ac_ext <<_ACEOF
-#line 15024 "configure"
+#line 17090 "configure"
 #include "confdefs.h"
 #include <ac_nonexistent.h>
 _ACEOF
-if { (eval echo "$as_me:15028: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:17094: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
   egrep -v '^ *\+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:15034: \$? = $ac_status" >&5
+  echo "$as_me:17100: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_cxx_preproc_warn_flag
@@ -15068,7 +17134,7 @@
 else
   ac_cv_prog_CXXCPP=$CXXCPP
 fi
-echo "$as_me:15071: result: $CXXCPP" >&5
+echo "$as_me:17137: result: $CXXCPP" >&5
 echo "${ECHO_T}$CXXCPP" >&6
 ac_preproc_ok=false
 for ac_cxx_preproc_warn_flag in '' yes
@@ -15078,18 +17144,18 @@
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp. "Syntax error" is here to catch this case.
   cat >conftest.$ac_ext <<_ACEOF
-#line 15081 "configure"
+#line 17147 "configure"
 #include "confdefs.h"
 #include <assert.h>
                      Syntax error
 _ACEOF
-if { (eval echo "$as_me:15086: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:17152: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
   egrep -v '^ *\+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:15092: \$? = $ac_status" >&5
+  echo "$as_me:17158: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_cxx_preproc_warn_flag
@@ -15112,17 +17178,17 @@
   # OK, works on sane cases.  Now check whether non-existent headers
   # can be detected and how.
   cat >conftest.$ac_ext <<_ACEOF
-#line 15115 "configure"
+#line 17181 "configure"
 #include "confdefs.h"
 #include <ac_nonexistent.h>
 _ACEOF
-if { (eval echo "$as_me:15119: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:17185: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
   egrep -v '^ *\+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:15125: \$? = $ac_status" >&5
+  echo "$as_me:17191: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_cxx_preproc_warn_flag
@@ -15150,7 +17216,7 @@
 if $ac_preproc_ok; then
   :
 else
-  { { echo "$as_me:15153: error: C++ preprocessor \"$CXXCPP\" fails sanity check" >&5
+  { { echo "$as_me:17219: error: C++ preprocessor \"$CXXCPP\" fails sanity check" >&5
 echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check" >&2;}
    { (exit 1); exit 1; }; }
 fi
@@ -15165,23 +17231,23 @@
 for ac_header in iostream typeinfo
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-echo "$as_me:15168: checking for $ac_header" >&5
+echo "$as_me:17234: checking for $ac_header" >&5
 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
 if eval "test \"\${$as_ac_Header+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 15174 "configure"
+#line 17240 "configure"
 #include "confdefs.h"
 #include <$ac_header>
 _ACEOF
-if { (eval echo "$as_me:15178: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:17244: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
   egrep -v '^ *\+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:15184: \$? = $ac_status" >&5
+  echo "$as_me:17250: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_cxx_preproc_warn_flag
@@ -15200,7 +17266,7 @@
 fi
 rm -f conftest.err conftest.$ac_ext
 fi
-echo "$as_me:15203: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "$as_me:17269: result: `eval echo '${'$as_ac_Header'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
   cat >>confdefs.h <<EOF
@@ -15211,10 +17277,10 @@
 done
 
     if test x"$ac_cv_header_iostream" = xyes ; then
-        echo "$as_me:15214: checking if iostream uses std-namespace" >&5
+        echo "$as_me:17280: checking if iostream uses std-namespace" >&5
 echo $ECHO_N "checking if iostream uses std-namespace... $ECHO_C" >&6
         cat >conftest.$ac_ext <<_ACEOF
-#line 15217 "configure"
+#line 17283 "configure"
 #include "confdefs.h"
 
 #include <iostream>
@@ -15231,16 +17297,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:15234: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:17300: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:15237: \$? = $ac_status" >&5
+  echo "$as_me:17303: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:15240: \"$ac_try\"") >&5
+  { (eval echo "$as_me:17306: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:15243: \$? = $ac_status" >&5
+  echo "$as_me:17309: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_iostream_namespace=yes
 else
@@ -15249,7 +17315,7 @@
 cf_iostream_namespace=no
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
-        echo "$as_me:15252: result: $cf_iostream_namespace" >&5
+        echo "$as_me:17318: result: $cf_iostream_namespace" >&5
 echo "${ECHO_T}$cf_iostream_namespace" >&6
         if test "$cf_iostream_namespace" = yes ; then
             cat >>confdefs.h <<\EOF
@@ -15259,7 +17325,7 @@
         fi
     fi
 
-echo "$as_me:15262: checking if we should include stdbool.h" >&5
+echo "$as_me:17328: checking if we should include stdbool.h" >&5
 echo $ECHO_N "checking if we should include stdbool.h... $ECHO_C" >&6
 
 if test "${cf_cv_header_stdbool_h+set}" = set; then
@@ -15267,7 +17333,7 @@
 else
 
 	cat >conftest.$ac_ext <<_ACEOF
-#line 15270 "configure"
+#line 17336 "configure"
 #include "confdefs.h"
 
 int
@@ -15279,23 +17345,23 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:15282: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:17348: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:15285: \$? = $ac_status" >&5
+  echo "$as_me:17351: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:15288: \"$ac_try\"") >&5
+  { (eval echo "$as_me:17354: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:15291: \$? = $ac_status" >&5
+  echo "$as_me:17357: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_header_stdbool_h=0
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
 cat >conftest.$ac_ext <<_ACEOF
-#line 15298 "configure"
+#line 17364 "configure"
 #include "confdefs.h"
 
 #ifndef __BEOS__
@@ -15311,16 +17377,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:15314: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:17380: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:15317: \$? = $ac_status" >&5
+  echo "$as_me:17383: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:15320: \"$ac_try\"") >&5
+  { (eval echo "$as_me:17386: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:15323: \$? = $ac_status" >&5
+  echo "$as_me:17389: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_header_stdbool_h=1
 else
@@ -15334,13 +17400,13 @@
 fi
 
 if test "$cf_cv_header_stdbool_h" = 1
-then	echo "$as_me:15337: result: yes" >&5
+then	echo "$as_me:17403: result: yes" >&5
 echo "${ECHO_T}yes" >&6
-else	echo "$as_me:15339: result: no" >&5
+else	echo "$as_me:17405: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
-echo "$as_me:15343: checking for builtin bool type" >&5
+echo "$as_me:17409: checking for builtin bool type" >&5
 echo $ECHO_N "checking for builtin bool type... $ECHO_C" >&6
 
 if test "${cf_cv_builtin_bool+set}" = set; then
@@ -15348,7 +17414,7 @@
 else
 
 	cat >conftest.$ac_ext <<_ACEOF
-#line 15351 "configure"
+#line 17417 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -15363,16 +17429,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:15366: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:17432: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:15369: \$? = $ac_status" >&5
+  echo "$as_me:17435: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:15372: \"$ac_try\"") >&5
+  { (eval echo "$as_me:17438: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:15375: \$? = $ac_status" >&5
+  echo "$as_me:17441: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_builtin_bool=1
 else
@@ -15385,13 +17451,13 @@
 fi
 
 if test "$cf_cv_builtin_bool" = 1
-then	echo "$as_me:15388: result: yes" >&5
+then	echo "$as_me:17454: result: yes" >&5
 echo "${ECHO_T}yes" >&6
-else	echo "$as_me:15390: result: no" >&5
+else	echo "$as_me:17456: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
-echo "$as_me:15394: checking for size of bool" >&5
+echo "$as_me:17460: checking for size of bool" >&5
 echo $ECHO_N "checking for size of bool... $ECHO_C" >&6
 if test "${cf_cv_type_of_bool+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -15402,7 +17468,7 @@
   cf_cv_type_of_bool=unknown
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 15405 "configure"
+#line 17471 "configure"
 #include "confdefs.h"
 
 #include <stdlib.h>
@@ -15444,15 +17510,15 @@
 
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:15447: \"$ac_link\"") >&5
+if { (eval echo "$as_me:17513: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:15450: \$? = $ac_status" >&5
+  echo "$as_me:17516: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:15452: \"$ac_try\"") >&5
+  { (eval echo "$as_me:17518: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:15455: \$? = $ac_status" >&5
+  echo "$as_me:17521: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_type_of_bool=`cat cf_test.out`
 		 if test -z "$cf_cv_type_of_bool"; then
@@ -15470,18 +17536,18 @@
 fi
 
 	rm -f cf_test.out
-echo "$as_me:15473: result: $cf_cv_type_of_bool" >&5
+echo "$as_me:17539: result: $cf_cv_type_of_bool" >&5
 echo "${ECHO_T}$cf_cv_type_of_bool" >&6
 if test "$cf_cv_type_of_bool" = unknown ; then
 	case .$NCURSES_BOOL in #(vi
 	.auto|.) NCURSES_BOOL=unsigned;;
 	esac
-	{ echo "$as_me:15479: WARNING: Assuming $NCURSES_BOOL for type of bool" >&5
+	{ echo "$as_me:17545: WARNING: Assuming $NCURSES_BOOL for type of bool" >&5
 echo "$as_me: WARNING: Assuming $NCURSES_BOOL for type of bool" >&2;}
 	cf_cv_type_of_bool=$NCURSES_BOOL
 fi
 
-echo "$as_me:15484: checking for special defines needed for etip.h" >&5
+echo "$as_me:17550: checking for special defines needed for etip.h" >&5
 echo $ECHO_N "checking for special defines needed for etip.h... $ECHO_C" >&6
 cf_save_CXXFLAGS="$CXXFLAGS"
 cf_result="none"
@@ -15493,7 +17559,7 @@
 	test -n "$cf_math" && CXXFLAGS="$CXXFLAGS -DETIP_NEEDS_${cf_math}"
 	test -n "$cf_excp" && CXXFLAGS="$CXXFLAGS -DETIP_NEEDS_${cf_excp}"
 cat >conftest.$ac_ext <<_ACEOF
-#line 15496 "configure"
+#line 17562 "configure"
 #include "confdefs.h"
 
 #include <etip.h.in>
@@ -15507,16 +17573,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:15510: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:17576: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:15513: \$? = $ac_status" >&5
+  echo "$as_me:17579: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:15516: \"$ac_try\"") >&5
+  { (eval echo "$as_me:17582: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:15519: \$? = $ac_status" >&5
+  echo "$as_me:17585: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
 	test -n "$cf_math" && cat >>confdefs.h <<EOF
@@ -15537,12 +17603,12 @@
 rm -f conftest.$ac_objext conftest.$ac_ext
 done
 done
-echo "$as_me:15540: result: $cf_result" >&5
+echo "$as_me:17606: result: $cf_result" >&5
 echo "${ECHO_T}$cf_result" >&6
 CXXFLAGS="$cf_save_CXXFLAGS"
 
 if test -n "$CXX"; then
-echo "$as_me:15545: checking if $CXX accepts parameter initialization" >&5
+echo "$as_me:17611: checking if $CXX accepts parameter initialization" >&5
 echo $ECHO_N "checking if $CXX accepts parameter initialization... $ECHO_C" >&6
 if test "${cf_cv_cpp_param_init+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -15559,7 +17625,7 @@
   cf_cv_cpp_param_init=unknown
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 15562 "configure"
+#line 17628 "configure"
 #include "confdefs.h"
 
 class TEST {
@@ -15578,15 +17644,15 @@
 
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:15581: \"$ac_link\"") >&5
+if { (eval echo "$as_me:17647: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:15584: \$? = $ac_status" >&5
+  echo "$as_me:17650: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:15586: \"$ac_try\"") >&5
+  { (eval echo "$as_me:17652: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:15589: \$? = $ac_status" >&5
+  echo "$as_me:17655: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_cpp_param_init=yes
 else
@@ -15605,7 +17671,7 @@
 ac_main_return=return
 
 fi
-echo "$as_me:15608: result: $cf_cv_cpp_param_init" >&5
+echo "$as_me:17674: result: $cf_cv_cpp_param_init" >&5
 echo "${ECHO_T}$cf_cv_cpp_param_init" >&6
 fi
 test "$cf_cv_cpp_param_init" = yes && cat >>confdefs.h <<\EOF
@@ -15614,7 +17680,7 @@
 
 if test -n "$CXX"; then
 
-echo "$as_me:15617: checking if $CXX accepts static_cast" >&5
+echo "$as_me:17683: checking if $CXX accepts static_cast" >&5
 echo $ECHO_N "checking if $CXX accepts static_cast... $ECHO_C" >&6
 if test "${cf_cv_cpp_static_cast+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -15628,7 +17694,7 @@
 ac_main_return=return
 
 	cat >conftest.$ac_ext <<_ACEOF
-#line 15631 "configure"
+#line 17697 "configure"
 #include "confdefs.h"
 
 class NCursesPanel
@@ -15672,16 +17738,16 @@
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:15675: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:17741: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:15678: \$? = $ac_status" >&5
+  echo "$as_me:17744: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:15681: \"$ac_try\"") >&5
+  { (eval echo "$as_me:17747: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:15684: \$? = $ac_status" >&5
+  echo "$as_me:17750: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_cpp_static_cast=yes
 else
@@ -15699,7 +17765,7 @@
 ac_main_return=return
 
 fi
-echo "$as_me:15702: result: $cf_cv_cpp_static_cast" >&5
+echo "$as_me:17768: result: $cf_cv_cpp_static_cast" >&5
 echo "${ECHO_T}$cf_cv_cpp_static_cast" >&6
 
 fi
@@ -15709,12 +17775,12 @@
 EOF
 
 	CXX_AR='$(AR)'
-	CXX_AR_OPTS='$(AR_OPTS)'
+	CXX_ARFLAGS='$(ARFLAGS)'
 	case $cf_cv_system_name in #(vi
 	irix*) #(vi
 	    if test "$GXX" != yes ; then
 		CXX_AR='$(CXX)'
-		CXX_AR_OPTS='-ar -o'
+		CXX_ARFLAGS='-ar -o'
 	    fi
 	    ;;
 	sco3.2v5*) #(vi
@@ -15723,7 +17789,7 @@
 	solaris2*)
 	    if test "$GXX" != yes ; then
 		CXX_AR='$(CXX)'
-		CXX_AR_OPTS='-xar -o'
+		CXX_ARFLAGS='-xar -o'
 	    fi
 	    ;;
 	esac
@@ -15747,7 +17813,7 @@
 	else
 		if test "$cf_cv_header_stdbool_h" = 1 ; then
 
-echo "$as_me:15750: checking for size of bool" >&5
+echo "$as_me:17816: checking for size of bool" >&5
 echo $ECHO_N "checking for size of bool... $ECHO_C" >&6
 if test "${cf_cv_type_of_bool+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -15758,7 +17824,7 @@
   cf_cv_type_of_bool=unknown
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 15761 "configure"
+#line 17827 "configure"
 #include "confdefs.h"
 
 #include <stdlib.h>
@@ -15800,15 +17866,15 @@
 
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:15803: \"$ac_link\"") >&5
+if { (eval echo "$as_me:17869: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:15806: \$? = $ac_status" >&5
+  echo "$as_me:17872: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:15808: \"$ac_try\"") >&5
+  { (eval echo "$as_me:17874: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:15811: \$? = $ac_status" >&5
+  echo "$as_me:17877: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_type_of_bool=`cat cf_test.out`
 		 if test -z "$cf_cv_type_of_bool"; then
@@ -15826,25 +17892,25 @@
 fi
 
 	rm -f cf_test.out
-echo "$as_me:15829: result: $cf_cv_type_of_bool" >&5
+echo "$as_me:17895: result: $cf_cv_type_of_bool" >&5
 echo "${ECHO_T}$cf_cv_type_of_bool" >&6
 if test "$cf_cv_type_of_bool" = unknown ; then
 	case .$NCURSES_BOOL in #(vi
 	.auto|.) NCURSES_BOOL=unsigned;;
 	esac
-	{ echo "$as_me:15835: WARNING: Assuming $NCURSES_BOOL for type of bool" >&5
+	{ echo "$as_me:17901: WARNING: Assuming $NCURSES_BOOL for type of bool" >&5
 echo "$as_me: WARNING: Assuming $NCURSES_BOOL for type of bool" >&2;}
 	cf_cv_type_of_bool=$NCURSES_BOOL
 fi
 
 		else
-			echo "$as_me:15841: checking for fallback type of bool" >&5
+			echo "$as_me:17907: checking for fallback type of bool" >&5
 echo $ECHO_N "checking for fallback type of bool... $ECHO_C" >&6
 			case "$host_cpu" in #(vi
 			i?86)	cf_cv_type_of_bool=char	;; #(vi
 			*)	cf_cv_type_of_bool=int	;;
 			esac
-			echo "$as_me:15847: result: $cf_cv_type_of_bool" >&5
+			echo "$as_me:17913: result: $cf_cv_type_of_bool" >&5
 echo "${ECHO_T}$cf_cv_type_of_bool" >&6
 		fi
 	fi
@@ -15871,19 +17937,20 @@
 
 if test -f "${srcdir}/Ada95/Makefile.in" ; then
 
-if test "$cf_with_ada" != "no" ; then
-    if test "$with_libtool" != "no"; then
-	{ echo "$as_me:15876: WARNING: libtool does not support Ada - disabling feature" >&5
+	if test "$cf_with_ada" != "no" ; then
+		if test "$with_libtool" != "no"; then
+			{ echo "$as_me:17942: WARNING: libtool does not support Ada - disabling feature" >&5
 echo "$as_me: WARNING: libtool does not support Ada - disabling feature" >&2;}
-	cf_with_ada=no
-    fi
-fi
+			cf_with_ada=no
+		fi
+	fi
+
+	if test "$cf_with_ada" != "no" ; then
 
-if test "$cf_with_ada" != "no" ; then
 cf_ada_make=gnatmake
 # Extract the first word of "$cf_ada_make", so it can be a program name with args.
 set dummy $cf_ada_make; ac_word=$2
-echo "$as_me:15886: checking for $ac_word" >&5
+echo "$as_me:17953: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_gnat_exists+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -15898,7 +17965,7 @@
   test -z "$ac_dir" && ac_dir=.
   $as_executable_p "$ac_dir/$ac_word" || continue
 ac_cv_prog_gnat_exists="yes"
-echo "$as_me:15901: found $ac_dir/$ac_word" >&5
+echo "$as_me:17968: found $ac_dir/$ac_word" >&5
 break
 done
 
@@ -15907,45 +17974,90 @@
 fi
 gnat_exists=$ac_cv_prog_gnat_exists
 if test -n "$gnat_exists"; then
-  echo "$as_me:15910: result: $gnat_exists" >&5
+  echo "$as_me:17977: result: $gnat_exists" >&5
 echo "${ECHO_T}$gnat_exists" >&6
 else
-  echo "$as_me:15913: result: no" >&5
+  echo "$as_me:17980: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
-if test "$ac_cv_prog_gnat_exists" = no; then
-   cf_ada_make=
+if test "$ac_cv_prog_gnat_exists" = no; then
+   cf_ada_make=
+else
+
+echo "$as_me:17988: checking for gnat version" >&5
+echo $ECHO_N "checking for gnat version... $ECHO_C" >&6
+cf_gnat_version=`${cf_ada_make:-gnatmake} -v 2>&1 | \
+	grep '[0-9].[0-9][0-9]*' |\
+    sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
+echo "$as_me:17993: result: $cf_gnat_version" >&5
+echo "${ECHO_T}$cf_gnat_version" >&6
+
+case $cf_gnat_version in #(vi
+3.1[1-9]*|3.[2-9]*|[4-9].*) #(vi
+	cf_cv_prog_gnat_correct=yes
+	;;
+*)
+	{ echo "$as_me:18001: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&5
+echo "$as_me: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&2;}
+	cf_cv_prog_gnat_correct=no
+	;;
+esac
+
+echo "$as_me:18007: checking if GNAT supports generics" >&5
+echo $ECHO_N "checking if GNAT supports generics... $ECHO_C" >&6
+case $cf_gnat_version in #(vi
+3.[1-9]*|[4-9].*) #(vi
+	cf_gnat_generics=yes
+	;;
+*)
+	cf_gnat_generics=no
+	;;
+esac
+echo "$as_me:18017: result: $cf_gnat_generics" >&5
+echo "${ECHO_T}$cf_gnat_generics" >&6
+
+if test "$cf_gnat_generics" = yes
+then
+	cf_compile_generics=generics
+	cf_generic_objects="\${GENOBJS}"
 else
+	cf_compile_generics=
+	cf_generic_objects=
+fi
 
-echo "$as_me:15921: checking for gnat version" >&5
-echo $ECHO_N "checking for gnat version... $ECHO_C" >&6
-cf_gnat_version=`${cf_ada_make-gnatmake} -v 2>&1 | grep '[0-9].[0-9][0-9]*' |\
-  sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
-echo "$as_me:15925: result: $cf_gnat_version" >&5
-echo "${ECHO_T}$cf_gnat_version" >&6
-
-case $cf_gnat_version in
-  3.1[1-9]*|3.[2-9]*|[4-9].*)
-    cf_cv_prog_gnat_correct=yes
-    ;;
-  *) echo Unsupported GNAT version $cf_gnat_version. Required is 3.11 or better. Disabling Ada95 binding.
-     cf_cv_prog_gnat_correct=no
-     ;;
-esac
-case $cf_gnat_version in
-  3.[1-9]*|[4-9].*)
-      cf_compile_generics=generics
-      cf_generic_objects="\${GENOBJS}"
-      ;;
-  *)  cf_compile_generics=
-      cf_generic_objects=
-      ;;
+echo "$as_me:18029: checking if GNAT supports project files" >&5
+echo $ECHO_N "checking if GNAT supports project files... $ECHO_C" >&6
+case $cf_gnat_version in #(vi
+3.[0-9]*) #(vi
+	cf_gnat_projects=no
+	;;
+*)
+	case $cf_cv_system_name in #(vi
+	cygwin*) #(vi
+		cf_gnat_projects=no
+		;;
+	*)
+		cf_gnat_projects=yes
+		;;
+	esac
+	;;
 esac
+echo "$as_me:18046: result: $cf_gnat_projects" >&5
+echo "${ECHO_T}$cf_gnat_projects" >&6
+
+if test "$cf_gnat_projects" = yes
+then
+	USE_OLD_MAKERULES="#"
+	USE_GNAT_PROJECTS=""
+else
+	USE_OLD_MAKERULES=""
+	USE_GNAT_PROJECTS="#"
+fi
 
    # Extract the first word of "m4", so it can be a program name with args.
 set dummy m4; ac_word=$2
-echo "$as_me:15948: checking for $ac_word" >&5
+echo "$as_me:18060: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_prog_M4_exists+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -15960,7 +18072,7 @@
   test -z "$ac_dir" && ac_dir=.
   $as_executable_p "$ac_dir/$ac_word" || continue
 ac_cv_prog_M4_exists="yes"
-echo "$as_me:15963: found $ac_dir/$ac_word" >&5
+echo "$as_me:18075: found $ac_dir/$ac_word" >&5
 break
 done
 
@@ -15969,10 +18081,10 @@
 fi
 M4_exists=$ac_cv_prog_M4_exists
 if test -n "$M4_exists"; then
-  echo "$as_me:15972: result: $M4_exists" >&5
+  echo "$as_me:18084: result: $M4_exists" >&5
 echo "${ECHO_T}$M4_exists" >&6
 else
-  echo "$as_me:15975: result: no" >&5
+  echo "$as_me:18087: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -15981,10 +18093,10 @@
       echo Ada95 binding required program m4 not found. Ada95 binding disabled.
    fi
    if test "$cf_cv_prog_gnat_correct" = yes; then
-      echo "$as_me:15984: checking if GNAT works" >&5
+      echo "$as_me:18096: checking if GNAT works" >&5
 echo $ECHO_N "checking if GNAT works... $ECHO_C" >&6
 
-rm -f conftest*
+rm -rf conftest*
 cat >>conftest.ads <<CF_EOF
 procedure conftest;
 CF_EOF
@@ -16007,19 +18119,24 @@
 else
    cf_cv_prog_gnat_correct=no
 fi
-rm -f conftest*
+rm -rf conftest*
 
-      echo "$as_me:16012: result: $cf_cv_prog_gnat_correct" >&5
+      echo "$as_me:18124: result: $cf_cv_prog_gnat_correct" >&5
 echo "${ECHO_T}$cf_cv_prog_gnat_correct" >&6
    fi
 fi
-if test	"$cf_cv_prog_gnat_correct" = yes; then
-   ADAFLAGS="-O3 -gnatpn $ADAFLAGS"
 
-   echo "$as_me:16019: checking if GNAT pragma Unreferenced works" >&5
+		if test	"$cf_cv_prog_gnat_correct" = yes; then
+
+ 	ADAFLAGS="$ADAFLAGS -O3 -gnatpn"
+
+echo "$as_me:18133: checking if GNAT pragma Unreferenced works" >&5
 echo $ECHO_N "checking if GNAT pragma Unreferenced works... $ECHO_C" >&6
+if test "${cf_cv_pragma_unreferenced+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
 
-rm -f conftest*
+rm -rf conftest*
 cat >>conftest.ads <<CF_EOF
 procedure conftest;
 CF_EOF
@@ -16041,17 +18158,21 @@
 else
    cf_cv_pragma_unreferenced=no
 fi
-rm -f conftest*
+rm -rf conftest*
 
-   echo "$as_me:16046: result: $cf_cv_pragma_unreferenced" >&5
+fi
+echo "$as_me:18164: result: $cf_cv_pragma_unreferenced" >&5
 echo "${ECHO_T}$cf_cv_pragma_unreferenced" >&6
 
-   # if the pragma is supported, use it (needed in the Trace code).
-   if test $cf_cv_pragma_unreferenced = yes ; then
-      PRAGMA_UNREF=TRUE
-   else
-      PRAGMA_UNREF=FALSE
-   fi
+# if the pragma is supported, use it (needed in the Trace code).
+if test $cf_cv_pragma_unreferenced = yes ; then
+	PRAGMA_UNREF=TRUE
+else
+	PRAGMA_UNREF=FALSE
+fi
+
+echo "$as_me:18174: checking for ada-compiler" >&5
+echo $ECHO_N "checking for ada-compiler... $ECHO_C" >&6
 
 # Check whether --with-ada-compiler or --without-ada-compiler was given.
 if test "${with_ada_compiler+set}" = set; then
@@ -16061,15 +18182,21 @@
   cf_ada_compiler=gnatmake
 fi;
 
-   cf_ada_package=terminal_interface
+echo "$as_me:18185: result: $cf_ada_compiler" >&5
+echo "${ECHO_T}$cf_ada_compiler" >&6
+
+			cf_ada_package=terminal_interface
+
+echo "$as_me:18190: checking for ada-include" >&5
+echo $ECHO_N "checking for ada-include... $ECHO_C" >&6
 
 # Check whether --with-ada-include or --without-ada-include was given.
 if test "${with_ada_include+set}" = set; then
   withval="$with_ada_include"
 
 else
-  withval="${ADA_INCLUDE-$prefix/lib/ada/adainclude}"
-fi; if test -n "$prefix/lib/ada/adainclude" ; then
+  withval="${ADA_INCLUDE:-$prefix/share/ada/adainclude}"
+fi; if test -n "$prefix/share/ada/adainclude" ; then
 
 if test "x$prefix" != xNONE; then
   cf_path_syntax="$prefix"
@@ -16096,7 +18223,7 @@
   withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
   ;;
 *)
-  { { echo "$as_me:16099: error: expected a pathname, not \"$withval\"" >&5
+  { { echo "$as_me:18226: error: expected a pathname, not \"$withval\"" >&5
 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
    { (exit 1); exit 1; }; }
   ;;
@@ -16105,12 +18232,18 @@
 fi
 ADA_INCLUDE="$withval"
 
+echo "$as_me:18235: result: $ADA_INCLUDE" >&5
+echo "${ECHO_T}$ADA_INCLUDE" >&6
+
+echo "$as_me:18238: checking for ada-objects" >&5
+echo $ECHO_N "checking for ada-objects... $ECHO_C" >&6
+
 # Check whether --with-ada-objects or --without-ada-objects was given.
 if test "${with_ada_objects+set}" = set; then
   withval="$with_ada_objects"
 
 else
-  withval="${ADA_OBJECTS-$prefix/lib/ada/adalib}"
+  withval="${ADA_OBJECTS:-$prefix/lib/ada/adalib}"
 fi; if test -n "$prefix/lib/ada/adalib" ; then
 
 if test "x$prefix" != xNONE; then
@@ -16138,7 +18271,7 @@
   withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
   ;;
 *)
-  { { echo "$as_me:16141: error: expected a pathname, not \"$withval\"" >&5
+  { { echo "$as_me:18274: error: expected a pathname, not \"$withval\"" >&5
 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
    { (exit 1); exit 1; }; }
   ;;
@@ -16147,10 +18280,38 @@
 fi
 ADA_OBJECTS="$withval"
 
+echo "$as_me:18283: result: $ADA_OBJECTS" >&5
+echo "${ECHO_T}$ADA_OBJECTS" >&6
+
+echo "$as_me:18286: checking if an Ada95 shared-library should be built" >&5
+echo $ECHO_N "checking if an Ada95 shared-library should be built... $ECHO_C" >&6
+
+# Check whether --with-ada-sharedlib or --without-ada-sharedlib was given.
+if test "${with_ada_sharedlib+set}" = set; then
+  withval="$with_ada_sharedlib"
+  with_ada_sharedlib=$withval
+else
+  with_ada_sharedlib=no
+fi;
+echo "$as_me:18296: result: $with_ada_sharedlib" >&5
+echo "${ECHO_T}$with_ada_sharedlib" >&6
+
+ADA_SHAREDLIB='lib$(LIB_NAME).so.1'
+MAKE_ADA_SHAREDLIB="#"
+
+if test "x$with_ada_sharedlib" != xno
+then
+	MAKE_ADA_SHAREDLIB=
+	if test "x$with_ada_sharedlib" != xyes
+	then
+		ADA_SHAREDLIB="$with_ada_sharedlib"
+	fi
 fi
-fi
+
+		fi
+	fi
 else
-   cf_with_ada=no
+	cf_with_ada=no
 fi
 
 ### Construct the ncurses library-subsets, if any, from this set of keywords:
@@ -16163,7 +18324,7 @@
 ### chooses to split module lists into libraries.
 ###
 ### (see CF_LIB_RULES).
-echo "$as_me:16166: checking for library subsets" >&5
+echo "$as_me:18327: checking for library subsets" >&5
 echo $ECHO_N "checking for library subsets... $ECHO_C" >&6
 LIB_SUBSETS=
 
@@ -16178,6 +18339,7 @@
 
 LIB_SUBSETS="${LIB_SUBSETS}termlib"
 test "$with_ext_funcs" = yes && LIB_SUBSETS="${LIB_SUBSETS}+ext_tinfo"
+
 if test "$with_termlib" != no ; then
 	LIB_SUBSETS="${LIB_SUBSETS} "
 else
@@ -16185,17 +18347,32 @@
 fi
 
 LIB_SUBSETS="${LIB_SUBSETS}base"
+
+# Most term-driver calls are to tinfo, but some like init_pair are to the
+# base library (so it resides in base).
+if test "$with_term_driver" != no ; then
+	LIB_SUBSETS="${LIB_SUBSETS}+port_drivers"
+	case $cf_cv_system_name in #(vi
+	*mingw32*) #(vi
+		LIB_SUBSETS="${LIB_SUBSETS}+port_tinfo+port_win32con"
+		;;
+	*) #(vi
+		LIB_SUBSETS="${LIB_SUBSETS}+port_tinfo"
+		;;
+	esac
+fi
+
 test "$with_widec"     = yes && LIB_SUBSETS="${LIB_SUBSETS}+widechar"
 test "$with_ext_funcs" = yes && LIB_SUBSETS="${LIB_SUBSETS}+ext_funcs"
 
-echo "$as_me:16191: result: $LIB_SUBSETS" >&5
+echo "$as_me:18368: result: $LIB_SUBSETS" >&5
 echo "${ECHO_T}$LIB_SUBSETS" >&6
 
 ### Construct the list of include-directories to be generated
 
-CPPFLAGS="-I. -I../include $CPPFLAGS"
+CPPFLAGS="$CPPFLAGS -I. -I../include"
 if test "$srcdir" != "."; then
-	CPPFLAGS="-I\${srcdir}/../include $CPPFLAGS"
+	CPPFLAGS="$CPPFLAGS -I\${srcdir}/../include"
 fi
 if test "$GCC" != yes; then
 	CPPFLAGS="$CPPFLAGS -I\${includedir}"
@@ -16209,7 +18386,7 @@
 	fi
 fi
 
-ACPPFLAGS="-I. -I../../include $ACPPFLAGS"
+ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS"
 if test "$srcdir" != "."; then
 	ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS"
 fi
@@ -16226,7 +18403,7 @@
 fi
 
 ### Build up pieces for makefile rules
-echo "$as_me:16229: checking default library suffix" >&5
+echo "$as_me:18406: checking default library suffix" >&5
 echo $ECHO_N "checking default library suffix... $ECHO_C" >&6
 
 	case $DFT_LWR_MODEL in
@@ -16237,46 +18414,50 @@
 	shared)  DFT_ARG_SUFFIX=''   ;;
 	esac
 	test -n "$LIB_SUFFIX" && DFT_ARG_SUFFIX="${LIB_SUFFIX}${DFT_ARG_SUFFIX}"
-echo "$as_me:16240: result: $DFT_ARG_SUFFIX" >&5
+echo "$as_me:18417: result: $DFT_ARG_SUFFIX" >&5
 echo "${ECHO_T}$DFT_ARG_SUFFIX" >&6
 
-echo "$as_me:16243: checking default library-dependency suffix" >&5
+echo "$as_me:18420: checking default library-dependency suffix" >&5
 echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6
 
-	case $DFT_LWR_MODEL in
-	libtool)
+	case $DFT_LWR_MODEL in #(vi
+	libtool) #(vi
 		DFT_LIB_SUFFIX='.la'
 		DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
 		;;
-	normal)
+	normal) #(vi
 		DFT_LIB_SUFFIX='.a'
 		DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
 		;;
-	debug)
+	debug) #(vi
 		DFT_LIB_SUFFIX='_g.a'
 		DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
 		;;
-	profile)
+	profile) #(vi
 		DFT_LIB_SUFFIX='_p.a'
 		DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
 		;;
-	shared)
+	shared) #(vi
 		case $cf_cv_system_name in
-		cygwin*)
+		aix[56]*) #(vi
+			DFT_LIB_SUFFIX='.a'
+			DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
+			;;
+		cygwin*) #(vi
 			DFT_LIB_SUFFIX='.dll'
 			DFT_DEP_SUFFIX='.dll.a'
 			;;
-		darwin*)
+		darwin*) #(vi
 			DFT_LIB_SUFFIX='.dylib'
 			DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
 			;;
-		hpux*)
+		hpux*) #(vi
 			case $target in
-			ia64*)
+			ia64*) #(vi
 				DFT_LIB_SUFFIX='.so'
 				DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
 				;;
-			*)
+			*) #(vi
 				DFT_LIB_SUFFIX='.sl'
 				DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
 				;;
@@ -16289,10 +18470,10 @@
 	esac
 	test -n "$LIB_SUFFIX" && DFT_LIB_SUFFIX="${LIB_SUFFIX}${DFT_LIB_SUFFIX}"
 	test -n "$LIB_SUFFIX" && DFT_DEP_SUFFIX="${LIB_SUFFIX}${DFT_DEP_SUFFIX}"
-echo "$as_me:16292: result: $DFT_DEP_SUFFIX" >&5
+echo "$as_me:18473: result: $DFT_DEP_SUFFIX" >&5
 echo "${ECHO_T}$DFT_DEP_SUFFIX" >&6
 
-echo "$as_me:16295: checking default object directory" >&5
+echo "$as_me:18476: checking default object directory" >&5
 echo $ECHO_N "checking default object directory... $ECHO_C" >&6
 
 	case $DFT_LWR_MODEL in
@@ -16308,51 +18489,55 @@
 			DFT_OBJ_SUBDIR='obj_s' ;;
 		esac
 	esac
-echo "$as_me:16311: result: $DFT_OBJ_SUBDIR" >&5
+echo "$as_me:18492: result: $DFT_OBJ_SUBDIR" >&5
 echo "${ECHO_T}$DFT_OBJ_SUBDIR" >&6
 
 # libtool thinks it can make c++ shared libraries (perhaps only g++)
 if test "$cf_with_cxx" = yes ; then
-echo "$as_me:16316: checking c++ library-dependency suffix" >&5
+echo "$as_me:18497: checking c++ library-dependency suffix" >&5
 echo $ECHO_N "checking c++ library-dependency suffix... $ECHO_C" >&6
 if test "$with_libtool" != "no"; then
 	CXX_LIB_SUFFIX=$DFT_DEP_SUFFIX
 else
 
-	case normal in
-	libtool)
+	case normal in #(vi
+	libtool) #(vi
 		CXX_LIB_SUFFIX='.la'
 		CXX_DEP_SUFFIX=$CXX_LIB_SUFFIX
 		;;
-	normal)
+	normal) #(vi
 		CXX_LIB_SUFFIX='.a'
 		CXX_DEP_SUFFIX=$CXX_LIB_SUFFIX
 		;;
-	debug)
+	debug) #(vi
 		CXX_LIB_SUFFIX='_g.a'
 		CXX_DEP_SUFFIX=$CXX_LIB_SUFFIX
 		;;
-	profile)
+	profile) #(vi
 		CXX_LIB_SUFFIX='_p.a'
 		CXX_DEP_SUFFIX=$CXX_LIB_SUFFIX
 		;;
-	shared)
+	shared) #(vi
 		case $cf_cv_system_name in
-		cygwin*)
+		aix[56]*) #(vi
+			CXX_LIB_SUFFIX='.a'
+			CXX_DEP_SUFFIX=$CXX_LIB_SUFFIX
+			;;
+		cygwin*) #(vi
 			CXX_LIB_SUFFIX='.dll'
 			CXX_DEP_SUFFIX='.dll.a'
 			;;
-		darwin*)
+		darwin*) #(vi
 			CXX_LIB_SUFFIX='.dylib'
 			CXX_DEP_SUFFIX=$CXX_LIB_SUFFIX
 			;;
-		hpux*)
+		hpux*) #(vi
 			case $target in
-			ia64*)
+			ia64*) #(vi
 				CXX_LIB_SUFFIX='.so'
 				CXX_DEP_SUFFIX=$CXX_LIB_SUFFIX
 				;;
-			*)
+			*) #(vi
 				CXX_LIB_SUFFIX='.sl'
 				CXX_DEP_SUFFIX=$CXX_LIB_SUFFIX
 				;;
@@ -16366,7 +18551,7 @@
 	test -n "$LIB_SUFFIX" && CXX_LIB_SUFFIX="${LIB_SUFFIX}${CXX_LIB_SUFFIX}"
 	test -n "$LIB_SUFFIX" && CXX_DEP_SUFFIX="${LIB_SUFFIX}${CXX_DEP_SUFFIX}"
 fi
-echo "$as_me:16369: result: $CXX_LIB_SUFFIX" >&5
+echo "$as_me:18554: result: $CXX_LIB_SUFFIX" >&5
 echo "${ECHO_T}$CXX_LIB_SUFFIX" >&6
 
 fi
@@ -16431,6 +18616,8 @@
 		TEST_ARGS="${TEST_DEPS}"
 		TEST_ARG2="${TEST_DEP2}"
 		TINFO_ARGS="-L${LIB_DIR} $TEST_ARGS"
+		TICS_LIST="$SHLIB_LIST $TEST_ARGS"
+		SHLIB_LIST="${SHLIB_LIST} $TEST_ARGS"
 	else
 		TEST_ARGS="-l${TINFO_ARG_SUFFIX}"
 		TEST_ARG2="-l${TINFO_ARG_SUFFIX}"
@@ -16480,7 +18667,7 @@
 
 if test "$GCC" = yes ; then
 	case $cf_cv_system_name in #(
-	OS/2*|os2*|aix[45]*) 	#( vi
+	OS/2*|os2*|aix[4]*|solaris2.1[0-9]|darwin*) 	#( vi
 		LDFLAGS_STATIC=
 		LDFLAGS_SHARED=
 		;;
@@ -16491,7 +18678,7 @@
     esac
 else
 	case $cf_cv_system_name in #(
-	aix[45]*) 	#( from ld manpage
+	aix[456]*) 	#( from ld manpage
 		LDFLAGS_STATIC=-bstatic
 		LDFLAGS_SHARED=-bdynamic
 		;;
@@ -16516,15 +18703,93 @@
 	esac
 fi
 
+if test -n "$LDFLAGS_STATIC" && test -n "$LDFLAGS_SHARED"
+then
+	echo "$as_me:18708: checking if linker supports switching between static/dynamic" >&5
+echo $ECHO_N "checking if linker supports switching between static/dynamic... $ECHO_C" >&6
+
+	rm -f libconftest.a
+	cat >conftest.$ac_ext <<EOF
+#line 18713 "configure"
+#include <stdio.h>
+int cf_ldflags_static(FILE *fp) { return fflush(fp); }
+EOF
+	if { (eval echo "$as_me:18717: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:18720: \$? = $ac_status" >&5
+  (exit $ac_status); } ; then
+		( $AR $ARFLAGS libconftest.a conftest.o ) 2>&5 1>/dev/null
+		( eval $RANLIB libconftest.a ) 2>&5 >/dev/null
+	fi
+	rm -f conftest.*
+
+	cf_save_LIBS="$LIBS"
+
+	LIBS="$LDFLAGS_STATIC -L`pwd` -lconftest $LDFLAGS_DYNAMIC $LIBS"
+	cat >conftest.$ac_ext <<_ACEOF
+#line 18731 "configure"
+#include "confdefs.h"
+
+#line 18734 "configure"
+#include <stdio.h>
+int cf_ldflags_static(FILE *fp);
+
+int
+main ()
+{
+
+	return cf_ldflags_static(stdin);
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:18749: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:18752: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:18755: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:18758: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_ldflags_static=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_ldflags_static=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+
+	rm -f libconftest.*
+	LIBS="$cf_save_LIBS"
+
+	echo "$as_me:18771: result: $cf_ldflags_static" >&5
+echo "${ECHO_T}$cf_ldflags_static" >&6
+
+	if test $cf_ldflags_static != yes
+	then
+		LDFLAGS_STATIC=
+		LDFLAGS_SHARED=
+	fi
+else
+	LDFLAGS_STATIC=
+	LDFLAGS_SHARED=
+fi
+
 	;;
 esac
 
-echo "$as_me:16522: checking where we will install curses.h" >&5
+echo "$as_me:18787: checking where we will install curses.h" >&5
 echo $ECHO_N "checking where we will install curses.h... $ECHO_C" >&6
 test "$with_overwrite" = no && \
 test "x$includedir" = 'x${prefix}/include' && \
 	includedir='${prefix}/include/ncurses'${LIB_SUFFIX}
-echo "$as_me:16527: result: $includedir" >&5
+echo "$as_me:18792: result: $includedir" >&5
 echo "${ECHO_T}$includedir" >&6
 
 ### Resolve a conflict between normal and wide-curses by forcing applications
@@ -16532,10 +18797,11 @@
 if test "$with_overwrite" != no ; then
 if test "$NCURSES_LIBUTF8" = 1 ; then
 	NCURSES_LIBUTF8='defined(HAVE_LIBUTF8_H)'
-	{ echo "$as_me:16535: WARNING: Wide-character applications must define HAVE_LIBUTF8_H to include curses.h" >&5
+	{ echo "$as_me:18800: WARNING: Wide-character applications must define HAVE_LIBUTF8_H to include curses.h" >&5
 echo "$as_me: WARNING: Wide-character applications must define HAVE_LIBUTF8_H to include curses.h" >&2;}
 fi
 fi
+WITH_OVERWRITE=$with_overwrite
 
 # used to separate tack out of the tree
 NCURSES_TREE=
@@ -16548,7 +18814,7 @@
 ### Construct the list of subdirectories for which we'll customize makefiles
 ### with the appropriate compile-rules.
 
-echo "$as_me:16551: checking for src modules" >&5
+echo "$as_me:18817: checking for src modules" >&5
 echo $ECHO_N "checking for src modules... $ECHO_C" >&6
 
 # dependencies and linker-arguments for test-programs
@@ -16611,25 +18877,34 @@
 		fi
 	fi
 done
-echo "$as_me:16614: result: $cf_cv_src_modules" >&5
+echo "$as_me:18880: result: $cf_cv_src_modules" >&5
 echo "${ECHO_T}$cf_cv_src_modules" >&6
 
 TEST_ARGS="-L${LIB_DIR} $TEST_ARGS"
 TEST_ARG2="-L${LIB_2ND} $TEST_ARG2"
 
-SRC_SUBDIRS="man include"
+SRC_SUBDIRS=
+if test "x$cf_with_manpages" != xno ; then
+	SRC_SUBDIRS="$SRC_SUBDIRS man"
+fi
+SRC_SUBDIRS="$SRC_SUBDIRS include"
 for cf_dir in $cf_cv_src_modules
 do
 	SRC_SUBDIRS="$SRC_SUBDIRS $cf_dir"
 done
-SRC_SUBDIRS="$SRC_SUBDIRS test"
+if test "x$cf_with_tests" != "xno" ; then
+	SRC_SUBDIRS="$SRC_SUBDIRS test"
+fi
 test -z "$MAKE_TERMINFO" && SRC_SUBDIRS="$SRC_SUBDIRS misc"
 test "$cf_with_cxx_binding" != no && SRC_SUBDIRS="$SRC_SUBDIRS c++"
 
 ADA_SUBDIRS=
 if test "$cf_cv_prog_gnat_correct" = yes && test -f $srcdir/Ada95/Makefile.in; then
-   SRC_SUBDIRS="$SRC_SUBDIRS Ada95"
-   ADA_SUBDIRS="gen src samples"
+	SRC_SUBDIRS="$SRC_SUBDIRS Ada95"
+	ADA_SUBDIRS="gen src"
+	if test "x$cf_with_tests" != "xno" ; then
+		ADA_SUBDIRS="$ADA_SUBDIRS samples"
+	fi
 fi
 
 SUB_MAKEFILES=
@@ -16639,15 +18914,16 @@
 done
 
 if test -n "$ADA_SUBDIRS"; then
-   for cf_dir in $ADA_SUBDIRS
-   do
-      SUB_MAKEFILES="$SUB_MAKEFILES Ada95/$cf_dir/Makefile"
-   done
+	for cf_dir in $ADA_SUBDIRS
+	do
+		SUB_MAKEFILES="$SUB_MAKEFILES Ada95/$cf_dir/Makefile"
+	done
 
 fi
 
 if test "$cf_with_ada" != "no" && test "$cf_cv_prog_gnat_correct" != "no"; then
-   SUB_MAKEFILES="$SUB_MAKEFILES Ada95/gen/adacurses-config"
+   SUB_MAKEFILES="$SUB_MAKEFILES Ada95/gen/adacurses${DFT_ARG_SUFFIX}-config:Ada95/gen/adacurses-config.in"
+   SUB_MAKEFILES="$SUB_MAKEFILES man/adacurses${DFT_ARG_SUFFIX}-config.1:man/MKada_config.in"
 fi
 
 DIRS_TO_MAKE="lib"
@@ -16679,8 +18955,12 @@
 	test ! -d $cf_dir && mkdir $cf_dir
 done
 
+# symbols that differ when compiling Ada95 by itself.
+NCURSES_SHLIB2='sh $(top_srcdir)/misc/shlib'
+
+# values to use as strings
 cat >>confdefs.h <<EOF
-#define NCURSES_PATHSEP '$PATHSEP'
+#define NCURSES_PATHSEP '$PATH_SEPARATOR'
 EOF
 
 cat >>confdefs.h <<EOF
@@ -16705,8 +18985,8 @@
 			cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
 
 			test "${cf_add_cflags}" != "${cf_tst_cflags}" \
-			&& test -z "${cf_tst_cflags}" \
-			&& cf_fix_cppflags=yes
+				&& test -z "${cf_tst_cflags}" \
+				&& cf_fix_cppflags=yes
 
 			if test $cf_fix_cppflags = yes ; then
 				cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
@@ -16721,6 +19001,16 @@
 		*$cf_add_cflags) #(vi
 			;;
 		*) #(vi
+			case $cf_add_cflags in #(vi
+			-D*)
+				cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
+
+CPPFLAGS=`echo "$CPPFLAGS" | \
+	sed	-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?[ 	]/ /g' \
+		-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?$//g'`
+
+				;;
+			esac
 			cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
 			;;
 		esac
@@ -16736,8 +19026,8 @@
 	cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
 
 	test "${cf_add_cflags}" != "${cf_tst_cflags}" \
-	&& test -z "${cf_tst_cflags}" \
-	&& cf_fix_cppflags=no
+		&& test -z "${cf_tst_cflags}" \
+		&& cf_fix_cppflags=no
 	;;
 esac
 done
@@ -16749,7 +19039,7 @@
 
 if test -n "$cf_new_cppflags" ; then
 
-	CPPFLAGS="$cf_new_cppflags $CPPFLAGS"
+	CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
 fi
 
 if test -n "$cf_new_extra_cppflags" ; then
@@ -16757,77 +19047,6 @@
 	EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
 fi
 
-### If we're building with rpath, try to link non-standard libs that way too.
-if test "$DFT_LWR_MODEL" = "shared"; then
-
-echo "$as_me:16763: checking for updated LDFLAGS" >&5
-echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6
-if test -n "$LDFLAGS" ; then
-echo "$as_me:16766: result: maybe" >&5
-echo "${ECHO_T}maybe" >&6
-test -n "$verbose" && echo "	...checking LDFLAGS $LDFLAGS" 1>&6
-
-echo "${as_me-configure}:16770: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
-
-test -n "$verbose" && echo "	...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
-
-echo "${as_me-configure}:16774: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
-
-case "$EXTRA_LDFLAGS" in #(vi
--Wl,-rpath,*) #(vi
-	cf_rpath_hack="-Wl,-rpath,"
-	;;
--R\ *)
-	cf_rpath_hack="-R "
-	;;
--R*)
-	cf_rpath_hack="-R"
-	;;
-*)
-	cf_rpath_hack=
-	;;
-esac
-if test -n "$cf_rpath_hack" ; then
-	cf_rpath_dst=
-	for cf_rpath_src in $LDFLAGS
-	do
-		test -n "$verbose" && echo "	Filtering $cf_rpath_src" 1>&6
-
-echo "${as_me-configure}:16796: testing Filtering $cf_rpath_src ..." 1>&5
-
-		case $cf_rpath_src in #(vi
-		-L*) #(vi
-			if test "$cf_rpath_hack" = "-R " ; then
-				cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e 's%-L%-R %'`
-			else
-				cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e s%-L%$cf_rpath_hack%`
-			fi
-			test -n "$verbose" && echo "	...Filter $cf_rpath_tmp" 1>&6
-
-echo "${as_me-configure}:16807: testing ...Filter $cf_rpath_tmp ..." 1>&5
-
-			EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
-			;;
-		esac
-		cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
-	done
-	LDFLAGS=$cf_rpath_dst
-	test -n "$verbose" && echo "	...checked LDFLAGS $LDFLAGS" 1>&6
-
-echo "${as_me-configure}:16817: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
-
-	test -n "$verbose" && echo "	...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
-
-echo "${as_me-configure}:16821: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
-
-fi
-else
-echo "$as_me:16825: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-fi
-
 ### Define substitutions for header files to avoid name-pollution
 
 if test "$cf_cv_have_tcgetattr" = yes ; then
@@ -16849,9 +19068,80 @@
 fi
 
 ################################################################################
-test "$use_database" = yes && SUB_MAKEFILES="$SUB_MAKEFILES misc/run_tic.sh:misc/run_tic.in"
+test "$use_database" = yes && \
+SUB_MAKEFILES="$SUB_MAKEFILES misc/run_tic.sh:misc/run_tic.in"
+
 SUB_MAKEFILES="$SUB_MAKEFILES misc/ncurses-config:misc/ncurses-config.in"
-ac_config_files="$ac_config_files include/MKterm.h.awk include/curses.head:include/curses.h.in include/termcap.h include/unctrl.h $SUB_MAKEFILES Makefile"
+SUB_MAKEFILES="$SUB_MAKEFILES man/ncurses${DFT_ARG_SUFFIX}${cf_cv_abi_version}-config.1:man/MKncu_config.in"
+
+if test x"$enable_pc_files" = xyes ; then \
+SUB_MAKEFILES="$SUB_MAKEFILES misc/gen-pkgconfig:misc/gen-pkgconfig.in"
+MAKE_PC_FILES=
+else
+MAKE_PC_FILES="#"
+fi
+
+# Extract the first word of "tic", so it can be a program name with args.
+set dummy tic; ac_word=$2
+echo "$as_me:19086: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_TIC_PATH+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $TIC_PATH in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_TIC_PATH="$TIC_PATH" # Let the user override the test with a path.
+  ;;
+  *)
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH:/usr/local/ncurses/bin"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  if $as_executable_p "$ac_dir/$ac_word"; then
+   ac_cv_path_TIC_PATH="$ac_dir/$ac_word"
+   echo "$as_me:19103: found $ac_dir/$ac_word" >&5
+   break
+fi
+done
+
+  test -z "$ac_cv_path_TIC_PATH" && ac_cv_path_TIC_PATH="unknown"
+  ;;
+esac
+fi
+TIC_PATH=$ac_cv_path_TIC_PATH
+
+if test -n "$TIC_PATH"; then
+  echo "$as_me:19115: result: $TIC_PATH" >&5
+echo "${ECHO_T}$TIC_PATH" >&6
+else
+  echo "$as_me:19118: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+if test -n "$FALLBACK_LIST"
+then
+	if test "$TIC_PATH" = unknown
+	then
+		{ echo "$as_me:19126: WARNING: no tic program found for fallbacks" >&5
+echo "$as_me: WARNING: no tic program found for fallbacks" >&2;}
+	fi
+fi
+
+if test "x$cf_with_tests" != xno ; then
+	MAKE_TESTS=
+else
+	MAKE_TESTS="#"
+fi
+
+SUB_SCRIPTS=
+case $cf_cv_system_name in #(vi
+*mingw32*) #(vi
+	SUB_SCRIPTS="mk-dlls.sh"
+	;;
+esac
+
+ac_config_files="$ac_config_files include/MKterm.h.awk include/curses.head:include/curses.h.in include/ncurses_dll.h include/termcap.h include/unctrl.h $SUB_SCRIPTS $SUB_MAKEFILES Makefile"
 ac_config_commands="$ac_config_commands default"
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
@@ -16932,7 +19222,7 @@
 : ${CONFIG_STATUS=./config.status}
 ac_clean_files_save=$ac_clean_files
 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ echo "$as_me:16935: creating $CONFIG_STATUS" >&5
+{ echo "$as_me:19225: creating $CONFIG_STATUS" >&5
 echo "$as_me: creating $CONFIG_STATUS" >&6;}
 cat >$CONFIG_STATUS <<_ACEOF
 #! $SHELL
@@ -17058,13 +19348,13 @@
 Configuration commands:
 $config_commands
 
-Report bugs to <bug-autoconf@gnu.org>."
+Report bugs to <dickey@invisible-island.net>."
 EOF
 
 cat >>$CONFIG_STATUS <<EOF
 ac_cs_version="\\
 config.status
-configured by $0, generated by GNU Autoconf 2.52.20080325,
+configured by $0, generated by GNU Autoconf 2.52.20101001,
   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
 
 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
@@ -17108,7 +19398,7 @@
     echo "$ac_cs_version"; exit 0 ;;
   --he | --h)
     # Conflict between --help and --header
-    { { echo "$as_me:17111: error: ambiguous option: $1
+    { { echo "$as_me:19401: error: ambiguous option: $1
 Try \`$0 --help' for more information." >&5
 echo "$as_me: error: ambiguous option: $1
 Try \`$0 --help' for more information." >&2;}
@@ -17127,7 +19417,7 @@
     ac_need_defaults=false;;
 
   # This is an error.
-  -*) { { echo "$as_me:17130: error: unrecognized option: $1
+  -*) { { echo "$as_me:19420: error: unrecognized option: $1
 Try \`$0 --help' for more information." >&5
 echo "$as_me: error: unrecognized option: $1
 Try \`$0 --help' for more information." >&2;}
@@ -17146,7 +19436,7 @@
 ## Running config.status.  ##
 ## ----------------------- ##
 
-This file was extended by $as_me 2.52.20080325, executed with
+This file was extended by $as_me 2.52.20101001, executed with
   CONFIG_FILES    = $CONFIG_FILES
   CONFIG_HEADERS  = $CONFIG_HEADERS
   CONFIG_LINKS    = $CONFIG_LINKS
@@ -17170,10 +19460,12 @@
 DFT_LWR_MODEL="$DFT_LWR_MODEL"
 ECHO_LINK="$ECHO_LINK"
 LDCONFIG="$LDCONFIG"
+LIBTOOL_VERSION="$LIBTOOL_VERSION"
 LIB_NAME="$LIB_NAME"
 LIB_SUBSETS="$LIB_SUBSETS"
 LIB_SUFFIX="$LIB_SUFFIX"
 LIB_TRACING="$LIB_TRACING"
+LN_S="$LN_S"
 MAKE_TERMINFO="$MAKE_TERMINFO"
 NCURSES_MAJOR="$NCURSES_MAJOR"
 NCURSES_MINOR="$NCURSES_MINOR"
@@ -17181,13 +19473,15 @@
 NCURSES_PATCH="$NCURSES_PATCH"
 SRC_SUBDIRS="$SRC_SUBDIRS"
 TERMINFO="$TERMINFO"
+TICS_ARG_SUFFIX="$TICS_ARG_SUFFIX"
+TICS_LIB_SUFFIX="$TICS_LIB_SUFFIX"
+TICS_NAME="$TICS_NAME"
+TIC_PATH="$TIC_PATH"
 TINFO_ARG_SUFFIX="$TINFO_ARG_SUFFIX"
 TINFO_LIB_SUFFIX="$TINFO_LIB_SUFFIX"
 TINFO_NAME="$TINFO_NAME"
 TINFO_SUFFIX="$TINFO_SUFFIX"
-TICS_ARG_SUFFIX="$TICS_ARG_SUFFIX"
-TICS_LIB_SUFFIX="$TICS_LIB_SUFFIX"
-TICS_NAME="$TICS_NAME"
+USE_OLD_MAKERULES="$USE_OLD_MAKERULES"
 WITH_CURSES_H="$with_curses_h"
 WITH_ECHO="$with_echo"
 WITH_OVERWRITE="$with_overwrite"
@@ -17205,7 +19499,10 @@
 cf_cv_shlib_version="$cf_cv_shlib_version"
 cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix"
 cf_cv_system_name="$cf_cv_system_name"
+cf_with_ada="$cf_with_ada"
 cf_with_cxx_binding="$cf_with_cxx_binding"
+cf_with_manpages="$cf_with_manpages"
+cf_with_tests="$cf_with_tests"
 host="$host"
 target="$target"
 
@@ -17218,13 +19515,15 @@
   # Handling of arguments.
   "include/MKterm.h.awk" ) CONFIG_FILES="$CONFIG_FILES include/MKterm.h.awk" ;;
   "include/curses.head" ) CONFIG_FILES="$CONFIG_FILES include/curses.head:include/curses.h.in" ;;
+  "include/ncurses_dll.h" ) CONFIG_FILES="$CONFIG_FILES include/ncurses_dll.h" ;;
   "include/termcap.h" ) CONFIG_FILES="$CONFIG_FILES include/termcap.h" ;;
   "include/unctrl.h" ) CONFIG_FILES="$CONFIG_FILES include/unctrl.h" ;;
+  "$SUB_SCRIPTS" ) CONFIG_FILES="$CONFIG_FILES $SUB_SCRIPTS" ;;
   "$SUB_MAKEFILES" ) CONFIG_FILES="$CONFIG_FILES $SUB_MAKEFILES" ;;
   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
   "include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;;
-  *) { { echo "$as_me:17227: error: invalid argument: $ac_config_target" >&5
+  *) { { echo "$as_me:19526: error: invalid argument: $ac_config_target" >&5
 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
    { (exit 1); exit 1; }; };;
   esac
@@ -17349,7 +19648,11 @@
 s,@LINT@,$LINT,;t t
 s,@LINT_OPTS@,$LINT_OPTS,;t t
 s,@LN_S@,$LN_S,;t t
+s,@PKG_CONFIG@,$PKG_CONFIG,;t t
+s,@PKG_CONFIG_LIBDIR@,$PKG_CONFIG_LIBDIR,;t t
 s,@SET_MAKE@,$SET_MAKE,;t t
+s,@CTAGS@,$CTAGS,;t t
+s,@ETAGS@,$ETAGS,;t t
 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
 s,@cf_cv_makeflags@,$cf_cv_makeflags,;t t
@@ -17359,7 +19662,7 @@
 s,@ac_ct_LD@,$ac_ct_LD,;t t
 s,@AR@,$AR,;t t
 s,@ac_ct_AR@,$ac_ct_AR,;t t
-s,@AR_OPTS@,$AR_OPTS,;t t
+s,@ARFLAGS@,$ARFLAGS,;t t
 s,@DESTDIR@,$DESTDIR,;t t
 s,@BUILD_CC@,$BUILD_CC,;t t
 s,@BUILD_CPP@,$BUILD_CPP,;t t
@@ -17370,7 +19673,9 @@
 s,@BUILD_EXEEXT@,$BUILD_EXEEXT,;t t
 s,@BUILD_OBJEXT@,$BUILD_OBJEXT,;t t
 s,@cf_list_models@,$cf_list_models,;t t
+s,@LIBTOOL_VERSION@,$LIBTOOL_VERSION,;t t
 s,@LIBTOOL@,$LIBTOOL,;t t
+s,@LT_UNDEF@,$LT_UNDEF,;t t
 s,@LIBTOOL_CXX@,$LIBTOOL_CXX,;t t
 s,@LIBTOOL_OPTS@,$LIBTOOL_OPTS,;t t
 s,@LIB_CREATE@,$LIB_CREATE,;t t
@@ -17392,6 +19697,7 @@
 s,@CXX_G_OPT@,$CXX_G_OPT,;t t
 s,@LD_MODEL@,$LD_MODEL,;t t
 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
+s,@LD_RPATH_OPT@,$LD_RPATH_OPT,;t t
 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
 s,@MK_SHARED_LIB@,$MK_SHARED_LIB,;t t
 s,@LINK_PROGS@,$LINK_PROGS,;t t
@@ -17400,8 +19706,8 @@
 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
 s,@LOCAL_LDFLAGS2@,$LOCAL_LDFLAGS2,;t t
 s,@INSTALL_LIB@,$INSTALL_LIB,;t t
+s,@cf_ldd_prog@,$cf_ldd_prog,;t t
 s,@TERMINFO_SRC@,$TERMINFO_SRC,;t t
-s,@PATHSEP@,$PATHSEP,;t t
 s,@FALLBACK_LIST@,$FALLBACK_LIST,;t t
 s,@WHICH_XTERM@,$WHICH_XTERM,;t t
 s,@TERMINFO_DIRS@,$TERMINFO_DIRS,;t t
@@ -17423,19 +19729,26 @@
 s,@NCURSES_BOOL@,$NCURSES_BOOL,;t t
 s,@TERMINFO_CAPS@,$TERMINFO_CAPS,;t t
 s,@NCURSES_OSPEED@,$NCURSES_OSPEED,;t t
+s,@NCURSES_CCHARW_MAX@,$NCURSES_CCHARW_MAX,;t t
 s,@MANPAGE_RENAMES@,$MANPAGE_RENAMES,;t t
 s,@NCURSES_EXT_FUNCS@,$NCURSES_EXT_FUNCS,;t t
+s,@GENERATED_EXT_FUNCS@,$GENERATED_EXT_FUNCS,;t t
+s,@NCURSES_SP_FUNCS@,$NCURSES_SP_FUNCS,;t t
+s,@GENERATED_SP_FUNCS@,$GENERATED_SP_FUNCS,;t t
 s,@NCURSES_CONST@,$NCURSES_CONST,;t t
 s,@NCURSES_EXT_COLORS@,$NCURSES_EXT_COLORS,;t t
 s,@NCURSES_MOUSE_VERSION@,$NCURSES_MOUSE_VERSION,;t t
 s,@NCURSES_SBOOL@,$NCURSES_SBOOL,;t t
 s,@NCURSES_XNAMES@,$NCURSES_XNAMES,;t t
+s,@NCURSES_INTEROP_FUNCS@,$NCURSES_INTEROP_FUNCS,;t t
 s,@PTHREAD@,$PTHREAD,;t t
 s,@cf_cv_enable_reentrant@,$cf_cv_enable_reentrant,;t t
 s,@cf_cv_enable_opaque@,$cf_cv_enable_opaque,;t t
 s,@NCURSES_OPAQUE@,$NCURSES_OPAQUE,;t t
 s,@NCURSES_SIZE_T@,$NCURSES_SIZE_T,;t t
+s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
 s,@ECHO_LINK@,$ECHO_LINK,;t t
+s,@ADAFLAGS@,$ADAFLAGS,;t t
 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
 s,@EXTRA_CXXFLAGS@,$EXTRA_CXXFLAGS,;t t
 s,@ADA_TRACE@,$ADA_TRACE,;t t
@@ -17446,23 +19759,27 @@
 s,@cf_cv_typeof_mmask_t@,$cf_cv_typeof_mmask_t,;t t
 s,@HAVE_VSSCANF@,$HAVE_VSSCANF,;t t
 s,@TEST_LIBS@,$TEST_LIBS,;t t
+s,@TEST_LIBS2@,$TEST_LIBS2,;t t
 s,@CXXCPP@,$CXXCPP,;t t
 s,@CXXLDFLAGS@,$CXXLDFLAGS,;t t
 s,@CXX_AR@,$CXX_AR,;t t
-s,@CXX_AR_OPTS@,$CXX_AR_OPTS,;t t
+s,@CXX_ARFLAGS@,$CXX_ARFLAGS,;t t
 s,@CXXLIBS@,$CXXLIBS,;t t
 s,@USE_CXX_BOOL@,$USE_CXX_BOOL,;t t
 s,@gnat_exists@,$gnat_exists,;t t
+s,@cf_compile_generics@,$cf_compile_generics,;t t
+s,@cf_generic_objects@,$cf_generic_objects,;t t
+s,@USE_OLD_MAKERULES@,$USE_OLD_MAKERULES,;t t
+s,@USE_GNAT_PROJECTS@,$USE_GNAT_PROJECTS,;t t
 s,@M4_exists@,$M4_exists,;t t
 s,@cf_ada_make@,$cf_ada_make,;t t
+s,@PRAGMA_UNREF@,$PRAGMA_UNREF,;t t
 s,@cf_ada_compiler@,$cf_ada_compiler,;t t
 s,@cf_ada_package@,$cf_ada_package,;t t
-s,@ADAFLAGS@,$ADAFLAGS,;t t
-s,@cf_compile_generics@,$cf_compile_generics,;t t
-s,@cf_generic_objects@,$cf_generic_objects,;t t
-s,@PRAGMA_UNREF@,$PRAGMA_UNREF,;t t
 s,@ADA_INCLUDE@,$ADA_INCLUDE,;t t
 s,@ADA_OBJECTS@,$ADA_OBJECTS,;t t
+s,@ADA_SHAREDLIB@,$ADA_SHAREDLIB,;t t
+s,@MAKE_ADA_SHAREDLIB@,$MAKE_ADA_SHAREDLIB,;t t
 s,@ACPPFLAGS@,$ACPPFLAGS,;t t
 s,@DFT_ARG_SUFFIX@,$DFT_ARG_SUFFIX,;t t
 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
@@ -17490,9 +19807,14 @@
 s,@TEST_DEP2@,$TEST_DEP2,;t t
 s,@ADA_SUBDIRS@,$ADA_SUBDIRS,;t t
 s,@DIRS_TO_MAKE@,$DIRS_TO_MAKE,;t t
+s,@NCURSES_SHLIB2@,$NCURSES_SHLIB2,;t t
 s,@HAVE_TCGETATTR@,$HAVE_TCGETATTR,;t t
 s,@HAVE_TERMIO_H@,$HAVE_TERMIO_H,;t t
 s,@HAVE_TERMIOS_H@,$HAVE_TERMIOS_H,;t t
+s,@MAKE_PC_FILES@,$MAKE_PC_FILES,;t t
+s,@cross_compiling@,$cross_compiling,;t t
+s,@TIC_PATH@,$TIC_PATH,;t t
+s,@MAKE_TESTS@,$MAKE_TESTS,;t t
 CEOF
 
 EOF
@@ -17607,7 +19929,7 @@
   esac
 
   if test x"$ac_file" != x-; then
-    { echo "$as_me:17610: creating $ac_file" >&5
+    { echo "$as_me:19932: creating $ac_file" >&5
 echo "$as_me: creating $ac_file" >&6;}
     rm -f "$ac_file"
   fi
@@ -17625,7 +19947,7 @@
       -) echo $tmp/stdin ;;
       [\\/$]*)
          # Absolute (can't be DOS-style, as IFS=:)
-         test -f "$f" || { { echo "$as_me:17628: error: cannot find input file: $f" >&5
+         test -f "$f" || { { echo "$as_me:19950: error: cannot find input file: $f" >&5
 echo "$as_me: error: cannot find input file: $f" >&2;}
    { (exit 1); exit 1; }; }
          echo $f;;
@@ -17638,7 +19960,7 @@
            echo $srcdir/$f
          else
            # /dev/null tree
-           { { echo "$as_me:17641: error: cannot find input file: $f" >&5
+           { { echo "$as_me:19963: error: cannot find input file: $f" >&5
 echo "$as_me: error: cannot find input file: $f" >&2;}
    { (exit 1); exit 1; }; }
          fi;;
@@ -17704,7 +20026,7 @@
   * )   ac_file_in=$ac_file.in ;;
   esac
 
-  test x"$ac_file" != x- && { echo "$as_me:17707: creating $ac_file" >&5
+  test x"$ac_file" != x- && { echo "$as_me:20029: creating $ac_file" >&5
 echo "$as_me: creating $ac_file" >&6;}
 
   # First look for the input files in the build tree, otherwise in the
@@ -17715,7 +20037,7 @@
       -) echo $tmp/stdin ;;
       [\\/$]*)
          # Absolute (can't be DOS-style, as IFS=:)
-         test -f "$f" || { { echo "$as_me:17718: error: cannot find input file: $f" >&5
+         test -f "$f" || { { echo "$as_me:20040: error: cannot find input file: $f" >&5
 echo "$as_me: error: cannot find input file: $f" >&2;}
    { (exit 1); exit 1; }; }
          echo $f;;
@@ -17728,7 +20050,7 @@
            echo $srcdir/$f
          else
            # /dev/null tree
-           { { echo "$as_me:17731: error: cannot find input file: $f" >&5
+           { { echo "$as_me:20053: error: cannot find input file: $f" >&5
 echo "$as_me: error: cannot find input file: $f" >&2;}
    { (exit 1); exit 1; }; }
          fi;;
@@ -17786,7 +20108,7 @@
   rm -f $tmp/in
   if test x"$ac_file" != x-; then
     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
-      { echo "$as_me:17789: $ac_file is unchanged" >&5
+      { echo "$as_me:20111: $ac_file is unchanged" >&5
 echo "$as_me: $ac_file is unchanged" >&6;}
     else
       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
@@ -17828,7 +20150,6 @@
 done
 EOF
 cat >>$CONFIG_STATUS <<\EOF
-
 #
 # CONFIG_COMMANDS section.
 #
@@ -17838,16 +20159,19 @@
 
   case $ac_dest in
     default )
+if test "x$cf_with_tests" != xno ; then
 
 for cf_dir in test
 do
 	if test ! -d $srcdir/$cf_dir; then
 		continue
 	elif test -f $srcdir/$cf_dir/programs; then
-		$AWK -f $srcdir/test/mk-test.awk ECHO_LINK="$ECHO_LINK" $srcdir/$cf_dir/programs >>$cf_dir/Makefile
+		$AWK -f $srcdir/test/mk-test.awk INSTALL=no ECHO_LINK="$ECHO_LINK" $srcdir/$cf_dir/programs >>$cf_dir/Makefile
 	fi
 done
 
+fi
+
 	case $cf_cv_system_name in #(vi
 	OS/2*|os2*) #(vi
         LIB_PREFIX=''
@@ -17862,6 +20186,23 @@
 	TINFO_SUFFIX=.dll
 fi
 
+if test -n "$TINFO_SUFFIX" ; then
+	case $TINFO_SUFFIX in
+	tw*)
+		TINFO_NAME="${TINFO_NAME}tw"
+		TINFO_SUFFIX=`echo $TINFO_SUFFIX | sed 's/^tw//'`
+		;;
+	t*)
+		TINFO_NAME="${TINFO_NAME}t"
+		TINFO_SUFFIX=`echo $TINFO_SUFFIX | sed 's/^t//'`
+		;;
+	w*)
+		TINFO_NAME="${TINFO_NAME}w"
+		TINFO_SUFFIX=`echo $TINFO_SUFFIX | sed 's/^w//'`
+		;;
+	esac
+fi
+
 for cf_dir in $SRC_SUBDIRS
 do
 	if test ! -d $srcdir/$cf_dir ; then
@@ -17873,40 +20214,44 @@
 		for cf_item in $cf_LIST_MODELS
 		do
 
-	case $cf_item in
-	libtool)
+	case $cf_item in #(vi
+	libtool) #(vi
 		cf_suffix='.la'
 		cf_depsuf=$cf_suffix
 		;;
-	normal)
+	normal) #(vi
 		cf_suffix='.a'
 		cf_depsuf=$cf_suffix
 		;;
-	debug)
+	debug) #(vi
 		cf_suffix='_g.a'
 		cf_depsuf=$cf_suffix
 		;;
-	profile)
+	profile) #(vi
 		cf_suffix='_p.a'
 		cf_depsuf=$cf_suffix
 		;;
-	shared)
+	shared) #(vi
 		case $cf_cv_system_name in
-		cygwin*)
+		aix[56]*) #(vi
+			cf_suffix='.a'
+			cf_depsuf=$cf_suffix
+			;;
+		cygwin*) #(vi
 			cf_suffix='.dll'
 			cf_depsuf='.dll.a'
 			;;
-		darwin*)
+		darwin*) #(vi
 			cf_suffix='.dylib'
 			cf_depsuf=$cf_suffix
 			;;
-		hpux*)
+		hpux*) #(vi
 			case $target in
-			ia64*)
+			ia64*) #(vi
 				cf_suffix='.so'
 				cf_depsuf=$cf_suffix
 				;;
-			*)
+			*) #(vi
 				cf_suffix='.sl'
 				cf_depsuf=$cf_suffix
 				;;
@@ -17927,6 +20272,14 @@
 					case "$cf_cv_system_name" in #(vi
 					darwin*)
 					case .${LIB_SUFFIX} in
+					.tw*)
+						cf_suffix=`echo $cf_suffix | sed 's/^tw//'`
+						cf_suffix=tw'.${REL_VERSION}'"$cf_suffix"
+						;;
+					.t*)
+						cf_suffix=`echo $cf_suffix | sed 's/^t//'`
+						cf_suffix=t'.${REL_VERSION}'"$cf_suffix"
+						;;
 					.w*)
 						cf_suffix=`echo $cf_suffix | sed 's/^w//'`
 						cf_suffix=w'.${REL_VERSION}'"$cf_suffix"
@@ -17943,6 +20296,14 @@
 					case "$cf_cv_system_name" in #(vi
 					darwin*)
 					case .${LIB_SUFFIX} in
+					.tw*)
+						cf_suffix=`echo $cf_suffix | sed 's/^tw//'`
+						cf_suffix=tw'.${ABI_VERSION}'"$cf_suffix"
+						;;
+					.t*)
+						cf_suffix=`echo $cf_suffix | sed 's/^t//'`
+						cf_suffix=t'.${ABI_VERSION}'"$cf_suffix"
+						;;
 					.w*)
 						cf_suffix=`echo $cf_suffix | sed 's/^w//'`
 						cf_suffix=w'.${ABI_VERSION}'"$cf_suffix"
@@ -18020,40 +20381,44 @@
 
 cf_ITEM=`echo "$cf_item" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
 
-	case $cf_item in
-	libtool)
+	case $cf_item in #(vi
+	libtool) #(vi
 		cf_suffix='.la'
 		cf_depsuf=$cf_suffix
 		;;
-	normal)
+	normal) #(vi
 		cf_suffix='.a'
 		cf_depsuf=$cf_suffix
 		;;
-	debug)
+	debug) #(vi
 		cf_suffix='_g.a'
 		cf_depsuf=$cf_suffix
 		;;
-	profile)
+	profile) #(vi
 		cf_suffix='_p.a'
 		cf_depsuf=$cf_suffix
 		;;
-	shared)
+	shared) #(vi
 		case $cf_cv_system_name in
-		cygwin*)
+		aix[56]*) #(vi
+			cf_suffix='.a'
+			cf_depsuf=$cf_suffix
+			;;
+		cygwin*) #(vi
 			cf_suffix='.dll'
 			cf_depsuf='.dll.a'
 			;;
-		darwin*)
+		darwin*) #(vi
 			cf_suffix='.dylib'
 			cf_depsuf=$cf_suffix
 			;;
-		hpux*)
+		hpux*) #(vi
 			case $target in
-			ia64*)
+			ia64*) #(vi
 				cf_suffix='.so'
 				cf_depsuf=$cf_suffix
 				;;
-			*)
+			*) #(vi
 				cf_suffix='.sl'
 				cf_depsuf=$cf_suffix
 				;;
@@ -18123,6 +20488,16 @@
  			if test "$cf_cv_shlib_version_infix" = yes ; then
 			if test -n "$LIB_SUFFIX" ; then
 				case $LIB_SUFFIX in
+				tw*)
+					cf_libname=`echo $cf_libname | sed 's/tw$//'`
+					cf_suffix=`echo $cf_suffix | sed 's/^tw//'`
+					cf_dir_suffix=tw
+					;;
+				t*)
+					cf_libname=`echo $cf_libname | sed 's/t$//'`
+					cf_suffix=`echo $cf_suffix | sed 's/^t//'`
+					cf_dir_suffix=t
+					;;
 				w*)
 					cf_libname=`echo $cf_libname | sed 's/w$//'`
 					cf_suffix=`echo $cf_suffix | sed 's/^w//'`
@@ -18140,17 +20515,19 @@
 				prefix=$cf_prefix \
 				suffix=$cf_suffix \
 				subset=$cf_subset \
+				SymLink="$LN_S" \
 				TermlibRoot=$TINFO_NAME \
 				TermlibSuffix=$TINFO_SUFFIX \
 				ShlibVer=$cf_cv_shlib_version \
 				ShlibVerInfix=$cf_cv_shlib_version_infix \
-				ReLink=${cf_cv_do_relink-no} \
+				ReLink=${cf_cv_do_relink:-no} \
 				DoLinks=$cf_cv_do_symlinks \
 				rmSoLocs=$cf_cv_rm_so_locs \
 				ldconfig="$LDCONFIG" \
 				overwrite=$WITH_OVERWRITE \
 				depend="$cf_depend" \
 				host="$host" \
+				libtool_version="$LIBTOOL_VERSION" \
 				$srcdir/$cf_dir/modules >>$cf_dir/Makefile
 
 			cf_suffix="$old_cf_suffix"
@@ -18234,18 +20611,28 @@
 install.libs uninstall.libs \\
 install.data uninstall.data ::
 $MAKE_TERMINFO	cd misc && \${MAKE} \${CF_MFLAGS} \$@
+CF_EOF
+
+if test "x$cf_with_manpages" = xyes; then
+cat >> Makefile <<CF_EOF
 
 install.man \\
 uninstall.man ::
 	cd man && \${MAKE} \${CF_MFLAGS} \$@
+CF_EOF
+fi
+
+cat >> Makefile <<CF_EOF
 
 distclean ::
 	rm -f config.cache config.log config.status Makefile include/ncurses_cfg.h
 	rm -f headers.sh headers.sed mk_shared_lib.sh
+	rm -f edit_man.* man_alias.*
 	rm -rf \${DIRS_TO_MAKE}
 CF_EOF
 
 # Special case: tack's manpage lives in its own directory.
+if test "x$cf_with_manpages" = xyes; then
 if test -d tack ; then
 if test -f $srcdir/$tack.h; then
 cat >> Makefile <<CF_EOF
@@ -18256,6 +20643,7 @@
 CF_EOF
 fi
 fi
+fi
 
 rm -f headers.sed headers.sh
 
@@ -18274,8 +20662,8 @@
 DST=\$1
 REF=\$2
 SRC=\$3
-TMPSRC=\${TMPDIR-/tmp}/\`basename \$SRC\`\$\$
-TMPSED=\${TMPDIR-/tmp}/headers.sed\$\$
+TMPSRC=\${TMPDIR:-/tmp}/\`basename \$SRC\`\$\$
+TMPSED=\${TMPDIR:-/tmp}/headers.sed\$\$
 echo installing \$SRC in \$DST
 CF_EOF
 
@@ -18363,6 +20751,11 @@
 	fi
 done
 
+if test "x$cf_with_ada" != xno ; then
+if test -z "$USE_OLD_MAKERULES" ; then
+	$AWK -f $srcdir/Ada95/mk-1st.awk <$srcdir/Ada95/src/modules >>Ada95/src/Makefile
+fi
+fi
  ;;
   esac
 done
@@ -18392,4 +20785,4 @@
   # would make configure fail if this is the last instruction.
   $ac_cs_success || { (exit 1); exit 1; }
 fi
-${MAKE-make} preinstall
+${MAKE:-make} preinstall
diff -Naur ncurses-5.7.orig/configure.in ncurses-5.7/configure.in
--- ncurses-5.7.orig/configure.in	2008-10-18 10:53:32.000000000 -0400
+++ ncurses-5.7/configure.in	2011-01-08 18:18:29.566655997 -0500
@@ -1,5 +1,5 @@
 dnl***************************************************************************
-dnl Copyright (c) 1998-2007,2008 Free Software Foundation, Inc.              *
+dnl Copyright (c) 1998-2009,2010 Free Software Foundation, Inc.              *
 dnl                                                                          *
 dnl Permission is hereby granted, free of charge, to any person obtaining a  *
 dnl copy of this software and associated documentation files (the            *
@@ -28,14 +28,14 @@
 dnl
 dnl Author: Thomas E. Dickey 1995-on
 dnl
-dnl $Id: configure.in,v 1.454 2008/10/18 14:53:32 tom Exp $
+dnl $Id: configure.in,v 1.514 2010/11/28 00:12:45 tom Exp $
 dnl Process this file with autoconf to produce a configure script.
 dnl
 dnl See http://invisible-island.net/autoconf/ for additional information.
 dnl
 dnl ---------------------------------------------------------------------------
 AC_PREREQ(2.13.20020210)
-AC_REVISION($Revision: 1.454 $)
+AC_REVISION($Revision: 1.514 $)
 AC_INIT(ncurses/base/lib_initscr.c)
 AC_CONFIG_HEADER(include/ncurses_cfg.h:include/ncurses_cfg.hin)
 
@@ -122,6 +122,13 @@
 	[cf_with_ada=yes])
 AC_MSG_RESULT($cf_with_ada)
 
+AC_MSG_CHECKING(if you want to install manpages)
+AC_ARG_WITH(manpages,
+	[  --without-manpages      suppress install of manpages],
+	[cf_with_manpages=$withval],
+	[cf_with_manpages=yes])
+AC_MSG_RESULT($cf_with_manpages)
+
 AC_MSG_CHECKING(if you want to build programs such as tic)
 AC_ARG_WITH(progs,
 	[  --without-progs         suppress build with programs (e.g., tic)],
@@ -129,6 +136,13 @@
 	[cf_with_progs=yes])
 AC_MSG_RESULT($cf_with_progs)
 
+AC_MSG_CHECKING(if you want to build test-programs)
+AC_ARG_WITH(tests,
+	[  --without-tests         suppress build with test-programs],
+	[cf_with_tests=$withval],
+	[cf_with_tests=yes])
+AC_MSG_RESULT($cf_with_tests)
+
 AC_MSG_CHECKING(if you wish to install curses.h)
 AC_ARG_WITH(curses-h,
 	[  --without-curses-h      install curses.h as ncurses.h only],
@@ -148,10 +162,35 @@
 CF_PROG_EGREP
 CF_PROG_INSTALL
 CF_PROG_LINT
-AC_PROG_LN_S
+CF_PROG_LN_S
 
 AC_SYS_LONG_FILE_NAMES
 
+# if we find pkg-config, check if we should install the ".pc" files.
+CF_PKG_CONFIG
+
+if test "$PKG_CONFIG" != no ; then
+	AC_MSG_CHECKING(if we should install .pc files for $PKG_CONFIG)
+
+	# Leave this as something that can be overridden in the environment.
+	if test -z "$PKG_CONFIG_LIBDIR" ; then
+		PKG_CONFIG_LIBDIR=`echo "$PKG_CONFIG" | sed -e 's,/[[^/]]*/[[^/]]*$,,'`/lib/pkgconfig
+	fi
+	PKG_CONFIG_LIBDIR=`echo "$PKG_CONFIG_LIBDIR" | sed -e 's/^://' -e 's/:.*//'`
+	if test -n "$PKG_CONFIG_LIBDIR" && test -d "$PKG_CONFIG_LIBDIR" ; then
+		AC_ARG_ENABLE(pc-files,
+			[  --enable-pc-files       generate and install .pc files for pkg-config],
+			[enable_pc_files=$enableval],
+			[enable_pc_files=no])
+		AC_MSG_RESULT($enable_pc_files)
+	else
+		AC_MSG_RESULT(no)
+		AC_MSG_WARN(did not find library $PKG_CONFIG_LIBDIR)
+		enable_pc_files=no
+	fi
+fi
+AC_SUBST(PKG_CONFIG_LIBDIR)
+
 AC_MSG_CHECKING(if we should assume mixed-case filenames)
 AC_ARG_ENABLE(mixed-case,
 	[  --enable-mixed-case     tic should assume mixed-case filenames],
@@ -176,7 +215,7 @@
 AC_CHECK_TOOL(RANLIB, ranlib, ':')
 AC_CHECK_TOOL(LD, ld, ld)
 AC_CHECK_TOOL(AR, ar, ar)
-CF_SUBST(archiver options,AR_OPTS,rv)
+CF_AR_FLAGS
 
 dnl Special option for use by system-builders: the install-prefix is used to
 dnl adjust the location into which the actual install is done, so that an
@@ -327,6 +366,7 @@
 		SHLIB_LIST="-ldl $SHLIB_LIST"
 	else
 		SHLIB_LIST="-lgpm $SHLIB_LIST"
+		CF_ADD_LIB(gpm,TEST_LIBS)
 	fi
 	AC_DEFINE(HAVE_LIBGPM)
 	CF_CHECK_GPM_WGETCH
@@ -380,6 +420,11 @@
 	done
 fi
 
+### If we're building with rpath, try to link non-standard libs that way too.
+if test "$DFT_LWR_MODEL" = "shared"; then
+	CF_DISABLE_RPATH_HACK
+fi
+
 ###############################################################################
 CF_HELP_MESSAGE(Fine-Tuning Your Configuration:)
 
@@ -413,7 +458,7 @@
 	AC_DEFINE(USE_DATABASE)
 
 	AC_MSG_CHECKING(which terminfo source-file will be installed)
-	AC_ARG_ENABLE(database,
+	AC_ARG_WITH(database,
 		[  --with-database=XXX     specify terminfo source to install],
 		[TERMINFO_SRC=$withval])
 	AC_MSG_RESULT($TERMINFO_SRC)
@@ -618,7 +663,7 @@
 AC_ARG_ENABLE(broken_linker,
 	[  --enable-broken_linker  compile with broken-linker support code],
 	[with_broken_linker=$enableval],
-	[with_broken_linker=${BROKEN_LINKER-no}])
+	[with_broken_linker=${BROKEN_LINKER:-no}])
 AC_MSG_RESULT($with_broken_linker)
 
 BROKEN_LINKER=0
@@ -655,7 +700,7 @@
 NCURSES_WINT_T=0
 
 # Check to define _XOPEN_SOURCE "automatically"
-CF_XOPEN_SOURCE
+CF_XOPEN_SOURCE(500)
 
 # Work around breakage on OS X
 CF_SIGWINCH
@@ -676,7 +721,15 @@
 if test "$with_widec" = yes ; then
 	LIB_SUFFIX="w${LIB_SUFFIX}"
 	AC_DEFINE(USE_WIDEC_SUPPORT)
-	CF_PREDEFINE(_XOPEN_SOURCE_EXTENDED)
+
+	case "$CFLAGS $CPPFLAGS" in #(vi
+	*-D_XOPEN_SOURCE=500) #(vi
+		;;
+	*)
+		CF_PREDEFINE(_XOPEN_SOURCE_EXTENDED)
+		;;
+	esac
+
 	# with_overwrite=no
 	NCURSES_CH_T=cchar_t
 	AC_CHECK_FUNCS(putwc btowc wctob mbtowc wctomb mblen mbrlen mbrtowc wcsrtombs mbsrtowcs wcstombs mbstowcs)
@@ -797,6 +850,15 @@
 	[NCURSES_MMASK_T=auto])
 AC_MSG_RESULT($NCURSES_MMASK_T)
 
+###   use option --with-ccharw-max to override CCHARW_MAX size
+AC_MSG_CHECKING(for size CCHARW_MAX)
+AC_ARG_WITH(ccharw-max,
+	[  --with-ccharw-max=XXX   override size CCHARW_MAX],
+	[NCURSES_CCHARW_MAX="$withval"],
+	[NCURSES_CCHARW_MAX=5])
+AC_MSG_RESULT($NCURSES_CCHARW_MAX)
+AC_SUBST(NCURSES_CCHARW_MAX)
+
 ### Enable compiling-in rcs id's
 AC_MSG_CHECKING(if RCS identifiers should be compiled-in)
 AC_ARG_WITH(rcs-ids,
@@ -807,7 +869,7 @@
 test "$with_rcs_ids" = yes && AC_DEFINE(USE_RCS_IDS)
 
 ###############################################################################
-CF_MAN_PAGES([ captoinfo clear infocmp infotocap tic toe tput ])
+CF_MAN_PAGES([ captoinfo clear infocmp infotocap tabs tic toe tput tset ])
 
 ###############################################################################
 CF_HELP_MESSAGE(Extensions:)
@@ -825,13 +887,47 @@
 	AC_DEFINE(HAVE_HAS_KEY)
 	AC_DEFINE(HAVE_RESIZETERM)
 	AC_DEFINE(HAVE_RESIZE_TERM)
+	AC_DEFINE(HAVE_TERM_ENTRY_H)
 	AC_DEFINE(HAVE_USE_DEFAULT_COLORS)
 	AC_DEFINE(HAVE_WRESIZE)
 	AC_DEFINE(NCURSES_EXT_FUNCS)
+	GENERATED_EXT_FUNCS=generated
 else
 	NCURSES_EXT_FUNCS=0
+	GENERATED_EXT_FUNCS=
 fi
 AC_SUBST(NCURSES_EXT_FUNCS)
+AC_SUBST(GENERATED_EXT_FUNCS)
+
+AC_MSG_CHECKING(if you want to build with experimental SCREEN extensions)
+AC_ARG_ENABLE(sp-funcs,
+	[  --enable-sp-funcs       enable experimental SCREEN-extensions],
+	[with_sp_funcs=$enableval],
+	[with_sp_funcs=no])
+AC_MSG_RESULT($with_sp_funcs)
+if test "$with_sp_funcs" = yes ; then
+	NCURSES_SP_FUNCS=1
+	AC_DEFINE(NCURSES_SP_FUNCS)
+	GENERATED_SP_FUNCS=generated
+else
+	NCURSES_SP_FUNCS=0
+	GENERATED_SP_FUNCS=
+fi
+AC_SUBST(NCURSES_SP_FUNCS)
+AC_SUBST(GENERATED_SP_FUNCS)
+
+AC_MSG_CHECKING(if you want to build with experimental terminal-driver)
+AC_ARG_ENABLE(term-driver,
+	[  --enable-term-driver    enable experimental terminal-driver],
+	[with_term_driver=$enableval],
+	[with_term_driver=no])
+AC_MSG_RESULT($with_term_driver)
+if test "$with_term_driver" = yes ; then
+	AC_DEFINE(USE_TERM_DRIVER)
+	if test "$with_sp_funcs" != yes ; then
+		AC_MSG_ERROR(The term-driver option relies upon sp-funcs)
+	fi
+fi
 
 ###   use option --enable-const to turn on use of const beyond that in XSI.
 AC_MSG_CHECKING(for extended use of const keyword)
@@ -973,30 +1069,55 @@
 ###   use option --enable-colorfgbg to turn on use of $COLORFGBG environment
 AC_MSG_CHECKING(if you want colorfgbg code)
 AC_ARG_ENABLE(colorfgbg,
-	[  --enable-colorfgbg      compile with $COLORFGBG code],
+	[  --enable-colorfgbg      compile-in experimental $COLORFGBG code],
 	[with_colorfgbg=$enableval],
 	[with_colorfgbg=no])
 AC_MSG_RESULT($with_colorfgbg)
 test "$with_colorfgbg" = yes && AC_DEFINE(USE_COLORFGBG)
 
+###   use option --enable-interop to turn on use of bindings used for interop
+AC_MSG_CHECKING(if you want interop bindings)
+AC_ARG_ENABLE(interop,
+	[  --enable-interop        compile-in experimental interop bindings],
+	[with_exp_interop=$enableval],
+	[with_exp_interop=no])
+AC_MSG_RESULT($with_exp_interop)
+
+NCURSES_INTEROP_FUNCS=0
+test "$with_exp_interop" = yes && NCURSES_INTEROP_FUNCS=1
+AC_SUBST(NCURSES_INTEROP_FUNCS)
+
 # This is still experimental (20080329), but should ultimately be moved to
 # the script-block --with-normal, etc.
 CF_WITH_PTHREAD
 
-AC_MSG_CHECKING(if you want to use weak-symbols for pthreads)
-AC_ARG_ENABLE(weak-symbols,
-    [  --enable-weak-symbols   enable weak-symbols for pthreads],
-    [use_weak_symbols=$withval],
-    [use_weak_symbols=no])
-AC_MSG_RESULT($use_weak_symbols)
-if test "$use_weak_symbols" = yes ; then
-    CF_WEAK_SYMBOLS
-else
-    cf_cv_weak_symbols=no
-fi
+if test "x$with_pthread" != xno; then
+	AC_CHECK_FUNC(pthread_kill,[
+		AC_MSG_CHECKING(if you want to allow EINTR in wgetch with pthreads)
+		AC_ARG_ENABLE(pthreads-eintr,
+			[  --enable-pthreads-eintr enable EINTR in wgetch with pthreads],
+			[use_pthreads_eintr=$enableval],
+			[use_pthreads_eintr=no])
+		AC_MSG_RESULT($use_pthreads_eintr)
+		if test $use_pthreads_eintr = yes ; then
+			AC_DEFINE(USE_PTHREADS_EINTR)
+		fi])
+
+	AC_MSG_CHECKING(if you want to use weak-symbols for pthreads)
+	AC_ARG_ENABLE(weak-symbols,
+		[  --enable-weak-symbols   enable weak-symbols for pthreads],
+		[use_weak_symbols=$enableval],
+		[use_weak_symbols=no])
+	AC_MSG_RESULT($use_weak_symbols)
+	if test "$use_weak_symbols" = yes ; then
+		CF_WEAK_SYMBOLS
+	else
+		cf_cv_weak_symbols=no
+	fi
 
-if test $cf_cv_weak_symbols = yes ; then
-    AC_DEFINE(USE_WEAK_SYMBOLS)
+	if test $cf_cv_weak_symbols = yes ; then
+		AC_DEFINE(USE_WEAK_SYMBOLS)
+	fi
 fi
 
 PTHREAD=
@@ -1024,11 +1145,13 @@
 	cf_cv_enable_opaque="NCURSES_INTERNALS"
 	NCURSES_OPAQUE=1
 	NCURSES_SIZE_T=int
-    if test $cf_cv_weak_symbols = yes ; then
-        CF_REMOVE_LIB(LIBS,$LIBS,pthread)
-    else
-        LIB_SUFFIX="t${LIB_SUFFIX}"
-    fi
+	if test $cf_cv_weak_symbols = yes ; then
+		CF_REMOVE_LIB(LIBS,$LIBS,pthread)
+		CF_ADD_LIB(pthread,TEST_LIBS)
+		CF_ADD_LIB(pthread,TEST_LIBS2)
+	else
+		LIB_SUFFIX="t${LIB_SUFFIX}"
+	fi
 	AC_DEFINE(USE_REENTRANT)
 	CF_NCURSES_ABI_6
 else
@@ -1042,6 +1165,20 @@
 AC_SUBST(NCURSES_OPAQUE)
 AC_SUBST(NCURSES_SIZE_T)
 
+### Allow using a different wrap-prefix
+if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then
+	AC_MSG_CHECKING(for prefix used to wrap public variables)
+	AC_ARG_WITH(wrap-prefix,
+		[  --with-wrap-prefix=XXX  override prefix used for public variables],
+		[NCURSES_WRAP_PREFIX=$withval],
+		[NCURSES_WRAP_PREFIX=_nc_])
+	AC_MSG_RESULT($NCURSES_WRAP_PREFIX)
+else
+	NCURSES_WRAP_PREFIX=_nc_
+fi
+AC_SUBST(NCURSES_WRAP_PREFIX)
+AC_DEFINE_UNQUOTED(NCURSES_WRAP_PREFIX,"$NCURSES_WRAP_PREFIX")
+
 AC_MSG_CHECKING(if you want experimental safe-sprintf code)
 AC_ARG_ENABLE(safe-sprintf,
 	[  --enable-safe-sprintf   compile with experimental safe-sprintf code],
@@ -1097,7 +1234,7 @@
 AC_MSG_RESULT($with_warnings)
 
 if test "x$with_warnings" = "xyes"; then
- 	ADAFLAGS="$ADAFLAGS -gnatg"
+ 	CF_ADD_ADAFLAGS(-gnatg)
 	CF_GCC_WARNINGS(Wdeclaration-after-statement Wextra Wno-unknown-pragmas Wswitch-enum)
 	if test "$cf_with_cxx" = yes ; then
 		CF_GXX_WARNINGS(Wno-unused)
@@ -1119,7 +1256,7 @@
 		AC_DEFINE(NDEBUG)
 		CPPFLAGS="$CPPFLAGS -DNDEBUG"
 	else
-		ADAFLAGS="$ADAFLAGS -gnata"
+		CF_ADD_ADAFLAGS(-gnata)
 	fi
 fi
 
@@ -1165,12 +1302,18 @@
 AC_SUBST(ADA_TRACE)
 
 ###	Checks for libraries.
+case $cf_cv_system_name in #(vi
+*mingw32*) #(vi
+	;;
+*)
 AC_CHECK_FUNC(gettimeofday,
 	AC_DEFINE(HAVE_GETTIMEOFDAY),[
 
 AC_CHECK_LIB(bsd, gettimeofday,
 	AC_DEFINE(HAVE_GETTIMEOFDAY)
-	LIBS="$LIBS -lbsd")])dnl CLIX: bzero, select, gettimeofday
+	CF_ADD_LIB(bsd))])dnl CLIX: bzero, select, gettimeofday
+	;;
+esac
 
 CF_MATH_LIB(MATH_LIB,sin(x))
 AC_SUBST(MATH_LIB)
@@ -1204,7 +1347,7 @@
 # Note: even non-Posix ISC needs <sys/bsdtypes.h> to declare fd_set
 if test "$ISC" = yes ; then
 	AC_CHECK_LIB(cposix,main)
-	AC_CHECK_LIB(inet,bzero,LIBS="$LIBS -linet")dnl also 'select()'
+	AC_CHECK_LIB(inet,bzero,CF_ADD_LIB(inet))dnl also 'select()'
 fi
 
 CF_SYS_TIME_SELECT
@@ -1287,6 +1430,8 @@
 CF_SIZECHANGE
 CF_FUNC_MEMMOVE
 CF_FUNC_POLL
+CF_VA_COPY
+AC_FUNC_VFORK
 
 # special check for test/ditto.c
 CF_FUNC_OPENPTY
@@ -1294,10 +1439,11 @@
     AC_DEFINE_UNQUOTED(USE_OPENPTY_HEADER,<$cf_cv_func_openpty>)
     AC_DEFINE(USE_XTERM_PTY)
     if test "$cf_cv_lib_util" = yes ; then
-        TEST_LIBS="-lutil $TEST_LIBS"
+        CF_ADD_LIB(util,TEST_LIBS)
     fi
 fi
 AC_SUBST(TEST_LIBS)
+AC_SUBST(TEST_LIBS2)
 
 if test "$with_hashed_db" != no ; then
 	AC_DEFINE(USE_HASHED_DB)
@@ -1354,12 +1500,12 @@
 	CF_CPP_STATIC_CAST
 
 	CXX_AR='$(AR)'
-	CXX_AR_OPTS='$(AR_OPTS)'
+	CXX_ARFLAGS='$(ARFLAGS)'
 	case $cf_cv_system_name in #(vi
 	irix*) #(vi
 	    if test "$GXX" != yes ; then
 		CXX_AR='$(CXX)'
-		CXX_AR_OPTS='-ar -o'
+		CXX_ARFLAGS='-ar -o'
 	    fi
 	    ;;
 	sco3.2v5*) #(vi
@@ -1368,13 +1514,13 @@
 	solaris2*)
 	    if test "$GXX" != yes ; then
 		CXX_AR='$(CXX)'
-		CXX_AR_OPTS='-xar -o'
+		CXX_ARFLAGS='-xar -o'
 	    fi
 	    ;;
 	esac
 	AC_SUBST(CXXLDFLAGS)
 	AC_SUBST(CXX_AR)
-	AC_SUBST(CXX_AR_OPTS)
+	AC_SUBST(CXX_ARFLAGS)
 else
 	cf_cxx_library=no
 	cf_cv_builtin_bool=1
@@ -1435,99 +1581,34 @@
 dnl libtool does not know anything about GNAT, though a change made in 1998
 dnl provided for it "someday".  Disable the ada subtree if we are using
 dnl libtool -TD 20070714
-if test "$cf_with_ada" != "no" ; then
-    if test "$with_libtool" != "no"; then
-	AC_MSG_WARN(libtool does not support Ada - disabling feature)
-	cf_with_ada=no
-    fi
-fi
+	if test "$cf_with_ada" != "no" ; then
+		if test "$with_libtool" != "no"; then
+			AC_MSG_WARN(libtool does not support Ada - disabling feature)
+			cf_with_ada=no
+		fi
+	fi
 
 dnl Check for availability of GNU Ada Translator (GNAT).
 dnl At the moment we support no other Ada95 compiler.
-if test "$cf_with_ada" != "no" ; then
-cf_ada_make=gnatmake
-AC_CHECK_PROG(gnat_exists, $cf_ada_make, yes, no)
-if test "$ac_cv_prog_gnat_exists" = no; then
-   cf_ada_make=
-else
-   CF_GNAT_VERSION
-   AC_CHECK_PROG(M4_exists, m4, yes, no)
-   if test "$ac_cv_prog_M4_exists" = no; then
-      cf_cv_prog_gnat_correct=no
-      echo Ada95 binding required program m4 not found. Ada95 binding disabled.
-   fi
-   if test "$cf_cv_prog_gnat_correct" = yes; then
-      AC_MSG_CHECKING(if GNAT works)
-      CF_GNAT_TRY_RUN([procedure conftest;],
-[with Text_IO;
-with GNAT.OS_Lib;
-procedure conftest is
-begin
-   Text_IO.Put ("Hello World");
-   Text_IO.New_Line;
-   GNAT.OS_Lib.OS_Exit (0);
-end conftest;],[cf_cv_prog_gnat_correct=yes],[cf_cv_prog_gnat_correct=no])
-      AC_MSG_RESULT($cf_cv_prog_gnat_correct)
-   fi
-fi
-if test	"$cf_cv_prog_gnat_correct" = yes; then
-   ADAFLAGS="-O3 -gnatpn $ADAFLAGS"
-
-   AC_MSG_CHECKING(if GNAT pragma Unreferenced works)
-   CF_GNAT_TRY_LINK([procedure conftest;],
-[with Text_IO;
-with GNAT.OS_Lib;
-procedure conftest is
-   test : Integer;
-   pragma Unreferenced (test);
-begin
-   test := 1;
-   Text_IO.Put ("Hello World");
-   Text_IO.New_Line;
-   GNAT.OS_Lib.OS_Exit (0);
-end conftest;],[cf_cv_pragma_unreferenced=yes],[cf_cv_pragma_unreferenced=no])
-   AC_MSG_RESULT($cf_cv_pragma_unreferenced)
-
-   # if the pragma is supported, use it (needed in the Trace code).
-   if test $cf_cv_pragma_unreferenced = yes ; then
-      PRAGMA_UNREF=TRUE
-   else
-      PRAGMA_UNREF=FALSE
-   fi
-
-   AC_ARG_WITH(ada-compiler,
-	[  --with-ada-compiler=CMD specify Ada95 compiler command (default gnatmake)],
-	[cf_ada_compiler=$withval],
-	[cf_ada_compiler=gnatmake])
-
-   cf_ada_package=terminal_interface
-
-   AC_SUBST(cf_ada_make)
-   AC_SUBST(cf_ada_compiler)
-   AC_SUBST(cf_ada_package)
-   AC_SUBST(ADAFLAGS)
-   AC_SUBST(cf_compile_generics)
-   AC_SUBST(cf_generic_objects)
-   AC_SUBST(PRAGMA_UNREF)
-
-   CF_WITH_PATH(ada-include,
-       [  --with-ada-include=DIR  Ada includes are in DIR],
-       ADA_INCLUDE,
-       PREFIX/lib/ada/adainclude,
-       [$]prefix/lib/ada/adainclude)
-   AC_SUBST(ADA_INCLUDE)
-
-   CF_WITH_PATH(ada-objects,
-       [  --with-ada-objects=DIR  Ada objects are in DIR],
-       ADA_OBJECTS,
-       PREFIX/lib/ada/adalib,
-       [$]prefix/lib/ada/adalib)
-   AC_SUBST(ADA_OBJECTS)
+	if test "$cf_with_ada" != "no" ; then
+		CF_PROG_GNAT
+		if test	"$cf_cv_prog_gnat_correct" = yes; then
+			CF_ADD_ADAFLAGS(-O3 -gnatpn)
 
-fi
-fi
+			CF_GNAT_PRAGMA_UNREF
+
+			CF_WITH_ADA_COMPILER
+
+			cf_ada_package=terminal_interface
+			AC_SUBST(cf_ada_package)
+
+			CF_WITH_ADA_INCLUDE
+			CF_WITH_ADA_OBJECTS
+			CF_WITH_ADA_SHAREDLIB
+		fi
+	fi
 else
-   cf_with_ada=no
+	cf_with_ada=no
 fi
 
 ### Construct the ncurses library-subsets, if any, from this set of keywords:
@@ -1554,6 +1635,7 @@
 
 LIB_SUBSETS="${LIB_SUBSETS}termlib"
 test "$with_ext_funcs" = yes && LIB_SUBSETS="${LIB_SUBSETS}+ext_tinfo"
+
 if test "$with_termlib" != no ; then
 	LIB_SUBSETS="${LIB_SUBSETS} "
 else
@@ -1561,6 +1643,21 @@
 fi
 
 LIB_SUBSETS="${LIB_SUBSETS}base"
+
+# Most term-driver calls are to tinfo, but some like init_pair are to the
+# base library (so it resides in base).
+if test "$with_term_driver" != no ; then
+	LIB_SUBSETS="${LIB_SUBSETS}+port_drivers"
+	case $cf_cv_system_name in #(vi
+	*mingw32*) #(vi
+		LIB_SUBSETS="${LIB_SUBSETS}+port_tinfo+port_win32con"
+		;;
+	*) #(vi
+		LIB_SUBSETS="${LIB_SUBSETS}+port_tinfo"
+		;;
+	esac
+fi
+
 test "$with_widec"     = yes && LIB_SUBSETS="${LIB_SUBSETS}+widechar"
 test "$with_ext_funcs" = yes && LIB_SUBSETS="${LIB_SUBSETS}+ext_funcs"
 
@@ -1656,6 +1753,8 @@
 		TEST_ARGS="${TEST_DEPS}"
 		TEST_ARG2="${TEST_DEP2}"
 		TINFO_ARGS="-L${LIB_DIR} $TEST_ARGS"
+		TICS_LIST="$SHLIB_LIST $TEST_ARGS"
+		SHLIB_LIST="${SHLIB_LIST} $TEST_ARGS"
 	else
 		TEST_ARGS="-l${TINFO_ARG_SUFFIX}"
 		TEST_ARG2="-l${TINFO_ARG_SUFFIX}"
@@ -1723,6 +1822,7 @@
 	AC_MSG_WARN(Wide-character applications must define HAVE_LIBUTF8_H to include curses.h)
 fi
 fi
+WITH_OVERWRITE=$with_overwrite
 
 AC_SUBST(WITH_OVERWRITE)
 AC_SUBST(TICS_LIST)
@@ -1742,40 +1842,88 @@
 CF_SRC_MODULES($modules_to_build)
 
 if test "$cf_with_ada" != "no" && test "$cf_cv_prog_gnat_correct" != "no"; then
-   SUB_MAKEFILES="$SUB_MAKEFILES Ada95/gen/adacurses-config"
+   SUB_MAKEFILES="$SUB_MAKEFILES Ada95/gen/adacurses${DFT_ARG_SUFFIX}-config:Ada95/gen/adacurses-config.in"
+   SUB_MAKEFILES="$SUB_MAKEFILES man/adacurses${DFT_ARG_SUFFIX}-config.1:man/MKada_config.in"
 fi
 
 CF_DIRS_TO_MAKE
 
-AC_DEFINE_UNQUOTED(NCURSES_PATHSEP,'$PATHSEP')
+# symbols that differ when compiling Ada95 by itself.
+NCURSES_SHLIB2='sh $(top_srcdir)/misc/shlib'
+AC_SUBST(NCURSES_SHLIB2)
+
+# values to use as strings
+AC_DEFINE_UNQUOTED(NCURSES_PATHSEP,'$PATH_SEPARATOR')
 
 AC_DEFINE_UNQUOTED(NCURSES_VERSION_STRING, "${NCURSES_MAJOR}.${NCURSES_MINOR}.${NCURSES_PATCH}")
 
 ### Now that we're done running tests, add the compiler-warnings, if any
 CF_ADD_CFLAGS($EXTRA_CFLAGS)
 
-### If we're building with rpath, try to link non-standard libs that way too.
-if test "$DFT_LWR_MODEL" = "shared"; then
-  CF_RPATH_HACK
-fi
-
 ### Define substitutions for header files to avoid name-pollution
 CF_SUBST_IF(["$cf_cv_have_tcgetattr" = yes], HAVE_TCGETATTR, 1, 0)
 CF_SUBST_IF(["$ac_cv_header_termio_h" = yes], HAVE_TERMIO_H, 1, 0)
 CF_SUBST_IF(["$ac_cv_header_termios_h" = yes], HAVE_TERMIOS_H, 1, 0)
 
 ################################################################################
-test "$use_database" = yes && SUB_MAKEFILES="$SUB_MAKEFILES misc/run_tic.sh:misc/run_tic.in"
+test "$use_database" = yes && \
+SUB_MAKEFILES="$SUB_MAKEFILES misc/run_tic.sh:misc/run_tic.in"
+
 SUB_MAKEFILES="$SUB_MAKEFILES misc/ncurses-config:misc/ncurses-config.in"
+SUB_MAKEFILES="$SUB_MAKEFILES man/ncurses${DFT_ARG_SUFFIX}${cf_cv_abi_version}-config.1:man/MKncu_config.in"
+
+if test x"$enable_pc_files" = xyes ; then \
+SUB_MAKEFILES="$SUB_MAKEFILES misc/gen-pkgconfig:misc/gen-pkgconfig.in"
+MAKE_PC_FILES=
+else
+MAKE_PC_FILES="#"
+fi
+AC_SUBST(MAKE_PC_FILES)
+AC_SUBST(cross_compiling)
+
+AC_PATH_PROG(TIC_PATH,tic,unknown,$PATH:/usr/local/ncurses/bin)
+if test -n "$FALLBACK_LIST"
+then
+	if test "$TIC_PATH" = unknown
+	then
+		AC_MSG_WARN(no tic program found for fallbacks)
+	fi
+fi
+AC_SUBST(TIC_PATH)
+
+if test "x$cf_with_tests" != xno ; then
+	MAKE_TESTS=
+else
+	MAKE_TESTS="#"
+fi
+AC_SUBST(MAKE_TESTS)
+
+SUB_SCRIPTS=
+case $cf_cv_system_name in #(vi
+*mingw32*) #(vi
+	SUB_SCRIPTS="mk-dlls.sh"
+	;;
+esac
+
 AC_OUTPUT( \
 	include/MKterm.h.awk \
 	include/curses.head:include/curses.h.in \
+	include/ncurses_dll.h \
 	include/termcap.h \
 	include/unctrl.h \
+	$SUB_SCRIPTS \
 	$SUB_MAKEFILES \
 	Makefile,[
-CF_PRG_RULES([$srcdir/test/mk-test.awk ECHO_LINK="$ECHO_LINK"], test)
+if test "x$cf_with_tests" != xno ; then
+	CF_PRG_RULES([$srcdir/test/mk-test.awk INSTALL=no ECHO_LINK="$ECHO_LINK"], test)
+fi
 CF_LIB_RULES($SRC_SUBDIRS)
+
+if test "x$cf_with_ada" != xno ; then
+if test -z "$USE_OLD_MAKERULES" ; then
+	$AWK -f $srcdir/Ada95/mk-1st.awk <$srcdir/Ada95/src/modules >>Ada95/src/Makefile
+fi
+fi
 ],[
 ### Special initialization commands, used to pass information from the
 ### configuration-run into config.status
@@ -1785,10 +1933,12 @@
 DFT_LWR_MODEL="$DFT_LWR_MODEL"
 ECHO_LINK="$ECHO_LINK"
 LDCONFIG="$LDCONFIG"
+LIBTOOL_VERSION="$LIBTOOL_VERSION"
 LIB_NAME="$LIB_NAME"
 LIB_SUBSETS="$LIB_SUBSETS"
 LIB_SUFFIX="$LIB_SUFFIX"
 LIB_TRACING="$LIB_TRACING"
+LN_S="$LN_S"
 MAKE_TERMINFO="$MAKE_TERMINFO"
 NCURSES_MAJOR="$NCURSES_MAJOR"
 NCURSES_MINOR="$NCURSES_MINOR"
@@ -1796,13 +1946,15 @@
 NCURSES_PATCH="$NCURSES_PATCH"
 SRC_SUBDIRS="$SRC_SUBDIRS"
 TERMINFO="$TERMINFO"
+TICS_ARG_SUFFIX="$TICS_ARG_SUFFIX"
+TICS_LIB_SUFFIX="$TICS_LIB_SUFFIX"
+TICS_NAME="$TICS_NAME"
+TIC_PATH="$TIC_PATH"
 TINFO_ARG_SUFFIX="$TINFO_ARG_SUFFIX"
 TINFO_LIB_SUFFIX="$TINFO_LIB_SUFFIX"
 TINFO_NAME="$TINFO_NAME"
 TINFO_SUFFIX="$TINFO_SUFFIX"
-TICS_ARG_SUFFIX="$TICS_ARG_SUFFIX"
-TICS_LIB_SUFFIX="$TICS_LIB_SUFFIX"
-TICS_NAME="$TICS_NAME"
+USE_OLD_MAKERULES="$USE_OLD_MAKERULES"
 WITH_CURSES_H="$with_curses_h"
 WITH_ECHO="$with_echo"
 WITH_OVERWRITE="$with_overwrite"
@@ -1820,9 +1972,12 @@
 cf_cv_shlib_version="$cf_cv_shlib_version"
 cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix"
 cf_cv_system_name="$cf_cv_system_name"
+cf_with_ada="$cf_with_ada"
 cf_with_cxx_binding="$cf_with_cxx_binding"
+cf_with_manpages="$cf_with_manpages"
+cf_with_tests="$cf_with_tests"
 host="$host"
 target="$target"
 
 ],cat)dnl
-${MAKE-make} preinstall
+${MAKE:-make} preinstall
diff -Naur ncurses-5.7.orig/dist.mk ncurses-5.7/dist.mk
--- ncurses-5.7.orig/dist.mk	2008-11-01 20:58:38.000000000 -0400
+++ ncurses-5.7/dist.mk	2011-01-08 18:18:29.814782179 -0500
@@ -1,5 +1,5 @@
 ##############################################################################
-# Copyright (c) 1998-2007,2008 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 "Software"), #
@@ -25,7 +25,7 @@
 # use or other dealings in this Software without prior written               #
 # authorization.                                                             #
 ##############################################################################
-# $Id: dist.mk,v 1.671 2008/11/02 00:58:38 tom Exp $
+# $Id: dist.mk,v 1.788 2011/01/01 16:29:59 tom Exp $
 # Makefile for creating ncurses distributions.
 #
 # This only needs to be used directly as a makefile by developers, but
@@ -37,7 +37,7 @@
 # These define the major/minor/patch versions of ncurses.
 NCURSES_MAJOR = 5
 NCURSES_MINOR = 7
-NCURSES_PATCH = 20081102
+NCURSES_PATCH = 20110101
 
 # We don't append the patch to the version, since this only applies to releases
 VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
@@ -57,8 +57,7 @@
 # has the effect of lengthening the text portion of the page -- so man2html
 # would remove some text.  The man program on Redhat 6.1 appears to work with
 # man2html if we set the top/bottom margins to 6 (the default is 7).  Newer
-# versions of 'man' on Linux leave no margin (and make it harder to sync with
-# pages).
+# versions of 'man' leave no margin (and make it harder to sync with pages).
 MAN2HTML= man2html -botm=0 -topm=0 -cgiurl '$$title.$$section$$subsection.html'
 
 ALL	= ANNOUNCE doc/html/announce.html doc/ncurses-intro.doc doc/hackguide.doc manhtml adahtml
diff -Naur ncurses-5.7.orig/doc/html/Ada95.html ncurses-5.7/doc/html/Ada95.html
--- ncurses-5.7.orig/doc/html/Ada95.html	2004-01-17 19:32:47.000000000 -0500
+++ ncurses-5.7/doc/html/Ada95.html	2011-01-08 18:18:29.634657268 -0500
@@ -1,8 +1,8 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 <!--
-  $Id: Ada95.html,v 1.6 2004/01/18 00:32:47 tom Exp $
+  $Id: Ada95.html,v 1.8 2010/12/04 16:42:54 tom Exp $
   ****************************************************************************
-  * Copyright (c) 1998-2003,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            *
@@ -28,11 +28,12 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: clear.1,v 1.3 2000/07/15 23:59:35 china Exp @
 -->
 <HTML>
 <HEAD>
 <TITLE>Ada95 Binding for ncurses</Title>
+<link rev=made href="mailto:bug-ncurses@gnu.org">
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
 </HEAD>
 <BODY>
 <H1>Ada95 Binding for ncurses</H1>
diff -Naur ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-aux__adb.htm ncurses-5.7/doc/html/ada/terminal_interface-curses-aux__adb.htm
--- ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-aux__adb.htm	2006-09-23 16:31:30.000000000 -0400
+++ ncurses-5.7/doc/html/ada/terminal_interface-curses-aux__adb.htm	2011-01-08 18:13:50.351157388 -0500
@@ -12,7 +12,7 @@
 <FONT COLOR=green><EM>--                                 B O D Y                                  --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-<FONT COLOR=green><EM>-- Copyright (c) 1998 Free Software Foundation, Inc.                        --</EM></FONT>
+<FONT COLOR=green><EM>-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>-- Permission is hereby granted, free of charge, to any person obtaining a  --</EM></FONT>
 <FONT COLOR=green><EM>-- copy of this software and associated documentation files (the            --</EM></FONT>
@@ -40,13 +40,13 @@
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <FONT COLOR=green><EM>--  Author:  Juergen Pfeifer, 1996</EM></FONT>
 <FONT COLOR=green><EM>--  Version Control:</EM></FONT>
-<FONT COLOR=green><EM>--  @Revision: 1.10 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Revision: 1.11 @</EM></FONT>
 <FONT COLOR=green><EM>--  Binding Version 01.00</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <b>package</b> <b>body</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<FONT COLOR=red><A NAME="ref_41_40" HREF="terminal_interface-curses-aux__ads.htm#ref_50_35">Aux</A></FONT> <b>is</b>
    <FONT COLOR=green><EM>--</EM></FONT>
    <FONT COLOR=green><EM>--  Some helpers</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_44_14" HREF="terminal_interface-curses-aux__ads.htm#ref_116_14">Fill_String</A></FONT> (<FONT COLOR=red><A NAME="ref_44_27" HREF="terminal_interface-curses-aux__ads.htm#ref_116_27">Cp</A></FONT>  : <b>in</b>  chars_ptr;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_44_14" HREF="terminal_interface-curses-aux__ads.htm#ref_116_14">Fill_String</A></FONT> (<FONT COLOR=red><A NAME="ref_44_27" HREF="terminal_interface-curses-aux__ads.htm#ref_116_27">Cp</A></FONT>  : chars_ptr;
                           <FONT COLOR=red><A NAME="ref_45_27" HREF="terminal_interface-curses-aux__ads.htm#ref_117_27">Str</A></FONT> : <b>out</b> String)
    <b>is</b>
       <FONT COLOR=green><EM>--  Fill the string with the characters referenced by the</EM></FONT>
diff -Naur ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-aux__ads.htm ncurses-5.7/doc/html/ada/terminal_interface-curses-aux__ads.htm
--- ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-aux__ads.htm	2008-06-21 19:22:31.000000000 -0400
+++ ncurses-5.7/doc/html/ada/terminal_interface-curses-aux__ads.htm	2011-01-08 18:13:50.351157388 -0500
@@ -12,7 +12,7 @@
 <FONT COLOR=green><EM>--                                 S P E C                                  --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-<FONT COLOR=green><EM>-- Copyright (c) 1998 Free Software Foundation, Inc.                        --</EM></FONT>
+<FONT COLOR=green><EM>-- Copyright (c) 1998-2007,2009 Free Software Foundation, Inc.              --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>-- Permission is hereby granted, free of charge, to any person obtaining a  --</EM></FONT>
 <FONT COLOR=green><EM>-- copy of this software and associated documentation files (the            --</EM></FONT>
@@ -40,7 +40,7 @@
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <FONT COLOR=green><EM>--  Author:  Juergen Pfeifer, 1996</EM></FONT>
 <FONT COLOR=green><EM>--  Version Control:</EM></FONT>
-<FONT COLOR=green><EM>--  @Revision: 1.16 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Revision: 1.17 @</EM></FONT>
 <FONT COLOR=green><EM>--  Binding Version 01.00</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <FONT COLOR=green><EM>--  curses binding.</EM></FONT>
@@ -48,22 +48,22 @@
 <FONT COLOR=green><EM>--  Run the generator instead.</EM></FONT>
 <FONT COLOR=green><EM>--  |</EM></FONT>
 <b>with</b> System;
-<b>with</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C;
-<b>with</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C.Strings; <b>use</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C.Strings;
+<b>with</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C;
+<b>with</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C.Strings; <b>use</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C.Strings;
 <b>with</b> <A HREF="unchconv__ads.htm#ref_20_10">Unchecked_Conversion</A>;
 
 <b>package</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<FONT COLOR=red><A NAME="ref_50_35" HREF="terminal_interface-curses-aux__adb.htm#ref_41_40">Aux</A></FONT> <b>is</b>
    <b>pragma</b> Preelaborate (<A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-aux__ads.htm#ref_50_35">Aux</A>);
 
-   <b>use</b> <b>type</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C.int;
+   <b>use</b> <b>type</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C.int;
 
-   <b>subtype</b> <FONT COLOR=red><A NAME="ref_55_12">C_Int</A></FONT>      <b>is</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C.int;
-   <b>subtype</b> <FONT COLOR=red><A NAME="ref_56_12">C_Short</A></FONT>    <b>is</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C.short;
-   <b>subtype</b> <FONT COLOR=red><A NAME="ref_57_12">C_Long_Int</A></FONT> <b>is</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C.long;
-   <b>subtype</b> <FONT COLOR=red><A NAME="ref_58_12">C_Size_T</A></FONT>   <b>is</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C.size_t;
-   <b>subtype</b> <FONT COLOR=red><A NAME="ref_59_12">C_UInt</A></FONT>     <b>is</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C.unsigned;
-   <b>subtype</b> <FONT COLOR=red><A NAME="ref_60_12">C_ULong</A></FONT>    <b>is</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C.unsigned_long;
-   <b>subtype</b> <FONT COLOR=red><A NAME="ref_61_12">C_Char_Ptr</A></FONT> <b>is</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C.Strings.chars_ptr;
+   <b>subtype</b> <FONT COLOR=red><A NAME="ref_55_12">C_Int</A></FONT>      <b>is</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C.int;
+   <b>subtype</b> <FONT COLOR=red><A NAME="ref_56_12">C_Short</A></FONT>    <b>is</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C.short;
+   <b>subtype</b> <FONT COLOR=red><A NAME="ref_57_12">C_Long_Int</A></FONT> <b>is</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C.long;
+   <b>subtype</b> <FONT COLOR=red><A NAME="ref_58_12">C_Size_T</A></FONT>   <b>is</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C.size_t;
+   <b>subtype</b> <FONT COLOR=red><A NAME="ref_59_12">C_UInt</A></FONT>     <b>is</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C.unsigned;
+   <b>subtype</b> <FONT COLOR=red><A NAME="ref_60_12">C_ULong</A></FONT>    <b>is</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C.unsigned_long;
+   <b>subtype</b> <FONT COLOR=red><A NAME="ref_61_12">C_Char_Ptr</A></FONT> <b>is</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C.Strings.chars_ptr;
    <b>type</b>    <FONT COLOR=red><A NAME="ref_62_12">C_Void_Ptr</A></FONT> <b>is</b> <b>new</b> System.Address;
    <b>type</b>    <FONT COLOR=red><A NAME="ref_63_12">C_Chtype</A></FONT>   <b>is</b> <b>new</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_60_12">C_ULong</A>;
    <b>type</b>    <FONT COLOR=red><A NAME="ref_64_12">C_AttrType</A></FONT> <b>is</b> <b>new</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_60_12">C_ULong</A>;
@@ -118,7 +118,7 @@
      <A HREF="unchconv__ads.htm#ref_20_10">Unchecked_Conversion</A> (<A HREF="unchconv__ads.htm#ref_17_9">Source</A> =&gt; <A HREF="terminal_interface-curses-aux__ads.htm#ref_64_12">C_AttrType</A>,
                            <A HREF="unchconv__ads.htm#ref_18_9">Target</A> =&gt; <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A>);
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_116_14" HREF="terminal_interface-curses-aux__adb.htm#ref_44_14">Fill_String</A></FONT> (<FONT COLOR=red><A NAME="ref_116_27" HREF="terminal_interface-curses-aux__adb.htm#ref_44_27">Cp</A></FONT>  : <b>in</b>  chars_ptr;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_116_14" HREF="terminal_interface-curses-aux__adb.htm#ref_44_14">Fill_String</A></FONT> (<FONT COLOR=red><A NAME="ref_116_27" HREF="terminal_interface-curses-aux__adb.htm#ref_44_27">Cp</A></FONT>  : chars_ptr;
                           <FONT COLOR=red><A NAME="ref_117_27" HREF="terminal_interface-curses-aux__adb.htm#ref_45_27">Str</A></FONT> : <b>out</b> String);
    <FONT COLOR=green><EM>--  Fill the Str parameter with the string denoted by the chars_ptr</EM></FONT>
    <FONT COLOR=green><EM>--  C-Style string.</EM></FONT>
diff -Naur ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-forms-field_types-alpha__adb.htm ncurses-5.7/doc/html/ada/terminal_interface-curses-forms-field_types-alpha__adb.htm
--- ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-forms-field_types-alpha__adb.htm	2008-10-11 17:36:30.000000000 -0400
+++ ncurses-5.7/doc/html/ada/terminal_interface-curses-forms-field_types-alpha__adb.htm	2011-01-08 18:13:50.351157388 -0500
@@ -12,7 +12,7 @@
 <FONT COLOR=green><EM>--                                 B O D Y                                  --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-<FONT COLOR=green><EM>-- Copyright (c) 1998,2008 Free Software Foundation, Inc.                   --</EM></FONT>
+<FONT COLOR=green><EM>-- Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.              --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>-- Permission is hereby granted, free of charge, to any person obtaining a  --</EM></FONT>
 <FONT COLOR=green><EM>-- copy of this software and associated documentation files (the            --</EM></FONT>
@@ -40,16 +40,16 @@
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <FONT COLOR=green><EM>--  Author:  Juergen Pfeifer, 1996</EM></FONT>
 <FONT COLOR=green><EM>--  Version Control:</EM></FONT>
-<FONT COLOR=green><EM>--  @Revision: 1.9 @</EM></FONT>
-<FONT COLOR=green><EM>--  @Date: 2008/07/26 18:50:25 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Revision: 1.10 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Date: 2009/12/26 17:38:58 @</EM></FONT>
 <FONT COLOR=green><EM>--  Binding Version 01.00</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <b>with</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-aux__ads.htm#ref_50_35">Aux</A>; <b>use</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-aux__ads.htm#ref_50_35">Aux</A>;
 
 <b>package</b> <b>body</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-forms__ads.htm#ref_49_35">Forms</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_43_41">Field_Types</A>.<FONT COLOR=red><A NAME="ref_44_58" HREF="terminal_interface-curses-forms-field_types-alpha__ads.htm#ref_41_53">Alpha</A></FONT> <b>is</b>
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_46_14" HREF="terminal_interface-curses-forms-field_types-alpha__ads.htm#ref_49_14">Set_Field_Type</A></FONT> (<FONT COLOR=red><A NAME="ref_46_30" HREF="terminal_interface-curses-forms-field_types-alpha__ads.htm#ref_49_30">Fld</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
-                             <FONT COLOR=red><A NAME="ref_47_30" HREF="terminal_interface-curses-forms-field_types-alpha__ads.htm#ref_50_30">Typ</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms-field_types-alpha__ads.htm#ref_44_9">Alpha_Field</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_46_14" HREF="terminal_interface-curses-forms-field_types-alpha__ads.htm#ref_49_14">Set_Field_Type</A></FONT> (<FONT COLOR=red><A NAME="ref_46_30" HREF="terminal_interface-curses-forms-field_types-alpha__ads.htm#ref_49_30">Fld</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
+                             <FONT COLOR=red><A NAME="ref_47_30" HREF="terminal_interface-curses-forms-field_types-alpha__ads.htm#ref_50_30">Typ</A></FONT> : <A HREF="terminal_interface-curses-forms-field_types-alpha__ads.htm#ref_44_9">Alpha_Field</A>)
    <b>is</b>
       <FONT COLOR=red><A NAME="ref_49_7">C_Alpha_Field_Type</A></FONT> : <A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_132_9">C_Field_Type</A>;
       <b>pragma</b> Import (C, <A HREF="terminal_interface-curses-forms-field_types-alpha__adb.htm#ref_49_7">C_Alpha_Field_Type</A>, "TYPE_ALPHA");
diff -Naur ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-forms-field_types-alpha__ads.htm ncurses-5.7/doc/html/ada/terminal_interface-curses-forms-field_types-alpha__ads.htm
--- ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-forms-field_types-alpha__ads.htm	2008-10-11 17:36:30.000000000 -0400
+++ ncurses-5.7/doc/html/ada/terminal_interface-curses-forms-field_types-alpha__ads.htm	2011-01-08 18:13:50.351157388 -0500
@@ -12,7 +12,7 @@
 <FONT COLOR=green><EM>--                                 S P E C                                  --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-<FONT COLOR=green><EM>-- Copyright (c) 1998 Free Software Foundation, Inc.                        --</EM></FONT>
+<FONT COLOR=green><EM>-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>-- Permission is hereby granted, free of charge, to any person obtaining a  --</EM></FONT>
 <FONT COLOR=green><EM>-- copy of this software and associated documentation files (the            --</EM></FONT>
@@ -40,7 +40,7 @@
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <FONT COLOR=green><EM>--  Author:  Juergen Pfeifer, 1996</EM></FONT>
 <FONT COLOR=green><EM>--  Version Control:</EM></FONT>
-<FONT COLOR=green><EM>--  @Revision: 1.11 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Revision: 1.12 @</EM></FONT>
 <FONT COLOR=green><EM>--  Binding Version 01.00</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <b>package</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-forms__ads.htm#ref_49_35">Forms</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_43_41">Field_Types</A>.<FONT COLOR=red><A NAME="ref_41_53" HREF="terminal_interface-curses-forms-field_types-alpha__adb.htm#ref_44_58">Alpha</A></FONT> <b>is</b>
@@ -51,8 +51,8 @@
         <FONT COLOR=red><A NAME="ref_46_9">Minimum_Field_Width</A></FONT> : Natural := 0;
      <b>end</b> <b>record</b>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_49_14" HREF="terminal_interface-curses-forms-field_types-alpha__adb.htm#ref_46_14">Set_Field_Type</A></FONT> (<FONT COLOR=red><A NAME="ref_49_30" HREF="terminal_interface-curses-forms-field_types-alpha__adb.htm#ref_46_30">Fld</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
-                             <FONT COLOR=red><A NAME="ref_50_30" HREF="terminal_interface-curses-forms-field_types-alpha__adb.htm#ref_47_30">Typ</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms-field_types-alpha__ads.htm#ref_44_9">Alpha_Field</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_49_14" HREF="terminal_interface-curses-forms-field_types-alpha__adb.htm#ref_46_14">Set_Field_Type</A></FONT> (<FONT COLOR=red><A NAME="ref_49_30" HREF="terminal_interface-curses-forms-field_types-alpha__adb.htm#ref_46_30">Fld</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
+                             <FONT COLOR=red><A NAME="ref_50_30" HREF="terminal_interface-curses-forms-field_types-alpha__adb.htm#ref_47_30">Typ</A></FONT> : <A HREF="terminal_interface-curses-forms-field_types-alpha__ads.htm#ref_44_9">Alpha_Field</A>);
    <b>pragma</b> Inline (Set_Field_Type);
 
 <b>end</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-forms__ads.htm#ref_49_35">Forms</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_43_41">Field_Types</A>.<A HREF="terminal_interface-curses-forms-field_types-alpha__ads.htm#ref_41_53">Alpha</A>;
diff -Naur ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-forms-field_types-alphanumeric__adb.htm ncurses-5.7/doc/html/ada/terminal_interface-curses-forms-field_types-alphanumeric__adb.htm
--- ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-forms-field_types-alphanumeric__adb.htm	2008-10-11 17:36:31.000000000 -0400
+++ ncurses-5.7/doc/html/ada/terminal_interface-curses-forms-field_types-alphanumeric__adb.htm	2011-01-08 18:13:50.351157388 -0500
@@ -12,7 +12,7 @@
 <FONT COLOR=green><EM>--                                 B O D Y                                  --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-<FONT COLOR=green><EM>-- Copyright (c) 1998,2008 Free Software Foundation, Inc.                   --</EM></FONT>
+<FONT COLOR=green><EM>-- Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.              --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>-- Permission is hereby granted, free of charge, to any person obtaining a  --</EM></FONT>
 <FONT COLOR=green><EM>-- copy of this software and associated documentation files (the            --</EM></FONT>
@@ -40,16 +40,16 @@
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <FONT COLOR=green><EM>--  Author:  Juergen Pfeifer, 1996</EM></FONT>
 <FONT COLOR=green><EM>--  Version Control:</EM></FONT>
-<FONT COLOR=green><EM>--  @Revision: 1.9 @</EM></FONT>
-<FONT COLOR=green><EM>--  @Date: 2008/07/26 18:50:15 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Revision: 1.10 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Date: 2009/12/26 17:38:58 @</EM></FONT>
 <FONT COLOR=green><EM>--  Binding Version 01.00</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <b>with</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-aux__ads.htm#ref_50_35">Aux</A>; <b>use</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-aux__ads.htm#ref_50_35">Aux</A>;
 
 <b>package</b> <b>body</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-forms__ads.htm#ref_49_35">Forms</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_43_41">Field_Types</A>.<FONT COLOR=red><A NAME="ref_44_58" HREF="terminal_interface-curses-forms-field_types-alphanumeric__ads.htm#ref_41_53">AlphaNumeric</A></FONT> <b>is</b>
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_46_14" HREF="terminal_interface-curses-forms-field_types-alphanumeric__ads.htm#ref_50_14">Set_Field_Type</A></FONT> (<FONT COLOR=red><A NAME="ref_46_30" HREF="terminal_interface-curses-forms-field_types-alphanumeric__ads.htm#ref_50_30">Fld</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
-                             <FONT COLOR=red><A NAME="ref_47_30" HREF="terminal_interface-curses-forms-field_types-alphanumeric__ads.htm#ref_51_30">Typ</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms-field_types-alphanumeric__ads.htm#ref_45_9">AlphaNumeric_Field</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_46_14" HREF="terminal_interface-curses-forms-field_types-alphanumeric__ads.htm#ref_50_14">Set_Field_Type</A></FONT> (<FONT COLOR=red><A NAME="ref_46_30" HREF="terminal_interface-curses-forms-field_types-alphanumeric__ads.htm#ref_50_30">Fld</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
+                             <FONT COLOR=red><A NAME="ref_47_30" HREF="terminal_interface-curses-forms-field_types-alphanumeric__ads.htm#ref_51_30">Typ</A></FONT> : <A HREF="terminal_interface-curses-forms-field_types-alphanumeric__ads.htm#ref_45_9">AlphaNumeric_Field</A>)
    <b>is</b>
       <FONT COLOR=red><A NAME="ref_49_7">C_AlphaNumeric_Field_Type</A></FONT> : <A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_132_9">C_Field_Type</A>;
       <b>pragma</b> Import (C, <A HREF="terminal_interface-curses-forms-field_types-alphanumeric__adb.htm#ref_49_7">C_AlphaNumeric_Field_Type</A>, "TYPE_ALNUM");
diff -Naur ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-forms-field_types-alphanumeric__ads.htm ncurses-5.7/doc/html/ada/terminal_interface-curses-forms-field_types-alphanumeric__ads.htm
--- ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-forms-field_types-alphanumeric__ads.htm	2008-10-11 17:36:31.000000000 -0400
+++ ncurses-5.7/doc/html/ada/terminal_interface-curses-forms-field_types-alphanumeric__ads.htm	2011-01-08 18:13:50.351157388 -0500
@@ -12,7 +12,7 @@
 <FONT COLOR=green><EM>--                                 S P E C                                  --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-<FONT COLOR=green><EM>-- Copyright (c) 1998 Free Software Foundation, Inc.                        --</EM></FONT>
+<FONT COLOR=green><EM>-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>-- Permission is hereby granted, free of charge, to any person obtaining a  --</EM></FONT>
 <FONT COLOR=green><EM>-- copy of this software and associated documentation files (the            --</EM></FONT>
@@ -40,7 +40,7 @@
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <FONT COLOR=green><EM>--  Author:  Juergen Pfeifer, 1996</EM></FONT>
 <FONT COLOR=green><EM>--  Version Control:</EM></FONT>
-<FONT COLOR=green><EM>--  @Revision: 1.11 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Revision: 1.12 @</EM></FONT>
 <FONT COLOR=green><EM>--  Binding Version 01.00</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <b>package</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-forms__ads.htm#ref_49_35">Forms</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_43_41">Field_Types</A>.<FONT COLOR=red><A NAME="ref_41_53" HREF="terminal_interface-curses-forms-field_types-alphanumeric__adb.htm#ref_44_58">AlphaNumeric</A></FONT> <b>is</b>
@@ -52,8 +52,8 @@
         <FONT COLOR=red><A NAME="ref_47_9">Minimum_Field_Width</A></FONT> : Natural := 0;
      <b>end</b> <b>record</b>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_50_14" HREF="terminal_interface-curses-forms-field_types-alphanumeric__adb.htm#ref_46_14">Set_Field_Type</A></FONT> (<FONT COLOR=red><A NAME="ref_50_30" HREF="terminal_interface-curses-forms-field_types-alphanumeric__adb.htm#ref_46_30">Fld</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
-                             <FONT COLOR=red><A NAME="ref_51_30" HREF="terminal_interface-curses-forms-field_types-alphanumeric__adb.htm#ref_47_30">Typ</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms-field_types-alphanumeric__ads.htm#ref_45_9">AlphaNumeric_Field</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_50_14" HREF="terminal_interface-curses-forms-field_types-alphanumeric__adb.htm#ref_46_14">Set_Field_Type</A></FONT> (<FONT COLOR=red><A NAME="ref_50_30" HREF="terminal_interface-curses-forms-field_types-alphanumeric__adb.htm#ref_46_30">Fld</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
+                             <FONT COLOR=red><A NAME="ref_51_30" HREF="terminal_interface-curses-forms-field_types-alphanumeric__adb.htm#ref_47_30">Typ</A></FONT> : <A HREF="terminal_interface-curses-forms-field_types-alphanumeric__ads.htm#ref_45_9">AlphaNumeric_Field</A>);
    <b>pragma</b> Inline (Set_Field_Type);
 
 <b>end</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-forms__ads.htm#ref_49_35">Forms</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_43_41">Field_Types</A>.<A HREF="terminal_interface-curses-forms-field_types-alphanumeric__ads.htm#ref_41_53">AlphaNumeric</A>;
diff -Naur ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-forms-field_types-enumeration__adb.htm ncurses-5.7/doc/html/ada/terminal_interface-curses-forms-field_types-enumeration__adb.htm
--- ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-forms-field_types-enumeration__adb.htm	2006-09-23 16:31:30.000000000 -0400
+++ ncurses-5.7/doc/html/ada/terminal_interface-curses-forms-field_types-enumeration__adb.htm	2011-01-08 18:13:50.355157495 -0500
@@ -12,7 +12,7 @@
 <FONT COLOR=green><EM>--                                 B O D Y                                  --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-<FONT COLOR=green><EM>-- Copyright (c) 1998 Free Software Foundation, Inc.                        --</EM></FONT>
+<FONT COLOR=green><EM>-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>-- Permission is hereby granted, free of charge, to any person obtaining a  --</EM></FONT>
 <FONT COLOR=green><EM>-- copy of this software and associated documentation files (the            --</EM></FONT>
@@ -40,12 +40,12 @@
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <FONT COLOR=green><EM>--  Author:  Juergen Pfeifer, 1996</EM></FONT>
 <FONT COLOR=green><EM>--  Version Control:</EM></FONT>
-<FONT COLOR=green><EM>--  @Revision: 1.7 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Revision: 1.8 @</EM></FONT>
 <FONT COLOR=green><EM>--  Binding Version 01.00</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <b>with</b> Ada.Unchecked_Deallocation;
-<b>with</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C; <b>use</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C;
-<b>with</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C.Strings; <b>use</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C.Strings;
+<b>with</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C; <b>use</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C;
+<b>with</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C.Strings; <b>use</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C.Strings;
 <b>with</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-aux__ads.htm#ref_50_35">Aux</A>; <b>use</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-aux__ads.htm#ref_50_35">Aux</A>;
 
 <b>package</b> <b>body</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-forms__ads.htm#ref_49_35">Forms</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_43_41">Field_Types</A>.<FONT COLOR=red><A NAME="ref_46_58" HREF="terminal_interface-curses-forms-field_types-enumeration__ads.htm#ref_43_53">Enumeration</A></FONT> <b>is</b>
@@ -93,8 +93,8 @@
       <A HREF="terminal_interface-curses-forms-field_types-enumeration__ads.htm#ref_77_23">Enum</A>.<A HREF="terminal_interface-curses-forms-field_types-enumeration__ads.htm#ref_95_10">Arr</A> := <b>null</b>;
    <b>end</b> <A HREF="terminal_interface-curses-forms-field_types-enumeration__ads.htm#ref_77_14">Release</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_91_14" HREF="terminal_interface-curses-forms-field_types-enumeration__ads.htm#ref_84_14">Set_Field_Type</A></FONT> (<FONT COLOR=red><A NAME="ref_91_30" HREF="terminal_interface-curses-forms-field_types-enumeration__ads.htm#ref_84_30">Fld</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
-                             <FONT COLOR=red><A NAME="ref_92_30" HREF="terminal_interface-curses-forms-field_types-enumeration__ads.htm#ref_85_30">Typ</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms-field_types-enumeration__ads.htm#ref_62_9">Enumeration_Field</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_91_14" HREF="terminal_interface-curses-forms-field_types-enumeration__ads.htm#ref_84_14">Set_Field_Type</A></FONT> (<FONT COLOR=red><A NAME="ref_91_30" HREF="terminal_interface-curses-forms-field_types-enumeration__ads.htm#ref_84_30">Fld</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
+                             <FONT COLOR=red><A NAME="ref_92_30" HREF="terminal_interface-curses-forms-field_types-enumeration__ads.htm#ref_85_30">Typ</A></FONT> : <A HREF="terminal_interface-curses-forms-field_types-enumeration__ads.htm#ref_62_9">Enumeration_Field</A>)
    <b>is</b>
       <FONT COLOR=red><A NAME="ref_94_7">C_Enum_Type</A></FONT> : <A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_132_9">C_Field_Type</A>;
       <b>pragma</b> Import (C, <A HREF="terminal_interface-curses-forms-field_types-enumeration__adb.htm#ref_94_7">C_Enum_Type</A>, "TYPE_ENUM");
diff -Naur ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-forms-field_types-enumeration__ads.htm ncurses-5.7/doc/html/ada/terminal_interface-curses-forms-field_types-enumeration__ads.htm
--- ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-forms-field_types-enumeration__ads.htm	2008-10-11 17:36:31.000000000 -0400
+++ ncurses-5.7/doc/html/ada/terminal_interface-curses-forms-field_types-enumeration__ads.htm	2011-01-08 18:13:50.355157495 -0500
@@ -12,7 +12,7 @@
 <FONT COLOR=green><EM>--                                 S P E C                                  --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-<FONT COLOR=green><EM>-- Copyright (c) 1998 Free Software Foundation, Inc.                        --</EM></FONT>
+<FONT COLOR=green><EM>-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>-- Permission is hereby granted, free of charge, to any person obtaining a  --</EM></FONT>
 <FONT COLOR=green><EM>-- copy of this software and associated documentation files (the            --</EM></FONT>
@@ -40,10 +40,10 @@
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <FONT COLOR=green><EM>--  Author:  Juergen Pfeifer, 1996</EM></FONT>
 <FONT COLOR=green><EM>--  Version Control:</EM></FONT>
-<FONT COLOR=green><EM>--  @Revision: 1.11 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Revision: 1.12 @</EM></FONT>
 <FONT COLOR=green><EM>--  Binding Version 01.00</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-<b>with</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C.Strings;
+<b>with</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C.Strings;
 
 <b>package</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-forms__ads.htm#ref_49_35">Forms</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_43_41">Field_Types</A>.<FONT COLOR=red><A NAME="ref_43_53" HREF="terminal_interface-curses-forms-field_types-enumeration__adb.htm#ref_46_58">Enumeration</A></FONT> <b>is</b>
    <b>pragma</b> Preelaborate
@@ -86,12 +86,12 @@
    <FONT COLOR=green><EM>--  The next type defintions are all ncurses extensions. They are typically</EM></FONT>
    <FONT COLOR=green><EM>--  not available in other curses implementations.</EM></FONT>
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_84_14" HREF="terminal_interface-curses-forms-field_types-enumeration__adb.htm#ref_91_14">Set_Field_Type</A></FONT> (<FONT COLOR=red><A NAME="ref_84_30" HREF="terminal_interface-curses-forms-field_types-enumeration__adb.htm#ref_91_30">Fld</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
-                             <FONT COLOR=red><A NAME="ref_85_30" HREF="terminal_interface-curses-forms-field_types-enumeration__adb.htm#ref_92_30">Typ</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms-field_types-enumeration__ads.htm#ref_62_9">Enumeration_Field</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_84_14" HREF="terminal_interface-curses-forms-field_types-enumeration__adb.htm#ref_91_14">Set_Field_Type</A></FONT> (<FONT COLOR=red><A NAME="ref_84_30" HREF="terminal_interface-curses-forms-field_types-enumeration__adb.htm#ref_91_30">Fld</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
+                             <FONT COLOR=red><A NAME="ref_85_30" HREF="terminal_interface-curses-forms-field_types-enumeration__adb.htm#ref_92_30">Typ</A></FONT> : <A HREF="terminal_interface-curses-forms-field_types-enumeration__ads.htm#ref_62_9">Enumeration_Field</A>);
    <b>pragma</b> Inline (Set_Field_Type);
 
 <b>private</b>
-   <b>type</b> <FONT COLOR=red><A NAME="ref_89_9">CPA_Access</A></FONT> <b>is</b> <b>access</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C.Strings.chars_ptr_array;
+   <b>type</b> <FONT COLOR=red><A NAME="ref_89_9">CPA_Access</A></FONT> <b>is</b> <b>access</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C.Strings.chars_ptr_array;
 
    <b>type</b> <A HREF="terminal_interface-curses-forms-field_types-enumeration__ads.htm#ref_62_9">Enumeration_Field</A> <b>is</b> <b>new</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_52_9">Field_Type</A> <b>with</b>
       <b>record</b>
diff -Naur ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-forms-field_types-intfield__adb.htm ncurses-5.7/doc/html/ada/terminal_interface-curses-forms-field_types-intfield__adb.htm
--- ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-forms-field_types-intfield__adb.htm	2008-10-11 17:36:31.000000000 -0400
+++ ncurses-5.7/doc/html/ada/terminal_interface-curses-forms-field_types-intfield__adb.htm	2011-01-08 18:13:50.355157495 -0500
@@ -12,7 +12,7 @@
 <FONT COLOR=green><EM>--                                 B O D Y                                  --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-<FONT COLOR=green><EM>-- Copyright (c) 1998,2008 Free Software Foundation, Inc.                   --</EM></FONT>
+<FONT COLOR=green><EM>-- Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.              --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>-- Permission is hereby granted, free of charge, to any person obtaining a  --</EM></FONT>
 <FONT COLOR=green><EM>-- copy of this software and associated documentation files (the            --</EM></FONT>
@@ -40,16 +40,16 @@
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <FONT COLOR=green><EM>--  Author:  Juergen Pfeifer, 1996</EM></FONT>
 <FONT COLOR=green><EM>--  Version Control:</EM></FONT>
-<FONT COLOR=green><EM>--  @Revision: 1.9 @</EM></FONT>
-<FONT COLOR=green><EM>--  @Date: 2008/07/26 18:50:06 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Revision: 1.10 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Date: 2009/12/26 17:38:58 @</EM></FONT>
 <FONT COLOR=green><EM>--  Binding Version 01.00</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <b>with</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-aux__ads.htm#ref_50_35">Aux</A>; <b>use</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-aux__ads.htm#ref_50_35">Aux</A>;
 
 <b>package</b> <b>body</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-forms__ads.htm#ref_49_35">Forms</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_43_41">Field_Types</A>.<FONT COLOR=red><A NAME="ref_44_58" HREF="terminal_interface-curses-forms-field_types-intfield__ads.htm#ref_41_53">IntField</A></FONT> <b>is</b>
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_46_14" HREF="terminal_interface-curses-forms-field_types-intfield__ads.htm#ref_51_14">Set_Field_Type</A></FONT> (<FONT COLOR=red><A NAME="ref_46_30" HREF="terminal_interface-curses-forms-field_types-intfield__ads.htm#ref_51_30">Fld</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
-                             <FONT COLOR=red><A NAME="ref_47_30" HREF="terminal_interface-curses-forms-field_types-intfield__ads.htm#ref_52_30">Typ</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms-field_types-intfield__ads.htm#ref_44_9">Integer_Field</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_46_14" HREF="terminal_interface-curses-forms-field_types-intfield__ads.htm#ref_51_14">Set_Field_Type</A></FONT> (<FONT COLOR=red><A NAME="ref_46_30" HREF="terminal_interface-curses-forms-field_types-intfield__ads.htm#ref_51_30">Fld</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
+                             <FONT COLOR=red><A NAME="ref_47_30" HREF="terminal_interface-curses-forms-field_types-intfield__ads.htm#ref_52_30">Typ</A></FONT> : <A HREF="terminal_interface-curses-forms-field_types-intfield__ads.htm#ref_44_9">Integer_Field</A>)
    <b>is</b>
       <FONT COLOR=red><A NAME="ref_49_7">C_Integer_Field_Type</A></FONT> : <A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_132_9">C_Field_Type</A>;
       <b>pragma</b> Import (C, <A HREF="terminal_interface-curses-forms-field_types-intfield__adb.htm#ref_49_7">C_Integer_Field_Type</A>, "TYPE_INTEGER");
diff -Naur ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-forms-field_types-intfield__ads.htm ncurses-5.7/doc/html/ada/terminal_interface-curses-forms-field_types-intfield__ads.htm
--- ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-forms-field_types-intfield__ads.htm	2008-10-11 17:36:31.000000000 -0400
+++ ncurses-5.7/doc/html/ada/terminal_interface-curses-forms-field_types-intfield__ads.htm	2011-01-08 18:13:50.355157495 -0500
@@ -12,7 +12,7 @@
 <FONT COLOR=green><EM>--                                 S P E C                                  --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-<FONT COLOR=green><EM>-- Copyright (c) 1998 Free Software Foundation, Inc.                        --</EM></FONT>
+<FONT COLOR=green><EM>-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>-- Permission is hereby granted, free of charge, to any person obtaining a  --</EM></FONT>
 <FONT COLOR=green><EM>-- copy of this software and associated documentation files (the            --</EM></FONT>
@@ -40,7 +40,7 @@
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <FONT COLOR=green><EM>--  Author:  Juergen Pfeifer, 1996</EM></FONT>
 <FONT COLOR=green><EM>--  Version Control:</EM></FONT>
-<FONT COLOR=green><EM>--  @Revision: 1.11 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Revision: 1.12 @</EM></FONT>
 <FONT COLOR=green><EM>--  Binding Version 01.00</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <b>package</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-forms__ads.htm#ref_49_35">Forms</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_43_41">Field_Types</A>.<FONT COLOR=red><A NAME="ref_41_53" HREF="terminal_interface-curses-forms-field_types-intfield__adb.htm#ref_44_58">IntField</A></FONT> <b>is</b>
@@ -53,8 +53,8 @@
          <FONT COLOR=red><A NAME="ref_48_10">Upper_Limit</A></FONT> : Integer;
       <b>end</b> <b>record</b>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_51_14" HREF="terminal_interface-curses-forms-field_types-intfield__adb.htm#ref_46_14">Set_Field_Type</A></FONT> (<FONT COLOR=red><A NAME="ref_51_30" HREF="terminal_interface-curses-forms-field_types-intfield__adb.htm#ref_46_30">Fld</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
-                             <FONT COLOR=red><A NAME="ref_52_30" HREF="terminal_interface-curses-forms-field_types-intfield__adb.htm#ref_47_30">Typ</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms-field_types-intfield__ads.htm#ref_44_9">Integer_Field</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_51_14" HREF="terminal_interface-curses-forms-field_types-intfield__adb.htm#ref_46_14">Set_Field_Type</A></FONT> (<FONT COLOR=red><A NAME="ref_51_30" HREF="terminal_interface-curses-forms-field_types-intfield__adb.htm#ref_46_30">Fld</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
+                             <FONT COLOR=red><A NAME="ref_52_30" HREF="terminal_interface-curses-forms-field_types-intfield__adb.htm#ref_47_30">Typ</A></FONT> : <A HREF="terminal_interface-curses-forms-field_types-intfield__ads.htm#ref_44_9">Integer_Field</A>);
    <b>pragma</b> Inline (Set_Field_Type);
 
 <b>end</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-forms__ads.htm#ref_49_35">Forms</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_43_41">Field_Types</A>.<A HREF="terminal_interface-curses-forms-field_types-intfield__ads.htm#ref_41_53">IntField</A>;
diff -Naur ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-forms-field_types-ipv4_address__adb.htm ncurses-5.7/doc/html/ada/terminal_interface-curses-forms-field_types-ipv4_address__adb.htm
--- ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-forms-field_types-ipv4_address__adb.htm	2008-10-11 17:36:31.000000000 -0400
+++ ncurses-5.7/doc/html/ada/terminal_interface-curses-forms-field_types-ipv4_address__adb.htm	2011-01-08 18:13:50.355157495 -0500
@@ -12,7 +12,7 @@
 <FONT COLOR=green><EM>--                                 B O D Y                                  --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-<FONT COLOR=green><EM>-- Copyright (c) 1998,2008 Free Software Foundation, Inc.                   --</EM></FONT>
+<FONT COLOR=green><EM>-- Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.              --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>-- Permission is hereby granted, free of charge, to any person obtaining a  --</EM></FONT>
 <FONT COLOR=green><EM>-- copy of this software and associated documentation files (the            --</EM></FONT>
@@ -40,16 +40,16 @@
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <FONT COLOR=green><EM>--  Author:  Juergen Pfeifer, 1996</EM></FONT>
 <FONT COLOR=green><EM>--  Version Control:</EM></FONT>
-<FONT COLOR=green><EM>--  @Revision: 1.9 @</EM></FONT>
-<FONT COLOR=green><EM>--  @Date: 2008/07/26 18:49:47 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Revision: 1.10 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Date: 2009/12/26 17:38:58 @</EM></FONT>
 <FONT COLOR=green><EM>--  Binding Version 01.00</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <b>with</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-aux__ads.htm#ref_50_35">Aux</A>; <b>use</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-aux__ads.htm#ref_50_35">Aux</A>;
 
 <b>package</b> <b>body</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-forms__ads.htm#ref_49_35">Forms</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_43_41">Field_Types</A>.<FONT COLOR=red><A NAME="ref_44_58" HREF="terminal_interface-curses-forms-field_types-ipv4_address__ads.htm#ref_41_53">IPV4_Address</A></FONT> <b>is</b>
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_46_14" HREF="terminal_interface-curses-forms-field_types-ipv4_address__ads.htm#ref_47_14">Set_Field_Type</A></FONT> (<FONT COLOR=red><A NAME="ref_46_30" HREF="terminal_interface-curses-forms-field_types-ipv4_address__ads.htm#ref_47_30">Fld</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
-                             <FONT COLOR=red><A NAME="ref_47_30" HREF="terminal_interface-curses-forms-field_types-ipv4_address__ads.htm#ref_48_30">Typ</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms-field_types-ipv4_address__ads.htm#ref_45_9">Internet_V4_Address_Field</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_46_14" HREF="terminal_interface-curses-forms-field_types-ipv4_address__ads.htm#ref_47_14">Set_Field_Type</A></FONT> (<FONT COLOR=red><A NAME="ref_46_30" HREF="terminal_interface-curses-forms-field_types-ipv4_address__ads.htm#ref_47_30">Fld</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
+                             <FONT COLOR=red><A NAME="ref_47_30" HREF="terminal_interface-curses-forms-field_types-ipv4_address__ads.htm#ref_48_30">Typ</A></FONT> : <A HREF="terminal_interface-curses-forms-field_types-ipv4_address__ads.htm#ref_45_9">Internet_V4_Address_Field</A>)
    <b>is</b>
       <FONT COLOR=red><A NAME="ref_49_7">C_IPV4_Field_Type</A></FONT> : <A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_132_9">C_Field_Type</A>;
       <b>pragma</b> Import (C, <A HREF="terminal_interface-curses-forms-field_types-ipv4_address__adb.htm#ref_49_7">C_IPV4_Field_Type</A>, "TYPE_IPV4");
diff -Naur ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-forms-field_types-ipv4_address__ads.htm ncurses-5.7/doc/html/ada/terminal_interface-curses-forms-field_types-ipv4_address__ads.htm
--- ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-forms-field_types-ipv4_address__ads.htm	2008-10-11 17:36:31.000000000 -0400
+++ ncurses-5.7/doc/html/ada/terminal_interface-curses-forms-field_types-ipv4_address__ads.htm	2011-01-08 18:13:50.355157495 -0500
@@ -12,7 +12,7 @@
 <FONT COLOR=green><EM>--                                 S P E C                                  --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-<FONT COLOR=green><EM>-- Copyright (c) 1998 Free Software Foundation, Inc.                        --</EM></FONT>
+<FONT COLOR=green><EM>-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>-- Permission is hereby granted, free of charge, to any person obtaining a  --</EM></FONT>
 <FONT COLOR=green><EM>-- copy of this software and associated documentation files (the            --</EM></FONT>
@@ -40,7 +40,7 @@
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <FONT COLOR=green><EM>--  Author:  Juergen Pfeifer, 1996</EM></FONT>
 <FONT COLOR=green><EM>--  Version Control:</EM></FONT>
-<FONT COLOR=green><EM>--  @Revision: 1.11 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Revision: 1.12 @</EM></FONT>
 <FONT COLOR=green><EM>--  Binding Version 01.00</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <b>package</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-forms__ads.htm#ref_49_35">Forms</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_43_41">Field_Types</A>.<FONT COLOR=red><A NAME="ref_41_53" HREF="terminal_interface-curses-forms-field_types-ipv4_address__adb.htm#ref_44_58">IPV4_Address</A></FONT> <b>is</b>
@@ -49,8 +49,8 @@
 
    <b>type</b> <FONT COLOR=red><A NAME="ref_45_9">Internet_V4_Address_Field</A></FONT> <b>is</b> <b>new</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_52_9">Field_Type</A> <b>with</b> <b>null</b> <b>record</b>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_47_14" HREF="terminal_interface-curses-forms-field_types-ipv4_address__adb.htm#ref_46_14">Set_Field_Type</A></FONT> (<FONT COLOR=red><A NAME="ref_47_30" HREF="terminal_interface-curses-forms-field_types-ipv4_address__adb.htm#ref_46_30">Fld</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
-                             <FONT COLOR=red><A NAME="ref_48_30" HREF="terminal_interface-curses-forms-field_types-ipv4_address__adb.htm#ref_47_30">Typ</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms-field_types-ipv4_address__ads.htm#ref_45_9">Internet_V4_Address_Field</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_47_14" HREF="terminal_interface-curses-forms-field_types-ipv4_address__adb.htm#ref_46_14">Set_Field_Type</A></FONT> (<FONT COLOR=red><A NAME="ref_47_30" HREF="terminal_interface-curses-forms-field_types-ipv4_address__adb.htm#ref_46_30">Fld</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
+                             <FONT COLOR=red><A NAME="ref_48_30" HREF="terminal_interface-curses-forms-field_types-ipv4_address__adb.htm#ref_47_30">Typ</A></FONT> : <A HREF="terminal_interface-curses-forms-field_types-ipv4_address__ads.htm#ref_45_9">Internet_V4_Address_Field</A>);
    <b>pragma</b> Inline (Set_Field_Type);
 
 <b>end</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-forms__ads.htm#ref_49_35">Forms</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_43_41">Field_Types</A>.<A HREF="terminal_interface-curses-forms-field_types-ipv4_address__ads.htm#ref_41_53">IPV4_Address</A>;
diff -Naur ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-forms-field_types-numeric__adb.htm ncurses-5.7/doc/html/ada/terminal_interface-curses-forms-field_types-numeric__adb.htm
--- ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-forms-field_types-numeric__adb.htm	2008-10-11 17:36:31.000000000 -0400
+++ ncurses-5.7/doc/html/ada/terminal_interface-curses-forms-field_types-numeric__adb.htm	2011-01-08 18:13:50.355157495 -0500
@@ -12,7 +12,7 @@
 <FONT COLOR=green><EM>--                                 B O D Y                                  --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-<FONT COLOR=green><EM>-- Copyright (c) 1998,2008 Free Software Foundation, Inc.                   --</EM></FONT>
+<FONT COLOR=green><EM>-- Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.              --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>-- Permission is hereby granted, free of charge, to any person obtaining a  --</EM></FONT>
 <FONT COLOR=green><EM>-- copy of this software and associated documentation files (the            --</EM></FONT>
@@ -40,19 +40,19 @@
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <FONT COLOR=green><EM>--  Author:  Juergen Pfeifer, 1996</EM></FONT>
 <FONT COLOR=green><EM>--  Version Control:</EM></FONT>
-<FONT COLOR=green><EM>--  @Revision: 1.10 @</EM></FONT>
-<FONT COLOR=green><EM>--  @Date: 2008/07/26 18:49:57 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Revision: 1.11 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Date: 2009/12/26 17:38:58 @</EM></FONT>
 <FONT COLOR=green><EM>--  Binding Version 01.00</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-<b>with</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C;
+<b>with</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C;
 <b>with</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-aux__ads.htm#ref_50_35">Aux</A>; <b>use</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-aux__ads.htm#ref_50_35">Aux</A>;
 
 <b>package</b> <b>body</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-forms__ads.htm#ref_49_35">Forms</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_43_41">Field_Types</A>.<FONT COLOR=red><A NAME="ref_45_58" HREF="terminal_interface-curses-forms-field_types-numeric__ads.htm#ref_41_53">Numeric</A></FONT> <b>is</b>
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_47_14" HREF="terminal_interface-curses-forms-field_types-numeric__ads.htm#ref_51_14">Set_Field_Type</A></FONT> (<FONT COLOR=red><A NAME="ref_47_30" HREF="terminal_interface-curses-forms-field_types-numeric__ads.htm#ref_51_30">Fld</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
-                             <FONT COLOR=red><A NAME="ref_48_30" HREF="terminal_interface-curses-forms-field_types-numeric__ads.htm#ref_52_30">Typ</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms-field_types-numeric__ads.htm#ref_44_9">Numeric_Field</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_47_14" HREF="terminal_interface-curses-forms-field_types-numeric__ads.htm#ref_51_14">Set_Field_Type</A></FONT> (<FONT COLOR=red><A NAME="ref_47_30" HREF="terminal_interface-curses-forms-field_types-numeric__ads.htm#ref_51_30">Fld</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
+                             <FONT COLOR=red><A NAME="ref_48_30" HREF="terminal_interface-curses-forms-field_types-numeric__ads.htm#ref_52_30">Typ</A></FONT> : <A HREF="terminal_interface-curses-forms-field_types-numeric__ads.htm#ref_44_9">Numeric_Field</A>)
    <b>is</b>
-      <b>type</b> <FONT COLOR=red><A NAME="ref_50_12">Double</A></FONT> <b>is</b> <b>new</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C.double;
+      <b>type</b> <FONT COLOR=red><A NAME="ref_50_12">Double</A></FONT> <b>is</b> <b>new</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C.double;
 
       <FONT COLOR=red><A NAME="ref_52_7">C_Numeric_Field_Type</A></FONT> : <A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_132_9">C_Field_Type</A>;
       <b>pragma</b> Import (C, <A HREF="terminal_interface-curses-forms-field_types-numeric__adb.htm#ref_52_7">C_Numeric_Field_Type</A>, "TYPE_NUMERIC");
diff -Naur ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-forms-field_types-numeric__ads.htm ncurses-5.7/doc/html/ada/terminal_interface-curses-forms-field_types-numeric__ads.htm
--- ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-forms-field_types-numeric__ads.htm	2008-10-11 17:36:31.000000000 -0400
+++ ncurses-5.7/doc/html/ada/terminal_interface-curses-forms-field_types-numeric__ads.htm	2011-01-08 18:13:50.355157495 -0500
@@ -12,7 +12,7 @@
 <FONT COLOR=green><EM>--                                 S P E C                                  --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-<FONT COLOR=green><EM>-- Copyright (c) 1998 Free Software Foundation, Inc.                        --</EM></FONT>
+<FONT COLOR=green><EM>-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>-- Permission is hereby granted, free of charge, to any person obtaining a  --</EM></FONT>
 <FONT COLOR=green><EM>-- copy of this software and associated documentation files (the            --</EM></FONT>
@@ -40,7 +40,7 @@
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <FONT COLOR=green><EM>--  Author:  Juergen Pfeifer, 1996</EM></FONT>
 <FONT COLOR=green><EM>--  Version Control:</EM></FONT>
-<FONT COLOR=green><EM>--  @Revision: 1.11 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Revision: 1.12 @</EM></FONT>
 <FONT COLOR=green><EM>--  Binding Version 01.00</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <b>package</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-forms__ads.htm#ref_49_35">Forms</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_43_41">Field_Types</A>.<FONT COLOR=red><A NAME="ref_41_53" HREF="terminal_interface-curses-forms-field_types-numeric__adb.htm#ref_45_58">Numeric</A></FONT> <b>is</b>
@@ -53,8 +53,8 @@
          <FONT COLOR=red><A NAME="ref_48_10">Upper_Limit</A></FONT> : Float;
       <b>end</b> <b>record</b>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_51_14" HREF="terminal_interface-curses-forms-field_types-numeric__adb.htm#ref_47_14">Set_Field_Type</A></FONT> (<FONT COLOR=red><A NAME="ref_51_30" HREF="terminal_interface-curses-forms-field_types-numeric__adb.htm#ref_47_30">Fld</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
-                             <FONT COLOR=red><A NAME="ref_52_30" HREF="terminal_interface-curses-forms-field_types-numeric__adb.htm#ref_48_30">Typ</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms-field_types-numeric__ads.htm#ref_44_9">Numeric_Field</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_51_14" HREF="terminal_interface-curses-forms-field_types-numeric__adb.htm#ref_47_14">Set_Field_Type</A></FONT> (<FONT COLOR=red><A NAME="ref_51_30" HREF="terminal_interface-curses-forms-field_types-numeric__adb.htm#ref_47_30">Fld</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
+                             <FONT COLOR=red><A NAME="ref_52_30" HREF="terminal_interface-curses-forms-field_types-numeric__adb.htm#ref_48_30">Typ</A></FONT> : <A HREF="terminal_interface-curses-forms-field_types-numeric__ads.htm#ref_44_9">Numeric_Field</A>);
    <b>pragma</b> Inline (Set_Field_Type);
 
 <b>end</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-forms__ads.htm#ref_49_35">Forms</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_43_41">Field_Types</A>.<A HREF="terminal_interface-curses-forms-field_types-numeric__ads.htm#ref_41_53">Numeric</A>;
diff -Naur ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-forms-field_types-regexp__adb.htm ncurses-5.7/doc/html/ada/terminal_interface-curses-forms-field_types-regexp__adb.htm
--- ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-forms-field_types-regexp__adb.htm	2006-09-23 16:31:30.000000000 -0400
+++ ncurses-5.7/doc/html/ada/terminal_interface-curses-forms-field_types-regexp__adb.htm	2011-01-08 18:13:50.355157495 -0500
@@ -12,7 +12,7 @@
 <FONT COLOR=green><EM>--                                 B O D Y                                  --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-<FONT COLOR=green><EM>-- Copyright (c) 1998 Free Software Foundation, Inc.                        --</EM></FONT>
+<FONT COLOR=green><EM>-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>-- Permission is hereby granted, free of charge, to any person obtaining a  --</EM></FONT>
 <FONT COLOR=green><EM>-- copy of this software and associated documentation files (the            --</EM></FONT>
@@ -40,18 +40,18 @@
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <FONT COLOR=green><EM>--  Author:  Juergen Pfeifer, 1996</EM></FONT>
 <FONT COLOR=green><EM>--  Version Control:</EM></FONT>
-<FONT COLOR=green><EM>--  @Revision: 1.8 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Revision: 1.9 @</EM></FONT>
 <FONT COLOR=green><EM>--  Binding Version 01.00</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-<b>with</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C; <b>use</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C;
+<b>with</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C; <b>use</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C;
 <b>with</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-aux__ads.htm#ref_50_35">Aux</A>; <b>use</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-aux__ads.htm#ref_50_35">Aux</A>;
 
 <b>package</b> <b>body</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-forms__ads.htm#ref_49_35">Forms</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_43_41">Field_Types</A>.<FONT COLOR=red><A NAME="ref_44_58" HREF="terminal_interface-curses-forms-field_types-regexp__ads.htm#ref_41_53">RegExp</A></FONT> <b>is</b>
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_46_14" HREF="terminal_interface-curses-forms-field_types-regexp__ads.htm#ref_51_14">Set_Field_Type</A></FONT> (<FONT COLOR=red><A NAME="ref_46_30" HREF="terminal_interface-curses-forms-field_types-regexp__ads.htm#ref_51_30">Fld</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
-                             <FONT COLOR=red><A NAME="ref_47_30" HREF="terminal_interface-curses-forms-field_types-regexp__ads.htm#ref_52_30">Typ</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms-field_types-regexp__ads.htm#ref_46_9">Regular_Expression_Field</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_46_14" HREF="terminal_interface-curses-forms-field_types-regexp__ads.htm#ref_51_14">Set_Field_Type</A></FONT> (<FONT COLOR=red><A NAME="ref_46_30" HREF="terminal_interface-curses-forms-field_types-regexp__ads.htm#ref_51_30">Fld</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
+                             <FONT COLOR=red><A NAME="ref_47_30" HREF="terminal_interface-curses-forms-field_types-regexp__ads.htm#ref_52_30">Typ</A></FONT> : <A HREF="terminal_interface-curses-forms-field_types-regexp__ads.htm#ref_46_9">Regular_Expression_Field</A>)
    <b>is</b>
-      <b>type</b> <FONT COLOR=red><A NAME="ref_49_12">Char_Ptr</A></FONT> <b>is</b> <b>access</b> <b>all</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C.char;
+      <b>type</b> <FONT COLOR=red><A NAME="ref_49_12">Char_Ptr</A></FONT> <b>is</b> <b>access</b> <b>all</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C.char;
 
       <FONT COLOR=red><A NAME="ref_51_7">C_Regexp_Field_Type</A></FONT> : <A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_132_9">C_Field_Type</A>;
       <b>pragma</b> Import (C, <A HREF="terminal_interface-curses-forms-field_types-regexp__adb.htm#ref_51_7">C_Regexp_Field_Type</A>, "TYPE_REGEXP");
diff -Naur ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-forms-field_types-regexp__ads.htm ncurses-5.7/doc/html/ada/terminal_interface-curses-forms-field_types-regexp__ads.htm
--- ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-forms-field_types-regexp__ads.htm	2006-09-23 16:31:30.000000000 -0400
+++ ncurses-5.7/doc/html/ada/terminal_interface-curses-forms-field_types-regexp__ads.htm	2011-01-08 18:13:50.355157495 -0500
@@ -12,7 +12,7 @@
 <FONT COLOR=green><EM>--                                 S P E C                                  --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-<FONT COLOR=green><EM>-- Copyright (c) 1998 Free Software Foundation, Inc.                        --</EM></FONT>
+<FONT COLOR=green><EM>-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>-- Permission is hereby granted, free of charge, to any person obtaining a  --</EM></FONT>
 <FONT COLOR=green><EM>-- copy of this software and associated documentation files (the            --</EM></FONT>
@@ -40,7 +40,7 @@
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <FONT COLOR=green><EM>--  Author:  Juergen Pfeifer, 1996</EM></FONT>
 <FONT COLOR=green><EM>--  Version Control:</EM></FONT>
-<FONT COLOR=green><EM>--  @Revision: 1.11 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Revision: 1.12 @</EM></FONT>
 <FONT COLOR=green><EM>--  Binding Version 01.00</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <b>package</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-forms__ads.htm#ref_49_35">Forms</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_43_41">Field_Types</A>.<FONT COLOR=red><A NAME="ref_41_53" HREF="terminal_interface-curses-forms-field_types-regexp__adb.htm#ref_44_58">RegExp</A></FONT> <b>is</b>
@@ -53,8 +53,8 @@
          <FONT COLOR=red><A NAME="ref_48_10">Regular_Expression</A></FONT> : <A HREF="terminal_interface-curses-forms-field_types-regexp__ads.htm#ref_44_9">String_Access</A>;
       <b>end</b> <b>record</b>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_51_14" HREF="terminal_interface-curses-forms-field_types-regexp__adb.htm#ref_46_14">Set_Field_Type</A></FONT> (<FONT COLOR=red><A NAME="ref_51_30" HREF="terminal_interface-curses-forms-field_types-regexp__adb.htm#ref_46_30">Fld</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
-                             <FONT COLOR=red><A NAME="ref_52_30" HREF="terminal_interface-curses-forms-field_types-regexp__adb.htm#ref_47_30">Typ</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms-field_types-regexp__ads.htm#ref_46_9">Regular_Expression_Field</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_51_14" HREF="terminal_interface-curses-forms-field_types-regexp__adb.htm#ref_46_14">Set_Field_Type</A></FONT> (<FONT COLOR=red><A NAME="ref_51_30" HREF="terminal_interface-curses-forms-field_types-regexp__adb.htm#ref_46_30">Fld</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
+                             <FONT COLOR=red><A NAME="ref_52_30" HREF="terminal_interface-curses-forms-field_types-regexp__adb.htm#ref_47_30">Typ</A></FONT> : <A HREF="terminal_interface-curses-forms-field_types-regexp__ads.htm#ref_46_9">Regular_Expression_Field</A>);
    <b>pragma</b> Inline (Set_Field_Type);
 
 <b>end</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-forms__ads.htm#ref_49_35">Forms</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_43_41">Field_Types</A>.<A HREF="terminal_interface-curses-forms-field_types-regexp__ads.htm#ref_41_53">RegExp</A>;
diff -Naur ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-forms-field_types-user-choice__ads.htm ncurses-5.7/doc/html/ada/terminal_interface-curses-forms-field_types-user-choice__ads.htm
--- ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-forms-field_types-user-choice__ads.htm	2008-10-11 17:36:31.000000000 -0400
+++ ncurses-5.7/doc/html/ada/terminal_interface-curses-forms-field_types-user-choice__ads.htm	2011-01-08 18:13:50.355157495 -0500
@@ -44,13 +44,13 @@
 <FONT COLOR=green><EM>--  @Date: 2008/07/26 18:49:20 @</EM></FONT>
 <FONT COLOR=green><EM>--  Binding Version 01.00</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-<b>with</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C;
+<b>with</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C;
 
 <b>package</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-forms__ads.htm#ref_49_35">Forms</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_43_41">Field_Types</A>.<A HREF="terminal_interface-curses-forms-field_types-user__ads.htm#ref_44_53">User</A>.<FONT COLOR=red><A NAME="ref_44_58" HREF="terminal_interface-curses-forms-field_types-user-choice__adb.htm#ref_45_63">Choice</A></FONT> <b>is</b>
    <b>pragma</b> Preelaborate
      (<A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-forms__ads.htm#ref_49_35">Forms</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_43_41">Field_Types</A>.<A HREF="terminal_interface-curses-forms-field_types-user__ads.htm#ref_44_53">User</A>.<A HREF="terminal_interface-curses-forms-field_types-user-choice__ads.htm#ref_44_58">Choice</A>);
 
-   <b>subtype</b> <FONT COLOR=red><A NAME="ref_48_12">C_Int</A></FONT> <b>is</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C.int;
+   <b>subtype</b> <FONT COLOR=red><A NAME="ref_48_12">C_Int</A></FONT> <b>is</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C.int;
 
    <b>type</b> <FONT COLOR=red><A NAME="ref_50_9">User_Defined_Field_Type_With_Choice</A></FONT> <b>is</b> <b>abstract</b> <b>new</b>
      <A HREF="terminal_interface-curses-forms-field_types-user__ads.htm#ref_48_9">User_Defined_Field_Type</A> <b>with</b> <b>null</b> <b>record</b>;
diff -Naur ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-forms-field_types-user__adb.htm ncurses-5.7/doc/html/ada/terminal_interface-curses-forms-field_types-user__adb.htm
--- ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-forms-field_types-user__adb.htm	2008-10-11 17:36:31.000000000 -0400
+++ ncurses-5.7/doc/html/ada/terminal_interface-curses-forms-field_types-user__adb.htm	2011-01-08 18:13:50.355157495 -0500
@@ -12,7 +12,7 @@
 <FONT COLOR=green><EM>--                                 B O D Y                                  --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-<FONT COLOR=green><EM>-- Copyright (c) 1998-2006,2008 Free Software Foundation, Inc.              --</EM></FONT>
+<FONT COLOR=green><EM>-- Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.              --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>-- Permission is hereby granted, free of charge, to any person obtaining a  --</EM></FONT>
 <FONT COLOR=green><EM>-- copy of this software and associated documentation files (the            --</EM></FONT>
@@ -40,8 +40,8 @@
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <FONT COLOR=green><EM>--  Author:  Juergen Pfeifer, 1996</EM></FONT>
 <FONT COLOR=green><EM>--  Version Control:</EM></FONT>
-<FONT COLOR=green><EM>--  @Revision: 1.15 @</EM></FONT>
-<FONT COLOR=green><EM>--  @Date: 2008/07/26 18:49:28 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Revision: 1.16 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Date: 2009/12/26 17:38:58 @</EM></FONT>
 <FONT COLOR=green><EM>--  Binding Version 01.00</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <b>with</b> Ada.Unchecked_Conversion;
@@ -49,8 +49,8 @@
 
 <b>package</b> <b>body</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-forms__ads.htm#ref_49_35">Forms</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_43_41">Field_Types</A>.<FONT COLOR=red><A NAME="ref_45_58" HREF="terminal_interface-curses-forms-field_types-user__ads.htm#ref_44_53">User</A></FONT> <b>is</b>
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_47_14" HREF="terminal_interface-curses-forms-field_types-user__ads.htm#ref_70_14">Set_Field_Type</A></FONT> (<FONT COLOR=red><A NAME="ref_47_30" HREF="terminal_interface-curses-forms-field_types-user__ads.htm#ref_70_30">Fld</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
-                             <FONT COLOR=red><A NAME="ref_48_30" HREF="terminal_interface-curses-forms-field_types-user__ads.htm#ref_71_30">Typ</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms-field_types-user__ads.htm#ref_48_9">User_Defined_Field_Type</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_47_14" HREF="terminal_interface-curses-forms-field_types-user__ads.htm#ref_70_14">Set_Field_Type</A></FONT> (<FONT COLOR=red><A NAME="ref_47_30" HREF="terminal_interface-curses-forms-field_types-user__ads.htm#ref_70_30">Fld</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
+                             <FONT COLOR=red><A NAME="ref_48_30" HREF="terminal_interface-curses-forms-field_types-user__ads.htm#ref_71_30">Typ</A></FONT> : <A HREF="terminal_interface-curses-forms-field_types-user__ads.htm#ref_48_9">User_Defined_Field_Type</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_50_16" HREF="terminal_interface-curses-forms-field_types-user__adb.htm#ref_61_16">Allocate_Arg</A></FONT> (<FONT COLOR=red><A NAME="ref_50_30" HREF="terminal_interface-curses-forms-field_types-user__adb.htm#ref_61_30">T</A></FONT> : <A HREF="terminal_interface-curses-forms-field_types-user__ads.htm#ref_48_9">User_Defined_Field_Type</A>'Class)
                              <b>return</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_216_9">Argument_Access</A>;
diff -Naur ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-forms-field_types-user__ads.htm ncurses-5.7/doc/html/ada/terminal_interface-curses-forms-field_types-user__ads.htm
--- ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-forms-field_types-user__ads.htm	2008-10-11 17:36:31.000000000 -0400
+++ ncurses-5.7/doc/html/ada/terminal_interface-curses-forms-field_types-user__ads.htm	2011-01-08 18:13:50.355157495 -0500
@@ -12,7 +12,7 @@
 <FONT COLOR=green><EM>--                                 S P E C                                  --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-<FONT COLOR=green><EM>-- Copyright (c) 1998,2008 Free Software Foundation, Inc.                   --</EM></FONT>
+<FONT COLOR=green><EM>-- Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.              --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>-- Permission is hereby granted, free of charge, to any person obtaining a  --</EM></FONT>
 <FONT COLOR=green><EM>-- copy of this software and associated documentation files (the            --</EM></FONT>
@@ -40,15 +40,15 @@
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <FONT COLOR=green><EM>--  Author:  Juergen Pfeifer, 1996</EM></FONT>
 <FONT COLOR=green><EM>--  Version Control:</EM></FONT>
-<FONT COLOR=green><EM>--  @Revision: 1.12 @</EM></FONT>
-<FONT COLOR=green><EM>--  @Date: 2008/07/26 18:49:38 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Revision: 1.13 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Date: 2009/12/26 17:38:58 @</EM></FONT>
 <FONT COLOR=green><EM>--  Binding Version 01.00</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-<b>with</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C;
+<b>with</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C;
 
 <b>package</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-forms__ads.htm#ref_49_35">Forms</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_43_41">Field_Types</A>.<FONT COLOR=red><A NAME="ref_44_53" HREF="terminal_interface-curses-forms-field_types-user__adb.htm#ref_45_58">User</A></FONT> <b>is</b>
    <b>pragma</b> Preelaborate (<A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-forms__ads.htm#ref_49_35">Forms</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_43_41">Field_Types</A>.<A HREF="terminal_interface-curses-forms-field_types-user__ads.htm#ref_44_53">User</A>);
-   <b>subtype</b> <FONT COLOR=red><A NAME="ref_46_12">C_Int</A></FONT> <b>is</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C.int;
+   <b>subtype</b> <FONT COLOR=red><A NAME="ref_46_12">C_Int</A></FONT> <b>is</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C.int;
 
    <b>type</b> <FONT COLOR=red><A NAME="ref_48_9">User_Defined_Field_Type</A></FONT> <b>is</b> <b>abstract</b> <b>new</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_52_9">Field_Type</A> <b>with</b> <b>null</b> <b>record</b>;
    <FONT COLOR=green><EM>--  This is the root of the mechanism we use to create field types in</EM></FONT>
@@ -72,8 +72,8 @@
    <FONT COLOR=green><EM>--  If True is returned, the character is considered as valid for the</EM></FONT>
    <FONT COLOR=green><EM>--  field, otherwise as invalid.</EM></FONT>
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_70_14" HREF="terminal_interface-curses-forms-field_types-user__adb.htm#ref_47_14">Set_Field_Type</A></FONT> (<FONT COLOR=red><A NAME="ref_70_30" HREF="terminal_interface-curses-forms-field_types-user__adb.htm#ref_47_30">Fld</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
-                             <FONT COLOR=red><A NAME="ref_71_30" HREF="terminal_interface-curses-forms-field_types-user__adb.htm#ref_48_30">Typ</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms-field_types-user__ads.htm#ref_48_9">User_Defined_Field_Type</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_70_14" HREF="terminal_interface-curses-forms-field_types-user__adb.htm#ref_47_14">Set_Field_Type</A></FONT> (<FONT COLOR=red><A NAME="ref_70_30" HREF="terminal_interface-curses-forms-field_types-user__adb.htm#ref_47_30">Fld</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
+                             <FONT COLOR=red><A NAME="ref_71_30" HREF="terminal_interface-curses-forms-field_types-user__adb.htm#ref_48_30">Typ</A></FONT> : <A HREF="terminal_interface-curses-forms-field_types-user__ads.htm#ref_48_9">User_Defined_Field_Type</A>);
    <FONT COLOR=green><EM>--  This should work for all types derived from User_Defined_Field_Type.</EM></FONT>
    <FONT COLOR=green><EM>--  No need to reimplement it for your derived type.</EM></FONT>
 
diff -Naur ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-forms-field_types__adb.htm ncurses-5.7/doc/html/ada/terminal_interface-curses-forms-field_types__adb.htm
--- ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-forms-field_types__adb.htm	2008-10-11 17:36:30.000000000 -0400
+++ ncurses-5.7/doc/html/ada/terminal_interface-curses-forms-field_types__adb.htm	2011-01-08 18:13:50.359157320 -0500
@@ -12,7 +12,7 @@
 <FONT COLOR=green><EM>--                                 B O D Y                                  --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-<FONT COLOR=green><EM>-- Copyright (c) 1998-2006,2008 Free Software Foundation, Inc.              --</EM></FONT>
+<FONT COLOR=green><EM>-- Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.              --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>-- Permission is hereby granted, free of charge, to any person obtaining a  --</EM></FONT>
 <FONT COLOR=green><EM>-- copy of this software and associated documentation files (the            --</EM></FONT>
@@ -40,8 +40,8 @@
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <FONT COLOR=green><EM>--  Author:  Juergen Pfeifer, 1996</EM></FONT>
 <FONT COLOR=green><EM>--  Version Control:</EM></FONT>
-<FONT COLOR=green><EM>--  @Revision: 1.20 @</EM></FONT>
-<FONT COLOR=green><EM>--  @Date: 2008/07/26 18:50:33 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Revision: 1.21 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Date: 2009/12/26 17:38:58 @</EM></FONT>
 <FONT COLOR=green><EM>--  Binding Version 01.00</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <b>with</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-aux__ads.htm#ref_50_35">Aux</A>; <b>use</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-aux__ads.htm#ref_50_35">Aux</A>;
@@ -73,7 +73,7 @@
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <FONT COLOR=green><EM>--  |</EM></FONT>
-   <b>function</b> <FONT COLOR=red><A NAME="ref_71_13" HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_79_13">Get_Type</A></FONT> (<FONT COLOR=red><A NAME="ref_71_23" HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_79_23">Fld</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>) <b>return</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_63_9">Field_Type_Access</A>
+   <b>function</b> <FONT COLOR=red><A NAME="ref_71_13" HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_79_13">Get_Type</A></FONT> (<FONT COLOR=red><A NAME="ref_71_23" HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_79_23">Fld</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>) <b>return</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_63_9">Field_Type_Access</A>
    <b>is</b>
       <FONT COLOR=red><A NAME="ref_73_7">Low_Level</A></FONT> : <b>constant</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_132_9">C_Field_Type</A> := <A HREF="terminal_interface-curses-forms-field_types__adb.htm#ref_59_13">Get_Fieldtype</A> (<A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_79_23">Fld</A>);
       <FONT COLOR=red><A NAME="ref_74_7">Arg</A></FONT> : <A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_216_9">Argument_Access</A>;
@@ -121,7 +121,7 @@
       <b>return</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_167_23">Usr</A>;
    <b>end</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_167_13">Copy_Arg</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_119_14" HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_172_14">Free_Arg</A></FONT> (<FONT COLOR=red><A NAME="ref_119_24" HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_172_24">Usr</A></FONT> : <b>in</b> System.Address)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_119_14" HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_172_14">Free_Arg</A></FONT> (<FONT COLOR=red><A NAME="ref_119_24" HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_172_24">Usr</A></FONT> : System.Address)
    <b>is</b>
       <b>procedure</b> Free_Type <b>is</b> <b>new</b> Ada.Unchecked_Deallocation
         (<A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_52_9">Field_Type</A>'Class, <A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_63_9">Field_Type_Access</A>);
diff -Naur ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-forms-field_types__ads.htm ncurses-5.7/doc/html/ada/terminal_interface-curses-forms-field_types__ads.htm
--- ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-forms-field_types__ads.htm	2008-10-11 17:36:30.000000000 -0400
+++ ncurses-5.7/doc/html/ada/terminal_interface-curses-forms-field_types__ads.htm	2011-01-08 18:13:50.359157320 -0500
@@ -12,7 +12,7 @@
 <FONT COLOR=green><EM>--                                 S P E C                                  --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-<FONT COLOR=green><EM>-- Copyright (c) 1998 Free Software Foundation, Inc.                        --</EM></FONT>
+<FONT COLOR=green><EM>-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>-- Permission is hereby granted, free of charge, to any person obtaining a  --</EM></FONT>
 <FONT COLOR=green><EM>-- copy of this software and associated documentation files (the            --</EM></FONT>
@@ -40,15 +40,15 @@
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <FONT COLOR=green><EM>--  Author:  Juergen Pfeifer, 1996</EM></FONT>
 <FONT COLOR=green><EM>--  Version Control:</EM></FONT>
-<FONT COLOR=green><EM>--  @Revision: 1.14 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Revision: 1.15 @</EM></FONT>
 <FONT COLOR=green><EM>--  Binding Version 01.00</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-<b>with</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C;
+<b>with</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C;
 
 <b>package</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-forms__ads.htm#ref_49_35">Forms</A>.<FONT COLOR=red><A NAME="ref_43_41" HREF="terminal_interface-curses-forms-field_types__adb.htm#ref_50_46">Field_Types</A></FONT> <b>is</b>
    <b>pragma</b> Preelaborate (<A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-forms__ads.htm#ref_49_35">Forms</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_43_41">Field_Types</A>);
-   <b>use</b> <b>type</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C.int;
-   <b>subtype</b> <FONT COLOR=red><A NAME="ref_46_12">C_Int</A></FONT> <b>is</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C.int;
+   <b>use</b> <b>type</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C.int;
+   <b>subtype</b> <FONT COLOR=red><A NAME="ref_46_12">C_Int</A></FONT> <b>is</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C.int;
 
    <FONT COLOR=green><EM>--  |=====================================================================</EM></FONT>
    <FONT COLOR=green><EM>--  | Man page <A HREF="../man/form_fieldtype.3x.html">form_fieldtype.3x</A></EM></FONT>
@@ -68,8 +68,8 @@
    <b>type</b> <FONT COLOR=red><A NAME="ref_63_9">Field_Type_Access</A></FONT> <b>is</b> <b>access</b> <b>all</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_52_9">Field_Type</A>'Class;
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_1"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_66_14">Set_Field_Type</A></FONT> (<FONT COLOR=red><A NAME="ref_66_30" HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_66_14">Fld</A></FONT>      : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
-                             <FONT COLOR=red><A NAME="ref_67_30" HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_66_14">Fld_Type</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_52_9">Field_Type</A>) <b>is</b> <b>abstract</b>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_66_14">Set_Field_Type</A></FONT> (<FONT COLOR=red><A NAME="ref_66_30" HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_66_14">Fld</A></FONT>      : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
+                             <FONT COLOR=red><A NAME="ref_67_30" HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_66_14">Fld_Type</A></FONT> : <A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_52_9">Field_Type</A>) <b>is</b> <b>abstract</b>;
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/form_fieldtype.3x.html">set_field_type()</A></EM></FONT>
    <FONT COLOR=green><EM>--  But: we hide the vararg mechanism of the C interface. You always</EM></FONT>
    <FONT COLOR=green><EM>--       have to pass a single Field_Type parameter.</EM></FONT>
@@ -81,7 +81,7 @@
    <FONT COLOR=green><EM>--  |=====================================================================</EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_2"#2|</EM></FONT>
-   <b>function</b> <FONT COLOR=red><A NAME="ref_79_13" HREF="terminal_interface-curses-forms-field_types__adb.htm#ref_71_13">Get_Type</A></FONT> (<FONT COLOR=red><A NAME="ref_79_23" HREF="terminal_interface-curses-forms-field_types__adb.htm#ref_71_23">Fld</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>) <b>return</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_63_9">Field_Type_Access</A>;
+   <b>function</b> <FONT COLOR=red><A NAME="ref_79_13" HREF="terminal_interface-curses-forms-field_types__adb.htm#ref_71_13">Get_Type</A></FONT> (<FONT COLOR=red><A NAME="ref_79_23" HREF="terminal_interface-curses-forms-field_types__adb.htm#ref_71_23">Fld</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>) <b>return</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_63_9">Field_Type_Access</A>;
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/form_field_validation.3x.html">field_type()</A></EM></FONT>
    <FONT COLOR=green><EM>--  AKA: field_arg()</EM></FONT>
    <FONT COLOR=green><EM>--  In Ada95 we can combine these. If you try to retrieve the field type</EM></FONT>
@@ -123,8 +123,8 @@
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <b>type</b> <FONT COLOR=red><A NAME="ref_119_9">Low_Level_Field_Type</A></FONT> <b>is</b>
       <b>record</b>
-         <FONT COLOR=red><A NAME="ref_121_10">Status</A></FONT> :              <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C.short;
-         <FONT COLOR=red><A NAME="ref_122_10">Ref_Count</A></FONT> :           <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C.long;
+         <FONT COLOR=red><A NAME="ref_121_10">Status</A></FONT> :              <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C.short;
+         <FONT COLOR=red><A NAME="ref_122_10">Ref_Count</A></FONT> :           <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C.long;
          <FONT COLOR=red><A NAME="ref_123_10">Left</A></FONT>, <FONT COLOR=red><A NAME="ref_123_16">Right</A></FONT> :         System.Address;
          <FONT COLOR=red><A NAME="ref_124_10">Makearg</A></FONT> :             <A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_92_9">Makearg_Function</A>;
          <FONT COLOR=red><A NAME="ref_125_10">Copyarg</A></FONT> :             <A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_96_9">Copyarg_Function</A>;
diff -Naur ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-forms-field_user_data__adb.htm ncurses-5.7/doc/html/ada/terminal_interface-curses-forms-field_user_data__adb.htm
--- ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-forms-field_user_data__adb.htm	2006-09-23 16:31:31.000000000 -0400
+++ ncurses-5.7/doc/html/ada/terminal_interface-curses-forms-field_user_data__adb.htm	2011-01-08 18:13:50.359157320 -0500
@@ -12,7 +12,7 @@
 <FONT COLOR=green><EM>--                                 B O D Y                                  --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-<FONT COLOR=green><EM>-- Copyright (c) 1998 Free Software Foundation, Inc.                        --</EM></FONT>
+<FONT COLOR=green><EM>-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>-- Permission is hereby granted, free of charge, to any person obtaining a  --</EM></FONT>
 <FONT COLOR=green><EM>-- copy of this software and associated documentation files (the            --</EM></FONT>
@@ -40,7 +40,7 @@
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <FONT COLOR=green><EM>--  Author:  Juergen Pfeifer, 1996</EM></FONT>
 <FONT COLOR=green><EM>--  Version Control:</EM></FONT>
-<FONT COLOR=green><EM>--  @Revision: 1.12 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Revision: 1.13 @</EM></FONT>
 <FONT COLOR=green><EM>--  Binding Version 01.00</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <b>with</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-aux__ads.htm#ref_50_35">Aux</A>; <b>use</b>  <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-aux__ads.htm#ref_50_35">Aux</A>;
@@ -54,10 +54,10 @@
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <FONT COLOR=green><EM>--  |</EM></FONT>
-   <b>use</b> <b>type</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C.int;
+   <b>use</b> <b>type</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C.int;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_54_14" HREF="terminal_interface-curses-forms-field_user_data__ads.htm#ref_53_14">Set_User_Data</A></FONT> (<FONT COLOR=red><A NAME="ref_54_29" HREF="terminal_interface-curses-forms-field_user_data__ads.htm#ref_53_29">Fld</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
-                            <FONT COLOR=red><A NAME="ref_55_29" HREF="terminal_interface-curses-forms-field_user_data__ads.htm#ref_54_29">Data</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms-field_user_data__ads.htm#ref_44_9">User_Access</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_54_14" HREF="terminal_interface-curses-forms-field_user_data__ads.htm#ref_53_14">Set_User_Data</A></FONT> (<FONT COLOR=red><A NAME="ref_54_29" HREF="terminal_interface-curses-forms-field_user_data__ads.htm#ref_53_29">Fld</A></FONT>  : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
+                            <FONT COLOR=red><A NAME="ref_55_29" HREF="terminal_interface-curses-forms-field_user_data__ads.htm#ref_54_29">Data</A></FONT> : <A HREF="terminal_interface-curses-forms-field_user_data__ads.htm#ref_44_9">User_Access</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_57_16">Set_Field_Userptr</A></FONT> (<FONT COLOR=red><A NAME="ref_57_35" HREF="terminal_interface-curses-forms-field_user_data__adb.htm#ref_57_16">Fld</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
                                   <FONT COLOR=red><A NAME="ref_58_35" HREF="terminal_interface-curses-forms-field_user_data__adb.htm#ref_57_16">Usr</A></FONT> : <A HREF="terminal_interface-curses-forms-field_user_data__ads.htm#ref_44_9">User_Access</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
@@ -72,7 +72,7 @@
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <FONT COLOR=green><EM>--  |</EM></FONT>
-   <b>function</b> <FONT COLOR=red><A NAME="ref_70_13" HREF="terminal_interface-curses-forms-field_user_data__ads.htm#ref_64_13">Get_User_Data</A></FONT> (<FONT COLOR=red><A NAME="ref_70_28" HREF="terminal_interface-curses-forms-field_user_data__ads.htm#ref_64_28">Fld</A></FONT>  : <b>in</b>  <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>) <b>return</b> <A HREF="terminal_interface-curses-forms-field_user_data__ads.htm#ref_44_9">User_Access</A>
+   <b>function</b> <FONT COLOR=red><A NAME="ref_70_13" HREF="terminal_interface-curses-forms-field_user_data__ads.htm#ref_64_13">Get_User_Data</A></FONT> (<FONT COLOR=red><A NAME="ref_70_28" HREF="terminal_interface-curses-forms-field_user_data__ads.htm#ref_64_28">Fld</A></FONT>  : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>) <b>return</b> <A HREF="terminal_interface-curses-forms-field_user_data__ads.htm#ref_44_9">User_Access</A>
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_72_16">Field_Userptr</A></FONT> (<FONT COLOR=red><A NAME="ref_72_31" HREF="terminal_interface-curses-forms-field_user_data__adb.htm#ref_72_16">Fld</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>) <b>return</b> <A HREF="terminal_interface-curses-forms-field_user_data__ads.htm#ref_44_9">User_Access</A>;
       <b>pragma</b> Import (C, Field_Userptr, "field_userptr");
@@ -80,7 +80,7 @@
       <b>return</b> <A HREF="terminal_interface-curses-forms-field_user_data__adb.htm#ref_72_16">Field_Userptr</A> (<A HREF="terminal_interface-curses-forms-field_user_data__ads.htm#ref_64_28">Fld</A>);
    <b>end</b> <A HREF="terminal_interface-curses-forms-field_user_data__ads.htm#ref_64_13">Get_User_Data</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_78_14" HREF="terminal_interface-curses-forms-field_user_data__ads.htm#ref_59_14">Get_User_Data</A></FONT> (<FONT COLOR=red><A NAME="ref_78_29" HREF="terminal_interface-curses-forms-field_user_data__ads.htm#ref_59_29">Fld</A></FONT>  : <b>in</b>  <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_78_14" HREF="terminal_interface-curses-forms-field_user_data__ads.htm#ref_59_14">Get_User_Data</A></FONT> (<FONT COLOR=red><A NAME="ref_78_29" HREF="terminal_interface-curses-forms-field_user_data__ads.htm#ref_59_29">Fld</A></FONT>  : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
                             <FONT COLOR=red><A NAME="ref_79_29" HREF="terminal_interface-curses-forms-field_user_data__ads.htm#ref_60_29">Data</A></FONT> : <b>out</b> <A HREF="terminal_interface-curses-forms-field_user_data__ads.htm#ref_44_9">User_Access</A>)
    <b>is</b>
    <b>begin</b>
diff -Naur ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-forms-field_user_data__ads.htm ncurses-5.7/doc/html/ada/terminal_interface-curses-forms-field_user_data__ads.htm
--- ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-forms-field_user_data__ads.htm	2007-09-01 19:56:30.000000000 -0400
+++ ncurses-5.7/doc/html/ada/terminal_interface-curses-forms-field_user_data__ads.htm	2011-01-08 18:13:50.359157320 -0500
@@ -12,7 +12,7 @@
 <FONT COLOR=green><EM>--                                 S P E C                                  --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-<FONT COLOR=green><EM>-- Copyright (c) 1998 Free Software Foundation, Inc.                        --</EM></FONT>
+<FONT COLOR=green><EM>-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>-- Permission is hereby granted, free of charge, to any person obtaining a  --</EM></FONT>
 <FONT COLOR=green><EM>-- copy of this software and associated documentation files (the            --</EM></FONT>
@@ -40,7 +40,7 @@
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <FONT COLOR=green><EM>--  Author:  Juergen Pfeifer, 1996</EM></FONT>
 <FONT COLOR=green><EM>--  Version Control:</EM></FONT>
-<FONT COLOR=green><EM>--  @Revision: 1.15 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Revision: 1.16 @</EM></FONT>
 <FONT COLOR=green><EM>--  Binding Version 01.00</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 
@@ -55,18 +55,18 @@
    <FONT COLOR=green><EM>--  |=====================================================================</EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_1"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_53_14" HREF="terminal_interface-curses-forms-field_user_data__adb.htm#ref_54_14">Set_User_Data</A></FONT> (<FONT COLOR=red><A NAME="ref_53_29" HREF="terminal_interface-curses-forms-field_user_data__adb.htm#ref_54_29">Fld</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
-                            <FONT COLOR=red><A NAME="ref_54_29" HREF="terminal_interface-curses-forms-field_user_data__adb.htm#ref_55_29">Data</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms-field_user_data__ads.htm#ref_44_9">User_Access</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_53_14" HREF="terminal_interface-curses-forms-field_user_data__adb.htm#ref_54_14">Set_User_Data</A></FONT> (<FONT COLOR=red><A NAME="ref_53_29" HREF="terminal_interface-curses-forms-field_user_data__adb.htm#ref_54_29">Fld</A></FONT>  : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
+                            <FONT COLOR=red><A NAME="ref_54_29" HREF="terminal_interface-curses-forms-field_user_data__adb.htm#ref_55_29">Data</A></FONT> : <A HREF="terminal_interface-curses-forms-field_user_data__ads.htm#ref_44_9">User_Access</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/form_field_userptr.3x.html">set_field_userptr</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses-forms-field_user_data__ads.htm#ref_53_14">Set_User_Data</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_2"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_59_14" HREF="terminal_interface-curses-forms-field_user_data__adb.htm#ref_78_14">Get_User_Data</A></FONT> (<FONT COLOR=red><A NAME="ref_59_29" HREF="terminal_interface-curses-forms-field_user_data__adb.htm#ref_78_29">Fld</A></FONT>  : <b>in</b>  <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_59_14" HREF="terminal_interface-curses-forms-field_user_data__adb.htm#ref_78_14">Get_User_Data</A></FONT> (<FONT COLOR=red><A NAME="ref_59_29" HREF="terminal_interface-curses-forms-field_user_data__adb.htm#ref_78_29">Fld</A></FONT>  : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
                             <FONT COLOR=red><A NAME="ref_60_29" HREF="terminal_interface-curses-forms-field_user_data__adb.htm#ref_79_29">Data</A></FONT> : <b>out</b> <A HREF="terminal_interface-curses-forms-field_user_data__ads.htm#ref_44_9">User_Access</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/form_field_userptr.3x.html">field_userptr</A></EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_3"#2|</EM></FONT>
-   <b>function</b> <FONT COLOR=red><A NAME="ref_64_13" HREF="terminal_interface-curses-forms-field_user_data__adb.htm#ref_70_13">Get_User_Data</A></FONT> (<FONT COLOR=red><A NAME="ref_64_28" HREF="terminal_interface-curses-forms-field_user_data__adb.htm#ref_70_28">Fld</A></FONT>  : <b>in</b>  <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>) <b>return</b> <A HREF="terminal_interface-curses-forms-field_user_data__ads.htm#ref_44_9">User_Access</A>;
+   <b>function</b> <FONT COLOR=red><A NAME="ref_64_13" HREF="terminal_interface-curses-forms-field_user_data__adb.htm#ref_70_13">Get_User_Data</A></FONT> (<FONT COLOR=red><A NAME="ref_64_28" HREF="terminal_interface-curses-forms-field_user_data__adb.htm#ref_70_28">Fld</A></FONT>  : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>) <b>return</b> <A HREF="terminal_interface-curses-forms-field_user_data__ads.htm#ref_44_9">User_Access</A>;
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/form_field_userptr.3x.html">field_userptr</A></EM></FONT>
    <FONT COLOR=green><EM>--  Sama as function</EM></FONT>
    <b>pragma</b> Inline (Get_User_Data);
diff -Naur ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-forms-form_user_data__adb.htm ncurses-5.7/doc/html/ada/terminal_interface-curses-forms-form_user_data__adb.htm
--- ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-forms-form_user_data__adb.htm	2006-09-23 16:31:31.000000000 -0400
+++ ncurses-5.7/doc/html/ada/terminal_interface-curses-forms-form_user_data__adb.htm	2011-01-08 18:13:50.359157320 -0500
@@ -12,7 +12,7 @@
 <FONT COLOR=green><EM>--                                 B O D Y                                  --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-<FONT COLOR=green><EM>-- Copyright (c) 1998 Free Software Foundation, Inc.                        --</EM></FONT>
+<FONT COLOR=green><EM>-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>-- Permission is hereby granted, free of charge, to any person obtaining a  --</EM></FONT>
 <FONT COLOR=green><EM>-- copy of this software and associated documentation files (the            --</EM></FONT>
@@ -40,7 +40,7 @@
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <FONT COLOR=green><EM>--  Author:  Juergen Pfeifer, 1996</EM></FONT>
 <FONT COLOR=green><EM>--  Version Control:</EM></FONT>
-<FONT COLOR=green><EM>--  @Revision: 1.12 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Revision: 1.13 @</EM></FONT>
 <FONT COLOR=green><EM>--  Binding Version 01.00</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <FONT COLOR=green><EM>--  |</EM></FONT>
@@ -52,13 +52,13 @@
 
 <b>package</b> <b>body</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-forms__ads.htm#ref_49_35">Forms</A>.<FONT COLOR=red><A NAME="ref_48_46" HREF="terminal_interface-curses-forms-form_user_data__ads.htm#ref_45_41">Form_User_Data</A></FONT> <b>is</b>
 
-   <b>use</b> <b>type</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C.int;
+   <b>use</b> <b>type</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C.int;
 
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <FONT COLOR=green><EM>--  |</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_55_14" HREF="terminal_interface-curses-forms-form_user_data__ads.htm#ref_53_14">Set_User_Data</A></FONT> (<FONT COLOR=red><A NAME="ref_55_29" HREF="terminal_interface-curses-forms-form_user_data__ads.htm#ref_53_29">Frm</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
-                            <FONT COLOR=red><A NAME="ref_56_29" HREF="terminal_interface-curses-forms-form_user_data__ads.htm#ref_54_29">Data</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms-form_user_data__ads.htm#ref_44_9">User_Access</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_55_14" HREF="terminal_interface-curses-forms-form_user_data__ads.htm#ref_53_14">Set_User_Data</A></FONT> (<FONT COLOR=red><A NAME="ref_55_29" HREF="terminal_interface-curses-forms-form_user_data__ads.htm#ref_53_29">Frm</A></FONT>  : <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
+                            <FONT COLOR=red><A NAME="ref_56_29" HREF="terminal_interface-curses-forms-form_user_data__ads.htm#ref_54_29">Data</A></FONT> : <A HREF="terminal_interface-curses-forms-form_user_data__ads.htm#ref_44_9">User_Access</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_58_16">Set_Form_Userptr</A></FONT> (<FONT COLOR=red><A NAME="ref_58_34" HREF="terminal_interface-curses-forms-form_user_data__adb.htm#ref_58_16">Frm</A></FONT>  : <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
                                  <FONT COLOR=red><A NAME="ref_59_34" HREF="terminal_interface-curses-forms-form_user_data__adb.htm#ref_58_16">Data</A></FONT> : <A HREF="terminal_interface-curses-forms-form_user_data__ads.htm#ref_44_9">User_Access</A>)  <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
@@ -73,7 +73,7 @@
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <FONT COLOR=green><EM>--  |</EM></FONT>
-   <b>function</b> <FONT COLOR=red><A NAME="ref_71_13" HREF="terminal_interface-curses-forms-form_user_data__ads.htm#ref_64_13">Get_User_Data</A></FONT> (<FONT COLOR=red><A NAME="ref_71_28" HREF="terminal_interface-curses-forms-form_user_data__ads.htm#ref_64_28">Frm</A></FONT>  : <b>in</b>  <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>) <b>return</b> <A HREF="terminal_interface-curses-forms-form_user_data__ads.htm#ref_44_9">User_Access</A>
+   <b>function</b> <FONT COLOR=red><A NAME="ref_71_13" HREF="terminal_interface-curses-forms-form_user_data__ads.htm#ref_64_13">Get_User_Data</A></FONT> (<FONT COLOR=red><A NAME="ref_71_28" HREF="terminal_interface-curses-forms-form_user_data__ads.htm#ref_64_28">Frm</A></FONT>  : <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>) <b>return</b> <A HREF="terminal_interface-curses-forms-form_user_data__ads.htm#ref_44_9">User_Access</A>
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_73_16">Form_Userptr</A></FONT> (<FONT COLOR=red><A NAME="ref_73_30" HREF="terminal_interface-curses-forms-form_user_data__adb.htm#ref_73_16">Frm</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>) <b>return</b> <A HREF="terminal_interface-curses-forms-form_user_data__ads.htm#ref_44_9">User_Access</A>;
       <b>pragma</b> Import (C, Form_Userptr, "form_userptr");
@@ -81,7 +81,7 @@
       <b>return</b> <A HREF="terminal_interface-curses-forms-form_user_data__adb.htm#ref_73_16">Form_Userptr</A> (<A HREF="terminal_interface-curses-forms-form_user_data__ads.htm#ref_64_28">Frm</A>);
    <b>end</b> <A HREF="terminal_interface-curses-forms-form_user_data__ads.htm#ref_64_13">Get_User_Data</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_79_14" HREF="terminal_interface-curses-forms-form_user_data__ads.htm#ref_59_14">Get_User_Data</A></FONT> (<FONT COLOR=red><A NAME="ref_79_29" HREF="terminal_interface-curses-forms-form_user_data__ads.htm#ref_59_29">Frm</A></FONT>  : <b>in</b>  <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_79_14" HREF="terminal_interface-curses-forms-form_user_data__ads.htm#ref_59_14">Get_User_Data</A></FONT> (<FONT COLOR=red><A NAME="ref_79_29" HREF="terminal_interface-curses-forms-form_user_data__ads.htm#ref_59_29">Frm</A></FONT>  : <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
                             <FONT COLOR=red><A NAME="ref_80_29" HREF="terminal_interface-curses-forms-form_user_data__ads.htm#ref_60_29">Data</A></FONT> : <b>out</b> <A HREF="terminal_interface-curses-forms-form_user_data__ads.htm#ref_44_9">User_Access</A>)
    <b>is</b>
    <b>begin</b>
diff -Naur ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-forms-form_user_data__ads.htm ncurses-5.7/doc/html/ada/terminal_interface-curses-forms-form_user_data__ads.htm
--- ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-forms-form_user_data__ads.htm	2007-09-01 19:56:30.000000000 -0400
+++ ncurses-5.7/doc/html/ada/terminal_interface-curses-forms-form_user_data__ads.htm	2011-01-08 18:13:50.359157320 -0500
@@ -12,7 +12,7 @@
 <FONT COLOR=green><EM>--                                 S P E C                                  --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-<FONT COLOR=green><EM>-- Copyright (c) 1998 Free Software Foundation, Inc.                        --</EM></FONT>
+<FONT COLOR=green><EM>-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>-- Permission is hereby granted, free of charge, to any person obtaining a  --</EM></FONT>
 <FONT COLOR=green><EM>-- copy of this software and associated documentation files (the            --</EM></FONT>
@@ -40,7 +40,7 @@
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <FONT COLOR=green><EM>--  Author:  Juergen Pfeifer, 1996</EM></FONT>
 <FONT COLOR=green><EM>--  Version Control:</EM></FONT>
-<FONT COLOR=green><EM>--  @Revision: 1.14 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Revision: 1.15 @</EM></FONT>
 <FONT COLOR=green><EM>--  Binding Version 01.00</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 
@@ -55,18 +55,18 @@
    <FONT COLOR=green><EM>--  |=====================================================================</EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_1"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_53_14" HREF="terminal_interface-curses-forms-form_user_data__adb.htm#ref_55_14">Set_User_Data</A></FONT> (<FONT COLOR=red><A NAME="ref_53_29" HREF="terminal_interface-curses-forms-form_user_data__adb.htm#ref_55_29">Frm</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
-                            <FONT COLOR=red><A NAME="ref_54_29" HREF="terminal_interface-curses-forms-form_user_data__adb.htm#ref_56_29">Data</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms-form_user_data__ads.htm#ref_44_9">User_Access</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_53_14" HREF="terminal_interface-curses-forms-form_user_data__adb.htm#ref_55_14">Set_User_Data</A></FONT> (<FONT COLOR=red><A NAME="ref_53_29" HREF="terminal_interface-curses-forms-form_user_data__adb.htm#ref_55_29">Frm</A></FONT>  : <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
+                            <FONT COLOR=red><A NAME="ref_54_29" HREF="terminal_interface-curses-forms-form_user_data__adb.htm#ref_56_29">Data</A></FONT> : <A HREF="terminal_interface-curses-forms-form_user_data__ads.htm#ref_44_9">User_Access</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/form_userptr.3x.html">set_form_userptr</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses-forms-form_user_data__ads.htm#ref_53_14">Set_User_Data</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_2"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_59_14" HREF="terminal_interface-curses-forms-form_user_data__adb.htm#ref_79_14">Get_User_Data</A></FONT> (<FONT COLOR=red><A NAME="ref_59_29" HREF="terminal_interface-curses-forms-form_user_data__adb.htm#ref_79_29">Frm</A></FONT>  : <b>in</b>  <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_59_14" HREF="terminal_interface-curses-forms-form_user_data__adb.htm#ref_79_14">Get_User_Data</A></FONT> (<FONT COLOR=red><A NAME="ref_59_29" HREF="terminal_interface-curses-forms-form_user_data__adb.htm#ref_79_29">Frm</A></FONT>  : <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
                             <FONT COLOR=red><A NAME="ref_60_29" HREF="terminal_interface-curses-forms-form_user_data__adb.htm#ref_80_29">Data</A></FONT> : <b>out</b> <A HREF="terminal_interface-curses-forms-form_user_data__ads.htm#ref_44_9">User_Access</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/form_userptr.3x.html">form_userptr</A></EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_3"#2|</EM></FONT>
-   <b>function</b> <FONT COLOR=red><A NAME="ref_64_13" HREF="terminal_interface-curses-forms-form_user_data__adb.htm#ref_71_13">Get_User_Data</A></FONT> (<FONT COLOR=red><A NAME="ref_64_28" HREF="terminal_interface-curses-forms-form_user_data__adb.htm#ref_71_28">Frm</A></FONT>  : <b>in</b>  <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>) <b>return</b> <A HREF="terminal_interface-curses-forms-form_user_data__ads.htm#ref_44_9">User_Access</A>;
+   <b>function</b> <FONT COLOR=red><A NAME="ref_64_13" HREF="terminal_interface-curses-forms-form_user_data__adb.htm#ref_71_13">Get_User_Data</A></FONT> (<FONT COLOR=red><A NAME="ref_64_28" HREF="terminal_interface-curses-forms-form_user_data__adb.htm#ref_71_28">Frm</A></FONT>  : <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>) <b>return</b> <A HREF="terminal_interface-curses-forms-form_user_data__ads.htm#ref_44_9">User_Access</A>;
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/form_userptr.3x.html">form_userptr</A></EM></FONT>
    <FONT COLOR=green><EM>--  Same as function</EM></FONT>
    <b>pragma</b> Inline (Get_User_Data);
diff -Naur ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-forms__adb.htm ncurses-5.7/doc/html/ada/terminal_interface-curses-forms__adb.htm
--- ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-forms__adb.htm	2008-10-11 17:36:30.000000000 -0400
+++ ncurses-5.7/doc/html/ada/terminal_interface-curses-forms__adb.htm	2011-01-08 18:13:50.363157410 -0500
@@ -12,7 +12,7 @@
 <FONT COLOR=green><EM>--                                 B O D Y                                  --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-<FONT COLOR=green><EM>-- Copyright (c) 1998-2004,2008 Free Software Foundation, Inc.              --</EM></FONT>
+<FONT COLOR=green><EM>-- Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.              --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>-- Permission is hereby granted, free of charge, to any person obtaining a  --</EM></FONT>
 <FONT COLOR=green><EM>-- copy of this software and associated documentation files (the            --</EM></FONT>
@@ -40,16 +40,16 @@
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <FONT COLOR=green><EM>--  Author:  Juergen Pfeifer, 1996</EM></FONT>
 <FONT COLOR=green><EM>--  Version Control:</EM></FONT>
-<FONT COLOR=green><EM>--  @Revision: 1.26 @</EM></FONT>
-<FONT COLOR=green><EM>--  @Date: 2008/07/26 18:50:44 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Revision: 1.27 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Date: 2009/12/26 17:38:58 @</EM></FONT>
 <FONT COLOR=green><EM>--  Binding Version 01.00</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <b>with</b> Ada.Unchecked_Deallocation;
 <b>with</b> Ada.Unchecked_Conversion;
 
-<b>with</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C; <b>use</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C;
-<b>with</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C.Strings; <b>use</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C.Strings;
-<b>with</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C.Pointers;
+<b>with</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C; <b>use</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C;
+<b>with</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C.Strings; <b>use</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C.Strings;
+<b>with</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C.Pointers;
 
 <b>with</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-aux__ads.htm#ref_50_35">Aux</A>;
 
@@ -59,7 +59,7 @@
 
    <b>type</b> C_Field_Array <b>is</b> <b>array</b> (Natural <b>range</b> &lt;&gt;) <b>of</b> <b>aliased</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
    <b>package</b> F_Array <b>is</b> <b>new</b>
-     <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C.Pointers (Natural, <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>, C_Field_Array, <A HREF="terminal_interface-curses-forms__ads.htm#ref_59_4">Null_Field</A>);
+     <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C.Pointers (Natural, <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>, C_Field_Array, <A HREF="terminal_interface-curses-forms__ads.htm#ref_59_4">Null_Field</A>);
 
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
    <FONT COLOR=green><EM>--  |</EM></FONT>
@@ -83,7 +83,7 @@
      Ada.Unchecked_Conversion (<A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>,
                                <A HREF="terminal_interface-curses-forms__ads.htm#ref_107_9">Form_Option_Set</A>);
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_81_14" HREF="terminal_interface-curses-forms__ads.htm#ref_276_14">Request_Name</A></FONT> (<FONT COLOR=red><A NAME="ref_81_28" HREF="terminal_interface-curses-forms__ads.htm#ref_276_28">Key</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_142_12">Form_Request_Code</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_81_14" HREF="terminal_interface-curses-forms__ads.htm#ref_276_14">Request_Name</A></FONT> (<FONT COLOR=red><A NAME="ref_81_28" HREF="terminal_interface-curses-forms__ads.htm#ref_276_28">Key</A></FONT>  : <A HREF="terminal_interface-curses-forms__ads.htm#ref_142_12">Form_Request_Code</A>;
                                 <FONT COLOR=red><A NAME="ref_82_33" HREF="terminal_interface-curses-forms__ads.htm#ref_277_28">Name</A></FONT> : <b>out</b> String)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_84_16">Form_Request_Name</A></FONT> (<FONT COLOR=red><A NAME="ref_84_35" HREF="terminal_interface-curses-forms__adb.htm#ref_84_16">Key</A></FONT> : <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>) <b>return</b> chars_ptr;
@@ -195,8 +195,8 @@
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <FONT COLOR=green><EM>--  |</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_193_14" HREF="terminal_interface-curses-forms__ads.htm#ref_339_14">Set_Justification</A></FONT> (<FONT COLOR=red><A NAME="ref_193_33" HREF="terminal_interface-curses-forms__ads.htm#ref_339_33">Fld</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
-                                <FONT COLOR=red><A NAME="ref_194_33" HREF="terminal_interface-curses-forms__ads.htm#ref_340_33">Just</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_62_9">Field_Justification</A> := <A HREF="terminal_interface-curses-forms__ads.htm#ref_62_33">None</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_193_14" HREF="terminal_interface-curses-forms__ads.htm#ref_339_14">Set_Justification</A></FONT> (<FONT COLOR=red><A NAME="ref_193_33" HREF="terminal_interface-curses-forms__ads.htm#ref_339_33">Fld</A></FONT>  : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
+                                <FONT COLOR=red><A NAME="ref_194_33" HREF="terminal_interface-curses-forms__ads.htm#ref_340_33">Just</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_62_9">Field_Justification</A> := <A HREF="terminal_interface-curses-forms__ads.htm#ref_62_33">None</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_196_16">Set_Field_Just</A></FONT> (<FONT COLOR=red><A NAME="ref_196_32" HREF="terminal_interface-curses-forms__adb.htm#ref_196_16">Fld</A></FONT>  : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
                                <FONT COLOR=red><A NAME="ref_197_32" HREF="terminal_interface-curses-forms__adb.htm#ref_196_16">Just</A></FONT> : <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
@@ -228,11 +228,11 @@
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_225_14" HREF="terminal_interface-curses-forms__ads.htm#ref_354_14">Set_Buffer</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_226_7" HREF="terminal_interface-curses-forms__ads.htm#ref_355_7">Fld</A></FONT>    : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
-      <FONT COLOR=red><A NAME="ref_227_7" HREF="terminal_interface-curses-forms__ads.htm#ref_356_7">Buffer</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_129_9">Buffer_Number</A> := <A HREF="terminal_interface-curses-forms__ads.htm#ref_129_9">Buffer_Number</A>'First;
-      <FONT COLOR=red><A NAME="ref_228_7" HREF="terminal_interface-curses-forms__ads.htm#ref_357_7">Str</A></FONT>    : <b>in</b> String)
+     (<FONT COLOR=red><A NAME="ref_226_7" HREF="terminal_interface-curses-forms__ads.htm#ref_355_7">Fld</A></FONT>    : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
+      <FONT COLOR=red><A NAME="ref_227_7" HREF="terminal_interface-curses-forms__ads.htm#ref_356_7">Buffer</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_129_9">Buffer_Number</A> := <A HREF="terminal_interface-curses-forms__ads.htm#ref_129_9">Buffer_Number</A>'First;
+      <FONT COLOR=red><A NAME="ref_228_7" HREF="terminal_interface-curses-forms__ads.htm#ref_357_7">Str</A></FONT>    : String)
    <b>is</b>
-      <b>type</b> <FONT COLOR=red><A NAME="ref_230_12">Char_Ptr</A></FONT> <b>is</b> <b>access</b> <b>all</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C.char;
+      <b>type</b> <FONT COLOR=red><A NAME="ref_230_12">Char_Ptr</A></FONT> <b>is</b> <b>access</b> <b>all</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C.char;
       <b>function</b> <FONT COLOR=red><A NAME="ref_231_16">Set_Fld_Buffer</A></FONT> (<FONT COLOR=red><A NAME="ref_231_32" HREF="terminal_interface-curses-forms__adb.htm#ref_231_16">Fld</A></FONT>    : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
                                  <FONT COLOR=red><A NAME="ref_232_34" HREF="terminal_interface-curses-forms__adb.htm#ref_231_16">Bufnum</A></FONT> : <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
                                  <FONT COLOR=red><A NAME="ref_233_34" HREF="terminal_interface-curses-forms__adb.htm#ref_231_16">S</A></FONT>      : <A HREF="terminal_interface-curses-forms__adb.htm#ref_230_12">Char_Ptr</A>)
@@ -253,8 +253,8 @@
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_250_14" HREF="terminal_interface-curses-forms__ads.htm#ref_362_14">Get_Buffer</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_251_7" HREF="terminal_interface-curses-forms__ads.htm#ref_363_7">Fld</A></FONT>    : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
-      <FONT COLOR=red><A NAME="ref_252_7" HREF="terminal_interface-curses-forms__ads.htm#ref_364_7">Buffer</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_129_9">Buffer_Number</A> := <A HREF="terminal_interface-curses-forms__ads.htm#ref_129_9">Buffer_Number</A>'First;
+     (<FONT COLOR=red><A NAME="ref_251_7" HREF="terminal_interface-curses-forms__ads.htm#ref_363_7">Fld</A></FONT>    : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
+      <FONT COLOR=red><A NAME="ref_252_7" HREF="terminal_interface-curses-forms__ads.htm#ref_364_7">Buffer</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_129_9">Buffer_Number</A> := <A HREF="terminal_interface-curses-forms__ads.htm#ref_129_9">Buffer_Number</A>'First;
       <FONT COLOR=red><A NAME="ref_253_7" HREF="terminal_interface-curses-forms__ads.htm#ref_365_7">Str</A></FONT>    : <b>out</b> String)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_255_16">Field_Buffer</A></FONT> (<FONT COLOR=red><A NAME="ref_255_30" HREF="terminal_interface-curses-forms__adb.htm#ref_255_16">Fld</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
@@ -265,8 +265,8 @@
    <b>end</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_362_14">Get_Buffer</A>;
 
    <b>function</b> <FONT COLOR=red><A NAME="ref_262_13" HREF="terminal_interface-curses-forms__ads.htm#ref_368_13">Get_Buffer</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_263_7" HREF="terminal_interface-curses-forms__ads.htm#ref_369_7">Fld</A></FONT>    : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
-      <FONT COLOR=red><A NAME="ref_264_7" HREF="terminal_interface-curses-forms__ads.htm#ref_370_7">Buffer</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_129_9">Buffer_Number</A> := <A HREF="terminal_interface-curses-forms__ads.htm#ref_129_9">Buffer_Number</A>'First) <b>return</b> String
+     (<FONT COLOR=red><A NAME="ref_263_7" HREF="terminal_interface-curses-forms__ads.htm#ref_369_7">Fld</A></FONT>    : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
+      <FONT COLOR=red><A NAME="ref_264_7" HREF="terminal_interface-curses-forms__ads.htm#ref_370_7">Buffer</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_129_9">Buffer_Number</A> := <A HREF="terminal_interface-curses-forms__ads.htm#ref_129_9">Buffer_Number</A>'First) <b>return</b> String
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_266_16">Field_Buffer</A></FONT> (<FONT COLOR=red><A NAME="ref_266_30" HREF="terminal_interface-curses-forms__adb.htm#ref_266_16">Fld</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
                              <FONT COLOR=red><A NAME="ref_267_30" HREF="terminal_interface-curses-forms__adb.htm#ref_266_16">B</A></FONT>   : <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>) <b>return</b> chars_ptr;
@@ -277,8 +277,8 @@
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <FONT COLOR=green><EM>--  |</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_275_14" HREF="terminal_interface-curses-forms__ads.htm#ref_376_14">Set_Status</A></FONT> (<FONT COLOR=red><A NAME="ref_275_26" HREF="terminal_interface-curses-forms__ads.htm#ref_376_26">Fld</A></FONT>    : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
-                         <FONT COLOR=red><A NAME="ref_276_26" HREF="terminal_interface-curses-forms__ads.htm#ref_377_26">Status</A></FONT> : <b>in</b> Boolean := True)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_275_14" HREF="terminal_interface-curses-forms__ads.htm#ref_376_14">Set_Status</A></FONT> (<FONT COLOR=red><A NAME="ref_275_26" HREF="terminal_interface-curses-forms__ads.htm#ref_376_26">Fld</A></FONT>    : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
+                         <FONT COLOR=red><A NAME="ref_276_26" HREF="terminal_interface-curses-forms__ads.htm#ref_377_26">Status</A></FONT> : Boolean := True)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_278_16">Set_Fld_Status</A></FONT> (<FONT COLOR=red><A NAME="ref_278_32" HREF="terminal_interface-curses-forms__adb.htm#ref_278_16">Fld</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
                                <FONT COLOR=red><A NAME="ref_279_32" HREF="terminal_interface-curses-forms__adb.htm#ref_278_16">St</A></FONT>  : <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
@@ -309,8 +309,8 @@
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <FONT COLOR=green><EM>--  |</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_307_14" HREF="terminal_interface-curses-forms__ads.htm#ref_387_14">Set_Maximum_Size</A></FONT> (<FONT COLOR=red><A NAME="ref_307_32" HREF="terminal_interface-curses-forms__ads.htm#ref_387_32">Fld</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
-                               <FONT COLOR=red><A NAME="ref_308_32" HREF="terminal_interface-curses-forms__ads.htm#ref_388_32">Max</A></FONT> : <b>in</b> Natural := 0)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_307_14" HREF="terminal_interface-curses-forms__ads.htm#ref_387_14">Set_Maximum_Size</A></FONT> (<FONT COLOR=red><A NAME="ref_307_32" HREF="terminal_interface-curses-forms__ads.htm#ref_387_32">Fld</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
+                               <FONT COLOR=red><A NAME="ref_308_32" HREF="terminal_interface-curses-forms__ads.htm#ref_388_32">Max</A></FONT> : Natural := 0)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_310_16">Set_Field_Max</A></FONT> (<FONT COLOR=red><A NAME="ref_310_31" HREF="terminal_interface-curses-forms__adb.htm#ref_310_16">Fld</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
                               <FONT COLOR=red><A NAME="ref_311_31" HREF="terminal_interface-curses-forms__adb.htm#ref_310_16">M</A></FONT>   : <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
@@ -329,8 +329,8 @@
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <FONT COLOR=green><EM>--  |</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_327_14" HREF="terminal_interface-curses-forms__ads.htm#ref_397_14">Set_Options</A></FONT> (<FONT COLOR=red><A NAME="ref_327_27" HREF="terminal_interface-curses-forms__ads.htm#ref_397_27">Fld</A></FONT>     : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
-                          <FONT COLOR=red><A NAME="ref_328_27" HREF="terminal_interface-curses-forms__ads.htm#ref_398_27">Options</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_68_9">Field_Option_Set</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_327_14" HREF="terminal_interface-curses-forms__ads.htm#ref_397_14">Set_Options</A></FONT> (<FONT COLOR=red><A NAME="ref_327_27" HREF="terminal_interface-curses-forms__ads.htm#ref_397_27">Fld</A></FONT>     : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
+                          <FONT COLOR=red><A NAME="ref_328_27" HREF="terminal_interface-curses-forms__ads.htm#ref_398_27">Options</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_68_9">Field_Option_Set</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_330_16">Set_Field_Opts</A></FONT> (<FONT COLOR=red><A NAME="ref_330_32" HREF="terminal_interface-curses-forms__adb.htm#ref_330_16">Fld</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
                                <FONT COLOR=red><A NAME="ref_331_32" HREF="terminal_interface-curses-forms__adb.htm#ref_330_16">Opt</A></FONT> : <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
@@ -347,8 +347,8 @@
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <FONT COLOR=green><EM>--  |</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_345_14" HREF="terminal_interface-curses-forms__ads.htm#ref_403_14">Switch_Options</A></FONT> (<FONT COLOR=red><A NAME="ref_345_30" HREF="terminal_interface-curses-forms__ads.htm#ref_403_30">Fld</A></FONT>     : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
-                             <FONT COLOR=red><A NAME="ref_346_30" HREF="terminal_interface-curses-forms__ads.htm#ref_404_30">Options</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_68_9">Field_Option_Set</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_345_14" HREF="terminal_interface-curses-forms__ads.htm#ref_403_14">Switch_Options</A></FONT> (<FONT COLOR=red><A NAME="ref_345_30" HREF="terminal_interface-curses-forms__ads.htm#ref_403_30">Fld</A></FONT>     : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
+                             <FONT COLOR=red><A NAME="ref_346_30" HREF="terminal_interface-curses-forms__ads.htm#ref_404_30">Options</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_68_9">Field_Option_Set</A>;
                              <FONT COLOR=red><A NAME="ref_347_30" HREF="terminal_interface-curses-forms__ads.htm#ref_405_30">On</A></FONT>      : Boolean := True)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_349_16">Field_Opts_On</A></FONT> (<FONT COLOR=red><A NAME="ref_349_31" HREF="terminal_interface-curses-forms__adb.htm#ref_349_16">Fld</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
@@ -373,7 +373,7 @@
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <FONT COLOR=green><EM>--  |</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_371_14" HREF="terminal_interface-curses-forms__ads.htm#ref_411_14">Get_Options</A></FONT> (<FONT COLOR=red><A NAME="ref_371_27" HREF="terminal_interface-curses-forms__ads.htm#ref_411_27">Fld</A></FONT>     : <b>in</b>  <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_371_14" HREF="terminal_interface-curses-forms__ads.htm#ref_411_14">Get_Options</A></FONT> (<FONT COLOR=red><A NAME="ref_371_27" HREF="terminal_interface-curses-forms__ads.htm#ref_411_27">Fld</A></FONT>     : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
                           <FONT COLOR=red><A NAME="ref_372_27" HREF="terminal_interface-curses-forms__ads.htm#ref_412_27">Options</A></FONT> : <b>out</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_68_9">Field_Option_Set</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_374_16">Field_Opts</A></FONT> (<FONT COLOR=red><A NAME="ref_374_28" HREF="terminal_interface-curses-forms__adb.htm#ref_374_16">Fld</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
@@ -402,9 +402,9 @@
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_399_14" HREF="terminal_interface-curses-forms__ads.htm#ref_426_14">Set_Foreground</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_400_7" HREF="terminal_interface-curses-forms__ads.htm#ref_427_7">Fld</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
-      <FONT COLOR=red><A NAME="ref_401_7" HREF="terminal_interface-curses-forms__ads.htm#ref_428_7">Fore</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_307_9">Character_Attribute_Set</A> := <A HREF="terminal_interface-curses__ads.htm#ref_350_4">Normal_Video</A>;
-      <FONT COLOR=red><A NAME="ref_402_7" HREF="terminal_interface-curses-forms__ads.htm#ref_429_7">Color</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A> := <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A>'First)
+     (<FONT COLOR=red><A NAME="ref_400_7" HREF="terminal_interface-curses-forms__ads.htm#ref_427_7">Fld</A></FONT>   : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
+      <FONT COLOR=red><A NAME="ref_401_7" HREF="terminal_interface-curses-forms__ads.htm#ref_428_7">Fore</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_307_9">Character_Attribute_Set</A> := <A HREF="terminal_interface-curses__ads.htm#ref_350_4">Normal_Video</A>;
+      <FONT COLOR=red><A NAME="ref_402_7" HREF="terminal_interface-curses-forms__ads.htm#ref_429_7">Color</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A> := <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A>'First)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_404_16">Set_Field_Fore</A></FONT> (<FONT COLOR=red><A NAME="ref_404_32" HREF="terminal_interface-curses-forms__adb.htm#ref_404_16">Fld</A></FONT>  : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
                                <FONT COLOR=red><A NAME="ref_405_32" HREF="terminal_interface-curses-forms__adb.htm#ref_404_16">Attr</A></FONT> : <A HREF="terminal_interface-curses-aux__ads.htm#ref_63_12">C_Chtype</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
@@ -423,7 +423,7 @@
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <FONT COLOR=green><EM>--  |</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_421_14" HREF="terminal_interface-curses-forms__ads.htm#ref_434_14">Foreground</A></FONT> (<FONT COLOR=red><A NAME="ref_421_26" HREF="terminal_interface-curses-forms__ads.htm#ref_434_26">Fld</A></FONT>  : <b>in</b>  <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_421_14" HREF="terminal_interface-curses-forms__ads.htm#ref_434_14">Foreground</A></FONT> (<FONT COLOR=red><A NAME="ref_421_26" HREF="terminal_interface-curses-forms__ads.htm#ref_434_26">Fld</A></FONT>  : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
                          <FONT COLOR=red><A NAME="ref_422_26" HREF="terminal_interface-curses-forms__ads.htm#ref_435_26">Fore</A></FONT> : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_307_9">Character_Attribute_Set</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_424_16">Field_Fore</A></FONT> (<FONT COLOR=red><A NAME="ref_424_28" HREF="terminal_interface-curses-forms__adb.htm#ref_424_16">Fld</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_63_12">C_Chtype</A>;
@@ -432,7 +432,7 @@
       <A HREF="terminal_interface-curses-forms__ads.htm#ref_435_26">Fore</A> := Chtype_To_AttrChar (<A HREF="terminal_interface-curses-forms__adb.htm#ref_424_16">Field_Fore</A> (<A HREF="terminal_interface-curses-forms__ads.htm#ref_434_26">Fld</A>)).<A HREF="terminal_interface-curses__ads.htm#ref_354_10">Attr</A>;
    <b>end</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_434_14">Foreground</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_430_14" HREF="terminal_interface-curses-forms__ads.htm#ref_439_14">Foreground</A></FONT> (<FONT COLOR=red><A NAME="ref_430_26" HREF="terminal_interface-curses-forms__ads.htm#ref_439_26">Fld</A></FONT>   : <b>in</b>  <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_430_14" HREF="terminal_interface-curses-forms__ads.htm#ref_439_14">Foreground</A></FONT> (<FONT COLOR=red><A NAME="ref_430_26" HREF="terminal_interface-curses-forms__ads.htm#ref_439_26">Fld</A></FONT>   : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
                          <FONT COLOR=red><A NAME="ref_431_26" HREF="terminal_interface-curses-forms__ads.htm#ref_440_26">Fore</A></FONT>  : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_307_9">Character_Attribute_Set</A>;
                          <FONT COLOR=red><A NAME="ref_432_26" HREF="terminal_interface-curses-forms__ads.htm#ref_441_26">Color</A></FONT> : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A>)
    <b>is</b>
@@ -446,9 +446,9 @@
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_443_14" HREF="terminal_interface-curses-forms__ads.htm#ref_446_14">Set_Background</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_444_7" HREF="terminal_interface-curses-forms__ads.htm#ref_447_7">Fld</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
-      <FONT COLOR=red><A NAME="ref_445_7" HREF="terminal_interface-curses-forms__ads.htm#ref_448_7">Back</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_307_9">Character_Attribute_Set</A> := <A HREF="terminal_interface-curses__ads.htm#ref_350_4">Normal_Video</A>;
-      <FONT COLOR=red><A NAME="ref_446_7" HREF="terminal_interface-curses-forms__ads.htm#ref_449_7">Color</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A> := <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A>'First)
+     (<FONT COLOR=red><A NAME="ref_444_7" HREF="terminal_interface-curses-forms__ads.htm#ref_447_7">Fld</A></FONT>   : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
+      <FONT COLOR=red><A NAME="ref_445_7" HREF="terminal_interface-curses-forms__ads.htm#ref_448_7">Back</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_307_9">Character_Attribute_Set</A> := <A HREF="terminal_interface-curses__ads.htm#ref_350_4">Normal_Video</A>;
+      <FONT COLOR=red><A NAME="ref_446_7" HREF="terminal_interface-curses-forms__ads.htm#ref_449_7">Color</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A> := <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A>'First)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_448_16">Set_Field_Back</A></FONT> (<FONT COLOR=red><A NAME="ref_448_32" HREF="terminal_interface-curses-forms__adb.htm#ref_448_16">Fld</A></FONT>  : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
                                <FONT COLOR=red><A NAME="ref_449_32" HREF="terminal_interface-curses-forms__adb.htm#ref_448_16">Attr</A></FONT> : <A HREF="terminal_interface-curses-aux__ads.htm#ref_63_12">C_Chtype</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
@@ -467,7 +467,7 @@
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <FONT COLOR=green><EM>--  |</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_465_14" HREF="terminal_interface-curses-forms__ads.htm#ref_454_14">Background</A></FONT> (<FONT COLOR=red><A NAME="ref_465_26" HREF="terminal_interface-curses-forms__ads.htm#ref_454_26">Fld</A></FONT>  : <b>in</b>  <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_465_14" HREF="terminal_interface-curses-forms__ads.htm#ref_454_14">Background</A></FONT> (<FONT COLOR=red><A NAME="ref_465_26" HREF="terminal_interface-curses-forms__ads.htm#ref_454_26">Fld</A></FONT>  : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
                          <FONT COLOR=red><A NAME="ref_466_26" HREF="terminal_interface-curses-forms__ads.htm#ref_455_26">Back</A></FONT> : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_307_9">Character_Attribute_Set</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_468_16">Field_Back</A></FONT> (<FONT COLOR=red><A NAME="ref_468_28" HREF="terminal_interface-curses-forms__adb.htm#ref_468_16">Fld</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_63_12">C_Chtype</A>;
@@ -476,7 +476,7 @@
       <A HREF="terminal_interface-curses-forms__ads.htm#ref_455_26">Back</A> := Chtype_To_AttrChar (<A HREF="terminal_interface-curses-forms__adb.htm#ref_468_16">Field_Back</A> (<A HREF="terminal_interface-curses-forms__ads.htm#ref_454_26">Fld</A>)).<A HREF="terminal_interface-curses__ads.htm#ref_354_10">Attr</A>;
    <b>end</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_454_14">Background</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_474_14" HREF="terminal_interface-curses-forms__ads.htm#ref_459_14">Background</A></FONT> (<FONT COLOR=red><A NAME="ref_474_26" HREF="terminal_interface-curses-forms__ads.htm#ref_459_26">Fld</A></FONT>   : <b>in</b>  <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_474_14" HREF="terminal_interface-curses-forms__ads.htm#ref_459_14">Background</A></FONT> (<FONT COLOR=red><A NAME="ref_474_26" HREF="terminal_interface-curses-forms__ads.htm#ref_459_26">Fld</A></FONT>   : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
                          <FONT COLOR=red><A NAME="ref_475_26" HREF="terminal_interface-curses-forms__ads.htm#ref_460_26">Back</A></FONT>  : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_307_9">Character_Attribute_Set</A>;
                          <FONT COLOR=red><A NAME="ref_476_26" HREF="terminal_interface-curses-forms__ads.htm#ref_461_26">Color</A></FONT> : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A>)
    <b>is</b>
@@ -489,8 +489,8 @@
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <FONT COLOR=green><EM>--  |</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_487_14" HREF="terminal_interface-curses-forms__ads.htm#ref_466_14">Set_Pad_Character</A></FONT> (<FONT COLOR=red><A NAME="ref_487_33" HREF="terminal_interface-curses-forms__ads.htm#ref_466_33">Fld</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
-                                <FONT COLOR=red><A NAME="ref_488_33" HREF="terminal_interface-curses-forms__ads.htm#ref_467_33">Pad</A></FONT> : <b>in</b> Character := Space)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_487_14" HREF="terminal_interface-curses-forms__ads.htm#ref_466_14">Set_Pad_Character</A></FONT> (<FONT COLOR=red><A NAME="ref_487_33" HREF="terminal_interface-curses-forms__ads.htm#ref_466_33">Fld</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
+                                <FONT COLOR=red><A NAME="ref_488_33" HREF="terminal_interface-curses-forms__ads.htm#ref_467_33">Pad</A></FONT> : Character := Space)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_490_16">Set_Field_Pad</A></FONT> (<FONT COLOR=red><A NAME="ref_490_31" HREF="terminal_interface-curses-forms__adb.htm#ref_490_16">Fld</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
                               <FONT COLOR=red><A NAME="ref_491_31" HREF="terminal_interface-curses-forms__adb.htm#ref_490_16">Ch</A></FONT>  : <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
@@ -506,7 +506,7 @@
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <FONT COLOR=green><EM>--  |</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_504_14" HREF="terminal_interface-curses-forms__ads.htm#ref_472_14">Pad_Character</A></FONT> (<FONT COLOR=red><A NAME="ref_504_29" HREF="terminal_interface-curses-forms__ads.htm#ref_472_29">Fld</A></FONT> : <b>in</b>  <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_504_14" HREF="terminal_interface-curses-forms__ads.htm#ref_472_14">Pad_Character</A></FONT> (<FONT COLOR=red><A NAME="ref_504_29" HREF="terminal_interface-curses-forms__ads.htm#ref_472_29">Fld</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
                             <FONT COLOR=red><A NAME="ref_505_29" HREF="terminal_interface-curses-forms__ads.htm#ref_473_29">Pad</A></FONT> : <b>out</b> Character)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_507_16">Field_Pad</A></FONT> (<FONT COLOR=red><A NAME="ref_507_27" HREF="terminal_interface-curses-forms__adb.htm#ref_507_16">Fld</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
@@ -521,7 +521,7 @@
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <FONT COLOR=green><EM>--  |</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_519_14" HREF="terminal_interface-curses-forms__ads.htm#ref_482_14">Info</A></FONT> (<FONT COLOR=red><A NAME="ref_519_20" HREF="terminal_interface-curses-forms__ads.htm#ref_482_20">Fld</A></FONT>                : <b>in</b>  <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_519_14" HREF="terminal_interface-curses-forms__ads.htm#ref_482_14">Info</A></FONT> (<FONT COLOR=red><A NAME="ref_519_20" HREF="terminal_interface-curses-forms__ads.htm#ref_482_20">Fld</A></FONT>                : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
                    <FONT COLOR=red><A NAME="ref_520_20" HREF="terminal_interface-curses-forms__ads.htm#ref_483_20">Lines</A></FONT>              : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_63_12">Line_Count</A>;
                    <FONT COLOR=red><A NAME="ref_521_20" HREF="terminal_interface-curses-forms__ads.htm#ref_484_20">Columns</A></FONT>            : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_65_12">Column_Count</A>;
                    <FONT COLOR=red><A NAME="ref_522_20" HREF="terminal_interface-curses-forms__ads.htm#ref_485_20">First_Row</A></FONT>          : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
@@ -555,7 +555,7 @@
 <FONT COLOR=green><EM>--  |</EM></FONT>
 <FONT COLOR=green><EM>--  |</EM></FONT>
 <FONT COLOR=green><EM>--  |</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_553_14" HREF="terminal_interface-curses-forms__ads.htm#ref_493_14">Dynamic_Info</A></FONT> (<FONT COLOR=red><A NAME="ref_553_28" HREF="terminal_interface-curses-forms__ads.htm#ref_493_28">Fld</A></FONT>     : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_553_14" HREF="terminal_interface-curses-forms__ads.htm#ref_493_14">Dynamic_Info</A></FONT> (<FONT COLOR=red><A NAME="ref_553_28" HREF="terminal_interface-curses-forms__ads.htm#ref_493_28">Fld</A></FONT>     : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
                            <FONT COLOR=red><A NAME="ref_554_28" HREF="terminal_interface-curses-forms__ads.htm#ref_494_28">Lines</A></FONT>   : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_63_12">Line_Count</A>;
                            <FONT COLOR=red><A NAME="ref_555_28" HREF="terminal_interface-curses-forms__ads.htm#ref_495_28">Columns</A></FONT> : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_65_12">Column_Count</A>;
                            <FONT COLOR=red><A NAME="ref_556_28" HREF="terminal_interface-curses-forms__ads.htm#ref_496_28">Max</A></FONT>     : <b>out</b> Natural)
@@ -584,8 +584,8 @@
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <FONT COLOR=green><EM>--  |</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_582_14" HREF="terminal_interface-curses-forms__ads.htm#ref_505_14">Set_Window</A></FONT> (<FONT COLOR=red><A NAME="ref_582_26" HREF="terminal_interface-curses-forms__ads.htm#ref_505_26">Frm</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
-                         <FONT COLOR=red><A NAME="ref_583_26" HREF="terminal_interface-curses-forms__ads.htm#ref_506_26">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_582_14" HREF="terminal_interface-curses-forms__ads.htm#ref_505_14">Set_Window</A></FONT> (<FONT COLOR=red><A NAME="ref_582_26" HREF="terminal_interface-curses-forms__ads.htm#ref_505_26">Frm</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
+                         <FONT COLOR=red><A NAME="ref_583_26" HREF="terminal_interface-curses-forms__ads.htm#ref_506_26">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_585_16">Set_Form_Win</A></FONT> (<FONT COLOR=red><A NAME="ref_585_30" HREF="terminal_interface-curses-forms__adb.htm#ref_585_16">Frm</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
                              <FONT COLOR=red><A NAME="ref_586_30" HREF="terminal_interface-curses-forms__adb.htm#ref_585_16">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
@@ -612,8 +612,8 @@
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <FONT COLOR=green><EM>--  |</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_610_14" HREF="terminal_interface-curses-forms__ads.htm#ref_516_14">Set_Sub_Window</A></FONT> (<FONT COLOR=red><A NAME="ref_610_30" HREF="terminal_interface-curses-forms__ads.htm#ref_516_30">Frm</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
-                             <FONT COLOR=red><A NAME="ref_611_30" HREF="terminal_interface-curses-forms__ads.htm#ref_517_30">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_610_14" HREF="terminal_interface-curses-forms__ads.htm#ref_516_14">Set_Sub_Window</A></FONT> (<FONT COLOR=red><A NAME="ref_610_30" HREF="terminal_interface-curses-forms__ads.htm#ref_516_30">Frm</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
+                             <FONT COLOR=red><A NAME="ref_611_30" HREF="terminal_interface-curses-forms__ads.htm#ref_517_30">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_613_16">Set_Form_Sub</A></FONT> (<FONT COLOR=red><A NAME="ref_613_30" HREF="terminal_interface-curses-forms__adb.htm#ref_613_16">Frm</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
                              <FONT COLOR=red><A NAME="ref_614_30" HREF="terminal_interface-curses-forms__adb.htm#ref_613_16">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
@@ -640,7 +640,7 @@
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <FONT COLOR=green><EM>--  |</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_638_14" HREF="terminal_interface-curses-forms__ads.htm#ref_527_14">Scale</A></FONT> (<FONT COLOR=red><A NAME="ref_638_21" HREF="terminal_interface-curses-forms__ads.htm#ref_527_21">Frm</A></FONT>     : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_638_14" HREF="terminal_interface-curses-forms__ads.htm#ref_527_14">Scale</A></FONT> (<FONT COLOR=red><A NAME="ref_638_21" HREF="terminal_interface-curses-forms__ads.htm#ref_527_21">Frm</A></FONT>     : <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
                     <FONT COLOR=red><A NAME="ref_639_21" HREF="terminal_interface-curses-forms__ads.htm#ref_528_21">Lines</A></FONT>   : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_63_12">Line_Count</A>;
                     <FONT COLOR=red><A NAME="ref_640_21" HREF="terminal_interface-curses-forms__ads.htm#ref_529_21">Columns</A></FONT> : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_65_12">Column_Count</A>)
    <b>is</b>
@@ -664,8 +664,8 @@
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <FONT COLOR=green><EM>--  |</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_662_14" HREF="terminal_interface-curses-forms__ads.htm#ref_541_14">Set_Field_Init_Hook</A></FONT> (<FONT COLOR=red><A NAME="ref_662_35" HREF="terminal_interface-curses-forms__ads.htm#ref_541_35">Frm</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
-                                  <FONT COLOR=red><A NAME="ref_663_35" HREF="terminal_interface-curses-forms__ads.htm#ref_542_35">Proc</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_537_9">Form_Hook_Function</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_662_14" HREF="terminal_interface-curses-forms__ads.htm#ref_541_14">Set_Field_Init_Hook</A></FONT> (<FONT COLOR=red><A NAME="ref_662_35" HREF="terminal_interface-curses-forms__ads.htm#ref_541_35">Frm</A></FONT>  : <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
+                                  <FONT COLOR=red><A NAME="ref_663_35" HREF="terminal_interface-curses-forms__ads.htm#ref_542_35">Proc</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_537_9">Form_Hook_Function</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_665_16">Set_Field_Init</A></FONT> (<FONT COLOR=red><A NAME="ref_665_32" HREF="terminal_interface-curses-forms__adb.htm#ref_665_16">Frm</A></FONT>  : <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
                                <FONT COLOR=red><A NAME="ref_666_32" HREF="terminal_interface-curses-forms__adb.htm#ref_665_16">Proc</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_537_9">Form_Hook_Function</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
@@ -680,8 +680,8 @@
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <FONT COLOR=green><EM>--  |</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_678_14" HREF="terminal_interface-curses-forms__ads.htm#ref_547_14">Set_Field_Term_Hook</A></FONT> (<FONT COLOR=red><A NAME="ref_678_35" HREF="terminal_interface-curses-forms__ads.htm#ref_547_35">Frm</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
-                                  <FONT COLOR=red><A NAME="ref_679_35" HREF="terminal_interface-curses-forms__ads.htm#ref_548_35">Proc</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_537_9">Form_Hook_Function</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_678_14" HREF="terminal_interface-curses-forms__ads.htm#ref_547_14">Set_Field_Term_Hook</A></FONT> (<FONT COLOR=red><A NAME="ref_678_35" HREF="terminal_interface-curses-forms__ads.htm#ref_547_35">Frm</A></FONT>  : <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
+                                  <FONT COLOR=red><A NAME="ref_679_35" HREF="terminal_interface-curses-forms__ads.htm#ref_548_35">Proc</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_537_9">Form_Hook_Function</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_681_16">Set_Field_Term</A></FONT> (<FONT COLOR=red><A NAME="ref_681_32" HREF="terminal_interface-curses-forms__adb.htm#ref_681_16">Frm</A></FONT>  : <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
                                <FONT COLOR=red><A NAME="ref_682_32" HREF="terminal_interface-curses-forms__adb.htm#ref_681_16">Proc</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_537_9">Form_Hook_Function</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
@@ -696,8 +696,8 @@
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <FONT COLOR=green><EM>--  |</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_694_14" HREF="terminal_interface-curses-forms__ads.htm#ref_553_14">Set_Form_Init_Hook</A></FONT> (<FONT COLOR=red><A NAME="ref_694_34" HREF="terminal_interface-curses-forms__ads.htm#ref_553_34">Frm</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
-                                 <FONT COLOR=red><A NAME="ref_695_34" HREF="terminal_interface-curses-forms__ads.htm#ref_554_34">Proc</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_537_9">Form_Hook_Function</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_694_14" HREF="terminal_interface-curses-forms__ads.htm#ref_553_14">Set_Form_Init_Hook</A></FONT> (<FONT COLOR=red><A NAME="ref_694_34" HREF="terminal_interface-curses-forms__ads.htm#ref_553_34">Frm</A></FONT>  : <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
+                                 <FONT COLOR=red><A NAME="ref_695_34" HREF="terminal_interface-curses-forms__ads.htm#ref_554_34">Proc</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_537_9">Form_Hook_Function</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_697_16">Set_Form_Init</A></FONT> (<FONT COLOR=red><A NAME="ref_697_31" HREF="terminal_interface-curses-forms__adb.htm#ref_697_16">Frm</A></FONT>  : <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
                               <FONT COLOR=red><A NAME="ref_698_31" HREF="terminal_interface-curses-forms__adb.htm#ref_697_16">Proc</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_537_9">Form_Hook_Function</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
@@ -712,8 +712,8 @@
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <FONT COLOR=green><EM>--  |</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_710_14" HREF="terminal_interface-curses-forms__ads.htm#ref_559_14">Set_Form_Term_Hook</A></FONT> (<FONT COLOR=red><A NAME="ref_710_34" HREF="terminal_interface-curses-forms__ads.htm#ref_559_34">Frm</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
-                                 <FONT COLOR=red><A NAME="ref_711_34" HREF="terminal_interface-curses-forms__ads.htm#ref_560_34">Proc</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_537_9">Form_Hook_Function</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_710_14" HREF="terminal_interface-curses-forms__ads.htm#ref_559_14">Set_Form_Term_Hook</A></FONT> (<FONT COLOR=red><A NAME="ref_710_34" HREF="terminal_interface-curses-forms__ads.htm#ref_559_34">Frm</A></FONT>  : <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
+                                 <FONT COLOR=red><A NAME="ref_711_34" HREF="terminal_interface-curses-forms__ads.htm#ref_560_34">Proc</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_537_9">Form_Hook_Function</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_713_16">Set_Form_Term</A></FONT> (<FONT COLOR=red><A NAME="ref_713_31" HREF="terminal_interface-curses-forms__adb.htm#ref_713_16">Frm</A></FONT>  : <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
                               <FONT COLOR=red><A NAME="ref_714_31" HREF="terminal_interface-curses-forms__adb.htm#ref_713_16">Proc</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_537_9">Form_Hook_Function</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
@@ -732,8 +732,8 @@
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <FONT COLOR=green><EM>--  |</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_730_14" HREF="terminal_interface-curses-forms__ads.htm#ref_589_14">Redefine</A></FONT> (<FONT COLOR=red><A NAME="ref_730_24" HREF="terminal_interface-curses-forms__ads.htm#ref_589_24">Frm</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
-                       <FONT COLOR=red><A NAME="ref_731_24" HREF="terminal_interface-curses-forms__ads.htm#ref_590_24">Flds</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_134_9">Field_Array_Access</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_730_14" HREF="terminal_interface-curses-forms__ads.htm#ref_589_14">Redefine</A></FONT> (<FONT COLOR=red><A NAME="ref_730_24" HREF="terminal_interface-curses-forms__ads.htm#ref_589_24">Frm</A></FONT>  : <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
+                       <FONT COLOR=red><A NAME="ref_731_24" HREF="terminal_interface-curses-forms__ads.htm#ref_590_24">Flds</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_134_9">Field_Array_Access</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_733_16">Set_Frm_Fields</A></FONT> (<FONT COLOR=red><A NAME="ref_733_32" HREF="terminal_interface-curses-forms__adb.htm#ref_733_16">Frm</A></FONT>   : <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
                                <FONT COLOR=red><A NAME="ref_734_32" HREF="terminal_interface-curses-forms__adb.htm#ref_733_16">Items</A></FONT> : System.Address) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
@@ -784,9 +784,9 @@
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <FONT COLOR=green><EM>--  |</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_782_14" HREF="terminal_interface-curses-forms__ads.htm#ref_612_14">Move</A></FONT> (<FONT COLOR=red><A NAME="ref_782_20" HREF="terminal_interface-curses-forms__ads.htm#ref_612_20">Fld</A></FONT>    : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
-                   <FONT COLOR=red><A NAME="ref_783_20" HREF="terminal_interface-curses-forms__ads.htm#ref_613_20">Line</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
-                   <FONT COLOR=red><A NAME="ref_784_20" HREF="terminal_interface-curses-forms__ads.htm#ref_614_20">Column</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_782_14" HREF="terminal_interface-curses-forms__ads.htm#ref_612_14">Move</A></FONT> (<FONT COLOR=red><A NAME="ref_782_20" HREF="terminal_interface-curses-forms__ads.htm#ref_612_20">Fld</A></FONT>    : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
+                   <FONT COLOR=red><A NAME="ref_783_20" HREF="terminal_interface-curses-forms__ads.htm#ref_613_20">Line</A></FONT>   : <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
+                   <FONT COLOR=red><A NAME="ref_784_20" HREF="terminal_interface-curses-forms__ads.htm#ref_614_20">Column</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_786_16">Move</A></FONT> (<FONT COLOR=red><A NAME="ref_786_22" HREF="terminal_interface-curses-forms__adb.htm#ref_786_16">Fld</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>; <FONT COLOR=red><A NAME="ref_786_35" HREF="terminal_interface-curses-forms__adb.htm#ref_786_16">L</A></FONT>, <FONT COLOR=red><A NAME="ref_786_38" HREF="terminal_interface-curses-forms__adb.htm#ref_786_16">C</A></FONT> : <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
       <b>pragma</b> Import (C, Move, "move_field");
@@ -844,8 +844,8 @@
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <FONT COLOR=green><EM>--  |</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_842_14" HREF="terminal_interface-curses-forms__ads.htm#ref_644_14">Set_Options</A></FONT> (<FONT COLOR=red><A NAME="ref_842_27" HREF="terminal_interface-curses-forms__ads.htm#ref_644_27">Frm</A></FONT>     : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
-                          <FONT COLOR=red><A NAME="ref_843_27" HREF="terminal_interface-curses-forms__ads.htm#ref_645_27">Options</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_107_9">Form_Option_Set</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_842_14" HREF="terminal_interface-curses-forms__ads.htm#ref_644_14">Set_Options</A></FONT> (<FONT COLOR=red><A NAME="ref_842_27" HREF="terminal_interface-curses-forms__ads.htm#ref_644_27">Frm</A></FONT>     : <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
+                          <FONT COLOR=red><A NAME="ref_843_27" HREF="terminal_interface-curses-forms__ads.htm#ref_645_27">Options</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_107_9">Form_Option_Set</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_845_16">Set_Form_Opts</A></FONT> (<FONT COLOR=red><A NAME="ref_845_31" HREF="terminal_interface-curses-forms__adb.htm#ref_845_16">Frm</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
                               <FONT COLOR=red><A NAME="ref_846_31" HREF="terminal_interface-curses-forms__adb.htm#ref_845_16">Opt</A></FONT> : <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
@@ -862,8 +862,8 @@
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <FONT COLOR=green><EM>--  |</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_860_14" HREF="terminal_interface-curses-forms__ads.htm#ref_650_14">Switch_Options</A></FONT> (<FONT COLOR=red><A NAME="ref_860_30" HREF="terminal_interface-curses-forms__ads.htm#ref_650_30">Frm</A></FONT>     : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
-                             <FONT COLOR=red><A NAME="ref_861_30" HREF="terminal_interface-curses-forms__ads.htm#ref_651_30">Options</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_107_9">Form_Option_Set</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_860_14" HREF="terminal_interface-curses-forms__ads.htm#ref_650_14">Switch_Options</A></FONT> (<FONT COLOR=red><A NAME="ref_860_30" HREF="terminal_interface-curses-forms__ads.htm#ref_650_30">Frm</A></FONT>     : <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
+                             <FONT COLOR=red><A NAME="ref_861_30" HREF="terminal_interface-curses-forms__ads.htm#ref_651_30">Options</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_107_9">Form_Option_Set</A>;
                              <FONT COLOR=red><A NAME="ref_862_30" HREF="terminal_interface-curses-forms__ads.htm#ref_652_30">On</A></FONT>      : Boolean := True)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_864_16">Form_Opts_On</A></FONT> (<FONT COLOR=red><A NAME="ref_864_30" HREF="terminal_interface-curses-forms__adb.htm#ref_864_16">Frm</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
@@ -888,7 +888,7 @@
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <FONT COLOR=green><EM>--  |</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_886_14" HREF="terminal_interface-curses-forms__ads.htm#ref_658_14">Get_Options</A></FONT> (<FONT COLOR=red><A NAME="ref_886_27" HREF="terminal_interface-curses-forms__ads.htm#ref_658_27">Frm</A></FONT>     : <b>in</b>  <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_886_14" HREF="terminal_interface-curses-forms__ads.htm#ref_658_14">Get_Options</A></FONT> (<FONT COLOR=red><A NAME="ref_886_27" HREF="terminal_interface-curses-forms__ads.htm#ref_658_27">Frm</A></FONT>     : <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
                           <FONT COLOR=red><A NAME="ref_887_27" HREF="terminal_interface-curses-forms__ads.htm#ref_659_27">Options</A></FONT> : <b>out</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_107_9">Form_Option_Set</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_889_16">Form_Opts</A></FONT> (<FONT COLOR=red><A NAME="ref_889_27" HREF="terminal_interface-curses-forms__adb.htm#ref_889_16">Frm</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
@@ -915,8 +915,8 @@
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <FONT COLOR=green><EM>--  |</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_913_14" HREF="terminal_interface-curses-forms__ads.htm#ref_672_14">Post</A></FONT> (<FONT COLOR=red><A NAME="ref_913_20" HREF="terminal_interface-curses-forms__ads.htm#ref_672_20">Frm</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
-                   <FONT COLOR=red><A NAME="ref_914_20" HREF="terminal_interface-curses-forms__ads.htm#ref_673_20">Post</A></FONT> : <b>in</b> Boolean := True)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_913_14" HREF="terminal_interface-curses-forms__ads.htm#ref_672_14">Post</A></FONT> (<FONT COLOR=red><A NAME="ref_913_20" HREF="terminal_interface-curses-forms__ads.htm#ref_672_20">Frm</A></FONT>  : <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
+                   <FONT COLOR=red><A NAME="ref_914_20" HREF="terminal_interface-curses-forms__ads.htm#ref_673_20">Post</A></FONT> : Boolean := True)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_916_16">M_Post</A></FONT> (<FONT COLOR=red><A NAME="ref_916_24" HREF="terminal_interface-curses-forms__adb.htm#ref_916_16">Frm</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
       <b>pragma</b> Import (C, M_Post, "post_form");
@@ -1025,8 +1025,8 @@
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <FONT COLOR=green><EM>--  |</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1023_14" HREF="terminal_interface-curses-forms__ads.htm#ref_723_14">Set_Current</A></FONT> (<FONT COLOR=red><A NAME="ref_1023_27" HREF="terminal_interface-curses-forms__ads.htm#ref_723_27">Frm</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
-                          <FONT COLOR=red><A NAME="ref_1024_27" HREF="terminal_interface-curses-forms__ads.htm#ref_724_27">Fld</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1023_14" HREF="terminal_interface-curses-forms__ads.htm#ref_723_14">Set_Current</A></FONT> (<FONT COLOR=red><A NAME="ref_1023_27" HREF="terminal_interface-curses-forms__ads.htm#ref_723_27">Frm</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
+                          <FONT COLOR=red><A NAME="ref_1024_27" HREF="terminal_interface-curses-forms__ads.htm#ref_724_27">Fld</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_1026_16">Set_Current_Fld</A></FONT> (<FONT COLOR=red><A NAME="ref_1026_33" HREF="terminal_interface-curses-forms__adb.htm#ref_1026_16">Frm</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>; <FONT COLOR=red><A NAME="ref_1026_45" HREF="terminal_interface-curses-forms__adb.htm#ref_1026_16">Fld</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
       <b>pragma</b> Import (C, Set_Current_Fld, "set_current_field");
@@ -1040,7 +1040,7 @@
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <FONT COLOR=green><EM>--  |</EM></FONT>
-   <b>function</b> <FONT COLOR=red><A NAME="ref_1038_13" HREF="terminal_interface-curses-forms__ads.htm#ref_729_13">Current</A></FONT> (<FONT COLOR=red><A NAME="ref_1038_22" HREF="terminal_interface-curses-forms__ads.htm#ref_729_22">Frm</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>) <b>return</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>
+   <b>function</b> <FONT COLOR=red><A NAME="ref_1038_13" HREF="terminal_interface-curses-forms__ads.htm#ref_729_13">Current</A></FONT> (<FONT COLOR=red><A NAME="ref_1038_22" HREF="terminal_interface-curses-forms__ads.htm#ref_729_22">Frm</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>) <b>return</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_1040_16">Current_Fld</A></FONT> (<FONT COLOR=red><A NAME="ref_1040_29" HREF="terminal_interface-curses-forms__adb.htm#ref_1040_16">Frm</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>) <b>return</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
       <b>pragma</b> Import (C, Current_Fld, "current_field");
@@ -1055,8 +1055,8 @@
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <FONT COLOR=green><EM>--  |</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1053_14" HREF="terminal_interface-curses-forms__ads.htm#ref_734_14">Set_Page</A></FONT> (<FONT COLOR=red><A NAME="ref_1053_24" HREF="terminal_interface-curses-forms__ads.htm#ref_734_24">Frm</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
-                       <FONT COLOR=red><A NAME="ref_1054_24" HREF="terminal_interface-curses-forms__ads.htm#ref_735_24">Page</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_720_9">Page_Number</A> := <A HREF="terminal_interface-curses-forms__ads.htm#ref_720_9">Page_Number</A>'First)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1053_14" HREF="terminal_interface-curses-forms__ads.htm#ref_734_14">Set_Page</A></FONT> (<FONT COLOR=red><A NAME="ref_1053_24" HREF="terminal_interface-curses-forms__ads.htm#ref_734_24">Frm</A></FONT>  : <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
+                       <FONT COLOR=red><A NAME="ref_1054_24" HREF="terminal_interface-curses-forms__ads.htm#ref_735_24">Page</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_720_9">Page_Number</A> := <A HREF="terminal_interface-curses-forms__ads.htm#ref_720_9">Page_Number</A>'First)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_1056_16">Set_Frm_Page</A></FONT> (<FONT COLOR=red><A NAME="ref_1056_30" HREF="terminal_interface-curses-forms__adb.htm#ref_1056_16">Frm</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>; <FONT COLOR=red><A NAME="ref_1056_42" HREF="terminal_interface-curses-forms__adb.htm#ref_1056_16">Pg</A></FONT> : <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
       <b>pragma</b> Import (C, Set_Frm_Page, "set_form_page");
@@ -1104,8 +1104,8 @@
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <FONT COLOR=green><EM>--  |</EM></FONT>
    <FONT COLOR=green><EM>--  |</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1102_14" HREF="terminal_interface-curses-forms__ads.htm#ref_757_14">Set_New_Page</A></FONT> (<FONT COLOR=red><A NAME="ref_1102_28" HREF="terminal_interface-curses-forms__ads.htm#ref_757_28">Fld</A></FONT>      : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
-                           <FONT COLOR=red><A NAME="ref_1103_28" HREF="terminal_interface-curses-forms__ads.htm#ref_758_28">New_Page</A></FONT> : <b>in</b> Boolean := True)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1102_14" HREF="terminal_interface-curses-forms__ads.htm#ref_757_14">Set_New_Page</A></FONT> (<FONT COLOR=red><A NAME="ref_1102_28" HREF="terminal_interface-curses-forms__ads.htm#ref_757_28">Fld</A></FONT>      : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
+                           <FONT COLOR=red><A NAME="ref_1103_28" HREF="terminal_interface-curses-forms__ads.htm#ref_758_28">New_Page</A></FONT> : Boolean := True)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_1105_16">Set_Page</A></FONT> (<FONT COLOR=red><A NAME="ref_1105_26" HREF="terminal_interface-curses-forms__adb.htm#ref_1105_16">Fld</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>; <FONT COLOR=red><A NAME="ref_1105_39" HREF="terminal_interface-curses-forms__adb.htm#ref_1105_16">Flg</A></FONT> : <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
       <b>pragma</b> Import (C, Set_Page, "set_new_page");
@@ -1134,7 +1134,7 @@
    <b>end</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_763_13">Is_New_Page</A>;
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_1131_14" HREF="terminal_interface-curses-forms__ads.htm#ref_136_14">Free</A></FONT> (<FONT COLOR=red><A NAME="ref_1131_20" HREF="terminal_interface-curses-forms__ads.htm#ref_136_20">FA</A></FONT>          : <b>in</b> <b>out</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_134_9">Field_Array_Access</A>;
-                   <FONT COLOR=red><A NAME="ref_1132_20" HREF="terminal_interface-curses-forms__ads.htm#ref_137_20">Free_Fields</A></FONT> : <b>in</b> Boolean := False)
+                   <FONT COLOR=red><A NAME="ref_1132_20" HREF="terminal_interface-curses-forms__ads.htm#ref_137_20">Free_Fields</A></FONT> : Boolean := False)
    <b>is</b>
       <b>procedure</b> Release <b>is</b> <b>new</b> Ada.Unchecked_Deallocation
         (Field_Array, <A HREF="terminal_interface-curses-forms__ads.htm#ref_134_9">Field_Array_Access</A>);
diff -Naur ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-forms__ads.htm ncurses-5.7/doc/html/ada/terminal_interface-curses-forms__ads.htm
--- ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-forms__ads.htm	2008-10-11 17:36:30.000000000 -0400
+++ ncurses-5.7/doc/html/ada/terminal_interface-curses-forms__ads.htm	2011-01-08 18:13:50.363157410 -0500
@@ -12,7 +12,7 @@
 <FONT COLOR=green><EM>--                                 S P E C                                  --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-<FONT COLOR=green><EM>-- Copyright (c) 1998,2006 Free Software Foundation, Inc.                   --</EM></FONT>
+<FONT COLOR=green><EM>-- Copyright (c) 1998-2006,2009 Free Software Foundation, Inc.              --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>-- Permission is hereby granted, free of charge, to any person obtaining a  --</EM></FONT>
 <FONT COLOR=green><EM>-- copy of this software and associated documentation files (the            --</EM></FONT>
@@ -40,8 +40,8 @@
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <FONT COLOR=green><EM>--  Author:  Juergen Pfeifer, 1996</EM></FONT>
 <FONT COLOR=green><EM>--  Version Control:</EM></FONT>
-<FONT COLOR=green><EM>--  @Revision: 1.29 @</EM></FONT>
-<FONT COLOR=green><EM>--  @Date: 2006/06/25 14:30:21 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Revision: 1.30 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Date: 2009/12/26 17:31:35 @</EM></FONT>
 <FONT COLOR=green><EM>--  Binding Version 01.00</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <FONT COLOR=green><EM>--  form binding.</EM></FONT>
@@ -53,8 +53,8 @@
 
 <b>package</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<FONT COLOR=red><A NAME="ref_49_35" HREF="terminal_interface-curses-forms__adb.htm#ref_51_40">Forms</A></FONT> <b>is</b>
    <b>pragma</b> Preelaborate (<A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-forms__ads.htm#ref_49_35">Forms</A>);
-   <b>pragma</b> Linker_Options ("-lformw");
-   <b>pragma</b> Linker_Options ("-lncursesw");
+   <b>pragma</b> Linker_Options ("-lform");
+   <b>pragma</b> Linker_Options ("-lncurses");
 
    Space : Character <b>renames</b> Ada.Characters.Latin_1.Space;
 
@@ -139,7 +139,7 @@
    <b>type</b> <FONT COLOR=red><A NAME="ref_134_9">Field_Array_Access</A></FONT> <b>is</b> <b>access</b> Field_Array;
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_136_14" HREF="terminal_interface-curses-forms__adb.htm#ref_1131_14">Free</A></FONT> (<FONT COLOR=red><A NAME="ref_136_20" HREF="terminal_interface-curses-forms__adb.htm#ref_1131_20">FA</A></FONT>          : <b>in</b> <b>out</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_134_9">Field_Array_Access</A>;
-                   <FONT COLOR=red><A NAME="ref_137_20" HREF="terminal_interface-curses-forms__adb.htm#ref_1132_20">Free_Fields</A></FONT> : <b>in</b> Boolean := False);
+                   <FONT COLOR=red><A NAME="ref_137_20" HREF="terminal_interface-curses-forms__adb.htm#ref_1132_20">Free_Fields</A></FONT> : Boolean := False);
    <FONT COLOR=green><EM>--  Release the memory for an allocated field array</EM></FONT>
    <FONT COLOR=green><EM>--  If Free_Fields is True, call Delete() for all the fields in</EM></FONT>
    <FONT COLOR=green><EM>--  the array.</EM></FONT>
@@ -278,7 +278,7 @@
    REQ_NEXT_CHOICE  : <A HREF="terminal_interface-curses-forms__ads.htm#ref_142_12">Form_Request_Code</A> <b>renames</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_208_4">F_Next_Choice</A>;
    REQ_PREV_CHOICE  : <A HREF="terminal_interface-curses-forms__ads.htm#ref_142_12">Form_Request_Code</A> <b>renames</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_209_4">F_Previous_Choice</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_276_14" HREF="terminal_interface-curses-forms__adb.htm#ref_81_14">Request_Name</A></FONT> (<FONT COLOR=red><A NAME="ref_276_28" HREF="terminal_interface-curses-forms__adb.htm#ref_81_28">Key</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_142_12">Form_Request_Code</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_276_14" HREF="terminal_interface-curses-forms__adb.htm#ref_81_14">Request_Name</A></FONT> (<FONT COLOR=red><A NAME="ref_276_28" HREF="terminal_interface-curses-forms__adb.htm#ref_81_28">Key</A></FONT>  : <A HREF="terminal_interface-curses-forms__ads.htm#ref_142_12">Form_Request_Code</A>;
                            <FONT COLOR=red><A NAME="ref_277_28" HREF="terminal_interface-curses-forms__adb.htm#ref_82_33">Name</A></FONT> : <b>out</b> String);
 
    <b>function</b>  <FONT COLOR=red><A NAME="ref_279_14" HREF="terminal_interface-curses-forms__adb.htm#ref_90_13">Request_Name</A></FONT> (<FONT COLOR=red><A NAME="ref_279_28" HREF="terminal_interface-curses-forms__adb.htm#ref_90_27">Key</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_142_12">Form_Request_Code</A>) <b>return</b> String;
@@ -341,8 +341,8 @@
    <FONT COLOR=green><EM>--  |=====================================================================</EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_6"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_339_14" HREF="terminal_interface-curses-forms__adb.htm#ref_193_14">Set_Justification</A></FONT> (<FONT COLOR=red><A NAME="ref_339_33" HREF="terminal_interface-curses-forms__adb.htm#ref_193_33">Fld</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
-                                <FONT COLOR=red><A NAME="ref_340_33" HREF="terminal_interface-curses-forms__adb.htm#ref_194_33">Just</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_62_9">Field_Justification</A> := <A HREF="terminal_interface-curses-forms__ads.htm#ref_62_33">None</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_339_14" HREF="terminal_interface-curses-forms__adb.htm#ref_193_14">Set_Justification</A></FONT> (<FONT COLOR=red><A NAME="ref_339_33" HREF="terminal_interface-curses-forms__adb.htm#ref_193_33">Fld</A></FONT>  : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
+                                <FONT COLOR=red><A NAME="ref_340_33" HREF="terminal_interface-curses-forms__adb.htm#ref_194_33">Just</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_62_9">Field_Justification</A> := <A HREF="terminal_interface-curses-forms__ads.htm#ref_62_33">None</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/form_field_just.3x.html">set_field_just()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses-forms__ads.htm#ref_339_14">Set_Justification</A>);
 
@@ -357,29 +357,29 @@
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_8"#2|</EM></FONT>
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_354_14" HREF="terminal_interface-curses-forms__adb.htm#ref_225_14">Set_Buffer</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_355_7" HREF="terminal_interface-curses-forms__adb.htm#ref_226_7">Fld</A></FONT>    : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
-      <FONT COLOR=red><A NAME="ref_356_7" HREF="terminal_interface-curses-forms__adb.htm#ref_227_7">Buffer</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_129_9">Buffer_Number</A> := <A HREF="terminal_interface-curses-forms__ads.htm#ref_129_9">Buffer_Number</A>'First;
-      <FONT COLOR=red><A NAME="ref_357_7" HREF="terminal_interface-curses-forms__adb.htm#ref_228_7">Str</A></FONT>    : <b>in</b> String);
+     (<FONT COLOR=red><A NAME="ref_355_7" HREF="terminal_interface-curses-forms__adb.htm#ref_226_7">Fld</A></FONT>    : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
+      <FONT COLOR=red><A NAME="ref_356_7" HREF="terminal_interface-curses-forms__adb.htm#ref_227_7">Buffer</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_129_9">Buffer_Number</A> := <A HREF="terminal_interface-curses-forms__ads.htm#ref_129_9">Buffer_Number</A>'First;
+      <FONT COLOR=red><A NAME="ref_357_7" HREF="terminal_interface-curses-forms__adb.htm#ref_228_7">Str</A></FONT>    : String);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/form_field_buffer.3x.html">set_field_buffer()</A></EM></FONT>
    <FONT COLOR=green><EM>--  Not inlined</EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_9"#2|</EM></FONT>
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_362_14" HREF="terminal_interface-curses-forms__adb.htm#ref_250_14">Get_Buffer</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_363_7" HREF="terminal_interface-curses-forms__adb.htm#ref_251_7">Fld</A></FONT>    : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
-      <FONT COLOR=red><A NAME="ref_364_7" HREF="terminal_interface-curses-forms__adb.htm#ref_252_7">Buffer</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_129_9">Buffer_Number</A> := <A HREF="terminal_interface-curses-forms__ads.htm#ref_129_9">Buffer_Number</A>'First;
+     (<FONT COLOR=red><A NAME="ref_363_7" HREF="terminal_interface-curses-forms__adb.htm#ref_251_7">Fld</A></FONT>    : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
+      <FONT COLOR=red><A NAME="ref_364_7" HREF="terminal_interface-curses-forms__adb.htm#ref_252_7">Buffer</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_129_9">Buffer_Number</A> := <A HREF="terminal_interface-curses-forms__ads.htm#ref_129_9">Buffer_Number</A>'First;
       <FONT COLOR=red><A NAME="ref_365_7" HREF="terminal_interface-curses-forms__adb.htm#ref_253_7">Str</A></FONT>    : <b>out</b> String);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/form_field_buffer.3x.html">field_buffer()</A></EM></FONT>
 
    <b>function</b> <FONT COLOR=red><A NAME="ref_368_13" HREF="terminal_interface-curses-forms__adb.htm#ref_262_13">Get_Buffer</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_369_7" HREF="terminal_interface-curses-forms__adb.htm#ref_263_7">Fld</A></FONT>    : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
-      <FONT COLOR=red><A NAME="ref_370_7" HREF="terminal_interface-curses-forms__adb.htm#ref_264_7">Buffer</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_129_9">Buffer_Number</A> := <A HREF="terminal_interface-curses-forms__ads.htm#ref_129_9">Buffer_Number</A>'First) <b>return</b> String;
+     (<FONT COLOR=red><A NAME="ref_369_7" HREF="terminal_interface-curses-forms__adb.htm#ref_263_7">Fld</A></FONT>    : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
+      <FONT COLOR=red><A NAME="ref_370_7" HREF="terminal_interface-curses-forms__adb.htm#ref_264_7">Buffer</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_129_9">Buffer_Number</A> := <A HREF="terminal_interface-curses-forms__ads.htm#ref_129_9">Buffer_Number</A>'First) <b>return</b> String;
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/form_field_buffer.3x.html">field_buffer()</A></EM></FONT>
    <FONT COLOR=green><EM>--  Same but as function</EM></FONT>
    <b>pragma</b> Inline (Get_Buffer);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_10"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_376_14" HREF="terminal_interface-curses-forms__adb.htm#ref_275_14">Set_Status</A></FONT> (<FONT COLOR=red><A NAME="ref_376_26" HREF="terminal_interface-curses-forms__adb.htm#ref_275_26">Fld</A></FONT>    : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
-                         <FONT COLOR=red><A NAME="ref_377_26" HREF="terminal_interface-curses-forms__adb.htm#ref_276_26">Status</A></FONT> : <b>in</b> Boolean := True);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_376_14" HREF="terminal_interface-curses-forms__adb.htm#ref_275_14">Set_Status</A></FONT> (<FONT COLOR=red><A NAME="ref_376_26" HREF="terminal_interface-curses-forms__adb.htm#ref_275_26">Fld</A></FONT>    : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
+                         <FONT COLOR=red><A NAME="ref_377_26" HREF="terminal_interface-curses-forms__adb.htm#ref_276_26">Status</A></FONT> : Boolean := True);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/form_field_buffer.3x.html">set_field_status()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses-forms__ads.htm#ref_376_14">Set_Status</A>);
 
@@ -389,8 +389,8 @@
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses-forms__ads.htm#ref_382_13">Changed</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_12"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_387_14" HREF="terminal_interface-curses-forms__adb.htm#ref_307_14">Set_Maximum_Size</A></FONT> (<FONT COLOR=red><A NAME="ref_387_32" HREF="terminal_interface-curses-forms__adb.htm#ref_307_32">Fld</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
-                               <FONT COLOR=red><A NAME="ref_388_32" HREF="terminal_interface-curses-forms__adb.htm#ref_308_32">Max</A></FONT> : <b>in</b> Natural := 0);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_387_14" HREF="terminal_interface-curses-forms__adb.htm#ref_307_14">Set_Maximum_Size</A></FONT> (<FONT COLOR=red><A NAME="ref_387_32" HREF="terminal_interface-curses-forms__adb.htm#ref_307_32">Fld</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
+                               <FONT COLOR=red><A NAME="ref_388_32" HREF="terminal_interface-curses-forms__adb.htm#ref_308_32">Max</A></FONT> : Natural := 0);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/form_field_buffer.3x.html">set_field_max()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses-forms__ads.htm#ref_387_14">Set_Maximum_Size</A>);
 
@@ -399,21 +399,21 @@
    <FONT COLOR=green><EM>--  |=====================================================================</EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_13"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_397_14" HREF="terminal_interface-curses-forms__adb.htm#ref_327_14">Set_Options</A></FONT> (<FONT COLOR=red><A NAME="ref_397_27" HREF="terminal_interface-curses-forms__adb.htm#ref_327_27">Fld</A></FONT>     : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
-                          <FONT COLOR=red><A NAME="ref_398_27" HREF="terminal_interface-curses-forms__adb.htm#ref_328_27">Options</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_68_9">Field_Option_Set</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_397_14" HREF="terminal_interface-curses-forms__adb.htm#ref_327_14">Set_Options</A></FONT> (<FONT COLOR=red><A NAME="ref_397_27" HREF="terminal_interface-curses-forms__adb.htm#ref_327_27">Fld</A></FONT>     : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
+                          <FONT COLOR=red><A NAME="ref_398_27" HREF="terminal_interface-curses-forms__adb.htm#ref_328_27">Options</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_68_9">Field_Option_Set</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/form_field_opts.3x.html">set_field_opts()</A></EM></FONT>
    <FONT COLOR=green><EM>--  An overloaded version is defined later. Pragma Inline appears there</EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_14"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_403_14" HREF="terminal_interface-curses-forms__adb.htm#ref_345_14">Switch_Options</A></FONT> (<FONT COLOR=red><A NAME="ref_403_30" HREF="terminal_interface-curses-forms__adb.htm#ref_345_30">Fld</A></FONT>     : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
-                             <FONT COLOR=red><A NAME="ref_404_30" HREF="terminal_interface-curses-forms__adb.htm#ref_346_30">Options</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_68_9">Field_Option_Set</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_403_14" HREF="terminal_interface-curses-forms__adb.htm#ref_345_14">Switch_Options</A></FONT> (<FONT COLOR=red><A NAME="ref_403_30" HREF="terminal_interface-curses-forms__adb.htm#ref_345_30">Fld</A></FONT>     : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
+                             <FONT COLOR=red><A NAME="ref_404_30" HREF="terminal_interface-curses-forms__adb.htm#ref_346_30">Options</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_68_9">Field_Option_Set</A>;
                              <FONT COLOR=red><A NAME="ref_405_30" HREF="terminal_interface-curses-forms__adb.htm#ref_347_30">On</A></FONT>      : Boolean := True);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/form_field_opts.3x.html">field_opts_on()</A></EM></FONT>
    <FONT COLOR=green><EM>--  AKA: field_opts_off()</EM></FONT>
    <FONT COLOR=green><EM>--  An overloaded version is defined later. Pragma Inline appears there</EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_15"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_411_14" HREF="terminal_interface-curses-forms__adb.htm#ref_371_14">Get_Options</A></FONT> (<FONT COLOR=red><A NAME="ref_411_27" HREF="terminal_interface-curses-forms__adb.htm#ref_371_27">Fld</A></FONT>     : <b>in</b>  <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_411_14" HREF="terminal_interface-curses-forms__adb.htm#ref_371_14">Get_Options</A></FONT> (<FONT COLOR=red><A NAME="ref_411_27" HREF="terminal_interface-curses-forms__adb.htm#ref_371_27">Fld</A></FONT>     : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
                           <FONT COLOR=red><A NAME="ref_412_27" HREF="terminal_interface-curses-forms__adb.htm#ref_372_27">Options</A></FONT> : <b>out</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_68_9">Field_Option_Set</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/form_field_opts.3x.html">field_opts()</A></EM></FONT>
 
@@ -429,19 +429,19 @@
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_17"#2|</EM></FONT>
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_426_14" HREF="terminal_interface-curses-forms__adb.htm#ref_399_14">Set_Foreground</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_427_7" HREF="terminal_interface-curses-forms__adb.htm#ref_400_7">Fld</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
-      <FONT COLOR=red><A NAME="ref_428_7" HREF="terminal_interface-curses-forms__adb.htm#ref_401_7">Fore</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_307_9">Character_Attribute_Set</A> := <A HREF="terminal_interface-curses__ads.htm#ref_350_4">Normal_Video</A>;
-      <FONT COLOR=red><A NAME="ref_429_7" HREF="terminal_interface-curses-forms__adb.htm#ref_402_7">Color</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A> := <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A>'First);
+     (<FONT COLOR=red><A NAME="ref_427_7" HREF="terminal_interface-curses-forms__adb.htm#ref_400_7">Fld</A></FONT>   : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
+      <FONT COLOR=red><A NAME="ref_428_7" HREF="terminal_interface-curses-forms__adb.htm#ref_401_7">Fore</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_307_9">Character_Attribute_Set</A> := <A HREF="terminal_interface-curses__ads.htm#ref_350_4">Normal_Video</A>;
+      <FONT COLOR=red><A NAME="ref_429_7" HREF="terminal_interface-curses-forms__adb.htm#ref_402_7">Color</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A> := <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A>'First);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/form_field_attributes.3x.html">set_field_fore()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses-forms__ads.htm#ref_426_14">Set_Foreground</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_18"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_434_14" HREF="terminal_interface-curses-forms__adb.htm#ref_421_14">Foreground</A></FONT> (<FONT COLOR=red><A NAME="ref_434_26" HREF="terminal_interface-curses-forms__adb.htm#ref_421_26">Fld</A></FONT>  : <b>in</b>  <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_434_14" HREF="terminal_interface-curses-forms__adb.htm#ref_421_14">Foreground</A></FONT> (<FONT COLOR=red><A NAME="ref_434_26" HREF="terminal_interface-curses-forms__adb.htm#ref_421_26">Fld</A></FONT>  : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
                          <FONT COLOR=red><A NAME="ref_435_26" HREF="terminal_interface-curses-forms__adb.htm#ref_422_26">Fore</A></FONT> : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_307_9">Character_Attribute_Set</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/form_field_attributes.3x.html">field_fore()</A></EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_19"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_439_14" HREF="terminal_interface-curses-forms__adb.htm#ref_430_14">Foreground</A></FONT> (<FONT COLOR=red><A NAME="ref_439_26" HREF="terminal_interface-curses-forms__adb.htm#ref_430_26">Fld</A></FONT>   : <b>in</b>  <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_439_14" HREF="terminal_interface-curses-forms__adb.htm#ref_430_14">Foreground</A></FONT> (<FONT COLOR=red><A NAME="ref_439_26" HREF="terminal_interface-curses-forms__adb.htm#ref_430_26">Fld</A></FONT>   : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
                          <FONT COLOR=red><A NAME="ref_440_26" HREF="terminal_interface-curses-forms__adb.htm#ref_431_26">Fore</A></FONT>  : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_307_9">Character_Attribute_Set</A>;
                          <FONT COLOR=red><A NAME="ref_441_26" HREF="terminal_interface-curses-forms__adb.htm#ref_432_26">Color</A></FONT> : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/form_field_attributes.3x.html">field_fore()</A></EM></FONT>
@@ -449,32 +449,32 @@
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_20"#2|</EM></FONT>
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_446_14" HREF="terminal_interface-curses-forms__adb.htm#ref_443_14">Set_Background</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_447_7" HREF="terminal_interface-curses-forms__adb.htm#ref_444_7">Fld</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
-      <FONT COLOR=red><A NAME="ref_448_7" HREF="terminal_interface-curses-forms__adb.htm#ref_445_7">Back</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_307_9">Character_Attribute_Set</A> := <A HREF="terminal_interface-curses__ads.htm#ref_350_4">Normal_Video</A>;
-      <FONT COLOR=red><A NAME="ref_449_7" HREF="terminal_interface-curses-forms__adb.htm#ref_446_7">Color</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A> := <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A>'First);
+     (<FONT COLOR=red><A NAME="ref_447_7" HREF="terminal_interface-curses-forms__adb.htm#ref_444_7">Fld</A></FONT>   : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
+      <FONT COLOR=red><A NAME="ref_448_7" HREF="terminal_interface-curses-forms__adb.htm#ref_445_7">Back</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_307_9">Character_Attribute_Set</A> := <A HREF="terminal_interface-curses__ads.htm#ref_350_4">Normal_Video</A>;
+      <FONT COLOR=red><A NAME="ref_449_7" HREF="terminal_interface-curses-forms__adb.htm#ref_446_7">Color</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A> := <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A>'First);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/form_field_attributes.3x.html">set_field_back()</A></EM></FONT>
    <b>pragma</b> Inline (Set_Background);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_21"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_454_14" HREF="terminal_interface-curses-forms__adb.htm#ref_465_14">Background</A></FONT> (<FONT COLOR=red><A NAME="ref_454_26" HREF="terminal_interface-curses-forms__adb.htm#ref_465_26">Fld</A></FONT>  : <b>in</b>  <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_454_14" HREF="terminal_interface-curses-forms__adb.htm#ref_465_14">Background</A></FONT> (<FONT COLOR=red><A NAME="ref_454_26" HREF="terminal_interface-curses-forms__adb.htm#ref_465_26">Fld</A></FONT>  : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
                          <FONT COLOR=red><A NAME="ref_455_26" HREF="terminal_interface-curses-forms__adb.htm#ref_466_26">Back</A></FONT> : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_307_9">Character_Attribute_Set</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/form_field_attributes.3x.html">field_back()</A></EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_22"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_459_14" HREF="terminal_interface-curses-forms__adb.htm#ref_474_14">Background</A></FONT> (<FONT COLOR=red><A NAME="ref_459_26" HREF="terminal_interface-curses-forms__adb.htm#ref_474_26">Fld</A></FONT>   : <b>in</b>  <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_459_14" HREF="terminal_interface-curses-forms__adb.htm#ref_474_14">Background</A></FONT> (<FONT COLOR=red><A NAME="ref_459_26" HREF="terminal_interface-curses-forms__adb.htm#ref_474_26">Fld</A></FONT>   : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
                          <FONT COLOR=red><A NAME="ref_460_26" HREF="terminal_interface-curses-forms__adb.htm#ref_475_26">Back</A></FONT>  : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_307_9">Character_Attribute_Set</A>;
                          <FONT COLOR=red><A NAME="ref_461_26" HREF="terminal_interface-curses-forms__adb.htm#ref_476_26">Color</A></FONT> : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/form_field_attributes.3x.html">field_back()</A></EM></FONT>
    <b>pragma</b> Inline (Background);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_23"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_466_14" HREF="terminal_interface-curses-forms__adb.htm#ref_487_14">Set_Pad_Character</A></FONT> (<FONT COLOR=red><A NAME="ref_466_33" HREF="terminal_interface-curses-forms__adb.htm#ref_487_33">Fld</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
-                                <FONT COLOR=red><A NAME="ref_467_33" HREF="terminal_interface-curses-forms__adb.htm#ref_488_33">Pad</A></FONT> : <b>in</b> Character := Space);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_466_14" HREF="terminal_interface-curses-forms__adb.htm#ref_487_14">Set_Pad_Character</A></FONT> (<FONT COLOR=red><A NAME="ref_466_33" HREF="terminal_interface-curses-forms__adb.htm#ref_487_33">Fld</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
+                                <FONT COLOR=red><A NAME="ref_467_33" HREF="terminal_interface-curses-forms__adb.htm#ref_488_33">Pad</A></FONT> : Character := Space);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/form_field_attributes.3x.html">set_field_pad()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses-forms__ads.htm#ref_466_14">Set_Pad_Character</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_24"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_472_14" HREF="terminal_interface-curses-forms__adb.htm#ref_504_14">Pad_Character</A></FONT> (<FONT COLOR=red><A NAME="ref_472_29" HREF="terminal_interface-curses-forms__adb.htm#ref_504_29">Fld</A></FONT> : <b>in</b>  <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_472_14" HREF="terminal_interface-curses-forms__adb.htm#ref_504_14">Pad_Character</A></FONT> (<FONT COLOR=red><A NAME="ref_472_29" HREF="terminal_interface-curses-forms__adb.htm#ref_504_29">Fld</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
                             <FONT COLOR=red><A NAME="ref_473_29" HREF="terminal_interface-curses-forms__adb.htm#ref_505_29">Pad</A></FONT> : <b>out</b> Character);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/form_field_attributes.3x.html">field_pad()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses-forms__ads.htm#ref_472_14">Pad_Character</A>);
@@ -484,7 +484,7 @@
    <FONT COLOR=green><EM>--  |=====================================================================</EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_25"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_482_14" HREF="terminal_interface-curses-forms__adb.htm#ref_519_14">Info</A></FONT> (<FONT COLOR=red><A NAME="ref_482_20" HREF="terminal_interface-curses-forms__adb.htm#ref_519_20">Fld</A></FONT>                : <b>in</b>  <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_482_14" HREF="terminal_interface-curses-forms__adb.htm#ref_519_14">Info</A></FONT> (<FONT COLOR=red><A NAME="ref_482_20" HREF="terminal_interface-curses-forms__adb.htm#ref_519_20">Fld</A></FONT>                : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
                    <FONT COLOR=red><A NAME="ref_483_20" HREF="terminal_interface-curses-forms__adb.htm#ref_520_20">Lines</A></FONT>              : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_63_12">Line_Count</A>;
                    <FONT COLOR=red><A NAME="ref_484_20" HREF="terminal_interface-curses-forms__adb.htm#ref_521_20">Columns</A></FONT>            : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_65_12">Column_Count</A>;
                    <FONT COLOR=red><A NAME="ref_485_20" HREF="terminal_interface-curses-forms__adb.htm#ref_522_20">First_Row</A></FONT>          : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
@@ -495,7 +495,7 @@
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses-forms__ads.htm#ref_482_14">Info</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_26"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_493_14" HREF="terminal_interface-curses-forms__adb.htm#ref_553_14">Dynamic_Info</A></FONT> (<FONT COLOR=red><A NAME="ref_493_28" HREF="terminal_interface-curses-forms__adb.htm#ref_553_28">Fld</A></FONT>     : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_493_14" HREF="terminal_interface-curses-forms__adb.htm#ref_553_14">Dynamic_Info</A></FONT> (<FONT COLOR=red><A NAME="ref_493_28" HREF="terminal_interface-curses-forms__adb.htm#ref_553_28">Fld</A></FONT>     : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
                            <FONT COLOR=red><A NAME="ref_494_28" HREF="terminal_interface-curses-forms__adb.htm#ref_554_28">Lines</A></FONT>   : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_63_12">Line_Count</A>;
                            <FONT COLOR=red><A NAME="ref_495_28" HREF="terminal_interface-curses-forms__adb.htm#ref_555_28">Columns</A></FONT> : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_65_12">Column_Count</A>;
                            <FONT COLOR=red><A NAME="ref_496_28" HREF="terminal_interface-curses-forms__adb.htm#ref_556_28">Max</A></FONT>     : <b>out</b> Natural);
@@ -507,8 +507,8 @@
    <FONT COLOR=green><EM>--  |=====================================================================</EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_27"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_505_14" HREF="terminal_interface-curses-forms__adb.htm#ref_582_14">Set_Window</A></FONT> (<FONT COLOR=red><A NAME="ref_505_26" HREF="terminal_interface-curses-forms__adb.htm#ref_582_26">Frm</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
-                         <FONT COLOR=red><A NAME="ref_506_26" HREF="terminal_interface-curses-forms__adb.htm#ref_583_26">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_505_14" HREF="terminal_interface-curses-forms__adb.htm#ref_582_14">Set_Window</A></FONT> (<FONT COLOR=red><A NAME="ref_505_26" HREF="terminal_interface-curses-forms__adb.htm#ref_582_26">Frm</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
+                         <FONT COLOR=red><A NAME="ref_506_26" HREF="terminal_interface-curses-forms__adb.htm#ref_583_26">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/form_win.3x.html">set_form_win()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses-forms__ads.htm#ref_505_14">Set_Window</A>);
 
@@ -518,8 +518,8 @@
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses-forms__ads.htm#ref_511_13">Get_Window</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_29"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_516_14" HREF="terminal_interface-curses-forms__adb.htm#ref_610_14">Set_Sub_Window</A></FONT> (<FONT COLOR=red><A NAME="ref_516_30" HREF="terminal_interface-curses-forms__adb.htm#ref_610_30">Frm</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
-                             <FONT COLOR=red><A NAME="ref_517_30" HREF="terminal_interface-curses-forms__adb.htm#ref_611_30">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_516_14" HREF="terminal_interface-curses-forms__adb.htm#ref_610_14">Set_Sub_Window</A></FONT> (<FONT COLOR=red><A NAME="ref_516_30" HREF="terminal_interface-curses-forms__adb.htm#ref_610_30">Frm</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
+                             <FONT COLOR=red><A NAME="ref_517_30" HREF="terminal_interface-curses-forms__adb.htm#ref_611_30">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/form_win.3x.html">set_form_sub()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses-forms__ads.htm#ref_516_14">Set_Sub_Window</A>);
 
@@ -529,7 +529,7 @@
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses-forms__ads.htm#ref_522_13">Get_Sub_Window</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_31"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_527_14" HREF="terminal_interface-curses-forms__adb.htm#ref_638_14">Scale</A></FONT> (<FONT COLOR=red><A NAME="ref_527_21" HREF="terminal_interface-curses-forms__adb.htm#ref_638_21">Frm</A></FONT>     : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_527_14" HREF="terminal_interface-curses-forms__adb.htm#ref_638_14">Scale</A></FONT> (<FONT COLOR=red><A NAME="ref_527_21" HREF="terminal_interface-curses-forms__adb.htm#ref_638_21">Frm</A></FONT>     : <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
                     <FONT COLOR=red><A NAME="ref_528_21" HREF="terminal_interface-curses-forms__adb.htm#ref_639_21">Lines</A></FONT>   : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_63_12">Line_Count</A>;
                     <FONT COLOR=red><A NAME="ref_529_21" HREF="terminal_interface-curses-forms__adb.htm#ref_640_21">Columns</A></FONT> : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_65_12">Column_Count</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/form_win.3x.html">scale_form()</A></EM></FONT>
@@ -539,30 +539,30 @@
    <FONT COLOR=green><EM>--  | Man page <A HREF="../man/form_hook.3x.html">form_hook.3x</A></EM></FONT>
    <FONT COLOR=green><EM>--  |=====================================================================</EM></FONT>
 
-   <b>type</b> <FONT COLOR=red><A NAME="ref_537_9">Form_Hook_Function</A></FONT> <b>is</b> <b>access</b> <b>procedure</b> (<FONT COLOR=red><A NAME="ref_537_49">Frm</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>);
+   <b>type</b> <FONT COLOR=red><A NAME="ref_537_9">Form_Hook_Function</A></FONT> <b>is</b> <b>access</b> <b>procedure</b> (<FONT COLOR=red><A NAME="ref_537_49">Frm</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>);
    <b>pragma</b> Convention (C, <A HREF="terminal_interface-curses-forms__ads.htm#ref_537_9">Form_Hook_Function</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_32"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_541_14" HREF="terminal_interface-curses-forms__adb.htm#ref_662_14">Set_Field_Init_Hook</A></FONT> (<FONT COLOR=red><A NAME="ref_541_35" HREF="terminal_interface-curses-forms__adb.htm#ref_662_35">Frm</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
-                                  <FONT COLOR=red><A NAME="ref_542_35" HREF="terminal_interface-curses-forms__adb.htm#ref_663_35">Proc</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_537_9">Form_Hook_Function</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_541_14" HREF="terminal_interface-curses-forms__adb.htm#ref_662_14">Set_Field_Init_Hook</A></FONT> (<FONT COLOR=red><A NAME="ref_541_35" HREF="terminal_interface-curses-forms__adb.htm#ref_662_35">Frm</A></FONT>  : <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
+                                  <FONT COLOR=red><A NAME="ref_542_35" HREF="terminal_interface-curses-forms__adb.htm#ref_663_35">Proc</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_537_9">Form_Hook_Function</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/form_hook.3x.html">set_field_init()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses-forms__ads.htm#ref_541_14">Set_Field_Init_Hook</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_33"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_547_14" HREF="terminal_interface-curses-forms__adb.htm#ref_678_14">Set_Field_Term_Hook</A></FONT> (<FONT COLOR=red><A NAME="ref_547_35" HREF="terminal_interface-curses-forms__adb.htm#ref_678_35">Frm</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
-                                  <FONT COLOR=red><A NAME="ref_548_35" HREF="terminal_interface-curses-forms__adb.htm#ref_679_35">Proc</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_537_9">Form_Hook_Function</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_547_14" HREF="terminal_interface-curses-forms__adb.htm#ref_678_14">Set_Field_Term_Hook</A></FONT> (<FONT COLOR=red><A NAME="ref_547_35" HREF="terminal_interface-curses-forms__adb.htm#ref_678_35">Frm</A></FONT>  : <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
+                                  <FONT COLOR=red><A NAME="ref_548_35" HREF="terminal_interface-curses-forms__adb.htm#ref_679_35">Proc</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_537_9">Form_Hook_Function</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/form_hook.3x.html">set_field_term()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses-forms__ads.htm#ref_547_14">Set_Field_Term_Hook</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_34"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_553_14" HREF="terminal_interface-curses-forms__adb.htm#ref_694_14">Set_Form_Init_Hook</A></FONT> (<FONT COLOR=red><A NAME="ref_553_34" HREF="terminal_interface-curses-forms__adb.htm#ref_694_34">Frm</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
-                                 <FONT COLOR=red><A NAME="ref_554_34" HREF="terminal_interface-curses-forms__adb.htm#ref_695_34">Proc</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_537_9">Form_Hook_Function</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_553_14" HREF="terminal_interface-curses-forms__adb.htm#ref_694_14">Set_Form_Init_Hook</A></FONT> (<FONT COLOR=red><A NAME="ref_553_34" HREF="terminal_interface-curses-forms__adb.htm#ref_694_34">Frm</A></FONT>  : <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
+                                 <FONT COLOR=red><A NAME="ref_554_34" HREF="terminal_interface-curses-forms__adb.htm#ref_695_34">Proc</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_537_9">Form_Hook_Function</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/form_hook.3x.html">set_form_init()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses-forms__ads.htm#ref_553_14">Set_Form_Init_Hook</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_35"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_559_14" HREF="terminal_interface-curses-forms__adb.htm#ref_710_14">Set_Form_Term_Hook</A></FONT> (<FONT COLOR=red><A NAME="ref_559_34" HREF="terminal_interface-curses-forms__adb.htm#ref_710_34">Frm</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
-                                 <FONT COLOR=red><A NAME="ref_560_34" HREF="terminal_interface-curses-forms__adb.htm#ref_711_34">Proc</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_537_9">Form_Hook_Function</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_559_14" HREF="terminal_interface-curses-forms__adb.htm#ref_710_14">Set_Form_Term_Hook</A></FONT> (<FONT COLOR=red><A NAME="ref_559_34" HREF="terminal_interface-curses-forms__adb.htm#ref_710_34">Frm</A></FONT>  : <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
+                                 <FONT COLOR=red><A NAME="ref_560_34" HREF="terminal_interface-curses-forms__adb.htm#ref_711_34">Proc</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_537_9">Form_Hook_Function</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/form_hook.3x.html">set_form_term()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses-forms__ads.htm#ref_559_14">Set_Form_Term_Hook</A>);
 
@@ -591,14 +591,14 @@
    <FONT COLOR=green><EM>--  |=====================================================================</EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_40"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_589_14" HREF="terminal_interface-curses-forms__adb.htm#ref_730_14">Redefine</A></FONT> (<FONT COLOR=red><A NAME="ref_589_24" HREF="terminal_interface-curses-forms__adb.htm#ref_730_24">Frm</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
-                       <FONT COLOR=red><A NAME="ref_590_24" HREF="terminal_interface-curses-forms__adb.htm#ref_731_24">Flds</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_134_9">Field_Array_Access</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_589_14" HREF="terminal_interface-curses-forms__adb.htm#ref_730_14">Redefine</A></FONT> (<FONT COLOR=red><A NAME="ref_589_24" HREF="terminal_interface-curses-forms__adb.htm#ref_730_24">Frm</A></FONT>  : <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
+                       <FONT COLOR=red><A NAME="ref_590_24" HREF="terminal_interface-curses-forms__adb.htm#ref_731_24">Flds</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_134_9">Field_Array_Access</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/form_field.3x.html">set_form_fields()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses-forms__ads.htm#ref_589_14">Redefine</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_41"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_595_14">Set_Fields</A></FONT> (<FONT COLOR=red><A NAME="ref_595_26">Frm</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
-                         <FONT COLOR=red><A NAME="ref_596_26">Flds</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_134_9">Field_Array_Access</A>) <b>renames</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_589_14">Redefine</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_595_14">Set_Fields</A></FONT> (<FONT COLOR=red><A NAME="ref_595_26">Frm</A></FONT>  : <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
+                         <FONT COLOR=red><A NAME="ref_596_26">Flds</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_134_9">Field_Array_Access</A>) <b>renames</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_589_14">Redefine</A>;
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/form_field.3x.html">set_form_fields()</A></EM></FONT>
    <FONT COLOR=green><EM>--  pragma Inline (Set_Fields);</EM></FONT>
 
@@ -614,9 +614,9 @@
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses-forms__ads.htm#ref_607_13">Field_Count</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_44"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_612_14" HREF="terminal_interface-curses-forms__adb.htm#ref_782_14">Move</A></FONT> (<FONT COLOR=red><A NAME="ref_612_20" HREF="terminal_interface-curses-forms__adb.htm#ref_782_20">Fld</A></FONT>    : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
-                   <FONT COLOR=red><A NAME="ref_613_20" HREF="terminal_interface-curses-forms__adb.htm#ref_783_20">Line</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
-                   <FONT COLOR=red><A NAME="ref_614_20" HREF="terminal_interface-curses-forms__adb.htm#ref_784_20">Column</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_612_14" HREF="terminal_interface-curses-forms__adb.htm#ref_782_14">Move</A></FONT> (<FONT COLOR=red><A NAME="ref_612_20" HREF="terminal_interface-curses-forms__adb.htm#ref_782_20">Fld</A></FONT>    : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
+                   <FONT COLOR=red><A NAME="ref_613_20" HREF="terminal_interface-curses-forms__adb.htm#ref_783_20">Line</A></FONT>   : <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
+                   <FONT COLOR=red><A NAME="ref_614_20" HREF="terminal_interface-curses-forms__adb.htm#ref_784_20">Column</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/form_field.3x.html">move_field()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses-forms__ads.htm#ref_612_14">Move</A>);
 
@@ -646,21 +646,21 @@
    <FONT COLOR=green><EM>--  |=====================================================================</EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_48"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_644_14" HREF="terminal_interface-curses-forms__adb.htm#ref_842_14">Set_Options</A></FONT> (<FONT COLOR=red><A NAME="ref_644_27" HREF="terminal_interface-curses-forms__adb.htm#ref_842_27">Frm</A></FONT>     : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
-                          <FONT COLOR=red><A NAME="ref_645_27" HREF="terminal_interface-curses-forms__adb.htm#ref_843_27">Options</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_107_9">Form_Option_Set</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_644_14" HREF="terminal_interface-curses-forms__adb.htm#ref_842_14">Set_Options</A></FONT> (<FONT COLOR=red><A NAME="ref_644_27" HREF="terminal_interface-curses-forms__adb.htm#ref_842_27">Frm</A></FONT>     : <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
+                          <FONT COLOR=red><A NAME="ref_645_27" HREF="terminal_interface-curses-forms__adb.htm#ref_843_27">Options</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_107_9">Form_Option_Set</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/form_opts.3x.html">set_form_opts()</A></EM></FONT>
    <b>pragma</b> Inline (Set_Options);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_49"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_650_14" HREF="terminal_interface-curses-forms__adb.htm#ref_860_14">Switch_Options</A></FONT> (<FONT COLOR=red><A NAME="ref_650_30" HREF="terminal_interface-curses-forms__adb.htm#ref_860_30">Frm</A></FONT>     : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
-                             <FONT COLOR=red><A NAME="ref_651_30" HREF="terminal_interface-curses-forms__adb.htm#ref_861_30">Options</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_107_9">Form_Option_Set</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_650_14" HREF="terminal_interface-curses-forms__adb.htm#ref_860_14">Switch_Options</A></FONT> (<FONT COLOR=red><A NAME="ref_650_30" HREF="terminal_interface-curses-forms__adb.htm#ref_860_30">Frm</A></FONT>     : <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
+                             <FONT COLOR=red><A NAME="ref_651_30" HREF="terminal_interface-curses-forms__adb.htm#ref_861_30">Options</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_107_9">Form_Option_Set</A>;
                              <FONT COLOR=red><A NAME="ref_652_30" HREF="terminal_interface-curses-forms__adb.htm#ref_862_30">On</A></FONT>      : Boolean := True);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/form_opts.3x.html">form_opts_on()</A></EM></FONT>
    <FONT COLOR=green><EM>--  AKA: form_opts_off()</EM></FONT>
    <b>pragma</b> Inline (Switch_Options);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_50"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_658_14" HREF="terminal_interface-curses-forms__adb.htm#ref_886_14">Get_Options</A></FONT> (<FONT COLOR=red><A NAME="ref_658_27" HREF="terminal_interface-curses-forms__adb.htm#ref_886_27">Frm</A></FONT>     : <b>in</b>  <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_658_14" HREF="terminal_interface-curses-forms__adb.htm#ref_886_14">Get_Options</A></FONT> (<FONT COLOR=red><A NAME="ref_658_27" HREF="terminal_interface-curses-forms__adb.htm#ref_886_27">Frm</A></FONT>     : <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
                           <FONT COLOR=red><A NAME="ref_659_27" HREF="terminal_interface-curses-forms__adb.htm#ref_887_27">Options</A></FONT> : <b>out</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_107_9">Form_Option_Set</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/form_opts.3x.html">form_opts()</A></EM></FONT>
 
@@ -674,8 +674,8 @@
    <FONT COLOR=green><EM>--  |=====================================================================</EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_52"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_672_14" HREF="terminal_interface-curses-forms__adb.htm#ref_913_14">Post</A></FONT> (<FONT COLOR=red><A NAME="ref_672_20" HREF="terminal_interface-curses-forms__adb.htm#ref_913_20">Frm</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
-                   <FONT COLOR=red><A NAME="ref_673_20" HREF="terminal_interface-curses-forms__adb.htm#ref_914_20">Post</A></FONT> : <b>in</b> Boolean := True);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_672_14" HREF="terminal_interface-curses-forms__adb.htm#ref_913_14">Post</A></FONT> (<FONT COLOR=red><A NAME="ref_672_20" HREF="terminal_interface-curses-forms__adb.htm#ref_913_20">Frm</A></FONT>  : <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
+                   <FONT COLOR=red><A NAME="ref_673_20" HREF="terminal_interface-curses-forms__adb.htm#ref_914_20">Post</A></FONT> : Boolean := True);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/form_post.3x.html">post_form()</A></EM></FONT>
    <FONT COLOR=green><EM>--  AKA: unpost_form()</EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses-forms__ads.htm#ref_672_14">Post</A>);
@@ -725,19 +725,19 @@
    <b>type</b> <FONT COLOR=red><A NAME="ref_720_9">Page_Number</A></FONT> <b>is</b> <b>new</b> Natural;
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_57"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_723_14" HREF="terminal_interface-curses-forms__adb.htm#ref_1023_14">Set_Current</A></FONT> (<FONT COLOR=red><A NAME="ref_723_27" HREF="terminal_interface-curses-forms__adb.htm#ref_1023_27">Frm</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
-                          <FONT COLOR=red><A NAME="ref_724_27" HREF="terminal_interface-curses-forms__adb.htm#ref_1024_27">Fld</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_723_14" HREF="terminal_interface-curses-forms__adb.htm#ref_1023_14">Set_Current</A></FONT> (<FONT COLOR=red><A NAME="ref_723_27" HREF="terminal_interface-curses-forms__adb.htm#ref_1023_27">Frm</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
+                          <FONT COLOR=red><A NAME="ref_724_27" HREF="terminal_interface-curses-forms__adb.htm#ref_1024_27">Fld</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/form_page.3x.html">set_current_field()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses-forms__ads.htm#ref_723_14">Set_Current</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_58"#2|</EM></FONT>
-   <b>function</b> <FONT COLOR=red><A NAME="ref_729_13" HREF="terminal_interface-curses-forms__adb.htm#ref_1038_13">Current</A></FONT> (<FONT COLOR=red><A NAME="ref_729_22" HREF="terminal_interface-curses-forms__adb.htm#ref_1038_22">Frm</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>) <b>return</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
+   <b>function</b> <FONT COLOR=red><A NAME="ref_729_13" HREF="terminal_interface-curses-forms__adb.htm#ref_1038_13">Current</A></FONT> (<FONT COLOR=red><A NAME="ref_729_22" HREF="terminal_interface-curses-forms__adb.htm#ref_1038_22">Frm</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>) <b>return</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/form_page.3x.html">current_field()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses-forms__ads.htm#ref_729_13">Current</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_59"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_734_14" HREF="terminal_interface-curses-forms__adb.htm#ref_1053_14">Set_Page</A></FONT> (<FONT COLOR=red><A NAME="ref_734_24" HREF="terminal_interface-curses-forms__adb.htm#ref_1053_24">Frm</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
-                       <FONT COLOR=red><A NAME="ref_735_24" HREF="terminal_interface-curses-forms__adb.htm#ref_1054_24">Page</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_720_9">Page_Number</A> := <A HREF="terminal_interface-curses-forms__ads.htm#ref_720_9">Page_Number</A>'First);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_734_14" HREF="terminal_interface-curses-forms__adb.htm#ref_1053_14">Set_Page</A></FONT> (<FONT COLOR=red><A NAME="ref_734_24" HREF="terminal_interface-curses-forms__adb.htm#ref_1053_24">Frm</A></FONT>  : <A HREF="terminal_interface-curses-forms__ads.htm#ref_57_9">Form</A>;
+                       <FONT COLOR=red><A NAME="ref_735_24" HREF="terminal_interface-curses-forms__adb.htm#ref_1054_24">Page</A></FONT> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_720_9">Page_Number</A> := <A HREF="terminal_interface-curses-forms__ads.htm#ref_720_9">Page_Number</A>'First);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/form_page.3x.html">set_form_page()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses-forms__ads.htm#ref_734_14">Set_Page</A>);
 
@@ -759,8 +759,8 @@
    <FONT COLOR=green><EM>--  |=====================================================================</EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_62"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_757_14" HREF="terminal_interface-curses-forms__adb.htm#ref_1102_14">Set_New_Page</A></FONT> (<FONT COLOR=red><A NAME="ref_757_28" HREF="terminal_interface-curses-forms__adb.htm#ref_1102_28">Fld</A></FONT>      : <b>in</b> <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
-                           <FONT COLOR=red><A NAME="ref_758_28" HREF="terminal_interface-curses-forms__adb.htm#ref_1103_28">New_Page</A></FONT> : <b>in</b> Boolean := True);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_757_14" HREF="terminal_interface-curses-forms__adb.htm#ref_1102_14">Set_New_Page</A></FONT> (<FONT COLOR=red><A NAME="ref_757_28" HREF="terminal_interface-curses-forms__adb.htm#ref_1102_28">Fld</A></FONT>      : <A HREF="terminal_interface-curses-forms__ads.htm#ref_56_9">Field</A>;
+                           <FONT COLOR=red><A NAME="ref_758_28" HREF="terminal_interface-curses-forms__adb.htm#ref_1103_28">New_Page</A></FONT> : Boolean := True);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/form_new_page.3x.html">set_new_page()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses-forms__ads.htm#ref_757_14">Set_New_Page</A>);
 
diff -Naur ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-menus-item_user_data__adb.htm ncurses-5.7/doc/html/ada/terminal_interface-curses-menus-item_user_data__adb.htm
--- ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-menus-item_user_data__adb.htm	2006-09-23 16:31:31.000000000 -0400
+++ ncurses-5.7/doc/html/ada/terminal_interface-curses-menus-item_user_data__adb.htm	2011-01-08 18:13:50.363157410 -0500
@@ -12,7 +12,7 @@
 <FONT COLOR=green><EM>--                                 B O D Y                                  --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-<FONT COLOR=green><EM>-- Copyright (c) 1998 Free Software Foundation, Inc.                        --</EM></FONT>
+<FONT COLOR=green><EM>-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>-- Permission is hereby granted, free of charge, to any person obtaining a  --</EM></FONT>
 <FONT COLOR=green><EM>-- copy of this software and associated documentation files (the            --</EM></FONT>
@@ -40,18 +40,18 @@
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <FONT COLOR=green><EM>--  Author:  Juergen Pfeifer, 1996</EM></FONT>
 <FONT COLOR=green><EM>--  Version Control:</EM></FONT>
-<FONT COLOR=green><EM>--  @Revision: 1.11 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Revision: 1.12 @</EM></FONT>
 <FONT COLOR=green><EM>--  Binding Version 01.00</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-<b>with</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C;
+<b>with</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C;
 <b>with</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-aux__ads.htm#ref_50_35">Aux</A>; <b>use</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-aux__ads.htm#ref_50_35">Aux</A>;
 
 <b>package</b> <b>body</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-menus__ads.htm#ref_49_35">Menus</A>.<FONT COLOR=red><A NAME="ref_44_46" HREF="terminal_interface-curses-menus-item_user_data__ads.htm#ref_46_41">Item_User_Data</A></FONT> <b>is</b>
 
-   <b>use</b> <b>type</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C.int;
+   <b>use</b> <b>type</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C.int;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_48_14" HREF="terminal_interface-curses-menus-item_user_data__ads.htm#ref_58_14">Set_User_Data</A></FONT> (<FONT COLOR=red><A NAME="ref_48_29" HREF="terminal_interface-curses-menus-item_user_data__ads.htm#ref_58_29">Itm</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_56_9">Item</A>;
-                            <FONT COLOR=red><A NAME="ref_49_29" HREF="terminal_interface-curses-menus-item_user_data__ads.htm#ref_59_29">Data</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-menus-item_user_data__ads.htm#ref_45_9">User_Access</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_48_14" HREF="terminal_interface-curses-menus-item_user_data__ads.htm#ref_58_14">Set_User_Data</A></FONT> (<FONT COLOR=red><A NAME="ref_48_29" HREF="terminal_interface-curses-menus-item_user_data__ads.htm#ref_58_29">Itm</A></FONT>  : <A HREF="terminal_interface-curses-menus__ads.htm#ref_56_9">Item</A>;
+                            <FONT COLOR=red><A NAME="ref_49_29" HREF="terminal_interface-curses-menus-item_user_data__ads.htm#ref_59_29">Data</A></FONT> : <A HREF="terminal_interface-curses-menus-item_user_data__ads.htm#ref_45_9">User_Access</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_51_16">Set_Item_Userptr</A></FONT> (<FONT COLOR=red><A NAME="ref_51_34" HREF="terminal_interface-curses-menus-item_user_data__adb.htm#ref_51_16">Itm</A></FONT>  : <A HREF="terminal_interface-curses-menus__ads.htm#ref_56_9">Item</A>;
                                  <FONT COLOR=red><A NAME="ref_52_34" HREF="terminal_interface-curses-menus-item_user_data__adb.htm#ref_51_16">Addr</A></FONT> : <A HREF="terminal_interface-curses-menus-item_user_data__ads.htm#ref_45_9">User_Access</A>)  <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
@@ -64,7 +64,7 @@
       <b>end</b> <b>if</b>;
    <b>end</b> <A HREF="terminal_interface-curses-menus-item_user_data__ads.htm#ref_58_14">Set_User_Data</A>;
 
-   <b>function</b> <FONT COLOR=red><A NAME="ref_62_13" HREF="terminal_interface-curses-menus-item_user_data__ads.htm#ref_69_13">Get_User_Data</A></FONT> (<FONT COLOR=red><A NAME="ref_62_28" HREF="terminal_interface-curses-menus-item_user_data__ads.htm#ref_69_28">Itm</A></FONT>  : <b>in</b>  <A HREF="terminal_interface-curses-menus__ads.htm#ref_56_9">Item</A>) <b>return</b> <A HREF="terminal_interface-curses-menus-item_user_data__ads.htm#ref_45_9">User_Access</A>
+   <b>function</b> <FONT COLOR=red><A NAME="ref_62_13" HREF="terminal_interface-curses-menus-item_user_data__ads.htm#ref_69_13">Get_User_Data</A></FONT> (<FONT COLOR=red><A NAME="ref_62_28" HREF="terminal_interface-curses-menus-item_user_data__ads.htm#ref_69_28">Itm</A></FONT>  : <A HREF="terminal_interface-curses-menus__ads.htm#ref_56_9">Item</A>) <b>return</b> <A HREF="terminal_interface-curses-menus-item_user_data__ads.htm#ref_45_9">User_Access</A>
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_64_16">Item_Userptr</A></FONT> (<FONT COLOR=red><A NAME="ref_64_30" HREF="terminal_interface-curses-menus-item_user_data__adb.htm#ref_64_16">Itm</A></FONT> : <A HREF="terminal_interface-curses-menus__ads.htm#ref_56_9">Item</A>) <b>return</b> <A HREF="terminal_interface-curses-menus-item_user_data__ads.htm#ref_45_9">User_Access</A>;
       <b>pragma</b> Import (C, Item_Userptr, "item_userptr");
@@ -72,7 +72,7 @@
       <b>return</b> <A HREF="terminal_interface-curses-menus-item_user_data__adb.htm#ref_64_16">Item_Userptr</A> (<A HREF="terminal_interface-curses-menus-item_user_data__ads.htm#ref_69_28">Itm</A>);
    <b>end</b> <A HREF="terminal_interface-curses-menus-item_user_data__ads.htm#ref_69_13">Get_User_Data</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_70_14" HREF="terminal_interface-curses-menus-item_user_data__ads.htm#ref_64_14">Get_User_Data</A></FONT> (<FONT COLOR=red><A NAME="ref_70_29" HREF="terminal_interface-curses-menus-item_user_data__ads.htm#ref_64_29">Itm</A></FONT>  : <b>in</b>  <A HREF="terminal_interface-curses-menus__ads.htm#ref_56_9">Item</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_70_14" HREF="terminal_interface-curses-menus-item_user_data__ads.htm#ref_64_14">Get_User_Data</A></FONT> (<FONT COLOR=red><A NAME="ref_70_29" HREF="terminal_interface-curses-menus-item_user_data__ads.htm#ref_64_29">Itm</A></FONT>  : <A HREF="terminal_interface-curses-menus__ads.htm#ref_56_9">Item</A>;
                             <FONT COLOR=red><A NAME="ref_71_29" HREF="terminal_interface-curses-menus-item_user_data__ads.htm#ref_65_29">Data</A></FONT> : <b>out</b> <A HREF="terminal_interface-curses-menus-item_user_data__ads.htm#ref_45_9">User_Access</A>)
    <b>is</b>
    <b>begin</b>
diff -Naur ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-menus-item_user_data__ads.htm ncurses-5.7/doc/html/ada/terminal_interface-curses-menus-item_user_data__ads.htm
--- ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-menus-item_user_data__ads.htm	2007-09-01 19:56:31.000000000 -0400
+++ ncurses-5.7/doc/html/ada/terminal_interface-curses-menus-item_user_data__ads.htm	2011-01-08 18:13:50.363157410 -0500
@@ -12,7 +12,7 @@
 <FONT COLOR=green><EM>--                                 S P E C                                  --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-<FONT COLOR=green><EM>-- Copyright (c) 1998,2006 Free Software Foundation, Inc.                   --</EM></FONT>
+<FONT COLOR=green><EM>-- Copyright (c) 1998-2006,2009 Free Software Foundation, Inc.              --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>-- Permission is hereby granted, free of charge, to any person obtaining a  --</EM></FONT>
 <FONT COLOR=green><EM>-- copy of this software and associated documentation files (the            --</EM></FONT>
@@ -40,8 +40,8 @@
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <FONT COLOR=green><EM>--  Author:  Juergen Pfeifer, 1996</EM></FONT>
 <FONT COLOR=green><EM>--  Version Control:</EM></FONT>
-<FONT COLOR=green><EM>--  @Revision: 1.16 @</EM></FONT>
-<FONT COLOR=green><EM>--  @Date: 2006/06/25 14:30:22 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Revision: 1.17 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Date: 2009/12/26 17:31:35 @</EM></FONT>
 <FONT COLOR=green><EM>--  Binding Version 01.00</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 
@@ -60,18 +60,18 @@
    <FONT COLOR=green><EM>--  |=====================================================================</EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_1"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_58_14" HREF="terminal_interface-curses-menus-item_user_data__adb.htm#ref_48_14">Set_User_Data</A></FONT> (<FONT COLOR=red><A NAME="ref_58_29" HREF="terminal_interface-curses-menus-item_user_data__adb.htm#ref_48_29">Itm</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_56_9">Item</A>;
-                            <FONT COLOR=red><A NAME="ref_59_29" HREF="terminal_interface-curses-menus-item_user_data__adb.htm#ref_49_29">Data</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-menus-item_user_data__ads.htm#ref_45_9">User_Access</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_58_14" HREF="terminal_interface-curses-menus-item_user_data__adb.htm#ref_48_14">Set_User_Data</A></FONT> (<FONT COLOR=red><A NAME="ref_58_29" HREF="terminal_interface-curses-menus-item_user_data__adb.htm#ref_48_29">Itm</A></FONT>  : <A HREF="terminal_interface-curses-menus__ads.htm#ref_56_9">Item</A>;
+                            <FONT COLOR=red><A NAME="ref_59_29" HREF="terminal_interface-curses-menus-item_user_data__adb.htm#ref_49_29">Data</A></FONT> : <A HREF="terminal_interface-curses-menus-item_user_data__ads.htm#ref_45_9">User_Access</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/mitem_userptr.3x.html">set_item_userptr</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses-menus-item_user_data__ads.htm#ref_58_14">Set_User_Data</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_2"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_64_14" HREF="terminal_interface-curses-menus-item_user_data__adb.htm#ref_70_14">Get_User_Data</A></FONT> (<FONT COLOR=red><A NAME="ref_64_29" HREF="terminal_interface-curses-menus-item_user_data__adb.htm#ref_70_29">Itm</A></FONT>  : <b>in</b>  <A HREF="terminal_interface-curses-menus__ads.htm#ref_56_9">Item</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_64_14" HREF="terminal_interface-curses-menus-item_user_data__adb.htm#ref_70_14">Get_User_Data</A></FONT> (<FONT COLOR=red><A NAME="ref_64_29" HREF="terminal_interface-curses-menus-item_user_data__adb.htm#ref_70_29">Itm</A></FONT>  : <A HREF="terminal_interface-curses-menus__ads.htm#ref_56_9">Item</A>;
                             <FONT COLOR=red><A NAME="ref_65_29" HREF="terminal_interface-curses-menus-item_user_data__adb.htm#ref_71_29">Data</A></FONT> : <b>out</b> <A HREF="terminal_interface-curses-menus-item_user_data__ads.htm#ref_45_9">User_Access</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/mitem_userptr.3x.html">item_userptr</A></EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_3"#2|</EM></FONT>
-   <b>function</b> <FONT COLOR=red><A NAME="ref_69_13" HREF="terminal_interface-curses-menus-item_user_data__adb.htm#ref_62_13">Get_User_Data</A></FONT> (<FONT COLOR=red><A NAME="ref_69_28" HREF="terminal_interface-curses-menus-item_user_data__adb.htm#ref_62_28">Itm</A></FONT>  : <b>in</b>  <A HREF="terminal_interface-curses-menus__ads.htm#ref_56_9">Item</A>) <b>return</b> <A HREF="terminal_interface-curses-menus-item_user_data__ads.htm#ref_45_9">User_Access</A>;
+   <b>function</b> <FONT COLOR=red><A NAME="ref_69_13" HREF="terminal_interface-curses-menus-item_user_data__adb.htm#ref_62_13">Get_User_Data</A></FONT> (<FONT COLOR=red><A NAME="ref_69_28" HREF="terminal_interface-curses-menus-item_user_data__adb.htm#ref_62_28">Itm</A></FONT>  : <A HREF="terminal_interface-curses-menus__ads.htm#ref_56_9">Item</A>) <b>return</b> <A HREF="terminal_interface-curses-menus-item_user_data__ads.htm#ref_45_9">User_Access</A>;
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/mitem_userptr.3x.html">item_userptr</A></EM></FONT>
    <FONT COLOR=green><EM>--  Same as function</EM></FONT>
    <b>pragma</b> Inline (Get_User_Data);
diff -Naur ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-menus-menu_user_data__adb.htm ncurses-5.7/doc/html/ada/terminal_interface-curses-menus-menu_user_data__adb.htm
--- ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-menus-menu_user_data__adb.htm	2006-09-23 16:31:31.000000000 -0400
+++ ncurses-5.7/doc/html/ada/terminal_interface-curses-menus-menu_user_data__adb.htm	2011-01-08 18:13:50.363157410 -0500
@@ -12,7 +12,7 @@
 <FONT COLOR=green><EM>--                                 B O D Y                                  --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-<FONT COLOR=green><EM>-- Copyright (c) 1998 Free Software Foundation, Inc.                        --</EM></FONT>
+<FONT COLOR=green><EM>-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>-- Permission is hereby granted, free of charge, to any person obtaining a  --</EM></FONT>
 <FONT COLOR=green><EM>-- copy of this software and associated documentation files (the            --</EM></FONT>
@@ -40,17 +40,17 @@
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <FONT COLOR=green><EM>--  Author:  Juergen Pfeifer, 1996</EM></FONT>
 <FONT COLOR=green><EM>--  Version Control:</EM></FONT>
-<FONT COLOR=green><EM>--  @Revision: 1.12 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Revision: 1.13 @</EM></FONT>
 <FONT COLOR=green><EM>--  Binding Version 01.00</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <b>with</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-aux__ads.htm#ref_50_35">Aux</A>; <b>use</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-aux__ads.htm#ref_50_35">Aux</A>;
 
 <b>package</b> <b>body</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-menus__ads.htm#ref_49_35">Menus</A>.<FONT COLOR=red><A NAME="ref_43_46" HREF="terminal_interface-curses-menus-menu_user_data__ads.htm#ref_45_41">Menu_User_Data</A></FONT> <b>is</b>
 
-   <b>use</b> <b>type</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C.int;
+   <b>use</b> <b>type</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C.int;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_47_14" HREF="terminal_interface-curses-menus-menu_user_data__ads.htm#ref_53_14">Set_User_Data</A></FONT> (<FONT COLOR=red><A NAME="ref_47_29" HREF="terminal_interface-curses-menus-menu_user_data__ads.htm#ref_53_29">Men</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
-                            <FONT COLOR=red><A NAME="ref_48_29" HREF="terminal_interface-curses-menus-menu_user_data__ads.htm#ref_54_29">Data</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-menus-menu_user_data__ads.htm#ref_44_9">User_Access</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_47_14" HREF="terminal_interface-curses-menus-menu_user_data__ads.htm#ref_53_14">Set_User_Data</A></FONT> (<FONT COLOR=red><A NAME="ref_47_29" HREF="terminal_interface-curses-menus-menu_user_data__ads.htm#ref_53_29">Men</A></FONT>  : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
+                            <FONT COLOR=red><A NAME="ref_48_29" HREF="terminal_interface-curses-menus-menu_user_data__ads.htm#ref_54_29">Data</A></FONT> : <A HREF="terminal_interface-curses-menus-menu_user_data__ads.htm#ref_44_9">User_Access</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_50_16">Set_Menu_Userptr</A></FONT> (<FONT COLOR=red><A NAME="ref_50_34" HREF="terminal_interface-curses-menus-menu_user_data__adb.htm#ref_50_16">Men</A></FONT>  : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
                                  <FONT COLOR=red><A NAME="ref_51_34" HREF="terminal_interface-curses-menus-menu_user_data__adb.htm#ref_50_16">Data</A></FONT> : <A HREF="terminal_interface-curses-menus-menu_user_data__ads.htm#ref_44_9">User_Access</A>)  <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
@@ -63,7 +63,7 @@
       <b>end</b> <b>if</b>;
    <b>end</b> <A HREF="terminal_interface-curses-menus-menu_user_data__ads.htm#ref_53_14">Set_User_Data</A>;
 
-   <b>function</b> <FONT COLOR=red><A NAME="ref_61_13" HREF="terminal_interface-curses-menus-menu_user_data__ads.htm#ref_64_13">Get_User_Data</A></FONT> (<FONT COLOR=red><A NAME="ref_61_28" HREF="terminal_interface-curses-menus-menu_user_data__ads.htm#ref_64_28">Men</A></FONT>  : <b>in</b>  <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>) <b>return</b> <A HREF="terminal_interface-curses-menus-menu_user_data__ads.htm#ref_44_9">User_Access</A>
+   <b>function</b> <FONT COLOR=red><A NAME="ref_61_13" HREF="terminal_interface-curses-menus-menu_user_data__ads.htm#ref_64_13">Get_User_Data</A></FONT> (<FONT COLOR=red><A NAME="ref_61_28" HREF="terminal_interface-curses-menus-menu_user_data__ads.htm#ref_64_28">Men</A></FONT>  : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>) <b>return</b> <A HREF="terminal_interface-curses-menus-menu_user_data__ads.htm#ref_44_9">User_Access</A>
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_63_16">Menu_Userptr</A></FONT> (<FONT COLOR=red><A NAME="ref_63_30" HREF="terminal_interface-curses-menus-menu_user_data__adb.htm#ref_63_16">Men</A></FONT> : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>) <b>return</b> <A HREF="terminal_interface-curses-menus-menu_user_data__ads.htm#ref_44_9">User_Access</A>;
       <b>pragma</b> Import (C, Menu_Userptr, "menu_userptr");
@@ -71,7 +71,7 @@
       <b>return</b> <A HREF="terminal_interface-curses-menus-menu_user_data__adb.htm#ref_63_16">Menu_Userptr</A> (<A HREF="terminal_interface-curses-menus-menu_user_data__ads.htm#ref_64_28">Men</A>);
    <b>end</b> <A HREF="terminal_interface-curses-menus-menu_user_data__ads.htm#ref_64_13">Get_User_Data</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_69_14" HREF="terminal_interface-curses-menus-menu_user_data__ads.htm#ref_59_14">Get_User_Data</A></FONT> (<FONT COLOR=red><A NAME="ref_69_29" HREF="terminal_interface-curses-menus-menu_user_data__ads.htm#ref_59_29">Men</A></FONT>  : <b>in</b>  <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_69_14" HREF="terminal_interface-curses-menus-menu_user_data__ads.htm#ref_59_14">Get_User_Data</A></FONT> (<FONT COLOR=red><A NAME="ref_69_29" HREF="terminal_interface-curses-menus-menu_user_data__ads.htm#ref_59_29">Men</A></FONT>  : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
                             <FONT COLOR=red><A NAME="ref_70_29" HREF="terminal_interface-curses-menus-menu_user_data__ads.htm#ref_60_29">Data</A></FONT> : <b>out</b> <A HREF="terminal_interface-curses-menus-menu_user_data__ads.htm#ref_44_9">User_Access</A>)
    <b>is</b>
    <b>begin</b>
diff -Naur ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-menus-menu_user_data__ads.htm ncurses-5.7/doc/html/ada/terminal_interface-curses-menus-menu_user_data__ads.htm
--- ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-menus-menu_user_data__ads.htm	2007-09-01 19:56:31.000000000 -0400
+++ ncurses-5.7/doc/html/ada/terminal_interface-curses-menus-menu_user_data__ads.htm	2011-01-08 18:13:50.363157410 -0500
@@ -12,7 +12,7 @@
 <FONT COLOR=green><EM>--                                 S P E C                                  --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-<FONT COLOR=green><EM>-- Copyright (c) 1998 Free Software Foundation, Inc.                        --</EM></FONT>
+<FONT COLOR=green><EM>-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>-- Permission is hereby granted, free of charge, to any person obtaining a  --</EM></FONT>
 <FONT COLOR=green><EM>-- copy of this software and associated documentation files (the            --</EM></FONT>
@@ -40,7 +40,7 @@
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <FONT COLOR=green><EM>--  Author:  Juergen Pfeifer, 1996</EM></FONT>
 <FONT COLOR=green><EM>--  Version Control:</EM></FONT>
-<FONT COLOR=green><EM>--  @Revision: 1.14 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Revision: 1.15 @</EM></FONT>
 <FONT COLOR=green><EM>--  Binding Version 01.00</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 
@@ -55,18 +55,18 @@
    <FONT COLOR=green><EM>--  |=====================================================================</EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_1"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_53_14" HREF="terminal_interface-curses-menus-menu_user_data__adb.htm#ref_47_14">Set_User_Data</A></FONT> (<FONT COLOR=red><A NAME="ref_53_29" HREF="terminal_interface-curses-menus-menu_user_data__adb.htm#ref_47_29">Men</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
-                            <FONT COLOR=red><A NAME="ref_54_29" HREF="terminal_interface-curses-menus-menu_user_data__adb.htm#ref_48_29">Data</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-menus-menu_user_data__ads.htm#ref_44_9">User_Access</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_53_14" HREF="terminal_interface-curses-menus-menu_user_data__adb.htm#ref_47_14">Set_User_Data</A></FONT> (<FONT COLOR=red><A NAME="ref_53_29" HREF="terminal_interface-curses-menus-menu_user_data__adb.htm#ref_47_29">Men</A></FONT>  : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
+                            <FONT COLOR=red><A NAME="ref_54_29" HREF="terminal_interface-curses-menus-menu_user_data__adb.htm#ref_48_29">Data</A></FONT> : <A HREF="terminal_interface-curses-menus-menu_user_data__ads.htm#ref_44_9">User_Access</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/menu_userptr.3x.html">set_menu_userptr</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses-menus-menu_user_data__ads.htm#ref_53_14">Set_User_Data</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_2"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_59_14" HREF="terminal_interface-curses-menus-menu_user_data__adb.htm#ref_69_14">Get_User_Data</A></FONT> (<FONT COLOR=red><A NAME="ref_59_29" HREF="terminal_interface-curses-menus-menu_user_data__adb.htm#ref_69_29">Men</A></FONT>  : <b>in</b>  <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_59_14" HREF="terminal_interface-curses-menus-menu_user_data__adb.htm#ref_69_14">Get_User_Data</A></FONT> (<FONT COLOR=red><A NAME="ref_59_29" HREF="terminal_interface-curses-menus-menu_user_data__adb.htm#ref_69_29">Men</A></FONT>  : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
                             <FONT COLOR=red><A NAME="ref_60_29" HREF="terminal_interface-curses-menus-menu_user_data__adb.htm#ref_70_29">Data</A></FONT> : <b>out</b> <A HREF="terminal_interface-curses-menus-menu_user_data__ads.htm#ref_44_9">User_Access</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/menu_userptr.3x.html">menu_userptr</A></EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_3"#2|</EM></FONT>
-   <b>function</b> <FONT COLOR=red><A NAME="ref_64_13" HREF="terminal_interface-curses-menus-menu_user_data__adb.htm#ref_61_13">Get_User_Data</A></FONT> (<FONT COLOR=red><A NAME="ref_64_28" HREF="terminal_interface-curses-menus-menu_user_data__adb.htm#ref_61_28">Men</A></FONT>  : <b>in</b>  <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>) <b>return</b> <A HREF="terminal_interface-curses-menus-menu_user_data__ads.htm#ref_44_9">User_Access</A>;
+   <b>function</b> <FONT COLOR=red><A NAME="ref_64_13" HREF="terminal_interface-curses-menus-menu_user_data__adb.htm#ref_61_13">Get_User_Data</A></FONT> (<FONT COLOR=red><A NAME="ref_64_28" HREF="terminal_interface-curses-menus-menu_user_data__adb.htm#ref_61_28">Men</A></FONT>  : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>) <b>return</b> <A HREF="terminal_interface-curses-menus-menu_user_data__ads.htm#ref_44_9">User_Access</A>;
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/menu_userptr.3x.html">menu_userptr</A></EM></FONT>
    <FONT COLOR=green><EM>--  Same as function</EM></FONT>
    <b>pragma</b> Inline (Get_User_Data);
diff -Naur ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-menus__adb.htm ncurses-5.7/doc/html/ada/terminal_interface-curses-menus__adb.htm
--- ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-menus__adb.htm	2008-10-11 17:36:31.000000000 -0400
+++ ncurses-5.7/doc/html/ada/terminal_interface-curses-menus__adb.htm	2011-01-08 18:13:50.367156790 -0500
@@ -12,7 +12,7 @@
 <FONT COLOR=green><EM>--                                 B O D Y                                  --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-<FONT COLOR=green><EM>-- Copyright (c) 1998-2004,2008 Free Software Foundation, Inc.              --</EM></FONT>
+<FONT COLOR=green><EM>-- Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.              --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>-- Permission is hereby granted, free of charge, to any person obtaining a  --</EM></FONT>
 <FONT COLOR=green><EM>-- copy of this software and associated documentation files (the            --</EM></FONT>
@@ -40,16 +40,16 @@
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <FONT COLOR=green><EM>--  Author:  Juergen Pfeifer, 1996</EM></FONT>
 <FONT COLOR=green><EM>--  Version Control:</EM></FONT>
-<FONT COLOR=green><EM>--  @Revision: 1.26 @</EM></FONT>
-<FONT COLOR=green><EM>--  @Date: 2008/07/26 18:50:58 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Revision: 1.27 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Date: 2009/12/26 17:38:58 @</EM></FONT>
 <FONT COLOR=green><EM>--  Binding Version 01.00</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <b>with</b> Ada.Unchecked_Deallocation;
 <b>with</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-aux__ads.htm#ref_50_35">Aux</A>; <b>use</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-aux__ads.htm#ref_50_35">Aux</A>;
 
-<b>with</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C; <b>use</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C;
-<b>with</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C.Strings; <b>use</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C.Strings;
-<b>with</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C.Pointers;
+<b>with</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C; <b>use</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C;
+<b>with</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C.Strings; <b>use</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C.Strings;
+<b>with</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C.Pointers;
 
 <b>with</b> Ada.Unchecked_Conversion;
 
@@ -57,10 +57,10 @@
 
    <b>type</b> C_Item_Array <b>is</b> <b>array</b> (Natural <b>range</b> &lt;&gt;) <b>of</b> <b>aliased</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_56_9">Item</A>;
    <b>package</b> I_Array <b>is</b> <b>new</b>
-     <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C.Pointers (Natural, <A HREF="terminal_interface-curses-menus__ads.htm#ref_56_9">Item</A>, C_Item_Array, <A HREF="terminal_interface-curses-menus__ads.htm#ref_62_4">Null_Item</A>);
+     <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C.Pointers (Natural, <A HREF="terminal_interface-curses-menus__ads.htm#ref_56_9">Item</A>, C_Item_Array, <A HREF="terminal_interface-curses-menus__ads.htm#ref_62_4">Null_Item</A>);
 
    <b>use</b> <b>type</b> System.Bit_Order;
-   <b>subtype</b> <FONT COLOR=red><A NAME="ref_58_12">chars_ptr</A></FONT> <b>is</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C.Strings.chars_ptr;
+   <b>subtype</b> <FONT COLOR=red><A NAME="ref_58_12">chars_ptr</A></FONT> <b>is</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C.Strings.chars_ptr;
 
    <b>function</b> MOS_2_CInt <b>is</b> <b>new</b>
      Ada.Unchecked_Conversion (<A HREF="terminal_interface-curses-menus__ads.htm#ref_121_9">Menu_Option_Set</A>,
@@ -79,7 +79,7 @@
                                <A HREF="terminal_interface-curses-menus__ads.htm#ref_153_9">Item_Option_Set</A>);
 
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_77_14" HREF="terminal_interface-curses-menus__ads.htm#ref_106_14">Request_Name</A></FONT> (<FONT COLOR=red><A NAME="ref_77_28" HREF="terminal_interface-curses-menus__ads.htm#ref_106_28">Key</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_65_12">Menu_Request_Code</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_77_14" HREF="terminal_interface-curses-menus__ads.htm#ref_106_14">Request_Name</A></FONT> (<FONT COLOR=red><A NAME="ref_77_28" HREF="terminal_interface-curses-menus__ads.htm#ref_106_28">Key</A></FONT>  : <A HREF="terminal_interface-curses-menus__ads.htm#ref_65_12">Menu_Request_Code</A>;
                            <FONT COLOR=red><A NAME="ref_78_28" HREF="terminal_interface-curses-menus__ads.htm#ref_107_28">Name</A></FONT> : <b>out</b> String)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_80_16">Request_Name</A></FONT> (<FONT COLOR=red><A NAME="ref_80_30" HREF="terminal_interface-curses-menus__adb.htm#ref_80_16">Key</A></FONT> : <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>) <b>return</b> <A HREF="terminal_interface-curses-menus__adb.htm#ref_58_12">chars_ptr</A>;
@@ -99,7 +99,7 @@
    <b>function</b> <FONT COLOR=red><A NAME="ref_94_13" HREF="terminal_interface-curses-menus__ads.htm#ref_191_13">Create</A></FONT> (<FONT COLOR=red><A NAME="ref_94_21" HREF="terminal_interface-curses-menus__ads.htm#ref_191_21">Name</A></FONT>        : String;
                     <FONT COLOR=red><A NAME="ref_95_21" HREF="terminal_interface-curses-menus__ads.htm#ref_192_21">Description</A></FONT> : String := "") <b>return</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_56_9">Item</A>
    <b>is</b>
-      <b>type</b> <FONT COLOR=red><A NAME="ref_97_12">Char_Ptr</A></FONT> <b>is</b> <b>access</b> <b>all</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C.char;
+      <b>type</b> <FONT COLOR=red><A NAME="ref_97_12">Char_Ptr</A></FONT> <b>is</b> <b>access</b> <b>all</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C.char;
       <b>function</b> <FONT COLOR=red><A NAME="ref_98_16">Newitem</A></FONT> (<FONT COLOR=red><A NAME="ref_98_25" HREF="terminal_interface-curses-menus__adb.htm#ref_98_16">Name</A></FONT>, <FONT COLOR=red><A NAME="ref_98_31" HREF="terminal_interface-curses-menus__adb.htm#ref_98_16">Desc</A></FONT> : <A HREF="terminal_interface-curses-menus__adb.htm#ref_97_12">Char_Ptr</A>) <b>return</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_56_9">Item</A>;
       <b>pragma</b> Import (C, Newitem, "new_item");
 
@@ -141,11 +141,11 @@
    <b>begin</b>
       <A HREF="terminal_interface-curses-menus__adb.htm#ref_135_7">Ptr</A> := <A HREF="terminal_interface-curses-menus__adb.htm#ref_126_16">Descname</A> (<A HREF="terminal_interface-curses-menus__ads.htm#ref_203_22">Itm</A>);
       <b>if</b> <A HREF="terminal_interface-curses-menus__adb.htm#ref_135_7">Ptr</A> /= Null_Ptr <b>then</b>
-         <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C.Strings.Free (<A HREF="terminal_interface-curses-menus__adb.htm#ref_135_7">Ptr</A>);
+         <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C.Strings.Free (<A HREF="terminal_interface-curses-menus__adb.htm#ref_135_7">Ptr</A>);
       <b>end</b> <b>if</b>;
       <A HREF="terminal_interface-curses-menus__adb.htm#ref_135_7">Ptr</A> := <A HREF="terminal_interface-curses-menus__adb.htm#ref_128_16">Itemname</A> (<A HREF="terminal_interface-curses-menus__ads.htm#ref_203_22">Itm</A>);
       <b>if</b> <A HREF="terminal_interface-curses-menus__adb.htm#ref_135_7">Ptr</A> /= Null_Ptr <b>then</b>
-         <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C.Strings.Free (<A HREF="terminal_interface-curses-menus__adb.htm#ref_135_7">Ptr</A>);
+         <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C.Strings.Free (<A HREF="terminal_interface-curses-menus__adb.htm#ref_135_7">Ptr</A>);
       <b>end</b> <b>if</b>;
       <A HREF="terminal_interface-curses-menus__adb.htm#ref_134_7">Res</A> := <A HREF="terminal_interface-curses-menus__adb.htm#ref_131_16">Freeitem</A> (<A HREF="terminal_interface-curses-menus__ads.htm#ref_203_22">Itm</A>);
       <b>if</b> <A HREF="terminal_interface-curses-menus__adb.htm#ref_134_7">Res</A> /= <A HREF="terminal_interface-curses-aux__ads.htm#ref_80_4">E_Ok</A> <b>then</b>
@@ -154,8 +154,8 @@
       <A HREF="terminal_interface-curses-menus__ads.htm#ref_203_22">Itm</A> := <A HREF="terminal_interface-curses-menus__ads.htm#ref_62_4">Null_Item</A>;
    <b>end</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_203_14">Delete</A>;
 <FONT COLOR=green><EM>-------------------------------------------------------------------------------</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_152_14" HREF="terminal_interface-curses-menus__ads.htm#ref_212_14">Set_Value</A></FONT> (<FONT COLOR=red><A NAME="ref_152_25" HREF="terminal_interface-curses-menus__ads.htm#ref_212_25">Itm</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_56_9">Item</A>;
-                        <FONT COLOR=red><A NAME="ref_153_25" HREF="terminal_interface-curses-menus__ads.htm#ref_213_25">Value</A></FONT> : <b>in</b> Boolean := True)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_152_14" HREF="terminal_interface-curses-menus__ads.htm#ref_212_14">Set_Value</A></FONT> (<FONT COLOR=red><A NAME="ref_152_25" HREF="terminal_interface-curses-menus__ads.htm#ref_212_25">Itm</A></FONT>   : <A HREF="terminal_interface-curses-menus__ads.htm#ref_56_9">Item</A>;
+                        <FONT COLOR=red><A NAME="ref_153_25" HREF="terminal_interface-curses-menus__ads.htm#ref_213_25">Value</A></FONT> : Boolean := True)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_155_16">Set_Item_Val</A></FONT> (<FONT COLOR=red><A NAME="ref_155_30" HREF="terminal_interface-curses-menus__adb.htm#ref_155_16">Itm</A></FONT> : <A HREF="terminal_interface-curses-menus__ads.htm#ref_56_9">Item</A>;
                              <FONT COLOR=red><A NAME="ref_156_30" HREF="terminal_interface-curses-menus__adb.htm#ref_155_16">Val</A></FONT> : <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
@@ -193,8 +193,8 @@
       <b>end</b> <b>if</b>;
    <b>end</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_227_13">Visible</A>;
 <FONT COLOR=green><EM>-------------------------------------------------------------------------------</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_191_14" HREF="terminal_interface-curses-menus__ads.htm#ref_236_14">Set_Options</A></FONT> (<FONT COLOR=red><A NAME="ref_191_27" HREF="terminal_interface-curses-menus__ads.htm#ref_236_27">Itm</A></FONT>     : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_56_9">Item</A>;
-                          <FONT COLOR=red><A NAME="ref_192_27" HREF="terminal_interface-curses-menus__ads.htm#ref_237_27">Options</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_153_9">Item_Option_Set</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_191_14" HREF="terminal_interface-curses-menus__ads.htm#ref_236_14">Set_Options</A></FONT> (<FONT COLOR=red><A NAME="ref_191_27" HREF="terminal_interface-curses-menus__ads.htm#ref_236_27">Itm</A></FONT>     : <A HREF="terminal_interface-curses-menus__ads.htm#ref_56_9">Item</A>;
+                          <FONT COLOR=red><A NAME="ref_192_27" HREF="terminal_interface-curses-menus__ads.htm#ref_237_27">Options</A></FONT> : <A HREF="terminal_interface-curses-menus__ads.htm#ref_153_9">Item_Option_Set</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_194_16">Set_Item_Opts</A></FONT> (<FONT COLOR=red><A NAME="ref_194_31" HREF="terminal_interface-curses-menus__adb.htm#ref_194_16">Itm</A></FONT> : <A HREF="terminal_interface-curses-menus__ads.htm#ref_56_9">Item</A>;
                               <FONT COLOR=red><A NAME="ref_195_31" HREF="terminal_interface-curses-menus__adb.htm#ref_194_16">Opt</A></FONT> : <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
@@ -209,8 +209,8 @@
       <b>end</b> <b>if</b>;
    <b>end</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_236_14">Set_Options</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_207_14" HREF="terminal_interface-curses-menus__ads.htm#ref_242_14">Switch_Options</A></FONT> (<FONT COLOR=red><A NAME="ref_207_30" HREF="terminal_interface-curses-menus__ads.htm#ref_242_30">Itm</A></FONT>     : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_56_9">Item</A>;
-                             <FONT COLOR=red><A NAME="ref_208_30" HREF="terminal_interface-curses-menus__ads.htm#ref_243_30">Options</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_153_9">Item_Option_Set</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_207_14" HREF="terminal_interface-curses-menus__ads.htm#ref_242_14">Switch_Options</A></FONT> (<FONT COLOR=red><A NAME="ref_207_30" HREF="terminal_interface-curses-menus__ads.htm#ref_242_30">Itm</A></FONT>     : <A HREF="terminal_interface-curses-menus__ads.htm#ref_56_9">Item</A>;
+                             <FONT COLOR=red><A NAME="ref_208_30" HREF="terminal_interface-curses-menus__ads.htm#ref_243_30">Options</A></FONT> : <A HREF="terminal_interface-curses-menus__ads.htm#ref_153_9">Item_Option_Set</A>;
                              <FONT COLOR=red><A NAME="ref_209_30" HREF="terminal_interface-curses-menus__ads.htm#ref_244_30">On</A></FONT>      : Boolean := True)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_211_16">Item_Opts_On</A></FONT> (<FONT COLOR=red><A NAME="ref_211_30" HREF="terminal_interface-curses-menus__adb.htm#ref_211_16">Itm</A></FONT> : <A HREF="terminal_interface-curses-menus__ads.htm#ref_56_9">Item</A>;
@@ -233,7 +233,7 @@
       <b>end</b> <b>if</b>;
    <b>end</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_242_14">Switch_Options</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_231_14" HREF="terminal_interface-curses-menus__ads.htm#ref_251_14">Get_Options</A></FONT> (<FONT COLOR=red><A NAME="ref_231_27" HREF="terminal_interface-curses-menus__ads.htm#ref_251_27">Itm</A></FONT>     : <b>in</b>  <A HREF="terminal_interface-curses-menus__ads.htm#ref_56_9">Item</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_231_14" HREF="terminal_interface-curses-menus__ads.htm#ref_251_14">Get_Options</A></FONT> (<FONT COLOR=red><A NAME="ref_231_27" HREF="terminal_interface-curses-menus__ads.htm#ref_251_27">Itm</A></FONT>     : <A HREF="terminal_interface-curses-menus__ads.htm#ref_56_9">Item</A>;
                           <FONT COLOR=red><A NAME="ref_232_27" HREF="terminal_interface-curses-menus__ads.htm#ref_252_27">Options</A></FONT> : <b>out</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_153_9">Item_Option_Set</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_234_16">Item_Opts</A></FONT> (<FONT COLOR=red><A NAME="ref_234_27" HREF="terminal_interface-curses-menus__adb.htm#ref_234_16">Itm</A></FONT> : <A HREF="terminal_interface-curses-menus__ads.htm#ref_56_9">Item</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
@@ -252,7 +252,7 @@
       <b>return</b> <A HREF="terminal_interface-curses-menus__adb.htm#ref_244_7">Ios</A>;
    <b>end</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_256_13">Get_Options</A>;
 <FONT COLOR=green><EM>-------------------------------------------------------------------------------</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_250_14" HREF="terminal_interface-curses-menus__ads.htm#ref_265_14">Name</A></FONT> (<FONT COLOR=red><A NAME="ref_250_20" HREF="terminal_interface-curses-menus__ads.htm#ref_265_20">Itm</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_56_9">Item</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_250_14" HREF="terminal_interface-curses-menus__ads.htm#ref_265_14">Name</A></FONT> (<FONT COLOR=red><A NAME="ref_250_20" HREF="terminal_interface-curses-menus__ads.htm#ref_265_20">Itm</A></FONT>  : <A HREF="terminal_interface-curses-menus__ads.htm#ref_56_9">Item</A>;
                    <FONT COLOR=red><A NAME="ref_251_20" HREF="terminal_interface-curses-menus__ads.htm#ref_266_20">Name</A></FONT> : <b>out</b> String)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_253_16">Itemname</A></FONT> (<FONT COLOR=red><A NAME="ref_253_26" HREF="terminal_interface-curses-menus__adb.htm#ref_253_16">Itm</A></FONT> : <A HREF="terminal_interface-curses-menus__ads.htm#ref_56_9">Item</A>) <b>return</b> <A HREF="terminal_interface-curses-menus__adb.htm#ref_58_12">chars_ptr</A>;
@@ -261,7 +261,7 @@
       <A HREF="terminal_interface-curses-aux__ads.htm#ref_116_14">Fill_String</A> (<A HREF="terminal_interface-curses-menus__adb.htm#ref_253_16">Itemname</A> (<A HREF="terminal_interface-curses-menus__ads.htm#ref_265_20">Itm</A>), <A HREF="terminal_interface-curses-menus__ads.htm#ref_266_20">Name</A>);
    <b>end</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_265_14">Name</A>;
 
-   <b>function</b> <FONT COLOR=red><A NAME="ref_259_13" HREF="terminal_interface-curses-menus__ads.htm#ref_268_14">Name</A></FONT> (<FONT COLOR=red><A NAME="ref_259_19" HREF="terminal_interface-curses-menus__ads.htm#ref_268_20">Itm</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_56_9">Item</A>) <b>return</b> String
+   <b>function</b> <FONT COLOR=red><A NAME="ref_259_13" HREF="terminal_interface-curses-menus__ads.htm#ref_268_14">Name</A></FONT> (<FONT COLOR=red><A NAME="ref_259_19" HREF="terminal_interface-curses-menus__ads.htm#ref_268_20">Itm</A></FONT> : <A HREF="terminal_interface-curses-menus__ads.htm#ref_56_9">Item</A>) <b>return</b> String
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_261_16">Itemname</A></FONT> (<FONT COLOR=red><A NAME="ref_261_26" HREF="terminal_interface-curses-menus__adb.htm#ref_261_16">Itm</A></FONT> : <A HREF="terminal_interface-curses-menus__ads.htm#ref_56_9">Item</A>) <b>return</b> <A HREF="terminal_interface-curses-menus__adb.htm#ref_58_12">chars_ptr</A>;
       <b>pragma</b> Import (C, Itemname, "item_name");
@@ -269,7 +269,7 @@
       <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_121_13">Fill_String</A> (<A HREF="terminal_interface-curses-menus__adb.htm#ref_261_16">Itemname</A> (<A HREF="terminal_interface-curses-menus__ads.htm#ref_268_20">Itm</A>));
    <b>end</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_268_14">Name</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_267_14" HREF="terminal_interface-curses-menus__ads.htm#ref_274_14">Description</A></FONT> (<FONT COLOR=red><A NAME="ref_267_27" HREF="terminal_interface-curses-menus__ads.htm#ref_274_27">Itm</A></FONT>         : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_56_9">Item</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_267_14" HREF="terminal_interface-curses-menus__ads.htm#ref_274_14">Description</A></FONT> (<FONT COLOR=red><A NAME="ref_267_27" HREF="terminal_interface-curses-menus__ads.htm#ref_274_27">Itm</A></FONT>         : <A HREF="terminal_interface-curses-menus__ads.htm#ref_56_9">Item</A>;
                           <FONT COLOR=red><A NAME="ref_268_27" HREF="terminal_interface-curses-menus__ads.htm#ref_275_27">Description</A></FONT> : <b>out</b> String)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_270_16">Descname</A></FONT> (<FONT COLOR=red><A NAME="ref_270_26" HREF="terminal_interface-curses-menus__adb.htm#ref_270_16">Itm</A></FONT>  : <A HREF="terminal_interface-curses-menus__ads.htm#ref_56_9">Item</A>) <b>return</b> <A HREF="terminal_interface-curses-menus__adb.htm#ref_58_12">chars_ptr</A>;
@@ -278,7 +278,7 @@
       <A HREF="terminal_interface-curses-aux__ads.htm#ref_116_14">Fill_String</A> (<A HREF="terminal_interface-curses-menus__adb.htm#ref_270_16">Descname</A> (<A HREF="terminal_interface-curses-menus__ads.htm#ref_274_27">Itm</A>), <A HREF="terminal_interface-curses-menus__ads.htm#ref_275_27">Description</A>);
    <b>end</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_274_14">Description</A>;
 
-   <b>function</b> <FONT COLOR=red><A NAME="ref_276_13" HREF="terminal_interface-curses-menus__ads.htm#ref_278_14">Description</A></FONT> (<FONT COLOR=red><A NAME="ref_276_26" HREF="terminal_interface-curses-menus__ads.htm#ref_278_27">Itm</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_56_9">Item</A>) <b>return</b> String
+   <b>function</b> <FONT COLOR=red><A NAME="ref_276_13" HREF="terminal_interface-curses-menus__ads.htm#ref_278_14">Description</A></FONT> (<FONT COLOR=red><A NAME="ref_276_26" HREF="terminal_interface-curses-menus__ads.htm#ref_278_27">Itm</A></FONT> : <A HREF="terminal_interface-curses-menus__ads.htm#ref_56_9">Item</A>) <b>return</b> String
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_278_16">Descname</A></FONT> (<FONT COLOR=red><A NAME="ref_278_26" HREF="terminal_interface-curses-menus__adb.htm#ref_278_16">Itm</A></FONT>  : <A HREF="terminal_interface-curses-menus__ads.htm#ref_56_9">Item</A>) <b>return</b> <A HREF="terminal_interface-curses-menus__adb.htm#ref_58_12">chars_ptr</A>;
       <b>pragma</b> Import (C, Descname, "item_description");
@@ -286,8 +286,8 @@
       <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_121_13">Fill_String</A> (<A HREF="terminal_interface-curses-menus__adb.htm#ref_278_16">Descname</A> (<A HREF="terminal_interface-curses-menus__ads.htm#ref_278_27">Itm</A>));
    <b>end</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_278_14">Description</A>;
 <FONT COLOR=green><EM>-------------------------------------------------------------------------------</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_284_14" HREF="terminal_interface-curses-menus__ads.htm#ref_288_14">Set_Current</A></FONT> (<FONT COLOR=red><A NAME="ref_284_27" HREF="terminal_interface-curses-menus__ads.htm#ref_288_27">Men</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
-                          <FONT COLOR=red><A NAME="ref_285_27" HREF="terminal_interface-curses-menus__ads.htm#ref_289_27">Itm</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_56_9">Item</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_284_14" HREF="terminal_interface-curses-menus__ads.htm#ref_288_14">Set_Current</A></FONT> (<FONT COLOR=red><A NAME="ref_284_27" HREF="terminal_interface-curses-menus__ads.htm#ref_288_27">Men</A></FONT> : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
+                          <FONT COLOR=red><A NAME="ref_285_27" HREF="terminal_interface-curses-menus__ads.htm#ref_289_27">Itm</A></FONT> : <A HREF="terminal_interface-curses-menus__ads.htm#ref_56_9">Item</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_287_16">Set_Curr_Item</A></FONT> (<FONT COLOR=red><A NAME="ref_287_31" HREF="terminal_interface-curses-menus__adb.htm#ref_287_16">Men</A></FONT> : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
                               <FONT COLOR=red><A NAME="ref_288_31" HREF="terminal_interface-curses-menus__adb.htm#ref_287_16">Itm</A></FONT> : <A HREF="terminal_interface-curses-menus__ads.htm#ref_56_9">Item</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
@@ -313,8 +313,8 @@
       <b>return</b> <A HREF="terminal_interface-curses-menus__adb.htm#ref_303_7">Res</A>;
    <b>end</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_294_13">Current</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_311_14" HREF="terminal_interface-curses-menus__ads.htm#ref_299_14">Set_Top_Row</A></FONT> (<FONT COLOR=red><A NAME="ref_311_27" HREF="terminal_interface-curses-menus__ads.htm#ref_299_27">Men</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
-                          <FONT COLOR=red><A NAME="ref_312_27" HREF="terminal_interface-curses-menus__ads.htm#ref_300_27">Line</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_311_14" HREF="terminal_interface-curses-menus__ads.htm#ref_299_14">Set_Top_Row</A></FONT> (<FONT COLOR=red><A NAME="ref_311_27" HREF="terminal_interface-curses-menus__ads.htm#ref_299_27">Men</A></FONT>  : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
+                          <FONT COLOR=red><A NAME="ref_312_27" HREF="terminal_interface-curses-menus__ads.htm#ref_300_27">Line</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_314_16">Set_Toprow</A></FONT> (<FONT COLOR=red><A NAME="ref_314_28" HREF="terminal_interface-curses-menus__adb.htm#ref_314_16">Men</A></FONT>  : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
                            <FONT COLOR=red><A NAME="ref_315_28" HREF="terminal_interface-curses-menus__adb.htm#ref_314_16">Line</A></FONT> : <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
@@ -353,8 +353,8 @@
       <b>return</b> Positive (Natural (<A HREF="terminal_interface-curses-menus__adb.htm#ref_343_7">Res</A>) + Positive'First);
    <b>end</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_310_13">Get_Index</A>;
 <FONT COLOR=green><EM>-------------------------------------------------------------------------------</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_351_14" HREF="terminal_interface-curses-menus__ads.htm#ref_322_14">Post</A></FONT> (<FONT COLOR=red><A NAME="ref_351_20" HREF="terminal_interface-curses-menus__ads.htm#ref_322_20">Men</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
-                   <FONT COLOR=red><A NAME="ref_352_20" HREF="terminal_interface-curses-menus__ads.htm#ref_323_20">Post</A></FONT> : <b>in</b> Boolean := True)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_351_14" HREF="terminal_interface-curses-menus__ads.htm#ref_322_14">Post</A></FONT> (<FONT COLOR=red><A NAME="ref_351_20" HREF="terminal_interface-curses-menus__ads.htm#ref_322_20">Men</A></FONT>  : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
+                   <FONT COLOR=red><A NAME="ref_352_20" HREF="terminal_interface-curses-menus__ads.htm#ref_323_20">Post</A></FONT> : Boolean := True)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_354_16">M_Post</A></FONT> (<FONT COLOR=red><A NAME="ref_354_24" HREF="terminal_interface-curses-menus__adb.htm#ref_354_16">Men</A></FONT> : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
       <b>pragma</b> Import (C, M_Post, "post_menu");
@@ -373,8 +373,8 @@
       <b>end</b> <b>if</b>;
    <b>end</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_322_14">Post</A>;
 <FONT COLOR=green><EM>-------------------------------------------------------------------------------</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_371_14" HREF="terminal_interface-curses-menus__ads.htm#ref_333_14">Set_Options</A></FONT> (<FONT COLOR=red><A NAME="ref_371_27" HREF="terminal_interface-curses-menus__ads.htm#ref_333_27">Men</A></FONT>     : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
-                          <FONT COLOR=red><A NAME="ref_372_27" HREF="terminal_interface-curses-menus__ads.htm#ref_334_27">Options</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_121_9">Menu_Option_Set</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_371_14" HREF="terminal_interface-curses-menus__ads.htm#ref_333_14">Set_Options</A></FONT> (<FONT COLOR=red><A NAME="ref_371_27" HREF="terminal_interface-curses-menus__ads.htm#ref_333_27">Men</A></FONT>     : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
+                          <FONT COLOR=red><A NAME="ref_372_27" HREF="terminal_interface-curses-menus__ads.htm#ref_334_27">Options</A></FONT> : <A HREF="terminal_interface-curses-menus__ads.htm#ref_121_9">Menu_Option_Set</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_374_16">Set_Menu_Opts</A></FONT> (<FONT COLOR=red><A NAME="ref_374_31" HREF="terminal_interface-curses-menus__adb.htm#ref_374_16">Men</A></FONT> : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
                               <FONT COLOR=red><A NAME="ref_375_31" HREF="terminal_interface-curses-menus__adb.htm#ref_374_16">Opt</A></FONT> : <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
@@ -389,9 +389,9 @@
       <b>end</b> <b>if</b>;
    <b>end</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_333_14">Set_Options</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_387_14" HREF="terminal_interface-curses-menus__ads.htm#ref_339_14">Switch_Options</A></FONT> (<FONT COLOR=red><A NAME="ref_387_30" HREF="terminal_interface-curses-menus__ads.htm#ref_339_30">Men</A></FONT>     : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
-                             <FONT COLOR=red><A NAME="ref_388_30" HREF="terminal_interface-curses-menus__ads.htm#ref_340_30">Options</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_121_9">Menu_Option_Set</A>;
-                             <FONT COLOR=red><A NAME="ref_389_30" HREF="terminal_interface-curses-menus__ads.htm#ref_341_30">On</A></FONT>      : <b>in</b> Boolean := True)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_387_14" HREF="terminal_interface-curses-menus__ads.htm#ref_339_14">Switch_Options</A></FONT> (<FONT COLOR=red><A NAME="ref_387_30" HREF="terminal_interface-curses-menus__ads.htm#ref_339_30">Men</A></FONT>     : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
+                             <FONT COLOR=red><A NAME="ref_388_30" HREF="terminal_interface-curses-menus__ads.htm#ref_340_30">Options</A></FONT> : <A HREF="terminal_interface-curses-menus__ads.htm#ref_121_9">Menu_Option_Set</A>;
+                             <FONT COLOR=red><A NAME="ref_389_30" HREF="terminal_interface-curses-menus__ads.htm#ref_341_30">On</A></FONT>      : Boolean := True)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_391_16">Menu_Opts_On</A></FONT> (<FONT COLOR=red><A NAME="ref_391_30" HREF="terminal_interface-curses-menus__adb.htm#ref_391_16">Men</A></FONT> : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
                              <FONT COLOR=red><A NAME="ref_392_30" HREF="terminal_interface-curses-menus__adb.htm#ref_391_16">Opt</A></FONT> : <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
@@ -413,8 +413,8 @@
       <b>end</b> <b>if</b>;
    <b>end</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_339_14">Switch_Options</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_411_14" HREF="terminal_interface-curses-menus__ads.htm#ref_347_14">Get_Options</A></FONT> (<FONT COLOR=red><A NAME="ref_411_27" HREF="terminal_interface-curses-menus__ads.htm#ref_347_27">Men</A></FONT>     : <b>in</b>  <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
-                               <FONT COLOR=red><A NAME="ref_412_32" HREF="terminal_interface-curses-menus__ads.htm#ref_348_27">Options</A></FONT> : <b>out</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_121_9">Menu_Option_Set</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_411_14" HREF="terminal_interface-curses-menus__ads.htm#ref_347_14">Get_Options</A></FONT> (<FONT COLOR=red><A NAME="ref_411_27" HREF="terminal_interface-curses-menus__ads.htm#ref_347_27">Men</A></FONT>     : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
+                          <FONT COLOR=red><A NAME="ref_412_27" HREF="terminal_interface-curses-menus__ads.htm#ref_348_27">Options</A></FONT> : <b>out</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_121_9">Menu_Option_Set</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_414_16">Menu_Opts</A></FONT> (<FONT COLOR=red><A NAME="ref_414_27" HREF="terminal_interface-curses-menus__adb.htm#ref_414_16">Men</A></FONT> : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
       <b>pragma</b> Import (C, Menu_Opts, "menu_opts");
@@ -432,8 +432,8 @@
       <b>return</b> <A HREF="terminal_interface-curses-menus__adb.htm#ref_424_7">Mos</A>;
    <b>end</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_352_13">Get_Options</A>;
 <FONT COLOR=green><EM>-------------------------------------------------------------------------------</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_430_14" HREF="terminal_interface-curses-menus__ads.htm#ref_361_14">Set_Window</A></FONT> (<FONT COLOR=red><A NAME="ref_430_26" HREF="terminal_interface-curses-menus__ads.htm#ref_361_26">Men</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
-                         <FONT COLOR=red><A NAME="ref_431_26" HREF="terminal_interface-curses-menus__ads.htm#ref_362_26">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_430_14" HREF="terminal_interface-curses-menus__ads.htm#ref_361_14">Set_Window</A></FONT> (<FONT COLOR=red><A NAME="ref_430_26" HREF="terminal_interface-curses-menus__ads.htm#ref_361_26">Men</A></FONT> : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
+                         <FONT COLOR=red><A NAME="ref_431_26" HREF="terminal_interface-curses-menus__ads.htm#ref_362_26">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_433_16">Set_Menu_Win</A></FONT> (<FONT COLOR=red><A NAME="ref_433_30" HREF="terminal_interface-curses-menus__adb.htm#ref_433_16">Men</A></FONT> : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
                              <FONT COLOR=red><A NAME="ref_434_30" HREF="terminal_interface-curses-menus__adb.htm#ref_433_16">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
@@ -456,8 +456,8 @@
       <b>return</b> <A HREF="terminal_interface-curses-menus__adb.htm#ref_449_7">W</A>;
    <b>end</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_367_13">Get_Window</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_454_14" HREF="terminal_interface-curses-menus__ads.htm#ref_372_14">Set_Sub_Window</A></FONT> (<FONT COLOR=red><A NAME="ref_454_30" HREF="terminal_interface-curses-menus__ads.htm#ref_372_30">Men</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
-                             <FONT COLOR=red><A NAME="ref_455_30" HREF="terminal_interface-curses-menus__ads.htm#ref_373_30">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_454_14" HREF="terminal_interface-curses-menus__ads.htm#ref_372_14">Set_Sub_Window</A></FONT> (<FONT COLOR=red><A NAME="ref_454_30" HREF="terminal_interface-curses-menus__ads.htm#ref_372_30">Men</A></FONT> : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
+                             <FONT COLOR=red><A NAME="ref_455_30" HREF="terminal_interface-curses-menus__ads.htm#ref_373_30">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_457_16">Set_Menu_Sub</A></FONT> (<FONT COLOR=red><A NAME="ref_457_30" HREF="terminal_interface-curses-menus__adb.htm#ref_457_16">Men</A></FONT> : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
                              <FONT COLOR=red><A NAME="ref_458_30" HREF="terminal_interface-curses-menus__adb.htm#ref_457_16">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
@@ -480,7 +480,7 @@
       <b>return</b> <A HREF="terminal_interface-curses-menus__adb.htm#ref_473_7">W</A>;
    <b>end</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_378_13">Get_Sub_Window</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_478_14" HREF="terminal_interface-curses-menus__ads.htm#ref_383_14">Scale</A></FONT> (<FONT COLOR=red><A NAME="ref_478_21" HREF="terminal_interface-curses-menus__ads.htm#ref_383_21">Men</A></FONT>     : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_478_14" HREF="terminal_interface-curses-menus__ads.htm#ref_383_14">Scale</A></FONT> (<FONT COLOR=red><A NAME="ref_478_21" HREF="terminal_interface-curses-menus__ads.htm#ref_383_21">Men</A></FONT>     : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
                     <FONT COLOR=red><A NAME="ref_479_21" HREF="terminal_interface-curses-menus__ads.htm#ref_384_21">Lines</A></FONT>   : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_63_12">Line_Count</A>;
                     <FONT COLOR=red><A NAME="ref_480_21" HREF="terminal_interface-curses-menus__ads.htm#ref_385_21">Columns</A></FONT> : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_65_12">Column_Count</A>)
    <b>is</b>
@@ -512,10 +512,10 @@
    <b>end</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_394_14">Position_Cursor</A>;
 
 <FONT COLOR=green><EM>-------------------------------------------------------------------------------</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_510_14" HREF="terminal_interface-curses-menus__ads.htm#ref_403_14">Set_Mark</A></FONT> (<FONT COLOR=red><A NAME="ref_510_24" HREF="terminal_interface-curses-menus__ads.htm#ref_403_24">Men</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
-                       <FONT COLOR=red><A NAME="ref_511_24" HREF="terminal_interface-curses-menus__ads.htm#ref_404_24">Mark</A></FONT> : <b>in</b> String)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_510_14" HREF="terminal_interface-curses-menus__ads.htm#ref_403_14">Set_Mark</A></FONT> (<FONT COLOR=red><A NAME="ref_510_24" HREF="terminal_interface-curses-menus__ads.htm#ref_403_24">Men</A></FONT>  : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
+                       <FONT COLOR=red><A NAME="ref_511_24" HREF="terminal_interface-curses-menus__ads.htm#ref_404_24">Mark</A></FONT> : String)
    <b>is</b>
-      <b>type</b> <FONT COLOR=red><A NAME="ref_513_12">Char_Ptr</A></FONT> <b>is</b> <b>access</b> <b>all</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C.char;
+      <b>type</b> <FONT COLOR=red><A NAME="ref_513_12">Char_Ptr</A></FONT> <b>is</b> <b>access</b> <b>all</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C.char;
       <b>function</b> <FONT COLOR=red><A NAME="ref_514_16">Set_Mark</A></FONT> (<FONT COLOR=red><A NAME="ref_514_26" HREF="terminal_interface-curses-menus__adb.htm#ref_514_16">Men</A></FONT>  : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
                          <FONT COLOR=red><A NAME="ref_515_26" HREF="terminal_interface-curses-menus__adb.htm#ref_514_16">Mark</A></FONT> : <A HREF="terminal_interface-curses-menus__adb.htm#ref_513_12">Char_Ptr</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
       <b>pragma</b> Import (C, Set_Mark, "set_menu_mark");
@@ -531,7 +531,7 @@
       <b>end</b> <b>if</b>;
    <b>end</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_403_14">Set_Mark</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_529_14" HREF="terminal_interface-curses-menus__ads.htm#ref_409_14">Mark</A></FONT> (<FONT COLOR=red><A NAME="ref_529_20" HREF="terminal_interface-curses-menus__ads.htm#ref_409_20">Men</A></FONT>  : <b>in</b>  <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_529_14" HREF="terminal_interface-curses-menus__ads.htm#ref_409_14">Mark</A></FONT> (<FONT COLOR=red><A NAME="ref_529_20" HREF="terminal_interface-curses-menus__ads.htm#ref_409_20">Men</A></FONT>  : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
                    <FONT COLOR=red><A NAME="ref_530_20" HREF="terminal_interface-curses-menus__ads.htm#ref_410_20">Mark</A></FONT> : <b>out</b> String)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_532_16">Get_Menu_Mark</A></FONT> (<FONT COLOR=red><A NAME="ref_532_31" HREF="terminal_interface-curses-menus__adb.htm#ref_532_16">Men</A></FONT> : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>) <b>return</b> <A HREF="terminal_interface-curses-menus__adb.htm#ref_58_12">chars_ptr</A>;
@@ -550,9 +550,9 @@
 
 <FONT COLOR=green><EM>-------------------------------------------------------------------------------</EM></FONT>
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_547_14" HREF="terminal_interface-curses-menus__ads.htm#ref_423_14">Set_Foreground</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_548_7" HREF="terminal_interface-curses-menus__ads.htm#ref_424_7">Men</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
-      <FONT COLOR=red><A NAME="ref_549_7" HREF="terminal_interface-curses-menus__ads.htm#ref_425_7">Fore</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_307_9">Character_Attribute_Set</A> := <A HREF="terminal_interface-curses__ads.htm#ref_350_4">Normal_Video</A>;
-      <FONT COLOR=red><A NAME="ref_550_7" HREF="terminal_interface-curses-menus__ads.htm#ref_426_7">Color</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A> := <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A>'First)
+     (<FONT COLOR=red><A NAME="ref_548_7" HREF="terminal_interface-curses-menus__ads.htm#ref_424_7">Men</A></FONT>   : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
+      <FONT COLOR=red><A NAME="ref_549_7" HREF="terminal_interface-curses-menus__ads.htm#ref_425_7">Fore</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_307_9">Character_Attribute_Set</A> := <A HREF="terminal_interface-curses__ads.htm#ref_350_4">Normal_Video</A>;
+      <FONT COLOR=red><A NAME="ref_550_7" HREF="terminal_interface-curses-menus__ads.htm#ref_426_7">Color</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A> := <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A>'First)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_552_16">Set_Menu_Fore</A></FONT> (<FONT COLOR=red><A NAME="ref_552_31" HREF="terminal_interface-curses-menus__adb.htm#ref_552_16">Men</A></FONT>  : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
                               <FONT COLOR=red><A NAME="ref_553_31" HREF="terminal_interface-curses-menus__adb.htm#ref_552_16">Attr</A></FONT> : <A HREF="terminal_interface-curses-aux__ads.htm#ref_63_12">C_Chtype</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
@@ -568,7 +568,7 @@
       <b>end</b> <b>if</b>;
    <b>end</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_423_14">Set_Foreground</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_566_14" HREF="terminal_interface-curses-menus__ads.htm#ref_431_14">Foreground</A></FONT> (<FONT COLOR=red><A NAME="ref_566_26" HREF="terminal_interface-curses-menus__ads.htm#ref_431_26">Men</A></FONT>  : <b>in</b>  <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_566_14" HREF="terminal_interface-curses-menus__ads.htm#ref_431_14">Foreground</A></FONT> (<FONT COLOR=red><A NAME="ref_566_26" HREF="terminal_interface-curses-menus__ads.htm#ref_431_26">Men</A></FONT>  : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
                          <FONT COLOR=red><A NAME="ref_567_26" HREF="terminal_interface-curses-menus__ads.htm#ref_432_26">Fore</A></FONT> : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_307_9">Character_Attribute_Set</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_569_16">Menu_Fore</A></FONT> (<FONT COLOR=red><A NAME="ref_569_27" HREF="terminal_interface-curses-menus__adb.htm#ref_569_16">Men</A></FONT> : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_63_12">C_Chtype</A>;
@@ -577,7 +577,7 @@
       <A HREF="terminal_interface-curses-menus__ads.htm#ref_432_26">Fore</A> := Chtype_To_AttrChar (<A HREF="terminal_interface-curses-menus__adb.htm#ref_569_16">Menu_Fore</A> (<A HREF="terminal_interface-curses-menus__ads.htm#ref_431_26">Men</A>)).<A HREF="terminal_interface-curses__ads.htm#ref_354_10">Attr</A>;
    <b>end</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_431_14">Foreground</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_575_14" HREF="terminal_interface-curses-menus__ads.htm#ref_436_14">Foreground</A></FONT> (<FONT COLOR=red><A NAME="ref_575_26" HREF="terminal_interface-curses-menus__ads.htm#ref_436_26">Men</A></FONT>   : <b>in</b>  <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_575_14" HREF="terminal_interface-curses-menus__ads.htm#ref_436_14">Foreground</A></FONT> (<FONT COLOR=red><A NAME="ref_575_26" HREF="terminal_interface-curses-menus__ads.htm#ref_436_26">Men</A></FONT>   : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
                          <FONT COLOR=red><A NAME="ref_576_26" HREF="terminal_interface-curses-menus__ads.htm#ref_437_26">Fore</A></FONT>  : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_307_9">Character_Attribute_Set</A>;
                          <FONT COLOR=red><A NAME="ref_577_26" HREF="terminal_interface-curses-menus__ads.htm#ref_438_26">Color</A></FONT> : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A>)
    <b>is</b>
@@ -589,9 +589,9 @@
    <b>end</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_436_14">Foreground</A>;
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_586_14" HREF="terminal_interface-curses-menus__ads.htm#ref_443_14">Set_Background</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_587_7" HREF="terminal_interface-curses-menus__ads.htm#ref_444_7">Men</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
-      <FONT COLOR=red><A NAME="ref_588_7" HREF="terminal_interface-curses-menus__ads.htm#ref_445_7">Back</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_307_9">Character_Attribute_Set</A> := <A HREF="terminal_interface-curses__ads.htm#ref_350_4">Normal_Video</A>;
-      <FONT COLOR=red><A NAME="ref_589_7" HREF="terminal_interface-curses-menus__ads.htm#ref_446_7">Color</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A> := <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A>'First)
+     (<FONT COLOR=red><A NAME="ref_587_7" HREF="terminal_interface-curses-menus__ads.htm#ref_444_7">Men</A></FONT>   : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
+      <FONT COLOR=red><A NAME="ref_588_7" HREF="terminal_interface-curses-menus__ads.htm#ref_445_7">Back</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_307_9">Character_Attribute_Set</A> := <A HREF="terminal_interface-curses__ads.htm#ref_350_4">Normal_Video</A>;
+      <FONT COLOR=red><A NAME="ref_589_7" HREF="terminal_interface-curses-menus__ads.htm#ref_446_7">Color</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A> := <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A>'First)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_591_16">Set_Menu_Back</A></FONT> (<FONT COLOR=red><A NAME="ref_591_31" HREF="terminal_interface-curses-menus__adb.htm#ref_591_16">Men</A></FONT>  : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
                               <FONT COLOR=red><A NAME="ref_592_31" HREF="terminal_interface-curses-menus__adb.htm#ref_591_16">Attr</A></FONT> : <A HREF="terminal_interface-curses-aux__ads.htm#ref_63_12">C_Chtype</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
@@ -607,7 +607,7 @@
       <b>end</b> <b>if</b>;
    <b>end</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_443_14">Set_Background</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_605_14" HREF="terminal_interface-curses-menus__ads.htm#ref_451_14">Background</A></FONT> (<FONT COLOR=red><A NAME="ref_605_26" HREF="terminal_interface-curses-menus__ads.htm#ref_451_26">Men</A></FONT>  : <b>in</b>  <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_605_14" HREF="terminal_interface-curses-menus__ads.htm#ref_451_14">Background</A></FONT> (<FONT COLOR=red><A NAME="ref_605_26" HREF="terminal_interface-curses-menus__ads.htm#ref_451_26">Men</A></FONT>  : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
                          <FONT COLOR=red><A NAME="ref_606_26" HREF="terminal_interface-curses-menus__ads.htm#ref_452_26">Back</A></FONT> : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_307_9">Character_Attribute_Set</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_608_16">Menu_Back</A></FONT> (<FONT COLOR=red><A NAME="ref_608_27" HREF="terminal_interface-curses-menus__adb.htm#ref_608_16">Men</A></FONT> : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_63_12">C_Chtype</A>;
@@ -616,7 +616,7 @@
       <A HREF="terminal_interface-curses-menus__ads.htm#ref_452_26">Back</A> := Chtype_To_AttrChar (<A HREF="terminal_interface-curses-menus__adb.htm#ref_608_16">Menu_Back</A> (<A HREF="terminal_interface-curses-menus__ads.htm#ref_451_26">Men</A>)).<A HREF="terminal_interface-curses__ads.htm#ref_354_10">Attr</A>;
    <b>end</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_451_14">Background</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_614_14" HREF="terminal_interface-curses-menus__ads.htm#ref_456_14">Background</A></FONT> (<FONT COLOR=red><A NAME="ref_614_26" HREF="terminal_interface-curses-menus__ads.htm#ref_456_26">Men</A></FONT>   : <b>in</b>  <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_614_14" HREF="terminal_interface-curses-menus__ads.htm#ref_456_14">Background</A></FONT> (<FONT COLOR=red><A NAME="ref_614_26" HREF="terminal_interface-curses-menus__ads.htm#ref_456_26">Men</A></FONT>   : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
                          <FONT COLOR=red><A NAME="ref_615_26" HREF="terminal_interface-curses-menus__ads.htm#ref_457_26">Back</A></FONT>  : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_307_9">Character_Attribute_Set</A>;
                          <FONT COLOR=red><A NAME="ref_616_26" HREF="terminal_interface-curses-menus__ads.htm#ref_458_26">Color</A></FONT> : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A>)
    <b>is</b>
@@ -627,9 +627,9 @@
       <A HREF="terminal_interface-curses-menus__ads.htm#ref_458_26">Color</A> := <A HREF="terminal_interface-curses-aux__ads.htm#ref_96_14">Chtype_To_AttrChar</A> (<A HREF="terminal_interface-curses-menus__adb.htm#ref_618_16">Menu_Back</A> (<A HREF="terminal_interface-curses-menus__ads.htm#ref_456_26">Men</A>)).<A HREF="terminal_interface-curses__ads.htm#ref_355_10">Color</A>;
    <b>end</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_456_14">Background</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_625_14" HREF="terminal_interface-curses-menus__ads.htm#ref_463_14">Set_Grey</A></FONT> (<FONT COLOR=red><A NAME="ref_625_24" HREF="terminal_interface-curses-menus__ads.htm#ref_464_7">Men</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
-                       <FONT COLOR=red><A NAME="ref_626_24" HREF="terminal_interface-curses-menus__ads.htm#ref_465_7">Grey</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_307_9">Character_Attribute_Set</A> := <A HREF="terminal_interface-curses__ads.htm#ref_350_4">Normal_Video</A>;
-                       <FONT COLOR=red><A NAME="ref_627_24" HREF="terminal_interface-curses-menus__ads.htm#ref_466_7">Color</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A> := <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A>'First)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_625_14" HREF="terminal_interface-curses-menus__ads.htm#ref_463_14">Set_Grey</A></FONT> (<FONT COLOR=red><A NAME="ref_625_24" HREF="terminal_interface-curses-menus__ads.htm#ref_464_7">Men</A></FONT>   : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
+                       <FONT COLOR=red><A NAME="ref_626_24" HREF="terminal_interface-curses-menus__ads.htm#ref_465_7">Grey</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_307_9">Character_Attribute_Set</A> := <A HREF="terminal_interface-curses__ads.htm#ref_350_4">Normal_Video</A>;
+                       <FONT COLOR=red><A NAME="ref_627_24" HREF="terminal_interface-curses-menus__ads.htm#ref_466_7">Color</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A> := <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A>'First)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_629_16">Set_Menu_Grey</A></FONT> (<FONT COLOR=red><A NAME="ref_629_31" HREF="terminal_interface-curses-menus__adb.htm#ref_629_16">Men</A></FONT>  : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
                               <FONT COLOR=red><A NAME="ref_630_31" HREF="terminal_interface-curses-menus__adb.htm#ref_629_16">Attr</A></FONT> : <A HREF="terminal_interface-curses-aux__ads.htm#ref_63_12">C_Chtype</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
@@ -646,7 +646,7 @@
       <b>end</b> <b>if</b>;
    <b>end</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_463_14">Set_Grey</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_644_14" HREF="terminal_interface-curses-menus__ads.htm#ref_471_14">Grey</A></FONT> (<FONT COLOR=red><A NAME="ref_644_20" HREF="terminal_interface-curses-menus__ads.htm#ref_471_20">Men</A></FONT>  : <b>in</b>  <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_644_14" HREF="terminal_interface-curses-menus__ads.htm#ref_471_14">Grey</A></FONT> (<FONT COLOR=red><A NAME="ref_644_20" HREF="terminal_interface-curses-menus__ads.htm#ref_471_20">Men</A></FONT>  : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
                    <FONT COLOR=red><A NAME="ref_645_20" HREF="terminal_interface-curses-menus__ads.htm#ref_472_20">Grey</A></FONT> : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_307_9">Character_Attribute_Set</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_647_16">Menu_Grey</A></FONT> (<FONT COLOR=red><A NAME="ref_647_27" HREF="terminal_interface-curses-menus__adb.htm#ref_647_16">Men</A></FONT> : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_63_12">C_Chtype</A>;
@@ -655,7 +655,7 @@
       <A HREF="terminal_interface-curses-menus__ads.htm#ref_472_20">Grey</A> := <A HREF="terminal_interface-curses-aux__ads.htm#ref_96_14">Chtype_To_AttrChar</A> (<A HREF="terminal_interface-curses-menus__adb.htm#ref_647_16">Menu_Grey</A> (<A HREF="terminal_interface-curses-menus__ads.htm#ref_471_20">Men</A>)).<A HREF="terminal_interface-curses__ads.htm#ref_354_10">Attr</A>;
    <b>end</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_471_14">Grey</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_653_14" HREF="terminal_interface-curses-menus__ads.htm#ref_476_14">Grey</A></FONT> (<FONT COLOR=red><A NAME="ref_653_20" HREF="terminal_interface-curses-menus__ads.htm#ref_477_7">Men</A></FONT>  : <b>in</b>  <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_653_14" HREF="terminal_interface-curses-menus__ads.htm#ref_476_14">Grey</A></FONT> (<FONT COLOR=red><A NAME="ref_653_20" HREF="terminal_interface-curses-menus__ads.htm#ref_477_7">Men</A></FONT>  : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
                    <FONT COLOR=red><A NAME="ref_654_20" HREF="terminal_interface-curses-menus__ads.htm#ref_478_7">Grey</A></FONT> : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_307_9">Character_Attribute_Set</A>;
                    <FONT COLOR=red><A NAME="ref_655_20" HREF="terminal_interface-curses-menus__ads.htm#ref_479_7">Color</A></FONT> : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A>)
    <b>is</b>
@@ -666,8 +666,8 @@
       <A HREF="terminal_interface-curses-menus__ads.htm#ref_479_7">Color</A> := <A HREF="terminal_interface-curses-aux__ads.htm#ref_96_14">Chtype_To_AttrChar</A> (<A HREF="terminal_interface-curses-menus__adb.htm#ref_657_16">Menu_Grey</A> (<A HREF="terminal_interface-curses-menus__ads.htm#ref_477_7">Men</A>)).<A HREF="terminal_interface-curses__ads.htm#ref_355_10">Color</A>;
    <b>end</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_476_14">Grey</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_664_14" HREF="terminal_interface-curses-menus__ads.htm#ref_484_14">Set_Pad_Character</A></FONT> (<FONT COLOR=red><A NAME="ref_664_33" HREF="terminal_interface-curses-menus__ads.htm#ref_484_33">Men</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
-                                <FONT COLOR=red><A NAME="ref_665_33" HREF="terminal_interface-curses-menus__ads.htm#ref_485_33">Pad</A></FONT> : <b>in</b> Character := Space)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_664_14" HREF="terminal_interface-curses-menus__ads.htm#ref_484_14">Set_Pad_Character</A></FONT> (<FONT COLOR=red><A NAME="ref_664_33" HREF="terminal_interface-curses-menus__ads.htm#ref_484_33">Men</A></FONT> : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
+                                <FONT COLOR=red><A NAME="ref_665_33" HREF="terminal_interface-curses-menus__ads.htm#ref_485_33">Pad</A></FONT> : Character := Space)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_667_16">Set_Menu_Pad</A></FONT> (<FONT COLOR=red><A NAME="ref_667_30" HREF="terminal_interface-curses-menus__adb.htm#ref_667_16">Men</A></FONT> : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
                              <FONT COLOR=red><A NAME="ref_668_30" HREF="terminal_interface-curses-menus__adb.htm#ref_667_16">Ch</A></FONT>  : <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
@@ -681,7 +681,7 @@
       <b>end</b> <b>if</b>;
    <b>end</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_484_14">Set_Pad_Character</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_679_14" HREF="terminal_interface-curses-menus__ads.htm#ref_490_14">Pad_Character</A></FONT> (<FONT COLOR=red><A NAME="ref_679_29" HREF="terminal_interface-curses-menus__ads.htm#ref_490_29">Men</A></FONT> : <b>in</b>  <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_679_14" HREF="terminal_interface-curses-menus__ads.htm#ref_490_14">Pad_Character</A></FONT> (<FONT COLOR=red><A NAME="ref_679_29" HREF="terminal_interface-curses-menus__ads.htm#ref_490_29">Men</A></FONT> : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
                             <FONT COLOR=red><A NAME="ref_680_29" HREF="terminal_interface-curses-menus__ads.htm#ref_491_29">Pad</A></FONT> : <b>out</b> Character)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_682_16">Menu_Pad</A></FONT> (<FONT COLOR=red><A NAME="ref_682_26" HREF="terminal_interface-curses-menus__adb.htm#ref_682_16">Men</A></FONT> : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
@@ -690,10 +690,10 @@
       <A HREF="terminal_interface-curses-menus__ads.htm#ref_491_29">Pad</A> := Character'Val (<A HREF="terminal_interface-curses-menus__adb.htm#ref_682_16">Menu_Pad</A> (<A HREF="terminal_interface-curses-menus__ads.htm#ref_490_29">Men</A>));
    <b>end</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_490_14">Pad_Character</A>;
 <FONT COLOR=green><EM>-------------------------------------------------------------------------------</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_688_14" HREF="terminal_interface-curses-menus__ads.htm#ref_500_14">Set_Spacing</A></FONT> (<FONT COLOR=red><A NAME="ref_688_27" HREF="terminal_interface-curses-menus__ads.htm#ref_500_27">Men</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
-                          <FONT COLOR=red><A NAME="ref_689_27" HREF="terminal_interface-curses-menus__ads.htm#ref_501_27">Descr</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A> := 0;
-                          <FONT COLOR=red><A NAME="ref_690_27" HREF="terminal_interface-curses-menus__ads.htm#ref_502_27">Row</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>   := 0;
-                          <FONT COLOR=red><A NAME="ref_691_27" HREF="terminal_interface-curses-menus__ads.htm#ref_503_27">Col</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A> := 0)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_688_14" HREF="terminal_interface-curses-menus__ads.htm#ref_500_14">Set_Spacing</A></FONT> (<FONT COLOR=red><A NAME="ref_688_27" HREF="terminal_interface-curses-menus__ads.htm#ref_500_27">Men</A></FONT>   : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
+                          <FONT COLOR=red><A NAME="ref_689_27" HREF="terminal_interface-curses-menus__ads.htm#ref_501_27">Descr</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A> := 0;
+                          <FONT COLOR=red><A NAME="ref_690_27" HREF="terminal_interface-curses-menus__ads.htm#ref_502_27">Row</A></FONT>   : <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>   := 0;
+                          <FONT COLOR=red><A NAME="ref_691_27" HREF="terminal_interface-curses-menus__ads.htm#ref_503_27">Col</A></FONT>   : <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A> := 0)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_693_16">Set_Spacing</A></FONT> (<FONT COLOR=red><A NAME="ref_693_29" HREF="terminal_interface-curses-menus__adb.htm#ref_693_16">Men</A></FONT>     : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
                             <FONT COLOR=red><A NAME="ref_694_29" HREF="terminal_interface-curses-menus__adb.htm#ref_693_16">D</A></FONT>, <FONT COLOR=red><A NAME="ref_694_32" HREF="terminal_interface-curses-menus__adb.htm#ref_693_16">R</A></FONT>, <FONT COLOR=red><A NAME="ref_694_35" HREF="terminal_interface-curses-menus__adb.htm#ref_693_16">C</A></FONT> : <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
@@ -709,7 +709,7 @@
       <b>end</b> <b>if</b>;
    <b>end</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_500_14">Set_Spacing</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_707_14" HREF="terminal_interface-curses-menus__ads.htm#ref_508_14">Spacing</A></FONT> (<FONT COLOR=red><A NAME="ref_707_23" HREF="terminal_interface-curses-menus__ads.htm#ref_508_23">Men</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_707_14" HREF="terminal_interface-curses-menus__ads.htm#ref_508_14">Spacing</A></FONT> (<FONT COLOR=red><A NAME="ref_707_23" HREF="terminal_interface-curses-menus__ads.htm#ref_508_23">Men</A></FONT>   : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
                       <FONT COLOR=red><A NAME="ref_708_23" HREF="terminal_interface-curses-menus__ads.htm#ref_509_23">Descr</A></FONT> : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
                       <FONT COLOR=red><A NAME="ref_709_23" HREF="terminal_interface-curses-menus__ads.htm#ref_510_23">Row</A></FONT>   : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
                       <FONT COLOR=red><A NAME="ref_710_23" HREF="terminal_interface-curses-menus__ads.htm#ref_511_23">Col</A></FONT>   : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>)
@@ -737,7 +737,7 @@
    <b>function</b> <FONT COLOR=red><A NAME="ref_732_13" HREF="terminal_interface-curses-menus__ads.htm#ref_520_13">Set_Pattern</A></FONT> (<FONT COLOR=red><A NAME="ref_732_26" HREF="terminal_interface-curses-menus__ads.htm#ref_520_26">Men</A></FONT>  : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
                          <FONT COLOR=red><A NAME="ref_733_26" HREF="terminal_interface-curses-menus__ads.htm#ref_521_26">Text</A></FONT> : String) <b>return</b> Boolean
    <b>is</b>
-      <b>type</b> <FONT COLOR=red><A NAME="ref_735_12">Char_Ptr</A></FONT> <b>is</b> <b>access</b> <b>all</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C.char;
+      <b>type</b> <FONT COLOR=red><A NAME="ref_735_12">Char_Ptr</A></FONT> <b>is</b> <b>access</b> <b>all</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C.char;
       <b>function</b> <FONT COLOR=red><A NAME="ref_736_16">Set_Pattern</A></FONT> (<FONT COLOR=red><A NAME="ref_736_29" HREF="terminal_interface-curses-menus__adb.htm#ref_736_16">Men</A></FONT>     : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
                             <FONT COLOR=red><A NAME="ref_737_29" HREF="terminal_interface-curses-menus__adb.htm#ref_736_16">Pattern</A></FONT> : <A HREF="terminal_interface-curses-menus__adb.htm#ref_735_12">Char_Ptr</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
       <b>pragma</b> Import (C, Set_Pattern, "set_menu_pattern");
@@ -757,7 +757,7 @@
       <b>end</b> <b>case</b>;
    <b>end</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_520_13">Set_Pattern</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_755_14" HREF="terminal_interface-curses-menus__ads.htm#ref_527_14">Pattern</A></FONT> (<FONT COLOR=red><A NAME="ref_755_23" HREF="terminal_interface-curses-menus__ads.htm#ref_527_23">Men</A></FONT>  : <b>in</b>  <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_755_14" HREF="terminal_interface-curses-menus__ads.htm#ref_527_14">Pattern</A></FONT> (<FONT COLOR=red><A NAME="ref_755_23" HREF="terminal_interface-curses-menus__ads.htm#ref_527_23">Men</A></FONT>  : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
                       <FONT COLOR=red><A NAME="ref_756_23" HREF="terminal_interface-curses-menus__ads.htm#ref_528_23">Text</A></FONT> : <b>out</b> String)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_758_16">Get_Pattern</A></FONT> (<FONT COLOR=red><A NAME="ref_758_29" HREF="terminal_interface-curses-menus__adb.htm#ref_758_16">Men</A></FONT> : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>) <b>return</b> <A HREF="terminal_interface-curses-menus__adb.htm#ref_58_12">chars_ptr</A>;
@@ -766,9 +766,9 @@
       <A HREF="terminal_interface-curses-aux__ads.htm#ref_116_14">Fill_String</A> (<A HREF="terminal_interface-curses-menus__adb.htm#ref_758_16">Get_Pattern</A> (<A HREF="terminal_interface-curses-menus__ads.htm#ref_527_23">Men</A>), <A HREF="terminal_interface-curses-menus__ads.htm#ref_528_23">Text</A>);
    <b>end</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_527_14">Pattern</A>;
 <FONT COLOR=green><EM>-------------------------------------------------------------------------------</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_764_14" HREF="terminal_interface-curses-menus__ads.htm#ref_537_14">Set_Format</A></FONT> (<FONT COLOR=red><A NAME="ref_764_26" HREF="terminal_interface-curses-menus__ads.htm#ref_537_26">Men</A></FONT>     : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
-                         <FONT COLOR=red><A NAME="ref_765_26" HREF="terminal_interface-curses-menus__ads.htm#ref_538_26">Lines</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_63_12">Line_Count</A>;
-                         <FONT COLOR=red><A NAME="ref_766_26" HREF="terminal_interface-curses-menus__ads.htm#ref_539_26">Columns</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_65_12">Column_Count</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_764_14" HREF="terminal_interface-curses-menus__ads.htm#ref_537_14">Set_Format</A></FONT> (<FONT COLOR=red><A NAME="ref_764_26" HREF="terminal_interface-curses-menus__ads.htm#ref_537_26">Men</A></FONT>     : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
+                         <FONT COLOR=red><A NAME="ref_765_26" HREF="terminal_interface-curses-menus__ads.htm#ref_538_26">Lines</A></FONT>   : <A HREF="terminal_interface-curses__ads.htm#ref_63_12">Line_Count</A>;
+                         <FONT COLOR=red><A NAME="ref_766_26" HREF="terminal_interface-curses-menus__ads.htm#ref_539_26">Columns</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_65_12">Column_Count</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_768_16">Set_Menu_Fmt</A></FONT> (<FONT COLOR=red><A NAME="ref_768_30" HREF="terminal_interface-curses-menus__adb.htm#ref_768_16">Men</A></FONT> : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
                              <FONT COLOR=red><A NAME="ref_769_30" HREF="terminal_interface-curses-menus__adb.htm#ref_768_16">Lin</A></FONT> : <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
@@ -784,7 +784,7 @@
       <b>end</b> <b>if</b>;
    <b>end</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_537_14">Set_Format</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_782_14" HREF="terminal_interface-curses-menus__ads.htm#ref_551_14">Format</A></FONT> (<FONT COLOR=red><A NAME="ref_782_22" HREF="terminal_interface-curses-menus__ads.htm#ref_551_22">Men</A></FONT>     : <b>in</b>  <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_782_14" HREF="terminal_interface-curses-menus__ads.htm#ref_551_14">Format</A></FONT> (<FONT COLOR=red><A NAME="ref_782_22" HREF="terminal_interface-curses-menus__ads.htm#ref_551_22">Men</A></FONT>     : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
                      <FONT COLOR=red><A NAME="ref_783_22" HREF="terminal_interface-curses-menus__ads.htm#ref_552_22">Lines</A></FONT>   : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_63_12">Line_Count</A>;
                      <FONT COLOR=red><A NAME="ref_784_22" HREF="terminal_interface-curses-menus__ads.htm#ref_553_22">Columns</A></FONT> : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_65_12">Column_Count</A>)
    <b>is</b>
@@ -804,8 +804,8 @@
       <b>end</b> <b>if</b>;
    <b>end</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_551_14">Format</A>;
 <FONT COLOR=green><EM>-------------------------------------------------------------------------------</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_802_14" HREF="terminal_interface-curses-menus__ads.htm#ref_565_14">Set_Item_Init_Hook</A></FONT> (<FONT COLOR=red><A NAME="ref_802_34" HREF="terminal_interface-curses-menus__ads.htm#ref_565_34">Men</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
-                                 <FONT COLOR=red><A NAME="ref_803_34" HREF="terminal_interface-curses-menus__ads.htm#ref_566_34">Proc</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_561_9">Menu_Hook_Function</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_802_14" HREF="terminal_interface-curses-menus__ads.htm#ref_565_14">Set_Item_Init_Hook</A></FONT> (<FONT COLOR=red><A NAME="ref_802_34" HREF="terminal_interface-curses-menus__ads.htm#ref_565_34">Men</A></FONT>  : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
+                                 <FONT COLOR=red><A NAME="ref_803_34" HREF="terminal_interface-curses-menus__ads.htm#ref_566_34">Proc</A></FONT> : <A HREF="terminal_interface-curses-menus__ads.htm#ref_561_9">Menu_Hook_Function</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_805_16">Set_Item_Init</A></FONT> (<FONT COLOR=red><A NAME="ref_805_31" HREF="terminal_interface-curses-menus__adb.htm#ref_805_16">Men</A></FONT>  : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
                               <FONT COLOR=red><A NAME="ref_806_31" HREF="terminal_interface-curses-menus__adb.htm#ref_805_16">Proc</A></FONT> : <A HREF="terminal_interface-curses-menus__ads.htm#ref_561_9">Menu_Hook_Function</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
@@ -818,8 +818,8 @@
       <b>end</b> <b>if</b>;
    <b>end</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_565_14">Set_Item_Init_Hook</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_816_14" HREF="terminal_interface-curses-menus__ads.htm#ref_571_14">Set_Item_Term_Hook</A></FONT> (<FONT COLOR=red><A NAME="ref_816_34" HREF="terminal_interface-curses-menus__ads.htm#ref_571_34">Men</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
-                                 <FONT COLOR=red><A NAME="ref_817_34" HREF="terminal_interface-curses-menus__ads.htm#ref_572_34">Proc</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_561_9">Menu_Hook_Function</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_816_14" HREF="terminal_interface-curses-menus__ads.htm#ref_571_14">Set_Item_Term_Hook</A></FONT> (<FONT COLOR=red><A NAME="ref_816_34" HREF="terminal_interface-curses-menus__ads.htm#ref_571_34">Men</A></FONT>  : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
+                                 <FONT COLOR=red><A NAME="ref_817_34" HREF="terminal_interface-curses-menus__ads.htm#ref_572_34">Proc</A></FONT> : <A HREF="terminal_interface-curses-menus__ads.htm#ref_561_9">Menu_Hook_Function</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_819_16">Set_Item_Term</A></FONT> (<FONT COLOR=red><A NAME="ref_819_31" HREF="terminal_interface-curses-menus__adb.htm#ref_819_16">Men</A></FONT>  : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
                               <FONT COLOR=red><A NAME="ref_820_31" HREF="terminal_interface-curses-menus__adb.htm#ref_819_16">Proc</A></FONT> : <A HREF="terminal_interface-curses-menus__ads.htm#ref_561_9">Menu_Hook_Function</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
@@ -832,8 +832,8 @@
       <b>end</b> <b>if</b>;
    <b>end</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_571_14">Set_Item_Term_Hook</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_830_14" HREF="terminal_interface-curses-menus__ads.htm#ref_577_14">Set_Menu_Init_Hook</A></FONT> (<FONT COLOR=red><A NAME="ref_830_34" HREF="terminal_interface-curses-menus__ads.htm#ref_577_34">Men</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
-                                 <FONT COLOR=red><A NAME="ref_831_34" HREF="terminal_interface-curses-menus__ads.htm#ref_578_34">Proc</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_561_9">Menu_Hook_Function</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_830_14" HREF="terminal_interface-curses-menus__ads.htm#ref_577_14">Set_Menu_Init_Hook</A></FONT> (<FONT COLOR=red><A NAME="ref_830_34" HREF="terminal_interface-curses-menus__ads.htm#ref_577_34">Men</A></FONT>  : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
+                                 <FONT COLOR=red><A NAME="ref_831_34" HREF="terminal_interface-curses-menus__ads.htm#ref_578_34">Proc</A></FONT> : <A HREF="terminal_interface-curses-menus__ads.htm#ref_561_9">Menu_Hook_Function</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_833_16">Set_Menu_Init</A></FONT> (<FONT COLOR=red><A NAME="ref_833_31" HREF="terminal_interface-curses-menus__adb.htm#ref_833_16">Men</A></FONT>  : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
                               <FONT COLOR=red><A NAME="ref_834_31" HREF="terminal_interface-curses-menus__adb.htm#ref_833_16">Proc</A></FONT> : <A HREF="terminal_interface-curses-menus__ads.htm#ref_561_9">Menu_Hook_Function</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
@@ -846,8 +846,8 @@
       <b>end</b> <b>if</b>;
    <b>end</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_577_14">Set_Menu_Init_Hook</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_844_14" HREF="terminal_interface-curses-menus__ads.htm#ref_583_14">Set_Menu_Term_Hook</A></FONT> (<FONT COLOR=red><A NAME="ref_844_34" HREF="terminal_interface-curses-menus__ads.htm#ref_583_34">Men</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
-                                 <FONT COLOR=red><A NAME="ref_845_34" HREF="terminal_interface-curses-menus__ads.htm#ref_584_34">Proc</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_561_9">Menu_Hook_Function</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_844_14" HREF="terminal_interface-curses-menus__ads.htm#ref_583_14">Set_Menu_Term_Hook</A></FONT> (<FONT COLOR=red><A NAME="ref_844_34" HREF="terminal_interface-curses-menus__ads.htm#ref_583_34">Men</A></FONT>  : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
+                                 <FONT COLOR=red><A NAME="ref_845_34" HREF="terminal_interface-curses-menus__ads.htm#ref_584_34">Proc</A></FONT> : <A HREF="terminal_interface-curses-menus__ads.htm#ref_561_9">Menu_Hook_Function</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_847_16">Set_Menu_Term</A></FONT> (<FONT COLOR=red><A NAME="ref_847_31" HREF="terminal_interface-curses-menus__adb.htm#ref_847_16">Men</A></FONT>  : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
                               <FONT COLOR=red><A NAME="ref_848_31" HREF="terminal_interface-curses-menus__adb.htm#ref_847_16">Proc</A></FONT> : <A HREF="terminal_interface-curses-menus__ads.htm#ref_561_9">Menu_Hook_Function</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
@@ -892,8 +892,8 @@
       <b>return</b> <A HREF="terminal_interface-curses-menus__adb.htm#ref_884_16">Menu_Term</A> (<A HREF="terminal_interface-curses-menus__ads.htm#ref_604_33">Men</A>);
    <b>end</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_604_13">Get_Menu_Term_Hook</A>;
 <FONT COLOR=green><EM>-------------------------------------------------------------------------------</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_890_14" HREF="terminal_interface-curses-menus__ads.htm#ref_613_14">Redefine</A></FONT> (<FONT COLOR=red><A NAME="ref_890_24" HREF="terminal_interface-curses-menus__ads.htm#ref_613_24">Men</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
-                       <FONT COLOR=red><A NAME="ref_891_24" HREF="terminal_interface-curses-menus__ads.htm#ref_614_24">Items</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_178_9">Item_Array_Access</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_890_14" HREF="terminal_interface-curses-menus__ads.htm#ref_613_14">Redefine</A></FONT> (<FONT COLOR=red><A NAME="ref_890_24" HREF="terminal_interface-curses-menus__ads.htm#ref_613_24">Men</A></FONT>   : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
+                       <FONT COLOR=red><A NAME="ref_891_24" HREF="terminal_interface-curses-menus__ads.htm#ref_614_24">Items</A></FONT> : <A HREF="terminal_interface-curses-menus__ads.htm#ref_178_9">Item_Array_Access</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_893_16">Set_Items</A></FONT> (<FONT COLOR=red><A NAME="ref_893_27" HREF="terminal_interface-curses-menus__adb.htm#ref_893_16">Men</A></FONT>   : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
                           <FONT COLOR=red><A NAME="ref_894_27" HREF="terminal_interface-curses-menus__adb.htm#ref_893_16">Items</A></FONT> : System.Address) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
@@ -995,7 +995,7 @@
    <b>end</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_660_13">Driver</A>;
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_992_14" HREF="terminal_interface-curses-menus__ads.htm#ref_180_14">Free</A></FONT> (<FONT COLOR=red><A NAME="ref_992_20" HREF="terminal_interface-curses-menus__ads.htm#ref_180_20">IA</A></FONT>         : <b>in</b> <b>out</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_178_9">Item_Array_Access</A>;
-                   <FONT COLOR=red><A NAME="ref_993_20" HREF="terminal_interface-curses-menus__ads.htm#ref_181_20">Free_Items</A></FONT> : <b>in</b> Boolean := False)
+                   <FONT COLOR=red><A NAME="ref_993_20" HREF="terminal_interface-curses-menus__ads.htm#ref_181_20">Free_Items</A></FONT> : Boolean := False)
    <b>is</b>
       <b>procedure</b> Release <b>is</b> <b>new</b> Ada.Unchecked_Deallocation
         (Item_Array, <A HREF="terminal_interface-curses-menus__ads.htm#ref_178_9">Item_Array_Access</A>);
diff -Naur ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-menus__ads.htm ncurses-5.7/doc/html/ada/terminal_interface-curses-menus__ads.htm
--- ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-menus__ads.htm	2008-10-11 17:36:31.000000000 -0400
+++ ncurses-5.7/doc/html/ada/terminal_interface-curses-menus__ads.htm	2011-01-08 18:13:50.371157247 -0500
@@ -12,7 +12,7 @@
 <FONT COLOR=green><EM>--                                 S P E C                                  --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-<FONT COLOR=green><EM>-- Copyright (c) 1998,2006 Free Software Foundation, Inc.                   --</EM></FONT>
+<FONT COLOR=green><EM>-- Copyright (c) 1998-2007,2009 Free Software Foundation, Inc.              --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>-- Permission is hereby granted, free of charge, to any person obtaining a  --</EM></FONT>
 <FONT COLOR=green><EM>-- copy of this software and associated documentation files (the            --</EM></FONT>
@@ -40,8 +40,8 @@
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <FONT COLOR=green><EM>--  Author:  Juergen Pfeifer, 1996</EM></FONT>
 <FONT COLOR=green><EM>--  Version Control:</EM></FONT>
-<FONT COLOR=green><EM>--  @Revision: 1.27 @</EM></FONT>
-<FONT COLOR=green><EM>--  @Date: 2007/05/05 20:20:52 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Revision: 1.28 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Date: 2009/12/26 18:35:22 @</EM></FONT>
 <FONT COLOR=green><EM>--  Binding Version 01.00</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <FONT COLOR=green><EM>--  menu binding.</EM></FONT>
@@ -53,8 +53,8 @@
 
 <b>package</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<FONT COLOR=red><A NAME="ref_49_35" HREF="terminal_interface-curses-menus__adb.htm#ref_51_40">Menus</A></FONT> <b>is</b>
    <b>pragma</b> Preelaborate (<A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-menus__ads.htm#ref_49_35">Menus</A>);
-   <b>pragma</b> Linker_Options ("-lmenuw");
-   <b>pragma</b> Linker_Options ("-lncursesw");
+   <b>pragma</b> Linker_Options ("-lmenu");
+   <b>pragma</b> Linker_Options ("-lncurses");
 
    Space : Character <b>renames</b> Ada.Characters.Latin_1.Space;
 
@@ -108,7 +108,7 @@
    REQ_NEXT_MATCH    : <A HREF="terminal_interface-curses-menus__ads.htm#ref_65_12">Menu_Request_Code</A> <b>renames</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_84_4">M_Next_Match</A>;
    REQ_PREV_MATCH    : <A HREF="terminal_interface-curses-menus__ads.htm#ref_65_12">Menu_Request_Code</A> <b>renames</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_85_4">M_Previous_Match</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_106_14" HREF="terminal_interface-curses-menus__adb.htm#ref_77_14">Request_Name</A></FONT> (<FONT COLOR=red><A NAME="ref_106_28" HREF="terminal_interface-curses-menus__adb.htm#ref_77_28">Key</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_65_12">Menu_Request_Code</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_106_14" HREF="terminal_interface-curses-menus__adb.htm#ref_77_14">Request_Name</A></FONT> (<FONT COLOR=red><A NAME="ref_106_28" HREF="terminal_interface-curses-menus__adb.htm#ref_77_28">Key</A></FONT>  : <A HREF="terminal_interface-curses-menus__ads.htm#ref_65_12">Menu_Request_Code</A>;
                            <FONT COLOR=red><A NAME="ref_107_28" HREF="terminal_interface-curses-menus__adb.htm#ref_78_28">Name</A></FONT> : <b>out</b> String);
 
    <b>function</b>  <FONT COLOR=red><A NAME="ref_109_14" HREF="terminal_interface-curses-menus__adb.htm#ref_86_13">Request_Name</A></FONT> (<FONT COLOR=red><A NAME="ref_109_28" HREF="terminal_interface-curses-menus__adb.htm#ref_86_27">Key</A></FONT> : <A HREF="terminal_interface-curses-menus__ads.htm#ref_65_12">Menu_Request_Code</A>) <b>return</b> String;
@@ -214,8 +214,8 @@
    <FONT COLOR=green><EM>--  |=====================================================================</EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_4"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_212_14" HREF="terminal_interface-curses-menus__adb.htm#ref_152_14">Set_Value</A></FONT> (<FONT COLOR=red><A NAME="ref_212_25" HREF="terminal_interface-curses-menus__adb.htm#ref_152_25">Itm</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_56_9">Item</A>;
-                        <FONT COLOR=red><A NAME="ref_213_25" HREF="terminal_interface-curses-menus__adb.htm#ref_153_25">Value</A></FONT> : <b>in</b> Boolean := True);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_212_14" HREF="terminal_interface-curses-menus__adb.htm#ref_152_14">Set_Value</A></FONT> (<FONT COLOR=red><A NAME="ref_212_25" HREF="terminal_interface-curses-menus__adb.htm#ref_152_25">Itm</A></FONT>   : <A HREF="terminal_interface-curses-menus__ads.htm#ref_56_9">Item</A>;
+                        <FONT COLOR=red><A NAME="ref_213_25" HREF="terminal_interface-curses-menus__adb.htm#ref_153_25">Value</A></FONT> : Boolean := True);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/mitem_value.3x.html">set_item_value()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses-menus__ads.htm#ref_212_14">Set_Value</A>);
 
@@ -238,14 +238,14 @@
    <FONT COLOR=green><EM>--  |=====================================================================</EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_7"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_236_14" HREF="terminal_interface-curses-menus__adb.htm#ref_191_14">Set_Options</A></FONT> (<FONT COLOR=red><A NAME="ref_236_27" HREF="terminal_interface-curses-menus__adb.htm#ref_191_27">Itm</A></FONT>     : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_56_9">Item</A>;
-                          <FONT COLOR=red><A NAME="ref_237_27" HREF="terminal_interface-curses-menus__adb.htm#ref_192_27">Options</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_153_9">Item_Option_Set</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_236_14" HREF="terminal_interface-curses-menus__adb.htm#ref_191_14">Set_Options</A></FONT> (<FONT COLOR=red><A NAME="ref_236_27" HREF="terminal_interface-curses-menus__adb.htm#ref_191_27">Itm</A></FONT>     : <A HREF="terminal_interface-curses-menus__ads.htm#ref_56_9">Item</A>;
+                          <FONT COLOR=red><A NAME="ref_237_27" HREF="terminal_interface-curses-menus__adb.htm#ref_192_27">Options</A></FONT> : <A HREF="terminal_interface-curses-menus__ads.htm#ref_153_9">Item_Option_Set</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/mitem_opts.3x.html">set_item_opts()</A></EM></FONT>
    <FONT COLOR=green><EM>--  An overloaded Set_Options is defined later. Pragma Inline appears there</EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_8"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_242_14" HREF="terminal_interface-curses-menus__adb.htm#ref_207_14">Switch_Options</A></FONT> (<FONT COLOR=red><A NAME="ref_242_30" HREF="terminal_interface-curses-menus__adb.htm#ref_207_30">Itm</A></FONT>     : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_56_9">Item</A>;
-                             <FONT COLOR=red><A NAME="ref_243_30" HREF="terminal_interface-curses-menus__adb.htm#ref_208_30">Options</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_153_9">Item_Option_Set</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_242_14" HREF="terminal_interface-curses-menus__adb.htm#ref_207_14">Switch_Options</A></FONT> (<FONT COLOR=red><A NAME="ref_242_30" HREF="terminal_interface-curses-menus__adb.htm#ref_207_30">Itm</A></FONT>     : <A HREF="terminal_interface-curses-menus__ads.htm#ref_56_9">Item</A>;
+                             <FONT COLOR=red><A NAME="ref_243_30" HREF="terminal_interface-curses-menus__adb.htm#ref_208_30">Options</A></FONT> : <A HREF="terminal_interface-curses-menus__ads.htm#ref_153_9">Item_Option_Set</A>;
                              <FONT COLOR=red><A NAME="ref_244_30" HREF="terminal_interface-curses-menus__adb.htm#ref_209_30">On</A></FONT>      : Boolean := True);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/mitem_opts.3x.html">item_opts_on()</A></EM></FONT>
    <FONT COLOR=green><EM>--  AKA: item_opts_off()</EM></FONT>
@@ -253,7 +253,7 @@
    <FONT COLOR=green><EM>--  Pragma Inline appears there</EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_9"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_251_14" HREF="terminal_interface-curses-menus__adb.htm#ref_231_14">Get_Options</A></FONT> (<FONT COLOR=red><A NAME="ref_251_27" HREF="terminal_interface-curses-menus__adb.htm#ref_231_27">Itm</A></FONT>     : <b>in</b>  <A HREF="terminal_interface-curses-menus__ads.htm#ref_56_9">Item</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_251_14" HREF="terminal_interface-curses-menus__adb.htm#ref_231_14">Get_Options</A></FONT> (<FONT COLOR=red><A NAME="ref_251_27" HREF="terminal_interface-curses-menus__adb.htm#ref_231_27">Itm</A></FONT>     : <A HREF="terminal_interface-curses-menus__ads.htm#ref_56_9">Item</A>;
                           <FONT COLOR=red><A NAME="ref_252_27" HREF="terminal_interface-curses-menus__adb.htm#ref_232_27">Options</A></FONT> : <b>out</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_153_9">Item_Option_Set</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/mitem_opts.3x.html">item_opts()</A></EM></FONT>
 
@@ -267,7 +267,7 @@
    <FONT COLOR=green><EM>--  |=====================================================================</EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_11"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_265_14" HREF="terminal_interface-curses-menus__adb.htm#ref_250_14">Name</A></FONT> (<FONT COLOR=red><A NAME="ref_265_20" HREF="terminal_interface-curses-menus__adb.htm#ref_250_20">Itm</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_56_9">Item</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_265_14" HREF="terminal_interface-curses-menus__adb.htm#ref_250_14">Name</A></FONT> (<FONT COLOR=red><A NAME="ref_265_20" HREF="terminal_interface-curses-menus__adb.htm#ref_250_20">Itm</A></FONT>  : <A HREF="terminal_interface-curses-menus__ads.htm#ref_56_9">Item</A>;
                    <FONT COLOR=red><A NAME="ref_266_20" HREF="terminal_interface-curses-menus__adb.htm#ref_251_20">Name</A></FONT> : <b>out</b> String);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/mitem_name.3x.html">item_name()</A></EM></FONT>
    <b>function</b>  <FONT COLOR=red><A NAME="ref_268_14" HREF="terminal_interface-curses-menus__adb.htm#ref_259_13">Name</A></FONT> (<FONT COLOR=red><A NAME="ref_268_20" HREF="terminal_interface-curses-menus__adb.htm#ref_259_19">Itm</A></FONT> : <A HREF="terminal_interface-curses-menus__ads.htm#ref_56_9">Item</A>) <b>return</b> String;
@@ -276,7 +276,7 @@
    <b>pragma</b> Inline (Name);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_12"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_274_14" HREF="terminal_interface-curses-menus__adb.htm#ref_267_14">Description</A></FONT> (<FONT COLOR=red><A NAME="ref_274_27" HREF="terminal_interface-curses-menus__adb.htm#ref_267_27">Itm</A></FONT>         : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_56_9">Item</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_274_14" HREF="terminal_interface-curses-menus__adb.htm#ref_267_14">Description</A></FONT> (<FONT COLOR=red><A NAME="ref_274_27" HREF="terminal_interface-curses-menus__adb.htm#ref_267_27">Itm</A></FONT>         : <A HREF="terminal_interface-curses-menus__ads.htm#ref_56_9">Item</A>;
                           <FONT COLOR=red><A NAME="ref_275_27" HREF="terminal_interface-curses-menus__adb.htm#ref_268_27">Description</A></FONT> : <b>out</b> String);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/mitem_name.3x.html">item_description();</A></EM></FONT>
 
@@ -290,8 +290,8 @@
    <FONT COLOR=green><EM>--  |=====================================================================</EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_13"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_288_14" HREF="terminal_interface-curses-menus__adb.htm#ref_284_14">Set_Current</A></FONT> (<FONT COLOR=red><A NAME="ref_288_27" HREF="terminal_interface-curses-menus__adb.htm#ref_284_27">Men</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
-                          <FONT COLOR=red><A NAME="ref_289_27" HREF="terminal_interface-curses-menus__adb.htm#ref_285_27">Itm</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_56_9">Item</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_288_14" HREF="terminal_interface-curses-menus__adb.htm#ref_284_14">Set_Current</A></FONT> (<FONT COLOR=red><A NAME="ref_288_27" HREF="terminal_interface-curses-menus__adb.htm#ref_284_27">Men</A></FONT> : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
+                          <FONT COLOR=red><A NAME="ref_289_27" HREF="terminal_interface-curses-menus__adb.htm#ref_285_27">Itm</A></FONT> : <A HREF="terminal_interface-curses-menus__ads.htm#ref_56_9">Item</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/mitem_current.3x.html">set_current_item()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses-menus__ads.htm#ref_288_14">Set_Current</A>);
 
@@ -301,8 +301,8 @@
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses-menus__ads.htm#ref_294_13">Current</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_15"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_299_14" HREF="terminal_interface-curses-menus__adb.htm#ref_311_14">Set_Top_Row</A></FONT> (<FONT COLOR=red><A NAME="ref_299_27" HREF="terminal_interface-curses-menus__adb.htm#ref_311_27">Men</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
-                          <FONT COLOR=red><A NAME="ref_300_27" HREF="terminal_interface-curses-menus__adb.htm#ref_312_27">Line</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_299_14" HREF="terminal_interface-curses-menus__adb.htm#ref_311_14">Set_Top_Row</A></FONT> (<FONT COLOR=red><A NAME="ref_299_27" HREF="terminal_interface-curses-menus__adb.htm#ref_311_27">Men</A></FONT>  : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
+                          <FONT COLOR=red><A NAME="ref_300_27" HREF="terminal_interface-curses-menus__adb.htm#ref_312_27">Line</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/mitem_current.3x.html">set_top_row()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses-menus__ads.htm#ref_299_14">Set_Top_Row</A>);
 
@@ -324,8 +324,8 @@
    <FONT COLOR=green><EM>--  |=====================================================================</EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_18"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_322_14" HREF="terminal_interface-curses-menus__adb.htm#ref_351_14">Post</A></FONT> (<FONT COLOR=red><A NAME="ref_322_20" HREF="terminal_interface-curses-menus__adb.htm#ref_351_20">Men</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
-                   <FONT COLOR=red><A NAME="ref_323_20" HREF="terminal_interface-curses-menus__adb.htm#ref_352_20">Post</A></FONT> : <b>in</b> Boolean := True);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_322_14" HREF="terminal_interface-curses-menus__adb.htm#ref_351_14">Post</A></FONT> (<FONT COLOR=red><A NAME="ref_322_20" HREF="terminal_interface-curses-menus__adb.htm#ref_351_20">Men</A></FONT>  : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
+                   <FONT COLOR=red><A NAME="ref_323_20" HREF="terminal_interface-curses-menus__adb.htm#ref_352_20">Post</A></FONT> : Boolean := True);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/menu_post.3x.html">post_menu()</A></EM></FONT>
    <FONT COLOR=green><EM>--  AKA: unpost_menu()</EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses-menus__ads.htm#ref_322_14">Post</A>);
@@ -335,22 +335,22 @@
    <FONT COLOR=green><EM>--  |=====================================================================</EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_19"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_333_14" HREF="terminal_interface-curses-menus__adb.htm#ref_371_14">Set_Options</A></FONT> (<FONT COLOR=red><A NAME="ref_333_27" HREF="terminal_interface-curses-menus__adb.htm#ref_371_27">Men</A></FONT>     : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
-                          <FONT COLOR=red><A NAME="ref_334_27" HREF="terminal_interface-curses-menus__adb.htm#ref_372_27">Options</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_121_9">Menu_Option_Set</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_333_14" HREF="terminal_interface-curses-menus__adb.htm#ref_371_14">Set_Options</A></FONT> (<FONT COLOR=red><A NAME="ref_333_27" HREF="terminal_interface-curses-menus__adb.htm#ref_371_27">Men</A></FONT>     : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
+                          <FONT COLOR=red><A NAME="ref_334_27" HREF="terminal_interface-curses-menus__adb.htm#ref_372_27">Options</A></FONT> : <A HREF="terminal_interface-curses-menus__ads.htm#ref_121_9">Menu_Option_Set</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/menu_opts.3x.html">set_menu_opts()</A></EM></FONT>
    <b>pragma</b> Inline (Set_Options);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_20"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_339_14" HREF="terminal_interface-curses-menus__adb.htm#ref_387_14">Switch_Options</A></FONT> (<FONT COLOR=red><A NAME="ref_339_30" HREF="terminal_interface-curses-menus__adb.htm#ref_387_30">Men</A></FONT>     : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
-                             <FONT COLOR=red><A NAME="ref_340_30" HREF="terminal_interface-curses-menus__adb.htm#ref_388_30">Options</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_121_9">Menu_Option_Set</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_339_14" HREF="terminal_interface-curses-menus__adb.htm#ref_387_14">Switch_Options</A></FONT> (<FONT COLOR=red><A NAME="ref_339_30" HREF="terminal_interface-curses-menus__adb.htm#ref_387_30">Men</A></FONT>     : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
+                             <FONT COLOR=red><A NAME="ref_340_30" HREF="terminal_interface-curses-menus__adb.htm#ref_388_30">Options</A></FONT> : <A HREF="terminal_interface-curses-menus__ads.htm#ref_121_9">Menu_Option_Set</A>;
                              <FONT COLOR=red><A NAME="ref_341_30" HREF="terminal_interface-curses-menus__adb.htm#ref_389_30">On</A></FONT>      : Boolean := True);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/menu_opts.3x.html">menu_opts_on()</A></EM></FONT>
    <FONT COLOR=green><EM>--  AKA: menu_opts_off()</EM></FONT>
    <b>pragma</b> Inline (Switch_Options);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_21"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_347_14" HREF="terminal_interface-curses-menus__adb.htm#ref_411_14">Get_Options</A></FONT> (<FONT COLOR=red><A NAME="ref_347_27" HREF="terminal_interface-curses-menus__adb.htm#ref_411_27">Men</A></FONT>     : <b>in</b>  <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
-                          <FONT COLOR=red><A NAME="ref_348_27" HREF="terminal_interface-curses-menus__adb.htm#ref_412_32">Options</A></FONT> : <b>out</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_121_9">Menu_Option_Set</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_347_14" HREF="terminal_interface-curses-menus__adb.htm#ref_411_14">Get_Options</A></FONT> (<FONT COLOR=red><A NAME="ref_347_27" HREF="terminal_interface-curses-menus__adb.htm#ref_411_27">Men</A></FONT>     : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
+                          <FONT COLOR=red><A NAME="ref_348_27" HREF="terminal_interface-curses-menus__adb.htm#ref_412_27">Options</A></FONT> : <b>out</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_121_9">Menu_Option_Set</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/menu_opts.3x.html">menu_opts()</A></EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_22"#2|</EM></FONT>
@@ -363,8 +363,8 @@
    <FONT COLOR=green><EM>--  |=====================================================================</EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_23"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_361_14" HREF="terminal_interface-curses-menus__adb.htm#ref_430_14">Set_Window</A></FONT> (<FONT COLOR=red><A NAME="ref_361_26" HREF="terminal_interface-curses-menus__adb.htm#ref_430_26">Men</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
-                         <FONT COLOR=red><A NAME="ref_362_26" HREF="terminal_interface-curses-menus__adb.htm#ref_431_26">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_361_14" HREF="terminal_interface-curses-menus__adb.htm#ref_430_14">Set_Window</A></FONT> (<FONT COLOR=red><A NAME="ref_361_26" HREF="terminal_interface-curses-menus__adb.htm#ref_430_26">Men</A></FONT> : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
+                         <FONT COLOR=red><A NAME="ref_362_26" HREF="terminal_interface-curses-menus__adb.htm#ref_431_26">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/menu_win.3x.html">set_menu_win()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses-menus__ads.htm#ref_361_14">Set_Window</A>);
 
@@ -374,8 +374,8 @@
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses-menus__ads.htm#ref_367_13">Get_Window</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_25"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_372_14" HREF="terminal_interface-curses-menus__adb.htm#ref_454_14">Set_Sub_Window</A></FONT> (<FONT COLOR=red><A NAME="ref_372_30" HREF="terminal_interface-curses-menus__adb.htm#ref_454_30">Men</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
-                             <FONT COLOR=red><A NAME="ref_373_30" HREF="terminal_interface-curses-menus__adb.htm#ref_455_30">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_372_14" HREF="terminal_interface-curses-menus__adb.htm#ref_454_14">Set_Sub_Window</A></FONT> (<FONT COLOR=red><A NAME="ref_372_30" HREF="terminal_interface-curses-menus__adb.htm#ref_454_30">Men</A></FONT> : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
+                             <FONT COLOR=red><A NAME="ref_373_30" HREF="terminal_interface-curses-menus__adb.htm#ref_455_30">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/menu_win.3x.html">set_menu_sub()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses-menus__ads.htm#ref_372_14">Set_Sub_Window</A>);
 
@@ -385,7 +385,7 @@
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses-menus__ads.htm#ref_378_13">Get_Sub_Window</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_27"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_383_14" HREF="terminal_interface-curses-menus__adb.htm#ref_478_14">Scale</A></FONT> (<FONT COLOR=red><A NAME="ref_383_21" HREF="terminal_interface-curses-menus__adb.htm#ref_478_21">Men</A></FONT>     : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_383_14" HREF="terminal_interface-curses-menus__adb.htm#ref_478_14">Scale</A></FONT> (<FONT COLOR=red><A NAME="ref_383_21" HREF="terminal_interface-curses-menus__adb.htm#ref_478_21">Men</A></FONT>     : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
                     <FONT COLOR=red><A NAME="ref_384_21" HREF="terminal_interface-curses-menus__adb.htm#ref_479_21">Lines</A></FONT>   : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_63_12">Line_Count</A>;
                     <FONT COLOR=red><A NAME="ref_385_21" HREF="terminal_interface-curses-menus__adb.htm#ref_480_21">Columns</A></FONT> : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_65_12">Column_Count</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/menu_win.3x.html">scale_menu()</A></EM></FONT>
@@ -405,13 +405,13 @@
    <FONT COLOR=green><EM>--  |=====================================================================</EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_29"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_403_14" HREF="terminal_interface-curses-menus__adb.htm#ref_510_14">Set_Mark</A></FONT> (<FONT COLOR=red><A NAME="ref_403_24" HREF="terminal_interface-curses-menus__adb.htm#ref_510_24">Men</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
-                       <FONT COLOR=red><A NAME="ref_404_24" HREF="terminal_interface-curses-menus__adb.htm#ref_511_24">Mark</A></FONT> : <b>in</b> String);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_403_14" HREF="terminal_interface-curses-menus__adb.htm#ref_510_14">Set_Mark</A></FONT> (<FONT COLOR=red><A NAME="ref_403_24" HREF="terminal_interface-curses-menus__adb.htm#ref_510_24">Men</A></FONT>  : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
+                       <FONT COLOR=red><A NAME="ref_404_24" HREF="terminal_interface-curses-menus__adb.htm#ref_511_24">Mark</A></FONT> : String);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/menu_mark.3x.html">set_menu_mark()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses-menus__ads.htm#ref_403_14">Set_Mark</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_30"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_409_14" HREF="terminal_interface-curses-menus__adb.htm#ref_529_14">Mark</A></FONT> (<FONT COLOR=red><A NAME="ref_409_20" HREF="terminal_interface-curses-menus__adb.htm#ref_529_20">Men</A></FONT>  : <b>in</b>  <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_409_14" HREF="terminal_interface-curses-menus__adb.htm#ref_529_14">Mark</A></FONT> (<FONT COLOR=red><A NAME="ref_409_20" HREF="terminal_interface-curses-menus__adb.htm#ref_529_20">Men</A></FONT>  : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
                    <FONT COLOR=red><A NAME="ref_410_20" HREF="terminal_interface-curses-menus__adb.htm#ref_530_20">Mark</A></FONT> : <b>out</b> String);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/menu_mark.3x.html">menu_mark()</A></EM></FONT>
 
@@ -426,19 +426,19 @@
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_31"#2|</EM></FONT>
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_423_14" HREF="terminal_interface-curses-menus__adb.htm#ref_547_14">Set_Foreground</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_424_7" HREF="terminal_interface-curses-menus__adb.htm#ref_548_7">Men</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
-      <FONT COLOR=red><A NAME="ref_425_7" HREF="terminal_interface-curses-menus__adb.htm#ref_549_7">Fore</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_307_9">Character_Attribute_Set</A> := <A HREF="terminal_interface-curses__ads.htm#ref_350_4">Normal_Video</A>;
-      <FONT COLOR=red><A NAME="ref_426_7" HREF="terminal_interface-curses-menus__adb.htm#ref_550_7">Color</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A> := <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A>'First);
+     (<FONT COLOR=red><A NAME="ref_424_7" HREF="terminal_interface-curses-menus__adb.htm#ref_548_7">Men</A></FONT>   : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
+      <FONT COLOR=red><A NAME="ref_425_7" HREF="terminal_interface-curses-menus__adb.htm#ref_549_7">Fore</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_307_9">Character_Attribute_Set</A> := <A HREF="terminal_interface-curses__ads.htm#ref_350_4">Normal_Video</A>;
+      <FONT COLOR=red><A NAME="ref_426_7" HREF="terminal_interface-curses-menus__adb.htm#ref_550_7">Color</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A> := <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A>'First);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/menu_attributes.3x.html">set_menu_fore()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses-menus__ads.htm#ref_423_14">Set_Foreground</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_32"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_431_14" HREF="terminal_interface-curses-menus__adb.htm#ref_566_14">Foreground</A></FONT> (<FONT COLOR=red><A NAME="ref_431_26" HREF="terminal_interface-curses-menus__adb.htm#ref_566_26">Men</A></FONT>   : <b>in</b>  <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_431_14" HREF="terminal_interface-curses-menus__adb.htm#ref_566_14">Foreground</A></FONT> (<FONT COLOR=red><A NAME="ref_431_26" HREF="terminal_interface-curses-menus__adb.htm#ref_566_26">Men</A></FONT>   : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
                          <FONT COLOR=red><A NAME="ref_432_26" HREF="terminal_interface-curses-menus__adb.htm#ref_567_26">Fore</A></FONT>  : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_307_9">Character_Attribute_Set</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/menu_attributes.3x.html">menu_fore()</A></EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_33"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_436_14" HREF="terminal_interface-curses-menus__adb.htm#ref_575_14">Foreground</A></FONT> (<FONT COLOR=red><A NAME="ref_436_26" HREF="terminal_interface-curses-menus__adb.htm#ref_575_26">Men</A></FONT>   : <b>in</b>  <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_436_14" HREF="terminal_interface-curses-menus__adb.htm#ref_575_14">Foreground</A></FONT> (<FONT COLOR=red><A NAME="ref_436_26" HREF="terminal_interface-curses-menus__adb.htm#ref_575_26">Men</A></FONT>   : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
                          <FONT COLOR=red><A NAME="ref_437_26" HREF="terminal_interface-curses-menus__adb.htm#ref_576_26">Fore</A></FONT>  : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_307_9">Character_Attribute_Set</A>;
                          <FONT COLOR=red><A NAME="ref_438_26" HREF="terminal_interface-curses-menus__adb.htm#ref_577_26">Color</A></FONT> : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/menu_attributes.3x.html">menu_fore()</A></EM></FONT>
@@ -446,19 +446,19 @@
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_34"#2|</EM></FONT>
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_443_14" HREF="terminal_interface-curses-menus__adb.htm#ref_586_14">Set_Background</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_444_7" HREF="terminal_interface-curses-menus__adb.htm#ref_587_7">Men</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
-      <FONT COLOR=red><A NAME="ref_445_7" HREF="terminal_interface-curses-menus__adb.htm#ref_588_7">Back</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_307_9">Character_Attribute_Set</A> := <A HREF="terminal_interface-curses__ads.htm#ref_350_4">Normal_Video</A>;
-      <FONT COLOR=red><A NAME="ref_446_7" HREF="terminal_interface-curses-menus__adb.htm#ref_589_7">Color</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A> := <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A>'First);
+     (<FONT COLOR=red><A NAME="ref_444_7" HREF="terminal_interface-curses-menus__adb.htm#ref_587_7">Men</A></FONT>   : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
+      <FONT COLOR=red><A NAME="ref_445_7" HREF="terminal_interface-curses-menus__adb.htm#ref_588_7">Back</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_307_9">Character_Attribute_Set</A> := <A HREF="terminal_interface-curses__ads.htm#ref_350_4">Normal_Video</A>;
+      <FONT COLOR=red><A NAME="ref_446_7" HREF="terminal_interface-curses-menus__adb.htm#ref_589_7">Color</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A> := <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A>'First);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/menu_attributes.3x.html">set_menu_back()</A></EM></FONT>
    <b>pragma</b> Inline (Set_Background);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_35"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_451_14" HREF="terminal_interface-curses-menus__adb.htm#ref_605_14">Background</A></FONT> (<FONT COLOR=red><A NAME="ref_451_26" HREF="terminal_interface-curses-menus__adb.htm#ref_605_26">Men</A></FONT>  : <b>in</b>  <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_451_14" HREF="terminal_interface-curses-menus__adb.htm#ref_605_14">Background</A></FONT> (<FONT COLOR=red><A NAME="ref_451_26" HREF="terminal_interface-curses-menus__adb.htm#ref_605_26">Men</A></FONT>  : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
                          <FONT COLOR=red><A NAME="ref_452_26" HREF="terminal_interface-curses-menus__adb.htm#ref_606_26">Back</A></FONT> : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_307_9">Character_Attribute_Set</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/menu_attributes.3x.html">menu_back()</A></EM></FONT>
    <FONT COLOR=green><EM>--  #1A NAME="AFU_36"#2|</EM></FONT>
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_456_14" HREF="terminal_interface-curses-menus__adb.htm#ref_614_14">Background</A></FONT> (<FONT COLOR=red><A NAME="ref_456_26" HREF="terminal_interface-curses-menus__adb.htm#ref_614_26">Men</A></FONT>   : <b>in</b>  <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_456_14" HREF="terminal_interface-curses-menus__adb.htm#ref_614_14">Background</A></FONT> (<FONT COLOR=red><A NAME="ref_456_26" HREF="terminal_interface-curses-menus__adb.htm#ref_614_26">Men</A></FONT>   : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
                          <FONT COLOR=red><A NAME="ref_457_26" HREF="terminal_interface-curses-menus__adb.htm#ref_615_26">Back</A></FONT>  : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_307_9">Character_Attribute_Set</A>;
                          <FONT COLOR=red><A NAME="ref_458_26" HREF="terminal_interface-curses-menus__adb.htm#ref_616_26">Color</A></FONT> : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/menu_attributes.3x.html">menu_back()</A></EM></FONT>
@@ -466,33 +466,33 @@
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_37"#2|</EM></FONT>
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_463_14" HREF="terminal_interface-curses-menus__adb.htm#ref_625_14">Set_Grey</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_464_7" HREF="terminal_interface-curses-menus__adb.htm#ref_625_24">Men</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
-      <FONT COLOR=red><A NAME="ref_465_7" HREF="terminal_interface-curses-menus__adb.htm#ref_626_24">Grey</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_307_9">Character_Attribute_Set</A> := <A HREF="terminal_interface-curses__ads.htm#ref_350_4">Normal_Video</A>;
-      <FONT COLOR=red><A NAME="ref_466_7" HREF="terminal_interface-curses-menus__adb.htm#ref_627_24">Color</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A> := <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A>'First);
+     (<FONT COLOR=red><A NAME="ref_464_7" HREF="terminal_interface-curses-menus__adb.htm#ref_625_24">Men</A></FONT>   : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
+      <FONT COLOR=red><A NAME="ref_465_7" HREF="terminal_interface-curses-menus__adb.htm#ref_626_24">Grey</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_307_9">Character_Attribute_Set</A> := <A HREF="terminal_interface-curses__ads.htm#ref_350_4">Normal_Video</A>;
+      <FONT COLOR=red><A NAME="ref_466_7" HREF="terminal_interface-curses-menus__adb.htm#ref_627_24">Color</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A> := <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A>'First);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/menu_attributes.3x.html">set_menu_grey()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses-menus__ads.htm#ref_463_14">Set_Grey</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_38"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_471_14" HREF="terminal_interface-curses-menus__adb.htm#ref_644_14">Grey</A></FONT> (<FONT COLOR=red><A NAME="ref_471_20" HREF="terminal_interface-curses-menus__adb.htm#ref_644_20">Men</A></FONT>  : <b>in</b>  <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_471_14" HREF="terminal_interface-curses-menus__adb.htm#ref_644_14">Grey</A></FONT> (<FONT COLOR=red><A NAME="ref_471_20" HREF="terminal_interface-curses-menus__adb.htm#ref_644_20">Men</A></FONT>  : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
                    <FONT COLOR=red><A NAME="ref_472_20" HREF="terminal_interface-curses-menus__adb.htm#ref_645_20">Grey</A></FONT> : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_307_9">Character_Attribute_Set</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/menu_attributes.3x.html">menu_grey()</A></EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_39"#2|</EM></FONT>
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_476_14" HREF="terminal_interface-curses-menus__adb.htm#ref_653_14">Grey</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_477_7" HREF="terminal_interface-curses-menus__adb.htm#ref_653_20">Men</A></FONT>   : <b>in</b>  <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
+     (<FONT COLOR=red><A NAME="ref_477_7" HREF="terminal_interface-curses-menus__adb.htm#ref_653_20">Men</A></FONT>   : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
       <FONT COLOR=red><A NAME="ref_478_7" HREF="terminal_interface-curses-menus__adb.htm#ref_654_20">Grey</A></FONT>  : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_307_9">Character_Attribute_Set</A>;
       <FONT COLOR=red><A NAME="ref_479_7" HREF="terminal_interface-curses-menus__adb.htm#ref_655_20">Color</A></FONT> : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/menu_attributes.3x.html">menu_grey()</A></EM></FONT>
    <b>pragma</b> Inline (Grey);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_40"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_484_14" HREF="terminal_interface-curses-menus__adb.htm#ref_664_14">Set_Pad_Character</A></FONT> (<FONT COLOR=red><A NAME="ref_484_33" HREF="terminal_interface-curses-menus__adb.htm#ref_664_33">Men</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
-                                <FONT COLOR=red><A NAME="ref_485_33" HREF="terminal_interface-curses-menus__adb.htm#ref_665_33">Pad</A></FONT> : <b>in</b> Character := Space);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_484_14" HREF="terminal_interface-curses-menus__adb.htm#ref_664_14">Set_Pad_Character</A></FONT> (<FONT COLOR=red><A NAME="ref_484_33" HREF="terminal_interface-curses-menus__adb.htm#ref_664_33">Men</A></FONT> : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
+                                <FONT COLOR=red><A NAME="ref_485_33" HREF="terminal_interface-curses-menus__adb.htm#ref_665_33">Pad</A></FONT> : Character := Space);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/menu_attributes.3x.html">set_menu_pad()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses-menus__ads.htm#ref_484_14">Set_Pad_Character</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_41"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_490_14" HREF="terminal_interface-curses-menus__adb.htm#ref_679_14">Pad_Character</A></FONT> (<FONT COLOR=red><A NAME="ref_490_29" HREF="terminal_interface-curses-menus__adb.htm#ref_679_29">Men</A></FONT> : <b>in</b>  <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_490_14" HREF="terminal_interface-curses-menus__adb.htm#ref_679_14">Pad_Character</A></FONT> (<FONT COLOR=red><A NAME="ref_490_29" HREF="terminal_interface-curses-menus__adb.htm#ref_679_29">Men</A></FONT> : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
                             <FONT COLOR=red><A NAME="ref_491_29" HREF="terminal_interface-curses-menus__adb.htm#ref_680_29">Pad</A></FONT> : <b>out</b> Character);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/menu_attributes.3x.html">menu_pad()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses-menus__ads.htm#ref_490_14">Pad_Character</A>);
@@ -502,15 +502,15 @@
    <FONT COLOR=green><EM>--  |=====================================================================</EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_42"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_500_14" HREF="terminal_interface-curses-menus__adb.htm#ref_688_14">Set_Spacing</A></FONT> (<FONT COLOR=red><A NAME="ref_500_27" HREF="terminal_interface-curses-menus__adb.htm#ref_688_27">Men</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
-                          <FONT COLOR=red><A NAME="ref_501_27" HREF="terminal_interface-curses-menus__adb.htm#ref_689_27">Descr</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A> := 0;
-                          <FONT COLOR=red><A NAME="ref_502_27" HREF="terminal_interface-curses-menus__adb.htm#ref_690_27">Row</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>   := 0;
-                          <FONT COLOR=red><A NAME="ref_503_27" HREF="terminal_interface-curses-menus__adb.htm#ref_691_27">Col</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A> := 0);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_500_14" HREF="terminal_interface-curses-menus__adb.htm#ref_688_14">Set_Spacing</A></FONT> (<FONT COLOR=red><A NAME="ref_500_27" HREF="terminal_interface-curses-menus__adb.htm#ref_688_27">Men</A></FONT>   : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
+                          <FONT COLOR=red><A NAME="ref_501_27" HREF="terminal_interface-curses-menus__adb.htm#ref_689_27">Descr</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A> := 0;
+                          <FONT COLOR=red><A NAME="ref_502_27" HREF="terminal_interface-curses-menus__adb.htm#ref_690_27">Row</A></FONT>   : <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>   := 0;
+                          <FONT COLOR=red><A NAME="ref_503_27" HREF="terminal_interface-curses-menus__adb.htm#ref_691_27">Col</A></FONT>   : <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A> := 0);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/menu_spacing.3x.html">set_menu_spacing()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses-menus__ads.htm#ref_500_14">Set_Spacing</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_43"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_508_14" HREF="terminal_interface-curses-menus__adb.htm#ref_707_14">Spacing</A></FONT> (<FONT COLOR=red><A NAME="ref_508_23" HREF="terminal_interface-curses-menus__adb.htm#ref_707_23">Men</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_508_14" HREF="terminal_interface-curses-menus__adb.htm#ref_707_14">Spacing</A></FONT> (<FONT COLOR=red><A NAME="ref_508_23" HREF="terminal_interface-curses-menus__adb.htm#ref_707_23">Men</A></FONT>   : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
                       <FONT COLOR=red><A NAME="ref_509_23" HREF="terminal_interface-curses-menus__adb.htm#ref_708_23">Descr</A></FONT> : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
                       <FONT COLOR=red><A NAME="ref_510_23" HREF="terminal_interface-curses-menus__adb.htm#ref_709_23">Row</A></FONT>   : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
                       <FONT COLOR=red><A NAME="ref_511_23" HREF="terminal_interface-curses-menus__adb.htm#ref_710_23">Col</A></FONT>   : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>);
@@ -529,7 +529,7 @@
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses-menus__ads.htm#ref_520_13">Set_Pattern</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_45"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_527_14" HREF="terminal_interface-curses-menus__adb.htm#ref_755_14">Pattern</A></FONT> (<FONT COLOR=red><A NAME="ref_527_23" HREF="terminal_interface-curses-menus__adb.htm#ref_755_23">Men</A></FONT>  : <b>in</b>  <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_527_14" HREF="terminal_interface-curses-menus__adb.htm#ref_755_14">Pattern</A></FONT> (<FONT COLOR=red><A NAME="ref_527_23" HREF="terminal_interface-curses-menus__adb.htm#ref_755_23">Men</A></FONT>  : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
                       <FONT COLOR=red><A NAME="ref_528_23" HREF="terminal_interface-curses-menus__adb.htm#ref_756_23">Text</A></FONT> : <b>out</b> String);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/menu_pattern.3x.html">menu_pattern()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses-menus__ads.htm#ref_527_14">Pattern</A>);
@@ -539,9 +539,9 @@
    <FONT COLOR=green><EM>--  |=====================================================================</EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_46"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_537_14" HREF="terminal_interface-curses-menus__adb.htm#ref_764_14">Set_Format</A></FONT> (<FONT COLOR=red><A NAME="ref_537_26" HREF="terminal_interface-curses-menus__adb.htm#ref_764_26">Men</A></FONT>     : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
-                         <FONT COLOR=red><A NAME="ref_538_26" HREF="terminal_interface-curses-menus__adb.htm#ref_765_26">Lines</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_63_12">Line_Count</A>;
-                         <FONT COLOR=red><A NAME="ref_539_26" HREF="terminal_interface-curses-menus__adb.htm#ref_766_26">Columns</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_65_12">Column_Count</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_537_14" HREF="terminal_interface-curses-menus__adb.htm#ref_764_14">Set_Format</A></FONT> (<FONT COLOR=red><A NAME="ref_537_26" HREF="terminal_interface-curses-menus__adb.htm#ref_764_26">Men</A></FONT>     : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
+                         <FONT COLOR=red><A NAME="ref_538_26" HREF="terminal_interface-curses-menus__adb.htm#ref_765_26">Lines</A></FONT>   : <A HREF="terminal_interface-curses__ads.htm#ref_63_12">Line_Count</A>;
+                         <FONT COLOR=red><A NAME="ref_539_26" HREF="terminal_interface-curses-menus__adb.htm#ref_766_26">Columns</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_65_12">Column_Count</A>);
    <FONT COLOR=green><EM>--  Not implemented: 0 argument for Lines or Columns;</EM></FONT>
    <FONT COLOR=green><EM>--  instead use Format to get the current sizes</EM></FONT>
    <FONT COLOR=green><EM>--      The  default  format  is  16  rows,  1  column.    Calling</EM></FONT>
@@ -553,7 +553,7 @@
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses-menus__ads.htm#ref_537_14">Set_Format</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_47"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_551_14" HREF="terminal_interface-curses-menus__adb.htm#ref_782_14">Format</A></FONT> (<FONT COLOR=red><A NAME="ref_551_22" HREF="terminal_interface-curses-menus__adb.htm#ref_782_22">Men</A></FONT>     : <b>in</b>  <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_551_14" HREF="terminal_interface-curses-menus__adb.htm#ref_782_14">Format</A></FONT> (<FONT COLOR=red><A NAME="ref_551_22" HREF="terminal_interface-curses-menus__adb.htm#ref_782_22">Men</A></FONT>     : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
                      <FONT COLOR=red><A NAME="ref_552_22" HREF="terminal_interface-curses-menus__adb.htm#ref_783_22">Lines</A></FONT>   : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_63_12">Line_Count</A>;
                      <FONT COLOR=red><A NAME="ref_553_22" HREF="terminal_interface-curses-menus__adb.htm#ref_784_22">Columns</A></FONT> : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_65_12">Column_Count</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/menu_format.3x.html">menu_format()</A></EM></FONT>
@@ -563,30 +563,30 @@
    <FONT COLOR=green><EM>--  | Man page <A HREF="../man/menu_hook.3x.html">menu_hook.3x</A></EM></FONT>
    <FONT COLOR=green><EM>--  |=====================================================================</EM></FONT>
 
-   <b>type</b> <FONT COLOR=red><A NAME="ref_561_9">Menu_Hook_Function</A></FONT> <b>is</b> <b>access</b> <b>procedure</b> (<FONT COLOR=red><A NAME="ref_561_49">Men</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>);
+   <b>type</b> <FONT COLOR=red><A NAME="ref_561_9">Menu_Hook_Function</A></FONT> <b>is</b> <b>access</b> <b>procedure</b> (<FONT COLOR=red><A NAME="ref_561_49">Men</A></FONT> : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>);
    <b>pragma</b> Convention (C, <A HREF="terminal_interface-curses-menus__ads.htm#ref_561_9">Menu_Hook_Function</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_48"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_565_14" HREF="terminal_interface-curses-menus__adb.htm#ref_802_14">Set_Item_Init_Hook</A></FONT> (<FONT COLOR=red><A NAME="ref_565_34" HREF="terminal_interface-curses-menus__adb.htm#ref_802_34">Men</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
-                                 <FONT COLOR=red><A NAME="ref_566_34" HREF="terminal_interface-curses-menus__adb.htm#ref_803_34">Proc</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_561_9">Menu_Hook_Function</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_565_14" HREF="terminal_interface-curses-menus__adb.htm#ref_802_14">Set_Item_Init_Hook</A></FONT> (<FONT COLOR=red><A NAME="ref_565_34" HREF="terminal_interface-curses-menus__adb.htm#ref_802_34">Men</A></FONT>  : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
+                                 <FONT COLOR=red><A NAME="ref_566_34" HREF="terminal_interface-curses-menus__adb.htm#ref_803_34">Proc</A></FONT> : <A HREF="terminal_interface-curses-menus__ads.htm#ref_561_9">Menu_Hook_Function</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/menu_hook.3x.html">set_item_init()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses-menus__ads.htm#ref_565_14">Set_Item_Init_Hook</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_49"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_571_14" HREF="terminal_interface-curses-menus__adb.htm#ref_816_14">Set_Item_Term_Hook</A></FONT> (<FONT COLOR=red><A NAME="ref_571_34" HREF="terminal_interface-curses-menus__adb.htm#ref_816_34">Men</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
-                                 <FONT COLOR=red><A NAME="ref_572_34" HREF="terminal_interface-curses-menus__adb.htm#ref_817_34">Proc</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_561_9">Menu_Hook_Function</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_571_14" HREF="terminal_interface-curses-menus__adb.htm#ref_816_14">Set_Item_Term_Hook</A></FONT> (<FONT COLOR=red><A NAME="ref_571_34" HREF="terminal_interface-curses-menus__adb.htm#ref_816_34">Men</A></FONT>  : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
+                                 <FONT COLOR=red><A NAME="ref_572_34" HREF="terminal_interface-curses-menus__adb.htm#ref_817_34">Proc</A></FONT> : <A HREF="terminal_interface-curses-menus__ads.htm#ref_561_9">Menu_Hook_Function</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/menu_hook.3x.html">set_item_term()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses-menus__ads.htm#ref_571_14">Set_Item_Term_Hook</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_50"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_577_14" HREF="terminal_interface-curses-menus__adb.htm#ref_830_14">Set_Menu_Init_Hook</A></FONT> (<FONT COLOR=red><A NAME="ref_577_34" HREF="terminal_interface-curses-menus__adb.htm#ref_830_34">Men</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
-                                 <FONT COLOR=red><A NAME="ref_578_34" HREF="terminal_interface-curses-menus__adb.htm#ref_831_34">Proc</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_561_9">Menu_Hook_Function</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_577_14" HREF="terminal_interface-curses-menus__adb.htm#ref_830_14">Set_Menu_Init_Hook</A></FONT> (<FONT COLOR=red><A NAME="ref_577_34" HREF="terminal_interface-curses-menus__adb.htm#ref_830_34">Men</A></FONT>  : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
+                                 <FONT COLOR=red><A NAME="ref_578_34" HREF="terminal_interface-curses-menus__adb.htm#ref_831_34">Proc</A></FONT> : <A HREF="terminal_interface-curses-menus__ads.htm#ref_561_9">Menu_Hook_Function</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/menu_hook.3x.html">set_menu_init()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses-menus__ads.htm#ref_577_14">Set_Menu_Init_Hook</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_51"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_583_14" HREF="terminal_interface-curses-menus__adb.htm#ref_844_14">Set_Menu_Term_Hook</A></FONT> (<FONT COLOR=red><A NAME="ref_583_34" HREF="terminal_interface-curses-menus__adb.htm#ref_844_34">Men</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
-                                 <FONT COLOR=red><A NAME="ref_584_34" HREF="terminal_interface-curses-menus__adb.htm#ref_845_34">Proc</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_561_9">Menu_Hook_Function</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_583_14" HREF="terminal_interface-curses-menus__adb.htm#ref_844_14">Set_Menu_Term_Hook</A></FONT> (<FONT COLOR=red><A NAME="ref_583_34" HREF="terminal_interface-curses-menus__adb.htm#ref_844_34">Men</A></FONT>  : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
+                                 <FONT COLOR=red><A NAME="ref_584_34" HREF="terminal_interface-curses-menus__adb.htm#ref_845_34">Proc</A></FONT> : <A HREF="terminal_interface-curses-menus__ads.htm#ref_561_9">Menu_Hook_Function</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/menu_hook.3x.html">set_menu_term()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses-menus__ads.htm#ref_583_14">Set_Menu_Term_Hook</A>);
 
@@ -615,13 +615,13 @@
    <FONT COLOR=green><EM>--  |=====================================================================</EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_56"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_613_14" HREF="terminal_interface-curses-menus__adb.htm#ref_890_14">Redefine</A></FONT> (<FONT COLOR=red><A NAME="ref_613_24" HREF="terminal_interface-curses-menus__adb.htm#ref_890_24">Men</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
-                       <FONT COLOR=red><A NAME="ref_614_24" HREF="terminal_interface-curses-menus__adb.htm#ref_891_24">Items</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_178_9">Item_Array_Access</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_613_14" HREF="terminal_interface-curses-menus__adb.htm#ref_890_14">Redefine</A></FONT> (<FONT COLOR=red><A NAME="ref_613_24" HREF="terminal_interface-curses-menus__adb.htm#ref_890_24">Men</A></FONT>   : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
+                       <FONT COLOR=red><A NAME="ref_614_24" HREF="terminal_interface-curses-menus__adb.htm#ref_891_24">Items</A></FONT> : <A HREF="terminal_interface-curses-menus__ads.htm#ref_178_9">Item_Array_Access</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/menu_items.3x.html">set_menu_items()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses-menus__ads.htm#ref_613_14">Redefine</A>);
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_618_14">Set_Items</A></FONT> (<FONT COLOR=red><A NAME="ref_618_25">Men</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
-                        <FONT COLOR=red><A NAME="ref_619_25">Items</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_178_9">Item_Array_Access</A>) <b>renames</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_613_14">Redefine</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_618_14">Set_Items</A></FONT> (<FONT COLOR=red><A NAME="ref_618_25">Men</A></FONT>   : <A HREF="terminal_interface-curses-menus__ads.htm#ref_57_9">Menu</A>;
+                        <FONT COLOR=red><A NAME="ref_619_25">Items</A></FONT> : <A HREF="terminal_interface-curses-menus__ads.htm#ref_178_9">Item_Array_Access</A>) <b>renames</b> <A HREF="terminal_interface-curses-menus__ads.htm#ref_613_14">Redefine</A>;
    <FONT COLOR=green><EM>--  pragma Inline (Set_Items);</EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_57"#2|</EM></FONT>
diff -Naur ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-mouse__adb.htm ncurses-5.7/doc/html/ada/terminal_interface-curses-mouse__adb.htm
--- ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-mouse__adb.htm	2008-10-11 17:36:31.000000000 -0400
+++ ncurses-5.7/doc/html/ada/terminal_interface-curses-mouse__adb.htm	2011-01-08 18:13:50.371157247 -0500
@@ -12,7 +12,7 @@
 <FONT COLOR=green><EM>--                                 B O D Y                                  --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-<FONT COLOR=green><EM>-- Copyright (c) 1998-2004,2008 Free Software Foundation, Inc.              --</EM></FONT>
+<FONT COLOR=green><EM>-- Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.              --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>-- Permission is hereby granted, free of charge, to any person obtaining a  --</EM></FONT>
 <FONT COLOR=green><EM>-- copy of this software and associated documentation files (the            --</EM></FONT>
@@ -40,13 +40,13 @@
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <FONT COLOR=green><EM>--  Author:  Juergen Pfeifer, 1996</EM></FONT>
 <FONT COLOR=green><EM>--  Version Control:</EM></FONT>
-<FONT COLOR=green><EM>--  @Revision: 1.22 @</EM></FONT>
-<FONT COLOR=green><EM>--  @Date: 2008/07/26 18:51:11 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Revision: 1.24 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Date: 2009/12/26 17:38:58 @</EM></FONT>
 <FONT COLOR=green><EM>--  Binding Version 01.00</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <b>with</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-aux__ads.htm#ref_50_35">Aux</A>; <b>use</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-aux__ads.htm#ref_50_35">Aux</A>;
-<b>with</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C; <b>use</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C;
-<b>use</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>;
+<b>with</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C; <b>use</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C;
+<b>use</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>;
 
 <b>package</b> <b>body</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<FONT COLOR=red><A NAME="ref_46_40" HREF="terminal_interface-curses-mouse__ads.htm#ref_48_35">Mouse</A></FONT> <b>is</b>
 
@@ -55,7 +55,7 @@
    <b>function</b> <FONT COLOR=red><A NAME="ref_50_13" HREF="terminal_interface-curses-mouse__ads.htm#ref_98_13">Has_Mouse</A></FONT> <b>return</b> Boolean
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_52_16">Mouse_Avail</A></FONT> <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
-      <b>pragma</b> Import (C, Mouse_Avail, "_nc_has_mouse");
+      <b>pragma</b> Import (C, Mouse_Avail, "has_mouse");
    <b>begin</b>
       <b>if</b> <A HREF="terminal_interface-curses__ads.htm#ref_767_13">Has_Key</A> (<A HREF="terminal_interface-curses__ads.htm#ref_204_4">Key_Mouse</A>) <b>or</b> <b>else</b> <A HREF="terminal_interface-curses-mouse__adb.htm#ref_52_16">Mouse_Avail</A> /= 0 <b>then</b>
          <b>return</b> True;
@@ -79,8 +79,8 @@
       <b>return</b> <A HREF="terminal_interface-curses-mouse__adb.htm#ref_69_7">Event</A>;
    <b>end</b> <A HREF="terminal_interface-curses-mouse__ads.htm#ref_133_13">Get_Mouse</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_77_14" HREF="terminal_interface-curses-mouse__ads.htm#ref_101_14">Register_Reportable_Event</A></FONT> (<FONT COLOR=red><A NAME="ref_77_41" HREF="terminal_interface-curses-mouse__ads.htm#ref_102_7">Button</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-mouse__ads.htm#ref_68_9">Mouse_Button</A>;
-                                        <FONT COLOR=red><A NAME="ref_78_41" HREF="terminal_interface-curses-mouse__ads.htm#ref_103_7">State</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-mouse__ads.htm#ref_79_9">Button_State</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_77_14" HREF="terminal_interface-curses-mouse__ads.htm#ref_101_14">Register_Reportable_Event</A></FONT> (<FONT COLOR=red><A NAME="ref_77_41" HREF="terminal_interface-curses-mouse__ads.htm#ref_102_7">Button</A></FONT> : <A HREF="terminal_interface-curses-mouse__ads.htm#ref_68_9">Mouse_Button</A>;
+                                        <FONT COLOR=red><A NAME="ref_78_41" HREF="terminal_interface-curses-mouse__ads.htm#ref_103_7">State</A></FONT>  : <A HREF="terminal_interface-curses-mouse__ads.htm#ref_79_9">Button_State</A>;
                                         <FONT COLOR=red><A NAME="ref_79_41" HREF="terminal_interface-curses-mouse__ads.htm#ref_104_7">Mask</A></FONT>   : <b>in</b> <b>out</b> <A HREF="terminal_interface-curses-mouse__ads.htm#ref_64_9">Event_Mask</A>)
    <b>is</b>
       <FONT COLOR=red><A NAME="ref_81_7">Button_Nr</A></FONT> : <b>constant</b> Natural := <A HREF="terminal_interface-curses-mouse__ads.htm#ref_68_9">Mouse_Button</A>'Pos (<A HREF="terminal_interface-curses-mouse__ads.htm#ref_102_7">Button</A>);
@@ -97,8 +97,8 @@
       <b>end</b> <b>if</b>;
    <b>end</b> <A HREF="terminal_interface-curses-mouse__ads.htm#ref_101_14">Register_Reportable_Event</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_95_14" HREF="terminal_interface-curses-mouse__ads.htm#ref_110_14">Register_Reportable_Events</A></FONT> (<FONT COLOR=red><A NAME="ref_95_42" HREF="terminal_interface-curses-mouse__ads.htm#ref_111_7">Button</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-mouse__ads.htm#ref_68_9">Mouse_Button</A>;
-                                         <FONT COLOR=red><A NAME="ref_96_42" HREF="terminal_interface-curses-mouse__ads.htm#ref_112_7">State</A></FONT>  : <b>in</b> Button_States;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_95_14" HREF="terminal_interface-curses-mouse__ads.htm#ref_110_14">Register_Reportable_Events</A></FONT> (<FONT COLOR=red><A NAME="ref_95_42" HREF="terminal_interface-curses-mouse__ads.htm#ref_111_7">Button</A></FONT> : <A HREF="terminal_interface-curses-mouse__ads.htm#ref_68_9">Mouse_Button</A>;
+                                         <FONT COLOR=red><A NAME="ref_96_42" HREF="terminal_interface-curses-mouse__ads.htm#ref_112_7">State</A></FONT>  : Button_States;
                                          <FONT COLOR=red><A NAME="ref_97_42" HREF="terminal_interface-curses-mouse__ads.htm#ref_113_7">Mask</A></FONT>   : <b>in</b> <b>out</b> <A HREF="terminal_interface-curses-mouse__ads.htm#ref_64_9">Event_Mask</A>)
    <b>is</b>
    <b>begin</b>
@@ -125,7 +125,7 @@
       <b>return</b> <A HREF="terminal_interface-curses-mouse__adb.htm#ref_114_7">Old</A>;
    <b>end</b> <A HREF="terminal_interface-curses-mouse__ads.htm#ref_123_13">Start_Mouse</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_123_14" HREF="terminal_interface-curses-mouse__ads.htm#ref_128_14">End_Mouse</A></FONT> (<FONT COLOR=red><A NAME="ref_123_25" HREF="terminal_interface-curses-mouse__ads.htm#ref_128_25">Mask</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-mouse__ads.htm#ref_64_9">Event_Mask</A> := <A HREF="terminal_interface-curses-mouse__ads.htm#ref_65_4">No_Events</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_123_14" HREF="terminal_interface-curses-mouse__ads.htm#ref_128_14">End_Mouse</A></FONT> (<FONT COLOR=red><A NAME="ref_123_25" HREF="terminal_interface-curses-mouse__ads.htm#ref_128_25">Mask</A></FONT> : <A HREF="terminal_interface-curses-mouse__ads.htm#ref_64_9">Event_Mask</A> := <A HREF="terminal_interface-curses-mouse__ads.htm#ref_65_4">No_Events</A>)
    <b>is</b>
    <b>begin</b>
       <b>if</b> <A HREF="terminal_interface-curses-mouse__ads.htm#ref_128_25">Mask</A> /= <A HREF="terminal_interface-curses-mouse__ads.htm#ref_65_4">No_Events</A> <b>then</b>
@@ -133,11 +133,11 @@
       <b>end</b> <b>if</b>;
    <b>end</b> <A HREF="terminal_interface-curses-mouse__ads.htm#ref_128_14">End_Mouse</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_131_14" HREF="terminal_interface-curses-mouse__adb.htm#ref_135_14">Dispatch_Event</A></FONT> (<FONT COLOR=red><A NAME="ref_131_30" HREF="terminal_interface-curses-mouse__adb.htm#ref_135_30">Mask</A></FONT>   : <b>in</b>  <A HREF="terminal_interface-curses-mouse__ads.htm#ref_64_9">Event_Mask</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_131_14" HREF="terminal_interface-curses-mouse__adb.htm#ref_135_14">Dispatch_Event</A></FONT> (<FONT COLOR=red><A NAME="ref_131_30" HREF="terminal_interface-curses-mouse__adb.htm#ref_135_30">Mask</A></FONT>   : <A HREF="terminal_interface-curses-mouse__ads.htm#ref_64_9">Event_Mask</A>;
                              <FONT COLOR=red><A NAME="ref_132_30" HREF="terminal_interface-curses-mouse__adb.htm#ref_136_30">Button</A></FONT> : <b>out</b> <A HREF="terminal_interface-curses-mouse__ads.htm#ref_68_9">Mouse_Button</A>;
                              <FONT COLOR=red><A NAME="ref_133_30" HREF="terminal_interface-curses-mouse__adb.htm#ref_137_30">State</A></FONT>  : <b>out</b> <A HREF="terminal_interface-curses-mouse__ads.htm#ref_79_9">Button_State</A>);
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_135_14" HREF="terminal_interface-curses-mouse__adb.htm#ref_131_14">Dispatch_Event</A></FONT> (<FONT COLOR=red><A NAME="ref_135_30" HREF="terminal_interface-curses-mouse__adb.htm#ref_131_30">Mask</A></FONT>   : <b>in</b>  <A HREF="terminal_interface-curses-mouse__ads.htm#ref_64_9">Event_Mask</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_135_14" HREF="terminal_interface-curses-mouse__adb.htm#ref_131_14">Dispatch_Event</A></FONT> (<FONT COLOR=red><A NAME="ref_135_30" HREF="terminal_interface-curses-mouse__adb.htm#ref_131_30">Mask</A></FONT>   : <A HREF="terminal_interface-curses-mouse__ads.htm#ref_64_9">Event_Mask</A>;
                              <FONT COLOR=red><A NAME="ref_136_30" HREF="terminal_interface-curses-mouse__adb.htm#ref_132_30">Button</A></FONT> : <b>out</b> <A HREF="terminal_interface-curses-mouse__ads.htm#ref_68_9">Mouse_Button</A>;
                              <FONT COLOR=red><A NAME="ref_137_30" HREF="terminal_interface-curses-mouse__adb.htm#ref_133_30">State</A></FONT>  : <b>out</b> <A HREF="terminal_interface-curses-mouse__ads.htm#ref_79_9">Button_State</A>) <b>is</b>
       <FONT COLOR=red><A NAME="ref_138_7">L</A></FONT> : <A HREF="terminal_interface-curses-mouse__ads.htm#ref_64_9">Event_Mask</A>;
@@ -173,7 +173,7 @@
       <b>end</b> <b>if</b>;
    <b>end</b> <A HREF="terminal_interface-curses-mouse__adb.htm#ref_131_14">Dispatch_Event</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_171_14" HREF="terminal_interface-curses-mouse__ads.htm#ref_137_14">Get_Event</A></FONT> (<FONT COLOR=red><A NAME="ref_171_25" HREF="terminal_interface-curses-mouse__ads.htm#ref_137_25">Event</A></FONT>  : <b>in</b>  <A HREF="terminal_interface-curses-mouse__ads.htm#ref_92_9">Mouse_Event</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_171_14" HREF="terminal_interface-curses-mouse__ads.htm#ref_137_14">Get_Event</A></FONT> (<FONT COLOR=red><A NAME="ref_171_25" HREF="terminal_interface-curses-mouse__ads.htm#ref_137_25">Event</A></FONT>  : <A HREF="terminal_interface-curses-mouse__ads.htm#ref_92_9">Mouse_Event</A>;
                         <FONT COLOR=red><A NAME="ref_172_25" HREF="terminal_interface-curses-mouse__ads.htm#ref_138_25">Y</A></FONT>      : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
                         <FONT COLOR=red><A NAME="ref_173_25" HREF="terminal_interface-curses-mouse__ads.htm#ref_139_25">X</A></FONT>      : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
                         <FONT COLOR=red><A NAME="ref_174_25" HREF="terminal_interface-curses-mouse__ads.htm#ref_140_25">Button</A></FONT> : <b>out</b> <A HREF="terminal_interface-curses-mouse__ads.htm#ref_68_9">Mouse_Button</A>;
@@ -186,7 +186,7 @@
       <A HREF="terminal_interface-curses-mouse__adb.htm#ref_131_14">Dispatch_Event</A> (<A HREF="terminal_interface-curses-mouse__adb.htm#ref_177_7">Mask</A>, <A HREF="terminal_interface-curses-mouse__ads.htm#ref_140_25">Button</A>, <A HREF="terminal_interface-curses-mouse__ads.htm#ref_141_25">State</A>);
    <b>end</b> <A HREF="terminal_interface-curses-mouse__ads.htm#ref_137_14">Get_Event</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_184_14" HREF="terminal_interface-curses-mouse__ads.htm#ref_149_14">Unget_Mouse</A></FONT> (<FONT COLOR=red><A NAME="ref_184_27" HREF="terminal_interface-curses-mouse__ads.htm#ref_149_27">Event</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-mouse__ads.htm#ref_92_9">Mouse_Event</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_184_14" HREF="terminal_interface-curses-mouse__ads.htm#ref_149_14">Unget_Mouse</A></FONT> (<FONT COLOR=red><A NAME="ref_184_27" HREF="terminal_interface-curses-mouse__ads.htm#ref_149_27">Event</A></FONT> : <A HREF="terminal_interface-curses-mouse__ads.htm#ref_92_9">Mouse_Event</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_186_16">Ungetmouse</A></FONT> (<FONT COLOR=red><A NAME="ref_186_28" HREF="terminal_interface-curses-mouse__adb.htm#ref_186_16">Ev</A></FONT> : <A HREF="terminal_interface-curses-mouse__ads.htm#ref_92_9">Mouse_Event</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
       <b>pragma</b> Import (C, Ungetmouse, "ungetmouse");
diff -Naur ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-mouse__ads.htm ncurses-5.7/doc/html/ada/terminal_interface-curses-mouse__ads.htm
--- ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-mouse__ads.htm	2008-10-11 17:36:31.000000000 -0400
+++ ncurses-5.7/doc/html/ada/terminal_interface-curses-mouse__ads.htm	2011-01-08 18:13:50.371157247 -0500
@@ -12,7 +12,7 @@
 <FONT COLOR=green><EM>--                                 S P E C                                  --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-<FONT COLOR=green><EM>-- Copyright (c) 1998-2004,2006 Free Software Foundation, Inc.              --</EM></FONT>
+<FONT COLOR=green><EM>-- Copyright (c) 1998-2006,2009 Free Software Foundation, Inc.              --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>-- Permission is hereby granted, free of charge, to any person obtaining a  --</EM></FONT>
 <FONT COLOR=green><EM>-- copy of this software and associated documentation files (the            --</EM></FONT>
@@ -40,8 +40,8 @@
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <FONT COLOR=green><EM>--  Author:  Juergen Pfeifer, 1996</EM></FONT>
 <FONT COLOR=green><EM>--  Version Control:</EM></FONT>
-<FONT COLOR=green><EM>--  @Revision: 1.27 @</EM></FONT>
-<FONT COLOR=green><EM>--  @Date: 2006/06/25 14:30:22 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Revision: 1.28 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Date: 2009/12/26 17:38:58 @</EM></FONT>
 <FONT COLOR=green><EM>--  Binding Version 01.00</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <FONT COLOR=green><EM>--  mouse binding.</EM></FONT>
@@ -104,8 +104,8 @@
    <FONT COLOR=green><EM>--  Return true if a mouse device is supported, false otherwise.</EM></FONT>
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_101_14" HREF="terminal_interface-curses-mouse__adb.htm#ref_77_14">Register_Reportable_Event</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_102_7" HREF="terminal_interface-curses-mouse__adb.htm#ref_77_41">Button</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-mouse__ads.htm#ref_68_9">Mouse_Button</A>;
-      <FONT COLOR=red><A NAME="ref_103_7" HREF="terminal_interface-curses-mouse__adb.htm#ref_78_41">State</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-mouse__ads.htm#ref_79_9">Button_State</A>;
+     (<FONT COLOR=red><A NAME="ref_102_7" HREF="terminal_interface-curses-mouse__adb.htm#ref_77_41">Button</A></FONT> : <A HREF="terminal_interface-curses-mouse__ads.htm#ref_68_9">Mouse_Button</A>;
+      <FONT COLOR=red><A NAME="ref_103_7" HREF="terminal_interface-curses-mouse__adb.htm#ref_78_41">State</A></FONT>  : <A HREF="terminal_interface-curses-mouse__ads.htm#ref_79_9">Button_State</A>;
       <FONT COLOR=red><A NAME="ref_104_7" HREF="terminal_interface-curses-mouse__adb.htm#ref_79_41">Mask</A></FONT>   : <b>in</b> <b>out</b> <A HREF="terminal_interface-curses-mouse__ads.htm#ref_64_9">Event_Mask</A>);
    <FONT COLOR=green><EM>--  Stores the event described by the button and the state in the mask.</EM></FONT>
    <FONT COLOR=green><EM>--  Before you call this the first time, you should init the mask</EM></FONT>
@@ -113,8 +113,8 @@
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses-mouse__ads.htm#ref_101_14">Register_Reportable_Event</A>);
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_110_14" HREF="terminal_interface-curses-mouse__adb.htm#ref_95_14">Register_Reportable_Events</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_111_7" HREF="terminal_interface-curses-mouse__adb.htm#ref_95_42">Button</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-mouse__ads.htm#ref_68_9">Mouse_Button</A>;
-      <FONT COLOR=red><A NAME="ref_112_7" HREF="terminal_interface-curses-mouse__adb.htm#ref_96_42">State</A></FONT>  : <b>in</b> Button_States;
+     (<FONT COLOR=red><A NAME="ref_111_7" HREF="terminal_interface-curses-mouse__adb.htm#ref_95_42">Button</A></FONT> : <A HREF="terminal_interface-curses-mouse__ads.htm#ref_68_9">Mouse_Button</A>;
+      <FONT COLOR=red><A NAME="ref_112_7" HREF="terminal_interface-curses-mouse__adb.htm#ref_96_42">State</A></FONT>  : Button_States;
       <FONT COLOR=red><A NAME="ref_113_7" HREF="terminal_interface-curses-mouse__adb.htm#ref_97_42">Mask</A></FONT>   : <b>in</b> <b>out</b> <A HREF="terminal_interface-curses-mouse__ads.htm#ref_64_9">Event_Mask</A>);
    <FONT COLOR=green><EM>--  Register all events described by the Button and the State bitmap.</EM></FONT>
    <FONT COLOR=green><EM>--  Before you call this the first time, you should init the mask</EM></FONT>
@@ -130,7 +130,7 @@
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_mouse.3x.html">mousemask()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses-mouse__ads.htm#ref_123_13">Start_Mouse</A>);
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_128_14" HREF="terminal_interface-curses-mouse__adb.htm#ref_123_14">End_Mouse</A></FONT> (<FONT COLOR=red><A NAME="ref_128_25" HREF="terminal_interface-curses-mouse__adb.htm#ref_123_25">Mask</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-mouse__ads.htm#ref_64_9">Event_Mask</A> := <A HREF="terminal_interface-curses-mouse__ads.htm#ref_65_4">No_Events</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_128_14" HREF="terminal_interface-curses-mouse__adb.htm#ref_123_14">End_Mouse</A></FONT> (<FONT COLOR=red><A NAME="ref_128_25" HREF="terminal_interface-curses-mouse__adb.htm#ref_123_25">Mask</A></FONT> : <A HREF="terminal_interface-curses-mouse__ads.htm#ref_64_9">Event_Mask</A> := <A HREF="terminal_interface-curses-mouse__ads.htm#ref_65_4">No_Events</A>);
    <FONT COLOR=green><EM>--  Terminates the mouse, restores the specified event mask</EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses-mouse__ads.htm#ref_128_14">End_Mouse</A>);
 
@@ -139,7 +139,7 @@
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_mouse.3x.html">getmouse()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses-mouse__ads.htm#ref_133_13">Get_Mouse</A>);
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_137_14" HREF="terminal_interface-curses-mouse__adb.htm#ref_171_14">Get_Event</A></FONT> (<FONT COLOR=red><A NAME="ref_137_25" HREF="terminal_interface-curses-mouse__adb.htm#ref_171_25">Event</A></FONT>  : <b>in</b>  <A HREF="terminal_interface-curses-mouse__ads.htm#ref_92_9">Mouse_Event</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_137_14" HREF="terminal_interface-curses-mouse__adb.htm#ref_171_14">Get_Event</A></FONT> (<FONT COLOR=red><A NAME="ref_137_25" HREF="terminal_interface-curses-mouse__adb.htm#ref_171_25">Event</A></FONT>  : <A HREF="terminal_interface-curses-mouse__ads.htm#ref_92_9">Mouse_Event</A>;
                         <FONT COLOR=red><A NAME="ref_138_25" HREF="terminal_interface-curses-mouse__adb.htm#ref_172_25">Y</A></FONT>      : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
                         <FONT COLOR=red><A NAME="ref_139_25" HREF="terminal_interface-curses-mouse__adb.htm#ref_173_25">X</A></FONT>      : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
                         <FONT COLOR=red><A NAME="ref_140_25" HREF="terminal_interface-curses-mouse__adb.htm#ref_174_25">Button</A></FONT> : <b>out</b> <A HREF="terminal_interface-curses-mouse__ads.htm#ref_68_9">Mouse_Button</A>;
@@ -151,7 +151,7 @@
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses-mouse__ads.htm#ref_137_14">Get_Event</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_3"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_149_14" HREF="terminal_interface-curses-mouse__adb.htm#ref_184_14">Unget_Mouse</A></FONT> (<FONT COLOR=red><A NAME="ref_149_27" HREF="terminal_interface-curses-mouse__adb.htm#ref_184_27">Event</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-mouse__ads.htm#ref_92_9">Mouse_Event</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_149_14" HREF="terminal_interface-curses-mouse__adb.htm#ref_184_14">Unget_Mouse</A></FONT> (<FONT COLOR=red><A NAME="ref_149_27" HREF="terminal_interface-curses-mouse__adb.htm#ref_184_27">Event</A></FONT> : <A HREF="terminal_interface-curses-mouse__ads.htm#ref_92_9">Mouse_Event</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_mouse.3x.html">ungetmouse()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses-mouse__ads.htm#ref_149_14">Unget_Mouse</A>);
 
@@ -168,14 +168,14 @@
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses-mouse__ads.htm#ref_161_13">Mouse_Interval</A>);
 
 <b>private</b>
-   <b>type</b> <A HREF="terminal_interface-curses-mouse__ads.htm#ref_64_9">Event_Mask</A> <b>is</b> <b>new</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C.unsigned_long;
+   <b>type</b> <A HREF="terminal_interface-curses-mouse__ads.htm#ref_64_9">Event_Mask</A> <b>is</b> <b>new</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C.unsigned_long;
 
    <b>type</b> <A HREF="terminal_interface-curses-mouse__ads.htm#ref_92_9">Mouse_Event</A> <b>is</b>
       <b>record</b>
-         <FONT COLOR=red><A NAME="ref_170_10">Id</A></FONT>      : Integer <b>range</b> Integer (<A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C.short'First) ..
-                                 Integer (<A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C.short'Last);
-         <FONT COLOR=red><A NAME="ref_172_10">X</A></FONT>, <FONT COLOR=red><A NAME="ref_172_13">Y</A></FONT>, <FONT COLOR=red><A NAME="ref_172_16">Z</A></FONT> : Integer <b>range</b> Integer (<A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C.int'First) ..
-                                 Integer (<A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C.int'Last);
+         <FONT COLOR=red><A NAME="ref_170_10">Id</A></FONT>      : Integer <b>range</b> Integer (<A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C.short'First) ..
+                                 Integer (<A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C.short'Last);
+         <FONT COLOR=red><A NAME="ref_172_10">X</A></FONT>, <FONT COLOR=red><A NAME="ref_172_13">Y</A></FONT>, <FONT COLOR=red><A NAME="ref_172_16">Z</A></FONT> : Integer <b>range</b> Integer (<A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C.int'First) ..
+                                 Integer (<A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C.int'Last);
          <FONT COLOR=red><A NAME="ref_174_10">Bstate</A></FONT>  : <A HREF="terminal_interface-curses-mouse__ads.htm#ref_64_9">Event_Mask</A>;
       <b>end</b> <b>record</b>;
    <b>pragma</b> Convention (C, <A HREF="terminal_interface-curses-mouse__ads.htm#ref_92_9">Mouse_Event</A>);
diff -Naur ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-panels-user_data__adb.htm ncurses-5.7/doc/html/ada/terminal_interface-curses-panels-user_data__adb.htm
--- ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-panels-user_data__adb.htm	2006-09-23 16:31:31.000000000 -0400
+++ ncurses-5.7/doc/html/ada/terminal_interface-curses-panels-user_data__adb.htm	2011-01-08 18:13:50.371157247 -0500
@@ -12,7 +12,7 @@
 <FONT COLOR=green><EM>--                                 B O D Y                                  --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-<FONT COLOR=green><EM>-- Copyright (c) 1998 Free Software Foundation, Inc.                        --</EM></FONT>
+<FONT COLOR=green><EM>-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>-- Permission is hereby granted, free of charge, to any person obtaining a  --</EM></FONT>
 <FONT COLOR=green><EM>-- copy of this software and associated documentation files (the            --</EM></FONT>
@@ -40,10 +40,10 @@
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <FONT COLOR=green><EM>--  Author:  Juergen Pfeifer, 1996</EM></FONT>
 <FONT COLOR=green><EM>--  Version Control:</EM></FONT>
-<FONT COLOR=green><EM>--  @Revision: 1.11 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Revision: 1.12 @</EM></FONT>
 <FONT COLOR=green><EM>--  Binding Version 01.00</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-<b>with</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C;
+<b>with</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C;
 <b>with</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-aux__ads.htm#ref_50_35">Aux</A>;
 <b>use</b>  <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-aux__ads.htm#ref_50_35">Aux</A>;
 <b>with</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-panels__ads.htm#ref_44_35">Panels</A>;
@@ -51,10 +51,10 @@
 
 <b>package</b> <b>body</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-panels__ads.htm#ref_44_35">Panels</A>.<FONT COLOR=red><A NAME="ref_47_47" HREF="terminal_interface-curses-panels-user_data__ads.htm#ref_45_42">User_Data</A></FONT> <b>is</b>
 
-   <b>use</b> <b>type</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C.int;
+   <b>use</b> <b>type</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C.int;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_51_14" HREF="terminal_interface-curses-panels-user_data__ads.htm#ref_53_14">Set_User_Data</A></FONT> (<FONT COLOR=red><A NAME="ref_51_29" HREF="terminal_interface-curses-panels-user_data__ads.htm#ref_53_29">Pan</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-panels__ads.htm#ref_49_9">Panel</A>;
-                            <FONT COLOR=red><A NAME="ref_52_29" HREF="terminal_interface-curses-panels-user_data__ads.htm#ref_54_29">Data</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-panels-user_data__ads.htm#ref_44_9">User_Access</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_51_14" HREF="terminal_interface-curses-panels-user_data__ads.htm#ref_53_14">Set_User_Data</A></FONT> (<FONT COLOR=red><A NAME="ref_51_29" HREF="terminal_interface-curses-panels-user_data__ads.htm#ref_53_29">Pan</A></FONT>  : <A HREF="terminal_interface-curses-panels__ads.htm#ref_49_9">Panel</A>;
+                            <FONT COLOR=red><A NAME="ref_52_29" HREF="terminal_interface-curses-panels-user_data__ads.htm#ref_54_29">Data</A></FONT> : <A HREF="terminal_interface-curses-panels-user_data__ads.htm#ref_44_9">User_Access</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_54_16">Set_Panel_Userptr</A></FONT> (<FONT COLOR=red><A NAME="ref_54_35" HREF="terminal_interface-curses-panels-user_data__adb.htm#ref_54_16">Pan</A></FONT>  : <A HREF="terminal_interface-curses-panels__ads.htm#ref_49_9">Panel</A>;
                                   <FONT COLOR=red><A NAME="ref_55_35" HREF="terminal_interface-curses-panels-user_data__adb.htm#ref_54_16">Addr</A></FONT> : <A HREF="terminal_interface-curses-panels-user_data__ads.htm#ref_44_9">User_Access</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
@@ -65,7 +65,7 @@
       <b>end</b> <b>if</b>;
    <b>end</b> <A HREF="terminal_interface-curses-panels-user_data__ads.htm#ref_53_14">Set_User_Data</A>;
 
-   <b>function</b> <FONT COLOR=red><A NAME="ref_63_13" HREF="terminal_interface-curses-panels-user_data__ads.htm#ref_64_13">Get_User_Data</A></FONT> (<FONT COLOR=red><A NAME="ref_63_28" HREF="terminal_interface-curses-panels-user_data__ads.htm#ref_64_28">Pan</A></FONT>  : <b>in</b>  <A HREF="terminal_interface-curses-panels__ads.htm#ref_49_9">Panel</A>) <b>return</b> <A HREF="terminal_interface-curses-panels-user_data__ads.htm#ref_44_9">User_Access</A>
+   <b>function</b> <FONT COLOR=red><A NAME="ref_63_13" HREF="terminal_interface-curses-panels-user_data__ads.htm#ref_64_13">Get_User_Data</A></FONT> (<FONT COLOR=red><A NAME="ref_63_28" HREF="terminal_interface-curses-panels-user_data__ads.htm#ref_64_28">Pan</A></FONT>  : <A HREF="terminal_interface-curses-panels__ads.htm#ref_49_9">Panel</A>) <b>return</b> <A HREF="terminal_interface-curses-panels-user_data__ads.htm#ref_44_9">User_Access</A>
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_65_16">Panel_Userptr</A></FONT> (<FONT COLOR=red><A NAME="ref_65_31" HREF="terminal_interface-curses-panels-user_data__adb.htm#ref_65_16">Pan</A></FONT> : <A HREF="terminal_interface-curses-panels__ads.htm#ref_49_9">Panel</A>) <b>return</b> <A HREF="terminal_interface-curses-panels-user_data__ads.htm#ref_44_9">User_Access</A>;
       <b>pragma</b> Import (C, Panel_Userptr, "panel_userptr");
@@ -73,7 +73,7 @@
       <b>return</b> <A HREF="terminal_interface-curses-panels-user_data__adb.htm#ref_65_16">Panel_Userptr</A> (<A HREF="terminal_interface-curses-panels-user_data__ads.htm#ref_64_28">Pan</A>);
    <b>end</b> <A HREF="terminal_interface-curses-panels-user_data__ads.htm#ref_64_13">Get_User_Data</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_71_14" HREF="terminal_interface-curses-panels-user_data__ads.htm#ref_59_14">Get_User_Data</A></FONT> (<FONT COLOR=red><A NAME="ref_71_29" HREF="terminal_interface-curses-panels-user_data__ads.htm#ref_59_29">Pan</A></FONT>  : <b>in</b>  <A HREF="terminal_interface-curses-panels__ads.htm#ref_49_9">Panel</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_71_14" HREF="terminal_interface-curses-panels-user_data__ads.htm#ref_59_14">Get_User_Data</A></FONT> (<FONT COLOR=red><A NAME="ref_71_29" HREF="terminal_interface-curses-panels-user_data__ads.htm#ref_59_29">Pan</A></FONT>  : <A HREF="terminal_interface-curses-panels__ads.htm#ref_49_9">Panel</A>;
                             <FONT COLOR=red><A NAME="ref_72_29" HREF="terminal_interface-curses-panels-user_data__ads.htm#ref_60_29">Data</A></FONT> : <b>out</b> <A HREF="terminal_interface-curses-panels-user_data__ads.htm#ref_44_9">User_Access</A>)
    <b>is</b>
    <b>begin</b>
diff -Naur ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-panels-user_data__ads.htm ncurses-5.7/doc/html/ada/terminal_interface-curses-panels-user_data__ads.htm
--- ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-panels-user_data__ads.htm	2007-09-01 19:56:31.000000000 -0400
+++ ncurses-5.7/doc/html/ada/terminal_interface-curses-panels-user_data__ads.htm	2011-01-08 18:13:50.371157247 -0500
@@ -12,7 +12,7 @@
 <FONT COLOR=green><EM>--                                 S P E C                                  --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-<FONT COLOR=green><EM>-- Copyright (c) 1998 Free Software Foundation, Inc.                        --</EM></FONT>
+<FONT COLOR=green><EM>-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>-- Permission is hereby granted, free of charge, to any person obtaining a  --</EM></FONT>
 <FONT COLOR=green><EM>-- copy of this software and associated documentation files (the            --</EM></FONT>
@@ -40,7 +40,7 @@
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <FONT COLOR=green><EM>--  Author:  Juergen Pfeifer, 1996</EM></FONT>
 <FONT COLOR=green><EM>--  Version Control:</EM></FONT>
-<FONT COLOR=green><EM>--  @Revision: 1.14 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Revision: 1.15 @</EM></FONT>
 <FONT COLOR=green><EM>--  Binding Version 01.00</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 
@@ -55,18 +55,18 @@
    <FONT COLOR=green><EM>--  |=====================================================================</EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_1"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_53_14" HREF="terminal_interface-curses-panels-user_data__adb.htm#ref_51_14">Set_User_Data</A></FONT> (<FONT COLOR=red><A NAME="ref_53_29" HREF="terminal_interface-curses-panels-user_data__adb.htm#ref_51_29">Pan</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-panels__ads.htm#ref_49_9">Panel</A>;
-                            <FONT COLOR=red><A NAME="ref_54_29" HREF="terminal_interface-curses-panels-user_data__adb.htm#ref_52_29">Data</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-panels-user_data__ads.htm#ref_44_9">User_Access</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_53_14" HREF="terminal_interface-curses-panels-user_data__adb.htm#ref_51_14">Set_User_Data</A></FONT> (<FONT COLOR=red><A NAME="ref_53_29" HREF="terminal_interface-curses-panels-user_data__adb.htm#ref_51_29">Pan</A></FONT>  : <A HREF="terminal_interface-curses-panels__ads.htm#ref_49_9">Panel</A>;
+                            <FONT COLOR=red><A NAME="ref_54_29" HREF="terminal_interface-curses-panels-user_data__adb.htm#ref_52_29">Data</A></FONT> : <A HREF="terminal_interface-curses-panels-user_data__ads.htm#ref_44_9">User_Access</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/panel.3x.html">set_panel_userptr</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses-panels-user_data__ads.htm#ref_53_14">Set_User_Data</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_2"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_59_14" HREF="terminal_interface-curses-panels-user_data__adb.htm#ref_71_14">Get_User_Data</A></FONT> (<FONT COLOR=red><A NAME="ref_59_29" HREF="terminal_interface-curses-panels-user_data__adb.htm#ref_71_29">Pan</A></FONT>  : <b>in</b>  <A HREF="terminal_interface-curses-panels__ads.htm#ref_49_9">Panel</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_59_14" HREF="terminal_interface-curses-panels-user_data__adb.htm#ref_71_14">Get_User_Data</A></FONT> (<FONT COLOR=red><A NAME="ref_59_29" HREF="terminal_interface-curses-panels-user_data__adb.htm#ref_71_29">Pan</A></FONT>  : <A HREF="terminal_interface-curses-panels__ads.htm#ref_49_9">Panel</A>;
                             <FONT COLOR=red><A NAME="ref_60_29" HREF="terminal_interface-curses-panels-user_data__adb.htm#ref_72_29">Data</A></FONT> : <b>out</b> <A HREF="terminal_interface-curses-panels-user_data__ads.htm#ref_44_9">User_Access</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/panel.3x.html">panel_userptr</A></EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_3"#2|</EM></FONT>
-   <b>function</b> <FONT COLOR=red><A NAME="ref_64_13" HREF="terminal_interface-curses-panels-user_data__adb.htm#ref_63_13">Get_User_Data</A></FONT> (<FONT COLOR=red><A NAME="ref_64_28" HREF="terminal_interface-curses-panels-user_data__adb.htm#ref_63_28">Pan</A></FONT>  : <b>in</b>  <A HREF="terminal_interface-curses-panels__ads.htm#ref_49_9">Panel</A>) <b>return</b> <A HREF="terminal_interface-curses-panels-user_data__ads.htm#ref_44_9">User_Access</A>;
+   <b>function</b> <FONT COLOR=red><A NAME="ref_64_13" HREF="terminal_interface-curses-panels-user_data__adb.htm#ref_63_13">Get_User_Data</A></FONT> (<FONT COLOR=red><A NAME="ref_64_28" HREF="terminal_interface-curses-panels-user_data__adb.htm#ref_63_28">Pan</A></FONT>  : <A HREF="terminal_interface-curses-panels__ads.htm#ref_49_9">Panel</A>) <b>return</b> <A HREF="terminal_interface-curses-panels-user_data__ads.htm#ref_44_9">User_Access</A>;
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/panel.3x.html">panel_userptr</A></EM></FONT>
    <FONT COLOR=green><EM>--  Same as function</EM></FONT>
    <b>pragma</b> Inline (Get_User_Data);
diff -Naur ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-panels__adb.htm ncurses-5.7/doc/html/ada/terminal_interface-curses-panels__adb.htm
--- ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-panels__adb.htm	2006-09-23 16:31:31.000000000 -0400
+++ ncurses-5.7/doc/html/ada/terminal_interface-curses-panels__adb.htm	2011-01-08 18:13:50.375156842 -0500
@@ -12,7 +12,7 @@
 <FONT COLOR=green><EM>--                                 B O D Y                                  --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-<FONT COLOR=green><EM>-- Copyright (c) 1998,2004 Free Software Foundation, Inc.                   --</EM></FONT>
+<FONT COLOR=green><EM>-- Copyright (c) 1998-2004,2009 Free Software Foundation, Inc.              --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>-- Permission is hereby granted, free of charge, to any person obtaining a  --</EM></FONT>
 <FONT COLOR=green><EM>-- copy of this software and associated documentation files (the            --</EM></FONT>
@@ -40,16 +40,16 @@
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <FONT COLOR=green><EM>--  Author:  Juergen Pfeifer, 1996</EM></FONT>
 <FONT COLOR=green><EM>--  Version Control:</EM></FONT>
-<FONT COLOR=green><EM>--  @Revision: 1.13 @</EM></FONT>
-<FONT COLOR=green><EM>--  @Date: 2004/08/21 21:37:00 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Revision: 1.14 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Date: 2009/12/26 17:38:58 @</EM></FONT>
 <FONT COLOR=green><EM>--  Binding Version 01.00</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <b>with</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-aux__ads.htm#ref_50_35">Aux</A>; <b>use</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-aux__ads.htm#ref_50_35">Aux</A>;
-<b>with</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C;
+<b>with</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C;
 
 <b>package</b> <b>body</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<FONT COLOR=red><A NAME="ref_45_40" HREF="terminal_interface-curses-panels__ads.htm#ref_44_35">Panels</A></FONT> <b>is</b>
 
-   <b>use</b> <b>type</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C.int;
+   <b>use</b> <b>type</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C.int;
 
    <b>function</b> <FONT COLOR=red><A NAME="ref_49_13" HREF="terminal_interface-curses-panels__ads.htm#ref_67_13">Create</A></FONT> (<FONT COLOR=red><A NAME="ref_49_21" HREF="terminal_interface-curses-panels__ads.htm#ref_67_21">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>) <b>return</b> <A HREF="terminal_interface-curses-panels__ads.htm#ref_49_9">Panel</A>
    <b>is</b>
@@ -65,7 +65,7 @@
       <b>return</b> <A HREF="terminal_interface-curses-panels__adb.htm#ref_54_7">Pan</A>;
    <b>end</b> <A HREF="terminal_interface-curses-panels__ads.htm#ref_67_13">Create</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_63_14" HREF="terminal_interface-curses-panels__ads.htm#ref_77_14">Bottom</A></FONT> (<FONT COLOR=red><A NAME="ref_63_22" HREF="terminal_interface-curses-panels__ads.htm#ref_77_22">Pan</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-panels__ads.htm#ref_49_9">Panel</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_63_14" HREF="terminal_interface-curses-panels__ads.htm#ref_77_14">Bottom</A></FONT> (<FONT COLOR=red><A NAME="ref_63_22" HREF="terminal_interface-curses-panels__ads.htm#ref_77_22">Pan</A></FONT> : <A HREF="terminal_interface-curses-panels__ads.htm#ref_49_9">Panel</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_65_16">Bottompanel</A></FONT> (<FONT COLOR=red><A NAME="ref_65_29" HREF="terminal_interface-curses-panels__adb.htm#ref_65_16">Pan</A></FONT> : <A HREF="terminal_interface-curses-panels__ads.htm#ref_49_9">Panel</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
       <b>pragma</b> Import (C, Bottompanel, "bottom_panel");
@@ -75,7 +75,7 @@
       <b>end</b> <b>if</b>;
    <b>end</b> <A HREF="terminal_interface-curses-panels__ads.htm#ref_77_14">Bottom</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_73_14" HREF="terminal_interface-curses-panels__ads.htm#ref_82_14">Top</A></FONT> (<FONT COLOR=red><A NAME="ref_73_19" HREF="terminal_interface-curses-panels__ads.htm#ref_82_19">Pan</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-panels__ads.htm#ref_49_9">Panel</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_73_14" HREF="terminal_interface-curses-panels__ads.htm#ref_82_14">Top</A></FONT> (<FONT COLOR=red><A NAME="ref_73_19" HREF="terminal_interface-curses-panels__ads.htm#ref_82_19">Pan</A></FONT> : <A HREF="terminal_interface-curses-panels__ads.htm#ref_49_9">Panel</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_75_16">Toppanel</A></FONT> (<FONT COLOR=red><A NAME="ref_75_26" HREF="terminal_interface-curses-panels__adb.htm#ref_75_16">Pan</A></FONT> : <A HREF="terminal_interface-curses-panels__ads.htm#ref_49_9">Panel</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
       <b>pragma</b> Import (C, Toppanel, "top_panel");
@@ -85,7 +85,7 @@
       <b>end</b> <b>if</b>;
    <b>end</b> <A HREF="terminal_interface-curses-panels__ads.htm#ref_82_14">Top</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_83_14" HREF="terminal_interface-curses-panels__ads.htm#ref_87_14">Show</A></FONT> (<FONT COLOR=red><A NAME="ref_83_20" HREF="terminal_interface-curses-panels__ads.htm#ref_87_20">Pan</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-panels__ads.htm#ref_49_9">Panel</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_83_14" HREF="terminal_interface-curses-panels__ads.htm#ref_87_14">Show</A></FONT> (<FONT COLOR=red><A NAME="ref_83_20" HREF="terminal_interface-curses-panels__ads.htm#ref_87_20">Pan</A></FONT> : <A HREF="terminal_interface-curses-panels__ads.htm#ref_49_9">Panel</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_85_16">Showpanel</A></FONT> (<FONT COLOR=red><A NAME="ref_85_27" HREF="terminal_interface-curses-panels__adb.htm#ref_85_16">Pan</A></FONT> : <A HREF="terminal_interface-curses-panels__ads.htm#ref_49_9">Panel</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
       <b>pragma</b> Import (C, Showpanel, "show_panel");
@@ -95,7 +95,7 @@
       <b>end</b> <b>if</b>;
    <b>end</b> <A HREF="terminal_interface-curses-panels__ads.htm#ref_87_14">Show</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_93_14" HREF="terminal_interface-curses-panels__ads.htm#ref_97_14">Hide</A></FONT> (<FONT COLOR=red><A NAME="ref_93_20" HREF="terminal_interface-curses-panels__ads.htm#ref_97_20">Pan</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-panels__ads.htm#ref_49_9">Panel</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_93_14" HREF="terminal_interface-curses-panels__ads.htm#ref_97_14">Hide</A></FONT> (<FONT COLOR=red><A NAME="ref_93_20" HREF="terminal_interface-curses-panels__ads.htm#ref_97_20">Pan</A></FONT> : <A HREF="terminal_interface-curses-panels__ads.htm#ref_49_9">Panel</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_95_16">Hidepanel</A></FONT> (<FONT COLOR=red><A NAME="ref_95_27" HREF="terminal_interface-curses-panels__adb.htm#ref_95_16">Pan</A></FONT> : <A HREF="terminal_interface-curses-panels__ads.htm#ref_49_9">Panel</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
       <b>pragma</b> Import (C, Hidepanel, "hide_panel");
@@ -118,8 +118,8 @@
       <b>return</b> <A HREF="terminal_interface-curses-panels__adb.htm#ref_108_7">Win</A>;
    <b>end</b> <A HREF="terminal_interface-curses-panels__ads.htm#ref_102_13">Get_Window</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_116_14" HREF="terminal_interface-curses-panels__ads.htm#ref_111_14">Replace</A></FONT> (<FONT COLOR=red><A NAME="ref_116_23" HREF="terminal_interface-curses-panels__ads.htm#ref_111_23">Pan</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-panels__ads.htm#ref_49_9">Panel</A>;
-                      <FONT COLOR=red><A NAME="ref_117_23" HREF="terminal_interface-curses-panels__ads.htm#ref_112_23">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_116_14" HREF="terminal_interface-curses-panels__ads.htm#ref_111_14">Replace</A></FONT> (<FONT COLOR=red><A NAME="ref_116_23" HREF="terminal_interface-curses-panels__ads.htm#ref_111_23">Pan</A></FONT> : <A HREF="terminal_interface-curses-panels__ads.htm#ref_49_9">Panel</A>;
+                      <FONT COLOR=red><A NAME="ref_117_23" HREF="terminal_interface-curses-panels__ads.htm#ref_112_23">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_119_16">Replace_Pan</A></FONT> (<FONT COLOR=red><A NAME="ref_119_29" HREF="terminal_interface-curses-panels__adb.htm#ref_119_16">Pan</A></FONT> : <A HREF="terminal_interface-curses-panels__ads.htm#ref_49_9">Panel</A>;
                             <FONT COLOR=red><A NAME="ref_120_29" HREF="terminal_interface-curses-panels__adb.htm#ref_119_16">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
@@ -130,9 +130,9 @@
       <b>end</b> <b>if</b>;
    <b>end</b> <A HREF="terminal_interface-curses-panels__ads.htm#ref_111_14">Replace</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_128_14" HREF="terminal_interface-curses-panels__ads.htm#ref_117_14">Move</A></FONT> (<FONT COLOR=red><A NAME="ref_128_20" HREF="terminal_interface-curses-panels__ads.htm#ref_117_20">Pan</A></FONT>    : <b>in</b> <A HREF="terminal_interface-curses-panels__ads.htm#ref_49_9">Panel</A>;
-                   <FONT COLOR=red><A NAME="ref_129_20" HREF="terminal_interface-curses-panels__ads.htm#ref_118_20">Line</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
-                   <FONT COLOR=red><A NAME="ref_130_20" HREF="terminal_interface-curses-panels__ads.htm#ref_119_20">Column</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_128_14" HREF="terminal_interface-curses-panels__ads.htm#ref_117_14">Move</A></FONT> (<FONT COLOR=red><A NAME="ref_128_20" HREF="terminal_interface-curses-panels__ads.htm#ref_117_20">Pan</A></FONT>    : <A HREF="terminal_interface-curses-panels__ads.htm#ref_49_9">Panel</A>;
+                   <FONT COLOR=red><A NAME="ref_129_20" HREF="terminal_interface-curses-panels__ads.htm#ref_118_20">Line</A></FONT>   : <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
+                   <FONT COLOR=red><A NAME="ref_130_20" HREF="terminal_interface-curses-panels__ads.htm#ref_119_20">Column</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_132_16">Move</A></FONT> (<FONT COLOR=red><A NAME="ref_132_22" HREF="terminal_interface-curses-panels__adb.htm#ref_132_16">Pan</A></FONT>    : <A HREF="terminal_interface-curses-panels__ads.htm#ref_49_9">Panel</A>;
                      <FONT COLOR=red><A NAME="ref_133_22" HREF="terminal_interface-curses-panels__adb.htm#ref_132_16">Line</A></FONT>   : <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
diff -Naur ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-panels__ads.htm ncurses-5.7/doc/html/ada/terminal_interface-curses-panels__ads.htm
--- ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-panels__ads.htm	2008-10-11 17:36:31.000000000 -0400
+++ ncurses-5.7/doc/html/ada/terminal_interface-curses-panels__ads.htm	2011-01-08 18:13:50.375156842 -0500
@@ -12,7 +12,7 @@
 <FONT COLOR=green><EM>--                                 S P E C                                  --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-<FONT COLOR=green><EM>-- Copyright (c) 1998,2006 Free Software Foundation, Inc.                   --</EM></FONT>
+<FONT COLOR=green><EM>-- Copyright (c) 1998-2006,2009 Free Software Foundation, Inc.              --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>-- Permission is hereby granted, free of charge, to any person obtaining a  --</EM></FONT>
 <FONT COLOR=green><EM>-- copy of this software and associated documentation files (the            --</EM></FONT>
@@ -40,16 +40,16 @@
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <FONT COLOR=green><EM>--  Author:  Juergen Pfeifer, 1996</EM></FONT>
 <FONT COLOR=green><EM>--  Version Control:</EM></FONT>
-<FONT COLOR=green><EM>--  @Revision: 1.19 @</EM></FONT>
-<FONT COLOR=green><EM>--  @Date: 2006/06/25 14:30:22 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Revision: 1.20 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Date: 2009/12/26 17:38:58 @</EM></FONT>
 <FONT COLOR=green><EM>--  Binding Version 01.00</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <b>with</b> System;
 
 <b>package</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<FONT COLOR=red><A NAME="ref_44_35" HREF="terminal_interface-curses-panels__adb.htm#ref_45_40">Panels</A></FONT> <b>is</b>
    <b>pragma</b> Preelaborate (<A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-panels__ads.htm#ref_44_35">Panels</A>);
-   <b>pragma</b> Linker_Options ("-lpanelw");
-   <b>pragma</b> Linker_Options ("-lncursesw");
+   <b>pragma</b> Linker_Options ("-lpanel");
+   <b>pragma</b> Linker_Options ("-lncurses");
 
    <b>type</b> <FONT COLOR=red><A NAME="ref_49_9">Panel</A></FONT> <b>is</b> <b>private</b>;
 
@@ -79,17 +79,17 @@
    <FONT COLOR=green><EM>--  pragma Inline (New_Panel);</EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_3"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_77_14" HREF="terminal_interface-curses-panels__adb.htm#ref_63_14">Bottom</A></FONT> (<FONT COLOR=red><A NAME="ref_77_22" HREF="terminal_interface-curses-panels__adb.htm#ref_63_22">Pan</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-panels__ads.htm#ref_49_9">Panel</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_77_14" HREF="terminal_interface-curses-panels__adb.htm#ref_63_14">Bottom</A></FONT> (<FONT COLOR=red><A NAME="ref_77_22" HREF="terminal_interface-curses-panels__adb.htm#ref_63_22">Pan</A></FONT> : <A HREF="terminal_interface-curses-panels__ads.htm#ref_49_9">Panel</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/panel.3x.html">bottom_panel()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses-panels__ads.htm#ref_77_14">Bottom</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_4"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_82_14" HREF="terminal_interface-curses-panels__adb.htm#ref_73_14">Top</A></FONT> (<FONT COLOR=red><A NAME="ref_82_19" HREF="terminal_interface-curses-panels__adb.htm#ref_73_19">Pan</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-panels__ads.htm#ref_49_9">Panel</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_82_14" HREF="terminal_interface-curses-panels__adb.htm#ref_73_14">Top</A></FONT> (<FONT COLOR=red><A NAME="ref_82_19" HREF="terminal_interface-curses-panels__adb.htm#ref_73_19">Pan</A></FONT> : <A HREF="terminal_interface-curses-panels__ads.htm#ref_49_9">Panel</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/panel.3x.html">top_panel()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses-panels__ads.htm#ref_82_14">Top</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_5"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_87_14" HREF="terminal_interface-curses-panels__adb.htm#ref_83_14">Show</A></FONT> (<FONT COLOR=red><A NAME="ref_87_20" HREF="terminal_interface-curses-panels__adb.htm#ref_83_20">Pan</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-panels__ads.htm#ref_49_9">Panel</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_87_14" HREF="terminal_interface-curses-panels__adb.htm#ref_83_14">Show</A></FONT> (<FONT COLOR=red><A NAME="ref_87_20" HREF="terminal_interface-curses-panels__adb.htm#ref_83_20">Pan</A></FONT> : <A HREF="terminal_interface-curses-panels__ads.htm#ref_49_9">Panel</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/panel.3x.html">show_panel()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses-panels__ads.htm#ref_87_14">Show</A>);
 
@@ -99,7 +99,7 @@
    <b>pragma</b> Import (C, Update_Panels, "update_panels");
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_7"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_97_14" HREF="terminal_interface-curses-panels__adb.htm#ref_93_14">Hide</A></FONT> (<FONT COLOR=red><A NAME="ref_97_20" HREF="terminal_interface-curses-panels__adb.htm#ref_93_20">Pan</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-panels__ads.htm#ref_49_9">Panel</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_97_14" HREF="terminal_interface-curses-panels__adb.htm#ref_93_14">Hide</A></FONT> (<FONT COLOR=red><A NAME="ref_97_20" HREF="terminal_interface-curses-panels__adb.htm#ref_93_20">Pan</A></FONT> : <A HREF="terminal_interface-curses-panels__ads.htm#ref_49_9">Panel</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/panel.3x.html">hide_panel()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses-panels__ads.htm#ref_97_14">Hide</A>);
 
@@ -113,15 +113,15 @@
    <FONT COLOR=green><EM>--  pragma Inline (Panel_Window);</EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_10"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_111_14" HREF="terminal_interface-curses-panels__adb.htm#ref_116_14">Replace</A></FONT> (<FONT COLOR=red><A NAME="ref_111_23" HREF="terminal_interface-curses-panels__adb.htm#ref_116_23">Pan</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-panels__ads.htm#ref_49_9">Panel</A>;
-                      <FONT COLOR=red><A NAME="ref_112_23" HREF="terminal_interface-curses-panels__adb.htm#ref_117_23">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_111_14" HREF="terminal_interface-curses-panels__adb.htm#ref_116_14">Replace</A></FONT> (<FONT COLOR=red><A NAME="ref_111_23" HREF="terminal_interface-curses-panels__adb.htm#ref_116_23">Pan</A></FONT> : <A HREF="terminal_interface-curses-panels__ads.htm#ref_49_9">Panel</A>;
+                      <FONT COLOR=red><A NAME="ref_112_23" HREF="terminal_interface-curses-panels__adb.htm#ref_117_23">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/panel.3x.html">replace_panel()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses-panels__ads.htm#ref_111_14">Replace</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_11"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_117_14" HREF="terminal_interface-curses-panels__adb.htm#ref_128_14">Move</A></FONT> (<FONT COLOR=red><A NAME="ref_117_20" HREF="terminal_interface-curses-panels__adb.htm#ref_128_20">Pan</A></FONT>    : <b>in</b> <A HREF="terminal_interface-curses-panels__ads.htm#ref_49_9">Panel</A>;
-                   <FONT COLOR=red><A NAME="ref_118_20" HREF="terminal_interface-curses-panels__adb.htm#ref_129_20">Line</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
-                   <FONT COLOR=red><A NAME="ref_119_20" HREF="terminal_interface-curses-panels__adb.htm#ref_130_20">Column</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_117_14" HREF="terminal_interface-curses-panels__adb.htm#ref_128_14">Move</A></FONT> (<FONT COLOR=red><A NAME="ref_117_20" HREF="terminal_interface-curses-panels__adb.htm#ref_128_20">Pan</A></FONT>    : <A HREF="terminal_interface-curses-panels__ads.htm#ref_49_9">Panel</A>;
+                   <FONT COLOR=red><A NAME="ref_118_20" HREF="terminal_interface-curses-panels__adb.htm#ref_129_20">Line</A></FONT>   : <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
+                   <FONT COLOR=red><A NAME="ref_119_20" HREF="terminal_interface-curses-panels__adb.htm#ref_130_20">Column</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/panel.3x.html">move_panel()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses-panels__ads.htm#ref_117_14">Move</A>);
 
diff -Naur ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-putwin__adb.htm ncurses-5.7/doc/html/ada/terminal_interface-curses-putwin__adb.htm
--- ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-putwin__adb.htm	2006-09-23 16:31:32.000000000 -0400
+++ ncurses-5.7/doc/html/ada/terminal_interface-curses-putwin__adb.htm	2011-01-08 18:13:50.375156842 -0500
@@ -44,12 +44,12 @@
 <FONT COLOR=green><EM>--  Binding Version 01.00</EM></FONT>
 
 <b>with</b> Ada.Streams.Stream_IO.C_Streams;
-<b>with</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C_Streams;
+<b>with</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C_Streams;
 <b>with</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-aux__ads.htm#ref_50_35">Aux</A>; <b>use</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-aux__ads.htm#ref_50_35">Aux</A>;
 
 <b>package</b> <b>body</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<FONT COLOR=red><A NAME="ref_45_40" HREF="terminal_interface-curses-putwin__ads.htm#ref_43_35">PutWin</A></FONT> <b>is</b>
 
-   <b>package</b> <FONT COLOR=red><A NAME="ref_47_12">ICS</A></FONT> <b>renames</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C_Streams;
+   <b>package</b> <FONT COLOR=red><A NAME="ref_47_12">ICS</A></FONT> <b>renames</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C_Streams;
    <b>package</b> <FONT COLOR=red><A NAME="ref_48_12">ACS</A></FONT> <b>renames</b> Ada.Streams.Stream_IO.C_Streams;
    <b>use</b> <b>type</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
 
diff -Naur ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-termcap__adb.htm ncurses-5.7/doc/html/ada/terminal_interface-curses-termcap__adb.htm
--- ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-termcap__adb.htm	2008-10-11 17:36:31.000000000 -0400
+++ ncurses-5.7/doc/html/ada/terminal_interface-curses-termcap__adb.htm	2011-01-08 18:13:50.375156842 -0500
@@ -12,7 +12,7 @@
 <FONT COLOR=green><EM>--                                 B O D Y                                  --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-<FONT COLOR=green><EM>-- Copyright (c) 2000-2004,2006 Free Software Foundation, Inc.              --</EM></FONT>
+<FONT COLOR=green><EM>-- Copyright (c) 2000-2006,2009 Free Software Foundation, Inc.              --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>-- Permission is hereby granted, free of charge, to any person obtaining a  --</EM></FONT>
 <FONT COLOR=green><EM>-- copy of this software and associated documentation files (the            --</EM></FONT>
@@ -40,14 +40,14 @@
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <FONT COLOR=green><EM>--  Author:  Juergen Pfeifer, 1996</EM></FONT>
 <FONT COLOR=green><EM>--  Version Control:</EM></FONT>
-<FONT COLOR=green><EM>--  @Revision: 1.11 @</EM></FONT>
-<FONT COLOR=green><EM>--  @Date: 2006/06/25 14:30:22 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Revision: 1.12 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Date: 2009/12/26 17:38:58 @</EM></FONT>
 <FONT COLOR=green><EM>--  Binding Version 01.00</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 
 <b>with</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-aux__ads.htm#ref_50_35">Aux</A>; <b>use</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-aux__ads.htm#ref_50_35">Aux</A>;
-<b>with</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C; <b>use</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C;
-<b>with</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C.Strings; <b>use</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C.Strings;
+<b>with</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C; <b>use</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C;
+<b>with</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C.Strings; <b>use</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C.Strings;
 
 <b>package</b> <b>body</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<FONT COLOR=red><A NAME="ref_47_40" HREF="terminal_interface-curses-termcap__ads.htm#ref_42_35">Termcap</A></FONT> <b>is</b>
 
@@ -87,7 +87,7 @@
    <b>end</b> <A HREF="terminal_interface-curses-termcap__ads.htm#ref_63_13">Get_Flag</A>;
 
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_85_14" HREF="terminal_interface-curses-termcap__ads.htm#ref_67_14">Get_Number</A></FONT> (<FONT COLOR=red><A NAME="ref_85_26" HREF="terminal_interface-curses-termcap__ads.htm#ref_67_26">Name</A></FONT>   : <b>in</b>  String;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_85_14" HREF="terminal_interface-curses-termcap__ads.htm#ref_67_14">Get_Number</A></FONT> (<FONT COLOR=red><A NAME="ref_85_26" HREF="terminal_interface-curses-termcap__ads.htm#ref_67_26">Name</A></FONT>   : String;
                          <FONT COLOR=red><A NAME="ref_86_26" HREF="terminal_interface-curses-termcap__ads.htm#ref_68_26">Value</A></FONT>  : <b>out</b> Integer;
                          <FONT COLOR=red><A NAME="ref_87_26" HREF="terminal_interface-curses-termcap__ads.htm#ref_69_26">Result</A></FONT> : <b>out</b> Boolean)
    <b>is</b>
diff -Naur ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-terminfo__adb.htm ncurses-5.7/doc/html/ada/terminal_interface-curses-terminfo__adb.htm
--- ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-terminfo__adb.htm	2008-10-11 17:36:31.000000000 -0400
+++ ncurses-5.7/doc/html/ada/terminal_interface-curses-terminfo__adb.htm	2011-01-08 18:13:50.375156842 -0500
@@ -12,7 +12,7 @@
 <FONT COLOR=green><EM>--                                 B O D Y                                  --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-<FONT COLOR=green><EM>-- Copyright (c) 1998-2000,2006 Free Software Foundation, Inc.              --</EM></FONT>
+<FONT COLOR=green><EM>-- Copyright (c) 1998-2006,2009 Free Software Foundation, Inc.              --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>-- Permission is hereby granted, free of charge, to any person obtaining a  --</EM></FONT>
 <FONT COLOR=green><EM>-- copy of this software and associated documentation files (the            --</EM></FONT>
@@ -40,21 +40,21 @@
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <FONT COLOR=green><EM>--  Author:  Juergen Pfeifer, 1996</EM></FONT>
 <FONT COLOR=green><EM>--  Version Control:</EM></FONT>
-<FONT COLOR=green><EM>--  @Revision: 1.5 @</EM></FONT>
-<FONT COLOR=green><EM>--  @Date: 2006/06/25 14:30:22 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Revision: 1.6 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Date: 2009/12/26 17:38:58 @</EM></FONT>
 <FONT COLOR=green><EM>--  Binding Version 01.00</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 
 <b>with</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-aux__ads.htm#ref_50_35">Aux</A>; <b>use</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-aux__ads.htm#ref_50_35">Aux</A>;
-<b>with</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C; <b>use</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C;
-<b>with</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C.Strings; <b>use</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C.Strings;
+<b>with</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C; <b>use</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C;
+<b>with</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C.Strings; <b>use</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C.Strings;
 <b>with</b> Ada.Unchecked_Conversion;
 
 <b>package</b> <b>body</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<FONT COLOR=red><A NAME="ref_48_40" HREF="terminal_interface-curses-terminfo__ads.htm#ref_44_35">Terminfo</A></FONT> <b>is</b>
 
-   <b>function</b> <FONT COLOR=red><A NAME="ref_50_13" HREF="terminal_interface-curses-terminfo__adb.htm#ref_52_13">Is_MinusOne_Pointer</A></FONT> (<FONT COLOR=red><A NAME="ref_50_34" HREF="terminal_interface-curses-terminfo__adb.htm#ref_52_34">P</A></FONT> : <b>in</b> chars_ptr) <b>return</b> Boolean;
+   <b>function</b> <FONT COLOR=red><A NAME="ref_50_13" HREF="terminal_interface-curses-terminfo__adb.htm#ref_52_13">Is_MinusOne_Pointer</A></FONT> (<FONT COLOR=red><A NAME="ref_50_34" HREF="terminal_interface-curses-terminfo__adb.htm#ref_52_34">P</A></FONT> : chars_ptr) <b>return</b> Boolean;
 
-   <b>function</b> <FONT COLOR=red><A NAME="ref_52_13" HREF="terminal_interface-curses-terminfo__adb.htm#ref_50_13">Is_MinusOne_Pointer</A></FONT> (<FONT COLOR=red><A NAME="ref_52_34" HREF="terminal_interface-curses-terminfo__adb.htm#ref_50_34">P</A></FONT> : <b>in</b> chars_ptr) <b>return</b> Boolean <b>is</b>
+   <b>function</b> <FONT COLOR=red><A NAME="ref_52_13" HREF="terminal_interface-curses-terminfo__adb.htm#ref_50_13">Is_MinusOne_Pointer</A></FONT> (<FONT COLOR=red><A NAME="ref_52_34" HREF="terminal_interface-curses-terminfo__adb.htm#ref_50_34">P</A></FONT> : chars_ptr) <b>return</b> Boolean <b>is</b>
       <b>type</b> <FONT COLOR=red><A NAME="ref_53_12">Weird_Address</A></FONT> <b>is</b> <b>new</b> System.Storage_Elements.Integer_Address;
       <FONT COLOR=red><A NAME="ref_54_7">Invalid_Pointer</A></FONT> : <b>constant</b> <A HREF="terminal_interface-curses-terminfo__adb.htm#ref_53_12">Weird_Address</A> := -1;
       <b>function</b> To_Weird <b>is</b> <b>new</b> Ada.Unchecked_Conversion
diff -Naur ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-terminfo__ads.htm ncurses-5.7/doc/html/ada/terminal_interface-curses-terminfo__ads.htm
--- ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-terminfo__ads.htm	2008-10-11 17:36:31.000000000 -0400
+++ ncurses-5.7/doc/html/ada/terminal_interface-curses-terminfo__ads.htm	2011-01-08 18:13:50.375156842 -0500
@@ -44,7 +44,7 @@
 <FONT COLOR=green><EM>--  Binding Version 01.00</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 
-<b>with</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C;
+<b>with</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C;
 
 <b>package</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<FONT COLOR=red><A NAME="ref_44_35" HREF="terminal_interface-curses-terminfo__adb.htm#ref_48_40">Terminfo</A></FONT> <b>is</b>
    <b>pragma</b> Preelaborate (<A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-terminfo__ads.htm#ref_44_35">Terminfo</A>);
@@ -73,8 +73,8 @@
    <b>function</b> <FONT COLOR=red><A NAME="ref_68_13" HREF="terminal_interface-curses-terminfo__adb.htm#ref_126_13">Get_Number</A></FONT> (<FONT COLOR=red><A NAME="ref_68_25" HREF="terminal_interface-curses-terminfo__adb.htm#ref_126_25">Name</A></FONT> : String) <b>return</b> Integer;
    <FONT COLOR=green><EM>--  AKA: tigetnum()</EM></FONT>
 
-   <b>type</b> <FONT COLOR=red><A NAME="ref_71_9">putctype</A></FONT> <b>is</b> <b>access</b> <b>function</b> (<FONT COLOR=red><A NAME="ref_71_38">c</A></FONT> : <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C.int)
-                                    <b>return</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C.int;
+   <b>type</b> <FONT COLOR=red><A NAME="ref_71_9">putctype</A></FONT> <b>is</b> <b>access</b> <b>function</b> (<FONT COLOR=red><A NAME="ref_71_38">c</A></FONT> : <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C.int)
+                                    <b>return</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C.int;
    <b>pragma</b> Convention (C, <A HREF="terminal_interface-curses-terminfo__ads.htm#ref_71_9">putctype</A>);
 
    <FONT COLOR=green><EM>--  |</EM></FONT>
diff -Naur ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-text_io-aux__adb.htm ncurses-5.7/doc/html/ada/terminal_interface-curses-text_io-aux__adb.htm
--- ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-text_io-aux__adb.htm	2007-05-05 16:35:20.000000000 -0400
+++ ncurses-5.7/doc/html/ada/terminal_interface-curses-text_io-aux__adb.htm	2011-01-08 18:13:50.375156842 -0500
@@ -12,7 +12,7 @@
 <FONT COLOR=green><EM>--                                 B O D Y                                  --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-<FONT COLOR=green><EM>-- Copyright (c) 1998,2006 Free Software Foundation, Inc.                   --</EM></FONT>
+<FONT COLOR=green><EM>-- Copyright (c) 1998-2006,2009 Free Software Foundation, Inc.              --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>-- Permission is hereby granted, free of charge, to any person obtaining a  --</EM></FONT>
 <FONT COLOR=green><EM>-- copy of this software and associated documentation files (the            --</EM></FONT>
@@ -40,18 +40,18 @@
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <FONT COLOR=green><EM>--  Author:  Juergen Pfeifer, 1996</EM></FONT>
 <FONT COLOR=green><EM>--  Version Control:</EM></FONT>
-<FONT COLOR=green><EM>--  @Revision: 1.12 @</EM></FONT>
-<FONT COLOR=green><EM>--  @Date: 2006/06/25 14:24:40 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Revision: 1.13 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Date: 2009/12/26 17:38:58 @</EM></FONT>
 <FONT COLOR=green><EM>--  Binding Version 01.00</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <b>package</b> <b>body</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-text_io__ads.htm#ref_44_35">Text_IO</A>.<FONT COLOR=red><A NAME="ref_42_48" HREF="terminal_interface-curses-text_io-aux__ads.htm#ref_42_51">Aux</A></FONT> <b>is</b>
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_44_14" HREF="terminal_interface-curses-text_io-aux__ads.htm#ref_48_14">Put_Buf</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_45_7" HREF="terminal_interface-curses-text_io-aux__ads.htm#ref_49_7">Win</A></FONT>    : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
-      <FONT COLOR=red><A NAME="ref_46_7" HREF="terminal_interface-curses-text_io-aux__ads.htm#ref_50_7">Buf</A></FONT>    : <b>in</b> String;
-      <FONT COLOR=red><A NAME="ref_47_7" HREF="terminal_interface-curses-text_io-aux__ads.htm#ref_51_7">Width</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A>;
-      <FONT COLOR=red><A NAME="ref_48_7" HREF="terminal_interface-curses-text_io-aux__ads.htm#ref_52_7">Signal</A></FONT> : <b>in</b> Boolean := True;
-      <FONT COLOR=red><A NAME="ref_49_7" HREF="terminal_interface-curses-text_io-aux__ads.htm#ref_53_7">Ljust</A></FONT>  : <b>in</b> Boolean := False)
+     (<FONT COLOR=red><A NAME="ref_45_7" HREF="terminal_interface-curses-text_io-aux__ads.htm#ref_49_7">Win</A></FONT>    : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
+      <FONT COLOR=red><A NAME="ref_46_7" HREF="terminal_interface-curses-text_io-aux__ads.htm#ref_50_7">Buf</A></FONT>    : String;
+      <FONT COLOR=red><A NAME="ref_47_7" HREF="terminal_interface-curses-text_io-aux__ads.htm#ref_51_7">Width</A></FONT>  : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A>;
+      <FONT COLOR=red><A NAME="ref_48_7" HREF="terminal_interface-curses-text_io-aux__ads.htm#ref_52_7">Signal</A></FONT> : Boolean := True;
+      <FONT COLOR=red><A NAME="ref_49_7" HREF="terminal_interface-curses-text_io-aux__ads.htm#ref_53_7">Ljust</A></FONT>  : Boolean := False)
    <b>is</b>
       <FONT COLOR=red><A NAME="ref_51_7">L</A></FONT>   : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A>;
       <FONT COLOR=red><A NAME="ref_52_7">Len</A></FONT> : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A>;
diff -Naur ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-text_io-aux__ads.htm ncurses-5.7/doc/html/ada/terminal_interface-curses-text_io-aux__ads.htm
--- ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-text_io-aux__ads.htm	2006-09-23 16:31:32.000000000 -0400
+++ ncurses-5.7/doc/html/ada/terminal_interface-curses-text_io-aux__ads.htm	2011-01-08 18:13:50.375156842 -0500
@@ -12,7 +12,7 @@
 <FONT COLOR=green><EM>--                                 S P E C                                  --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-<FONT COLOR=green><EM>-- Copyright (c) 1998,2006 Free Software Foundation, Inc.                   --</EM></FONT>
+<FONT COLOR=green><EM>-- Copyright (c) 1998-2006,2009 Free Software Foundation, Inc.              --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>-- Permission is hereby granted, free of charge, to any person obtaining a  --</EM></FONT>
 <FONT COLOR=green><EM>-- copy of this software and associated documentation files (the            --</EM></FONT>
@@ -40,8 +40,8 @@
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <FONT COLOR=green><EM>--  Author:  Juergen Pfeifer, 1996</EM></FONT>
 <FONT COLOR=green><EM>--  Version Control:</EM></FONT>
-<FONT COLOR=green><EM>--  @Revision: 1.13 @</EM></FONT>
-<FONT COLOR=green><EM>--  @Date: 2006/06/25 14:24:40 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Revision: 1.14 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Date: 2009/12/26 17:38:58 @</EM></FONT>
 <FONT COLOR=green><EM>--  Binding Version 01.00</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <b>private</b> <b>package</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-text_io__ads.htm#ref_44_35">Text_IO</A>.<FONT COLOR=red><A NAME="ref_42_51" HREF="terminal_interface-curses-text_io-aux__adb.htm#ref_42_48">Aux</A></FONT> <b>is</b>
@@ -51,11 +51,11 @@
    <FONT COLOR=green><EM>--  and enumeration types.</EM></FONT>
    <FONT COLOR=green><EM>--</EM></FONT>
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_48_14" HREF="terminal_interface-curses-text_io-aux__adb.htm#ref_44_14">Put_Buf</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_49_7" HREF="terminal_interface-curses-text_io-aux__adb.htm#ref_45_7">Win</A></FONT>    : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;               <FONT COLOR=green><EM>-- The output window</EM></FONT>
-      <FONT COLOR=red><A NAME="ref_50_7" HREF="terminal_interface-curses-text_io-aux__adb.htm#ref_46_7">Buf</A></FONT>    : <b>in</b> String;               <FONT COLOR=green><EM>-- The buffer containing the text</EM></FONT>
-      <FONT COLOR=red><A NAME="ref_51_7" HREF="terminal_interface-curses-text_io-aux__adb.htm#ref_47_7">Width</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A>;                <FONT COLOR=green><EM>-- The width of the output field</EM></FONT>
-      <FONT COLOR=red><A NAME="ref_52_7" HREF="terminal_interface-curses-text_io-aux__adb.htm#ref_48_7">Signal</A></FONT> : <b>in</b> Boolean := True;      <FONT COLOR=green><EM>-- If true, we raise Layout_Error</EM></FONT>
-      <FONT COLOR=red><A NAME="ref_53_7" HREF="terminal_interface-curses-text_io-aux__adb.htm#ref_49_7">Ljust</A></FONT>  : <b>in</b> Boolean := False);    <FONT COLOR=green><EM>-- The Buf is left justified</EM></FONT>
+     (<FONT COLOR=red><A NAME="ref_49_7" HREF="terminal_interface-curses-text_io-aux__adb.htm#ref_45_7">Win</A></FONT>    : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;               <FONT COLOR=green><EM>-- The output window</EM></FONT>
+      <FONT COLOR=red><A NAME="ref_50_7" HREF="terminal_interface-curses-text_io-aux__adb.htm#ref_46_7">Buf</A></FONT>    : String;               <FONT COLOR=green><EM>-- The buffer containing the text</EM></FONT>
+      <FONT COLOR=red><A NAME="ref_51_7" HREF="terminal_interface-curses-text_io-aux__adb.htm#ref_47_7">Width</A></FONT>  : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A>;                <FONT COLOR=green><EM>-- The width of the output field</EM></FONT>
+      <FONT COLOR=red><A NAME="ref_52_7" HREF="terminal_interface-curses-text_io-aux__adb.htm#ref_48_7">Signal</A></FONT> : Boolean := True;      <FONT COLOR=green><EM>-- If true, we raise Layout_Error</EM></FONT>
+      <FONT COLOR=red><A NAME="ref_53_7" HREF="terminal_interface-curses-text_io-aux__adb.htm#ref_49_7">Ljust</A></FONT>  : Boolean := False);    <FONT COLOR=green><EM>-- The Buf is left justified</EM></FONT>
 
 <b>end</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-text_io__ads.htm#ref_44_35">Text_IO</A>.<A HREF="terminal_interface-curses-text_io-aux__ads.htm#ref_42_51">Aux</A>;
 </PRE></BODY></HTML>
diff -Naur ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-text_io-complex_io__adb.htm ncurses-5.7/doc/html/ada/terminal_interface-curses-text_io-complex_io__adb.htm
--- ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-text_io-complex_io__adb.htm	2008-10-11 17:36:31.000000000 -0400
+++ ncurses-5.7/doc/html/ada/terminal_interface-curses-text_io-complex_io__adb.htm	2011-01-08 18:13:50.375156842 -0500
@@ -12,7 +12,7 @@
 <FONT COLOR=green><EM>--                                 B O D Y                                  --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-<FONT COLOR=green><EM>-- Copyright (c) 1998 Free Software Foundation, Inc.                        --</EM></FONT>
+<FONT COLOR=green><EM>-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>-- Permission is hereby granted, free of charge, to any person obtaining a  --</EM></FONT>
 <FONT COLOR=green><EM>-- copy of this software and associated documentation files (the            --</EM></FONT>
@@ -40,7 +40,7 @@
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <FONT COLOR=green><EM>--  Author:  Juergen Pfeifer, 1996</EM></FONT>
 <FONT COLOR=green><EM>--  Version Control:</EM></FONT>
-<FONT COLOR=green><EM>--  @Revision: 1.10 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Revision: 1.11 @</EM></FONT>
 <FONT COLOR=green><EM>--  Binding Version 01.00</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <b>with</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-text_io__ads.htm#ref_44_35">Text_IO</A>.<A HREF="terminal_interface-curses-text_io-float_io__ads.htm#ref_44_43">Float_IO</A>;
@@ -51,11 +51,11 @@
      <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-text_io__ads.htm#ref_44_35">Text_IO</A>.<A HREF="terminal_interface-curses-text_io-float_io__ads.htm#ref_44_43">Float_IO</A> (Complex_Types.Real'Base);
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_48_14" HREF="terminal_interface-curses-text_io-complex_io__ads.htm#ref_54_14">Put</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_49_7" HREF="terminal_interface-curses-text_io-complex_io__ads.htm#ref_55_7">Win</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
-      Item : <b>in</b> Complex;
-      <FONT COLOR=red><A NAME="ref_51_7" HREF="terminal_interface-curses-text_io-complex_io__ads.htm#ref_57_7">Fore</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-complex_io__ads.htm#ref_50_4">Default_Fore</A>;
-      <FONT COLOR=red><A NAME="ref_52_7" HREF="terminal_interface-curses-text_io-complex_io__ads.htm#ref_58_7">Aft</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-complex_io__ads.htm#ref_51_4">Default_Aft</A>;
-      <FONT COLOR=red><A NAME="ref_53_7" HREF="terminal_interface-curses-text_io-complex_io__ads.htm#ref_59_7">Exp</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-complex_io__ads.htm#ref_52_4">Default_Exp</A>)
+     (<FONT COLOR=red><A NAME="ref_49_7" HREF="terminal_interface-curses-text_io-complex_io__ads.htm#ref_55_7">Win</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
+      Item : Complex;
+      <FONT COLOR=red><A NAME="ref_51_7" HREF="terminal_interface-curses-text_io-complex_io__ads.htm#ref_57_7">Fore</A></FONT> : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-complex_io__ads.htm#ref_50_4">Default_Fore</A>;
+      <FONT COLOR=red><A NAME="ref_52_7" HREF="terminal_interface-curses-text_io-complex_io__ads.htm#ref_58_7">Aft</A></FONT>  : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-complex_io__ads.htm#ref_51_4">Default_Aft</A>;
+      <FONT COLOR=red><A NAME="ref_53_7" HREF="terminal_interface-curses-text_io-complex_io__ads.htm#ref_59_7">Exp</A></FONT>  : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-complex_io__ads.htm#ref_52_4">Default_Exp</A>)
    <b>is</b>
    <b>begin</b>
       <A HREF="terminal_interface-curses-text_io__ads.htm#ref_108_14">Put</A> (<A HREF="terminal_interface-curses-text_io-complex_io__ads.htm#ref_55_7">Win</A>, '(');
@@ -66,10 +66,10 @@
    <b>end</b> <A HREF="terminal_interface-curses-text_io-complex_io__ads.htm#ref_54_14">Put</A>;
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_63_14" HREF="terminal_interface-curses-text_io-complex_io__ads.htm#ref_61_14">Put</A></FONT>
-     (Item : <b>in</b> Complex;
-      <FONT COLOR=red><A NAME="ref_65_7" HREF="terminal_interface-curses-text_io-complex_io__ads.htm#ref_63_7">Fore</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-complex_io__ads.htm#ref_50_4">Default_Fore</A>;
-      <FONT COLOR=red><A NAME="ref_66_7" HREF="terminal_interface-curses-text_io-complex_io__ads.htm#ref_64_7">Aft</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-complex_io__ads.htm#ref_51_4">Default_Aft</A>;
-      <FONT COLOR=red><A NAME="ref_67_7" HREF="terminal_interface-curses-text_io-complex_io__ads.htm#ref_65_7">Exp</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-complex_io__ads.htm#ref_52_4">Default_Exp</A>)
+     (Item : Complex;
+      <FONT COLOR=red><A NAME="ref_65_7" HREF="terminal_interface-curses-text_io-complex_io__ads.htm#ref_63_7">Fore</A></FONT> : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-complex_io__ads.htm#ref_50_4">Default_Fore</A>;
+      <FONT COLOR=red><A NAME="ref_66_7" HREF="terminal_interface-curses-text_io-complex_io__ads.htm#ref_64_7">Aft</A></FONT>  : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-complex_io__ads.htm#ref_51_4">Default_Aft</A>;
+      <FONT COLOR=red><A NAME="ref_67_7" HREF="terminal_interface-curses-text_io-complex_io__ads.htm#ref_65_7">Exp</A></FONT>  : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-complex_io__ads.htm#ref_52_4">Default_Exp</A>)
    <b>is</b>
    <b>begin</b>
       <A HREF="terminal_interface-curses-text_io-complex_io__ads.htm#ref_54_14">Put</A> (<A HREF="terminal_interface-curses-text_io__ads.htm#ref_62_13">Get_Window</A>, Item, <A HREF="terminal_interface-curses-text_io-complex_io__ads.htm#ref_63_7">Fore</A>, <A HREF="terminal_interface-curses-text_io-complex_io__ads.htm#ref_64_7">Aft</A>, <A HREF="terminal_interface-curses-text_io-complex_io__ads.htm#ref_65_7">Exp</A>);
diff -Naur ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-text_io-complex_io__ads.htm ncurses-5.7/doc/html/ada/terminal_interface-curses-text_io-complex_io__ads.htm
--- ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-text_io-complex_io__ads.htm	2008-10-11 17:36:31.000000000 -0400
+++ ncurses-5.7/doc/html/ada/terminal_interface-curses-text_io-complex_io__ads.htm	2011-01-08 18:13:50.375156842 -0500
@@ -12,7 +12,7 @@
 <FONT COLOR=green><EM>--                                 S P E C                                  --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-<FONT COLOR=green><EM>-- Copyright (c) 1998 Free Software Foundation, Inc.                        --</EM></FONT>
+<FONT COLOR=green><EM>-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>-- Permission is hereby granted, free of charge, to any person obtaining a  --</EM></FONT>
 <FONT COLOR=green><EM>-- copy of this software and associated documentation files (the            --</EM></FONT>
@@ -40,7 +40,7 @@
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <FONT COLOR=green><EM>--  Author:  Juergen Pfeifer, 1996</EM></FONT>
 <FONT COLOR=green><EM>--  Version Control:</EM></FONT>
-<FONT COLOR=green><EM>--  @Revision: 1.10 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Revision: 1.11 @</EM></FONT>
 <FONT COLOR=green><EM>--  Binding Version 01.00</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <b>with</b> Ada.Numerics.Generic_Complex_Types;
@@ -57,17 +57,17 @@
    <FONT COLOR=red><A NAME="ref_52_4">Default_Exp</A></FONT>  : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := 3;
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_54_14" HREF="terminal_interface-curses-text_io-complex_io__adb.htm#ref_48_14">Put</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_55_7" HREF="terminal_interface-curses-text_io-complex_io__adb.htm#ref_49_7">Win</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
-      <A HREF="terminal_interface-curses-text_io-complex_io__ads.htm#ref_54_14">Item</A> : <b>in</b> Complex;
-      <FONT COLOR=red><A NAME="ref_57_7" HREF="terminal_interface-curses-text_io-complex_io__adb.htm#ref_51_7">Fore</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-complex_io__ads.htm#ref_50_4">Default_Fore</A>;
-      <FONT COLOR=red><A NAME="ref_58_7" HREF="terminal_interface-curses-text_io-complex_io__adb.htm#ref_52_7">Aft</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-complex_io__ads.htm#ref_51_4">Default_Aft</A>;
-      <FONT COLOR=red><A NAME="ref_59_7" HREF="terminal_interface-curses-text_io-complex_io__adb.htm#ref_53_7">Exp</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-complex_io__ads.htm#ref_52_4">Default_Exp</A>);
+     (<FONT COLOR=red><A NAME="ref_55_7" HREF="terminal_interface-curses-text_io-complex_io__adb.htm#ref_49_7">Win</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
+      <A HREF="terminal_interface-curses-text_io-complex_io__ads.htm#ref_54_14">Item</A> : Complex;
+      <FONT COLOR=red><A NAME="ref_57_7" HREF="terminal_interface-curses-text_io-complex_io__adb.htm#ref_51_7">Fore</A></FONT> : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-complex_io__ads.htm#ref_50_4">Default_Fore</A>;
+      <FONT COLOR=red><A NAME="ref_58_7" HREF="terminal_interface-curses-text_io-complex_io__adb.htm#ref_52_7">Aft</A></FONT>  : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-complex_io__ads.htm#ref_51_4">Default_Aft</A>;
+      <FONT COLOR=red><A NAME="ref_59_7" HREF="terminal_interface-curses-text_io-complex_io__adb.htm#ref_53_7">Exp</A></FONT>  : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-complex_io__ads.htm#ref_52_4">Default_Exp</A>);
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_61_14" HREF="terminal_interface-curses-text_io-complex_io__adb.htm#ref_63_14">Put</A></FONT>
-     (<A HREF="terminal_interface-curses-text_io-complex_io__ads.htm#ref_61_14">Item</A> : <b>in</b> Complex;
-      <FONT COLOR=red><A NAME="ref_63_7" HREF="terminal_interface-curses-text_io-complex_io__adb.htm#ref_65_7">Fore</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-complex_io__ads.htm#ref_50_4">Default_Fore</A>;
-      <FONT COLOR=red><A NAME="ref_64_7" HREF="terminal_interface-curses-text_io-complex_io__adb.htm#ref_66_7">Aft</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-complex_io__ads.htm#ref_51_4">Default_Aft</A>;
-      <FONT COLOR=red><A NAME="ref_65_7" HREF="terminal_interface-curses-text_io-complex_io__adb.htm#ref_67_7">Exp</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-complex_io__ads.htm#ref_52_4">Default_Exp</A>);
+     (<A HREF="terminal_interface-curses-text_io-complex_io__ads.htm#ref_61_14">Item</A> : Complex;
+      <FONT COLOR=red><A NAME="ref_63_7" HREF="terminal_interface-curses-text_io-complex_io__adb.htm#ref_65_7">Fore</A></FONT> : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-complex_io__ads.htm#ref_50_4">Default_Fore</A>;
+      <FONT COLOR=red><A NAME="ref_64_7" HREF="terminal_interface-curses-text_io-complex_io__adb.htm#ref_66_7">Aft</A></FONT>  : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-complex_io__ads.htm#ref_51_4">Default_Aft</A>;
+      <FONT COLOR=red><A NAME="ref_65_7" HREF="terminal_interface-curses-text_io-complex_io__adb.htm#ref_67_7">Exp</A></FONT>  : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-complex_io__ads.htm#ref_52_4">Default_Exp</A>);
 
 <b>private</b>
    <b>pragma</b> Inline (Put);
diff -Naur ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-text_io-decimal_io__adb.htm ncurses-5.7/doc/html/ada/terminal_interface-curses-text_io-decimal_io__adb.htm
--- ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-text_io-decimal_io__adb.htm	2006-09-23 16:31:32.000000000 -0400
+++ ncurses-5.7/doc/html/ada/terminal_interface-curses-text_io-decimal_io__adb.htm	2011-01-08 18:13:50.375156842 -0500
@@ -12,7 +12,7 @@
 <FONT COLOR=green><EM>--                                 B O D Y                                  --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-<FONT COLOR=green><EM>-- Copyright (c) 1998 Free Software Foundation, Inc.                        --</EM></FONT>
+<FONT COLOR=green><EM>-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>-- Permission is hereby granted, free of charge, to any person obtaining a  --</EM></FONT>
 <FONT COLOR=green><EM>-- copy of this software and associated documentation files (the            --</EM></FONT>
@@ -40,7 +40,7 @@
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <FONT COLOR=green><EM>--  Author:  Juergen Pfeifer, 1996</EM></FONT>
 <FONT COLOR=green><EM>--  Version Control:</EM></FONT>
-<FONT COLOR=green><EM>--  @Revision: 1.10 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Revision: 1.11 @</EM></FONT>
 <FONT COLOR=green><EM>--  Binding Version 01.00</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <b>with</b> Ada.Text_IO;
@@ -52,11 +52,11 @@
    <b>package</b> DIO <b>is</b> <b>new</b> Ada.Text_IO.Decimal_IO (<A HREF="terminal_interface-curses-text_io-decimal_io__ads.htm#ref_42_9">Num</A>);
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_49_14" HREF="terminal_interface-curses-text_io-decimal_io__ads.htm#ref_50_14">Put</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_50_7" HREF="terminal_interface-curses-text_io-decimal_io__ads.htm#ref_51_7">Win</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
-      <FONT COLOR=red><A NAME="ref_51_7" HREF="terminal_interface-curses-text_io-decimal_io__ads.htm#ref_52_7">Item</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-text_io-decimal_io__ads.htm#ref_42_9">Num</A>;
-      <FONT COLOR=red><A NAME="ref_52_7" HREF="terminal_interface-curses-text_io-decimal_io__ads.htm#ref_53_7">Fore</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-decimal_io__ads.htm#ref_46_4">Default_Fore</A>;
-      <FONT COLOR=red><A NAME="ref_53_7" HREF="terminal_interface-curses-text_io-decimal_io__ads.htm#ref_54_7">Aft</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-decimal_io__ads.htm#ref_47_4">Default_Aft</A>;
-      <FONT COLOR=red><A NAME="ref_54_7" HREF="terminal_interface-curses-text_io-decimal_io__ads.htm#ref_55_7">Exp</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-decimal_io__ads.htm#ref_48_4">Default_Exp</A>)
+     (<FONT COLOR=red><A NAME="ref_50_7" HREF="terminal_interface-curses-text_io-decimal_io__ads.htm#ref_51_7">Win</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
+      <FONT COLOR=red><A NAME="ref_51_7" HREF="terminal_interface-curses-text_io-decimal_io__ads.htm#ref_52_7">Item</A></FONT> : <A HREF="terminal_interface-curses-text_io-decimal_io__ads.htm#ref_42_9">Num</A>;
+      <FONT COLOR=red><A NAME="ref_52_7" HREF="terminal_interface-curses-text_io-decimal_io__ads.htm#ref_53_7">Fore</A></FONT> : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-decimal_io__ads.htm#ref_46_4">Default_Fore</A>;
+      <FONT COLOR=red><A NAME="ref_53_7" HREF="terminal_interface-curses-text_io-decimal_io__ads.htm#ref_54_7">Aft</A></FONT>  : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-decimal_io__ads.htm#ref_47_4">Default_Aft</A>;
+      <FONT COLOR=red><A NAME="ref_54_7" HREF="terminal_interface-curses-text_io-decimal_io__ads.htm#ref_55_7">Exp</A></FONT>  : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-decimal_io__ads.htm#ref_48_4">Default_Exp</A>)
    <b>is</b>
       <FONT COLOR=red><A NAME="ref_56_7">Buf</A></FONT> : String (1 .. <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A>'Last);
       <FONT COLOR=red><A NAME="ref_57_7">Len</A></FONT> : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-decimal_io__ads.htm#ref_53_7">Fore</A> + 1 + <A HREF="terminal_interface-curses-text_io-decimal_io__ads.htm#ref_54_7">Aft</A>;
@@ -69,10 +69,10 @@
    <b>end</b> <A HREF="terminal_interface-curses-text_io-decimal_io__ads.htm#ref_50_14">Put</A>;
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_66_14" HREF="terminal_interface-curses-text_io-decimal_io__ads.htm#ref_57_14">Put</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_67_7" HREF="terminal_interface-curses-text_io-decimal_io__ads.htm#ref_58_7">Item</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-text_io-decimal_io__ads.htm#ref_42_9">Num</A>;
-      <FONT COLOR=red><A NAME="ref_68_7" HREF="terminal_interface-curses-text_io-decimal_io__ads.htm#ref_59_7">Fore</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-decimal_io__ads.htm#ref_46_4">Default_Fore</A>;
-      <FONT COLOR=red><A NAME="ref_69_7" HREF="terminal_interface-curses-text_io-decimal_io__ads.htm#ref_60_7">Aft</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-decimal_io__ads.htm#ref_47_4">Default_Aft</A>;
-      <FONT COLOR=red><A NAME="ref_70_7" HREF="terminal_interface-curses-text_io-decimal_io__ads.htm#ref_61_7">Exp</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-decimal_io__ads.htm#ref_48_4">Default_Exp</A>) <b>is</b>
+     (<FONT COLOR=red><A NAME="ref_67_7" HREF="terminal_interface-curses-text_io-decimal_io__ads.htm#ref_58_7">Item</A></FONT> : <A HREF="terminal_interface-curses-text_io-decimal_io__ads.htm#ref_42_9">Num</A>;
+      <FONT COLOR=red><A NAME="ref_68_7" HREF="terminal_interface-curses-text_io-decimal_io__ads.htm#ref_59_7">Fore</A></FONT> : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-decimal_io__ads.htm#ref_46_4">Default_Fore</A>;
+      <FONT COLOR=red><A NAME="ref_69_7" HREF="terminal_interface-curses-text_io-decimal_io__ads.htm#ref_60_7">Aft</A></FONT>  : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-decimal_io__ads.htm#ref_47_4">Default_Aft</A>;
+      <FONT COLOR=red><A NAME="ref_70_7" HREF="terminal_interface-curses-text_io-decimal_io__ads.htm#ref_61_7">Exp</A></FONT>  : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-decimal_io__ads.htm#ref_48_4">Default_Exp</A>) <b>is</b>
    <b>begin</b>
       <A HREF="terminal_interface-curses-text_io-decimal_io__ads.htm#ref_50_14">Put</A> (<A HREF="terminal_interface-curses-text_io__ads.htm#ref_62_13">Get_Window</A>, <A HREF="terminal_interface-curses-text_io-decimal_io__ads.htm#ref_58_7">Item</A>, <A HREF="terminal_interface-curses-text_io-decimal_io__ads.htm#ref_59_7">Fore</A>, <A HREF="terminal_interface-curses-text_io-decimal_io__ads.htm#ref_60_7">Aft</A>, <A HREF="terminal_interface-curses-text_io-decimal_io__ads.htm#ref_61_7">Exp</A>);
    <b>end</b> <A HREF="terminal_interface-curses-text_io-decimal_io__ads.htm#ref_57_14">Put</A>;
diff -Naur ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-text_io-decimal_io__ads.htm ncurses-5.7/doc/html/ada/terminal_interface-curses-text_io-decimal_io__ads.htm
--- ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-text_io-decimal_io__ads.htm	2006-09-23 16:31:32.000000000 -0400
+++ ncurses-5.7/doc/html/ada/terminal_interface-curses-text_io-decimal_io__ads.htm	2011-01-08 18:13:50.379156875 -0500
@@ -12,7 +12,7 @@
 <FONT COLOR=green><EM>--                                 S P E C                                  --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-<FONT COLOR=green><EM>-- Copyright (c) 1998 Free Software Foundation, Inc.                        --</EM></FONT>
+<FONT COLOR=green><EM>-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>-- Permission is hereby granted, free of charge, to any person obtaining a  --</EM></FONT>
 <FONT COLOR=green><EM>-- copy of this software and associated documentation files (the            --</EM></FONT>
@@ -40,7 +40,7 @@
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <FONT COLOR=green><EM>--  Author:  Juergen Pfeifer, 1996</EM></FONT>
 <FONT COLOR=green><EM>--  Version Control:</EM></FONT>
-<FONT COLOR=green><EM>--  @Revision: 1.11 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Revision: 1.12 @</EM></FONT>
 <FONT COLOR=green><EM>--  Binding Version 01.00</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <b>generic</b>
@@ -53,17 +53,17 @@
    <FONT COLOR=red><A NAME="ref_48_4">Default_Exp</A></FONT>  : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := 0;
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_50_14" HREF="terminal_interface-curses-text_io-decimal_io__adb.htm#ref_49_14">Put</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_51_7" HREF="terminal_interface-curses-text_io-decimal_io__adb.htm#ref_50_7">Win</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
-      <FONT COLOR=red><A NAME="ref_52_7" HREF="terminal_interface-curses-text_io-decimal_io__adb.htm#ref_51_7">Item</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-text_io-decimal_io__ads.htm#ref_42_9">Num</A>;
-      <FONT COLOR=red><A NAME="ref_53_7" HREF="terminal_interface-curses-text_io-decimal_io__adb.htm#ref_52_7">Fore</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-decimal_io__ads.htm#ref_46_4">Default_Fore</A>;
-      <FONT COLOR=red><A NAME="ref_54_7" HREF="terminal_interface-curses-text_io-decimal_io__adb.htm#ref_53_7">Aft</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-decimal_io__ads.htm#ref_47_4">Default_Aft</A>;
-      <FONT COLOR=red><A NAME="ref_55_7" HREF="terminal_interface-curses-text_io-decimal_io__adb.htm#ref_54_7">Exp</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-decimal_io__ads.htm#ref_48_4">Default_Exp</A>);
+     (<FONT COLOR=red><A NAME="ref_51_7" HREF="terminal_interface-curses-text_io-decimal_io__adb.htm#ref_50_7">Win</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
+      <FONT COLOR=red><A NAME="ref_52_7" HREF="terminal_interface-curses-text_io-decimal_io__adb.htm#ref_51_7">Item</A></FONT> : <A HREF="terminal_interface-curses-text_io-decimal_io__ads.htm#ref_42_9">Num</A>;
+      <FONT COLOR=red><A NAME="ref_53_7" HREF="terminal_interface-curses-text_io-decimal_io__adb.htm#ref_52_7">Fore</A></FONT> : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-decimal_io__ads.htm#ref_46_4">Default_Fore</A>;
+      <FONT COLOR=red><A NAME="ref_54_7" HREF="terminal_interface-curses-text_io-decimal_io__adb.htm#ref_53_7">Aft</A></FONT>  : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-decimal_io__ads.htm#ref_47_4">Default_Aft</A>;
+      <FONT COLOR=red><A NAME="ref_55_7" HREF="terminal_interface-curses-text_io-decimal_io__adb.htm#ref_54_7">Exp</A></FONT>  : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-decimal_io__ads.htm#ref_48_4">Default_Exp</A>);
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_57_14" HREF="terminal_interface-curses-text_io-decimal_io__adb.htm#ref_66_14">Put</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_58_7" HREF="terminal_interface-curses-text_io-decimal_io__adb.htm#ref_67_7">Item</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-text_io-decimal_io__ads.htm#ref_42_9">Num</A>;
-      <FONT COLOR=red><A NAME="ref_59_7" HREF="terminal_interface-curses-text_io-decimal_io__adb.htm#ref_68_7">Fore</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-decimal_io__ads.htm#ref_46_4">Default_Fore</A>;
-      <FONT COLOR=red><A NAME="ref_60_7" HREF="terminal_interface-curses-text_io-decimal_io__adb.htm#ref_69_7">Aft</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-decimal_io__ads.htm#ref_47_4">Default_Aft</A>;
-      <FONT COLOR=red><A NAME="ref_61_7" HREF="terminal_interface-curses-text_io-decimal_io__adb.htm#ref_70_7">Exp</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-decimal_io__ads.htm#ref_48_4">Default_Exp</A>);
+     (<FONT COLOR=red><A NAME="ref_58_7" HREF="terminal_interface-curses-text_io-decimal_io__adb.htm#ref_67_7">Item</A></FONT> : <A HREF="terminal_interface-curses-text_io-decimal_io__ads.htm#ref_42_9">Num</A>;
+      <FONT COLOR=red><A NAME="ref_59_7" HREF="terminal_interface-curses-text_io-decimal_io__adb.htm#ref_68_7">Fore</A></FONT> : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-decimal_io__ads.htm#ref_46_4">Default_Fore</A>;
+      <FONT COLOR=red><A NAME="ref_60_7" HREF="terminal_interface-curses-text_io-decimal_io__adb.htm#ref_69_7">Aft</A></FONT>  : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-decimal_io__ads.htm#ref_47_4">Default_Aft</A>;
+      <FONT COLOR=red><A NAME="ref_61_7" HREF="terminal_interface-curses-text_io-decimal_io__adb.htm#ref_70_7">Exp</A></FONT>  : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-decimal_io__ads.htm#ref_48_4">Default_Exp</A>);
 
 <b>private</b>
    <b>pragma</b> Inline (Put);
diff -Naur ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-text_io-enumeration_io__adb.htm ncurses-5.7/doc/html/ada/terminal_interface-curses-text_io-enumeration_io__adb.htm
--- ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-text_io-enumeration_io__adb.htm	2006-09-23 16:31:32.000000000 -0400
+++ ncurses-5.7/doc/html/ada/terminal_interface-curses-text_io-enumeration_io__adb.htm	2011-01-08 18:13:50.379156875 -0500
@@ -12,7 +12,7 @@
 <FONT COLOR=green><EM>--                                 B O D Y                                  --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-<FONT COLOR=green><EM>-- Copyright (c) 1998 Free Software Foundation, Inc.                        --</EM></FONT>
+<FONT COLOR=green><EM>-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>-- Permission is hereby granted, free of charge, to any person obtaining a  --</EM></FONT>
 <FONT COLOR=green><EM>-- copy of this software and associated documentation files (the            --</EM></FONT>
@@ -40,7 +40,7 @@
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <FONT COLOR=green><EM>--  Author:  Juergen Pfeifer, 1996</EM></FONT>
 <FONT COLOR=green><EM>--  Version Control:</EM></FONT>
-<FONT COLOR=green><EM>--  @Revision: 1.10 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Revision: 1.11 @</EM></FONT>
 <FONT COLOR=green><EM>--  Binding Version 01.00</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <b>with</b> Ada.Text_IO;
@@ -53,10 +53,10 @@
    <b>package</b> EIO <b>is</b> <b>new</b> Ada.Text_IO.Enumeration_IO (<A HREF="terminal_interface-curses-text_io-enumeration_io__ads.htm#ref_42_9">Enum</A>);
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_50_14" HREF="terminal_interface-curses-text_io-enumeration_io__ads.htm#ref_49_14">Put</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_51_7" HREF="terminal_interface-curses-text_io-enumeration_io__ads.htm#ref_50_7">Win</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
-      <FONT COLOR=red><A NAME="ref_52_7" HREF="terminal_interface-curses-text_io-enumeration_io__ads.htm#ref_51_7">Item</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-text_io-enumeration_io__ads.htm#ref_42_9">Enum</A>;
-      <FONT COLOR=red><A NAME="ref_53_7" HREF="terminal_interface-curses-text_io-enumeration_io__ads.htm#ref_52_7">Width</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-enumeration_io__ads.htm#ref_46_4">Default_Width</A>;
-      <FONT COLOR=red><A NAME="ref_54_7" HREF="terminal_interface-curses-text_io-enumeration_io__ads.htm#ref_53_7">Set</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_53_9">Type_Set</A> := <A HREF="terminal_interface-curses-text_io-enumeration_io__ads.htm#ref_47_4">Default_Setting</A>)
+     (<FONT COLOR=red><A NAME="ref_51_7" HREF="terminal_interface-curses-text_io-enumeration_io__ads.htm#ref_50_7">Win</A></FONT>   : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
+      <FONT COLOR=red><A NAME="ref_52_7" HREF="terminal_interface-curses-text_io-enumeration_io__ads.htm#ref_51_7">Item</A></FONT>  : <A HREF="terminal_interface-curses-text_io-enumeration_io__ads.htm#ref_42_9">Enum</A>;
+      <FONT COLOR=red><A NAME="ref_53_7" HREF="terminal_interface-curses-text_io-enumeration_io__ads.htm#ref_52_7">Width</A></FONT> : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-enumeration_io__ads.htm#ref_46_4">Default_Width</A>;
+      <FONT COLOR=red><A NAME="ref_54_7" HREF="terminal_interface-curses-text_io-enumeration_io__ads.htm#ref_53_7">Set</A></FONT>   : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_53_9">Type_Set</A> := <A HREF="terminal_interface-curses-text_io-enumeration_io__ads.htm#ref_47_4">Default_Setting</A>)
    <b>is</b>
       <FONT COLOR=red><A NAME="ref_56_7">Buf</A></FONT>  : String (1 .. <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A>'Last);
       <FONT COLOR=red><A NAME="ref_57_7">Tset</A></FONT> : Ada.Text_IO.Type_Set;
@@ -74,9 +74,9 @@
    <b>end</b> <A HREF="terminal_interface-curses-text_io-enumeration_io__ads.htm#ref_49_14">Put</A>;
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_71_14" HREF="terminal_interface-curses-text_io-enumeration_io__ads.htm#ref_55_14">Put</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_72_7" HREF="terminal_interface-curses-text_io-enumeration_io__ads.htm#ref_56_7">Item</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-text_io-enumeration_io__ads.htm#ref_42_9">Enum</A>;
-      <FONT COLOR=red><A NAME="ref_73_7" HREF="terminal_interface-curses-text_io-enumeration_io__ads.htm#ref_57_7">Width</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-enumeration_io__ads.htm#ref_46_4">Default_Width</A>;
-      <FONT COLOR=red><A NAME="ref_74_7" HREF="terminal_interface-curses-text_io-enumeration_io__ads.htm#ref_58_7">Set</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_53_9">Type_Set</A> := <A HREF="terminal_interface-curses-text_io-enumeration_io__ads.htm#ref_47_4">Default_Setting</A>)
+     (<FONT COLOR=red><A NAME="ref_72_7" HREF="terminal_interface-curses-text_io-enumeration_io__ads.htm#ref_56_7">Item</A></FONT>  : <A HREF="terminal_interface-curses-text_io-enumeration_io__ads.htm#ref_42_9">Enum</A>;
+      <FONT COLOR=red><A NAME="ref_73_7" HREF="terminal_interface-curses-text_io-enumeration_io__ads.htm#ref_57_7">Width</A></FONT> : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-enumeration_io__ads.htm#ref_46_4">Default_Width</A>;
+      <FONT COLOR=red><A NAME="ref_74_7" HREF="terminal_interface-curses-text_io-enumeration_io__ads.htm#ref_58_7">Set</A></FONT>   : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_53_9">Type_Set</A> := <A HREF="terminal_interface-curses-text_io-enumeration_io__ads.htm#ref_47_4">Default_Setting</A>)
    <b>is</b>
    <b>begin</b>
       <A HREF="terminal_interface-curses-text_io-enumeration_io__ads.htm#ref_49_14">Put</A> (<A HREF="terminal_interface-curses-text_io__ads.htm#ref_62_13">Get_Window</A>, <A HREF="terminal_interface-curses-text_io-enumeration_io__ads.htm#ref_56_7">Item</A>, <A HREF="terminal_interface-curses-text_io-enumeration_io__ads.htm#ref_57_7">Width</A>, <A HREF="terminal_interface-curses-text_io-enumeration_io__ads.htm#ref_58_7">Set</A>);
diff -Naur ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-text_io-enumeration_io__ads.htm ncurses-5.7/doc/html/ada/terminal_interface-curses-text_io-enumeration_io__ads.htm
--- ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-text_io-enumeration_io__ads.htm	2006-09-23 16:31:32.000000000 -0400
+++ ncurses-5.7/doc/html/ada/terminal_interface-curses-text_io-enumeration_io__ads.htm	2011-01-08 18:13:50.379156875 -0500
@@ -12,7 +12,7 @@
 <FONT COLOR=green><EM>--                                 S P E C                                  --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-<FONT COLOR=green><EM>-- Copyright (c) 1998 Free Software Foundation, Inc.                        --</EM></FONT>
+<FONT COLOR=green><EM>-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>-- Permission is hereby granted, free of charge, to any person obtaining a  --</EM></FONT>
 <FONT COLOR=green><EM>-- copy of this software and associated documentation files (the            --</EM></FONT>
@@ -40,7 +40,7 @@
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <FONT COLOR=green><EM>--  Author:  Juergen Pfeifer, 1996</EM></FONT>
 <FONT COLOR=green><EM>--  Version Control:</EM></FONT>
-<FONT COLOR=green><EM>--  @Revision: 1.11 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Revision: 1.12 @</EM></FONT>
 <FONT COLOR=green><EM>--  Binding Version 01.00</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <b>generic</b>
@@ -52,15 +52,15 @@
    <FONT COLOR=red><A NAME="ref_47_4">Default_Setting</A></FONT> : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_53_9">Type_Set</A> := <A HREF="terminal_interface-curses-text_io__ads.htm#ref_53_46">Mixed_Case</A>;
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_49_14" HREF="terminal_interface-curses-text_io-enumeration_io__adb.htm#ref_50_14">Put</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_50_7" HREF="terminal_interface-curses-text_io-enumeration_io__adb.htm#ref_51_7">Win</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
-      <FONT COLOR=red><A NAME="ref_51_7" HREF="terminal_interface-curses-text_io-enumeration_io__adb.htm#ref_52_7">Item</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-text_io-enumeration_io__ads.htm#ref_42_9">Enum</A>;
-      <FONT COLOR=red><A NAME="ref_52_7" HREF="terminal_interface-curses-text_io-enumeration_io__adb.htm#ref_53_7">Width</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-enumeration_io__ads.htm#ref_46_4">Default_Width</A>;
-      <FONT COLOR=red><A NAME="ref_53_7" HREF="terminal_interface-curses-text_io-enumeration_io__adb.htm#ref_54_7">Set</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_53_9">Type_Set</A> := <A HREF="terminal_interface-curses-text_io-enumeration_io__ads.htm#ref_47_4">Default_Setting</A>);
+     (<FONT COLOR=red><A NAME="ref_50_7" HREF="terminal_interface-curses-text_io-enumeration_io__adb.htm#ref_51_7">Win</A></FONT>   : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
+      <FONT COLOR=red><A NAME="ref_51_7" HREF="terminal_interface-curses-text_io-enumeration_io__adb.htm#ref_52_7">Item</A></FONT>  : <A HREF="terminal_interface-curses-text_io-enumeration_io__ads.htm#ref_42_9">Enum</A>;
+      <FONT COLOR=red><A NAME="ref_52_7" HREF="terminal_interface-curses-text_io-enumeration_io__adb.htm#ref_53_7">Width</A></FONT> : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-enumeration_io__ads.htm#ref_46_4">Default_Width</A>;
+      <FONT COLOR=red><A NAME="ref_53_7" HREF="terminal_interface-curses-text_io-enumeration_io__adb.htm#ref_54_7">Set</A></FONT>   : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_53_9">Type_Set</A> := <A HREF="terminal_interface-curses-text_io-enumeration_io__ads.htm#ref_47_4">Default_Setting</A>);
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_55_14" HREF="terminal_interface-curses-text_io-enumeration_io__adb.htm#ref_71_14">Put</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_56_7" HREF="terminal_interface-curses-text_io-enumeration_io__adb.htm#ref_72_7">Item</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-text_io-enumeration_io__ads.htm#ref_42_9">Enum</A>;
-      <FONT COLOR=red><A NAME="ref_57_7" HREF="terminal_interface-curses-text_io-enumeration_io__adb.htm#ref_73_7">Width</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-enumeration_io__ads.htm#ref_46_4">Default_Width</A>;
-      <FONT COLOR=red><A NAME="ref_58_7" HREF="terminal_interface-curses-text_io-enumeration_io__adb.htm#ref_74_7">Set</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_53_9">Type_Set</A> := <A HREF="terminal_interface-curses-text_io-enumeration_io__ads.htm#ref_47_4">Default_Setting</A>);
+     (<FONT COLOR=red><A NAME="ref_56_7" HREF="terminal_interface-curses-text_io-enumeration_io__adb.htm#ref_72_7">Item</A></FONT>  : <A HREF="terminal_interface-curses-text_io-enumeration_io__ads.htm#ref_42_9">Enum</A>;
+      <FONT COLOR=red><A NAME="ref_57_7" HREF="terminal_interface-curses-text_io-enumeration_io__adb.htm#ref_73_7">Width</A></FONT> : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-enumeration_io__ads.htm#ref_46_4">Default_Width</A>;
+      <FONT COLOR=red><A NAME="ref_58_7" HREF="terminal_interface-curses-text_io-enumeration_io__adb.htm#ref_74_7">Set</A></FONT>   : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_53_9">Type_Set</A> := <A HREF="terminal_interface-curses-text_io-enumeration_io__ads.htm#ref_47_4">Default_Setting</A>);
 
 <b>private</b>
    <b>pragma</b> Inline (Put);
diff -Naur ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-text_io-fixed_io__adb.htm ncurses-5.7/doc/html/ada/terminal_interface-curses-text_io-fixed_io__adb.htm
--- ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-text_io-fixed_io__adb.htm	2006-09-23 16:31:32.000000000 -0400
+++ ncurses-5.7/doc/html/ada/terminal_interface-curses-text_io-fixed_io__adb.htm	2011-01-08 18:13:50.379156875 -0500
@@ -12,7 +12,7 @@
 <FONT COLOR=green><EM>--                                 B O D Y                                  --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-<FONT COLOR=green><EM>-- Copyright (c) 1998 Free Software Foundation, Inc.                        --</EM></FONT>
+<FONT COLOR=green><EM>-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>-- Permission is hereby granted, free of charge, to any person obtaining a  --</EM></FONT>
 <FONT COLOR=green><EM>-- copy of this software and associated documentation files (the            --</EM></FONT>
@@ -40,7 +40,7 @@
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <FONT COLOR=green><EM>--  Author:  Juergen Pfeifer, 1996</EM></FONT>
 <FONT COLOR=green><EM>--  Version Control:</EM></FONT>
-<FONT COLOR=green><EM>--  @Revision: 1.10 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Revision: 1.11 @</EM></FONT>
 <FONT COLOR=green><EM>--  Binding Version 01.00</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <b>with</b> Ada.Text_IO;
@@ -52,11 +52,11 @@
    <b>package</b> FIXIO <b>is</b> <b>new</b> Ada.Text_IO.Fixed_IO (<A HREF="terminal_interface-curses-text_io-fixed_io__ads.htm#ref_42_9">Num</A>);
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_49_14" HREF="terminal_interface-curses-text_io-fixed_io__ads.htm#ref_50_14">Put</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_50_7" HREF="terminal_interface-curses-text_io-fixed_io__ads.htm#ref_51_7">Win</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
-      <FONT COLOR=red><A NAME="ref_51_7" HREF="terminal_interface-curses-text_io-fixed_io__ads.htm#ref_52_7">Item</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-text_io-fixed_io__ads.htm#ref_42_9">Num</A>;
-      <FONT COLOR=red><A NAME="ref_52_7" HREF="terminal_interface-curses-text_io-fixed_io__ads.htm#ref_53_7">Fore</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-fixed_io__ads.htm#ref_46_4">Default_Fore</A>;
-      <FONT COLOR=red><A NAME="ref_53_7" HREF="terminal_interface-curses-text_io-fixed_io__ads.htm#ref_54_7">Aft</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-fixed_io__ads.htm#ref_47_4">Default_Aft</A>;
-      <FONT COLOR=red><A NAME="ref_54_7" HREF="terminal_interface-curses-text_io-fixed_io__ads.htm#ref_55_7">Exp</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-fixed_io__ads.htm#ref_48_4">Default_Exp</A>)
+     (<FONT COLOR=red><A NAME="ref_50_7" HREF="terminal_interface-curses-text_io-fixed_io__ads.htm#ref_51_7">Win</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
+      <FONT COLOR=red><A NAME="ref_51_7" HREF="terminal_interface-curses-text_io-fixed_io__ads.htm#ref_52_7">Item</A></FONT> : <A HREF="terminal_interface-curses-text_io-fixed_io__ads.htm#ref_42_9">Num</A>;
+      <FONT COLOR=red><A NAME="ref_52_7" HREF="terminal_interface-curses-text_io-fixed_io__ads.htm#ref_53_7">Fore</A></FONT> : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-fixed_io__ads.htm#ref_46_4">Default_Fore</A>;
+      <FONT COLOR=red><A NAME="ref_53_7" HREF="terminal_interface-curses-text_io-fixed_io__ads.htm#ref_54_7">Aft</A></FONT>  : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-fixed_io__ads.htm#ref_47_4">Default_Aft</A>;
+      <FONT COLOR=red><A NAME="ref_54_7" HREF="terminal_interface-curses-text_io-fixed_io__ads.htm#ref_55_7">Exp</A></FONT>  : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-fixed_io__ads.htm#ref_48_4">Default_Exp</A>)
    <b>is</b>
       <FONT COLOR=red><A NAME="ref_56_7">Buf</A></FONT> : String (1 .. <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A>'Last);
       <FONT COLOR=red><A NAME="ref_57_7">Len</A></FONT> : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-fixed_io__ads.htm#ref_53_7">Fore</A> + 1 + <A HREF="terminal_interface-curses-text_io-fixed_io__ads.htm#ref_54_7">Aft</A>;
@@ -69,10 +69,10 @@
    <b>end</b> <A HREF="terminal_interface-curses-text_io-fixed_io__ads.htm#ref_50_14">Put</A>;
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_66_14" HREF="terminal_interface-curses-text_io-fixed_io__ads.htm#ref_57_14">Put</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_67_7" HREF="terminal_interface-curses-text_io-fixed_io__ads.htm#ref_58_7">Item</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-text_io-fixed_io__ads.htm#ref_42_9">Num</A>;
-      <FONT COLOR=red><A NAME="ref_68_7" HREF="terminal_interface-curses-text_io-fixed_io__ads.htm#ref_59_7">Fore</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-fixed_io__ads.htm#ref_46_4">Default_Fore</A>;
-      <FONT COLOR=red><A NAME="ref_69_7" HREF="terminal_interface-curses-text_io-fixed_io__ads.htm#ref_60_7">Aft</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-fixed_io__ads.htm#ref_47_4">Default_Aft</A>;
-      <FONT COLOR=red><A NAME="ref_70_7" HREF="terminal_interface-curses-text_io-fixed_io__ads.htm#ref_61_7">Exp</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-fixed_io__ads.htm#ref_48_4">Default_Exp</A>) <b>is</b>
+     (<FONT COLOR=red><A NAME="ref_67_7" HREF="terminal_interface-curses-text_io-fixed_io__ads.htm#ref_58_7">Item</A></FONT> : <A HREF="terminal_interface-curses-text_io-fixed_io__ads.htm#ref_42_9">Num</A>;
+      <FONT COLOR=red><A NAME="ref_68_7" HREF="terminal_interface-curses-text_io-fixed_io__ads.htm#ref_59_7">Fore</A></FONT> : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-fixed_io__ads.htm#ref_46_4">Default_Fore</A>;
+      <FONT COLOR=red><A NAME="ref_69_7" HREF="terminal_interface-curses-text_io-fixed_io__ads.htm#ref_60_7">Aft</A></FONT>  : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-fixed_io__ads.htm#ref_47_4">Default_Aft</A>;
+      <FONT COLOR=red><A NAME="ref_70_7" HREF="terminal_interface-curses-text_io-fixed_io__ads.htm#ref_61_7">Exp</A></FONT>  : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-fixed_io__ads.htm#ref_48_4">Default_Exp</A>) <b>is</b>
    <b>begin</b>
       <A HREF="terminal_interface-curses-text_io-fixed_io__ads.htm#ref_50_14">Put</A> (<A HREF="terminal_interface-curses-text_io__ads.htm#ref_62_13">Get_Window</A>, <A HREF="terminal_interface-curses-text_io-fixed_io__ads.htm#ref_58_7">Item</A>, <A HREF="terminal_interface-curses-text_io-fixed_io__ads.htm#ref_59_7">Fore</A>, <A HREF="terminal_interface-curses-text_io-fixed_io__ads.htm#ref_60_7">Aft</A>, <A HREF="terminal_interface-curses-text_io-fixed_io__ads.htm#ref_61_7">Exp</A>);
    <b>end</b> <A HREF="terminal_interface-curses-text_io-fixed_io__ads.htm#ref_57_14">Put</A>;
diff -Naur ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-text_io-fixed_io__ads.htm ncurses-5.7/doc/html/ada/terminal_interface-curses-text_io-fixed_io__ads.htm
--- ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-text_io-fixed_io__ads.htm	2006-09-23 16:31:32.000000000 -0400
+++ ncurses-5.7/doc/html/ada/terminal_interface-curses-text_io-fixed_io__ads.htm	2011-01-08 18:13:50.379156875 -0500
@@ -12,7 +12,7 @@
 <FONT COLOR=green><EM>--                                 S P E C                                  --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-<FONT COLOR=green><EM>-- Copyright (c) 1998 Free Software Foundation, Inc.                        --</EM></FONT>
+<FONT COLOR=green><EM>-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>-- Permission is hereby granted, free of charge, to any person obtaining a  --</EM></FONT>
 <FONT COLOR=green><EM>-- copy of this software and associated documentation files (the            --</EM></FONT>
@@ -40,7 +40,7 @@
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <FONT COLOR=green><EM>--  Author:  Juergen Pfeifer, 1996</EM></FONT>
 <FONT COLOR=green><EM>--  Version Control:</EM></FONT>
-<FONT COLOR=green><EM>--  @Revision: 1.11 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Revision: 1.12 @</EM></FONT>
 <FONT COLOR=green><EM>--  Binding Version 01.00</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <b>generic</b>
@@ -53,17 +53,17 @@
    <FONT COLOR=red><A NAME="ref_48_4">Default_Exp</A></FONT>  : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := 0;
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_50_14" HREF="terminal_interface-curses-text_io-fixed_io__adb.htm#ref_49_14">Put</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_51_7" HREF="terminal_interface-curses-text_io-fixed_io__adb.htm#ref_50_7">Win</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
-      <FONT COLOR=red><A NAME="ref_52_7" HREF="terminal_interface-curses-text_io-fixed_io__adb.htm#ref_51_7">Item</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-text_io-fixed_io__ads.htm#ref_42_9">Num</A>;
-      <FONT COLOR=red><A NAME="ref_53_7" HREF="terminal_interface-curses-text_io-fixed_io__adb.htm#ref_52_7">Fore</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-fixed_io__ads.htm#ref_46_4">Default_Fore</A>;
-      <FONT COLOR=red><A NAME="ref_54_7" HREF="terminal_interface-curses-text_io-fixed_io__adb.htm#ref_53_7">Aft</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-fixed_io__ads.htm#ref_47_4">Default_Aft</A>;
-      <FONT COLOR=red><A NAME="ref_55_7" HREF="terminal_interface-curses-text_io-fixed_io__adb.htm#ref_54_7">Exp</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-fixed_io__ads.htm#ref_48_4">Default_Exp</A>);
+     (<FONT COLOR=red><A NAME="ref_51_7" HREF="terminal_interface-curses-text_io-fixed_io__adb.htm#ref_50_7">Win</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
+      <FONT COLOR=red><A NAME="ref_52_7" HREF="terminal_interface-curses-text_io-fixed_io__adb.htm#ref_51_7">Item</A></FONT> : <A HREF="terminal_interface-curses-text_io-fixed_io__ads.htm#ref_42_9">Num</A>;
+      <FONT COLOR=red><A NAME="ref_53_7" HREF="terminal_interface-curses-text_io-fixed_io__adb.htm#ref_52_7">Fore</A></FONT> : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-fixed_io__ads.htm#ref_46_4">Default_Fore</A>;
+      <FONT COLOR=red><A NAME="ref_54_7" HREF="terminal_interface-curses-text_io-fixed_io__adb.htm#ref_53_7">Aft</A></FONT>  : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-fixed_io__ads.htm#ref_47_4">Default_Aft</A>;
+      <FONT COLOR=red><A NAME="ref_55_7" HREF="terminal_interface-curses-text_io-fixed_io__adb.htm#ref_54_7">Exp</A></FONT>  : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-fixed_io__ads.htm#ref_48_4">Default_Exp</A>);
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_57_14" HREF="terminal_interface-curses-text_io-fixed_io__adb.htm#ref_66_14">Put</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_58_7" HREF="terminal_interface-curses-text_io-fixed_io__adb.htm#ref_67_7">Item</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-text_io-fixed_io__ads.htm#ref_42_9">Num</A>;
-      <FONT COLOR=red><A NAME="ref_59_7" HREF="terminal_interface-curses-text_io-fixed_io__adb.htm#ref_68_7">Fore</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-fixed_io__ads.htm#ref_46_4">Default_Fore</A>;
-      <FONT COLOR=red><A NAME="ref_60_7" HREF="terminal_interface-curses-text_io-fixed_io__adb.htm#ref_69_7">Aft</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-fixed_io__ads.htm#ref_47_4">Default_Aft</A>;
-      <FONT COLOR=red><A NAME="ref_61_7" HREF="terminal_interface-curses-text_io-fixed_io__adb.htm#ref_70_7">Exp</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-fixed_io__ads.htm#ref_48_4">Default_Exp</A>);
+     (<FONT COLOR=red><A NAME="ref_58_7" HREF="terminal_interface-curses-text_io-fixed_io__adb.htm#ref_67_7">Item</A></FONT> : <A HREF="terminal_interface-curses-text_io-fixed_io__ads.htm#ref_42_9">Num</A>;
+      <FONT COLOR=red><A NAME="ref_59_7" HREF="terminal_interface-curses-text_io-fixed_io__adb.htm#ref_68_7">Fore</A></FONT> : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-fixed_io__ads.htm#ref_46_4">Default_Fore</A>;
+      <FONT COLOR=red><A NAME="ref_60_7" HREF="terminal_interface-curses-text_io-fixed_io__adb.htm#ref_69_7">Aft</A></FONT>  : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-fixed_io__ads.htm#ref_47_4">Default_Aft</A>;
+      <FONT COLOR=red><A NAME="ref_61_7" HREF="terminal_interface-curses-text_io-fixed_io__adb.htm#ref_70_7">Exp</A></FONT>  : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-fixed_io__ads.htm#ref_48_4">Default_Exp</A>);
 
 <b>private</b>
    <b>pragma</b> Inline (Put);
diff -Naur ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-text_io-float_io__adb.htm ncurses-5.7/doc/html/ada/terminal_interface-curses-text_io-float_io__adb.htm
--- ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-text_io-float_io__adb.htm	2006-09-23 16:31:32.000000000 -0400
+++ ncurses-5.7/doc/html/ada/terminal_interface-curses-text_io-float_io__adb.htm	2011-01-08 18:13:50.379156875 -0500
@@ -12,7 +12,7 @@
 <FONT COLOR=green><EM>--                                 B O D Y                                  --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-<FONT COLOR=green><EM>-- Copyright (c) 1998 Free Software Foundation, Inc.                        --</EM></FONT>
+<FONT COLOR=green><EM>-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>-- Permission is hereby granted, free of charge, to any person obtaining a  --</EM></FONT>
 <FONT COLOR=green><EM>-- copy of this software and associated documentation files (the            --</EM></FONT>
@@ -40,7 +40,7 @@
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <FONT COLOR=green><EM>--  Author:  Juergen Pfeifer, 1996</EM></FONT>
 <FONT COLOR=green><EM>--  Version Control:</EM></FONT>
-<FONT COLOR=green><EM>--  @Revision: 1.10 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Revision: 1.11 @</EM></FONT>
 <FONT COLOR=green><EM>--  Binding Version 01.00</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <b>with</b> Ada.Text_IO;
@@ -52,11 +52,11 @@
    <b>package</b> FIO <b>is</b> <b>new</b> Ada.Text_IO.Float_IO (<A HREF="terminal_interface-curses-text_io-float_io__ads.htm#ref_42_9">Num</A>);
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_49_14" HREF="terminal_interface-curses-text_io-float_io__ads.htm#ref_50_14">Put</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_50_7" HREF="terminal_interface-curses-text_io-float_io__ads.htm#ref_51_7">Win</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
-      <FONT COLOR=red><A NAME="ref_51_7" HREF="terminal_interface-curses-text_io-float_io__ads.htm#ref_52_7">Item</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-text_io-float_io__ads.htm#ref_42_9">Num</A>;
-      <FONT COLOR=red><A NAME="ref_52_7" HREF="terminal_interface-curses-text_io-float_io__ads.htm#ref_53_7">Fore</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-float_io__ads.htm#ref_46_4">Default_Fore</A>;
-      <FONT COLOR=red><A NAME="ref_53_7" HREF="terminal_interface-curses-text_io-float_io__ads.htm#ref_54_7">Aft</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-float_io__ads.htm#ref_47_4">Default_Aft</A>;
-      <FONT COLOR=red><A NAME="ref_54_7" HREF="terminal_interface-curses-text_io-float_io__ads.htm#ref_55_7">Exp</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-float_io__ads.htm#ref_48_4">Default_Exp</A>)
+     (<FONT COLOR=red><A NAME="ref_50_7" HREF="terminal_interface-curses-text_io-float_io__ads.htm#ref_51_7">Win</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
+      <FONT COLOR=red><A NAME="ref_51_7" HREF="terminal_interface-curses-text_io-float_io__ads.htm#ref_52_7">Item</A></FONT> : <A HREF="terminal_interface-curses-text_io-float_io__ads.htm#ref_42_9">Num</A>;
+      <FONT COLOR=red><A NAME="ref_52_7" HREF="terminal_interface-curses-text_io-float_io__ads.htm#ref_53_7">Fore</A></FONT> : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-float_io__ads.htm#ref_46_4">Default_Fore</A>;
+      <FONT COLOR=red><A NAME="ref_53_7" HREF="terminal_interface-curses-text_io-float_io__ads.htm#ref_54_7">Aft</A></FONT>  : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-float_io__ads.htm#ref_47_4">Default_Aft</A>;
+      <FONT COLOR=red><A NAME="ref_54_7" HREF="terminal_interface-curses-text_io-float_io__ads.htm#ref_55_7">Exp</A></FONT>  : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-float_io__ads.htm#ref_48_4">Default_Exp</A>)
    <b>is</b>
       <FONT COLOR=red><A NAME="ref_56_7">Buf</A></FONT> : String (1 .. <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A>'Last);
       <FONT COLOR=red><A NAME="ref_57_7">Len</A></FONT> : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-float_io__ads.htm#ref_53_7">Fore</A> + 1 + <A HREF="terminal_interface-curses-text_io-float_io__ads.htm#ref_54_7">Aft</A>;
@@ -69,10 +69,10 @@
    <b>end</b> <A HREF="terminal_interface-curses-text_io-float_io__ads.htm#ref_50_14">Put</A>;
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_66_14" HREF="terminal_interface-curses-text_io-float_io__ads.htm#ref_57_14">Put</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_67_7" HREF="terminal_interface-curses-text_io-float_io__ads.htm#ref_58_7">Item</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-text_io-float_io__ads.htm#ref_42_9">Num</A>;
-      <FONT COLOR=red><A NAME="ref_68_7" HREF="terminal_interface-curses-text_io-float_io__ads.htm#ref_59_7">Fore</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-float_io__ads.htm#ref_46_4">Default_Fore</A>;
-      <FONT COLOR=red><A NAME="ref_69_7" HREF="terminal_interface-curses-text_io-float_io__ads.htm#ref_60_7">Aft</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-float_io__ads.htm#ref_47_4">Default_Aft</A>;
-      <FONT COLOR=red><A NAME="ref_70_7" HREF="terminal_interface-curses-text_io-float_io__ads.htm#ref_61_7">Exp</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-float_io__ads.htm#ref_48_4">Default_Exp</A>)
+     (<FONT COLOR=red><A NAME="ref_67_7" HREF="terminal_interface-curses-text_io-float_io__ads.htm#ref_58_7">Item</A></FONT> : <A HREF="terminal_interface-curses-text_io-float_io__ads.htm#ref_42_9">Num</A>;
+      <FONT COLOR=red><A NAME="ref_68_7" HREF="terminal_interface-curses-text_io-float_io__ads.htm#ref_59_7">Fore</A></FONT> : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-float_io__ads.htm#ref_46_4">Default_Fore</A>;
+      <FONT COLOR=red><A NAME="ref_69_7" HREF="terminal_interface-curses-text_io-float_io__ads.htm#ref_60_7">Aft</A></FONT>  : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-float_io__ads.htm#ref_47_4">Default_Aft</A>;
+      <FONT COLOR=red><A NAME="ref_70_7" HREF="terminal_interface-curses-text_io-float_io__ads.htm#ref_61_7">Exp</A></FONT>  : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-float_io__ads.htm#ref_48_4">Default_Exp</A>)
    <b>is</b>
    <b>begin</b>
       <A HREF="terminal_interface-curses-text_io-float_io__ads.htm#ref_50_14">Put</A> (<A HREF="terminal_interface-curses-text_io__ads.htm#ref_62_13">Get_Window</A>, <A HREF="terminal_interface-curses-text_io-float_io__ads.htm#ref_58_7">Item</A>, <A HREF="terminal_interface-curses-text_io-float_io__ads.htm#ref_59_7">Fore</A>, <A HREF="terminal_interface-curses-text_io-float_io__ads.htm#ref_60_7">Aft</A>, <A HREF="terminal_interface-curses-text_io-float_io__ads.htm#ref_61_7">Exp</A>);
diff -Naur ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-text_io-float_io__ads.htm ncurses-5.7/doc/html/ada/terminal_interface-curses-text_io-float_io__ads.htm
--- ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-text_io-float_io__ads.htm	2006-09-23 16:31:32.000000000 -0400
+++ ncurses-5.7/doc/html/ada/terminal_interface-curses-text_io-float_io__ads.htm	2011-01-08 18:13:50.379156875 -0500
@@ -12,7 +12,7 @@
 <FONT COLOR=green><EM>--                                 S P E C                                  --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-<FONT COLOR=green><EM>-- Copyright (c) 1998 Free Software Foundation, Inc.                        --</EM></FONT>
+<FONT COLOR=green><EM>-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>-- Permission is hereby granted, free of charge, to any person obtaining a  --</EM></FONT>
 <FONT COLOR=green><EM>-- copy of this software and associated documentation files (the            --</EM></FONT>
@@ -40,7 +40,7 @@
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <FONT COLOR=green><EM>--  Author:  Juergen Pfeifer, 1996</EM></FONT>
 <FONT COLOR=green><EM>--  Version Control:</EM></FONT>
-<FONT COLOR=green><EM>--  @Revision: 1.11 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Revision: 1.12 @</EM></FONT>
 <FONT COLOR=green><EM>--  Binding Version 01.00</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <b>generic</b>
@@ -53,17 +53,17 @@
    <FONT COLOR=red><A NAME="ref_48_4">Default_Exp</A></FONT>  : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := 3;
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_50_14" HREF="terminal_interface-curses-text_io-float_io__adb.htm#ref_49_14">Put</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_51_7" HREF="terminal_interface-curses-text_io-float_io__adb.htm#ref_50_7">Win</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
-      <FONT COLOR=red><A NAME="ref_52_7" HREF="terminal_interface-curses-text_io-float_io__adb.htm#ref_51_7">Item</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-text_io-float_io__ads.htm#ref_42_9">Num</A>;
-      <FONT COLOR=red><A NAME="ref_53_7" HREF="terminal_interface-curses-text_io-float_io__adb.htm#ref_52_7">Fore</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-float_io__ads.htm#ref_46_4">Default_Fore</A>;
-      <FONT COLOR=red><A NAME="ref_54_7" HREF="terminal_interface-curses-text_io-float_io__adb.htm#ref_53_7">Aft</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-float_io__ads.htm#ref_47_4">Default_Aft</A>;
-      <FONT COLOR=red><A NAME="ref_55_7" HREF="terminal_interface-curses-text_io-float_io__adb.htm#ref_54_7">Exp</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-float_io__ads.htm#ref_48_4">Default_Exp</A>);
+     (<FONT COLOR=red><A NAME="ref_51_7" HREF="terminal_interface-curses-text_io-float_io__adb.htm#ref_50_7">Win</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
+      <FONT COLOR=red><A NAME="ref_52_7" HREF="terminal_interface-curses-text_io-float_io__adb.htm#ref_51_7">Item</A></FONT> : <A HREF="terminal_interface-curses-text_io-float_io__ads.htm#ref_42_9">Num</A>;
+      <FONT COLOR=red><A NAME="ref_53_7" HREF="terminal_interface-curses-text_io-float_io__adb.htm#ref_52_7">Fore</A></FONT> : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-float_io__ads.htm#ref_46_4">Default_Fore</A>;
+      <FONT COLOR=red><A NAME="ref_54_7" HREF="terminal_interface-curses-text_io-float_io__adb.htm#ref_53_7">Aft</A></FONT>  : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-float_io__ads.htm#ref_47_4">Default_Aft</A>;
+      <FONT COLOR=red><A NAME="ref_55_7" HREF="terminal_interface-curses-text_io-float_io__adb.htm#ref_54_7">Exp</A></FONT>  : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-float_io__ads.htm#ref_48_4">Default_Exp</A>);
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_57_14" HREF="terminal_interface-curses-text_io-float_io__adb.htm#ref_66_14">Put</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_58_7" HREF="terminal_interface-curses-text_io-float_io__adb.htm#ref_67_7">Item</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-text_io-float_io__ads.htm#ref_42_9">Num</A>;
-      <FONT COLOR=red><A NAME="ref_59_7" HREF="terminal_interface-curses-text_io-float_io__adb.htm#ref_68_7">Fore</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-float_io__ads.htm#ref_46_4">Default_Fore</A>;
-      <FONT COLOR=red><A NAME="ref_60_7" HREF="terminal_interface-curses-text_io-float_io__adb.htm#ref_69_7">Aft</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-float_io__ads.htm#ref_47_4">Default_Aft</A>;
-      <FONT COLOR=red><A NAME="ref_61_7" HREF="terminal_interface-curses-text_io-float_io__adb.htm#ref_70_7">Exp</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-float_io__ads.htm#ref_48_4">Default_Exp</A>);
+     (<FONT COLOR=red><A NAME="ref_58_7" HREF="terminal_interface-curses-text_io-float_io__adb.htm#ref_67_7">Item</A></FONT> : <A HREF="terminal_interface-curses-text_io-float_io__ads.htm#ref_42_9">Num</A>;
+      <FONT COLOR=red><A NAME="ref_59_7" HREF="terminal_interface-curses-text_io-float_io__adb.htm#ref_68_7">Fore</A></FONT> : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-float_io__ads.htm#ref_46_4">Default_Fore</A>;
+      <FONT COLOR=red><A NAME="ref_60_7" HREF="terminal_interface-curses-text_io-float_io__adb.htm#ref_69_7">Aft</A></FONT>  : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-float_io__ads.htm#ref_47_4">Default_Aft</A>;
+      <FONT COLOR=red><A NAME="ref_61_7" HREF="terminal_interface-curses-text_io-float_io__adb.htm#ref_70_7">Exp</A></FONT>  : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-float_io__ads.htm#ref_48_4">Default_Exp</A>);
 
 <b>private</b>
    <b>pragma</b> Inline (Put);
diff -Naur ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-text_io-integer_io__adb.htm ncurses-5.7/doc/html/ada/terminal_interface-curses-text_io-integer_io__adb.htm
--- ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-text_io-integer_io__adb.htm	2006-09-23 16:31:32.000000000 -0400
+++ ncurses-5.7/doc/html/ada/terminal_interface-curses-text_io-integer_io__adb.htm	2011-01-08 18:13:50.379156875 -0500
@@ -12,7 +12,7 @@
 <FONT COLOR=green><EM>--                                 B O D Y                                  --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-<FONT COLOR=green><EM>-- Copyright (c) 1998 Free Software Foundation, Inc.                        --</EM></FONT>
+<FONT COLOR=green><EM>-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>-- Permission is hereby granted, free of charge, to any person obtaining a  --</EM></FONT>
 <FONT COLOR=green><EM>-- copy of this software and associated documentation files (the            --</EM></FONT>
@@ -40,7 +40,7 @@
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <FONT COLOR=green><EM>--  Author:  Juergen Pfeifer, 1996</EM></FONT>
 <FONT COLOR=green><EM>--  Version Control:</EM></FONT>
-<FONT COLOR=green><EM>--  @Revision: 1.10 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Revision: 1.11 @</EM></FONT>
 <FONT COLOR=green><EM>--  Binding Version 01.00</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <b>with</b> Ada.Text_IO;
@@ -52,10 +52,10 @@
    <b>package</b> IIO <b>is</b> <b>new</b> Ada.Text_IO.Integer_IO (<A HREF="terminal_interface-curses-text_io-integer_io__ads.htm#ref_42_9">Num</A>);
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_49_14" HREF="terminal_interface-curses-text_io-integer_io__ads.htm#ref_49_14">Put</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_50_7" HREF="terminal_interface-curses-text_io-integer_io__ads.htm#ref_50_7">Win</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
-      <FONT COLOR=red><A NAME="ref_51_7" HREF="terminal_interface-curses-text_io-integer_io__ads.htm#ref_51_7">Item</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-text_io-integer_io__ads.htm#ref_42_9">Num</A>;
-      <FONT COLOR=red><A NAME="ref_52_7" HREF="terminal_interface-curses-text_io-integer_io__ads.htm#ref_52_7">Width</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-integer_io__ads.htm#ref_46_4">Default_Width</A>;
-      <FONT COLOR=red><A NAME="ref_53_7" HREF="terminal_interface-curses-text_io-integer_io__ads.htm#ref_53_7">Base</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_51_12">Number_Base</A> := <A HREF="terminal_interface-curses-text_io-integer_io__ads.htm#ref_47_4">Default_Base</A>)
+     (<FONT COLOR=red><A NAME="ref_50_7" HREF="terminal_interface-curses-text_io-integer_io__ads.htm#ref_50_7">Win</A></FONT>   : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
+      <FONT COLOR=red><A NAME="ref_51_7" HREF="terminal_interface-curses-text_io-integer_io__ads.htm#ref_51_7">Item</A></FONT>  : <A HREF="terminal_interface-curses-text_io-integer_io__ads.htm#ref_42_9">Num</A>;
+      <FONT COLOR=red><A NAME="ref_52_7" HREF="terminal_interface-curses-text_io-integer_io__ads.htm#ref_52_7">Width</A></FONT> : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-integer_io__ads.htm#ref_46_4">Default_Width</A>;
+      <FONT COLOR=red><A NAME="ref_53_7" HREF="terminal_interface-curses-text_io-integer_io__ads.htm#ref_53_7">Base</A></FONT>  : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_51_12">Number_Base</A> := <A HREF="terminal_interface-curses-text_io-integer_io__ads.htm#ref_47_4">Default_Base</A>)
    <b>is</b>
       <FONT COLOR=red><A NAME="ref_55_7">Buf</A></FONT> : String (1 .. <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A>'Last);
    <b>begin</b>
@@ -64,9 +64,9 @@
    <b>end</b> <A HREF="terminal_interface-curses-text_io-integer_io__ads.htm#ref_49_14">Put</A>;
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_61_14" HREF="terminal_interface-curses-text_io-integer_io__ads.htm#ref_55_14">Put</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_62_7" HREF="terminal_interface-curses-text_io-integer_io__ads.htm#ref_56_7">Item</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-text_io-integer_io__ads.htm#ref_42_9">Num</A>;
-      <FONT COLOR=red><A NAME="ref_63_7" HREF="terminal_interface-curses-text_io-integer_io__ads.htm#ref_57_7">Width</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-integer_io__ads.htm#ref_46_4">Default_Width</A>;
-      <FONT COLOR=red><A NAME="ref_64_7" HREF="terminal_interface-curses-text_io-integer_io__ads.htm#ref_58_7">Base</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_51_12">Number_Base</A> := <A HREF="terminal_interface-curses-text_io-integer_io__ads.htm#ref_47_4">Default_Base</A>)
+     (<FONT COLOR=red><A NAME="ref_62_7" HREF="terminal_interface-curses-text_io-integer_io__ads.htm#ref_56_7">Item</A></FONT>  : <A HREF="terminal_interface-curses-text_io-integer_io__ads.htm#ref_42_9">Num</A>;
+      <FONT COLOR=red><A NAME="ref_63_7" HREF="terminal_interface-curses-text_io-integer_io__ads.htm#ref_57_7">Width</A></FONT> : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-integer_io__ads.htm#ref_46_4">Default_Width</A>;
+      <FONT COLOR=red><A NAME="ref_64_7" HREF="terminal_interface-curses-text_io-integer_io__ads.htm#ref_58_7">Base</A></FONT>  : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_51_12">Number_Base</A> := <A HREF="terminal_interface-curses-text_io-integer_io__ads.htm#ref_47_4">Default_Base</A>)
    <b>is</b>
    <b>begin</b>
       <A HREF="terminal_interface-curses-text_io-integer_io__ads.htm#ref_49_14">Put</A> (<A HREF="terminal_interface-curses-text_io__ads.htm#ref_62_13">Get_Window</A>, <A HREF="terminal_interface-curses-text_io-integer_io__ads.htm#ref_56_7">Item</A>, <A HREF="terminal_interface-curses-text_io-integer_io__ads.htm#ref_57_7">Width</A>, <A HREF="terminal_interface-curses-text_io-integer_io__ads.htm#ref_58_7">Base</A>);
diff -Naur ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-text_io-integer_io__ads.htm ncurses-5.7/doc/html/ada/terminal_interface-curses-text_io-integer_io__ads.htm
--- ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-text_io-integer_io__ads.htm	2006-09-23 16:31:32.000000000 -0400
+++ ncurses-5.7/doc/html/ada/terminal_interface-curses-text_io-integer_io__ads.htm	2011-01-08 18:13:50.379156875 -0500
@@ -12,7 +12,7 @@
 <FONT COLOR=green><EM>--                                 S P E C                                  --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-<FONT COLOR=green><EM>-- Copyright (c) 1998 Free Software Foundation, Inc.                        --</EM></FONT>
+<FONT COLOR=green><EM>-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>-- Permission is hereby granted, free of charge, to any person obtaining a  --</EM></FONT>
 <FONT COLOR=green><EM>-- copy of this software and associated documentation files (the            --</EM></FONT>
@@ -40,7 +40,7 @@
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <FONT COLOR=green><EM>--  Author:  Juergen Pfeifer, 1996</EM></FONT>
 <FONT COLOR=green><EM>--  Version Control:</EM></FONT>
-<FONT COLOR=green><EM>--  @Revision: 1.11 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Revision: 1.12 @</EM></FONT>
 <FONT COLOR=green><EM>--  Binding Version 01.00</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <b>generic</b>
@@ -52,15 +52,15 @@
    <FONT COLOR=red><A NAME="ref_47_4">Default_Base</A></FONT>  : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_51_12">Number_Base</A> := 10;
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_49_14" HREF="terminal_interface-curses-text_io-integer_io__adb.htm#ref_49_14">Put</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_50_7" HREF="terminal_interface-curses-text_io-integer_io__adb.htm#ref_50_7">Win</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
-      <FONT COLOR=red><A NAME="ref_51_7" HREF="terminal_interface-curses-text_io-integer_io__adb.htm#ref_51_7">Item</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-text_io-integer_io__ads.htm#ref_42_9">Num</A>;
-      <FONT COLOR=red><A NAME="ref_52_7" HREF="terminal_interface-curses-text_io-integer_io__adb.htm#ref_52_7">Width</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-integer_io__ads.htm#ref_46_4">Default_Width</A>;
-      <FONT COLOR=red><A NAME="ref_53_7" HREF="terminal_interface-curses-text_io-integer_io__adb.htm#ref_53_7">Base</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_51_12">Number_Base</A> := <A HREF="terminal_interface-curses-text_io-integer_io__ads.htm#ref_47_4">Default_Base</A>);
+     (<FONT COLOR=red><A NAME="ref_50_7" HREF="terminal_interface-curses-text_io-integer_io__adb.htm#ref_50_7">Win</A></FONT>   : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
+      <FONT COLOR=red><A NAME="ref_51_7" HREF="terminal_interface-curses-text_io-integer_io__adb.htm#ref_51_7">Item</A></FONT>  : <A HREF="terminal_interface-curses-text_io-integer_io__ads.htm#ref_42_9">Num</A>;
+      <FONT COLOR=red><A NAME="ref_52_7" HREF="terminal_interface-curses-text_io-integer_io__adb.htm#ref_52_7">Width</A></FONT> : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-integer_io__ads.htm#ref_46_4">Default_Width</A>;
+      <FONT COLOR=red><A NAME="ref_53_7" HREF="terminal_interface-curses-text_io-integer_io__adb.htm#ref_53_7">Base</A></FONT>  : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_51_12">Number_Base</A> := <A HREF="terminal_interface-curses-text_io-integer_io__ads.htm#ref_47_4">Default_Base</A>);
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_55_14" HREF="terminal_interface-curses-text_io-integer_io__adb.htm#ref_61_14">Put</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_56_7" HREF="terminal_interface-curses-text_io-integer_io__adb.htm#ref_62_7">Item</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-text_io-integer_io__ads.htm#ref_42_9">Num</A>;
-      <FONT COLOR=red><A NAME="ref_57_7" HREF="terminal_interface-curses-text_io-integer_io__adb.htm#ref_63_7">Width</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-integer_io__ads.htm#ref_46_4">Default_Width</A>;
-      <FONT COLOR=red><A NAME="ref_58_7" HREF="terminal_interface-curses-text_io-integer_io__adb.htm#ref_64_7">Base</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_51_12">Number_Base</A> := <A HREF="terminal_interface-curses-text_io-integer_io__ads.htm#ref_47_4">Default_Base</A>);
+     (<FONT COLOR=red><A NAME="ref_56_7" HREF="terminal_interface-curses-text_io-integer_io__adb.htm#ref_62_7">Item</A></FONT>  : <A HREF="terminal_interface-curses-text_io-integer_io__ads.htm#ref_42_9">Num</A>;
+      <FONT COLOR=red><A NAME="ref_57_7" HREF="terminal_interface-curses-text_io-integer_io__adb.htm#ref_63_7">Width</A></FONT> : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-integer_io__ads.htm#ref_46_4">Default_Width</A>;
+      <FONT COLOR=red><A NAME="ref_58_7" HREF="terminal_interface-curses-text_io-integer_io__adb.htm#ref_64_7">Base</A></FONT>  : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_51_12">Number_Base</A> := <A HREF="terminal_interface-curses-text_io-integer_io__ads.htm#ref_47_4">Default_Base</A>);
 
 <b>private</b>
    <b>pragma</b> Inline (Put);
diff -Naur ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-text_io-modular_io__adb.htm ncurses-5.7/doc/html/ada/terminal_interface-curses-text_io-modular_io__adb.htm
--- ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-text_io-modular_io__adb.htm	2006-09-23 16:31:32.000000000 -0400
+++ ncurses-5.7/doc/html/ada/terminal_interface-curses-text_io-modular_io__adb.htm	2011-01-08 18:13:50.379156875 -0500
@@ -12,7 +12,7 @@
 <FONT COLOR=green><EM>--                                 B O D Y                                  --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-<FONT COLOR=green><EM>-- Copyright (c) 1998 Free Software Foundation, Inc.                        --</EM></FONT>
+<FONT COLOR=green><EM>-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>-- Permission is hereby granted, free of charge, to any person obtaining a  --</EM></FONT>
 <FONT COLOR=green><EM>-- copy of this software and associated documentation files (the            --</EM></FONT>
@@ -40,7 +40,7 @@
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <FONT COLOR=green><EM>--  Author:  Juergen Pfeifer, 1996</EM></FONT>
 <FONT COLOR=green><EM>--  Version Control:</EM></FONT>
-<FONT COLOR=green><EM>--  @Revision: 1.10 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Revision: 1.11 @</EM></FONT>
 <FONT COLOR=green><EM>--  Binding Version 01.00</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <b>with</b> Ada.Text_IO;
@@ -52,10 +52,10 @@
    <b>package</b> MIO <b>is</b> <b>new</b> Ada.Text_IO.Modular_IO (<A HREF="terminal_interface-curses-text_io-modular_io__ads.htm#ref_42_9">Num</A>);
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_49_14" HREF="terminal_interface-curses-text_io-modular_io__ads.htm#ref_49_14">Put</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_50_7" HREF="terminal_interface-curses-text_io-modular_io__ads.htm#ref_50_7">Win</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
-      <FONT COLOR=red><A NAME="ref_51_7" HREF="terminal_interface-curses-text_io-modular_io__ads.htm#ref_51_7">Item</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-text_io-modular_io__ads.htm#ref_42_9">Num</A>;
-      <FONT COLOR=red><A NAME="ref_52_7" HREF="terminal_interface-curses-text_io-modular_io__ads.htm#ref_52_7">Width</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-modular_io__ads.htm#ref_46_4">Default_Width</A>;
-      <FONT COLOR=red><A NAME="ref_53_7" HREF="terminal_interface-curses-text_io-modular_io__ads.htm#ref_53_7">Base</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_51_12">Number_Base</A> := <A HREF="terminal_interface-curses-text_io-modular_io__ads.htm#ref_47_4">Default_Base</A>)
+     (<FONT COLOR=red><A NAME="ref_50_7" HREF="terminal_interface-curses-text_io-modular_io__ads.htm#ref_50_7">Win</A></FONT>   : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
+      <FONT COLOR=red><A NAME="ref_51_7" HREF="terminal_interface-curses-text_io-modular_io__ads.htm#ref_51_7">Item</A></FONT>  : <A HREF="terminal_interface-curses-text_io-modular_io__ads.htm#ref_42_9">Num</A>;
+      <FONT COLOR=red><A NAME="ref_52_7" HREF="terminal_interface-curses-text_io-modular_io__ads.htm#ref_52_7">Width</A></FONT> : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-modular_io__ads.htm#ref_46_4">Default_Width</A>;
+      <FONT COLOR=red><A NAME="ref_53_7" HREF="terminal_interface-curses-text_io-modular_io__ads.htm#ref_53_7">Base</A></FONT>  : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_51_12">Number_Base</A> := <A HREF="terminal_interface-curses-text_io-modular_io__ads.htm#ref_47_4">Default_Base</A>)
    <b>is</b>
       <FONT COLOR=red><A NAME="ref_55_7">Buf</A></FONT> : String (1 .. <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A>'Last);
    <b>begin</b>
@@ -64,9 +64,9 @@
    <b>end</b> <A HREF="terminal_interface-curses-text_io-modular_io__ads.htm#ref_49_14">Put</A>;
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_61_14" HREF="terminal_interface-curses-text_io-modular_io__ads.htm#ref_55_14">Put</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_62_7" HREF="terminal_interface-curses-text_io-modular_io__ads.htm#ref_56_7">Item</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-text_io-modular_io__ads.htm#ref_42_9">Num</A>;
-      <FONT COLOR=red><A NAME="ref_63_7" HREF="terminal_interface-curses-text_io-modular_io__ads.htm#ref_57_7">Width</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-modular_io__ads.htm#ref_46_4">Default_Width</A>;
-      <FONT COLOR=red><A NAME="ref_64_7" HREF="terminal_interface-curses-text_io-modular_io__ads.htm#ref_58_7">Base</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_51_12">Number_Base</A> := <A HREF="terminal_interface-curses-text_io-modular_io__ads.htm#ref_47_4">Default_Base</A>)
+     (<FONT COLOR=red><A NAME="ref_62_7" HREF="terminal_interface-curses-text_io-modular_io__ads.htm#ref_56_7">Item</A></FONT>  : <A HREF="terminal_interface-curses-text_io-modular_io__ads.htm#ref_42_9">Num</A>;
+      <FONT COLOR=red><A NAME="ref_63_7" HREF="terminal_interface-curses-text_io-modular_io__ads.htm#ref_57_7">Width</A></FONT> : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-modular_io__ads.htm#ref_46_4">Default_Width</A>;
+      <FONT COLOR=red><A NAME="ref_64_7" HREF="terminal_interface-curses-text_io-modular_io__ads.htm#ref_58_7">Base</A></FONT>  : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_51_12">Number_Base</A> := <A HREF="terminal_interface-curses-text_io-modular_io__ads.htm#ref_47_4">Default_Base</A>)
    <b>is</b>
    <b>begin</b>
       <A HREF="terminal_interface-curses-text_io-modular_io__ads.htm#ref_49_14">Put</A> (<A HREF="terminal_interface-curses-text_io__ads.htm#ref_62_13">Get_Window</A>, <A HREF="terminal_interface-curses-text_io-modular_io__ads.htm#ref_56_7">Item</A>, <A HREF="terminal_interface-curses-text_io-modular_io__ads.htm#ref_57_7">Width</A>, <A HREF="terminal_interface-curses-text_io-modular_io__ads.htm#ref_58_7">Base</A>);
diff -Naur ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-text_io-modular_io__ads.htm ncurses-5.7/doc/html/ada/terminal_interface-curses-text_io-modular_io__ads.htm
--- ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-text_io-modular_io__ads.htm	2006-09-23 16:31:32.000000000 -0400
+++ ncurses-5.7/doc/html/ada/terminal_interface-curses-text_io-modular_io__ads.htm	2011-01-08 18:13:50.379156875 -0500
@@ -12,7 +12,7 @@
 <FONT COLOR=green><EM>--                                 S P E C                                  --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-<FONT COLOR=green><EM>-- Copyright (c) 1998 Free Software Foundation, Inc.                        --</EM></FONT>
+<FONT COLOR=green><EM>-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>-- Permission is hereby granted, free of charge, to any person obtaining a  --</EM></FONT>
 <FONT COLOR=green><EM>-- copy of this software and associated documentation files (the            --</EM></FONT>
@@ -40,7 +40,7 @@
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <FONT COLOR=green><EM>--  Author:  Juergen Pfeifer, 1996</EM></FONT>
 <FONT COLOR=green><EM>--  Version Control:</EM></FONT>
-<FONT COLOR=green><EM>--  @Revision: 1.11 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Revision: 1.12 @</EM></FONT>
 <FONT COLOR=green><EM>--  Binding Version 01.00</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <b>generic</b>
@@ -52,15 +52,15 @@
    <FONT COLOR=red><A NAME="ref_47_4">Default_Base</A></FONT>  : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_51_12">Number_Base</A> := 10;
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_49_14" HREF="terminal_interface-curses-text_io-modular_io__adb.htm#ref_49_14">Put</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_50_7" HREF="terminal_interface-curses-text_io-modular_io__adb.htm#ref_50_7">Win</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
-      <FONT COLOR=red><A NAME="ref_51_7" HREF="terminal_interface-curses-text_io-modular_io__adb.htm#ref_51_7">Item</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-text_io-modular_io__ads.htm#ref_42_9">Num</A>;
-      <FONT COLOR=red><A NAME="ref_52_7" HREF="terminal_interface-curses-text_io-modular_io__adb.htm#ref_52_7">Width</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-modular_io__ads.htm#ref_46_4">Default_Width</A>;
-      <FONT COLOR=red><A NAME="ref_53_7" HREF="terminal_interface-curses-text_io-modular_io__adb.htm#ref_53_7">Base</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_51_12">Number_Base</A> := <A HREF="terminal_interface-curses-text_io-modular_io__ads.htm#ref_47_4">Default_Base</A>);
+     (<FONT COLOR=red><A NAME="ref_50_7" HREF="terminal_interface-curses-text_io-modular_io__adb.htm#ref_50_7">Win</A></FONT>   : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
+      <FONT COLOR=red><A NAME="ref_51_7" HREF="terminal_interface-curses-text_io-modular_io__adb.htm#ref_51_7">Item</A></FONT>  : <A HREF="terminal_interface-curses-text_io-modular_io__ads.htm#ref_42_9">Num</A>;
+      <FONT COLOR=red><A NAME="ref_52_7" HREF="terminal_interface-curses-text_io-modular_io__adb.htm#ref_52_7">Width</A></FONT> : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-modular_io__ads.htm#ref_46_4">Default_Width</A>;
+      <FONT COLOR=red><A NAME="ref_53_7" HREF="terminal_interface-curses-text_io-modular_io__adb.htm#ref_53_7">Base</A></FONT>  : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_51_12">Number_Base</A> := <A HREF="terminal_interface-curses-text_io-modular_io__ads.htm#ref_47_4">Default_Base</A>);
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_55_14" HREF="terminal_interface-curses-text_io-modular_io__adb.htm#ref_61_14">Put</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_56_7" HREF="terminal_interface-curses-text_io-modular_io__adb.htm#ref_62_7">Item</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-text_io-modular_io__ads.htm#ref_42_9">Num</A>;
-      <FONT COLOR=red><A NAME="ref_57_7" HREF="terminal_interface-curses-text_io-modular_io__adb.htm#ref_63_7">Width</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-modular_io__ads.htm#ref_46_4">Default_Width</A>;
-      <FONT COLOR=red><A NAME="ref_58_7" HREF="terminal_interface-curses-text_io-modular_io__adb.htm#ref_64_7">Base</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_51_12">Number_Base</A> := <A HREF="terminal_interface-curses-text_io-modular_io__ads.htm#ref_47_4">Default_Base</A>);
+     (<FONT COLOR=red><A NAME="ref_56_7" HREF="terminal_interface-curses-text_io-modular_io__adb.htm#ref_62_7">Item</A></FONT>  : <A HREF="terminal_interface-curses-text_io-modular_io__ads.htm#ref_42_9">Num</A>;
+      <FONT COLOR=red><A NAME="ref_57_7" HREF="terminal_interface-curses-text_io-modular_io__adb.htm#ref_63_7">Width</A></FONT> : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_50_12">Field</A> := <A HREF="terminal_interface-curses-text_io-modular_io__ads.htm#ref_46_4">Default_Width</A>;
+      <FONT COLOR=red><A NAME="ref_58_7" HREF="terminal_interface-curses-text_io-modular_io__adb.htm#ref_64_7">Base</A></FONT>  : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_51_12">Number_Base</A> := <A HREF="terminal_interface-curses-text_io-modular_io__ads.htm#ref_47_4">Default_Base</A>);
 
 <b>private</b>
    <b>pragma</b> Inline (Put);
diff -Naur ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-text_io__adb.htm ncurses-5.7/doc/html/ada/terminal_interface-curses-text_io__adb.htm
--- ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-text_io__adb.htm	2007-05-05 16:35:20.000000000 -0400
+++ ncurses-5.7/doc/html/ada/terminal_interface-curses-text_io__adb.htm	2011-01-08 18:13:50.383157249 -0500
@@ -12,7 +12,7 @@
 <FONT COLOR=green><EM>--                                 B O D Y                                  --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-<FONT COLOR=green><EM>-- Copyright (c) 1998-2004,2006 Free Software Foundation, Inc.              --</EM></FONT>
+<FONT COLOR=green><EM>-- Copyright (c) 1998-2006,2009 Free Software Foundation, Inc.              --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>-- Permission is hereby granted, free of charge, to any person obtaining a  --</EM></FONT>
 <FONT COLOR=green><EM>-- copy of this software and associated documentation files (the            --</EM></FONT>
@@ -40,15 +40,15 @@
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <FONT COLOR=green><EM>--  Author:  Juergen Pfeifer, 1996</EM></FONT>
 <FONT COLOR=green><EM>--  Version Control:</EM></FONT>
-<FONT COLOR=green><EM>--  @Revision: 1.18 @</EM></FONT>
-<FONT COLOR=green><EM>--  @Date: 2006/06/25 14:24:40 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Revision: 1.19 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Date: 2009/12/26 17:40:46 @</EM></FONT>
 <FONT COLOR=green><EM>--  Binding Version 01.00</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <b>package</b> <b>body</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<FONT COLOR=red><A NAME="ref_42_40" HREF="terminal_interface-curses-text_io__ads.htm#ref_44_35">Text_IO</A></FONT> <b>is</b>
 
    <FONT COLOR=red><A NAME="ref_44_4">Default_Window</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_58_4">Null_Window</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_46_14" HREF="terminal_interface-curses-text_io__ads.htm#ref_59_14">Set_Window</A></FONT> (<FONT COLOR=red><A NAME="ref_46_26" HREF="terminal_interface-curses-text_io__ads.htm#ref_59_26">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_46_14" HREF="terminal_interface-curses-text_io__ads.htm#ref_59_14">Set_Window</A></FONT> (<FONT COLOR=red><A NAME="ref_46_26" HREF="terminal_interface-curses-text_io__ads.htm#ref_59_26">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>)
    <b>is</b>
    <b>begin</b>
       <A HREF="terminal_interface-curses-text_io__adb.htm#ref_44_4">Default_Window</A> := <A HREF="terminal_interface-curses-text_io__ads.htm#ref_59_26">Win</A>;
@@ -65,7 +65,7 @@
    <b>end</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_62_13">Get_Window</A>;
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses-text_io__ads.htm#ref_62_13">Get_Window</A>);
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_63_14" HREF="terminal_interface-curses-text_io__ads.htm#ref_65_14">Flush</A></FONT> (<FONT COLOR=red><A NAME="ref_63_21" HREF="terminal_interface-curses-text_io__ads.htm#ref_65_21">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_63_14" HREF="terminal_interface-curses-text_io__ads.htm#ref_65_14">Flush</A></FONT> (<FONT COLOR=red><A NAME="ref_63_21" HREF="terminal_interface-curses-text_io__ads.htm#ref_65_21">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>)
    <b>is</b>
    <b>begin</b>
       <A HREF="terminal_interface-curses__ads.htm#ref_1045_14">Refresh</A> (<A HREF="terminal_interface-curses-text_io__ads.htm#ref_65_21">Win</A>);
@@ -86,7 +86,7 @@
    <FONT COLOR=green><EM>--  A scroll-window is interpreted as an page with unbounded page length,</EM></FONT>
    <FONT COLOR=green><EM>--  i.e. it returns the conventional 0 as page length.</EM></FONT>
 
-   <b>function</b> <FONT COLOR=red><A NAME="ref_84_13" HREF="terminal_interface-curses-text_io__ads.htm#ref_77_13">Line_Length</A></FONT> (<FONT COLOR=red><A NAME="ref_84_26" HREF="terminal_interface-curses-text_io__ads.htm#ref_77_26">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>) <b>return</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_47_12">Count</A>
+   <b>function</b> <FONT COLOR=red><A NAME="ref_84_13" HREF="terminal_interface-curses-text_io__ads.htm#ref_77_13">Line_Length</A></FONT> (<FONT COLOR=red><A NAME="ref_84_26" HREF="terminal_interface-curses-text_io__ads.htm#ref_77_26">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>) <b>return</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_47_12">Count</A>
    <b>is</b>
       <FONT COLOR=red><A NAME="ref_86_7">N_Lines</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_63_12">Line_Count</A>;
       <FONT COLOR=red><A NAME="ref_87_7">N_Cols</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_65_12">Column_Count</A>;
@@ -104,7 +104,7 @@
       <b>return</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_77_13">Line_Length</A> (<A HREF="terminal_interface-curses-text_io__ads.htm#ref_62_13">Get_Window</A>);
    <b>end</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_78_13">Line_Length</A>;
 
-   <b>function</b> <FONT COLOR=red><A NAME="ref_102_13" HREF="terminal_interface-curses-text_io__ads.htm#ref_80_13">Page_Length</A></FONT> (<FONT COLOR=red><A NAME="ref_102_26" HREF="terminal_interface-curses-text_io__ads.htm#ref_80_26">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>) <b>return</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_47_12">Count</A>
+   <b>function</b> <FONT COLOR=red><A NAME="ref_102_13" HREF="terminal_interface-curses-text_io__ads.htm#ref_80_13">Page_Length</A></FONT> (<FONT COLOR=red><A NAME="ref_102_26" HREF="terminal_interface-curses-text_io__ads.htm#ref_80_26">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>) <b>return</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_47_12">Count</A>
    <b>is</b>
       <FONT COLOR=red><A NAME="ref_104_7">N_Lines</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_63_12">Line_Count</A>;
       <FONT COLOR=red><A NAME="ref_105_7">N_Cols</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_65_12">Column_Count</A>;
@@ -129,15 +129,15 @@
    <FONT COLOR=green><EM>------------------------------------</EM></FONT>
    <FONT COLOR=green><EM>-- Column, Line, and Page Control --</EM></FONT>
    <FONT COLOR=green><EM>------------------------------------</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_127_14" HREF="terminal_interface-curses-text_io__ads.htm#ref_86_14">New_Line</A></FONT> (<FONT COLOR=red><A NAME="ref_127_24" HREF="terminal_interface-curses-text_io__ads.htm#ref_86_24">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>; <FONT COLOR=red><A NAME="ref_127_41" HREF="terminal_interface-curses-text_io__ads.htm#ref_86_41">Spacing</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_48_12">Positive_Count</A> := 1)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_127_14" HREF="terminal_interface-curses-text_io__ads.htm#ref_86_14">New_Line</A></FONT> (<FONT COLOR=red><A NAME="ref_127_24" HREF="terminal_interface-curses-text_io__ads.htm#ref_86_24">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>; <FONT COLOR=red><A NAME="ref_127_38" HREF="terminal_interface-curses-text_io__ads.htm#ref_86_38">Spacing</A></FONT> : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_48_12">Positive_Count</A> := 1)
    <b>is</b>
       <FONT COLOR=red><A NAME="ref_129_7">P_Size</A></FONT> : <b>constant</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_47_12">Count</A> := <A HREF="terminal_interface-curses-text_io__ads.htm#ref_80_13">Page_Length</A> (<A HREF="terminal_interface-curses-text_io__ads.htm#ref_86_24">Win</A>);
    <b>begin</b>
-      <b>if</b> <b>not</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_86_41">Spacing</A>'Valid <b>then</b>
+      <b>if</b> <b>not</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_86_38">Spacing</A>'Valid <b>then</b>
          <b>raise</b> Constraint_Error;
       <b>end</b> <b>if</b>;
 
-      <b>for</b> <FONT COLOR=red><A NAME="ref_135_11">I</A></FONT> <b>in</b> 1 .. <A HREF="terminal_interface-curses-text_io__ads.htm#ref_86_41">Spacing</A> <b>loop</b>
+      <b>for</b> <FONT COLOR=red><A NAME="ref_135_11">I</A></FONT> <b>in</b> 1 .. <A HREF="terminal_interface-curses-text_io__ads.htm#ref_86_38">Spacing</A> <b>loop</b>
          <b>if</b> <A HREF="terminal_interface-curses-text_io__adb.htm#ref_129_7">P_Size</A> &gt; 0 <b>and</b> <b>then</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_101_13">Line</A> (<A HREF="terminal_interface-curses-text_io__ads.htm#ref_86_24">Win</A>) &gt;= <A HREF="terminal_interface-curses-text_io__adb.htm#ref_129_7">P_Size</A> <b>then</b>
             <A HREF="terminal_interface-curses-text_io__ads.htm#ref_89_14">New_Page</A> (<A HREF="terminal_interface-curses-text_io__ads.htm#ref_86_24">Win</A>);
          <b>else</b>
@@ -146,13 +146,13 @@
       <b>end</b> <b>loop</b>;
    <b>end</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_86_14">New_Line</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_144_14" HREF="terminal_interface-curses-text_io__ads.htm#ref_87_14">New_Line</A></FONT> (<FONT COLOR=red><A NAME="ref_144_24" HREF="terminal_interface-curses-text_io__ads.htm#ref_87_24">Spacing</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_48_12">Positive_Count</A> := 1)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_144_14" HREF="terminal_interface-curses-text_io__ads.htm#ref_87_14">New_Line</A></FONT> (<FONT COLOR=red><A NAME="ref_144_24" HREF="terminal_interface-curses-text_io__ads.htm#ref_87_24">Spacing</A></FONT> : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_48_12">Positive_Count</A> := 1)
    <b>is</b>
    <b>begin</b>
       <A HREF="terminal_interface-curses-text_io__ads.htm#ref_86_14">New_Line</A> (<A HREF="terminal_interface-curses-text_io__ads.htm#ref_62_13">Get_Window</A>, <A HREF="terminal_interface-curses-text_io__ads.htm#ref_87_24">Spacing</A>);
    <b>end</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_87_14">New_Line</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_150_14" HREF="terminal_interface-curses-text_io__ads.htm#ref_89_14">New_Page</A></FONT> (<FONT COLOR=red><A NAME="ref_150_24" HREF="terminal_interface-curses-text_io__ads.htm#ref_89_24">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_150_14" HREF="terminal_interface-curses-text_io__ads.htm#ref_89_14">New_Page</A></FONT> (<FONT COLOR=red><A NAME="ref_150_24" HREF="terminal_interface-curses-text_io__ads.htm#ref_89_24">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>)
    <b>is</b>
    <b>begin</b>
       <A HREF="terminal_interface-curses__ads.htm#ref_1080_14">Clear</A> (<A HREF="terminal_interface-curses-text_io__ads.htm#ref_89_24">Win</A>);
@@ -164,19 +164,19 @@
       <A HREF="terminal_interface-curses-text_io__ads.htm#ref_89_14">New_Page</A> (<A HREF="terminal_interface-curses-text_io__ads.htm#ref_62_13">Get_Window</A>);
    <b>end</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_90_14">New_Page</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_162_14" HREF="terminal_interface-curses-text_io__ads.htm#ref_92_14">Set_Col</A></FONT> (<FONT COLOR=red><A NAME="ref_162_23" HREF="terminal_interface-curses-text_io__ads.htm#ref_92_23">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;  <FONT COLOR=red><A NAME="ref_162_41" HREF="terminal_interface-curses-text_io__ads.htm#ref_92_41">To</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_48_12">Positive_Count</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_162_14" HREF="terminal_interface-curses-text_io__ads.htm#ref_92_14">Set_Col</A></FONT> (<FONT COLOR=red><A NAME="ref_162_23" HREF="terminal_interface-curses-text_io__ads.htm#ref_92_23">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;  <FONT COLOR=red><A NAME="ref_162_38" HREF="terminal_interface-curses-text_io__ads.htm#ref_92_38">To</A></FONT> : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_48_12">Positive_Count</A>)
    <b>is</b>
       <FONT COLOR=red><A NAME="ref_164_7">Y</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
       <FONT COLOR=red><A NAME="ref_165_7">X1</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
       <FONT COLOR=red><A NAME="ref_166_7">X2</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
       <FONT COLOR=red><A NAME="ref_167_7">N</A></FONT>  : Natural;
    <b>begin</b>
-      <b>if</b> <b>not</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_92_41">To</A>'Valid <b>then</b>
+      <b>if</b> <b>not</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_92_38">To</A>'Valid <b>then</b>
          <b>raise</b> Constraint_Error;
       <b>end</b> <b>if</b>;
 
       <A HREF="terminal_interface-curses__ads.htm#ref_1244_14">Get_Cursor_Position</A> (<A HREF="terminal_interface-curses-text_io__ads.htm#ref_92_23">Win</A>, <A HREF="terminal_interface-curses-text_io__adb.htm#ref_164_7">Y</A>, <A HREF="terminal_interface-curses-text_io__adb.htm#ref_165_7">X1</A>);
-      <A HREF="terminal_interface-curses-text_io__adb.htm#ref_167_7">N</A>  := Natural (<A HREF="terminal_interface-curses-text_io__ads.htm#ref_92_41">To</A>); <A HREF="terminal_interface-curses-text_io__adb.htm#ref_167_7">N</A> := <A HREF="terminal_interface-curses-text_io__adb.htm#ref_167_7">N</A> - 1;
+      <A HREF="terminal_interface-curses-text_io__adb.htm#ref_167_7">N</A>  := Natural (<A HREF="terminal_interface-curses-text_io__ads.htm#ref_92_38">To</A>); <A HREF="terminal_interface-curses-text_io__adb.htm#ref_167_7">N</A> := <A HREF="terminal_interface-curses-text_io__adb.htm#ref_167_7">N</A> - 1;
       <A HREF="terminal_interface-curses-text_io__adb.htm#ref_166_7">X2</A> := <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A> (<A HREF="terminal_interface-curses-text_io__adb.htm#ref_167_7">N</A>);
       <b>if</b> <A HREF="terminal_interface-curses-text_io__adb.htm#ref_165_7">X1</A> &gt; <A HREF="terminal_interface-curses-text_io__adb.htm#ref_166_7">X2</A> <b>then</b>
          <A HREF="terminal_interface-curses-text_io__ads.htm#ref_86_14">New_Line</A> (<A HREF="terminal_interface-curses-text_io__ads.htm#ref_92_23">Win</A>, 1);
@@ -192,25 +192,25 @@
       <b>end</b> <b>if</b>;
    <b>end</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_92_14">Set_Col</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_190_14" HREF="terminal_interface-curses-text_io__ads.htm#ref_93_14">Set_Col</A></FONT> (<FONT COLOR=red><A NAME="ref_190_23" HREF="terminal_interface-curses-text_io__ads.htm#ref_93_23">To</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_48_12">Positive_Count</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_190_14" HREF="terminal_interface-curses-text_io__ads.htm#ref_93_14">Set_Col</A></FONT> (<FONT COLOR=red><A NAME="ref_190_23" HREF="terminal_interface-curses-text_io__ads.htm#ref_93_23">To</A></FONT> : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_48_12">Positive_Count</A>)
    <b>is</b>
    <b>begin</b>
       <A HREF="terminal_interface-curses-text_io__ads.htm#ref_92_14">Set_Col</A> (<A HREF="terminal_interface-curses-text_io__ads.htm#ref_62_13">Get_Window</A>, <A HREF="terminal_interface-curses-text_io__ads.htm#ref_93_23">To</A>);
    <b>end</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_93_14">Set_Col</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_196_14" HREF="terminal_interface-curses-text_io__ads.htm#ref_95_14">Set_Line</A></FONT> (<FONT COLOR=red><A NAME="ref_196_24" HREF="terminal_interface-curses-text_io__ads.htm#ref_95_24">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>; <FONT COLOR=red><A NAME="ref_196_41" HREF="terminal_interface-curses-text_io__ads.htm#ref_95_41">To</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_48_12">Positive_Count</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_196_14" HREF="terminal_interface-curses-text_io__ads.htm#ref_95_14">Set_Line</A></FONT> (<FONT COLOR=red><A NAME="ref_196_24" HREF="terminal_interface-curses-text_io__ads.htm#ref_95_24">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>; <FONT COLOR=red><A NAME="ref_196_38" HREF="terminal_interface-curses-text_io__ads.htm#ref_95_38">To</A></FONT> : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_48_12">Positive_Count</A>)
    <b>is</b>
       <FONT COLOR=red><A NAME="ref_198_7">Y1</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
       <FONT COLOR=red><A NAME="ref_199_7">Y2</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
       <FONT COLOR=red><A NAME="ref_200_7">X</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
       <FONT COLOR=red><A NAME="ref_201_7">N</A></FONT>  : Natural;
    <b>begin</b>
-      <b>if</b> <b>not</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_95_41">To</A>'Valid <b>then</b>
+      <b>if</b> <b>not</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_95_38">To</A>'Valid <b>then</b>
          <b>raise</b> Constraint_Error;
       <b>end</b> <b>if</b>;
 
       <A HREF="terminal_interface-curses__ads.htm#ref_1244_14">Get_Cursor_Position</A> (<A HREF="terminal_interface-curses-text_io__ads.htm#ref_95_24">Win</A>, <A HREF="terminal_interface-curses-text_io__adb.htm#ref_198_7">Y1</A>, <A HREF="terminal_interface-curses-text_io__adb.htm#ref_200_7">X</A>);
-      <A HREF="terminal_interface-curses-text_io__adb.htm#ref_201_7">N</A>  := Natural (<A HREF="terminal_interface-curses-text_io__ads.htm#ref_95_41">To</A>); <A HREF="terminal_interface-curses-text_io__adb.htm#ref_201_7">N</A> := <A HREF="terminal_interface-curses-text_io__adb.htm#ref_201_7">N</A> - 1;
+      <A HREF="terminal_interface-curses-text_io__adb.htm#ref_201_7">N</A>  := Natural (<A HREF="terminal_interface-curses-text_io__ads.htm#ref_95_38">To</A>); <A HREF="terminal_interface-curses-text_io__adb.htm#ref_201_7">N</A> := <A HREF="terminal_interface-curses-text_io__adb.htm#ref_201_7">N</A> - 1;
       <A HREF="terminal_interface-curses-text_io__adb.htm#ref_199_7">Y2</A> := <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A> (<A HREF="terminal_interface-curses-text_io__adb.htm#ref_201_7">N</A>);
       <b>if</b> <A HREF="terminal_interface-curses-text_io__adb.htm#ref_199_7">Y2</A> &lt; <A HREF="terminal_interface-curses-text_io__adb.htm#ref_198_7">Y1</A> <b>then</b>
          <A HREF="terminal_interface-curses-text_io__ads.htm#ref_89_14">New_Page</A> (<A HREF="terminal_interface-curses-text_io__ads.htm#ref_95_24">Win</A>);
@@ -221,13 +221,13 @@
       <b>end</b> <b>if</b>;
    <b>end</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_95_14">Set_Line</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_219_14" HREF="terminal_interface-curses-text_io__ads.htm#ref_96_14">Set_Line</A></FONT> (<FONT COLOR=red><A NAME="ref_219_24" HREF="terminal_interface-curses-text_io__ads.htm#ref_96_24">To</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_48_12">Positive_Count</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_219_14" HREF="terminal_interface-curses-text_io__ads.htm#ref_96_14">Set_Line</A></FONT> (<FONT COLOR=red><A NAME="ref_219_24" HREF="terminal_interface-curses-text_io__ads.htm#ref_96_24">To</A></FONT> : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_48_12">Positive_Count</A>)
    <b>is</b>
    <b>begin</b>
       <A HREF="terminal_interface-curses-text_io__ads.htm#ref_95_14">Set_Line</A> (<A HREF="terminal_interface-curses-text_io__ads.htm#ref_62_13">Get_Window</A>, <A HREF="terminal_interface-curses-text_io__ads.htm#ref_96_24">To</A>);
    <b>end</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_96_14">Set_Line</A>;
 
-   <b>function</b> <FONT COLOR=red><A NAME="ref_225_13" HREF="terminal_interface-curses-text_io__ads.htm#ref_98_13">Col</A></FONT> (<FONT COLOR=red><A NAME="ref_225_18" HREF="terminal_interface-curses-text_io__ads.htm#ref_98_18">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>) <b>return</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_48_12">Positive_Count</A>
+   <b>function</b> <FONT COLOR=red><A NAME="ref_225_13" HREF="terminal_interface-curses-text_io__ads.htm#ref_98_13">Col</A></FONT> (<FONT COLOR=red><A NAME="ref_225_18" HREF="terminal_interface-curses-text_io__ads.htm#ref_98_18">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>) <b>return</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_48_12">Positive_Count</A>
    <b>is</b>
       <FONT COLOR=red><A NAME="ref_227_7">Y</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
       <FONT COLOR=red><A NAME="ref_228_7">X</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
@@ -247,7 +247,7 @@
       <b>return</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_98_13">Col</A> (<A HREF="terminal_interface-curses-text_io__ads.htm#ref_62_13">Get_Window</A>);
    <b>end</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_99_13">Col</A>;
 
-   <b>function</b> <FONT COLOR=red><A NAME="ref_245_13" HREF="terminal_interface-curses-text_io__ads.htm#ref_101_13">Line</A></FONT> (<FONT COLOR=red><A NAME="ref_245_19" HREF="terminal_interface-curses-text_io__ads.htm#ref_101_19">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>) <b>return</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_48_12">Positive_Count</A>
+   <b>function</b> <FONT COLOR=red><A NAME="ref_245_13" HREF="terminal_interface-curses-text_io__ads.htm#ref_101_13">Line</A></FONT> (<FONT COLOR=red><A NAME="ref_245_19" HREF="terminal_interface-curses-text_io__ads.htm#ref_101_19">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>) <b>return</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_48_12">Positive_Count</A>
    <b>is</b>
       <FONT COLOR=red><A NAME="ref_247_7">Y</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
       <FONT COLOR=red><A NAME="ref_248_7">X</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
@@ -271,7 +271,7 @@
    <FONT COLOR=green><EM>-- Characters Output --</EM></FONT>
    <FONT COLOR=green><EM>-----------------------</EM></FONT>
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_269_14" HREF="terminal_interface-curses-text_io__ads.htm#ref_108_14">Put</A></FONT> (<FONT COLOR=red><A NAME="ref_269_19" HREF="terminal_interface-curses-text_io__ads.htm#ref_108_19">Win</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>; <FONT COLOR=red><A NAME="ref_269_37" HREF="terminal_interface-curses-text_io__ads.htm#ref_108_37">Item</A></FONT> : <b>in</b> Character)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_269_14" HREF="terminal_interface-curses-text_io__ads.htm#ref_108_14">Put</A></FONT> (<FONT COLOR=red><A NAME="ref_269_19" HREF="terminal_interface-curses-text_io__ads.htm#ref_108_19">Win</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>; <FONT COLOR=red><A NAME="ref_269_34" HREF="terminal_interface-curses-text_io__ads.htm#ref_108_34">Item</A></FONT> : Character)
    <b>is</b>
       <FONT COLOR=red><A NAME="ref_271_7">P_Size</A></FONT> : <b>constant</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_47_12">Count</A> := <A HREF="terminal_interface-curses-text_io__ads.htm#ref_80_13">Page_Length</A> (<A HREF="terminal_interface-curses-text_io__ads.htm#ref_108_19">Win</A>);
       <FONT COLOR=red><A NAME="ref_272_7">Y</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
@@ -286,10 +286,10 @@
             <A HREF="terminal_interface-curses-text_io__ads.htm#ref_89_14">New_Page</A> (<A HREF="terminal_interface-curses-text_io__ads.htm#ref_108_19">Win</A>);
          <b>end</b> <b>if</b>;
       <b>end</b> <b>if</b>;
-      <A HREF="terminal_interface-curses__ads.htm#ref_528_14">Add</A> (<A HREF="terminal_interface-curses-text_io__ads.htm#ref_108_19">Win</A>, <A HREF="terminal_interface-curses-text_io__ads.htm#ref_108_37">Item</A>);
+      <A HREF="terminal_interface-curses__ads.htm#ref_528_14">Add</A> (<A HREF="terminal_interface-curses-text_io__ads.htm#ref_108_19">Win</A>, <A HREF="terminal_interface-curses-text_io__ads.htm#ref_108_34">Item</A>);
    <b>end</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_108_14">Put</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_287_14" HREF="terminal_interface-curses-text_io__ads.htm#ref_109_14">Put</A></FONT> (<FONT COLOR=red><A NAME="ref_287_19" HREF="terminal_interface-curses-text_io__ads.htm#ref_109_19">Item</A></FONT> : <b>in</b> Character)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_287_14" HREF="terminal_interface-curses-text_io__ads.htm#ref_109_14">Put</A></FONT> (<FONT COLOR=red><A NAME="ref_287_19" HREF="terminal_interface-curses-text_io__ads.htm#ref_109_19">Item</A></FONT> : Character)
    <b>is</b>
    <b>begin</b>
       <A HREF="terminal_interface-curses-text_io__ads.htm#ref_108_14">Put</A> (<A HREF="terminal_interface-curses-text_io__ads.htm#ref_62_13">Get_Window</A>, <A HREF="terminal_interface-curses-text_io__ads.htm#ref_109_19">Item</A>);
@@ -299,7 +299,7 @@
    <FONT COLOR=green><EM>-- Strings-Output --</EM></FONT>
    <FONT COLOR=green><EM>--------------------</EM></FONT>
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_297_14" HREF="terminal_interface-curses-text_io__ads.htm#ref_115_14">Put</A></FONT> (<FONT COLOR=red><A NAME="ref_297_19" HREF="terminal_interface-curses-text_io__ads.htm#ref_115_19">Win</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>; <FONT COLOR=red><A NAME="ref_297_37" HREF="terminal_interface-curses-text_io__ads.htm#ref_115_37">Item</A></FONT> : <b>in</b> String)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_297_14" HREF="terminal_interface-curses-text_io__ads.htm#ref_115_14">Put</A></FONT> (<FONT COLOR=red><A NAME="ref_297_19" HREF="terminal_interface-curses-text_io__ads.htm#ref_115_19">Win</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>; <FONT COLOR=red><A NAME="ref_297_34" HREF="terminal_interface-curses-text_io__ads.htm#ref_115_34">Item</A></FONT> : String)
    <b>is</b>
       <FONT COLOR=red><A NAME="ref_299_7">P_Size</A></FONT> : <b>constant</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_47_12">Count</A> := <A HREF="terminal_interface-curses-text_io__ads.htm#ref_80_13">Page_Length</A> (<A HREF="terminal_interface-curses-text_io__ads.htm#ref_115_19">Win</A>);
       <FONT COLOR=red><A NAME="ref_300_7">Y</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
@@ -310,22 +310,22 @@
       <b>if</b> <A HREF="terminal_interface-curses-text_io__adb.htm#ref_299_7">P_Size</A> &gt; 0 <b>then</b>
          <A HREF="terminal_interface-curses__ads.htm#ref_1244_14">Get_Cursor_Position</A> (<A HREF="terminal_interface-curses-text_io__ads.htm#ref_115_19">Win</A>, <A HREF="terminal_interface-curses-text_io__adb.htm#ref_300_7">Y</A>, <A HREF="terminal_interface-curses-text_io__adb.htm#ref_301_7">X</A>);
          <A HREF="terminal_interface-curses__ads.htm#ref_1228_14">Get_Size</A> (<A HREF="terminal_interface-curses-text_io__ads.htm#ref_115_19">Win</A>, <A HREF="terminal_interface-curses-text_io__adb.htm#ref_302_7">L</A>, <A HREF="terminal_interface-curses-text_io__adb.htm#ref_303_7">C</A>);
-         <b>if</b> (<A HREF="terminal_interface-curses-text_io__adb.htm#ref_300_7">Y</A> + 1) = <A HREF="terminal_interface-curses-text_io__adb.htm#ref_302_7">L</A> <b>and</b> <b>then</b> (<A HREF="terminal_interface-curses-text_io__adb.htm#ref_301_7">X</A> + 1 + <A HREF="terminal_interface-curses-text_io__ads.htm#ref_115_37">Item</A>'Length) &gt;= <A HREF="terminal_interface-curses-text_io__adb.htm#ref_303_7">C</A> <b>then</b>
+         <b>if</b> (<A HREF="terminal_interface-curses-text_io__adb.htm#ref_300_7">Y</A> + 1) = <A HREF="terminal_interface-curses-text_io__adb.htm#ref_302_7">L</A> <b>and</b> <b>then</b> (<A HREF="terminal_interface-curses-text_io__adb.htm#ref_301_7">X</A> + 1 + <A HREF="terminal_interface-curses-text_io__ads.htm#ref_115_34">Item</A>'Length) &gt;= <A HREF="terminal_interface-curses-text_io__adb.htm#ref_303_7">C</A> <b>then</b>
             <A HREF="terminal_interface-curses-text_io__ads.htm#ref_89_14">New_Page</A> (<A HREF="terminal_interface-curses-text_io__ads.htm#ref_115_19">Win</A>);
          <b>end</b> <b>if</b>;
       <b>end</b> <b>if</b>;
-      <A HREF="terminal_interface-curses__ads.htm#ref_653_14">Add</A> (<A HREF="terminal_interface-curses-text_io__ads.htm#ref_115_19">Win</A>, <A HREF="terminal_interface-curses-text_io__ads.htm#ref_115_37">Item</A>);
+      <A HREF="terminal_interface-curses__ads.htm#ref_653_14">Add</A> (<A HREF="terminal_interface-curses-text_io__ads.htm#ref_115_19">Win</A>, <A HREF="terminal_interface-curses-text_io__ads.htm#ref_115_34">Item</A>);
    <b>end</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_115_14">Put</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_315_14" HREF="terminal_interface-curses-text_io__ads.htm#ref_116_14">Put</A></FONT> (<FONT COLOR=red><A NAME="ref_315_19" HREF="terminal_interface-curses-text_io__ads.htm#ref_116_19">Item</A></FONT> : <b>in</b> String)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_315_14" HREF="terminal_interface-curses-text_io__ads.htm#ref_116_14">Put</A></FONT> (<FONT COLOR=red><A NAME="ref_315_19" HREF="terminal_interface-curses-text_io__ads.htm#ref_116_19">Item</A></FONT> : String)
    <b>is</b>
    <b>begin</b>
       <A HREF="terminal_interface-curses-text_io__ads.htm#ref_115_14">Put</A> (<A HREF="terminal_interface-curses-text_io__ads.htm#ref_62_13">Get_Window</A>, <A HREF="terminal_interface-curses-text_io__ads.htm#ref_116_19">Item</A>);
    <b>end</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_116_14">Put</A>;
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_321_14" HREF="terminal_interface-curses-text_io__ads.htm#ref_118_14">Put_Line</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_322_7" HREF="terminal_interface-curses-text_io__ads.htm#ref_119_7">Win</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
-      <FONT COLOR=red><A NAME="ref_323_7" HREF="terminal_interface-curses-text_io__ads.htm#ref_120_7">Item</A></FONT> : <b>in</b> String)
+     (<FONT COLOR=red><A NAME="ref_322_7" HREF="terminal_interface-curses-text_io__ads.htm#ref_119_7">Win</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
+      <FONT COLOR=red><A NAME="ref_323_7" HREF="terminal_interface-curses-text_io__ads.htm#ref_120_7">Item</A></FONT> : String)
    <b>is</b>
    <b>begin</b>
       <A HREF="terminal_interface-curses-text_io__ads.htm#ref_115_14">Put</A> (<A HREF="terminal_interface-curses-text_io__ads.htm#ref_119_7">Win</A>, <A HREF="terminal_interface-curses-text_io__ads.htm#ref_120_7">Item</A>);
@@ -333,7 +333,7 @@
    <b>end</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_118_14">Put_Line</A>;
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_330_14" HREF="terminal_interface-curses-text_io__ads.htm#ref_122_14">Put_Line</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_331_7" HREF="terminal_interface-curses-text_io__ads.htm#ref_123_7">Item</A></FONT> : <b>in</b> String)
+     (<FONT COLOR=red><A NAME="ref_331_7" HREF="terminal_interface-curses-text_io__ads.htm#ref_123_7">Item</A></FONT> : String)
    <b>is</b>
    <b>begin</b>
       <A HREF="terminal_interface-curses-text_io__ads.htm#ref_118_14">Put_Line</A> (<A HREF="terminal_interface-curses-text_io__ads.htm#ref_62_13">Get_Window</A>, <A HREF="terminal_interface-curses-text_io__ads.htm#ref_123_7">Item</A>);
diff -Naur ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-text_io__ads.htm ncurses-5.7/doc/html/ada/terminal_interface-curses-text_io__ads.htm
--- ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-text_io__ads.htm	2006-09-23 16:31:32.000000000 -0400
+++ ncurses-5.7/doc/html/ada/terminal_interface-curses-text_io__ads.htm	2011-01-08 18:13:50.383157249 -0500
@@ -12,7 +12,7 @@
 <FONT COLOR=green><EM>--                                 S P E C                                  --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-<FONT COLOR=green><EM>-- Copyright (c) 1998 Free Software Foundation, Inc.                        --</EM></FONT>
+<FONT COLOR=green><EM>-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>-- Permission is hereby granted, free of charge, to any person obtaining a  --</EM></FONT>
 <FONT COLOR=green><EM>-- copy of this software and associated documentation files (the            --</EM></FONT>
@@ -40,7 +40,7 @@
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <FONT COLOR=green><EM>--  Author:  Juergen Pfeifer, 1996</EM></FONT>
 <FONT COLOR=green><EM>--  Version Control:</EM></FONT>
-<FONT COLOR=green><EM>--  @Revision: 1.13 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Revision: 1.14 @</EM></FONT>
 <FONT COLOR=green><EM>--  Binding Version 01.00</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <b>with</b> Ada.Text_IO;
@@ -61,13 +61,13 @@
    <FONT COLOR=green><EM>--  type parameter. They will operate on a default window, which can</EM></FONT>
    <FONT COLOR=green><EM>--  be set by the user. It is initially equal to Standard_Window.</EM></FONT>
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_59_14" HREF="terminal_interface-curses-text_io__adb.htm#ref_46_14">Set_Window</A></FONT> (<FONT COLOR=red><A NAME="ref_59_26" HREF="terminal_interface-curses-text_io__adb.htm#ref_46_26">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_59_14" HREF="terminal_interface-curses-text_io__adb.htm#ref_46_14">Set_Window</A></FONT> (<FONT COLOR=red><A NAME="ref_59_26" HREF="terminal_interface-curses-text_io__adb.htm#ref_46_26">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>);
    <FONT COLOR=green><EM>--  Set Win as the default window</EM></FONT>
 
    <b>function</b> <FONT COLOR=red><A NAME="ref_62_13" HREF="terminal_interface-curses-text_io__adb.htm#ref_52_13">Get_Window</A></FONT> <b>return</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
    <FONT COLOR=green><EM>--  Get the current default window</EM></FONT>
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_65_14" HREF="terminal_interface-curses-text_io__adb.htm#ref_63_14">Flush</A></FONT> (<FONT COLOR=red><A NAME="ref_65_21" HREF="terminal_interface-curses-text_io__adb.htm#ref_63_21">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_65_14" HREF="terminal_interface-curses-text_io__adb.htm#ref_63_14">Flush</A></FONT> (<FONT COLOR=red><A NAME="ref_65_21" HREF="terminal_interface-curses-text_io__adb.htm#ref_63_21">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>);
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_66_14" HREF="terminal_interface-curses-text_io__adb.htm#ref_69_14">Flush</A></FONT>;
 
    <FONT COLOR=green><EM>--------------------------------------------</EM></FONT>
@@ -79,53 +79,53 @@
    <FONT COLOR=green><EM>--  A scroll-window is interpreted as an page with unbounded page length,</EM></FONT>
    <FONT COLOR=green><EM>--  i.e. it returns the conventional 0 as page length.</EM></FONT>
 
-   <b>function</b> <FONT COLOR=red><A NAME="ref_77_13" HREF="terminal_interface-curses-text_io__adb.htm#ref_84_13">Line_Length</A></FONT> (<FONT COLOR=red><A NAME="ref_77_26" HREF="terminal_interface-curses-text_io__adb.htm#ref_84_26">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>) <b>return</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_47_12">Count</A>;
+   <b>function</b> <FONT COLOR=red><A NAME="ref_77_13" HREF="terminal_interface-curses-text_io__adb.htm#ref_84_13">Line_Length</A></FONT> (<FONT COLOR=red><A NAME="ref_77_26" HREF="terminal_interface-curses-text_io__adb.htm#ref_84_26">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>) <b>return</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_47_12">Count</A>;
    <b>function</b> <FONT COLOR=red><A NAME="ref_78_13" HREF="terminal_interface-curses-text_io__adb.htm#ref_96_13">Line_Length</A></FONT> <b>return</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_47_12">Count</A>;
 
-   <b>function</b> <FONT COLOR=red><A NAME="ref_80_13" HREF="terminal_interface-curses-text_io__adb.htm#ref_102_13">Page_Length</A></FONT> (<FONT COLOR=red><A NAME="ref_80_26" HREF="terminal_interface-curses-text_io__adb.htm#ref_102_26">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>) <b>return</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_47_12">Count</A>;
+   <b>function</b> <FONT COLOR=red><A NAME="ref_80_13" HREF="terminal_interface-curses-text_io__adb.htm#ref_102_13">Page_Length</A></FONT> (<FONT COLOR=red><A NAME="ref_80_26" HREF="terminal_interface-curses-text_io__adb.htm#ref_102_26">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>) <b>return</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_47_12">Count</A>;
    <b>function</b> <FONT COLOR=red><A NAME="ref_81_13" HREF="terminal_interface-curses-text_io__adb.htm#ref_118_13">Page_Length</A></FONT> <b>return</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_47_12">Count</A>;
 
    <FONT COLOR=green><EM>------------------------------------</EM></FONT>
    <FONT COLOR=green><EM>-- Column, Line, and Page Control --</EM></FONT>
    <FONT COLOR=green><EM>------------------------------------</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_86_14" HREF="terminal_interface-curses-text_io__adb.htm#ref_127_14">New_Line</A></FONT> (<FONT COLOR=red><A NAME="ref_86_24" HREF="terminal_interface-curses-text_io__adb.htm#ref_127_24">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>; <FONT COLOR=red><A NAME="ref_86_41" HREF="terminal_interface-curses-text_io__adb.htm#ref_127_41">Spacing</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_48_12">Positive_Count</A> := 1);
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_87_14" HREF="terminal_interface-curses-text_io__adb.htm#ref_144_14">New_Line</A></FONT> (<FONT COLOR=red><A NAME="ref_87_24" HREF="terminal_interface-curses-text_io__adb.htm#ref_144_24">Spacing</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_48_12">Positive_Count</A> := 1);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_86_14" HREF="terminal_interface-curses-text_io__adb.htm#ref_127_14">New_Line</A></FONT> (<FONT COLOR=red><A NAME="ref_86_24" HREF="terminal_interface-curses-text_io__adb.htm#ref_127_24">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>; <FONT COLOR=red><A NAME="ref_86_38" HREF="terminal_interface-curses-text_io__adb.htm#ref_127_38">Spacing</A></FONT> : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_48_12">Positive_Count</A> := 1);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_87_14" HREF="terminal_interface-curses-text_io__adb.htm#ref_144_14">New_Line</A></FONT> (<FONT COLOR=red><A NAME="ref_87_24" HREF="terminal_interface-curses-text_io__adb.htm#ref_144_24">Spacing</A></FONT> : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_48_12">Positive_Count</A> := 1);
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_89_14" HREF="terminal_interface-curses-text_io__adb.htm#ref_150_14">New_Page</A></FONT> (<FONT COLOR=red><A NAME="ref_89_24" HREF="terminal_interface-curses-text_io__adb.htm#ref_150_24">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_89_14" HREF="terminal_interface-curses-text_io__adb.htm#ref_150_14">New_Page</A></FONT> (<FONT COLOR=red><A NAME="ref_89_24" HREF="terminal_interface-curses-text_io__adb.htm#ref_150_24">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>);
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_90_14" HREF="terminal_interface-curses-text_io__adb.htm#ref_156_14">New_Page</A></FONT>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_92_14" HREF="terminal_interface-curses-text_io__adb.htm#ref_162_14">Set_Col</A></FONT> (<FONT COLOR=red><A NAME="ref_92_23" HREF="terminal_interface-curses-text_io__adb.htm#ref_162_23">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;  <FONT COLOR=red><A NAME="ref_92_41" HREF="terminal_interface-curses-text_io__adb.htm#ref_162_41">To</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_48_12">Positive_Count</A>);
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_93_14" HREF="terminal_interface-curses-text_io__adb.htm#ref_190_14">Set_Col</A></FONT> (<FONT COLOR=red><A NAME="ref_93_23" HREF="terminal_interface-curses-text_io__adb.htm#ref_190_23">To</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_48_12">Positive_Count</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_92_14" HREF="terminal_interface-curses-text_io__adb.htm#ref_162_14">Set_Col</A></FONT> (<FONT COLOR=red><A NAME="ref_92_23" HREF="terminal_interface-curses-text_io__adb.htm#ref_162_23">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;  <FONT COLOR=red><A NAME="ref_92_38" HREF="terminal_interface-curses-text_io__adb.htm#ref_162_38">To</A></FONT> : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_48_12">Positive_Count</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_93_14" HREF="terminal_interface-curses-text_io__adb.htm#ref_190_14">Set_Col</A></FONT> (<FONT COLOR=red><A NAME="ref_93_23" HREF="terminal_interface-curses-text_io__adb.htm#ref_190_23">To</A></FONT> : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_48_12">Positive_Count</A>);
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_95_14" HREF="terminal_interface-curses-text_io__adb.htm#ref_196_14">Set_Line</A></FONT> (<FONT COLOR=red><A NAME="ref_95_24" HREF="terminal_interface-curses-text_io__adb.htm#ref_196_24">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>; <FONT COLOR=red><A NAME="ref_95_41" HREF="terminal_interface-curses-text_io__adb.htm#ref_196_41">To</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_48_12">Positive_Count</A>);
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_96_14" HREF="terminal_interface-curses-text_io__adb.htm#ref_219_14">Set_Line</A></FONT> (<FONT COLOR=red><A NAME="ref_96_24" HREF="terminal_interface-curses-text_io__adb.htm#ref_219_24">To</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_48_12">Positive_Count</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_95_14" HREF="terminal_interface-curses-text_io__adb.htm#ref_196_14">Set_Line</A></FONT> (<FONT COLOR=red><A NAME="ref_95_24" HREF="terminal_interface-curses-text_io__adb.htm#ref_196_24">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>; <FONT COLOR=red><A NAME="ref_95_38" HREF="terminal_interface-curses-text_io__adb.htm#ref_196_38">To</A></FONT> : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_48_12">Positive_Count</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_96_14" HREF="terminal_interface-curses-text_io__adb.htm#ref_219_14">Set_Line</A></FONT> (<FONT COLOR=red><A NAME="ref_96_24" HREF="terminal_interface-curses-text_io__adb.htm#ref_219_24">To</A></FONT> : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_48_12">Positive_Count</A>);
 
-   <b>function</b> <FONT COLOR=red><A NAME="ref_98_13" HREF="terminal_interface-curses-text_io__adb.htm#ref_225_13">Col</A></FONT> (<FONT COLOR=red><A NAME="ref_98_18" HREF="terminal_interface-curses-text_io__adb.htm#ref_225_18">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>) <b>return</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_48_12">Positive_Count</A>;
+   <b>function</b> <FONT COLOR=red><A NAME="ref_98_13" HREF="terminal_interface-curses-text_io__adb.htm#ref_225_13">Col</A></FONT> (<FONT COLOR=red><A NAME="ref_98_18" HREF="terminal_interface-curses-text_io__adb.htm#ref_225_18">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>) <b>return</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_48_12">Positive_Count</A>;
    <b>function</b> <FONT COLOR=red><A NAME="ref_99_13" HREF="terminal_interface-curses-text_io__adb.htm#ref_239_13">Col</A></FONT> <b>return</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_48_12">Positive_Count</A>;
 
-   <b>function</b> <FONT COLOR=red><A NAME="ref_101_13" HREF="terminal_interface-curses-text_io__adb.htm#ref_245_13">Line</A></FONT> (<FONT COLOR=red><A NAME="ref_101_19" HREF="terminal_interface-curses-text_io__adb.htm#ref_245_19">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>) <b>return</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_48_12">Positive_Count</A>;
+   <b>function</b> <FONT COLOR=red><A NAME="ref_101_13" HREF="terminal_interface-curses-text_io__adb.htm#ref_245_13">Line</A></FONT> (<FONT COLOR=red><A NAME="ref_101_19" HREF="terminal_interface-curses-text_io__adb.htm#ref_245_19">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>) <b>return</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_48_12">Positive_Count</A>;
    <b>function</b> <FONT COLOR=red><A NAME="ref_102_13" HREF="terminal_interface-curses-text_io__adb.htm#ref_259_13">Line</A></FONT> <b>return</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_48_12">Positive_Count</A>;
 
    <FONT COLOR=green><EM>-----------------------</EM></FONT>
    <FONT COLOR=green><EM>-- Characters-Output --</EM></FONT>
    <FONT COLOR=green><EM>-----------------------</EM></FONT>
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_108_14" HREF="terminal_interface-curses-text_io__adb.htm#ref_269_14">Put</A></FONT> (<FONT COLOR=red><A NAME="ref_108_19" HREF="terminal_interface-curses-text_io__adb.htm#ref_269_19">Win</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>; <FONT COLOR=red><A NAME="ref_108_37" HREF="terminal_interface-curses-text_io__adb.htm#ref_269_37">Item</A></FONT> : <b>in</b> Character);
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_109_14" HREF="terminal_interface-curses-text_io__adb.htm#ref_287_14">Put</A></FONT> (<FONT COLOR=red><A NAME="ref_109_19" HREF="terminal_interface-curses-text_io__adb.htm#ref_287_19">Item</A></FONT> : <b>in</b> Character);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_108_14" HREF="terminal_interface-curses-text_io__adb.htm#ref_269_14">Put</A></FONT> (<FONT COLOR=red><A NAME="ref_108_19" HREF="terminal_interface-curses-text_io__adb.htm#ref_269_19">Win</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>; <FONT COLOR=red><A NAME="ref_108_34" HREF="terminal_interface-curses-text_io__adb.htm#ref_269_34">Item</A></FONT> : Character);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_109_14" HREF="terminal_interface-curses-text_io__adb.htm#ref_287_14">Put</A></FONT> (<FONT COLOR=red><A NAME="ref_109_19" HREF="terminal_interface-curses-text_io__adb.htm#ref_287_19">Item</A></FONT> : Character);
 
    <FONT COLOR=green><EM>--------------------</EM></FONT>
    <FONT COLOR=green><EM>-- Strings-Output --</EM></FONT>
    <FONT COLOR=green><EM>--------------------</EM></FONT>
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_115_14" HREF="terminal_interface-curses-text_io__adb.htm#ref_297_14">Put</A></FONT> (<FONT COLOR=red><A NAME="ref_115_19" HREF="terminal_interface-curses-text_io__adb.htm#ref_297_19">Win</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>; <FONT COLOR=red><A NAME="ref_115_37" HREF="terminal_interface-curses-text_io__adb.htm#ref_297_37">Item</A></FONT> : <b>in</b> String);
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_116_14" HREF="terminal_interface-curses-text_io__adb.htm#ref_315_14">Put</A></FONT> (<FONT COLOR=red><A NAME="ref_116_19" HREF="terminal_interface-curses-text_io__adb.htm#ref_315_19">Item</A></FONT> : <b>in</b> String);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_115_14" HREF="terminal_interface-curses-text_io__adb.htm#ref_297_14">Put</A></FONT> (<FONT COLOR=red><A NAME="ref_115_19" HREF="terminal_interface-curses-text_io__adb.htm#ref_297_19">Win</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>; <FONT COLOR=red><A NAME="ref_115_34" HREF="terminal_interface-curses-text_io__adb.htm#ref_297_34">Item</A></FONT> : String);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_116_14" HREF="terminal_interface-curses-text_io__adb.htm#ref_315_14">Put</A></FONT> (<FONT COLOR=red><A NAME="ref_116_19" HREF="terminal_interface-curses-text_io__adb.htm#ref_315_19">Item</A></FONT> : String);
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_118_14" HREF="terminal_interface-curses-text_io__adb.htm#ref_321_14">Put_Line</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_119_7" HREF="terminal_interface-curses-text_io__adb.htm#ref_322_7">Win</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
-      <FONT COLOR=red><A NAME="ref_120_7" HREF="terminal_interface-curses-text_io__adb.htm#ref_323_7">Item</A></FONT> : <b>in</b> String);
+     (<FONT COLOR=red><A NAME="ref_119_7" HREF="terminal_interface-curses-text_io__adb.htm#ref_322_7">Win</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
+      <FONT COLOR=red><A NAME="ref_120_7" HREF="terminal_interface-curses-text_io__adb.htm#ref_323_7">Item</A></FONT> : String);
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_122_14" HREF="terminal_interface-curses-text_io__adb.htm#ref_330_14">Put_Line</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_123_7" HREF="terminal_interface-curses-text_io__adb.htm#ref_331_7">Item</A></FONT> : <b>in</b> String);
+     (<FONT COLOR=red><A NAME="ref_123_7" HREF="terminal_interface-curses-text_io__adb.htm#ref_331_7">Item</A></FONT> : String);
 
    <FONT COLOR=green><EM>--  Exceptions</EM></FONT>
 
diff -Naur ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-trace__adb.htm ncurses-5.7/doc/html/ada/terminal_interface-curses-trace__adb.htm
--- ncurses-5.7.orig/doc/html/ada/terminal_interface-curses-trace__adb.htm	2006-09-23 16:31:32.000000000 -0400
+++ ncurses-5.7/doc/html/ada/terminal_interface-curses-trace__adb.htm	2011-01-08 18:13:50.383157249 -0500
@@ -12,7 +12,7 @@
 <FONT COLOR=green><EM>--                                 B O D Y                                  --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-<FONT COLOR=green><EM>-- Copyright (c) 2000,2004 Free Software Foundation, Inc.                   --</EM></FONT>
+<FONT COLOR=green><EM>-- Copyright (c) 2000-2004,2009 Free Software Foundation, Inc.              --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>-- Permission is hereby granted, free of charge, to any person obtaining a  --</EM></FONT>
 <FONT COLOR=green><EM>-- copy of this software and associated documentation files (the            --</EM></FONT>
@@ -40,7 +40,7 @@
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <FONT COLOR=green><EM>--  Author:  Juergen Pfeifer, 1996</EM></FONT>
 <FONT COLOR=green><EM>--  Version Control:</EM></FONT>
-<FONT COLOR=green><EM>--  @Revision: 1.5 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Revision: 1.6 @</EM></FONT>
 <FONT COLOR=green><EM>--  Binding Version 01.00</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 
diff -Naur ncurses-5.7.orig/doc/html/ada/terminal_interface-curses__adb.htm ncurses-5.7/doc/html/ada/terminal_interface-curses__adb.htm
--- ncurses-5.7.orig/doc/html/ada/terminal_interface-curses__adb.htm	2008-10-11 17:36:30.000000000 -0400
+++ ncurses-5.7/doc/html/ada/terminal_interface-curses__adb.htm	2011-01-08 18:13:50.387157261 -0500
@@ -12,7 +12,7 @@
 <FONT COLOR=green><EM>--                                 B O D Y                                  --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-<FONT COLOR=green><EM>-- Copyright (c) 1998-2007,2008 Free Software Foundation, Inc.              --</EM></FONT>
+<FONT COLOR=green><EM>-- Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.              --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>-- Permission is hereby granted, free of charge, to any person obtaining a  --</EM></FONT>
 <FONT COLOR=green><EM>-- copy of this software and associated documentation files (the            --</EM></FONT>
@@ -40,15 +40,15 @@
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <FONT COLOR=green><EM>--  Author: Juergen Pfeifer, 1996</EM></FONT>
 <FONT COLOR=green><EM>--  Version Control:</EM></FONT>
-<FONT COLOR=green><EM>--  @Revision: 1.5 @</EM></FONT>
-<FONT COLOR=green><EM>--  @Date: 2008/07/26 18:46:32 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Revision: 1.6 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Date: 2009/12/26 17:38:58 @</EM></FONT>
 <FONT COLOR=green><EM>--  Binding Version 01.00</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <b>with</b> System;
 
 <b>with</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-aux__ads.htm#ref_50_35">Aux</A>;
-<b>with</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C;                  <b>use</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C;
-<b>with</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C.Strings;          <b>use</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C.Strings;
+<b>with</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C;                  <b>use</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C;
+<b>with</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C.Strings;          <b>use</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C.Strings;
 <b>with</b> Ada.Characters.Handling;       <b>use</b> Ada.Characters.Handling;
 <b>with</b> Ada.Strings.Fixed;
 
@@ -64,7 +64,7 @@
    <b>pragma</b> Convention (C, chtype_array);
 
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-   <b>function</b> <FONT COLOR=red><A NAME="ref_62_13" HREF="terminal_interface-curses__ads.htm#ref_1616_13">Key_Name</A></FONT> (<FONT COLOR=red><A NAME="ref_62_23" HREF="terminal_interface-curses__ads.htm#ref_1616_23">Key</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_73_12">Real_Key_Code</A>) <b>return</b> String
+   <b>function</b> <FONT COLOR=red><A NAME="ref_62_13" HREF="terminal_interface-curses__ads.htm#ref_1616_13">Key_Name</A></FONT> (<FONT COLOR=red><A NAME="ref_62_23" HREF="terminal_interface-curses__ads.htm#ref_1616_23">Key</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_73_12">Real_Key_Code</A>) <b>return</b> String
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_64_16">Keyname</A></FONT> (<FONT COLOR=red><A NAME="ref_64_25" HREF="terminal_interface-curses__adb.htm#ref_64_16">K</A></FONT> : <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>) <b>return</b> chars_ptr;
       <b>pragma</b> Import (C, Keyname, "keyname");
@@ -92,7 +92,7 @@
       <b>end</b> <b>if</b>;
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_1616_13">Key_Name</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_90_14" HREF="terminal_interface-curses__ads.htm#ref_1610_14">Key_Name</A></FONT> (<FONT COLOR=red><A NAME="ref_90_24" HREF="terminal_interface-curses__ads.htm#ref_1610_24">Key</A></FONT>  : <b>in</b>  <A HREF="terminal_interface-curses__ads.htm#ref_73_12">Real_Key_Code</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_90_14" HREF="terminal_interface-curses__ads.htm#ref_1610_14">Key_Name</A></FONT> (<FONT COLOR=red><A NAME="ref_90_24" HREF="terminal_interface-curses__ads.htm#ref_1610_24">Key</A></FONT>  :  <A HREF="terminal_interface-curses__ads.htm#ref_73_12">Real_Key_Code</A>;
                        <FONT COLOR=red><A NAME="ref_91_24" HREF="terminal_interface-curses__ads.htm#ref_1611_24">Name</A></FONT> : <b>out</b> String)
    <b>is</b>
    <b>begin</b>
@@ -135,9 +135,9 @@
       <b>end</b> <b>if</b>;
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_502_13">Is_End_Window</A>;
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_133_14" HREF="terminal_interface-curses__ads.htm#ref_511_14">Move_Cursor</A></FONT> (<FONT COLOR=red><A NAME="ref_133_27" HREF="terminal_interface-curses__ads.htm#ref_511_27">Win</A></FONT>    : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-                          <FONT COLOR=red><A NAME="ref_134_27" HREF="terminal_interface-curses__ads.htm#ref_512_27">Line</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
-                          <FONT COLOR=red><A NAME="ref_135_27" HREF="terminal_interface-curses__ads.htm#ref_513_27">Column</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_133_14" HREF="terminal_interface-curses__ads.htm#ref_511_14">Move_Cursor</A></FONT> (<FONT COLOR=red><A NAME="ref_133_27" HREF="terminal_interface-curses__ads.htm#ref_511_27">Win</A></FONT>    : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+                          <FONT COLOR=red><A NAME="ref_134_27" HREF="terminal_interface-curses__ads.htm#ref_512_27">Line</A></FONT>   : <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
+                          <FONT COLOR=red><A NAME="ref_135_27" HREF="terminal_interface-curses__ads.htm#ref_513_27">Column</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_137_16">Wmove</A></FONT> (<FONT COLOR=red><A NAME="ref_137_23" HREF="terminal_interface-curses__adb.htm#ref_137_16">Win</A></FONT>    : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
                       <FONT COLOR=red><A NAME="ref_138_23" HREF="terminal_interface-curses__adb.htm#ref_137_16">Line</A></FONT>   : <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
@@ -150,8 +150,8 @@
       <b>end</b> <b>if</b>;
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_511_14">Move_Cursor</A>;
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_148_14" HREF="terminal_interface-curses__ads.htm#ref_523_14">Add</A></FONT> (<FONT COLOR=red><A NAME="ref_148_19" HREF="terminal_interface-curses__ads.htm#ref_523_19">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-                  <FONT COLOR=red><A NAME="ref_149_19" HREF="terminal_interface-curses__ads.htm#ref_524_19">Ch</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_148_14" HREF="terminal_interface-curses__ads.htm#ref_523_14">Add</A></FONT> (<FONT COLOR=red><A NAME="ref_148_19" HREF="terminal_interface-curses__ads.htm#ref_523_19">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+                  <FONT COLOR=red><A NAME="ref_149_19" HREF="terminal_interface-curses__ads.htm#ref_524_19">Ch</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_151_16">Waddch</A></FONT> (<FONT COLOR=red><A NAME="ref_151_24" HREF="terminal_interface-curses__adb.htm#ref_151_16">W</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
                        <FONT COLOR=red><A NAME="ref_152_24" HREF="terminal_interface-curses__adb.htm#ref_151_16">Ch</A></FONT> : <A HREF="terminal_interface-curses-aux__ads.htm#ref_63_12">C_Chtype</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
@@ -162,8 +162,8 @@
       <b>end</b> <b>if</b>;
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_523_14">Add</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_160_14" HREF="terminal_interface-curses__ads.htm#ref_528_14">Add</A></FONT> (<FONT COLOR=red><A NAME="ref_160_19" HREF="terminal_interface-curses__ads.htm#ref_528_19">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-                  <FONT COLOR=red><A NAME="ref_161_19" HREF="terminal_interface-curses__ads.htm#ref_529_19">Ch</A></FONT>  : <b>in</b> Character)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_160_14" HREF="terminal_interface-curses__ads.htm#ref_528_14">Add</A></FONT> (<FONT COLOR=red><A NAME="ref_160_19" HREF="terminal_interface-curses__ads.htm#ref_528_19">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+                  <FONT COLOR=red><A NAME="ref_161_19" HREF="terminal_interface-curses__ads.htm#ref_529_19">Ch</A></FONT>  : Character)
    <b>is</b>
    <b>begin</b>
       <A HREF="terminal_interface-curses__ads.htm#ref_523_14">Add</A> (<A HREF="terminal_interface-curses__ads.htm#ref_528_19">Win</A>,
@@ -173,10 +173,10 @@
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_528_14">Add</A>;
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_170_14" HREF="terminal_interface-curses__ads.htm#ref_534_14">Add</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_171_7" HREF="terminal_interface-curses__ads.htm#ref_535_7">Win</A></FONT>    : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-      <FONT COLOR=red><A NAME="ref_172_7" HREF="terminal_interface-curses__ads.htm#ref_536_7">Line</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
-      <FONT COLOR=red><A NAME="ref_173_7" HREF="terminal_interface-curses__ads.htm#ref_537_7">Column</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
-      <FONT COLOR=red><A NAME="ref_174_7" HREF="terminal_interface-curses__ads.htm#ref_538_7">Ch</A></FONT>     : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A>)
+     (<FONT COLOR=red><A NAME="ref_171_7" HREF="terminal_interface-curses__ads.htm#ref_535_7">Win</A></FONT>    : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+      <FONT COLOR=red><A NAME="ref_172_7" HREF="terminal_interface-curses__ads.htm#ref_536_7">Line</A></FONT>   : <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
+      <FONT COLOR=red><A NAME="ref_173_7" HREF="terminal_interface-curses__ads.htm#ref_537_7">Column</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
+      <FONT COLOR=red><A NAME="ref_174_7" HREF="terminal_interface-curses__ads.htm#ref_538_7">Ch</A></FONT>     : <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_176_16">mvwaddch</A></FONT> (<FONT COLOR=red><A NAME="ref_176_26" HREF="terminal_interface-curses__adb.htm#ref_176_16">W</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
                          <FONT COLOR=red><A NAME="ref_177_26" HREF="terminal_interface-curses__adb.htm#ref_176_16">Y</A></FONT>  : <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
@@ -192,10 +192,10 @@
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_534_14">Add</A>;
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_189_14" HREF="terminal_interface-curses__ads.htm#ref_542_14">Add</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_190_7" HREF="terminal_interface-curses__ads.htm#ref_543_7">Win</A></FONT>    : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-      <FONT COLOR=red><A NAME="ref_191_7" HREF="terminal_interface-curses__ads.htm#ref_544_7">Line</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
-      <FONT COLOR=red><A NAME="ref_192_7" HREF="terminal_interface-curses__ads.htm#ref_545_7">Column</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
-      <FONT COLOR=red><A NAME="ref_193_7" HREF="terminal_interface-curses__ads.htm#ref_546_7">Ch</A></FONT>     : <b>in</b> Character)
+     (<FONT COLOR=red><A NAME="ref_190_7" HREF="terminal_interface-curses__ads.htm#ref_543_7">Win</A></FONT>    : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+      <FONT COLOR=red><A NAME="ref_191_7" HREF="terminal_interface-curses__ads.htm#ref_544_7">Line</A></FONT>   : <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
+      <FONT COLOR=red><A NAME="ref_192_7" HREF="terminal_interface-curses__ads.htm#ref_545_7">Column</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
+      <FONT COLOR=red><A NAME="ref_193_7" HREF="terminal_interface-curses__ads.htm#ref_546_7">Ch</A></FONT>     : Character)
    <b>is</b>
    <b>begin</b>
       <A HREF="terminal_interface-curses__ads.htm#ref_534_14">Add</A> (<A HREF="terminal_interface-curses__ads.htm#ref_543_7">Win</A>,
@@ -207,8 +207,8 @@
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_542_14">Add</A>;
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_204_14" HREF="terminal_interface-curses__ads.htm#ref_551_14">Add_With_Immediate_Echo</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_205_7" HREF="terminal_interface-curses__ads.htm#ref_552_7">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-      <FONT COLOR=red><A NAME="ref_206_7" HREF="terminal_interface-curses__ads.htm#ref_553_7">Ch</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A>)
+     (<FONT COLOR=red><A NAME="ref_205_7" HREF="terminal_interface-curses__ads.htm#ref_552_7">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+      <FONT COLOR=red><A NAME="ref_206_7" HREF="terminal_interface-curses__ads.htm#ref_553_7">Ch</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_208_16">Wechochar</A></FONT> (<FONT COLOR=red><A NAME="ref_208_27" HREF="terminal_interface-curses__adb.htm#ref_208_16">W</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
                           <FONT COLOR=red><A NAME="ref_209_27" HREF="terminal_interface-curses__adb.htm#ref_208_16">Ch</A></FONT> : <A HREF="terminal_interface-curses-aux__ads.htm#ref_63_12">C_Chtype</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
@@ -220,8 +220,8 @@
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_551_14">Add_With_Immediate_Echo</A>;
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_217_14" HREF="terminal_interface-curses__ads.htm#ref_557_14">Add_With_Immediate_Echo</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_218_7" HREF="terminal_interface-curses__ads.htm#ref_558_7">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-      <FONT COLOR=red><A NAME="ref_219_7" HREF="terminal_interface-curses__ads.htm#ref_559_7">Ch</A></FONT>  : <b>in</b> Character)
+     (<FONT COLOR=red><A NAME="ref_218_7" HREF="terminal_interface-curses__ads.htm#ref_558_7">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+      <FONT COLOR=red><A NAME="ref_219_7" HREF="terminal_interface-curses__ads.htm#ref_559_7">Ch</A></FONT>  : Character)
    <b>is</b>
    <b>begin</b>
       <A HREF="terminal_interface-curses__ads.htm#ref_551_14">Add_With_Immediate_Echo</A>
@@ -334,9 +334,9 @@
       <b>return</b> <A HREF="terminal_interface-curses__adb.htm#ref_324_7">W</A>;
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_614_13">Duplicate</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_332_14" HREF="terminal_interface-curses__ads.htm#ref_619_14">Move_Window</A></FONT> (<FONT COLOR=red><A NAME="ref_332_27" HREF="terminal_interface-curses__ads.htm#ref_619_27">Win</A></FONT>    : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
-                          <FONT COLOR=red><A NAME="ref_333_27" HREF="terminal_interface-curses__ads.htm#ref_620_27">Line</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
-                          <FONT COLOR=red><A NAME="ref_334_27" HREF="terminal_interface-curses__ads.htm#ref_621_27">Column</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_332_14" HREF="terminal_interface-curses__ads.htm#ref_619_14">Move_Window</A></FONT> (<FONT COLOR=red><A NAME="ref_332_27" HREF="terminal_interface-curses__ads.htm#ref_619_27">Win</A></FONT>    : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
+                          <FONT COLOR=red><A NAME="ref_333_27" HREF="terminal_interface-curses__ads.htm#ref_620_27">Line</A></FONT>   : <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
+                          <FONT COLOR=red><A NAME="ref_334_27" HREF="terminal_interface-curses__ads.htm#ref_621_27">Column</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_336_16">Mvwin</A></FONT> (<FONT COLOR=red><A NAME="ref_336_23" HREF="terminal_interface-curses__adb.htm#ref_336_16">Win</A></FONT>    : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
                       <FONT COLOR=red><A NAME="ref_337_23" HREF="terminal_interface-curses__adb.htm#ref_336_16">Line</A></FONT>   : <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
@@ -348,9 +348,9 @@
       <b>end</b> <b>if</b>;
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_619_14">Move_Window</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_346_14" HREF="terminal_interface-curses__ads.htm#ref_626_14">Move_Derived_Window</A></FONT> (<FONT COLOR=red><A NAME="ref_346_35" HREF="terminal_interface-curses__ads.htm#ref_626_35">Win</A></FONT>    : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
-                                  <FONT COLOR=red><A NAME="ref_347_35" HREF="terminal_interface-curses__ads.htm#ref_627_35">Line</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
-                                  <FONT COLOR=red><A NAME="ref_348_35" HREF="terminal_interface-curses__ads.htm#ref_628_35">Column</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_346_14" HREF="terminal_interface-curses__ads.htm#ref_626_14">Move_Derived_Window</A></FONT> (<FONT COLOR=red><A NAME="ref_346_35" HREF="terminal_interface-curses__ads.htm#ref_626_35">Win</A></FONT>    : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
+                                  <FONT COLOR=red><A NAME="ref_347_35" HREF="terminal_interface-curses__ads.htm#ref_627_35">Line</A></FONT>   : <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
+                                  <FONT COLOR=red><A NAME="ref_348_35" HREF="terminal_interface-curses__ads.htm#ref_628_35">Column</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_350_16">Mvderwin</A></FONT> (<FONT COLOR=red><A NAME="ref_350_26" HREF="terminal_interface-curses__adb.htm#ref_350_16">Win</A></FONT>    : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
                          <FONT COLOR=red><A NAME="ref_351_26" HREF="terminal_interface-curses__adb.htm#ref_350_16">Line</A></FONT>   : <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
@@ -362,8 +362,8 @@
       <b>end</b> <b>if</b>;
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_626_14">Move_Derived_Window</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_360_14" HREF="terminal_interface-curses__ads.htm#ref_643_14">Set_Synch_Mode</A></FONT> (<FONT COLOR=red><A NAME="ref_360_30" HREF="terminal_interface-curses__ads.htm#ref_643_30">Win</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>  := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-                             <FONT COLOR=red><A NAME="ref_361_30" HREF="terminal_interface-curses__ads.htm#ref_644_30">Mode</A></FONT> : <b>in</b> Boolean := False)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_360_14" HREF="terminal_interface-curses__ads.htm#ref_643_14">Set_Synch_Mode</A></FONT> (<FONT COLOR=red><A NAME="ref_360_30" HREF="terminal_interface-curses__ads.htm#ref_643_30">Win</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>  := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+                             <FONT COLOR=red><A NAME="ref_361_30" HREF="terminal_interface-curses__ads.htm#ref_644_30">Mode</A></FONT> : Boolean := False)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_363_16">Syncok</A></FONT> (<FONT COLOR=red><A NAME="ref_363_24" HREF="terminal_interface-curses__adb.htm#ref_363_16">Win</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
                        <FONT COLOR=red><A NAME="ref_364_24" HREF="terminal_interface-curses__adb.htm#ref_363_16">Mode</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_1926_9">Curses_Bool</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
@@ -374,9 +374,9 @@
       <b>end</b> <b>if</b>;
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_643_14">Set_Synch_Mode</A>;
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_372_14" HREF="terminal_interface-curses__ads.htm#ref_653_14">Add</A></FONT> (<FONT COLOR=red><A NAME="ref_372_19" HREF="terminal_interface-curses__ads.htm#ref_653_19">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-                  <FONT COLOR=red><A NAME="ref_373_19" HREF="terminal_interface-curses__ads.htm#ref_654_19">Str</A></FONT> : <b>in</b> String;
-                  <FONT COLOR=red><A NAME="ref_374_19" HREF="terminal_interface-curses__ads.htm#ref_655_19">Len</A></FONT> : <b>in</b> Integer := -1)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_372_14" HREF="terminal_interface-curses__ads.htm#ref_653_14">Add</A></FONT> (<FONT COLOR=red><A NAME="ref_372_19" HREF="terminal_interface-curses__ads.htm#ref_653_19">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+                  <FONT COLOR=red><A NAME="ref_373_19" HREF="terminal_interface-curses__ads.htm#ref_654_19">Str</A></FONT> : String;
+                  <FONT COLOR=red><A NAME="ref_374_19" HREF="terminal_interface-curses__ads.htm#ref_655_19">Len</A></FONT> : Integer := -1)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_376_16">Waddnstr</A></FONT> (<FONT COLOR=red><A NAME="ref_376_26" HREF="terminal_interface-curses__adb.htm#ref_376_16">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
                          <FONT COLOR=red><A NAME="ref_377_26" HREF="terminal_interface-curses__adb.htm#ref_376_16">Str</A></FONT> : char_array;
@@ -393,11 +393,11 @@
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_653_14">Add</A>;
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_390_14" HREF="terminal_interface-curses__ads.htm#ref_662_14">Add</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_391_7" HREF="terminal_interface-curses__ads.htm#ref_662_19">Win</A></FONT>    : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-      <FONT COLOR=red><A NAME="ref_392_7" HREF="terminal_interface-curses__ads.htm#ref_663_19">Line</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
-      <FONT COLOR=red><A NAME="ref_393_7" HREF="terminal_interface-curses__ads.htm#ref_664_19">Column</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
-      <FONT COLOR=red><A NAME="ref_394_7" HREF="terminal_interface-curses__ads.htm#ref_665_19">Str</A></FONT>    : <b>in</b> String;
-      <FONT COLOR=red><A NAME="ref_395_7" HREF="terminal_interface-curses__ads.htm#ref_666_19">Len</A></FONT>    : <b>in</b> Integer := -1)
+     (<FONT COLOR=red><A NAME="ref_391_7" HREF="terminal_interface-curses__ads.htm#ref_662_19">Win</A></FONT>    : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+      <FONT COLOR=red><A NAME="ref_392_7" HREF="terminal_interface-curses__ads.htm#ref_663_19">Line</A></FONT>   : <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
+      <FONT COLOR=red><A NAME="ref_393_7" HREF="terminal_interface-curses__ads.htm#ref_664_19">Column</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
+      <FONT COLOR=red><A NAME="ref_394_7" HREF="terminal_interface-curses__ads.htm#ref_665_19">Str</A></FONT>    : String;
+      <FONT COLOR=red><A NAME="ref_395_7" HREF="terminal_interface-curses__ads.htm#ref_666_19">Len</A></FONT>    : Integer := -1)
    <b>is</b>
    <b>begin</b>
       <A HREF="terminal_interface-curses__ads.htm#ref_511_14">Move_Cursor</A> (<A HREF="terminal_interface-curses__ads.htm#ref_662_19">Win</A>, <A HREF="terminal_interface-curses__ads.htm#ref_663_19">Line</A>, <A HREF="terminal_interface-curses__ads.htm#ref_664_19">Column</A>);
@@ -405,9 +405,9 @@
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_662_14">Add</A>;
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_402_14" HREF="terminal_interface-curses__ads.htm#ref_677_14">Add</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_403_7" HREF="terminal_interface-curses__ads.htm#ref_677_19">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-      <FONT COLOR=red><A NAME="ref_404_7" HREF="terminal_interface-curses__ads.htm#ref_678_19">Str</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_371_4">Attributed_String</A>;
-      <FONT COLOR=red><A NAME="ref_405_7" HREF="terminal_interface-curses__ads.htm#ref_679_19">Len</A></FONT> : <b>in</b> Integer := -1)
+     (<FONT COLOR=red><A NAME="ref_403_7" HREF="terminal_interface-curses__ads.htm#ref_677_19">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+      <FONT COLOR=red><A NAME="ref_404_7" HREF="terminal_interface-curses__ads.htm#ref_678_19">Str</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_371_4">Attributed_String</A>;
+      <FONT COLOR=red><A NAME="ref_405_7" HREF="terminal_interface-curses__ads.htm#ref_679_19">Len</A></FONT> : Integer := -1)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_407_16">Waddchnstr</A></FONT> (<FONT COLOR=red><A NAME="ref_407_28" HREF="terminal_interface-curses__adb.htm#ref_407_16">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
                            <FONT COLOR=red><A NAME="ref_408_28" HREF="terminal_interface-curses__adb.htm#ref_407_16">Str</A></FONT> : chtype_array;
@@ -428,11 +428,11 @@
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_677_14">Add</A>;
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_425_14" HREF="terminal_interface-curses__ads.htm#ref_686_14">Add</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_426_7" HREF="terminal_interface-curses__ads.htm#ref_686_19">Win</A></FONT>    : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-      <FONT COLOR=red><A NAME="ref_427_7" HREF="terminal_interface-curses__ads.htm#ref_687_19">Line</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
-      <FONT COLOR=red><A NAME="ref_428_7" HREF="terminal_interface-curses__ads.htm#ref_688_19">Column</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
-      <FONT COLOR=red><A NAME="ref_429_7" HREF="terminal_interface-curses__ads.htm#ref_689_19">Str</A></FONT>    : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_371_4">Attributed_String</A>;
-      <FONT COLOR=red><A NAME="ref_430_7" HREF="terminal_interface-curses__ads.htm#ref_690_19">Len</A></FONT>    : <b>in</b> Integer := -1)
+     (<FONT COLOR=red><A NAME="ref_426_7" HREF="terminal_interface-curses__ads.htm#ref_686_19">Win</A></FONT>    : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+      <FONT COLOR=red><A NAME="ref_427_7" HREF="terminal_interface-curses__ads.htm#ref_687_19">Line</A></FONT>   : <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
+      <FONT COLOR=red><A NAME="ref_428_7" HREF="terminal_interface-curses__ads.htm#ref_688_19">Column</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
+      <FONT COLOR=red><A NAME="ref_429_7" HREF="terminal_interface-curses__ads.htm#ref_689_19">Str</A></FONT>    : <A HREF="terminal_interface-curses__ads.htm#ref_371_4">Attributed_String</A>;
+      <FONT COLOR=red><A NAME="ref_430_7" HREF="terminal_interface-curses__ads.htm#ref_690_19">Len</A></FONT>    : Integer := -1)
    <b>is</b>
    <b>begin</b>
       <A HREF="terminal_interface-curses__ads.htm#ref_511_14">Move_Cursor</A> (<A HREF="terminal_interface-curses__ads.htm#ref_686_19">Win</A>, <A HREF="terminal_interface-curses__ads.htm#ref_687_19">Line</A>, <A HREF="terminal_interface-curses__ads.htm#ref_688_19">Column</A>);
@@ -440,15 +440,15 @@
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_686_14">Add</A>;
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_437_14" HREF="terminal_interface-curses__ads.htm#ref_704_14">Border</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_438_7" HREF="terminal_interface-curses__ads.htm#ref_705_7">Win</A></FONT>                       : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-      <FONT COLOR=red><A NAME="ref_439_7" HREF="terminal_interface-curses__ads.htm#ref_706_7">Left_Side_Symbol</A></FONT>          : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A> := <A HREF="terminal_interface-curses__ads.htm#ref_371_4">Default_Character</A>;
-      <FONT COLOR=red><A NAME="ref_440_7" HREF="terminal_interface-curses__ads.htm#ref_707_7">Right_Side_Symbol</A></FONT>         : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A> := <A HREF="terminal_interface-curses__ads.htm#ref_371_4">Default_Character</A>;
-      <FONT COLOR=red><A NAME="ref_441_7" HREF="terminal_interface-curses__ads.htm#ref_708_7">Top_Side_Symbol</A></FONT>           : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A> := <A HREF="terminal_interface-curses__ads.htm#ref_371_4">Default_Character</A>;
-      <FONT COLOR=red><A NAME="ref_442_7" HREF="terminal_interface-curses__ads.htm#ref_709_7">Bottom_Side_Symbol</A></FONT>        : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A> := <A HREF="terminal_interface-curses__ads.htm#ref_371_4">Default_Character</A>;
-      <FONT COLOR=red><A NAME="ref_443_7" HREF="terminal_interface-curses__ads.htm#ref_710_7">Upper_Left_Corner_Symbol</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A> := <A HREF="terminal_interface-curses__ads.htm#ref_371_4">Default_Character</A>;
-      <FONT COLOR=red><A NAME="ref_444_7" HREF="terminal_interface-curses__ads.htm#ref_711_7">Upper_Right_Corner_Symbol</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A> := <A HREF="terminal_interface-curses__ads.htm#ref_371_4">Default_Character</A>;
-      <FONT COLOR=red><A NAME="ref_445_7" HREF="terminal_interface-curses__ads.htm#ref_712_7">Lower_Left_Corner_Symbol</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A> := <A HREF="terminal_interface-curses__ads.htm#ref_371_4">Default_Character</A>;
-      <FONT COLOR=red><A NAME="ref_446_7" HREF="terminal_interface-curses__ads.htm#ref_713_7">Lower_Right_Corner_Symbol</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A> := <A HREF="terminal_interface-curses__ads.htm#ref_371_4">Default_Character</A>)
+     (<FONT COLOR=red><A NAME="ref_438_7" HREF="terminal_interface-curses__ads.htm#ref_705_7">Win</A></FONT>                       : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+      <FONT COLOR=red><A NAME="ref_439_7" HREF="terminal_interface-curses__ads.htm#ref_706_7">Left_Side_Symbol</A></FONT>          : <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A> := <A HREF="terminal_interface-curses__ads.htm#ref_371_4">Default_Character</A>;
+      <FONT COLOR=red><A NAME="ref_440_7" HREF="terminal_interface-curses__ads.htm#ref_707_7">Right_Side_Symbol</A></FONT>         : <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A> := <A HREF="terminal_interface-curses__ads.htm#ref_371_4">Default_Character</A>;
+      <FONT COLOR=red><A NAME="ref_441_7" HREF="terminal_interface-curses__ads.htm#ref_708_7">Top_Side_Symbol</A></FONT>           : <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A> := <A HREF="terminal_interface-curses__ads.htm#ref_371_4">Default_Character</A>;
+      <FONT COLOR=red><A NAME="ref_442_7" HREF="terminal_interface-curses__ads.htm#ref_709_7">Bottom_Side_Symbol</A></FONT>        : <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A> := <A HREF="terminal_interface-curses__ads.htm#ref_371_4">Default_Character</A>;
+      <FONT COLOR=red><A NAME="ref_443_7" HREF="terminal_interface-curses__ads.htm#ref_710_7">Upper_Left_Corner_Symbol</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A> := <A HREF="terminal_interface-curses__ads.htm#ref_371_4">Default_Character</A>;
+      <FONT COLOR=red><A NAME="ref_444_7" HREF="terminal_interface-curses__ads.htm#ref_711_7">Upper_Right_Corner_Symbol</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A> := <A HREF="terminal_interface-curses__ads.htm#ref_371_4">Default_Character</A>;
+      <FONT COLOR=red><A NAME="ref_445_7" HREF="terminal_interface-curses__ads.htm#ref_712_7">Lower_Left_Corner_Symbol</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A> := <A HREF="terminal_interface-curses__ads.htm#ref_371_4">Default_Character</A>;
+      <FONT COLOR=red><A NAME="ref_446_7" HREF="terminal_interface-curses__ads.htm#ref_713_7">Lower_Right_Corner_Symbol</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A> := <A HREF="terminal_interface-curses__ads.htm#ref_371_4">Default_Character</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_448_16">Wborder</A></FONT> (<FONT COLOR=red><A NAME="ref_448_25" HREF="terminal_interface-curses__adb.htm#ref_448_16">W</A></FONT>   : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
                         <FONT COLOR=red><A NAME="ref_449_25" HREF="terminal_interface-curses__adb.htm#ref_448_16">LS</A></FONT>  : <A HREF="terminal_interface-curses-aux__ads.htm#ref_63_12">C_Chtype</A>;
@@ -477,9 +477,9 @@
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_704_14">Border</A>;
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_474_14" HREF="terminal_interface-curses__ads.htm#ref_720_14">Box</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_475_7" HREF="terminal_interface-curses__ads.htm#ref_721_7">Win</A></FONT>               : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-      <FONT COLOR=red><A NAME="ref_476_7" HREF="terminal_interface-curses__ads.htm#ref_722_7">Vertical_Symbol</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A> := <A HREF="terminal_interface-curses__ads.htm#ref_371_4">Default_Character</A>;
-      <FONT COLOR=red><A NAME="ref_477_7" HREF="terminal_interface-curses__ads.htm#ref_723_7">Horizontal_Symbol</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A> := <A HREF="terminal_interface-curses__ads.htm#ref_371_4">Default_Character</A>)
+     (<FONT COLOR=red><A NAME="ref_475_7" HREF="terminal_interface-curses__ads.htm#ref_721_7">Win</A></FONT>               : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+      <FONT COLOR=red><A NAME="ref_476_7" HREF="terminal_interface-curses__ads.htm#ref_722_7">Vertical_Symbol</A></FONT>   : <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A> := <A HREF="terminal_interface-curses__ads.htm#ref_371_4">Default_Character</A>;
+      <FONT COLOR=red><A NAME="ref_477_7" HREF="terminal_interface-curses__ads.htm#ref_723_7">Horizontal_Symbol</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A> := <A HREF="terminal_interface-curses__ads.htm#ref_371_4">Default_Character</A>)
    <b>is</b>
    <b>begin</b>
       <A HREF="terminal_interface-curses__ads.htm#ref_704_14">Border</A> (<A HREF="terminal_interface-curses__ads.htm#ref_721_7">Win</A>,
@@ -488,9 +488,9 @@
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_720_14">Box</A>;
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_485_14" HREF="terminal_interface-curses__ads.htm#ref_728_14">Horizontal_Line</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_486_7" HREF="terminal_interface-curses__ads.htm#ref_729_7">Win</A></FONT>         : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-      <FONT COLOR=red><A NAME="ref_487_7" HREF="terminal_interface-curses__ads.htm#ref_730_7">Line_Size</A></FONT>   : <b>in</b> Natural;
-      <FONT COLOR=red><A NAME="ref_488_7" HREF="terminal_interface-curses__ads.htm#ref_731_7">Line_Symbol</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A> := <A HREF="terminal_interface-curses__ads.htm#ref_371_4">Default_Character</A>)
+     (<FONT COLOR=red><A NAME="ref_486_7" HREF="terminal_interface-curses__ads.htm#ref_729_7">Win</A></FONT>         : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+      <FONT COLOR=red><A NAME="ref_487_7" HREF="terminal_interface-curses__ads.htm#ref_730_7">Line_Size</A></FONT>   : Natural;
+      <FONT COLOR=red><A NAME="ref_488_7" HREF="terminal_interface-curses__ads.htm#ref_731_7">Line_Symbol</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A> := <A HREF="terminal_interface-curses__ads.htm#ref_371_4">Default_Character</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_490_16">Whline</A></FONT> (<FONT COLOR=red><A NAME="ref_490_24" HREF="terminal_interface-curses__adb.htm#ref_490_16">W</A></FONT>   : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
                        <FONT COLOR=red><A NAME="ref_491_24" HREF="terminal_interface-curses__adb.htm#ref_490_16">Ch</A></FONT>  : <A HREF="terminal_interface-curses-aux__ads.htm#ref_63_12">C_Chtype</A>;
@@ -505,9 +505,9 @@
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_728_14">Horizontal_Line</A>;
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_502_14" HREF="terminal_interface-curses__ads.htm#ref_737_14">Vertical_Line</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_503_7" HREF="terminal_interface-curses__ads.htm#ref_738_7">Win</A></FONT>         : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-      <FONT COLOR=red><A NAME="ref_504_7" HREF="terminal_interface-curses__ads.htm#ref_739_7">Line_Size</A></FONT>   : <b>in</b> Natural;
-      <FONT COLOR=red><A NAME="ref_505_7" HREF="terminal_interface-curses__ads.htm#ref_740_7">Line_Symbol</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A> := <A HREF="terminal_interface-curses__ads.htm#ref_371_4">Default_Character</A>)
+     (<FONT COLOR=red><A NAME="ref_503_7" HREF="terminal_interface-curses__ads.htm#ref_738_7">Win</A></FONT>         : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+      <FONT COLOR=red><A NAME="ref_504_7" HREF="terminal_interface-curses__ads.htm#ref_739_7">Line_Size</A></FONT>   : Natural;
+      <FONT COLOR=red><A NAME="ref_505_7" HREF="terminal_interface-curses__ads.htm#ref_740_7">Line_Symbol</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A> := <A HREF="terminal_interface-curses__ads.htm#ref_371_4">Default_Character</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_507_16">Wvline</A></FONT> (<FONT COLOR=red><A NAME="ref_507_24" HREF="terminal_interface-curses__adb.htm#ref_507_16">W</A></FONT>   : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
                        <FONT COLOR=red><A NAME="ref_508_24" HREF="terminal_interface-curses__adb.htm#ref_507_16">Ch</A></FONT>  : <A HREF="terminal_interface-curses-aux__ads.htm#ref_63_12">C_Chtype</A>;
@@ -537,7 +537,7 @@
       <b>end</b> <b>if</b>;
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_751_13">Get_Keystroke</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_535_14" HREF="terminal_interface-curses__ads.htm#ref_762_14">Undo_Keystroke</A></FONT> (<FONT COLOR=red><A NAME="ref_535_30" HREF="terminal_interface-curses__ads.htm#ref_762_30">Key</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_73_12">Real_Key_Code</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_535_14" HREF="terminal_interface-curses__ads.htm#ref_762_14">Undo_Keystroke</A></FONT> (<FONT COLOR=red><A NAME="ref_535_30" HREF="terminal_interface-curses__ads.htm#ref_762_30">Key</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_73_12">Real_Key_Code</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_537_16">Ungetch</A></FONT> (<FONT COLOR=red><A NAME="ref_537_25" HREF="terminal_interface-curses__adb.htm#ref_537_16">Ch</A></FONT> : <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
       <b>pragma</b> Import (C, Ungetch, "ungetch");
@@ -609,9 +609,9 @@
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_800_14">Standout</A>;
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_606_14" HREF="terminal_interface-curses__ads.htm#ref_806_14">Switch_Character_Attribute</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_607_7" HREF="terminal_interface-curses__ads.htm#ref_807_7">Win</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-      <FONT COLOR=red><A NAME="ref_608_7" HREF="terminal_interface-curses__ads.htm#ref_808_7">Attr</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_307_9">Character_Attribute_Set</A> := <A HREF="terminal_interface-curses__ads.htm#ref_350_4">Normal_Video</A>;
-      <FONT COLOR=red><A NAME="ref_609_7" HREF="terminal_interface-curses__ads.htm#ref_809_7">On</A></FONT>   : <b>in</b> Boolean := True)
+     (<FONT COLOR=red><A NAME="ref_607_7" HREF="terminal_interface-curses__ads.htm#ref_807_7">Win</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+      <FONT COLOR=red><A NAME="ref_608_7" HREF="terminal_interface-curses__ads.htm#ref_808_7">Attr</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_307_9">Character_Attribute_Set</A> := <A HREF="terminal_interface-curses__ads.htm#ref_350_4">Normal_Video</A>;
+      <FONT COLOR=red><A NAME="ref_609_7" HREF="terminal_interface-curses__ads.htm#ref_809_7">On</A></FONT>   : Boolean := True)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_611_16">Wattron</A></FONT> (<FONT COLOR=red><A NAME="ref_611_25" HREF="terminal_interface-curses__adb.htm#ref_611_16">Win</A></FONT>    : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
                         <FONT COLOR=red><A NAME="ref_612_25" HREF="terminal_interface-curses__adb.htm#ref_611_16">C_Attr</A></FONT> : <A HREF="terminal_interface-curses-aux__ads.htm#ref_64_12">C_AttrType</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
@@ -637,9 +637,9 @@
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_806_14">Switch_Character_Attribute</A>;
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_634_14" HREF="terminal_interface-curses__ads.htm#ref_817_14">Set_Character_Attributes</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_635_7" HREF="terminal_interface-curses__ads.htm#ref_818_7">Win</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-      <FONT COLOR=red><A NAME="ref_636_7" HREF="terminal_interface-curses__ads.htm#ref_819_7">Attr</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_307_9">Character_Attribute_Set</A> := <A HREF="terminal_interface-curses__ads.htm#ref_350_4">Normal_Video</A>;
-      <FONT COLOR=red><A NAME="ref_637_7" HREF="terminal_interface-curses__ads.htm#ref_820_7">Color</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A> := <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A>'First)
+     (<FONT COLOR=red><A NAME="ref_635_7" HREF="terminal_interface-curses__ads.htm#ref_818_7">Win</A></FONT>   : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+      <FONT COLOR=red><A NAME="ref_636_7" HREF="terminal_interface-curses__ads.htm#ref_819_7">Attr</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_307_9">Character_Attribute_Set</A> := <A HREF="terminal_interface-curses__ads.htm#ref_350_4">Normal_Video</A>;
+      <FONT COLOR=red><A NAME="ref_637_7" HREF="terminal_interface-curses__ads.htm#ref_820_7">Color</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A> := <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A>'First)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_639_16">Wattrset</A></FONT> (<FONT COLOR=red><A NAME="ref_639_26" HREF="terminal_interface-curses__adb.htm#ref_639_16">Win</A></FONT>    : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
                          <FONT COLOR=red><A NAME="ref_640_26" HREF="terminal_interface-curses__adb.htm#ref_639_16">C_Attr</A></FONT> : <A HREF="terminal_interface-curses-aux__ads.htm#ref_64_12">C_AttrType</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
@@ -700,8 +700,8 @@
       <b>end</b> <b>if</b>;
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_832_13">Get_Character_Attribute</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_698_14" HREF="terminal_interface-curses__ads.htm#ref_838_14">Set_Color</A></FONT> (<FONT COLOR=red><A NAME="ref_698_25" HREF="terminal_interface-curses__ads.htm#ref_838_25">Win</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-                        <FONT COLOR=red><A NAME="ref_699_25" HREF="terminal_interface-curses__ads.htm#ref_839_25">Pair</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_698_14" HREF="terminal_interface-curses__ads.htm#ref_838_14">Set_Color</A></FONT> (<FONT COLOR=red><A NAME="ref_698_25" HREF="terminal_interface-curses__ads.htm#ref_838_25">Win</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+                        <FONT COLOR=red><A NAME="ref_699_25" HREF="terminal_interface-curses__ads.htm#ref_839_25">Pair</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_701_16">Wset_Color</A></FONT> (<FONT COLOR=red><A NAME="ref_701_28" HREF="terminal_interface-curses__adb.htm#ref_701_16">Win</A></FONT>   : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
                            <FONT COLOR=red><A NAME="ref_702_28" HREF="terminal_interface-curses__adb.htm#ref_701_16">Color</A></FONT> : <A HREF="terminal_interface-curses-aux__ads.htm#ref_56_12">C_Short</A>;
@@ -716,10 +716,10 @@
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_838_14">Set_Color</A>;
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_713_14" HREF="terminal_interface-curses__ads.htm#ref_845_14">Change_Attributes</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_714_7" HREF="terminal_interface-curses__ads.htm#ref_846_7">Win</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-      <FONT COLOR=red><A NAME="ref_715_7" HREF="terminal_interface-curses__ads.htm#ref_847_7">Count</A></FONT> : <b>in</b> Integer := -1;
-      <FONT COLOR=red><A NAME="ref_716_7" HREF="terminal_interface-curses__ads.htm#ref_848_7">Attr</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_307_9">Character_Attribute_Set</A> := <A HREF="terminal_interface-curses__ads.htm#ref_350_4">Normal_Video</A>;
-      <FONT COLOR=red><A NAME="ref_717_7" HREF="terminal_interface-curses__ads.htm#ref_849_7">Color</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A> := <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A>'First)
+     (<FONT COLOR=red><A NAME="ref_714_7" HREF="terminal_interface-curses__ads.htm#ref_846_7">Win</A></FONT>   : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+      <FONT COLOR=red><A NAME="ref_715_7" HREF="terminal_interface-curses__ads.htm#ref_847_7">Count</A></FONT> : Integer := -1;
+      <FONT COLOR=red><A NAME="ref_716_7" HREF="terminal_interface-curses__ads.htm#ref_848_7">Attr</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_307_9">Character_Attribute_Set</A> := <A HREF="terminal_interface-curses__ads.htm#ref_350_4">Normal_Video</A>;
+      <FONT COLOR=red><A NAME="ref_717_7" HREF="terminal_interface-curses__ads.htm#ref_849_7">Color</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A> := <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A>'First)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_719_16">Wchgat</A></FONT> (<FONT COLOR=red><A NAME="ref_719_24" HREF="terminal_interface-curses__adb.htm#ref_719_16">Win</A></FONT>   : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
                        <FONT COLOR=red><A NAME="ref_720_24" HREF="terminal_interface-curses__adb.htm#ref_719_16">Cnt</A></FONT>   : <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
@@ -739,12 +739,12 @@
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_845_14">Change_Attributes</A>;
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_736_14" HREF="terminal_interface-curses__ads.htm#ref_854_14">Change_Attributes</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_737_7" HREF="terminal_interface-curses__ads.htm#ref_855_7">Win</A></FONT>    : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-      <FONT COLOR=red><A NAME="ref_738_7" HREF="terminal_interface-curses__ads.htm#ref_856_7">Line</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A> := <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>'First;
-      <FONT COLOR=red><A NAME="ref_739_7" HREF="terminal_interface-curses__ads.htm#ref_857_7">Column</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A> := <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>'First;
-      <FONT COLOR=red><A NAME="ref_740_7" HREF="terminal_interface-curses__ads.htm#ref_858_7">Count</A></FONT>  : <b>in</b> Integer := -1;
-      <FONT COLOR=red><A NAME="ref_741_7" HREF="terminal_interface-curses__ads.htm#ref_859_7">Attr</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_307_9">Character_Attribute_Set</A> := <A HREF="terminal_interface-curses__ads.htm#ref_350_4">Normal_Video</A>;
-      <FONT COLOR=red><A NAME="ref_742_7" HREF="terminal_interface-curses__ads.htm#ref_860_7">Color</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A> := <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A>'First)
+     (<FONT COLOR=red><A NAME="ref_737_7" HREF="terminal_interface-curses__ads.htm#ref_855_7">Win</A></FONT>    : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+      <FONT COLOR=red><A NAME="ref_738_7" HREF="terminal_interface-curses__ads.htm#ref_856_7">Line</A></FONT>   : <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A> := <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>'First;
+      <FONT COLOR=red><A NAME="ref_739_7" HREF="terminal_interface-curses__ads.htm#ref_857_7">Column</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A> := <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>'First;
+      <FONT COLOR=red><A NAME="ref_740_7" HREF="terminal_interface-curses__ads.htm#ref_858_7">Count</A></FONT>  : Integer := -1;
+      <FONT COLOR=red><A NAME="ref_741_7" HREF="terminal_interface-curses__ads.htm#ref_859_7">Attr</A></FONT>   : <A HREF="terminal_interface-curses__ads.htm#ref_307_9">Character_Attribute_Set</A> := <A HREF="terminal_interface-curses__ads.htm#ref_350_4">Normal_Video</A>;
+      <FONT COLOR=red><A NAME="ref_742_7" HREF="terminal_interface-curses__ads.htm#ref_860_7">Color</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A> := <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A>'First)
    <b>is</b>
    <b>begin</b>
       <A HREF="terminal_interface-curses__ads.htm#ref_511_14">Move_Cursor</A> (<A HREF="terminal_interface-curses__ads.htm#ref_855_7">Win</A>, <A HREF="terminal_interface-curses__ads.htm#ref_856_7">Line</A>, <A HREF="terminal_interface-curses__ads.htm#ref_857_7">Column</A>);
@@ -771,7 +771,7 @@
       <b>end</b> <b>if</b>;
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_875_14">Flash_Screen</A>;
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_769_14" HREF="terminal_interface-curses__ads.htm#ref_886_14">Set_Cbreak_Mode</A></FONT> (<FONT COLOR=red><A NAME="ref_769_31" HREF="terminal_interface-curses__ads.htm#ref_886_31">SwitchOn</A></FONT> : <b>in</b> Boolean := True)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_769_14" HREF="terminal_interface-curses__ads.htm#ref_886_14">Set_Cbreak_Mode</A></FONT> (<FONT COLOR=red><A NAME="ref_769_31" HREF="terminal_interface-curses__ads.htm#ref_886_31">SwitchOn</A></FONT> : Boolean := True)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_771_16">Cbreak</A></FONT> <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
       <b>pragma</b> Import (C, Cbreak, "cbreak");
@@ -790,7 +790,7 @@
       <b>end</b> <b>if</b>;
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_886_14">Set_Cbreak_Mode</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_788_14" HREF="terminal_interface-curses__ads.htm#ref_892_14">Set_Raw_Mode</A></FONT> (<FONT COLOR=red><A NAME="ref_788_28" HREF="terminal_interface-curses__ads.htm#ref_892_28">SwitchOn</A></FONT> : <b>in</b> Boolean := True)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_788_14" HREF="terminal_interface-curses__ads.htm#ref_892_14">Set_Raw_Mode</A></FONT> (<FONT COLOR=red><A NAME="ref_788_28" HREF="terminal_interface-curses__ads.htm#ref_892_28">SwitchOn</A></FONT> : Boolean := True)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_790_16">Raw</A></FONT> <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
       <b>pragma</b> Import (C, Raw, "raw");
@@ -809,7 +809,7 @@
       <b>end</b> <b>if</b>;
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_892_14">Set_Raw_Mode</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_807_14" HREF="terminal_interface-curses__ads.htm#ref_898_14">Set_Echo_Mode</A></FONT> (<FONT COLOR=red><A NAME="ref_807_29" HREF="terminal_interface-curses__ads.htm#ref_898_29">SwitchOn</A></FONT> : <b>in</b> Boolean := True)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_807_14" HREF="terminal_interface-curses__ads.htm#ref_898_14">Set_Echo_Mode</A></FONT> (<FONT COLOR=red><A NAME="ref_807_29" HREF="terminal_interface-curses__ads.htm#ref_898_29">SwitchOn</A></FONT> : Boolean := True)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_809_16">Echo</A></FONT> <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
       <b>pragma</b> Import (C, Echo, "echo");
@@ -828,8 +828,8 @@
       <b>end</b> <b>if</b>;
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_898_14">Set_Echo_Mode</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_826_14" HREF="terminal_interface-curses__ads.htm#ref_904_14">Set_Meta_Mode</A></FONT> (<FONT COLOR=red><A NAME="ref_826_29" HREF="terminal_interface-curses__ads.htm#ref_904_29">Win</A></FONT>      : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-                            <FONT COLOR=red><A NAME="ref_827_29" HREF="terminal_interface-curses__ads.htm#ref_905_29">SwitchOn</A></FONT> : <b>in</b> Boolean := True)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_826_14" HREF="terminal_interface-curses__ads.htm#ref_904_14">Set_Meta_Mode</A></FONT> (<FONT COLOR=red><A NAME="ref_826_29" HREF="terminal_interface-curses__ads.htm#ref_904_29">Win</A></FONT>      : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+                            <FONT COLOR=red><A NAME="ref_827_29" HREF="terminal_interface-curses__ads.htm#ref_905_29">SwitchOn</A></FONT> : Boolean := True)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_829_16">Meta</A></FONT> (<FONT COLOR=red><A NAME="ref_829_22" HREF="terminal_interface-curses__adb.htm#ref_829_16">W</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>; <FONT COLOR=red><A NAME="ref_829_34" HREF="terminal_interface-curses__adb.htm#ref_829_16">Mode</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_1926_9">Curses_Bool</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
       <b>pragma</b> Import (C, Meta, "meta");
@@ -839,8 +839,8 @@
       <b>end</b> <b>if</b>;
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_904_14">Set_Meta_Mode</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_837_14" HREF="terminal_interface-curses__ads.htm#ref_910_14">Set_KeyPad_Mode</A></FONT> (<FONT COLOR=red><A NAME="ref_837_31" HREF="terminal_interface-curses__ads.htm#ref_910_31">Win</A></FONT>      : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-                              <FONT COLOR=red><A NAME="ref_838_31" HREF="terminal_interface-curses__ads.htm#ref_911_31">SwitchOn</A></FONT> : <b>in</b> Boolean := True)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_837_14" HREF="terminal_interface-curses__ads.htm#ref_910_14">Set_KeyPad_Mode</A></FONT> (<FONT COLOR=red><A NAME="ref_837_31" HREF="terminal_interface-curses__ads.htm#ref_910_31">Win</A></FONT>      : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+                              <FONT COLOR=red><A NAME="ref_838_31" HREF="terminal_interface-curses__ads.htm#ref_911_31">SwitchOn</A></FONT> : Boolean := True)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_840_16">Keypad</A></FONT> (<FONT COLOR=red><A NAME="ref_840_24" HREF="terminal_interface-curses__adb.htm#ref_840_16">W</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>; <FONT COLOR=red><A NAME="ref_840_36" HREF="terminal_interface-curses__adb.htm#ref_840_16">Mode</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_1926_9">Curses_Bool</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
       <b>pragma</b> Import (C, Keypad, "keypad");
@@ -850,7 +850,7 @@
       <b>end</b> <b>if</b>;
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_910_14">Set_KeyPad_Mode</A>;
 
-   <b>function</b> <FONT COLOR=red><A NAME="ref_848_13" HREF="terminal_interface-curses__ads.htm#ref_915_13">Get_KeyPad_Mode</A></FONT> (<FONT COLOR=red><A NAME="ref_848_30" HREF="terminal_interface-curses__ads.htm#ref_915_30">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>)
+   <b>function</b> <FONT COLOR=red><A NAME="ref_848_13" HREF="terminal_interface-curses__ads.htm#ref_915_13">Get_KeyPad_Mode</A></FONT> (<FONT COLOR=red><A NAME="ref_848_30" HREF="terminal_interface-curses__ads.htm#ref_915_30">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>)
                              <b>return</b> Boolean
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_851_16">Is_Keypad</A></FONT> (<FONT COLOR=red><A NAME="ref_851_27" HREF="terminal_interface-curses__adb.htm#ref_851_16">W</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>) <b>return</b> <A HREF="terminal_interface-curses__ads.htm#ref_1926_9">Curses_Bool</A>;
@@ -859,7 +859,7 @@
       <b>return</b> (<A HREF="terminal_interface-curses__adb.htm#ref_851_16">Is_Keypad</A> (<A HREF="terminal_interface-curses__ads.htm#ref_915_30">Win</A>) /= <A HREF="terminal_interface-curses__ads.htm#ref_1927_4">Curses_Bool_False</A>);
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_915_13">Get_KeyPad_Mode</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_857_14" HREF="terminal_interface-curses__ads.htm#ref_923_14">Half_Delay</A></FONT> (<FONT COLOR=red><A NAME="ref_857_26" HREF="terminal_interface-curses__ads.htm#ref_923_26">Amount</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_920_9">Half_Delay_Amount</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_857_14" HREF="terminal_interface-curses__ads.htm#ref_923_14">Half_Delay</A></FONT> (<FONT COLOR=red><A NAME="ref_857_26" HREF="terminal_interface-curses__ads.htm#ref_923_26">Amount</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_920_9">Half_Delay_Amount</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_859_16">Halfdelay</A></FONT> (<FONT COLOR=red><A NAME="ref_859_27" HREF="terminal_interface-curses__adb.htm#ref_859_16">Amount</A></FONT> : <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
       <b>pragma</b> Import (C, Halfdelay, "halfdelay");
@@ -870,8 +870,8 @@
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_923_14">Half_Delay</A>;
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_867_14" HREF="terminal_interface-curses__ads.htm#ref_928_14">Set_Flush_On_Interrupt_Mode</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_868_7" HREF="terminal_interface-curses__ads.htm#ref_929_7">Win</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-      <FONT COLOR=red><A NAME="ref_869_7" HREF="terminal_interface-curses__ads.htm#ref_930_7">Mode</A></FONT> : <b>in</b> Boolean := True)
+     (<FONT COLOR=red><A NAME="ref_868_7" HREF="terminal_interface-curses__ads.htm#ref_929_7">Win</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+      <FONT COLOR=red><A NAME="ref_869_7" HREF="terminal_interface-curses__ads.htm#ref_930_7">Mode</A></FONT> : Boolean := True)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_871_16">Intrflush</A></FONT> (<FONT COLOR=red><A NAME="ref_871_27" HREF="terminal_interface-curses__adb.htm#ref_871_16">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>; <FONT COLOR=red><A NAME="ref_871_41" HREF="terminal_interface-curses__adb.htm#ref_871_16">Mode</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_1926_9">Curses_Bool</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
       <b>pragma</b> Import (C, Intrflush, "intrflush");
@@ -882,8 +882,8 @@
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_928_14">Set_Flush_On_Interrupt_Mode</A>;
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_879_14" HREF="terminal_interface-curses__ads.htm#ref_935_14">Set_Queue_Interrupt_Mode</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_880_7" HREF="terminal_interface-curses__ads.htm#ref_936_7">Win</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-      <FONT COLOR=red><A NAME="ref_881_7" HREF="terminal_interface-curses__ads.htm#ref_937_7">Flush</A></FONT> : <b>in</b> Boolean := True)
+     (<FONT COLOR=red><A NAME="ref_880_7" HREF="terminal_interface-curses__ads.htm#ref_936_7">Win</A></FONT>   : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+      <FONT COLOR=red><A NAME="ref_881_7" HREF="terminal_interface-curses__ads.htm#ref_937_7">Flush</A></FONT> : Boolean := True)
    <b>is</b>
       <b>procedure</b> <FONT COLOR=red><A NAME="ref_883_17">Qiflush</A></FONT>;
       <b>pragma</b> Import (C, Qiflush, "qiflush");
@@ -901,8 +901,8 @@
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_935_14">Set_Queue_Interrupt_Mode</A>;
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_898_14" HREF="terminal_interface-curses__ads.htm#ref_943_14">Set_NoDelay_Mode</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_899_7" HREF="terminal_interface-curses__ads.htm#ref_944_7">Win</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-      <FONT COLOR=red><A NAME="ref_900_7" HREF="terminal_interface-curses__ads.htm#ref_945_7">Mode</A></FONT> : <b>in</b> Boolean := False)
+     (<FONT COLOR=red><A NAME="ref_899_7" HREF="terminal_interface-curses__ads.htm#ref_944_7">Win</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+      <FONT COLOR=red><A NAME="ref_900_7" HREF="terminal_interface-curses__ads.htm#ref_945_7">Mode</A></FONT> : Boolean := False)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_902_16">Nodelay</A></FONT> (<FONT COLOR=red><A NAME="ref_902_25" HREF="terminal_interface-curses__adb.htm#ref_902_16">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>; <FONT COLOR=red><A NAME="ref_902_39" HREF="terminal_interface-curses__adb.htm#ref_902_16">Mode</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_1926_9">Curses_Bool</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
       <b>pragma</b> Import (C, Nodelay, "nodelay");
@@ -912,9 +912,9 @@
       <b>end</b> <b>if</b>;
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_943_14">Set_NoDelay_Mode</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_910_14" HREF="terminal_interface-curses__ads.htm#ref_952_14">Set_Timeout_Mode</A></FONT> (<FONT COLOR=red><A NAME="ref_910_32" HREF="terminal_interface-curses__ads.htm#ref_952_32">Win</A></FONT>    : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-                               <FONT COLOR=red><A NAME="ref_911_32" HREF="terminal_interface-curses__ads.htm#ref_953_32">Mode</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_949_9">Timeout_Mode</A>;
-                               <FONT COLOR=red><A NAME="ref_912_32" HREF="terminal_interface-curses__ads.htm#ref_954_32">Amount</A></FONT> : <b>in</b> Natural)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_910_14" HREF="terminal_interface-curses__ads.htm#ref_952_14">Set_Timeout_Mode</A></FONT> (<FONT COLOR=red><A NAME="ref_910_32" HREF="terminal_interface-curses__ads.htm#ref_952_32">Win</A></FONT>    : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+                               <FONT COLOR=red><A NAME="ref_911_32" HREF="terminal_interface-curses__ads.htm#ref_953_32">Mode</A></FONT>   : <A HREF="terminal_interface-curses__ads.htm#ref_949_9">Timeout_Mode</A>;
+                               <FONT COLOR=red><A NAME="ref_912_32" HREF="terminal_interface-curses__ads.htm#ref_954_32">Amount</A></FONT> : Natural)
    <b>is</b>
       <b>procedure</b> <FONT COLOR=red><A NAME="ref_914_17">Wtimeout</A></FONT> (<FONT COLOR=red><A NAME="ref_914_27" HREF="terminal_interface-curses__adb.htm#ref_914_17">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>; <FONT COLOR=red><A NAME="ref_914_41" HREF="terminal_interface-curses__adb.htm#ref_914_17">Amount</A></FONT> : <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>);
       <b>pragma</b> Import (C, Wtimeout, "wtimeout");
@@ -934,8 +934,8 @@
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_952_14">Set_Timeout_Mode</A>;
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_931_14" HREF="terminal_interface-curses__ads.htm#ref_964_14">Set_Escape_Timer_Mode</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_932_7" HREF="terminal_interface-curses__ads.htm#ref_965_7">Win</A></FONT>       : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-      <FONT COLOR=red><A NAME="ref_933_7" HREF="terminal_interface-curses__ads.htm#ref_966_7">Timer_Off</A></FONT> : <b>in</b> Boolean := False)
+     (<FONT COLOR=red><A NAME="ref_932_7" HREF="terminal_interface-curses__ads.htm#ref_965_7">Win</A></FONT>       : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+      <FONT COLOR=red><A NAME="ref_933_7" HREF="terminal_interface-curses__ads.htm#ref_966_7">Timer_Off</A></FONT> : Boolean := False)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_935_16">Notimeout</A></FONT> (<FONT COLOR=red><A NAME="ref_935_27" HREF="terminal_interface-curses__adb.htm#ref_935_16">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>; <FONT COLOR=red><A NAME="ref_935_41" HREF="terminal_interface-curses__adb.htm#ref_935_16">Mode</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_1926_9">Curses_Bool</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
       <b>pragma</b> Import (C, Notimeout, "notimeout");
@@ -947,7 +947,7 @@
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_964_14">Set_Escape_Timer_Mode</A>;
 
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_945_14" HREF="terminal_interface-curses__ads.htm#ref_975_14">Set_NL_Mode</A></FONT> (<FONT COLOR=red><A NAME="ref_945_27" HREF="terminal_interface-curses__ads.htm#ref_975_27">SwitchOn</A></FONT> : <b>in</b> Boolean := True)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_945_14" HREF="terminal_interface-curses__ads.htm#ref_975_14">Set_NL_Mode</A></FONT> (<FONT COLOR=red><A NAME="ref_945_27" HREF="terminal_interface-curses__ads.htm#ref_975_27">SwitchOn</A></FONT> : Boolean := True)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_947_16">NL</A></FONT> <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
       <b>pragma</b> Import (C, NL, "nl");
@@ -967,8 +967,8 @@
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_975_14">Set_NL_Mode</A>;
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_964_14" HREF="terminal_interface-curses__ads.htm#ref_981_14">Clear_On_Next_Update</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_965_7" HREF="terminal_interface-curses__ads.htm#ref_982_7">Win</A></FONT>      : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-      <FONT COLOR=red><A NAME="ref_966_7" HREF="terminal_interface-curses__ads.htm#ref_983_7">Do_Clear</A></FONT> : <b>in</b> Boolean := True)
+     (<FONT COLOR=red><A NAME="ref_965_7" HREF="terminal_interface-curses__ads.htm#ref_982_7">Win</A></FONT>      : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+      <FONT COLOR=red><A NAME="ref_966_7" HREF="terminal_interface-curses__ads.htm#ref_983_7">Do_Clear</A></FONT> : Boolean := True)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_968_16">Clear_Ok</A></FONT> (<FONT COLOR=red><A NAME="ref_968_26" HREF="terminal_interface-curses__adb.htm#ref_968_16">W</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>; <FONT COLOR=red><A NAME="ref_968_38" HREF="terminal_interface-curses__adb.htm#ref_968_16">Flag</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_1926_9">Curses_Bool</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
       <b>pragma</b> Import (C, Clear_Ok, "clearok");
@@ -979,8 +979,8 @@
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_981_14">Clear_On_Next_Update</A>;
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_976_14" HREF="terminal_interface-curses__ads.htm#ref_988_14">Use_Insert_Delete_Line</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_977_7" HREF="terminal_interface-curses__ads.htm#ref_989_7">Win</A></FONT>    : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-      <FONT COLOR=red><A NAME="ref_978_7" HREF="terminal_interface-curses__ads.htm#ref_990_7">Do_Idl</A></FONT> : <b>in</b> Boolean := True)
+     (<FONT COLOR=red><A NAME="ref_977_7" HREF="terminal_interface-curses__ads.htm#ref_989_7">Win</A></FONT>    : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+      <FONT COLOR=red><A NAME="ref_978_7" HREF="terminal_interface-curses__ads.htm#ref_990_7">Do_Idl</A></FONT> : Boolean := True)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_980_16">IDL_Ok</A></FONT> (<FONT COLOR=red><A NAME="ref_980_24" HREF="terminal_interface-curses__adb.htm#ref_980_16">W</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>; <FONT COLOR=red><A NAME="ref_980_36" HREF="terminal_interface-curses__adb.htm#ref_980_16">Flag</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_1926_9">Curses_Bool</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
       <b>pragma</b> Import (C, IDL_Ok, "idlok");
@@ -991,8 +991,8 @@
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_988_14">Use_Insert_Delete_Line</A>;
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_988_14" HREF="terminal_interface-curses__ads.htm#ref_995_14">Use_Insert_Delete_Character</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_989_7" HREF="terminal_interface-curses__ads.htm#ref_996_7">Win</A></FONT>    : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-      <FONT COLOR=red><A NAME="ref_990_7" HREF="terminal_interface-curses__ads.htm#ref_997_7">Do_Idc</A></FONT> : <b>in</b> Boolean := True)
+     (<FONT COLOR=red><A NAME="ref_989_7" HREF="terminal_interface-curses__ads.htm#ref_996_7">Win</A></FONT>    : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+      <FONT COLOR=red><A NAME="ref_990_7" HREF="terminal_interface-curses__ads.htm#ref_997_7">Do_Idc</A></FONT> : Boolean := True)
    <b>is</b>
       <b>procedure</b> <FONT COLOR=red><A NAME="ref_992_17">IDC_Ok</A></FONT> (<FONT COLOR=red><A NAME="ref_992_25" HREF="terminal_interface-curses__adb.htm#ref_992_17">W</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>; <FONT COLOR=red><A NAME="ref_992_37" HREF="terminal_interface-curses__adb.htm#ref_992_17">Flag</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_1926_9">Curses_Bool</A>);
       <b>pragma</b> Import (C, IDC_Ok, "idcok");
@@ -1001,8 +1001,8 @@
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_995_14">Use_Insert_Delete_Character</A>;
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_998_14" HREF="terminal_interface-curses__ads.htm#ref_1002_14">Leave_Cursor_After_Update</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_999_7" HREF="terminal_interface-curses__ads.htm#ref_1003_7">Win</A></FONT>      : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-      <FONT COLOR=red><A NAME="ref_1000_7" HREF="terminal_interface-curses__ads.htm#ref_1004_7">Do_Leave</A></FONT> : <b>in</b> Boolean := True)
+     (<FONT COLOR=red><A NAME="ref_999_7" HREF="terminal_interface-curses__ads.htm#ref_1003_7">Win</A></FONT>      : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+      <FONT COLOR=red><A NAME="ref_1000_7" HREF="terminal_interface-curses__ads.htm#ref_1004_7">Do_Leave</A></FONT> : Boolean := True)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_1002_16">Leave_Ok</A></FONT> (<FONT COLOR=red><A NAME="ref_1002_26" HREF="terminal_interface-curses__adb.htm#ref_1002_16">W</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>; <FONT COLOR=red><A NAME="ref_1002_38" HREF="terminal_interface-curses__adb.htm#ref_1002_16">Flag</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_1926_9">Curses_Bool</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
       <b>pragma</b> Import (C, Leave_Ok, "leaveok");
@@ -1013,8 +1013,8 @@
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_1002_14">Leave_Cursor_After_Update</A>;
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_1010_14" HREF="terminal_interface-curses__ads.htm#ref_1009_14">Immediate_Update_Mode</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_1011_7" HREF="terminal_interface-curses__ads.htm#ref_1010_7">Win</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-      <FONT COLOR=red><A NAME="ref_1012_7" HREF="terminal_interface-curses__ads.htm#ref_1011_7">Mode</A></FONT> : <b>in</b> Boolean := False)
+     (<FONT COLOR=red><A NAME="ref_1011_7" HREF="terminal_interface-curses__ads.htm#ref_1010_7">Win</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+      <FONT COLOR=red><A NAME="ref_1012_7" HREF="terminal_interface-curses__ads.htm#ref_1011_7">Mode</A></FONT> : Boolean := False)
    <b>is</b>
       <b>procedure</b> <FONT COLOR=red><A NAME="ref_1014_17">Immedok</A></FONT> (<FONT COLOR=red><A NAME="ref_1014_26" HREF="terminal_interface-curses__adb.htm#ref_1014_17">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>; <FONT COLOR=red><A NAME="ref_1014_40" HREF="terminal_interface-curses__adb.htm#ref_1014_17">Mode</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_1926_9">Curses_Bool</A>);
       <b>pragma</b> Import (C, Immedok, "immedok");
@@ -1023,8 +1023,8 @@
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_1009_14">Immediate_Update_Mode</A>;
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_1020_14" HREF="terminal_interface-curses__ads.htm#ref_1016_14">Allow_Scrolling</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_1021_7" HREF="terminal_interface-curses__ads.htm#ref_1017_7">Win</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>  := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-      <FONT COLOR=red><A NAME="ref_1022_7" HREF="terminal_interface-curses__ads.htm#ref_1018_7">Mode</A></FONT> : <b>in</b> Boolean := False)
+     (<FONT COLOR=red><A NAME="ref_1021_7" HREF="terminal_interface-curses__ads.htm#ref_1017_7">Win</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>  := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+      <FONT COLOR=red><A NAME="ref_1022_7" HREF="terminal_interface-curses__ads.htm#ref_1018_7">Mode</A></FONT> : Boolean := False)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_1024_16">Scrollok</A></FONT> (<FONT COLOR=red><A NAME="ref_1024_26" HREF="terminal_interface-curses__adb.htm#ref_1024_16">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>; <FONT COLOR=red><A NAME="ref_1024_40" HREF="terminal_interface-curses__adb.htm#ref_1024_16">Mode</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_1926_9">Curses_Bool</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
       <b>pragma</b> Import (C, Scrollok, "scrollok");
@@ -1044,9 +1044,9 @@
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_1022_13">Scrolling_Allowed</A>;
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_1041_14" HREF="terminal_interface-curses__ads.htm#ref_1027_14">Set_Scroll_Region</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_1042_7" HREF="terminal_interface-curses__ads.htm#ref_1028_7">Win</A></FONT>         : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-      <FONT COLOR=red><A NAME="ref_1043_7" HREF="terminal_interface-curses__ads.htm#ref_1029_7">Top_Line</A></FONT>    : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
-      <FONT COLOR=red><A NAME="ref_1044_7" HREF="terminal_interface-curses__ads.htm#ref_1030_7">Bottom_Line</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>)
+     (<FONT COLOR=red><A NAME="ref_1042_7" HREF="terminal_interface-curses__ads.htm#ref_1028_7">Win</A></FONT>         : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+      <FONT COLOR=red><A NAME="ref_1043_7" HREF="terminal_interface-curses__ads.htm#ref_1029_7">Top_Line</A></FONT>    : <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
+      <FONT COLOR=red><A NAME="ref_1044_7" HREF="terminal_interface-curses__ads.htm#ref_1030_7">Bottom_Line</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_1046_16">Wsetscrreg</A></FONT> (<FONT COLOR=red><A NAME="ref_1046_28" HREF="terminal_interface-curses__adb.htm#ref_1046_16">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
                            <FONT COLOR=red><A NAME="ref_1047_28" HREF="terminal_interface-curses__adb.htm#ref_1046_16">Lin</A></FONT> : <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
@@ -1069,7 +1069,7 @@
       <b>end</b> <b>if</b>;
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_1040_14">Update_Screen</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1067_14" HREF="terminal_interface-curses__ads.htm#ref_1045_14">Refresh</A></FONT> (<FONT COLOR=red><A NAME="ref_1067_23" HREF="terminal_interface-curses__ads.htm#ref_1045_23">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1067_14" HREF="terminal_interface-curses__ads.htm#ref_1045_14">Refresh</A></FONT> (<FONT COLOR=red><A NAME="ref_1067_23" HREF="terminal_interface-curses__ads.htm#ref_1045_23">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_1069_16">Wrefresh</A></FONT> (<FONT COLOR=red><A NAME="ref_1069_26" HREF="terminal_interface-curses__adb.htm#ref_1069_16">W</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
       <b>pragma</b> Import (C, Wrefresh, "wrefresh");
@@ -1080,7 +1080,7 @@
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_1045_14">Refresh</A>;
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_1077_14" HREF="terminal_interface-curses__ads.htm#ref_1052_14">Refresh_Without_Update</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_1078_7" HREF="terminal_interface-curses__ads.htm#ref_1053_7">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>)
+     (<FONT COLOR=red><A NAME="ref_1078_7" HREF="terminal_interface-curses__ads.htm#ref_1053_7">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_1080_16">Wnoutrefresh</A></FONT> (<FONT COLOR=red><A NAME="ref_1080_30" HREF="terminal_interface-curses__adb.htm#ref_1080_16">W</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
       <b>pragma</b> Import (C, Wnoutrefresh, "wnoutrefresh");
@@ -1090,7 +1090,7 @@
       <b>end</b> <b>if</b>;
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_1052_14">Refresh_Without_Update</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1088_14" HREF="terminal_interface-curses__ads.htm#ref_1059_14">Redraw</A></FONT> (<FONT COLOR=red><A NAME="ref_1088_22" HREF="terminal_interface-curses__ads.htm#ref_1059_22">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1088_14" HREF="terminal_interface-curses__ads.htm#ref_1059_14">Redraw</A></FONT> (<FONT COLOR=red><A NAME="ref_1088_22" HREF="terminal_interface-curses__ads.htm#ref_1059_22">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_1090_16">Redrawwin</A></FONT> (<FONT COLOR=red><A NAME="ref_1090_27" HREF="terminal_interface-curses__adb.htm#ref_1090_16">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
       <b>pragma</b> Import (C, Redrawwin, "redrawwin");
@@ -1101,9 +1101,9 @@
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_1059_14">Redraw</A>;
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_1098_14" HREF="terminal_interface-curses__ads.htm#ref_1063_14">Redraw</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_1099_7" HREF="terminal_interface-curses__ads.htm#ref_1063_22">Win</A></FONT>        : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-      <FONT COLOR=red><A NAME="ref_1100_7" HREF="terminal_interface-curses__ads.htm#ref_1064_22">Begin_Line</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
-      <FONT COLOR=red><A NAME="ref_1101_7" HREF="terminal_interface-curses__ads.htm#ref_1065_22">Line_Count</A></FONT> : <b>in</b> Positive)
+     (<FONT COLOR=red><A NAME="ref_1099_7" HREF="terminal_interface-curses__ads.htm#ref_1063_22">Win</A></FONT>        : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+      <FONT COLOR=red><A NAME="ref_1100_7" HREF="terminal_interface-curses__ads.htm#ref_1064_22">Begin_Line</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
+      <FONT COLOR=red><A NAME="ref_1101_7" HREF="terminal_interface-curses__ads.htm#ref_1065_22">Line_Count</A></FONT> : Positive)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_1103_16">Wredrawln</A></FONT> (<FONT COLOR=red><A NAME="ref_1103_27" HREF="terminal_interface-curses__adb.htm#ref_1103_16">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>; <FONT COLOR=red><A NAME="ref_1103_41" HREF="terminal_interface-curses__adb.htm#ref_1103_16">First</A></FONT> : <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>; <FONT COLOR=red><A NAME="ref_1103_56" HREF="terminal_interface-curses__adb.htm#ref_1103_16">Cnt</A></FONT> : <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>)
                           <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
@@ -1117,7 +1117,7 @@
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_1063_14">Redraw</A>;
 
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1115_14" HREF="terminal_interface-curses__ads.htm#ref_1074_14">Erase</A></FONT> (<FONT COLOR=red><A NAME="ref_1115_21" HREF="terminal_interface-curses__ads.htm#ref_1074_21">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1115_14" HREF="terminal_interface-curses__ads.htm#ref_1074_14">Erase</A></FONT> (<FONT COLOR=red><A NAME="ref_1115_21" HREF="terminal_interface-curses__ads.htm#ref_1074_21">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_1117_16">Werase</A></FONT> (<FONT COLOR=red><A NAME="ref_1117_24" HREF="terminal_interface-curses__adb.htm#ref_1117_16">W</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
       <b>pragma</b> Import (C, Werase, "werase");
@@ -1127,7 +1127,7 @@
       <b>end</b> <b>if</b>;
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_1074_14">Erase</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1125_14" HREF="terminal_interface-curses__ads.htm#ref_1080_14">Clear</A></FONT> (<FONT COLOR=red><A NAME="ref_1125_21" HREF="terminal_interface-curses__ads.htm#ref_1081_7">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1125_14" HREF="terminal_interface-curses__ads.htm#ref_1080_14">Clear</A></FONT> (<FONT COLOR=red><A NAME="ref_1125_21" HREF="terminal_interface-curses__ads.htm#ref_1081_7">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_1127_16">Wclear</A></FONT> (<FONT COLOR=red><A NAME="ref_1127_24" HREF="terminal_interface-curses__adb.htm#ref_1127_16">W</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
       <b>pragma</b> Import (C, Wclear, "wclear");
@@ -1137,7 +1137,7 @@
       <b>end</b> <b>if</b>;
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_1080_14">Clear</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1135_14" HREF="terminal_interface-curses__ads.htm#ref_1087_14">Clear_To_End_Of_Screen</A></FONT> (<FONT COLOR=red><A NAME="ref_1135_38" HREF="terminal_interface-curses__ads.htm#ref_1088_7">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1135_14" HREF="terminal_interface-curses__ads.htm#ref_1087_14">Clear_To_End_Of_Screen</A></FONT> (<FONT COLOR=red><A NAME="ref_1135_38" HREF="terminal_interface-curses__ads.htm#ref_1088_7">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_1137_16">Wclearbot</A></FONT> (<FONT COLOR=red><A NAME="ref_1137_27" HREF="terminal_interface-curses__adb.htm#ref_1137_16">W</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
       <b>pragma</b> Import (C, Wclearbot, "wclrtobot");
@@ -1147,7 +1147,7 @@
       <b>end</b> <b>if</b>;
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_1087_14">Clear_To_End_Of_Screen</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1145_14" HREF="terminal_interface-curses__ads.htm#ref_1094_14">Clear_To_End_Of_Line</A></FONT> (<FONT COLOR=red><A NAME="ref_1145_36" HREF="terminal_interface-curses__ads.htm#ref_1095_7">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1145_14" HREF="terminal_interface-curses__ads.htm#ref_1094_14">Clear_To_End_Of_Line</A></FONT> (<FONT COLOR=red><A NAME="ref_1145_36" HREF="terminal_interface-curses__ads.htm#ref_1095_7">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_1147_16">Wcleareol</A></FONT> (<FONT COLOR=red><A NAME="ref_1147_27" HREF="terminal_interface-curses__adb.htm#ref_1147_16">W</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
       <b>pragma</b> Import (C, Wcleareol, "wclrtoeol");
@@ -1158,18 +1158,18 @@
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_1094_14">Clear_To_End_Of_Line</A>;
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_1155_14" HREF="terminal_interface-curses__ads.htm#ref_1108_14">Set_Background</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_1156_7" HREF="terminal_interface-curses__ads.htm#ref_1109_7">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-      <FONT COLOR=red><A NAME="ref_1157_7" HREF="terminal_interface-curses__ads.htm#ref_1110_7">Ch</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A>)
+     (<FONT COLOR=red><A NAME="ref_1156_7" HREF="terminal_interface-curses__ads.htm#ref_1109_7">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+      <FONT COLOR=red><A NAME="ref_1157_7" HREF="terminal_interface-curses__ads.htm#ref_1110_7">Ch</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A>)
    <b>is</b>
-      <b>procedure</b> <FONT COLOR=red><A NAME="ref_1159_17">WBackground</A></FONT> (<FONT COLOR=red><A NAME="ref_1159_30" HREF="terminal_interface-curses__adb.htm#ref_1159_17">W</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>; <FONT COLOR=red><A NAME="ref_1159_45" HREF="terminal_interface-curses__adb.htm#ref_1159_17">Ch</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_63_12">C_Chtype</A>);
+      <b>procedure</b> <FONT COLOR=red><A NAME="ref_1159_17">WBackground</A></FONT> (<FONT COLOR=red><A NAME="ref_1159_30" HREF="terminal_interface-curses__adb.htm#ref_1159_17">W</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>; <FONT COLOR=red><A NAME="ref_1159_42" HREF="terminal_interface-curses__adb.htm#ref_1159_17">Ch</A></FONT> : <A HREF="terminal_interface-curses-aux__ads.htm#ref_63_12">C_Chtype</A>);
       <b>pragma</b> Import (C, WBackground, "wbkgdset");
    <b>begin</b>
       <A HREF="terminal_interface-curses__adb.htm#ref_1159_17">WBackground</A> (<A HREF="terminal_interface-curses__ads.htm#ref_1109_7">Win</A>, <A HREF="terminal_interface-curses-aux__ads.htm#ref_75_4">AttrChar_To_Chtype</A> (<A HREF="terminal_interface-curses__ads.htm#ref_1110_7">Ch</A>));
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_1108_14">Set_Background</A>;
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_1165_14" HREF="terminal_interface-curses__ads.htm#ref_1116_14">Change_Background</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_1166_7" HREF="terminal_interface-curses__ads.htm#ref_1117_7">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-      <FONT COLOR=red><A NAME="ref_1167_7" HREF="terminal_interface-curses__ads.htm#ref_1118_7">Ch</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A>)
+     (<FONT COLOR=red><A NAME="ref_1166_7" HREF="terminal_interface-curses__ads.htm#ref_1117_7">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+      <FONT COLOR=red><A NAME="ref_1167_7" HREF="terminal_interface-curses__ads.htm#ref_1118_7">Ch</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_1169_16">WChangeBkgd</A></FONT> (<FONT COLOR=red><A NAME="ref_1169_29" HREF="terminal_interface-curses__adb.htm#ref_1169_16">W</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>; <FONT COLOR=red><A NAME="ref_1169_41" HREF="terminal_interface-curses__adb.htm#ref_1169_16">Ch</A></FONT> : <A HREF="terminal_interface-curses-aux__ads.htm#ref_63_12">C_Chtype</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
       <b>pragma</b> Import (C, WChangeBkgd, "wbkgd");
@@ -1188,10 +1188,10 @@
       <b>return</b> Chtype_To_AttrChar (<A HREF="terminal_interface-curses__adb.htm#ref_1180_16">Wgetbkgd</A> (<A HREF="terminal_interface-curses__ads.htm#ref_1125_29">Win</A>));
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_1125_13">Get_Background</A>;
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1186_14" HREF="terminal_interface-curses__ads.htm#ref_1152_14">Change_Lines_Status</A></FONT> (<FONT COLOR=red><A NAME="ref_1186_35" HREF="terminal_interface-curses__ads.htm#ref_1152_35">Win</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-                                  <FONT COLOR=red><A NAME="ref_1187_35" HREF="terminal_interface-curses__ads.htm#ref_1153_35">Start</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
-                                  <FONT COLOR=red><A NAME="ref_1188_35" HREF="terminal_interface-curses__ads.htm#ref_1154_35">Count</A></FONT> : <b>in</b> Positive;
-                                  <FONT COLOR=red><A NAME="ref_1189_35" HREF="terminal_interface-curses__ads.htm#ref_1155_35">State</A></FONT> : <b>in</b> Boolean)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1186_14" HREF="terminal_interface-curses__ads.htm#ref_1152_14">Change_Lines_Status</A></FONT> (<FONT COLOR=red><A NAME="ref_1186_35" HREF="terminal_interface-curses__ads.htm#ref_1152_35">Win</A></FONT>   : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+                                  <FONT COLOR=red><A NAME="ref_1187_35" HREF="terminal_interface-curses__ads.htm#ref_1153_35">Start</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
+                                  <FONT COLOR=red><A NAME="ref_1188_35" HREF="terminal_interface-curses__ads.htm#ref_1154_35">Count</A></FONT> : Positive;
+                                  <FONT COLOR=red><A NAME="ref_1189_35" HREF="terminal_interface-curses__ads.htm#ref_1155_35">State</A></FONT> : Boolean)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_1191_16">Wtouchln</A></FONT> (<FONT COLOR=red><A NAME="ref_1191_26" HREF="terminal_interface-curses__adb.htm#ref_1191_16">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
                          <FONT COLOR=red><A NAME="ref_1192_26" HREF="terminal_interface-curses__adb.htm#ref_1191_16">Sta</A></FONT> : <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
@@ -1205,7 +1205,7 @@
       <b>end</b> <b>if</b>;
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_1152_14">Change_Lines_Status</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1203_14" HREF="terminal_interface-curses__ads.htm#ref_1141_14">Touch</A></FONT> (<FONT COLOR=red><A NAME="ref_1203_21" HREF="terminal_interface-curses__ads.htm#ref_1141_21">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1203_14" HREF="terminal_interface-curses__ads.htm#ref_1141_14">Touch</A></FONT> (<FONT COLOR=red><A NAME="ref_1203_21" HREF="terminal_interface-curses__ads.htm#ref_1141_21">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>)
    <b>is</b>
       <FONT COLOR=red><A NAME="ref_1205_7">Y</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
       <FONT COLOR=red><A NAME="ref_1206_7">X</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
@@ -1214,7 +1214,7 @@
       <A HREF="terminal_interface-curses__ads.htm#ref_1152_14">Change_Lines_Status</A> (<A HREF="terminal_interface-curses__ads.htm#ref_1141_21">Win</A>, 0, Positive (<A HREF="terminal_interface-curses__adb.htm#ref_1205_7">Y</A>), True);
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_1141_14">Touch</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1212_14" HREF="terminal_interface-curses__ads.htm#ref_1136_14">Untouch</A></FONT> (<FONT COLOR=red><A NAME="ref_1212_23" HREF="terminal_interface-curses__ads.htm#ref_1136_23">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1212_14" HREF="terminal_interface-curses__ads.htm#ref_1136_14">Untouch</A></FONT> (<FONT COLOR=red><A NAME="ref_1212_23" HREF="terminal_interface-curses__ads.htm#ref_1136_23">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>)
    <b>is</b>
       <FONT COLOR=red><A NAME="ref_1214_7">Y</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
       <FONT COLOR=red><A NAME="ref_1215_7">X</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
@@ -1223,9 +1223,9 @@
       <A HREF="terminal_interface-curses__ads.htm#ref_1152_14">Change_Lines_Status</A> (<A HREF="terminal_interface-curses__ads.htm#ref_1136_23">Win</A>, 0, Positive (<A HREF="terminal_interface-curses__adb.htm#ref_1214_7">Y</A>), False);
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_1136_14">Untouch</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1221_14" HREF="terminal_interface-curses__ads.htm#ref_1145_14">Touch</A></FONT> (<FONT COLOR=red><A NAME="ref_1221_21" HREF="terminal_interface-curses__ads.htm#ref_1145_21">Win</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-                    <FONT COLOR=red><A NAME="ref_1222_21" HREF="terminal_interface-curses__ads.htm#ref_1146_21">Start</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
-                    <FONT COLOR=red><A NAME="ref_1223_21" HREF="terminal_interface-curses__ads.htm#ref_1147_21">Count</A></FONT> : <b>in</b> Positive)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1221_14" HREF="terminal_interface-curses__ads.htm#ref_1145_14">Touch</A></FONT> (<FONT COLOR=red><A NAME="ref_1221_21" HREF="terminal_interface-curses__ads.htm#ref_1145_21">Win</A></FONT>   : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+                    <FONT COLOR=red><A NAME="ref_1222_21" HREF="terminal_interface-curses__ads.htm#ref_1146_21">Start</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
+                    <FONT COLOR=red><A NAME="ref_1223_21" HREF="terminal_interface-curses__ads.htm#ref_1147_21">Count</A></FONT> : Positive)
    <b>is</b>
    <b>begin</b>
       <A HREF="terminal_interface-curses__ads.htm#ref_1152_14">Change_Lines_Status</A> (<A HREF="terminal_interface-curses__ads.htm#ref_1145_21">Win</A>, <A HREF="terminal_interface-curses__ads.htm#ref_1146_21">Start</A>, <A HREF="terminal_interface-curses__ads.htm#ref_1147_21">Count</A>, True);
@@ -1259,15 +1259,15 @@
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_1165_13">Is_Touched</A>;
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_1256_14" HREF="terminal_interface-curses__ads.htm#ref_1174_14">Copy</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_1257_7" HREF="terminal_interface-curses__ads.htm#ref_1175_7">Source_Window</A></FONT>            : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
-      <FONT COLOR=red><A NAME="ref_1258_7" HREF="terminal_interface-curses__ads.htm#ref_1176_7">Destination_Window</A></FONT>       : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
-      <FONT COLOR=red><A NAME="ref_1259_7" HREF="terminal_interface-curses__ads.htm#ref_1177_7">Source_Top_Row</A></FONT>           : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
-      <FONT COLOR=red><A NAME="ref_1260_7" HREF="terminal_interface-curses__ads.htm#ref_1178_7">Source_Left_Column</A></FONT>       : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
-      <FONT COLOR=red><A NAME="ref_1261_7" HREF="terminal_interface-curses__ads.htm#ref_1179_7">Destination_Top_Row</A></FONT>      : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
-      <FONT COLOR=red><A NAME="ref_1262_7" HREF="terminal_interface-curses__ads.htm#ref_1180_7">Destination_Left_Column</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
-      <FONT COLOR=red><A NAME="ref_1263_7" HREF="terminal_interface-curses__ads.htm#ref_1181_7">Destination_Bottom_Row</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
-      <FONT COLOR=red><A NAME="ref_1264_7" HREF="terminal_interface-curses__ads.htm#ref_1182_7">Destination_Right_Column</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
-      <FONT COLOR=red><A NAME="ref_1265_7" HREF="terminal_interface-curses__ads.htm#ref_1183_7">Non_Destructive_Mode</A></FONT>     : <b>in</b> Boolean := True)
+     (<FONT COLOR=red><A NAME="ref_1257_7" HREF="terminal_interface-curses__ads.htm#ref_1175_7">Source_Window</A></FONT>            : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
+      <FONT COLOR=red><A NAME="ref_1258_7" HREF="terminal_interface-curses__ads.htm#ref_1176_7">Destination_Window</A></FONT>       : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
+      <FONT COLOR=red><A NAME="ref_1259_7" HREF="terminal_interface-curses__ads.htm#ref_1177_7">Source_Top_Row</A></FONT>           : <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
+      <FONT COLOR=red><A NAME="ref_1260_7" HREF="terminal_interface-curses__ads.htm#ref_1178_7">Source_Left_Column</A></FONT>       : <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
+      <FONT COLOR=red><A NAME="ref_1261_7" HREF="terminal_interface-curses__ads.htm#ref_1179_7">Destination_Top_Row</A></FONT>      : <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
+      <FONT COLOR=red><A NAME="ref_1262_7" HREF="terminal_interface-curses__ads.htm#ref_1180_7">Destination_Left_Column</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
+      <FONT COLOR=red><A NAME="ref_1263_7" HREF="terminal_interface-curses__ads.htm#ref_1181_7">Destination_Bottom_Row</A></FONT>   : <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
+      <FONT COLOR=red><A NAME="ref_1264_7" HREF="terminal_interface-curses__ads.htm#ref_1182_7">Destination_Right_Column</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
+      <FONT COLOR=red><A NAME="ref_1265_7" HREF="terminal_interface-curses__ads.htm#ref_1183_7">Non_Destructive_Mode</A></FONT>     : Boolean := True)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_1267_16">Copywin</A></FONT> (<FONT COLOR=red><A NAME="ref_1267_25" HREF="terminal_interface-curses__adb.htm#ref_1267_16">Src</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
                         <FONT COLOR=red><A NAME="ref_1268_25" HREF="terminal_interface-curses__adb.htm#ref_1267_16">Dst</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
@@ -1295,8 +1295,8 @@
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_1174_14">Copy</A>;
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_1292_14" HREF="terminal_interface-curses__ads.htm#ref_1188_14">Overwrite</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_1293_7" HREF="terminal_interface-curses__ads.htm#ref_1188_25">Source_Window</A></FONT>      : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
-      <FONT COLOR=red><A NAME="ref_1294_7" HREF="terminal_interface-curses__ads.htm#ref_1189_25">Destination_Window</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>)
+     (<FONT COLOR=red><A NAME="ref_1293_7" HREF="terminal_interface-curses__ads.htm#ref_1188_25">Source_Window</A></FONT>      : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
+      <FONT COLOR=red><A NAME="ref_1294_7" HREF="terminal_interface-curses__ads.htm#ref_1189_25">Destination_Window</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_1296_16">Overwrite</A></FONT> (<FONT COLOR=red><A NAME="ref_1296_27" HREF="terminal_interface-curses__adb.htm#ref_1296_16">Src</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>; <FONT COLOR=red><A NAME="ref_1296_41" HREF="terminal_interface-curses__adb.htm#ref_1296_16">Dst</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
       <b>pragma</b> Import (C, Overwrite, "overwrite");
@@ -1307,8 +1307,8 @@
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_1188_14">Overwrite</A>;
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_1304_14" HREF="terminal_interface-curses__ads.htm#ref_1194_14">Overlay</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_1305_7" HREF="terminal_interface-curses__ads.htm#ref_1194_23">Source_Window</A></FONT>      : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
-      <FONT COLOR=red><A NAME="ref_1306_7" HREF="terminal_interface-curses__ads.htm#ref_1195_23">Destination_Window</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>)
+     (<FONT COLOR=red><A NAME="ref_1305_7" HREF="terminal_interface-curses__ads.htm#ref_1194_23">Source_Window</A></FONT>      : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
+      <FONT COLOR=red><A NAME="ref_1306_7" HREF="terminal_interface-curses__ads.htm#ref_1195_23">Destination_Window</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_1308_16">Overlay</A></FONT> (<FONT COLOR=red><A NAME="ref_1308_25" HREF="terminal_interface-curses__adb.htm#ref_1308_16">Src</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>; <FONT COLOR=red><A NAME="ref_1308_39" HREF="terminal_interface-curses__adb.htm#ref_1308_16">Dst</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
       <b>pragma</b> Import (C, Overlay, "overlay");
@@ -1320,8 +1320,8 @@
 
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_1317_14" HREF="terminal_interface-curses__ads.htm#ref_1204_14">Insert_Delete_Lines</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_1318_7" HREF="terminal_interface-curses__ads.htm#ref_1205_7">Win</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-      <FONT COLOR=red><A NAME="ref_1319_7" HREF="terminal_interface-curses__ads.htm#ref_1206_7">Lines</A></FONT> : <b>in</b> Integer       := 1) <FONT COLOR=green><EM>-- default is to insert one line above</EM></FONT>
+     (<FONT COLOR=red><A NAME="ref_1318_7" HREF="terminal_interface-curses__ads.htm#ref_1205_7">Win</A></FONT>   : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+      <FONT COLOR=red><A NAME="ref_1319_7" HREF="terminal_interface-curses__ads.htm#ref_1206_7">Lines</A></FONT> : Integer       := 1) <FONT COLOR=green><EM>-- default is to insert one line above</EM></FONT>
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_1321_16">Winsdelln</A></FONT> (<FONT COLOR=red><A NAME="ref_1321_27" HREF="terminal_interface-curses__adb.htm#ref_1321_16">W</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>; <FONT COLOR=red><A NAME="ref_1321_39" HREF="terminal_interface-curses__adb.htm#ref_1321_16">N</A></FONT> : <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
       <b>pragma</b> Import (C, Winsdelln, "winsdelln");
@@ -1331,13 +1331,13 @@
       <b>end</b> <b>if</b>;
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_1204_14">Insert_Delete_Lines</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1329_14" HREF="terminal_interface-curses__ads.htm#ref_1212_14">Delete_Line</A></FONT> (<FONT COLOR=red><A NAME="ref_1329_27" HREF="terminal_interface-curses__ads.htm#ref_1212_27">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1329_14" HREF="terminal_interface-curses__ads.htm#ref_1212_14">Delete_Line</A></FONT> (<FONT COLOR=red><A NAME="ref_1329_27" HREF="terminal_interface-curses__ads.htm#ref_1212_27">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>)
    <b>is</b>
    <b>begin</b>
       <A HREF="terminal_interface-curses__ads.htm#ref_1204_14">Insert_Delete_Lines</A> (<A HREF="terminal_interface-curses__ads.htm#ref_1212_27">Win</A>, -1);
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_1212_14">Delete_Line</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1335_14" HREF="terminal_interface-curses__ads.htm#ref_1218_14">Insert_Line</A></FONT> (<FONT COLOR=red><A NAME="ref_1335_27" HREF="terminal_interface-curses__ads.htm#ref_1218_27">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1335_14" HREF="terminal_interface-curses__ads.htm#ref_1218_14">Insert_Line</A></FONT> (<FONT COLOR=red><A NAME="ref_1335_27" HREF="terminal_interface-curses__ads.htm#ref_1218_27">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>)
    <b>is</b>
    <b>begin</b>
       <A HREF="terminal_interface-curses__ads.htm#ref_1204_14">Insert_Delete_Lines</A> (<A HREF="terminal_interface-curses__ads.htm#ref_1218_27">Win</A>, 1);
@@ -1345,7 +1345,7 @@
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_1342_14" HREF="terminal_interface-curses__ads.htm#ref_1228_14">Get_Size</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_1343_7" HREF="terminal_interface-curses__ads.htm#ref_1229_7">Win</A></FONT>               : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+     (<FONT COLOR=red><A NAME="ref_1343_7" HREF="terminal_interface-curses__ads.htm#ref_1229_7">Win</A></FONT>               : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
       <FONT COLOR=red><A NAME="ref_1344_7" HREF="terminal_interface-curses__ads.htm#ref_1230_7">Number_Of_Lines</A></FONT>   : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_63_12">Line_Count</A>;
       <FONT COLOR=red><A NAME="ref_1345_7" HREF="terminal_interface-curses__ads.htm#ref_1231_7">Number_Of_Columns</A></FONT> : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_65_12">Column_Count</A>)
    <b>is</b>
@@ -1365,7 +1365,7 @@
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_1228_14">Get_Size</A>;
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_1362_14" HREF="terminal_interface-curses__ads.htm#ref_1236_14">Get_Window_Position</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_1363_7" HREF="terminal_interface-curses__ads.htm#ref_1237_7">Win</A></FONT>             : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+     (<FONT COLOR=red><A NAME="ref_1363_7" HREF="terminal_interface-curses__ads.htm#ref_1237_7">Win</A></FONT>             : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
       <FONT COLOR=red><A NAME="ref_1364_7" HREF="terminal_interface-curses__ads.htm#ref_1238_7">Top_Left_Line</A></FONT>   : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
       <FONT COLOR=red><A NAME="ref_1365_7" HREF="terminal_interface-curses__ads.htm#ref_1239_7">Top_Left_Column</A></FONT> : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>)
    <b>is</b>
@@ -1383,7 +1383,7 @@
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_1236_14">Get_Window_Position</A>;
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_1380_14" HREF="terminal_interface-curses__ads.htm#ref_1244_14">Get_Cursor_Position</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_1381_7" HREF="terminal_interface-curses__ads.htm#ref_1245_7">Win</A></FONT>    : <b>in</b>  <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+     (<FONT COLOR=red><A NAME="ref_1381_7" HREF="terminal_interface-curses__ads.htm#ref_1245_7">Win</A></FONT>    :  <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
       <FONT COLOR=red><A NAME="ref_1382_7" HREF="terminal_interface-curses__ads.htm#ref_1246_7">Line</A></FONT>   : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
       <FONT COLOR=red><A NAME="ref_1383_7" HREF="terminal_interface-curses__ads.htm#ref_1247_7">Column</A></FONT> : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>)
    <b>is</b>
@@ -1401,7 +1401,7 @@
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_1244_14">Get_Cursor_Position</A>;
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_1398_14" HREF="terminal_interface-curses__ads.htm#ref_1252_14">Get_Origin_Relative_To_Parent</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_1399_7" HREF="terminal_interface-curses__ads.htm#ref_1253_7">Win</A></FONT>                : <b>in</b>  <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
+     (<FONT COLOR=red><A NAME="ref_1399_7" HREF="terminal_interface-curses__ads.htm#ref_1253_7">Win</A></FONT>                :  <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
       <FONT COLOR=red><A NAME="ref_1400_7" HREF="terminal_interface-curses__ads.htm#ref_1254_7">Top_Left_Line</A></FONT>      : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
       <FONT COLOR=red><A NAME="ref_1401_7" HREF="terminal_interface-curses__ads.htm#ref_1255_7">Top_Left_Column</A></FONT>    : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
       <FONT COLOR=red><A NAME="ref_1402_7" HREF="terminal_interface-curses__ads.htm#ref_1256_7">Is_Not_A_Subwindow</A></FONT> : <b>out</b> Boolean)
@@ -1470,13 +1470,13 @@
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_1273_13">Sub_Pad</A>;
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_1467_14" HREF="terminal_interface-curses__ads.htm#ref_1283_14">Refresh</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_1468_7" HREF="terminal_interface-curses__ads.htm#ref_1284_7">Pad</A></FONT>                      : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
-      <FONT COLOR=red><A NAME="ref_1469_7" HREF="terminal_interface-curses__ads.htm#ref_1285_7">Source_Top_Row</A></FONT>           : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
-      <FONT COLOR=red><A NAME="ref_1470_7" HREF="terminal_interface-curses__ads.htm#ref_1286_7">Source_Left_Column</A></FONT>       : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
-      <FONT COLOR=red><A NAME="ref_1471_7" HREF="terminal_interface-curses__ads.htm#ref_1287_7">Destination_Top_Row</A></FONT>      : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
-      <FONT COLOR=red><A NAME="ref_1472_7" HREF="terminal_interface-curses__ads.htm#ref_1288_7">Destination_Left_Column</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
-      <FONT COLOR=red><A NAME="ref_1473_7" HREF="terminal_interface-curses__ads.htm#ref_1289_7">Destination_Bottom_Row</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
-      <FONT COLOR=red><A NAME="ref_1474_7" HREF="terminal_interface-curses__ads.htm#ref_1290_7">Destination_Right_Column</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>)
+     (<FONT COLOR=red><A NAME="ref_1468_7" HREF="terminal_interface-curses__ads.htm#ref_1284_7">Pad</A></FONT>                      : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
+      <FONT COLOR=red><A NAME="ref_1469_7" HREF="terminal_interface-curses__ads.htm#ref_1285_7">Source_Top_Row</A></FONT>           : <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
+      <FONT COLOR=red><A NAME="ref_1470_7" HREF="terminal_interface-curses__ads.htm#ref_1286_7">Source_Left_Column</A></FONT>       : <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
+      <FONT COLOR=red><A NAME="ref_1471_7" HREF="terminal_interface-curses__ads.htm#ref_1287_7">Destination_Top_Row</A></FONT>      : <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
+      <FONT COLOR=red><A NAME="ref_1472_7" HREF="terminal_interface-curses__ads.htm#ref_1288_7">Destination_Left_Column</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
+      <FONT COLOR=red><A NAME="ref_1473_7" HREF="terminal_interface-curses__ads.htm#ref_1289_7">Destination_Bottom_Row</A></FONT>   : <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
+      <FONT COLOR=red><A NAME="ref_1474_7" HREF="terminal_interface-curses__ads.htm#ref_1290_7">Destination_Right_Column</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_1476_16">Prefresh</A></FONT>
         (<FONT COLOR=red><A NAME="ref_1477_10" HREF="terminal_interface-curses__adb.htm#ref_1476_16">Pad</A></FONT>                      : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
@@ -1500,13 +1500,13 @@
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_1283_14">Refresh</A>;
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_1497_14" HREF="terminal_interface-curses__ads.htm#ref_1295_14">Refresh_Without_Update</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_1498_7" HREF="terminal_interface-curses__ads.htm#ref_1296_7">Pad</A></FONT>                      : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
-      <FONT COLOR=red><A NAME="ref_1499_7" HREF="terminal_interface-curses__ads.htm#ref_1297_7">Source_Top_Row</A></FONT>           : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
-      <FONT COLOR=red><A NAME="ref_1500_7" HREF="terminal_interface-curses__ads.htm#ref_1298_7">Source_Left_Column</A></FONT>       : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
-      <FONT COLOR=red><A NAME="ref_1501_7" HREF="terminal_interface-curses__ads.htm#ref_1299_7">Destination_Top_Row</A></FONT>      : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
-      <FONT COLOR=red><A NAME="ref_1502_7" HREF="terminal_interface-curses__ads.htm#ref_1300_7">Destination_Left_Column</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
-      <FONT COLOR=red><A NAME="ref_1503_7" HREF="terminal_interface-curses__ads.htm#ref_1301_7">Destination_Bottom_Row</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
-      <FONT COLOR=red><A NAME="ref_1504_7" HREF="terminal_interface-curses__ads.htm#ref_1302_7">Destination_Right_Column</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>)
+     (<FONT COLOR=red><A NAME="ref_1498_7" HREF="terminal_interface-curses__ads.htm#ref_1296_7">Pad</A></FONT>                      : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
+      <FONT COLOR=red><A NAME="ref_1499_7" HREF="terminal_interface-curses__ads.htm#ref_1297_7">Source_Top_Row</A></FONT>           : <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
+      <FONT COLOR=red><A NAME="ref_1500_7" HREF="terminal_interface-curses__ads.htm#ref_1298_7">Source_Left_Column</A></FONT>       : <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
+      <FONT COLOR=red><A NAME="ref_1501_7" HREF="terminal_interface-curses__ads.htm#ref_1299_7">Destination_Top_Row</A></FONT>      : <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
+      <FONT COLOR=red><A NAME="ref_1502_7" HREF="terminal_interface-curses__ads.htm#ref_1300_7">Destination_Left_Column</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
+      <FONT COLOR=red><A NAME="ref_1503_7" HREF="terminal_interface-curses__ads.htm#ref_1301_7">Destination_Bottom_Row</A></FONT>   : <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
+      <FONT COLOR=red><A NAME="ref_1504_7" HREF="terminal_interface-curses__ads.htm#ref_1302_7">Destination_Right_Column</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_1506_16">Pnoutrefresh</A></FONT>
         (<FONT COLOR=red><A NAME="ref_1507_10" HREF="terminal_interface-curses__adb.htm#ref_1506_16">Pad</A></FONT>                      : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
@@ -1530,8 +1530,8 @@
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_1295_14">Refresh_Without_Update</A>;
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_1527_14" HREF="terminal_interface-curses__ads.htm#ref_1307_14">Add_Character_To_Pad_And_Echo_It</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_1528_7" HREF="terminal_interface-curses__ads.htm#ref_1308_7">Pad</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
-      <FONT COLOR=red><A NAME="ref_1529_7" HREF="terminal_interface-curses__ads.htm#ref_1309_7">Ch</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A>)
+     (<FONT COLOR=red><A NAME="ref_1528_7" HREF="terminal_interface-curses__ads.htm#ref_1308_7">Pad</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
+      <FONT COLOR=red><A NAME="ref_1529_7" HREF="terminal_interface-curses__ads.htm#ref_1309_7">Ch</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_1531_16">Pechochar</A></FONT> (<FONT COLOR=red><A NAME="ref_1531_27" HREF="terminal_interface-curses__adb.htm#ref_1531_16">Pad</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>; <FONT COLOR=red><A NAME="ref_1531_41" HREF="terminal_interface-curses__adb.htm#ref_1531_16">Ch</A></FONT> : <A HREF="terminal_interface-curses-aux__ads.htm#ref_63_12">C_Chtype</A>)
                           <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
@@ -1543,8 +1543,8 @@
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_1307_14">Add_Character_To_Pad_And_Echo_It</A>;
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_1540_14" HREF="terminal_interface-curses__ads.htm#ref_1312_14">Add_Character_To_Pad_And_Echo_It</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_1541_7" HREF="terminal_interface-curses__ads.htm#ref_1313_7">Pad</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
-      <FONT COLOR=red><A NAME="ref_1542_7" HREF="terminal_interface-curses__ads.htm#ref_1314_7">Ch</A></FONT>  : <b>in</b> Character)
+     (<FONT COLOR=red><A NAME="ref_1541_7" HREF="terminal_interface-curses__ads.htm#ref_1313_7">Pad</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
+      <FONT COLOR=red><A NAME="ref_1542_7" HREF="terminal_interface-curses__ads.htm#ref_1314_7">Ch</A></FONT>  : Character)
    <b>is</b>
    <b>begin</b>
       <A HREF="terminal_interface-curses__ads.htm#ref_1307_14">Add_Character_To_Pad_And_Echo_It</A>
@@ -1554,8 +1554,8 @@
                                <A HREF="terminal_interface-curses__ads.htm#ref_354_10">Attr</A>  =&gt; <A HREF="terminal_interface-curses__ads.htm#ref_350_4">Normal_Video</A>));
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_1312_14">Add_Character_To_Pad_And_Echo_It</A>;
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1552_14" HREF="terminal_interface-curses__ads.htm#ref_1322_14">Scroll</A></FONT> (<FONT COLOR=red><A NAME="ref_1552_22" HREF="terminal_interface-curses__ads.htm#ref_1322_22">Win</A></FONT>    : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-                     <FONT COLOR=red><A NAME="ref_1553_22" HREF="terminal_interface-curses__ads.htm#ref_1323_22">Amount</A></FONT> : <b>in</b> Integer := 1)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1552_14" HREF="terminal_interface-curses__ads.htm#ref_1322_14">Scroll</A></FONT> (<FONT COLOR=red><A NAME="ref_1552_22" HREF="terminal_interface-curses__ads.htm#ref_1322_22">Win</A></FONT>    : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+                     <FONT COLOR=red><A NAME="ref_1553_22" HREF="terminal_interface-curses__ads.htm#ref_1323_22">Amount</A></FONT> : Integer := 1)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_1555_16">Wscrl</A></FONT> (<FONT COLOR=red><A NAME="ref_1555_23" HREF="terminal_interface-curses__adb.htm#ref_1555_16">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>; <FONT COLOR=red><A NAME="ref_1555_37" HREF="terminal_interface-curses__adb.htm#ref_1555_16">N</A></FONT> : <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
       <b>pragma</b> Import (C, Wscrl, "wscrl");
@@ -1567,7 +1567,7 @@
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_1322_14">Scroll</A>;
 
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1565_14" HREF="terminal_interface-curses__ads.htm#ref_1334_14">Delete_Character</A></FONT> (<FONT COLOR=red><A NAME="ref_1565_32" HREF="terminal_interface-curses__ads.htm#ref_1334_32">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1565_14" HREF="terminal_interface-curses__ads.htm#ref_1334_14">Delete_Character</A></FONT> (<FONT COLOR=red><A NAME="ref_1565_32" HREF="terminal_interface-curses__ads.htm#ref_1334_32">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_1567_16">Wdelch</A></FONT> (<FONT COLOR=red><A NAME="ref_1567_24" HREF="terminal_interface-curses__adb.htm#ref_1567_16">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
       <b>pragma</b> Import (C, Wdelch, "wdelch");
@@ -1578,9 +1578,9 @@
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_1334_14">Delete_Character</A>;
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_1575_14" HREF="terminal_interface-curses__ads.htm#ref_1339_14">Delete_Character</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_1576_7" HREF="terminal_interface-curses__ads.htm#ref_1340_7">Win</A></FONT>    : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-      <FONT COLOR=red><A NAME="ref_1577_7" HREF="terminal_interface-curses__ads.htm#ref_1341_7">Line</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
-      <FONT COLOR=red><A NAME="ref_1578_7" HREF="terminal_interface-curses__ads.htm#ref_1342_7">Column</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>)
+     (<FONT COLOR=red><A NAME="ref_1576_7" HREF="terminal_interface-curses__ads.htm#ref_1340_7">Win</A></FONT>    : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+      <FONT COLOR=red><A NAME="ref_1577_7" HREF="terminal_interface-curses__ads.htm#ref_1341_7">Line</A></FONT>   : <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
+      <FONT COLOR=red><A NAME="ref_1578_7" HREF="terminal_interface-curses__ads.htm#ref_1342_7">Column</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_1580_16">Mvwdelch</A></FONT> (<FONT COLOR=red><A NAME="ref_1580_26" HREF="terminal_interface-curses__adb.htm#ref_1580_16">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
                          <FONT COLOR=red><A NAME="ref_1581_26" HREF="terminal_interface-curses__adb.htm#ref_1580_16">Lin</A></FONT> : <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
@@ -1614,8 +1614,8 @@
       <b>return</b> Chtype_To_AttrChar (<A HREF="terminal_interface-curses__adb.htm#ref_1604_16">Mvwinch</A> (<A HREF="terminal_interface-curses__ads.htm#ref_1359_7">Win</A>, <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A> (<A HREF="terminal_interface-curses__ads.htm#ref_1360_7">Line</A>), <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A> (<A HREF="terminal_interface-curses__ads.htm#ref_1361_7">Column</A>)));
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_1358_13">Peek</A>;
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1612_14" HREF="terminal_interface-curses__ads.htm#ref_1371_14">Insert</A></FONT> (<FONT COLOR=red><A NAME="ref_1612_22" HREF="terminal_interface-curses__ads.htm#ref_1371_22">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-                     <FONT COLOR=red><A NAME="ref_1613_22" HREF="terminal_interface-curses__ads.htm#ref_1372_22">Ch</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1612_14" HREF="terminal_interface-curses__ads.htm#ref_1371_14">Insert</A></FONT> (<FONT COLOR=red><A NAME="ref_1612_22" HREF="terminal_interface-curses__ads.htm#ref_1371_22">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+                     <FONT COLOR=red><A NAME="ref_1613_22" HREF="terminal_interface-curses__ads.htm#ref_1372_22">Ch</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_1615_16">Winsch</A></FONT> (<FONT COLOR=red><A NAME="ref_1615_24" HREF="terminal_interface-curses__adb.htm#ref_1615_16">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>; <FONT COLOR=red><A NAME="ref_1615_38" HREF="terminal_interface-curses__adb.htm#ref_1615_16">Ch</A></FONT> : <A HREF="terminal_interface-curses-aux__ads.htm#ref_63_12">C_Chtype</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
       <b>pragma</b> Import (C, Winsch, "winsch");
@@ -1626,10 +1626,10 @@
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_1371_14">Insert</A>;
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_1623_14" HREF="terminal_interface-curses__ads.htm#ref_1377_14">Insert</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_1624_7" HREF="terminal_interface-curses__ads.htm#ref_1377_22">Win</A></FONT>    : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-      <FONT COLOR=red><A NAME="ref_1625_7" HREF="terminal_interface-curses__ads.htm#ref_1378_22">Line</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
-      <FONT COLOR=red><A NAME="ref_1626_7" HREF="terminal_interface-curses__ads.htm#ref_1379_22">Column</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
-      <FONT COLOR=red><A NAME="ref_1627_7" HREF="terminal_interface-curses__ads.htm#ref_1380_22">Ch</A></FONT>     : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A>)
+     (<FONT COLOR=red><A NAME="ref_1624_7" HREF="terminal_interface-curses__ads.htm#ref_1377_22">Win</A></FONT>    : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+      <FONT COLOR=red><A NAME="ref_1625_7" HREF="terminal_interface-curses__ads.htm#ref_1378_22">Line</A></FONT>   : <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
+      <FONT COLOR=red><A NAME="ref_1626_7" HREF="terminal_interface-curses__ads.htm#ref_1379_22">Column</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
+      <FONT COLOR=red><A NAME="ref_1627_7" HREF="terminal_interface-curses__ads.htm#ref_1380_22">Ch</A></FONT>     : <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_1629_16">Mvwinsch</A></FONT> (<FONT COLOR=red><A NAME="ref_1629_26" HREF="terminal_interface-curses__adb.htm#ref_1629_16">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
                          <FONT COLOR=red><A NAME="ref_1630_26" HREF="terminal_interface-curses__adb.htm#ref_1629_16">Lin</A></FONT> : <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
@@ -1645,9 +1645,9 @@
       <b>end</b> <b>if</b>;
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_1377_14">Insert</A>;
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1643_14" HREF="terminal_interface-curses__ads.htm#ref_1389_14">Insert</A></FONT> (<FONT COLOR=red><A NAME="ref_1643_22" HREF="terminal_interface-curses__ads.htm#ref_1389_22">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-                     <FONT COLOR=red><A NAME="ref_1644_22" HREF="terminal_interface-curses__ads.htm#ref_1390_22">Str</A></FONT> : <b>in</b> String;
-                     <FONT COLOR=red><A NAME="ref_1645_22" HREF="terminal_interface-curses__ads.htm#ref_1391_22">Len</A></FONT> : <b>in</b> Integer := -1)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1643_14" HREF="terminal_interface-curses__ads.htm#ref_1389_14">Insert</A></FONT> (<FONT COLOR=red><A NAME="ref_1643_22" HREF="terminal_interface-curses__ads.htm#ref_1389_22">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+                     <FONT COLOR=red><A NAME="ref_1644_22" HREF="terminal_interface-curses__ads.htm#ref_1390_22">Str</A></FONT> : String;
+                     <FONT COLOR=red><A NAME="ref_1645_22" HREF="terminal_interface-curses__ads.htm#ref_1391_22">Len</A></FONT> : Integer := -1)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_1647_16">Winsnstr</A></FONT> (<FONT COLOR=red><A NAME="ref_1647_26" HREF="terminal_interface-curses__adb.htm#ref_1647_16">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
                          <FONT COLOR=red><A NAME="ref_1648_26" HREF="terminal_interface-curses__adb.htm#ref_1647_16">Str</A></FONT> : char_array;
@@ -1664,11 +1664,11 @@
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_1389_14">Insert</A>;
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_1661_14" HREF="terminal_interface-curses__ads.htm#ref_1398_14">Insert</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_1662_7" HREF="terminal_interface-curses__ads.htm#ref_1398_22">Win</A></FONT>    : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-      <FONT COLOR=red><A NAME="ref_1663_7" HREF="terminal_interface-curses__ads.htm#ref_1399_22">Line</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
-      <FONT COLOR=red><A NAME="ref_1664_7" HREF="terminal_interface-curses__ads.htm#ref_1400_22">Column</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
-      <FONT COLOR=red><A NAME="ref_1665_7" HREF="terminal_interface-curses__ads.htm#ref_1401_22">Str</A></FONT>    : <b>in</b> String;
-      <FONT COLOR=red><A NAME="ref_1666_7" HREF="terminal_interface-curses__ads.htm#ref_1402_22">Len</A></FONT>    : <b>in</b> Integer := -1)
+     (<FONT COLOR=red><A NAME="ref_1662_7" HREF="terminal_interface-curses__ads.htm#ref_1398_22">Win</A></FONT>    : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+      <FONT COLOR=red><A NAME="ref_1663_7" HREF="terminal_interface-curses__ads.htm#ref_1399_22">Line</A></FONT>   : <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
+      <FONT COLOR=red><A NAME="ref_1664_7" HREF="terminal_interface-curses__ads.htm#ref_1400_22">Column</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
+      <FONT COLOR=red><A NAME="ref_1665_7" HREF="terminal_interface-curses__ads.htm#ref_1401_22">Str</A></FONT>    : String;
+      <FONT COLOR=red><A NAME="ref_1666_7" HREF="terminal_interface-curses__ads.htm#ref_1402_22">Len</A></FONT>    : Integer := -1)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_1668_16">Mvwinsnstr</A></FONT> (<FONT COLOR=red><A NAME="ref_1668_28" HREF="terminal_interface-curses__adb.htm#ref_1668_16">Win</A></FONT>    : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
                            <FONT COLOR=red><A NAME="ref_1669_28" HREF="terminal_interface-curses__adb.htm#ref_1668_16">Line</A></FONT>   : <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
@@ -1687,9 +1687,9 @@
       <b>end</b> <b>if</b>;
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_1398_14">Insert</A>;
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1685_14" HREF="terminal_interface-curses__ads.htm#ref_1414_14">Peek</A></FONT> (<FONT COLOR=red><A NAME="ref_1685_20" HREF="terminal_interface-curses__ads.htm#ref_1414_20">Win</A></FONT> : <b>in</b>  <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1685_14" HREF="terminal_interface-curses__ads.htm#ref_1414_14">Peek</A></FONT> (<FONT COLOR=red><A NAME="ref_1685_20" HREF="terminal_interface-curses__ads.htm#ref_1414_20">Win</A></FONT> :  <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
                    <FONT COLOR=red><A NAME="ref_1686_20" HREF="terminal_interface-curses__ads.htm#ref_1415_20">Str</A></FONT> : <b>out</b> String;
-                   <FONT COLOR=red><A NAME="ref_1687_20" HREF="terminal_interface-curses__ads.htm#ref_1416_20">Len</A></FONT> : <b>in</b>  Integer := -1)
+                   <FONT COLOR=red><A NAME="ref_1687_20" HREF="terminal_interface-curses__ads.htm#ref_1416_20">Len</A></FONT> :  Integer := -1)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_1689_16">Winnstr</A></FONT> (<FONT COLOR=red><A NAME="ref_1689_25" HREF="terminal_interface-curses__adb.htm#ref_1689_16">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
                         <FONT COLOR=red><A NAME="ref_1690_25" HREF="terminal_interface-curses__adb.htm#ref_1689_16">Str</A></FONT> : char_array;
@@ -1706,7 +1706,7 @@
       <b>if</b> <A HREF="terminal_interface-curses__adb.htm#ref_1694_7">N</A> &gt; <A HREF="terminal_interface-curses__ads.htm#ref_1415_20">Str</A>'Length <b>then</b>
          <b>raise</b> Constraint_Error;
       <b>end</b> <b>if</b>;
-      <A HREF="terminal_interface-curses__adb.htm#ref_1695_7">Txt</A> (0) := <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C.char'First;
+      <A HREF="terminal_interface-curses__adb.htm#ref_1695_7">Txt</A> (0) := <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C.char'First;
       <b>if</b> <A HREF="terminal_interface-curses__adb.htm#ref_1689_16">Winnstr</A> (<A HREF="terminal_interface-curses__ads.htm#ref_1414_20">Win</A>, <A HREF="terminal_interface-curses__adb.htm#ref_1695_7">Txt</A>, <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A> (<A HREF="terminal_interface-curses__adb.htm#ref_1694_7">N</A>)) = <A HREF="terminal_interface-curses-aux__ads.htm#ref_72_4">Curses_Err</A> <b>then</b>
          <b>raise</b> <A HREF="terminal_interface-curses__ads.htm#ref_383_4">Curses_Exception</A>;
       <b>end</b> <b>if</b>;
@@ -1717,11 +1717,11 @@
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_1414_14">Peek</A>;
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_1714_14" HREF="terminal_interface-curses__ads.htm#ref_1423_14">Peek</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_1715_7" HREF="terminal_interface-curses__ads.htm#ref_1423_20">Win</A></FONT>    : <b>in</b>  <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-      <FONT COLOR=red><A NAME="ref_1716_7" HREF="terminal_interface-curses__ads.htm#ref_1424_20">Line</A></FONT>   : <b>in</b>  <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
-      <FONT COLOR=red><A NAME="ref_1717_7" HREF="terminal_interface-curses__ads.htm#ref_1425_20">Column</A></FONT> : <b>in</b>  <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
+     (<FONT COLOR=red><A NAME="ref_1715_7" HREF="terminal_interface-curses__ads.htm#ref_1423_20">Win</A></FONT>    :  <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+      <FONT COLOR=red><A NAME="ref_1716_7" HREF="terminal_interface-curses__ads.htm#ref_1424_20">Line</A></FONT>   :  <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
+      <FONT COLOR=red><A NAME="ref_1717_7" HREF="terminal_interface-curses__ads.htm#ref_1425_20">Column</A></FONT> :  <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
       <FONT COLOR=red><A NAME="ref_1718_7" HREF="terminal_interface-curses__ads.htm#ref_1426_20">Str</A></FONT>    : <b>out</b> String;
-      <FONT COLOR=red><A NAME="ref_1719_7" HREF="terminal_interface-curses__ads.htm#ref_1427_20">Len</A></FONT>    : <b>in</b>  Integer := -1)
+      <FONT COLOR=red><A NAME="ref_1719_7" HREF="terminal_interface-curses__ads.htm#ref_1427_20">Len</A></FONT>    :  Integer := -1)
    <b>is</b>
    <b>begin</b>
       <A HREF="terminal_interface-curses__ads.htm#ref_511_14">Move_Cursor</A> (<A HREF="terminal_interface-curses__ads.htm#ref_1423_20">Win</A>, <A HREF="terminal_interface-curses__ads.htm#ref_1424_20">Line</A>, <A HREF="terminal_interface-curses__ads.htm#ref_1425_20">Column</A>);
@@ -1729,9 +1729,9 @@
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_1423_14">Peek</A>;
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_1726_14" HREF="terminal_interface-curses__ads.htm#ref_1438_14">Peek</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_1727_7" HREF="terminal_interface-curses__ads.htm#ref_1438_20">Win</A></FONT> : <b>in</b>  <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+     (<FONT COLOR=red><A NAME="ref_1727_7" HREF="terminal_interface-curses__ads.htm#ref_1438_20">Win</A></FONT> :  <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
       <FONT COLOR=red><A NAME="ref_1728_7" HREF="terminal_interface-curses__ads.htm#ref_1439_20">Str</A></FONT> : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_371_4">Attributed_String</A>;
-      <FONT COLOR=red><A NAME="ref_1729_7" HREF="terminal_interface-curses__ads.htm#ref_1440_20">Len</A></FONT> : <b>in</b>  Integer := -1)
+      <FONT COLOR=red><A NAME="ref_1729_7" HREF="terminal_interface-curses__ads.htm#ref_1440_20">Len</A></FONT> :  Integer := -1)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_1731_16">Winchnstr</A></FONT> (<FONT COLOR=red><A NAME="ref_1731_27" HREF="terminal_interface-curses__adb.htm#ref_1731_16">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
                           <FONT COLOR=red><A NAME="ref_1732_27" HREF="terminal_interface-curses__adb.htm#ref_1731_16">Str</A></FONT> : chtype_array;             <FONT COLOR=green><EM>-- out</EM></FONT>
@@ -1766,20 +1766,20 @@
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_1438_14">Peek</A>;
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_1763_14" HREF="terminal_interface-curses__ads.htm#ref_1447_14">Peek</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_1764_7" HREF="terminal_interface-curses__ads.htm#ref_1447_20">Win</A></FONT>    : <b>in</b>  <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-      <FONT COLOR=red><A NAME="ref_1765_7" HREF="terminal_interface-curses__ads.htm#ref_1448_20">Line</A></FONT>   : <b>in</b>  <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
-      <FONT COLOR=red><A NAME="ref_1766_7" HREF="terminal_interface-curses__ads.htm#ref_1449_20">Column</A></FONT> : <b>in</b>  <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
+     (<FONT COLOR=red><A NAME="ref_1764_7" HREF="terminal_interface-curses__ads.htm#ref_1447_20">Win</A></FONT>    :  <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+      <FONT COLOR=red><A NAME="ref_1765_7" HREF="terminal_interface-curses__ads.htm#ref_1448_20">Line</A></FONT>   :  <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
+      <FONT COLOR=red><A NAME="ref_1766_7" HREF="terminal_interface-curses__ads.htm#ref_1449_20">Column</A></FONT> :  <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
       <FONT COLOR=red><A NAME="ref_1767_7" HREF="terminal_interface-curses__ads.htm#ref_1450_20">Str</A></FONT>    : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_371_4">Attributed_String</A>;
-      <FONT COLOR=red><A NAME="ref_1768_7" HREF="terminal_interface-curses__ads.htm#ref_1451_20">Len</A></FONT>    : <b>in</b> Integer := -1)
+      <FONT COLOR=red><A NAME="ref_1768_7" HREF="terminal_interface-curses__ads.htm#ref_1451_20">Len</A></FONT>    : Integer := -1)
    <b>is</b>
    <b>begin</b>
       <A HREF="terminal_interface-curses__ads.htm#ref_511_14">Move_Cursor</A> (<A HREF="terminal_interface-curses__ads.htm#ref_1447_20">Win</A>, <A HREF="terminal_interface-curses__ads.htm#ref_1448_20">Line</A>, <A HREF="terminal_interface-curses__ads.htm#ref_1449_20">Column</A>);
       <A HREF="terminal_interface-curses__ads.htm#ref_1438_14">Peek</A> (<A HREF="terminal_interface-curses__ads.htm#ref_1447_20">Win</A>, <A HREF="terminal_interface-curses__ads.htm#ref_1450_20">Str</A>, <A HREF="terminal_interface-curses__ads.htm#ref_1451_20">Len</A>);
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_1447_14">Peek</A>;
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1775_14" HREF="terminal_interface-curses__ads.htm#ref_1463_14">Get</A></FONT> (<FONT COLOR=red><A NAME="ref_1775_19" HREF="terminal_interface-curses__ads.htm#ref_1463_19">Win</A></FONT> : <b>in</b>  <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1775_14" HREF="terminal_interface-curses__ads.htm#ref_1463_14">Get</A></FONT> (<FONT COLOR=red><A NAME="ref_1775_19" HREF="terminal_interface-curses__ads.htm#ref_1463_19">Win</A></FONT> :  <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
                   <FONT COLOR=red><A NAME="ref_1776_19" HREF="terminal_interface-curses__ads.htm#ref_1464_19">Str</A></FONT> : <b>out</b> String;
-                  <FONT COLOR=red><A NAME="ref_1777_19" HREF="terminal_interface-curses__ads.htm#ref_1465_19">Len</A></FONT> : <b>in</b>  Integer := -1)
+                  <FONT COLOR=red><A NAME="ref_1777_19" HREF="terminal_interface-curses__ads.htm#ref_1465_19">Len</A></FONT> :  Integer := -1)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_1779_16">Wgetnstr</A></FONT> (<FONT COLOR=red><A NAME="ref_1779_26" HREF="terminal_interface-curses__adb.htm#ref_1779_16">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
                          <FONT COLOR=red><A NAME="ref_1780_26" HREF="terminal_interface-curses__adb.htm#ref_1779_16">Str</A></FONT> : char_array;
@@ -1796,7 +1796,7 @@
       <b>if</b> <A HREF="terminal_interface-curses__adb.htm#ref_1784_7">N</A> &gt; <A HREF="terminal_interface-curses__ads.htm#ref_1464_19">Str</A>'Length <b>then</b>
          <b>raise</b> Constraint_Error;
       <b>end</b> <b>if</b>;
-      <A HREF="terminal_interface-curses__adb.htm#ref_1785_7">Txt</A> (0) := <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C.char'First;
+      <A HREF="terminal_interface-curses__adb.htm#ref_1785_7">Txt</A> (0) := <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C.char'First;
       <b>if</b> <A HREF="terminal_interface-curses__adb.htm#ref_1779_16">Wgetnstr</A> (<A HREF="terminal_interface-curses__ads.htm#ref_1463_19">Win</A>, <A HREF="terminal_interface-curses__adb.htm#ref_1785_7">Txt</A>, <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A> (<A HREF="terminal_interface-curses__adb.htm#ref_1784_7">N</A>)) = <A HREF="terminal_interface-curses-aux__ads.htm#ref_72_4">Curses_Err</A> <b>then</b>
          <b>raise</b> <A HREF="terminal_interface-curses__ads.htm#ref_383_4">Curses_Exception</A>;
       <b>end</b> <b>if</b>;
@@ -1807,11 +1807,11 @@
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_1463_14">Get</A>;
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_1804_14" HREF="terminal_interface-curses__ads.htm#ref_1474_14">Get</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_1805_7" HREF="terminal_interface-curses__ads.htm#ref_1474_19">Win</A></FONT>    : <b>in</b>  <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-      <FONT COLOR=red><A NAME="ref_1806_7" HREF="terminal_interface-curses__ads.htm#ref_1475_19">Line</A></FONT>   : <b>in</b>  <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
-      <FONT COLOR=red><A NAME="ref_1807_7" HREF="terminal_interface-curses__ads.htm#ref_1476_19">Column</A></FONT> : <b>in</b>  <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
+     (<FONT COLOR=red><A NAME="ref_1805_7" HREF="terminal_interface-curses__ads.htm#ref_1474_19">Win</A></FONT>    :  <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+      <FONT COLOR=red><A NAME="ref_1806_7" HREF="terminal_interface-curses__ads.htm#ref_1475_19">Line</A></FONT>   :  <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
+      <FONT COLOR=red><A NAME="ref_1807_7" HREF="terminal_interface-curses__ads.htm#ref_1476_19">Column</A></FONT> :  <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
       <FONT COLOR=red><A NAME="ref_1808_7" HREF="terminal_interface-curses__ads.htm#ref_1477_19">Str</A></FONT>    : <b>out</b> String;
-      <FONT COLOR=red><A NAME="ref_1809_7" HREF="terminal_interface-curses__ads.htm#ref_1478_19">Len</A></FONT>    : <b>in</b>  Integer := -1)
+      <FONT COLOR=red><A NAME="ref_1809_7" HREF="terminal_interface-curses__ads.htm#ref_1478_19">Len</A></FONT>    :  Integer := -1)
    <b>is</b>
    <b>begin</b>
       <A HREF="terminal_interface-curses__ads.htm#ref_511_14">Move_Cursor</A> (<A HREF="terminal_interface-curses__ads.htm#ref_1474_19">Win</A>, <A HREF="terminal_interface-curses__ads.htm#ref_1475_19">Line</A>, <A HREF="terminal_interface-curses__ads.htm#ref_1476_19">Column</A>);
@@ -1819,7 +1819,7 @@
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_1474_14">Get</A>;
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_1816_14" HREF="terminal_interface-curses__ads.htm#ref_1499_14">Init_Soft_Label_Keys</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_1817_7" HREF="terminal_interface-curses__ads.htm#ref_1500_7">Format</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_1491_9">Soft_Label_Key_Format</A> := <A HREF="terminal_interface-curses__ads.htm#ref_1491_35">Three_Two_Three</A>)
+     (<FONT COLOR=red><A NAME="ref_1817_7" HREF="terminal_interface-curses__ads.htm#ref_1500_7">Format</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_1491_9">Soft_Label_Key_Format</A> := <A HREF="terminal_interface-curses__ads.htm#ref_1491_35">Three_Two_Three</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_1819_16">Slk_Init</A></FONT> (<FONT COLOR=red><A NAME="ref_1819_26" HREF="terminal_interface-curses__adb.htm#ref_1819_16">Fmt</A></FONT> : <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
       <b>pragma</b> Import (C, Slk_Init, "slk_init");
@@ -1829,9 +1829,9 @@
       <b>end</b> <b>if</b>;
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_1499_14">Init_Soft_Label_Keys</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1827_14" HREF="terminal_interface-curses__ads.htm#ref_1505_14">Set_Soft_Label_Key</A></FONT> (<FONT COLOR=red><A NAME="ref_1827_34" HREF="terminal_interface-curses__ads.htm#ref_1505_34">Label</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_1495_9">Label_Number</A>;
-                                 <FONT COLOR=red><A NAME="ref_1828_34" HREF="terminal_interface-curses__ads.htm#ref_1506_34">Text</A></FONT>  : <b>in</b> String;
-                                 <FONT COLOR=red><A NAME="ref_1829_34" HREF="terminal_interface-curses__ads.htm#ref_1507_34">Fmt</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_1496_9">Label_Justification</A> := <A HREF="terminal_interface-curses__ads.htm#ref_1496_33">Left</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1827_14" HREF="terminal_interface-curses__ads.htm#ref_1505_14">Set_Soft_Label_Key</A></FONT> (<FONT COLOR=red><A NAME="ref_1827_34" HREF="terminal_interface-curses__ads.htm#ref_1505_34">Label</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_1495_9">Label_Number</A>;
+                                 <FONT COLOR=red><A NAME="ref_1828_34" HREF="terminal_interface-curses__ads.htm#ref_1506_34">Text</A></FONT>  : String;
+                                 <FONT COLOR=red><A NAME="ref_1829_34" HREF="terminal_interface-curses__ads.htm#ref_1507_34">Fmt</A></FONT>   : <A HREF="terminal_interface-curses__ads.htm#ref_1496_9">Label_Justification</A> := <A HREF="terminal_interface-curses__ads.htm#ref_1496_33">Left</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_1831_16">Slk_Set</A></FONT> (<FONT COLOR=red><A NAME="ref_1831_25" HREF="terminal_interface-curses__adb.htm#ref_1831_16">Label</A></FONT> : <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
                         <FONT COLOR=red><A NAME="ref_1832_25" HREF="terminal_interface-curses__adb.htm#ref_1831_16">Txt</A></FONT>   : char_array;
@@ -1868,7 +1868,7 @@
       <b>end</b> <b>if</b>;
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_1517_14">Refresh_Soft_Label_Keys_Without_Update</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1866_14" HREF="terminal_interface-curses__ads.htm#ref_1522_14">Get_Soft_Label_Key</A></FONT> (<FONT COLOR=red><A NAME="ref_1866_34" HREF="terminal_interface-curses__ads.htm#ref_1522_34">Label</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_1495_9">Label_Number</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1866_14" HREF="terminal_interface-curses__ads.htm#ref_1522_14">Get_Soft_Label_Key</A></FONT> (<FONT COLOR=red><A NAME="ref_1866_34" HREF="terminal_interface-curses__ads.htm#ref_1522_34">Label</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_1495_9">Label_Number</A>;
                                  <FONT COLOR=red><A NAME="ref_1867_34" HREF="terminal_interface-curses__ads.htm#ref_1523_34">Text</A></FONT>  : <b>out</b> String)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_1869_16">Slk_Label</A></FONT> (<FONT COLOR=red><A NAME="ref_1869_27" HREF="terminal_interface-curses__adb.htm#ref_1869_16">Label</A></FONT> : <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>) <b>return</b> chars_ptr;
@@ -1877,7 +1877,7 @@
       <A HREF="terminal_interface-curses-aux__ads.htm#ref_116_14">Fill_String</A> (<A HREF="terminal_interface-curses__adb.htm#ref_1869_16">Slk_Label</A> (<A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A> (<A HREF="terminal_interface-curses__ads.htm#ref_1522_34">Label</A>)), <A HREF="terminal_interface-curses__ads.htm#ref_1523_34">Text</A>);
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_1522_14">Get_Soft_Label_Key</A>;
 
-   <b>function</b> <FONT COLOR=red><A NAME="ref_1875_13" HREF="terminal_interface-curses__ads.htm#ref_1527_13">Get_Soft_Label_Key</A></FONT> (<FONT COLOR=red><A NAME="ref_1875_33" HREF="terminal_interface-curses__ads.htm#ref_1527_33">Label</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_1495_9">Label_Number</A>) <b>return</b> String
+   <b>function</b> <FONT COLOR=red><A NAME="ref_1875_13" HREF="terminal_interface-curses__ads.htm#ref_1527_13">Get_Soft_Label_Key</A></FONT> (<FONT COLOR=red><A NAME="ref_1875_33" HREF="terminal_interface-curses__ads.htm#ref_1527_33">Label</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_1495_9">Label_Number</A>) <b>return</b> String
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_1877_16">Slk_Label</A></FONT> (<FONT COLOR=red><A NAME="ref_1877_27" HREF="terminal_interface-curses__adb.htm#ref_1877_16">Label</A></FONT> : <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>) <b>return</b> chars_ptr;
       <b>pragma</b> Import (C, Slk_Label, "slk_label");
@@ -1916,8 +1916,8 @@
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_1543_14">Touch_Soft_Label_Keys</A>;
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_1913_14" HREF="terminal_interface-curses__ads.htm#ref_1548_14">Switch_Soft_Label_Key_Attributes</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_1914_7" HREF="terminal_interface-curses__ads.htm#ref_1549_7">Attr</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_307_9">Character_Attribute_Set</A>;
-      <FONT COLOR=red><A NAME="ref_1915_7" HREF="terminal_interface-curses__ads.htm#ref_1550_7">On</A></FONT>   : <b>in</b> Boolean := True)
+     (<FONT COLOR=red><A NAME="ref_1914_7" HREF="terminal_interface-curses__ads.htm#ref_1549_7">Attr</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_307_9">Character_Attribute_Set</A>;
+      <FONT COLOR=red><A NAME="ref_1915_7" HREF="terminal_interface-curses__ads.htm#ref_1550_7">On</A></FONT>   : Boolean := True)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_1917_16">Slk_Attron</A></FONT> (<FONT COLOR=red><A NAME="ref_1917_28" HREF="terminal_interface-curses__adb.htm#ref_1917_16">Ch</A></FONT> : <A HREF="terminal_interface-curses-aux__ads.htm#ref_63_12">C_Chtype</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
       <b>pragma</b> Import (C, Slk_Attron, "slk_attron");
@@ -1940,8 +1940,8 @@
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_1548_14">Switch_Soft_Label_Key_Attributes</A>;
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_1937_14" HREF="terminal_interface-curses__ads.htm#ref_1556_14">Set_Soft_Label_Key_Attributes</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_1938_7" HREF="terminal_interface-curses__ads.htm#ref_1557_7">Attr</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_307_9">Character_Attribute_Set</A> := <A HREF="terminal_interface-curses__ads.htm#ref_350_4">Normal_Video</A>;
-      <FONT COLOR=red><A NAME="ref_1939_7" HREF="terminal_interface-curses__ads.htm#ref_1558_7">Color</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A> := <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A>'First)
+     (<FONT COLOR=red><A NAME="ref_1938_7" HREF="terminal_interface-curses__ads.htm#ref_1557_7">Attr</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_307_9">Character_Attribute_Set</A> := <A HREF="terminal_interface-curses__ads.htm#ref_350_4">Normal_Video</A>;
+      <FONT COLOR=red><A NAME="ref_1939_7" HREF="terminal_interface-curses__ads.htm#ref_1558_7">Color</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A> := <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A>'First)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_1941_16">Slk_Attrset</A></FONT> (<FONT COLOR=red><A NAME="ref_1941_29" HREF="terminal_interface-curses__adb.htm#ref_1941_16">Ch</A></FONT> : <A HREF="terminal_interface-curses-aux__ads.htm#ref_63_12">C_Chtype</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
       <b>pragma</b> Import (C, Slk_Attrset, "slk_attrset");
@@ -1975,9 +1975,9 @@
       <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_75_4">Chtype_To_AttrChar</A> (<A HREF="terminal_interface-curses__adb.htm#ref_1968_7">Attr</A>).<A HREF="terminal_interface-curses__ads.htm#ref_355_10">Color</A>;
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_1567_13">Get_Soft_Label_Key_Attributes</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1973_14" HREF="terminal_interface-curses__ads.htm#ref_1572_14">Set_Soft_Label_Key_Color</A></FONT> (<FONT COLOR=red><A NAME="ref_1973_40" HREF="terminal_interface-curses__ads.htm#ref_1572_40">Pair</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1973_14" HREF="terminal_interface-curses__ads.htm#ref_1572_14">Set_Soft_Label_Key_Color</A></FONT> (<FONT COLOR=red><A NAME="ref_1973_40" HREF="terminal_interface-curses__ads.htm#ref_1572_40">Pair</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A>)
    <b>is</b>
-      <b>function</b> <FONT COLOR=red><A NAME="ref_1975_16">Slk_Color</A></FONT> (<FONT COLOR=red><A NAME="ref_1975_27" HREF="terminal_interface-curses__adb.htm#ref_1975_16">Color</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_56_12">C_Short</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
+      <b>function</b> <FONT COLOR=red><A NAME="ref_1975_16">Slk_Color</A></FONT> (<FONT COLOR=red><A NAME="ref_1975_27" HREF="terminal_interface-curses__adb.htm#ref_1975_16">Color</A></FONT> : <A HREF="terminal_interface-curses-aux__ads.htm#ref_56_12">C_Short</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
       <b>pragma</b> Import (C, Slk_Color, "slk_color");
    <b>begin</b>
       <b>if</b> <A HREF="terminal_interface-curses__adb.htm#ref_1975_16">Slk_Color</A> (<A HREF="terminal_interface-curses-aux__ads.htm#ref_56_12">C_Short</A> (<A HREF="terminal_interface-curses__ads.htm#ref_1572_40">Pair</A>)) = <A HREF="terminal_interface-curses-aux__ads.htm#ref_72_4">Curses_Err</A> <b>then</b>
@@ -1986,8 +1986,8 @@
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_1572_14">Set_Soft_Label_Key_Color</A>;
 
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1984_14" HREF="terminal_interface-curses__ads.htm#ref_1586_14">Enable_Key</A></FONT> (<FONT COLOR=red><A NAME="ref_1984_26" HREF="terminal_interface-curses__ads.htm#ref_1586_26">Key</A></FONT>    : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_78_12">Special_Key_Code</A>;
-                         <FONT COLOR=red><A NAME="ref_1985_26" HREF="terminal_interface-curses__ads.htm#ref_1587_26">Enable</A></FONT> : <b>in</b> Boolean := True)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1984_14" HREF="terminal_interface-curses__ads.htm#ref_1586_14">Enable_Key</A></FONT> (<FONT COLOR=red><A NAME="ref_1984_26" HREF="terminal_interface-curses__ads.htm#ref_1586_26">Key</A></FONT>    : <A HREF="terminal_interface-curses__ads.htm#ref_78_12">Special_Key_Code</A>;
+                         <FONT COLOR=red><A NAME="ref_1985_26" HREF="terminal_interface-curses__ads.htm#ref_1587_26">Enable</A></FONT> : Boolean := True)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_1987_16">Keyok</A></FONT> (<FONT COLOR=red><A NAME="ref_1987_23" HREF="terminal_interface-curses__adb.htm#ref_1987_16">Keycode</A></FONT> : <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
                       <FONT COLOR=red><A NAME="ref_1988_23" HREF="terminal_interface-curses__adb.htm#ref_1987_16">On_Off</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_1926_9">Curses_Bool</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
@@ -1999,8 +1999,8 @@
       <b>end</b> <b>if</b>;
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_1586_14">Enable_Key</A>;
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1997_14" HREF="terminal_interface-curses__ads.htm#ref_1596_14">Define_Key</A></FONT> (<FONT COLOR=red><A NAME="ref_1997_26" HREF="terminal_interface-curses__ads.htm#ref_1596_26">Definition</A></FONT> : <b>in</b> String;
-                         <FONT COLOR=red><A NAME="ref_1998_26" HREF="terminal_interface-curses__ads.htm#ref_1597_26">Key</A></FONT>        : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_78_12">Special_Key_Code</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1997_14" HREF="terminal_interface-curses__ads.htm#ref_1596_14">Define_Key</A></FONT> (<FONT COLOR=red><A NAME="ref_1997_26" HREF="terminal_interface-curses__ads.htm#ref_1596_26">Definition</A></FONT> : String;
+                         <FONT COLOR=red><A NAME="ref_1998_26" HREF="terminal_interface-curses__ads.htm#ref_1597_26">Key</A></FONT>        : <A HREF="terminal_interface-curses__ads.htm#ref_78_12">Special_Key_Code</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_2000_16">Defkey</A></FONT> (<FONT COLOR=red><A NAME="ref_2000_24" HREF="terminal_interface-curses__adb.htm#ref_2000_16">Def</A></FONT> : char_array;
                        <FONT COLOR=red><A NAME="ref_2001_24" HREF="terminal_interface-curses__adb.htm#ref_2000_16">Key</A></FONT> : <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
@@ -2015,7 +2015,7 @@
       <b>end</b> <b>if</b>;
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_1596_14">Define_Key</A>;
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_2013_14" HREF="terminal_interface-curses__ads.htm#ref_1622_14">Un_Control</A></FONT> (<FONT COLOR=red><A NAME="ref_2013_26" HREF="terminal_interface-curses__ads.htm#ref_1622_26">Ch</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_2013_14" HREF="terminal_interface-curses__ads.htm#ref_1622_14">Un_Control</A></FONT> (<FONT COLOR=red><A NAME="ref_2013_26" HREF="terminal_interface-curses__ads.htm#ref_1622_26">Ch</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A>;
                          <FONT COLOR=red><A NAME="ref_2014_26" HREF="terminal_interface-curses__ads.htm#ref_1623_26">Str</A></FONT> : <b>out</b> String)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_2016_16">Unctrl</A></FONT> (<FONT COLOR=red><A NAME="ref_2016_24" HREF="terminal_interface-curses__adb.htm#ref_2016_16">Ch</A></FONT> : <A HREF="terminal_interface-curses-aux__ads.htm#ref_63_12">C_Chtype</A>) <b>return</b> chars_ptr;
@@ -2024,7 +2024,7 @@
       <A HREF="terminal_interface-curses-aux__ads.htm#ref_116_14">Fill_String</A> (<A HREF="terminal_interface-curses__adb.htm#ref_2016_16">Unctrl</A> (<A HREF="terminal_interface-curses-aux__ads.htm#ref_75_4">AttrChar_To_Chtype</A> (<A HREF="terminal_interface-curses__ads.htm#ref_1622_26">Ch</A>)), <A HREF="terminal_interface-curses__ads.htm#ref_1623_26">Str</A>);
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_1622_14">Un_Control</A>;
 
-   <b>function</b> <FONT COLOR=red><A NAME="ref_2022_13" HREF="terminal_interface-curses__ads.htm#ref_1627_13">Un_Control</A></FONT> (<FONT COLOR=red><A NAME="ref_2022_25" HREF="terminal_interface-curses__ads.htm#ref_1627_25">Ch</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A>) <b>return</b> String
+   <b>function</b> <FONT COLOR=red><A NAME="ref_2022_13" HREF="terminal_interface-curses__ads.htm#ref_1627_13">Un_Control</A></FONT> (<FONT COLOR=red><A NAME="ref_2022_25" HREF="terminal_interface-curses__ads.htm#ref_1627_25">Ch</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A>) <b>return</b> String
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_2024_16">Unctrl</A></FONT> (<FONT COLOR=red><A NAME="ref_2024_24" HREF="terminal_interface-curses__adb.htm#ref_2024_16">Ch</A></FONT> : <A HREF="terminal_interface-curses-aux__ads.htm#ref_63_12">C_Chtype</A>) <b>return</b> chars_ptr;
       <b>pragma</b> Import (C, Unctrl, "unctrl");
@@ -2032,7 +2032,7 @@
       <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_121_13">Fill_String</A> (<A HREF="terminal_interface-curses__adb.htm#ref_2024_16">Unctrl</A> (<A HREF="terminal_interface-curses-aux__ads.htm#ref_75_4">AttrChar_To_Chtype</A> (<A HREF="terminal_interface-curses__ads.htm#ref_1627_25">Ch</A>)));
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_1627_13">Un_Control</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_2030_14" HREF="terminal_interface-curses__ads.htm#ref_1633_14">Delay_Output</A></FONT> (<FONT COLOR=red><A NAME="ref_2030_28" HREF="terminal_interface-curses__ads.htm#ref_1633_28">Msecs</A></FONT> : <b>in</b> Natural)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_2030_14" HREF="terminal_interface-curses__ads.htm#ref_1633_14">Delay_Output</A></FONT> (<FONT COLOR=red><A NAME="ref_2030_28" HREF="terminal_interface-curses__ads.htm#ref_1633_28">Msecs</A></FONT> : Natural)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_2032_16">Delayoutput</A></FONT> (<FONT COLOR=red><A NAME="ref_2032_29" HREF="terminal_interface-curses__adb.htm#ref_2032_16">Msecs</A></FONT> : <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
       <b>pragma</b> Import (C, Delayoutput, "delay_output");
@@ -2142,9 +2142,9 @@
       <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_121_13">Fill_String</A> (<A HREF="terminal_interface-curses__adb.htm#ref_2134_16">Termname</A>);
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_1691_13">Terminal_Name</A>;
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_2140_14" HREF="terminal_interface-curses__ads.htm#ref_1712_14">Init_Pair</A></FONT> (<FONT COLOR=red><A NAME="ref_2140_25" HREF="terminal_interface-curses__ads.htm#ref_1712_25">Pair</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_301_12">Redefinable_Color_Pair</A>;
-                        <FONT COLOR=red><A NAME="ref_2141_25" HREF="terminal_interface-curses__ads.htm#ref_1713_25">Fore</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_278_9">Color_Number</A>;
-                        <FONT COLOR=red><A NAME="ref_2142_25" HREF="terminal_interface-curses__ads.htm#ref_1714_25">Back</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_278_9">Color_Number</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_2140_14" HREF="terminal_interface-curses__ads.htm#ref_1712_14">Init_Pair</A></FONT> (<FONT COLOR=red><A NAME="ref_2140_25" HREF="terminal_interface-curses__ads.htm#ref_1712_25">Pair</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_301_12">Redefinable_Color_Pair</A>;
+                        <FONT COLOR=red><A NAME="ref_2141_25" HREF="terminal_interface-curses__ads.htm#ref_1713_25">Fore</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_278_9">Color_Number</A>;
+                        <FONT COLOR=red><A NAME="ref_2142_25" HREF="terminal_interface-curses__ads.htm#ref_1714_25">Back</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_278_9">Color_Number</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_2144_16">Initpair</A></FONT> (<FONT COLOR=red><A NAME="ref_2144_26" HREF="terminal_interface-curses__adb.htm#ref_2144_16">Pair</A></FONT> : <A HREF="terminal_interface-curses-aux__ads.htm#ref_56_12">C_Short</A>;
                          <FONT COLOR=red><A NAME="ref_2145_26" HREF="terminal_interface-curses__adb.htm#ref_2144_16">Fore</A></FONT> : <A HREF="terminal_interface-curses-aux__ads.htm#ref_56_12">C_Short</A>;
@@ -2164,7 +2164,7 @@
       <b>end</b> <b>if</b>;
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_1712_14">Init_Pair</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_2162_14" HREF="terminal_interface-curses__ads.htm#ref_1719_14">Pair_Content</A></FONT> (<FONT COLOR=red><A NAME="ref_2162_28" HREF="terminal_interface-curses__ads.htm#ref_1719_28">Pair</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_2162_14" HREF="terminal_interface-curses__ads.htm#ref_1719_14">Pair_Content</A></FONT> (<FONT COLOR=red><A NAME="ref_2162_28" HREF="terminal_interface-curses__ads.htm#ref_1719_28">Pair</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A>;
                            <FONT COLOR=red><A NAME="ref_2163_28" HREF="terminal_interface-curses__ads.htm#ref_1720_28">Fore</A></FONT> : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_278_9">Color_Number</A>;
                            <FONT COLOR=red><A NAME="ref_2164_28" HREF="terminal_interface-curses__ads.htm#ref_1721_28">Back</A></FONT> : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_278_9">Color_Number</A>)
    <b>is</b>
@@ -2196,10 +2196,10 @@
       <b>end</b> <b>if</b>;
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_1726_13">Has_Colors</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_2194_14" HREF="terminal_interface-curses__ads.htm#ref_1731_14">Init_Color</A></FONT> (<FONT COLOR=red><A NAME="ref_2194_26" HREF="terminal_interface-curses__ads.htm#ref_1731_26">Color</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_278_9">Color_Number</A>;
-                         <FONT COLOR=red><A NAME="ref_2195_26" HREF="terminal_interface-curses__ads.htm#ref_1732_26">Red</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_295_9">RGB_Value</A>;
-                         <FONT COLOR=red><A NAME="ref_2196_26" HREF="terminal_interface-curses__ads.htm#ref_1733_26">Green</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_295_9">RGB_Value</A>;
-                         <FONT COLOR=red><A NAME="ref_2197_26" HREF="terminal_interface-curses__ads.htm#ref_1734_26">Blue</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_295_9">RGB_Value</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_2194_14" HREF="terminal_interface-curses__ads.htm#ref_1731_14">Init_Color</A></FONT> (<FONT COLOR=red><A NAME="ref_2194_26" HREF="terminal_interface-curses__ads.htm#ref_1731_26">Color</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_278_9">Color_Number</A>;
+                         <FONT COLOR=red><A NAME="ref_2195_26" HREF="terminal_interface-curses__ads.htm#ref_1732_26">Red</A></FONT>   : <A HREF="terminal_interface-curses__ads.htm#ref_295_9">RGB_Value</A>;
+                         <FONT COLOR=red><A NAME="ref_2196_26" HREF="terminal_interface-curses__ads.htm#ref_1733_26">Green</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_295_9">RGB_Value</A>;
+                         <FONT COLOR=red><A NAME="ref_2197_26" HREF="terminal_interface-curses__ads.htm#ref_1734_26">Blue</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_295_9">RGB_Value</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_2199_16">Initcolor</A></FONT> (<FONT COLOR=red><A NAME="ref_2199_27" HREF="terminal_interface-curses__adb.htm#ref_2199_16">Col</A></FONT>   : <A HREF="terminal_interface-curses-aux__ads.htm#ref_56_12">C_Short</A>;
                           <FONT COLOR=red><A NAME="ref_2200_27" HREF="terminal_interface-curses__adb.htm#ref_2199_16">Red</A></FONT>   : <A HREF="terminal_interface-curses-aux__ads.htm#ref_56_12">C_Short</A>;
@@ -2225,7 +2225,7 @@
       <b>end</b> <b>if</b>;
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_1739_13">Can_Change_Color</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_2223_14" HREF="terminal_interface-curses__ads.htm#ref_1744_14">Color_Content</A></FONT> (<FONT COLOR=red><A NAME="ref_2223_29" HREF="terminal_interface-curses__ads.htm#ref_1744_29">Color</A></FONT> : <b>in</b>  <A HREF="terminal_interface-curses__ads.htm#ref_278_9">Color_Number</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_2223_14" HREF="terminal_interface-curses__ads.htm#ref_1744_14">Color_Content</A></FONT> (<FONT COLOR=red><A NAME="ref_2223_29" HREF="terminal_interface-curses__ads.htm#ref_1744_29">Color</A></FONT> :  <A HREF="terminal_interface-curses__ads.htm#ref_278_9">Color_Number</A>;
                             <FONT COLOR=red><A NAME="ref_2224_29" HREF="terminal_interface-curses__ads.htm#ref_1745_29">Red</A></FONT>   : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_295_9">RGB_Value</A>;
                             <FONT COLOR=red><A NAME="ref_2225_29" HREF="terminal_interface-curses__ads.htm#ref_1746_29">Green</A></FONT> : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_295_9">RGB_Value</A>;
                             <FONT COLOR=red><A NAME="ref_2226_29" HREF="terminal_interface-curses__ads.htm#ref_1747_29">Blue</A></FONT>  : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_295_9">RGB_Value</A>)
@@ -2249,7 +2249,7 @@
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_1744_14">Color_Content</A>;
 
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_2247_14" HREF="terminal_interface-curses__ads.htm#ref_1759_14">Save_Curses_Mode</A></FONT> (<FONT COLOR=red><A NAME="ref_2247_32" HREF="terminal_interface-curses__ads.htm#ref_1759_32">Mode</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_1756_9">Curses_Mode</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_2247_14" HREF="terminal_interface-curses__ads.htm#ref_1759_14">Save_Curses_Mode</A></FONT> (<FONT COLOR=red><A NAME="ref_2247_32" HREF="terminal_interface-curses__ads.htm#ref_1759_32">Mode</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_1756_9">Curses_Mode</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_2249_16">Def_Prog_Mode</A></FONT> <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
       <b>pragma</b> Import (C, Def_Prog_Mode, "def_prog_mode");
@@ -2267,7 +2267,7 @@
       <b>end</b> <b>if</b>;
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_1759_14">Save_Curses_Mode</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_2265_14" HREF="terminal_interface-curses__ads.htm#ref_1765_14">Reset_Curses_Mode</A></FONT> (<FONT COLOR=red><A NAME="ref_2265_33" HREF="terminal_interface-curses__ads.htm#ref_1765_33">Mode</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_1756_9">Curses_Mode</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_2265_14" HREF="terminal_interface-curses__ads.htm#ref_1765_14">Reset_Curses_Mode</A></FONT> (<FONT COLOR=red><A NAME="ref_2265_33" HREF="terminal_interface-curses__ads.htm#ref_1765_33">Mode</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_1756_9">Curses_Mode</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_2267_16">Reset_Prog_Mode</A></FONT> <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
       <b>pragma</b> Import (C, Reset_Prog_Mode, "reset_prog_mode");
@@ -2305,8 +2305,8 @@
       <b>end</b> <b>if</b>;
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_1776_14">Reset_Terminal_State</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_2303_14" HREF="terminal_interface-curses__ads.htm#ref_1789_14">Rip_Off_Lines</A></FONT> (<FONT COLOR=red><A NAME="ref_2303_29" HREF="terminal_interface-curses__ads.htm#ref_1789_29">Lines</A></FONT> : <b>in</b> Integer;
-                            <FONT COLOR=red><A NAME="ref_2304_29" HREF="terminal_interface-curses__ads.htm#ref_1790_29">Proc</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_1780_9">Stdscr_Init_Proc</A>)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_2303_14" HREF="terminal_interface-curses__ads.htm#ref_1789_14">Rip_Off_Lines</A></FONT> (<FONT COLOR=red><A NAME="ref_2303_29" HREF="terminal_interface-curses__ads.htm#ref_1789_29">Lines</A></FONT> : Integer;
+                            <FONT COLOR=red><A NAME="ref_2304_29" HREF="terminal_interface-curses__ads.htm#ref_1790_29">Proc</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_1780_9">Stdscr_Init_Proc</A>)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_2306_16">Ripoffline</A></FONT> (<FONT COLOR=red><A NAME="ref_2306_28" HREF="terminal_interface-curses__adb.htm#ref_2306_16">Lines</A></FONT> : <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
                            <FONT COLOR=red><A NAME="ref_2307_28" HREF="terminal_interface-curses__adb.htm#ref_2306_16">Proc</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_1780_9">Stdscr_Init_Proc</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
@@ -2330,7 +2330,7 @@
       <b>end</b> <b>if</b>;
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_1801_14">Set_Cursor_Visibility</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_2328_14" HREF="terminal_interface-curses__ads.htm#ref_1806_14">Nap_Milli_Seconds</A></FONT> (<FONT COLOR=red><A NAME="ref_2328_33" HREF="terminal_interface-curses__ads.htm#ref_1806_33">Ms</A></FONT> : <b>in</b> Natural)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_2328_14" HREF="terminal_interface-curses__ads.htm#ref_1806_14">Nap_Milli_Seconds</A></FONT> (<FONT COLOR=red><A NAME="ref_2328_33" HREF="terminal_interface-curses__ads.htm#ref_1806_33">Ms</A></FONT> : Natural)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_2330_16">Napms</A></FONT> (<FONT COLOR=red><A NAME="ref_2330_23" HREF="terminal_interface-curses__adb.htm#ref_2330_16">Ms</A></FONT> : <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
       <b>pragma</b> Import (C, Napms, "napms");
@@ -2399,10 +2399,10 @@
 
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_2396_14" HREF="terminal_interface-curses__ads.htm#ref_1814_14">Transform_Coordinates</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_2397_7" HREF="terminal_interface-curses__ads.htm#ref_1815_7">W</A></FONT>      : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+     (<FONT COLOR=red><A NAME="ref_2397_7" HREF="terminal_interface-curses__ads.htm#ref_1815_7">W</A></FONT>      : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
       <FONT COLOR=red><A NAME="ref_2398_7" HREF="terminal_interface-curses__ads.htm#ref_1816_7">Line</A></FONT>   : <b>in</b> <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
       <FONT COLOR=red><A NAME="ref_2399_7" HREF="terminal_interface-curses__ads.htm#ref_1817_7">Column</A></FONT> : <b>in</b> <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
-      <FONT COLOR=red><A NAME="ref_2400_7" HREF="terminal_interface-curses__ads.htm#ref_1818_7">Dir</A></FONT>    : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_1813_9">Transform_Direction</A> := <A HREF="terminal_interface-curses__ads.htm#ref_1813_33">From_Screen</A>)
+      <FONT COLOR=red><A NAME="ref_2400_7" HREF="terminal_interface-curses__ads.htm#ref_1818_7">Dir</A></FONT>    : <A HREF="terminal_interface-curses__ads.htm#ref_1813_9">Transform_Direction</A> := <A HREF="terminal_interface-curses__ads.htm#ref_1813_33">From_Screen</A>)
    <b>is</b>
       <b>type</b> <FONT COLOR=red><A NAME="ref_2402_12">Int_Access</A></FONT> <b>is</b> <b>access</b> <b>all</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
       <b>function</b> <FONT COLOR=red><A NAME="ref_2403_16">Transform</A></FONT> (<FONT COLOR=red><A NAME="ref_2403_27" HREF="terminal_interface-curses__adb.htm#ref_2403_16">W</A></FONT>    : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
@@ -2490,7 +2490,7 @@
       <b>end</b> <b>if</b>;
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_1851_13">Use_Extended_Names</A>;
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_2488_14" HREF="terminal_interface-curses__ads.htm#ref_1867_14">Screen_Dump_To_File</A></FONT> (<FONT COLOR=red><A NAME="ref_2488_35" HREF="terminal_interface-curses__ads.htm#ref_1867_35">Filename</A></FONT> : <b>in</b> String)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_2488_14" HREF="terminal_interface-curses__ads.htm#ref_1867_14">Screen_Dump_To_File</A></FONT> (<FONT COLOR=red><A NAME="ref_2488_35" HREF="terminal_interface-curses__ads.htm#ref_1867_35">Filename</A></FONT> : String)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_2490_16">scr_dump</A></FONT> (<FONT COLOR=red><A NAME="ref_2490_26" HREF="terminal_interface-curses__adb.htm#ref_2490_16">f</A></FONT> : char_array) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
       <b>pragma</b> Import (C, scr_dump, "scr_dump");
@@ -2503,7 +2503,7 @@
       <b>end</b> <b>if</b>;
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_1867_14">Screen_Dump_To_File</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_2501_14" HREF="terminal_interface-curses__ads.htm#ref_1871_14">Screen_Restore_From_File</A></FONT> (<FONT COLOR=red><A NAME="ref_2501_40" HREF="terminal_interface-curses__ads.htm#ref_1871_40">Filename</A></FONT> : <b>in</b> String)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_2501_14" HREF="terminal_interface-curses__ads.htm#ref_1871_14">Screen_Restore_From_File</A></FONT> (<FONT COLOR=red><A NAME="ref_2501_40" HREF="terminal_interface-curses__ads.htm#ref_1871_40">Filename</A></FONT> : String)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_2503_16">scr_restore</A></FONT> (<FONT COLOR=red><A NAME="ref_2503_29" HREF="terminal_interface-curses__adb.htm#ref_2503_16">f</A></FONT> : char_array) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
       <b>pragma</b> Import (C, scr_restore, "scr_restore");
@@ -2516,7 +2516,7 @@
       <b>end</b> <b>if</b>;
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_1871_14">Screen_Restore_From_File</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_2514_14" HREF="terminal_interface-curses__ads.htm#ref_1875_14">Screen_Init_From_File</A></FONT> (<FONT COLOR=red><A NAME="ref_2514_37" HREF="terminal_interface-curses__ads.htm#ref_1875_37">Filename</A></FONT> : <b>in</b> String)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_2514_14" HREF="terminal_interface-curses__ads.htm#ref_1875_14">Screen_Init_From_File</A></FONT> (<FONT COLOR=red><A NAME="ref_2514_37" HREF="terminal_interface-curses__ads.htm#ref_1875_37">Filename</A></FONT> : String)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_2516_16">scr_init</A></FONT> (<FONT COLOR=red><A NAME="ref_2516_26" HREF="terminal_interface-curses__adb.htm#ref_2516_16">f</A></FONT> : char_array) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
       <b>pragma</b> Import (C, scr_init, "scr_init");
@@ -2529,7 +2529,7 @@
       <b>end</b> <b>if</b>;
    <b>end</b> <A HREF="terminal_interface-curses__ads.htm#ref_1875_14">Screen_Init_From_File</A>;
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_2527_14" HREF="terminal_interface-curses__ads.htm#ref_1879_14">Screen_Set_File</A></FONT> (<FONT COLOR=red><A NAME="ref_2527_31" HREF="terminal_interface-curses__ads.htm#ref_1879_31">Filename</A></FONT> : <b>in</b> String)
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_2527_14" HREF="terminal_interface-curses__ads.htm#ref_1879_14">Screen_Set_File</A></FONT> (<FONT COLOR=red><A NAME="ref_2527_31" HREF="terminal_interface-curses__ads.htm#ref_1879_31">Filename</A></FONT> : String)
    <b>is</b>
       <b>function</b> <FONT COLOR=red><A NAME="ref_2529_16">scr_set</A></FONT> (<FONT COLOR=red><A NAME="ref_2529_25" HREF="terminal_interface-curses__adb.htm#ref_2529_16">f</A></FONT> : char_array) <b>return</b> <A HREF="terminal_interface-curses-aux__ads.htm#ref_55_12">C_Int</A>;
       <b>pragma</b> Import (C, scr_set, "scr_set");
diff -Naur ncurses-5.7.orig/doc/html/ada/terminal_interface-curses__ads.htm ncurses-5.7/doc/html/ada/terminal_interface-curses__ads.htm
--- ncurses-5.7.orig/doc/html/ada/terminal_interface-curses__ads.htm	2008-10-11 17:36:30.000000000 -0400
+++ ncurses-5.7/doc/html/ada/terminal_interface-curses__ads.htm	2011-01-08 18:13:50.395157542 -0500
@@ -12,7 +12,7 @@
 <FONT COLOR=green><EM>--                                 S P E C                                  --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
-<FONT COLOR=green><EM>-- Copyright (c) 1998-2006,2007 Free Software Foundation, Inc.              --</EM></FONT>
+<FONT COLOR=green><EM>-- Copyright (c) 1998-2007,2009 Free Software Foundation, Inc.              --</EM></FONT>
 <FONT COLOR=green><EM>--                                                                          --</EM></FONT>
 <FONT COLOR=green><EM>-- Permission is hereby granted, free of charge, to any person obtaining a  --</EM></FONT>
 <FONT COLOR=green><EM>-- copy of this software and associated documentation files (the            --</EM></FONT>
@@ -40,8 +40,8 @@
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <FONT COLOR=green><EM>--  Author:  Juergen Pfeifer, 1996</EM></FONT>
 <FONT COLOR=green><EM>--  Version Control:</EM></FONT>
-<FONT COLOR=green><EM>--  @Revision: 1.41 @</EM></FONT>
-<FONT COLOR=green><EM>--  @Date: 2007/05/05 20:33:52 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Revision: 1.42 @</EM></FONT>
+<FONT COLOR=green><EM>--  @Date: 2009/12/26 17:38:58 @</EM></FONT>
 <FONT COLOR=green><EM>--  Binding Version 01.00</EM></FONT>
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 <FONT COLOR=green><EM>--  curses binding.</EM></FONT>
@@ -49,15 +49,15 @@
 <FONT COLOR=green><EM>--  Run the generator instead.</EM></FONT>
 <FONT COLOR=green><EM>--  |</EM></FONT>
 <b>with</b> System.Storage_Elements;
-<b>with</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C;   <FONT COLOR=green><EM>--  We need this for some assertions.</EM></FONT>
+<b>with</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C;   <FONT COLOR=green><EM>--  We need this for some assertions.</EM></FONT>
 
 <b>package</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<FONT COLOR=red><A NAME="ref_49_28" HREF="terminal_interface-curses__adb.htm#ref_50_33">Curses</A></FONT> <b>is</b>
    <b>pragma</b> Preelaborate (<A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>);
-   <b>pragma</b> Linker_Options ("-lncursesw");
+   <b>pragma</b> Linker_Options ("-lncurses");
 
    <FONT COLOR=red><A NAME="ref_53_4">NC_Major_Version</A></FONT> : <b>constant</b> := 5; <FONT COLOR=green><EM>--  Major version of the library</EM></FONT>
-   <FONT COLOR=red><A NAME="ref_54_4">NC_Minor_Version</A></FONT> : <b>constant</b> := 6; <FONT COLOR=green><EM>--  Minor version of the library</EM></FONT>
-   <FONT COLOR=red><A NAME="ref_55_4">NC_Version</A></FONT> : <b>constant</b> String := "5.6";  <FONT COLOR=green><EM>--  Version of library</EM></FONT>
+   <FONT COLOR=red><A NAME="ref_54_4">NC_Minor_Version</A></FONT> : <b>constant</b> := 7; <FONT COLOR=green><EM>--  Minor version of the library</EM></FONT>
+   <FONT COLOR=red><A NAME="ref_55_4">NC_Version</A></FONT> : <b>constant</b> String := "5.7";  <FONT COLOR=green><EM>--  Version of library</EM></FONT>
 
    <b>type</b> <FONT COLOR=red><A NAME="ref_57_9">Window</A></FONT> <b>is</b> <b>private</b>;
    <FONT COLOR=red><A NAME="ref_58_4">Null_Window</A></FONT> : <b>constant</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
@@ -280,8 +280,8 @@
 
 <FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
 
-   <b>type</b> <FONT COLOR=red><A NAME="ref_278_9">Color_Number</A></FONT> <b>is</b> <b>range</b> -1 .. Integer (<A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C.short'Last);
-   <b>for</b> <A HREF="terminal_interface-curses__ads.htm#ref_278_9">Color_Number</A>'Size <b>use</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C.short'Size;
+   <b>type</b> <FONT COLOR=red><A NAME="ref_278_9">Color_Number</A></FONT> <b>is</b> <b>range</b> -1 .. Integer (<A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C.short'Last);
+   <b>for</b> <A HREF="terminal_interface-curses__ads.htm#ref_278_9">Color_Number</A>'Size <b>use</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C.short'Size;
    <FONT COLOR=green><EM>--  (n)curses uses a short for the color index</EM></FONT>
    <FONT COLOR=green><EM>--  The model is, that a Color_Number is an index into an array of</EM></FONT>
    <FONT COLOR=green><EM>--  (potentially) definable colors. Some of those indices are</EM></FONT>
@@ -297,8 +297,8 @@
    <FONT COLOR=red><A NAME="ref_292_4">Cyan</A></FONT>             : <b>constant</b> <A HREF="terminal_interface-curses__ads.htm#ref_278_9">Color_Number</A> := 6;
    <FONT COLOR=red><A NAME="ref_293_4">White</A></FONT>            : <b>constant</b> <A HREF="terminal_interface-curses__ads.htm#ref_278_9">Color_Number</A> := 7;
 
-   <b>type</b> <FONT COLOR=red><A NAME="ref_295_9">RGB_Value</A></FONT> <b>is</b> <b>range</b> 0 .. Integer (<A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C.short'Last);
-   <b>for</b> <A HREF="terminal_interface-curses__ads.htm#ref_295_9">RGB_Value</A>'Size <b>use</b> <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C.short'Size;
+   <b>type</b> <FONT COLOR=red><A NAME="ref_295_9">RGB_Value</A></FONT> <b>is</b> <b>range</b> 0 .. Integer (<A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C.short'Last);
+   <b>for</b> <A HREF="terminal_interface-curses__ads.htm#ref_295_9">RGB_Value</A>'Size <b>use</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C.short'Size;
    <FONT COLOR=green><EM>--  Some system may allow to redefine a color by setting RGB values.</EM></FONT>
 
    <b>type</b> <FONT COLOR=red><A NAME="ref_299_9">Color_Pair</A></FONT> <b>is</b> <b>range</b> 0 .. 255;
@@ -513,9 +513,9 @@
    <FONT COLOR=green><EM>--  |=====================================================================</EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_7"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_511_14" HREF="terminal_interface-curses__adb.htm#ref_133_14">Move_Cursor</A></FONT> (<FONT COLOR=red><A NAME="ref_511_27" HREF="terminal_interface-curses__adb.htm#ref_133_27">Win</A></FONT>    : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-                          <FONT COLOR=red><A NAME="ref_512_27" HREF="terminal_interface-curses__adb.htm#ref_134_27">Line</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
-                          <FONT COLOR=red><A NAME="ref_513_27" HREF="terminal_interface-curses__adb.htm#ref_135_27">Column</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_511_14" HREF="terminal_interface-curses__adb.htm#ref_133_14">Move_Cursor</A></FONT> (<FONT COLOR=red><A NAME="ref_511_27" HREF="terminal_interface-curses__adb.htm#ref_133_27">Win</A></FONT>    : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+                          <FONT COLOR=red><A NAME="ref_512_27" HREF="terminal_interface-curses__adb.htm#ref_134_27">Line</A></FONT>   : <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
+                          <FONT COLOR=red><A NAME="ref_513_27" HREF="terminal_interface-curses__adb.htm#ref_135_27">Column</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_move.3x.html">wmove()</A></EM></FONT>
    <FONT COLOR=green><EM>--  AKA: move()</EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses__ads.htm#ref_511_14">Move_Cursor</A>);
@@ -525,43 +525,43 @@
    <FONT COLOR=green><EM>--  |=====================================================================</EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_8"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_523_14" HREF="terminal_interface-curses__adb.htm#ref_148_14">Add</A></FONT> (<FONT COLOR=red><A NAME="ref_523_19" HREF="terminal_interface-curses__adb.htm#ref_148_19">Win</A></FONT> :  <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-                  <FONT COLOR=red><A NAME="ref_524_19" HREF="terminal_interface-curses__adb.htm#ref_149_19">Ch</A></FONT>  :  <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_523_14" HREF="terminal_interface-curses__adb.htm#ref_148_14">Add</A></FONT> (<FONT COLOR=red><A NAME="ref_523_19" HREF="terminal_interface-curses__adb.htm#ref_148_19">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+                  <FONT COLOR=red><A NAME="ref_524_19" HREF="terminal_interface-curses__adb.htm#ref_149_19">Ch</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_addch.3x.html">waddch()</A></EM></FONT>
    <FONT COLOR=green><EM>--  AKA: addch()</EM></FONT>
 
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_528_14" HREF="terminal_interface-curses__adb.htm#ref_160_14">Add</A></FONT> (<FONT COLOR=red><A NAME="ref_528_19" HREF="terminal_interface-curses__adb.htm#ref_160_19">Win</A></FONT> :  <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-                  <FONT COLOR=red><A NAME="ref_529_19" HREF="terminal_interface-curses__adb.htm#ref_161_19">Ch</A></FONT>  :  <b>in</b> Character);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_528_14" HREF="terminal_interface-curses__adb.htm#ref_160_14">Add</A></FONT> (<FONT COLOR=red><A NAME="ref_528_19" HREF="terminal_interface-curses__adb.htm#ref_160_19">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+                  <FONT COLOR=red><A NAME="ref_529_19" HREF="terminal_interface-curses__adb.htm#ref_161_19">Ch</A></FONT>  : Character);
    <FONT COLOR=green><EM>--  Add a single character at the current logical cursor position to</EM></FONT>
    <FONT COLOR=green><EM>--  the window. Use the current windows attributes.</EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_9"#2|</EM></FONT>
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_534_14" HREF="terminal_interface-curses__adb.htm#ref_170_14">Add</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_535_7" HREF="terminal_interface-curses__adb.htm#ref_171_7">Win</A></FONT>    : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-      <FONT COLOR=red><A NAME="ref_536_7" HREF="terminal_interface-curses__adb.htm#ref_172_7">Line</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
-      <FONT COLOR=red><A NAME="ref_537_7" HREF="terminal_interface-curses__adb.htm#ref_173_7">Column</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
-      <FONT COLOR=red><A NAME="ref_538_7" HREF="terminal_interface-curses__adb.htm#ref_174_7">Ch</A></FONT>     : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A>);
+     (<FONT COLOR=red><A NAME="ref_535_7" HREF="terminal_interface-curses__adb.htm#ref_171_7">Win</A></FONT>    : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+      <FONT COLOR=red><A NAME="ref_536_7" HREF="terminal_interface-curses__adb.htm#ref_172_7">Line</A></FONT>   : <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
+      <FONT COLOR=red><A NAME="ref_537_7" HREF="terminal_interface-curses__adb.htm#ref_173_7">Column</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
+      <FONT COLOR=red><A NAME="ref_538_7" HREF="terminal_interface-curses__adb.htm#ref_174_7">Ch</A></FONT>     : <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_addch.3x.html">mvwaddch()</A></EM></FONT>
    <FONT COLOR=green><EM>--  AKA: mvaddch()</EM></FONT>
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_542_14" HREF="terminal_interface-curses__adb.htm#ref_189_14">Add</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_543_7" HREF="terminal_interface-curses__adb.htm#ref_190_7">Win</A></FONT>    : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-      <FONT COLOR=red><A NAME="ref_544_7" HREF="terminal_interface-curses__adb.htm#ref_191_7">Line</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
-      <FONT COLOR=red><A NAME="ref_545_7" HREF="terminal_interface-curses__adb.htm#ref_192_7">Column</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
-      <FONT COLOR=red><A NAME="ref_546_7" HREF="terminal_interface-curses__adb.htm#ref_193_7">Ch</A></FONT>     : <b>in</b> Character);
+     (<FONT COLOR=red><A NAME="ref_543_7" HREF="terminal_interface-curses__adb.htm#ref_190_7">Win</A></FONT>    : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+      <FONT COLOR=red><A NAME="ref_544_7" HREF="terminal_interface-curses__adb.htm#ref_191_7">Line</A></FONT>   : <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
+      <FONT COLOR=red><A NAME="ref_545_7" HREF="terminal_interface-curses__adb.htm#ref_192_7">Column</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
+      <FONT COLOR=red><A NAME="ref_546_7" HREF="terminal_interface-curses__adb.htm#ref_193_7">Ch</A></FONT>     : Character);
    <FONT COLOR=green><EM>--  Move to the position and add a single character into the window</EM></FONT>
    <FONT COLOR=green><EM>--  There are more Add routines, so the Inline pragma follows later</EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_10"#2|</EM></FONT>
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_551_14" HREF="terminal_interface-curses__adb.htm#ref_204_14">Add_With_Immediate_Echo</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_552_7" HREF="terminal_interface-curses__adb.htm#ref_205_7">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-      <FONT COLOR=red><A NAME="ref_553_7" HREF="terminal_interface-curses__adb.htm#ref_206_7">Ch</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A>);
+     (<FONT COLOR=red><A NAME="ref_552_7" HREF="terminal_interface-curses__adb.htm#ref_205_7">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+      <FONT COLOR=red><A NAME="ref_553_7" HREF="terminal_interface-curses__adb.htm#ref_206_7">Ch</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_addch.3x.html">wechochar()</A></EM></FONT>
    <FONT COLOR=green><EM>--  AKA: echochar()</EM></FONT>
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_557_14" HREF="terminal_interface-curses__adb.htm#ref_217_14">Add_With_Immediate_Echo</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_558_7" HREF="terminal_interface-curses__adb.htm#ref_218_7">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-      <FONT COLOR=red><A NAME="ref_559_7" HREF="terminal_interface-curses__adb.htm#ref_219_7">Ch</A></FONT>  : <b>in</b> Character);
+     (<FONT COLOR=red><A NAME="ref_558_7" HREF="terminal_interface-curses__adb.htm#ref_218_7">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+      <FONT COLOR=red><A NAME="ref_559_7" HREF="terminal_interface-curses__adb.htm#ref_219_7">Ch</A></FONT>  : Character);
    <FONT COLOR=green><EM>--  Add a character and do an immediate refresh of the screen.</EM></FONT>
    <b>pragma</b> Inline (Add_With_Immediate_Echo);
 
@@ -621,32 +621,32 @@
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses__ads.htm#ref_614_13">Duplicate</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_16"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_619_14" HREF="terminal_interface-curses__adb.htm#ref_332_14">Move_Window</A></FONT> (<FONT COLOR=red><A NAME="ref_619_27" HREF="terminal_interface-curses__adb.htm#ref_332_27">Win</A></FONT>    : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
-                          <FONT COLOR=red><A NAME="ref_620_27" HREF="terminal_interface-curses__adb.htm#ref_333_27">Line</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
-                          <FONT COLOR=red><A NAME="ref_621_27" HREF="terminal_interface-curses__adb.htm#ref_334_27">Column</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_619_14" HREF="terminal_interface-curses__adb.htm#ref_332_14">Move_Window</A></FONT> (<FONT COLOR=red><A NAME="ref_619_27" HREF="terminal_interface-curses__adb.htm#ref_332_27">Win</A></FONT>    : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
+                          <FONT COLOR=red><A NAME="ref_620_27" HREF="terminal_interface-curses__adb.htm#ref_333_27">Line</A></FONT>   : <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
+                          <FONT COLOR=red><A NAME="ref_621_27" HREF="terminal_interface-curses__adb.htm#ref_334_27">Column</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_window.3x.html">mvwin()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses__ads.htm#ref_619_14">Move_Window</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_17"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_626_14" HREF="terminal_interface-curses__adb.htm#ref_346_14">Move_Derived_Window</A></FONT> (<FONT COLOR=red><A NAME="ref_626_35" HREF="terminal_interface-curses__adb.htm#ref_346_35">Win</A></FONT>    : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
-                                  <FONT COLOR=red><A NAME="ref_627_35" HREF="terminal_interface-curses__adb.htm#ref_347_35">Line</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
-                                  <FONT COLOR=red><A NAME="ref_628_35" HREF="terminal_interface-curses__adb.htm#ref_348_35">Column</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_626_14" HREF="terminal_interface-curses__adb.htm#ref_346_14">Move_Derived_Window</A></FONT> (<FONT COLOR=red><A NAME="ref_626_35" HREF="terminal_interface-curses__adb.htm#ref_346_35">Win</A></FONT>    : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
+                                  <FONT COLOR=red><A NAME="ref_627_35" HREF="terminal_interface-curses__adb.htm#ref_347_35">Line</A></FONT>   : <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
+                                  <FONT COLOR=red><A NAME="ref_628_35" HREF="terminal_interface-curses__adb.htm#ref_348_35">Column</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_window.3x.html">mvderwin()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses__ads.htm#ref_626_14">Move_Derived_Window</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_18"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_633_14">Synchronize_Upwards</A></FONT> (<FONT COLOR=red><A NAME="ref_633_35" HREF="terminal_interface-curses__ads.htm#ref_633_14">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_633_14">Synchronize_Upwards</A></FONT> (<FONT COLOR=red><A NAME="ref_633_35" HREF="terminal_interface-curses__ads.htm#ref_633_14">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_window.3x.html">wsyncup()</A></EM></FONT>
    <b>pragma</b> Import (C, Synchronize_Upwards, "wsyncup");
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_19"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_638_14">Synchronize_Downwards</A></FONT> (<FONT COLOR=red><A NAME="ref_638_37" HREF="terminal_interface-curses__ads.htm#ref_638_14">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_638_14">Synchronize_Downwards</A></FONT> (<FONT COLOR=red><A NAME="ref_638_37" HREF="terminal_interface-curses__ads.htm#ref_638_14">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_window.3x.html">wsyncdown()</A></EM></FONT>
    <b>pragma</b> Import (C, Synchronize_Downwards, "wsyncdown");
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_20"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_643_14" HREF="terminal_interface-curses__adb.htm#ref_360_14">Set_Synch_Mode</A></FONT> (<FONT COLOR=red><A NAME="ref_643_30" HREF="terminal_interface-curses__adb.htm#ref_360_30">Win</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-                             <FONT COLOR=red><A NAME="ref_644_30" HREF="terminal_interface-curses__adb.htm#ref_361_30">Mode</A></FONT> : <b>in</b> Boolean := False);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_643_14" HREF="terminal_interface-curses__adb.htm#ref_360_14">Set_Synch_Mode</A></FONT> (<FONT COLOR=red><A NAME="ref_643_30" HREF="terminal_interface-curses__adb.htm#ref_360_30">Win</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+                             <FONT COLOR=red><A NAME="ref_644_30" HREF="terminal_interface-curses__adb.htm#ref_361_30">Mode</A></FONT> : Boolean := False);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_window.3x.html">syncok()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses__ads.htm#ref_643_14">Set_Synch_Mode</A>);
 
@@ -655,20 +655,20 @@
    <FONT COLOR=green><EM>--  |=====================================================================</EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_21"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_653_14" HREF="terminal_interface-curses__adb.htm#ref_372_14">Add</A></FONT> (<FONT COLOR=red><A NAME="ref_653_19" HREF="terminal_interface-curses__adb.htm#ref_372_19">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-                  <FONT COLOR=red><A NAME="ref_654_19" HREF="terminal_interface-curses__adb.htm#ref_373_19">Str</A></FONT> : <b>in</b> String;
-                  <FONT COLOR=red><A NAME="ref_655_19" HREF="terminal_interface-curses__adb.htm#ref_374_19">Len</A></FONT> : <b>in</b> Integer := -1);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_653_14" HREF="terminal_interface-curses__adb.htm#ref_372_14">Add</A></FONT> (<FONT COLOR=red><A NAME="ref_653_19" HREF="terminal_interface-curses__adb.htm#ref_372_19">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+                  <FONT COLOR=red><A NAME="ref_654_19" HREF="terminal_interface-curses__adb.htm#ref_373_19">Str</A></FONT> : String;
+                  <FONT COLOR=red><A NAME="ref_655_19" HREF="terminal_interface-curses__adb.htm#ref_374_19">Len</A></FONT> : Integer := -1);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_addstr.3x.html">waddnstr()</A></EM></FONT>
    <FONT COLOR=green><EM>--  AKA: waddstr()</EM></FONT>
    <FONT COLOR=green><EM>--  AKA: addnstr()</EM></FONT>
    <FONT COLOR=green><EM>--  AKA: addstr()</EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_22"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_662_14" HREF="terminal_interface-curses__adb.htm#ref_390_14">Add</A></FONT> (<FONT COLOR=red><A NAME="ref_662_19" HREF="terminal_interface-curses__adb.htm#ref_391_7">Win</A></FONT>    : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-                  <FONT COLOR=red><A NAME="ref_663_19" HREF="terminal_interface-curses__adb.htm#ref_392_7">Line</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
-                  <FONT COLOR=red><A NAME="ref_664_19" HREF="terminal_interface-curses__adb.htm#ref_393_7">Column</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
-                  <FONT COLOR=red><A NAME="ref_665_19" HREF="terminal_interface-curses__adb.htm#ref_394_7">Str</A></FONT>    : <b>in</b> String;
-                  <FONT COLOR=red><A NAME="ref_666_19" HREF="terminal_interface-curses__adb.htm#ref_395_7">Len</A></FONT>    : <b>in</b> Integer := -1);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_662_14" HREF="terminal_interface-curses__adb.htm#ref_390_14">Add</A></FONT> (<FONT COLOR=red><A NAME="ref_662_19" HREF="terminal_interface-curses__adb.htm#ref_391_7">Win</A></FONT>    : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+                  <FONT COLOR=red><A NAME="ref_663_19" HREF="terminal_interface-curses__adb.htm#ref_392_7">Line</A></FONT>   : <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
+                  <FONT COLOR=red><A NAME="ref_664_19" HREF="terminal_interface-curses__adb.htm#ref_393_7">Column</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
+                  <FONT COLOR=red><A NAME="ref_665_19" HREF="terminal_interface-curses__adb.htm#ref_394_7">Str</A></FONT>    : String;
+                  <FONT COLOR=red><A NAME="ref_666_19" HREF="terminal_interface-curses__adb.htm#ref_395_7">Len</A></FONT>    : Integer := -1);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_addstr.3x.html">mvwaddnstr()</A></EM></FONT>
    <FONT COLOR=green><EM>--  AKA: mvwaddstr()</EM></FONT>
    <FONT COLOR=green><EM>--  AKA: mvaddnstr()</EM></FONT>
@@ -679,20 +679,20 @@
    <FONT COLOR=green><EM>--  |=====================================================================</EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_23"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_677_14" HREF="terminal_interface-curses__adb.htm#ref_402_14">Add</A></FONT> (<FONT COLOR=red><A NAME="ref_677_19" HREF="terminal_interface-curses__adb.htm#ref_403_7">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-                  <FONT COLOR=red><A NAME="ref_678_19" HREF="terminal_interface-curses__adb.htm#ref_404_7">Str</A></FONT> : <b>in</b> Attributed_String;
-                  <FONT COLOR=red><A NAME="ref_679_19" HREF="terminal_interface-curses__adb.htm#ref_405_7">Len</A></FONT> : <b>in</b> Integer := -1);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_677_14" HREF="terminal_interface-curses__adb.htm#ref_402_14">Add</A></FONT> (<FONT COLOR=red><A NAME="ref_677_19" HREF="terminal_interface-curses__adb.htm#ref_403_7">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+                  <FONT COLOR=red><A NAME="ref_678_19" HREF="terminal_interface-curses__adb.htm#ref_404_7">Str</A></FONT> : Attributed_String;
+                  <FONT COLOR=red><A NAME="ref_679_19" HREF="terminal_interface-curses__adb.htm#ref_405_7">Len</A></FONT> : Integer := -1);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_addchstr.3x.html">waddchnstr()</A></EM></FONT>
    <FONT COLOR=green><EM>--  AKA: waddchstr()</EM></FONT>
    <FONT COLOR=green><EM>--  AKA: addchnstr()</EM></FONT>
    <FONT COLOR=green><EM>--  AKA: addchstr()</EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_24"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_686_14" HREF="terminal_interface-curses__adb.htm#ref_425_14">Add</A></FONT> (<FONT COLOR=red><A NAME="ref_686_19" HREF="terminal_interface-curses__adb.htm#ref_426_7">Win</A></FONT>    : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-                  <FONT COLOR=red><A NAME="ref_687_19" HREF="terminal_interface-curses__adb.htm#ref_427_7">Line</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
-                  <FONT COLOR=red><A NAME="ref_688_19" HREF="terminal_interface-curses__adb.htm#ref_428_7">Column</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
-                  <FONT COLOR=red><A NAME="ref_689_19" HREF="terminal_interface-curses__adb.htm#ref_429_7">Str</A></FONT>    : <b>in</b> Attributed_String;
-                  <FONT COLOR=red><A NAME="ref_690_19" HREF="terminal_interface-curses__adb.htm#ref_430_7">Len</A></FONT>    : <b>in</b> Integer := -1);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_686_14" HREF="terminal_interface-curses__adb.htm#ref_425_14">Add</A></FONT> (<FONT COLOR=red><A NAME="ref_686_19" HREF="terminal_interface-curses__adb.htm#ref_426_7">Win</A></FONT>    : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+                  <FONT COLOR=red><A NAME="ref_687_19" HREF="terminal_interface-curses__adb.htm#ref_427_7">Line</A></FONT>   : <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
+                  <FONT COLOR=red><A NAME="ref_688_19" HREF="terminal_interface-curses__adb.htm#ref_428_7">Column</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
+                  <FONT COLOR=red><A NAME="ref_689_19" HREF="terminal_interface-curses__adb.htm#ref_429_7">Str</A></FONT>    : Attributed_String;
+                  <FONT COLOR=red><A NAME="ref_690_19" HREF="terminal_interface-curses__adb.htm#ref_430_7">Len</A></FONT>    : Integer := -1);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_addchstr.3x.html">mvwaddchnstr()</A></EM></FONT>
    <FONT COLOR=green><EM>--  AKA: mvwaddchstr()</EM></FONT>
    <FONT COLOR=green><EM>--  AKA: mvaddchnstr()</EM></FONT>
@@ -707,15 +707,15 @@
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_25"#2|</EM></FONT>
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_704_14" HREF="terminal_interface-curses__adb.htm#ref_437_14">Border</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_705_7" HREF="terminal_interface-curses__adb.htm#ref_438_7">Win</A></FONT>                       : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-      <FONT COLOR=red><A NAME="ref_706_7" HREF="terminal_interface-curses__adb.htm#ref_439_7">Left_Side_Symbol</A></FONT>          : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A> := <A HREF="terminal_interface-curses__ads.htm#ref_371_4">Default_Character</A>;
-      <FONT COLOR=red><A NAME="ref_707_7" HREF="terminal_interface-curses__adb.htm#ref_440_7">Right_Side_Symbol</A></FONT>         : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A> := <A HREF="terminal_interface-curses__ads.htm#ref_371_4">Default_Character</A>;
-      <FONT COLOR=red><A NAME="ref_708_7" HREF="terminal_interface-curses__adb.htm#ref_441_7">Top_Side_Symbol</A></FONT>           : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A> := <A HREF="terminal_interface-curses__ads.htm#ref_371_4">Default_Character</A>;
-      <FONT COLOR=red><A NAME="ref_709_7" HREF="terminal_interface-curses__adb.htm#ref_442_7">Bottom_Side_Symbol</A></FONT>        : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A> := <A HREF="terminal_interface-curses__ads.htm#ref_371_4">Default_Character</A>;
-      <FONT COLOR=red><A NAME="ref_710_7" HREF="terminal_interface-curses__adb.htm#ref_443_7">Upper_Left_Corner_Symbol</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A> := <A HREF="terminal_interface-curses__ads.htm#ref_371_4">Default_Character</A>;
-      <FONT COLOR=red><A NAME="ref_711_7" HREF="terminal_interface-curses__adb.htm#ref_444_7">Upper_Right_Corner_Symbol</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A> := <A HREF="terminal_interface-curses__ads.htm#ref_371_4">Default_Character</A>;
-      <FONT COLOR=red><A NAME="ref_712_7" HREF="terminal_interface-curses__adb.htm#ref_445_7">Lower_Left_Corner_Symbol</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A> := <A HREF="terminal_interface-curses__ads.htm#ref_371_4">Default_Character</A>;
-      <FONT COLOR=red><A NAME="ref_713_7" HREF="terminal_interface-curses__adb.htm#ref_446_7">Lower_Right_Corner_Symbol</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A> := <A HREF="terminal_interface-curses__ads.htm#ref_371_4">Default_Character</A>
+     (<FONT COLOR=red><A NAME="ref_705_7" HREF="terminal_interface-curses__adb.htm#ref_438_7">Win</A></FONT>                       : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+      <FONT COLOR=red><A NAME="ref_706_7" HREF="terminal_interface-curses__adb.htm#ref_439_7">Left_Side_Symbol</A></FONT>          : <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A> := <A HREF="terminal_interface-curses__ads.htm#ref_371_4">Default_Character</A>;
+      <FONT COLOR=red><A NAME="ref_707_7" HREF="terminal_interface-curses__adb.htm#ref_440_7">Right_Side_Symbol</A></FONT>         : <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A> := <A HREF="terminal_interface-curses__ads.htm#ref_371_4">Default_Character</A>;
+      <FONT COLOR=red><A NAME="ref_708_7" HREF="terminal_interface-curses__adb.htm#ref_441_7">Top_Side_Symbol</A></FONT>           : <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A> := <A HREF="terminal_interface-curses__ads.htm#ref_371_4">Default_Character</A>;
+      <FONT COLOR=red><A NAME="ref_709_7" HREF="terminal_interface-curses__adb.htm#ref_442_7">Bottom_Side_Symbol</A></FONT>        : <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A> := <A HREF="terminal_interface-curses__ads.htm#ref_371_4">Default_Character</A>;
+      <FONT COLOR=red><A NAME="ref_710_7" HREF="terminal_interface-curses__adb.htm#ref_443_7">Upper_Left_Corner_Symbol</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A> := <A HREF="terminal_interface-curses__ads.htm#ref_371_4">Default_Character</A>;
+      <FONT COLOR=red><A NAME="ref_711_7" HREF="terminal_interface-curses__adb.htm#ref_444_7">Upper_Right_Corner_Symbol</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A> := <A HREF="terminal_interface-curses__ads.htm#ref_371_4">Default_Character</A>;
+      <FONT COLOR=red><A NAME="ref_712_7" HREF="terminal_interface-curses__adb.htm#ref_445_7">Lower_Left_Corner_Symbol</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A> := <A HREF="terminal_interface-curses__ads.htm#ref_371_4">Default_Character</A>;
+      <FONT COLOR=red><A NAME="ref_713_7" HREF="terminal_interface-curses__adb.htm#ref_446_7">Lower_Right_Corner_Symbol</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A> := <A HREF="terminal_interface-curses__ads.htm#ref_371_4">Default_Character</A>
      );
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_border.3x.html">wborder()</A></EM></FONT>
    <FONT COLOR=green><EM>--  AKA: border()</EM></FONT>
@@ -723,26 +723,26 @@
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_26"#2|</EM></FONT>
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_720_14" HREF="terminal_interface-curses__adb.htm#ref_474_14">Box</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_721_7" HREF="terminal_interface-curses__adb.htm#ref_475_7">Win</A></FONT>               : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-      <FONT COLOR=red><A NAME="ref_722_7" HREF="terminal_interface-curses__adb.htm#ref_476_7">Vertical_Symbol</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A> := <A HREF="terminal_interface-curses__ads.htm#ref_371_4">Default_Character</A>;
-      <FONT COLOR=red><A NAME="ref_723_7" HREF="terminal_interface-curses__adb.htm#ref_477_7">Horizontal_Symbol</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A> := <A HREF="terminal_interface-curses__ads.htm#ref_371_4">Default_Character</A>);
+     (<FONT COLOR=red><A NAME="ref_721_7" HREF="terminal_interface-curses__adb.htm#ref_475_7">Win</A></FONT>               : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+      <FONT COLOR=red><A NAME="ref_722_7" HREF="terminal_interface-curses__adb.htm#ref_476_7">Vertical_Symbol</A></FONT>   : <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A> := <A HREF="terminal_interface-curses__ads.htm#ref_371_4">Default_Character</A>;
+      <FONT COLOR=red><A NAME="ref_723_7" HREF="terminal_interface-curses__adb.htm#ref_477_7">Horizontal_Symbol</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A> := <A HREF="terminal_interface-curses__ads.htm#ref_371_4">Default_Character</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_border.3x.html">box()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses__ads.htm#ref_720_14">Box</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_27"#2|</EM></FONT>
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_728_14" HREF="terminal_interface-curses__adb.htm#ref_485_14">Horizontal_Line</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_729_7" HREF="terminal_interface-curses__adb.htm#ref_486_7">Win</A></FONT>         : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-      <FONT COLOR=red><A NAME="ref_730_7" HREF="terminal_interface-curses__adb.htm#ref_487_7">Line_Size</A></FONT>   : <b>in</b> Natural;
-      <FONT COLOR=red><A NAME="ref_731_7" HREF="terminal_interface-curses__adb.htm#ref_488_7">Line_Symbol</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A> := <A HREF="terminal_interface-curses__ads.htm#ref_371_4">Default_Character</A>);
+     (<FONT COLOR=red><A NAME="ref_729_7" HREF="terminal_interface-curses__adb.htm#ref_486_7">Win</A></FONT>         : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+      <FONT COLOR=red><A NAME="ref_730_7" HREF="terminal_interface-curses__adb.htm#ref_487_7">Line_Size</A></FONT>   : Natural;
+      <FONT COLOR=red><A NAME="ref_731_7" HREF="terminal_interface-curses__adb.htm#ref_488_7">Line_Symbol</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A> := <A HREF="terminal_interface-curses__ads.htm#ref_371_4">Default_Character</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_border.3x.html">whline()</A></EM></FONT>
    <FONT COLOR=green><EM>--  AKA: hline()</EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses__ads.htm#ref_728_14">Horizontal_Line</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_28"#2|</EM></FONT>
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_737_14" HREF="terminal_interface-curses__adb.htm#ref_502_14">Vertical_Line</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_738_7" HREF="terminal_interface-curses__adb.htm#ref_503_7">Win</A></FONT>         : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-      <FONT COLOR=red><A NAME="ref_739_7" HREF="terminal_interface-curses__adb.htm#ref_504_7">Line_Size</A></FONT>   : <b>in</b> Natural;
-      <FONT COLOR=red><A NAME="ref_740_7" HREF="terminal_interface-curses__adb.htm#ref_505_7">Line_Symbol</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A> := <A HREF="terminal_interface-curses__ads.htm#ref_371_4">Default_Character</A>);
+     (<FONT COLOR=red><A NAME="ref_738_7" HREF="terminal_interface-curses__adb.htm#ref_503_7">Win</A></FONT>         : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+      <FONT COLOR=red><A NAME="ref_739_7" HREF="terminal_interface-curses__adb.htm#ref_504_7">Line_Size</A></FONT>   : Natural;
+      <FONT COLOR=red><A NAME="ref_740_7" HREF="terminal_interface-curses__adb.htm#ref_505_7">Line_Symbol</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A> := <A HREF="terminal_interface-curses__ads.htm#ref_371_4">Default_Character</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_border.3x.html">wvline()</A></EM></FONT>
    <FONT COLOR=green><EM>--  AKA: vline()</EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses__ads.htm#ref_737_14">Vertical_Line</A>);
@@ -764,7 +764,7 @@
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses__ads.htm#ref_751_13">Get_Keystroke</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_30"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_762_14" HREF="terminal_interface-curses__adb.htm#ref_535_14">Undo_Keystroke</A></FONT> (<FONT COLOR=red><A NAME="ref_762_30" HREF="terminal_interface-curses__adb.htm#ref_535_30">Key</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_73_12">Real_Key_Code</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_762_14" HREF="terminal_interface-curses__adb.htm#ref_535_14">Undo_Keystroke</A></FONT> (<FONT COLOR=red><A NAME="ref_762_30" HREF="terminal_interface-curses__adb.htm#ref_535_30">Key</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_73_12">Real_Key_Code</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_getch.3x.html">ungetch()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses__ads.htm#ref_762_14">Undo_Keystroke</A>);
 
@@ -809,9 +809,9 @@
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_33"#2|</EM></FONT>
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_806_14" HREF="terminal_interface-curses__adb.htm#ref_606_14">Switch_Character_Attribute</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_807_7" HREF="terminal_interface-curses__adb.htm#ref_607_7">Win</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-      <FONT COLOR=red><A NAME="ref_808_7" HREF="terminal_interface-curses__adb.htm#ref_608_7">Attr</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_307_9">Character_Attribute_Set</A> := <A HREF="terminal_interface-curses__ads.htm#ref_350_4">Normal_Video</A>;
-      <FONT COLOR=red><A NAME="ref_809_7" HREF="terminal_interface-curses__adb.htm#ref_609_7">On</A></FONT>   : <b>in</b> Boolean := True); <FONT COLOR=green><EM>--  if False we switch Off.</EM></FONT>
+     (<FONT COLOR=red><A NAME="ref_807_7" HREF="terminal_interface-curses__adb.htm#ref_607_7">Win</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+      <FONT COLOR=red><A NAME="ref_808_7" HREF="terminal_interface-curses__adb.htm#ref_608_7">Attr</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_307_9">Character_Attribute_Set</A> := <A HREF="terminal_interface-curses__ads.htm#ref_350_4">Normal_Video</A>;
+      <FONT COLOR=red><A NAME="ref_809_7" HREF="terminal_interface-curses__adb.htm#ref_609_7">On</A></FONT>   : Boolean := True); <FONT COLOR=green><EM>--  if False we switch Off.</EM></FONT>
    <FONT COLOR=green><EM>--  Switches those Attributes set to true in the list.</EM></FONT>
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_attr.3x.html">wattron()</A></EM></FONT>
    <FONT COLOR=green><EM>--  AKA: wattroff()</EM></FONT>
@@ -820,49 +820,49 @@
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_34"#2|</EM></FONT>
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_817_14" HREF="terminal_interface-curses__adb.htm#ref_634_14">Set_Character_Attributes</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_818_7" HREF="terminal_interface-curses__adb.htm#ref_635_7">Win</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-      <FONT COLOR=red><A NAME="ref_819_7" HREF="terminal_interface-curses__adb.htm#ref_636_7">Attr</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_307_9">Character_Attribute_Set</A> := <A HREF="terminal_interface-curses__ads.htm#ref_350_4">Normal_Video</A>;
-      <FONT COLOR=red><A NAME="ref_820_7" HREF="terminal_interface-curses__adb.htm#ref_637_7">Color</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A> := <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A>'First);
+     (<FONT COLOR=red><A NAME="ref_818_7" HREF="terminal_interface-curses__adb.htm#ref_635_7">Win</A></FONT>   : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+      <FONT COLOR=red><A NAME="ref_819_7" HREF="terminal_interface-curses__adb.htm#ref_636_7">Attr</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_307_9">Character_Attribute_Set</A> := <A HREF="terminal_interface-curses__ads.htm#ref_350_4">Normal_Video</A>;
+      <FONT COLOR=red><A NAME="ref_820_7" HREF="terminal_interface-curses__adb.htm#ref_637_7">Color</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A> := <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A>'First);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_attr.3x.html">wattrset()</A></EM></FONT>
    <FONT COLOR=green><EM>--  AKA: attrset()</EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses__ads.htm#ref_817_14">Set_Character_Attributes</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_35"#2|</EM></FONT>
    <b>function</b> <FONT COLOR=red><A NAME="ref_826_13" HREF="terminal_interface-curses__adb.htm#ref_652_13">Get_Character_Attribute</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_827_7" HREF="terminal_interface-curses__adb.htm#ref_652_38">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>) <b>return</b> <A HREF="terminal_interface-curses__ads.htm#ref_307_9">Character_Attribute_Set</A>;
+     (<FONT COLOR=red><A NAME="ref_827_7" HREF="terminal_interface-curses__adb.htm#ref_652_38">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>) <b>return</b> <A HREF="terminal_interface-curses__ads.htm#ref_307_9">Character_Attribute_Set</A>;
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_attr.3x.html">wattr_get()</A></EM></FONT>
    <FONT COLOR=green><EM>--  AKA: attr_get()</EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_36"#2|</EM></FONT>
    <b>function</b> <FONT COLOR=red><A NAME="ref_832_13" HREF="terminal_interface-curses__adb.htm#ref_675_13">Get_Character_Attribute</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_833_7" HREF="terminal_interface-curses__adb.htm#ref_675_38">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>) <b>return</b> <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A>;
+     (<FONT COLOR=red><A NAME="ref_833_7" HREF="terminal_interface-curses__adb.htm#ref_675_38">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>) <b>return</b> <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A>;
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_attr.3x.html">wattr_get()</A></EM></FONT>
    <b>pragma</b> Inline (Get_Character_Attribute);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_37"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_838_14" HREF="terminal_interface-curses__adb.htm#ref_698_14">Set_Color</A></FONT> (<FONT COLOR=red><A NAME="ref_838_25" HREF="terminal_interface-curses__adb.htm#ref_698_25">Win</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-                        <FONT COLOR=red><A NAME="ref_839_25" HREF="terminal_interface-curses__adb.htm#ref_699_25">Pair</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_838_14" HREF="terminal_interface-curses__adb.htm#ref_698_14">Set_Color</A></FONT> (<FONT COLOR=red><A NAME="ref_838_25" HREF="terminal_interface-curses__adb.htm#ref_698_25">Win</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+                        <FONT COLOR=red><A NAME="ref_839_25" HREF="terminal_interface-curses__adb.htm#ref_699_25">Pair</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_attr.3x.html">wcolor_set()</A></EM></FONT>
    <FONT COLOR=green><EM>--  AKA: color_set()</EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses__ads.htm#ref_838_14">Set_Color</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_38"#2|</EM></FONT>
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_845_14" HREF="terminal_interface-curses__adb.htm#ref_713_14">Change_Attributes</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_846_7" HREF="terminal_interface-curses__adb.htm#ref_714_7">Win</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-      <FONT COLOR=red><A NAME="ref_847_7" HREF="terminal_interface-curses__adb.htm#ref_715_7">Count</A></FONT> : <b>in</b> Integer := -1;
-      <FONT COLOR=red><A NAME="ref_848_7" HREF="terminal_interface-curses__adb.htm#ref_716_7">Attr</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_307_9">Character_Attribute_Set</A> := <A HREF="terminal_interface-curses__ads.htm#ref_350_4">Normal_Video</A>;
-      <FONT COLOR=red><A NAME="ref_849_7" HREF="terminal_interface-curses__adb.htm#ref_717_7">Color</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A> := <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A>'First);
+     (<FONT COLOR=red><A NAME="ref_846_7" HREF="terminal_interface-curses__adb.htm#ref_714_7">Win</A></FONT>   : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+      <FONT COLOR=red><A NAME="ref_847_7" HREF="terminal_interface-curses__adb.htm#ref_715_7">Count</A></FONT> : Integer := -1;
+      <FONT COLOR=red><A NAME="ref_848_7" HREF="terminal_interface-curses__adb.htm#ref_716_7">Attr</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_307_9">Character_Attribute_Set</A> := <A HREF="terminal_interface-curses__ads.htm#ref_350_4">Normal_Video</A>;
+      <FONT COLOR=red><A NAME="ref_849_7" HREF="terminal_interface-curses__adb.htm#ref_717_7">Color</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A> := <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A>'First);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_attr.3x.html">wchgat()</A></EM></FONT>
    <FONT COLOR=green><EM>--  AKA: chgat()</EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_39"#2|</EM></FONT>
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_854_14" HREF="terminal_interface-curses__adb.htm#ref_736_14">Change_Attributes</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_855_7" HREF="terminal_interface-curses__adb.htm#ref_737_7">Win</A></FONT>    : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-      <FONT COLOR=red><A NAME="ref_856_7" HREF="terminal_interface-curses__adb.htm#ref_738_7">Line</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A> := <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>'First;
-      <FONT COLOR=red><A NAME="ref_857_7" HREF="terminal_interface-curses__adb.htm#ref_739_7">Column</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A> := <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>'First;
-      <FONT COLOR=red><A NAME="ref_858_7" HREF="terminal_interface-curses__adb.htm#ref_740_7">Count</A></FONT>  : <b>in</b> Integer := -1;
-      <FONT COLOR=red><A NAME="ref_859_7" HREF="terminal_interface-curses__adb.htm#ref_741_7">Attr</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_307_9">Character_Attribute_Set</A> := <A HREF="terminal_interface-curses__ads.htm#ref_350_4">Normal_Video</A>;
-      <FONT COLOR=red><A NAME="ref_860_7" HREF="terminal_interface-curses__adb.htm#ref_742_7">Color</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A> := <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A>'First);
+     (<FONT COLOR=red><A NAME="ref_855_7" HREF="terminal_interface-curses__adb.htm#ref_737_7">Win</A></FONT>    : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+      <FONT COLOR=red><A NAME="ref_856_7" HREF="terminal_interface-curses__adb.htm#ref_738_7">Line</A></FONT>   : <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A> := <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>'First;
+      <FONT COLOR=red><A NAME="ref_857_7" HREF="terminal_interface-curses__adb.htm#ref_739_7">Column</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A> := <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>'First;
+      <FONT COLOR=red><A NAME="ref_858_7" HREF="terminal_interface-curses__adb.htm#ref_740_7">Count</A></FONT>  : Integer := -1;
+      <FONT COLOR=red><A NAME="ref_859_7" HREF="terminal_interface-curses__adb.htm#ref_741_7">Attr</A></FONT>   : <A HREF="terminal_interface-curses__ads.htm#ref_307_9">Character_Attribute_Set</A> := <A HREF="terminal_interface-curses__ads.htm#ref_350_4">Normal_Video</A>;
+      <FONT COLOR=red><A NAME="ref_860_7" HREF="terminal_interface-curses__adb.htm#ref_742_7">Color</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A> := <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A>'First);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_attr.3x.html">mvwchgat()</A></EM></FONT>
    <FONT COLOR=green><EM>--  AKA: mvchgat()</EM></FONT>
    <b>pragma</b> Inline (Change_Attributes);
@@ -888,36 +888,36 @@
    <FONT COLOR=green><EM>--  | Not implemented : typeahead</EM></FONT>
    <FONT COLOR=green><EM>--</EM></FONT>
    <FONT COLOR=green><EM>--  #1A NAME="AFU_42"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_886_14" HREF="terminal_interface-curses__adb.htm#ref_769_14">Set_Cbreak_Mode</A></FONT> (<FONT COLOR=red><A NAME="ref_886_31" HREF="terminal_interface-curses__adb.htm#ref_769_31">SwitchOn</A></FONT> : <b>in</b> Boolean := True);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_886_14" HREF="terminal_interface-curses__adb.htm#ref_769_14">Set_Cbreak_Mode</A></FONT> (<FONT COLOR=red><A NAME="ref_886_31" HREF="terminal_interface-curses__adb.htm#ref_769_31">SwitchOn</A></FONT> : Boolean := True);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_inopts.3x.html">cbreak()</A></EM></FONT>
    <FONT COLOR=green><EM>--  AKA: nocbreak()</EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses__ads.htm#ref_886_14">Set_Cbreak_Mode</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_43"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_892_14" HREF="terminal_interface-curses__adb.htm#ref_788_14">Set_Raw_Mode</A></FONT> (<FONT COLOR=red><A NAME="ref_892_28" HREF="terminal_interface-curses__adb.htm#ref_788_28">SwitchOn</A></FONT> : <b>in</b> Boolean := True);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_892_14" HREF="terminal_interface-curses__adb.htm#ref_788_14">Set_Raw_Mode</A></FONT> (<FONT COLOR=red><A NAME="ref_892_28" HREF="terminal_interface-curses__adb.htm#ref_788_28">SwitchOn</A></FONT> : Boolean := True);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_inopts.3x.html">raw()</A></EM></FONT>
    <FONT COLOR=green><EM>--  AKA: noraw()</EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses__ads.htm#ref_892_14">Set_Raw_Mode</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_44"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_898_14" HREF="terminal_interface-curses__adb.htm#ref_807_14">Set_Echo_Mode</A></FONT> (<FONT COLOR=red><A NAME="ref_898_29" HREF="terminal_interface-curses__adb.htm#ref_807_29">SwitchOn</A></FONT> : <b>in</b> Boolean := True);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_898_14" HREF="terminal_interface-curses__adb.htm#ref_807_14">Set_Echo_Mode</A></FONT> (<FONT COLOR=red><A NAME="ref_898_29" HREF="terminal_interface-curses__adb.htm#ref_807_29">SwitchOn</A></FONT> : Boolean := True);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_inopts.3x.html">echo()</A></EM></FONT>
    <FONT COLOR=green><EM>--  AKA: noecho()</EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses__ads.htm#ref_898_14">Set_Echo_Mode</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_45"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_904_14" HREF="terminal_interface-curses__adb.htm#ref_826_14">Set_Meta_Mode</A></FONT> (<FONT COLOR=red><A NAME="ref_904_29" HREF="terminal_interface-curses__adb.htm#ref_826_29">Win</A></FONT>      : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-                            <FONT COLOR=red><A NAME="ref_905_29" HREF="terminal_interface-curses__adb.htm#ref_827_29">SwitchOn</A></FONT> : <b>in</b> Boolean := True);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_904_14" HREF="terminal_interface-curses__adb.htm#ref_826_14">Set_Meta_Mode</A></FONT> (<FONT COLOR=red><A NAME="ref_904_29" HREF="terminal_interface-curses__adb.htm#ref_826_29">Win</A></FONT>      : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+                            <FONT COLOR=red><A NAME="ref_905_29" HREF="terminal_interface-curses__adb.htm#ref_827_29">SwitchOn</A></FONT> : Boolean := True);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_inopts.3x.html">meta()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses__ads.htm#ref_904_14">Set_Meta_Mode</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_46"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_910_14" HREF="terminal_interface-curses__adb.htm#ref_837_14">Set_KeyPad_Mode</A></FONT> (<FONT COLOR=red><A NAME="ref_910_31" HREF="terminal_interface-curses__adb.htm#ref_837_31">Win</A></FONT>      : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-                              <FONT COLOR=red><A NAME="ref_911_31" HREF="terminal_interface-curses__adb.htm#ref_838_31">SwitchOn</A></FONT> : <b>in</b> Boolean := True);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_910_14" HREF="terminal_interface-curses__adb.htm#ref_837_14">Set_KeyPad_Mode</A></FONT> (<FONT COLOR=red><A NAME="ref_910_31" HREF="terminal_interface-curses__adb.htm#ref_837_31">Win</A></FONT>      : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+                              <FONT COLOR=red><A NAME="ref_911_31" HREF="terminal_interface-curses__adb.htm#ref_838_31">SwitchOn</A></FONT> : Boolean := True);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_inopts.3x.html">keypad()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses__ads.htm#ref_910_14">Set_KeyPad_Mode</A>);
 
-   <b>function</b> <FONT COLOR=red><A NAME="ref_915_13" HREF="terminal_interface-curses__adb.htm#ref_848_13">Get_KeyPad_Mode</A></FONT> (<FONT COLOR=red><A NAME="ref_915_30" HREF="terminal_interface-curses__adb.htm#ref_848_30">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>)
+   <b>function</b> <FONT COLOR=red><A NAME="ref_915_13" HREF="terminal_interface-curses__adb.htm#ref_848_13">Get_KeyPad_Mode</A></FONT> (<FONT COLOR=red><A NAME="ref_915_30" HREF="terminal_interface-curses__adb.htm#ref_848_30">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>)
                              <b>return</b> Boolean;
    <FONT COLOR=green><EM>--  This has no pendant in C. There you've to look into the WINDOWS</EM></FONT>
    <FONT COLOR=green><EM>--  structure to get the value. Bad practice, not repeated in Ada.</EM></FONT>
@@ -925,38 +925,38 @@
    <b>type</b> <FONT COLOR=red><A NAME="ref_920_9">Half_Delay_Amount</A></FONT> <b>is</b> <b>range</b> 1 .. 255;
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_47"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_923_14" HREF="terminal_interface-curses__adb.htm#ref_857_14">Half_Delay</A></FONT> (<FONT COLOR=red><A NAME="ref_923_26" HREF="terminal_interface-curses__adb.htm#ref_857_26">Amount</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_920_9">Half_Delay_Amount</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_923_14" HREF="terminal_interface-curses__adb.htm#ref_857_14">Half_Delay</A></FONT> (<FONT COLOR=red><A NAME="ref_923_26" HREF="terminal_interface-curses__adb.htm#ref_857_26">Amount</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_920_9">Half_Delay_Amount</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_inopts.3x.html">halfdelay()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses__ads.htm#ref_923_14">Half_Delay</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_48"#2|</EM></FONT>
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_928_14" HREF="terminal_interface-curses__adb.htm#ref_867_14">Set_Flush_On_Interrupt_Mode</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_929_7" HREF="terminal_interface-curses__adb.htm#ref_868_7">Win</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-      <FONT COLOR=red><A NAME="ref_930_7" HREF="terminal_interface-curses__adb.htm#ref_869_7">Mode</A></FONT> : <b>in</b> Boolean := True);
+     (<FONT COLOR=red><A NAME="ref_929_7" HREF="terminal_interface-curses__adb.htm#ref_868_7">Win</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+      <FONT COLOR=red><A NAME="ref_930_7" HREF="terminal_interface-curses__adb.htm#ref_869_7">Mode</A></FONT> : Boolean := True);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_inopts.3x.html">intrflush()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses__ads.htm#ref_928_14">Set_Flush_On_Interrupt_Mode</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_49"#2|</EM></FONT>
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_935_14" HREF="terminal_interface-curses__adb.htm#ref_879_14">Set_Queue_Interrupt_Mode</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_936_7" HREF="terminal_interface-curses__adb.htm#ref_880_7">Win</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-      <FONT COLOR=red><A NAME="ref_937_7" HREF="terminal_interface-curses__adb.htm#ref_881_7">Flush</A></FONT> : <b>in</b> Boolean := True);
+     (<FONT COLOR=red><A NAME="ref_936_7" HREF="terminal_interface-curses__adb.htm#ref_880_7">Win</A></FONT>   : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+      <FONT COLOR=red><A NAME="ref_937_7" HREF="terminal_interface-curses__adb.htm#ref_881_7">Flush</A></FONT> : Boolean := True);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_inopts.3x.html">qiflush()</A></EM></FONT>
    <FONT COLOR=green><EM>--  AKA: noqiflush()</EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses__ads.htm#ref_935_14">Set_Queue_Interrupt_Mode</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_50"#2|</EM></FONT>
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_943_14" HREF="terminal_interface-curses__adb.htm#ref_898_14">Set_NoDelay_Mode</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_944_7" HREF="terminal_interface-curses__adb.htm#ref_899_7">Win</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-      <FONT COLOR=red><A NAME="ref_945_7" HREF="terminal_interface-curses__adb.htm#ref_900_7">Mode</A></FONT> : <b>in</b> Boolean := False);
+     (<FONT COLOR=red><A NAME="ref_944_7" HREF="terminal_interface-curses__adb.htm#ref_899_7">Win</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+      <FONT COLOR=red><A NAME="ref_945_7" HREF="terminal_interface-curses__adb.htm#ref_900_7">Mode</A></FONT> : Boolean := False);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_inopts.3x.html">nodelay()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses__ads.htm#ref_943_14">Set_NoDelay_Mode</A>);
 
    <b>type</b> <FONT COLOR=red><A NAME="ref_949_9">Timeout_Mode</A></FONT> <b>is</b> (<FONT COLOR=red><A NAME="ref_949_26">Blocking</A></FONT>, <FONT COLOR=red><A NAME="ref_949_36">Non_Blocking</A></FONT>, <FONT COLOR=red><A NAME="ref_949_50">Delayed</A></FONT>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_51"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_952_14" HREF="terminal_interface-curses__adb.htm#ref_910_14">Set_Timeout_Mode</A></FONT> (<FONT COLOR=red><A NAME="ref_952_32" HREF="terminal_interface-curses__adb.htm#ref_910_32">Win</A></FONT>    : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-                               <FONT COLOR=red><A NAME="ref_953_32" HREF="terminal_interface-curses__adb.htm#ref_911_32">Mode</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_949_9">Timeout_Mode</A>;
-                               <FONT COLOR=red><A NAME="ref_954_32" HREF="terminal_interface-curses__adb.htm#ref_912_32">Amount</A></FONT> : <b>in</b> Natural); <FONT COLOR=green><EM>--  in Milliseconds</EM></FONT>
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_952_14" HREF="terminal_interface-curses__adb.htm#ref_910_14">Set_Timeout_Mode</A></FONT> (<FONT COLOR=red><A NAME="ref_952_32" HREF="terminal_interface-curses__adb.htm#ref_910_32">Win</A></FONT>    : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+                               <FONT COLOR=red><A NAME="ref_953_32" HREF="terminal_interface-curses__adb.htm#ref_911_32">Mode</A></FONT>   : <A HREF="terminal_interface-curses__ads.htm#ref_949_9">Timeout_Mode</A>;
+                               <FONT COLOR=red><A NAME="ref_954_32" HREF="terminal_interface-curses__adb.htm#ref_912_32">Amount</A></FONT> : Natural); <FONT COLOR=green><EM>--  in Milliseconds</EM></FONT>
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_inopts.3x.html">wtimeout()</A></EM></FONT>
    <FONT COLOR=green><EM>--  AKA: timeout()</EM></FONT>
    <FONT COLOR=green><EM>--  Instead of overloading the semantic of the sign of amount, we</EM></FONT>
@@ -967,8 +967,8 @@
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_52"#2|</EM></FONT>
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_964_14" HREF="terminal_interface-curses__adb.htm#ref_931_14">Set_Escape_Timer_Mode</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_965_7" HREF="terminal_interface-curses__adb.htm#ref_932_7">Win</A></FONT>       : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-      <FONT COLOR=red><A NAME="ref_966_7" HREF="terminal_interface-curses__adb.htm#ref_933_7">Timer_Off</A></FONT> : <b>in</b> Boolean := False);
+     (<FONT COLOR=red><A NAME="ref_965_7" HREF="terminal_interface-curses__adb.htm#ref_932_7">Win</A></FONT>       : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+      <FONT COLOR=red><A NAME="ref_966_7" HREF="terminal_interface-curses__adb.htm#ref_933_7">Timer_Off</A></FONT> : Boolean := False);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_inopts.3x.html">notimeout()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses__ads.htm#ref_964_14">Set_Escape_Timer_Mode</A>);
 
@@ -977,50 +977,50 @@
    <FONT COLOR=green><EM>--  |=====================================================================</EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_53"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_975_14" HREF="terminal_interface-curses__adb.htm#ref_945_14">Set_NL_Mode</A></FONT> (<FONT COLOR=red><A NAME="ref_975_27" HREF="terminal_interface-curses__adb.htm#ref_945_27">SwitchOn</A></FONT> : <b>in</b> Boolean := True);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_975_14" HREF="terminal_interface-curses__adb.htm#ref_945_14">Set_NL_Mode</A></FONT> (<FONT COLOR=red><A NAME="ref_975_27" HREF="terminal_interface-curses__adb.htm#ref_945_27">SwitchOn</A></FONT> : Boolean := True);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_outopts.3x.html">nl()</A></EM></FONT>
    <FONT COLOR=green><EM>--  AKA: nonl()</EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses__ads.htm#ref_975_14">Set_NL_Mode</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_54"#2|</EM></FONT>
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_981_14" HREF="terminal_interface-curses__adb.htm#ref_964_14">Clear_On_Next_Update</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_982_7" HREF="terminal_interface-curses__adb.htm#ref_965_7">Win</A></FONT>      : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-      <FONT COLOR=red><A NAME="ref_983_7" HREF="terminal_interface-curses__adb.htm#ref_966_7">Do_Clear</A></FONT> : <b>in</b> Boolean := True);
+     (<FONT COLOR=red><A NAME="ref_982_7" HREF="terminal_interface-curses__adb.htm#ref_965_7">Win</A></FONT>      : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+      <FONT COLOR=red><A NAME="ref_983_7" HREF="terminal_interface-curses__adb.htm#ref_966_7">Do_Clear</A></FONT> : Boolean := True);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_outopts.3x.html">clearok()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses__ads.htm#ref_981_14">Clear_On_Next_Update</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_55"#2|</EM></FONT>
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_988_14" HREF="terminal_interface-curses__adb.htm#ref_976_14">Use_Insert_Delete_Line</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_989_7" HREF="terminal_interface-curses__adb.htm#ref_977_7">Win</A></FONT>    : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-      <FONT COLOR=red><A NAME="ref_990_7" HREF="terminal_interface-curses__adb.htm#ref_978_7">Do_Idl</A></FONT> : <b>in</b> Boolean := True);
+     (<FONT COLOR=red><A NAME="ref_989_7" HREF="terminal_interface-curses__adb.htm#ref_977_7">Win</A></FONT>    : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+      <FONT COLOR=red><A NAME="ref_990_7" HREF="terminal_interface-curses__adb.htm#ref_978_7">Do_Idl</A></FONT> : Boolean := True);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_outopts.3x.html">idlok()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses__ads.htm#ref_988_14">Use_Insert_Delete_Line</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_56"#2|</EM></FONT>
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_995_14" HREF="terminal_interface-curses__adb.htm#ref_988_14">Use_Insert_Delete_Character</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_996_7" HREF="terminal_interface-curses__adb.htm#ref_989_7">Win</A></FONT>    : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-      <FONT COLOR=red><A NAME="ref_997_7" HREF="terminal_interface-curses__adb.htm#ref_990_7">Do_Idc</A></FONT> : <b>in</b> Boolean := True);
+     (<FONT COLOR=red><A NAME="ref_996_7" HREF="terminal_interface-curses__adb.htm#ref_989_7">Win</A></FONT>    : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+      <FONT COLOR=red><A NAME="ref_997_7" HREF="terminal_interface-curses__adb.htm#ref_990_7">Do_Idc</A></FONT> : Boolean := True);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_outopts.3x.html">idcok()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses__ads.htm#ref_995_14">Use_Insert_Delete_Character</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_57"#2|</EM></FONT>
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_1002_14" HREF="terminal_interface-curses__adb.htm#ref_998_14">Leave_Cursor_After_Update</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_1003_7" HREF="terminal_interface-curses__adb.htm#ref_999_7">Win</A></FONT>      : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-      <FONT COLOR=red><A NAME="ref_1004_7" HREF="terminal_interface-curses__adb.htm#ref_1000_7">Do_Leave</A></FONT> : <b>in</b> Boolean := True);
+     (<FONT COLOR=red><A NAME="ref_1003_7" HREF="terminal_interface-curses__adb.htm#ref_999_7">Win</A></FONT>      : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+      <FONT COLOR=red><A NAME="ref_1004_7" HREF="terminal_interface-curses__adb.htm#ref_1000_7">Do_Leave</A></FONT> : Boolean := True);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_outopts.3x.html">leaveok()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses__ads.htm#ref_1002_14">Leave_Cursor_After_Update</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_58"#2|</EM></FONT>
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_1009_14" HREF="terminal_interface-curses__adb.htm#ref_1010_14">Immediate_Update_Mode</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_1010_7" HREF="terminal_interface-curses__adb.htm#ref_1011_7">Win</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-      <FONT COLOR=red><A NAME="ref_1011_7" HREF="terminal_interface-curses__adb.htm#ref_1012_7">Mode</A></FONT> : <b>in</b> Boolean := False);
+     (<FONT COLOR=red><A NAME="ref_1010_7" HREF="terminal_interface-curses__adb.htm#ref_1011_7">Win</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+      <FONT COLOR=red><A NAME="ref_1011_7" HREF="terminal_interface-curses__adb.htm#ref_1012_7">Mode</A></FONT> : Boolean := False);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_outopts.3x.html">immedok()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses__ads.htm#ref_1009_14">Immediate_Update_Mode</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_59"#2|</EM></FONT>
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_1016_14" HREF="terminal_interface-curses__adb.htm#ref_1020_14">Allow_Scrolling</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_1017_7" HREF="terminal_interface-curses__adb.htm#ref_1021_7">Win</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-      <FONT COLOR=red><A NAME="ref_1018_7" HREF="terminal_interface-curses__adb.htm#ref_1022_7">Mode</A></FONT> : <b>in</b> Boolean := False);
+     (<FONT COLOR=red><A NAME="ref_1017_7" HREF="terminal_interface-curses__adb.htm#ref_1021_7">Win</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+      <FONT COLOR=red><A NAME="ref_1018_7" HREF="terminal_interface-curses__adb.htm#ref_1022_7">Mode</A></FONT> : Boolean := False);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_outopts.3x.html">scrollok()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses__ads.htm#ref_1016_14">Allow_Scrolling</A>);
 
@@ -1030,9 +1030,9 @@
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_60"#2|</EM></FONT>
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_1027_14" HREF="terminal_interface-curses__adb.htm#ref_1041_14">Set_Scroll_Region</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_1028_7" HREF="terminal_interface-curses__adb.htm#ref_1042_7">Win</A></FONT>         : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-      <FONT COLOR=red><A NAME="ref_1029_7" HREF="terminal_interface-curses__adb.htm#ref_1043_7">Top_Line</A></FONT>    : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
-      <FONT COLOR=red><A NAME="ref_1030_7" HREF="terminal_interface-curses__adb.htm#ref_1044_7">Bottom_Line</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>);
+     (<FONT COLOR=red><A NAME="ref_1028_7" HREF="terminal_interface-curses__adb.htm#ref_1042_7">Win</A></FONT>         : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+      <FONT COLOR=red><A NAME="ref_1029_7" HREF="terminal_interface-curses__adb.htm#ref_1043_7">Top_Line</A></FONT>    : <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
+      <FONT COLOR=red><A NAME="ref_1030_7" HREF="terminal_interface-curses__adb.htm#ref_1044_7">Bottom_Line</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_outopts.3x.html">wsetscrreg()</A></EM></FONT>
    <FONT COLOR=green><EM>--  AKA: setscrreg()</EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses__ads.htm#ref_1027_14">Set_Scroll_Region</A>);
@@ -1047,7 +1047,7 @@
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses__ads.htm#ref_1040_14">Update_Screen</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_62"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1045_14" HREF="terminal_interface-curses__adb.htm#ref_1067_14">Refresh</A></FONT> (<FONT COLOR=red><A NAME="ref_1045_23" HREF="terminal_interface-curses__adb.htm#ref_1067_23">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1045_14" HREF="terminal_interface-curses__adb.htm#ref_1067_14">Refresh</A></FONT> (<FONT COLOR=red><A NAME="ref_1045_23" HREF="terminal_interface-curses__adb.htm#ref_1067_23">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_refresh.3x.html">wrefresh()</A></EM></FONT>
    <FONT COLOR=green><EM>--  There is an overloaded Refresh for Pads.</EM></FONT>
    <FONT COLOR=green><EM>--  The Inline pragma appears there</EM></FONT>
@@ -1055,19 +1055,19 @@
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_63"#2|</EM></FONT>
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_1052_14" HREF="terminal_interface-curses__adb.htm#ref_1077_14">Refresh_Without_Update</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_1053_7" HREF="terminal_interface-curses__adb.htm#ref_1078_7">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>);
+     (<FONT COLOR=red><A NAME="ref_1053_7" HREF="terminal_interface-curses__adb.htm#ref_1078_7">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_refresh.3x.html">wnoutrefresh()</A></EM></FONT>
    <FONT COLOR=green><EM>--  There is an overloaded Refresh_Without_Update for Pads.</EM></FONT>
    <FONT COLOR=green><EM>--  The Inline pragma appears there</EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_64"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1059_14" HREF="terminal_interface-curses__adb.htm#ref_1088_14">Redraw</A></FONT> (<FONT COLOR=red><A NAME="ref_1059_22" HREF="terminal_interface-curses__adb.htm#ref_1088_22">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1059_14" HREF="terminal_interface-curses__adb.htm#ref_1088_14">Redraw</A></FONT> (<FONT COLOR=red><A NAME="ref_1059_22" HREF="terminal_interface-curses__adb.htm#ref_1088_22">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_refresh.3x.html">redrawwin()</A></EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_65"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1063_14" HREF="terminal_interface-curses__adb.htm#ref_1098_14">Redraw</A></FONT> (<FONT COLOR=red><A NAME="ref_1063_22" HREF="terminal_interface-curses__adb.htm#ref_1099_7">Win</A></FONT>        : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-                     <FONT COLOR=red><A NAME="ref_1064_22" HREF="terminal_interface-curses__adb.htm#ref_1100_7">Begin_Line</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
-                     <FONT COLOR=red><A NAME="ref_1065_22" HREF="terminal_interface-curses__adb.htm#ref_1101_7">Line_Count</A></FONT> : <b>in</b> Positive);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1063_14" HREF="terminal_interface-curses__adb.htm#ref_1098_14">Redraw</A></FONT> (<FONT COLOR=red><A NAME="ref_1063_22" HREF="terminal_interface-curses__adb.htm#ref_1099_7">Win</A></FONT>        : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+                     <FONT COLOR=red><A NAME="ref_1064_22" HREF="terminal_interface-curses__adb.htm#ref_1100_7">Begin_Line</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
+                     <FONT COLOR=red><A NAME="ref_1065_22" HREF="terminal_interface-curses__adb.htm#ref_1101_7">Line_Count</A></FONT> : Positive);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_refresh.3x.html">wredrawln()</A></EM></FONT>
    <b>pragma</b> Inline (Redraw);
 
@@ -1076,28 +1076,28 @@
    <FONT COLOR=green><EM>--  |=====================================================================</EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_66"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1074_14" HREF="terminal_interface-curses__adb.htm#ref_1115_14">Erase</A></FONT> (<FONT COLOR=red><A NAME="ref_1074_21" HREF="terminal_interface-curses__adb.htm#ref_1115_21">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1074_14" HREF="terminal_interface-curses__adb.htm#ref_1115_14">Erase</A></FONT> (<FONT COLOR=red><A NAME="ref_1074_21" HREF="terminal_interface-curses__adb.htm#ref_1115_21">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_clear.3x.html">werase()</A></EM></FONT>
    <FONT COLOR=green><EM>--  AKA: erase()</EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses__ads.htm#ref_1074_14">Erase</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_67"#2|</EM></FONT>
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_1080_14" HREF="terminal_interface-curses__adb.htm#ref_1125_14">Clear</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_1081_7" HREF="terminal_interface-curses__adb.htm#ref_1125_21">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>);
+     (<FONT COLOR=red><A NAME="ref_1081_7" HREF="terminal_interface-curses__adb.htm#ref_1125_21">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_clear.3x.html">wclear()</A></EM></FONT>
    <FONT COLOR=green><EM>--  AKA: clear()</EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses__ads.htm#ref_1080_14">Clear</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_68"#2|</EM></FONT>
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_1087_14" HREF="terminal_interface-curses__adb.htm#ref_1135_14">Clear_To_End_Of_Screen</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_1088_7" HREF="terminal_interface-curses__adb.htm#ref_1135_38">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>);
+     (<FONT COLOR=red><A NAME="ref_1088_7" HREF="terminal_interface-curses__adb.htm#ref_1135_38">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_clear.3x.html">wclrtobot()</A></EM></FONT>
    <FONT COLOR=green><EM>--  AKA: clrtobot()</EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses__ads.htm#ref_1087_14">Clear_To_End_Of_Screen</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_69"#2|</EM></FONT>
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_1094_14" HREF="terminal_interface-curses__adb.htm#ref_1145_14">Clear_To_End_Of_Line</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_1095_7" HREF="terminal_interface-curses__adb.htm#ref_1145_36">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>);
+     (<FONT COLOR=red><A NAME="ref_1095_7" HREF="terminal_interface-curses__adb.htm#ref_1145_36">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_clear.3x.html">wclrtoeol()</A></EM></FONT>
    <FONT COLOR=green><EM>--  AKA: clrtoeol()</EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses__ads.htm#ref_1094_14">Clear_To_End_Of_Line</A>);
@@ -1111,16 +1111,16 @@
    <FONT COLOR=green><EM>--  because in C it is common to see bkgdset(A_BOLD) or</EM></FONT>
    <FONT COLOR=green><EM>--  bkgdset(COLOR_PAIR(n))</EM></FONT>
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_1108_14" HREF="terminal_interface-curses__adb.htm#ref_1155_14">Set_Background</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_1109_7" HREF="terminal_interface-curses__adb.htm#ref_1156_7">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-      <FONT COLOR=red><A NAME="ref_1110_7" HREF="terminal_interface-curses__adb.htm#ref_1157_7">Ch</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A>);
+     (<FONT COLOR=red><A NAME="ref_1109_7" HREF="terminal_interface-curses__adb.htm#ref_1156_7">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+      <FONT COLOR=red><A NAME="ref_1110_7" HREF="terminal_interface-curses__adb.htm#ref_1157_7">Ch</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_bkgd.3x.html">wbkgdset()</A></EM></FONT>
    <FONT COLOR=green><EM>--  AKA: bkgdset()</EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses__ads.htm#ref_1108_14">Set_Background</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_71"#2|</EM></FONT>
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_1116_14" HREF="terminal_interface-curses__adb.htm#ref_1165_14">Change_Background</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_1117_7" HREF="terminal_interface-curses__adb.htm#ref_1166_7">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-      <FONT COLOR=red><A NAME="ref_1118_7" HREF="terminal_interface-curses__adb.htm#ref_1167_7">Ch</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A>);
+     (<FONT COLOR=red><A NAME="ref_1117_7" HREF="terminal_interface-curses__adb.htm#ref_1166_7">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+      <FONT COLOR=red><A NAME="ref_1118_7" HREF="terminal_interface-curses__adb.htm#ref_1167_7">Ch</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_bkgd.3x.html">wbkgd()</A></EM></FONT>
    <FONT COLOR=green><EM>--  AKA: bkgd()</EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses__ads.htm#ref_1116_14">Change_Background</A>);
@@ -1138,26 +1138,26 @@
    <FONT COLOR=green><EM>--  |=====================================================================</EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_73"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1136_14" HREF="terminal_interface-curses__adb.htm#ref_1212_14">Untouch</A></FONT> (<FONT COLOR=red><A NAME="ref_1136_23" HREF="terminal_interface-curses__adb.htm#ref_1212_23">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1136_14" HREF="terminal_interface-curses__adb.htm#ref_1212_14">Untouch</A></FONT> (<FONT COLOR=red><A NAME="ref_1136_23" HREF="terminal_interface-curses__adb.htm#ref_1212_23">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_touch.3x.html">untouchwin()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses__ads.htm#ref_1136_14">Untouch</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_74"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1141_14" HREF="terminal_interface-curses__adb.htm#ref_1203_14">Touch</A></FONT> (<FONT COLOR=red><A NAME="ref_1141_21" HREF="terminal_interface-curses__adb.htm#ref_1203_21">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1141_14" HREF="terminal_interface-curses__adb.htm#ref_1203_14">Touch</A></FONT> (<FONT COLOR=red><A NAME="ref_1141_21" HREF="terminal_interface-curses__adb.htm#ref_1203_21">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_touch.3x.html">touchwin()</A></EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_75"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1145_14" HREF="terminal_interface-curses__adb.htm#ref_1221_14">Touch</A></FONT> (<FONT COLOR=red><A NAME="ref_1145_21" HREF="terminal_interface-curses__adb.htm#ref_1221_21">Win</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-                    <FONT COLOR=red><A NAME="ref_1146_21" HREF="terminal_interface-curses__adb.htm#ref_1222_21">Start</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
-                    <FONT COLOR=red><A NAME="ref_1147_21" HREF="terminal_interface-curses__adb.htm#ref_1223_21">Count</A></FONT> : <b>in</b> Positive);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1145_14" HREF="terminal_interface-curses__adb.htm#ref_1221_14">Touch</A></FONT> (<FONT COLOR=red><A NAME="ref_1145_21" HREF="terminal_interface-curses__adb.htm#ref_1221_21">Win</A></FONT>   : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+                    <FONT COLOR=red><A NAME="ref_1146_21" HREF="terminal_interface-curses__adb.htm#ref_1222_21">Start</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
+                    <FONT COLOR=red><A NAME="ref_1147_21" HREF="terminal_interface-curses__adb.htm#ref_1223_21">Count</A></FONT> : Positive);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_touch.3x.html">touchline()</A></EM></FONT>
    <b>pragma</b> Inline (Touch);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_76"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1152_14" HREF="terminal_interface-curses__adb.htm#ref_1186_14">Change_Lines_Status</A></FONT> (<FONT COLOR=red><A NAME="ref_1152_35" HREF="terminal_interface-curses__adb.htm#ref_1186_35">Win</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-                                  <FONT COLOR=red><A NAME="ref_1153_35" HREF="terminal_interface-curses__adb.htm#ref_1187_35">Start</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
-                                  <FONT COLOR=red><A NAME="ref_1154_35" HREF="terminal_interface-curses__adb.htm#ref_1188_35">Count</A></FONT> : <b>in</b> Positive;
-                                  <FONT COLOR=red><A NAME="ref_1155_35" HREF="terminal_interface-curses__adb.htm#ref_1189_35">State</A></FONT> : <b>in</b> Boolean);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1152_14" HREF="terminal_interface-curses__adb.htm#ref_1186_14">Change_Lines_Status</A></FONT> (<FONT COLOR=red><A NAME="ref_1152_35" HREF="terminal_interface-curses__adb.htm#ref_1186_35">Win</A></FONT>   : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+                                  <FONT COLOR=red><A NAME="ref_1153_35" HREF="terminal_interface-curses__adb.htm#ref_1187_35">Start</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
+                                  <FONT COLOR=red><A NAME="ref_1154_35" HREF="terminal_interface-curses__adb.htm#ref_1188_35">Count</A></FONT> : Positive;
+                                  <FONT COLOR=red><A NAME="ref_1155_35" HREF="terminal_interface-curses__adb.htm#ref_1189_35">State</A></FONT> : Boolean);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_touch.3x.html">wtouchln()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses__ads.htm#ref_1152_14">Change_Lines_Status</A>);
 
@@ -1177,27 +1177,27 @@
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_79"#2|</EM></FONT>
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_1174_14" HREF="terminal_interface-curses__adb.htm#ref_1256_14">Copy</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_1175_7" HREF="terminal_interface-curses__adb.htm#ref_1257_7">Source_Window</A></FONT>            : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
-      <FONT COLOR=red><A NAME="ref_1176_7" HREF="terminal_interface-curses__adb.htm#ref_1258_7">Destination_Window</A></FONT>       : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
-      <FONT COLOR=red><A NAME="ref_1177_7" HREF="terminal_interface-curses__adb.htm#ref_1259_7">Source_Top_Row</A></FONT>           : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
-      <FONT COLOR=red><A NAME="ref_1178_7" HREF="terminal_interface-curses__adb.htm#ref_1260_7">Source_Left_Column</A></FONT>       : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
-      <FONT COLOR=red><A NAME="ref_1179_7" HREF="terminal_interface-curses__adb.htm#ref_1261_7">Destination_Top_Row</A></FONT>      : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
-      <FONT COLOR=red><A NAME="ref_1180_7" HREF="terminal_interface-curses__adb.htm#ref_1262_7">Destination_Left_Column</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
-      <FONT COLOR=red><A NAME="ref_1181_7" HREF="terminal_interface-curses__adb.htm#ref_1263_7">Destination_Bottom_Row</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
-      <FONT COLOR=red><A NAME="ref_1182_7" HREF="terminal_interface-curses__adb.htm#ref_1264_7">Destination_Right_Column</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
-      <FONT COLOR=red><A NAME="ref_1183_7" HREF="terminal_interface-curses__adb.htm#ref_1265_7">Non_Destructive_Mode</A></FONT>     : <b>in</b> Boolean := True);
+     (<FONT COLOR=red><A NAME="ref_1175_7" HREF="terminal_interface-curses__adb.htm#ref_1257_7">Source_Window</A></FONT>            : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
+      <FONT COLOR=red><A NAME="ref_1176_7" HREF="terminal_interface-curses__adb.htm#ref_1258_7">Destination_Window</A></FONT>       : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
+      <FONT COLOR=red><A NAME="ref_1177_7" HREF="terminal_interface-curses__adb.htm#ref_1259_7">Source_Top_Row</A></FONT>           : <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
+      <FONT COLOR=red><A NAME="ref_1178_7" HREF="terminal_interface-curses__adb.htm#ref_1260_7">Source_Left_Column</A></FONT>       : <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
+      <FONT COLOR=red><A NAME="ref_1179_7" HREF="terminal_interface-curses__adb.htm#ref_1261_7">Destination_Top_Row</A></FONT>      : <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
+      <FONT COLOR=red><A NAME="ref_1180_7" HREF="terminal_interface-curses__adb.htm#ref_1262_7">Destination_Left_Column</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
+      <FONT COLOR=red><A NAME="ref_1181_7" HREF="terminal_interface-curses__adb.htm#ref_1263_7">Destination_Bottom_Row</A></FONT>   : <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
+      <FONT COLOR=red><A NAME="ref_1182_7" HREF="terminal_interface-curses__adb.htm#ref_1264_7">Destination_Right_Column</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
+      <FONT COLOR=red><A NAME="ref_1183_7" HREF="terminal_interface-curses__adb.htm#ref_1265_7">Non_Destructive_Mode</A></FONT>     : Boolean := True);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_overlay.3x.html">copywin()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses__ads.htm#ref_1174_14">Copy</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_80"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1188_14" HREF="terminal_interface-curses__adb.htm#ref_1292_14">Overwrite</A></FONT> (<FONT COLOR=red><A NAME="ref_1188_25" HREF="terminal_interface-curses__adb.htm#ref_1293_7">Source_Window</A></FONT>      : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
-                        <FONT COLOR=red><A NAME="ref_1189_25" HREF="terminal_interface-curses__adb.htm#ref_1294_7">Destination_Window</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1188_14" HREF="terminal_interface-curses__adb.htm#ref_1292_14">Overwrite</A></FONT> (<FONT COLOR=red><A NAME="ref_1188_25" HREF="terminal_interface-curses__adb.htm#ref_1293_7">Source_Window</A></FONT>      : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
+                        <FONT COLOR=red><A NAME="ref_1189_25" HREF="terminal_interface-curses__adb.htm#ref_1294_7">Destination_Window</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_overlay.3x.html">overwrite()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses__ads.htm#ref_1188_14">Overwrite</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_81"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1194_14" HREF="terminal_interface-curses__adb.htm#ref_1304_14">Overlay</A></FONT> (<FONT COLOR=red><A NAME="ref_1194_23" HREF="terminal_interface-curses__adb.htm#ref_1305_7">Source_Window</A></FONT>      : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
-                      <FONT COLOR=red><A NAME="ref_1195_23" HREF="terminal_interface-curses__adb.htm#ref_1306_7">Destination_Window</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1194_14" HREF="terminal_interface-curses__adb.htm#ref_1304_14">Overlay</A></FONT> (<FONT COLOR=red><A NAME="ref_1194_23" HREF="terminal_interface-curses__adb.htm#ref_1305_7">Source_Window</A></FONT>      : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
+                      <FONT COLOR=red><A NAME="ref_1195_23" HREF="terminal_interface-curses__adb.htm#ref_1306_7">Destination_Window</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_overlay.3x.html">overlay()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses__ads.htm#ref_1194_14">Overlay</A>);
 
@@ -1207,20 +1207,20 @@
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_82"#2|</EM></FONT>
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_1204_14" HREF="terminal_interface-curses__adb.htm#ref_1317_14">Insert_Delete_Lines</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_1205_7" HREF="terminal_interface-curses__adb.htm#ref_1318_7">Win</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>  := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-      <FONT COLOR=red><A NAME="ref_1206_7" HREF="terminal_interface-curses__adb.htm#ref_1319_7">Lines</A></FONT> : <b>in</b> Integer := 1); <FONT COLOR=green><EM>--  default is to insert one line above</EM></FONT>
+     (<FONT COLOR=red><A NAME="ref_1205_7" HREF="terminal_interface-curses__adb.htm#ref_1318_7">Win</A></FONT>   : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>  := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+      <FONT COLOR=red><A NAME="ref_1206_7" HREF="terminal_interface-curses__adb.htm#ref_1319_7">Lines</A></FONT> : Integer := 1); <FONT COLOR=green><EM>--  default is to insert one line above</EM></FONT>
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_deleteln.3x.html">winsdelln()</A></EM></FONT>
    <FONT COLOR=green><EM>--  AKA: insdelln()</EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses__ads.htm#ref_1204_14">Insert_Delete_Lines</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_83"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1212_14" HREF="terminal_interface-curses__adb.htm#ref_1329_14">Delete_Line</A></FONT> (<FONT COLOR=red><A NAME="ref_1212_27" HREF="terminal_interface-curses__adb.htm#ref_1329_27">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1212_14" HREF="terminal_interface-curses__adb.htm#ref_1329_14">Delete_Line</A></FONT> (<FONT COLOR=red><A NAME="ref_1212_27" HREF="terminal_interface-curses__adb.htm#ref_1329_27">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_deleteln.3x.html">wdeleteln()</A></EM></FONT>
    <FONT COLOR=green><EM>--  AKA: deleteln()</EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses__ads.htm#ref_1212_14">Delete_Line</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_84"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1218_14" HREF="terminal_interface-curses__adb.htm#ref_1335_14">Insert_Line</A></FONT> (<FONT COLOR=red><A NAME="ref_1218_27" HREF="terminal_interface-curses__adb.htm#ref_1335_27">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1218_14" HREF="terminal_interface-curses__adb.htm#ref_1335_14">Insert_Line</A></FONT> (<FONT COLOR=red><A NAME="ref_1218_27" HREF="terminal_interface-curses__adb.htm#ref_1335_27">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_deleteln.3x.html">winsertln()</A></EM></FONT>
    <FONT COLOR=green><EM>--  AKA: insertln()</EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses__ads.htm#ref_1218_14">Insert_Line</A>);
@@ -1231,7 +1231,7 @@
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_85"#2|</EM></FONT>
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_1228_14" HREF="terminal_interface-curses__adb.htm#ref_1342_14">Get_Size</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_1229_7" HREF="terminal_interface-curses__adb.htm#ref_1343_7">Win</A></FONT>               : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+     (<FONT COLOR=red><A NAME="ref_1229_7" HREF="terminal_interface-curses__adb.htm#ref_1343_7">Win</A></FONT>               : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
       <FONT COLOR=red><A NAME="ref_1230_7" HREF="terminal_interface-curses__adb.htm#ref_1344_7">Number_Of_Lines</A></FONT>   : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_63_12">Line_Count</A>;
       <FONT COLOR=red><A NAME="ref_1231_7" HREF="terminal_interface-curses__adb.htm#ref_1345_7">Number_Of_Columns</A></FONT> : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_65_12">Column_Count</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_getyx.3x.html">getmaxyx()</A></EM></FONT>
@@ -1239,7 +1239,7 @@
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_86"#2|</EM></FONT>
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_1236_14" HREF="terminal_interface-curses__adb.htm#ref_1362_14">Get_Window_Position</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_1237_7" HREF="terminal_interface-curses__adb.htm#ref_1363_7">Win</A></FONT>             : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+     (<FONT COLOR=red><A NAME="ref_1237_7" HREF="terminal_interface-curses__adb.htm#ref_1363_7">Win</A></FONT>             : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
       <FONT COLOR=red><A NAME="ref_1238_7" HREF="terminal_interface-curses__adb.htm#ref_1364_7">Top_Left_Line</A></FONT>   : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
       <FONT COLOR=red><A NAME="ref_1239_7" HREF="terminal_interface-curses__adb.htm#ref_1365_7">Top_Left_Column</A></FONT> : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_getyx.3x.html">getbegyx()</A></EM></FONT>
@@ -1247,7 +1247,7 @@
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_87"#2|</EM></FONT>
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_1244_14" HREF="terminal_interface-curses__adb.htm#ref_1380_14">Get_Cursor_Position</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_1245_7" HREF="terminal_interface-curses__adb.htm#ref_1381_7">Win</A></FONT>    : <b>in</b>  <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+     (<FONT COLOR=red><A NAME="ref_1245_7" HREF="terminal_interface-curses__adb.htm#ref_1381_7">Win</A></FONT>    : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
       <FONT COLOR=red><A NAME="ref_1246_7" HREF="terminal_interface-curses__adb.htm#ref_1382_7">Line</A></FONT>   : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
       <FONT COLOR=red><A NAME="ref_1247_7" HREF="terminal_interface-curses__adb.htm#ref_1383_7">Column</A></FONT> : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_getyx.3x.html">getyx()</A></EM></FONT>
@@ -1255,7 +1255,7 @@
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_88"#2|</EM></FONT>
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_1252_14" HREF="terminal_interface-curses__adb.htm#ref_1398_14">Get_Origin_Relative_To_Parent</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_1253_7" HREF="terminal_interface-curses__adb.htm#ref_1399_7">Win</A></FONT>                : <b>in</b>  <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
+     (<FONT COLOR=red><A NAME="ref_1253_7" HREF="terminal_interface-curses__adb.htm#ref_1399_7">Win</A></FONT>                : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
       <FONT COLOR=red><A NAME="ref_1254_7" HREF="terminal_interface-curses__adb.htm#ref_1400_7">Top_Left_Line</A></FONT>      : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
       <FONT COLOR=red><A NAME="ref_1255_7" HREF="terminal_interface-curses__adb.htm#ref_1401_7">Top_Left_Column</A></FONT>    : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
       <FONT COLOR=red><A NAME="ref_1256_7" HREF="terminal_interface-curses__adb.htm#ref_1402_7">Is_Not_A_Subwindow</A></FONT> : <b>out</b> Boolean);
@@ -1286,37 +1286,37 @@
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_91"#2|</EM></FONT>
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_1283_14" HREF="terminal_interface-curses__adb.htm#ref_1467_14">Refresh</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_1284_7" HREF="terminal_interface-curses__adb.htm#ref_1468_7">Pad</A></FONT>                      : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
-      <FONT COLOR=red><A NAME="ref_1285_7" HREF="terminal_interface-curses__adb.htm#ref_1469_7">Source_Top_Row</A></FONT>           : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
-      <FONT COLOR=red><A NAME="ref_1286_7" HREF="terminal_interface-curses__adb.htm#ref_1470_7">Source_Left_Column</A></FONT>       : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
-      <FONT COLOR=red><A NAME="ref_1287_7" HREF="terminal_interface-curses__adb.htm#ref_1471_7">Destination_Top_Row</A></FONT>      : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
-      <FONT COLOR=red><A NAME="ref_1288_7" HREF="terminal_interface-curses__adb.htm#ref_1472_7">Destination_Left_Column</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
-      <FONT COLOR=red><A NAME="ref_1289_7" HREF="terminal_interface-curses__adb.htm#ref_1473_7">Destination_Bottom_Row</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
-      <FONT COLOR=red><A NAME="ref_1290_7" HREF="terminal_interface-curses__adb.htm#ref_1474_7">Destination_Right_Column</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>);
+     (<FONT COLOR=red><A NAME="ref_1284_7" HREF="terminal_interface-curses__adb.htm#ref_1468_7">Pad</A></FONT>                      : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
+      <FONT COLOR=red><A NAME="ref_1285_7" HREF="terminal_interface-curses__adb.htm#ref_1469_7">Source_Top_Row</A></FONT>           : <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
+      <FONT COLOR=red><A NAME="ref_1286_7" HREF="terminal_interface-curses__adb.htm#ref_1470_7">Source_Left_Column</A></FONT>       : <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
+      <FONT COLOR=red><A NAME="ref_1287_7" HREF="terminal_interface-curses__adb.htm#ref_1471_7">Destination_Top_Row</A></FONT>      : <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
+      <FONT COLOR=red><A NAME="ref_1288_7" HREF="terminal_interface-curses__adb.htm#ref_1472_7">Destination_Left_Column</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
+      <FONT COLOR=red><A NAME="ref_1289_7" HREF="terminal_interface-curses__adb.htm#ref_1473_7">Destination_Bottom_Row</A></FONT>   : <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
+      <FONT COLOR=red><A NAME="ref_1290_7" HREF="terminal_interface-curses__adb.htm#ref_1474_7">Destination_Right_Column</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_pad.3x.html">prefresh()</A></EM></FONT>
    <b>pragma</b> Inline (Refresh);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_92"#2|</EM></FONT>
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_1295_14" HREF="terminal_interface-curses__adb.htm#ref_1497_14">Refresh_Without_Update</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_1296_7" HREF="terminal_interface-curses__adb.htm#ref_1498_7">Pad</A></FONT>                      : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
-      <FONT COLOR=red><A NAME="ref_1297_7" HREF="terminal_interface-curses__adb.htm#ref_1499_7">Source_Top_Row</A></FONT>           : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
-      <FONT COLOR=red><A NAME="ref_1298_7" HREF="terminal_interface-curses__adb.htm#ref_1500_7">Source_Left_Column</A></FONT>       : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
-      <FONT COLOR=red><A NAME="ref_1299_7" HREF="terminal_interface-curses__adb.htm#ref_1501_7">Destination_Top_Row</A></FONT>      : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
-      <FONT COLOR=red><A NAME="ref_1300_7" HREF="terminal_interface-curses__adb.htm#ref_1502_7">Destination_Left_Column</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
-      <FONT COLOR=red><A NAME="ref_1301_7" HREF="terminal_interface-curses__adb.htm#ref_1503_7">Destination_Bottom_Row</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
-      <FONT COLOR=red><A NAME="ref_1302_7" HREF="terminal_interface-curses__adb.htm#ref_1504_7">Destination_Right_Column</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>);
+     (<FONT COLOR=red><A NAME="ref_1296_7" HREF="terminal_interface-curses__adb.htm#ref_1498_7">Pad</A></FONT>                      : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
+      <FONT COLOR=red><A NAME="ref_1297_7" HREF="terminal_interface-curses__adb.htm#ref_1499_7">Source_Top_Row</A></FONT>           : <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
+      <FONT COLOR=red><A NAME="ref_1298_7" HREF="terminal_interface-curses__adb.htm#ref_1500_7">Source_Left_Column</A></FONT>       : <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
+      <FONT COLOR=red><A NAME="ref_1299_7" HREF="terminal_interface-curses__adb.htm#ref_1501_7">Destination_Top_Row</A></FONT>      : <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
+      <FONT COLOR=red><A NAME="ref_1300_7" HREF="terminal_interface-curses__adb.htm#ref_1502_7">Destination_Left_Column</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
+      <FONT COLOR=red><A NAME="ref_1301_7" HREF="terminal_interface-curses__adb.htm#ref_1503_7">Destination_Bottom_Row</A></FONT>   : <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
+      <FONT COLOR=red><A NAME="ref_1302_7" HREF="terminal_interface-curses__adb.htm#ref_1504_7">Destination_Right_Column</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_pad.3x.html">pnoutrefresh()</A></EM></FONT>
    <b>pragma</b> Inline (Refresh_Without_Update);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_93"#2|</EM></FONT>
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_1307_14" HREF="terminal_interface-curses__adb.htm#ref_1527_14">Add_Character_To_Pad_And_Echo_It</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_1308_7" HREF="terminal_interface-curses__adb.htm#ref_1528_7">Pad</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
-      <FONT COLOR=red><A NAME="ref_1309_7" HREF="terminal_interface-curses__adb.htm#ref_1529_7">Ch</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A>);
+     (<FONT COLOR=red><A NAME="ref_1308_7" HREF="terminal_interface-curses__adb.htm#ref_1528_7">Pad</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
+      <FONT COLOR=red><A NAME="ref_1309_7" HREF="terminal_interface-curses__adb.htm#ref_1529_7">Ch</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_pad.3x.html">pechochar()</A></EM></FONT>
 
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_1312_14" HREF="terminal_interface-curses__adb.htm#ref_1540_14">Add_Character_To_Pad_And_Echo_It</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_1313_7" HREF="terminal_interface-curses__adb.htm#ref_1541_7">Pad</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
-      <FONT COLOR=red><A NAME="ref_1314_7" HREF="terminal_interface-curses__adb.htm#ref_1542_7">Ch</A></FONT>  : <b>in</b> Character);
+     (<FONT COLOR=red><A NAME="ref_1313_7" HREF="terminal_interface-curses__adb.htm#ref_1541_7">Pad</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
+      <FONT COLOR=red><A NAME="ref_1314_7" HREF="terminal_interface-curses__adb.htm#ref_1542_7">Ch</A></FONT>  : Character);
    <b>pragma</b> Inline (Add_Character_To_Pad_And_Echo_It);
 
    <FONT COLOR=green><EM>--  |=====================================================================</EM></FONT>
@@ -1324,8 +1324,8 @@
    <FONT COLOR=green><EM>--  |=====================================================================</EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_94"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1322_14" HREF="terminal_interface-curses__adb.htm#ref_1552_14">Scroll</A></FONT> (<FONT COLOR=red><A NAME="ref_1322_22" HREF="terminal_interface-curses__adb.htm#ref_1552_22">Win</A></FONT>    : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>  := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-                     <FONT COLOR=red><A NAME="ref_1323_22" HREF="terminal_interface-curses__adb.htm#ref_1553_22">Amount</A></FONT> : <b>in</b> Integer := 1);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1322_14" HREF="terminal_interface-curses__adb.htm#ref_1552_14">Scroll</A></FONT> (<FONT COLOR=red><A NAME="ref_1322_22" HREF="terminal_interface-curses__adb.htm#ref_1552_22">Win</A></FONT>    : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>  := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+                     <FONT COLOR=red><A NAME="ref_1323_22" HREF="terminal_interface-curses__adb.htm#ref_1553_22">Amount</A></FONT> : Integer := 1);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_scroll.3x.html">wscrl()</A></EM></FONT>
    <FONT COLOR=green><EM>--  AKA: scroll()</EM></FONT>
    <FONT COLOR=green><EM>--  AKA: scrl()</EM></FONT>
@@ -1336,15 +1336,15 @@
    <FONT COLOR=green><EM>--  |=====================================================================</EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_95"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1334_14" HREF="terminal_interface-curses__adb.htm#ref_1565_14">Delete_Character</A></FONT> (<FONT COLOR=red><A NAME="ref_1334_32" HREF="terminal_interface-curses__adb.htm#ref_1565_32">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1334_14" HREF="terminal_interface-curses__adb.htm#ref_1565_14">Delete_Character</A></FONT> (<FONT COLOR=red><A NAME="ref_1334_32" HREF="terminal_interface-curses__adb.htm#ref_1565_32">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_delch.3x.html">wdelch()</A></EM></FONT>
    <FONT COLOR=green><EM>--  AKA: delch()</EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_96"#2|</EM></FONT>
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_1339_14" HREF="terminal_interface-curses__adb.htm#ref_1575_14">Delete_Character</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_1340_7" HREF="terminal_interface-curses__adb.htm#ref_1576_7">Win</A></FONT>    : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-      <FONT COLOR=red><A NAME="ref_1341_7" HREF="terminal_interface-curses__adb.htm#ref_1577_7">Line</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
-      <FONT COLOR=red><A NAME="ref_1342_7" HREF="terminal_interface-curses__adb.htm#ref_1578_7">Column</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>);
+     (<FONT COLOR=red><A NAME="ref_1340_7" HREF="terminal_interface-curses__adb.htm#ref_1576_7">Win</A></FONT>    : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+      <FONT COLOR=red><A NAME="ref_1341_7" HREF="terminal_interface-curses__adb.htm#ref_1577_7">Line</A></FONT>   : <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
+      <FONT COLOR=red><A NAME="ref_1342_7" HREF="terminal_interface-curses__adb.htm#ref_1578_7">Column</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_delch.3x.html">mvwdelch()</A></EM></FONT>
    <FONT COLOR=green><EM>--  AKA: mvdelch()</EM></FONT>
    <b>pragma</b> Inline (Delete_Character);
@@ -1373,16 +1373,16 @@
    <FONT COLOR=green><EM>--  |=====================================================================</EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_99"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1371_14" HREF="terminal_interface-curses__adb.htm#ref_1612_14">Insert</A></FONT> (<FONT COLOR=red><A NAME="ref_1371_22" HREF="terminal_interface-curses__adb.htm#ref_1612_22">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-                     <FONT COLOR=red><A NAME="ref_1372_22" HREF="terminal_interface-curses__adb.htm#ref_1613_22">Ch</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1371_14" HREF="terminal_interface-curses__adb.htm#ref_1612_14">Insert</A></FONT> (<FONT COLOR=red><A NAME="ref_1371_22" HREF="terminal_interface-curses__adb.htm#ref_1612_22">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+                     <FONT COLOR=red><A NAME="ref_1372_22" HREF="terminal_interface-curses__adb.htm#ref_1613_22">Ch</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_insch.3x.html">winsch()</A></EM></FONT>
    <FONT COLOR=green><EM>--  AKA: insch()</EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_100"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1377_14" HREF="terminal_interface-curses__adb.htm#ref_1623_14">Insert</A></FONT> (<FONT COLOR=red><A NAME="ref_1377_22" HREF="terminal_interface-curses__adb.htm#ref_1624_7">Win</A></FONT>    : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-                     <FONT COLOR=red><A NAME="ref_1378_22" HREF="terminal_interface-curses__adb.htm#ref_1625_7">Line</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
-                     <FONT COLOR=red><A NAME="ref_1379_22" HREF="terminal_interface-curses__adb.htm#ref_1626_7">Column</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
-                     <FONT COLOR=red><A NAME="ref_1380_22" HREF="terminal_interface-curses__adb.htm#ref_1627_7">Ch</A></FONT>     : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1377_14" HREF="terminal_interface-curses__adb.htm#ref_1623_14">Insert</A></FONT> (<FONT COLOR=red><A NAME="ref_1377_22" HREF="terminal_interface-curses__adb.htm#ref_1624_7">Win</A></FONT>    : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+                     <FONT COLOR=red><A NAME="ref_1378_22" HREF="terminal_interface-curses__adb.htm#ref_1625_7">Line</A></FONT>   : <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
+                     <FONT COLOR=red><A NAME="ref_1379_22" HREF="terminal_interface-curses__adb.htm#ref_1626_7">Column</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
+                     <FONT COLOR=red><A NAME="ref_1380_22" HREF="terminal_interface-curses__adb.htm#ref_1627_7">Ch</A></FONT>     : <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_insch.3x.html">mvwinsch()</A></EM></FONT>
    <FONT COLOR=green><EM>--  AKA: mvinsch()</EM></FONT>
 
@@ -1391,20 +1391,20 @@
    <FONT COLOR=green><EM>--  |=====================================================================</EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_101"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1389_14" HREF="terminal_interface-curses__adb.htm#ref_1643_14">Insert</A></FONT> (<FONT COLOR=red><A NAME="ref_1389_22" HREF="terminal_interface-curses__adb.htm#ref_1643_22">Win</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-                     <FONT COLOR=red><A NAME="ref_1390_22" HREF="terminal_interface-curses__adb.htm#ref_1644_22">Str</A></FONT> : <b>in</b> String;
-                     <FONT COLOR=red><A NAME="ref_1391_22" HREF="terminal_interface-curses__adb.htm#ref_1645_22">Len</A></FONT> : <b>in</b> Integer := -1);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1389_14" HREF="terminal_interface-curses__adb.htm#ref_1643_14">Insert</A></FONT> (<FONT COLOR=red><A NAME="ref_1389_22" HREF="terminal_interface-curses__adb.htm#ref_1643_22">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+                     <FONT COLOR=red><A NAME="ref_1390_22" HREF="terminal_interface-curses__adb.htm#ref_1644_22">Str</A></FONT> : String;
+                     <FONT COLOR=red><A NAME="ref_1391_22" HREF="terminal_interface-curses__adb.htm#ref_1645_22">Len</A></FONT> : Integer := -1);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_insstr.3x.html">winsnstr()</A></EM></FONT>
    <FONT COLOR=green><EM>--  AKA: winsstr()</EM></FONT>
    <FONT COLOR=green><EM>--  AKA: insnstr()</EM></FONT>
    <FONT COLOR=green><EM>--  AKA: insstr()</EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_102"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1398_14" HREF="terminal_interface-curses__adb.htm#ref_1661_14">Insert</A></FONT> (<FONT COLOR=red><A NAME="ref_1398_22" HREF="terminal_interface-curses__adb.htm#ref_1662_7">Win</A></FONT>    : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-                     <FONT COLOR=red><A NAME="ref_1399_22" HREF="terminal_interface-curses__adb.htm#ref_1663_7">Line</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
-                     <FONT COLOR=red><A NAME="ref_1400_22" HREF="terminal_interface-curses__adb.htm#ref_1664_7">Column</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
-                     <FONT COLOR=red><A NAME="ref_1401_22" HREF="terminal_interface-curses__adb.htm#ref_1665_7">Str</A></FONT>    : <b>in</b> String;
-                     <FONT COLOR=red><A NAME="ref_1402_22" HREF="terminal_interface-curses__adb.htm#ref_1666_7">Len</A></FONT>    : <b>in</b> Integer := -1);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1398_14" HREF="terminal_interface-curses__adb.htm#ref_1661_14">Insert</A></FONT> (<FONT COLOR=red><A NAME="ref_1398_22" HREF="terminal_interface-curses__adb.htm#ref_1662_7">Win</A></FONT>    : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+                     <FONT COLOR=red><A NAME="ref_1399_22" HREF="terminal_interface-curses__adb.htm#ref_1663_7">Line</A></FONT>   : <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
+                     <FONT COLOR=red><A NAME="ref_1400_22" HREF="terminal_interface-curses__adb.htm#ref_1664_7">Column</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
+                     <FONT COLOR=red><A NAME="ref_1401_22" HREF="terminal_interface-curses__adb.htm#ref_1665_7">Str</A></FONT>    : String;
+                     <FONT COLOR=red><A NAME="ref_1402_22" HREF="terminal_interface-curses__adb.htm#ref_1666_7">Len</A></FONT>    : Integer := -1);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_insstr.3x.html">mvwinsnstr()</A></EM></FONT>
    <FONT COLOR=green><EM>--  AKA: mvwinsstr()</EM></FONT>
    <FONT COLOR=green><EM>--  AKA: mvinsnstr()</EM></FONT>
@@ -1416,20 +1416,20 @@
    <FONT COLOR=green><EM>--  |=====================================================================</EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_103"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1414_14" HREF="terminal_interface-curses__adb.htm#ref_1685_14">Peek</A></FONT> (<FONT COLOR=red><A NAME="ref_1414_20" HREF="terminal_interface-curses__adb.htm#ref_1685_20">Win</A></FONT> : <b>in</b>  <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1414_14" HREF="terminal_interface-curses__adb.htm#ref_1685_14">Peek</A></FONT> (<FONT COLOR=red><A NAME="ref_1414_20" HREF="terminal_interface-curses__adb.htm#ref_1685_20">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
                    <FONT COLOR=red><A NAME="ref_1415_20" HREF="terminal_interface-curses__adb.htm#ref_1686_20">Str</A></FONT> : <b>out</b> String;
-                   <FONT COLOR=red><A NAME="ref_1416_20" HREF="terminal_interface-curses__adb.htm#ref_1687_20">Len</A></FONT> : <b>in</b>  Integer := -1);
+                   <FONT COLOR=red><A NAME="ref_1416_20" HREF="terminal_interface-curses__adb.htm#ref_1687_20">Len</A></FONT> : Integer := -1);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_instr.3x.html">winnstr()</A></EM></FONT>
    <FONT COLOR=green><EM>--  AKA: winstr()</EM></FONT>
    <FONT COLOR=green><EM>--  AKA: innstr()</EM></FONT>
    <FONT COLOR=green><EM>--  AKA: instr()</EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_104"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1423_14" HREF="terminal_interface-curses__adb.htm#ref_1714_14">Peek</A></FONT> (<FONT COLOR=red><A NAME="ref_1423_20" HREF="terminal_interface-curses__adb.htm#ref_1715_7">Win</A></FONT>    : <b>in</b>  <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-                   <FONT COLOR=red><A NAME="ref_1424_20" HREF="terminal_interface-curses__adb.htm#ref_1716_7">Line</A></FONT>   : <b>in</b>  <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
-                   <FONT COLOR=red><A NAME="ref_1425_20" HREF="terminal_interface-curses__adb.htm#ref_1717_7">Column</A></FONT> : <b>in</b>  <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1423_14" HREF="terminal_interface-curses__adb.htm#ref_1714_14">Peek</A></FONT> (<FONT COLOR=red><A NAME="ref_1423_20" HREF="terminal_interface-curses__adb.htm#ref_1715_7">Win</A></FONT>    : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+                   <FONT COLOR=red><A NAME="ref_1424_20" HREF="terminal_interface-curses__adb.htm#ref_1716_7">Line</A></FONT>   : <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
+                   <FONT COLOR=red><A NAME="ref_1425_20" HREF="terminal_interface-curses__adb.htm#ref_1717_7">Column</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
                    <FONT COLOR=red><A NAME="ref_1426_20" HREF="terminal_interface-curses__adb.htm#ref_1718_7">Str</A></FONT>    : <b>out</b> String;
-                   <FONT COLOR=red><A NAME="ref_1427_20" HREF="terminal_interface-curses__adb.htm#ref_1719_7">Len</A></FONT>    : <b>in</b>  Integer := -1);
+                   <FONT COLOR=red><A NAME="ref_1427_20" HREF="terminal_interface-curses__adb.htm#ref_1719_7">Len</A></FONT>    : Integer := -1);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_instr.3x.html">mvwinnstr()</A></EM></FONT>
    <FONT COLOR=green><EM>--  AKA: mvwinstr()</EM></FONT>
    <FONT COLOR=green><EM>--  AKA: mvinnstr()</EM></FONT>
@@ -1440,20 +1440,20 @@
    <FONT COLOR=green><EM>--  |=====================================================================</EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_105"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1438_14" HREF="terminal_interface-curses__adb.htm#ref_1726_14">Peek</A></FONT> (<FONT COLOR=red><A NAME="ref_1438_20" HREF="terminal_interface-curses__adb.htm#ref_1727_7">Win</A></FONT> : <b>in</b>  <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1438_14" HREF="terminal_interface-curses__adb.htm#ref_1726_14">Peek</A></FONT> (<FONT COLOR=red><A NAME="ref_1438_20" HREF="terminal_interface-curses__adb.htm#ref_1727_7">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
                    <FONT COLOR=red><A NAME="ref_1439_20" HREF="terminal_interface-curses__adb.htm#ref_1728_7">Str</A></FONT> : <b>out</b> Attributed_String;
-                   <FONT COLOR=red><A NAME="ref_1440_20" HREF="terminal_interface-curses__adb.htm#ref_1729_7">Len</A></FONT> : <b>in</b>  Integer := -1);
+                   <FONT COLOR=red><A NAME="ref_1440_20" HREF="terminal_interface-curses__adb.htm#ref_1729_7">Len</A></FONT> : Integer := -1);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_inchstr.3x.html">winchnstr()</A></EM></FONT>
    <FONT COLOR=green><EM>--  AKA: winchstr()</EM></FONT>
    <FONT COLOR=green><EM>--  AKA: inchnstr()</EM></FONT>
    <FONT COLOR=green><EM>--  AKA: inchstr()</EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_106"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1447_14" HREF="terminal_interface-curses__adb.htm#ref_1763_14">Peek</A></FONT> (<FONT COLOR=red><A NAME="ref_1447_20" HREF="terminal_interface-curses__adb.htm#ref_1764_7">Win</A></FONT>    : <b>in</b>  <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-                   <FONT COLOR=red><A NAME="ref_1448_20" HREF="terminal_interface-curses__adb.htm#ref_1765_7">Line</A></FONT>   : <b>in</b>  <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
-                   <FONT COLOR=red><A NAME="ref_1449_20" HREF="terminal_interface-curses__adb.htm#ref_1766_7">Column</A></FONT> : <b>in</b>  <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1447_14" HREF="terminal_interface-curses__adb.htm#ref_1763_14">Peek</A></FONT> (<FONT COLOR=red><A NAME="ref_1447_20" HREF="terminal_interface-curses__adb.htm#ref_1764_7">Win</A></FONT>    : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+                   <FONT COLOR=red><A NAME="ref_1448_20" HREF="terminal_interface-curses__adb.htm#ref_1765_7">Line</A></FONT>   : <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
+                   <FONT COLOR=red><A NAME="ref_1449_20" HREF="terminal_interface-curses__adb.htm#ref_1766_7">Column</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
                    <FONT COLOR=red><A NAME="ref_1450_20" HREF="terminal_interface-curses__adb.htm#ref_1767_7">Str</A></FONT>    : <b>out</b> Attributed_String;
-                   <FONT COLOR=red><A NAME="ref_1451_20" HREF="terminal_interface-curses__adb.htm#ref_1768_7">Len</A></FONT>    : <b>in</b>  Integer := -1);
+                   <FONT COLOR=red><A NAME="ref_1451_20" HREF="terminal_interface-curses__adb.htm#ref_1768_7">Len</A></FONT>    : Integer := -1);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_inchstr.3x.html">mvwinchnstr()</A></EM></FONT>
    <FONT COLOR=green><EM>--  AKA: mvwinchstr()</EM></FONT>
    <FONT COLOR=green><EM>--  AKA: mvinchnstr()</EM></FONT>
@@ -1465,9 +1465,9 @@
    <FONT COLOR=green><EM>--  |=====================================================================</EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_107"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1463_14" HREF="terminal_interface-curses__adb.htm#ref_1775_14">Get</A></FONT> (<FONT COLOR=red><A NAME="ref_1463_19" HREF="terminal_interface-curses__adb.htm#ref_1775_19">Win</A></FONT> : <b>in</b>  <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1463_14" HREF="terminal_interface-curses__adb.htm#ref_1775_14">Get</A></FONT> (<FONT COLOR=red><A NAME="ref_1463_19" HREF="terminal_interface-curses__adb.htm#ref_1775_19">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
                   <FONT COLOR=red><A NAME="ref_1464_19" HREF="terminal_interface-curses__adb.htm#ref_1776_19">Str</A></FONT> : <b>out</b> String;
-                  <FONT COLOR=red><A NAME="ref_1465_19" HREF="terminal_interface-curses__adb.htm#ref_1777_19">Len</A></FONT> : <b>in</b>  Integer := -1);
+                  <FONT COLOR=red><A NAME="ref_1465_19" HREF="terminal_interface-curses__adb.htm#ref_1777_19">Len</A></FONT> : Integer := -1);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_getstr.3x.html">wgetnstr()</A></EM></FONT>
    <FONT COLOR=green><EM>--  AKA: wgetstr()</EM></FONT>
    <FONT COLOR=green><EM>--  AKA: getnstr()</EM></FONT>
@@ -1476,11 +1476,11 @@
    <FONT COLOR=green><EM>--  overflows.</EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_108"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1474_14" HREF="terminal_interface-curses__adb.htm#ref_1804_14">Get</A></FONT> (<FONT COLOR=red><A NAME="ref_1474_19" HREF="terminal_interface-curses__adb.htm#ref_1805_7">Win</A></FONT>    : <b>in</b>  <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
-                  <FONT COLOR=red><A NAME="ref_1475_19" HREF="terminal_interface-curses__adb.htm#ref_1806_7">Line</A></FONT>   : <b>in</b>  <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
-                  <FONT COLOR=red><A NAME="ref_1476_19" HREF="terminal_interface-curses__adb.htm#ref_1807_7">Column</A></FONT> : <b>in</b>  <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1474_14" HREF="terminal_interface-curses__adb.htm#ref_1804_14">Get</A></FONT> (<FONT COLOR=red><A NAME="ref_1474_19" HREF="terminal_interface-curses__adb.htm#ref_1805_7">Win</A></FONT>    : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+                  <FONT COLOR=red><A NAME="ref_1475_19" HREF="terminal_interface-curses__adb.htm#ref_1806_7">Line</A></FONT>   : <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
+                  <FONT COLOR=red><A NAME="ref_1476_19" HREF="terminal_interface-curses__adb.htm#ref_1807_7">Column</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
                   <FONT COLOR=red><A NAME="ref_1477_19" HREF="terminal_interface-curses__adb.htm#ref_1808_7">Str</A></FONT>    : <b>out</b> String;
-                  <FONT COLOR=red><A NAME="ref_1478_19" HREF="terminal_interface-curses__adb.htm#ref_1809_7">Len</A></FONT>    : <b>in</b>  Integer := -1);
+                  <FONT COLOR=red><A NAME="ref_1478_19" HREF="terminal_interface-curses__adb.htm#ref_1809_7">Len</A></FONT>    : Integer := -1);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_getstr.3x.html">mvwgetnstr()</A></EM></FONT>
    <FONT COLOR=green><EM>--  AKA: mvwgetstr()</EM></FONT>
    <FONT COLOR=green><EM>--  AKA: mvgetnstr()</EM></FONT>
@@ -1502,14 +1502,14 @@
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_109"#2|</EM></FONT>
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_1499_14" HREF="terminal_interface-curses__adb.htm#ref_1816_14">Init_Soft_Label_Keys</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_1500_7" HREF="terminal_interface-curses__adb.htm#ref_1817_7">Format</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_1491_9">Soft_Label_Key_Format</A> := <A HREF="terminal_interface-curses__ads.htm#ref_1491_35">Three_Two_Three</A>);
+     (<FONT COLOR=red><A NAME="ref_1500_7" HREF="terminal_interface-curses__adb.htm#ref_1817_7">Format</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_1491_9">Soft_Label_Key_Format</A> := <A HREF="terminal_interface-curses__ads.htm#ref_1491_35">Three_Two_Three</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_slk.3x.html">slk_init()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses__ads.htm#ref_1499_14">Init_Soft_Label_Keys</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_110"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1505_14" HREF="terminal_interface-curses__adb.htm#ref_1827_14">Set_Soft_Label_Key</A></FONT> (<FONT COLOR=red><A NAME="ref_1505_34" HREF="terminal_interface-curses__adb.htm#ref_1827_34">Label</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_1495_9">Label_Number</A>;
-                                 <FONT COLOR=red><A NAME="ref_1506_34" HREF="terminal_interface-curses__adb.htm#ref_1828_34">Text</A></FONT>  : <b>in</b> String;
-                                 <FONT COLOR=red><A NAME="ref_1507_34" HREF="terminal_interface-curses__adb.htm#ref_1829_34">Fmt</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_1496_9">Label_Justification</A> := <A HREF="terminal_interface-curses__ads.htm#ref_1496_33">Left</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1505_14" HREF="terminal_interface-curses__adb.htm#ref_1827_14">Set_Soft_Label_Key</A></FONT> (<FONT COLOR=red><A NAME="ref_1505_34" HREF="terminal_interface-curses__adb.htm#ref_1827_34">Label</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_1495_9">Label_Number</A>;
+                                 <FONT COLOR=red><A NAME="ref_1506_34" HREF="terminal_interface-curses__adb.htm#ref_1828_34">Text</A></FONT>  : String;
+                                 <FONT COLOR=red><A NAME="ref_1507_34" HREF="terminal_interface-curses__adb.htm#ref_1829_34">Fmt</A></FONT>   : <A HREF="terminal_interface-curses__ads.htm#ref_1496_9">Label_Justification</A> := <A HREF="terminal_interface-curses__ads.htm#ref_1496_33">Left</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_slk.3x.html">slk_set()</A></EM></FONT>
    <FONT COLOR=green><EM>--  We don't inline this procedure</EM></FONT>
 
@@ -1524,12 +1524,12 @@
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses__ads.htm#ref_1517_14">Refresh_Soft_Label_Keys_Without_Update</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_113"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1522_14" HREF="terminal_interface-curses__adb.htm#ref_1866_14">Get_Soft_Label_Key</A></FONT> (<FONT COLOR=red><A NAME="ref_1522_34" HREF="terminal_interface-curses__adb.htm#ref_1866_34">Label</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_1495_9">Label_Number</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1522_14" HREF="terminal_interface-curses__adb.htm#ref_1866_14">Get_Soft_Label_Key</A></FONT> (<FONT COLOR=red><A NAME="ref_1522_34" HREF="terminal_interface-curses__adb.htm#ref_1866_34">Label</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_1495_9">Label_Number</A>;
                                  <FONT COLOR=red><A NAME="ref_1523_34" HREF="terminal_interface-curses__adb.htm#ref_1867_34">Text</A></FONT>  : <b>out</b> String);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_slk.3x.html">slk_label()</A></EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_114"#2|</EM></FONT>
-   <b>function</b> <FONT COLOR=red><A NAME="ref_1527_13" HREF="terminal_interface-curses__adb.htm#ref_1875_13">Get_Soft_Label_Key</A></FONT> (<FONT COLOR=red><A NAME="ref_1527_33" HREF="terminal_interface-curses__adb.htm#ref_1875_33">Label</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_1495_9">Label_Number</A>) <b>return</b> String;
+   <b>function</b> <FONT COLOR=red><A NAME="ref_1527_13" HREF="terminal_interface-curses__adb.htm#ref_1875_13">Get_Soft_Label_Key</A></FONT> (<FONT COLOR=red><A NAME="ref_1527_33" HREF="terminal_interface-curses__adb.htm#ref_1875_33">Label</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_1495_9">Label_Number</A>) <b>return</b> String;
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_slk.3x.html">slk_label()</A></EM></FONT>
    <FONT COLOR=green><EM>--  Same as function</EM></FONT>
    <b>pragma</b> Inline (Get_Soft_Label_Key);
@@ -1551,16 +1551,16 @@
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_118"#2|</EM></FONT>
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_1548_14" HREF="terminal_interface-curses__adb.htm#ref_1913_14">Switch_Soft_Label_Key_Attributes</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_1549_7" HREF="terminal_interface-curses__adb.htm#ref_1914_7">Attr</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_307_9">Character_Attribute_Set</A>;
-      <FONT COLOR=red><A NAME="ref_1550_7" HREF="terminal_interface-curses__adb.htm#ref_1915_7">On</A></FONT>   : <b>in</b> Boolean := True);
+     (<FONT COLOR=red><A NAME="ref_1549_7" HREF="terminal_interface-curses__adb.htm#ref_1914_7">Attr</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_307_9">Character_Attribute_Set</A>;
+      <FONT COLOR=red><A NAME="ref_1550_7" HREF="terminal_interface-curses__adb.htm#ref_1915_7">On</A></FONT>   : Boolean := True);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_slk.3x.html">slk_attron()</A></EM></FONT>
    <FONT COLOR=green><EM>--  AKA: slk_attroff()</EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses__ads.htm#ref_1548_14">Switch_Soft_Label_Key_Attributes</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_119"#2|</EM></FONT>
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_1556_14" HREF="terminal_interface-curses__adb.htm#ref_1937_14">Set_Soft_Label_Key_Attributes</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_1557_7" HREF="terminal_interface-curses__adb.htm#ref_1938_7">Attr</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_307_9">Character_Attribute_Set</A> := <A HREF="terminal_interface-curses__ads.htm#ref_350_4">Normal_Video</A>;
-      <FONT COLOR=red><A NAME="ref_1558_7" HREF="terminal_interface-curses__adb.htm#ref_1939_7">Color</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A> := <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A>'First);
+     (<FONT COLOR=red><A NAME="ref_1557_7" HREF="terminal_interface-curses__adb.htm#ref_1938_7">Attr</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_307_9">Character_Attribute_Set</A> := <A HREF="terminal_interface-curses__ads.htm#ref_350_4">Normal_Video</A>;
+      <FONT COLOR=red><A NAME="ref_1558_7" HREF="terminal_interface-curses__adb.htm#ref_1939_7">Color</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A> := <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A>'First);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_slk.3x.html">slk_attrset()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses__ads.htm#ref_1556_14">Set_Soft_Label_Key_Attributes</A>);
 
@@ -1574,7 +1574,7 @@
    <b>pragma</b> Inline (Get_Soft_Label_Key_Attributes);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_122"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1572_14" HREF="terminal_interface-curses__adb.htm#ref_1973_14">Set_Soft_Label_Key_Color</A></FONT> (<FONT COLOR=red><A NAME="ref_1572_40" HREF="terminal_interface-curses__adb.htm#ref_1973_40">Pair</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1572_14" HREF="terminal_interface-curses__adb.htm#ref_1973_14">Set_Soft_Label_Key_Color</A></FONT> (<FONT COLOR=red><A NAME="ref_1572_40" HREF="terminal_interface-curses__adb.htm#ref_1973_40">Pair</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_slk.3x.html">slk_color()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses__ads.htm#ref_1572_14">Set_Soft_Label_Key_Color</A>);
 
@@ -1588,8 +1588,8 @@
    <FONT COLOR=green><EM>--  |=====================================================================</EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_123"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1586_14" HREF="terminal_interface-curses__adb.htm#ref_1984_14">Enable_Key</A></FONT> (<FONT COLOR=red><A NAME="ref_1586_26" HREF="terminal_interface-curses__adb.htm#ref_1984_26">Key</A></FONT>    : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_78_12">Special_Key_Code</A>;
-                         <FONT COLOR=red><A NAME="ref_1587_26" HREF="terminal_interface-curses__adb.htm#ref_1985_26">Enable</A></FONT> : <b>in</b> Boolean := True);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1586_14" HREF="terminal_interface-curses__adb.htm#ref_1984_14">Enable_Key</A></FONT> (<FONT COLOR=red><A NAME="ref_1586_26" HREF="terminal_interface-curses__adb.htm#ref_1984_26">Key</A></FONT>    : <A HREF="terminal_interface-curses__ads.htm#ref_78_12">Special_Key_Code</A>;
+                         <FONT COLOR=red><A NAME="ref_1587_26" HREF="terminal_interface-curses__adb.htm#ref_1985_26">Enable</A></FONT> : Boolean := True);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/keyok.3x.html">keyok()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses__ads.htm#ref_1586_14">Enable_Key</A>);
 
@@ -1598,8 +1598,8 @@
    <FONT COLOR=green><EM>--  |=====================================================================</EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_124"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1596_14" HREF="terminal_interface-curses__adb.htm#ref_1997_14">Define_Key</A></FONT> (<FONT COLOR=red><A NAME="ref_1596_26" HREF="terminal_interface-curses__adb.htm#ref_1997_26">Definition</A></FONT> : <b>in</b> String;
-                         <FONT COLOR=red><A NAME="ref_1597_26" HREF="terminal_interface-curses__adb.htm#ref_1998_26">Key</A></FONT>        : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_78_12">Special_Key_Code</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1596_14" HREF="terminal_interface-curses__adb.htm#ref_1997_14">Define_Key</A></FONT> (<FONT COLOR=red><A NAME="ref_1596_26" HREF="terminal_interface-curses__adb.htm#ref_1997_26">Definition</A></FONT> : String;
+                         <FONT COLOR=red><A NAME="ref_1597_26" HREF="terminal_interface-curses__adb.htm#ref_1998_26">Key</A></FONT>        : <A HREF="terminal_interface-curses__ads.htm#ref_78_12">Special_Key_Code</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/define_key.3x.html">define_key()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses__ads.htm#ref_1596_14">Define_Key</A>);
 
@@ -1612,30 +1612,30 @@
    <FONT COLOR=green><EM>--</EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_125"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1610_14" HREF="terminal_interface-curses__adb.htm#ref_90_14">Key_Name</A></FONT> (<FONT COLOR=red><A NAME="ref_1610_24" HREF="terminal_interface-curses__adb.htm#ref_90_24">Key</A></FONT>  : <b>in</b>  <A HREF="terminal_interface-curses__ads.htm#ref_73_12">Real_Key_Code</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1610_14" HREF="terminal_interface-curses__adb.htm#ref_90_14">Key_Name</A></FONT> (<FONT COLOR=red><A NAME="ref_1610_24" HREF="terminal_interface-curses__adb.htm#ref_90_24">Key</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_73_12">Real_Key_Code</A>;
                        <FONT COLOR=red><A NAME="ref_1611_24" HREF="terminal_interface-curses__adb.htm#ref_91_24">Name</A></FONT> : <b>out</b> String);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_util.3x.html">keyname()</A></EM></FONT>
    <FONT COLOR=green><EM>--  The external name for a real keystroke.</EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_126"#2|</EM></FONT>
-   <b>function</b> <FONT COLOR=red><A NAME="ref_1616_13" HREF="terminal_interface-curses__adb.htm#ref_62_13">Key_Name</A></FONT> (<FONT COLOR=red><A NAME="ref_1616_23" HREF="terminal_interface-curses__adb.htm#ref_62_23">Key</A></FONT>  : <b>in</b>  <A HREF="terminal_interface-curses__ads.htm#ref_73_12">Real_Key_Code</A>) <b>return</b> String;
+   <b>function</b> <FONT COLOR=red><A NAME="ref_1616_13" HREF="terminal_interface-curses__adb.htm#ref_62_13">Key_Name</A></FONT> (<FONT COLOR=red><A NAME="ref_1616_23" HREF="terminal_interface-curses__adb.htm#ref_62_23">Key</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_73_12">Real_Key_Code</A>) <b>return</b> String;
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_util.3x.html">keyname()</A></EM></FONT>
    <FONT COLOR=green><EM>--  Same as function</EM></FONT>
    <FONT COLOR=green><EM>--  We don't inline this routine</EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_127"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1622_14" HREF="terminal_interface-curses__adb.htm#ref_2013_14">Un_Control</A></FONT> (<FONT COLOR=red><A NAME="ref_1622_26" HREF="terminal_interface-curses__adb.htm#ref_2013_26">Ch</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1622_14" HREF="terminal_interface-curses__adb.htm#ref_2013_14">Un_Control</A></FONT> (<FONT COLOR=red><A NAME="ref_1622_26" HREF="terminal_interface-curses__adb.htm#ref_2013_26">Ch</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A>;
                          <FONT COLOR=red><A NAME="ref_1623_26" HREF="terminal_interface-curses__adb.htm#ref_2014_26">Str</A></FONT> : <b>out</b> String);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_util.3x.html">unctrl()</A></EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_128"#2|</EM></FONT>
-   <b>function</b> <FONT COLOR=red><A NAME="ref_1627_13" HREF="terminal_interface-curses__adb.htm#ref_2022_13">Un_Control</A></FONT> (<FONT COLOR=red><A NAME="ref_1627_25" HREF="terminal_interface-curses__adb.htm#ref_2022_25">Ch</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A>) <b>return</b> String;
+   <b>function</b> <FONT COLOR=red><A NAME="ref_1627_13" HREF="terminal_interface-curses__adb.htm#ref_2022_13">Un_Control</A></FONT> (<FONT COLOR=red><A NAME="ref_1627_25" HREF="terminal_interface-curses__adb.htm#ref_2022_25">Ch</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_352_9">Attributed_Character</A>) <b>return</b> String;
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_util.3x.html">unctrl()</A></EM></FONT>
    <FONT COLOR=green><EM>--  Same as function</EM></FONT>
    <b>pragma</b> Inline (Un_Control);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_129"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1633_14" HREF="terminal_interface-curses__adb.htm#ref_2030_14">Delay_Output</A></FONT> (<FONT COLOR=red><A NAME="ref_1633_28" HREF="terminal_interface-curses__adb.htm#ref_2030_28">Msecs</A></FONT> : <b>in</b> Natural);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1633_14" HREF="terminal_interface-curses__adb.htm#ref_2030_14">Delay_Output</A></FONT> (<FONT COLOR=red><A NAME="ref_1633_28" HREF="terminal_interface-curses__adb.htm#ref_2030_28">Msecs</A></FONT> : Natural);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_util.3x.html">delay_output()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses__ads.htm#ref_1633_14">Delay_Output</A>);
 
@@ -1714,14 +1714,14 @@
    <b>pragma</b> Import (C, Start_Color, "start_color");
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_142"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1712_14" HREF="terminal_interface-curses__adb.htm#ref_2140_14">Init_Pair</A></FONT> (<FONT COLOR=red><A NAME="ref_1712_25" HREF="terminal_interface-curses__adb.htm#ref_2140_25">Pair</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_301_12">Redefinable_Color_Pair</A>;
-                        <FONT COLOR=red><A NAME="ref_1713_25" HREF="terminal_interface-curses__adb.htm#ref_2141_25">Fore</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_278_9">Color_Number</A>;
-                        <FONT COLOR=red><A NAME="ref_1714_25" HREF="terminal_interface-curses__adb.htm#ref_2142_25">Back</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_278_9">Color_Number</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1712_14" HREF="terminal_interface-curses__adb.htm#ref_2140_14">Init_Pair</A></FONT> (<FONT COLOR=red><A NAME="ref_1712_25" HREF="terminal_interface-curses__adb.htm#ref_2140_25">Pair</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_301_12">Redefinable_Color_Pair</A>;
+                        <FONT COLOR=red><A NAME="ref_1713_25" HREF="terminal_interface-curses__adb.htm#ref_2141_25">Fore</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_278_9">Color_Number</A>;
+                        <FONT COLOR=red><A NAME="ref_1714_25" HREF="terminal_interface-curses__adb.htm#ref_2142_25">Back</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_278_9">Color_Number</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_color.3x.html">init_pair()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses__ads.htm#ref_1712_14">Init_Pair</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_143"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1719_14" HREF="terminal_interface-curses__adb.htm#ref_2162_14">Pair_Content</A></FONT> (<FONT COLOR=red><A NAME="ref_1719_28" HREF="terminal_interface-curses__adb.htm#ref_2162_28">Pair</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1719_14" HREF="terminal_interface-curses__adb.htm#ref_2162_14">Pair_Content</A></FONT> (<FONT COLOR=red><A NAME="ref_1719_28" HREF="terminal_interface-curses__adb.htm#ref_2162_28">Pair</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_299_9">Color_Pair</A>;
                            <FONT COLOR=red><A NAME="ref_1720_28" HREF="terminal_interface-curses__adb.htm#ref_2163_28">Fore</A></FONT> : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_278_9">Color_Number</A>;
                            <FONT COLOR=red><A NAME="ref_1721_28" HREF="terminal_interface-curses__adb.htm#ref_2164_28">Back</A></FONT> : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_278_9">Color_Number</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_color.3x.html">pair_content()</A></EM></FONT>
@@ -1733,10 +1733,10 @@
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses__ads.htm#ref_1726_13">Has_Colors</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_145"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1731_14" HREF="terminal_interface-curses__adb.htm#ref_2194_14">Init_Color</A></FONT> (<FONT COLOR=red><A NAME="ref_1731_26" HREF="terminal_interface-curses__adb.htm#ref_2194_26">Color</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_278_9">Color_Number</A>;
-                         <FONT COLOR=red><A NAME="ref_1732_26" HREF="terminal_interface-curses__adb.htm#ref_2195_26">Red</A></FONT>   : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_295_9">RGB_Value</A>;
-                         <FONT COLOR=red><A NAME="ref_1733_26" HREF="terminal_interface-curses__adb.htm#ref_2196_26">Green</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_295_9">RGB_Value</A>;
-                         <FONT COLOR=red><A NAME="ref_1734_26" HREF="terminal_interface-curses__adb.htm#ref_2197_26">Blue</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_295_9">RGB_Value</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1731_14" HREF="terminal_interface-curses__adb.htm#ref_2194_14">Init_Color</A></FONT> (<FONT COLOR=red><A NAME="ref_1731_26" HREF="terminal_interface-curses__adb.htm#ref_2194_26">Color</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_278_9">Color_Number</A>;
+                         <FONT COLOR=red><A NAME="ref_1732_26" HREF="terminal_interface-curses__adb.htm#ref_2195_26">Red</A></FONT>   : <A HREF="terminal_interface-curses__ads.htm#ref_295_9">RGB_Value</A>;
+                         <FONT COLOR=red><A NAME="ref_1733_26" HREF="terminal_interface-curses__adb.htm#ref_2196_26">Green</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_295_9">RGB_Value</A>;
+                         <FONT COLOR=red><A NAME="ref_1734_26" HREF="terminal_interface-curses__adb.htm#ref_2197_26">Blue</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_295_9">RGB_Value</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_color.3x.html">init_color()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses__ads.htm#ref_1731_14">Init_Color</A>);
 
@@ -1746,7 +1746,7 @@
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses__ads.htm#ref_1739_13">Can_Change_Color</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_147"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1744_14" HREF="terminal_interface-curses__adb.htm#ref_2223_14">Color_Content</A></FONT> (<FONT COLOR=red><A NAME="ref_1744_29" HREF="terminal_interface-curses__adb.htm#ref_2223_29">Color</A></FONT> : <b>in</b>  <A HREF="terminal_interface-curses__ads.htm#ref_278_9">Color_Number</A>;
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1744_14" HREF="terminal_interface-curses__adb.htm#ref_2223_14">Color_Content</A></FONT> (<FONT COLOR=red><A NAME="ref_1744_29" HREF="terminal_interface-curses__adb.htm#ref_2223_29">Color</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_278_9">Color_Number</A>;
                             <FONT COLOR=red><A NAME="ref_1745_29" HREF="terminal_interface-curses__adb.htm#ref_2224_29">Red</A></FONT>   : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_295_9">RGB_Value</A>;
                             <FONT COLOR=red><A NAME="ref_1746_29" HREF="terminal_interface-curses__adb.htm#ref_2225_29">Green</A></FONT> : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_295_9">RGB_Value</A>;
                             <FONT COLOR=red><A NAME="ref_1747_29" HREF="terminal_interface-curses__adb.htm#ref_2226_29">Blue</A></FONT>  : <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_295_9">RGB_Value</A>);
@@ -1761,13 +1761,13 @@
    <b>type</b> <FONT COLOR=red><A NAME="ref_1756_9">Curses_Mode</A></FONT> <b>is</b> (<FONT COLOR=red><A NAME="ref_1756_25">Curses</A></FONT>, <FONT COLOR=red><A NAME="ref_1756_33">Shell</A></FONT>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_148"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1759_14" HREF="terminal_interface-curses__adb.htm#ref_2247_14">Save_Curses_Mode</A></FONT> (<FONT COLOR=red><A NAME="ref_1759_32" HREF="terminal_interface-curses__adb.htm#ref_2247_32">Mode</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_1756_9">Curses_Mode</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1759_14" HREF="terminal_interface-curses__adb.htm#ref_2247_14">Save_Curses_Mode</A></FONT> (<FONT COLOR=red><A NAME="ref_1759_32" HREF="terminal_interface-curses__adb.htm#ref_2247_32">Mode</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_1756_9">Curses_Mode</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_kernel.3x.html">def_prog_mode()</A></EM></FONT>
    <FONT COLOR=green><EM>--  AKA: def_shell_mode()</EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses__ads.htm#ref_1759_14">Save_Curses_Mode</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_149"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1765_14" HREF="terminal_interface-curses__adb.htm#ref_2265_14">Reset_Curses_Mode</A></FONT> (<FONT COLOR=red><A NAME="ref_1765_33" HREF="terminal_interface-curses__adb.htm#ref_2265_33">Mode</A></FONT> : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_1756_9">Curses_Mode</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1765_14" HREF="terminal_interface-curses__adb.htm#ref_2265_14">Reset_Curses_Mode</A></FONT> (<FONT COLOR=red><A NAME="ref_1765_33" HREF="terminal_interface-curses__adb.htm#ref_2265_33">Mode</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_1756_9">Curses_Mode</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_kernel.3x.html">reset_prog_mode()</A></EM></FONT>
    <FONT COLOR=green><EM>--  AKA: reset_shell_mode()</EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses__ads.htm#ref_1765_14">Reset_Curses_Mode</A>);
@@ -1791,8 +1791,8 @@
    <FONT COLOR=green><EM>--        and -1 otherwise.</EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_152"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1789_14" HREF="terminal_interface-curses__adb.htm#ref_2303_14">Rip_Off_Lines</A></FONT> (<FONT COLOR=red><A NAME="ref_1789_29" HREF="terminal_interface-curses__adb.htm#ref_2303_29">Lines</A></FONT> : <b>in</b> Integer;
-                            <FONT COLOR=red><A NAME="ref_1790_29" HREF="terminal_interface-curses__adb.htm#ref_2304_29">Proc</A></FONT>  : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_1780_9">Stdscr_Init_Proc</A>);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1789_14" HREF="terminal_interface-curses__adb.htm#ref_2303_14">Rip_Off_Lines</A></FONT> (<FONT COLOR=red><A NAME="ref_1789_29" HREF="terminal_interface-curses__adb.htm#ref_2303_29">Lines</A></FONT> : Integer;
+                            <FONT COLOR=red><A NAME="ref_1790_29" HREF="terminal_interface-curses__adb.htm#ref_2304_29">Proc</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_1780_9">Stdscr_Init_Proc</A>);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_kernel.3x.html">ripoffline()</A></EM></FONT>
    <FONT COLOR=green><EM>--  N.B.: to be more precise, this uses a ncurses specific enhancement of</EM></FONT>
    <FONT COLOR=green><EM>--        ripoffline(), in which the Lines argument absolute value is the</EM></FONT>
@@ -1808,7 +1808,7 @@
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses__ads.htm#ref_1801_14">Set_Cursor_Visibility</A>);
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_154"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1806_14" HREF="terminal_interface-curses__adb.htm#ref_2328_14">Nap_Milli_Seconds</A></FONT> (<FONT COLOR=red><A NAME="ref_1806_33" HREF="terminal_interface-curses__adb.htm#ref_2328_33">Ms</A></FONT> : <b>in</b> Natural);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1806_14" HREF="terminal_interface-curses__adb.htm#ref_2328_14">Nap_Milli_Seconds</A></FONT> (<FONT COLOR=red><A NAME="ref_1806_33" HREF="terminal_interface-curses__adb.htm#ref_2328_33">Ms</A></FONT> : Natural);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_kernel.3x.html">napms()</A></EM></FONT>
    <b>pragma</b> Inline (<A HREF="terminal_interface-curses__ads.htm#ref_1806_14">Nap_Milli_Seconds</A>);
 
@@ -1817,10 +1817,10 @@
    <FONT COLOR=green><EM>--  |=====================================================================</EM></FONT>
    <b>type</b> <FONT COLOR=red><A NAME="ref_1813_9">Transform_Direction</A></FONT> <b>is</b> (<FONT COLOR=red><A NAME="ref_1813_33">From_Screen</A></FONT>, <FONT COLOR=red><A NAME="ref_1813_46">To_Screen</A></FONT>);
    <b>procedure</b> <FONT COLOR=red><A NAME="ref_1814_14" HREF="terminal_interface-curses__adb.htm#ref_2396_14">Transform_Coordinates</A></FONT>
-     (<FONT COLOR=red><A NAME="ref_1815_7" HREF="terminal_interface-curses__adb.htm#ref_2397_7">W</A></FONT>      : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
+     (<FONT COLOR=red><A NAME="ref_1815_7" HREF="terminal_interface-curses__adb.htm#ref_2397_7">W</A></FONT>      : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A> := <A HREF="terminal_interface-curses__ads.htm#ref_476_13">Standard_Window</A>;
       <FONT COLOR=red><A NAME="ref_1816_7" HREF="terminal_interface-curses__adb.htm#ref_2398_7">Line</A></FONT>   : <b>in</b> <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_60_9">Line_Position</A>;
       <FONT COLOR=red><A NAME="ref_1817_7" HREF="terminal_interface-curses__adb.htm#ref_2399_7">Column</A></FONT> : <b>in</b> <b>out</b> <A HREF="terminal_interface-curses__ads.htm#ref_61_9">Column_Position</A>;
-      <FONT COLOR=red><A NAME="ref_1818_7" HREF="terminal_interface-curses__adb.htm#ref_2400_7">Dir</A></FONT>    : <b>in</b> <A HREF="terminal_interface-curses__ads.htm#ref_1813_9">Transform_Direction</A> := <A HREF="terminal_interface-curses__ads.htm#ref_1813_33">From_Screen</A>);
+      <FONT COLOR=red><A NAME="ref_1818_7" HREF="terminal_interface-curses__adb.htm#ref_2400_7">Dir</A></FONT>    : <A HREF="terminal_interface-curses__ads.htm#ref_1813_9">Transform_Direction</A> := <A HREF="terminal_interface-curses__ads.htm#ref_1813_33">From_Screen</A>);
    <FONT COLOR=green><EM>--  This procedure transforms screen coordinates into coordinates relative</EM></FONT>
    <FONT COLOR=green><EM>--  to the window and vice versa, depending on the Dir parameter.</EM></FONT>
    <FONT COLOR=green><EM>--  Screen coordinates are the position informations on the physical device.</EM></FONT>
@@ -1869,25 +1869,25 @@
    <FONT COLOR=green><EM>--  |=====================================================================</EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_160"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1867_14" HREF="terminal_interface-curses__adb.htm#ref_2488_14">Screen_Dump_To_File</A></FONT> (<FONT COLOR=red><A NAME="ref_1867_35" HREF="terminal_interface-curses__adb.htm#ref_2488_35">Filename</A></FONT> : <b>in</b> String);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1867_14" HREF="terminal_interface-curses__adb.htm#ref_2488_14">Screen_Dump_To_File</A></FONT> (<FONT COLOR=red><A NAME="ref_1867_35" HREF="terminal_interface-curses__adb.htm#ref_2488_35">Filename</A></FONT> : String);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_scr_dump.3x.html">scr_dump()</A></EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_161"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1871_14" HREF="terminal_interface-curses__adb.htm#ref_2501_14">Screen_Restore_From_File</A></FONT> (<FONT COLOR=red><A NAME="ref_1871_40" HREF="terminal_interface-curses__adb.htm#ref_2501_40">Filename</A></FONT> : <b>in</b> String);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1871_14" HREF="terminal_interface-curses__adb.htm#ref_2501_14">Screen_Restore_From_File</A></FONT> (<FONT COLOR=red><A NAME="ref_1871_40" HREF="terminal_interface-curses__adb.htm#ref_2501_40">Filename</A></FONT> : String);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_scr_dump.3x.html">scr_restore()</A></EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_162"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1875_14" HREF="terminal_interface-curses__adb.htm#ref_2514_14">Screen_Init_From_File</A></FONT> (<FONT COLOR=red><A NAME="ref_1875_37" HREF="terminal_interface-curses__adb.htm#ref_2514_37">Filename</A></FONT> : <b>in</b> String);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1875_14" HREF="terminal_interface-curses__adb.htm#ref_2514_14">Screen_Init_From_File</A></FONT> (<FONT COLOR=red><A NAME="ref_1875_37" HREF="terminal_interface-curses__adb.htm#ref_2514_37">Filename</A></FONT> : String);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_scr_dump.3x.html">scr_init()</A></EM></FONT>
 
    <FONT COLOR=green><EM>--  #1A NAME="AFU_163"#2|</EM></FONT>
-   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1879_14" HREF="terminal_interface-curses__adb.htm#ref_2527_14">Screen_Set_File</A></FONT> (<FONT COLOR=red><A NAME="ref_1879_31" HREF="terminal_interface-curses__adb.htm#ref_2527_31">Filename</A></FONT> : <b>in</b> String);
+   <b>procedure</b> <FONT COLOR=red><A NAME="ref_1879_14" HREF="terminal_interface-curses__adb.htm#ref_2527_14">Screen_Set_File</A></FONT> (<FONT COLOR=red><A NAME="ref_1879_31" HREF="terminal_interface-curses__adb.htm#ref_2527_31">Filename</A></FONT> : String);
    <FONT COLOR=green><EM>--  AKA: <A HREF="../man/curs_scr_dump.3x.html">scr_set()</A></EM></FONT>
 
    <FONT COLOR=green><EM>--  |=====================================================================</EM></FONT>
    <FONT COLOR=green><EM>--  | Man page <A HREF="../man/curs_print.3x.html">curs_print.3x</A></EM></FONT>
    <FONT COLOR=green><EM>--  |=====================================================================</EM></FONT>
-   <FONT COLOR=green><EM>--  Not implemented:  mcprint</EM></FONT>
+   <FONT COLOR=green><EM>--  Not implemented: mcprint</EM></FONT>
 
    <FONT COLOR=green><EM>--  |=====================================================================</EM></FONT>
    <FONT COLOR=green><EM>--  | Man page <A HREF="../man/curs_printw.3x.html">curs_printw.3x</A></EM></FONT>
@@ -1928,7 +1928,7 @@
    <FONT COLOR=red><A NAME="ref_1923_4">Sizeof_bool</A></FONT>        : <b>constant</b> Natural :=  1; <FONT COLOR=green><EM>--  bool</EM></FONT>
    <FONT COLOR=red><A NAME="ref_1924_4">Offset_XY</A></FONT>          : <b>constant</b> Natural :=  1; <FONT COLOR=green><EM>--  int</EM></FONT>
 
-   <b>type</b> <FONT COLOR=red><A NAME="ref_1926_9">Curses_Bool</A></FONT> <b>is</b> <b>mod</b> 2 ** <A HREF="interfac__ads.htm#ref_38_9">Interfaces</A>.C.char'Size;
+   <b>type</b> <FONT COLOR=red><A NAME="ref_1926_9">Curses_Bool</A></FONT> <b>is</b> <b>mod</b> 2 ** <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C.char'Size;
    <FONT COLOR=red><A NAME="ref_1927_4">Curses_Bool_False</A></FONT> : <b>constant</b> <A HREF="terminal_interface-curses__ads.htm#ref_1926_9">Curses_Bool</A> := 0;
 
 <b>end</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>;
diff -Naur ncurses-5.7.orig/doc/html/announce.html ncurses-5.7/doc/html/announce.html
--- ncurses-5.7.orig/doc/html/announce.html	2008-11-01 21:05:08.000000000 -0400
+++ ncurses-5.7/doc/html/announce.html	2011-01-08 18:18:29.638657816 -0500
@@ -1,8 +1,8 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.0//EN">
 <!--
-  $Id: announce.html,v 1.52 2008/11/02 01:05:08 tom Exp $
+  $Id: announce.html,v 1.53 2010/12/04 18:47:13 tom Exp $
   ****************************************************************************
-  * 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            *
@@ -578,11 +578,3 @@
 archive</A>&nbsp;.
 </BODY>
 </HTML>
-<!--
-# The following sets edit modes for GNU EMACS
-# Local Variables:
-# mode:html
-# case-fold-search:nil
-# fill-column:70
-# End:
--->
diff -Naur ncurses-5.7.orig/doc/html/hackguide.html ncurses-5.7/doc/html/hackguide.html
--- ncurses-5.7.orig/doc/html/hackguide.html	2005-12-24 10:37:13.000000000 -0500
+++ ncurses-5.7/doc/html/hackguide.html	2011-01-08 18:18:29.638657816 -0500
@@ -1,8 +1,8 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.0//EN">
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 <!--
-  $Id: hackguide.html,v 1.27 2005/12/24 15:37:13 tom Exp $
+  $Id: hackguide.html,v 1.28 2010/12/04 16:44:21 tom Exp $
   ****************************************************************************
-  * 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            *
diff -Naur ncurses-5.7.orig/doc/html/index.html ncurses-5.7/doc/html/index.html
--- ncurses-5.7.orig/doc/html/index.html	2006-04-22 18:29:12.000000000 -0400
+++ ncurses-5.7/doc/html/index.html	2011-01-08 18:18:29.638657816 -0500
@@ -1,8 +1,8 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.0//EN">
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 <!--
-  $Id: index.html,v 1.2 2006/04/22 22:29:12 tom Exp $
+  $Id: index.html,v 1.5 2010/12/04 18:36:44 tom Exp $
   ****************************************************************************
-  * 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            *
@@ -33,25 +33,19 @@
 <HEAD>
 <TITLE>Welcome to ncurses</TITLE>
 <link rev=made href="mailto:bug-ncurses@gnu.org">
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
 </HEAD>
 <BODY>
 
 <H1>Welcome to ncurses</H1>
 From this index page you have access to these further documents
 <UL>
-<LI>The <a href="announce.html">Announcement</a> of the current version of ncurses.</LI>
-<LI>An <a href="ncurses-intro.html">Introduction</a> into (n)curses programming.</LI>
-<LI>A <a href="hackguide.html">hackers guide</a> to ncurses.</LI>
-<LI>A description of the <a href="Ada95.html">Ada95 binding</a> to ncurses.</LI>
+<LI>The <a href="announce.html">Announcement</a> of the current version of ncurses.
+<LI>An <a href="ncurses-intro.html">Introduction</a> into (n)curses programming.
+<LI>A <a href="hackguide.html">hackers guide</a> to ncurses.
+<LI>A description of the <a href="Ada95.html">Ada95 binding</a>, by J&uuml;rgen Pfeifer.
+<li>A <a href="NCURSES-Programming-HOWTO.html">A short tutorial</a>, by Pradeep Padala.
 </UL><P>
 We also have HTML versions of all the ncurses <a href="man">manpages</a>.
 </BODY>
 </HTML>
-<!--
-# The following sets edit modes for GNU EMACS
-# Local Variables:
-# mode:html
-# case-fold-search:nil
-# fill-column:70
-# End:
--->
diff -Naur ncurses-5.7.orig/doc/html/man/adacurses-config.1.html ncurses-5.7/doc/html/man/adacurses-config.1.html
--- ncurses-5.7.orig/doc/html/man/adacurses-config.1.html	1969-12-31 19:00:00.000000000 -0500
+++ ncurses-5.7/doc/html/man/adacurses-config.1.html	2011-01-08 18:18:29.346656821 -0500
@@ -0,0 +1,96 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
+<!-- 
+  ****************************************************************************
+  * 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: MKada_config.in,v 1.3 2010/03/06 22:29:06 tom Exp @
+-->
+<HTML>
+<HEAD>
+<TITLE>ADACURSES 1   User Commands</TITLE>
+<link rev=made href="mailto:bug-ncurses@gnu.org">
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+</HEAD>
+<BODY>
+<H1>ADACURSES 1   User Commands</H1>
+<HR>
+<PRE>
+<!-- Manpage converted by man2html 3.0.1 -->
+<STRONG><A HREF="ADACURSES.1.html">ADACURSES(1)</A></STRONG>                 User Commands                 <STRONG><A HREF="ADACURSES.1.html">ADACURSES(1)</A></STRONG>
+
+
+
+
+</PRE>
+<H2>NAME</H2><PRE>
+       adacurses-config - helper script for AdaCurses libraries
+
+
+</PRE>
+<H2>SYNOPSIS</H2><PRE>
+       <STRONG>adacurses-config</STRONG> [<EM>options</EM>]
+
+
+</PRE>
+<H2>DESCRIPTION</H2><PRE>
+       This  is  a  shell  script which simplifies configuring an
+       application  to  use  the  AdaCurses  library  binding  to
+       ncurses.
+
+
+</PRE>
+<H2>OPTIONS</H2><PRE>
+       <STRONG>--cflags</STRONG>
+              echos  the gnat (Ada compiler) flags needed to com-
+              pile with adacurses
+
+       <STRONG>--libs</STRONG> echos  the  gnat  libraries  needed  to  link  with
+              adacurses
+
+       <STRONG>--version</STRONG>
+              echos the release+patchdate version of adacurses
+
+       <STRONG>--help</STRONG> prints this message
+
+
+</PRE>
+<H2>SEE ALSO</H2><PRE>
+       <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>
+
+       This describes <STRONG>ncurses</STRONG> version 5.7 (patch 20101002).
+
+
+
+                                                           <STRONG><A HREF="ADACURSES.1.html">ADACURSES(1)</A></STRONG>
+</PRE>
+<HR>
+<ADDRESS>
+Man(1) output converted with
+<a href="http://www.oac.uci.edu/indiv/ehood/man2html.html">man2html</a>
+</ADDRESS>
+</BODY>
+</HTML>
diff -Naur ncurses-5.7.orig/doc/html/man/captoinfo.1m.html ncurses-5.7/doc/html/man/captoinfo.1m.html
--- ncurses-5.7.orig/doc/html/man/captoinfo.1m.html	2008-10-11 17:33:58.000000000 -0400
+++ ncurses-5.7/doc/html/man/captoinfo.1m.html	2011-01-08 18:18:29.346656821 -0500
@@ -2,7 +2,7 @@
 <!-- 
   * 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            *
@@ -28,7 +28,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: captoinfo.1m,v 1.22 2007/06/02 20:40:07 tom Exp @
+  * @Id: captoinfo.1m,v 1.24 2010/08/28 19:36:31 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -59,25 +59,26 @@
 
 </PRE>
 <H2>DESCRIPTION</H2><PRE>
-       <STRONG>captoinfo</STRONG> looks in <EM>file</EM>  for  <STRONG>termcap</STRONG>  descriptions.   For
-       each  one  found,  an  equivalent  <STRONG>terminfo</STRONG> description is
-       written to standard output.  Termcap <STRONG>tc</STRONG>  capabilities  are
-       translated directly to terminfo <STRONG>use</STRONG> capabilities.
+       <STRONG>captoinfo</STRONG> looks  in  each  given  text  <EM>file</EM>  for  <STRONG>termcap</STRONG>
+       descriptions.   For each one found, an equivalent <STRONG>terminfo</STRONG>
+       description is written to  standard  output.   Termcap  <STRONG>tc</STRONG>
+       capabilities are translated directly to terminfo <STRONG>use</STRONG> capa-
+       bilities.
 
        If no <EM>file</EM> is given, then the environment variable <STRONG>TERMCAP</STRONG>
-       is used for the filename or entry.  If <STRONG>TERMCAP</STRONG> is  a  full
+       is  used  for the filename or entry.  If <STRONG>TERMCAP</STRONG> is a full
        pathname to a file, only the terminal whose name is speci-
-       fied in the environment variable <STRONG>TERM</STRONG>  is  extracted  from
-       that  file.   If  the  environment variable <STRONG>TERMCAP</STRONG> is not
+       fied  in  the  environment variable <STRONG>TERM</STRONG> is extracted from
+       that file.  If the environment  variable  <STRONG>TERMCAP</STRONG>  is  not
        set, then the file <STRONG>/usr/share/terminfo</STRONG> is read.
 
-       <STRONG>-v</STRONG>   print out tracing information on  standard  error  as
+       <STRONG>-v</STRONG>   print  out  tracing  information on standard error as
             the program runs.
 
-       <STRONG>-V</STRONG>   print  out the version of the program in use on stan-
+       <STRONG>-V</STRONG>   print out the version of the program in use on  stan-
             dard error and exit.
 
-       <STRONG>-1</STRONG>   cause the fields to print out one to a line.   Other-
+       <STRONG>-1</STRONG>   cause  the fields to print out one to a line.  Other-
             wise, the fields will be printed several to a line to
             a maximum width of 60 characters.
 
@@ -86,21 +87,20 @@
 
 </PRE>
 <H2>FILES</H2><PRE>
-       /usr/share/terminfo Compiled     terminal      description
-                           database.
+       /usr/share/terminfo Compiled  terminal  description  data-
+                           base.
 
 
 </PRE>
 <H2>TRANSLATIONS FROM NONSTANDARD CAPABILITIES</H2><PRE>
-       Some  obsolete nonstandard capabilities will automatically
-       be translated into  standard  (SVr4/XSI  Curses)  terminfo
-       capabilities  by  <STRONG>captoinfo</STRONG>.   Whenever one of these auto-
-       matic translations is done,  the  program  will  issue  an
+       Some obsolete nonstandard capabilities will  automatically
+       be  translated  into  standard  (SVr4/XSI Curses) terminfo
+       capabilities by <STRONG>captoinfo</STRONG>.  Whenever one  of  these  auto-
+       matic  translations  is  done,  the  program will issue an
        notification to stderr, inviting the user to check that it
-       has not mistakenly translated  a  completely  unknown  and
+       has  not  mistakenly  translated  a completely unknown and
        random capability and/or syntax error.
 
-
        Nonstd   Std    From           Terminfo
         name    name                 capability
        -----------------------------------------------
@@ -134,11 +134,10 @@
        FC       Sf     Tek     set_foreground
        HS       mh     Iris    enter_dim_mode
 
-       XENIX  termcap  also used to have a set of extension capa-
-       bilities for forms drawing, designed to take advantage  of
+       XENIX termcap also used to have a set of  extension  capa-
+       bilities  for forms drawing, designed to take advantage of
        the IBM PC high-half graphics.  They were as follows:
 
-
        Cap          Graphic
        -----------------------------
        G2    upper left
@@ -165,14 +164,14 @@
        Gc    intersection
        GG    acs magic cookie count
 
-       If  the  single-line  capabilities occur in an entry, they
-       will automatically be composed into an <EM>acsc</EM>  string.   The
+       If the single-line capabilities occur in  an  entry,  they
+       will  automatically  be composed into an <EM>acsc</EM> string.  The
        double-line capabilities and <STRONG>GG</STRONG> are discarded with a warn-
        ing message.
 
        IBM's AIX has a terminfo facility descended from SVr1 ter-
-       minfo but incompatible with the SVr4 format. The following
-       AIX extensions are automatically translated:
+       minfo but incompatible with the SVr4 format.  The  follow-
+       ing AIX extensions are automatically translated:
 
         IBM    XSI
        -------------
@@ -183,22 +182,22 @@
        font2   s2ds
        font3   s3ds
 
-       Additionally, the AIX <EM>box1</EM> capability  will  be  automati-
+       Additionally,  the  AIX  <EM>box1</EM> capability will be automati-
        cally translated to an <EM>acsc</EM> string.
 
-       Hewlett-Packard's  terminfo  library supports two nonstan-
-       dard terminfo capabilities <EM>meml</EM>  (memory  lock)  and  <EM>memu</EM>
-       (memory  unlock).   These will be discarded with a warning
+       Hewlett-Packard's terminfo library supports  two  nonstan-
+       dard  terminfo  capabilities  <EM>meml</EM>  (memory lock) and <EM>memu</EM>
+       (memory unlock).  These will be discarded with  a  warning
        message.
 
 
 </PRE>
 <H2>NOTES</H2><PRE>
-       This utility is actually a link to <STRONG><A HREF="tic.1m.html">tic(1m)</A></STRONG>, running in  <EM>-I</EM>
+       This  utility is actually a link to <STRONG><A HREF="tic.1m.html">tic(1m)</A></STRONG>, running in <EM>-I</EM>
        mode.  You can use other <STRONG>tic</STRONG> options such as <STRONG>-f</STRONG> and  <STRONG>-x</STRONG>.
 
-       The  trace option is not identical to SVr4's.  Under SVr4,
-       instead of following the <STRONG>-v</STRONG> with  a  trace  level  n,  you
+       The trace option is not identical to SVr4's.  Under  SVr4,
+       instead  of  following  the  <STRONG>-v</STRONG>  with a trace level n, you
        repeat it n times.
 
 
@@ -206,12 +205,13 @@
 <H2>SEE ALSO</H2><PRE>
        <STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>, <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>
 
-       This describes <STRONG>ncurses</STRONG> version 5.6 (patch 20081011).
+       This describes <STRONG>ncurses</STRONG> version 5.7 (patch 20101002).
 
 
 </PRE>
 <H2>AUTHOR</H2><PRE>
-       Eric S. Raymond &lt;esr@snark.thyrsus.com&gt;
+       Eric S. Raymond &lt;esr@snark.thyrsus.com&gt; and
+       Thomas E. Dickey &lt;dickey@invisible-island.net&gt;
 
 
 
diff -Naur ncurses-5.7.orig/doc/html/man/clear.1.html ncurses-5.7/doc/html/man/clear.1.html
--- ncurses-5.7.orig/doc/html/man/clear.1.html	2008-10-11 17:33:58.000000000 -0400
+++ ncurses-5.7/doc/html/man/clear.1.html	2011-01-08 18:18:29.346656821 -0500
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 <!-- 
   ****************************************************************************
-  * 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            *
@@ -27,7 +27,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: clear.1,v 1.6 2006/12/24 18:07:53 tom Exp @
+  * @Id: clear.1,v 1.7 2010/07/31 16:12:01 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -69,7 +69,7 @@
 <H2>SEE ALSO</H2><PRE>
        <STRONG><A HREF="tput.1.html">tput(1)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>
 
-       This describes <STRONG>ncurses</STRONG> version 5.6 (patch 20081011).
+       This describes <STRONG>ncurses</STRONG> version 5.7 (patch 20101002).
 
 
 
diff -Naur ncurses-5.7.orig/doc/html/man/curs_add_wch.3x.html ncurses-5.7/doc/html/man/curs_add_wch.3x.html
--- ncurses-5.7.orig/doc/html/man/curs_add_wch.3x.html	2006-12-24 10:50:48.000000000 -0500
+++ ncurses-5.7/doc/html/man/curs_add_wch.3x.html	2011-01-08 18:18:29.234656968 -0500
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 <!-- 
   ****************************************************************************
-  * Copyright (c) 2001-2002,2006 Free Software Foundation, Inc.              *
+  * Copyright (c) 2001-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,7 +27,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: curs_add_wch.3x,v 1.6 2006/12/24 15:22:22 tom Exp @
+  * @Id: curs_add_wch.3x,v 1.9 2010/09/18 20:18:34 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -73,21 +73,21 @@
        perform  wrapping and special-character processing as fol-
        lows:
 
-       -    If <EM>wch</EM> refers to a spacing character, then any previ-
-            ous  character  at  that  location is removed.  A new
-            character specified by <EM>wch</EM> is placed at that location
-            with  rendition  specified  by  <EM>wch</EM>.  The cursor then
-            advances to the next spacing character on the screen.
-
-       -    If  <EM>wch</EM> refers to a non-spacing character, all previ-
-            ous characters at that location are  preserved.   The
-            non-spacing  characters of <EM>wch</EM> are added to the spac-
-            ing complex character, and the rendition specified by
-            <EM>wch</EM> is ignored.
-
-       -    If  the  character  part  of  <EM>wch</EM>  is a tab, newline,
-            backspace or other control character, the  window  is
-            updated and the cursor moves as if <STRONG>addch</STRONG> were called.
+       <STRONG>o</STRONG>   If <EM>wch</EM> refers to a spacing character, then any  previ-
+           ous  character  at  that  location  is removed.  A new
+           character specified by <EM>wch</EM> is placed at that  location
+           with  rendition  specified  by  <EM>wch</EM>.   The cursor then
+           advances to the next spacing character on the screen.
+
+       <STRONG>o</STRONG>   If <EM>wch</EM> refers to a non-spacing character, all previous
+           characters  at  that location are preserved.  The non-
+           spacing characters of <EM>wch</EM> are  added  to  the  spacing
+           complex  character, and the rendition specified by <EM>wch</EM>
+           is ignored.
+
+       <STRONG>o</STRONG>   If the character  part  of  <EM>wch</EM>  is  a  tab,  newline,
+           backspace  or  other  control character, the window is
+           updated and the cursor moves as if <STRONG>addch</STRONG> were called.
 
        The <STRONG>echo_wchar</STRONG> function is functionally  equivalent  to  a
        call to <STRONG>add_wch</STRONG> followed by a call to <STRONG>refresh</STRONG>.  Similarly,
@@ -104,6 +104,10 @@
        All routines return the integer <STRONG>ERR</STRONG> upon failure and <STRONG>OK</STRONG> on
        success.
 
+       Functions with a "mv" prefix first perform a cursor  move-
+       ment  using  <STRONG>wmove</STRONG>, and return an error if the position is
+       outside the window, or if the window pointer is null.
+
 
 </PRE>
 <H2>NOTES</H2><PRE>
diff -Naur ncurses-5.7.orig/doc/html/man/curs_add_wchstr.3x.html ncurses-5.7/doc/html/man/curs_add_wchstr.3x.html
--- ncurses-5.7.orig/doc/html/man/curs_add_wchstr.3x.html	2005-05-07 19:20:38.000000000 -0400
+++ ncurses-5.7/doc/html/man/curs_add_wchstr.3x.html	2011-01-08 18:18:29.234656968 -0500
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 <!-- 
   ****************************************************************************
-  * Copyright (c) 2002-2004,2005 Free Software Foundation, Inc.              *
+  * Copyright (c) 2002-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            *
@@ -27,7 +27,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: curs_add_wchstr.3x,v 1.6 2005/01/02 01:28:49 tom Exp @
+  * @Id: curs_add_wchstr.3x,v 1.8 2010/08/14 23:29:16 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -103,6 +103,10 @@
        All routines return the integer <STRONG>ERR</STRONG> upon failure and <STRONG>OK</STRONG> on
        success.
 
+       Functions with a "mv" prefix first perform a cursor  move-
+       ment  using  <STRONG>wmove</STRONG>, and return an error if the position is
+       outside the window, or if the window pointer is null.
+
 
 </PRE>
 <H2>PORTABILITY</H2><PRE>
diff -Naur ncurses-5.7.orig/doc/html/man/curs_addch.3x.html ncurses-5.7/doc/html/man/curs_addch.3x.html
--- ncurses-5.7.orig/doc/html/man/curs_addch.3x.html	2008-06-21 19:11:31.000000000 -0400
+++ ncurses-5.7/doc/html/man/curs_addch.3x.html	2011-01-08 18:18:29.346656821 -0500
@@ -2,7 +2,7 @@
 <!-- 
   * 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            *
@@ -28,7 +28,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: curs_addch.3x,v 1.27 2007/06/02 20:40:07 tom Exp @
+  * @Id: curs_addch.3x,v 1.30 2010/10/02 23:19:07 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -112,9 +112,8 @@
        characters to the screen with routines of the  <STRONG>addch</STRONG>  fam-
        ily.   The  default  character listed below is used if the
        <STRONG>acsc</STRONG>  capability  does  not  define  a   terminal-specific
-       replacement  for  it.   The  names  are  taken  from VT100
-       nomenclature.
-
+       replacement for it.  The names are taken from VT100 nomen-
+       clature.
 
        <EM>Name</EM>           <EM>Default</EM>   <EM>Description</EM>
        --------------------------------------------------
@@ -159,6 +158,10 @@
        other than <STRONG>ERR</STRONG>") upon successful completion, unless other-
        wise noted in the preceding routine descriptions.
 
+       Functions  with a "mv" prefix first perform a cursor move-
+       ment using <STRONG>wmove</STRONG>, and return an error if the  position  is
+       outside the window, or if the window pointer is null.
+
 
 </PRE>
 <H2>NOTES</H2><PRE>
@@ -192,7 +195,8 @@
 </PRE>
 <H2>SEE ALSO</H2><PRE>
        <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_attr.3x.html">curs_attr(3x)</A></STRONG>, <STRONG><A HREF="curs_clear.3x.html">curs_clear(3x)</A></STRONG>,  <STRONG><A HREF="curs_inch.3x.html">curs_inch(3x)</A></STRONG>,
-       <STRONG><A HREF="curs_outopts.3x.html">curs_outopts(3x)</A></STRONG>, <STRONG><A HREF="curs_refresh.3x.html">curs_refresh(3x)</A></STRONG>, <STRONG><A HREF="putc.3.html">putc(3)</A></STRONG>.
+       <STRONG><A HREF="curs_outopts.3x.html">curs_outopts(3x)</A></STRONG>,   <STRONG><A HREF="curs_refresh.3x.html">curs_refresh(3x)</A></STRONG>,  <STRONG><A HREF="curs_variables.3x.html">curs_variables(3x)</A></STRONG>,
+       <STRONG><A HREF="putc.3.html">putc(3)</A></STRONG>.
 
        Comparable  functions  in  the  wide-character  (ncursesw)
        library are described in <STRONG><A HREF="curs_add_wch.3x.html">curs_add_wch(3x)</A></STRONG>.
diff -Naur ncurses-5.7.orig/doc/html/man/curs_addchstr.3x.html ncurses-5.7/doc/html/man/curs_addchstr.3x.html
--- ncurses-5.7.orig/doc/html/man/curs_addchstr.3x.html	2006-12-16 17:51:22.000000000 -0500
+++ ncurses-5.7/doc/html/man/curs_addchstr.3x.html	2011-01-08 18:18:29.234656968 -0500
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 <!-- 
   ****************************************************************************
-  * 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,7 +27,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: curs_addchstr.3x,v 1.12 2006/12/02 17:02:45 tom Exp @
+  * @Id: curs_addchstr.3x,v 1.14 2010/08/14 23:29:16 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -62,40 +62,44 @@
        <STRONG>int</STRONG> <STRONG>waddchnstr(WINDOW</STRONG> <STRONG>*win,</STRONG> <STRONG>const</STRONG> <STRONG>chtype</STRONG> <STRONG>*chstr,</STRONG> <STRONG>int</STRONG> <STRONG>n);</STRONG>
        <STRONG>int</STRONG> <STRONG>mvaddchstr(int</STRONG> <STRONG>y,</STRONG> <STRONG>int</STRONG> <STRONG>x,</STRONG> <STRONG>const</STRONG> <STRONG>chtype</STRONG> <STRONG>*chstr);</STRONG>
        <STRONG>int</STRONG> <STRONG>mvaddchnstr(int</STRONG> <STRONG>y,</STRONG> <STRONG>int</STRONG> <STRONG>x,</STRONG> <STRONG>const</STRONG> <STRONG>chtype</STRONG> <STRONG>*chstr,</STRONG> <STRONG>int</STRONG> <STRONG>n);</STRONG>
-       <STRONG>int</STRONG> <STRONG>mvwaddchstr(WINDOW</STRONG> <STRONG>*win,</STRONG> <STRONG>int</STRONG> <STRONG>y,</STRONG> <STRONG>int</STRONG>  <STRONG>x,</STRONG>  <STRONG>const</STRONG>  <STRONG>chtype</STRONG>
+       <STRONG>int</STRONG>  <STRONG>mvwaddchstr(WINDOW</STRONG>  <STRONG>*win,</STRONG>  <STRONG>int</STRONG> <STRONG>y,</STRONG> <STRONG>int</STRONG> <STRONG>x,</STRONG> <STRONG>const</STRONG> <STRONG>chtype</STRONG>
        <STRONG>*chstr);</STRONG>
-       <STRONG>int</STRONG>  <STRONG>mvwaddchnstr(WINDOW</STRONG>  <STRONG>*win,</STRONG> <STRONG>int</STRONG> <STRONG>y,</STRONG> <STRONG>int</STRONG> <STRONG>x,</STRONG> <STRONG>const</STRONG> <STRONG>chtype</STRONG>
+       <STRONG>int</STRONG> <STRONG>mvwaddchnstr(WINDOW</STRONG> <STRONG>*win,</STRONG> <STRONG>int</STRONG> <STRONG>y,</STRONG> <STRONG>int</STRONG> <STRONG>x,</STRONG>  <STRONG>const</STRONG>  <STRONG>chtype</STRONG>
        <STRONG>*chstr,</STRONG> <STRONG>int</STRONG> <STRONG>n);</STRONG>
 
 
 </PRE>
 <H2>DESCRIPTION</H2><PRE>
-       These routines copy <EM>chstr</EM> into the window image  structure
-       at  and  after the current cursor position.  The four rou-
+       These  routines copy <EM>chstr</EM> into the window image structure
+       at and after the current cursor position.  The  four  rou-
        tines with <EM>n</EM> as the last argument copy at most <EM>n</EM> elements,
-       but  no  more than will fit on the line.  If <STRONG>n</STRONG>=<STRONG>-1</STRONG> then the
-       whole string is copied, to the maximum number  of  charac-
+       but no more than will fit on the line.  If <STRONG>n</STRONG>=<STRONG>-1</STRONG>  then  the
+       whole  string  is copied, to the maximum number of charac-
        ters that will fit on the line.
 
        The window cursor is <EM>not</EM> advanced, and these routines work
        faster than <STRONG>waddnstr</STRONG>.  On the other hand, they do not per-
-       form  any  kind  of  checking  (such  as  for the newline,
+       form any kind  of  checking  (such  as  for  the  newline,
        backspace, or carriage return characters), they do not ad-
        vance the current cursor position, they do not expand oth-
-       er control characters to ^-escapes, and they truncate  the
-       string  if  it crosses the right margin, rather than wrap-
+       er  control characters to ^-escapes, and they truncate the
+       string if it crosses the right margin, rather  than  wrap-
        ping it around to the new line.
 
 
 </PRE>
 <H2>RETURN VALUES</H2><PRE>
        All routines return the integer <STRONG>ERR</STRONG> upon failure and <STRONG>OK</STRONG> on
-       success  (the  SVr4 manuals specify only "an integer value
+       success (the SVr4 manuals specify only "an  integer  value
        other than <STRONG>ERR</STRONG>") upon successful completion, unless other-
        wise noted in the preceding routine descriptions.
 
-       X/Open  does not define any error conditions.  This imple-
-       mentation returns an error if the window pointer is  null.
+       X/Open does not define any error conditions.  This  imple-
+       mentation returns an error if the window pointer is null.
+
+       Functions  with a "mv" prefix first perform a cursor move-
+       ment using <STRONG>wmove</STRONG>, and return an error if the  position  is
+       outside the window, or if the window pointer is null.
 
 
 </PRE>
diff -Naur ncurses-5.7.orig/doc/html/man/curs_addstr.3x.html ncurses-5.7/doc/html/man/curs_addstr.3x.html
--- ncurses-5.7.orig/doc/html/man/curs_addstr.3x.html	2005-05-15 13:05:48.000000000 -0400
+++ ncurses-5.7/doc/html/man/curs_addstr.3x.html	2011-01-08 18:18:29.234656968 -0500
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 <!-- 
   ****************************************************************************
-  * 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            *
@@ -27,7 +27,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: curs_addstr.3x,v 1.13 2005/05/15 16:17:14 tom Exp @
+  * @Id: curs_addstr.3x,v 1.15 2010/08/14 23:29:16 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -89,6 +89,10 @@
        or if the string pointer is null or if  the  corresponding
        calls to <STRONG>waddch</STRONG> return an error.
 
+       Functions  with a "mv" prefix first perform a cursor move-
+       ment using <STRONG>wmove</STRONG>, and return an error if the  position  is
+       outside the window, or if the window pointer is null.
+
 
 </PRE>
 <H2>NOTES</H2><PRE>
diff -Naur ncurses-5.7.orig/doc/html/man/curs_addwstr.3x.html ncurses-5.7/doc/html/man/curs_addwstr.3x.html
--- ncurses-5.7.orig/doc/html/man/curs_addwstr.3x.html	2006-09-23 16:42:58.000000000 -0400
+++ ncurses-5.7/doc/html/man/curs_addwstr.3x.html	2011-01-08 18:18:29.234656968 -0500
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 <!-- 
   ****************************************************************************
-  * Copyright (c) 2002-2005,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            *
@@ -27,7 +27,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: curs_addwstr.3x,v 1.7 2006/02/25 20:59:08 tom Exp @
+  * @Id: curs_addwstr.3x,v 1.9 2010/08/14 23:29:16 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -90,6 +90,10 @@
        All routines return the integer <STRONG>ERR</STRONG> upon failure and <STRONG>OK</STRONG> on
        success.
 
+       Functions with a "mv" prefix first perform a cursor  move-
+       ment  using  <STRONG>wmove</STRONG>, and return an error if the position is
+       outside the window, or if the window pointer is null.
+
 
 </PRE>
 <H2>NOTES</H2><PRE>
diff -Naur ncurses-5.7.orig/doc/html/man/curs_attr.3x.html ncurses-5.7/doc/html/man/curs_attr.3x.html
--- ncurses-5.7.orig/doc/html/man/curs_attr.3x.html	2008-06-21 19:11:32.000000000 -0400
+++ ncurses-5.7/doc/html/man/curs_attr.3x.html	2011-01-08 18:18:29.346656821 -0500
@@ -2,7 +2,7 @@
 <!-- 
   * t
   ****************************************************************************
-  * Copyright (c) 1998-2006,2007 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 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: curs_attr.3x,v 1.31 2007/03/17 20:30:33 tom Exp @
+  * @Id: curs_attr.3x,v 1.35 2010/10/02 23:19:07 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -148,7 +148,6 @@
        be passed to the routines <STRONG>attron</STRONG>, <STRONG>attroff</STRONG>, and <STRONG>attrset</STRONG>, or
        OR'd with the characters passed to <STRONG>addch</STRONG>.
 
-
         <STRONG>A_NORMAL</STRONG>        Normal display (no highlight)
         <STRONG>A_STANDOUT</STRONG>      Best highlighting mode of the terminal.
         <STRONG>A_UNDERLINE</STRONG>     Underlining
@@ -211,7 +210,6 @@
        the  screen when changing the attributes.  Use <STRONG>touchwin</STRONG> to
        force the screen to match the updated attributes.
 
-
         <STRONG>WA_NORMAL</STRONG>       Normal display (no highlight)
         <STRONG>WA_STANDOUT</STRONG>     Best highlighting mode of the terminal.
         <STRONG>WA_UNDERLINE</STRONG>    Underlining
@@ -244,11 +242,15 @@
        OR_PAIRS-1.   This  implementation  also provides <STRONG>getattrs</STRONG>
        for compatibility with older versions of curses.
 
+       Functions with a "mv" prefix first perform a cursor  move-
+       ment  using  <STRONG>wmove</STRONG>, and return an error if the position is
+       outside the window, or if the window pointer is null.
+
 
 </PRE>
 <H2>SEE ALSO</H2><PRE>
        <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>,        <STRONG><A HREF="curs_addch.3x.html">curs_addch(3x)</A></STRONG>,        <STRONG><A HREF="curs_addstr.3x.html">curs_addstr(3x)</A></STRONG>,
-       <STRONG><A HREF="curs_bkgd.3x.html">curs_bkgd(3x)</A></STRONG>, <STRONG><A HREF="curs_printw.3x.html">curs_printw(3x)</A></STRONG>
+       <STRONG><A HREF="curs_bkgd.3x.html">curs_bkgd(3x)</A></STRONG>, <STRONG><A HREF="curs_printw.3x.html">curs_printw(3x)</A></STRONG>, <STRONG><A HREF="curs_variables.3x.html">curs_variables(3x)</A></STRONG>
 
 
 
diff -Naur ncurses-5.7.orig/doc/html/man/curs_beep.3x.html ncurses-5.7/doc/html/man/curs_beep.3x.html
--- ncurses-5.7.orig/doc/html/man/curs_beep.3x.html	2005-05-07 19:20:39.000000000 -0400
+++ ncurses-5.7/doc/html/man/curs_beep.3x.html	2011-01-08 18:13:50.395157542 -0500
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 <!-- 
   ****************************************************************************
-  * 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            *
@@ -27,7 +27,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: curs_beep.3x,v 1.10 2005/01/08 17:55:51 tom Exp @
+  * @Id: curs_beep.3x,v 1.11 2010/07/31 16:12:01 tom Exp @
 -->
 <HTML>
 <HEAD>
diff -Naur ncurses-5.7.orig/doc/html/man/curs_bkgd.3x.html ncurses-5.7/doc/html/man/curs_bkgd.3x.html
--- ncurses-5.7.orig/doc/html/man/curs_bkgd.3x.html	2005-05-07 19:20:39.000000000 -0400
+++ ncurses-5.7/doc/html/man/curs_bkgd.3x.html	2011-01-08 18:13:50.395157542 -0500
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 <!-- 
   ****************************************************************************
-  * Copyright (c) 1998-2002,2003 Free Software Foundation, Inc.              *
+  * Copyright (c) 1998-2003,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,7 +27,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: curs_bkgd.3x,v 1.19 2003/12/27 18:50:40 tom Exp @
+  * @Id: curs_bkgd.3x,v 1.21 2010/07/31 14:36:04 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -110,7 +110,7 @@
 <H2>PORTABILITY</H2><PRE>
        These  functions are described in the XSI Curses standard,
        Issue 4.  It specifies that <STRONG>bkgd</STRONG> and <STRONG>wbkgd</STRONG> return  <STRONG>ERR</STRONG>  on
-       failure.  but gives no failure conditions.
+       failure, but gives no failure conditions.
 
 
 </PRE>
diff -Naur ncurses-5.7.orig/doc/html/man/curs_border.3x.html ncurses-5.7/doc/html/man/curs_border.3x.html
--- ncurses-5.7.orig/doc/html/man/curs_border.3x.html	2007-03-03 19:10:36.000000000 -0500
+++ ncurses-5.7/doc/html/man/curs_border.3x.html	2011-01-08 18:18:29.238658175 -0500
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 <!-- 
   ****************************************************************************
-  * 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,7 +27,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: curs_border.3x,v 1.19 2007/02/24 16:15:38 tom Exp @
+  * @Id: curs_border.3x,v 1.21 2010/08/14 23:29:16 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -122,12 +122,16 @@
        this appears to be an error.
 
        X/Open does not define any error conditions.  This  imple-
-       mentation  returns an error if the window pointer is null.
+       mentation returns an error if the window pointer is null.
+
+       Functions  with a "mv" prefix first perform a cursor move-
+       ment using <STRONG>wmove</STRONG>, and return an error if the  position  is
+       outside the window, or if the window pointer is null.
 
 
 </PRE>
 <H2>NOTES</H2><PRE>
-       The borders generated by these functions are  <EM>inside</EM>  bor-
+       The  borders  generated by these functions are <EM>inside</EM> bor-
        ders (this is also true of SVr4 curses, though the fact is
        not documented).
 
@@ -136,8 +140,8 @@
 
 </PRE>
 <H2>PORTABILITY</H2><PRE>
-       These functions are described in the XSI Curses  standard,
-       Issue  4.   The standard specifies that they return <STRONG>ERR</STRONG> on
+       These  functions are described in the XSI Curses standard,
+       Issue 4.  The standard specifies that they return  <STRONG>ERR</STRONG>  on
        failure, but specifies no error conditions.
 
 
diff -Naur ncurses-5.7.orig/doc/html/man/curs_border_set.3x.html ncurses-5.7/doc/html/man/curs_border_set.3x.html
--- ncurses-5.7.orig/doc/html/man/curs_border_set.3x.html	2005-05-15 13:05:49.000000000 -0400
+++ ncurses-5.7/doc/html/man/curs_border_set.3x.html	2011-01-08 18:18:29.238658175 -0500
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 <!-- 
   ****************************************************************************
-  * Copyright (c) 2002-2004,2005 Free Software Foundation, Inc.              *
+  * Copyright (c) 2002-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            *
@@ -27,7 +27,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: curs_border_set.3x,v 1.6 2005/05/15 16:17:37 tom Exp @
+  * @Id: curs_border_set.3x,v 1.8 2010/08/14 23:29:16 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -161,6 +161,10 @@
        Functions  using  a window parameter return an error if it
        is null.
 
+       Functions with a "mv" prefix first perform a cursor  move-
+       ment  using  <STRONG>wmove</STRONG>, and return an error if the position is
+       outside the window, or if the window pointer is null.
+
 
 </PRE>
 <H2>SEE ALSO</H2><PRE>
diff -Naur ncurses-5.7.orig/doc/html/man/curs_clear.3x.html ncurses-5.7/doc/html/man/curs_clear.3x.html
--- ncurses-5.7.orig/doc/html/man/curs_clear.3x.html	2008-06-21 19:11:33.000000000 -0400
+++ ncurses-5.7/doc/html/man/curs_clear.3x.html	2011-01-08 18:18:29.350657586 -0500
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 <!-- 
   ****************************************************************************
-  * 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            *
@@ -27,7 +27,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: curs_clear.3x,v 1.11 2007/12/29 15:58:38 tom Exp @
+  * @Id: curs_clear.3x,v 1.13 2010/10/02 23:19:07 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -67,21 +67,21 @@
 
 </PRE>
 <H2>DESCRIPTION</H2><PRE>
-       The  <STRONG>erase</STRONG>  and <STRONG>werase</STRONG> routines copy blanks to every posi-
+       The <STRONG>erase</STRONG> and <STRONG>werase</STRONG> routines copy blanks to  every  posi-
        tion in the window, clearing the screen.
 
-       The <STRONG>clear</STRONG> and <STRONG>wclear</STRONG> routines are like <STRONG>erase</STRONG>  and  <STRONG>werase</STRONG>,
-       but  they also call <STRONG>clearok</STRONG>, so that the screen is cleared
-       completely on the next call to <STRONG>wrefresh</STRONG>  for  that  window
+       The  <STRONG>clear</STRONG>  and <STRONG>wclear</STRONG> routines are like <STRONG>erase</STRONG> and <STRONG>werase</STRONG>,
+       but they also call <STRONG>clearok</STRONG>, so that the screen is  cleared
+       completely  on  the  next call to <STRONG>wrefresh</STRONG> for that window
        and repainted from scratch.
 
-       The  <STRONG>clrtobot</STRONG> and <STRONG>wclrtobot</STRONG> routines erase from the cursor
+       The <STRONG>clrtobot</STRONG> and <STRONG>wclrtobot</STRONG> routines erase from the  cursor
        to the end of screen.  That is, they erase all lines below
-       the  cursor  in the window.  Also, the current line to the
+       the cursor in the window.  Also, the current line  to  the
        right of the cursor, inclusive, is erased.
 
        The <STRONG>clrtoeol</STRONG> and <STRONG>wclrtoeol</STRONG> routines erase the current line
-       to  the  right of the cursor, inclusive, to the end of the
+       to the right of the cursor, inclusive, to the end  of  the
        current line.
 
        Blanks created by erasure have the current background ren-
@@ -90,11 +90,11 @@
 
 </PRE>
 <H2>RETURN VALUE</H2><PRE>
-       All  routines  return the integer <STRONG>OK</STRONG> on success and <STRONG>ERR</STRONG> on
-       failure.  The SVr4.0 manual says "or a non-negative  inte-
+       All routines return the integer <STRONG>OK</STRONG> on success and  <STRONG>ERR</STRONG>  on
+       failure.   The SVr4.0 manual says "or a non-negative inte-
        ger if <STRONG>immedok</STRONG> is set", but this appears to be an error.
 
-       X/Open  defines  no error conditions.  In this implementa-
+       X/Open defines no error conditions.  In  this  implementa-
        tion, functions using a window pointer parameter return an
        error if it is null.
 
@@ -107,30 +107,31 @@
 
 </PRE>
 <H2>PORTABILITY</H2><PRE>
-       These functions are described in the XSI Curses  standard,
-       Issue  4.   The standard specifies that they return <STRONG>ERR</STRONG> on
+       These  functions are described in the XSI Curses standard,
+       Issue 4.  The standard specifies that they return  <STRONG>ERR</STRONG>  on
        failure, but specifies no error conditions.
 
-       Some historic curses implementations had,  as  an  undocu-
-       mented  feature,  the  ability  to  do  the  equivalent of
-       <STRONG>clearok(...,</STRONG> <STRONG>1)</STRONG> by saying <STRONG>touchwin(stdscr)</STRONG>  or  <STRONG>clear(std-</STRONG>
+       Some  historic  curses  implementations had, as an undocu-
+       mented feature,  the  ability  to  do  the  equivalent  of
+       <STRONG>clearok(...,</STRONG>  <STRONG>1)</STRONG>  by saying <STRONG>touchwin(stdscr)</STRONG> or <STRONG>clear(std-</STRONG>
        <STRONG>scr)</STRONG>.  This will not work under ncurses.
 
-       This  implementation, and others such as Solaris, sets the
-       current position to 0,0 after  erasing  via  <STRONG>werase()</STRONG>  and
-       <STRONG>wclear()</STRONG>.   That fact is not documented in other implemen-
+       This implementation, and others such as Solaris, sets  the
+       current  position  to  0,0  after erasing via <STRONG>werase()</STRONG> and
+       <STRONG>wclear()</STRONG>.  That fact is not documented in other  implemen-
        tations, and may not be true of implementations which were
        not derived from SVr4 source.
 
-       Not  obvious  from  the  description, most implementations
-       clear the screen after <STRONG>wclear</STRONG> even for a subwindow or  de-
+       Not obvious from  the  description,  most  implementations
+       clear  the screen after <STRONG>wclear</STRONG> even for a subwindow or de-
        rived window.  If you do not want to clear the screen dur-
        ing the next <STRONG>wrefresh</STRONG>, use <STRONG>werase</STRONG> instead.
 
 
 </PRE>
 <H2>SEE ALSO</H2><PRE>
-       <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_outopts.3x.html">curs_outopts(3x)</A></STRONG>, <STRONG><A HREF="curs_refresh.3x.html">curs_refresh(3x)</A></STRONG>
+       <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_outopts.3x.html">curs_outopts(3x)</A></STRONG>, <STRONG><A HREF="curs_refresh.3x.html">curs_refresh(3x)</A></STRONG>, <STRONG>curs_vari-</STRONG>
+       <STRONG><A HREF="curs_variables.3x.html">ables(3x)</A></STRONG>
 
 
 
diff -Naur ncurses-5.7.orig/doc/html/man/curs_color.3x.html ncurses-5.7/doc/html/man/curs_color.3x.html
--- ncurses-5.7.orig/doc/html/man/curs_color.3x.html	2006-09-23 16:43:00.000000000 -0400
+++ ncurses-5.7/doc/html/man/curs_color.3x.html	2011-01-08 18:18:29.350657586 -0500
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 <!-- 
   ****************************************************************************
-  * Copyright (c) 1998-2004,2005 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            *
@@ -27,7 +27,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: curs_color.3x,v 1.28 2005/12/18 00:00:37 tom Exp @
+  * @Id: curs_color.3x,v 1.33 2010/10/02 23:19:27 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -55,6 +55,7 @@
 </PRE>
 <H2>SYNOPSIS</H2><PRE>
        <STRONG>#</STRONG> <STRONG>include</STRONG> <STRONG>&lt;curses.h&gt;</STRONG>
+
        <STRONG>int</STRONG> <STRONG>start_color(void);</STRONG>
        <STRONG>int</STRONG> <STRONG>init_pair(short</STRONG> <STRONG>pair,</STRONG> <STRONG>short</STRONG> <STRONG>f,</STRONG> <STRONG>short</STRONG> <STRONG>b);</STRONG>
        <STRONG>int</STRONG> <STRONG>init_color(short</STRONG> <STRONG>color,</STRONG> <STRONG>short</STRONG> <STRONG>r,</STRONG> <STRONG>short</STRONG> <STRONG>g,</STRONG> <STRONG>short</STRONG> <STRONG>b);</STRONG>
@@ -108,44 +109,47 @@
        pair to be changed, the foreground color number,  and  the
        background color number.  For portable applications:
 
-       -    The value of the first argument must be between <STRONG>1</STRONG> and
-            <STRONG>COLOR_PAIRS-1</STRONG>.
-
-       -    The value of the second and third arguments  must  be
-            between  0 and <STRONG>COLORS</STRONG>.  Color pair 0 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.
+       <STRONG>o</STRONG>   The  value of the first argument must be between <STRONG>1</STRONG> and
+           <STRONG>COLOR_PAIRS-1</STRONG>, except that if default colors are  used
+           (see  <STRONG>use_default_colors</STRONG>)  the upper limit is adjusted
+           to allow for extra pairs which use a default color  in
+           foreground and/or background.
+
+       <STRONG>o</STRONG>   The  value  of  the second and third arguments must be
+           between 0 and <STRONG>COLORS</STRONG>.  Color pair 0 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.
 
-       If the color-pair was previously initialized,  the  screen
-       is  refreshed  and  all occurrences of that color-pair are
+       If  the  color-pair was previously initialized, the screen
+       is refreshed and all occurrences of  that  color-pair  are
        changed to the new definition.
 
-       As an extension, ncurses allows you to set  color  pair  0
-       via  the  <STRONG>assume_default_colors</STRONG> routine, or to specify the
-       use of default colors (color number <STRONG>-1</STRONG>) if you  first  in-
+       As  an  extension,  ncurses allows you to set color pair 0
+       via the <STRONG>assume_default_colors</STRONG> routine, or to  specify  the
+       use  of  default colors (color number <STRONG>-1</STRONG>) if you first in-
        voke the <STRONG>use_default_colors</STRONG> routine.
 
-       The  <STRONG>init_color</STRONG> 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 <STRONG>0</STRONG> and <STRONG>COLORS</STRONG>.  (See the section
-       <STRONG>Colors</STRONG> for the default color index.)   Each  of  the  last
-       three  arguments must be a value between 0 and 1000.  When
-       <STRONG>init_color</STRONG> is used, all occurrences of that color  on  the
+       The <STRONG>init_color</STRONG> 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 <STRONG>0</STRONG> and <STRONG>COLORS</STRONG>.  (See  the  section
+       <STRONG>Colors</STRONG>  for  the  default  color index.)  Each of the last
+       three arguments must be a value between 0 and 1000.   When
+       <STRONG>init_color</STRONG>  is  used, all occurrences of that color on the
        screen immediately change to the new definition.
 
-       The  <STRONG>has_colors</STRONG> routine requires no arguments.  It returns
-       <STRONG>TRUE</STRONG> if the terminal can manipulate colors; otherwise,  it
+       The <STRONG>has_colors</STRONG> routine requires no arguments.  It  returns
+       <STRONG>TRUE</STRONG>  if the terminal can manipulate colors; otherwise, it
        returns <STRONG>FALSE</STRONG>.  This routine facilitates writing terminal-
-       independent programs.  For example, a programmer  can  use
-       it  to decide whether to use color or some other video at-
+       independent  programs.   For example, a programmer can use
+       it to decide whether to use color or some other video  at-
        tribute.
 
-       The <STRONG>can_change_color</STRONG> routine requires  no  arguments.   It
-       returns  <STRONG>TRUE</STRONG>  if  the  terminal  supports  colors and can
-       change their definitions; other, it returns  <STRONG>FALSE</STRONG>.   This
+       The  <STRONG>can_change_color</STRONG>  routine  requires no arguments.  It
+       returns <STRONG>TRUE</STRONG> if  the  terminal  supports  colors  and  can
+       change  their  definitions; other, it returns <STRONG>FALSE</STRONG>.  This
        routine facilitates writing terminal-independent programs.
 
        The <STRONG>color_content</STRONG> routine gives programmers a way to  find
@@ -202,72 +206,71 @@
        turned from  secondary  functions  such  as  <STRONG>init_pair</STRONG>  if
        <STRONG>start_color</STRONG> was not called.
 
-              <STRONG>init_color</STRONG>
-                   returns an error if the terminal does not sup-
-                   port  this  feature,  e.g.,  if  the  <EM>initial-</EM>
-                   <EM>ize</EM><STRONG>_</STRONG><EM>color</EM> capability is absent from the termi-
-                   nal description.
-
-              <STRONG>start_color</STRONG>
-                   returns an error If the color table cannot  be
-                   allocated.
+          <STRONG>init_color</STRONG>
+               returns  an error if the terminal does not support
+               this feature, e.g., if the <EM>initialize</EM><STRONG>_</STRONG><EM>color</EM>  capa-
+               bility is absent from the terminal description.
+
+          <STRONG>start_color</STRONG>
+               returns  an error if the color table cannot be al-
+               located.
 
 
 </PRE>
 <H2>NOTES</H2><PRE>
-       In  the  <EM>ncurses</EM> implementation, there is a separate color
+       In the <EM>ncurses</EM> implementation, there is a  separate  color
        activation flag, color palette, color pairs table, and as-
-       sociated  COLORS  and  COLOR_PAIRS counts for each screen;
-       the <STRONG>start_color</STRONG> function only affects the current  screen.
+       sociated COLORS and COLOR_PAIRS counts  for  each  screen;
+       the  <STRONG>start_color</STRONG> function only affects the current screen.
        The SVr4/XSI interface is not really designed with this in
-       mind, and historical  implementations  may  use  a  single
+       mind,  and  historical  implementations  may  use a single
        shared color palette.
 
        Note that setting an implicit background color via a color
-       pair affects only character cells that a  character  write
-       operation  explicitly  touches.   To change the background
-       color used when parts of a window are blanked  by  erasing
+       pair  affects  only character cells that a character write
+       operation explicitly touches.  To  change  the  background
+       color  used  when parts of a window are blanked by erasing
        or scrolling operations, see <STRONG><A HREF="curs_bkgd.3x.html">curs_bkgd(3x)</A></STRONG>.
 
-       Several  caveats  apply  on 386 and 486 machines with VGA-
+       Several caveats apply on 386 and 486  machines  with  VGA-
        compatible graphics:
 
-       -    COLOR_YELLOW is actually brown.  To get  yellow,  use
-            COLOR_YELLOW combined with the <STRONG>A_BOLD</STRONG> attribute.
+       <STRONG>o</STRONG>   COLOR_YELLOW  is  actually  brown.  To get yellow, use
+           COLOR_YELLOW combined with the <STRONG>A_BOLD</STRONG> attribute.
 
-       -    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).
+       <STRONG>o</STRONG>   The A_BLINK attribute should in theory cause the back-
+           ground  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).
 
-       -    Color RGB values are not settable.
+       <STRONG>o</STRONG>   Color RGB values are not settable.
 
 
 </PRE>
 <H2>PORTABILITY</H2><PRE>
-       This implementation satisfies XSI Curses's  minimum  maxi-
+       This  implementation  satisfies XSI Curses's minimum maxi-
        mums for <STRONG>COLORS</STRONG> and <STRONG>COLOR_PAIRS</STRONG>.
 
-       The  <STRONG>init_pair</STRONG>  routine  accepts  negative values of fore-
-       ground  and  background  color  to  support  the   <STRONG>use_de-</STRONG>
-       <STRONG>fault_colors</STRONG>  extension, but only if that routine has been
+       The <STRONG>init_pair</STRONG> routine accepts  negative  values  of  fore-
+       ground   and  background  color  to  support  the  <STRONG>use_de-</STRONG>
+       <STRONG>fault_colors</STRONG> extension, but only if that routine has  been
        first invoked.
 
-       The assumption that <STRONG>COLOR_BLACK</STRONG> is the default  background
-       color  for  all  terminals  can  be modified using the <STRONG>as-</STRONG>
+       The  assumption that <STRONG>COLOR_BLACK</STRONG> is the default background
+       color for all terminals can  be  modified  using  the  <STRONG>as-</STRONG>
        <STRONG>sume_default_colors</STRONG> extension.
 
-       This implementation checks the  pointers,  e.g.,  for  the
-       values  returned  by  <STRONG>color_content</STRONG>  and <STRONG>pair_content</STRONG>, and
+       This  implementation  checks  the  pointers, e.g., for the
+       values returned by  <STRONG>color_content</STRONG>  and  <STRONG>pair_content</STRONG>,  and
        will treat those as optional parameters when null.
 
 
 </PRE>
 <H2>SEE ALSO</H2><PRE>
-       <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_initscr.3x.html">curs_initscr(3x)</A></STRONG>, <STRONG><A HREF="curs_attr.3x.html">curs_attr(3x)</A></STRONG>,  <STRONG>default_col-</STRONG>
-       <STRONG><A HREF="default_colors.3x.html">ors(3x)</A></STRONG>
+       <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>,  <STRONG><A HREF="curs_initscr.3x.html">curs_initscr(3x)</A></STRONG>,  <STRONG><A HREF="curs_attr.3x.html">curs_attr(3x)</A></STRONG>,  <STRONG>curs_vari-</STRONG>
+       <STRONG><A HREF="curs_variables.3x.html">ables(3x)</A></STRONG>, <STRONG><A HREF="default_colors.3x.html">default_colors(3x)</A></STRONG>
 
 
 
diff -Naur ncurses-5.7.orig/doc/html/man/curs_delch.3x.html ncurses-5.7/doc/html/man/curs_delch.3x.html
--- ncurses-5.7.orig/doc/html/man/curs_delch.3x.html	2006-09-23 16:43:00.000000000 -0400
+++ ncurses-5.7/doc/html/man/curs_delch.3x.html	2011-01-08 18:18:29.238658175 -0500
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 <!-- 
   ****************************************************************************
-  * 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            *
@@ -27,7 +27,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: curs_delch.3x,v 1.8 2006/02/25 21:42:57 tom Exp @
+  * @Id: curs_delch.3x,v 1.10 2010/08/14 23:29:16 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -78,6 +78,10 @@
        (SVr4  specifies  only  "an integer value other than <STRONG>ERR</STRONG>")
        upon successful completion.
 
+       Functions with a "mv" prefix first perform a cursor  move-
+       ment  using  <STRONG>wmove</STRONG>, and return an error if the position is
+       outside the window, or if the window pointer is null.
+
 
 </PRE>
 <H2>NOTES</H2><PRE>
diff -Naur ncurses-5.7.orig/doc/html/man/curs_deleteln.3x.html ncurses-5.7/doc/html/man/curs_deleteln.3x.html
--- ncurses-5.7.orig/doc/html/man/curs_deleteln.3x.html	2008-06-21 19:11:34.000000000 -0400
+++ ncurses-5.7/doc/html/man/curs_deleteln.3x.html	2011-01-08 18:13:50.399157173 -0500
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 <!-- 
   ****************************************************************************
-  * 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,7 +27,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: curs_deleteln.3x,v 1.11 2007/06/02 20:40:07 tom Exp @
+  * @Id: curs_deleteln.3x,v 1.12 2010/07/31 16:12:01 tom Exp @
 -->
 <HTML>
 <HEAD>
diff -Naur ncurses-5.7.orig/doc/html/man/curs_extend.3x.html ncurses-5.7/doc/html/man/curs_extend.3x.html
--- ncurses-5.7.orig/doc/html/man/curs_extend.3x.html	2007-03-03 19:10:37.000000000 -0500
+++ ncurses-5.7/doc/html/man/curs_extend.3x.html	2011-01-08 18:13:50.399157173 -0500
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 <!-- 
   ****************************************************************************
-  * 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 @@
   * authorization.                                                           *
   ****************************************************************************
   * 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.18 2010/07/31 16:12:01 tom Exp @
 -->
 <HTML>
 <HEAD>
diff -Naur ncurses-5.7.orig/doc/html/man/curs_get_wch.3x.html ncurses-5.7/doc/html/man/curs_get_wch.3x.html
--- ncurses-5.7.orig/doc/html/man/curs_get_wch.3x.html	2006-09-23 16:43:01.000000000 -0400
+++ ncurses-5.7/doc/html/man/curs_get_wch.3x.html	2011-01-08 18:18:29.238658175 -0500
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 <!-- 
   ****************************************************************************
-  * Copyright (c) 2002-2003,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            *
@@ -27,7 +27,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: curs_get_wch.3x,v 1.6 2006/02/25 21:47:06 tom Exp @
+  * @Id: curs_get_wch.3x,v 1.7 2010/08/14 23:31:42 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -123,19 +123,23 @@
 
 </PRE>
 <H2>RETURN VALUES</H2><PRE>
-       When <STRONG>get_wch</STRONG>, <STRONG>wget_wch</STRONG>, <STRONG>mvget_wch</STRONG>,  and  <STRONG>mvwget_wch</STRONG>  func-
-       tions  successfully report the pressing of a function key,
+       When  <STRONG>get_wch</STRONG>,  <STRONG>wget_wch</STRONG>,  <STRONG>mvget_wch</STRONG>, and <STRONG>mvwget_wch</STRONG> func-
+       tions successfully report the pressing of a function  key,
        they return <STRONG>KEY_CODE_YES</STRONG>.  When they successfully report a
-       wide  character,  they  return <STRONG>OK</STRONG>.  Otherwise, they return
+       wide character, they return <STRONG>OK</STRONG>.   Otherwise,  they  return
        <STRONG>ERR</STRONG>.
 
-       Upon successful completion, <STRONG>unget_wch</STRONG> returns <STRONG>OK</STRONG>.   Other-
+       Upon  successful completion, <STRONG>unget_wch</STRONG> returns <STRONG>OK</STRONG>.  Other-
        wise, the function returns <STRONG>ERR</STRONG>.
 
+       Functions with a "mv" prefix first perform a cursor  move-
+       ment  using  <STRONG>wmove</STRONG>, and return an error if the position is
+       outside the window, or if the window pointer is null.
+
 
 </PRE>
 <H2>SEE ALSO</H2><PRE>
-       <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>,        <STRONG><A HREF="curs_getch.3x.html">curs_getch(3x)</A></STRONG>,       <STRONG><A HREF="curs_ins_wch.3x.html">curs_ins_wch(3x)</A></STRONG>,
+       <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>,       <STRONG><A HREF="curs_getch.3x.html">curs_getch(3x)</A></STRONG>,        <STRONG><A HREF="curs_ins_wch.3x.html">curs_ins_wch(3x)</A></STRONG>,
        <STRONG><A HREF="curs_inopts.3x.html">curs_inopts(3x)</A></STRONG>, <STRONG><A HREF="curs_move.3x.html">curs_move(3x)</A></STRONG>, <STRONG><A HREF="curs_refresh.3x.html">curs_refresh(3x)</A></STRONG>
 
 
diff -Naur ncurses-5.7.orig/doc/html/man/curs_get_wstr.3x.html ncurses-5.7/doc/html/man/curs_get_wstr.3x.html
--- ncurses-5.7.orig/doc/html/man/curs_get_wstr.3x.html	2006-09-23 16:43:01.000000000 -0400
+++ ncurses-5.7/doc/html/man/curs_get_wstr.3x.html	2011-01-08 18:18:29.238658175 -0500
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 <!-- 
   ****************************************************************************
-  * Copyright (c) 2002-2005,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            *
@@ -27,7 +27,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: curs_get_wstr.3x,v 1.6 2006/02/25 21:49:19 tom Exp @
+  * @Id: curs_get_wstr.3x,v 1.7 2010/08/14 23:31:42 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -129,6 +129,10 @@
                    returns an error if  the  associated  call  to
                    <STRONG>wget_wch</STRONG> failed.
 
+       Functions  with a "mv" prefix first perform a cursor move-
+       ment using <STRONG>wmove</STRONG>, and return an error if the  position  is
+       outside the window, or if the window pointer is null.
+
 
 </PRE>
 <H2>PORTABILITY</H2><PRE>
@@ -147,7 +151,7 @@
 
 </PRE>
 <H2>SEE ALSO</H2><PRE>
-       Functions:  <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_get_wch.3x.html">curs_get_wch(3x)</A></STRONG>, <STRONG><A HREF="curs_getstr.3x.html">curs_getstr(3x)</A></STRONG>.
+       Functions: <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_get_wch.3x.html">curs_get_wch(3x)</A></STRONG>, <STRONG><A HREF="curs_getstr.3x.html">curs_getstr(3x)</A></STRONG>.
 
 
 
diff -Naur ncurses-5.7.orig/doc/html/man/curs_getcchar.3x.html ncurses-5.7/doc/html/man/curs_getcchar.3x.html
--- ncurses-5.7.orig/doc/html/man/curs_getcchar.3x.html	2008-06-21 19:11:34.000000000 -0400
+++ ncurses-5.7/doc/html/man/curs_getcchar.3x.html	2011-01-08 18:18:29.238658175 -0500
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 <!-- 
   ****************************************************************************
-  * Copyright (c) 2001-2006,2008 Free Software Foundation, Inc.              *
+  * Copyright (c) 2001-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            *
@@ -27,7 +27,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: curs_getcchar.3x,v 1.11 2008/05/17 19:37:05 tom Exp @
+  * @Id: curs_getcchar.3x,v 1.14 2010/09/18 20:26:21 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -77,43 +77,43 @@
        rendition from a <STRONG>cchar_t</STRONG> argument.  When <EM>wch</EM> is not a null
        pointer, the <STRONG>getcchar</STRONG> function does the following:
 
-       -    Extracts information from a <STRONG>cchar_t</STRONG> value <EM>wcval</EM>
+       <STRONG>o</STRONG>   Extracts information from a <STRONG>cchar_t</STRONG> value <EM>wcval</EM>
 
-       -    Stores  the  character  attributes  in  the  location
-            pointed to by <EM>attrs</EM>
+       <STRONG>o</STRONG>   Stores   the  character  attributes  in  the  location
+           pointed to by <EM>attrs</EM>
 
-       -    Stores the color-pair in the location pointed  to  by
-            <EM>color</EM><STRONG>_</STRONG><EM>pair</EM>
+       <STRONG>o</STRONG>   Stores the color-pair in the location  pointed  to  by
+           <EM>color</EM><STRONG>_</STRONG><EM>pair</EM>
 
-       -    Stores  the  wide-character string, characters refer-
-            enced by <EM>wcval</EM>, into the array pointed to by <EM>wch</EM>.
+       <STRONG>o</STRONG>   Stores  the  wide-character  string, characters refer-
+           enced by <EM>wcval</EM>, into the array pointed to by <EM>wch</EM>.
 
        When <EM>wch</EM> is a null pointer, the <STRONG>getcchar</STRONG> function does the
        following:
 
-       -    Obtains  the  number of wide characters pointed to by
-            <EM>wcval</EM>
+       <STRONG>o</STRONG>   Obtains  the  number  of wide characters pointed to by
+           <EM>wcval</EM>
 
-       -    Does not change  the  data  referenced  by  <EM>attrs</EM>  or
-            <EM>color</EM><STRONG>_</STRONG><EM>pair</EM>
+       <STRONG>o</STRONG>   Does not  change  the  data  referenced  by  <EM>attrs</EM>  or
+           <EM>color</EM><STRONG>_</STRONG><EM>pair</EM>
 
        The  <STRONG>setcchar</STRONG> function initializes the location pointed to
        by <EM>wcval</EM> by using:
 
-       -    The character attributes in <EM>attrs</EM>
+       <STRONG>o</STRONG>   The character attributes in <EM>attrs</EM>
 
-       -    The color pair in <EM>color</EM><STRONG>_</STRONG><EM>pair</EM>
+       <STRONG>o</STRONG>   The color pair in <EM>color</EM><STRONG>_</STRONG><EM>pair</EM>
 
-       -    The wide-character string pointed  to  by  <EM>wch</EM>.   The
-            string  must be L'\0' terminated, contain at most one
-            spacing character, which must be the first.
+       <STRONG>o</STRONG>   The wide-character string  pointed  to  by  <EM>wch</EM>.   The
+           string  must  be L'\0' terminated, contain at most one
+           spacing character, which must be the first.
 
-            Up to <STRONG>CCHARW_MAX</STRONG>-1 nonspacing characters may  follow.
-            Additional nonspacing characters are ignored.
+           Up to <STRONG>CCHARW_MAX</STRONG>-1 nonspacing characters  may  follow.
+           Additional nonspacing characters are ignored.
 
-            The  string  may  contain  a single control character
-            instead.  In that case, no nonspacing characters  are
-            allowed.
+           The  string  may  contain  a  single control character
+           instead.  In that case, no nonspacing  characters  are
+           allowed.
 
 
 </PRE>
@@ -130,18 +130,19 @@
 </PRE>
 <H2>RETURN VALUES</H2><PRE>
        When <EM>wch</EM> is a null pointer, <STRONG>getcchar</STRONG> returns the number of
-       wide characters referenced by <EM>wcval</EM>.
+       wide characters referenced by <EM>wcval</EM>, including one  for  a
+       trailing null.
 
-       When <EM>wch</EM> is not a null pointer, <STRONG>getcchar</STRONG> returns  <STRONG>OK</STRONG>  upon
+       When  <EM>wch</EM>  is not a null pointer, <STRONG>getcchar</STRONG> returns <STRONG>OK</STRONG> upon
        successful completion, and <STRONG>ERR</STRONG> otherwise.
 
-       Upon  successful  completion, <STRONG>setcchar</STRONG> returns <STRONG>OK</STRONG>.  Other-
+       Upon successful completion, <STRONG>setcchar</STRONG> returns  <STRONG>OK</STRONG>.   Other-
        wise, it returns <STRONG>ERR</STRONG>.
 
 
 </PRE>
 <H2>SEE ALSO</H2><PRE>
-       Functions:  <STRONG><A HREF="curs_attr.3x.html">curs_attr(3x)</A></STRONG>,   <STRONG><A HREF="curs_color.3x.html">curs_color(3x)</A></STRONG>,   <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>,
+       Functions:   <STRONG><A HREF="curs_attr.3x.html">curs_attr(3x)</A></STRONG>,   <STRONG><A HREF="curs_color.3x.html">curs_color(3x)</A></STRONG>,  <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>,
        <STRONG><A HREF="wcwidth.3.html">wcwidth(3)</A></STRONG>.
 
 
diff -Naur ncurses-5.7.orig/doc/html/man/curs_getch.3x.html ncurses-5.7/doc/html/man/curs_getch.3x.html
--- ncurses-5.7.orig/doc/html/man/curs_getch.3x.html	2006-12-16 17:51:26.000000000 -0500
+++ ncurses-5.7/doc/html/man/curs_getch.3x.html	2011-01-08 18:18:29.238658175 -0500
@@ -2,7 +2,7 @@
 <!-- 
   * 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            *
@@ -28,7 +28,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: curs_getch.3x,v 1.30 2006/12/02 17:02:53 tom Exp @
+  * @Id: curs_getch.3x,v 1.32 2010/08/14 23:29:16 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -78,7 +78,7 @@
 
        Unless <STRONG>noecho</STRONG> has been set, then the character  will  also
        be echoed into the designated window according to the fol-
-       lowing rules: If the character is the current erase  char-
+       lowing rules: if the character is the current erase  char-
        acter,  left  arrow, or backspace, the cursor is moved one
        space to the left and that screen position is erased as if
        <STRONG>delch</STRONG> had been called.  If the character value is any oth-
@@ -110,7 +110,6 @@
        be returned by the next call to <STRONG>wgetch</STRONG>.  There is just one
        input queue for all windows.
 
-
    <STRONG>Function</STRONG> <STRONG>Keys</STRONG>
        The following function keys, defined in <STRONG>&lt;curses.h&gt;</STRONG>,  might
        be  returned  by  <STRONG>getch</STRONG>  if <STRONG>keypad</STRONG> has been enabled.  Note
@@ -179,8 +178,8 @@
             KEY_REPLACE     Replace key
             KEY_RESIZE      Screen resized
             KEY_RESTART     Restart key
-            KEY_RESUME      Resume key
 
+            KEY_RESUME      Resume key
             KEY_SAVE        Save key
             KEY_SBEG        Shifted beginning key
             KEY_SCANCEL     Shifted cancel key
@@ -233,7 +232,6 @@
        sion of <STRONG>KEY_MOUSE</STRONG>.
 
 
-
 </PRE>
 <H2>RETURN VALUE</H2><PRE>
        All routines return the integer <STRONG>ERR</STRONG> upon  failure  and  an
@@ -249,6 +247,10 @@
                    null, or if its timeout expires without having
                    any data.
 
+       Functions  with a "mv" prefix first perform a cursor move-
+       ment using <STRONG>wmove</STRONG>, and return an error if the  position  is
+       outside the window, or if the window pointer is null.
+
 
 </PRE>
 <H2>NOTES</H2><PRE>
diff -Naur ncurses-5.7.orig/doc/html/man/curs_getstr.3x.html ncurses-5.7/doc/html/man/curs_getstr.3x.html
--- ncurses-5.7.orig/doc/html/man/curs_getstr.3x.html	2006-09-23 16:43:02.000000000 -0400
+++ ncurses-5.7/doc/html/man/curs_getstr.3x.html	2011-01-08 18:18:29.350657586 -0500
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 <!-- 
   ****************************************************************************
-  * 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            *
@@ -27,7 +27,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: curs_getstr.3x,v 1.15 2006/01/12 00:30:58 tom Exp @
+  * @Id: curs_getstr.3x,v 1.18 2010/10/02 23:19:43 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -107,6 +107,10 @@
        SIGWINCH interrupts the function, it will  return  <STRONG>KEY_RE-</STRONG>
        <STRONG>SIZE</STRONG> rather than <STRONG>OK</STRONG> or <STRONG>ERR</STRONG>.
 
+       Functions  with a "mv" prefix first perform a cursor move-
+       ment using <STRONG>wmove</STRONG>, and return an error if the  position  is
+       outside the window, or if the window pointer is null.
+
 
 </PRE>
 <H2>NOTES</H2><PRE>
@@ -136,7 +140,7 @@
 
 </PRE>
 <H2>SEE ALSO</H2><PRE>
-       <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_getch.3x.html">curs_getch(3x)</A></STRONG>.
+       <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_getch.3x.html">curs_getch(3x)</A></STRONG>, <STRONG><A HREF="curs_variables.3x.html">curs_variables(3x)</A></STRONG>.
 
 
 
diff -Naur ncurses-5.7.orig/doc/html/man/curs_getyx.3x.html ncurses-5.7/doc/html/man/curs_getyx.3x.html
--- ncurses-5.7.orig/doc/html/man/curs_getyx.3x.html	2008-06-21 19:11:35.000000000 -0400
+++ ncurses-5.7/doc/html/man/curs_getyx.3x.html	2011-01-08 18:13:50.403157294 -0500
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 <!-- 
   ****************************************************************************
-  * 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,7 +27,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: curs_getyx.3x,v 1.16 2007/05/12 16:34:49 tom Exp @
+  * @Id: curs_getyx.3x,v 1.17 2010/07/31 16:12:01 tom Exp @
 -->
 <HTML>
 <HEAD>
diff -Naur ncurses-5.7.orig/doc/html/man/curs_in_wch.3x.html ncurses-5.7/doc/html/man/curs_in_wch.3x.html
--- ncurses-5.7.orig/doc/html/man/curs_in_wch.3x.html	2006-09-23 16:43:02.000000000 -0400
+++ ncurses-5.7/doc/html/man/curs_in_wch.3x.html	2011-01-08 18:18:29.238658175 -0500
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 <!-- 
   ****************************************************************************
-  * 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            *
@@ -27,7 +27,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: curs_in_wch.3x,v 1.2 2006/02/25 21:42:22 tom Exp @
+  * @Id: curs_in_wch.3x,v 1.4 2010/08/14 23:29:16 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -76,6 +76,10 @@
        the  cursor,  returning  ERR in that case.  Otherwise they
        return OK
 
+       Functions with a "mv" prefix first perform a cursor  move-
+       ment  using  <STRONG>wmove</STRONG>, and return an error if the position is
+       outside the window, or if the window pointer is null.
+
 
 </PRE>
 <H2>NOTES</H2><PRE>
diff -Naur ncurses-5.7.orig/doc/html/man/curs_in_wchstr.3x.html ncurses-5.7/doc/html/man/curs_in_wchstr.3x.html
--- ncurses-5.7.orig/doc/html/man/curs_in_wchstr.3x.html	2006-12-16 17:51:27.000000000 -0500
+++ ncurses-5.7/doc/html/man/curs_in_wchstr.3x.html	2011-01-08 18:18:29.238658175 -0500
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 <!-- 
   ****************************************************************************
-  * Copyright (c) 2002-2005,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            *
@@ -27,7 +27,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: curs_in_wchstr.3x,v 1.6 2006/12/02 17:03:07 tom Exp @
+  * @Id: curs_in_wchstr.3x,v 1.7 2010/08/14 23:31:42 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -94,6 +94,10 @@
        Upon successful completion,  these  functions  return  <STRONG>OK</STRONG>.
        Otherwise, they return <STRONG>ERR</STRONG>.
 
+       Functions  with a "mv" prefix first perform a cursor move-
+       ment using <STRONG>wmove</STRONG>, and return an error if the  position  is
+       outside the window, or if the window pointer is null.
+
 
 </PRE>
 <H2>PORTABILITY</H2><PRE>
diff -Naur ncurses-5.7.orig/doc/html/man/curs_inch.3x.html ncurses-5.7/doc/html/man/curs_inch.3x.html
--- ncurses-5.7.orig/doc/html/man/curs_inch.3x.html	2006-12-16 17:51:27.000000000 -0500
+++ ncurses-5.7/doc/html/man/curs_inch.3x.html	2011-01-08 18:18:29.238658175 -0500
@@ -2,7 +2,7 @@
 <!-- 
   * 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            *
@@ -28,7 +28,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: curs_inch.3x,v 1.13 2006/12/02 16:58:55 tom Exp @
+  * @Id: curs_inch.3x,v 1.16 2010/08/14 23:35:36 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -81,6 +81,13 @@
 
 
 </PRE>
+<H2>RETURN VALUE</H2><PRE>
+       Functions with a "mv" prefix first perform a cursor  move-
+       ment  using  <STRONG>wmove</STRONG>, and return an error if the position is
+       outside the window, or if the window pointer is null.
+
+
+</PRE>
 <H2>NOTES</H2><PRE>
        Note that all of these routines may be macros.
 
diff -Naur ncurses-5.7.orig/doc/html/man/curs_inchstr.3x.html ncurses-5.7/doc/html/man/curs_inchstr.3x.html
--- ncurses-5.7.orig/doc/html/man/curs_inchstr.3x.html	2006-12-16 17:51:27.000000000 -0500
+++ ncurses-5.7/doc/html/man/curs_inchstr.3x.html	2011-01-08 18:18:29.238658175 -0500
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 <!-- 
   ****************************************************************************
-  * 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,7 +27,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: curs_inchstr.3x,v 1.12 2006/12/02 17:00:58 tom Exp @
+  * @Id: curs_inchstr.3x,v 1.14 2010/08/14 23:29:16 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -91,14 +91,18 @@
        is null, no data is returned, and the return value is  ze-
        ro.
 
+       Functions  with a "mv" prefix first perform a cursor move-
+       ment using <STRONG>wmove</STRONG>, and return an error if the  position  is
+       outside the window, or if the window pointer is null.
+
 
 </PRE>
 <H2>NOTES</H2><PRE>
        Note  that  all  routines  except <STRONG>winchnstr</STRONG> may be macros.
-       SVr4 does not document whether the result string is 0-ter-
-       minated; it does not document whether a length limit argu-
-       ment includes any trailing 0; and it does not document the
-       meaning of the return value.
+       SVr4 does not 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.
 
 
 </PRE>
diff -Naur ncurses-5.7.orig/doc/html/man/curs_initscr.3x.html ncurses-5.7/doc/html/man/curs_initscr.3x.html
--- ncurses-5.7.orig/doc/html/man/curs_initscr.3x.html	2005-05-15 13:05:52.000000000 -0400
+++ ncurses-5.7/doc/html/man/curs_initscr.3x.html	2011-01-08 18:18:29.350657586 -0500
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 <!-- 
   ****************************************************************************
-  * 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            *
@@ -27,7 +27,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: curs_initscr.3x,v 1.14 2005/05/15 16:18:01 tom Exp @
+  * @Id: curs_initscr.3x,v 1.16 2010/10/02 23:19:57 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -127,8 +127,8 @@
 
        Routines that return pointers always return <STRONG>NULL</STRONG> on error.
 
-       X/Open defines no error conditions.  In  this  implementa-
-       tion  <STRONG>endwin</STRONG> returns an error if the terminal was not ini-
+       X/Open  defines  no error conditions.  In this implementa-
+       tion <STRONG>endwin</STRONG> returns an error if the terminal was not  ini-
        tialized.
 
 
@@ -139,20 +139,20 @@
 
 </PRE>
 <H2>PORTABILITY</H2><PRE>
-       These functions are described in the XSI Curses  standard,
+       These  functions are described in the XSI Curses standard,
        Issue 4.  It specifies that portable applications must not
        call <STRONG>initscr</STRONG> more than once.
 
        Old versions of curses, e.g., BSD 4.4, may have returned a
-       null  pointer  from  <STRONG>initscr</STRONG>  when  an  error is detected,
-       rather than exiting.  It is safe but  redundant  to  check
+       null pointer from  <STRONG>initscr</STRONG>  when  an  error  is  detected,
+       rather  than  exiting.   It is safe but redundant to check
        the return value of <STRONG>initscr</STRONG> in XSI Curses.
 
 
 </PRE>
 <H2>SEE ALSO</H2><PRE>
        <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>,       <STRONG><A HREF="curs_kernel.3x.html">curs_kernel(3x)</A></STRONG>,       <STRONG><A HREF="curs_refresh.3x.html">curs_refresh(3x)</A></STRONG>,
-       <STRONG><A HREF="curs_slk.3x.html">curs_slk(3x)</A></STRONG>, <STRONG><A HREF="curs_util.3x.html">curs_util(3x)</A></STRONG>
+       <STRONG><A HREF="curs_slk.3x.html">curs_slk(3x)</A></STRONG>, <STRONG><A HREF="curs_util.3x.html">curs_util(3x)</A></STRONG>, <STRONG><A HREF="curs_variables.3x.html">curs_variables(3x)</A></STRONG>.
 
 
 
diff -Naur ncurses-5.7.orig/doc/html/man/curs_inopts.3x.html ncurses-5.7/doc/html/man/curs_inopts.3x.html
--- ncurses-5.7.orig/doc/html/man/curs_inopts.3x.html	2005-05-15 13:05:52.000000000 -0400
+++ ncurses-5.7/doc/html/man/curs_inopts.3x.html	2011-01-08 18:13:50.403157294 -0500
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 <!-- 
   ****************************************************************************
-  * 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            *
@@ -27,7 +27,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: curs_inopts.3x,v 1.13 2005/05/15 16:18:07 tom Exp @
+  * @Id: curs_inopts.3x,v 1.14 2010/07/31 16:11:27 tom Exp @
 -->
 <HTML>
 <HEAD>
diff -Naur ncurses-5.7.orig/doc/html/man/curs_ins_wch.3x.html ncurses-5.7/doc/html/man/curs_ins_wch.3x.html
--- ncurses-5.7.orig/doc/html/man/curs_ins_wch.3x.html	2006-09-23 16:43:03.000000000 -0400
+++ ncurses-5.7/doc/html/man/curs_ins_wch.3x.html	2011-01-08 18:18:29.238658175 -0500
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 <!-- 
   ****************************************************************************
-  * 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            *
@@ -27,7 +27,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: curs_ins_wch.3x,v 1.3 2006/02/25 21:42:22 tom Exp @
+  * @Id: curs_ins_wch.3x,v 1.4 2010/08/14 23:31:42 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -77,6 +77,10 @@
        If successful, these functions return OK.   If  not,  they
        return ERR.
 
+       Functions  with a "mv" prefix first perform a cursor move-
+       ment using <STRONG>wmove</STRONG>, and return an error if the  position  is
+       outside the window, or if the window pointer is null.
+
 
 </PRE>
 <H2>ERRORS</H2><PRE>
diff -Naur ncurses-5.7.orig/doc/html/man/curs_ins_wstr.3x.html ncurses-5.7/doc/html/man/curs_ins_wstr.3x.html
--- ncurses-5.7.orig/doc/html/man/curs_ins_wstr.3x.html	2005-05-15 13:05:52.000000000 -0400
+++ ncurses-5.7/doc/html/man/curs_ins_wstr.3x.html	2011-01-08 18:18:29.242657591 -0500
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 <!-- 
   ****************************************************************************
-  * Copyright (c) 2002,2005 Free Software Foundation, Inc.                   *
+  * Copyright (c) 2002-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            *
@@ -27,7 +27,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: curs_ins_wstr.3x,v 1.4 2005/05/15 17:02:54 tom Exp @
+  * @Id: curs_ins_wstr.3x,v 1.5 2010/08/14 23:31:42 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -106,6 +106,10 @@
        Upon successful completion,  these  functions  return  OK.
        Otherwise, they return ERR.
 
+       Functions  with a "mv" prefix first perform a cursor move-
+       ment using <STRONG>wmove</STRONG>, and return an error if the  position  is
+       outside the window, or if the window pointer is null.
+
 
 </PRE>
 <H2>SEE ALSO</H2><PRE>
diff -Naur ncurses-5.7.orig/doc/html/man/curs_insch.3x.html ncurses-5.7/doc/html/man/curs_insch.3x.html
--- ncurses-5.7.orig/doc/html/man/curs_insch.3x.html	2006-12-16 17:51:28.000000000 -0500
+++ ncurses-5.7/doc/html/man/curs_insch.3x.html	2011-01-08 18:18:29.242657591 -0500
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 <!-- 
   ****************************************************************************
-  * 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,7 +27,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: curs_insch.3x,v 1.10 2006/12/02 17:01:50 tom Exp @
+  * @Id: curs_insch.3x,v 1.12 2010/08/14 23:29:16 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -78,6 +78,10 @@
        than  <STRONG>ERR</STRONG>")  upon  successful completion, unless otherwise
        noted in the preceding routine descriptions.
 
+       Functions with a "mv" prefix first perform a cursor  move-
+       ment  using  <STRONG>wmove</STRONG>, and return an error if the position is
+       outside the window, or if the window pointer is null.
+
 
 </PRE>
 <H2>NOTES</H2><PRE>
diff -Naur ncurses-5.7.orig/doc/html/man/curs_insstr.3x.html ncurses-5.7/doc/html/man/curs_insstr.3x.html
--- ncurses-5.7.orig/doc/html/man/curs_insstr.3x.html	2006-12-24 10:50:54.000000000 -0500
+++ ncurses-5.7/doc/html/man/curs_insstr.3x.html	2011-01-08 18:18:29.242657591 -0500
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 <!-- 
   ****************************************************************************
-  * 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,7 +27,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: curs_insstr.3x,v 1.18 2006/12/24 14:59:30 tom Exp @
+  * @Id: curs_insstr.3x,v 1.20 2010/08/14 23:29:16 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -68,14 +68,14 @@
 
 </PRE>
 <H2>DESCRIPTION</H2><PRE>
-       These  routines insert a character string (as many charac-
-       ters as will fit on the line) before the  character  under
+       These routines insert a character string (as many  charac-
+       ters  as  will fit on the line) before the character under
        the cursor.  All characters to the right of the cursor are
-       shifted right with the possibility of the rightmost  char-
-       acters  on  the line being lost.  The cursor position does
-       not change (after moving to  <EM>y</EM>,  <EM>x</EM>,  if  specified).   The
-       functions  with  <EM>n</EM>  as  the last argument insert a leading
-       substring of at most <EM>n</EM>  characters.   If  <EM>n</EM>&lt;=0,  then  the
+       shifted  right with the possibility of the rightmost char-
+       acters on the line being lost.  The cursor  position  does
+       not  change  (after  moving  to  <EM>y</EM>, <EM>x</EM>, if specified).  The
+       functions with <EM>n</EM> as the last  argument  insert  a  leading
+       substring  of  at  most  <EM>n</EM>  characters.  If <EM>n</EM>&lt;=0, then the
        entire string is inserted.
 
        Special characters are handled as in <STRONG>addch</STRONG>.
@@ -83,15 +83,19 @@
 
 </PRE>
 <H2>RETURN VALUE</H2><PRE>
-       All  routines that return an integer return <STRONG>ERR</STRONG> upon fail-
-       ure and OK (SVr4 specifies only "an  integer  value  other
-       than  <STRONG>ERR</STRONG>")  upon  successful completion, unless otherwise
+       All routines that return an integer return <STRONG>ERR</STRONG> upon  fail-
+       ure  and  OK  (SVr4 specifies only "an integer value other
+       than <STRONG>ERR</STRONG>") upon successful  completion,  unless  otherwise
        noted in the preceding routine descriptions.
 
-       X/Open defines no error conditions.  In  this  implementa-
+       X/Open  defines  no error conditions.  In this implementa-
        tion, if the window parameter is null or the str parameter
        is null, an error is returned.
 
+       Functions  with a "mv" prefix first perform a cursor move-
+       ment using <STRONG>wmove</STRONG>, and return an error if the  position  is
+       outside the window, or if the window pointer is null.
+
 
 </PRE>
 <H2>NOTES</H2><PRE>
@@ -100,19 +104,19 @@
 
 </PRE>
 <H2>PORTABILITY</H2><PRE>
-       These functions are described in the XSI Curses  standard,
+       These  functions are described in the XSI Curses standard,
        Issue 4, which adds const qualifiers to the arguments.
 
-       The  Single  Unix  Specification,  Version  2  states that
-       <STRONG>insnstr</STRONG> and <STRONG>winsnstr</STRONG> perform wrapping.  This  is  probably
+       The Single  Unix  Specification,  Version  2  states  that
+       <STRONG>insnstr</STRONG>  and  <STRONG>winsnstr</STRONG> perform wrapping.  This is probably
        an error, since it makes this group of functions inconsis-
-       tent.  Also, no implementation of  curses  documents  this
+       tent.   Also,  no  implementation of curses documents this
        inconsistency.
 
 
 </PRE>
 <H2>SEE ALSO</H2><PRE>
-       <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>,  <STRONG><A HREF="curs_util.3x.html">curs_util(3x)</A></STRONG>, <STRONG><A HREF="curs_clear.3x.html">curs_clear(3x)</A></STRONG>, <STRONG><A HREF="curs_inch.3x.html">curs_inch(3x)</A></STRONG>.
+       <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_util.3x.html">curs_util(3x)</A></STRONG>, <STRONG><A HREF="curs_clear.3x.html">curs_clear(3x)</A></STRONG>, <STRONG><A HREF="curs_inch.3x.html">curs_inch(3x)</A></STRONG>.
 
 
 
diff -Naur ncurses-5.7.orig/doc/html/man/curs_instr.3x.html ncurses-5.7/doc/html/man/curs_instr.3x.html
--- ncurses-5.7.orig/doc/html/man/curs_instr.3x.html	2006-09-23 16:43:04.000000000 -0400
+++ ncurses-5.7/doc/html/man/curs_instr.3x.html	2011-01-08 18:18:29.242657591 -0500
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 <!-- 
   ****************************************************************************
-  * 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,7 +27,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: curs_instr.3x,v 1.13 2006/02/25 21:49:19 tom Exp @
+  * @Id: curs_instr.3x,v 1.15 2010/08/14 23:29:16 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -86,6 +86,10 @@
        tion, if the window parameter is null or the str parameter
        is null, a zero is returned.
 
+       Functions with a "mv" prefix first perform a cursor  move-
+       ment  using  <STRONG>wmove</STRONG>, and return an error if the position is
+       outside the window, or if the window pointer is null.
+
 
 </PRE>
 <H2>NOTES</H2><PRE>
diff -Naur ncurses-5.7.orig/doc/html/man/curs_inwstr.3x.html ncurses-5.7/doc/html/man/curs_inwstr.3x.html
--- ncurses-5.7.orig/doc/html/man/curs_inwstr.3x.html	2006-09-23 16:43:05.000000000 -0400
+++ ncurses-5.7/doc/html/man/curs_inwstr.3x.html	2011-01-08 18:18:29.242657591 -0500
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 <!-- 
   ****************************************************************************
-  * Copyright (c) 2002-2005,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            *
@@ -27,7 +27,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: curs_inwstr.3x,v 1.5 2006/02/25 21:20:20 tom Exp @
+  * @Id: curs_inwstr.3x,v 1.6 2010/08/14 23:31:42 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -93,6 +93,10 @@
        routines  return  the  number  of characters read into the
        string.
 
+       Functions with a "mv" prefix first perform a cursor  move-
+       ment  using  <STRONG>wmove</STRONG>, and return an error if the position is
+       outside the window, or if the window pointer is null.
+
 
 </PRE>
 <H2>SEE ALSO</H2><PRE>
diff -Naur ncurses-5.7.orig/doc/html/man/curs_kernel.3x.html ncurses-5.7/doc/html/man/curs_kernel.3x.html
--- ncurses-5.7.orig/doc/html/man/curs_kernel.3x.html	2005-05-15 13:05:53.000000000 -0400
+++ ncurses-5.7/doc/html/man/curs_kernel.3x.html	2011-01-08 18:18:29.350657586 -0500
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 <!-- 
   ****************************************************************************
-  * 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            *
@@ -27,7 +27,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: curs_kernel.3x,v 1.15 2005/05/15 16:18:13 tom Exp @
+  * @Id: curs_kernel.3x,v 1.18 2010/10/02 23:20:13 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -72,7 +72,7 @@
 </PRE>
 <H2>DESCRIPTION</H2><PRE>
        The  following  routines  give low-level access to various
-       <STRONG>curses</STRONG> capabilities.  Theses routines typically  are  used
+       <STRONG>curses</STRONG> capabilities.  These routines  typically  are  used
        inside library routines.
 
        The  <STRONG>def_prog_mode</STRONG>  and  <STRONG>def_shell_mode</STRONG>  routines save the
@@ -128,11 +128,11 @@
        <STRONG>ripoffline</STRONG>  can  be called up to five times before calling
        <STRONG>initscr</STRONG> or <STRONG>newterm</STRONG>.
 
-       The <STRONG>curs_set</STRONG> routine sets the cursor state is set  to  in-
-       visible,  normal,  or very visible for <STRONG>visibility</STRONG> equal to
-       <STRONG>0</STRONG>, <STRONG>1</STRONG>, or <STRONG>2</STRONG> respectively.  If  the  terminal  supports  the
-       <EM>visibility</EM>  requested,  the  previous  <EM>cursor</EM> state is re-
-       turned; otherwise, <STRONG>ERR</STRONG> is returned.
+       The <STRONG>curs_set</STRONG> routine sets the cursor state  to  invisible,
+       normal, or very visible for <STRONG>visibility</STRONG> equal to <STRONG>0</STRONG>, <STRONG>1</STRONG>, or <STRONG>2</STRONG>
+       respectively.  If the terminal supports the <EM>visibility</EM> re-
+       quested, the previous <EM>cursor</EM> state is returned; otherwise,
+       <STRONG>ERR</STRONG> is returned.
 
        The <STRONG>napms</STRONG> routine is used to sleep for <EM>ms</EM> milliseconds.
 
@@ -149,48 +149,49 @@
 
               <STRONG>def_prog_mode</STRONG>, <STRONG>def_shell_mode</STRONG>, <STRONG>reset_prog_mode</STRONG>, <STRONG>re-</STRONG>
               <STRONG>set_shell_mode</STRONG>
-                   return an error if the terminal was  not  ini-
-                   tialized,  or  if  the  I/O call to obtain the
+                   return  an  error if the terminal was not ini-
+                   tialized, or if the I/O  call  to  obtain  the
                    terminal settings fails.
 
               <STRONG>ripoffline</STRONG>
-                   returns an error  if  the  maximum  number  of
-                   ripped-off  lines exceeds the maximum (NRIPS =
+                   returns  an  error  if  the  maximum number of
+                   ripped-off lines exceeds the maximum (NRIPS  =
                    5).
 
 
 </PRE>
 <H2>NOTES</H2><PRE>
-       Note that <STRONG>getsyx</STRONG> is a macro, so <STRONG>&amp;</STRONG> is not necessary  before
+       Note  that <STRONG>getsyx</STRONG> is a macro, so <STRONG>&amp;</STRONG> is not necessary before
        the variables <EM>y</EM> and <EM>x</EM>.
 
-       Older  SVr4  man  pages  warn  that  the  return  value of
-       <STRONG>curs_set</STRONG> "is currently  incorrect".   This  implementation
-       gets  it  right, but it may be unwise to count on the cor-
+       Older SVr4  man  pages  warn  that  the  return  value  of
+       <STRONG>curs_set</STRONG>  "is  currently  incorrect".  This implementation
+       gets it right, but it may be unwise to count on  the  cor-
        rectness of the return value anywhere else.
 
-       Both ncurses and SVr4 will  call  <STRONG>curs_set</STRONG>  in  <STRONG>endwin</STRONG>  if
-       <STRONG>curs_set</STRONG>  has  been  called  to make the cursor other than
-       normal, i.e., either invisible or very visible.  There  is
-       no  way  for ncurses to determine the initial cursor state
+       Both  ncurses  and  SVr4  will  call <STRONG>curs_set</STRONG> in <STRONG>endwin</STRONG> if
+       <STRONG>curs_set</STRONG> has been called to make  the  cursor  other  than
+       normal,  i.e., either invisible or very visible.  There is
+       no way for ncurses to determine the initial  cursor  state
        to restore that.
 
 
 </PRE>
 <H2>PORTABILITY</H2><PRE>
-       The functions <STRONG>setsyx</STRONG> and <STRONG>getsyx</STRONG> are not described  in  the
-       XSI  Curses standard, Issue 4.  All other functions are as
+       The  functions  <STRONG>setsyx</STRONG> and <STRONG>getsyx</STRONG> are not described in the
+       XSI Curses standard, Issue 4.  All other functions are  as
        described in XSI Curses.
 
        The SVr4 documentation describes <STRONG>setsyx</STRONG> and <STRONG>getsyx</STRONG> as hav-
-       ing  return  type  int.  This  is  misleading, as they are
-       macros with no documented semantics for the return  value.
+       ing return type int.  This  is  misleading,  as  they  are
+       macros with no documented semantics for the return value.
 
 
 </PRE>
 <H2>SEE ALSO</H2><PRE>
        <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>,  <STRONG><A HREF="curs_initscr.3x.html">curs_initscr(3x)</A></STRONG>,  <STRONG><A HREF="curs_outopts.3x.html">curs_outopts(3x)</A></STRONG>, <STRONG>curs_re-</STRONG>
-       <STRONG><A HREF="curs_refresh.3x.html">fresh(3x)</A></STRONG>, <STRONG><A HREF="curs_scr_dump.3x.html">curs_scr_dump(3x)</A></STRONG>, <STRONG><A HREF="curs_slk.3x.html">curs_slk(3x)</A></STRONG>
+       <STRONG><A HREF="curs_refresh.3x.html">fresh(3x)</A></STRONG>,  <STRONG><A HREF="curs_scr_dump.3x.html">curs_scr_dump(3x)</A></STRONG>,  <STRONG><A HREF="curs_slk.3x.html">curs_slk(3x)</A></STRONG>,   <STRONG>curs_vari-</STRONG>
+       <STRONG><A HREF="curs_variables.3x.html">ables(3x)</A></STRONG>.
 
 
 
diff -Naur ncurses-5.7.orig/doc/html/man/curs_legacy.3x.html ncurses-5.7/doc/html/man/curs_legacy.3x.html
--- ncurses-5.7.orig/doc/html/man/curs_legacy.3x.html	2008-06-21 19:11:38.000000000 -0400
+++ ncurses-5.7/doc/html/man/curs_legacy.3x.html	2011-01-08 18:18:29.350657586 -0500
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 <!-- 
   ****************************************************************************
-  * 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            *
@@ -27,7 +27,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: curs_legacy.3x,v 1.1 2007/04/07 23:54:29 tom Exp @
+  * @Id: curs_legacy.3x,v 1.4 2010/09/18 22:31:47 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -47,14 +47,15 @@
 
 </PRE>
 <H2>NAME</H2><PRE>
-       <STRONG>getbegx</STRONG>, <STRONG>getbegy</STRONG>, <STRONG>getcurx</STRONG>, <STRONG>getcury</STRONG>, <STRONG>getmaxx</STRONG>, <STRONG>getmaxy</STRONG>, <STRONG>get-</STRONG>
-       <STRONG>parx</STRONG>, <STRONG>getpary</STRONG> - get <STRONG>curses</STRONG> cursor and window coordinates
+       getattrs  -  get  <STRONG>curses</STRONG>  cursor  and  window coordinates,
+       attributes
 
 
 </PRE>
 <H2>SYNOPSIS</H2><PRE>
        <STRONG>#include</STRONG> <STRONG>&lt;curses.h&gt;</STRONG>
 
+       <STRONG>int</STRONG> <STRONG>getattrs(WINDOW</STRONG> <STRONG>*win);</STRONG>
        <STRONG>int</STRONG> <STRONG>getbegx(WINDOW</STRONG> <STRONG>*win);</STRONG>
        <STRONG>int</STRONG> <STRONG>getbegy(WINDOW</STRONG> <STRONG>*win);</STRONG>
        <STRONG>int</STRONG> <STRONG>getcurx(WINDOW</STRONG> <STRONG>*win);</STRONG>
diff -Naur ncurses-5.7.orig/doc/html/man/curs_memleaks.3x.html ncurses-5.7/doc/html/man/curs_memleaks.3x.html
--- ncurses-5.7.orig/doc/html/man/curs_memleaks.3x.html	1969-12-31 19:00:00.000000000 -0500
+++ ncurses-5.7/doc/html/man/curs_memleaks.3x.html	2011-01-08 18:13:50.407157335 -0500
@@ -0,0 +1,111 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
+<!-- 
+  ****************************************************************************
+  * 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            *
+  * "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_memleaks.3x,v 1.2 2010/07/31 16:11:27 tom Exp @
+-->
+<HTML>
+<HEAD>
+<TITLE>curs_memleaks 3x</TITLE>
+<link rev=made href="mailto:bug-ncurses@gnu.org">
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+</HEAD>
+<BODY>
+<H1>curs_memleaks 3x</H1>
+<HR>
+<PRE>
+<!-- Manpage converted by man2html 3.0.1 -->
+<STRONG><A HREF="curs_memleaks.3x.html">curs_memleaks(3x)</A></STRONG>                                     <STRONG><A HREF="curs_memleaks.3x.html">curs_memleaks(3x)</A></STRONG>
+
+
+
+
+</PRE>
+<H2>NAME</H2><PRE>
+       <STRONG>_nc_freeall</STRONG> <STRONG>_nc_free_and_exit</STRONG> - <STRONG>curses</STRONG> memory-leak
+       checking
+
+
+</PRE>
+<H2>SYNOPSIS</H2><PRE>
+       <STRONG>#include</STRONG> <STRONG>&lt;curses.h&gt;</STRONG>
+
+       <STRONG>void</STRONG> <STRONG>_nc_freeall(void);</STRONG>
+       <STRONG>void</STRONG> <STRONG>_nc_free_and_exit(int);</STRONG>
+
+
+</PRE>
+<H2>DESCRIPTION</H2><PRE>
+       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 <STRONG>--disable-leaks</STRONG> option.  That com-
+       piles-in code that frees memory that normally would not be
+       freed.
+
+       Any  implementation of curses must not free the memory as-
+       sociated with a screen, since (even after calling <STRONG>endwin</STRONG>),
+       it  must be available for use in the next call to <STRONG>refresh</STRONG>.
+       There are also chunks of memory held for performance  rea-
+       sons.   That  makes it hard to analyze curses applications
+       for memory leaks.  To work around this, one  can  build  a
+       debugging version of the ncurses library which frees those
+       chunks which it can, and provides these functions to  free
+       all of the memory allocated by the ncurses library.
+
+       The  _nc_free_and_exit function is the preferred one since
+       some of the memory which is freed may be required for  the
+       application  to  continue  running.   Its parameter is the
+       code to pass to the exit routine.
+
+
+</PRE>
+<H2>RETURN VALUE</H2><PRE>
+       These functions do not return a value.
+
+
+</PRE>
+<H2>PORTABILITY</H2><PRE>
+       These functions are not part of the XSI interface.
+
+
+</PRE>
+<H2>SEE ALSO</H2><PRE>
+       <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>.
+
+
+
+                                                      <STRONG><A HREF="curs_memleaks.3x.html">curs_memleaks(3x)</A></STRONG>
+</PRE>
+<HR>
+<ADDRESS>
+Man(1) output converted with
+<a href="http://www.oac.uci.edu/indiv/ehood/man2html.html">man2html</a>
+</ADDRESS>
+</BODY>
+</HTML>
diff -Naur ncurses-5.7.orig/doc/html/man/curs_mouse.3x.html ncurses-5.7/doc/html/man/curs_mouse.3x.html
--- ncurses-5.7.orig/doc/html/man/curs_mouse.3x.html	2007-03-03 19:10:40.000000000 -0500
+++ ncurses-5.7/doc/html/man/curs_mouse.3x.html	2011-01-08 18:18:29.350657586 -0500
@@ -2,7 +2,7 @@
 <!-- 
   * t
   ****************************************************************************
-  * Copyright (c) 1998-2005,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 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: curs_mouse.3x,v 1.30 2006/12/30 23:43:34 tom Exp @
+  * @Id: curs_mouse.3x,v 1.37 2010/10/02 23:20:27 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -48,9 +48,9 @@
 
 </PRE>
 <H2>NAME</H2><PRE>
-       <STRONG>getmouse</STRONG>, <STRONG>ungetmouse</STRONG>, <STRONG>mousemask</STRONG>, <STRONG>wenclose</STRONG>, <STRONG>mouse_trafo</STRONG>,
-       <STRONG>wmouse_trafo</STRONG>, <STRONG>mouseinterval</STRONG> - mouse interface through
-       curses
+       <STRONG>has_mouse</STRONG>, <STRONG>getmouse</STRONG>, <STRONG>ungetmouse</STRONG>, <STRONG>mousemask</STRONG>, <STRONG>wenclose</STRONG>,
+       <STRONG>mouse_trafo</STRONG>, <STRONG>wmouse_trafo</STRONG>, <STRONG>mouseinterval</STRONG> - mouse interface
+       through curses
 
 
 </PRE>
@@ -66,6 +66,7 @@
            <STRONG>mmask_t</STRONG> <STRONG>bstate;</STRONG>   <EM>/*</EM> <EM>button</EM> <EM>state</EM> <EM>bits</EM> <EM>*/</EM>
        <STRONG>}</STRONG>
        <STRONG>MEVENT;</STRONG>
+       <STRONG>bool</STRONG> <STRONG>has_mouse(void);</STRONG>
        <STRONG>int</STRONG> <STRONG>getmouse(MEVENT</STRONG> <STRONG>*event);</STRONG>
        <STRONG>int</STRONG> <STRONG>ungetmouse(MEVENT</STRONG> <STRONG>*event);</STRONG>
        <STRONG>mmask_t</STRONG> <STRONG>mousemask(mmask_t</STRONG> <STRONG>newmask,</STRONG> <STRONG>mmask_t</STRONG> <STRONG>*oldmask);</STRONG>
@@ -97,7 +98,6 @@
 
        Here are the mouse event type masks which may be defined:
 
-
        <EM>Name</EM>                     <EM>Description</EM>
        ---------------------------------------------------------------------
        BUTTON1_PRESSED          mouse button 1 down
@@ -148,7 +148,9 @@
        as  y  and  x  in  the event structure coordinates will be
        screen-relative character-cell coordinates.  The  returned
        state  mask  will have exactly one bit set to indicate the
-       event type.
+       event type.  The corresponding data in the queue is marked
+       invalid.   A subsequent call to <STRONG>getmouse</STRONG> will retrieve the
+       next older item from the queue.
 
        The <STRONG>ungetmouse</STRONG> function behaves  analogously  to  <STRONG>ungetch</STRONG>.
        It  pushes a <STRONG>KEY_MOUSE</STRONG> event onto the input queue, and as-
@@ -195,105 +197,111 @@
        <STRONG>val(-1)</STRONG> to obtain the interval without altering  it.   The
        default is one sixth of a second.
 
-       Note  that  mouse  events will be ignored when input is in
+       The  <STRONG>has_mouse</STRONG>  function  returns TRUE if the mouse driver
+       has been successfully initialized.
+
+       Note that mouse events will be ignored when  input  is  in
        cooked mode, and will cause an error beep when cooked mode
-       is  being simulated in a window by a function such as <STRONG>get-</STRONG>
+       is being simulated in a window by a function such as  <STRONG>get-</STRONG>
        <STRONG>str</STRONG> that expects a linefeed for input-loop termination.
 
 
 </PRE>
 <H2>RETURN VALUE</H2><PRE>
-       <STRONG>getmouse</STRONG> and <STRONG>ungetmouse</STRONG> return the integer <STRONG>ERR</STRONG> upon  fail-
+       <STRONG>getmouse</STRONG>  and <STRONG>ungetmouse</STRONG> return the integer <STRONG>ERR</STRONG> upon fail-
        ure or <STRONG>OK</STRONG> upon successful completion.
 
               <STRONG>getmouse</STRONG>
                    returns an error.  If no mouse driver was ini-
-                   tialized, or if the mask parameter is zero,
+                   tialized, or if the mask parameter is zero, it
+                   also returns an error if no more events remain
+                   in the queue.
 
               <STRONG>ungetmouse</STRONG>
                    returns an error if the FIFO is full.
 
        <STRONG>mousemask</STRONG> returns the mask of reportable events.
 
-       <STRONG>mouseinterval</STRONG> returns the previous interval value,  unless
-       the  terminal  was  not initialized.  In that case, it re-
+       <STRONG>mouseinterval</STRONG>  returns the previous interval value, unless
+       the terminal was not initialized.  In that  case,  it  re-
        turns the maximum interval value (166).
 
-       <STRONG>wenclose</STRONG> and <STRONG>wmouse_trafo</STRONG> are boolean functions  returning
+       <STRONG>wenclose</STRONG>  and <STRONG>wmouse_trafo</STRONG> are boolean functions returning
        <STRONG>TRUE</STRONG> or <STRONG>FALSE</STRONG> depending on their test result.
 
 
 </PRE>
 <H2>PORTABILITY</H2><PRE>
-       These  calls  were  designed  for <STRONG><A HREF="ncurses.3x.html">ncurses(3x)</A></STRONG>, and are not
+       These calls were designed for  <STRONG><A HREF="ncurses.3x.html">ncurses(3x)</A></STRONG>,  and  are  not
        found in SVr4 curses, 4.4BSD curses, or any other previous
        version of curses.
 
        The feature macro <STRONG>NCURSES_MOUSE_VERSION</STRONG> is provided so the
-       preprocessor can be used to test  whether  these  features
-       are  present.   If  the interface is changed, the value of
-       <STRONG>NCURSES_MOUSE_VERSION</STRONG> will be incremented.   These  values
-       for  <STRONG>NCURSES_MOUSE_VERSION</STRONG> may be specified when configur-
+       preprocessor  can  be  used to test whether these features
+       are present.  If the interface is changed,  the  value  of
+       <STRONG>NCURSES_MOUSE_VERSION</STRONG>  will  be incremented.  These values
+       for <STRONG>NCURSES_MOUSE_VERSION</STRONG> may be specified when  configur-
        ing ncurses:
 
-              1  has definitions for reserved events.   The  mask
+              1  has  definitions  for reserved events.  The mask
                  uses 28 bits.
 
               2  adds definitions for button 5, removes the defi-
-                 nitions for reserved events.  The mask  uses  29
+                 nitions  for  reserved events.  The mask uses 29
                  bits.
 
-       The  order  of the <STRONG>MEVENT</STRONG> structure members is not guaran-
-       teed.  Additional fields may be added to the structure  in
+       The order of the <STRONG>MEVENT</STRONG> structure members is  not  guaran-
+       teed.   Additional fields may be added to the structure in
        the future.
 
-       Under  <STRONG><A HREF="ncurses.3x.html">ncurses(3x)</A></STRONG>,  these calls are implemented using ei-
-       ther xterm's built-in mouse-tracking API or  platform-spe-
+       Under <STRONG><A HREF="ncurses.3x.html">ncurses(3x)</A></STRONG>, these calls are implemented  using  ei-
+       ther  xterm's built-in mouse-tracking API or platform-spe-
        cific drivers including
-              Alessandro Rubini's gpm server.
+              Alessandro Rubini's gpm server
               FreeBSD sysmouse
               OS/2 EMX
-       If  you  are  using  an  unsupported  configuration, mouse
-       events will not be visible to <STRONG><A HREF="ncurses.3x.html">ncurses(3x)</A></STRONG> (and the  <STRONG>mouse-</STRONG>
+       If you  are  using  an  unsupported  configuration,  mouse
+       events  will not be visible to <STRONG><A HREF="ncurses.3x.html">ncurses(3x)</A></STRONG> (and the <STRONG>mouse-</STRONG>
        <STRONG>mask</STRONG> function will always return <STRONG>0</STRONG>).
 
-       If  the  terminfo entry contains a <STRONG>XM</STRONG> string, this is used
-       in the xterm mouse driver to control the way the  terminal
+       If the terminfo entry contains a <STRONG>XM</STRONG> string, this  is  used
+       in  the xterm mouse driver to control the way the terminal
        is initialized for mouse operation.  The default, if <STRONG>XM</STRONG> is
        not found, corresponds to private mode 1000 of xterm:
               \E[?1000%?%p1%{1}%=%th%el%;
        The z member in the event structure is not presently used.
-       It  is  intended  for use with touch screens (which may be
+       It is intended for use with touch screens  (which  may  be
        pressure-sensitive)   or   with   3D-mice/trackballs/power
        gloves.
 
 
 </PRE>
 <H2>BUGS</H2><PRE>
-       Mouse  events under xterm will not in fact be ignored dur-
-       ing cooked mode, if they have been enabled  by  <STRONG>mousemask</STRONG>.
-       Instead,  the  xterm  mouse report sequence will appear in
+       Mouse events under xterm will not in fact be ignored  dur-
+       ing  cooked  mode, if they have been enabled by <STRONG>mousemask</STRONG>.
+       Instead, the xterm mouse report sequence  will  appear  in
        the string read.
 
        Mouse events under xterm will not be detected correctly in
-       a  window  with  its keypad bit off, since they are inter-
-       preted as a variety of function key.   Your  terminfo  de-
-       scription  should  have <STRONG>kmous</STRONG> set to "\E[M" (the beginning
-       of the response from xterm for mouse clicks).  Other  val-
-       ues  for  <STRONG>kmous</STRONG>  are permitted, but under the same assump-
+       a window with its keypad bit off, since  they  are  inter-
+       preted  as  a  variety of function key.  Your terminfo de-
+       scription should have <STRONG>kmous</STRONG> set to "\E[M"  (the  beginning
+       of  the response from xterm for mouse clicks).  Other val-
+       ues for <STRONG>kmous</STRONG> are permitted, but under  the  same  assump-
        tion, i.e., it is the beginning of the response.
 
-       Because there are  no  standard  terminal  responses  that
-       would  serve to identify terminals which support the xterm
-       mouse protocol, <STRONG>ncurses</STRONG> assumes that if your  $TERM  envi-
-       ronment  variable contains "xterm", or <STRONG>kmous</STRONG> is defined in
+       Because  there  are  no  standard  terminal responses that
+       would serve to identify terminals which support the  xterm
+       mouse  protocol,  <STRONG>ncurses</STRONG> assumes that if your $TERM envi-
+       ronment variable contains "xterm", or <STRONG>kmous</STRONG> is defined  in
        the terminal description, then the terminal may send mouse
        events.
 
 
 </PRE>
 <H2>SEE ALSO</H2><PRE>
-       <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_kernel.3x.html">curs_kernel(3x)</A></STRONG>, <STRONG><A HREF="curs_slk.3x.html">curs_slk(3x)</A></STRONG>.
+       <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>,  <STRONG><A HREF="curs_kernel.3x.html">curs_kernel(3x)</A></STRONG>,   <STRONG><A HREF="curs_slk.3x.html">curs_slk(3x)</A></STRONG>,   <STRONG>curs_vari-</STRONG>
+       <STRONG><A HREF="curs_variables.3x.html">ables(3x)</A></STRONG>.
 
 
 
diff -Naur ncurses-5.7.orig/doc/html/man/curs_move.3x.html ncurses-5.7/doc/html/man/curs_move.3x.html
--- ncurses-5.7.orig/doc/html/man/curs_move.3x.html	2006-09-23 16:43:05.000000000 -0400
+++ ncurses-5.7/doc/html/man/curs_move.3x.html	2011-01-08 18:13:50.407157335 -0500
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 <!-- 
   ****************************************************************************
-  * 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,7 +27,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: curs_move.3x,v 1.12 2006/02/25 21:49:19 tom Exp @
+  * @Id: curs_move.3x,v 1.13 2010/07/31 16:10:55 tom Exp @
 -->
 <HTML>
 <HEAD>
diff -Naur ncurses-5.7.orig/doc/html/man/curs_opaque.3x.html ncurses-5.7/doc/html/man/curs_opaque.3x.html
--- ncurses-5.7.orig/doc/html/man/curs_opaque.3x.html	2008-06-21 19:11:38.000000000 -0400
+++ ncurses-5.7/doc/html/man/curs_opaque.3x.html	2011-01-08 18:13:50.407157335 -0500
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 <!-- 
   ****************************************************************************
-  * Copyright (c) 2007 Free Software Foundation, Inc.                        *
+  * Copyright (c) 2007-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            *
@@ -27,7 +27,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: curs_opaque.3x,v 1.6 2007/09/08 18:49:13 tom Exp @
+  * @Id: curs_opaque.3x,v 1.8 2010/07/31 16:10:55 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -48,8 +48,8 @@
 </PRE>
 <H2>NAME</H2><PRE>
        <STRONG>is_cleared</STRONG>, <STRONG>is_idlok</STRONG>, <STRONG>is_idcok</STRONG>, <STRONG>is_immedok</STRONG>, <STRONG>is_keypad</STRONG>,
-       <STRONG>is_leaveok</STRONG>, <STRONG>is_nodelay</STRONG>, <STRONG>is_timeout</STRONG>, <STRONG>is_scrollok</STRONG>, <STRONG>is_syncok</STRONG>
-       - <STRONG>curses</STRONG> window properties
+       <STRONG>is_leaveok</STRONG>, <STRONG>is_nodelay</STRONG>, <STRONG>is_notimeout</STRONG>, <STRONG>is_pad</STRONG>, <STRONG>is_scrollok</STRONG>,
+       <STRONG>is_subwin</STRONG>, <STRONG>is_syncok</STRONG> - <STRONG>curses</STRONG> window properties
 
 
 </PRE>
@@ -64,7 +64,9 @@
        <STRONG>bool</STRONG> <STRONG>is_leaveok(const</STRONG> <STRONG>WINDOW</STRONG> <STRONG>*win);</STRONG>
        <STRONG>bool</STRONG> <STRONG>is_nodelay(const</STRONG> <STRONG>WINDOW</STRONG> <STRONG>*win);</STRONG>
        <STRONG>bool</STRONG> <STRONG>is_notimeout(const</STRONG> <STRONG>WINDOW</STRONG> <STRONG>*win);</STRONG>
+       <STRONG>bool</STRONG> <STRONG>is_pad(const</STRONG> <STRONG>WINDOW</STRONG> <STRONG>*win);</STRONG>
        <STRONG>bool</STRONG> <STRONG>is_scrollok(const</STRONG> <STRONG>WINDOW</STRONG> <STRONG>*win);</STRONG>
+       <STRONG>bool</STRONG> <STRONG>is_subwin(const</STRONG> <STRONG>WINDOW</STRONG> <STRONG>*win);</STRONG>
        <STRONG>bool</STRONG> <STRONG>is_syncok(const</STRONG> <STRONG>WINDOW</STRONG> <STRONG>*win);</STRONG>
        <STRONG>WINDOW</STRONG> <STRONG>*</STRONG> <STRONG>wgetparent(const</STRONG> <STRONG>WINDOW</STRONG> <STRONG>*win);</STRONG>
        <STRONG>int</STRONG> <STRONG>wgetscrreg(const</STRONG> <STRONG>WINDOW</STRONG> <STRONG>*win,</STRONG> <STRONG>int</STRONG> <STRONG>*top,</STRONG> <STRONG>int</STRONG> <STRONG>*bottom);</STRONG>
@@ -100,9 +102,17 @@
        <STRONG>is_notimeout</STRONG>
             returns the value set in <STRONG>notimeout</STRONG>
 
+       <STRONG>is_pad</STRONG>
+            returns  TRUE if the window is a pad i.e., created by
+            <STRONG>newpad</STRONG>
+
        <STRONG>is_scrollok</STRONG>
             returns the value set in <STRONG>scrollok</STRONG>
 
+       <STRONG>is_subwin</STRONG>
+            returns TRUE if the window is a subwindow, i.e., cre-
+            ated by <STRONG>subwin</STRONG> or <STRONG>derwin</STRONG>
+
        <STRONG>is_syncok</STRONG>
             returns the value set in <STRONG>syncok</STRONG>
 
@@ -127,15 +137,15 @@
 
 </PRE>
 <H2>PORTABILITY</H2><PRE>
-       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  ex-
+       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 ex-
        tensions be conditioned using NCURSES_VERSION.
 
 
 </PRE>
 <H2>SEE ALSO</H2><PRE>
-       <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>,  <STRONG><A HREF="curs_inopts.3x.html">curs_inopts(3x)</A></STRONG>,  <STRONG><A HREF="curs_outopts.3x.html">curs_outopts(3x)</A></STRONG>, <STRONG>curs_win-</STRONG>
+       <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_inopts.3x.html">curs_inopts(3x)</A></STRONG>,  <STRONG><A HREF="curs_outopts.3x.html">curs_outopts(3x)</A></STRONG>,  <STRONG>curs_win-</STRONG>
        <STRONG><A HREF="curs_window.3x.html">dow(3x)</A></STRONG>
 
 
diff -Naur ncurses-5.7.orig/doc/html/man/curs_outopts.3x.html ncurses-5.7/doc/html/man/curs_outopts.3x.html
--- ncurses-5.7.orig/doc/html/man/curs_outopts.3x.html	2008-06-21 19:11:38.000000000 -0400
+++ ncurses-5.7/doc/html/man/curs_outopts.3x.html	2011-01-08 18:18:29.350657586 -0500
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 <!-- 
   ****************************************************************************
-  * 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            *
@@ -27,7 +27,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: curs_outopts.3x,v 1.21 2007/06/02 20:40:07 tom Exp @
+  * @Id: curs_outopts.3x,v 1.24 2010/10/02 23:20:43 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -115,40 +115,40 @@
        leave  it.  It is useful for applications where the cursor
        is not used, since it reduces the need for cursor motions.
 
-       The  <STRONG>setscrreg</STRONG>  and <STRONG>wsetscrreg</STRONG> routines allow the applica-
-       tion programmer to set a software scrolling  region  in  a
-       window.   <EM>top</EM>  and <EM>bot</EM> 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 <STRONG>scrollok</STRONG> are en-
-       abled, an attempt to move off the bottom margin line caus-
-       es all lines in the scrolling region to scroll one line in
-       the direction of the first line.  Only  the  text  of  the
-       window  is  scrolled.   (Note  that this has nothing to do
-       with the use of a physical scrolling region capability  in
-       the terminal, like that in the VT100.  If <STRONG>idlok</STRONG> is enabled
-       and the terminal has either  a  scrolling  region  or  in-
-       sert/delete line capability, they will probably be used by
-       the output routines.)
-
-       The <STRONG>scrollok</STRONG> option controls what happens when the  cursor
-       of  a  window  is  moved  off  the  edge  of the window or
-       scrolling region, either as a result of a  newline  action
-       on  the  bottom  line, or typing the last character of the
+       The <STRONG>setscrreg</STRONG> and <STRONG>wsetscrreg</STRONG> routines allow  the  applica-
+       tion  programmer  to  set a software scrolling region in a
+       window.  The <EM>top</EM> and <EM>bot</EM> 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  <STRONG>scrollok</STRONG> are enabled, an attempt to move off the bot-
+       tom margin line causes all lines in the  scrolling  region
+       to  scroll  one  line  in the direction of the first line.
+       Only the text of the window is scrolled.  (Note that  this
+       has nothing to do with the use of a physical scrolling re-
+       gion capability in the terminal, like that in  the  VT100.
+       If  <STRONG>idlok</STRONG>  is  enabled  and  the  terminal  has  either  a
+       scrolling region or insert/delete  line  capability,  they
+       will probably be used by the output routines.)
+
+       The  <STRONG>scrollok</STRONG> option controls what happens when the cursor
+       of a window is  moved  off  the  edge  of  the  window  or
+       scrolling  region,  either as a result of a newline action
+       on the bottom line, or typing the last  character  of  the
        last line.  If disabled, (<EM>bf</EM> is <STRONG>FALSE</STRONG>), the cursor is left
-       on  the bottom line.  If enabled, (<EM>bf</EM> is <STRONG>TRUE</STRONG>), the window
-       is scrolled up one line (Note that  to  get  the  physical
-       scrolling  effect on the terminal, it is also necessary to
+       on the bottom line.  If enabled, (<EM>bf</EM> is <STRONG>TRUE</STRONG>), the  window
+       is  scrolled  up  one  line (Note that to get the physical
+       scrolling effect on the terminal, it is also necessary  to
        call <STRONG>idlok</STRONG>).
 
-       The <STRONG>nl</STRONG> and <STRONG>nonl</STRONG> routines control  whether  the  underlying
-       display  device  translates the return key into newline on
-       input, and whether it translates newline into  return  and
-       line-feed  on output (in either case, the call <STRONG>addch('\n')</STRONG>
+       The  <STRONG>nl</STRONG>  and  <STRONG>nonl</STRONG> routines control whether the underlying
+       display device translates the return key into  newline  on
+       input,  and  whether it translates newline into return and
+       line-feed on output (in either case, the call  <STRONG>addch('\n')</STRONG>
        does the equivalent of return and line feed on the virtual
-       screen).   Initially, these translations do occur.  If you
-       disable them using <STRONG>nonl</STRONG>, <STRONG>curses</STRONG> will be able to make  bet-
-       ter  use  of the line-feed capability, resulting in faster
-       cursor motion.  Also, <STRONG>curses</STRONG> will then be able  to  detect
+       screen).  Initially, these translations do occur.  If  you
+       disable  them using <STRONG>nonl</STRONG>, <STRONG>curses</STRONG> will be able to make bet-
+       ter use of the line-feed capability, resulting  in  faster
+       cursor  motion.   Also, <STRONG>curses</STRONG> will then be able to detect
        the return key.
 
 
@@ -161,19 +161,19 @@
        X/Open does not define any error conditions.
 
        In this implementation, those functions that have a window
-       pointer will return an error  if  the  window  pointer  is
+       pointer  will  return  an  error  if the window pointer is
        null.
 
               <STRONG>wclrtoeol</STRONG>
-                   returns  an  error  if  the cursor position is
+                   returns an error if  the  cursor  position  is
                    about to wrap.
 
               <STRONG>wsetscrreg</STRONG>
-                   returns an error if the scrolling region  lim-
+                   returns  an error if the scrolling region lim-
                    its extend outside the window.
 
-       X/Open  does not define any error conditions.  This imple-
-       mentation returns an error if the window pointer is  null.
+       X/Open does not define any error conditions.  This  imple-
+       mentation returns an error if the window pointer is null.
 
 
 </PRE>
@@ -218,7 +218,8 @@
 </PRE>
 <H2>SEE ALSO</H2><PRE>
        <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>,        <STRONG><A HREF="curs_addch.3x.html">curs_addch(3x)</A></STRONG>,         <STRONG><A HREF="curs_clear.3x.html">curs_clear(3x)</A></STRONG>,
-       <STRONG><A HREF="curs_initscr.3x.html">curs_initscr(3x)</A></STRONG>, <STRONG><A HREF="curs_scroll.3x.html">curs_scroll(3x)</A></STRONG>, <STRONG><A HREF="curs_refresh.3x.html">curs_refresh(3x)</A></STRONG>
+       <STRONG><A HREF="curs_initscr.3x.html">curs_initscr(3x)</A></STRONG>,    <STRONG><A HREF="curs_scroll.3x.html">curs_scroll(3x)</A></STRONG>,    <STRONG><A HREF="curs_refresh.3x.html">curs_refresh(3x)</A></STRONG>,
+       <STRONG><A HREF="curs_variables.3x.html">curs_variables(3x)</A></STRONG>.
 
 
 
diff -Naur ncurses-5.7.orig/doc/html/man/curs_overlay.3x.html ncurses-5.7/doc/html/man/curs_overlay.3x.html
--- ncurses-5.7.orig/doc/html/man/curs_overlay.3x.html	2006-09-23 16:43:06.000000000 -0400
+++ ncurses-5.7/doc/html/man/curs_overlay.3x.html	2011-01-08 18:13:50.407157335 -0500
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 <!-- 
   ****************************************************************************
-  * 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,7 +27,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: curs_overlay.3x,v 1.14 2006/02/25 21:49:19 tom Exp @
+  * @Id: curs_overlay.3x,v 1.15 2010/07/31 16:10:55 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -69,25 +69,25 @@
        of <EM>dstwin</EM>.  <EM>scrwin</EM> and <EM>dstwin</EM> are not required to  be  the
        same  size;  only  text  where  the two windows overlap is
        copied.  The difference is that <STRONG>overlay</STRONG> is non-destructive
-       (blanks  are not copied) whereas <STRONG>overwrite</STRONG> is destructive.
+       (blanks are not copied) whereas <STRONG>overwrite</STRONG> is destructive.
 
-       The <STRONG>copywin</STRONG> routine provides a finer granularity  of  con-
+       The  <STRONG>copywin</STRONG>  routine provides a finer granularity of con-
        trol over the <STRONG>overlay</STRONG> and <STRONG>overwrite</STRONG> routines.  Like in the
        <STRONG>prefresh</STRONG> routine, a rectangle is specified in the destina-
-       tion  window,  (<EM>dminrow</EM>,  <EM>dmincol</EM>) and (<EM>dmaxrow</EM>, <EM>dmaxcol</EM>),
-       and the upper-left-corner coordinates of the  source  win-
+       tion window, (<EM>dminrow</EM>, <EM>dmincol</EM>)  and  (<EM>dmaxrow</EM>,  <EM>dmaxcol</EM>),
+       and  the  upper-left-corner coordinates of the source win-
        dow, (<EM>sminrow</EM>, <EM>smincol</EM>).  If the argument <EM>overlay</EM> is <STRONG>true</STRONG>,
        then copying is non-destructive, as in <STRONG>overlay</STRONG>.
 
 
 </PRE>
 <H2>RETURN VALUE</H2><PRE>
-       Routines that return an integer return <STRONG>ERR</STRONG>  upon  failure,
-       and  <STRONG>OK</STRONG>  (SVr4 only specifies "an integer value other than
+       Routines  that  return an integer return <STRONG>ERR</STRONG> upon failure,
+       and <STRONG>OK</STRONG> (SVr4 only specifies "an integer value  other  than
        <STRONG>ERR</STRONG>") upon successful completion.
 
-       X/Open defines no error conditions.  In  this  implementa-
-       tion,  <STRONG>copywin</STRONG>,  <STRONG>overlay</STRONG>  and <STRONG>overwrite</STRONG> return an error if
+       X/Open  defines  no error conditions.  In this implementa-
+       tion, <STRONG>copywin</STRONG>, <STRONG>overlay</STRONG> and <STRONG>overwrite</STRONG> return  an  error  if
        either of the window pointers are null, or if some part of
        the window would be placed off-screen.
 
diff -Naur ncurses-5.7.orig/doc/html/man/curs_pad.3x.html ncurses-5.7/doc/html/man/curs_pad.3x.html
--- ncurses-5.7.orig/doc/html/man/curs_pad.3x.html	2005-05-15 13:05:54.000000000 -0400
+++ ncurses-5.7/doc/html/man/curs_pad.3x.html	2011-01-08 18:13:50.407157335 -0500
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 <!-- 
   ****************************************************************************
-  * Copyright (c) 1998-2004,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            *
@@ -27,7 +27,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: curs_pad.3x,v 1.14 2005/05/15 16:18:43 tom Exp @
+  * @Id: curs_pad.3x,v 1.16 2010/07/31 14:43:29 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -97,16 +97,16 @@
        <STRONG>wrefresh</STRONG> and <STRONG>wnoutrefresh</STRONG> 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.
-       <EM>pminrow</EM>  and <EM>pmincol</EM> specify the upper left-hand corner of
-       the rectangle to be displayed in the pad.  <EM>sminrow</EM>,  <EM>smin-</EM>
-       <EM>col</EM>, <EM>smaxrow</EM>, and <EM>smaxcol</EM> specify the edges of the rectan-
-       gle to be displayed on the screen.  The  lower  right-hand
-       corner of the rectangle to be displayed in the pad is cal-
-       culated from the screen coordinates, since the  rectangles
-       must  be  the same size.  Both rectangles must be entirely
-       contained within their  respective  structures.   Negative
-       values of <EM>pminrow</EM>, <EM>pmincol</EM>, <EM>sminrow</EM>, or <EM>smincol</EM> are treat-
-       ed as if they were zero.
+       The <EM>pminrow</EM> and <EM>pmincol</EM> parameters specify the upper left-
+       hand corner of the rectangle to be displayed in  the  pad.
+       The  <EM>sminrow</EM>,  <EM>smincol</EM>,  <EM>smaxrow</EM>,  and  <EM>smaxcol</EM> 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  co-
+       ordinates,  since  the  rectangles  must be the same size.
+       Both rectangles must be entirely  contained  within  their
+       respective  structures.  Negative values of <EM>pminrow</EM>, <EM>pmin-</EM>
+       <EM>col</EM>, <EM>sminrow</EM>, or <EM>smincol</EM> are treated as if they were zero.
 
        The <STRONG>pechochar</STRONG> routine is functionally equivalent to a call
        to  <STRONG>addch</STRONG>  followed by a call to <STRONG>refresh</STRONG>, a call to <STRONG>waddch</STRONG>
diff -Naur ncurses-5.7.orig/doc/html/man/curs_print.3x.html ncurses-5.7/doc/html/man/curs_print.3x.html
--- ncurses-5.7.orig/doc/html/man/curs_print.3x.html	2006-09-23 16:43:06.000000000 -0400
+++ ncurses-5.7/doc/html/man/curs_print.3x.html	2011-01-08 18:13:50.407157335 -0500
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 <!-- 
   ****************************************************************************
-  * 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,7 +27,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: curs_print.3x,v 1.8 2006/02/25 21:49:19 tom Exp @
+  * @Id: curs_print.3x,v 1.9 2010/07/31 16:10:55 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -70,21 +70,21 @@
        (typically  about  half  of its nominal cps rating).  Dot-
        matrix printers and 6-page-per-minute lasers can typically
        handle  80cps,  so a good conservative rule of thumb is to
-       sleep for a second after shipping each 80-character  line.
+       sleep for a second after shipping each 80-character line.
 
 
 </PRE>
 <H2>RETURN VALUE</H2><PRE>
-       The  <STRONG>mcprint</STRONG>  function  returns <STRONG>ERR</STRONG> if the write operation
+       The <STRONG>mcprint</STRONG> function returns <STRONG>ERR</STRONG> if  the  write  operation
        aborted for some reason.  In this case, errno will contain
-       either  an  error  associated  with <STRONG>write(2)</STRONG> or one of the
+       either an error associated with <STRONG>write(2)</STRONG>  or  one  of  the
        following:
 
        ENODEV
             Capabilities for printer redirection do not exist.
 
        ENOMEM
-            Couldn't allocate sufficient  memory  to  buffer  the
+            Couldn't  allocate  sufficient  memory  to buffer the
             printer write.
 
        When <STRONG>mcprint</STRONG> succeeds, it returns the number of characters
@@ -93,14 +93,14 @@
 
 </PRE>
 <H2>PORTABILITY</H2><PRE>
-       The <STRONG>mcprint</STRONG> call was designed for <STRONG><A HREF="ncurses.3x.html">ncurses(3x)</A></STRONG>, and is  not
+       The  <STRONG>mcprint</STRONG> call was designed for <STRONG><A HREF="ncurses.3x.html">ncurses(3x)</A></STRONG>, and is not
        found in SVr4 curses, 4.4BSD curses, or any other previous
        version of curses.
 
 
 </PRE>
 <H2>BUGS</H2><PRE>
-       Padding in the <STRONG>mc5p</STRONG>, <STRONG>mc4</STRONG> and <STRONG>mc5</STRONG> capabilities will not  be
+       Padding  in the <STRONG>mc5p</STRONG>, <STRONG>mc4</STRONG> and <STRONG>mc5</STRONG> capabilities will not be
        interpreted.
 
 
diff -Naur ncurses-5.7.orig/doc/html/man/curs_printw.3x.html ncurses-5.7/doc/html/man/curs_printw.3x.html
--- ncurses-5.7.orig/doc/html/man/curs_printw.3x.html	2006-12-24 12:02:39.000000000 -0500
+++ ncurses-5.7/doc/html/man/curs_printw.3x.html	2011-01-08 18:18:29.242657591 -0500
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 <!-- 
   ****************************************************************************
-  * 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,7 +27,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: curs_printw.3x,v 1.17 2006/12/24 16:05:17 tom Exp @
+  * @Id: curs_printw.3x,v 1.19 2010/08/14 23:29:16 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -91,6 +91,10 @@
        enough memory for the buffer used to format  the  results.
        It will return an error if the window pointer is null.
 
+       Functions  with a "mv" prefix first perform a cursor move-
+       ment using <STRONG>wmove</STRONG>, and return an error if the  position  is
+       outside the window, or if the window pointer is null.
+
 
 </PRE>
 <H2>PORTABILITY</H2><PRE>
diff -Naur ncurses-5.7.orig/doc/html/man/curs_refresh.3x.html ncurses-5.7/doc/html/man/curs_refresh.3x.html
--- ncurses-5.7.orig/doc/html/man/curs_refresh.3x.html	2005-05-15 13:05:54.000000000 -0400
+++ ncurses-5.7/doc/html/man/curs_refresh.3x.html	2011-01-08 18:18:29.350657586 -0500
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 <!-- 
   ****************************************************************************
-  * 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            *
@@ -27,7 +27,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: curs_refresh.3x,v 1.12 2005/05/15 16:18:49 tom Exp @
+  * @Id: curs_refresh.3x,v 1.14 2010/10/02 23:20:50 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -155,7 +155,7 @@
 
 </PRE>
 <H2>SEE ALSO</H2><PRE>
-       <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_outopts.3x.html">curs_outopts(3x)</A></STRONG>
+       <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_outopts.3x.html">curs_outopts(3x)</A></STRONG> <STRONG><A HREF="curs_variables.3x.html">curs_variables(3x)</A></STRONG>.
 
 
 
diff -Naur ncurses-5.7.orig/doc/html/man/curs_scanw.3x.html ncurses-5.7/doc/html/man/curs_scanw.3x.html
--- ncurses-5.7.orig/doc/html/man/curs_scanw.3x.html	2006-12-24 12:02:39.000000000 -0500
+++ ncurses-5.7/doc/html/man/curs_scanw.3x.html	2011-01-08 18:18:29.242657591 -0500
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 <!-- 
   ****************************************************************************
-  * 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            *
@@ -27,7 +27,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: curs_scanw.3x,v 1.14 2006/12/24 16:05:49 tom Exp @
+  * @Id: curs_scanw.3x,v 1.16 2010/08/14 23:29:16 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -86,6 +86,10 @@
        <STRONG>wscanw</STRONG>,  <STRONG>mvscanw</STRONG>  and  <STRONG>mvwscanw</STRONG>  routines to determine the
        number of fields which were mapped in the call.
 
+       Functions with a "mv" prefix first perform a cursor  move-
+       ment  using  <STRONG>wmove</STRONG>, and return an error if the position is
+       outside the window, or if the window pointer is null.
+
 
 </PRE>
 <H2>PORTABILITY</H2><PRE>
diff -Naur ncurses-5.7.orig/doc/html/man/curs_scr_dump.3x.html ncurses-5.7/doc/html/man/curs_scr_dump.3x.html
--- ncurses-5.7.orig/doc/html/man/curs_scr_dump.3x.html	2006-12-24 12:02:39.000000000 -0500
+++ ncurses-5.7/doc/html/man/curs_scr_dump.3x.html	2011-01-08 18:13:50.407157335 -0500
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 <!-- 
   ****************************************************************************
-  * 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,7 +27,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: curs_scr_dump.3x,v 1.7 2006/12/24 16:05:49 tom Exp @
+  * @Id: curs_scr_dump.3x,v 1.8 2010/07/31 16:10:55 tom Exp @
 -->
 <HTML>
 <HEAD>
diff -Naur ncurses-5.7.orig/doc/html/man/curs_scroll.3x.html ncurses-5.7/doc/html/man/curs_scroll.3x.html
--- ncurses-5.7.orig/doc/html/man/curs_scroll.3x.html	2006-09-23 16:43:07.000000000 -0400
+++ ncurses-5.7/doc/html/man/curs_scroll.3x.html	2011-01-08 18:13:50.407157335 -0500
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 <!-- 
   ****************************************************************************
-  * 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,7 +27,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: curs_scroll.3x,v 1.13 2006/02/25 21:49:19 tom Exp @
+  * @Id: curs_scroll.3x,v 1.14 2010/07/31 16:10:55 tom Exp @
 -->
 <HTML>
 <HEAD>
diff -Naur ncurses-5.7.orig/doc/html/man/curs_slk.3x.html ncurses-5.7/doc/html/man/curs_slk.3x.html
--- ncurses-5.7.orig/doc/html/man/curs_slk.3x.html	2008-06-21 19:11:40.000000000 -0400
+++ ncurses-5.7/doc/html/man/curs_slk.3x.html	2011-01-08 18:18:29.350657586 -0500
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 <!-- 
   ****************************************************************************
-  * 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,7 +27,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: curs_slk.3x,v 1.16 2007/06/02 20:40:07 tom Exp @
+  * @Id: curs_slk.3x,v 1.21 2010/10/02 23:21:04 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -47,7 +47,7 @@
 
 </PRE>
 <H2>NAME</H2><PRE>
-       <STRONG>slk_init</STRONG>, <STRONG>slk_set</STRONG>, <STRONG>slk_refresh</STRONG>, <STRONG>slk_noutrefresh</STRONG>,
+       <STRONG>slk_init</STRONG>, <STRONG>slk_set</STRONG>, <STRONG>slk_wset</STRONG>, <STRONG>slk_refresh</STRONG>, <STRONG>slk_noutrefresh</STRONG>,
        <STRONG>slk_label</STRONG>, <STRONG>slk_clear</STRONG>, <STRONG>slk_restore</STRONG>, <STRONG>slk_touch</STRONG>, <STRONG>slk_attron</STRONG>,
        <STRONG>slk_attrset</STRONG>, <STRONG>slk_attroff</STRONG>, <STRONG>slk_attr_on</STRONG>, <STRONG>slk_attr_set</STRONG>,
        <STRONG>slk_attr_off</STRONG>, <STRONG>slk_attr</STRONG>, <STRONG>slk_color</STRONG> - <STRONG>curses</STRONG> soft label
@@ -71,69 +71,85 @@
        <STRONG>int</STRONG> <STRONG>slk_attrset(const</STRONG> <STRONG>chtype</STRONG> <STRONG>attrs);</STRONG>
        <STRONG>int</STRONG> <STRONG>slk_attr_on(attr_t</STRONG> <STRONG>attrs,</STRONG> <STRONG>void*</STRONG> <STRONG>opts);</STRONG>
        <STRONG>int</STRONG> <STRONG>slk_attr_off(const</STRONG> <STRONG>attr_t</STRONG> <STRONG>attrs,</STRONG> <STRONG>void</STRONG> <STRONG>*</STRONG> <STRONG>opts);</STRONG>
-       <STRONG>int</STRONG> <STRONG>slk_attr_set(const</STRONG> <STRONG>attr_t</STRONG> <STRONG>attrs,</STRONG>
-            <STRONG>short</STRONG> <STRONG>color_pair_number,</STRONG> <STRONG>void*</STRONG> <STRONG>opts);</STRONG>
+       <STRONG>int</STRONG>  <STRONG>slk_attr_set(const</STRONG>  <STRONG>attr_t</STRONG>  <STRONG>attrs,</STRONG>  <STRONG>short</STRONG> <STRONG>color_pair,</STRONG>
+       <STRONG>void*</STRONG> <STRONG>opts);</STRONG>
        <STRONG>attr_t</STRONG> <STRONG>slk_attr(void);</STRONG>
-       <STRONG>int</STRONG> <STRONG>slk_color(short</STRONG> <STRONG>color_pair_number);</STRONG>
+       <STRONG>int</STRONG> <STRONG>slk_color(short</STRONG> <STRONG>color_pair);</STRONG>
+       <STRONG>int</STRONG> <STRONG>slk_wset(int</STRONG> <STRONG>labnum,</STRONG> <STRONG>const</STRONG> <STRONG>wchar_t</STRONG> <STRONG>*label,</STRONG> <STRONG>int</STRONG> <STRONG>fmt);</STRONG>
 
 
 </PRE>
 <H2>DESCRIPTION</H2><PRE>
        The slk* functions manipulate the set of soft function-key
-       labels that exist on many terminals.  For those  terminals
+       labels  that exist on many terminals.  For those terminals
        that do not have soft labels, <STRONG>curses</STRONG> takes over the bottom
-       line of <STRONG>stdscr</STRONG>, reducing the size of <STRONG>stdscr</STRONG> and the  vari-
-       able  <STRONG>LINES</STRONG>.  <STRONG>curses</STRONG> standardizes on eight labels of up to
-       eight characters each. In addition to  this,  the  ncurses
-       implementation  supports  a mode where it simulates 12 la-
-       bels 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 mode.
+       line  of <STRONG>stdscr</STRONG>, reducing the size of <STRONG>stdscr</STRONG> and the vari-
+       able <STRONG>LINES</STRONG>.  <STRONG>curses</STRONG> standardizes on eight labels of up  to
+       eight  characters  each.  In addition to this, the ncurses
+       implementation supports a mode where it simulates  12  la-
+       bels  of  up  to five 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.
 
-       The <STRONG>slk_init</STRONG> routine must  be  called  before  <STRONG>initscr</STRONG>  or
+       The  <STRONG>slk_init</STRONG>  routine  must  be  called before <STRONG>initscr</STRONG> or
        <STRONG>newterm</STRONG> is called.  If <STRONG>initscr</STRONG> eventually uses a line from
        <STRONG>stdscr</STRONG> to emulate the soft labels, then <EM>fmt</EM> determines how
-       the  labels  are arranged on the screen.  Setting <EM>fmt</EM> to <STRONG>0</STRONG>
-       indicates a 3-2-3 arrangement of the labels, <STRONG>1</STRONG> indicates a
-       4-4 arrangement and <STRONG>2</STRONG> indicates the PC like 4-4-4 mode. If
-       <STRONG>fmt</STRONG> is set to <STRONG>3</STRONG>, it is again the PC like 4-4-4  mode,  but
-       in  addition  an index line is generated, helping the user
-       to identify the key numbers easily.
-
-       The <STRONG>slk_set</STRONG> routine requires <EM>labnum</EM> to be a label  number,
-       from <STRONG>1</STRONG> to <STRONG>8</STRONG> (resp. <STRONG>12</STRONG>); <EM>label</EM> 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. <EM>fmt</EM> is either <STRONG>0</STRONG>, <STRONG>1</STRONG>, or <STRONG>2</STRONG>,  indicating  whether  the
-       label  is  to be left-justified, centered, or right-justi-
-       fied, respectively, within the label.
+       the labels are arranged on the screen:
+
+              <STRONG>0</STRONG>  indicates a 3-2-3 arrangement of the labels.
+
+              <STRONG>1</STRONG>  indicates a 4-4 arrangement
+
+              <STRONG>2</STRONG>  indicates the PC-like 4-4-4 mode.
+
+              <STRONG>3</STRONG>  is again the PC-like 4-4-4 mode, but in addition
+                 an  index line is generated, helping the user to
+                 identify the key numbers easily.
+
+       The <STRONG>slk_set</STRONG> routine (and  the  <STRONG>slk_wset</STRONG>  routine  for  the
+       wide-character library) has three parameters:
+
+              <EM>labnum</EM>
+                   is  the  label number, from <STRONG>1</STRONG> to <STRONG>8</STRONG> (12 for <EM>fmt</EM>
+                   in <STRONG>slk_init</STRONG> is <STRONG>2</STRONG> or <STRONG>3</STRONG>);
+
+              <EM>label</EM>
+                   is be the string to put on the  label,  up  to
+                   eight  (five  for  <EM>fmt</EM>  in <STRONG>slk_init</STRONG> is <STRONG>2</STRONG> or <STRONG>3</STRONG>)
+                   characters in length.  A null string or a null
+                   pointer sets up a blank label.
+
+              <EM>fmt</EM>  is  either  <STRONG>0</STRONG>, <STRONG>1</STRONG>, or <STRONG>2</STRONG>, indicating whether the
+                   label is to be  left-justified,  centered,  or
+                   right-justified,  respectively, within the la-
+                   bel.
 
        The <STRONG>slk_refresh</STRONG> and <STRONG>slk_noutrefresh</STRONG> routines correspond to
        the <STRONG>wrefresh</STRONG> and <STRONG>wnoutrefresh</STRONG> routines.
 
        The  <STRONG>slk_label</STRONG> routine returns the current label for label
-       number <EM>labnum</EM>, with leading and trailing blanks  stripped.
+       number <EM>labnum</EM>, with leading and trailing blanks stripped.
 
-       The  <STRONG>slk_clear</STRONG>  routine  clears  the  soft labels from the
+       The <STRONG>slk_clear</STRONG> routine clears  the  soft  labels  from  the
        screen.
 
-       The <STRONG>slk_restore</STRONG> routine restores the soft  labels  to  the
+       The  <STRONG>slk_restore</STRONG>  routine  restores the soft labels to the
        screen after a <STRONG>slk_clear</STRONG> has been performed.
 
-       The  <STRONG>slk_touch</STRONG>  routine  forces  all the soft labels to be
+       The <STRONG>slk_touch</STRONG> routine forces all the  soft  labels  to  be
        output the next time a <STRONG>slk_noutrefresh</STRONG> is performed.
 
        The <STRONG>slk_attron</STRONG>, <STRONG>slk_attrset</STRONG>, <STRONG>slk_attroff</STRONG> and <STRONG>slk_attr</STRONG> rou-
        tines correspond to <STRONG>attron</STRONG>, <STRONG>attrset</STRONG>, <STRONG>attroff</STRONG> and <STRONG>attr_get</STRONG>.
-       They have an effect only if soft labels are  simulated  on
-       the  bottom line of the screen.  The default highlight for
+       They  have  an effect only if soft labels are simulated on
+       the bottom line of the screen.  The default highlight  for
        soft keys is A_STANDOUT (as in System V curses, which does
        not document this fact).
 
-       The  <STRONG>slk_color</STRONG> routine corresponds to <STRONG>color_set</STRONG>. It has an
-       effect only if soft labels are  simulated  on  the  bottom
+       The <STRONG>slk_color</STRONG> routine corresponds to <STRONG>color_set</STRONG>.  It has an
+       effect  only  if  soft  labels are simulated on the bottom
        line of the screen.
 
 
@@ -143,44 +159,44 @@
        fies only "an integer value other than <STRONG>ERR</STRONG>") upon success-
        ful completion.
 
-       X/Open  defines  no error conditions.  In this implementa-
+       X/Open defines no error conditions.  In  this  implementa-
        tion
 
               <STRONG>slk_attr</STRONG>
-                   returns the attribute used for the soft  keys.
+                   returns the attribute used for the soft keys.
 
               <STRONG>slk_attroff</STRONG>, <STRONG>slk_attron</STRONG>, <STRONG>slk_clear</STRONG>,
               <STRONG>slk_noutrefresh</STRONG>, <STRONG>slk_refresh</STRONG>, <STRONG>slk_touch</STRONG>
-                   return  an  error if the terminal or the soft-
+                   return an error if the terminal or  the  soft-
                    keys were not initialized.
 
               <STRONG>slk_attrset</STRONG>
-                   returns an error if the terminal or the  soft-
+                   returns  an error if the terminal or the soft-
                    keys were not initialized.
 
               <STRONG>slk_attr_set</STRONG>
-                   returns  an error if the terminal or the soft-
-                   keys were not initialized, or the  color  pair
+                   returns an error if the terminal or the  soft-
+                   keys  were  not initialized, or the color pair
                    is outside the range 0..COLOR_PAIRS-1, or opts
                    is not null.
 
               <STRONG>slk_color</STRONG>
-                   returns an error if the terminal or the  soft-
-                   keys  were  not initialized, or the color pair
+                   returns  an error if the terminal or the soft-
+                   keys were not initialized, or the  color  pair
                    is outside the range 0..COLOR_PAIRS-1.
 
               <STRONG>slk_init</STRONG>
-                   returns an error if the  format  parameter  is
+                   returns  an  error  if the format parameter is
                    outside the range 0..3.
 
               <STRONG>slk_label</STRONG>
                    returns <STRONG>NULL</STRONG> on error.
 
               <STRONG>slk_set</STRONG>
-                   returns  an error if the terminal or the soft-
-                   keys were not initialized, or the  <EM>labnum</EM>  pa-
-                   rameter  is outside the range of label counts,
-                   or if the  format  parameter  is  outside  the
+                   returns an error if the terminal or the  soft-
+                   keys  were  not initialized, or the <EM>labnum</EM> pa-
+                   rameter is outside the range of label  counts,
+                   or  if  the  format  parameter  is outside the
                    range 0..2, or if memory for the labels cannot
                    be allocated.
 
@@ -193,18 +209,18 @@
 
 </PRE>
 <H2>PORTABILITY</H2><PRE>
-       The  XSI  Curses  standard, Issue 4, describes these func-
-       tions.  It changes the argument type of the  attribute-ma-
-       nipulation  functions <STRONG>slk_attron</STRONG>, <STRONG>slk_attroff</STRONG>, <STRONG>slk_attrset</STRONG>
-       to be <STRONG>attr_t</STRONG>, and adds <STRONG>const</STRONG> qualifiers. The format  codes
-       <STRONG>2</STRONG>  and <STRONG>3</STRONG> for <STRONG>slk_init()</STRONG> and the function <STRONG>slk_attr</STRONG> are spe-
+       The XSI Curses standard, Issue 4,  describes  these  func-
+       tions.   It changes the argument type of the attribute-ma-
+       nipulation functions <STRONG>slk_attron</STRONG>, <STRONG>slk_attroff</STRONG>,  <STRONG>slk_attrset</STRONG>
+       to be <STRONG>attr_t</STRONG>, and adds <STRONG>const</STRONG> qualifiers.  The format codes
+       <STRONG>2</STRONG> and <STRONG>3</STRONG> for <STRONG>slk_init()</STRONG> and the function <STRONG>slk_attr</STRONG> are  spe-
        cific to ncurses.
 
 
 </PRE>
 <H2>SEE ALSO</H2><PRE>
-       <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>,  <STRONG><A HREF="curs_attr.3x.html">curs_attr(3x)</A></STRONG>,   <STRONG><A HREF="curs_initscr.3x.html">curs_initscr(3x)</A></STRONG>,   <STRONG>curs_re-</STRONG>
-       <STRONG><A HREF="curs_refresh.3x.html">fresh(3x)</A></STRONG>
+       <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>,   <STRONG><A HREF="curs_attr.3x.html">curs_attr(3x)</A></STRONG>,   <STRONG><A HREF="curs_initscr.3x.html">curs_initscr(3x)</A></STRONG>,  <STRONG>curs_re-</STRONG>
+       <STRONG><A HREF="curs_refresh.3x.html">fresh(3x)</A></STRONG>, <STRONG><A HREF="curs_variables.3x.html">curs_variables(3x)</A></STRONG>.
 
 
 
diff -Naur ncurses-5.7.orig/doc/html/man/curs_sp_funcs.3x.html ncurses-5.7/doc/html/man/curs_sp_funcs.3x.html
--- ncurses-5.7.orig/doc/html/man/curs_sp_funcs.3x.html	1969-12-31 19:00:00.000000000 -0500
+++ ncurses-5.7/doc/html/man/curs_sp_funcs.3x.html	2011-01-08 18:18:29.242657591 -0500
@@ -0,0 +1,283 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
+<!-- 
+  ****************************************************************************
+  * 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: curs_sp_funcs.3x,v 1.4 2010/09/18 20:07:36 tom Exp @
+  * ***************************************************************************
+  * ***************************************************************************
+  * ***************************************************************************
+-->
+<HTML>
+<HEAD>
+<TITLE>curs_sp_funcs 3x</TITLE>
+<link rev=made href="mailto:bug-ncurses@gnu.org">
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+</HEAD>
+<BODY>
+<H1>curs_sp_funcs 3x</H1>
+<HR>
+<PRE>
+<!-- Manpage converted by man2html 3.0.1 -->
+<STRONG><A HREF="curs_sp_funcs.3x.html">curs_sp_funcs(3x)</A></STRONG>                                     <STRONG><A HREF="curs_sp_funcs.3x.html">curs_sp_funcs(3x)</A></STRONG>
+
+
+
+
+</PRE>
+<H2>NAME</H2><PRE>
+       new_prescr - <STRONG>curses</STRONG> screen-pointer extension
+
+
+</PRE>
+<H2>SYNOPSIS</H2><PRE>
+       <STRONG>#include</STRONG> <STRONG>&lt;curses.h&gt;</STRONG>
+
+       <STRONG>int</STRONG> <STRONG>assume_default_colors_sp(SCREEN*,</STRONG> <STRONG>int,</STRONG> <STRONG>int);</STRONG>
+       <STRONG>int</STRONG> <STRONG>baudrate_sp(SCREEN*);</STRONG>
+       <STRONG>int</STRONG> <STRONG>beep_sp(SCREEN*);</STRONG>
+       <STRONG>bool</STRONG> <STRONG>can_change_color_sp(SCREEN*);</STRONG>
+       <STRONG>int</STRONG> <STRONG>cbreak_sp(SCREEN*);</STRONG>
+       <STRONG>int</STRONG> <STRONG>color_content_sp(SCREEN*,</STRONG> <STRONG>short,</STRONG> <STRONG>short*,</STRONG> <STRONG>short*,</STRONG> <STRONG>short*);</STRONG>
+       <STRONG>int</STRONG> <STRONG>curs_set_sp(SCREEN*,</STRONG> <STRONG>int);</STRONG>
+       <STRONG>int</STRONG> <STRONG>define_key_sp(SCREEN*,</STRONG> <STRONG>const</STRONG> <STRONG>char</STRONG> <STRONG>*,</STRONG> <STRONG>int);</STRONG>
+       <STRONG>int</STRONG> <STRONG>def_prog_mode_sp(SCREEN*);</STRONG>
+       <STRONG>int</STRONG> <STRONG>def_shell_mode_sp(SCREEN*);</STRONG>
+       <STRONG>int</STRONG> <STRONG>delay_output_sp(SCREEN*,</STRONG> <STRONG>int);</STRONG>
+       <STRONG>int</STRONG> <STRONG>doupdate_sp(SCREEN*);</STRONG>
+       <STRONG>int</STRONG> <STRONG>echo_sp(SCREEN*);</STRONG>
+       <STRONG>int</STRONG> <STRONG>endwin_sp(SCREEN*);</STRONG>
+       <STRONG>int</STRONG> <STRONG>erasechar_sp(SCREEN*);</STRONG>
+       <STRONG>int</STRONG> <STRONG>filter_sp(SCREEN*);</STRONG>
+       <STRONG>int</STRONG> <STRONG>flash_sp(SCREEN*);</STRONG>
+       <STRONG>int</STRONG> <STRONG>flushinp_sp(SCREEN*);</STRONG>
+       <STRONG>int</STRONG> <STRONG>get_escdelay_sp(SCREEN*);</STRONG>
+       <STRONG>int</STRONG> <STRONG>getmouse_sp(SCREEN*,</STRONG> <STRONG>MEVENT*);</STRONG>
+       <STRONG>WINDOW*</STRONG> <STRONG>getwin_sp(SCREEN*,</STRONG> <STRONG>FILE*);</STRONG>
+       <STRONG>int</STRONG> <STRONG>halfdelay_sp(SCREEN*);</STRONG>
+       <STRONG>bool</STRONG> <STRONG>has_colors_sp(SCREEN*);</STRONG>
+       <STRONG>bool</STRONG> <STRONG>has_ic_sp(SCREEN*);</STRONG>
+       <STRONG>bool</STRONG> <STRONG>has_il_sp(SCREEN*);</STRONG>
+       <STRONG>int</STRONG> <STRONG>has_key_sp(SCREEN*,</STRONG> <STRONG>int);</STRONG>
+       <STRONG>bool</STRONG> <STRONG>has_mouse_sp(SCREEN*);</STRONG>
+       <STRONG>int</STRONG> <STRONG>init_color_sp(SCREEN*,</STRONG> <STRONG>short,</STRONG> <STRONG>short,</STRONG> <STRONG>short,</STRONG> <STRONG>short);</STRONG>
+       <STRONG>int</STRONG> <STRONG>init_pair_sp(SCREEN*,</STRONG> <STRONG>short,</STRONG> <STRONG>short,</STRONG> <STRONG>short);</STRONG>
+       <STRONG>int</STRONG> <STRONG>intrflush_sp(SCREEN*,</STRONG> <STRONG>WINDOW*,</STRONG> <STRONG>bool);</STRONG>
+       <STRONG>bool</STRONG> <STRONG>isendwin_sp(SCREEN*);</STRONG>
+       <STRONG>bool</STRONG> <STRONG>is_term_resized_sp(SCREEN*,</STRONG> <STRONG>int,</STRONG> <STRONG>int);</STRONG>
+       <STRONG>char*</STRONG> <STRONG>keybound_sp(SCREEN*,</STRONG> <STRONG>int,</STRONG> <STRONG>int);</STRONG>
+       <STRONG>int</STRONG> <STRONG>key_defined_sp(SCREEN*,</STRONG> <STRONG>const</STRONG> <STRONG>char</STRONG> <STRONG>*);</STRONG>
+       <STRONG>NCURSES_CONST</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG> <STRONG>keyname_sp(SCREEN*,</STRONG> <STRONG>int);</STRONG>
+       <STRONG>int</STRONG> <STRONG>keyok_sp(SCREEN*,</STRONG> <STRONG>int,</STRONG> <STRONG>bool);</STRONG>
+       <STRONG>char</STRONG> <STRONG>killchar_sp(SCREEN*);</STRONG>
+       <STRONG>int</STRONG> <STRONG>mcprint_sp(SCREEN*,</STRONG> <STRONG>char</STRONG> <STRONG>*,</STRONG> <STRONG>int);</STRONG>
+       <STRONG>int</STRONG> <STRONG>mouseinterval_sp(SCREEN*,</STRONG> <STRONG>int);</STRONG>
+       <STRONG>mmask_t</STRONG> <STRONG>mousemask_sp(SCREEN*,</STRONG> <STRONG>mmask_t,</STRONG> <STRONG>mmask_t</STRONG> <STRONG>*);</STRONG>
+       <STRONG>int</STRONG> <STRONG>mvcur_sp(SCREEN*,</STRONG> <STRONG>int,</STRONG> <STRONG>int,</STRONG> <STRONG>int,</STRONG> <STRONG>int);</STRONG>
+       <STRONG>int</STRONG> <STRONG>napms_sp(SCREEN*,</STRONG> <STRONG>int);</STRONG>
+       <STRONG>WINDOW*</STRONG> <STRONG>newpad_sp(SCREEN*,</STRONG> <STRONG>int,</STRONG> <STRONG>int);</STRONG>
+       <STRONG>SCREEN*</STRONG> <STRONG>new_prescr(void);</STRONG>
+       <STRONG>SCREEN*</STRONG> <STRONG>newterm_sp(SCREEN*,</STRONG> <STRONG>NCURSES_CONST</STRONG> <STRONG>char</STRONG> <STRONG>*,</STRONG> <STRONG>FILE</STRONG> <STRONG>*,</STRONG> <STRONG>FILE</STRONG> <STRONG>*);</STRONG>
+       <STRONG>WINDOW*</STRONG> <STRONG>newwin_sp(SCREEN*,</STRONG> <STRONG>int,</STRONG> <STRONG>int,</STRONG> <STRONG>int,</STRONG> <STRONG>int);</STRONG>
+       <STRONG>int</STRONG> <STRONG>nl_sp(SCREEN*);</STRONG>
+       <STRONG>int</STRONG> <STRONG>nocbreak_sp(SCREEN*);</STRONG>
+       <STRONG>int</STRONG> <STRONG>noecho_sp(SCREEN*);</STRONG>
+       <STRONG>int</STRONG> <STRONG>nofilter_sp(SCREEN*);</STRONG>
+       <STRONG>int</STRONG> <STRONG>nonl_sp(SCREEN*);</STRONG>
+       <STRONG>void</STRONG> <STRONG>noqiflush_sp(SCREEN*);</STRONG>
+       <STRONG>int</STRONG> <STRONG>noraw_sp(SCREEN*);</STRONG>
+       <STRONG>int</STRONG> <STRONG>pair_content_sp(SCREEN*,</STRONG> <STRONG>short,</STRONG> <STRONG>short*,</STRONG> <STRONG>short*);</STRONG>
+       <STRONG>void</STRONG> <STRONG>qiflush_sp(SCREEN*);</STRONG>
+       <STRONG>int</STRONG> <STRONG>raw_sp(SCREEN*);</STRONG>
+       <STRONG>int</STRONG> <STRONG>reset_prog_mode_sp(SCREEN*);</STRONG>
+       <STRONG>int</STRONG> <STRONG>reset_shell_mode_sp(SCREEN*);</STRONG>
+       <STRONG>int</STRONG> <STRONG>resetty_sp(SCREEN*);</STRONG>
+       <STRONG>int</STRONG> <STRONG>resize_term_sp(SCREEN*,</STRONG> <STRONG>int,</STRONG> <STRONG>int);</STRONG>
+       <STRONG>int</STRONG> <STRONG>resizeterm_sp(SCREEN*,</STRONG> <STRONG>int,</STRONG> <STRONG>int);</STRONG>
+       <STRONG>int</STRONG> <STRONG>restartterm_sp(SCREEN*,</STRONG> <STRONG>NCURSES_CONST</STRONG> <STRONG>char*,</STRONG> <STRONG>int,</STRONG> <STRONG>int</STRONG> <STRONG>*);</STRONG>
+       <STRONG>int</STRONG> <STRONG>ripoffline_sp(SCREEN*,</STRONG> <STRONG>int,</STRONG> <STRONG>int</STRONG> <STRONG>(*)(WINDOW*,</STRONG> <STRONG>int));</STRONG>
+       <STRONG>int</STRONG> <STRONG>savetty_sp(SCREEN*);</STRONG>
+       <STRONG>int</STRONG> <STRONG>scr_init_sp(SCREEN*,</STRONG> <STRONG>const</STRONG> <STRONG>char</STRONG> <STRONG>*);</STRONG>
+       <STRONG>int</STRONG> <STRONG>scr_restore_sp(SCREEN*,</STRONG> <STRONG>const</STRONG> <STRONG>char</STRONG> <STRONG>*);</STRONG>
+       <STRONG>int</STRONG> <STRONG>scr_set_sp(SCREEN*,</STRONG> <STRONG>const</STRONG> <STRONG>char</STRONG> <STRONG>*);</STRONG>
+       <STRONG>TERMINAL*</STRONG> <STRONG>set_curterm_sp(SCREEN*,</STRONG> <STRONG>TERMINAL*);</STRONG>
+       <STRONG>int</STRONG> <STRONG>set_escdelay_sp(SCREEN*,</STRONG> <STRONG>int);</STRONG>
+       <STRONG>int</STRONG> <STRONG>set_tabsize_sp(SCREEN*,</STRONG> <STRONG>int);</STRONG>
+       <STRONG>int</STRONG> <STRONG>slk_attroff_sp(SCREEN*,</STRONG> <STRONG>const</STRONG> <STRONG>chtype);</STRONG>
+       <STRONG>int</STRONG> <STRONG>slk_attron_sp(SCREEN*,</STRONG> <STRONG>const</STRONG> <STRONG>chtype);</STRONG>
+       <STRONG>int</STRONG> <STRONG>slk_attr_set_sp(SCREEN*,</STRONG> <STRONG>const</STRONG> <STRONG>attr_t,</STRONG> <STRONG>short,</STRONG> <STRONG>void*);</STRONG>
+       <STRONG>int</STRONG> <STRONG>slk_attrset_sp(SCREEN*,</STRONG> <STRONG>const</STRONG> <STRONG>chtype);</STRONG>
+       <STRONG>int</STRONG> <STRONG>slk_attr_sp((SCREEN*);</STRONG>
+       <STRONG>int</STRONG> <STRONG>slk_clear_sp(SCREEN*);</STRONG>
+       <STRONG>int</STRONG> <STRONG>slk_color_sp(SCREEN*,</STRONG> <STRONG>short);</STRONG>
+       <STRONG>int</STRONG> <STRONG>slk_init_sp(SCREEN*,</STRONG> <STRONG>int);</STRONG>
+       <STRONG>int</STRONG> <STRONG>slk_label_sp(SCREEN*,</STRONG> <STRONG>int);</STRONG>
+       <STRONG>int</STRONG> <STRONG>slk_noutrefresh_sp(SCREEN*);</STRONG>
+       <STRONG>int</STRONG> <STRONG>slk_refresh_sp(SCREEN*);</STRONG>
+       <STRONG>int</STRONG> <STRONG>slk_restore_sp(SCREEN*);</STRONG>
+       <STRONG>int</STRONG> <STRONG>slk_set_sp(SCREEN*,</STRONG> <STRONG>int,</STRONG> <STRONG>const</STRONG> <STRONG>char</STRONG> <STRONG>*,</STRONG> <STRONG>int);</STRONG>
+       <STRONG>int</STRONG> <STRONG>slk_touch_sp(SCREEN*);</STRONG>
+       <STRONG>int</STRONG> <STRONG>start_color_sp(SCREEN*);</STRONG>
+       <STRONG>attr_t</STRONG> <STRONG>term_attrs_sp(SCREEN*);</STRONG>
+       <STRONG>chtype</STRONG> <STRONG>termattrs_sp(SCREEN*);</STRONG>
+       <STRONG>char*</STRONG> <STRONG>termname_sp(SCREEN*);</STRONG>
+       <STRONG>int</STRONG> <STRONG>typeahead_sp(SCREEN*,</STRONG> <STRONG>int);</STRONG>
+       <STRONG>NCURSES_CONST</STRONG> <STRONG>char*</STRONG> <STRONG>unctrl_sp(SCREEN*,</STRONG> <STRONG>chtype);</STRONG>
+       <STRONG>int</STRONG> <STRONG>ungetch_sp(SCREEN*,</STRONG> <STRONG>int);</STRONG>
+       <STRONG>int</STRONG> <STRONG>ungetmouse_sp(SCREEN*,MEVENT</STRONG> <STRONG>*);</STRONG>
+       <STRONG>int</STRONG> <STRONG>unget_wch_sp(SCREEN*,</STRONG> <STRONG>const</STRONG> <STRONG>wchar_t);</STRONG>
+       <STRONG>int</STRONG> <STRONG>use_default_colors_sp(SCREEN*);</STRONG>
+       <STRONG>void</STRONG> <STRONG>use_env_sp(SCREEN*,</STRONG> <STRONG>bool);</STRONG>
+       <STRONG>int</STRONG> <STRONG>use_legacy_coding_sp(SCREEN*,</STRONG> <STRONG>int);</STRONG>
+       <STRONG>int</STRONG> <STRONG>vid_attr_sp(SCREEN*,</STRONG> <STRONG>attr_t,</STRONG> <STRONG>short,</STRONG> <STRONG>void</STRONG> <STRONG>*);</STRONG>
+       <STRONG>int</STRONG> <STRONG>vidattr_sp(SCREEN*,</STRONG> <STRONG>chtype);</STRONG>
+       <STRONG>int</STRONG> <STRONG>vid_puts_sp(SCREEN*,</STRONG> <STRONG>attr_t,</STRONG> <STRONG>short,</STRONG> <STRONG>void</STRONG> <STRONG>*,</STRONG> <STRONG>NCURSES_SP_OUTC);</STRONG>
+       <STRONG>int</STRONG> <STRONG>vidputs_sp(SCREEN*,</STRONG> <STRONG>chtype,</STRONG> <STRONG>NCURSES_SP_OUTC);</STRONG>
+       <STRONG>wchar_t*</STRONG> <STRONG>wunctrl_sp(SCREEN*,</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*);</STRONG>
+
+       <STRONG>#include</STRONG> <STRONG>&lt;form.h&gt;</STRONG>
+
+       <STRONG>int</STRONG> <STRONG>new_form_sp(SCREEN*,</STRONG> <STRONG>FIELD</STRONG> <STRONG>**);</STRONG>
+
+       <STRONG>#include</STRONG> <STRONG>&lt;menu.h&gt;</STRONG>
+
+       <STRONG>int</STRONG> <STRONG>new_menu_sp(SCREEN*,</STRONG> <STRONG>ITEM</STRONG> <STRONG>**);</STRONG>
+
+       <STRONG>#include</STRONG> <STRONG>&lt;panel.h&gt;</STRONG>
+
+       <STRONG>int</STRONG> <STRONG>ceiling_panel(SCREEN*);</STRONG>
+       <STRONG>PANEL*</STRONG> <STRONG>ground_panel(SCREEN*);</STRONG>
+       <STRONG>int</STRONG> <STRONG>update_panels_sp(SCREEN*);</STRONG>
+
+       <STRONG>#include</STRONG> <STRONG>&lt;term.h&gt;</STRONG>
+
+       <STRONG>int</STRONG> <STRONG>del_curterm_sp(SCREEN*,</STRONG> <STRONG>TERMINAL</STRONG> <STRONG>*);</STRONG>
+       <STRONG>int</STRONG> <STRONG>putp_sp(SCREEN*,</STRONG> <STRONG>const</STRONG> <STRONG>char</STRONG> <STRONG>*);</STRONG>
+       <STRONG>int</STRONG> <STRONG>tgetflag_sp(SCREEN*,</STRONG> <STRONG>char</STRONG> <STRONG>*,</STRONG> <STRONG>const</STRONG> <STRONG>char</STRONG> <STRONG>*);</STRONG>
+       <STRONG>int</STRONG> <STRONG>tgetent_sp(SCREEN*,</STRONG> <STRONG>char</STRONG> <STRONG>*,</STRONG> <STRONG>const</STRONG> <STRONG>char</STRONG> <STRONG>*);</STRONG>
+       <STRONG>int</STRONG> <STRONG>tgetnum_sp(SCREEN*,</STRONG> <STRONG>NCURSES_CONST</STRONG> <STRONG>char</STRONG> <STRONG>*);</STRONG>
+       <STRONG>char*</STRONG> <STRONG>tgetstr_sp(SCREEN*,</STRONG> <STRONG>NCURSES_CONST</STRONG> <STRONG>char</STRONG> <STRONG>*,</STRONG> <STRONG>char</STRONG> <STRONG>**);</STRONG>
+       <STRONG>int</STRONG> <STRONG>tigetflag_sp(SCREEN*,</STRONG> <STRONG>NCURSES_CONST</STRONG> <STRONG>char</STRONG> <STRONG>*);</STRONG>
+       <STRONG>int</STRONG> <STRONG>tigetnum_sp(SCREEN*,</STRONG> <STRONG>NCURSES_CONST</STRONG> <STRONG>char</STRONG> <STRONG>*);</STRONG>
+       <STRONG>char*</STRONG> <STRONG>tigetstr_sp(SCREEN*,</STRONG> <STRONG>NCURSES_CONST</STRONG> <STRONG>char</STRONG> <STRONG>*);</STRONG>
+       <STRONG>int</STRONG> <STRONG>tputs_sp(SCREEN*,</STRONG> <STRONG>const</STRONG> <STRONG>char</STRONG> <STRONG>*,</STRONG> <STRONG>int,</STRONG> <STRONG>NCURSES_SP_OUTC);</STRONG>
+
+
+</PRE>
+<H2>DESCRIPTION</H2><PRE>
+       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 configu-
+       rations supported by  ncurses;  it  adds  new  entrypoints
+       without changing the meaning of any of the existing ones.
+
+   <STRONG>IMPROVED</STRONG> <STRONG>FUNCTIONS</STRONG>
+       Most  of  the functions are new versions of existing func-
+       tions.  A parameter is added at the front of the parameter
+       list.  It is a SCREEN pointer.
+
+       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.
+
+   <STRONG>NEW</STRONG> <STRONG>FUNCTIONS</STRONG>
+       Here are the new functions:
+
+       ceiling_panel
+            this returns a pointer to the topmost  panel  in  the
+            given screen.
+
+       ground_panel
+            this  returns  a  pointer  to the lowest panel in the
+            given screen.
+
+       new_prescr
+            when creating a new screen, the library  uses  static
+            variables   which   have   been   preset,   e.g.,  by
+            <STRONG><A HREF="use_env.3x.html">use_env(3x)</A></STRONG>, <STRONG><A HREF="filter.3x.html">filter(3x)</A></STRONG>, etc.  With the screen-point-
+            er extension, there are situations where it must cre-
+            ate a current screen before  the  unextended  library
+            does.   The <STRONG>new_prescr</STRONG> function is used internally to
+            handle these cases.  It is also provided as an entry-
+            point  to allow applications to customize the library
+            initialization.
+
+
+</PRE>
+<H2>NOTES</H2><PRE>
+       This extension introduces some new names:
+
+       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.
+
+       NCURSES_SP_NAME
+            The new functions are named using  the  macro  <EM>NCURS-</EM>
+            <EM>ES</EM><STRONG>_</STRONG><EM>SP</EM><STRONG>_</STRONG><EM>NAME</EM>,  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.
+
+       NCURSES_SP_OUTC
+            This  is  a  new  function-pointer type to use in the
+            screen-pointer functions  where  an  <EM>NCURSES</EM><STRONG>_</STRONG><EM>OUTC</EM>  is
+            used in the unextended library.
+
+       NCURSES_OUTC
+            This  is  a  function-pointer type used for the cases
+            where a function  passes  characters  to  the  output
+            stream, e.g., <STRONG><A HREF="vidputs.3x.html">vidputs(3x)</A></STRONG>.
+
+
+</PRE>
+<H2>PORTABILITY</H2><PRE>
+       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 ex-
+       tensions be conditioned using <EM>NCURSES</EM><STRONG>_</STRONG><EM>SP</EM><STRONG>_</STRONG><EM>FUNCS</EM>.
+
+
+</PRE>
+<H2>SEE ALSO</H2><PRE>
+       <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_opaque.3x.html">curs_opaque(3x)</A></STRONG>, <STRONG><A HREF="curs_threads.3x.html">curs_threads(3x)</A></STRONG>.
+
+
+
+                                                      <STRONG><A HREF="curs_sp_funcs.3x.html">curs_sp_funcs(3x)</A></STRONG>
+</PRE>
+<HR>
+<ADDRESS>
+Man(1) output converted with
+<a href="http://www.oac.uci.edu/indiv/ehood/man2html.html">man2html</a>
+</ADDRESS>
+</BODY>
+</HTML>
diff -Naur ncurses-5.7.orig/doc/html/man/curs_termattrs.3x.html ncurses-5.7/doc/html/man/curs_termattrs.3x.html
--- ncurses-5.7.orig/doc/html/man/curs_termattrs.3x.html	2008-06-21 19:11:40.000000000 -0400
+++ ncurses-5.7/doc/html/man/curs_termattrs.3x.html	2011-01-08 18:13:50.411156937 -0500
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 <!-- 
   ****************************************************************************
-  * Copyright (c) 1998-2003,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,7 +27,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: curs_termattrs.3x,v 1.10 2007/06/02 20:40:07 tom Exp @
+  * @Id: curs_termattrs.3x,v 1.11 2010/07/31 16:10:55 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -111,11 +111,11 @@
 
        If  a  given  terminal  does not support a video attribute
        that an application program is trying to use,  <STRONG>curses</STRONG>  may
-       substitute  a  different  video  attribute  for  it.   The
-       <STRONG>termattrs</STRONG> and <STRONG>term_attrs</STRONG> functions return a logical <STRONG>OR</STRONG>  of
-       all  video  attributes  supported by the terminal using <EM>A</EM><STRONG>_</STRONG>
-       and <EM>WA</EM><STRONG>_</STRONG> constants respectively.  This information is  use-
-       ful  when a <STRONG>curses</STRONG> program needs complete control over the
+       substitute  a  different video attribute for it.  The <STRONG>ter-</STRONG>
+       <STRONG>mattrs</STRONG> and <STRONG>term_attrs</STRONG> functions return a logical <STRONG>OR</STRONG> of all
+       video  attributes  supported  by the terminal using <EM>A</EM><STRONG>_</STRONG> and
+       <EM>WA</EM><STRONG>_</STRONG> constants respectively.  This  information  is  useful
+       when  a  <STRONG>curses</STRONG>  program  needs  complete control over the
        appearance of the screen.
 
        The <STRONG>termname</STRONG> routine returns the  terminal  name  used  by
diff -Naur ncurses-5.7.orig/doc/html/man/curs_termcap.3x.html ncurses-5.7/doc/html/man/curs_termcap.3x.html
--- ncurses-5.7.orig/doc/html/man/curs_termcap.3x.html	2008-06-21 19:11:40.000000000 -0400
+++ ncurses-5.7/doc/html/man/curs_termcap.3x.html	2011-01-08 18:18:29.350657586 -0500
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 <!-- 
   ****************************************************************************
-  * 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,7 +27,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: curs_termcap.3x,v 1.22 2007/06/02 20:40:07 tom Exp @
+  * @Id: curs_termcap.3x,v 1.25 2010/10/02 23:40:57 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -47,8 +47,9 @@
 
 </PRE>
 <H2>NAME</H2><PRE>
-       <STRONG>tgetent</STRONG>, <STRONG>tgetflag</STRONG>, <STRONG>tgetnum</STRONG>, <STRONG>tgetstr</STRONG>, <STRONG>tgoto</STRONG>, <STRONG>tputs</STRONG> - direct
-       <STRONG>curses</STRONG> interface to the terminfo capability database
+       <STRONG>PC</STRONG>, <STRONG>UP</STRONG>, <STRONG>BC</STRONG>, <STRONG>ospeed</STRONG>, <STRONG>tgetent</STRONG>, <STRONG>tgetflag</STRONG>, <STRONG>tgetnum</STRONG>, <STRONG>tgetstr</STRONG>,
+       <STRONG>tgoto</STRONG>, <STRONG>tputs</STRONG> - direct <STRONG>curses</STRONG> interface to the terminfo
+       capability database
 
 
 </PRE>
@@ -71,56 +72,56 @@
 
 </PRE>
 <H2>DESCRIPTION</H2><PRE>
-       These routines are included as a conversion aid  for  pro-
-       grams  that use the <EM>termcap</EM> library.  Their parameters are
-       the same and the routines are emulated using the  <EM>terminfo</EM>
-       database.   Thus, they can only be used to query the capa-
-       bilities of entries for which a terminfo  entry  has  been
+       These  routines  are included as a conversion aid for pro-
+       grams that use the <EM>termcap</EM> library.  Their parameters  are
+       the  same and the routines are emulated using the <EM>terminfo</EM>
+       database.  Thus, they can only be used to query the  capa-
+       bilities  of  entries  for which a terminfo entry has been
        compiled.
 
-       The  <STRONG>tgetent</STRONG> routine loads the entry for <EM>name</EM>.  It returns
-       1 on success, 0 if there is no such entry, and -1  if  the
-       terminfo  database  could  not  be  found.   The emulation
-       ignores the buffer pointer <EM>bp</EM>.
+       The <STRONG>tgetent</STRONG> routine loads the entry for <EM>name</EM>.  It  returns
+       1  on  success, 0 if there is no such entry, and -1 if the
+       terminfo database could not be found.  The  emulation  ig-
+       nores the buffer pointer <EM>bp</EM>.
 
-       The <STRONG>tgetflag</STRONG> routine gets the boolean  entry  for  <EM>id</EM>,  or
-       zero if it is not available.
+       The <STRONG>tgetflag</STRONG> routine gets the boolean entry for <EM>id</EM>, or ze-
+       ro if it is not available.
 
-       The  <STRONG>tgetnum</STRONG>  routine gets the numeric entry for <EM>id</EM>, or -1
+       The <STRONG>tgetnum</STRONG> routine gets the numeric entry for <EM>id</EM>,  or  -1
        if it is not available.
 
-       The <STRONG>tgetstr</STRONG> routine returns the string entry  for  <EM>id</EM>,  or
-       zero  if  it  is  not  available.  Use <STRONG>tputs</STRONG> to output the
-       returned string.  The return value will also be copied  to
-       the  buffer pointed to by <EM>area</EM>, and the <EM>area</EM> value will be
+       The  <STRONG>tgetstr</STRONG>  routine  returns the string entry for <EM>id</EM>, or
+       zero if it is not available.  Use <STRONG>tputs</STRONG> to output the  re-
+       turned  string.   The  return value will also be copied to
+       the buffer pointed to by <EM>area</EM>, and the <EM>area</EM> value will  be
        updated to point past the null ending this value.
 
        Only the first two characters of the <STRONG>id</STRONG> parameter of <STRONG>tget-</STRONG>
        <STRONG>flag</STRONG>, <STRONG>tgetnum</STRONG> and <STRONG>tgetstr</STRONG> are compared in lookups.
 
-       The  <STRONG>tgoto</STRONG>  routine  instantiates  the parameters into the
-       given capability.  The output from this routine is  to  be
+       The <STRONG>tgoto</STRONG> routine instantiates  the  parameters  into  the
+       given  capability.   The output from this routine is to be
        passed to <STRONG>tputs</STRONG>.
 
-       The  <STRONG>tputs</STRONG>  routine  is described on the <STRONG><A HREF="curs_terminfo.3x.html">curs_terminfo(3x)</A></STRONG>
+       The <STRONG>tputs</STRONG> routine is described  on  the  <STRONG><A HREF="curs_terminfo.3x.html">curs_terminfo(3x)</A></STRONG>
        manual page.  It can retrieve capabilities by either term-
        cap or terminfo name.
 
        The variables <STRONG>PC</STRONG>, <STRONG>UP</STRONG> and <STRONG>BC</STRONG> are set by <STRONG>tgetent</STRONG> to the ter-
        minfo   entry's   data   for   <STRONG>pad_char</STRONG>,   <STRONG>cursor_up</STRONG>   and
-       <STRONG>backspace_if_not_bs</STRONG>,  respectively.   <STRONG>UP</STRONG>  is  not  used by
+       <STRONG>backspace_if_not_bs</STRONG>, respectively.   <STRONG>UP</STRONG>  is  not  used  by
        ncurses.  <STRONG>PC</STRONG> is used in the <STRONG>tdelay_output</STRONG> function.  <STRONG>BC</STRONG> is
-       used  in  the <STRONG>tgoto</STRONG> emulation.  The variable <STRONG>ospeed</STRONG> is set
-       by ncurses in a  system-specific  coding  to  reflect  the
-       terminal speed.
+       used in the <STRONG>tgoto</STRONG> emulation.  The variable <STRONG>ospeed</STRONG>  is  set
+       by ncurses in a system-specific coding to reflect the ter-
+       minal speed.
 
 
 </PRE>
 <H2>RETURN VALUE</H2><PRE>
-       Except  where  explicitly  noted,  routines that return an
-       integer return <STRONG>ERR</STRONG> upon failure and <STRONG>OK</STRONG> (SVr4  only  speci-
-       fies  "an  integer  value other than <STRONG>ERR</STRONG>") upon successful
-       completion.
+       Except where explicitly noted, routines that return an in-
+       teger  return <STRONG>ERR</STRONG> upon failure and <STRONG>OK</STRONG> (SVr4 only specifies
+       "an integer value other than <STRONG>ERR</STRONG>") upon successful comple-
+       tion.
 
        Routines that return pointers return <STRONG>NULL</STRONG> on error.
 
@@ -128,54 +129,54 @@
 </PRE>
 <H2>BUGS</H2><PRE>
        If you call <STRONG>tgetstr</STRONG> to fetch <STRONG>ca</STRONG> or any other parameterized
-       string,  be  aware  that  it  will be returned in terminfo
-       notation, not the older and  not-quite-compatible  termcap
-       notation.  This will not cause problems if all you do with
-       it is call <STRONG>tgoto</STRONG> or <STRONG>tparm</STRONG>,  which  both  expand  terminfo-
-       style  strings  as terminfo.  (The <STRONG>tgoto</STRONG> function, if con-
-       figured to support termcap, will check if  the  string  is
-       indeed  terminfo-style  by  looking for "%p" parameters or
-       "$&lt;..&gt;" delays, and invoke a termcap-style parser  if  the
+       string, be aware that it will be returned in terminfo  no-
+       tation, not the older and not-quite-compatible termcap no-
+       tation.  This will not cause problems if all you  do  with
+       it  is  call  <STRONG>tgoto</STRONG>  or <STRONG>tparm</STRONG>, which both expand terminfo-
+       style strings as terminfo.  (The <STRONG>tgoto</STRONG> function,  if  con-
+       figured  to  support  termcap, will check if the string is
+       indeed terminfo-style by looking for  "%p"  parameters  or
+       "$&lt;..&gt;"  delays,  and invoke a termcap-style parser if the
        string does not appear to be terminfo).
 
-       Because  terminfo  conventions for representing padding in
-       string capabilities differ  from  termcap's,  <STRONG>tputs("50");</STRONG>
-       will  put  out a literal "50" rather than busy-waiting for
+       Because terminfo conventions for representing  padding  in
+       string  capabilities  differ  from termcap's, <STRONG>tputs("50");</STRONG>
+       will put out a literal "50" rather than  busy-waiting  for
        50 milliseconds.  Cope with it.
 
-       Note that termcap has nothing analogous to terminfo's  <STRONG>sgr</STRONG>
-       string.   One consequence of this is that termcap applica-
-       tions assume me (terminfo <STRONG>sgr0</STRONG>) does not reset the  alter-
-       nate  character  set.  This implementation checks for, and
+       Note  that termcap has nothing analogous to terminfo's <STRONG>sgr</STRONG>
+       string.  One consequence of this is that termcap  applica-
+       tions  assume me (terminfo <STRONG>sgr0</STRONG>) does not reset the alter-
+       nate character set.  This implementation checks  for,  and
        modifies the data shown to the termcap interface to accom-
        modate termcap's limitation in this respect.
 
 
 </PRE>
 <H2>PORTABILITY</H2><PRE>
-       The  XSI  Curses  standard,  Issue 4 describes these func-
-       tions.  However, they are marked TO BE WITHDRAWN  and  may
+       The XSI Curses standard, Issue  4  describes  these  func-
+       tions.   However,  they are marked TO BE WITHDRAWN and may
        be removed in future versions.
 
-       Neither  the  XSI  Curses  standard nor the SVr4 man pages
-       documented the return values of <STRONG>tgetent</STRONG> correctly,  though
-       all  three were in fact returned ever since SVr1.  In par-
-       ticular, an omission in the XSI Curses  documentation  has
-       been  misinterpreted  to  mean  that <STRONG>tgetent</STRONG> returns <STRONG>OK</STRONG> or
+       Neither the XSI Curses standard nor  the  SVr4  man  pages
+       documented  the return values of <STRONG>tgetent</STRONG> correctly, though
+       all three were in fact returned ever since SVr1.  In  par-
+       ticular,  an  omission in the XSI Curses documentation has
+       been misinterpreted to mean that  <STRONG>tgetent</STRONG>  returns  <STRONG>OK</STRONG>  or
        <STRONG>ERR</STRONG>.  Because the purpose of these functions is to provide
-       compatibility  with  the <EM>termcap</EM> library, that is a defect
+       compatibility with the <EM>termcap</EM> library, that is  a  defect
        in XCurses, Issue 4, Version 2 rather than in ncurses.
 
-       External variables are provided  for  support  of  certain
-       termcap  applications.  However, termcap applications' use
+       External  variables  are  provided  for support of certain
+       termcap applications.  However, termcap applications'  use
        of those variables is poorly documented, e.g., not distin-
-       guishing  between  input  and output.  In particular, some
+       guishing between input and output.   In  particular,  some
        applications are reported to declare and/or modify <STRONG>ospeed</STRONG>.
 
 
 </PRE>
 <H2>SEE ALSO</H2><PRE>
-       <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>, <STRONG><A HREF="putc.3.html">putc(3)</A></STRONG>.
+       <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>, <STRONG><A HREF="term_variables.3x.html">term_variables(3x)</A></STRONG>, <STRONG><A HREF="putc.3.html">putc(3)</A></STRONG>.
 
 
 
diff -Naur ncurses-5.7.orig/doc/html/man/curs_terminfo.3x.html ncurses-5.7/doc/html/man/curs_terminfo.3x.html
--- ncurses-5.7.orig/doc/html/man/curs_terminfo.3x.html	2008-10-11 17:34:07.000000000 -0400
+++ ncurses-5.7/doc/html/man/curs_terminfo.3x.html	2011-01-08 18:18:29.354656643 -0500
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 <!-- 
   ****************************************************************************
-  * Copyright (c) 1999-2007,2008 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            *
@@ -27,7 +27,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: curs_terminfo.3x,v 1.30 2008/08/16 20:53:27 tom Exp @
+  * @Id: curs_terminfo.3x,v 1.34 2010/10/02 23:41:09 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -48,9 +48,9 @@
 </PRE>
 <H2>NAME</H2><PRE>
        <STRONG>del_curterm</STRONG>, <STRONG>mvcur</STRONG>, <STRONG>putp</STRONG>, <STRONG>restartterm</STRONG>, <STRONG>set_curterm</STRONG>,
-       <STRONG>setterm</STRONG>, <STRONG>setupterm</STRONG>, <STRONG>tigetflag</STRONG>, <STRONG>tigetnum</STRONG>, <STRONG>tigetstr</STRONG>, <STRONG>tparm</STRONG>,
-       <STRONG>tputs</STRONG>, <STRONG>vid_attr</STRONG>, <STRONG>vid_puts</STRONG>, <STRONG>vidattr</STRONG>, <STRONG>vidputs</STRONG> - <STRONG>curses</STRONG>
-       interfaces to terminfo database
+       <STRONG>setterm</STRONG>, <STRONG>setupterm</STRONG>, <STRONG>tigetflag</STRONG>, <STRONG>tigetnum</STRONG>, <STRONG>tigetstr</STRONG>, <STRONG>tiparm</STRONG>,
+       <STRONG>tparm</STRONG>, <STRONG>tputs</STRONG>, <STRONG>vid_attr</STRONG>, <STRONG>vid_puts</STRONG>, <STRONG>vidattr</STRONG>, <STRONG>vidputs</STRONG> -
+       <STRONG>curses</STRONG> interfaces to terminfo database
 
 
 </PRE>
@@ -74,6 +74,7 @@
        <STRONG>int</STRONG> <STRONG>tigetflag(char</STRONG> <STRONG>*</STRONG><EM>capname</EM><STRONG>);</STRONG>
        <STRONG>int</STRONG> <STRONG>tigetnum(char</STRONG> <STRONG>*</STRONG><EM>capname</EM><STRONG>);</STRONG>
        <STRONG>char</STRONG> <STRONG>*tigetstr(char</STRONG> <STRONG>*</STRONG><EM>capname</EM><STRONG>);</STRONG>
+       <STRONG>char</STRONG> <STRONG>*tiparm(const</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG><EM>str</EM><STRONG>,</STRONG> <STRONG>...);</STRONG>
 
 
 </PRE>
@@ -180,6 +181,10 @@
        ters  <EM>pi</EM>.  A pointer is returned to the result of <EM>str</EM> with
        the parameters applied.
 
+       <STRONG>tiparm</STRONG> is a newer form  of  <STRONG>tparm</STRONG>  which  uses  <EM>&lt;stdarg.h&gt;</EM>
+       rather  than  a fixed-parameter list.  Its numeric parame-
+       ters are integers (int) rather than longs.
+
        The <STRONG>tputs</STRONG>  routine  applies  padding  information  to  the
        string  <EM>str</EM>  and  outputs  it.  The <EM>str</EM> must be a terminfo
        string variable or the return value from  <STRONG>tparm</STRONG>,  <STRONG>tgetstr</STRONG>,
@@ -253,11 +258,11 @@
 
        Routines that return pointers always return <STRONG>NULL</STRONG> on error.
 
-       X/Open  defines  no error conditions.  In this implementa-
+       X/Open defines no error conditions.  In  this  implementa-
        tion
 
               <STRONG>del_curterm</STRONG>
-                   returns an error if its terminal parameter  is
+                   returns  an error if its terminal parameter is
                    null.
 
               <STRONG>putp</STRONG> calls <STRONG>tputs</STRONG>, returning the same error-codes.
@@ -267,23 +272,23 @@
                    <STRONG>tupterm</STRONG> returns an error.
 
               <STRONG>setupterm</STRONG>
-                   returns an error if it cannot allocate  enough
+                   returns  an error if it cannot allocate enough
                    memory, or create the initial windows (stdscr,
-                   curscr, newscr).  Other error  conditions  are
+                   curscr,  newscr).   Other error conditions are
                    documented above.
 
               <STRONG>tputs</STRONG>
-                   returns  an  error  if the string parameter is
-                   null.  It does not detect I/O  errors:  X/Open
-                   states  that <STRONG>tputs</STRONG> ignores the return value of
+                   returns an error if the  string  parameter  is
+                   null.   It  does not detect I/O errors: X/Open
+                   states that <STRONG>tputs</STRONG> ignores the return value  of
                    the output function <EM>putc</EM>.
 
 
 </PRE>
 <H2>NOTES</H2><PRE>
-       The <STRONG>setupterm</STRONG> routine should be used in place of  <STRONG>setterm</STRONG>.
-       It  may be useful when you want to test for terminal capa-
-       bilities without committing to the allocation  of  storage
+       The  <STRONG>setupterm</STRONG> routine should be used in place of <STRONG>setterm</STRONG>.
+       It may be useful when you want to test for terminal  capa-
+       bilities  without  committing to the allocation of storage
        involved in <STRONG>initscr</STRONG>.
 
        Note that <STRONG>vidattr</STRONG> and <STRONG>vidputs</STRONG> may be macros.
@@ -291,54 +296,59 @@
 
 </PRE>
 <H2>PORTABILITY</H2><PRE>
-       The  function  <STRONG>setterm</STRONG> is not described by X/Open and must
-       be considered non-portable.  All other  functions  are  as
+       The function <STRONG>setterm</STRONG> is not described by X/Open  and  must
+       be  considered  non-portable.   All other functions are as
        described by X/Open.
 
-       <STRONG>setupterm</STRONG>  copies  the terminal name to the array <STRONG>ttytype</STRONG>.
-       This is not part of X/Open Curses, but is assumed by  some
+       <STRONG>setupterm</STRONG> copies the terminal name to the  array  <STRONG>ttytype</STRONG>.
+       This  is not part of X/Open Curses, but is assumed by some
        applications.
 
-       In  System V Release 4, <STRONG>set_curterm</STRONG> has an <STRONG>int</STRONG> return type
-       and returns <STRONG>OK</STRONG> or <STRONG>ERR</STRONG>.  We have chosen  to  implement  the
+       In System V Release 4, <STRONG>set_curterm</STRONG> has an <STRONG>int</STRONG> return  type
+       and  returns  <STRONG>OK</STRONG>  or <STRONG>ERR</STRONG>.  We have chosen to implement the
        X/Open Curses semantics.
 
        In System V Release 4, the third argument of <STRONG>tputs</STRONG> has the
        type <STRONG>int</STRONG> <STRONG>(*putc)(char)</STRONG>.
 
        At least one implementation of X/Open Curses (Solaris) re-
-       turns  a value other than OK/ERR from <STRONG>tputs</STRONG>.  That returns
+       turns a value other than OK/ERR from <STRONG>tputs</STRONG>.  That  returns
        the length of the string, and does no error-checking.
 
-       X/Open Curses prototypes <STRONG>tparm</STRONG> with a fixed number of  pa-
-       rameters,  rather than a variable argument list.  This im-
-       plementation uses a variable argument list.  Portable  ap-
+       X/Open  Curses prototypes <STRONG>tparm</STRONG> with a fixed number of pa-
+       rameters, rather than a variable argument list.  This  im-
+       plementation  uses  a  variable  argument list, but can be
+       configured to use the fixed-parameter list.  Portable  ap-
        plications  should  provide 9 parameters after the format;
        zeroes are fine for this purpose.
 
-       X/Open notes that after calling <STRONG>mvcur</STRONG>,  the  curses  state
-       may  not  match the actual terminal state, and that an ap-
-       plication should touch and refresh the window  before  re-
+       In response to comments by Thomas E. Dickey, X/Open Curses
+       Issue 7 proposed the <STRONG>tiparam</STRONG> function in mid-2009.
+
+       X/Open  notes  that  after calling <STRONG>mvcur</STRONG>, the curses state
+       may not match the actual terminal state, and that  an  ap-
+       plication  should  touch and refresh the window before re-
        suming normal curses calls.  Both ncurses and System V Re-
        lease 4 curses implement <STRONG>mvcur</STRONG> using the SCREEN data allo-
        cated in either <STRONG>initscr</STRONG> or <STRONG>newterm</STRONG>.  So though it is docu-
-       mented as a terminfo function, <STRONG>mvcur</STRONG> is  really  a  curses
+       mented  as  a  terminfo function, <STRONG>mvcur</STRONG> is really a curses
        function which is not well specified.
 
-       X/Open  states  that  the  old  location must be given for
-       <STRONG>mvcur</STRONG>.  This implementation allows the caller to use  -1's
-       for  the old ordinates.  In that case, the old location is
+       X/Open states that the old  location  must  be  given  for
+       <STRONG>mvcur</STRONG>.   This implementation allows the caller to use -1's
+       for the old ordinates.  In that case, the old location  is
        unknown.
 
-       Extended terminal capability names, e.g.,  as  defined  by
-       <STRONG>tic</STRONG> <STRONG>-x</STRONG>,  are  not  stored  in the arrays described in this
+       Extended  terminal  capability  names, e.g., as defined by
+       <STRONG>tic</STRONG> <STRONG>-x</STRONG>, are not stored in the  arrays  described  in  this
        section.
 
 
 </PRE>
 <H2>SEE ALSO</H2><PRE>
-       <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_initscr.3x.html">curs_initscr(3x)</A></STRONG>, <STRONG><A HREF="curs_kernel.3x.html">curs_kernel(3x)</A></STRONG>,  <STRONG>curs_term-</STRONG>
-       <STRONG><A HREF="curs_termcap.3x.html">cap(3x)</A></STRONG>, <STRONG><A HREF="putc.3.html">putc(3)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>
+       <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>,  <STRONG><A HREF="curs_initscr.3x.html">curs_initscr(3x)</A></STRONG>, <STRONG><A HREF="curs_kernel.3x.html">curs_kernel(3x)</A></STRONG>, <STRONG>curs_term-</STRONG>
+       <STRONG><A HREF="curs_termcap.3x.html">cap(3x)</A></STRONG>, <STRONG><A HREF="curs_variables.3x.html">curs_variables(3x)</A></STRONG>, <STRONG><A HREF="term_variables.3x.html">term_variables(3x)</A></STRONG>,  <STRONG><A HREF="putc.3.html">putc(3)</A></STRONG>,
+       <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>
 
 
 
diff -Naur ncurses-5.7.orig/doc/html/man/curs_threads.3x.html ncurses-5.7/doc/html/man/curs_threads.3x.html
--- ncurses-5.7.orig/doc/html/man/curs_threads.3x.html	2008-06-21 19:11:41.000000000 -0400
+++ ncurses-5.7/doc/html/man/curs_threads.3x.html	2011-01-08 18:18:29.354656643 -0500
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 <!-- 
   ****************************************************************************
-  * 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            *
@@ -27,7 +27,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: curs_threads.3x,v 1.12 2008/04/12 18:22:51 tom Exp @
+  * @Id: curs_threads.3x,v 1.17 2010/10/02 23:21:27 tom Exp @
   * ***************************************************************************
   * ***************************************************************************
 -->
@@ -56,80 +56,83 @@
 <H2>SYNOPSIS</H2><PRE>
        <STRONG>#include</STRONG> <STRONG>&lt;curses.h&gt;</STRONG>
 
-       <STRONG>typedef</STRONG>  <STRONG>int</STRONG> <STRONG>(*NCURSES_WINDOW_CB)(WINDOW</STRONG> <STRONG>*,</STRONG> <STRONG>void</STRONG> <STRONG>*);</STRONG> <STRONG>type-</STRONG>
-       <STRONG>def</STRONG> <STRONG>int</STRONG> <STRONG>(*NCURSES_SCREEN_CB)(SCREEN</STRONG> <STRONG>*,</STRONG> <STRONG>void</STRONG> <STRONG>*);</STRONG>
+       <STRONG>typedef</STRONG> <STRONG>int</STRONG> <STRONG>(*NCURSES_WINDOW_CB)(WINDOW</STRONG> <STRONG>*,</STRONG> <STRONG>void</STRONG> <STRONG>*);</STRONG>
+       <STRONG>typedef</STRONG> <STRONG>int</STRONG> <STRONG>(*NCURSES_SCREEN_CB)(SCREEN</STRONG> <STRONG>*,</STRONG> <STRONG>void</STRONG> <STRONG>*);</STRONG>
+       <STRONG>int</STRONG> <STRONG>get_escdelay(void);</STRONG>
        <STRONG>int</STRONG> <STRONG>set_escdelay(int</STRONG> <STRONG>size);</STRONG>
        <STRONG>int</STRONG> <STRONG>set_tabsize(int</STRONG> <STRONG>size);</STRONG>
-       <STRONG>int</STRONG> <STRONG>use_screen(SCREEN</STRONG> <STRONG>*scr,</STRONG> <STRONG>NCURSES_WINDOW_CB</STRONG>  <STRONG>func,</STRONG>  <STRONG>void</STRONG>
+       <STRONG>int</STRONG>  <STRONG>use_screen(SCREEN</STRONG>  <STRONG>*scr,</STRONG> <STRONG>NCURSES_WINDOW_CB</STRONG> <STRONG>func,</STRONG> <STRONG>void</STRONG>
        <STRONG>*data);</STRONG>
-       <STRONG>int</STRONG>  <STRONG>use_window(WINDOW</STRONG>  <STRONG>*win,</STRONG> <STRONG>NCURSES_SCREEN_CB</STRONG> <STRONG>func,</STRONG> <STRONG>void</STRONG>
+       <STRONG>int</STRONG> <STRONG>use_window(WINDOW</STRONG> <STRONG>*win,</STRONG> <STRONG>NCURSES_SCREEN_CB</STRONG>  <STRONG>func,</STRONG>  <STRONG>void</STRONG>
        <STRONG>*data);</STRONG>
 
 
 </PRE>
 <H2>DESCRIPTION</H2><PRE>
-       This implementation can be configured to provide  rudimen-
-       tary  support for multi-threaded applications.  This makes
-       a different set of libraries, e.g., <EM>libncursest</EM> since  the
+       This  implementation can be configured to provide rudimen-
+       tary support for multi-threaded applications.  This  makes
+       a  different set of libraries, e.g., <EM>libncursest</EM> since the
        binary interfaces are different.
 
-       Rather  than modify the interfaces to pass a thread speci-
-       fier to each function, it adds a few functions  which  can
+       Rather than modify the interfaces to pass a thread  speci-
+       fier  to  each function, it adds a few functions which can
        be used in any configuration which hide the mutex's needed
-       to prevent concurrent use of  the  global  variables  when
+       to  prevent  concurrent  use  of the global variables when
        configured for threading.
 
-       In  addition  to  forcing  access to members of the <STRONG>WINDOW</STRONG>
-       structure to be via functions  (see  <STRONG><A HREF="curs_opaque.3x.html">curs_opaque(3x)</A></STRONG>),  it
+       In addition to forcing access to  members  of  the  <STRONG>WINDOW</STRONG>
+       structure  to  be  via functions (see <STRONG><A HREF="curs_opaque.3x.html">curs_opaque(3x)</A></STRONG>), it
        makes functions of the common global variables, e.g., COL-
-       ORS, COLOR_PAIRS, COLS, ESCDELAY, LINES,  TABSIZE  curscr,
-       newscr  and  ttytype.   Those  variables are maintained as
+       ORS,  COLOR_PAIRS,  COLS, ESCDELAY, LINES, TABSIZE curscr,
+       newscr and ttytype.  Those  variables  are  maintained  as
        read-only values, stored in the <STRONG>SCREEN</STRONG> structure.
 
-       Even this is not enough to make a thread-safe  application
-       using  curses.   A multi-threaded application would be ex-
-       pected to have threads updating separate  windows  (within
+       Even  this is not enough to make a thread-safe application
+       using curses.  A multi-threaded application would  be  ex-
+       pected  to  have threads updating separate windows (within
        the same device), or updating on separate screens (on dif-
-       ferent devices).  Also, a few of the global variables  are
-       considered  writable  by some applications.  The functions
+       ferent  devices).  Also, a few of the global variables are
+       considered writable by some applications.   The  functions
        described here address these special situations.
 
-       The ESCDELAY and TABSIZE global variables are modified  by
-       some  applications.   To modify them in any configuration,
-       use the  <STRONG>set_escdelay</STRONG>  or  <STRONG>set_tabsize</STRONG>  functions.   Other
+       The  ESCDELAY and TABSIZE global variables are modified by
+       some applications.  To modify them in  any  configuration,
+       use  the  <STRONG>set_escdelay</STRONG>  or  <STRONG>set_tabsize</STRONG>  functions.  Other
        global variables are not modifiable.
 
-       The  <STRONG>use_window</STRONG>  and  <STRONG>use_screen</STRONG>  functions provide coarse
+       The <STRONG>get_escdelay</STRONG> function returns the value for ESCDELAY.
+
+       The <STRONG>use_window</STRONG> and  <STRONG>use_screen</STRONG>  functions  provide  coarse
        granularity mutexes for their respective <STRONG>WINDOW</STRONG> and <STRONG>SCREEN</STRONG>
-       parameters,  and call a user-supplied function, passing it
-       a <EM>data</EM> parameter, and returning the value from  the  user-
+       parameters, and call a user-supplied function, passing  it
+       a  <EM>data</EM>  parameter, and returning the value from the user-
        supplied function to the application.
 
    <STRONG>USAGE</STRONG>
-       All  of  the ncurses library functions assume that the lo-
-       cale is not altered during operation.  In  addition,  they
+       All of the ncurses library functions assume that  the  lo-
+       cale  is  not altered during operation.  In addition, they
        use data which is maintained within a hierarchy of scopes.
 
-              -  global data, e.g., used in the low-level termin-
-                 fo or termcap interfaces.
+          <STRONG>o</STRONG>   global data, e.g., used in the  low-level  terminfo
+              or termcap interfaces.
 
-              -  terminal  data,  e.g., associated with a call to
-                 <EM>set</EM><STRONG>_</STRONG><EM>curterm</EM>.  The terminal data are  initialized
-                 when screens are created.
-
-              -  screen  data,  e.g.,  associated  with a call to
-                 <EM>newterm</EM> or <EM>initscr</EM>.
-
-              -  window data, e.g., associated  with  a  call  to
-                 <EM>newwin</EM>  or  <EM>subwin</EM>.  Windows are associated with
-                 screens.  Pads are  not  necessarily  associated
-                 with a particular screen.
+          <STRONG>o</STRONG>   terminal  data,  e.g.,  associated  with  a call to
+              <EM>set</EM><STRONG>_</STRONG><EM>curterm</EM>.  The  terminal  data  are  initialized
+              when screens are created.
+
+          <STRONG>o</STRONG>   screen  data,  e.g.,  associated  with  a  call  to
+              <EM>newterm</EM> or <EM>initscr</EM>.
+
+          <STRONG>o</STRONG>   window data, e.g., associated with a call to <EM>newwin</EM>
+              or  <EM>subwin</EM>.   Windows  are associated with screens.
+              Pads are not necessarily associated with a particu-
+              lar screen.
 
-                 Most  curses applications operate on one or more
-                 windows within a single screen.
+              Most  curses  applications  operate  on one or more
+              windows within a single screen.
 
-              -  reentrant, i.e., it uses only the data passed as
-                 parameters.
+          <STRONG>o</STRONG>   reentrant, i.e., it uses only the  data  passed  as
+              parameters.
 
        This table lists the scope of data used for each symbol in
        the ncurses library  when  it  is  configured  to  support
@@ -178,10 +181,10 @@
       boolfnames              global (readonly)
       boolnames               global (readonly)
       border                  window (stdscr)
+
       border_set              window (stdscr)
       box                     window (stdscr)
       box_set                 window (stdscr)
-
       can_change_color        terminal
       cbreak                  screen
       chgat                   window (stdscr)
@@ -245,10 +248,10 @@
       has_key                 screen
       hline                   window (stdscr)
       hline_set               window (stdscr)
+
       idcok                   window
       idlok                   window
       immedok                 window
-
       in_wch                  window (stdscr)
       in_wchnstr              window (stdscr)
       in_wchstr               window (stdscr)
@@ -312,10 +315,10 @@
       mvaddstr                window (stdscr)
       mvaddwstr               window (stdscr)
       mvchgat                 window (stdscr)
+
       mvcur                   screen
       mvdelch                 window (stdscr)
       mvderwin                window (stdscr)
-
       mvget_wch               screen (input-operation)
       mvget_wstr              screen (input-operation)
       mvgetch                 screen (input-operation)
@@ -379,10 +382,10 @@
       mvwinsch                window
       mvwinsnstr              window
       mvwinsstr               window
+
       mvwinstr                window
       mvwinwstr               window
       mvwprintw               window
-
       mvwscanw                screen
       mvwvline                window
       mvwvline_set            window
@@ -446,10 +449,10 @@
       slk_attr_on             screen
       slk_attr_set            screen
       slk_attroff             screen
+
       slk_attron              screen
       slk_attrset             screen
       slk_clear               screen
-
       slk_color               screen
       slk_init                screen
       slk_label               screen
@@ -513,10 +516,10 @@
       wadd_wchnstr            window
       wadd_wchstr             window
       waddch                  window
+
       waddchnstr              window
       waddchstr               window
       waddnstr                window
-
       waddnwstr               window
       waddstr                 window
       waddwstr                window
@@ -580,10 +583,10 @@
       wprintw                 window
       wredrawln               window
       wrefresh                screen
+
       wresize                 window locks(windowlist)
       wscanw                  screen
       wscrl                   window
-
       wsetscrreg              window
       wstandend               window
       wstandout               window
@@ -608,15 +611,15 @@
 
 </PRE>
 <H2>PORTABILITY</H2><PRE>
-       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  ex-
+       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 ex-
        tensions be conditioned using NCURSES_VERSION.
 
 
 </PRE>
 <H2>SEE ALSO</H2><PRE>
-       <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_opaque.3x.html">curs_opaque(3x)</A></STRONG>
+       <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_opaque.3x.html">curs_opaque(3x)</A></STRONG>, <STRONG><A HREF="curs_variables.3x.html">curs_variables(3x)</A></STRONG>.
 
 
 
diff -Naur ncurses-5.7.orig/doc/html/man/curs_touch.3x.html ncurses-5.7/doc/html/man/curs_touch.3x.html
--- ncurses-5.7.orig/doc/html/man/curs_touch.3x.html	2006-09-23 16:43:08.000000000 -0400
+++ ncurses-5.7/doc/html/man/curs_touch.3x.html	2011-01-08 18:18:29.354656643 -0500
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 <!-- 
   ****************************************************************************
-  * 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,7 +27,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: curs_touch.3x,v 1.11 2006/02/25 21:49:19 tom Exp @
+  * @Id: curs_touch.3x,v 1.13 2010/10/02 23:21:37 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -79,46 +79,46 @@
 
        The <STRONG>wtouchln</STRONG> routine makes <EM>n</EM> lines in the window, starting
        at line <EM>y</EM>, look as if they have (<EM>changed</EM><STRONG>=1</STRONG>)  or  have  not
-       (<EM>changed</EM><STRONG>=0</STRONG>)  been changed since the last call to <STRONG>wrefresh</STRONG>.
+       (<EM>changed</EM><STRONG>=0</STRONG>) been changed since the last call to <STRONG>wrefresh</STRONG>.
 
-       The <STRONG>is_linetouched</STRONG> and <STRONG>is_wintouched</STRONG> routines return  <STRONG>TRUE</STRONG>
-       if  the  specified line/window was modified since the last
-       call to <STRONG>wrefresh</STRONG>; otherwise they return <STRONG>FALSE</STRONG>.   In  addi-
-       tion,  <STRONG>is_linetouched</STRONG> returns <STRONG>ERR</STRONG> if <EM>line</EM> is not valid for
+       The  <STRONG>is_linetouched</STRONG> and <STRONG>is_wintouched</STRONG> routines return <STRONG>TRUE</STRONG>
+       if the specified line/window was modified since  the  last
+       call  to  <STRONG>wrefresh</STRONG>; otherwise they return <STRONG>FALSE</STRONG>.  In addi-
+       tion, <STRONG>is_linetouched</STRONG> returns <STRONG>ERR</STRONG> if <EM>line</EM> is not valid  for
        the given window.
 
 
 </PRE>
 <H2>RETURN VALUE</H2><PRE>
-       All routines return the integer <STRONG>ERR</STRONG> upon  failure  and  an
-       integer  value  other than <STRONG>ERR</STRONG> upon successful completion,
-       unless otherwise noted in the preceding  routine  descrip-
+       All  routines  return  the integer <STRONG>ERR</STRONG> upon failure and an
+       integer value other than <STRONG>ERR</STRONG> upon  successful  completion,
+       unless  otherwise  noted in the preceding routine descrip-
        tions.
 
-       X/Open  does not define any error conditions.  In this im-
+       X/Open does not define any error conditions.  In this  im-
        plementation
 
               <STRONG>is_linetouched</STRONG>
-                   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
+                   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.
 
               <STRONG>wtouchln</STRONG>
-                   returns an error  if  the  window  pointer  is
-                   null,  or  if  the  line number is outside the
+                   returns  an  error  if  the  window pointer is
+                   null, or if the line  number  is  outside  the
                    window.
 
 
 </PRE>
 <H2>PORTABILITY</H2><PRE>
-       The XSI Curses standard, Issue  4  describes  these  func-
+       The  XSI  Curses  standard,  Issue 4 describes these func-
        tions.
 
-       Some  historic  curses  implementations had, as an undocu-
-       mented feature,  the  ability  to  do  the  equivalent  of
-       <STRONG>clearok(...,</STRONG>  <STRONG>1)</STRONG>  by saying <STRONG>touchwin(stdscr)</STRONG> or <STRONG>clear(std-</STRONG>
+       Some historic curses implementations had,  as  an  undocu-
+       mented  feature,  the  ability  to  do  the  equivalent of
+       <STRONG>clearok(...,</STRONG> <STRONG>1)</STRONG> by saying <STRONG>touchwin(stdscr)</STRONG>  or  <STRONG>clear(std-</STRONG>
        <STRONG>scr)</STRONG>.  This will not work under ncurses.
 
 
@@ -129,7 +129,7 @@
 
 </PRE>
 <H2>SEE ALSO</H2><PRE>
-       <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_refresh.3x.html">curs_refresh(3x)</A></STRONG>.
+       <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_refresh.3x.html">curs_refresh(3x)</A></STRONG>, <STRONG><A HREF="curs_variables.3x.html">curs_variables(3x)</A></STRONG>.
 
 
 
diff -Naur ncurses-5.7.orig/doc/html/man/curs_trace.3x.html ncurses-5.7/doc/html/man/curs_trace.3x.html
--- ncurses-5.7.orig/doc/html/man/curs_trace.3x.html	2007-03-03 19:10:43.000000000 -0500
+++ ncurses-5.7/doc/html/man/curs_trace.3x.html	2011-01-08 18:13:50.411156937 -0500
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 <!-- 
   ****************************************************************************
-  * Copyright (c) 2000-2005,2007 Free Software Foundation, Inc.              *
+  * Copyright (c) 2000-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            *
@@ -27,7 +27,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: curs_trace.3x,v 1.8 2007/02/24 17:33:49 tom Exp @
+  * @Id: curs_trace.3x,v 1.11 2010/07/31 16:10:55 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -48,8 +48,9 @@
 </PRE>
 <H2>NAME</H2><PRE>
        <STRONG>_tracef</STRONG>, <STRONG>_tracedump</STRONG>, <STRONG>_traceattr</STRONG>, <STRONG>_traceattr2</STRONG>,
-       <STRONG>_nc_tracebits</STRONG>, <STRONG>_tracechar</STRONG>, <STRONG>_tracechtype</STRONG>, <STRONG>_tracechtype2</STRONG>,
-       <STRONG>_tracemouse</STRONG>, <STRONG>trace</STRONG> - <STRONG>curses</STRONG> debugging routines
+       <STRONG>_nc_tracebits</STRONG>, <STRONG>_tracecchar_t</STRONG>, <STRONG>_tracecchar_t2</STRONG>, <STRONG>_tracechar</STRONG>,
+       <STRONG>_tracechtype</STRONG>, <STRONG>_tracechtype2</STRONG>, <STRONG>_tracemouse</STRONG>, <STRONG>trace</STRONG> - <STRONG>curses</STRONG>
+       debugging routines
 
 
 </PRE>
@@ -61,7 +62,9 @@
        <STRONG>char</STRONG> <STRONG>*_traceattr(attr_t</STRONG> <STRONG>attr);</STRONG>
        <STRONG>char</STRONG> <STRONG>*_traceattr2(int</STRONG> <STRONG>buffer,</STRONG> <STRONG>chtype</STRONG> <STRONG>ch);</STRONG>
        <STRONG>char</STRONG> <STRONG>*_nc_tracebits(void);</STRONG>
-       <STRONG>char</STRONG> <STRONG>*_tracechar(int);</STRONG>
+       <STRONG>char</STRONG> <STRONG>*</STRONG> <STRONG>_tracecchar_t(const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*string);</STRONG>
+       <STRONG>char</STRONG> <STRONG>*</STRONG> <STRONG>_tracecchar_t2(int</STRONG> <STRONG>buffer,</STRONG> <STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*string);</STRONG>
+       <STRONG>char</STRONG> <STRONG>*_tracechar(int</STRONG> <STRONG>ch);</STRONG>
        <STRONG>char</STRONG> <STRONG>*_tracechtype(chtype</STRONG> <STRONG>ch);</STRONG>
        <STRONG>char</STRONG> <STRONG>*_tracechtype2(int</STRONG> <STRONG>buffer,</STRONG> <STRONG>chtype</STRONG> <STRONG>ch);</STRONG>
        <STRONG>char</STRONG> <STRONG>*_tracemouse(const</STRONG> <STRONG>MEVENT</STRONG> <STRONG>*event);</STRONG>
@@ -70,20 +73,22 @@
 
 </PRE>
 <H2>DESCRIPTION</H2><PRE>
-       The  <STRONG>trace</STRONG> routines are used for debugging the ncurses li-
+       The <STRONG>trace</STRONG> routines are used for debugging the ncurses  li-
        braries, as well as applications which use the ncurses li-
        braries.  These functions are normally available only with
-       the debugging library <EM>libncurses</EM><STRONG>_</STRONG><EM>g.a</EM>, but may be  compiled
-       into  any  model (shared, static, profile) by defining the
-       symbol <STRONG>TRACE</STRONG>.
+       the  debugging library <EM>libncurses</EM><STRONG>_</STRONG><EM>g.a</EM>, but may be compiled
+       into any model (shared, static, profile) by  defining  the
+       symbol  <STRONG>TRACE</STRONG>.   Additionally,  some  functions  are  only
+       available with the wide-character configuration of the li-
+       braries.
 
-       The principal parts of this interface are the  <STRONG>trace</STRONG>  rou-
+       The  principal  parts of this interface are the <STRONG>trace</STRONG> rou-
        tine which selectively enables different tracing features,
        and the <STRONG>_tracef</STRONG> routine which writes formatted data to the
        <EM>trace</EM> file.
 
-       Calling  <STRONG>trace</STRONG>  with  a  nonzero  parameter opens the file
-       <STRONG>trace</STRONG> in the current directory for output.  The  parameter
+       Calling <STRONG>trace</STRONG> with a  nonzero  parameter  opens  the  file
+       <STRONG>trace</STRONG>  in the current directory for output.  The parameter
        is formed by OR'ing values from the list of <STRONG>TRACE_</STRONG><EM>xxx</EM> def-
        initions in <STRONG>&lt;curses.h&gt;</STRONG>.  These include:
 
@@ -106,8 +111,8 @@
             trace all character outputs.
 
        TRACE_ORDINARY
-            trace all update actions.  The  old  and  new  screen
-            contents  are  written to the trace file for each re-
+            trace  all  update  actions.   The old and new screen
+            contents are written to the trace file for  each  re-
             fresh.
 
        TRACE_CALLS
@@ -143,6 +148,12 @@
        rameter is nonzero.  Some features overlap.  The  specific
        names are used as a guideline.
 
+       These  functions check the <STRONG>NCURSES_TRACE</STRONG> environment vari-
+       able, to set the tracing feature as if <STRONG>trace</STRONG> was called:
+              filter,  initscr,  new_prescr,  newterm,  nofilter,
+              ripoffline, setupterm, slk_init, tgetent
+
+
 
 </PRE>
 <H2>RETURN VALUE</H2><PRE>
diff -Naur ncurses-5.7.orig/doc/html/man/curs_util.3x.html ncurses-5.7/doc/html/man/curs_util.3x.html
--- ncurses-5.7.orig/doc/html/man/curs_util.3x.html	2008-10-11 17:34:08.000000000 -0400
+++ ncurses-5.7/doc/html/man/curs_util.3x.html	2011-01-08 18:18:29.354656643 -0500
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 <!-- 
   ****************************************************************************
-  * 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            *
@@ -27,7 +27,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: curs_util.3x,v 1.26 2008/10/11 20:32:56 tom Exp @
+  * @Id: curs_util.3x,v 1.31 2010/10/02 23:21:45 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -76,32 +76,33 @@
        tributes.   Control characters are displayed in the <STRONG>^</STRONG><EM>X</EM> no-
        tation.  Printing characters are  displayed  as  is.   The
        corresponding  <STRONG>wunctrl</STRONG>  returns a printable representation
-       of a wide-character.
+       of a wide character.
 
        The <STRONG>keyname</STRONG> routine returns a character string correspond-
        ing to the key <EM>c</EM>:
 
-          -  Printable  characters  are  displayed as themselves,
-             e.g., a one-character string containing the key.
+          <STRONG>o</STRONG>   Printable  characters  are displayed as themselves,
+              e.g., a one-character string containing the key.
 
-          -  Control characters are displayed in the <STRONG>^</STRONG><EM>X</EM> notation.
+          <STRONG>o</STRONG>   Control characters are displayed in  the  <STRONG>^</STRONG><EM>X</EM>  nota-
+              tion.
 
-          -  DEL (character 127) is displayed as <STRONG>^?</STRONG>.
+          <STRONG>o</STRONG>   DEL (character 127) is displayed as <STRONG>^?</STRONG>.
 
-          -  Values  above 128 are either meta characters (if the
-             screen has not been initialized, or if <STRONG>meta</STRONG> has been
-             called  with a TRUE parameter), shown in the <STRONG>M-</STRONG><EM>X</EM> no-
-             tation, or are displayed as themselves.  In the lat-
-             ter case, the values may not be printable; this fol-
-             lows the X/Open specification.
-
-          -  Values above 256 may be the names of  the  names  of
-             function keys.
-
-          -  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.
+          <STRONG>o</STRONG>   Values above 128 are either meta characters (if the
+              screen has not been initialized,  or  if  <STRONG>meta</STRONG>  has
+              been  called  with  a TRUE parameter), shown in the
+              <STRONG>M-</STRONG><EM>X</EM> notation, or are displayed as  themselves.   In
+              the  latter  case, the values may not be printable;
+              this follows the X/Open specification.
+
+          <STRONG>o</STRONG>   Values above 256 may be the names of the  names  of
+              function keys.
+
+          <STRONG>o</STRONG>   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.
 
        The corresponding <STRONG>key_name</STRONG> returns a character string cor-
        responding  to  the wide-character value <EM>w</EM>.  The two func-
@@ -127,8 +128,8 @@
        <EM>terminfo</EM>  database will be used, even if environment vari-
        ables <STRONG>LINES</STRONG> and <STRONG>COLUMNS</STRONG> (used by default) are set,  or  if
        <STRONG>curses</STRONG>  is  running in a window (in which case default be-
-       havior would be to  use  the  window  size  if  <STRONG>LINES</STRONG>  and
-       <STRONG>COLUMNS</STRONG>  are not set).  Note that setting <STRONG>LINES</STRONG> or <STRONG>COLUMNS</STRONG>
+       havior would be to use the window size if <STRONG>LINES</STRONG>  and  <STRONG>COL-</STRONG>
+       <STRONG>UMNS</STRONG>  are  not  set).   Note that setting <STRONG>LINES</STRONG> or <STRONG>COLUMNS</STRONG>
        overrides the corresponding size  which  may  be  obtained
        from the operating system.
 
@@ -163,90 +164,94 @@
        X/Open does not define any error conditions.  In this  im-
        plementation
 
-              <STRONG>flushinp</STRONG>
-                   returns  an error if the terminal was not ini-
-                   tialized.
-
-              <STRONG>putwin</STRONG>
-                   returns an  error  if  the  associated  <STRONG>fwrite</STRONG>
-                   calls return an error.
+          <STRONG>flushinp</STRONG>
+               returns  an error if the terminal was not initial-
+               ized.
+
+          <STRONG>meta</STRONG> returns an error if the terminal was not  initial-
+               ized.
+
+          <STRONG>putwin</STRONG>
+               returns  an  error  if the associated <STRONG>fwrite</STRONG> calls
+               return an error.
 
 
 </PRE>
 <H2>PORTABILITY</H2><PRE>
-       The  XSI  Curses  standard,  Issue 4 describes these func-
-       tions.  It states that <STRONG>unctrl</STRONG> and <STRONG>wunctrl</STRONG>  will  return  a
-       null  pointer if unsuccessful, but does not define any er-
+       The XSI Curses standard, Issue  4  describes  these  func-
+       tions.   It  states  that <STRONG>unctrl</STRONG> and <STRONG>wunctrl</STRONG> will return a
+       null pointer if unsuccessful, but does not define any  er-
        ror conditions.  This implementation checks for three cas-
        es:
 
-              -    the  parameter is a 7-bit US-ASCII code.  This
-                   is the case that X/Open Curses documented.
+          <STRONG>o</STRONG>   the parameter is a 7-bit US-ASCII  code.   This  is
+              the case that X/Open Curses documented.
 
-              -    the parameter is in the range 128-159, i.e., a
-                   C1  control  code.   If  <STRONG>use_legacy_coding</STRONG> has
-                   been called with a <STRONG>2</STRONG> parameter, <STRONG>unctrl</STRONG> 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.
-
-                   X/Open Curses does not document whether <STRONG>unctrl</STRONG>
-                   can  be  called  before  initializing  curses.
-                   This implementation permits that, and  returns
-                   the ``~@'', etc., values in that case.
+          <STRONG>o</STRONG>   the  parameter  is in the range 128-159, i.e., a C1
+              control code.  If <STRONG>use_legacy_coding</STRONG> has been called
+              with  a  <STRONG>2</STRONG> parameter, <STRONG>unctrl</STRONG> 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  con-
+              trols.
+
+              X/Open  Curses does not document whether <STRONG>unctrl</STRONG> can
+              be called before initializing curses.  This  imple-
+              mentation  permits  that,  and  returns the ``~@'',
+              etc., values in that case.
 
-              -    parameter  values  outside the 0 to 255 range.
-                   <STRONG>unctrl</STRONG> returns a null pointer.
+          <STRONG>o</STRONG>   parameter values outside the 0 to 255 range.   <STRONG>unc-</STRONG>
+              <STRONG>trl</STRONG> returns a null pointer.
 
        The SVr4 documentation describes the action of <STRONG>filter</STRONG> only
-       in  the  vaguest  terms.   The description here is adapted
-       from the XSI Curses standard (which erroneously  fails  to
+       in the vaguest terms.  The  description  here  is  adapted
+       from  the  XSI Curses standard (which erroneously fails to
        describe the disabling of <STRONG>cuu</STRONG>).
 
-       The  strings returned by <STRONG>unctrl</STRONG> in this implementation are
-       determined at compile time, showing C1 controls  from  the
-       upper-128  codes with a `~' prefix rather than `^'.  Other
-       implementations have different conventions.  For  example,
-       they  may  show  both sets of control characters with `^',
-       and strip the parameter to 7 bits.  Or they may ignore  C1
-       controls  and  treat  all of the upper-128 codes as print-
+       The strings returned by <STRONG>unctrl</STRONG> in this implementation  are
+       determined  at  compile time, showing C1 controls from the
+       upper-128 codes with a `~' prefix rather than `^'.   Other
+       implementations  have different conventions.  For example,
+       they may show both sets of control  characters  with  `^',
+       and  strip the parameter to 7 bits.  Or they may ignore C1
+       controls and treat all of the upper-128  codes  as  print-
        able.  This implementation uses 8 bits but does not modify
        the string to reflect locale.  The <STRONG>use_legacy_coding</STRONG> func-
        tion allows the caller to change the output of <STRONG>unctrl</STRONG>.
 
-       Likewise, the <STRONG>meta</STRONG> function allows the  caller  to  change
-       the  output of <STRONG>keyname</STRONG>, i.e., it determines whether to use
-       the `M-' prefix for ``meta'' keys (codes in the range  128
+       Likewise,  the  <STRONG>meta</STRONG>  function allows the caller to change
+       the output of <STRONG>keyname</STRONG>, i.e., it determines whether to  use
+       the  `M-' prefix for ``meta'' keys (codes in the range 128
        to 255).  Both <STRONG>use_legacy_coding</STRONG> and <STRONG>meta</STRONG> succeed only af-
-       ter curses is initialized.  X/Open Curses does  not  docu-
-       ment  the  treatment  of  codes 128 to 159.  When treating
+       ter  curses  is initialized.  X/Open Curses does not docu-
+       ment the treatment of codes 128  to  159.   When  treating
        them as ``meta'' keys (or if <STRONG>keyname</STRONG> is called before ini-
-       tializing  curses),  this  implementation  returns strings
+       tializing curses),  this  implementation  returns  strings
        ``M-^@'', ``M-^A'', etc.
 
-       The <STRONG>keyname</STRONG> function may return the names of  user-defined
-       string  capabilities which are defined in the terminfo en-
-       try via the <STRONG>-x</STRONG> option of <STRONG>tic</STRONG>.  This  implementation  auto-
-       matically  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
-       <STRONG>use_extended_names</STRONG> function controls whether this data  is
-       loaded  when  the  terminal description is read by the li-
+       The  <STRONG>keyname</STRONG> function may return the names of user-defined
+       string capabilities which are defined in the terminfo  en-
+       try  via  the <STRONG>-x</STRONG> option of <STRONG>tic</STRONG>.  This implementation auto-
+       matically 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
+       <STRONG>use_extended_names</STRONG>  function controls whether this data is
+       loaded when the terminal description is read  by  the  li-
        brary.
 
-       The <STRONG>nofilter</STRONG> 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  ex-
+       The  <STRONG>nofilter</STRONG>  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 ex-
        tensions be conditioned using NCURSES_VERSION.
 
 
 </PRE>
 <H2>SEE ALSO</H2><PRE>
        <STRONG><A HREF="legacy_coding.3x.html">legacy_coding(3x)</A></STRONG>, <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_initscr.3x.html">curs_initscr(3x)</A></STRONG>, <STRONG>curs_ker-</STRONG>
-       <STRONG><A HREF="curs_kernel.3x.html">nel(3x)</A></STRONG>, <STRONG><A HREF="curs_scr_dump.3x.html">curs_scr_dump(3x)</A></STRONG>, <STRONG><A HREF="legacy_coding.3x.html">legacy_coding(3x)</A></STRONG>.
+       <STRONG><A HREF="curs_kernel.3x.html">nel(3x)</A></STRONG>,   <STRONG><A HREF="curs_scr_dump.3x.html">curs_scr_dump(3x)</A></STRONG>,   <STRONG><A HREF="curs_variables.3x.html">curs_variables(3x)</A></STRONG>,  <STRONG>lega-</STRONG>
+       <STRONG><A HREF="legacy_coding.3x.html">cy_coding(3x)</A></STRONG>.
 
 
 
diff -Naur ncurses-5.7.orig/doc/html/man/curs_variables.3x.html ncurses-5.7/doc/html/man/curs_variables.3x.html
--- ncurses-5.7.orig/doc/html/man/curs_variables.3x.html	1969-12-31 19:00:00.000000000 -0500
+++ ncurses-5.7/doc/html/man/curs_variables.3x.html	2011-01-08 18:18:29.246657101 -0500
@@ -0,0 +1,164 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
+<!-- 
+  ****************************************************************************
+  * 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: curs_variables.3x,v 1.3 2010/09/11 20:16:49 tom Exp @
+-->
+<HTML>
+<HEAD>
+<TITLE>curs_variables 3x</TITLE>
+<link rev=made href="mailto:bug-ncurses@gnu.org">
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+</HEAD>
+<BODY>
+<H1>curs_variables 3x</H1>
+<HR>
+<PRE>
+<!-- Manpage converted by man2html 3.0.1 -->
+<STRONG><A HREF="curs_variables.3x.html">curs_variables(3x)</A></STRONG>                                   <STRONG><A HREF="curs_variables.3x.html">curs_variables(3x)</A></STRONG>
+
+
+
+
+</PRE>
+<H2>NAME</H2><PRE>
+       <STRONG>COLORS</STRONG>, <STRONG>COLOR_PAIRS</STRONG>, <STRONG>COLS</STRONG>, <STRONG>ESCDELAY</STRONG>, <STRONG>LINES</STRONG>, <STRONG>TABSIZE</STRONG>,
+       <STRONG>curscr</STRONG>, <STRONG>newscr</STRONG>, <STRONG>stdscr</STRONG> - <STRONG>curses</STRONG> global variables
+
+
+</PRE>
+<H2>SYNOPSIS</H2><PRE>
+       <STRONG>#include</STRONG> <STRONG>&lt;curses.h&gt;</STRONG>
+
+       <STRONG>int</STRONG> <STRONG>COLOR_PAIRS;</STRONG>
+       <STRONG>int</STRONG> <STRONG>COLORS;</STRONG>
+       <STRONG>int</STRONG> <STRONG>COLS;</STRONG>
+       <STRONG>int</STRONG> <STRONG>ESCDELAY;</STRONG>
+       <STRONG>int</STRONG> <STRONG>LINES;</STRONG>
+       <STRONG>int</STRONG> <STRONG>TABSIZE;</STRONG>
+       <STRONG>WINDOW</STRONG> <STRONG>*</STRONG> <STRONG>curscr;</STRONG>
+       <STRONG>WINDOW</STRONG> <STRONG>*</STRONG> <STRONG>newscr;</STRONG>
+       <STRONG>WINDOW</STRONG> <STRONG>*</STRONG> <STRONG>stdscr;</STRONG>
+
+
+</PRE>
+<H2>DESCRIPTION</H2><PRE>
+       This page summarizes variables provided by the <STRONG>curses</STRONG>  li-
+       brary.   A more complete description is given in the <STRONG>curs-</STRONG>
+       <STRONG><A HREF="ncurses.3x.html">es(3x)</A></STRONG> manual page.
+
+       Depending on the configuration, these may be actual  vari-
+       ables,  or  macros  (see  <STRONG><A HREF="curs_threads.3x.html">curs_threads(3x)</A></STRONG>)  which provide
+       read-only access to <EM>curses</EM>'s state.  In either  case,  ap-
+       plications should treat them as read-only to avoid confus-
+       ing the library.
+
+   <STRONG>COLOR_PAIRS</STRONG>
+       After initializing curses, this variable contains the num-
+       ber of color pairs which the terminal can support.  Usual-
+       ly the number of color pairs  will  be  the  product  <STRONG>COL-</STRONG>
+       <STRONG>ORS</STRONG>*<STRONG>COLORS</STRONG>, however this is not always true:
+
+       <STRONG>o</STRONG>   a  few  terminals  use HLS colors, which do not follow
+           this rule
+
+       <STRONG>o</STRONG>   terminals supporting a large number of colors are lim-
+           ited  by  the number of color pairs that can be repre-
+           sented in a <EM>signed</EM> <EM>short</EM> value.
+
+   <STRONG>COLORS</STRONG>
+       After initializing curses, this variable contains the num-
+       ber of colors which the terminal can support.
+
+   <STRONG>COLS</STRONG>
+       After  initializing  curses,  this  variable  contains the
+       width of the screen, i.e., the number of columns.
+
+   <STRONG>ESCDELAY</STRONG>
+       This variable holds the number of milliseconds to wait af-
+       ter 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
+       <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>.
+
+   <STRONG>LINES</STRONG>
+       After initializing  curses,  this  variable  contains  the
+       height of the screen, i.e., the number of lines.
+
+   <STRONG>TABSIZE</STRONG>
+       This  variable  holds  the  number  of columns used by the
+       <EM>curses</EM> library when converting a tab character  to  spaces
+       as it adds the tab to a window (see <STRONG><A HREF="curs_addch.3x.html">curs_addch(3x)</A></STRONG>.
+
+   <STRONG>The</STRONG> <STRONG>Current</STRONG> <STRONG>Screen</STRONG>
+       This implementation of curses uses a special window <STRONG>curscr</STRONG>
+       to record its updates to the terminal screen.
+
+   <STRONG>The</STRONG> <STRONG>New</STRONG> <STRONG>Screen</STRONG>
+       This implementation of curses uses a special window <STRONG>newscr</STRONG>
+       to  hold  updates  to  the terminal screen before applying
+       them to <STRONG>curscr</STRONG>.
+
+   <STRONG>The</STRONG> <STRONG>Standard</STRONG> <STRONG>Screen</STRONG>
+       Upon initializing curses, a default window called  <STRONG>stdscr</STRONG>,
+       which  is  the  size  of  the terminal screen, is created.
+       Many curses functions use this window.
+
+
+</PRE>
+<H2>NOTES</H2><PRE>
+       The   curses   library   is   initialized   using   either
+       <STRONG><A HREF="initscr.3x.html">initscr(3x)</A></STRONG>, or <STRONG><A HREF="newterm.3x.html">newterm(3x)</A></STRONG>.
+
+       If  <STRONG>curses</STRONG>  is  configured to use separate curses/terminfo
+       libraries, most of these variables reside  in  the  curses
+       library.
+
+
+</PRE>
+<H2>PORTABILITY</H2><PRE>
+       ESCDELAY  and TABSIZE are extensions, not provided in most
+       other implementations of curses.
+
+
+</PRE>
+<H2>SEE ALSO</H2><PRE>
+       <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_threads.3x.html">curs_threads(3x)</A></STRONG>, <STRONG><A HREF="term_variables.3x.html">term_variables(3x)</A></STRONG>,  <STRONG>termin-</STRONG>
+       <STRONG><A HREF="terminfo.3x.html">fo(3x)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>.
+
+
+
+                                                     <STRONG><A HREF="curs_variables.3x.html">curs_variables(3x)</A></STRONG>
+</PRE>
+<HR>
+<ADDRESS>
+Man(1) output converted with
+<a href="http://www.oac.uci.edu/indiv/ehood/man2html.html">man2html</a>
+</ADDRESS>
+</BODY>
+</HTML>
diff -Naur ncurses-5.7.orig/doc/html/man/curs_window.3x.html ncurses-5.7/doc/html/man/curs_window.3x.html
--- ncurses-5.7.orig/doc/html/man/curs_window.3x.html	2006-09-23 16:43:09.000000000 -0400
+++ ncurses-5.7/doc/html/man/curs_window.3x.html	2011-01-08 18:18:29.354656643 -0500
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 <!-- 
   ****************************************************************************
-  * 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,7 +27,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: curs_window.3x,v 1.14 2006/02/25 21:49:19 tom Exp @
+  * @Id: curs_window.3x,v 1.16 2010/10/02 23:17:27 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -200,7 +200,8 @@
 
 </PRE>
 <H2>SEE ALSO</H2><PRE>
-       <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_refresh.3x.html">curs_refresh(3x)</A></STRONG>, <STRONG><A HREF="curs_touch.3x.html">curs_touch(3x)</A></STRONG>
+       <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_refresh.3x.html">curs_refresh(3x)</A></STRONG>,  <STRONG><A HREF="curs_touch.3x.html">curs_touch(3x)</A></STRONG>,  <STRONG>curs_vari-</STRONG>
+       <STRONG><A HREF="curs_variables.3x.html">ables(3x)</A></STRONG>
 
 
 
diff -Naur ncurses-5.7.orig/doc/html/man/default_colors.3x.html ncurses-5.7/doc/html/man/default_colors.3x.html
--- ncurses-5.7.orig/doc/html/man/default_colors.3x.html	2006-12-24 10:50:59.000000000 -0500
+++ ncurses-5.7/doc/html/man/default_colors.3x.html	2011-01-08 18:13:50.411156937 -0500
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 <!-- 
   ****************************************************************************
-  * 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            *
@@ -28,7 +28,7 @@
   * authorization.                                                           *
   ****************************************************************************
   * 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.21 2010/07/31 16:10:55 tom Exp @
 -->
 <HTML>
 <HEAD>
diff -Naur ncurses-5.7.orig/doc/html/man/define_key.3x.html ncurses-5.7/doc/html/man/define_key.3x.html
--- ncurses-5.7.orig/doc/html/man/define_key.3x.html	2006-09-23 16:43:09.000000000 -0400
+++ ncurses-5.7/doc/html/man/define_key.3x.html	2011-01-08 18:13:50.411156937 -0500
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 <!-- 
   ****************************************************************************
-  * Copyright (c) 1998-2004,2006 Free Software Foundation, Inc.              *
+  * Copyright (c) 1998-2006,2009 Free 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 @@
   * authorization.                                                           *
   ****************************************************************************
   * 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.13 2009/09/19 21:09:35 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -74,15 +74,18 @@
 
 </PRE>
 <H2>RETURN VALUE</H2><PRE>
-       The keycode  must  be  greater  than  zero,  else  ERR  is
+       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.
 
 
 </PRE>
 <H2>PORTABILITY</H2><PRE>
-       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 con-
+       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  con-
        ditioned using NCURSES_VERSION.
 
 
diff -Naur ncurses-5.7.orig/doc/html/man/form.3x.html ncurses-5.7/doc/html/man/form.3x.html
--- ncurses-5.7.orig/doc/html/man/form.3x.html	2008-10-11 17:34:08.000000000 -0400
+++ ncurses-5.7/doc/html/man/form.3x.html	2011-01-08 18:18:29.354656643 -0500
@@ -2,7 +2,7 @@
 <!-- 
   * 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            *
@@ -28,7 +28,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: form.3x,v 1.22 2008/10/11 20:48:11 tom Exp @
+  * @Id: form.3x,v 1.23 2010/07/31 16:10:55 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -243,7 +243,7 @@
 
 </PRE>
 <H2>SEE ALSO</H2><PRE>
-       This describes <STRONG>ncurses</STRONG> version 5.6 (patch 20081011).
+       This describes <STRONG>ncurses</STRONG> version 5.7 (patch 20101002).
 
 
 
diff -Naur ncurses-5.7.orig/doc/html/man/form_cursor.3x.html ncurses-5.7/doc/html/man/form_cursor.3x.html
--- ncurses-5.7.orig/doc/html/man/form_cursor.3x.html	2006-12-16 17:51:34.000000000 -0500
+++ ncurses-5.7/doc/html/man/form_cursor.3x.html	2011-01-08 18:13:50.415156784 -0500
@@ -2,7 +2,7 @@
 <!-- 
   * 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            *
@@ -28,7 +28,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: form_cursor.3x,v 1.6 2006/11/04 18:50:24 tom Exp @
+  * @Id: form_cursor.3x,v 1.7 2010/07/31 16:10:55 tom Exp @
 -->
 <HTML>
 <HEAD>
diff -Naur ncurses-5.7.orig/doc/html/man/form_data.3x.html ncurses-5.7/doc/html/man/form_data.3x.html
--- ncurses-5.7.orig/doc/html/man/form_data.3x.html	2006-09-23 16:43:10.000000000 -0400
+++ ncurses-5.7/doc/html/man/form_data.3x.html	2011-01-08 18:13:50.415156784 -0500
@@ -2,7 +2,7 @@
 <!-- 
   * 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            *
@@ -28,7 +28,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: form_data.3x,v 1.8 2006/02/25 21:38:26 tom Exp @
+  * @Id: form_data.3x,v 1.9 2010/07/31 16:09:36 tom Exp @
 -->
 <HTML>
 <HEAD>
diff -Naur ncurses-5.7.orig/doc/html/man/form_driver.3x.html ncurses-5.7/doc/html/man/form_driver.3x.html
--- ncurses-5.7.orig/doc/html/man/form_driver.3x.html	2008-06-21 19:11:43.000000000 -0400
+++ ncurses-5.7/doc/html/man/form_driver.3x.html	2011-01-08 18:18:29.354656643 -0500
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 <!-- 
   ****************************************************************************
-  * 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            *
@@ -27,7 +27,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: form_driver.3x,v 1.16 2008/06/21 21:55:39 tom Exp @
+  * @Id: form_driver.3x,v 1.21 2010/10/02 23:39:22 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -62,17 +62,17 @@
        input events to it through <STRONG>form_driver</STRONG>.  This routine  has
        three major input cases:
 
-       -  The  input  is  a  form navigation request.  Navigation
-          request codes are constants defined in <STRONG>&lt;form.h&gt;</STRONG>,  which
-          are distinct from the key- and character codes returned
-          by <STRONG>wgetch</STRONG>.
-
-       -  The input is a printable character.  Printable  charac-
-          ters  (which  must  be  positive,  less  than  256) are
-          checked according to the program's locale settings.
+       <STRONG>o</STRONG>   The  input  is  a form navigation request.  Navigation
+           request codes are constants defined in <STRONG>&lt;form.h&gt;</STRONG>, which
+           are   distinct  from  the  key-  and  character  codes
+           returned by <STRONG>wgetch</STRONG>.
+
+       <STRONG>o</STRONG>   The input is a printable character.  Printable charac-
+           ters  (which  must  be  positive,  less  than 256) are
+           checked according to the program's locale settings.
 
-       -  The input is the KEY_MOUSE special key associated  with
-          an mouse event.
+       <STRONG>o</STRONG>   The input is the KEY_MOUSE special key associated with
+           an mouse event.
 
        The form driver requests are as follows:
 
@@ -262,41 +262,40 @@
        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 area or the decora-
+       window  (e.g., inside the form display area or the decora-
        tion window) are handled.
 
        If you click above the display region of the form:
 
-              a REQ_PREV_FIELD is generated for a single click,
+          a REQ_PREV_FIELD is generated for a single click,
 
-              a REQ_PREV_PAGE is generated for a double-click and
+          a REQ_PREV_PAGE is generated for a double-click and
 
-              a REQ_FIRST_FIELD is generated for a  triple-click.
+          a REQ_FIRST_FIELD is generated for a triple-click.
 
        If you click below the display region of the form:
 
-              a REQ_NEXT_FIELD is generated for a single click,
+          a REQ_NEXT_FIELD is generated for a single click,
 
-              a REQ_NEXT_PAGE is generated for a double-click and
+          a REQ_NEXT_PAGE is generated for a double-click and
 
-              a REQ_LAST_FIELD is generated for a triple-click.
+          a REQ_LAST_FIELD is generated for a triple-click.
 
        If you click at an field inside the display  area  of  the
        form:
 
-              -  the form cursor is positioned to that field.
+          <STRONG>o</STRONG>   the form cursor is positioned to that field.
 
-              -  If  you double-click a field, the form cursor is
-                 positioned to that field  and  <STRONG>E_UNKNOWN_COMMAND</STRONG>
-                 is  returned.   This  return  value makes sense,
-                 because a double click  usually  means  that  an
-                 field-specific action should be returned.  It is
-                 exactly the purpose of this return value to sig-
-                 nal  that an application specific command should
-                 be executed.
+          <STRONG>o</STRONG>   If  you  double-click  a  field, the form cursor is
+              positioned to that field and  <STRONG>E_UNKNOWN_COMMAND</STRONG>  is
+              returned.  This return value makes sense, because a
+              double click usually means that  an  field-specific
+              action  should be returned.  It is exactly the pur-
+              pose of this return value to signal that an  appli-
+              cation specific command should be executed.
 
-              -  If  a  translation  into  a  request  was  done,
-                 <STRONG>form_driver</STRONG>  returns the result of this request.
+          <STRONG>o</STRONG>   If   a   translation   into  a  request  was  done,
+              <STRONG>form_driver</STRONG> returns the result of this request.
 
        If you clicked outside the user window or the mouse  event
        could   not   be   translated   into  a  form  request  an
@@ -343,7 +342,7 @@
 
 </PRE>
 <H2>SEE ALSO</H2><PRE>
-       <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="form.3x.html">form(3x)</A></STRONG>, <STRONG><A HREF="wgetch.3x.html">wgetch(3x)</A></STRONG>.
+       <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="form.3x.html">form(3x)</A></STRONG>, <STRONG><A HREF="form_variables.3x.html">form_variables(3x)</A></STRONG>, <STRONG><A HREF="getch.3x.html">getch(3x)</A></STRONG>.
 
 
 </PRE>
diff -Naur ncurses-5.7.orig/doc/html/man/form_field.3x.html ncurses-5.7/doc/html/man/form_field.3x.html
--- ncurses-5.7.orig/doc/html/man/form_field.3x.html	2006-12-16 17:51:34.000000000 -0500
+++ ncurses-5.7/doc/html/man/form_field.3x.html	2011-01-08 18:13:50.415156784 -0500
@@ -2,7 +2,7 @@
 <!-- 
   * 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            *
@@ -28,7 +28,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: form_field.3x,v 1.8 2006/11/04 18:01:38 tom Exp @
+  * @Id: form_field.3x,v 1.9 2010/07/31 16:09:36 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -126,7 +126,7 @@
 
 </PRE>
 <H2>AUTHORS</H2><PRE>
-       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
+       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
        curses by Eric S. Raymond.
 
 
diff -Naur ncurses-5.7.orig/doc/html/man/form_field_attributes.3x.html ncurses-5.7/doc/html/man/form_field_attributes.3x.html
--- ncurses-5.7.orig/doc/html/man/form_field_attributes.3x.html	2006-12-16 17:51:35.000000000 -0500
+++ ncurses-5.7/doc/html/man/form_field_attributes.3x.html	2011-01-08 18:13:50.415156784 -0500
@@ -2,7 +2,7 @@
 <!-- 
   * 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            *
@@ -28,7 +28,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: form_field_attributes.3x,v 1.10 2006/11/04 18:51:26 tom Exp @
+  * @Id: form_field_attributes.3x,v 1.11 2010/07/31 16:09:36 tom Exp @
 -->
 <HTML>
 <HEAD>
diff -Naur ncurses-5.7.orig/doc/html/man/form_field_buffer.3x.html ncurses-5.7/doc/html/man/form_field_buffer.3x.html
--- ncurses-5.7.orig/doc/html/man/form_field_buffer.3x.html	2006-12-16 17:51:35.000000000 -0500
+++ ncurses-5.7/doc/html/man/form_field_buffer.3x.html	2011-01-08 18:18:29.246657101 -0500
@@ -2,7 +2,7 @@
 <!-- 
   * t
   ****************************************************************************
-  * Copyright (c) 1998-2005,2006 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            *
@@ -28,7 +28,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: form_field_buffer.3x,v 1.14 2006/11/04 17:12:00 tom Exp @
+  * @Id: form_field_buffer.3x,v 1.18 2010/09/18 20:22:01 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -54,6 +54,7 @@
 </PRE>
 <H2>SYNOPSIS</H2><PRE>
        <STRONG>#include</STRONG> <STRONG>&lt;form.h&gt;</STRONG>
+
        int  set_field_buffer(FIELD  *field,  int  buf, const char
        *value);
        char *field_buffer(const FIELD *field, int buffer);
@@ -65,21 +66,41 @@
 </PRE>
 <H2>DESCRIPTION</H2><PRE>
        The function <STRONG>set_field_buffer</STRONG> sets the numbered buffer  of
-       the  given  field  to contain a given string.  Buffer 0 is
-       the displayed value of the field; other  numbered  buffers
-       may be allocated by applications through the <STRONG>nbuf</STRONG> argument
-       of (see <STRONG><A HREF="form_field_new.3x.html">form_field_new(3x)</A></STRONG>) but are not manipulated by the
-       forms  library.   The  function  <STRONG>field_buffer</STRONG>  returns the
-       address of the buffer.  Please note that this  buffer  has
-       always  the  length  of the buffer, that means that it may
-       typically contain trailing spaces. If you entered  leading
-       spaces  the  buffer may also contain them. 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 trail-
-       ing spaces. Please note also, that  subsequent  operations
-       on  the  form  will  probably  change  the  content of the
-       buffer. So do not use it for  long  term  storage  of  the
-       entered form data.
+       the given field to contain a given string:
+
+          <STRONG>o</STRONG>   Buffer 0 is the displayed value of the field.
+
+          <STRONG>o</STRONG>   Other numbered buffers may be allocated by applica-
+              tions   through   the   <STRONG>nbuf</STRONG>   argument   of   (see
+              <STRONG><A HREF="form_field_new.3x.html">form_field_new(3x)</A></STRONG>)  but are not manipulated by the
+              forms library.
+
+       The function <STRONG>field_buffer</STRONG> returns a pointer  to  the  con-
+       tents of the given numbered buffer:
+
+          <STRONG>o</STRONG>   The  buffer  contents  always have the same length,
+              and are padded with trailing spaces  as  needed  to
+              ensure this length is the same.
+
+          <STRONG>o</STRONG>   The buffer may contain leading spaces, depending on
+              how it was set.
+
+          <STRONG>o</STRONG>   The buffer contents are set with  <STRONG>set_field_buffer</STRONG>,
+              or  as  a  side effect of any editing operations on
+              the corresponding field.
+
+          <STRONG>o</STRONG>   Editing operations are based on  the  <EM>window</EM>  which
+              displays the field, rather than a <EM>string</EM>.  The win-
+              dow 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.
+
+          <STRONG>o</STRONG>   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.
 
        The  function  <STRONG>set_field_status</STRONG> sets the associated status
        flag of <EM>field</EM>; <STRONG>field_status</STRONG> gets the current  value.   The
@@ -127,11 +148,11 @@
        The header file <STRONG>&lt;form.h&gt;</STRONG> automatically includes the header
        file
 
-       When  configured for wide-characters, <STRONG>field_buffer</STRONG> returns
+       When  configured for wide characters, <STRONG>field_buffer</STRONG> 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
-       <STRONG>field_buffer</STRONG> to return the same buffer.  <STRONG>&lt;curses.h&gt;</STRONG>.
+       the data.  It will be freed on the next call to <STRONG>field_buf-</STRONG>
+       <STRONG>fer</STRONG> to return the same buffer.  <STRONG>&lt;curses.h&gt;</STRONG>.
 
 
 </PRE>
diff -Naur ncurses-5.7.orig/doc/html/man/form_field_info.3x.html ncurses-5.7/doc/html/man/form_field_info.3x.html
--- ncurses-5.7.orig/doc/html/man/form_field_info.3x.html	2006-12-16 17:51:35.000000000 -0500
+++ ncurses-5.7/doc/html/man/form_field_info.3x.html	2011-01-08 18:13:50.415156784 -0500
@@ -2,7 +2,7 @@
 <!-- 
   * 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            *
@@ -28,7 +28,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: form_field_info.3x,v 1.10 2006/11/04 17:14:31 tom Exp @
+  * @Id: form_field_info.3x,v 1.11 2010/07/31 16:09:36 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -56,21 +56,21 @@
        <STRONG>#include</STRONG> <STRONG>&lt;form.h&gt;</STRONG>
        int field_info(const FIELD *field, int *rows, int *cols,
                      int *frow, int *fcol, int *nrow, int *nbuf);
-       int dynamic_field_info(const FIELD *field, int *rows,  int
+       int  dynamic_field_info(const FIELD *field, int *rows, int
        *cols, int *max);
 
 
 </PRE>
 <H2>DESCRIPTION</H2><PRE>
        The  function  <STRONG>field_info</STRONG>  returns  the  sizes  and  other
-       attributes passed in to the field at  its  creation  time.
-       The  attributes are: height, width, row of upper-left cor-
-       ner, column of upper-left corner, number off-screen  rows,
+       attributes  passed  in  to the field at its creation time.
+       The attributes are: height, width, row of upper-left  cor-
+       ner,  column of upper-left corner, number off-screen rows,
        and number of working buffers.
 
        The function <STRONG>dynamic_field_info</STRONG> returns the actual size of
-       the field, and its maximum possible size.   If  the  field
-       has  no  size  limit,  the location addressed by the third
+       the  field,  and  its maximum possible size.  If the field
+       has no size limit, the location  addressed  by  the  third
        argument will be set to 0.  A field can be made dynamic by
        turning off the <STRONG>O_STATIC</STRONG> option with <STRONG>field_opts_off</STRONG>.
 
@@ -85,7 +85,7 @@
             System error occurred (see <STRONG>errno</STRONG>).
 
        <STRONG>E_BAD_ARGUMENT</STRONG>
-            Routine  detected  an incorrect or out-of-range argu-
+            Routine detected an incorrect or  out-of-range  argu-
             ment.
 
 
@@ -103,17 +103,17 @@
 
 </PRE>
 <H2>PORTABILITY</H2><PRE>
-       These routines emulate the System V forms  library.   They
+       These  routines  emulate the System V forms library.  They
        were not supported on Version 7 or BSD versions.
 
-       A  null  (zero  pointer) is accepted for any of the return
-       values, to ignore that  value.   Not  all  implementations
+       A null (zero pointer) is accepted for any  of  the  return
+       values,  to  ignore  that  value.  Not all implementations
        allow this, e.g., Solaris 2.7 does not.
 
 
 </PRE>
 <H2>AUTHORS</H2><PRE>
-       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
+       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
        curses by Eric S. Raymond.
 
 
diff -Naur ncurses-5.7.orig/doc/html/man/form_field_just.3x.html ncurses-5.7/doc/html/man/form_field_just.3x.html
--- ncurses-5.7.orig/doc/html/man/form_field_just.3x.html	2006-12-16 17:51:35.000000000 -0500
+++ ncurses-5.7/doc/html/man/form_field_just.3x.html	2011-01-08 18:13:50.415156784 -0500
@@ -2,7 +2,7 @@
 <!-- 
   * 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            *
@@ -28,7 +28,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: form_field_just.3x,v 1.9 2006/11/04 17:12:00 tom Exp @
+  * @Id: form_field_just.3x,v 1.10 2010/07/31 16:09:36 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -63,12 +63,12 @@
        The   function   <STRONG>set_field_just</STRONG>   sets  the  justification
        attribute of a field; <STRONG>field_just</STRONG> returns a field's  justi-
        fication attribute.  The attribute may be one of NO_JUSTI-
-       FICATION, JUSTIFY_RIGHT, JUSTIFY_LEFT, or  JUSTIFY_CENTER.
+       FICATION, JUSTIFY_RIGHT, JUSTIFY_LEFT, or JUSTIFY_CENTER.
 
 
 </PRE>
 <H2>RETURN VALUE</H2><PRE>
-       The  function <STRONG>field_just</STRONG> returns one of: NO_JUSTIFICATION,
+       The function <STRONG>field_just</STRONG> returns one of:  NO_JUSTIFICATION,
        JUSTIFY_RIGHT, JUSTIFY_LEFT, or JUSTIFY_CENTER.
 
        The function <STRONG>set_field_just</STRONG> returns one of the following:
@@ -79,7 +79,7 @@
             System error occurred (see <STRONG>errno</STRONG>).
 
        <STRONG>E_BAD_ARGUMENT</STRONG>
-            Routine detected an incorrect or  out-of-range  argu-
+            Routine  detected  an incorrect or out-of-range argu-
             ment.
 
 
@@ -97,13 +97,13 @@
 
 </PRE>
 <H2>PORTABILITY</H2><PRE>
-       These  routines  emulate the System V forms library.  They
+       These routines emulate the System V forms  library.   They
        were not supported on Version 7 or BSD versions.
 
 
 </PRE>
 <H2>AUTHORS</H2><PRE>
-       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
+       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
        curses by Eric S. Raymond.
 
 
diff -Naur ncurses-5.7.orig/doc/html/man/form_field_new.3x.html ncurses-5.7/doc/html/man/form_field_new.3x.html
--- ncurses-5.7.orig/doc/html/man/form_field_new.3x.html	2008-06-21 19:11:44.000000000 -0400
+++ ncurses-5.7/doc/html/man/form_field_new.3x.html	2011-01-08 18:13:50.415156784 -0500
@@ -2,7 +2,7 @@
 <!-- 
   * 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            *
@@ -28,7 +28,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: form_field_new.3x,v 1.16 2007/06/02 20:40:07 tom Exp @
+  * @Id: form_field_new.3x,v 1.17 2010/07/31 16:09:36 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -69,18 +69,18 @@
        upper-left  corner,  column  of  upper-left corner, number
        off-screen rows, and number of additional working buffers.
 
-       The  function  <STRONG>dup_field</STRONG> duplicates a field at a new loca-
-       tion.  Most attributes (including current contents,  size,
-       validation  type, buffer count, growth threshold, justifi-
-       cation, foreground, background,  pad  character,  options,
-       and  user pointer) are copied.  Field status and the field
+       The function <STRONG>dup_field</STRONG> duplicates a field at a  new  loca-
+       tion.   Most attributes (including current contents, size,
+       validation type, buffer count, growth threshold,  justifi-
+       cation,  foreground,  background,  pad character, options,
+       and user pointer) are copied.  Field status and the  field
        page bit are not copied.
 
-       The function <STRONG>link_field</STRONG> acts like <STRONG>dup_field</STRONG>, but  the  new
-       field  shares  buffers with its parent.  Attribute data is
+       The  function  <STRONG>link_field</STRONG> acts like <STRONG>dup_field</STRONG>, but the new
+       field shares buffers with its parent.  Attribute  data  is
        separate.
 
-       The function <STRONG>free_field</STRONG>  de-allocates  storage  associated
+       The  function  <STRONG>free_field</STRONG>  de-allocates storage associated
        with a field.
 
 
@@ -92,7 +92,7 @@
        <STRONG>E_OK</STRONG> The routine succeeded.
 
        <STRONG>E_BAD_ARGUMENT</STRONG>
-            Routine detected an incorrect or  out-of-range  argu-
+            Routine  detected  an incorrect or out-of-range argu-
             ment.
 
        <STRONG>E_SYSTEM_ERROR</STRONG>
@@ -103,7 +103,7 @@
        <STRONG>E_OK</STRONG> The routine succeeded.
 
        <STRONG>E_BAD_ARGUMENT</STRONG>
-            Routine  detected  an incorrect or out-of-range argu-
+            Routine detected an incorrect or  out-of-range  argu-
             ment.
 
        <STRONG>E_CONNECTED</STRONG>
@@ -123,18 +123,18 @@
 
 </PRE>
 <H2>PORTABILITY</H2><PRE>
-       These  routines  emulate the System V forms library.  They
+       These routines emulate the System V forms  library.   They
        were not supported on Version 7 or BSD versions.
 
-       It may be unwise to count on the set of attributes  copied
-       by  <STRONG>dup_field</STRONG>  being  portable; the System V forms library
+       It  may be unwise to count on the set of attributes copied
+       by <STRONG>dup_field</STRONG> being portable; the System  V  forms  library
        documents are not very explicit about what gets copied and
        what does not.
 
 
 </PRE>
 <H2>AUTHORS</H2><PRE>
-       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
+       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
        curses by Eric S. Raymond.
 
 
diff -Naur ncurses-5.7.orig/doc/html/man/form_field_opts.3x.html ncurses-5.7/doc/html/man/form_field_opts.3x.html
--- ncurses-5.7.orig/doc/html/man/form_field_opts.3x.html	2007-03-03 19:10:46.000000000 -0500
+++ ncurses-5.7/doc/html/man/form_field_opts.3x.html	2011-01-08 18:13:50.415156784 -0500
@@ -2,7 +2,7 @@
 <!-- 
   * 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            *
@@ -28,7 +28,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: form_field_opts.3x,v 1.13 2007/02/24 17:34:27 tom Exp @
+  * @Id: form_field_opts.3x,v 1.15 2010/07/31 14:49:44 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -78,17 +78,17 @@
        The following options are defined (all are on by default):
 
        O_VISIBLE
-            The  field is displayed.  If this option is off, dis-
+            The field is displayed.  If this option is off,  dis-
             play of the field is suppressed.
 
        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
+            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.
 
        O_PUBLIC
-            The  field contents are displayed as data is entered.
+            The field contents are displayed as data is entered.
 
        O_EDIT
             The field can be edited.
@@ -138,8 +138,10 @@
        <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="form.3x.html">form(3x)</A></STRONG>.
 
 
-       <STRONG>NOTES</STRONG>  The header file <STRONG>&lt;form.h&gt;</STRONG> automatically includes the
-              header file <STRONG>&lt;curses.h&gt;</STRONG>.
+</PRE>
+<H2>NOTES</H2><PRE>
+       The header file <STRONG>&lt;form.h&gt;</STRONG> automatically includes the header
+       file <STRONG>&lt;curses.h&gt;</STRONG>.
 
 
 </PRE>
diff -Naur ncurses-5.7.orig/doc/html/man/form_field_userptr.3x.html ncurses-5.7/doc/html/man/form_field_userptr.3x.html
--- ncurses-5.7.orig/doc/html/man/form_field_userptr.3x.html	2006-12-16 17:51:36.000000000 -0500
+++ ncurses-5.7/doc/html/man/form_field_userptr.3x.html	2011-01-08 18:13:50.415156784 -0500
@@ -2,7 +2,7 @@
 <!-- 
   * 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            *
@@ -28,7 +28,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: form_field_userptr.3x,v 1.8 2006/11/04 18:04:37 tom Exp @
+  * @Id: form_field_userptr.3x,v 1.9 2010/07/31 16:09:36 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -87,7 +87,7 @@
 
 </PRE>
 <H2>PORTABILITY</H2><PRE>
-       These  routines  emulate the System V forms library.  They
+       These routines emulate the System V forms  library.   They
        were not supported on Version 7 or BSD versions.
 
        The user pointer is a void pointer.  We chose not to leave
@@ -96,7 +96,7 @@
 
 </PRE>
 <H2>AUTHORS</H2><PRE>
-       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
+       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
        curses by Eric S. Raymond.
 
 
diff -Naur ncurses-5.7.orig/doc/html/man/form_field_validation.3x.html ncurses-5.7/doc/html/man/form_field_validation.3x.html
--- ncurses-5.7.orig/doc/html/man/form_field_validation.3x.html	2006-12-24 12:02:44.000000000 -0500
+++ ncurses-5.7/doc/html/man/form_field_validation.3x.html	2011-01-08 18:18:29.354656643 -0500
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 <!-- 
   ****************************************************************************
-  * 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,7 +27,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: form_field_validation.3x,v 1.16 2006/12/24 16:08:08 tom Exp @
+  * @Id: form_field_validation.3x,v 1.19 2010/10/02 23:39:08 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -88,70 +88,69 @@
             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.
+            notice that the string list is copied. So you may use
+            a  list  that  lives  in  automatic  variables on the
+            stack.
 
        TYPE_INTEGER
-            Integer  data,  parsable  to  an  integer by <STRONG>atoi(3)</STRONG>.
-            Requires a third <STRONG>int</STRONG> argument controlling the  preci-
-            sion,  a  fourth  <STRONG>long</STRONG>  argument constraining minimum
-            value, and a fifth <STRONG>long</STRONG> constraining  maximum  value.
-            If  the  maximum  value  is less than or equal to the
+            Integer data, parsable  to  an  integer  by  <STRONG>atoi(3)</STRONG>.
+            Requires  a third <STRONG>int</STRONG> argument controlling the preci-
+            sion, a fourth  <STRONG>long</STRONG>  argument  constraining  minimum
+            value,  and  a fifth <STRONG>long</STRONG> constraining maximum value.
+            If the maximum value is less than  or  equal  to  the
             minimum value, the range is simply ignored. On return
             the field buffer is formatted according to the <STRONG>printf</STRONG>
-            format  specification  ".*ld",  where  the   '*'   is
-            replaced  by  the precision argument.  For details of
+            format   specification   ".*ld",  where  the  '*'  is
+            replaced by the precision argument.  For  details  of
             the precision handling see <STRONG>printf's</STRONG> man-page.
 
        TYPE_NUMERIC
-            Numeric  data  (may  have  a   decimal-point   part).
-            Requires  a third <STRONG>int</STRONG> argument controlling the preci-
-            sion, a fourth <STRONG>double</STRONG> argument  constraining  minimum
+            Numeric   data   (may  have  a  decimal-point  part).
+            Requires a third <STRONG>int</STRONG> argument controlling the  preci-
+            sion,  a  fourth <STRONG>double</STRONG> argument constraining minimum
             value, and a fifth <STRONG>double</STRONG> constraining maximum value.
-            If your system supports locales,  the  decimal  point
-            character  to  be  used  must be the one specified by
-            your locale.  If the maximum value is  less  than  or
-            equal  to  the  minimum  value,  the  range is simply
-            ignored. On return  the  field  buffer  is  formatted
-            according  to  the <STRONG>printf</STRONG> format specification ".*f",
-            where the '*' is replaced by the precision  argument.
-            For  details  of  the precision handling see <STRONG>printf's</STRONG>
+            If  your  system  supports locales, the decimal point
+            character to be used must be  the  one  specified  by
+            your  locale.   If  the maximum value is less than or
+            equal to the  minimum  value,  the  range  is  simply
+            ignored.  On  return  the  field  buffer is formatted
+            according to the <STRONG>printf</STRONG> format  specification  ".*f",
+            where  the '*' is replaced by the precision argument.
+            For details of the precision  handling  see  <STRONG>printf's</STRONG>
             man-page.
 
        TYPE_REGEXP
-            Regular expression data.  Requires a regular  expres-
-            sion  <STRONG>(char</STRONG>  <STRONG>*)</STRONG>  third argument; the data is valid if
-            the regular expression matches it.   Regular  expres-
-            sions  are  in  the  format  of  <STRONG>regcomp</STRONG> and <STRONG>regexec</STRONG>.
-            Please notice that the regular expression must  match
-            the  whole  field.  If  you have for example an eight
+            Regular  expression data.  Requires a regular expres-
+            sion <STRONG>(char</STRONG> <STRONG>*)</STRONG> third argument; the data  is  valid  if
+            the  regular  expression matches it.  Regular expres-
+            sions are in  the  format  of  <STRONG>regcomp</STRONG>  and  <STRONG>regexec</STRONG>.
+            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  means  that  you have to fill all eight posi-
+            always means that you have to fill  all  eight  posi-
             tions 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 leading and trailing
+            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.
 
        TYPE_IPV4
             An Internet Protocol Version 4 address. This requires
-            no  additional argument. It is checked whether or not
-            the buffer has the form a.b.c.d, where  a,b,c  and  d
+            no additional argument. It is checked whether or  not
+            the  buffer  has  the form a.b.c.d, where a,b,c and d
             are numbers between 0 and 255. Trailing blanks in the
-            buffer are ignored. The address itself is  not  vali-
+            buffer  are  ignored. The address itself is not vali-
             dated. Please note that this is an ncurses extension.
-            This field type may not be available in other  curses
+            This  field type may not be available in other curses
             implementations.
 
-       It  is  possible  to  set  up new programmer-defined field
+       It is possible to  set  up  new  programmer-defined  field
        types.  See the <STRONG><A HREF="form_fieldtype.3x.html">form_fieldtype(3x)</A></STRONG> manual page.
 
 
 </PRE>
 <H2>RETURN VALUE</H2><PRE>
-       The functions <STRONG>field_type</STRONG>  and  <STRONG>field_arg</STRONG>  return  <STRONG>NULL</STRONG>  on
+       The  functions  <STRONG>field_type</STRONG>  and  <STRONG>field_arg</STRONG>  return <STRONG>NULL</STRONG> on
        error. The function <STRONG>set_field_type</STRONG> returns one of the fol-
        lowing:
 
@@ -163,7 +162,7 @@
 
 </PRE>
 <H2>SEE ALSO</H2><PRE>
-       <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="form.3x.html">form(3x)</A></STRONG>.
+       <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="form.3x.html">form(3x)</A></STRONG>, <STRONG><A HREF="form_variables.3x.html">form_variables(3x)</A></STRONG>.
 
 
 </PRE>
@@ -174,13 +173,13 @@
 
 </PRE>
 <H2>PORTABILITY</H2><PRE>
-       These  routines  emulate the System V forms library.  They
+       These routines emulate the System V forms  library.   They
        were not supported on Version 7 or BSD versions.
 
 
 </PRE>
 <H2>AUTHORS</H2><PRE>
-       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
+       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
        curses by Eric S. Raymond.
 
 
diff -Naur ncurses-5.7.orig/doc/html/man/form_fieldtype.3x.html ncurses-5.7/doc/html/man/form_fieldtype.3x.html
--- ncurses-5.7.orig/doc/html/man/form_fieldtype.3x.html	2006-12-16 17:51:36.000000000 -0500
+++ ncurses-5.7/doc/html/man/form_fieldtype.3x.html	2011-01-08 18:13:50.415156784 -0500
@@ -2,7 +2,7 @@
 <!-- 
   * 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            *
@@ -28,7 +28,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: form_fieldtype.3x,v 1.14 2006/11/04 17:12:00 tom Exp @
+  * @Id: form_fieldtype.3x,v 1.15 2010/07/31 16:10:55 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -112,8 +112,8 @@
        <STRONG>REQ_PREV_CHOICE</STRONG> assume that the possible values of a field
        form an ordered set, and provide the forms user with a way
        to  move  through the set.  The <STRONG>set_fieldtype_choice</STRONG> func-
-       tion allows forms  programmers  to  define  successor  and
-       predecessor functions for the field type.  These functions
+       tion allows forms programmers to define successor and pre-
+       decessor  functions  for  the field type.  These functions
        take the field pointer and an argument-block structure  as
        arguments.
 
diff -Naur ncurses-5.7.orig/doc/html/man/form_hook.3x.html ncurses-5.7/doc/html/man/form_hook.3x.html
--- ncurses-5.7.orig/doc/html/man/form_hook.3x.html	2007-03-03 19:10:46.000000000 -0500
+++ ncurses-5.7/doc/html/man/form_hook.3x.html	2011-01-08 18:13:50.419157335 -0500
@@ -2,7 +2,7 @@
 <!-- 
   * 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            *
@@ -28,7 +28,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: form_hook.3x,v 1.9 2007/02/24 17:34:18 tom Exp @
+  * @Id: form_hook.3x,v 1.10 2010/07/31 16:08:48 tom Exp @
 -->
 <HTML>
 <HEAD>
diff -Naur ncurses-5.7.orig/doc/html/man/form_new.3x.html ncurses-5.7/doc/html/man/form_new.3x.html
--- ncurses-5.7.orig/doc/html/man/form_new.3x.html	2006-12-16 17:51:37.000000000 -0500
+++ ncurses-5.7/doc/html/man/form_new.3x.html	2011-01-08 18:13:50.419157335 -0500
@@ -2,7 +2,7 @@
 <!-- 
   * 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            *
@@ -28,7 +28,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: form_new.3x,v 1.7 2006/11/04 17:12:00 tom Exp @
+  * @Id: form_new.3x,v 1.8 2010/07/31 16:08:48 tom Exp @
 -->
 <HTML>
 <HEAD>
diff -Naur ncurses-5.7.orig/doc/html/man/form_new_page.3x.html ncurses-5.7/doc/html/man/form_new_page.3x.html
--- ncurses-5.7.orig/doc/html/man/form_new_page.3x.html	2006-12-16 17:51:37.000000000 -0500
+++ ncurses-5.7/doc/html/man/form_new_page.3x.html	2011-01-08 18:13:50.419157335 -0500
@@ -2,7 +2,7 @@
 <!-- 
   * 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            *
@@ -28,7 +28,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: form_new_page.3x,v 1.8 2006/11/04 17:12:00 tom Exp @
+  * @Id: form_new_page.3x,v 1.9 2010/07/31 16:08:48 tom Exp @
 -->
 <HTML>
 <HEAD>
diff -Naur ncurses-5.7.orig/doc/html/man/form_opts.3x.html ncurses-5.7/doc/html/man/form_opts.3x.html
--- ncurses-5.7.orig/doc/html/man/form_opts.3x.html	2007-03-03 19:10:47.000000000 -0500
+++ ncurses-5.7/doc/html/man/form_opts.3x.html	2011-01-08 18:13:50.419157335 -0500
@@ -2,7 +2,7 @@
 <!-- 
   * 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            *
@@ -28,7 +28,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: form_opts.3x,v 1.9 2007/02/24 17:34:36 tom Exp @
+  * @Id: form_opts.3x,v 1.10 2010/07/31 16:08:48 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -78,13 +78,13 @@
        The following options are defined (all are on by default):
 
        O_NL_OVERLOAD
-            Overload  the  <STRONG>REQ_NEW_LINE</STRONG>  forms  driver request so
-            that calling it at the end of a  field  goes  to  the
+            Overload the <STRONG>REQ_NEW_LINE</STRONG>  forms  driver  request  so
+            that  calling  it  at  the end of a field goes to the
             next field.
 
        O_BS_OVERLOAD
-            Overload  the  <STRONG>REQ_DEL_PREV</STRONG>  forms  driver request so
-            that calling it at the beginning of a field  goes  to
+            Overload the <STRONG>REQ_DEL_PREV</STRONG>  forms  driver  request  so
+            that  calling  it at the beginning of a field goes to
             the previous field.
 
 
@@ -112,13 +112,13 @@
 
 </PRE>
 <H2>PORTABILITY</H2><PRE>
-       These  routines  emulate the System V forms library.  They
+       These routines emulate the System V forms  library.   They
        were not supported on Version 7 or BSD versions.
 
 
 </PRE>
 <H2>AUTHORS</H2><PRE>
-       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
+       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
        curses by Eric S. Raymond.
 
 
diff -Naur ncurses-5.7.orig/doc/html/man/form_page.3x.html ncurses-5.7/doc/html/man/form_page.3x.html
--- ncurses-5.7.orig/doc/html/man/form_page.3x.html	2006-12-16 17:51:37.000000000 -0500
+++ ncurses-5.7/doc/html/man/form_page.3x.html	2011-01-08 18:13:50.419157335 -0500
@@ -2,7 +2,7 @@
 <!-- 
   * 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            *
@@ -28,7 +28,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: form_page.3x,v 1.10 2006/11/04 18:52:32 tom Exp @
+  * @Id: form_page.3x,v 1.11 2010/07/31 16:08:48 tom Exp @
 -->
 <HTML>
 <HEAD>
diff -Naur ncurses-5.7.orig/doc/html/man/form_post.3x.html ncurses-5.7/doc/html/man/form_post.3x.html
--- ncurses-5.7.orig/doc/html/man/form_post.3x.html	2006-12-16 17:51:37.000000000 -0500
+++ ncurses-5.7/doc/html/man/form_post.3x.html	2011-01-08 18:13:50.419157335 -0500
@@ -2,7 +2,7 @@
 <!-- 
   * 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            *
@@ -28,7 +28,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: form_post.3x,v 1.7 2006/11/04 18:53:20 tom Exp @
+  * @Id: form_post.3x,v 1.8 2010/07/31 16:08:48 tom Exp @
 -->
 <HTML>
 <HEAD>
diff -Naur ncurses-5.7.orig/doc/html/man/form_requestname.3x.html ncurses-5.7/doc/html/man/form_requestname.3x.html
--- ncurses-5.7.orig/doc/html/man/form_requestname.3x.html	2006-12-16 17:51:38.000000000 -0500
+++ ncurses-5.7/doc/html/man/form_requestname.3x.html	2011-01-08 18:13:50.419157335 -0500
@@ -2,7 +2,7 @@
 <!-- 
   * 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            *
@@ -28,7 +28,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: form_requestname.3x,v 1.7 2006/11/04 17:57:49 tom Exp @
+  * @Id: form_requestname.3x,v 1.8 2010/07/31 16:08:48 tom Exp @
 -->
 <HTML>
 <HEAD>
diff -Naur ncurses-5.7.orig/doc/html/man/form_userptr.3x.html ncurses-5.7/doc/html/man/form_userptr.3x.html
--- ncurses-5.7.orig/doc/html/man/form_userptr.3x.html	2006-12-16 17:51:38.000000000 -0500
+++ ncurses-5.7/doc/html/man/form_userptr.3x.html	2011-01-08 18:13:50.419157335 -0500
@@ -2,7 +2,7 @@
 <!-- 
   * 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            *
@@ -28,7 +28,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: form_userptr.3x,v 1.11 2006/11/04 18:43:24 tom Exp @
+  * @Id: form_userptr.3x,v 1.12 2010/07/31 16:08:48 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -60,7 +60,7 @@
 
 </PRE>
 <H2>DESCRIPTION</H2><PRE>
-       Every form and every form item has a  field  that  can  be
+       Every  form  and  every  form item has a field that can be
        used to hold application-specific data (that is, the form-
        driver code leaves it alone).  These functions get and set
        the form user pointer field.
@@ -68,7 +68,7 @@
 
 </PRE>
 <H2>RETURN VALUE</H2><PRE>
-       The  function <STRONG>form_userptr</STRONG> returns a pointer (which may be
+       The function <STRONG>form_userptr</STRONG> returns a pointer (which may  be
        <STRONG>NULL</STRONG>).  It does not set errno.
 
        The function <STRONG>set_form_userptr</STRONG> returns <STRONG>E_OK</STRONG> (success).
@@ -87,7 +87,7 @@
 
 </PRE>
 <H2>PORTABILITY</H2><PRE>
-       These  routines  emulate the System V forms library.  They
+       These routines emulate the System V forms  library.   They
        were not supported on Version 7 or BSD versions.
 
        The user pointer is a void pointer.  We chose not to leave
@@ -96,7 +96,7 @@
 
 </PRE>
 <H2>AUTHORS</H2><PRE>
-       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
+       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
        curses by Eric S. Raymond.
 
 
diff -Naur ncurses-5.7.orig/doc/html/man/form_variables.3x.html ncurses-5.7/doc/html/man/form_variables.3x.html
--- ncurses-5.7.orig/doc/html/man/form_variables.3x.html	1969-12-31 19:00:00.000000000 -0500
+++ ncurses-5.7/doc/html/man/form_variables.3x.html	2011-01-08 18:18:29.354656643 -0500
@@ -0,0 +1,118 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
+<!-- 
+  ****************************************************************************
+  * 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: form_variables.3x,v 1.2 2010/10/02 23:45:15 Sven.Joachim Exp @
+-->
+<HTML>
+<HEAD>
+<TITLE>form_variables 3x</TITLE>
+<link rev=made href="mailto:bug-ncurses@gnu.org">
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+</HEAD>
+<BODY>
+<H1>form_variables 3x</H1>
+<HR>
+<PRE>
+<!-- Manpage converted by man2html 3.0.1 -->
+<STRONG><A HREF="form_variables.3x.html">form_variables(3x)</A></STRONG>                                   <STRONG><A HREF="form_variables.3x.html">form_variables(3x)</A></STRONG>
+
+
+
+
+</PRE>
+<H2>NAME</H2><PRE>
+       <STRONG>TYPE_ALNUM</STRONG>, <STRONG>TYPE_ALPHA</STRONG>, <STRONG>TYPE_ENUM</STRONG>, <STRONG>TYPE_INTEGER</STRONG>,
+       <STRONG>TYPE_IPV4</STRONG>, <STRONG>TYPE_NUMERIC</STRONG>, <STRONG>TYPE_REGEXP</STRONG> - form system global
+       variables
+
+
+</PRE>
+<H2>SYNOPSIS</H2><PRE>
+       <STRONG>#include</STRONG> <STRONG>&lt;form.h&gt;</STRONG>
+
+       <STRONG>FIELDTYPE</STRONG> <STRONG>*</STRONG> <STRONG>TYPE_ALNUM;</STRONG>
+       <STRONG>FIELDTYPE</STRONG> <STRONG>*</STRONG> <STRONG>TYPE_ALPHA;</STRONG>
+       <STRONG>FIELDTYPE</STRONG> <STRONG>*</STRONG> <STRONG>TYPE_ENUM;</STRONG>
+       <STRONG>FIELDTYPE</STRONG> <STRONG>*</STRONG> <STRONG>TYPE_INTEGER;</STRONG>
+       <STRONG>FIELDTYPE</STRONG> <STRONG>*</STRONG> <STRONG>TYPE_IPV4;</STRONG>
+       <STRONG>FIELDTYPE</STRONG> <STRONG>*</STRONG> <STRONG>TYPE_NUMERIC;</STRONG>
+       <STRONG>FIELDTYPE</STRONG> <STRONG>*</STRONG> <STRONG>TYPE_REGEXP;</STRONG>
+
+
+</PRE>
+<H2>DESCRIPTION</H2><PRE>
+       These  are  building blocks for the form library, defining
+       fields that can be created using <STRONG><A HREF="set_fieldtype.3x.html">set_fieldtype(3x)</A></STRONG>.   Each
+       provides  functions  for  field- and character-validation,
+       according to the given datatype.
+
+   <STRONG>TYPE_ALNUM</STRONG>
+       This holds alphanumeric data.
+
+   <STRONG>TYPE_ALPHA</STRONG>
+       This holds alphabetic data.
+
+   <STRONG>TYPE_ENUM</STRONG>
+       This holds an enumerated type.
+
+   <STRONG>TYPE_INTEGER</STRONG>
+       This holds a decimal integer.
+
+   <STRONG>TYPE_IPV4</STRONG>
+       This holds an IPv4 internet address, e.g., "127.0.0.1".
+
+   <STRONG>TYPE_NUMERIC</STRONG>
+       This holds a decimal number, with optional sign and  deci-
+       mal point.
+
+   <STRONG>TYPE_REGEXP</STRONG>
+       This holds a regular expression.
+
+
+</PRE>
+<H2>PORTABILITY</H2><PRE>
+       The  <STRONG>TYPE_IPV4</STRONG>  variable  is  an extension not provided by
+       older implementations of the form library.
+
+
+</PRE>
+<H2>SEE ALSO</H2><PRE>
+       <STRONG><A HREF="form.3x.html">form(3x)</A></STRONG>.
+
+
+
+                                                     <STRONG><A HREF="form_variables.3x.html">form_variables(3x)</A></STRONG>
+</PRE>
+<HR>
+<ADDRESS>
+Man(1) output converted with
+<a href="http://www.oac.uci.edu/indiv/ehood/man2html.html">man2html</a>
+</ADDRESS>
+</BODY>
+</HTML>
diff -Naur ncurses-5.7.orig/doc/html/man/form_win.3x.html ncurses-5.7/doc/html/man/form_win.3x.html
--- ncurses-5.7.orig/doc/html/man/form_win.3x.html	2006-12-16 17:51:38.000000000 -0500
+++ ncurses-5.7/doc/html/man/form_win.3x.html	2011-01-08 18:18:29.354656643 -0500
@@ -2,7 +2,7 @@
 <!-- 
   * 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            *
@@ -28,7 +28,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: form_win.3x,v 1.10 2006/11/04 17:12:00 tom Exp @
+  * @Id: form_win.3x,v 1.12 2010/10/02 23:22:03 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -64,28 +64,28 @@
 
 </PRE>
 <H2>DESCRIPTION</H2><PRE>
-       Every  form has an associated pair of <STRONG>curses</STRONG> windows.  The
-       form window displays any title and border associated  with
-       the  window;  the form subwindow displays the items of the
+       Every form has an associated pair of <STRONG>curses</STRONG> windows.   The
+       form  window displays any title and border associated with
+       the window; the form subwindow displays the items  of  the
        form that are currently available for selection.
 
        The first four functions get and set those windows.  It is
        not necessary to set either window; by default, the driver
        code uses <STRONG>stdscr</STRONG> for both.
 
-       In the <STRONG>set_</STRONG> functions, window argument of <STRONG>NULL</STRONG> is  treated
-       as  though  it  were  <STRONG>stsdcr</STRONG>.   A form argument of <STRONG>NULL</STRONG> is
-       treated as a request to change  the  system  default  form
+       In  the <STRONG>set_</STRONG> functions, window argument of <STRONG>NULL</STRONG> is treated
+       as though it were <STRONG>stsdcr</STRONG>.  A  form  argument  of  <STRONG>NULL</STRONG>  is
+       treated  as  a  request  to change the system default form
        window or subwindow.
 
-       The  function <STRONG>scale_form</STRONG> returns the minimum size required
+       The function <STRONG>scale_form</STRONG> returns the minimum size  required
        for the subwindow of <EM>form</EM>.
 
 
 </PRE>
 <H2>RETURN VALUE</H2><PRE>
-       Routines that return pointers return <STRONG>NULL</STRONG> on error.   Rou-
-       tines  that  return an integer return one of the following
+       Routines  that return pointers return <STRONG>NULL</STRONG> on error.  Rou-
+       tines that return an integer return one of  the  following
        error codes:
 
        <STRONG>E_OK</STRONG> The routine succeeded.
@@ -94,7 +94,7 @@
             System error occurred (see <STRONG>errno</STRONG>).
 
        <STRONG>E_BAD_ARGUMENT</STRONG>
-            Routine detected an incorrect or  out-of-range  argu-
+            Routine  detected  an incorrect or out-of-range argu-
             ment.
 
        <STRONG>E_POSTED</STRONG>
@@ -106,7 +106,7 @@
 
 </PRE>
 <H2>SEE ALSO</H2><PRE>
-       <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="form.3x.html">form(3x)</A></STRONG>.
+       <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_variables.3x.html">curs_variables(3x)</A></STRONG>, <STRONG><A HREF="form.3x.html">form(3x)</A></STRONG>.
 
 
 </PRE>
@@ -117,13 +117,13 @@
 
 </PRE>
 <H2>PORTABILITY</H2><PRE>
-       These routines emulate the System V forms  library.   They
+       These  routines  emulate the System V forms library.  They
        were not supported on Version 7 or BSD versions.
 
 
 </PRE>
 <H2>AUTHORS</H2><PRE>
-       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
+       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
        curses by Eric S. Raymond.
 
 
diff -Naur ncurses-5.7.orig/doc/html/man/index.html ncurses-5.7/doc/html/man/index.html
--- ncurses-5.7.orig/doc/html/man/index.html	2006-12-24 18:05:35.000000000 -0500
+++ ncurses-5.7/doc/html/man/index.html	2011-01-08 18:13:50.419157335 -0500
@@ -1,8 +1,8 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.0//EN">
 <!--
-  $Id: index.html,v 1.3 2006/12/24 23:05:35 tom Exp $
+  $Id: index.html,v 1.4 2010/01/09 20:36:50 tom Exp $
   ****************************************************************************
-  * 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            *
@@ -31,7 +31,7 @@
   -->
 <HTML>
 <HEAD>
-<TITLE>NCURSES - Manual Pages</TITLE>
+<TITLE>NCURSES &ndash; Manual Pages</TITLE>
 <LINK REV=MADE HREF="mailto:dickey@invisible-island.net">
 </HEAD>
 <BODY>
@@ -39,27 +39,28 @@
 <ul>
 <li>Programs:
 <ul>
-<li><a href = "captoinfo.1m.html">captoinfo - convert a termcap description into a terminfo description</a>
-<li><a href = "clear.1.html">clear - clear the terminal screen</a>
-<li><a href = "infocmp.1m.html">infocmp - compare or print out terminfo descriptions</a>
-<li><a href = "infotocap.1m.html">infotocap - convert a terminfo description into a termcap description</a>
-<li><a href = "tic.1m.html">tic - the terminfo entry-description compiler</a>
-<li><a href = "toe.1m.html">toe - table of (terminfo) entries</a>
-<li><a href = "tput.1.html">tput -  initialize  a  terminal or query terminfo database</a>
-<li><a href = "tset.1.html">tset - terminal initialization</a>
+<li><a href = "captoinfo.1m.html">captoinfo &ndash; convert a termcap description into a terminfo description</a>
+<li><a href = "clear.1.html">clear &ndash; clear the terminal screen</a>
+<li><a href = "infocmp.1m.html">infocmp &ndash; compare or print out terminfo descriptions</a>
+<li><a href = "infotocap.1m.html">infotocap &ndash; convert a terminfo description into a termcap description</a>
+<li><a href = "tabs.1.html">tabs &ndash; set tabs on a terminal</a>
+<li><a href = "tic.1m.html">tic &ndash; the terminfo entry-description compiler</a>
+<li><a href = "toe.1m.html">toe &ndash; table of (terminfo) entries</a>
+<li><a href = "tput.1.html">tput &ndash; initialize a terminal or query terminfo database</a>
+<li><a href = "tset.1.html">tset &ndash; terminal initialization</a>
 </ul>
 <li>Libraries:
 <ul>
-<li><a href = "ncurses.3x.html">ncurses - CRT screen handling and optimization package</a>
+<li><a href = "ncurses.3x.html">ncurses &ndash; CRT screen handling and optimization package</a>
 <li><a href = "panel.3x.html">panel- panel stack extension for curses</a>
-<li><a href = "form.3x.html">form - curses extension for programming forms</a>
-<li><a href = "menu.3x.html">menu - curses extension for programming menus</a>
+<li><a href = "form.3x.html">form &ndash; curses extension for programming forms</a>
+<li><a href = "menu.3x.html">menu &ndash; curses extension for programming menus</a>
 </ul>
 <li>File formats:
 <ul>
-<li><a href = "terminfo.5.html">terminfo - terminal capability data base</a>
-<li><a href = "term.5.html">term - format of compiled term file.</a>
-<li><a href = "term.7.html">term - conventions for naming terminal types</a>
+<li><a href = "terminfo.5.html">terminfo &ndash; terminal capability data base</a>
+<li><a href = "term.5.html">term &ndash; format of compiled term file.</a>
+<li><a href = "term.7.html">term &ndash; conventions for naming terminal types</a>
 </ul>
 </ul>
 </BODY>
diff -Naur ncurses-5.7.orig/doc/html/man/infocmp.1m.html ncurses-5.7/doc/html/man/infocmp.1m.html
--- ncurses-5.7.orig/doc/html/man/infocmp.1m.html	2008-10-11 17:34:12.000000000 -0400
+++ ncurses-5.7/doc/html/man/infocmp.1m.html	2011-01-08 18:18:29.354656643 -0500
@@ -2,7 +2,7 @@
 <!-- 
   * t
   ****************************************************************************
-  * Copyright (c) 1998-2004,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 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: infocmp.1m,v 1.44 2006/12/24 18:16:31 tom Exp @
+  * @Id: infocmp.1m,v 1.45 2010/07/31 16:09:36 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -72,35 +72,35 @@
    <STRONG>Default</STRONG> <STRONG>Options</STRONG>
        If  no options are specified and zero or one <EM>termnames</EM> are
        specified, the <STRONG>-I</STRONG> option will be assumed.   If  more  than
-       one  <EM>termname</EM> is specified, the <STRONG>-d</STRONG> option will be assumed.
+       one <EM>termname</EM> is specified, the <STRONG>-d</STRONG> option will be assumed.
 
    <STRONG>Comparison</STRONG> <STRONG>Options</STRONG> <STRONG>[-d]</STRONG> <STRONG>[-c]</STRONG> <STRONG>[-n]</STRONG>
-       <STRONG>infocmp</STRONG> compares the <STRONG>terminfo</STRONG>  description  of  the  first
-       terminal  <EM>termname</EM>  with each of the descriptions given by
-       the entries for the  other  terminal's  <EM>termnames</EM>.   If  a
-       capability  is  defined for only one of the terminals, the
-       value returned will depend on the type of the  capability:
-       <STRONG>F</STRONG>  for  boolean  variables,  <STRONG>-1</STRONG> for integer variables, and
+       <STRONG>infocmp</STRONG>  compares  the  <STRONG>terminfo</STRONG>  description of the first
+       terminal <EM>termname</EM> with each of the descriptions  given  by
+       the  entries  for  the  other  terminal's <EM>termnames</EM>.  If a
+       capability is defined for only one of the  terminals,  the
+       value  returned will depend on the type of the capability:
+       <STRONG>F</STRONG> for boolean variables, <STRONG>-1</STRONG>  for  integer  variables,  and
        <STRONG>NULL</STRONG> for string variables.
 
-       The <STRONG>-d</STRONG> option produces a list of each capability  that  is
-       different  between  two entries.  This option is useful to
-       show the difference between two entries, created  by  dif-
+       The  <STRONG>-d</STRONG>  option produces a list of each capability that is
+       different between two entries.  This option is  useful  to
+       show  the  difference between two entries, created by dif-
        ferent people, for the same or similar terminals.
 
-       The  <STRONG>-c</STRONG>  option produces a list of each capability that is
+       The <STRONG>-c</STRONG> 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
+       are ignored.  This option can be used as a quick check  to
        see if the <STRONG>-u</STRONG> option is worth using.
 
-       The <STRONG>-n</STRONG> option produces a list of each capability  that  is
+       The  <STRONG>-n</STRONG>  option produces a list of each capability that is
        in neither entry.  If no <EM>termnames</EM> are given, the environ-
        ment variable <STRONG>TERM</STRONG> will be used for both of the <EM>termnames</EM>.
-       This  can  be used as a quick check to see if anything was
+       This can be used as a quick check to see if  anything  was
        left out of a description.
 
    <STRONG>Source</STRONG> <STRONG>Listing</STRONG> <STRONG>Options</STRONG> <STRONG>[-I]</STRONG> <STRONG>[-L]</STRONG> <STRONG>[-C]</STRONG> <STRONG>[-r]</STRONG>
-       The <STRONG>-I</STRONG>, <STRONG>-L</STRONG>, and <STRONG>-C</STRONG> options will produce a  source  listing
+       The  <STRONG>-I</STRONG>,  <STRONG>-L</STRONG>, and <STRONG>-C</STRONG> options will produce a source listing
        for each terminal named.
 
       <STRONG>-I</STRONG>   use the <STRONG>terminfo</STRONG> names
@@ -108,40 +108,40 @@
       <STRONG>-C</STRONG>   use the <STRONG>termcap</STRONG> names
       <STRONG>-r</STRONG>   when using <STRONG>-C</STRONG>, put out all capabilities in <STRONG>termcap</STRONG> form
 
-       If  no  <EM>termnames</EM> are given, the environment variable <STRONG>TERM</STRONG>
+       If no <EM>termnames</EM> are given, the environment  variable  <STRONG>TERM</STRONG>
        will be used for the terminal name.
 
-       The source produced by the <STRONG>-C</STRONG> option may be used  directly
-       as  a <STRONG>termcap</STRONG> entry, but not all parameterized strings can
+       The  source produced by the <STRONG>-C</STRONG> option may be used directly
+       as a <STRONG>termcap</STRONG> entry, but not all parameterized strings  can
        be changed to the <STRONG>termcap</STRONG> format.  <STRONG>infocmp</STRONG> will attempt to
-       convert  most  of  the parameterized information, and any-
-       thing not converted will be plainly marked in  the  output
+       convert most of the parameterized  information,  and  any-
+       thing  not  converted will be plainly marked in the output
        and commented out.  These should be edited by hand.
 
-       All  padding  information  for  strings  will be collected
-       together and placed at the beginning of the  string  where
-       <STRONG>termcap</STRONG>  expects  it.  Mandatory padding (padding informa-
+       All padding information  for  strings  will  be  collected
+       together  and  placed at the beginning of the string where
+       <STRONG>termcap</STRONG> expects it.  Mandatory padding  (padding  informa-
        tion with a trailing '/') will become optional.
 
        All <STRONG>termcap</STRONG> variables no longer supported by <STRONG>terminfo</STRONG>, but
        which are derivable from other <STRONG>terminfo</STRONG> variables, will be
        output.  Not all <STRONG>terminfo</STRONG> capabilities will be translated;
-       only  those variables which were part of <STRONG>termcap</STRONG> will nor-
-       mally be output.  Specifying the <STRONG>-r</STRONG> option will  take  off
-       this  restriction,  allowing all capabilities to be output
+       only those variables which were part of <STRONG>termcap</STRONG> will  nor-
+       mally  be  output.  Specifying the <STRONG>-r</STRONG> option will take off
+       this restriction, allowing all capabilities to  be  output
        in <EM>termcap</EM> form.
 
        Note that because padding is collected to the beginning of
-       the  capability,  not all capabilities are output.  Manda-
-       tory padding is not supported.   Because  <STRONG>termcap</STRONG>  strings
-       are  not as flexible, it is not always possible to convert
-       a <STRONG>terminfo</STRONG> string capability into  an  equivalent  <STRONG>termcap</STRONG>
-       format.   A subsequent conversion of the <STRONG>termcap</STRONG> file back
-       into <STRONG>terminfo</STRONG> format will not  necessarily  reproduce  the
+       the capability, not all capabilities are  output.   Manda-
+       tory  padding  is  not supported.  Because <STRONG>termcap</STRONG> strings
+       are not as flexible, it is not always possible to  convert
+       a  <STRONG>terminfo</STRONG>  string  capability into an equivalent <STRONG>termcap</STRONG>
+       format.  A subsequent conversion of the <STRONG>termcap</STRONG> file  back
+       into  <STRONG>terminfo</STRONG>  format  will not necessarily reproduce the
        original <STRONG>terminfo</STRONG> source.
 
-       Some  common  <STRONG>terminfo</STRONG>  parameter sequences, their <STRONG>termcap</STRONG>
-       equivalents, and some terminal types which  commonly  have
+       Some common <STRONG>terminfo</STRONG> parameter  sequences,  their  <STRONG>termcap</STRONG>
+       equivalents,  and  some terminal types which commonly have
        such sequences, are:
 
      <STRONG>terminfo</STRONG>                    <STRONG>termcap</STRONG>   Representative Terminals
@@ -154,130 +154,130 @@
      <STRONG>%p2</STRONG> is printed before <STRONG>%p1</STRONG>   <STRONG>%r</STRONG>        hp
 
    <STRONG>Use=</STRONG> <STRONG>Option</STRONG> <STRONG>[-u]</STRONG>
-       The  <STRONG>-u</STRONG>  option  produces a <STRONG>terminfo</STRONG> source description of
-       the first terminal <EM>termname</EM> which is relative to  the  sum
-       of  the  descriptions  given  by the entries for the other
-       terminals <EM>termnames</EM>.  It does this by analyzing  the  dif-
-       ferences   between   the  first  <EM>termname</EM>  and  the  other
+       The <STRONG>-u</STRONG> option produces a <STRONG>terminfo</STRONG>  source  description  of
+       the  first  terminal <EM>termname</EM> which is relative to the sum
+       of the descriptions given by the  entries  for  the  other
+       terminals  <EM>termnames</EM>.   It does this by analyzing the dif-
+       ferences  between  the  first  <EM>termname</EM>  and   the   other
        <EM>termnames</EM> and producing a description with <STRONG>use=</STRONG> fields for
-       the  other  terminals.   In this manner, it is possible to
-       retrofit  generic  terminfo  entries  into  a   terminal's
+       the other terminals.  In this manner, it  is  possible  to
+       retrofit   generic  terminfo  entries  into  a  terminal's
        description.  Or, if two similar terminals exist, but were
-       coded at different times or by different  people  so  that
+       coded  at  different  times or by different people so that
        each description is a full description, using <STRONG>infocmp</STRONG> will
        show what can be done to change one description to be rel-
        ative to the other.
 
        A capability will get printed with an at-sign (@) if it no
-       longer exists in the first <EM>termname</EM>, but one of the  other
-       <EM>termname</EM>  entries contains a value for it.  A capability's
-       value gets printed if the value in the first  <EM>termname</EM>  is
-       not  found in any of the other <EM>termname</EM> entries, or if the
+       longer  exists in the first <EM>termname</EM>, but one of the other
+       <EM>termname</EM> entries contains a value for it.  A  capability's
+       value  gets  printed if the value in the first <EM>termname</EM> is
+       not found in any of the other <EM>termname</EM> entries, or if  the
        first of the other <EM>termname</EM> entries that has this capabil-
-       ity  gives  a different value for the capability than that
+       ity gives a different value for the capability  than  that
        in the first <EM>termname</EM>.
 
-       The order of the other <EM>termname</EM>  entries  is  significant.
-       Since  the terminfo compiler <STRONG>tic</STRONG> does a left-to-right scan
+       The  order  of  the other <EM>termname</EM> entries is significant.
+       Since the terminfo compiler <STRONG>tic</STRONG> does a left-to-right  scan
        of the capabilities, specifying two <STRONG>use=</STRONG> entries that con-
        tain differing entries for the same capabilities will pro-
-       duce different results depending on  the  order  that  the
-       entries  are  given in.  <STRONG>infocmp</STRONG> will flag any such incon-
-       sistencies between the other <EM>termname</EM> entries as they  are
+       duce  different  results  depending  on the order that the
+       entries are given in.  <STRONG>infocmp</STRONG> will flag any  such  incon-
+       sistencies  between the other <EM>termname</EM> entries as they are
        found.
 
-       Alternatively,  specifying a capability <EM>after</EM> a <STRONG>use=</STRONG> entry
+       Alternatively, specifying a capability <EM>after</EM> a <STRONG>use=</STRONG>  entry
        that contains that capability will cause the second speci-
-       fication  to  be  ignored.   Using  <STRONG>infocmp</STRONG>  to recreate a
+       fication to be  ignored.   Using  <STRONG>infocmp</STRONG>  to  recreate  a
        description can be a useful check to make sure that every-
-       thing  was  specified  correctly  in  the  original source
+       thing was  specified  correctly  in  the  original  source
        description.
 
-       Another error  that  does  not  cause  incorrect  compiled
-       files,  but will slow down the compilation time, is speci-
-       fying extra <STRONG>use=</STRONG> fields  that  are  superfluous.   <STRONG>infocmp</STRONG>
-       will  flag  any  other  <EM>termname</EM> <EM>use=</EM> fields that were not
+       Another  error  that  does  not  cause  incorrect compiled
+       files, but will slow down the compilation time, is  speci-
+       fying  extra  <STRONG>use=</STRONG>  fields  that are superfluous.  <STRONG>infocmp</STRONG>
+       will flag any other <EM>termname</EM> <EM>use=</EM>  fields  that  were  not
        needed.
 
    <STRONG>Changing</STRONG> <STRONG>Databases</STRONG> <STRONG>[-A</STRONG> <EM>directory</EM>] [-B <EM>directory</EM>]
-       The location of the compiled <STRONG>terminfo</STRONG>  database  is  taken
-       from  the environment variable <STRONG>TERMINFO</STRONG> .  If the variable
+       The  location  of  the compiled <STRONG>terminfo</STRONG> database is taken
+       from the environment variable <STRONG>TERMINFO</STRONG> .  If the  variable
        is not defined, or the terminal is not found in that loca-
-       tion,  the  system  <STRONG>terminfo</STRONG>  database, in <STRONG>/usr/share/ter-</STRONG>
+       tion, the system  <STRONG>terminfo</STRONG>  database,  in  <STRONG>/usr/share/ter-</STRONG>
        <STRONG>minfo</STRONG>, will be used.  The options <STRONG>-A</STRONG> and <STRONG>-B</STRONG> may be used to
-       override  this  location.  The <STRONG>-A</STRONG> option will set <STRONG>TERMINFO</STRONG>
+       override this location.  The <STRONG>-A</STRONG> option will  set  <STRONG>TERMINFO</STRONG>
        for the first <EM>termname</EM> and the <STRONG>-B</STRONG> option will set <STRONG>TERMINFO</STRONG>
-       for  the  other  <EM>termnames</EM>.   With this, it is possible to
-       compare descriptions for a terminal  with  the  same  name
-       located  in  two  different databases.  This is useful for
-       comparing descriptions for the same  terminal  created  by
+       for the other <EM>termnames</EM>.  With this,  it  is  possible  to
+       compare  descriptions  for  a  terminal with the same name
+       located in two different databases.  This  is  useful  for
+       comparing  descriptions  for  the same terminal created by
        different people.
 
    <STRONG>Other</STRONG> <STRONG>Options</STRONG>
-       <STRONG>-1</STRONG>   causes  the  fields  to be printed out one to a line.
-            Otherwise, the fields will be printed  several  to  a
+       <STRONG>-1</STRONG>   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.
 
-       <STRONG>-a</STRONG>   tells  <STRONG>infocmp</STRONG>  to  retain commented-out capabilities
-            rather than discarding them.  Capabilities  are  com-
+       <STRONG>-a</STRONG>   tells <STRONG>infocmp</STRONG> to  retain  commented-out  capabilities
+            rather  than  discarding them.  Capabilities are com-
             mented by prefixing them with a period.
 
        <STRONG>-E</STRONG>   Dump  the  capabilities  of  the  given  terminal  as
-            tables, needed in the C initializer  for  a  TERMTYPE
-            structure  (the  terminal capability structure in the
-            <STRONG>&lt;term.h&gt;</STRONG>).  This option is useful for preparing  ver-
-            sions  of  the  curses  library hardwired for a given
-            terminal type.  The tables are all  declared  static,
-            and  are  named according to the type and the name of
+            tables,  needed  in  the C initializer for a TERMTYPE
+            structure (the terminal capability structure  in  the
+            <STRONG>&lt;term.h&gt;</STRONG>).   This option is useful for preparing ver-
+            sions of the curses library  hardwired  for  a  given
+            terminal  type.   The tables are all declared static,
+            and are named according to the type and the  name  of
             the corresponding terminal entry.
 
-            Before ncurses 5.0, the split between the <STRONG>-e</STRONG>  and  <STRONG>-E</STRONG>
-            options  was  not  needed;  but  support for extended
+            Before  ncurses  5.0, the split between the <STRONG>-e</STRONG> and <STRONG>-E</STRONG>
+            options was not  needed;  but  support  for  extended
             names required making the arrays of terminal capabil-
             ities separate from the TERMTYPE structure.
 
-       <STRONG>-e</STRONG>   Dump  the  capabilities  of the given terminal as a C
-            initializer for a TERMTYPE  structure  (the  terminal
-            capability  structure  in the <STRONG>&lt;term.h&gt;</STRONG>).  This option
+       <STRONG>-e</STRONG>   Dump the capabilities of the given terminal  as  a  C
+            initializer  for  a  TERMTYPE structure (the terminal
+            capability structure in the <STRONG>&lt;term.h&gt;</STRONG>).   This  option
             is  useful  for  preparing  versions  of  the  curses
             library hardwired for a given terminal type.
 
-       <STRONG>-F</STRONG>   compare  terminfo  files.  This assumes that two fol-
-            lowing  arguments  are  filenames.   The  files   are
-            searched  for  pairwise matches between entries, with
+       <STRONG>-F</STRONG>   compare terminfo files.  This assumes that  two  fol-
+            lowing   arguments  are  filenames.   The  files  are
+            searched for pairwise matches between  entries,  with
             two entries considered to match if any of their names
-            do.   The  report  printed  to  standard output lists
-            entries with  no  matches  in  the  other  file,  and
-            entries  with  more than one match.  For entries with
-            exactly one match it includes  a  difference  report.
-            Normally,  to  reduce  the  volume of the report, use
-            references are not resolved before looking  for  dif-
+            do.  The report  printed  to  standard  output  lists
+            entries  with  no  matches  in  the  other  file, and
+            entries with more than one match.  For  entries  with
+            exactly  one  match  it includes a difference report.
+            Normally, to reduce the volume  of  the  report,  use
+            references  are  not resolved before looking for dif-
             ferences, but resolution can be forced by also speci-
             fying <STRONG>-r</STRONG>.
 
-       <STRONG>-f</STRONG>   Display  complex  terminfo  strings   which   contain
+       <STRONG>-f</STRONG>   Display   complex   terminfo  strings  which  contain
             if/then/else/endif expressions indented for readabil-
             ity.
 
        <STRONG>-G</STRONG>   Display constant literals in decimal form rather than
             their character equivalents.
 
-       <STRONG>-g</STRONG>   Display  constant  character  literals in quoted form
+       <STRONG>-g</STRONG>   Display constant character literals  in  quoted  form
             rather than their decimal equivalents.
 
        <STRONG>-i</STRONG>   Analyze the initialization (<STRONG>is1</STRONG>, <STRONG>is2</STRONG>, <STRONG>is3</STRONG>), and reset
-            (<STRONG>rs1</STRONG>,  <STRONG>rs2</STRONG>,  <STRONG>rs3</STRONG>),  strings  in  the entry.  For each
-            string, the code tries to analyze it into actions  in
+            (<STRONG>rs1</STRONG>, <STRONG>rs2</STRONG>, <STRONG>rs3</STRONG>), strings  in  the  entry.   For  each
+            string,  the code tries to analyze it into actions in
             terms of the other capabilities in the entry, certain
-            X3.64/ISO 6429/ECMA-48 capabilities, and certain  DEC
-            VT-series  private  modes (the set of recognized spe-
-            cial sequences has  been  selected  for  completeness
-            over  the  existing  terminfo database).  Each report
-            line consists of the capability name, followed  by  a
+            X3.64/ISO  6429/ECMA-48 capabilities, and certain DEC
+            VT-series private modes (the set of  recognized  spe-
+            cial  sequences  has  been  selected for completeness
+            over the existing terminfo  database).   Each  report
+            line  consists  of the capability name, followed by a
             colon and space, followed by a printable expansion of
-            the capability string with sections  matching  recog-
-            nized  actions  translated into {}-bracketed descrip-
-            tions.  Here  is  a  list  of  the  DEC/ANSI  special
+            the  capability  string with sections matching recog-
+            nized actions translated into  {}-bracketed  descrip-
+            tions.   Here  is  a  list  of  the  DEC/ANSI special
             sequences recognized: i.
 
                   Action        Meaning
@@ -317,10 +317,10 @@
                   DEC[+-]AWM    wraparound mode
                   DEC[+-]ARM    auto-repeat mode
 
-            It  also  recognizes  a  SGR  action corresponding to
-            ANSI/ISO 6429/ECMA Set Graphics Rendition,  with  the
-            values  NORMAL,  BOLD, UNDERLINE, BLINK, and REVERSE.
-            All but NORMAL may be prefixed with `+' (turn on)  or
+            It also recognizes  a  SGR  action  corresponding  to
+            ANSI/ISO  6429/ECMA  Set Graphics Rendition, with the
+            values NORMAL, BOLD, UNDERLINE, BLINK,  and  REVERSE.
+            All  but NORMAL may be prefixed with `+' (turn on) or
             `-' (turn off).
 
        An SGR0 designates an empty highlight sequence (equivalent
@@ -398,8 +398,8 @@
 
 </PRE>
 <H2>FILES</H2><PRE>
-       /usr/share/terminfo Compiled      terminal     description
-                           database.
+       /usr/share/terminfo Compiled  terminal  description  data-
+                           base.
 
 
 </PRE>
@@ -423,7 +423,7 @@
        <STRONG><A HREF="captoinfo.1m.html">captoinfo(1m)</A></STRONG>,    <STRONG><A HREF="infotocap.1m.html">infotocap(1m)</A></STRONG>,     <STRONG><A HREF="tic.1m.html">tic(1m)</A></STRONG>,     <STRONG><A HREF="toe.1m.html">toe(1m)</A></STRONG>,
        <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>.
 
-       This describes <STRONG>ncurses</STRONG> version 5.6 (patch 20081011).
+       This describes <STRONG>ncurses</STRONG> version 5.7 (patch 20101002).
 
 
 </PRE>
diff -Naur ncurses-5.7.orig/doc/html/man/infotocap.1m.html ncurses-5.7/doc/html/man/infotocap.1m.html
--- ncurses-5.7.orig/doc/html/man/infotocap.1m.html	2008-10-11 17:34:12.000000000 -0400
+++ ncurses-5.7/doc/html/man/infotocap.1m.html	2011-01-08 18:18:29.354656643 -0500
@@ -2,7 +2,7 @@
 <!-- 
   * 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            *
@@ -28,7 +28,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: infotocap.1m,v 1.8 2006/12/24 20:13:56 tom Exp @
+  * @Id: infotocap.1m,v 1.10 2010/08/28 19:40:02 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -59,18 +59,19 @@
 
 </PRE>
 <H2>DESCRIPTION</H2><PRE>
-       <STRONG>infotocap</STRONG> looks in <EM>file</EM> for  <STRONG>terminfo</STRONG>  descriptions.   For
-       each one found, an equivalent <STRONG>termcap</STRONG> description is writ-
-       ten to standard output.   Terminfo  <STRONG>use</STRONG>  capabilities  are
-       translated directly to termcap <STRONG>tc</STRONG> capabilities.
+       <STRONG>infotocap</STRONG> looks in  each  given  text  <EM>file</EM>  for  <STRONG>terminfo</STRONG>
+       descriptions.   For  each  terminfo  description found, an
+       equivalent <STRONG>termcap</STRONG> description is written to standard out-
+       put.  Terminfo <STRONG>use</STRONG> capabilities are translated directly to
+       termcap <STRONG>tc</STRONG> capabilities.
 
-       <STRONG>-v</STRONG>   print  out  tracing  information on standard error as
+       <STRONG>-v</STRONG>   print out tracing information on  standard  error  as
             the program runs.
 
-       <STRONG>-V</STRONG>   print out the version of the program in use on  stan-
+       <STRONG>-V</STRONG>   print  out the version of the program in use on stan-
             dard error and exit.
 
-       <STRONG>-1</STRONG>   cause  the fields to print out one to a line.  Other-
+       <STRONG>-1</STRONG>   cause the fields to print out one to a line.   Other-
             wise, the fields will be printed several to a line to
             a maximum width of 60 characters.
 
@@ -79,13 +80,13 @@
 
 </PRE>
 <H2>FILES</H2><PRE>
-       /usr/share/terminfo Compiled      terminal     description
-                           database.
+       /usr/share/terminfo Compiled  terminal  description  data-
+                           base.
 
 
 </PRE>
 <H2>NOTES</H2><PRE>
-       This utility is actually a link  to  <EM>tic</EM>,  running  in  <EM>-C</EM>
+       This  utility  is  actually  a  link to <EM>tic</EM>, running in <EM>-C</EM>
        mode.  You can use other <EM>tic</EM> options such as <STRONG>-f</STRONG> and  <STRONG>-x</STRONG>.
 
 
@@ -93,7 +94,13 @@
 <H2>SEE ALSO</H2><PRE>
        <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="tic.1m.html">tic(1m)</A></STRONG>, <STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>
 
-       This describes <STRONG>ncurses</STRONG> version 5.6 (patch 20081011).
+       This describes <STRONG>ncurses</STRONG> version 5.7 (patch 20101002).
+
+
+</PRE>
+<H2>AUTHOR</H2><PRE>
+       Eric S. Raymond &lt;esr@snark.thyrsus.com&gt; and
+       Thomas E. Dickey &lt;dickey@invisible-island.net&gt;
 
 
 
diff -Naur ncurses-5.7.orig/doc/html/man/key_defined.3x.html ncurses-5.7/doc/html/man/key_defined.3x.html
--- ncurses-5.7.orig/doc/html/man/key_defined.3x.html	2006-09-23 16:43:15.000000000 -0400
+++ ncurses-5.7/doc/html/man/key_defined.3x.html	2011-01-08 18:13:50.419157335 -0500
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 <!-- 
   ****************************************************************************
-  * 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 @@
   * authorization.                                                           *
   ****************************************************************************
   * 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.5 2010/07/31 16:09:36 tom Exp @
 -->
 <HTML>
 <HEAD>
diff -Naur ncurses-5.7.orig/doc/html/man/keybound.3x.html ncurses-5.7/doc/html/man/keybound.3x.html
--- ncurses-5.7.orig/doc/html/man/keybound.3x.html	2006-09-23 16:43:15.000000000 -0400
+++ ncurses-5.7/doc/html/man/keybound.3x.html	2011-01-08 18:13:50.423156849 -0500
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 <!-- 
   ****************************************************************************
-  * Copyright (c) 1999-2003,2006 Free Software Foundation, Inc.              *
+  * Copyright (c) 1999-2006,2008 Free Software Foundation, Inc.              *
   *                                                                          *
   * Permission is hereby granted, free of charge, to any person obtaining a  *
   * copy of this software and associated documentation files (the            *
@@ -28,20 +28,20 @@
   * authorization.                                                           *
   ****************************************************************************
   * Author: Thomas E. Dickey 1999
-  * @Id: keybound.3x,v 1.6 2006/02/25 21:47:06 tom Exp @
+  * @Id: keybound.3x,v 1.7 2008/12/13 18:19:07 Frederic.Culot Exp @
 -->
 <HTML>
 <HEAD>
-<TITLE>keyok 3x</TITLE>
+<TITLE>keybound 3x</TITLE>
 <link rev=made href="mailto:bug-ncurses@gnu.org">
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
 </HEAD>
 <BODY>
-<H1>keyok 3x</H1>
+<H1>keybound 3x</H1>
 <HR>
 <PRE>
 <!-- Manpage converted by man2html 3.0.1 -->
-<STRONG><A HREF="keyok.3x.html">keyok(3x)</A></STRONG>                                                     <STRONG><A HREF="keyok.3x.html">keyok(3x)</A></STRONG>
+<STRONG><A HREF="keybound.3x.html">keybound(3x)</A></STRONG>                                               <STRONG><A HREF="keybound.3x.html">keybound(3x)</A></STRONG>
 
 
 
@@ -94,7 +94,7 @@
 
 
 
-                                                              <STRONG><A HREF="keyok.3x.html">keyok(3x)</A></STRONG>
+                                                           <STRONG><A HREF="keybound.3x.html">keybound(3x)</A></STRONG>
 </PRE>
 <HR>
 <ADDRESS>
diff -Naur ncurses-5.7.orig/doc/html/man/keyok.3x.html ncurses-5.7/doc/html/man/keyok.3x.html
--- ncurses-5.7.orig/doc/html/man/keyok.3x.html	2006-09-23 16:43:15.000000000 -0400
+++ ncurses-5.7/doc/html/man/keyok.3x.html	2011-01-08 18:13:50.423156849 -0500
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 <!-- 
   ****************************************************************************
-  * 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 @@
   * authorization.                                                           *
   ****************************************************************************
   * Author: Thomas E. Dickey 1997
-  * @Id: keyok.3x,v 1.9 2006/02/25 21:47:06 tom Exp @
+  * @Id: keyok.3x,v 1.10 2010/07/31 16:08:48 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -63,7 +63,7 @@
        This is an extension to the curses library.  It permits an
        application to disable specific keycodes, rather than  use
        the  <EM>keypad</EM>  function  to disable all keycodes.  Keys that
-       have been disabled can be reenabled.
+       have been disabled can be re-enabled.
 
 
 </PRE>
diff -Naur ncurses-5.7.orig/doc/html/man/menu.3x.html ncurses-5.7/doc/html/man/menu.3x.html
--- ncurses-5.7.orig/doc/html/man/menu.3x.html	2008-10-11 17:34:13.000000000 -0400
+++ ncurses-5.7/doc/html/man/menu.3x.html	2011-01-08 18:18:29.354656643 -0500
@@ -2,7 +2,7 @@
 <!-- 
   * 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            *
@@ -28,7 +28,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: menu.3x,v 1.19 2006/11/04 18:38:29 tom Exp @
+  * @Id: menu.3x,v 1.20 2010/07/31 16:09:36 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -226,7 +226,7 @@
 
 </PRE>
 <H2>SEE ALSO</H2><PRE>
-       This describes <STRONG>ncurses</STRONG> version 5.6 (patch 20081011).
+       This describes <STRONG>ncurses</STRONG> version 5.7 (patch 20101002).
 
 
 
diff -Naur ncurses-5.7.orig/doc/html/man/menu_attributes.3x.html ncurses-5.7/doc/html/man/menu_attributes.3x.html
--- ncurses-5.7.orig/doc/html/man/menu_attributes.3x.html	2008-10-11 17:34:13.000000000 -0400
+++ ncurses-5.7/doc/html/man/menu_attributes.3x.html	2011-01-08 18:13:50.423156849 -0500
@@ -2,7 +2,7 @@
 <!-- 
   * 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            *
@@ -28,7 +28,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: menu_attributes.3x,v 1.10 2008/08/23 18:24:23 tom Exp @
+  * @Id: menu_attributes.3x,v 1.11 2010/07/31 16:09:36 tom Exp @
 -->
 <HTML>
 <HEAD>
diff -Naur ncurses-5.7.orig/doc/html/man/menu_cursor.3x.html ncurses-5.7/doc/html/man/menu_cursor.3x.html
--- ncurses-5.7.orig/doc/html/man/menu_cursor.3x.html	2006-12-16 17:51:40.000000000 -0500
+++ ncurses-5.7/doc/html/man/menu_cursor.3x.html	2011-01-08 18:13:50.423156849 -0500
@@ -2,7 +2,7 @@
 <!-- 
   * 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            *
@@ -28,7 +28,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: menu_cursor.3x,v 1.6 2006/11/04 17:13:57 tom Exp @
+  * @Id: menu_cursor.3x,v 1.7 2010/07/31 16:09:36 tom Exp @
 -->
 <HTML>
 <HEAD>
diff -Naur ncurses-5.7.orig/doc/html/man/menu_driver.3x.html ncurses-5.7/doc/html/man/menu_driver.3x.html
--- ncurses-5.7.orig/doc/html/man/menu_driver.3x.html	2008-06-21 19:11:48.000000000 -0400
+++ ncurses-5.7/doc/html/man/menu_driver.3x.html	2011-01-08 18:18:29.358656498 -0500
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 <!-- 
   ****************************************************************************
-  * 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            *
@@ -27,7 +27,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: menu_driver.3x,v 1.15 2008/06/21 21:55:30 tom Exp @
+  * @Id: menu_driver.3x,v 1.19 2010/10/02 23:10:49 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -62,17 +62,17 @@
        input events to it through <STRONG>menu_driver</STRONG>.  This routine  has
        three major input cases:
 
-       -  The  input  is  a  form navigation request.  Navigation
-          request codes are constants defined in <STRONG>&lt;form.h&gt;</STRONG>,  which
-          are distinct from the key- and character codes returned
-          by <STRONG>wgetch</STRONG>.
-
-       -  The input is a printable character.  Printable  charac-
-          ters  (which  must  be  positive,  less  than  256) are
-          checked according to the program's locale settings.
+       <STRONG>o</STRONG>   The  input  is  a form navigation request.  Navigation
+           request codes are constants defined in <STRONG>&lt;form.h&gt;</STRONG>, which
+           are   distinct  from  the  key-  and  character  codes
+           returned by <STRONG>wgetch</STRONG>.
+
+       <STRONG>o</STRONG>   The input is a printable character.  Printable charac-
+           ters  (which  must  be  positive,  less  than 256) are
+           checked according to the program's locale settings.
 
-       -  The input is the KEY_MOUSE special key associated  with
-          an mouse event.
+       <STRONG>o</STRONG>   The input is the KEY_MOUSE special key associated with
+           an mouse event.
 
        The menu driver requests are as follows:
 
@@ -119,8 +119,8 @@
             Clear the menu pattern buffer.
 
        REQ_BACK_PATTERN
-            Delete   the  previous  character  from  the  pattern
-            buffer.
+            Delete  the  previous character from the pattern buf-
+            fer.
 
        REQ_NEXT_MATCH
             Move to the next item matching the pattern match.
@@ -128,53 +128,53 @@
        REQ_PREV_MATCH
             Move to the previous item matching the pattern match.
 
-       If  the second argument is a printable character, the code
-       appends it to the pattern buffer and attempts to  move  to
-       the  next  item  matching the new pattern.  If there is no
+       If the second argument is a printable character, the  code
+       appends  it  to the pattern buffer and attempts to move to
+       the next item matching the new pattern.  If  there  is  no
        such match, <STRONG>menu_driver</STRONG> returns <STRONG>E_NO_MATCH</STRONG> and deletes the
        appended character from the buffer.
 
-       If  the  second  argument  is one of the above pre-defined
+       If the second argument is one  of  the  above  pre-defined
        requests, the corresponding action is performed.
 
    <STRONG>MOUSE</STRONG> <STRONG>HANDLING</STRONG>
-       If the second argument is the KEY_MOUSE special  key,  the
+       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 area or the decora-
+       pre-defined  requests.   Currently only clicks in the user
+       window (e.g., inside the menu display area or the  decora-
        tion window) are handled.
 
        If you click above the display region of the menu:
 
-              a REQ_SCR_ULINE is generated for a single click,
+       <STRONG>o</STRONG>   a REQ_SCR_ULINE is generated for a single click,
 
-              a REQ_SCR_UPAGE is generated for a double-click and
+       <STRONG>o</STRONG>   a REQ_SCR_UPAGE is generated for a double-click and
 
-              a REQ_FIRST_ITEM is generated for a triple-click.
+       <STRONG>o</STRONG>   a REQ_FIRST_ITEM is generated for a triple-click.
 
        If you click below the display region of the menu:
 
-              a REQ_SCR_DLINE is generated for a single click,
+       <STRONG>o</STRONG>   a REQ_SCR_DLINE is generated for a single click,
 
-              a REQ_SCR_DPAGE is generated for a double-click and
+       <STRONG>o</STRONG>   a REQ_SCR_DPAGE is generated for a double-click and
 
-              a REQ_LAST_ITEM is generated for a triple-click.
+       <STRONG>o</STRONG>   a REQ_LAST_ITEM is generated for a triple-click.
 
-       If you click at an item inside the  display  area  of  the
+       If  you  click  at  an item inside the display area of the
        menu:
 
-              -  the menu cursor is positioned to that item.
+       <STRONG>o</STRONG>   the menu cursor is positioned to that item.
 
-              -  If you double-click an item a REQ_TOGGLE_ITEM is
-                 generated  and  <STRONG>E_UNKNOWN_COMMAND</STRONG>  is  returned.
-                 This  return value makes sense, because a double
-                 click usually means that an item-specific action
-                 should  be  returned.  It is exactly the purpose
-                 of this return value to signal that an  applica-
-                 tion specific command should be executed.
+       <STRONG>o</STRONG>   If you double-click an item a REQ_TOGGLE_ITEM is  gen-
+           erated and <STRONG>E_UNKNOWN_COMMAND</STRONG> is returned.  This return
+           value makes sense,  because  a  double  click  usually
+           means that an item-specific action should be returned.
+           It is exactly the purpose of this return value to sig-
+           nal  that  an  application  specific command should be
+           executed.
 
-              -  If  a  translation  into  a  request  was  done,
-                 <STRONG>menu_driver</STRONG> returns the result of this  request.
+       <STRONG>o</STRONG>   If a translation into a request was done,  <STRONG>menu_driver</STRONG>
+           returns the result of this request.
 
        If  you clicked outside the user window or the mouse event
        could  not  be  translated  into   a   menu   request   an
@@ -221,7 +221,7 @@
 
 </PRE>
 <H2>SEE ALSO</H2><PRE>
-       <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="menu.3x.html">menu(3x)</A></STRONG>, <STRONG><A HREF="wgetch.3x.html">wgetch(3x)</A></STRONG>.
+       <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="menu.3x.html">menu(3x)</A></STRONG>, <STRONG><A HREF="getch.3x.html">getch(3x)</A></STRONG>.
 
 
 </PRE>
diff -Naur ncurses-5.7.orig/doc/html/man/menu_format.3x.html ncurses-5.7/doc/html/man/menu_format.3x.html
--- ncurses-5.7.orig/doc/html/man/menu_format.3x.html	2006-12-16 17:51:41.000000000 -0500
+++ ncurses-5.7/doc/html/man/menu_format.3x.html	2011-01-08 18:13:50.423156849 -0500
@@ -2,7 +2,7 @@
 <!-- 
   * 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            *
@@ -28,7 +28,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: menu_format.3x,v 1.10 2006/11/04 17:12:00 tom Exp @
+  * @Id: menu_format.3x,v 1.11 2010/07/31 16:09:36 tom Exp @
 -->
 <HTML>
 <HEAD>
diff -Naur ncurses-5.7.orig/doc/html/man/menu_hook.3x.html ncurses-5.7/doc/html/man/menu_hook.3x.html
--- ncurses-5.7.orig/doc/html/man/menu_hook.3x.html	2007-03-03 19:10:50.000000000 -0500
+++ ncurses-5.7/doc/html/man/menu_hook.3x.html	2011-01-08 18:13:50.423156849 -0500
@@ -2,7 +2,7 @@
 <!-- 
   * 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            *
@@ -28,7 +28,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: menu_hook.3x,v 1.9 2007/02/24 17:34:08 tom Exp @
+  * @Id: menu_hook.3x,v 1.10 2010/07/31 16:09:36 tom Exp @
 -->
 <HTML>
 <HEAD>
diff -Naur ncurses-5.7.orig/doc/html/man/menu_items.3x.html ncurses-5.7/doc/html/man/menu_items.3x.html
--- ncurses-5.7.orig/doc/html/man/menu_items.3x.html	2006-12-16 17:51:41.000000000 -0500
+++ ncurses-5.7/doc/html/man/menu_items.3x.html	2011-01-08 18:13:50.423156849 -0500
@@ -2,7 +2,7 @@
 <!-- 
   * 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            *
@@ -28,7 +28,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: menu_items.3x,v 1.7 2006/11/04 18:35:31 tom Exp @
+  * @Id: menu_items.3x,v 1.8 2010/07/31 16:08:48 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -117,12 +117,12 @@
        were not supported on Version 7 or BSD versions.
 
        The  SVr4  menu  library   documentation   specifies   the
-       <STRONG>item_count</STRONG>  error value as -1 (which is the value of <STRONG>ERR</STRONG>).
+       <STRONG>item_count</STRONG> error value as -1 (which is the value of <STRONG>ERR</STRONG>).
 
 
 </PRE>
 <H2>AUTHORS</H2><PRE>
-       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
+       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
        curses by Eric S. Raymond.
 
 
diff -Naur ncurses-5.7.orig/doc/html/man/menu_mark.3x.html ncurses-5.7/doc/html/man/menu_mark.3x.html
--- ncurses-5.7.orig/doc/html/man/menu_mark.3x.html	2006-12-16 17:51:41.000000000 -0500
+++ ncurses-5.7/doc/html/man/menu_mark.3x.html	2011-01-08 18:13:50.423156849 -0500
@@ -2,7 +2,7 @@
 <!-- 
   * 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            *
@@ -28,7 +28,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: menu_mark.3x,v 1.9 2006/11/04 18:33:18 tom Exp @
+  * @Id: menu_mark.3x,v 1.10 2010/07/31 16:08:48 tom Exp @
 -->
 <HTML>
 <HEAD>
diff -Naur ncurses-5.7.orig/doc/html/man/menu_new.3x.html ncurses-5.7/doc/html/man/menu_new.3x.html
--- ncurses-5.7.orig/doc/html/man/menu_new.3x.html	2006-12-16 17:51:41.000000000 -0500
+++ ncurses-5.7/doc/html/man/menu_new.3x.html	2011-01-08 18:13:50.423156849 -0500
@@ -2,7 +2,7 @@
 <!-- 
   * 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            *
@@ -28,7 +28,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: menu_new.3x,v 1.9 2006/11/04 18:31:37 tom Exp @
+  * @Id: menu_new.3x,v 1.10 2010/07/31 16:08:48 tom Exp @
 -->
 <HTML>
 <HEAD>
diff -Naur ncurses-5.7.orig/doc/html/man/menu_opts.3x.html ncurses-5.7/doc/html/man/menu_opts.3x.html
--- ncurses-5.7.orig/doc/html/man/menu_opts.3x.html	2007-03-03 19:10:50.000000000 -0500
+++ ncurses-5.7/doc/html/man/menu_opts.3x.html	2011-01-08 18:13:50.423156849 -0500
@@ -2,7 +2,7 @@
 <!-- 
   * 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            *
@@ -28,7 +28,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: menu_opts.3x,v 1.10 2007/02/24 17:33:59 tom Exp @
+  * @Id: menu_opts.3x,v 1.11 2010/07/31 16:08:48 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -91,11 +91,11 @@
             Ignore the case when pattern-matching.
 
        O_SHOWMATCH
-            Move the cursor to within the item  name  while  pat-
+            Move  the  cursor  to within the item name while pat-
             tern-matching.
 
        O_NONCYCLIC
-            Don't   wrap   around  next-item  and  previous-item,
+            Don't  wrap  around  next-item   and   previous-item,
             requests to the other end of the menu.
 
 
@@ -126,13 +126,13 @@
 
 </PRE>
 <H2>PORTABILITY</H2><PRE>
-       These routines emulate the System V  menu  library.   They
+       These  routines  emulate  the System V menu library.  They
        were not supported on Version 7 or BSD versions.
 
 
 </PRE>
 <H2>AUTHORS</H2><PRE>
-       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
+       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
        curses by Eric S. Raymond.
 
 
diff -Naur ncurses-5.7.orig/doc/html/man/menu_pattern.3x.html ncurses-5.7/doc/html/man/menu_pattern.3x.html
--- ncurses-5.7.orig/doc/html/man/menu_pattern.3x.html	2008-06-21 19:11:49.000000000 -0400
+++ ncurses-5.7/doc/html/man/menu_pattern.3x.html	2011-01-08 18:13:50.423156849 -0500
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 <!-- 
   ****************************************************************************
-  * 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,7 +27,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: menu_pattern.3x,v 1.11 2008/06/21 21:58:20 tom Exp @
+  * @Id: menu_pattern.3x,v 1.12 2010/07/31 16:08:48 tom Exp @
 -->
 <HTML>
 <HEAD>
diff -Naur ncurses-5.7.orig/doc/html/man/menu_post.3x.html ncurses-5.7/doc/html/man/menu_post.3x.html
--- ncurses-5.7.orig/doc/html/man/menu_post.3x.html	2006-12-16 17:51:42.000000000 -0500
+++ ncurses-5.7/doc/html/man/menu_post.3x.html	2011-01-08 18:13:50.423156849 -0500
@@ -2,7 +2,7 @@
 <!-- 
   * 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            *
@@ -28,7 +28,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: menu_post.3x,v 1.9 2006/11/04 17:12:00 tom Exp @
+  * @Id: menu_post.3x,v 1.10 2010/07/31 16:08:48 tom Exp @
 -->
 <HTML>
 <HEAD>
diff -Naur ncurses-5.7.orig/doc/html/man/menu_requestname.3x.html ncurses-5.7/doc/html/man/menu_requestname.3x.html
--- ncurses-5.7.orig/doc/html/man/menu_requestname.3x.html	2006-12-16 17:51:42.000000000 -0500
+++ ncurses-5.7/doc/html/man/menu_requestname.3x.html	2011-01-08 18:13:50.423156849 -0500
@@ -2,7 +2,7 @@
 <!-- 
   * 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            *
@@ -28,7 +28,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: menu_requestname.3x,v 1.7 2006/11/04 17:56:09 tom Exp @
+  * @Id: menu_requestname.3x,v 1.8 2010/07/31 16:08:48 tom Exp @
 -->
 <HTML>
 <HEAD>
diff -Naur ncurses-5.7.orig/doc/html/man/menu_spacing.3x.html ncurses-5.7/doc/html/man/menu_spacing.3x.html
--- ncurses-5.7.orig/doc/html/man/menu_spacing.3x.html	2005-05-07 19:20:53.000000000 -0400
+++ ncurses-5.7/doc/html/man/menu_spacing.3x.html	2011-01-08 18:18:29.358656498 -0500
@@ -2,7 +2,7 @@
 <!-- 
   * 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            *
@@ -28,7 +28,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: menu_spacing.3x,v 1.8 2004/12/11 23:39:07 tom Exp @
+  * @Id: menu_spacing.3x,v 1.11 2010/10/02 23:22:15 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -66,35 +66,35 @@
 
 </PRE>
 <H2>DESCRIPTION</H2><PRE>
-       The  function  <STRONG>set_menu_spacing</STRONG>  sets the spacing informa-
-       tions for the menu.  <STRONG>spc_description</STRONG> controls  the  number
-       of spaces between an item name and an item description. It
-       must not be larger than <STRONG>TABSIZE</STRONG>. The menu system  puts  in
-       the  middle  of  this  spacing area the pad character. The
-       remaining parts are filled with spaces.  <STRONG>spc_rows</STRONG> 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 char-
-       acter in the appropriate positions.  <STRONG>spc_columns</STRONG>  controls
-       the number of blanks between columns of items. It must not
-       be larger than TABSIZE.  A value of 0 for all the  spacing
-       values  resets  them to the default, which is 1 for all of
-       them.
+       The function <STRONG>set_menu_spacing</STRONG> sets the spacing information
+       for the menu.  Its parameter <STRONG>spc_description</STRONG> controls  the
+       number of spaces between an item name and an item descrip-
+       tion.  It must not be larger than <STRONG>TABSIZE</STRONG>.  The menu  sys-
+       tem  puts in the middle of this spacing area the pad char-
+       acter.  The remaining parts are filled with  spaces.   The
+       <STRONG>spc_rows</STRONG>  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.   The <STRONG>spc_columns</STRONG> 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.
        The function <STRONG>menu_spacing</STRONG> passes back the spacing info for
-       the menu. If a pointer is NULL, this specific info is sim-
-       ply not returned.
+       the  menu.   If  a  pointer is NULL, this specific info is
+       simply not returned.
 
 
 </PRE>
 <H2>RETURN VALUE</H2><PRE>
-       Both routines return <STRONG>E_OK</STRONG> on success. <STRONG>set_menu_spacing</STRONG> may
-       return  <STRONG>E_POSTED</STRONG>  if the menu is posted, or <STRONG>E_BAD_ARGUMENT</STRONG>
-       if one of the spacing values is out of range.
+       Both routines return <STRONG>E_OK</STRONG>  on  success.   <STRONG>set_menu_spacing</STRONG>
+       may  return <STRONG>E_POSTED</STRONG> if the menu is posted, or <STRONG>E_BAD_ARGU-</STRONG>
+       <STRONG>MENT</STRONG> if one of the spacing values is out of range.
 
 
 </PRE>
 <H2>SEE ALSO</H2><PRE>
-       <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="menu.3x.html">menu(3x)</A></STRONG>.
+       <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_variables.3x.html">curs_variables(3x)</A></STRONG>, <STRONG><A HREF="menu.3x.html">menu(3x)</A></STRONG>.
 
 
 </PRE>
diff -Naur ncurses-5.7.orig/doc/html/man/menu_userptr.3x.html ncurses-5.7/doc/html/man/menu_userptr.3x.html
--- ncurses-5.7.orig/doc/html/man/menu_userptr.3x.html	2006-12-16 17:51:43.000000000 -0500
+++ ncurses-5.7/doc/html/man/menu_userptr.3x.html	2011-01-08 18:13:50.427157294 -0500
@@ -2,7 +2,7 @@
 <!-- 
   * 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            *
@@ -28,7 +28,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: menu_userptr.3x,v 1.8 2006/11/04 18:21:03 tom Exp @
+  * @Id: menu_userptr.3x,v 1.9 2010/07/31 16:08:48 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -60,7 +60,7 @@
 
 </PRE>
 <H2>DESCRIPTION</H2><PRE>
-       Every menu and every menu item has a  field  that  can  be
+       Every  menu  and  every  menu item has a field that can be
        used to hold application-specific data (that is, the menu-
        driver code leaves it alone).  These functions get and set
        the menu user pointer field.
@@ -68,7 +68,7 @@
 
 </PRE>
 <H2>RETURN VALUE</H2><PRE>
-       <STRONG>menu_userptr</STRONG>  returns  a  pointer (which may be <STRONG>NULL</STRONG>).  It
+       <STRONG>menu_userptr</STRONG> returns a pointer (which may  be  <STRONG>NULL</STRONG>).   It
        does not set errno.
 
        <STRONG>set_menu_userptr</STRONG> returns <STRONG>E_OK</STRONG> (success).
@@ -87,7 +87,7 @@
 
 </PRE>
 <H2>PORTABILITY</H2><PRE>
-       These  routines  emulate  the System V menu library.  They
+       These routines emulate the System V  menu  library.   They
        were not supported on Version 7 or BSD versions.
 
        The user pointer is a void pointer.  We chose not to leave
@@ -96,7 +96,7 @@
 
 </PRE>
 <H2>AUTHORS</H2><PRE>
-       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
+       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
        curses by Eric S. Raymond.
 
 
diff -Naur ncurses-5.7.orig/doc/html/man/menu_win.3x.html ncurses-5.7/doc/html/man/menu_win.3x.html
--- ncurses-5.7.orig/doc/html/man/menu_win.3x.html	2006-12-16 17:51:43.000000000 -0500
+++ ncurses-5.7/doc/html/man/menu_win.3x.html	2011-01-08 18:18:29.358656498 -0500
@@ -2,7 +2,7 @@
 <!-- 
   * 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            *
@@ -28,7 +28,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: menu_win.3x,v 1.8 2006/11/04 17:12:00 tom Exp @
+  * @Id: menu_win.3x,v 1.10 2010/10/02 23:22:24 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -64,28 +64,28 @@
 
 </PRE>
 <H2>DESCRIPTION</H2><PRE>
-       Every  menu has an associated pair of <STRONG>curses</STRONG> windows.  The
-       menu window displays any title and border associated  with
-       the  window;  the menu subwindow displays the items of the
+       Every menu has an associated pair of <STRONG>curses</STRONG> windows.   The
+       menu  window displays any title and border associated with
+       the window; the menu subwindow displays the items  of  the
        menu that are currently available for selection.
 
        The first four functions get and set those windows.  It is
        not necessary to set either window; by default, the driver
        code uses <STRONG>stdscr</STRONG> for both.
 
-       In the <STRONG>set_</STRONG> functions, window argument of <STRONG>NULL</STRONG> is  treated
-       as  though  it  were  <STRONG>stsdcr</STRONG>.   A menu argument of <STRONG>NULL</STRONG> is
-       treated as a request to change  the  system  default  menu
+       In  the <STRONG>set_</STRONG> functions, window argument of <STRONG>NULL</STRONG> is treated
+       as though it were <STRONG>stsdcr</STRONG>.  A  menu  argument  of  <STRONG>NULL</STRONG>  is
+       treated  as  a  request  to change the system default menu
        window or subwindow.
 
-       The  function <STRONG>scale_menu</STRONG> returns the minimum size required
+       The function <STRONG>scale_menu</STRONG> returns the minimum size  required
        for the subwindow of <EM>menu</EM>.
 
 
 </PRE>
 <H2>RETURN VALUE</H2><PRE>
-       Routines that return pointers return <STRONG>NULL</STRONG> on error.   Rou-
-       tines  that  return an integer return one of the following
+       Routines  that return pointers return <STRONG>NULL</STRONG> on error.  Rou-
+       tines that return an integer return one of  the  following
        error codes:
 
        <STRONG>E_OK</STRONG> The routine succeeded.
@@ -94,7 +94,7 @@
             System error occurred (see <STRONG>errno</STRONG>).
 
        <STRONG>E_BAD_ARGUMENT</STRONG>
-            Routine detected an incorrect or  out-of-range  argu-
+            Routine  detected  an incorrect or out-of-range argu-
             ment.
 
        <STRONG>E_POSTED</STRONG>
@@ -106,7 +106,7 @@
 
 </PRE>
 <H2>SEE ALSO</H2><PRE>
-       <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="menu.3x.html">menu(3x)</A></STRONG>.
+       <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_variables.3x.html">curs_variables(3x)</A></STRONG>, <STRONG><A HREF="menu.3x.html">menu(3x)</A></STRONG>.
 
 
 </PRE>
@@ -117,13 +117,13 @@
 
 </PRE>
 <H2>PORTABILITY</H2><PRE>
-       These routines emulate the System V  menu  library.   They
+       These  routines  emulate  the System V menu library.  They
        were not supported on Version 7 or BSD versions.
 
 
 </PRE>
 <H2>AUTHORS</H2><PRE>
-       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
+       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
        curses by Eric S. Raymond.
 
 
diff -Naur ncurses-5.7.orig/doc/html/man/mitem_current.3x.html ncurses-5.7/doc/html/man/mitem_current.3x.html
--- ncurses-5.7.orig/doc/html/man/mitem_current.3x.html	2006-12-16 17:51:43.000000000 -0500
+++ ncurses-5.7/doc/html/man/mitem_current.3x.html	2011-01-08 18:13:50.427157294 -0500
@@ -2,7 +2,7 @@
 <!-- 
   * 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            *
@@ -28,7 +28,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: mitem_current.3x,v 1.11 2006/11/04 18:18:19 tom Exp @
+  * @Id: mitem_current.3x,v 1.12 2010/07/31 16:08:48 tom Exp @
 -->
 <HTML>
 <HEAD>
diff -Naur ncurses-5.7.orig/doc/html/man/mitem_name.3x.html ncurses-5.7/doc/html/man/mitem_name.3x.html
--- ncurses-5.7.orig/doc/html/man/mitem_name.3x.html	2006-12-16 17:51:43.000000000 -0500
+++ ncurses-5.7/doc/html/man/mitem_name.3x.html	2011-01-08 18:13:50.427157294 -0500
@@ -2,7 +2,7 @@
 <!-- 
   * 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            *
@@ -28,7 +28,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: mitem_name.3x,v 1.6 2006/11/04 17:53:40 tom Exp @
+  * @Id: mitem_name.3x,v 1.7 2010/07/31 16:08:48 tom Exp @
 -->
 <HTML>
 <HEAD>
diff -Naur ncurses-5.7.orig/doc/html/man/mitem_new.3x.html ncurses-5.7/doc/html/man/mitem_new.3x.html
--- ncurses-5.7.orig/doc/html/man/mitem_new.3x.html	2006-12-16 17:51:43.000000000 -0500
+++ ncurses-5.7/doc/html/man/mitem_new.3x.html	2011-01-08 18:13:50.427157294 -0500
@@ -2,7 +2,7 @@
 <!-- 
   * 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            *
@@ -28,7 +28,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: mitem_new.3x,v 1.10 2006/11/04 18:16:36 tom Exp @
+  * @Id: mitem_new.3x,v 1.11 2010/07/31 16:08:48 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -61,24 +61,24 @@
 </PRE>
 <H2>DESCRIPTION</H2><PRE>
        The function <STRONG>new_item</STRONG> allocates a new item and initializes
-       it  from  the <STRONG>name</STRONG> and <STRONG>description</STRONG> pointers. Please notice
-       that the item stores only the pointers  to  the  name  and
+       it from the <STRONG>name</STRONG> and <STRONG>description</STRONG> pointers.  Please  notice
+       that  the  item  stores  only the pointers to the name and
        description. Those pointers must be valid during the life-
        time of the item. So you should be very careful with names
        or descriptions allocated on the stack of some routines.
        The function <STRONG>free_item</STRONG> de-allocates an item. Please notice
-       that it  is  the  responsibility  of  the  application  to
-       release  the memory for the name or the description of the
+       that  it  is  the  responsibility  of  the  application to
+       release the memory for the name or the description of  the
        item.
 
 
 </PRE>
 <H2>RETURN VALUE</H2><PRE>
-       The function <STRONG>new_item</STRONG> returns  <STRONG>NULL</STRONG>  on  error.   It  sets
+       The  function  <STRONG>new_item</STRONG>  returns  <STRONG>NULL</STRONG>  on error.  It sets
        errno according to the function's failure:
 
        <STRONG>E_BAD_ARGUMENT</STRONG>
-            Routine  detected  an incorrect or out-of-range argu-
+            Routine detected an incorrect or  out-of-range  argu-
             ment.
 
        <STRONG>E_SYSTEM_ERROR</STRONG>
@@ -89,7 +89,7 @@
        <STRONG>E_OK</STRONG> The routine succeeded.
 
        <STRONG>E_BAD_ARGUMENT</STRONG>
-            Routine detected an incorrect or  out-of-range  argu-
+            Routine  detected  an incorrect or out-of-range argu-
             ment.
 
        <STRONG>E_CONNECTED</STRONG>
@@ -112,13 +112,13 @@
 
 </PRE>
 <H2>PORTABILITY</H2><PRE>
-       These routines emulate the System V  menu  library.   They
+       These  routines  emulate  the System V menu library.  They
        were not supported on Version 7 or BSD versions.
 
 
 </PRE>
 <H2>AUTHORS</H2><PRE>
-       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
+       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
        curses by Eric S. Raymond.
 
 
diff -Naur ncurses-5.7.orig/doc/html/man/mitem_opts.3x.html ncurses-5.7/doc/html/man/mitem_opts.3x.html
--- ncurses-5.7.orig/doc/html/man/mitem_opts.3x.html	2007-03-03 19:10:52.000000000 -0500
+++ ncurses-5.7/doc/html/man/mitem_opts.3x.html	2011-01-08 18:13:50.427157294 -0500
@@ -2,7 +2,7 @@
 <!-- 
   * 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            *
@@ -28,7 +28,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: mitem_opts.3x,v 1.9 2007/02/24 17:33:32 tom Exp @
+  * @Id: mitem_opts.3x,v 1.10 2010/07/31 16:08:48 tom Exp @
 -->
 <HTML>
 <HEAD>
diff -Naur ncurses-5.7.orig/doc/html/man/mitem_userptr.3x.html ncurses-5.7/doc/html/man/mitem_userptr.3x.html
--- ncurses-5.7.orig/doc/html/man/mitem_userptr.3x.html	2006-12-16 17:51:44.000000000 -0500
+++ ncurses-5.7/doc/html/man/mitem_userptr.3x.html	2011-01-08 18:13:50.427157294 -0500
@@ -2,7 +2,7 @@
 <!-- 
   * 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            *
@@ -28,7 +28,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: mitem_userptr.3x,v 1.9 2006/11/04 18:21:03 tom Exp @
+  * @Id: mitem_userptr.3x,v 1.10 2010/07/31 16:08:48 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -68,7 +68,7 @@
 
 </PRE>
 <H2>RETURN VALUE</H2><PRE>
-       The  function  <STRONG>item_userptr</STRONG>  returns  a  pointer (possibly
+       The function  <STRONG>item_userptr</STRONG>  returns  a  pointer  (possibly
        <STRONG>NULL</STRONG>).  It does not set errno.
 
        The <STRONG>set_item_userptr</STRONG> always returns <STRONG>E_OK</STRONG> (success).
@@ -87,7 +87,7 @@
 
 </PRE>
 <H2>PORTABILITY</H2><PRE>
-       These  routines  emulate  the System V menu library.  They
+       These routines emulate the System V  menu  library.   They
        were not supported on Version 7 or BSD versions.
 
        The user pointer is a void pointer.  We chose not to leave
@@ -96,7 +96,7 @@
 
 </PRE>
 <H2>AUTHORS</H2><PRE>
-       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
+       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
        curses by Eric S. Raymond.
 
 
diff -Naur ncurses-5.7.orig/doc/html/man/mitem_value.3x.html ncurses-5.7/doc/html/man/mitem_value.3x.html
--- ncurses-5.7.orig/doc/html/man/mitem_value.3x.html	2006-12-16 17:51:44.000000000 -0500
+++ ncurses-5.7/doc/html/man/mitem_value.3x.html	2011-01-08 18:13:50.427157294 -0500
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 <!-- 
   ****************************************************************************
-  * 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,7 +27,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: mitem_value.3x,v 1.8 2006/11/04 17:12:00 tom Exp @
+  * @Id: mitem_value.3x,v 1.9 2010/07/31 16:08:48 tom Exp @
 -->
 <HTML>
 <HEAD>
diff -Naur ncurses-5.7.orig/doc/html/man/mitem_visible.3x.html ncurses-5.7/doc/html/man/mitem_visible.3x.html
--- ncurses-5.7.orig/doc/html/man/mitem_visible.3x.html	2005-05-07 19:20:55.000000000 -0400
+++ ncurses-5.7/doc/html/man/mitem_visible.3x.html	2011-01-08 18:13:50.427157294 -0500
@@ -2,7 +2,7 @@
 <!-- 
   * 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            *
@@ -28,7 +28,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: mitem_visible.3x,v 1.5 1998/11/29 01:12:55 Rick.Ohnemus Exp @
+  * @Id: mitem_visible.3x,v 1.6 2010/07/31 16:08:48 tom Exp @
 -->
 <HTML>
 <HEAD>
diff -Naur ncurses-5.7.orig/doc/html/man/ncurses.3x.html ncurses-5.7/doc/html/man/ncurses.3x.html
--- ncurses-5.7.orig/doc/html/man/ncurses.3x.html	2008-10-11 17:34:17.000000000 -0400
+++ ncurses-5.7/doc/html/man/ncurses.3x.html	2011-01-08 18:18:29.358656498 -0500
@@ -2,7 +2,7 @@
 <!-- 
   * t
   ****************************************************************************
-  * Copyright (c) 1998-2007,2008 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 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: ncurses.3x,v 1.91 2008/10/11 20:43:11 tom Exp @
+  * @Id: ncurses.3x,v 1.100 2010/10/02 23:30:31 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -63,17 +63,17 @@
        sonable   optimization.    This  implementation  is  ``new
        curses'' (ncurses) and is  the  approved  replacement  for
        4.4BSD  classic curses, which has been discontinued.  This
-       describes <STRONG>ncurses</STRONG> version 5.6 (patch 20081011).
+       describes <STRONG>ncurses</STRONG> version 5.7 (patch 20101002).
 
-       The <STRONG>ncurses</STRONG> library emulates  the  <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>  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 <STRONG>ncurses</STRONG> library
-       is freely redistributable  in  source  form.   Differences
-       from  the  SVr4 curses are summarized under the <STRONG>EXTENSIONS</STRONG>
-       and <STRONG>PORTABILITY</STRONG> sections below and described in detail  in
-       the  respective  <STRONG>EXTENSIONS</STRONG>, <STRONG>PORTABILITY</STRONG> and <STRONG>BUGS</STRONG> sections
-       of individual man pages.
+       The <STRONG>ncurses</STRONG> 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  <STRONG>ncurses</STRONG>  library  is
+       freely redistributable in source form.   Differences  from
+       the  SVr4  curses  are summarized under the <STRONG>EXTENSIONS</STRONG> and
+       <STRONG>PORTABILITY</STRONG> sections below and described in detail in  the
+       respective  <STRONG>EXTENSIONS</STRONG>,  <STRONG>PORTABILITY</STRONG>  and <STRONG>BUGS</STRONG> sections of
+       individual man pages.
 
        The <STRONG>ncurses</STRONG> library also provides many useful  extensions,
        i.e.,  features  which  cannot  be implemented by a simple
@@ -150,48 +150,48 @@
        Among those, the most basic routines are <STRONG>move</STRONG>  and  <STRONG>addch</STRONG>.
        More  general versions of these routines are included with
        names beginning with <STRONG>w</STRONG>, allowing the  user  to  specify  a
-       window.   The routines not beginning with <STRONG>w</STRONG> affect <STRONG>stdscr</STRONG>.
+       window.  The routines not beginning with <STRONG>w</STRONG> affect <STRONG>stdscr</STRONG>.
 
-       After using routines to manipulate a  window,  <STRONG>refresh</STRONG>  is
-       called,  telling <STRONG>curses</STRONG> to make the user's CRT screen look
-       like <STRONG>stdscr</STRONG>.  The characters in a window are  actually  of
-       type  <STRONG>chtype</STRONG>, (character and attribute data) so that other
-       information about the character may also  be  stored  with
+       After  using  routines  to manipulate a window, <STRONG>refresh</STRONG> is
+       called, telling <STRONG>curses</STRONG> to make the user's CRT screen  look
+       like  <STRONG>stdscr</STRONG>.   The characters in a window are actually of
+       type <STRONG>chtype</STRONG>, (character and attribute data) so that  other
+       information  about  the  character may also be stored with
        each character.
 
-       Special  windows  called  <EM>pads</EM>  may  also  be manipulated.
+       Special windows  called  <EM>pads</EM>  may  also  be  manipulated.
        These are windows which are not constrained to the size of
-       the  screen and whose contents need not be completely dis-
+       the screen and whose contents need not be completely  dis-
        played.  See <STRONG><A HREF="curs_pad.3x.html">curs_pad(3x)</A></STRONG> for more information.
 
-       In addition to drawing characters  on  the  screen,  video
-       attributes  and colors may be supported, causing the char-
-       acters to show up in such modes as underlined, in  reverse
-       video,  or in color on terminals that support such display
+       In  addition  to  drawing  characters on the screen, video
+       attributes and colors may be supported, causing the  char-
+       acters  to show up in such modes as underlined, in reverse
+       video, or in color on terminals that support such  display
        enhancements.  Line drawing characters may be specified to
-       be  output.   On  input,  <STRONG>curses</STRONG> is also able to translate
-       arrow and function keys  that  transmit  escape  sequences
-       into  single  values.   The video attributes, line drawing
-       characters,  and  input  values  use  names,  defined   in
+       be output.  On input, <STRONG>curses</STRONG> is  also  able  to  translate
+       arrow  and  function  keys  that transmit escape sequences
+       into single values.  The video  attributes,  line  drawing
+       characters,   and  input  values  use  names,  defined  in
        <STRONG>&lt;curses.h&gt;</STRONG>, such as <STRONG>A_REVERSE</STRONG>, <STRONG>ACS_HLINE</STRONG>, and <STRONG>KEY_LEFT</STRONG>.
 
        If the environment variables <STRONG>LINES</STRONG> and <STRONG>COLUMNS</STRONG> are set, or
-       if the program is executing in a window environment,  line
-       and  column  information  in the environment will override
+       if  the program is executing in a window environment, line
+       and column information in the  environment  will  override
        information read by <EM>terminfo</EM>.  This would affect a program
-       running  in an AT&amp;T 630 layer, for example, where the size
+       running in an AT&amp;T 630 layer, for example, where the  size
        of a screen is changeable (see <STRONG>ENVIRONMENT</STRONG>).
 
-       If the environment variable <STRONG>TERMINFO</STRONG> is defined, any  pro-
-       gram  using  <STRONG>curses</STRONG> checks for a local terminal definition
-       before checking in the standard place.   For  example,  if
+       If  the environment variable <STRONG>TERMINFO</STRONG> is defined, any pro-
+       gram using <STRONG>curses</STRONG> checks for a local  terminal  definition
+       before  checking  in  the standard place.  For example, if
        <STRONG>TERM</STRONG> is set to <STRONG>att4424</STRONG>, then the compiled terminal defini-
        tion is found in
 
              <STRONG>/usr/share/terminfo/a/att4424</STRONG>.
 
        (The <STRONG>a</STRONG> is copied from the first letter of <STRONG>att4424</STRONG> to avoid
-       creation  of  huge  directories.)  However, if <STRONG>TERMINFO</STRONG> is
+       creation of huge directories.)  However,  if  <STRONG>TERMINFO</STRONG>  is
        set to <STRONG>$HOME/myterms</STRONG>, <STRONG>curses</STRONG> first checks
 
              <STRONG>$HOME/myterms/a/att4424</STRONG>,
@@ -200,115 +200,115 @@
 
              <STRONG>/usr/share/terminfo/a/att4424</STRONG>.
 
-       This is useful for developing experimental definitions  or
+       This  is useful for developing experimental definitions or
        when write permission in <STRONG>/usr/share/terminfo</STRONG> is not avail-
        able.
 
-       The integer  variables  <STRONG>LINES</STRONG>  and  <STRONG>COLS</STRONG>  are  defined  in
-       <STRONG>&lt;curses.h&gt;</STRONG>  and will be filled in by <STRONG>initscr</STRONG> with the size
+       The  integer  variables  <STRONG>LINES</STRONG>  and  <STRONG>COLS</STRONG>  are  defined in
+       <STRONG>&lt;curses.h&gt;</STRONG> and will be filled in by <STRONG>initscr</STRONG> with the  size
        of the screen.  The constants <STRONG>TRUE</STRONG> and <STRONG>FALSE</STRONG> have the val-
        ues <STRONG>1</STRONG> and <STRONG>0</STRONG>, respectively.
 
-       The  <STRONG>curses</STRONG>  routines  also  define  the <STRONG>WINDOW</STRONG> <STRONG>*</STRONG> variable
+       The <STRONG>curses</STRONG> routines also  define  the  <STRONG>WINDOW</STRONG>  <STRONG>*</STRONG>  variable
        <STRONG>curscr</STRONG> which is used for certain low-level operations like
-       clearing  and  redrawing a screen containing garbage.  The
+       clearing and redrawing a screen containing  garbage.   The
        <STRONG>curscr</STRONG> can be used in only a few routines.
 
    <STRONG>Routine</STRONG> <STRONG>and</STRONG> <STRONG>Argument</STRONG> <STRONG>Names</STRONG>
-       Many <STRONG>curses</STRONG> routines have two or more versions.  The  rou-
+       Many  <STRONG>curses</STRONG> routines have two or more versions.  The rou-
        tines prefixed with <STRONG>w</STRONG> require a window argument.  The rou-
        tines prefixed with <STRONG>p</STRONG> require a pad argument.  Those with-
        out a prefix generally use <STRONG>stdscr</STRONG>.
 
        The routines prefixed with <STRONG>mv</STRONG> require a <EM>y</EM> and <EM>x</EM> coordinate
-       to move to before performing the appropriate action.   The
-       <STRONG>mv</STRONG>  routines  imply  a call to <STRONG>move</STRONG> before the call to the
-       other routine.  The coordinate <EM>y</EM> always refers to the  row
-       (of  the  window), and <EM>x</EM> always refers to the column.  The
+       to  move to before performing the appropriate action.  The
+       <STRONG>mv</STRONG> routines imply a call to <STRONG>move</STRONG> before the  call  to  the
+       other  routine.  The coordinate <EM>y</EM> always refers to the row
+       (of the window), and <EM>x</EM> always refers to the  column.   The
        upper left-hand corner is always (0,0), not (1,1).
 
        The routines prefixed with <STRONG>mvw</STRONG> take both a window argument
-       and  <EM>x</EM>  and  <EM>y</EM> coordinates.  The window argument is always
+       and <EM>x</EM> and <EM>y</EM> coordinates.  The window  argument  is  always
        specified before the coordinates.
 
-       In each case, <EM>win</EM> is the window affected, and <EM>pad</EM>  is  the
+       In  each  case, <EM>win</EM> is the window affected, and <EM>pad</EM> is the
        pad affected; <EM>win</EM> and <EM>pad</EM> are always pointers to type <STRONG>WIN-</STRONG>
        <STRONG>DOW</STRONG>.
 
        Option setting routines require a Boolean flag <EM>bf</EM> with the
-       value  <STRONG>TRUE</STRONG>  or <STRONG>FALSE</STRONG>; <EM>bf</EM> is always of type <STRONG>bool</STRONG>.  Most of
-       the data types used in the library routines, such as  <STRONG>WIN-</STRONG>
-       <STRONG>DOW</STRONG>,  <STRONG>SCREEN</STRONG>,  <STRONG>bool</STRONG>, and <STRONG>chtype</STRONG> are defined in <STRONG>&lt;curses.h&gt;</STRONG>.
-       Types used for the terminfo routines such as <STRONG>TERMINAL</STRONG>  are
+       value <STRONG>TRUE</STRONG> or <STRONG>FALSE</STRONG>; <EM>bf</EM> is always of type <STRONG>bool</STRONG>.   Most  of
+       the  data types used in the library routines, such as <STRONG>WIN-</STRONG>
+       <STRONG>DOW</STRONG>, <STRONG>SCREEN</STRONG>, <STRONG>bool</STRONG>, and <STRONG>chtype</STRONG> are defined  in  <STRONG>&lt;curses.h&gt;</STRONG>.
+       Types  used for the terminfo routines such as <STRONG>TERMINAL</STRONG> are
        defined in <STRONG>&lt;term.h&gt;</STRONG>.
 
-       This  manual  page describes functions which may appear in
-       any configuration of the library.  There  are  two  common
+       This manual page describes functions which may  appear  in
+       any  configuration  of  the library.  There are two common
        configurations of the library:
 
               ncurses
                    the  "normal"  library,  which  handles  8-bit
                    characters.  The normal (8-bit) library stores
-                   characters  combined with attributes in <STRONG>chtype</STRONG>
+                   characters combined with attributes in  <STRONG>chtype</STRONG>
                    data.
 
-                   Attributes alone (no corresponding  character)
-                   may  be  stored  in  <STRONG>chtype</STRONG>  or the equivalent
-                   <STRONG>attr_t</STRONG> data.  In  either  case,  the  data  is
+                   Attributes  alone (no corresponding character)
+                   may be stored  in  <STRONG>chtype</STRONG>  or  the  equivalent
+                   <STRONG>attr_t</STRONG>  data.   In  either  case,  the data is
                    stored in something like an integer.
 
-                   Each  cell  (row  and  column)  in a <STRONG>WINDOW</STRONG> is
+                   Each cell (row and  column)  in  a  <STRONG>WINDOW</STRONG>  is
                    stored as a <STRONG>chtype</STRONG>.
 
               ncursesw
-                   the so-called "wide"  library,  which  handles
-                   multibyte   characters  (See  the  section  on
+                   the  so-called  "wide"  library, which handles
+                   multibyte  characters  (see  the  section   on
                    <STRONG>ALTERNATE</STRONG> <STRONG>CONFIGURATIONS</STRONG>).  The "wide" library
-                   includes  all  of  the calls from the "normal"
-                   library.  It adds about one third  more  calls
+                   includes all of the calls  from  the  "normal"
+                   library.   It  adds about one third more calls
                    using data types which store multibyte charac-
                    ters:
 
                    <STRONG>cchar_t</STRONG>
-                        corresponds to <STRONG>chtype</STRONG>.  However it  is  a
-                        structure,  because  more  data is stored
-                        than can fit into an integer.  The  char-
+                        corresponds  to  <STRONG>chtype</STRONG>.  However it is a
+                        structure, because more  data  is  stored
+                        than  can fit into an integer.  The char-
                         acters 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  sepa-
+                        integer  value  -  and  there may be more
+                        than one character per cell.   The  video
+                        attributes  and color are stored in sepa-
                         rate fields of the structure.
 
                         Each cell (row and column) in a <STRONG>WINDOW</STRONG> is
                         stored as a <STRONG>cchar_t</STRONG>.
 
                    <STRONG>wchar_t</STRONG>
-                        stores a "wide" character.  Like  <STRONG>chtype</STRONG>,
+                        stores  a "wide" character.  Like <STRONG>chtype</STRONG>,
                         this may be an integer.
 
                    <STRONG>wint_t</STRONG>
-                        stores  a <STRONG>wchar_t</STRONG> or <STRONG>WEOF</STRONG> - not the same,
+                        stores a <STRONG>wchar_t</STRONG> or <STRONG>WEOF</STRONG> - not the  same,
                         though both may have the same size.
 
                    The  "wide"  library  provides  new  functions
-                   which  are analogous to functions in the "nor-
-                   mal" library.  There is  a  naming  convention
-                   which  relates  many  of the normal/wide vari-
-                   ants: a "_w" is inserted into the  name.   For
+                   which are analogous to functions in the  "nor-
+                   mal"  library.   There  is a naming convention
+                   which relates many of  the  normal/wide  vari-
+                   ants:  a  "_w" is inserted into the name.  For
                    example, <STRONG>waddch</STRONG> becomes <STRONG>wadd_wch</STRONG>.
 
-
    <STRONG>Routine</STRONG> <STRONG>Name</STRONG> <STRONG>Index</STRONG>
        The following table lists each <STRONG>curses</STRONG> routine and the name
-       of the manual page on which  it  is  described.   Routines
-       flagged  with  `*'  are ncurses-specific, not described by
+       of  the  manual  page  on which it is described.  Routines
+       flagged with `*' are ncurses-specific,  not  described  by
        XPG4 or present in SVr4.
 
-
               <STRONG>curses</STRONG> Routine Name     Manual Page Name
               --------------------------------------------
               COLOR_PAIR              <STRONG><A HREF="curs_color.3x.html">curs_color(3x)</A></STRONG>
               PAIR_NUMBER             <STRONG><A HREF="curs_attr.3x.html">curs_attr(3x)</A></STRONG>
+              _nc_free_and_exit       <STRONG><A HREF="curs_memleaks.3x.html">curs_memleaks(3x)</A></STRONG>*
+              _nc_freeall             <STRONG><A HREF="curs_memleaks.3x.html">curs_memleaks(3x)</A></STRONG>*
               _nc_tracebits           <STRONG><A HREF="curs_trace.3x.html">curs_trace(3x)</A></STRONG>*
 
               _traceattr              <STRONG><A HREF="curs_trace.3x.html">curs_trace(3x)</A></STRONG>*
@@ -750,14 +750,14 @@
 
 </PRE>
 <H2>RETURN VALUE</H2><PRE>
-       Routines that return an integer return  <STRONG>ERR</STRONG>  upon  failure
-       and  an  integer value other than <STRONG>ERR</STRONG> upon successful com-
-       pletion, unless otherwise noted in  the  routine  descrip-
+       Routines  that  return  an integer return <STRONG>ERR</STRONG> upon failure
+       and an integer value other than <STRONG>ERR</STRONG> upon  successful  com-
+       pletion,  unless  otherwise  noted in the routine descrip-
        tions.
 
-       All  macros  return  the  value  of  the <STRONG>w</STRONG> version, except
+       All macros return the  value  of  the  <STRONG>w</STRONG>  version,  except
        <STRONG>setscrreg</STRONG>, <STRONG>wsetscrreg</STRONG>, <STRONG>getyx</STRONG>, <STRONG>getbegyx</STRONG>, and <STRONG>getmaxyx</STRONG>.  The
-       return  values  of <STRONG>setscrreg</STRONG>, <STRONG>wsetscrreg</STRONG>, <STRONG>getyx</STRONG>, <STRONG>getbegyx</STRONG>,
+       return values of <STRONG>setscrreg</STRONG>, <STRONG>wsetscrreg</STRONG>,  <STRONG>getyx</STRONG>,  <STRONG>getbegyx</STRONG>,
        and <STRONG>getmaxyx</STRONG> are undefined (i.e., these should not be used
        as the right-hand side of assignment statements).
 
@@ -771,18 +771,23 @@
        important ones have been already discussed in detail.
 
        BAUDRATE
-            The  debugging library checks this environment symbol
+            The debugging library checks this environment  symbol
             when the application has redirected output to a file.
-            The  symbol's numeric value is used for the baudrate.
+            The symbol's numeric value is used for the  baudrate.
             If no value is found, <STRONG>ncurses</STRONG> uses 9600.  This allows
-            testers  to construct repeatable test-cases that take
+            testers to construct repeatable test-cases that  take
             into account costs that depend on baudrate.
 
        CC   When set, change occurrences of the command_character
-            (i.e.,  the  <STRONG>cmdch</STRONG> capability) of the loaded terminfo
-            entries to the value of this symbol.  Very  few  ter-
+            (i.e., the <STRONG>cmdch</STRONG> capability) of the  loaded  terminfo
+            entries  to  the value of this symbol.  Very few ter-
             minfo entries provide this feature.
 
+            Because this name is also used in  development  envi-
+            ronments  to represent the C compiler's name, <STRONG>ncurses</STRONG>
+            ignores it if it does not happen to be a single char-
+            acter.
+
        COLUMNS
             Specify  the  width  of  the  screen  in  characters.
             Applications running in a windowing environment  usu-
@@ -851,11 +856,11 @@
 
        LINES
             Like COLUMNS, specify the height  of  the  screen  in
-            characters.   See COLUMNS for a detailed description.
+            characters.  See COLUMNS for a detailed description.
 
        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
+            the order of buttons on the mouse.   OS/2  numbers  a
             3-button mouse inconsistently from other platforms:
 
             1 = left
@@ -863,203 +868,204 @@
             3 = middle.
 
             This symbol lets you customize the mouse.  The symbol
-            must  be three numeric digits 1-3 in any order, e.g.,
-            123 or 321.  If it is  not  specified,  <STRONG>ncurses</STRONG>  uses
+            must be three numeric digits 1-3 in any order,  e.g.,
+            123  or  321.   If  it is not specified, <STRONG>ncurses</STRONG> uses
             132.
 
        NCURSES_ASSUMED_COLORS
-            Override  the  compiled-in assumption that the termi-
-            nal's  default   colors   are   white-on-black   (see
-            <STRONG><A HREF="default_colors.3x.html">default_colors(3x)</A></STRONG>).   You may set the foreground and
-            background color values with this  environment  vari-
-            able  by  proving  a 2-element list: foreground,back-
-            ground.  For example, to tell ncurses to  not  assume
-            anything  about  the colors, set this to "-1,-1".  To
-            make it green-on-black, set it to "2,0".   Any  posi-
+            Override the compiled-in assumption that  the  termi-
+            nal's   default   colors   are   white-on-black  (see
+            <STRONG><A HREF="default_colors.3x.html">default_colors(3x)</A></STRONG>).  You may set the foreground  and
+            background  color  values with this environment vari-
+            able by proving a  2-element  list:  foreground,back-
+            ground.   For  example, to tell ncurses to not assume
+            anything about the colors, set this to  "-1,-1".   To
+            make  it  green-on-black, set it to "2,0".  Any posi-
             tive value from zero to the terminfo <STRONG>max_colors</STRONG> value
             is allowed.
 
        NCURSES_GPM_TERMS
-            This applies only to ncurses configured  to  use  the
+            This  applies  only  to ncurses configured to use the
             GPM interface.
 
             If present, the environment variable is a list of one
-            or more terminal names against which the  TERM  envi-
-            ronment  variable is matched.  Setting it to an empty
-            value disables the GPM interface; using the  built-in
+            or  more  terminal names against which the TERM envi-
+            ronment variable is matched.  Setting it to an  empty
+            value  disables the GPM interface; using the built-in
             support for xterm, etc.
 
-            If  the  environment variable is absent, ncurses will
+            If the environment variable is absent,  ncurses  will
             attempt to open GPM if TERM contains "linux".
 
        NCURSES_NO_HARD_TABS
-            <STRONG>Ncurses</STRONG> may use tabs as part of the  cursor  movement
-            optimization.   In  some  cases, your terminal driver
-            may not handle these properly.  Set this  environment
+            <STRONG>Ncurses</STRONG>  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 <STRONG>stty</STRONG> settings to avoid the problem.
 
        NCURSES_NO_MAGIC_COOKIES
             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 termi-
+            requires special handling to  make  highlighting  and
+            other  video  attributes  display  properly.  You can
+            suppress the highlighting entirely for  these  termi-
             nals by setting this environment variable.
 
        NCURSES_NO_PADDING
-            Most of the terminal  descriptions  in  the  terminfo
-            database  are  written for real "hardware" terminals.
-            Many people use terminal emulators  which  run  in  a
-            windowing    environment    and    use   curses-based
-            applications.  Terminal emulators can  duplicate  all
-            of  the important aspects of a hardware terminal, but
-            they do not have the  same  limitations.   The  chief
-            limitation of a hardware terminal from the standpoint
-            of your application is the  management  of  dataflow,
-            i.e.,  timing.   Unless a hardware terminal is inter-
-            faced into a terminal concentrator (which  does  flow
-            control),   it  (or  your  application)  must  manage
-            dataflow, preventing overruns.  The cheapest solution
-            (no  hardware cost) is for your program to do this by
-            pausing  after  operations  that  the  terminal  does
-            slowly, such as clearing the display.
-
-            As  a  result,  many terminal descriptions (including
-            the vt100) have delay times embedded.  You  may  wish
-            to  use  these  descriptions, but not want to pay the
+            Most  of  the  terminal  descriptions in the terminfo
+            database are written for real  "hardware"  terminals.
+            Many  people  use  terminal  emulators which run in a
+            windowing environment and use  curses-based  applica-
+            tions.   Terminal  emulators can duplicate all of the
+            important aspects of a hardware terminal, but they do
+            not  have the same limitations.  The chief limitation
+            of a hardware terminal from the  standpoint  of  your
+            application is the management of dataflow, i.e., tim-
+            ing.  Unless a hardware terminal is interfaced into a
+            terminal  concentrator  (which does flow control), it
+            (or your application) must manage dataflow,  prevent-
+            ing  overruns.   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.
+
+            As a result, many  terminal  descriptions  (including
+            the  vt100)  have delay times embedded.  You may wish
+            to use these descriptions, but not want  to  pay  the
             performance penalty.
 
-            Set the NCURSES_NO_PADDING symbol to disable all  but
-            mandatory  padding.   Mandatory  padding is used as a
+            Set  the NCURSES_NO_PADDING symbol to disable all but
+            mandatory padding.  Mandatory padding is  used  as  a
             part of special control sequences such as <EM>flash</EM>.
 
        NCURSES_NO_SETBUF
-            Normally <STRONG>ncurses</STRONG> enables buffered output during  ter-
-            minal  initialization.   This  is  done  (as  in SVr4
-            curses) for performance reasons.   For  testing  pur-
+            Normally  <STRONG>ncurses</STRONG> enables buffered output during ter-
+            minal initialization.   This  is  done  (as  in  SVr4
+            curses)  for  performance  reasons.  For testing pur-
             poses, both of <STRONG>ncurses</STRONG> and certain applications, this
             feature    is    made    optional.     Setting    the
             NCURSES_NO_SETBUF variable disables output buffering,
-            leaving the output  in  the  original  (usually  line
+            leaving  the  output  in  the  original (usually line
             buffered) mode.
 
        NCURSES_NO_UTF8_ACS
             During initialization, the <STRONG>ncurses</STRONG> library checks for
-            special cases where VT100 line-drawing (and the  cor-
-            responding   alternate  character  set  capabilities)
-            described in the terminfo are known  to  be  missing.
-            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.  Doing this
-            tells ncurses to use Unicode values which  correspond
+            special  cases where VT100 line-drawing (and the cor-
+            responding  alternate  character  set   capabilities)
+            described  in  the  terminfo are known to be missing.
+            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.   Doing  this
+            tells  ncurses to use Unicode values which correspond
             to the VT100 line-drawing glyphs.  That works for the
             special cases cited, and is likely to work for termi-
             nal emulators.
 
-            When  setting  this  variable, you should set it to a
-            nonzero value.  Setting it to zero (or to  a  nonnum-
-            ber) disables the special check for Linux and screen.
+            When setting this variable, you should set  it  to  a
+            nonzero  value.   Setting it to zero (or to a nonnum-
+            ber) disables  the  special  check  for  "linux"  and
+            "screen".
 
        NCURSES_TRACE
-            During initialization, the <STRONG>ncurses</STRONG> debugging  library
-            checks  the  NCURSES_TRACE symbol.  If it is defined,
+            During  initialization, the <STRONG>ncurses</STRONG> debugging library
+            checks the NCURSES_TRACE symbol.  If it  is  defined,
             to a numeric value, <STRONG>ncurses</STRONG> calls the <STRONG>trace</STRONG> function,
             using that value as the argument.
 
-            The  argument  values, which are defined in <STRONG>curses.h</STRONG>,
-            provide several types of information.   When  running
-            with  traces enabled, your application will write the
+            The argument values, which are defined  in  <STRONG>curses.h</STRONG>,
+            provide  several  types of information.  When running
+            with traces enabled, your application will write  the
             file <STRONG>trace</STRONG> to the current directory.
 
-       TERM Denotes your terminal type.  Each  terminal  type  is
+       TERM Denotes  your  terminal  type.  Each terminal type is
             distinct, though many are similar.
 
        TERMCAP
             If the <STRONG>ncurses</STRONG> library has been configured with <EM>term-</EM>
-            <EM>cap</EM> support, <STRONG>ncurses</STRONG>  will  check  for  a  terminal's
+            <EM>cap</EM>  support,  <STRONG>ncurses</STRONG>  will  check  for a terminal's
             description in termcap form if it is not available in
             the terminfo database.
 
-            The  TERMCAP  symbol  contains  either   a   terminal
-            description  (with  newlines stripped out), or a file
-            name telling where the  information  denoted  by  the
-            TERM  symbol  exists.   In  either  case,  setting it
-            directs <STRONG>ncurses</STRONG> to ignore the usual  place  for  this
+            The   TERMCAP   symbol  contains  either  a  terminal
+            description (with newlines stripped out), or  a  file
+            name  telling  where  the  information denoted by the
+            TERM symbol  exists.   In  either  case,  setting  it
+            directs  <STRONG>ncurses</STRONG>  to  ignore the usual place for this
             information, e.g., /etc/termcap.
 
        TERMINFO
             Overrides the directory in which <STRONG>ncurses</STRONG> searches for
             your terminal description.  This is the simplest, but
-            not  the  only way to change the list of directories.
+            not the only way to change the list  of  directories.
             The complete list of directories in order follows:
 
-            -  the last directory to which <STRONG>ncurses</STRONG> wrote, if any,
-               is searched first
+            <STRONG>o</STRONG>   the  last  directory  to  which <STRONG>ncurses</STRONG> wrote, if
+                any, is searched first
 
-            -  the directory specified by the TERMINFO symbol
+            <STRONG>o</STRONG>   the directory specified by the TERMINFO symbol
 
-            -  $HOME/.terminfo
+            <STRONG>o</STRONG>   $HOME/.terminfo
 
-            -  directories listed in the TERMINFO_DIRS symbol
+            <STRONG>o</STRONG>   directories listed in the TERMINFO_DIRS symbol
 
-            -  one or more directories whose names are configured
-               and  compiled  into  the  ncurses  library,  e.g.,
-               /usr/share/terminfo
+            <STRONG>o</STRONG>   one or more directories whose names  are  config-
+                ured and compiled into the ncurses library, e.g.,
+                /usr/share/terminfo
 
        TERMINFO_DIRS
-            Specifies  a list of directories to search for termi-
-            nal descriptions.  The list is  separated  by  colons
-            (i.e.,  ":") on Unix, semicolons on OS/2 EMX.  All of
+            Specifies a list of directories to search for  termi-
+            nal  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
+            makes a subdirectory named for the  first  letter  of
             the terminal names therein.
 
        TERMPATH
-            If TERMCAP does not hold a  file  name  then  <STRONG>ncurses</STRONG>
-            checks  the TERMPATH symbol.  This is a list of file-
-            names separated by spaces or colons  (i.e.,  ":")  on
+            If  TERMCAP  does  not  hold a file name then <STRONG>ncurses</STRONG>
+            checks the TERMPATH symbol.  This is a list of  file-
+            names  separated  by  spaces or colons (i.e., ":") on
             Unix, semicolons on OS/2 EMX.  If the TERMPATH symbol
-            is not set, <STRONG>ncurses</STRONG> looks in the files  /etc/termcap,
-            /usr/share/misc/termcap  and  $HOME/.termcap, in that
+            is  not set, <STRONG>ncurses</STRONG> looks in the files /etc/termcap,
+            /usr/share/misc/termcap and $HOME/.termcap,  in  that
             order.
 
-       The library may be configured to disregard  the  following
-       variables  when  the current user is the superuser (root),
-       or if the application uses setuid or  setgid  permissions:
+       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:
        $TERMINFO, $TERMINFO_DIRS, $TERMPATH, as well as $HOME.
 
 
 </PRE>
 <H2>ALTERNATE CONFIGURATIONS</H2><PRE>
-       Several  different  configurations are possible, depending
-       on  the  configure  script  options  used  when   building
-       <STRONG>ncurses</STRONG>.   There  are a few main options whose effects are
+       Several different configurations are  possible,  depending
+       on   the  configure  script  options  used  when  building
+       <STRONG>ncurses</STRONG>.  There are a few main options whose  effects  are
        visible to the applications developer using <STRONG>ncurses</STRONG>:
 
        --disable-overwrite
-            The standard include for <STRONG>ncurses</STRONG> is as noted in  <STRONG>SYN-</STRONG>
+            The  standard include for <STRONG>ncurses</STRONG> is as noted in <STRONG>SYN-</STRONG>
             <STRONG>OPSIS</STRONG>:
 
             <STRONG>#include</STRONG> <STRONG>&lt;curses.h&gt;</STRONG>
 
-            This  option is used to avoid filename conflicts when
-            <STRONG>ncurses</STRONG> is not the main implementation of  curses  of
-            the  computer.   If  <STRONG>ncurses</STRONG>  is  installed disabling
-            overwrite, it puts its  headers  in  a  subdirectory,
+            This option is used to avoid filename conflicts  when
+            <STRONG>ncurses</STRONG>  is  not the main implementation of curses of
+            the computer.   If  <STRONG>ncurses</STRONG>  is  installed  disabling
+            overwrite,  it  puts  its  headers in a subdirectory,
             e.g.,
 
             <STRONG>#include</STRONG> <STRONG>&lt;ncurses/curses.h&gt;</STRONG>
 
-            It  also  omits a symbolic link which would allow you
+            It also omits a symbolic link which would  allow  you
             to use <STRONG>-lcurses</STRONG> to build executables.
 
        --enable-widec
-            The configure script renames the library and (if  the
-            <STRONG>--disable-overwrite</STRONG>  option  is used) puts the header
+            The  configure script renames the library and (if the
+            <STRONG>--disable-overwrite</STRONG> option is used) puts  the  header
             files  in  a  different  subdirectory.   All  of  the
-            library  names  have  a  "w"  appended to them, i.e.,
+            library names have a  "w"  appended  to  them,  i.e.,
             instead of
 
             <STRONG>-lncurses</STRONG>
@@ -1069,16 +1075,16 @@
             <STRONG>-lncursesw</STRONG>
 
             You must also define <STRONG>_XOPEN_SOURCE_EXTENDED</STRONG> when com-
-            piling  for  the  wide-character  library  to use the
-            extended (wide-character)  functions.   The  <STRONG>curses.h</STRONG>
-            file   which  is  installed  for  the  wide-character
-            library is designed to be compatible with the  normal
+            piling for the  wide-character  library  to  use  the
+            extended  (wide-character)  functions.   The <STRONG>curses.h</STRONG>
+            file  which  is  installed  for  the   wide-character
+            library  is designed to be compatible with the normal
             library's header.  Only the size of the <STRONG>WINDOW</STRONG> struc-
-            ture differs, and very few applications require  more
-            than  a  pointer  to  <STRONG>WINDOW</STRONG>s.   If  the  headers are
-            installed  allowing  overwrite,  the   wide-character
-            library's  headers should be installed last, to allow
-            applications to be built using  either  library  from
+            ture  differs, and very few applications require more
+            than a  pointer  to  <STRONG>WINDOW</STRONG>s.   If  the  headers  are
+            installed   allowing  overwrite,  the  wide-character
+            library's headers should be installed last, to  allow
+            applications  to  be  built using either library from
             the same set of headers.
 
        --with-shared
@@ -1088,16 +1094,16 @@
        --with-debug
 
        --with-profile
-            The  shared  and normal (static) library names differ
-            by their  suffixes,  e.g.,  <STRONG>libncurses.so</STRONG>  and  <STRONG>libn-</STRONG>
-            <STRONG>curses.a</STRONG>.   The  debug  and profiling libraries add a
+            The shared and normal (static) library  names  differ
+            by  their  suffixes,  e.g.,  <STRONG>libncurses.so</STRONG>  and <STRONG>libn-</STRONG>
+            <STRONG>curses.a</STRONG>.  The debug and profiling  libraries  add  a
             "_g" and a "_p" to the root names respectively, e.g.,
             <STRONG>libncurses_g.a</STRONG> and <STRONG>libncurses_p.a</STRONG>.
 
        --with-trace
-            The  <STRONG>trace</STRONG>  function  normally  resides  in the debug
+            The <STRONG>trace</STRONG> function  normally  resides  in  the  debug
             library, but it is sometimes useful to configure this
-            in  the  shared  library.   Configure  scripts should
+            in the  shared  library.   Configure  scripts  should
             check for the function's existence rather than assum-
             ing it is always in the debug library.
 
@@ -1105,15 +1111,16 @@
 </PRE>
 <H2>FILES</H2><PRE>
        /usr/share/tabset
-            directory  containing  initialization  files  for the
+            directory containing  initialization  files  for  the
             terminal capability database /usr/share/terminfo ter-
             minal capability database
 
 
 </PRE>
 <H2>SEE ALSO</H2><PRE>
-       <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>  and  related  pages whose names begin "curs_"
+       <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG> and related pages whose  names  begin  "curs_"
        for detailed routine descriptions.
+       <STRONG><A HREF="curs_variables.3x.html">curs_variables(3x)</A></STRONG>
 
 
 </PRE>
@@ -1121,79 +1128,86 @@
        The  <STRONG>ncurses</STRONG>  library  can  be  compiled  with  an  option
        (<STRONG>-DUSE_GETCAP</STRONG>) that falls back to the old-style /etc/term-
        cap file if the terminal setup code cannot find a terminfo
-       entry  corresponding  to <STRONG>TERM</STRONG>.  Use of this feature is not
-       recommended, as it essentially includes an entire  termcap
-       compiler  in the <STRONG>ncurses</STRONG> startup code, at significant cost
+       entry corresponding to <STRONG>TERM</STRONG>.  Use of this feature  is  not
+       recommended,  as it essentially includes an entire termcap
+       compiler in the <STRONG>ncurses</STRONG> startup code, at significant  cost
        in core and startup cycles.
 
-       The <STRONG>ncurses</STRONG>  library  includes  facilities  for  capturing
-       mouse  events on certain terminals (including xterm).  See
+       The  <STRONG>ncurses</STRONG>  library  includes  facilities  for capturing
+       mouse events on certain terminals (including xterm).   See
        the <STRONG><A HREF="curs_mouse.3x.html">curs_mouse(3x)</A></STRONG> manual page for details.
 
-       The <STRONG>ncurses</STRONG> library includes facilities for responding  to
-       window  resizing  events,  e.g., when running in an xterm.
-       See the <STRONG><A HREF="resizeterm.3x.html">resizeterm(3x)</A></STRONG> and <STRONG><A HREF="wresize.3x.html">wresize(3x)</A></STRONG>  manual  pages  for
-       details.   In addition, the library may be configured with
+       The  <STRONG>ncurses</STRONG> library includes facilities for responding to
+       window resizing events, e.g., when running  in  an  xterm.
+       See  the  <STRONG><A HREF="resizeterm.3x.html">resizeterm(3x)</A></STRONG>  and <STRONG><A HREF="wresize.3x.html">wresize(3x)</A></STRONG> manual pages for
+       details.  In addition, the library may be configured  with
        a SIGWINCH handler.
 
-       The <STRONG>ncurses</STRONG> library extends the fixed set of function  key
-       capabilities  of  terminals  by  allowing  the application
-       designer to define additional key  sequences  at  runtime.
+       The  <STRONG>ncurses</STRONG> library extends the fixed set of function key
+       capabilities of  terminals  by  allowing  the  application
+       designer  to  define  additional key sequences at runtime.
        See the <STRONG><A HREF="define_key.3x.html">define_key(3x)</A></STRONG> <STRONG><A HREF="key_defined.3x.html">key_defined(3x)</A></STRONG>, and <STRONG><A HREF="keyok.3x.html">keyok(3x)</A></STRONG> man-
        ual pages for details.
 
        The <STRONG>ncurses</STRONG> library can exploit the capabilities of termi-
-       nals  which  implement the ISO-6429 SGR 39 and SGR 49 con-
+       nals which implement the ISO-6429 SGR 39 and SGR  49  con-
        trols, 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  col-
-       ored  text  on  a  background  whose color is set indepen-
-       dently, providing better  control  over  color  contrasts.
+       its original foreground and background colors.   From  the
+       users'  perspective,  the application is able to draw col-
+       ored text on a background  whose  color  is  set  indepen-
+       dently,  providing  better  control  over color contrasts.
        See the <STRONG><A HREF="default_colors.3x.html">default_colors(3x)</A></STRONG> manual page for details.
 
-       The  <STRONG>ncurses</STRONG>  library  includes  a  function for directing
-       application output to a printer attached to  the  terminal
+       The <STRONG>ncurses</STRONG> library  includes  a  function  for  directing
+       application  output  to a printer attached to the terminal
        device.  See the <STRONG><A HREF="curs_print.3x.html">curs_print(3x)</A></STRONG> manual page for details.
 
 
 </PRE>
 <H2>PORTABILITY</H2><PRE>
-       The  <STRONG>ncurses</STRONG>  library is intended to be BASE-level confor-
+       The <STRONG>ncurses</STRONG> library is intended to be  BASE-level  confor-
        mant with XSI Curses.  The EXTENDED XSI Curses functional-
        ity (including color support) is supported.
 
-       A  small  number of local differences (that is, individual
-       differences between the XSI Curses and <STRONG>ncurses</STRONG> calls)  are
-       described  in  <STRONG>PORTABILITY</STRONG>  sections  of  the  library man
+       A small number of local differences (that  is,  individual
+       differences  between the XSI Curses and <STRONG>ncurses</STRONG> calls) are
+       described in  <STRONG>PORTABILITY</STRONG>  sections  of  the  library  man
        pages.
 
        This implementation also contains several extensions:
 
-            The routine <STRONG>has_key</STRONG> is not part of XPG4,  nor  is  it
-            present  in SVr4.  See the <STRONG><A HREF="curs_getch.3x.html">curs_getch(3x)</A></STRONG> manual page
-            for details.
-
-            The routine <STRONG>slk_attr</STRONG> is not part of XPG4, nor  is  it
-            present  in  SVr4.   See the <STRONG><A HREF="curs_slk.3x.html">curs_slk(3x)</A></STRONG> manual page
-            for details.
-
-            The routines <STRONG>getmouse</STRONG>,  <STRONG>mousemask</STRONG>,  <STRONG>ungetmouse</STRONG>,  <STRONG>mou-</STRONG>
-            <STRONG>seinterval</STRONG>,  and <STRONG>wenclose</STRONG> relating to mouse interfac-
-            ing are not part of XPG4, nor  are  they  present  in
-            SVr4.    See   the  <STRONG><A HREF="curs_mouse.3x.html">curs_mouse(3x)</A></STRONG>  manual  page  for
-            details.
-
-            The routine <STRONG>mcprint</STRONG> was not present in  any  previous
-            curses implementation.  See the <STRONG><A HREF="curs_print.3x.html">curs_print(3x)</A></STRONG> manual
-            page for details.
-
-            The routine <STRONG>wresize</STRONG> is not part of XPG4,  nor  is  it
-            present in SVr4.  See the <STRONG><A HREF="wresize.3x.html">wresize(3x)</A></STRONG> manual page for
-            details.
-
-            The WINDOW structure's internal details can be hidden
-            from  application  programs.  See <STRONG><A HREF="curs_opaque.3x.html">curs_opaque(3x)</A></STRONG> for
-            the discussion of <STRONG>is_scrollok</STRONG>, etc.
+       <STRONG>o</STRONG>   The  routine  <STRONG>has_key</STRONG>  is  not part of XPG4, nor is it
+           present in SVr4.  See the <STRONG><A HREF="curs_getch.3x.html">curs_getch(3x)</A></STRONG>  manual  page
+           for details.
+
+       <STRONG>o</STRONG>   The  routine  <STRONG>slk_attr</STRONG>  is not part of XPG4, nor is it
+           present in SVr4.  See the <STRONG><A HREF="curs_slk.3x.html">curs_slk(3x)</A></STRONG> manual page for
+           details.
+
+       <STRONG>o</STRONG>   The routines <STRONG>getmouse</STRONG>, <STRONG>mousemask</STRONG>, <STRONG>ungetmouse</STRONG>, <STRONG>mousein-</STRONG>
+           <STRONG>terval</STRONG>, and <STRONG>wenclose</STRONG> relating to mouse interfacing are
+           not  part  of XPG4, nor are they present in SVr4.  See
+           the <STRONG><A HREF="curs_mouse.3x.html">curs_mouse(3x)</A></STRONG> manual page for details.
+
+       <STRONG>o</STRONG>   The routine <STRONG>mcprint</STRONG> was not present  in  any  previous
+           curses  implementation.  See the <STRONG><A HREF="curs_print.3x.html">curs_print(3x)</A></STRONG> manual
+           page for details.
+
+       <STRONG>o</STRONG>   The routine <STRONG>wresize</STRONG> is not part of  XPG4,  nor  is  it
+           present  in SVr4.  See the <STRONG><A HREF="wresize.3x.html">wresize(3x)</A></STRONG> manual page for
+           details.
+
+       <STRONG>o</STRONG>   The WINDOW structure's internal details can be  hidden
+           from  application  programs.   See <STRONG><A HREF="curs_opaque.3x.html">curs_opaque(3x)</A></STRONG> for
+           the discussion of <STRONG>is_scrollok</STRONG>, etc.
+
+       <STRONG>o</STRONG>   This implementation can be configured to provide rudi-
+           mentary  support for multi-threaded applications.  See
+           <STRONG><A HREF="curs_threads.3x.html">curs_threads(3x)</A></STRONG> for details.
+
+       <STRONG>o</STRONG>   This implementation can also be configured to  provide
+           a set of functions which improve the ability to manage
+           multiple screens.  See <STRONG><A HREF="curs_sp_funcs.3x.html">curs_sp_funcs(3x)</A></STRONG> for details.
 
        In historic curses versions, delays embedded in the  capa-
        bilities <STRONG>cr</STRONG>, <STRONG>ind</STRONG>, <STRONG>cub1</STRONG>, <STRONG>ff</STRONG> and <STRONG>tab</STRONG> activated corresponding
diff -Naur ncurses-5.7.orig/doc/html/man/ncurses5-config.1.html ncurses-5.7/doc/html/man/ncurses5-config.1.html
--- ncurses-5.7.orig/doc/html/man/ncurses5-config.1.html	1969-12-31 19:00:00.000000000 -0500
+++ ncurses-5.7/doc/html/man/ncurses5-config.1.html	2011-01-08 18:18:29.358656498 -0500
@@ -0,0 +1,133 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
+<!-- 
+  ****************************************************************************
+  * 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 @
+-->
+<HTML>
+<HEAD>
+<TITLE>ncurses5-config 1</TITLE>
+<link rev=made href="mailto:bug-ncurses@gnu.org">
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+</HEAD>
+<BODY>
+<H1>ncurses5-config 1</H1>
+<HR>
+<PRE>
+<!-- Manpage converted by man2html 3.0.1 -->
+<STRONG><A HREF="ncurses5-config.1.html">ncurses5-config(1)</A></STRONG>                                   <STRONG><A HREF="ncurses5-config.1.html">ncurses5-config(1)</A></STRONG>
+
+
+
+
+</PRE>
+<H2>NAME</H2><PRE>
+       ncurses5-config - helper script for ncurses libraries
+
+
+</PRE>
+<H2>SYNOPSIS</H2><PRE>
+       <STRONG>ncurses5-config</STRONG> [<EM>options</EM>]
+
+
+</PRE>
+<H2>DESCRIPTION</H2><PRE>
+       This is a shell script which simplifies configuring appli-
+       cations against a particular set of ncurses libraries.
+
+
+</PRE>
+<H2>OPTIONS</H2><PRE>
+       <STRONG>--prefix</STRONG>
+              echos the package-prefix of ncurses
+
+       <STRONG>--exec-prefix</STRONG>
+              echos the executable-prefix of ncurses
+
+       <STRONG>--cflags</STRONG>
+              echos the C compiler flags needed to  compile  with
+              ncurses
+
+       <STRONG>--libs</STRONG> echos the libraries needed to link with ncurses
+
+       <STRONG>--version</STRONG>
+              echos the release+patchdate version of ncurses
+
+       <STRONG>--abi-version</STRONG>
+              echos the ABI version of ncurses
+
+       <STRONG>--mouse-version</STRONG>
+              echos the mouse-interface version of ncurses
+
+       <STRONG>--bindir</STRONG>
+              echos the directory containing ncurses programs
+
+       <STRONG>--datadir</STRONG>
+              echos the directory containing ncurses data
+
+       <STRONG>--includedir</STRONG>
+              echos the directory containing ncurses header files
+
+       <STRONG>--libdir</STRONG>
+              echos the directory containing ncurses libraries
+
+       <STRONG>--mandir</STRONG>
+              echos the directory containing ncurses manpages
+
+       <STRONG>--terminfo</STRONG>
+              echos the $TERMINFO terminfo database path, e.g.,
+              /usr/share/terminfo
+
+       <STRONG>--terminfo-dirs</STRONG>
+              echos the $TERMINFO_DIRS directory list, e.g.,
+              /usr/local/ncurses/lib/terminfo:/usr/share/terminfo
+
+       <STRONG>--termpath</STRONG>
+              echos  the  $TERMPATH  termcap list, if support for
+              termcap is configured.
+
+       <STRONG>--help</STRONG> prints this message
+
+
+</PRE>
+<H2>SEE ALSO</H2><PRE>
+       <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>
+
+       This describes <STRONG>ncurses</STRONG> version 5.7 (patch 20101002).
+
+
+
+                                                     <STRONG><A HREF="ncurses5-config.1.html">ncurses5-config(1)</A></STRONG>
+</PRE>
+<HR>
+<ADDRESS>
+Man(1) output converted with
+<a href="http://www.oac.uci.edu/indiv/ehood/man2html.html">man2html</a>
+</ADDRESS>
+</BODY>
+</HTML>
diff -Naur ncurses-5.7.orig/doc/html/man/panel.3x.html ncurses-5.7/doc/html/man/panel.3x.html
--- ncurses-5.7.orig/doc/html/man/panel.3x.html	2008-10-11 17:34:17.000000000 -0400
+++ ncurses-5.7/doc/html/man/panel.3x.html	2011-01-08 18:18:29.358656498 -0500
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 <!-- 
   ****************************************************************************
-  * 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,7 +27,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: panel.3x,v 1.14 2007/05/12 20:45:20 tom Exp @
+  * @Id: panel.3x,v 1.17 2010/10/02 23:22:44 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -106,33 +106,33 @@
               refreshes the virtual screen to reflect  the  rela-
               tions between the panels in the stack, but does not
               call doupdate() to  refresh  the  physical  screen.
-              Use this function and not wrefresh or wnoutrefresh.
-              update_panels() may be called more than once before
-              a  call  to doupdate(), but doupdate() is the func-
-              tion responsible for updating the physical  screen.
+              Use this function and not <STRONG>wrefresh</STRONG> or <STRONG>wnoutrefresh</STRONG>.
+              <STRONG>update_panels</STRONG> may be called more than once before a
+              call  to doupdate(), but doupdate() is the function
+              responsible for updating the physical screen.
 
        <STRONG>del_panel(pan)</STRONG>
               removes the given panel from the  stack and deallo-
-              cates the <STRONG>PANEL</STRONG> structure (but not  its  associated
+              cates  the  <STRONG>PANEL</STRONG> structure (but not its associated
               window).
 
        <STRONG>hide_panel(pan)</STRONG>
-              removes  the  given  panel from the panel stack and
+              removes the given panel from the  panel  stack  and
               thus hides it from view. The <STRONG>PANEL</STRONG> structure is not
               lost, merely removed from the stack.
 
        <STRONG>panel_hidden(pan)</STRONG>
-              returns  TRUE  if  the panel is in the panel stack,
-              FALSE if it  is  not.   If  the  panel  is  a  null
+              returns TRUE if the panel is in  the  panel  stack,
+              FALSE  if  it  is  not.   If  the  panel  is a null
               pointer, return ERR.
 
        <STRONG>show_panel(pan)</STRONG>
-              makes  a  hidden panel visible by placing it on top
+              makes a hidden panel visible by placing it  on  top
               of the panels in the panel stack. See COMPATIBILITY
               below.
 
        <STRONG>top_panel(pan)</STRONG>
-              puts  the  given visible panel on top of all panels
+              puts the given visible panel on top of  all  panels
               in the stack.  See COMPATIBILITY below.
 
        <STRONG>bottom_panel(pan)</STRONG>
@@ -140,26 +140,26 @@
 
        <STRONG>move_panel(pan,starty,startx)</STRONG>
               moves the given panel window so that its upper-left
-              corner  is  at  <STRONG>starty</STRONG>, <STRONG>startx</STRONG>.  It does not change
+              corner is at <STRONG>starty</STRONG>, <STRONG>startx</STRONG>.  It  does  not  change
               the position of the panel in the stack.  Be sure to
-              use  this  function,  not  <STRONG>mvwin()</STRONG>, to move a panel
+              use this function, not <STRONG>mvwin()</STRONG>,  to  move  a  panel
               window.
 
        <STRONG>replace_panel(pan,window)</STRONG>
-              replaces the current window of  panel  with  <STRONG>window</STRONG>
+              replaces  the  current  window of panel with <STRONG>window</STRONG>
               (useful, for example if you want to resize a panel;
               if you're using <STRONG>ncurses</STRONG>, you can call <STRONG>replace_panel</STRONG>
-              on  the output of <STRONG><A HREF="wresize.3x.html">wresize(3x)</A></STRONG>).  It does not change
+              on the output of <STRONG><A HREF="wresize.3x.html">wresize(3x)</A></STRONG>).  It does not  change
               the position of the panel in the stack.
 
        <STRONG>panel_above(pan)</STRONG>
-              returns a pointer to the panel above pan.   If  the
-              panel  argument is <STRONG>(PANEL</STRONG> <STRONG>*)0</STRONG>, it returns a pointer
+              returns  a  pointer to the panel above pan.  If the
+              panel argument is <STRONG>(PANEL</STRONG> <STRONG>*)0</STRONG>, it returns a  pointer
               to the bottom panel in the stack.
 
        <STRONG>panel_below(pan)</STRONG>
-              returns a pointer to the panel just below pan.   If
-              the  panel  argument  is  <STRONG>(PANEL</STRONG>  <STRONG>*)0</STRONG>, it returns a
+              returns  a pointer to the panel just below pan.  If
+              the panel argument is  <STRONG>(PANEL</STRONG>  <STRONG>*)0</STRONG>,  it  returns  a
               pointer to the top panel in the stack.
 
        <STRONG>set_panel_userptr(pan,ptr)</STRONG>
@@ -183,10 +183,10 @@
 <H2>COMPATIBILITY</H2><PRE>
        Reasonable  care  has been taken to  ensure  compatibility
        with  the  native  panel  facility  introduced  in  SVr3.2
-       (inspection   of   the  SVr4  manual  pages  suggests  the
-       programming  interface  is  unchanged).   The  <STRONG>PANEL</STRONG>  data
-       structures  are  merely   similar. The  programmer is cau-
-       tioned not to directly use <STRONG>PANEL</STRONG> fields.
+       (inspection of the SVr4 manual pages suggests the program-
+       ming interface is unchanged).  The <STRONG>PANEL</STRONG>  data  structures
+       are  merely   similar. The  programmer is cautioned not to
+       directly use <STRONG>PANEL</STRONG> fields.
 
        The functions <STRONG>show_panel()</STRONG> and <STRONG>top_panel()</STRONG>  are  identical
        in  this  implementation,  and work equally well with dis-
@@ -216,9 +216,9 @@
 
 </PRE>
 <H2>SEE ALSO</H2><PRE>
-       <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>
+       <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_variables.3x.html">curs_variables(3x)</A></STRONG>,
 
-       This describes <STRONG>ncurses</STRONG> version 5.6 (patch 20081011).
+       This describes <STRONG>ncurses</STRONG> version 5.7 (patch 20101002).
 
 
 </PRE>
diff -Naur ncurses-5.7.orig/doc/html/man/resizeterm.3x.html ncurses-5.7/doc/html/man/resizeterm.3x.html
--- ncurses-5.7.orig/doc/html/man/resizeterm.3x.html	2005-08-27 17:15:29.000000000 -0400
+++ ncurses-5.7/doc/html/man/resizeterm.3x.html	2011-01-08 18:18:29.358656498 -0500
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 <!-- 
   ****************************************************************************
-  * 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            *
@@ -28,7 +28,7 @@
   * authorization.                                                           *
   ****************************************************************************
   * Author: Thomas E. Dickey 1996-2005
-  * @Id: resizeterm.3x,v 1.11 2005/06/25 22:19:42 tom Exp @
+  * @Id: resizeterm.3x,v 1.13 2010/10/02 23:23:03 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -92,35 +92,35 @@
        Except  as  notes,  these  function return the integer <STRONG>ERR</STRONG>
        upon failure and <STRONG>OK</STRONG> 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.
+       error occurs while (re)allocating memory for the windows.
 
 
 </PRE>
 <H2>NOTES</H2><PRE>
        While these functions are intended to be used to support a
-       signal handler (i.e., for SIGWINCH), care should be  taken
-       to  avoid invoking them in a context where <STRONG>malloc</STRONG> or <STRONG>real-</STRONG>
-       <STRONG>loc</STRONG> may have been interrupted, since it uses  those  func-
+       signal  handler (i.e., for SIGWINCH), care should be taken
+       to avoid invoking them in a context where <STRONG>malloc</STRONG> or  <STRONG>real-</STRONG>
+       <STRONG>loc</STRONG>  may  have been interrupted, since it uses those func-
        tions.
 
-       If  ncurses  is configured to supply its own SIGWINCH han-
+       If ncurses is configured to supply its own  SIGWINCH  han-
        dler, the <STRONG>resizeterm</STRONG> function ungetch's a <STRONG>KEY_RESIZE</STRONG> which
-       will  be  read on the next call to <STRONG>getch</STRONG>.  This is used to
+       will be read on the next call to <STRONG>getch</STRONG>.  This is  used  to
        alert an application that the screen size has changed, and
-       that  it should repaint special features such as pads that
+       that it should repaint special features such as pads  that
        cannot be done automatically.
 
-       If the environment variables <STRONG>LINES</STRONG>  or  <STRONG>COLUMNS</STRONG>  are  set,
-       this  overrides  the  library's  use  of  the  window size
-       obtained from the operating system.  Thus, even if a  SIG-
-       WINCH  is received, no screen size change may be recorded.
+       If  the  environment  variables  <STRONG>LINES</STRONG> or <STRONG>COLUMNS</STRONG> are set,
+       this overrides  the  library's  use  of  the  window  size
+       obtained  from the operating system.  Thus, even if a SIG-
+       WINCH is received, no screen size change may be  recorded.
        In that case, no <STRONG>KEY_RESIZE</STRONG> is queued for the next call to
        <STRONG>getch</STRONG>; an <STRONG>ERR</STRONG> will be returned instead.
 
 
 </PRE>
 <H2>SEE ALSO</H2><PRE>
-       <STRONG><A HREF="wresize.3x.html">wresize(3x)</A></STRONG>.
+       <STRONG><A HREF="curs_variables.3x.html">curs_variables(3x)</A></STRONG>, <STRONG><A HREF="wresize.3x.html">wresize(3x)</A></STRONG>.
 
 
 </PRE>
diff -Naur ncurses-5.7.orig/doc/html/man/tabs.1.html ncurses-5.7/doc/html/man/tabs.1.html
--- ncurses-5.7.orig/doc/html/man/tabs.1.html	1969-12-31 19:00:00.000000000 -0500
+++ ncurses-5.7/doc/html/man/tabs.1.html	2011-01-08 18:18:29.358656498 -0500
@@ -0,0 +1,171 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
+<!-- 
+  ****************************************************************************
+  * Copyright (c) 2008-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            *
+  * "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.7 2010/07/31 18:17:37 tom Exp @
+-->
+<HTML>
+<HEAD>
+<TITLE>tabs 1</TITLE>
+<link rev=made href="mailto:bug-ncurses@gnu.org">
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+</HEAD>
+<BODY>
+<H1>tabs 1</H1>
+<HR>
+<PRE>
+<!-- Manpage converted by man2html 3.0.1 -->
+<STRONG><A HREF="tabs.1.html">tabs(1)</A></STRONG>                                                         <STRONG><A HREF="tabs.1.html">tabs(1)</A></STRONG>
+
+
+
+
+</PRE>
+<H2>NAME</H2><PRE>
+       <STRONG>tabs</STRONG> - set tabs on a terminal
+
+
+</PRE>
+<H2>SYNOPSIS</H2><PRE>
+       <STRONG>tabs</STRONG> [<STRONG>-v</STRONG>[<EM>n</EM>]] [<STRONG>-ahuUV</STRONG>] <EM>file...</EM>
+
+
+</PRE>
+<H2>DESCRIPTION</H2><PRE>
+       The  <STRONG>tabs</STRONG>  program clears and sets tab-stops on the termi-
+       nal.  This uses the terminfo  <EM>clear</EM><STRONG>_</STRONG><EM>all</EM><STRONG>_</STRONG><EM>tabs</EM>  and  <EM>set</EM><STRONG>_</STRONG><EM>tab</EM>
+       capabilities.   If  either  is  absent,  <STRONG>tabs</STRONG> is unable to
+       clear/set tab-stops.  The terminal should be configured to
+       use hard tabs, e.g.,
+
+              stty tab0
+
+
+</PRE>
+<H2>OPTIONS</H2><PRE>
+   <STRONG>General</STRONG> <STRONG>Options</STRONG>
+       <STRONG>-T</STRONG><EM>name</EM>
+            Tell <STRONG>tabs</STRONG> which terminal type to use.  If this option
+            is not given, <STRONG>tabs</STRONG> will  use  the  <STRONG>$TERM</STRONG>  environment
+            variable.   If  that  is  not  set,  it  will use the
+            <EM>ansi+tabs</EM> entry.
+
+       <STRONG>-d</STRONG>   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.
+
+       <STRONG>-n</STRONG>   This option tells <STRONG>tabs</STRONG> to check the options  and  run
+            any  debugging option, but not to modify the terminal
+            settings.
+
+       The <STRONG>tabs</STRONG> 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.
+
+   <STRONG>Implicit</STRONG> <STRONG>Lists</STRONG>
+       Use a single number as an option, e.g., "<STRONG>-5</STRONG>" 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.
+
+       Use "<STRONG>-0</STRONG>" to clear all tabs.
+
+       Use "<STRONG>-8</STRONG>" to set tabs to the standard interval.
+
+   <STRONG>Explicit</STRONG> <STRONG>Lists</STRONG>
+       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,
+
+              tabs 1,6,11,16,21
+              tabs 1 6 11 16 21
+       Use a '+' to treat a number as an  increment  relative  to
+       the previous value, e.g.,
+
+              tabs 1,+5,+5,+5,+5
+       which is equivalent to the 1,6,11,16,21 example.
+
+   <STRONG>Predefined</STRONG> <STRONG>Tab-Stops</STRONG>
+       X/Open defines several predefined lists of tab stops.
+
+       <STRONG>-a</STRONG>   Assembler, IBM S/370, first format
+
+       <STRONG>-a2</STRONG>  Assembler, IBM S/370, second format
+
+       <STRONG>-c</STRONG>   COBOL, normal format
+
+       <STRONG>-c2</STRONG>  COBOL compact format
+
+       <STRONG>-c3</STRONG>  COBOL compact format extended
+
+       <STRONG>-f</STRONG>   FORTRAN
+
+       <STRONG>-p</STRONG>   PL/I
+
+       <STRONG>-s</STRONG>   SNOBOL
+
+       <STRONG>-u</STRONG>   UNIVAC 1100 Assembler
+
+
+</PRE>
+<H2>PORTABILITY</H2><PRE>
+       X/Open  describes  a  <STRONG>+m</STRONG> option, to set a terminal's left-
+       margin.  Very few of the entries in the terminal  database
+       provide this capability.
+
+       The  <STRONG>-d</STRONG>  (debug) and <STRONG>-n</STRONG> (no-op) options are extensions not
+       provided by other implementations.
+
+       Documentation for other implementations states that  there
+       is  a limit on the number of tab stops.  While some termi-
+       nals 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.
+
+
+</PRE>
+<H2>SEE ALSO</H2><PRE>
+       <STRONG><A HREF="tset.1.html">tset(1)</A></STRONG>, <STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>, <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>.
+
+       This describes <STRONG>ncurses</STRONG> version 5.7 (patch 20101002).
+
+
+
+                                                                <STRONG><A HREF="tabs.1.html">tabs(1)</A></STRONG>
+</PRE>
+<HR>
+<ADDRESS>
+Man(1) output converted with
+<a href="http://www.oac.uci.edu/indiv/ehood/man2html.html">man2html</a>
+</ADDRESS>
+</BODY>
+</HTML>
diff -Naur ncurses-5.7.orig/doc/html/man/term.5.html ncurses-5.7/doc/html/man/term.5.html
--- ncurses-5.7.orig/doc/html/man/term.5.html	2007-03-03 19:10:54.000000000 -0500
+++ ncurses-5.7/doc/html/man/term.5.html	2011-01-08 18:13:50.431156978 -0500
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 <!-- 
   ****************************************************************************
-  * Copyright (c) 1998-2004,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,7 +27,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: term.5,v 1.19 2006/12/24 18:12:38 tom Exp @
+  * @Id: term.5,v 1.20 2010/07/31 16:13:27 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -113,7 +113,7 @@
             (4) the number of short integers in the numbers  sec-
             tion;
 
-            (5) the number of offsets  (short  integers)  in  the
+            (5)  the  number  of  offsets (short integers) in the
             strings section;
 
             (6) the size, in bytes, of the string table.
diff -Naur ncurses-5.7.orig/doc/html/man/term.7.html ncurses-5.7/doc/html/man/term.7.html
--- ncurses-5.7.orig/doc/html/man/term.7.html	2008-06-21 19:11:52.000000000 -0400
+++ ncurses-5.7/doc/html/man/term.7.html	2011-01-08 18:13:50.431156978 -0500
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 <!-- 
   ****************************************************************************
-  * 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,7 +27,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: term.7,v 1.18 2007/06/02 20:40:07 tom Exp @
+  * @Id: term.7,v 1.21 2010/07/31 15:28:39 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -59,7 +59,7 @@
        mailer.
 
        A  default  <STRONG>TERM</STRONG>  value will be set on a per-line basis by
-       either <STRONG>/etc/inittab</STRONG> (Linux and  System-V-like  UNIXes)  or
+       either  <STRONG>/etc/inittab</STRONG>  (e.g.,  System-V-like   UNIXes)   or
        <STRONG>/etc/ttys</STRONG>  (BSD  UNIXes).  This will nearly always suffice
        for workstation and microcomputer consoles.
 
@@ -85,9 +85,9 @@
        the tty device and baud rate.
 
        Setting your own <STRONG>TERM</STRONG> value may also be useful if you have
-       created a custom  entry  incorporating  options  (such  as
-       visual  bell  or reverse-video) which you wish to override
-       the system default type for your line.
+       created a custom entry incorporating options (such as vis-
+       ual  bell or reverse-video) which you wish to override the
+       system default type for your line.
 
        Terminal type descriptions are stored as files of capabil-
        ity data underneath /usr/share/terminfo.  To browse a list
@@ -101,9 +101,9 @@
        you  must  use the <STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG> command.  Invoke it as fol-
        lows:
 
-            infocmp <EM>entry-name</EM>
+            infocmp <EM>entry</EM><STRONG>_</STRONG><EM>name</EM>
 
-       where <EM>entry-name</EM> is the name of the type you wish to exam-
+       where <EM>entry</EM><STRONG>_</STRONG><EM>name</EM> is the name of the type you wish to exam-
        ine  (and the name of its capability file the subdirectory
        of /usr/share/terminfo named for its first letter).   This
        command  dumps  a  capability  file  in  the  text  format
@@ -152,7 +152,7 @@
        thus <STRONG>vt100</STRONG>, <STRONG>hp2621</STRONG>, <STRONG>wy50</STRONG>.
 
        The root name for a PC-Unix console type should be the  OS
-       name,  i.e.  <STRONG>linux</STRONG>, <STRONG>bsdos</STRONG>, <STRONG>freebsd</STRONG>, <STRONG>netbsd</STRONG>.  It should <EM>not</EM>
+       name,  i.e., <STRONG>linux</STRONG>, <STRONG>bsdos</STRONG>, <STRONG>freebsd</STRONG>, <STRONG>netbsd</STRONG>.  It should <EM>not</EM>
        be <STRONG>console</STRONG> or any other generic that might cause confusion
        in  a  multi-platform environment!  If a model number fol-
        lows, it should indicate either the OS  release  level  or
@@ -161,7 +161,7 @@
        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. <STRONG>versaterm</STRONG>, <STRONG>ctrm</STRONG>).
+       it (i.e., <STRONG>versaterm</STRONG>, <STRONG>ctrm</STRONG>).
 
        Following the root name, you may add any reasonable number
        of hyphen-separated feature suffixes.
diff -Naur ncurses-5.7.orig/doc/html/man/term_variables.3x.html ncurses-5.7/doc/html/man/term_variables.3x.html
--- ncurses-5.7.orig/doc/html/man/term_variables.3x.html	1969-12-31 19:00:00.000000000 -0500
+++ ncurses-5.7/doc/html/man/term_variables.3x.html	2011-01-08 18:18:29.246657101 -0500
@@ -0,0 +1,165 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
+<!-- 
+  ****************************************************************************
+  * 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: term_variables.3x,v 1.1 2010/09/11 21:01:44 tom Exp @
+-->
+<HTML>
+<HEAD>
+<TITLE>term_variables 3x</TITLE>
+<link rev=made href="mailto:bug-ncurses@gnu.org">
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+</HEAD>
+<BODY>
+<H1>term_variables 3x</H1>
+<HR>
+<PRE>
+<!-- Manpage converted by man2html 3.0.1 -->
+<STRONG><A HREF="term_variables.3x.html">term_variables(3x)</A></STRONG>                                   <STRONG><A HREF="term_variables.3x.html">term_variables(3x)</A></STRONG>
+
+
+
+
+</PRE>
+<H2>NAME</H2><PRE>
+       <STRONG>SP</STRONG>, <STRONG>acs_map</STRONG>, <STRONG>boolcodes</STRONG>, <STRONG>boolfnames</STRONG>, <STRONG>boolnames</STRONG>, <STRONG>cur_term</STRONG>,
+       <STRONG>numcodes</STRONG>, <STRONG>numfnames</STRONG>, <STRONG>numnames</STRONG>, <STRONG>strcodes</STRONG>, <STRONG>strfnames</STRONG>,
+       <STRONG>strnames</STRONG>, <STRONG>ttytype</STRONG> - <STRONG>curses</STRONG> terminfo global variables
+
+
+</PRE>
+<H2>SYNOPSIS</H2><PRE>
+       <STRONG>#include</STRONG> <STRONG>&lt;curses.h&gt;</STRONG>
+       <STRONG>#include</STRONG> <STRONG>&lt;term.h&gt;</STRONG>
+
+       <STRONG>chtype</STRONG> <STRONG>acs_map[];</STRONG>
+       <STRONG>NCURSES_CONST</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG> <STRONG>const</STRONG> <STRONG>*</STRONG> <STRONG>boolcodes;</STRONG>
+       <STRONG>NCURSES_CONST</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG> <STRONG>const</STRONG> <STRONG>*</STRONG> <STRONG>boolfnames;</STRONG>
+       <STRONG>NCURSES_CONST</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG> <STRONG>const</STRONG> <STRONG>*</STRONG> <STRONG>boolnames;</STRONG>
+       <STRONG>TERMINAL</STRONG> <STRONG>*</STRONG> <STRONG>cur_term;</STRONG>
+       <STRONG>NCURSES_CONST</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG> <STRONG>const</STRONG> <STRONG>*</STRONG> <STRONG>numcodes;</STRONG>
+       <STRONG>NCURSES_CONST</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG> <STRONG>const</STRONG> <STRONG>*</STRONG> <STRONG>numfnames;</STRONG>
+       <STRONG>NCURSES_CONST</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG> <STRONG>const</STRONG> <STRONG>*</STRONG> <STRONG>numnames;</STRONG>
+       <STRONG>NCURSES_CONST</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG> <STRONG>const</STRONG> <STRONG>*</STRONG> <STRONG>strcodes;</STRONG>
+       <STRONG>NCURSES_CONST</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG> <STRONG>const</STRONG> <STRONG>*</STRONG> <STRONG>strfnames;</STRONG>
+       <STRONG>NCURSES_CONST</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG> <STRONG>const</STRONG> <STRONG>*</STRONG> <STRONG>strnames;</STRONG>
+       <STRONG>char</STRONG> <STRONG>ttytype[];</STRONG>
+
+
+</PRE>
+<H2>DESCRIPTION</H2><PRE>
+       This  page summarizes variables provided by the <STRONG>curses</STRONG> li-
+       brary's low-level terminfo interface.  A more complete de-
+       scription is given in the <STRONG><A HREF="curs_terminfo.3x.html">curs_terminfo(3x)</A></STRONG> manual page.
+
+       Depending  on the configuration, these may be actual vari-
+       ables, or  macros  (see  <STRONG><A HREF="curs_threads.3x.html">curs_threads(3x)</A></STRONG>)  which  provide
+       read-only  access  to <EM>curses</EM>'s state.  In either case, ap-
+       plications should treat them as read-only to avoid confus-
+       ing the library.
+
+   <STRONG>Alternate</STRONG> <STRONG>Character</STRONG> <STRONG>Set</STRONG> <STRONG>Mapping</STRONG>
+       After  initializing the curses or terminfo interfaces, the
+       <STRONG>acs_map</STRONG> array holds information used  to  translate  cells
+       with  the  <STRONG>A_ALTCHARSET</STRONG>  video attribute into line-drawing
+       characters.
+
+       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 &lt;curses.h&gt;.
+
+       The comparable data for the wide-character  library  is  a
+       private variable.
+
+   <STRONG>Current</STRONG> <STRONG>Terminal</STRONG> <STRONG>Data</STRONG>
+       After  initializing the curses or terminfo interfaces, the
+       <STRONG>cur_term</STRONG> contains data describing  the  current  terminal.
+       This variable is also set as a side-effect of <STRONG><A HREF="set_term.3x.html">set_term(3x)</A></STRONG>
+       and <STRONG><A HREF="delscreen.3x.html">delscreen(3x)</A></STRONG>.
+
+       It is possible to save a value of <STRONG>cur_term</STRONG> for  subsequent
+       use  as  a  parameter  to  <STRONG>set_term</STRONG>, for switching between
+       screens.  Alternatively, one can  save  the  return  value
+       from <STRONG>newterm</STRONG> or <STRONG>setupterm</STRONG> to reuse in <STRONG>set_term</STRONG>.
+
+   <STRONG>Terminfo</STRONG> <STRONG>Names</STRONG>
+       The  <STRONG><A HREF="tic.1.html">tic(1)</A></STRONG>  and <STRONG><A HREF="infocmp.1.html">infocmp(1)</A></STRONG> 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,  though  the
+       hash-tables are not available.
+
+       The  long  terminfo  capability  names  use a "l" (ell) in
+       their names: boolfnames numfnames strfnames
+
+       These are the short names for terminfo capabilities: bool-
+       names, numnames, and strnames.
+
+       These  are  the  corresponding  names used for termcap de-
+       scriptions: boolcodes, numcodes, and strcodes.
+
+   <STRONG>Terminal</STRONG> <STRONG>Type</STRONG>
+       On initialization of the curses  or  terminfo  interfaces,
+       <STRONG>setupterm</STRONG> copies the terminal name to the array <STRONG>ttytype</STRONG>.
+
+
+</PRE>
+<H2>NOTES</H2><PRE>
+       The  low-level terminfo interface is initialized using <STRONG>se-</STRONG>
+       <STRONG><A HREF="setupterm.3x.html">tupterm(3x)</A></STRONG>.  The upper-level curses  interface  uses  the
+       low-level terminfo interface, internally.
+
+
+</PRE>
+<H2>PORTABILITY</H2><PRE>
+       X/Open  Curses  does  not describe any of these except for
+       <STRONG>cur_term</STRONG>.  (The inclusion of <STRONG>cur_term</STRONG>  appears  to  be  an
+       oversight, since other comparable low-level information is
+       omitted by X/Open).
+
+       Other implementations may have comparable variables.  Some
+       implementations  provide the variables in their libraries,
+       but omit them from the header files.
+
+
+</PRE>
+<H2>SEE ALSO</H2><PRE>
+       <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_terminfo.3x.html">curs_terminfo(3x)</A></STRONG>,  <STRONG><A HREF="curs_threads.3x.html">curs_threads(3x)</A></STRONG>,  <STRONG>termin-</STRONG>
+       <STRONG><A HREF="terminfo.3x.html">fo(3x)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>.
+
+
+
+                                                     <STRONG><A HREF="term_variables.3x.html">term_variables(3x)</A></STRONG>
+</PRE>
+<HR>
+<ADDRESS>
+Man(1) output converted with
+<a href="http://www.oac.uci.edu/indiv/ehood/man2html.html">man2html</a>
+</ADDRESS>
+</BODY>
+</HTML>
diff -Naur ncurses-5.7.orig/doc/html/man/terminfo.5.html ncurses-5.7/doc/html/man/terminfo.5.html
--- ncurses-5.7.orig/doc/html/man/terminfo.5.html	2008-10-11 17:34:18.000000000 -0400
+++ ncurses-5.7/doc/html/man/terminfo.5.html	2011-01-08 18:18:29.358656498 -0500
@@ -6,7 +6,7 @@
   * 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.              *
+  * 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            *
@@ -32,9 +32,9 @@
   * 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 @
+  * @Id: terminfo.head,v 1.18 2010/07/31 16:08:48 tom Exp @
   * Head of terminfo man page ends here
-  * @Id: terminfo.tail,v 1.49 2008/02/16 20:57:43 tom Exp @
+  * @Id: terminfo.tail,v 1.52 2010/10/02 23:40:29 tom Exp @
   * Beginning of terminfo.tail file
   * This file is part of ncurses.
   * See "terminfo.head" for copyright.
@@ -78,7 +78,7 @@
        nals by giving a set of capabilities which they  have,  by
        specifying how to perform screen operations, and by speci-
        fying padding requirements and  initialization  sequences.
-       This describes <STRONG>ncurses</STRONG> version 5.6 (patch 20081011).
+       This describes <STRONG>ncurses</STRONG> version 5.7 (patch 20101002).
 
        Entries in <EM>terminfo</EM> consist of a sequence of `,' separated
        fields (embedded commas may be escaped with a backslash or
@@ -113,7 +113,6 @@
        vt100-w.  The following suffixes should be used where pos-
        sible:
 
-
       <STRONG>Suffix</STRONG>                  <STRONG>Meaning</STRONG>                   <STRONG>Example</STRONG>
       -<EM>nn</EM>      Number of lines on the screen            aaa-60
       -<EM>n</EM>p      Number of pages of memory                c100-4p
@@ -126,8 +125,8 @@
       -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 (&gt; 80 columns, usually 132)    vt100-w
 
        For more on terminal naming conventions, see  the  <STRONG>term(7)</STRONG>
@@ -176,133 +175,134 @@
        These are the boolean capabilities:
 
 
-               <STRONG>Variable</STRONG>          <STRONG>Cap-</STRONG>  <STRONG>TCap</STRONG>      <STRONG>Description</STRONG>
-               <STRONG>Booleans</STRONG>          <STRONG>name</STRONG>  <STRONG>Code</STRONG>
-       auto_left_margin          bw    bw    cub1 wraps from col-
+               <STRONG>Variable</STRONG>          <STRONG>Cap-</STRONG>   <STRONG>TCap</STRONG>     <STRONG>Description</STRONG>
+               <STRONG>Booleans</STRONG>          <STRONG>name</STRONG>   <STRONG>Code</STRONG>
+       auto_left_margin          bw     bw   cub1 wraps from col-
                                              umn 0 to last column
-       auto_right_margin         am    am    terminal has auto-
+       auto_right_margin         am     am   terminal has auto-
                                              matic margins
-       back_color_erase          bce   ut    screen erased with
+       back_color_erase          bce    ut   screen erased with
                                              background color
-       can_change                ccc   cc    terminal can re-
+       can_change                ccc    cc   terminal can re-
                                              define existing col-
                                              ors
-       ceol_standout_glitch      xhp   xs    standout not erased
+       ceol_standout_glitch      xhp    xs   standout not erased
                                              by overwriting (hp)
-       col_addr_glitch           xhpa  YA    only positive motion
+       col_addr_glitch           xhpa   YA   only positive motion
                                              for hpa/mhpa caps
 
 
-       cpi_changes_res           cpix  YF    changing character
+
+       cpi_changes_res           cpix   YF   changing character
                                              pitch changes reso-
                                              lution
-       cr_cancels_micro_mode     crxm  YB    using cr turns off
+       cr_cancels_micro_mode     crxm   YB   using cr turns off
                                              micro mode
-       dest_tabs_magic_smso      xt    xt    tabs destructive,
+       dest_tabs_magic_smso      xt     xt   tabs destructive,
                                              magic so char
                                              (t1061)
-       eat_newline_glitch        xenl  xn    newline ignored
+       eat_newline_glitch        xenl   xn   newline ignored
                                              after 80 cols (con-
                                              cept)
-       erase_overstrike          eo    eo    can erase over-
+       erase_overstrike          eo     eo   can erase over-
                                              strikes with a blank
-       generic_type              gn    gn    generic line type
-       hard_copy                 hc    hc    hardcopy terminal
-       hard_cursor               chts  HC    cursor is hard to
+       generic_type              gn     gn   generic line type
+       hard_copy                 hc     hc   hardcopy terminal
+       hard_cursor               chts   HC   cursor is hard to
                                              see
-       has_meta_key              km    km    Has a meta key
+       has_meta_key              km     km   Has a meta key
                                              (i.e., sets 8th-bit)
-       has_print_wheel           daisy YC    printer needs opera-
+       has_print_wheel           daisy  YC   printer needs opera-
                                              tor to change char-
                                              acter set
-       has_status_line           hs    hs    has extra status
+       has_status_line           hs     hs   has extra status
                                              line
-       hue_lightness_saturation  hls   hl    terminal uses only
+       hue_lightness_saturation  hls    hl   terminal uses only
                                              HLS color notation
                                              (Tektronix)
-       insert_null_glitch        in    in    insert mode distin-
+       insert_null_glitch        in     in   insert mode distin-
                                              guishes nulls
-       lpi_changes_res           lpix  YG    changing line pitch
+       lpi_changes_res           lpix   YG   changing line pitch
                                              changes resolution
-       memory_above              da    da    display may be
+       memory_above              da     da   display may be
                                              retained above the
                                              screen
-       memory_below              db    db    display may be
+       memory_below              db     db   display may be
                                              retained below the
                                              screen
-       move_insert_mode          mir   mi    safe to move while
+       move_insert_mode          mir    mi   safe to move while
                                              in insert mode
-       move_standout_mode        msgr  ms    safe to move while
+       move_standout_mode        msgr   ms   safe to move while
                                              in standout mode
-       needs_xon_xoff            nxon  nx    padding will not
+       needs_xon_xoff            nxon   nx   padding will not
                                              work, xon/xoff
                                              required
-       no_esc_ctlc               xsb   xb    beehive (f1=escape,
+       no_esc_ctlc               xsb    xb   beehive (f1=escape,
                                              f2=ctrl C)
-       no_pad_char               npc   NP    pad character does
+       no_pad_char               npc    NP   pad character does
                                              not exist
-       non_dest_scroll_region    ndscr ND    scrolling region is
+       non_dest_scroll_region    ndscr  ND   scrolling region is
                                              non-destructive
-       non_rev_rmcup             nrrmc NR    smcup does not
+       non_rev_rmcup             nrrmc  NR   smcup does not
                                              reverse rmcup
-       over_strike               os    os    terminal can over-
+       over_strike               os     os   terminal can over-
                                              strike
-       prtr_silent               mc5i  5i    printer will not
+       prtr_silent               mc5i   5i   printer will not
                                              echo on screen
-       row_addr_glitch           xvpa  YD    only positive motion
+       row_addr_glitch           xvpa   YD   only positive motion
                                              for vpa/mvpa caps
-       semi_auto_right_margin    sam   YE    printing in last
+       semi_auto_right_margin    sam    YE   printing in last
                                              column causes cr
-       status_line_esc_ok        eslok es    escape can be used
+       status_line_esc_ok        eslok  es   escape can be used
                                              on the status line
-       tilde_glitch              hz    hz    cannot print ~'s
+       tilde_glitch              hz     hz   cannot print ~'s
                                              (hazeltine)
 
 
-       transparent_underline     ul    ul    underline character
+       transparent_underline     ul     ul   underline character
                                              overstrikes
-       xon_xoff                  xon   xo    terminal uses
+       xon_xoff                  xon    xo   terminal uses
                                              xon/xoff handshaking
 
        These are the numeric capabilities:
 
 
-            <STRONG>Variable</STRONG>         <STRONG>Cap-</STRONG>     <STRONG>TCap</STRONG>       <STRONG>Description</STRONG>
-             <STRONG>Numeric</STRONG>         <STRONG>name</STRONG>     <STRONG>Code</STRONG>
-       columns               cols     co     number of columns in
+               <STRONG>Variable</STRONG>          <STRONG>Cap-</STRONG>   <STRONG>TCap</STRONG>     <STRONG>Description</STRONG>
+                <STRONG>Numeric</STRONG>          <STRONG>name</STRONG>   <STRONG>Code</STRONG>
+       columns                   cols   co   number of columns in
                                              a line
-       init_tabs             it       it     tabs initially every
+       init_tabs                 it     it   tabs initially every
                                              # spaces
-       label_height          lh       lh     rows in each label
-       label_width           lw       lw     columns in each
+       label_height              lh     lh   rows in each label
+       label_width               lw     lw   columns in each
                                              label
-       lines                 lines    li     number of lines on
+       lines                     lines  li   number of lines on
                                              screen or page
-       lines_of_memory       lm       lm     lines of memory if &gt;
+       lines_of_memory           lm     lm   lines of memory if &gt;
                                              line. 0 means varies
-       magic_cookie_glitch   xmc      sg     number of blank
+       magic_cookie_glitch       xmc    sg   number of blank
                                              characters left by
                                              smso or rmso
-       max_attributes        ma       ma     maximum combined
+       max_attributes            ma     ma   maximum combined
                                              attributes terminal
                                              can handle
-       max_colors            colors   Co     maximum number of
+       max_colors                colors Co   maximum number of
                                              colors on screen
-       max_pairs             pairs    pa     maximum number of
+       max_pairs                 pairs  pa   maximum number of
                                              color-pairs on the
                                              screen
-       maximum_windows       wnum     MW     maximum number of
+       maximum_windows           wnum   MW   maximum number of
                                              defineable windows
-       no_color_video        ncv      NC     video attributes
+       no_color_video            ncv    NC   video attributes
                                              that cannot be used
                                              with colors
-       num_labels            nlab     Nl     number of labels on
+       num_labels                nlab   Nl   number of labels on
                                              screen
-       padding_baud_rate     pb       pb     lowest baud rate
+       padding_baud_rate         pb     pb   lowest baud rate
                                              where padding needed
-       virtual_terminal      vt       vt     virtual terminal
+       virtual_terminal          vt     vt   virtual terminal
                                              number (CB/unix)
-       width_status_line     wsl      ws     number of columns in
+       width_status_line         wsl    ws   number of columns in
                                              status line
 
        The following numeric  capabilities  are  present  in  the
@@ -310,47 +310,47 @@
        man page.  They came in with SVr4's printer support.
 
 
-             <STRONG>Variable</STRONG>         <STRONG>Cap-</STRONG>    <STRONG>TCap</STRONG>       <STRONG>Description</STRONG>
-             <STRONG>Numeric</STRONG>          <STRONG>name</STRONG>    <STRONG>Code</STRONG>
-       bit_image_entwining    bitwin  Yo     number of passes for
+               <STRONG>Variable</STRONG>          <STRONG>Cap-</STRONG>   <STRONG>TCap</STRONG>     <STRONG>Description</STRONG>
+                <STRONG>Numeric</STRONG>          <STRONG>name</STRONG>   <STRONG>Code</STRONG>
+       bit_image_entwining       bitwin Yo   number of passes for
                                              each bit-image row
-       bit_image_type         bitype  Yp     type of bit-image
+       bit_image_type            bitype Yp   type of bit-image
                                              device
-       buffer_capacity        bufsz   Ya     numbers of bytes
+       buffer_capacity           bufsz  Ya   numbers of bytes
                                              buffered before
                                              printing
-       buttons                btns    BT     number of buttons on
+       buttons                   btns   BT   number of buttons on
                                              mouse
-       dot_horz_spacing       spinh   Yc     spacing of dots hor-
+       dot_horz_spacing          spinh  Yc   spacing of dots hor-
                                              izontally in dots
                                              per inch
 
-       dot_vert_spacing       spinv   Yb     spacing of pins ver-
+       dot_vert_spacing          spinv  Yb   spacing of pins ver-
                                              tically in pins per
                                              inch
-       max_micro_address      maddr   Yd     maximum value in
+       max_micro_address         maddr  Yd   maximum value in
                                              micro_..._address
-       max_micro_jump         mjump   Ye     maximum value in
+       max_micro_jump            mjump  Ye   maximum value in
                                              parm_..._micro
-       micro_col_size         mcs     Yf     character step size
+       micro_col_size            mcs    Yf   character step size
                                              when in micro mode
-       micro_line_size        mls     Yg     line step size when
+       micro_line_size           mls    Yg   line step size when
                                              in micro mode
-       number_of_pins         npins   Yh     numbers of pins in
+       number_of_pins            npins  Yh   numbers of pins in
                                              print-head
-       output_res_char        orc     Yi     horizontal resolu-
+       output_res_char           orc    Yi   horizontal resolu-
                                              tion in units per
                                              line
-       output_res_horz_inch   orhi    Yk     horizontal resolu-
+       output_res_horz_inch      orhi   Yk   horizontal resolu-
                                              tion in units per
                                              inch
-       output_res_line        orl     Yj     vertical resolution
+       output_res_line           orl    Yj   vertical resolution
                                              in units per line
-       output_res_vert_inch   orvi    Yl     vertical resolution
+       output_res_vert_inch      orvi   Yl   vertical resolution
                                              in units per inch
-       print_rate             cps     Ym     print rate in char-
+       print_rate                cps    Ym   print rate in char-
                                              acters per second
-       wide_char_size         widcs   Yn     character step size
+       wide_char_size            widcs  Yn   character step size
                                              when in double wide
                                              mode
 
@@ -402,8 +402,8 @@
                                              prototype !?
        create_window             cwin   CW   define a window #1
                                              from #2,#3 to #4,#5
-       cursor_address            cup    cm   move to row #1
-                                             columns #2
+       cursor_address            cup    cm   move to row #1 col-
+                                             umns #2
        cursor_down               cud1   do   down one line
        cursor_home               home   ho   home cursor (if no
                                              cup)
@@ -904,8 +904,8 @@
        zero_motion               zerom  Zx   No motion for subse-
                                              quent character
 
-       The  following  string  capabilities  are  present  in the
-       SVr4.0 term structure, but were originally not  documented
+       The following  string  capabilities  are  present  in  the
+       SVr4.0  term structure, but were originally not documented
        in the man page.
 
 
@@ -989,12 +989,12 @@
                                                bottom margins to
                                                #1, #2
 
-        The XSI Curses  standard  added  these.   They  are  some
-        post-4.1  versions  of System V curses, e.g., Solaris 2.5
-        and IRIX 6.x.  The <STRONG>ncurses</STRONG> termcap  names  for  them  are
+        The  XSI  Curses  standard  added  these.   They are some
+        post-4.1 versions of System V curses, e.g.,  Solaris  2.5
+        and  IRIX  6.x.   The  <STRONG>ncurses</STRONG> termcap names for them are
         invented; according to the XSI Curses standard, they have
-        no termcap names.  If your compiled terminfo entries  use
-        these,  they  may  not be binary-compatible with System V
+        no  termcap names.  If your compiled terminfo entries use
+        these, they may not be binary-compatible  with  System  V
         terminfo entries after SVr4.1; beware!
 
 
@@ -1021,7 +1021,7 @@
 
    <STRONG>A</STRONG> <STRONG>Sample</STRONG> <STRONG>Entry</STRONG>
        The following entry, describing an ANSI-standard terminal,
-       is  representative  of  what a <STRONG>terminfo</STRONG> entry for a modern
+       is representative of what a <STRONG>terminfo</STRONG> entry  for  a  modern
        terminal typically looks like.
 
      ansi|ansi/pc-term compatible with color,
@@ -1045,84 +1045,82 @@
              sgr0=\E[0;10m, tbc=\E[2g, u6=\E[%d;%dR, u7=\E[6n,
              u8=\E[?%[;0123456789]c, u9=\E[c, vpa=\E[%p1%dd,
 
-       Entries may continue onto multiple lines by placing  white
-       space  at  the  beginning  of  each line except the first.
-       Comments may be included on lines  beginning  with  ``#''.
+       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 <EM>terminfo</EM> are of three types: Boolean capa-
        bilities which indicate that the terminal has some partic-
-       ular  feature, numeric capabilities giving the size of the
-       terminal or the size  of  particular  delays,  and  string
-       capabilities,  which  give a sequence which can be used to
+       ular feature, numeric capabilities giving the size of  the
+       terminal  or  the  size  of  particular delays, and string
+       capabilities, which give a sequence which can be  used  to
        perform particular terminal operations.
 
-
    <STRONG>Types</STRONG> <STRONG>of</STRONG> <STRONG>Capabilities</STRONG>
-       All capabilities have names.  For instance, the fact  that
-       ANSI-standard  terminals  have <EM>automatic</EM> <EM>margins</EM> (i.e., an
-       automatic return and line-feed when the end of a  line  is
-       reached)  is  indicated  by  the capability <STRONG>am</STRONG>.  Hence the
+       All  capabilities have names.  For instance, the fact that
+       ANSI-standard terminals have <EM>automatic</EM> <EM>margins</EM>  (i.e.,  an
+       automatic  return  and line-feed when the end of a line is
+       reached) is indicated by the  capability  <STRONG>am</STRONG>.   Hence  the
        description of ansi includes <STRONG>am</STRONG>.  Numeric capabilities are
-       followed  by  the character `#' and then a positive value.
-       Thus <STRONG>cols</STRONG>, which indicates the number of columns the  ter-
-       minal  has,  gives  the  value  `80' for ansi.  Values for
+       followed by the character `#' and then a  positive  value.
+       Thus  <STRONG>cols</STRONG>, which indicates the number of columns the ter-
+       minal has, gives the value  `80'  for  ansi.   Values  for
        numeric capabilities may be specified in decimal, octal or
-       hexadecimal,  using the C programming language conventions
+       hexadecimal, using the C programming language  conventions
        (e.g., 255, 0377 and 0xff or 0xFF).
 
-       Finally, string valued capabilities, such as <STRONG>el</STRONG> (clear  to
+       Finally,  string valued capabilities, such as <STRONG>el</STRONG> (clear to
        end of line sequence) are given by the two-character code,
-       an `=', and then a string ending  at  the  next  following
+       an  `=',  and  then  a string ending at the next following
        `,'.
 
-       A  number  of  escape sequences are provided in the string
+       A number of escape sequences are provided  in  the  string
        valued capabilities for easy encoding of characters there.
-       Both  <STRONG>\E</STRONG>  and  <STRONG>\e</STRONG> map to an ESCAPE character, <STRONG>^x</STRONG> maps to a
-       control-x for any appropriate x, and the sequences  <STRONG>\n</STRONG>  <STRONG>\l</STRONG>
-       <STRONG>\r</STRONG>  <STRONG>\t</STRONG>  <STRONG>\b</STRONG>  <STRONG>\f</STRONG>  <STRONG>\s</STRONG> give a newline, line-feed, return, tab,
+       Both <STRONG>\E</STRONG> and <STRONG>\e</STRONG> map to an ESCAPE character, <STRONG>^x</STRONG>  maps  to  a
+       control-x  for  any appropriate x, and the sequences <STRONG>\n</STRONG> <STRONG>\l</STRONG>
+       <STRONG>\r</STRONG> <STRONG>\t</STRONG> <STRONG>\b</STRONG> <STRONG>\f</STRONG> <STRONG>\s</STRONG> give a  newline,  line-feed,  return,  tab,
        backspace, form-feed, and space.  Other escapes include <STRONG>\^</STRONG>
-       for  <STRONG>^</STRONG>, <STRONG>\\</STRONG> for <STRONG>\</STRONG>, <STRONG>\</STRONG>, for comma, <STRONG>\:</STRONG> for <STRONG>:</STRONG>, and <STRONG>\0</STRONG> for null.
-       (<STRONG>\0</STRONG> will produce \200, which does not terminate  a  string
+       for <STRONG>^</STRONG>, <STRONG>\\</STRONG> for <STRONG>\</STRONG>, <STRONG>\</STRONG>, for comma, <STRONG>\:</STRONG> for <STRONG>:</STRONG>, and <STRONG>\0</STRONG> for  null.
+       (<STRONG>\0</STRONG>  will  produce \200, which does not terminate a string
        but behaves as a null character on most terminals, provid-
-       ing CS7 is specified.  See <STRONG><A HREF="stty.1.html">stty(1)</A></STRONG>.)  Finally,  characters
+       ing  CS7 is specified.  See <STRONG><A HREF="stty.1.html">stty(1)</A></STRONG>.)  Finally, characters
        may be given as three octal digits after a <STRONG>\</STRONG>.
 
-       A  delay  in  milliseconds may appear anywhere in a string
-       capability, enclosed in $&lt;..&gt; brackets, as in  <STRONG>el</STRONG>=\EK$&lt;5&gt;,
-       and  padding  characters  are supplied by <EM>tputs</EM> to provide
-       this delay.  The delay must be a number with at  most  one
+       A delay in milliseconds may appear anywhere  in  a  string
+       capability,  enclosed in $&lt;..&gt; brackets, as in <STRONG>el</STRONG>=\EK$&lt;5&gt;,
+       and padding characters are supplied by  <EM>tputs</EM>  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
+       `*'  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  <EM>lines</EM>
-       affected.)   Normally,  padding  is advisory if the device
-       has the <STRONG>xon</STRONG> 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 <STRONG>xon</STRONG> is
+       affected.)  Normally, padding is advisory  if  the  device
+       has  the  <STRONG>xon</STRONG>  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  <STRONG>xon</STRONG>  is
        present to indicate flow control.
 
-       Sometimes individual capabilities must be  commented  out.
-       To  do this, put a period before the capability name.  For
+       Sometimes  individual  capabilities must be commented out.
+       To do this, put a period before the capability name.   For
        example, see the second <STRONG>ind</STRONG> in the example above.
 
-
    <STRONG>Fetching</STRONG> <STRONG>Compiled</STRONG> <STRONG>Descriptions</STRONG>
-       If the environment variable TERMINFO is set, it is  inter-
-       preted  as the pathname of a directory containing the com-
+       If  the environment variable TERMINFO is set, it is inter-
+       preted as the pathname of a directory containing the  com-
        piled description you are working on.  Only that directory
        is searched.
 
-       If  TERMINFO  is  not set, the <STRONG>ncurses</STRONG> version of the ter-
-       minfo reader code  will  instead  look  in  the  directory
-       <STRONG>$HOME/.terminfo</STRONG>  for  a compiled description.  If it fails
-       to find one  there,  and  the  environment  variable  TER-
-       MINFO_DIRS  is set, it will interpret the contents of that
-       variable as a list of colon- separated directories  to  be
-       searched  (an  empty  entry is interpreted as a command to
-       search <EM>/usr/share/terminfo</EM>).  If no description  is  found
-       in  any of the TERMINFO_DIRS directories, the fetch fails.
+       If TERMINFO is not set, the <STRONG>ncurses</STRONG> version  of  the  ter-
+       minfo  reader  code  will  instead  look  in the directory
+       <STRONG>$HOME/.terminfo</STRONG> for a compiled description.  If  it  fails
+       to  find  one  there,  and  the  environment variable TER-
+       MINFO_DIRS is set, it will interpret the contents of  that
+       variable  as  a list of colon- separated directories to be
+       searched (an empty entry is interpreted as  a  command  to
+       search  <EM>/usr/share/terminfo</EM>).   If no description is found
+       in any of the TERMINFO_DIRS directories, the fetch fails.
 
        If neither TERMINFO nor TERMINFO_DIRS  is  set,  the  last
        place   tried  will  be  the  system  terminfo  directory,
@@ -1132,7 +1130,6 @@
        extensions   are  supported  under  stock  System  V  ter-
        minfo/curses.)
 
-
    <STRONG>Preparing</STRONG> <STRONG>Descriptions</STRONG>
        We now outline how to prepare descriptions  of  terminals.
        The  most  effective way to prepare a terminal description
@@ -1152,7 +1149,6 @@
        ally  needed.  A similar test can be used for insert char-
        acter.
 
-
    <STRONG>Basic</STRONG> <STRONG>Capabilities</STRONG>
        The number of columns on each line  for  the  terminal  is
        given  by the <STRONG>cols</STRONG> numeric capability.  If the terminal is
@@ -1190,35 +1186,35 @@
        left corner of the screen and send the <STRONG>ind</STRONG> (index) string.
 
        To scroll text down, a program goes to the top left corner
-       of  the  screen  and  sends the <STRONG>ri</STRONG> (reverse index) string.
-       The strings <STRONG>ind</STRONG> and <STRONG>ri</STRONG> are undefined  when  not  on  their
+       of the screen and sends the  <STRONG>ri</STRONG>  (reverse  index)  string.
+       The  strings  <STRONG>ind</STRONG>  and  <STRONG>ri</STRONG> are undefined when not on their
        respective corners of the screen.
 
        Parameterized versions of the scrolling sequences are <STRONG>indn</STRONG>
        and <STRONG>rin</STRONG> which have the same semantics as <STRONG>ind</STRONG> and <STRONG>ri</STRONG> except
-       that  they take one parameter, and scroll that many lines.
-       They are also undefined except at the appropriate edge  of
+       that they take one parameter, and scroll that many  lines.
+       They  are also undefined except at the appropriate edge of
        the screen.
 
-       The  <STRONG>am</STRONG>  capability tells whether the cursor sticks at the
-       right edge of the screen when text  is  output,  but  this
+       The <STRONG>am</STRONG> 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 <STRONG>cuf1</STRONG> from the last column.
-       The only local motion which is defined from the left  edge
-       is  if  <STRONG>bw</STRONG>  is  given, then a <STRONG>cub1</STRONG> from the left edge will
-       move to the right edge of the previous row.  If <STRONG>bw</STRONG> is  not
-       given,  the effect is undefined.  This is useful for draw-
-       ing a box around the edge of the screen, for example.   If
-       the  terminal has switch selectable automatic margins, the
-       <EM>terminfo</EM> file usually assumes that this is on;  i.e.,  <STRONG>am</STRONG>.
-       If  the  terminal  has  a command which moves to the first
-       column of the next line, that command can be given as  <STRONG>nel</STRONG>
-       (newline).   It  does not matter if the command clears the
-       remainder of the current line, so if the terminal  has  no
-       <STRONG>cr</STRONG>  and <STRONG>lf</STRONG> it may still be possible to craft a working <STRONG>nel</STRONG>
+       The  only local motion which is defined from the left edge
+       is if <STRONG>bw</STRONG> is given, then a <STRONG>cub1</STRONG> from  the  left  edge  will
+       move  to the right edge of the previous row.  If <STRONG>bw</STRONG> is not
+       given, the effect is undefined.  This is useful for  draw-
+       ing  a box around the edge of the screen, for example.  If
+       the terminal has switch selectable automatic margins,  the
+       <EM>terminfo</EM>  file  usually assumes that this is on; i.e., <STRONG>am</STRONG>.
+       If the terminal has a command which  moves  to  the  first
+       column  of the next line, that command can be given as <STRONG>nel</STRONG>
+       (newline).  It does not matter if the command  clears  the
+       remainder  of  the current line, so if the terminal has no
+       <STRONG>cr</STRONG> and <STRONG>lf</STRONG> it may still be possible to craft a working  <STRONG>nel</STRONG>
        out of one or both of them.
 
        These  capabilities  suffice  to  describe  hard-copy  and
-       "glass-tty"  terminals.   Thus  the  model  33 teletype is
+       "glass-tty" terminals.  Thus  the  model  33  teletype  is
        described as
 
        33|tty33|tty|model 33 teletype,
@@ -1230,34 +1226,32 @@
             am, bel=^G, clear=^Z, cols#80, cr=^M, cub1=^H, cud1=^J,
             ind=^J, lines#24,
 
-
    <STRONG>Parameterized</STRONG> <STRONG>Strings</STRONG>
-       Cursor addressing and other strings  requiring  parameters
-       in  the  terminal  are described by a parameterized string
-       capability, with <STRONG><A HREF="printf.3.html">printf(3)</A></STRONG> like escapes  <STRONG>%x</STRONG>  in  it.   For
-       example,  to  address  the  cursor,  the <STRONG>cup</STRONG> capability is
+       Cursor  addressing  and other strings requiring parameters
+       in the terminal are described by  a  parameterized  string
+       capability,  with  <STRONG><A HREF="printf.3.html">printf(3)</A></STRONG>  like  escapes <STRONG>%x</STRONG> in it.  For
+       example, to address the  cursor,  the  <STRONG>cup</STRONG>  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
+       memory.)  If  the  terminal  has  memory  relative  cursor
        addressing, that can be indicated by <STRONG>mrcup</STRONG>.
 
-       The parameter mechanism uses a stack and special  <STRONG>%</STRONG>  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
+       The  parameter  mechanism uses a stack and special <STRONG>%</STRONG> 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 <STRONG>sgr</STRONG> string.
 
        The <STRONG>%</STRONG> encodings have the following meanings:
 
-
        %%   outputs `%'
 
        %<EM>[[</EM>:<EM>]flags][width[.precision]][</EM>doxXs<EM>]</EM>
-            as in <STRONG>printf</STRONG>, flags are [-+#] and space.  Use  a  `:'
-            to  allow the next character to be a `-' flag, avoid-
+            as  in  <STRONG>printf</STRONG>, flags are [-+#] and space.  Use a `:'
+            to allow the next character to be a `-' flag,  avoid-
             ing interpreting "%-" as an operator.
 
        %c   print pop() like %c in <STRONG>printf</STRONG>
@@ -1279,11 +1273,11 @@
        %g[A-Z]
             get static variable [a-z] and push it
 
-            The terms  "static"  and  "dynamic"  are  misleading.
-            Historically,  these are simply two different sets of
-            variables, whose values are not reset  between  calls
-            to  <STRONG>tparm</STRONG>.   However,  that fact is not documented in
-            other implementations.  Relying on it will  adversely
+            The  terms  "static"  and  "dynamic"  are misleading.
+            Historically, these are simply two different sets  of
+            variables,  whose  values are not reset between calls
+            to <STRONG>tparm</STRONG>.  However, that fact is  not  documented  in
+            other  implementations.  Relying on it will adversely
             impact portability to other implementations.
 
        %'<EM>c</EM>' char constant <EM>c</EM>
@@ -1307,16 +1301,16 @@
             logical AND and OR operations (for conditionals)
 
        %! %~
-            unary  operations  (logical  and   bit   complement):
+            unary   operations   (logical  and  bit  complement):
             push(op pop())
 
        %i   add 1 to first two parameters (for ANSI terminals)
 
        %? <EM>expr</EM> %t <EM>thenpart</EM> %e <EM>elsepart</EM> %;
-            This  forms  an  if-then-else.   The  %e  <EM>elsepart</EM> is
-            optional.  Usually the %? <EM>expr</EM> part  pushes  a  value
-            onto  the stack, and %t pops it from the stack, test-
-            ing if it is nonzero (true).  If it is zero  (false),
+            This forms  an  if-then-else.   The  %e  <EM>elsepart</EM>  is
+            optional.   Usually  the  %? <EM>expr</EM> part pushes a value
+            onto the stack, and %t pops it from the stack,  test-
+            ing  if it is nonzero (true).  If it is zero (false),
             control passes to the %e (else) part.
 
             It is possible to form else-if's a la Algol 68:
@@ -1325,7 +1319,7 @@
             where ci are conditions, bi are bodies.
 
             Use the <STRONG>-f</STRONG> option of <STRONG>tic</STRONG> or <STRONG>infocmp</STRONG> to see the struc-
-            ture  of  if-the-else's.  Some strings, e.g., <STRONG>sgr</STRONG> can
+            ture  of if-then-else's.  Some strings, e.g., <STRONG>sgr</STRONG> can
             be very complicated when written on one line.  The <STRONG>-f</STRONG>
             option  splits  the  string into lines with the parts
             indented.
@@ -1342,241 +1336,236 @@
        its.  Thus its <STRONG>cup</STRONG> capability is "cup=6\E&amp;%p2%2dc%p1%2dY".
 
        The Microterm ACT-IV needs the current row and column sent
-       preceded  by  a <STRONG>^T</STRONG>, with the row and column simply encoded
-       in binary, "cup=^T%p1%c%p2%c".  Terminals which  use  "%c"
-       need  to  be  able  to backspace the cursor (<STRONG>cub1</STRONG>), and to
+       preceded by a <STRONG>^T</STRONG>, with the row and column  simply  encoded
+       in  binary,  "cup=^T%p1%c%p2%c".  Terminals which use "%c"
+       need to be able to backspace the  cursor  (<STRONG>cub1</STRONG>),  and  to
        move the cursor up one line on the screen (<STRONG>cuu1</STRONG>).  This is
-       necessary  because it is not always safe to transmit <STRONG>\n</STRONG> <STRONG>^D</STRONG>
-       and <STRONG>\r</STRONG>, as the system may change or  discard  them.   (The
-       library  routines  dealing  with terminfo set tty modes so
+       necessary because it is not always safe to transmit <STRONG>\n</STRONG>  <STRONG>^D</STRONG>
+       and  <STRONG>\r</STRONG>,  as  the system may change or discard them.  (The
+       library routines dealing with terminfo set  tty  modes  so
        that tabs are never expanded, so \t is safe to send.  This
        turns out to be essential for the Ann Arbor 4080.)
 
        A final example is the LSI ADM-3a, which uses row and col-
        umn  offset  by  a  blank  character,  thus  "cup=\E=%p1%'
-       '%+%c%p2%'  '%+%c".   After sending `\E=', this pushes the
-       first parameter, pushes the ASCII value for a space  (32),
-       adds  them  (pushing  the sum on the stack in place of the
-       two previous values) and outputs that value as  a  charac-
-       ter.   Then  the  same  is  done for the second parameter.
+       '%+%c%p2%' '%+%c".  After sending `\E=', this  pushes  the
+       first  parameter, pushes the ASCII value for a space (32),
+       adds them (pushing the sum on the stack in  place  of  the
+       two  previous  values) and outputs that value as a charac-
+       ter.  Then the same is  done  for  the  second  parameter.
        More complex arithmetic is possible using the stack.
 
-
    <STRONG>Cursor</STRONG> <STRONG>Motions</STRONG>
        If the terminal has a fast way to home the cursor (to very
-       upper  left  corner  of  screen) then this can be given as
-       <STRONG>home</STRONG>; similarly a fast way of getting to the  lower  left-
-       hand  corner can be given as <STRONG>ll</STRONG>; this may involve going up
-       with <STRONG>cuu1</STRONG> from the home position,  but  a  program  should
-       never  do this itself (unless <STRONG>ll</STRONG> does) because it can make
-       no assumption about the effect of moving up from the  home
-       position.   Note  that  the  home  position is the same as
+       upper left corner of screen) then this  can  be  given  as
+       <STRONG>home</STRONG>;  similarly  a fast way of getting to the lower left-
+       hand corner can be given as <STRONG>ll</STRONG>; this may involve going  up
+       with  <STRONG>cuu1</STRONG>  from  the  home position, but a program should
+       never do this itself (unless <STRONG>ll</STRONG> does) because it can  make
+       no  assumption about the effect of moving up from the home
+       position.  Note that the home  position  is  the  same  as
        addressing to (0,0): to the top left corner of the screen,
-       not  of  memory.   (Thus, the \EH sequence on HP terminals
+       not of memory.  (Thus, the \EH sequence  on  HP  terminals
        cannot be used for <STRONG>home</STRONG>.)
 
        If the terminal has row or column absolute cursor address-
-       ing,  these  can be given as single parameter capabilities
+       ing, these can be given as single  parameter  capabilities
        <STRONG>hpa</STRONG> (horizontal position absolute) and <STRONG>vpa</STRONG> (vertical posi-
        tion absolute).  Sometimes these are shorter than the more
-       general two parameter sequence (as with  the  hp2645)  and
-       can   be   used  in  preference  to  <STRONG>cup</STRONG>.   If  there  are
-       parameterized local motions (e.g., move <EM>n</EM>  spaces  to  the
-       right) these can be given as <STRONG>cud</STRONG>, <STRONG>cub</STRONG>, <STRONG>cuf</STRONG>, and <STRONG>cuu</STRONG> with a
-       single parameter  indicating  how  many  spaces  to  move.
-       These  are  primarily useful if the terminal does not have
-       <STRONG>cup</STRONG>, such as the TEKTRONIX 4025.
+       general  two  parameter  sequence (as with the hp2645) and
+       can be used in preference to <STRONG>cup</STRONG>.  If there are parameter-
+       ized  local  motions  (e.g.,  move  <EM>n</EM> spaces to the right)
+       these can be given as <STRONG>cud</STRONG>, <STRONG>cub</STRONG>, <STRONG>cuf</STRONG>, and <STRONG>cuu</STRONG> with a single
+       parameter  indicating  how many spaces to move.  These are
+       primarily useful if the terminal does not have  <STRONG>cup</STRONG>,  such
+       as the TEKTRONIX 4025.
 
        If the terminal needs to be in a special mode when running
        a program that uses these capabilities, the codes to enter
-       and exit this mode can be given as <STRONG>smcup</STRONG> and <STRONG>rmcup</STRONG>.   This
-       arises,  for example, from terminals like the Concept with
-       more than one page of memory.  If the  terminal  has  only
-       memory  relative cursor addressing and not screen relative
+       and  exit this mode can be given as <STRONG>smcup</STRONG> and <STRONG>rmcup</STRONG>.  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.
+       into the terminal for cursor addressing to work  properly.
        This is also used for the TEKTRONIX 4025, where <STRONG>smcup</STRONG> sets
-       the  command character to be the one used by terminfo.  If
-       the <STRONG>smcup</STRONG> sequence will not restore the  screen  after  an
+       the command character to be the one used by terminfo.   If
+       the  <STRONG>smcup</STRONG>  sequence  will not restore the screen after an
        <STRONG>rmcup</STRONG> sequence is output (to the state prior to outputting
        <STRONG>rmcup</STRONG>), specify <STRONG>nrrmc</STRONG>.
 
-
    <STRONG>Area</STRONG> <STRONG>Clears</STRONG>
        If the terminal can clear from the current position to the
-       end  of  the  line,  leaving  the cursor where it is, this
+       end of the line, leaving the  cursor  where  it  is,  this
        should be given as <STRONG>el</STRONG>.  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
-       <STRONG>el1</STRONG>.   If the terminal can clear from the current position
-       to the end of the display, then this should  be  given  as
-       <STRONG>ed</STRONG>.   <STRONG>Ed</STRONG>  is only defined from the first column of a line.
-       (Thus, it can be simulated by a request to delete a  large
+       beginning of the line to the current  position  inclusive,
+       leaving  the  cursor  where it is, this should be given as
+       <STRONG>el1</STRONG>.  If the terminal can clear from the current  position
+       to  the  end  of the display, then this should be given as
+       <STRONG>ed</STRONG>.  <STRONG>Ed</STRONG> 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 <STRONG>ed</STRONG> is not available.)
 
-
    <STRONG>Insert/delete</STRONG> <STRONG>line</STRONG> <STRONG>and</STRONG> <STRONG>vertical</STRONG> <STRONG>motions</STRONG>
-       If  the terminal can open a new blank line before the line
-       where the cursor is, this should be given as <STRONG>il1</STRONG>; this  is
-       done  only  from the first position of a line.  The cursor
+       If the terminal can open a new blank line before the  line
+       where  the cursor is, this should be given as <STRONG>il1</STRONG>; 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 <STRONG>dl1</STRONG>; this is done only from  the  first
-       position  on  the line to be deleted.  Versions of <STRONG>il1</STRONG> and
-       <STRONG>dl1</STRONG> which take a single parameter  and  insert  or  delete
+       can delete the line which the  cursor  is  on,  then  this
+       should  be  given as <STRONG>dl1</STRONG>; this is done only from the first
+       position on the line to be deleted.  Versions of  <STRONG>il1</STRONG>  and
+       <STRONG>dl1</STRONG>  which  take  a  single parameter and insert or delete
        that many lines can be given as <STRONG>il</STRONG> and <STRONG>dl</STRONG>.
 
-       If  the terminal has a settable scrolling region (like the
-       vt100) the command to set this can be described  with  the
-       <STRONG>csr</STRONG>  capability,  which  takes two parameters: the top and
+       If the terminal has a settable scrolling region (like  the
+       vt100)  the  command to set this can be described with the
+       <STRONG>csr</STRONG> capability, which takes two parameters:  the  top  and
        bottom lines of the scrolling region.  The cursor position
        is, alas, undefined after using this command.
 
-       It  is possible to get the effect of insert or delete line
+       It is possible to get the effect of insert or delete  line
        using <STRONG>csr</STRONG> on a properly chosen region; the <STRONG>sc</STRONG> and <STRONG>rc</STRONG> (save
-       and  restore  cursor)  commands may be useful for ensuring
-       that your synthesized insert/delete string does  not  move
-       the  cursor.  (Note that the <STRONG><A HREF="ncurses.3x.html">ncurses(3x)</A></STRONG> library does this
-       synthesis  automatically,  so   you   need   not   compose
+       and restore cursor) commands may be  useful  for  ensuring
+       that  your  synthesized insert/delete string does not move
+       the cursor.  (Note that the <STRONG><A HREF="ncurses.3x.html">ncurses(3x)</A></STRONG> library does  this
+       synthesis   automatically,   so   you   need  not  compose
        insert/delete strings for an entry with <STRONG>csr</STRONG>).
 
        Yet another way to construct insert and delete might be to
-       use a combination of index with  the  memory-lock  feature
-       found  on some terminals (like the HP-700/90 series, which
+       use  a  combination  of index with the memory-lock feature
+       found on some terminals (like the HP-700/90 series,  which
        however also has insert/delete).
 
-       Inserting lines at the top or bottom  of  the  screen  can
-       also  be  done using <STRONG>ri</STRONG> or <STRONG>ind</STRONG> on many terminals without a
-       true insert/delete line, and is often faster even on  ter-
+       Inserting  lines  at  the  top or bottom of the screen can
+       also be done using <STRONG>ri</STRONG> or <STRONG>ind</STRONG> on many terminals  without  a
+       true  insert/delete line, and is often faster even on ter-
        minals with those features.
 
-       The  boolean  <STRONG>non_dest_scroll_region</STRONG> should be set if each
-       scrolling window is effectively a view port on  a  screen-
-       sized  canvas.   To  test  for  this  capability, create a
-       scrolling region in the middle of the screen, write  some-
-       thing  to  the  bottom line, move the cursor to the top of
+       The boolean <STRONG>non_dest_scroll_region</STRONG> should be set  if  each
+       scrolling  window  is effectively a view port on a screen-
+       sized canvas.  To  test  for  this  capability,  create  a
+       scrolling  region in the middle of the screen, write some-
+       thing to the bottom line, move the cursor to  the  top  of
        the region, and do <STRONG>ri</STRONG> followed by <STRONG>dl1</STRONG> or <STRONG>ind</STRONG>.  If the data
-       scrolled  off  the  bottom  of  the  region  by the <STRONG>ri</STRONG> re-
-       appears, then scrolling is non-destructive.  System V  and
-       XSI  Curses  expect that <STRONG>ind</STRONG>, <STRONG>ri</STRONG>, <STRONG>indn</STRONG>, and <STRONG>rin</STRONG> will simu-
-       late destructive scrolling; their  documentation  cautions
-       you  not  to  define <STRONG>csr</STRONG> unless this is true.  This <STRONG>curses</STRONG>
+       scrolled off the bottom  of  the  region  by  the  <STRONG>ri</STRONG>  re-
+       appears,  then scrolling is non-destructive.  System V and
+       XSI Curses expect that <STRONG>ind</STRONG>, <STRONG>ri</STRONG>, <STRONG>indn</STRONG>, and <STRONG>rin</STRONG>  will  simu-
+       late  destructive  scrolling; their documentation cautions
+       you not to define <STRONG>csr</STRONG> unless this is  true.   This  <STRONG>curses</STRONG>
        implementation is more liberal and will do explicit erases
        after scrolling if <STRONG>ndstr</STRONG> is defined.
 
        If the terminal has the ability to define a window as part
-       of memory, which all commands affect, it should  be  given
+       of  memory,  which all commands affect, it should be given
        as the parameterized string <STRONG>wind</STRONG>.  The four parameters are
-       the starting and ending lines in memory and  the  starting
+       the  starting  and ending lines in memory and the starting
        and ending columns in memory, in that order.
 
-       If  the terminal can retain display memory above, then the
-       <STRONG>da</STRONG> capability should be given; if display  memory  can  be
-       retained  below,  then <STRONG>db</STRONG> should be given.  These indicate
-       that deleting a line  or  scrolling  may  bring  non-blank
-       lines  up  from  below  or that scrolling back with <STRONG>ri</STRONG> may
+       If the terminal can retain display memory above, then  the
+       <STRONG>da</STRONG>  capability  should  be given; if display memory can be
+       retained below, then <STRONG>db</STRONG> should be given.   These  indicate
+       that  deleting  a  line  or  scrolling may bring non-blank
+       lines up from below or that scrolling  back  with  <STRONG>ri</STRONG>  may
        bring down non-blank lines.
 
-
    <STRONG>Insert/Delete</STRONG> <STRONG>Character</STRONG>
-       There are two basic kinds of  intelligent  terminals  with
-       respect  to insert/delete character which can be described
-       using <EM>terminfo.</EM>  The most common  insert/delete  character
-       operations  affect only the characters on the current line
-       and shift characters off the  end  of  the  line  rigidly.
-       Other  terminals,  such  as the Concept 100 and the Perkin
-       Elmer Owl, make a distinction between  typed  and  untyped
-       blanks  on  the  screen, shifting upon an insert or delete
-       only to an untyped blank on the  screen  which  is  either
-       eliminated,  or  expanded  to two untyped blanks.  You can
-       determine the kind of terminal you have  by  clearing  the
-       screen  and  then typing text separated by cursor motions.
-       Type "abc    def" using local cursor motions (not  spaces)
+       There  are  two  basic kinds of intelligent terminals with
+       respect to insert/delete character which can be  described
+       using  <EM>terminfo.</EM>   The most common insert/delete character
+       operations affect only the characters on the current  line
+       and  shift  characters  off  the  end of the line rigidly.
+       Other terminals, such as the Concept 100  and  the  Perkin
+       Elmer  Owl,  make  a distinction between typed and untyped
+       blanks on the screen, shifting upon an  insert  or  delete
+       only  to  an  untyped  blank on the screen which is either
+       eliminated, or expanded to two untyped  blanks.   You  can
+       determine  the  kind  of terminal you have by clearing the
+       screen and then typing text separated by  cursor  motions.
+       Type  "abc    def" using local cursor motions (not spaces)
        between the "abc" and the "def".  Then position the cursor
-       before the "abc" and put the terminal in insert mode.   If
-       typing  characters  causes  the  rest of the line to shift
+       before  the "abc" and put the terminal in insert mode.  If
+       typing characters causes the rest of  the  line  to  shift
        rigidly and characters to fall off the end, then your ter-
-       minal  does  not  distinguish  between  blanks and untyped
-       positions.  If the "abc" shifts over to  the  "def"  which
-       then  move together around the end of the current line and
-       onto the next as you insert, you have the second  type  of
-       terminal,  and should give the capability <STRONG>in</STRONG>, which stands
+       minal does not  distinguish  between  blanks  and  untyped
+       positions.   If  the  "abc" shifts over to the "def" which
+       then move together around the end of the current line  and
+       onto  the  next as you insert, you have the second type of
+       terminal, and should give the capability <STRONG>in</STRONG>, which  stands
        for "insert null".  While these are two logically separate
-       attributes  (one  line  versus multi-line insert mode, and
-       special treatment of untyped spaces) we have seen no  ter-
+       attributes (one line versus multi-line  insert  mode,  and
+       special  treatment of untyped spaces) we have seen no ter-
        minals whose insert mode cannot be described with the sin-
        gle attribute.
 
-       Terminfo can describe both terminals which have an  insert
+       Terminfo  can describe both terminals which have an insert
        mode, and terminals which send a simple sequence to open a
-       blank position on the current  line.   Give  as  <STRONG>smir</STRONG>  the
-       sequence  to  get  into  insert  mode.   Give  as <STRONG>rmir</STRONG> the
-       sequence to leave insert  mode.   Now  give  as  <STRONG>ich1</STRONG>  any
-       sequence  needed  to  be  sent  just  before  sending  the
-       character to be inserted.   Most  terminals  with  a  true
-       insert  mode  will  not  give <STRONG>ich1</STRONG>; terminals which send a
-       sequence to open a screen position should give it here.
-
-       If your terminal has both, insert mode is usually  prefer-
-       able  to  <STRONG>ich1</STRONG>.   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
+       blank  position  on  the  current  line.  Give as <STRONG>smir</STRONG> the
+       sequence to get  into  insert  mode.   Give  as  <STRONG>rmir</STRONG>  the
+       sequence  to  leave  insert  mode.   Now  give as <STRONG>ich1</STRONG> any
+       sequence needed to be sent just before sending the charac-
+       ter  to  be  inserted.   Most terminals with a true insert
+       mode will not give <STRONG>ich1</STRONG>; terminals which send  a  sequence
+       to open a screen position should give it here.
+
+       If  your terminal has both, insert mode is usually prefer-
+       able to <STRONG>ich1</STRONG>.   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 <STRONG>ich</STRONG> sequences do not require previous smir,
        and most smir insert modes do not require <STRONG>ich1</STRONG> before each
-       character.  Therefore, the  new  <STRONG>curses</STRONG>  actually  assumes
-       this  is the case and uses either <STRONG>rmir</STRONG>/<STRONG>smir</STRONG> or <STRONG>ich</STRONG>/<STRONG>ich1</STRONG> as
+       character.   Therefore,  the  new  <STRONG>curses</STRONG> actually assumes
+       this is the case and uses either <STRONG>rmir</STRONG>/<STRONG>smir</STRONG> or <STRONG>ich</STRONG>/<STRONG>ich1</STRONG>  as
        appropriate (but not both).  If you have to write an entry
-       to  be  used under new curses for a terminal old enough to
+       to be used under new curses for a terminal old  enough  to
        need both, include the <STRONG>rmir</STRONG>/<STRONG>smir</STRONG> sequences in <STRONG>ich1</STRONG>.
 
        If post insert padding is needed, give this as a number of
-       milliseconds  in <STRONG>ip</STRONG> (a string option).  Any other sequence
-       which may need to be sent after  an  insert  of  a  single
+       milliseconds in <STRONG>ip</STRONG> (a string option).  Any other  sequence
+       which  may  need  to  be  sent after an insert of a single
        character may also be given in <STRONG>ip</STRONG>.  If your terminal needs
        both to be placed into an `insert mode' and a special code
-       to  precede  each  inserted character, then both <STRONG>smir</STRONG>/<STRONG>rmir</STRONG>
-       and <STRONG>ich1</STRONG> can be given, and both will  be  used.   The  <STRONG>ich</STRONG>
+       to precede each inserted character,  then  both  <STRONG>smir</STRONG>/<STRONG>rmir</STRONG>
+       and  <STRONG>ich1</STRONG>  can  be  given, and both will be used.  The <STRONG>ich</STRONG>
        capability, with one parameter, <EM>n</EM>, will repeat the effects
        of <STRONG>ich1</STRONG> <EM>n</EM> times.
 
        If padding is necessary between characters typed while not
-       in  insert  mode,  give  this  as a number of milliseconds
-       padding in <STRONG>rmp</STRONG>.
+       in insert mode, give this as a number of milliseconds pad-
+       ding in <STRONG>rmp</STRONG>.
 
-       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 <STRONG>mir</STRONG> to speed up  inserting  in  this  case.
-       Omitting  <STRONG>mir</STRONG>  will  affect  only  speed.   Some terminals
+       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  <STRONG>mir</STRONG>  to  speed up inserting in this case.
+       Omitting <STRONG>mir</STRONG>  will  affect  only  speed.   Some  terminals
        (notably Datamedia's) must not have <STRONG>mir</STRONG> because of the way
        their insert mode works.
 
-       Finally,  you  can specify <STRONG>dch1</STRONG> to delete a single charac-
-       ter, <STRONG>dch</STRONG> with one parameter, <EM>n</EM>, to  delete  <EM>n</EM>  <EM>characters,</EM>
-       and  delete mode by giving <STRONG>smdc</STRONG> and <STRONG>rmdc</STRONG> to enter and exit
-       delete mode (any mode the terminal needs to be  placed  in
+       Finally, you can specify <STRONG>dch1</STRONG> to delete a  single  charac-
+       ter,  <STRONG>dch</STRONG>  with  one parameter, <EM>n</EM>, to delete <EM>n</EM> <EM>characters,</EM>
+       and delete mode by giving <STRONG>smdc</STRONG> and <STRONG>rmdc</STRONG> to enter and  exit
+       delete  mode  (any mode the terminal needs to be placed in
        for <STRONG>dch1</STRONG> to work).
 
-       A  command to erase <EM>n</EM> characters (equivalent to outputting
-       <EM>n</EM> blanks without moving the cursor) can be  given  as  <STRONG>ech</STRONG>
+       A command to erase <EM>n</EM> characters (equivalent to  outputting
+       <EM>n</EM>  blanks  without  moving the cursor) can be given as <STRONG>ech</STRONG>
        with one parameter.
 
-
    <STRONG>Highlighting,</STRONG> <STRONG>Underlining,</STRONG> <STRONG>and</STRONG> <STRONG>Visible</STRONG> <STRONG>Bells</STRONG>
        If  your  terminal  has  one  or  more  kinds  of  display
-       attributes, these can be represented in a number  of  dif-
+       attributes,  these  can be represented in a number of dif-
        ferent ways.  You should choose one display form as <EM>stand-</EM>
        <EM>out</EM> <EM>mode</EM>, 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
-       <STRONG>smso</STRONG>  and  <STRONG>rmso</STRONG>, 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,
+       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
+       <STRONG>smso</STRONG> and <STRONG>rmso</STRONG>, respectively.  If the code to  change  into
+       or  out of standout mode leaves one or even two blank spa-
+       ces on the screen, as the TVI 912  and  Teleray  1061  do,
        then <STRONG>xmc</STRONG> should be given to tell how many spaces are left.
 
        Codes  to  begin  underlining  and  end underlining can be
@@ -1605,19 +1594,18 @@
 
        For example, the DEC vt220 supports most of the modes:
 
+        <STRONG>tparm</STRONG> <STRONG>parameter</STRONG>      <STRONG>attribute</STRONG>        <STRONG>escape</STRONG> <STRONG>sequence</STRONG>
 
-           <STRONG>tparm</STRONG> <STRONG>parameter</STRONG>   <STRONG>attribute</STRONG>    <STRONG>escape</STRONG> <STRONG>sequence</STRONG>
-
-           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)
+        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)
 
        We  begin each escape sequence by turning off any existing
        modes, since there is no quick way  to  determine  whether
@@ -1637,18 +1625,16 @@
        Writing out the above sequences, along with  their  depen-
        dencies yields
 
+      <STRONG>sequence</STRONG>             <STRONG>when</STRONG> <STRONG>to</STRONG> <STRONG>output</STRONG>      <STRONG>terminfo</STRONG> <STRONG>translation</STRONG>
 
-         <STRONG>sequence</STRONG>    <STRONG>when</STRONG> <STRONG>to</STRONG> <STRONG>output</STRONG>     <STRONG>terminfo</STRONG> <STRONG>translation</STRONG>
-
-         \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%;
+      \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%;
 
        Putting this all together into the sgr sequence gives:
 
@@ -1695,7 +1681,6 @@
        erasable with a blank, then this should  be  indicated  by
        giving <STRONG>eo</STRONG>.
 
-
    <STRONG>Keypad</STRONG> <STRONG>and</STRONG> <STRONG>Function</STRONG> <STRONG>Keys</STRONG>
        If the terminal has a keypad that transmits codes when the
        keys are pressed, this information  can  be  given.   Note
@@ -1710,70 +1695,68 @@
        tion  keys  such  as f0, f1, ..., f10, the codes they send
        can be given as <STRONG>kf0,</STRONG> <STRONG>kf1,</STRONG> <STRONG>...,</STRONG> <STRONG>kf10</STRONG>.  If these  keys  have
        labels  other  than the default f0 through f10, the labels
-       can  be  given  as  <STRONG>lf0,</STRONG>  <STRONG>lf1,</STRONG>  <STRONG>...,</STRONG>  <STRONG>lf10</STRONG>.    The   codes
-       transmitted  by  certain  other special keys can be given:
-       <STRONG>kll</STRONG> (home down), <STRONG>kbs</STRONG> (backspace), <STRONG>ktbc</STRONG> (clear  all  tabs),
-       <STRONG>kctab</STRONG>  (clear  the  tab  stop in this column), <STRONG>kclr</STRONG> (clear
-       screen or  erase  key),  <STRONG>kdch1</STRONG>  (delete  character),  <STRONG>kdl1</STRONG>
-       (delete line), <STRONG>krmir</STRONG> (exit insert mode), <STRONG>kel</STRONG> (clear to end
-       of line), <STRONG>ked</STRONG> (clear to  end  of  screen),  <STRONG>kich1</STRONG>  (insert
-       character  or  enter insert mode), <STRONG>kil1</STRONG> (insert line), <STRONG>knp</STRONG>
-       (next  page),  <STRONG>kpp</STRONG>  (previous  page),  <STRONG>kind</STRONG>  (scroll  for-
-       ward/down), <STRONG>kri</STRONG> (scroll backward/up), <STRONG>khts</STRONG> (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 <STRONG>ka1</STRONG>, <STRONG>ka3</STRONG>,  <STRONG>kb2</STRONG>,  <STRONG>kc1</STRONG>,  and  <STRONG>kc3</STRONG>.
-       These  keys are useful when the effects of a 3 by 3 direc-
-       tional pad are needed.
-
-       Strings to program function keys can be  given  as  <STRONG>pfkey</STRONG>,
-       <STRONG>pfloc</STRONG>,  and <STRONG>pfx</STRONG>.  A string to program screen labels should
-       be specified as <STRONG>pln</STRONG>.  Each  of  these  strings  takes  two
-       parameters:  the function key number to program (from 0 to
-       10) and the string to program it with.  Function key  num-
-       bers  out  of  this  range may program undefined keys in a
-       terminal dependent manner.   The  difference  between  the
-       capabilities  is  that <STRONG>pfkey</STRONG> causes pressing the given key
-       to be the same as the user typing the given string;  <STRONG>pfloc</STRONG>
+       can be given as <STRONG>lf0,</STRONG> <STRONG>lf1,</STRONG> <STRONG>...,</STRONG> <STRONG>lf10</STRONG>.  The codes  transmit-
+       ted  by certain other special keys can be given: <STRONG>kll</STRONG> (home
+       down), <STRONG>kbs</STRONG>  (backspace),  <STRONG>ktbc</STRONG>  (clear  all  tabs),  <STRONG>kctab</STRONG>
+       (clear the tab stop in this column), <STRONG>kclr</STRONG> (clear screen or
+       erase key), <STRONG>kdch1</STRONG> (delete character), <STRONG>kdl1</STRONG> (delete  line),
+       <STRONG>krmir</STRONG>  (exit insert mode), <STRONG>kel</STRONG> (clear to end of line), <STRONG>ked</STRONG>
+       (clear to end of screen), <STRONG>kich1</STRONG> (insert character or enter
+       insert  mode),  <STRONG>kil1</STRONG>  (insert  line), <STRONG>knp</STRONG> (next page), <STRONG>kpp</STRONG>
+       (previous page), <STRONG>kind</STRONG> (scroll forward/down),  <STRONG>kri</STRONG>  (scroll
+       backward/up),  <STRONG>khts</STRONG>  (set  a tab stop in this column).  In
+       addition, if the keypad has a 3 by 3 array of keys includ-
+       ing  the four arrow keys, the other five keys can be given
+       as <STRONG>ka1</STRONG>, <STRONG>ka3</STRONG>, <STRONG>kb2</STRONG>, <STRONG>kc1</STRONG>, and <STRONG>kc3</STRONG>.   These  keys  are  useful
+       when the effects of a 3 by 3 directional pad are needed.
+
+       Strings  to  program  function keys can be given as <STRONG>pfkey</STRONG>,
+       <STRONG>pfloc</STRONG>, and <STRONG>pfx</STRONG>.  A string to program screen labels  should
+       be  specified  as  <STRONG>pln</STRONG>.   Each  of these strings takes two
+       parameters: the function key number to program (from 0  to
+       10)  and the string to program it with.  Function key num-
+       bers out of this range may program  undefined  keys  in  a
+       terminal  dependent  manner.   The  difference between the
+       capabilities is that <STRONG>pfkey</STRONG> causes pressing the  given  key
+       to  be the same as the user typing the given string; <STRONG>pfloc</STRONG>
        causes the string to be executed by the terminal in local;
-       and <STRONG>pfx</STRONG> causes the string to be transmitted  to  the  com-
+       and  <STRONG>pfx</STRONG>  causes  the string to be transmitted to the com-
        puter.
 
        The capabilities <STRONG>nlab</STRONG>, <STRONG>lw</STRONG> and <STRONG>lh</STRONG> define the number of pro-
-       grammable screen labels and their width  and  height.   If
-       there  are  commands  to  turn the labels on and off, give
-       them in <STRONG>smln</STRONG> and <STRONG>rmln</STRONG>.  <STRONG>smln</STRONG> is normally output after  one
+       grammable  screen  labels  and their width and height.  If
+       there are commands to turn the labels  on  and  off,  give
+       them  in <STRONG>smln</STRONG> and <STRONG>rmln</STRONG>.  <STRONG>smln</STRONG> is normally output after one
        or more pln sequences to make sure that the change becomes
        visible.
 
-
    <STRONG>Tabs</STRONG> <STRONG>and</STRONG> <STRONG>Initialization</STRONG>
-       If the terminal has hardware tabs, the command to  advance
-       to  the  next tab stop can be given as <STRONG>ht</STRONG> (usually control
-       I).  A ``back-tab'' command which moves  leftward  to  the
+       If  the terminal has hardware tabs, the command to advance
+       to the next tab stop can be given as <STRONG>ht</STRONG>  (usually  control
+       I).   A  ``back-tab''  command which moves leftward to the
        preceding tab stop can be given as <STRONG>cbt</STRONG>.  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  <STRONG>ht</STRONG>  or  <STRONG>cbt</STRONG>  even  if  they  are
-       present,  since  the user may not have the tab stops prop-
-       erly set.  If the terminal has  hardware  tabs  which  are
-       initially  set every <EM>n</EM> spaces when the terminal is powered
-       up, the numeric parameter <STRONG>it</STRONG> is given, showing the  number
-       of  spaces  the tabs are set to.  This is normally used by
-       the <EM>tset</EM> 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
+       the  teletype  modes indicate that tabs are being expanded
+       by the computer rather than being sent  to  the  terminal,
+       programs  should  not  use  <STRONG>ht</STRONG>  or  <STRONG>cbt</STRONG>  even  if they are
+       present, since the user may not have the tab  stops  prop-
+       erly  set.   If  the  terminal has hardware tabs which are
+       initially set every <EM>n</EM> spaces when the terminal is  powered
+       up,  the numeric parameter <STRONG>it</STRONG> is given, showing the number
+       of spaces the tabs are set to.  This is normally  used  by
+       the  <EM>tset</EM> command to determine whether to set the mode for
+       hardware tab expansion, and whether to set the tab  stops.
+       If  the  terminal  has tab stops that can be saved in non-
+       volatile memory, the terminfo description can assume  that
        they are properly set.
 
-       Other capabilities include <STRONG>is1</STRONG>, <STRONG>is2</STRONG>, and <STRONG>is3</STRONG>,  initializa-
-       tion  strings  for the terminal, <STRONG>iprog</STRONG>, the path name of a
-       program to be run to initialize the terminal, and <STRONG>if</STRONG>,  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.
+       Other  capabilities include <STRONG>is1</STRONG>, <STRONG>is2</STRONG>, and <STRONG>is3</STRONG>, initializa-
+       tion strings for the terminal, <STRONG>iprog</STRONG>, the path name  of  a
+       program  to be run to initialize the terminal, and <STRONG>if</STRONG>, 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 <EM>init</EM> option
-       of  the  <EM>tput</EM>  program,  each time the user logs in.  They
+       of the <EM>tput</EM> program, each time the  user  logs  in.   They
        will be printed in the following order:
 
               run the program
@@ -1793,101 +1776,99 @@
               and finally
                      output <STRONG>is3</STRONG>.
 
-       Most initialization is done with  <STRONG>is2</STRONG>.   Special  terminal
+       Most  initialization  is  done with <STRONG>is2</STRONG>.  Special terminal
        modes can be set up without duplicating strings by putting
-       the common sequences in <STRONG>is2</STRONG> and special cases in  <STRONG>is1</STRONG>  and
+       the  common  sequences in <STRONG>is2</STRONG> and special cases in <STRONG>is1</STRONG> and
        <STRONG>is3</STRONG>.
 
        A set of sequences that does a harder reset from a totally
        unknown state can be given as <STRONG>rs1</STRONG>, <STRONG>rs2</STRONG>, <STRONG>rf</STRONG> and <STRONG>rs3</STRONG>, analo-
-       gous  to  <STRONG>is1</STRONG>  <STRONG>,</STRONG>  <STRONG>is2</STRONG>  <STRONG>,</STRONG>  <STRONG>if</STRONG>  and <STRONG>is3</STRONG> respectively.  These
-       strings are output by the <EM>reset</EM>  program,  which  is  used
-       when  the terminal gets into a wedged state.  Commands are
-       normally placed in <STRONG>rs1</STRONG>, <STRONG>rs2</STRONG> <STRONG>rs3</STRONG> and <STRONG>rf</STRONG> only if  they  pro-
-       duce  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 <STRONG>is2</STRONG>,
-       but it causes an annoying glitch of the screen and is  not
-       normally  needed  since the terminal is usually already in
+       gous to <STRONG>is1</STRONG> <STRONG>,</STRONG>  <STRONG>is2</STRONG>  <STRONG>,</STRONG>  <STRONG>if</STRONG>  and  <STRONG>is3</STRONG>  respectively.   These
+       strings  are  output  by  the <EM>reset</EM> program, which is used
+       when the terminal gets into a wedged state.  Commands  are
+       normally  placed  in <STRONG>rs1</STRONG>, <STRONG>rs2</STRONG> <STRONG>rs3</STRONG> and <STRONG>rf</STRONG> only if they pro-
+       duce 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  <STRONG>is2</STRONG>,
+       but  it causes an annoying glitch of the screen and is not
+       normally needed since the terminal is usually  already  in
        80 column mode.
 
        The <EM>reset</EM> program writes strings including <STRONG>iprog</STRONG>, etc., in
-       the  same  order  as  the  <EM>init</EM>  program, using <STRONG>rs1</STRONG>, etc.,
+       the same order as  the  <EM>init</EM>  program,  using  <STRONG>rs1</STRONG>,  etc.,
        instead of <STRONG>is1</STRONG>, etc.  If any of <STRONG>rs1</STRONG>, <STRONG>rs2</STRONG>, <STRONG>rs3</STRONG>, or <STRONG>rf</STRONG> reset
-       capability  strings  are  missing, the <EM>reset</EM> program falls
+       capability strings are missing, the  <EM>reset</EM>  program  falls
        back  upon  the  corresponding  initialization  capability
        string.
 
        If there are commands to set and clear tab stops, they can
-       be given as <STRONG>tbc</STRONG> (clear all tab stops) and <STRONG>hts</STRONG> (set  a  tab
-       stop  in the current column of every row).  If a more com-
-       plex sequence is needed  to  set  the  tabs  than  can  be
-       described  by  this,  the sequence can be placed in <STRONG>is2</STRONG> or
+       be  given  as <STRONG>tbc</STRONG> (clear all tab stops) and <STRONG>hts</STRONG> (set a tab
+       stop in the current column of every row).  If a more  com-
+       plex  sequence  is  needed  to  set  the  tabs than can be
+       described by this, the sequence can be placed  in  <STRONG>is2</STRONG>  or
        <STRONG>if</STRONG>.
 
    <STRONG>Delays</STRONG> <STRONG>and</STRONG> <STRONG>Padding</STRONG>
-       Many older and slower  terminals  do  not  support  either
+       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 cer-
+       and  some  very  archaic CRTs (including, for example, DEC
+       VT100s).  These may require padding characters after  cer-
        tain cursor motions and screen changes.
 
        If the terminal uses xon/xoff handshaking for flow control
-       (that  is, it automatically emits ^S back to the host when
+       (that is, it automatically emits ^S back to the host  when
        its input buffers are close to full), set <STRONG>xon</STRONG>.  This capa-
-       bility  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  deci-
+       bility 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 deci-
        sions about relative costs, but actual pad characters will
        not be transmitted.
 
-       If <STRONG>pb</STRONG> (padding baud rate) is given, padding is  suppressed
-       at  baud rates below the value of <STRONG>pb</STRONG>.  If the entry has no
-       padding baud rate, then whether padding is emitted or  not
+       If  <STRONG>pb</STRONG> (padding baud rate) is given, padding is suppressed
+       at baud rates below the value of <STRONG>pb</STRONG>.  If the entry has  no
+       padding  baud rate, then whether padding is emitted or not
        is completely controlled by <STRONG>xon</STRONG>.
 
-       If  the terminal requires other than a null (zero) charac-
-       ter as a pad, then this can be given  as  <STRONG>pad</STRONG>.   Only  the
+       If the terminal requires other than a null (zero)  charac-
+       ter  as  a  pad,  then this can be given as <STRONG>pad</STRONG>.  Only the
        first character of the <STRONG>pad</STRONG> string is used.
 
-
    <STRONG>Status</STRONG> <STRONG>Lines</STRONG>
-       Some  terminals  have  an extra `status line' which is not
-       normally used by software (and thus  not  counted  in  the
+       Some terminals have an extra `status line'  which  is  not
+       normally  used  by  software  (and thus not counted in the
        terminal's <STRONG>lines</STRONG> capability).
 
-       The  simplest  case  is  a  status  line  which is cursor-
-       addressable but not part of the main scrolling  region  on
-       the  screen;  the  Heathkit  H19 has a status line of this
-       kind, as would a 24-line VT100 with  a  23-line  scrolling
-       region  set up on initialization.  This situation is indi-
+       The simplest case  is  a  status  line  which  is  cursor-
+       addressable  but  not part of the main scrolling region on
+       the screen; the Heathkit H19 has a  status  line  of  this
+       kind,  as  would  a 24-line VT100 with a 23-line scrolling
+       region set up on initialization.  This situation is  indi-
        cated by the <STRONG>hs</STRONG> capability.
 
        Some terminals with status lines need special sequences to
-       access  the  status  line.   These  may  be expressed as a
+       access the status line.   These  may  be  expressed  as  a
        string with single parameter <STRONG>tsl</STRONG> which takes the cursor to
-       a  given zero-origin column on the status line.  The capa-
+       a given zero-origin column on the status line.  The  capa-
        bility <STRONG>fsl</STRONG> must return to the main-screen cursor positions
-       before  the  last  <STRONG>tsl</STRONG>.   You may need to embed the string
-       values of <STRONG>sc</STRONG> (save cursor) and <STRONG>rc</STRONG> (restore cursor) in  <STRONG>tsl</STRONG>
+       before the last <STRONG>tsl</STRONG>.  You may need  to  embed  the  string
+       values  of <STRONG>sc</STRONG> (save cursor) and <STRONG>rc</STRONG> (restore cursor) in <STRONG>tsl</STRONG>
        and <STRONG>fsl</STRONG> to accomplish this.
 
-       The  status  line is normally assumed to be the same width
-       as the width of the terminal.  If this is untrue, you  can
+       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 <STRONG>wsl</STRONG>.
 
-       A  command to erase or blank the status line may be speci-
+       A command to erase or blank the status line may be  speci-
        fied as <STRONG>dsl</STRONG>.
 
-       The  boolean  capability  <STRONG>eslok</STRONG>  specifies   that   escape
+       The   boolean   capability  <STRONG>eslok</STRONG>  specifies  that  escape
        sequences, tabs, etc., work ordinarily in the status line.
 
        The <STRONG>ncurses</STRONG> implementation does not yet use any  of  these
        capabilities.   They are documented here in case they ever
        become important.
 
-
    <STRONG>Line</STRONG> <STRONG>Graphics</STRONG>
        Many terminals have alternate character  sets  useful  for
        forms-drawing.   Terminfo  and <STRONG>curses</STRONG> build in support for
@@ -1895,42 +1876,41 @@
        characters  from  the  AT&amp;T  4410v1 added.  This alternate
        character set may be specified by the <STRONG>acsc</STRONG> capability.
 
+       <STRONG>Glyph</STRONG>                       <STRONG>ACS</STRONG>           <STRONG>Ascii</STRONG>     <STRONG>VT100</STRONG>
+       <STRONG>Name</STRONG>                        <STRONG>Name</STRONG>          <STRONG>Default</STRONG>   <STRONG>Name</STRONG>
+       UK pound sign               ACS_STERLING  f         }
+       arrow pointing down         ACS_DARROW    v         .
+       arrow pointing left         ACS_LARROW    &lt;         ,
+       arrow pointing right        ACS_RARROW    &gt;         +
+       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    \         f
+       diamond                     ACS_DIAMOND   +         `
+       greater-than-or-equal-to    ACS_GEQUAL    &gt;         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    &lt;         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
 
-                <STRONG>Glyph</STRONG>             <STRONG>ACS</STRONG>            <STRONG>Ascii</STRONG>      <STRONG>VT100</STRONG>
-                 <STRONG>Name</STRONG>             <STRONG>Name</STRONG>           <STRONG>Default</STRONG>    <STRONG>Name</STRONG>
-       UK pound sign              ACS_STERLING   f          }
-       arrow pointing down        ACS_DARROW     v          .
-       arrow pointing left        ACS_LARROW     &lt;          ,
-       arrow pointing right       ACS_RARROW     &gt;          +
-       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     \          f
-       diamond                    ACS_DIAMOND    +          `
-       greater-than-or-equal-to   ACS_GEQUAL     &gt;          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     &lt;          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
+       upper right corner          ACS_URCORNER  +         k
+       vertical line               ACS_VLINE     |         x
 
        The best way to define a new device's graphics set  is  to
        add  a  column  to a copy of this table for your terminal,
@@ -1940,7 +1920,6 @@
        acter  pairs  right  to left in sequence; these become the
        ACSC string.
 
-
    <STRONG>Color</STRONG> <STRONG>Handling</STRONG>
        Most color terminals are either `Tektronix-like'  or  `HP-
        like'.   Tektronix-like terminals have a predefined set of
@@ -1986,7 +1965,6 @@
        these  as  it  likes,  but  the RGB values indicate normal
        locations in color space.
 
-
              <STRONG>Color</STRONG>       <STRONG>#define</STRONG>       <STRONG>Value</STRONG>       <STRONG>RGB</STRONG>
              black     <STRONG>COLOR_BLACK</STRONG>       0     0, 0, 0
              red       <STRONG>COLOR_RED</STRONG>         1     max,0,0
@@ -2038,17 +2016,16 @@
        ors  are  enabled.  The correspondence with the attributes
        understood by <STRONG>curses</STRONG> is as follows:
 
-
-                      <STRONG>Attribute</STRONG>      <STRONG>Bit</STRONG>   <STRONG>Decimal</STRONG>
-                      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
+              <STRONG>Attribute</STRONG>                   <STRONG>Bit</STRONG>    <STRONG>Decimal</STRONG>
+              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
 
        For example,  on  many  IBM  PC  consoles,  the  underline
        attribute  collides  with the foreground color blue and is
@@ -2058,7 +2035,6 @@
        SVr4  curses  does nothing with <STRONG>ncv</STRONG>, ncurses recognizes it
        and optimizes the output in favor of colors.
 
-
    <STRONG>Miscellaneous</STRONG>
        If the terminal requires other than a null (zero)  charac-
        ter  as  a  pad,  then this can be given as pad.  Only the
@@ -2132,7 +2108,6 @@
        text,  including  <STRONG>mc4</STRONG>,  is  transparently  passed  to  the
        printer while an <STRONG>mc5p</STRONG> is in effect.
 
-
    <STRONG>Glitches</STRONG> <STRONG>and</STRONG> <STRONG>Braindamage</STRONG>
        Hazeltine terminals, which do not allow `~' characters  to
        be displayed should indicate <STRONG>hz</STRONG>.
@@ -2140,209 +2115,207 @@
        Terminals which ignore a line-feed immediately after an <STRONG>am</STRONG>
        wrap, such as the Concept and vt100, should indicate <STRONG>xenl</STRONG>.
 
-       If  <STRONG>el</STRONG>  is  required  to  get  rid of standout (instead of
-       merely writing normal text on top of it),  <STRONG>xhp</STRONG>  should  be
+       If <STRONG>el</STRONG> is required to  get  rid  of  standout  (instead  of
+       merely  writing  normal  text on top of it), <STRONG>xhp</STRONG> should be
        given.
 
-       Teleray  terminals,  where  tabs turn all characters moved
-       over to blanks, should  indicate  <STRONG>xt</STRONG>  (destructive  tabs).
-       Note:    the    variable    indicating    this    is   now
-       `dest_tabs_magic_smso'; in older  versions,  it  was  tel-
+       Teleray terminals, where tabs turn  all  characters  moved
+       over  to  blanks,  should  indicate <STRONG>xt</STRONG> (destructive tabs).
+       Note:   the    variable    indicating    this    is    now
+       `dest_tabs_magic_smso';  in  older  versions,  it was tel-
        eray_glitch.  This glitch is also taken to mean that it is
-       not possible to position the cursor on top  of  a  ``magic
+       not  possible  to  position the cursor on top of a ``magic
        cookie'', that to erase standout mode it is instead neces-
        sary to use delete and insert line.  The ncurses implemen-
        tation ignores this glitch.
 
-       The  Beehive Superbee, which is unable to correctly trans-
-       mit the escape or control C characters, has <STRONG>xsb</STRONG>,  indicat-
-       ing  that the f1 key is used for escape and f2 for control
-       C.  (Only certain Superbees have this  problem,  depending
-       on  the  ROM.)  Note that in older terminfo versions, this
-       capability  was  called  `beehive_glitch';   it   is   now
+       The Beehive Superbee, which is unable to correctly  trans-
+       mit  the escape or control C characters, has <STRONG>xsb</STRONG>, indicat-
+       ing that the f1 key is used for escape and f2 for  control
+       C.   (Only  certain Superbees have this problem, depending
+       on the ROM.)  Note that in older terminfo  versions,  this
+       capability   was   called   `beehive_glitch';  it  is  now
        `no_esc_ctl_c'.
 
-       Other  specific  terminal  problems  may  be  corrected by
+       Other specific  terminal  problems  may  be  corrected  by
        adding more capabilities of the form <STRONG>x</STRONG><EM>x</EM>.
 
-
    <STRONG>Similar</STRONG> <STRONG>Terminals</STRONG>
        If there are two very similar terminals, one (the variant)
-       can  be  defined  as  being just like the other (the base)
-       with certain exceptions.  In the definition of  the  vari-
-       ant,  the string capability <STRONG>use</STRONG> can be given with the name
-       of the base terminal.  The capabilities given  before  <STRONG>use</STRONG>
-       override  those  in  the base type named by <STRONG>use</STRONG>.  If there
-       are multiple <STRONG>use</STRONG> capabilities, they are merged in  reverse
-       order.   That is, the rightmost <STRONG>use</STRONG> reference is processed
-       first, then the one to its left, and so forth.   Capabili-
-       ties  given explicitly in the entry override those brought
+       can be defined as being just like  the  other  (the  base)
+       with  certain  exceptions.  In the definition of the vari-
+       ant, the string capability <STRONG>use</STRONG> can be given with the  name
+       of  the  base terminal.  The capabilities given before <STRONG>use</STRONG>
+       override those in the base type named by  <STRONG>use</STRONG>.   If  there
+       are  multiple <STRONG>use</STRONG> capabilities, they are merged in reverse
+       order.  That is, the rightmost <STRONG>use</STRONG> reference is  processed
+       first,  then the one to its left, and so forth.  Capabili-
+       ties given explicitly in the entry override those  brought
        in by <STRONG>use</STRONG> references.
 
        A capability can be canceled by placing <STRONG>xx@</STRONG> to the left of
-       the  use  reference that imports it, where <EM>xx</EM> is the capa-
+       the use reference that imports it, where <EM>xx</EM> is  the  capa-
        bility.  For example, the entry
 
-                   2621-nl, smkx@, rmkx@, use=2621,
+                                2621-nl, smkx@, rmkx@, use=2621,
 
-       defines a 2621-nl that does not  have  the  <STRONG>smkx</STRONG>  or  <STRONG>rmkx</STRONG>
-       capabilities,  and hence does not turn on the function key
-       labels when in visual mode.  This is useful for  different
+       defines  a  2621-nl  that  does  not have the <STRONG>smkx</STRONG> or <STRONG>rmkx</STRONG>
+       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.
 
-
    <STRONG>Pitfalls</STRONG> <STRONG>of</STRONG> <STRONG>Long</STRONG> <STRONG>Entries</STRONG>
-       Long  terminfo  entries  are  unlikely to be a problem; to
-       date, no entry has even  approached  terminfo's  4096-byte
+       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 transla-
        tions are much more strictly limited (to 1023 bytes), thus
-       termcap  translations  of  long terminfo entries can cause
+       termcap translations of long terminfo  entries  can  cause
        problems.
 
-       The man pages for 4.3BSD and older versions  of  <STRONG>tgetent()</STRONG>
-       instruct  the  user to allocate a 1024-byte buffer for the
-       termcap entry.  The  entry  gets  null-terminated  by  the
+       The  man  pages for 4.3BSD and older versions of <STRONG>tgetent()</STRONG>
+       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
+       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 <STRONG>tgetent()</STRONG>
        is searching for is, several bad things can happen.
 
-       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
+       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.
 
        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
+       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.
 
-       The "before tc expansion" length  is  the  most  important
-       one,  because it affects more than just users of that par-
-       ticular terminal.  This is the length of the entry  as  it
+       The  "before  tc  expansion"  length is the most important
+       one, because it affects more than just users of that  par-
+       ticular  terminal.   This is the length of the entry as it
        exists in /etc/termcap, minus the backslash-newline pairs,
        which <STRONG>tgetent()</STRONG> strips out while reading it.  Some termcap
-       libraries  strip  off  the final newline, too (GNU termcap
+       libraries strip off the final newline,  too  (GNU  termcap
        does not).  Now suppose:
 
-       *    a termcap entry before expansion is  more  than  1023
+       *    a  termcap  entry  before expansion is more than 1023
             bytes long,
 
        *    and the application has only allocated a 1k buffer,
 
-       *    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
+       *    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,
 
-       *    and <STRONG>tgetent()</STRONG> is searching for a terminal  type  that
+       *    and  <STRONG>tgetent()</STRONG>  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  <STRONG>tgetent()</STRONG> has to search the whole
+            after  the long entry, or does not appear in the file
+            at all (so that <STRONG>tgetent()</STRONG> has  to  search  the  whole
             termcap file).
 
-       Then <STRONG>tgetent()</STRONG> 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
+       Then  <STRONG>tgetent()</STRONG>  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.
 
        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 <STRONG>tgetent()</STRONG> only does "tc" expan-
-       sion once it is found the terminal  type  it  was  looking
+       that terminal type, since <STRONG>tgetent()</STRONG> only does "tc"  expan-
+       sion  once  it  is  found the terminal type it was looking
        for, not while searching.
 
        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,
+       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 ter-
-       minal types and users whose TERM variable does not have  a
+       minal  types and users whose TERM variable does not have a
        termcap entry.
 
        When in -C (translate to termcap) mode, the <STRONG>ncurses</STRONG> imple-
        mentation of <STRONG><A HREF="tic.1m.html">tic(1m)</A></STRONG> 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)
+       tc length of a termcap translation is too  long.   The  -c
+       (check)  option  also checks resolved (after tc expansion)
        lengths.
 
    <STRONG>Binary</STRONG> <STRONG>Compatibility</STRONG>
-       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
+       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
+       SVr1, and have added extension capabilities to the  string
+       table  that  (in  the binary format) collide with System V
        and XSI Curses extensions.
 
 
 </PRE>
 <H2>EXTENSIONS</H2><PRE>
-       Some  SVr4  <STRONG>curses</STRONG>  implementations,  and  all previous to
-       SVr4, do not interpret the %A and %O operators in  parame-
+       Some SVr4 <STRONG>curses</STRONG>  implementations,  and  all  previous  to
+       SVr4,  do not interpret the %A and %O operators in parame-
        ter strings.
 
-       SVr4/XPG4  do  not  specify whether <STRONG>msgr</STRONG> 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  <STRONG>ncurses</STRONG>  implementation
-       ignores  <STRONG>msgr</STRONG>  in <STRONG>ALTCHARSET</STRONG> mode.  This raises the possi-
-       bility that an XPG4  implementation  making  the  opposite
-       interpretation  may need terminfo entries made for <STRONG>ncurses</STRONG>
+       SVr4/XPG4 do not specify whether  <STRONG>msgr</STRONG>  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 <STRONG>ncurses</STRONG> implementation
+       ignores <STRONG>msgr</STRONG> in <STRONG>ALTCHARSET</STRONG> mode.  This raises  the  possi-
+       bility  that  an  XPG4  implementation making the opposite
+       interpretation may need terminfo entries made for  <STRONG>ncurses</STRONG>
        to have <STRONG>msgr</STRONG> turned off.
 
-       The <STRONG>ncurses</STRONG> library handles insert-character  and  insert-
+       The  <STRONG>ncurses</STRONG>  library handles insert-character and insert-
        character modes in a slightly non-standard way to get bet-
-       ter update efficiency.  See  the  <STRONG>Insert/Delete</STRONG>  <STRONG>Character</STRONG>
+       ter  update  efficiency.   See the <STRONG>Insert/Delete</STRONG> <STRONG>Character</STRONG>
        subsection above.
 
-       The   parameter   substitutions  for  <STRONG>set_clock</STRONG>  and  <STRONG>dis-</STRONG>
-       <STRONG>play_clock</STRONG> are not documented in SVr4 or  the  XSI  Curses
+       The  parameter  substitutions  for  <STRONG>set_clock</STRONG>   and   <STRONG>dis-</STRONG>
+       <STRONG>play_clock</STRONG>  are  not  documented in SVr4 or the XSI Curses
        standard.  They are deduced from the documentation for the
        AT&amp;T 505 terminal.
 
-       Be careful assigning the <STRONG>kmous</STRONG>  capability.   The  <STRONG>ncurses</STRONG>
-       wants  to  interpret it as <STRONG>KEY_MOUSE</STRONG>, for use by terminals
-       and emulators like xterm that  can  return  mouse-tracking
+       Be  careful  assigning  the <STRONG>kmous</STRONG> capability.  The <STRONG>ncurses</STRONG>
+       wants to interpret it as <STRONG>KEY_MOUSE</STRONG>, for use  by  terminals
+       and  emulators  like  xterm that can return mouse-tracking
        information in the keyboard-input stream.
 
-       Different  commercial ports of terminfo and curses support
-       different subsets of the XSI Curses standard and (in  some
+       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, accu-
        rate as of October 1995:
 
        <STRONG>SVR4,</STRONG> <STRONG>Solaris,</STRONG> <STRONG>ncurses</STRONG> -- These support all SVr4 capabili-
        ties.
 
-       <STRONG>SGI</STRONG>  --  Supports  the  SVr4  set,  adds  one undocumented
+       <STRONG>SGI</STRONG> --  Supports  the  SVr4  set,  adds  one  undocumented
        extended string capability (<STRONG>set_pglen</STRONG>).
 
-       <STRONG>SVr1,</STRONG> <STRONG>Ultrix</STRONG> -- These support a restricted subset of  ter-
-       minfo  capabilities.   The booleans end with <STRONG>xon_xoff</STRONG>; the
-       numerics with  <STRONG>width_status_line</STRONG>;  and  the  strings  with
+       <STRONG>SVr1,</STRONG>  <STRONG>Ultrix</STRONG> -- These support a restricted subset of ter-
+       minfo capabilities.  The booleans end with  <STRONG>xon_xoff</STRONG>;  the
+       numerics  with  <STRONG>width_status_line</STRONG>;  and  the  strings with
        <STRONG>prtr_non</STRONG>.
 
-       <STRONG>HP/UX</STRONG>  --  Supports  the  SVr1  subset,  plus the SVr[234]
+       <STRONG>HP/UX</STRONG> -- Supports  the  SVr1  subset,  plus  the  SVr[234]
        numerics <STRONG>num_labels</STRONG>, <STRONG>label_height</STRONG>, <STRONG>label_width</STRONG>, plus func-
-       tion  keys  11  through  63, plus <STRONG>plab_norm</STRONG>, <STRONG>label_on</STRONG>, and
+       tion keys 11 through 63,  plus  <STRONG>plab_norm</STRONG>,  <STRONG>label_on</STRONG>,  and
        <STRONG>label_off</STRONG>, plus some incompatible extensions in the string
        table.
 
-       <STRONG>AIX</STRONG>  --  Supports  the  SVr1 subset, plus function keys 11
-       through 63, plus a number  of  incompatible  string  table
+       <STRONG>AIX</STRONG> -- Supports the SVr1 subset,  plus  function  keys  11
+       through  63,  plus  a  number of incompatible string table
        extensions.
 
-       <STRONG>OSF</STRONG>  -- Supports both the SVr4 set and the AIX extensions.
+       <STRONG>OSF</STRONG> -- Supports both the SVr4 set and the AIX extensions.
 
 
 </PRE>
@@ -2353,12 +2326,13 @@
 
 </PRE>
 <H2>SEE ALSO</H2><PRE>
-       <STRONG><A HREF="tic.1m.html">tic(1m)</A></STRONG>, <STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>, <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="printf.3.html">printf(3)</A></STRONG>, <STRONG><A HREF="term.5.html">term(5)</A></STRONG>.
+       <STRONG><A HREF="tic.1m.html">tic(1m)</A></STRONG>,   <STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>,  <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>,  <STRONG><A HREF="printf.3.html">printf(3)</A></STRONG>,  <STRONG><A HREF="term.5.html">term(5)</A></STRONG>.
+       <STRONG><A HREF="term_variables.3x.html">term_variables(3x)</A></STRONG>.
 
 
 </PRE>
 <H2>AUTHORS</H2><PRE>
-       Zeyd  M.  Ben-Halim,  Eric  S.  Raymond, Thomas E. Dickey.
+       Zeyd M. Ben-Halim, Eric  S.  Raymond,  Thomas  E.  Dickey.
        Based on pcurses by Pavel Curtis.
 
 
diff -Naur ncurses-5.7.orig/doc/html/man/tic.1m.html ncurses-5.7/doc/html/man/tic.1m.html
--- ncurses-5.7.orig/doc/html/man/tic.1m.html	2008-10-11 17:34:18.000000000 -0400
+++ ncurses-5.7/doc/html/man/tic.1m.html	2011-01-08 18:18:29.358656498 -0500
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 <!-- 
   ****************************************************************************
-  * 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,7 +27,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: tic.1m,v 1.44 2006/12/24 17:59:11 tom Exp @
+  * @Id: tic.1m,v 1.46 2010/08/28 19:41:09 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -160,11 +160,11 @@
 
        <STRONG>-r</STRONG>     Force entry resolution (so there are  no  remaining
               tc  capabilities)  even  when  doing translation to
-              termcap format.  This may  be  needed  if  you  are
-              preparing  a  termcap  file  for  a termcap library
-              (such as GNU termcap through  version  1.3  or  BSD
-              termcap through 4.3BSD) that does not handle multi-
-              ple tc capabilities per entry.
+              termcap format.  This may be needed if you are pre-
+              paring  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.
 
        <STRONG>-s</STRONG>     Summarize the compile by showing the directory into
               which  entries  are  written,  and  the  number  of
@@ -228,45 +228,45 @@
        9      All values computed in construction of the hash ta-
               ble
 
-       If the debug level <EM>n</EM> is not given, it is taken to be  one.
+       If the debug level <EM>n</EM> is not given, it is taken to be one.
 
        All but one of the capabilities recognized by <STRONG>tic</STRONG> are doc-
        umented in <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>.  The exception is the <STRONG>use</STRONG> capabil-
        ity.
 
-       When  a  <STRONG>use</STRONG>=<EM>entry</EM>-<EM>name</EM>  field is discovered in a terminal
-       entry currently being compiled, <STRONG>tic</STRONG> reads  in  the  binary
-       from  <STRONG>/usr/share/terminfo</STRONG> to complete the entry.  (Entries
-       created from <EM>file</EM> will be used first.  If the  environment
-       variable  <STRONG>TERMINFO</STRONG>  is  set,  that  directory  is searched
+       When a <STRONG>use</STRONG>=<EM>entry</EM>-<EM>name</EM> field is discovered  in  a  terminal
+       entry  currently  being  compiled, <STRONG>tic</STRONG> reads in the binary
+       from <STRONG>/usr/share/terminfo</STRONG> to complete the entry.   (Entries
+       created  from <EM>file</EM> will be used first.  If the environment
+       variable <STRONG>TERMINFO</STRONG>  is  set,  that  directory  is  searched
        instead of <STRONG>/usr/share/terminfo</STRONG>.)  <STRONG>tic</STRONG> duplicates the capa-
-       bilities  in  <EM>entry</EM>-<EM>name</EM>  for  the current entry, with the
-       exception  of  those  capabilities  that  explicitly   are
+       bilities in <EM>entry</EM>-<EM>name</EM> for the  current  entry,  with  the
+       exception   of  those  capabilities  that  explicitly  are
        defined in the current entry.
 
-       When    an   entry,   e.g.,   <STRONG>entry_name_1</STRONG>,   contains   a
-       <STRONG>use=</STRONG><EM>entry</EM>_<EM>name</EM>_<EM>2</EM>  field,  any  canceled  capabilities   in
-       <EM>entry</EM>_<EM>name</EM>_<EM>2</EM>  must also appear in <STRONG>entry_name_1</STRONG> before <STRONG>use=</STRONG>
+       When   an   entry,   e.g.,   <STRONG>entry_name_1</STRONG>,   contains    a
+       <STRONG>use=</STRONG><EM>entry</EM>_<EM>name</EM>_<EM>2</EM>   field,  any  canceled  capabilities  in
+       <EM>entry</EM>_<EM>name</EM>_<EM>2</EM> must also appear in <STRONG>entry_name_1</STRONG> before  <STRONG>use=</STRONG>
        for these capabilities to be canceled in <STRONG>entry_name_1</STRONG>.
 
-       If the environment variable <STRONG>TERMINFO</STRONG> is set, the  compiled
+       If  the environment variable <STRONG>TERMINFO</STRONG> is set, the compiled
        results are placed there instead of <STRONG>/usr/share/terminfo</STRONG>.
 
        Total compiled entries cannot exceed 4096 bytes.  The name
-       field cannot exceed 512 bytes.  Terminal  names  exceeding
-       the  maximum  alias  length (32 characters on systems with
+       field  cannot  exceed 512 bytes.  Terminal names exceeding
+       the maximum alias length (32 characters  on  systems  with
        long filenames, 14 characters otherwise) will be truncated
-       to  the maximum alias length and a warning message will be
+       to the maximum alias length and a warning message will  be
        printed.
 
 
 </PRE>
 <H2>COMPATIBILITY</H2><PRE>
-       There is some evidence that historic  <STRONG>tic</STRONG>  implementations
-       treated  description  fields with no whitespace in them as
-       additional aliases or short names.  This <STRONG>tic</STRONG> does  not  do
-       that,  but  it  does  warn  when description fields may be
-       treated that way and check them for dangerous  characters.
+       There  is  some evidence that historic <STRONG>tic</STRONG> implementations
+       treated description fields with no whitespace in  them  as
+       additional  aliases  or short names.  This <STRONG>tic</STRONG> does not do
+       that, but it does warn  when  description  fields  may  be
+       treated that way and check them for dangerous characters.
 
 
 </PRE>
@@ -309,7 +309,13 @@
        <STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>,    <STRONG><A HREF="captoinfo.1m.html">captoinfo(1m)</A></STRONG>,   <STRONG><A HREF="infotocap.1m.html">infotocap(1m)</A></STRONG>,   <STRONG><A HREF="toe.1m.html">toe(1m)</A></STRONG>,
        <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>.
 
-       This describes <STRONG>ncurses</STRONG> version 5.6 (patch 20081011).
+       This describes <STRONG>ncurses</STRONG> version 5.7 (patch 20101002).
+
+
+</PRE>
+<H2>AUTHOR</H2><PRE>
+       Eric S. Raymond &lt;esr@snark.thyrsus.com&gt; and
+       Thomas E. Dickey &lt;dickey@invisible-island.net&gt;
 
 
 
diff -Naur ncurses-5.7.orig/doc/html/man/toe.1m.html ncurses-5.7/doc/html/man/toe.1m.html
--- ncurses-5.7.orig/doc/html/man/toe.1m.html	2008-10-11 17:34:18.000000000 -0400
+++ ncurses-5.7/doc/html/man/toe.1m.html	2011-01-08 18:18:29.358656498 -0500
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 <!-- 
   ****************************************************************************
-  * 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,7 +27,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: toe.1m,v 1.21 2008/01/05 20:57:16 tom Exp @
+  * @Id: toe.1m,v 1.22 2010/07/31 16:08:48 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -111,7 +111,7 @@
        <STRONG><A HREF="tic.1m.html">tic(1m)</A></STRONG>,    <STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>,   <STRONG><A HREF="captoinfo.1m.html">captoinfo(1m)</A></STRONG>,   <STRONG><A HREF="infotocap.1m.html">infotocap(1m)</A></STRONG>,
        <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>.
 
-       This describes <STRONG>ncurses</STRONG> version 5.6 (patch 20081011).
+       This describes <STRONG>ncurses</STRONG> version 5.7 (patch 20101002).
 
 
 
diff -Naur ncurses-5.7.orig/doc/html/man/tput.1.html ncurses-5.7/doc/html/man/tput.1.html
--- ncurses-5.7.orig/doc/html/man/tput.1.html	2008-10-11 17:34:18.000000000 -0400
+++ ncurses-5.7/doc/html/man/tput.1.html	2011-01-08 18:18:29.358656498 -0500
@@ -2,7 +2,7 @@
 <!-- 
   * 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            *
@@ -28,7 +28,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: tput.1,v 1.27 2006/12/24 18:11:31 tom Exp @
+  * @Id: tput.1,v 1.28 2010/07/31 16:08:48 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -99,8 +99,8 @@
               be queried for the actual screen size.
 
        <EM>capname</EM>
-              indicates   the   capability   from   the  <STRONG>terminfo</STRONG>
-              database.  When <STRONG>termcap</STRONG> support is compiled in, the
+              indicates  the  capability  from the <STRONG>terminfo</STRONG> data-
+              base.  When <STRONG>termcap</STRONG> support  is  compiled  in,  the
               <STRONG>termcap</STRONG> name for the capability is also accepted.
 
        <EM>parms</EM>  If  the  capability  is a string that takes parame-
@@ -112,8 +112,8 @@
               table to decide which to pass as strings.  Normally
               <STRONG>tput</STRONG> uses <STRONG>tparm</STRONG> (3x) to perform  the  substitution.
               If no parameters are given for the capability, <STRONG>tput</STRONG>
-              writes   the   string   without   performing    the
-              substitution.
+              writes the string without performing the  substitu-
+              tion.
 
        <STRONG>-S</STRONG>     allows  more  than one capability per invocation of
               <STRONG>tput</STRONG>.  The capabilities must be passed to <STRONG>tput</STRONG> from
@@ -204,16 +204,16 @@
        <STRONG>bold=`tput</STRONG> <STRONG>smso`</STRONG> <STRONG>offbold=`tput</STRONG> <STRONG>rmso`</STRONG>
             Set the shell variables <STRONG>bold</STRONG>, to begin stand-out mode
             sequence, and <STRONG>offbold</STRONG>, to end standout mode sequence,
-            for the current terminal.  This might be followed  by
-            a  prompt:  <STRONG>echo</STRONG>  <STRONG>"${bold}Please</STRONG>  <STRONG>type</STRONG>  <STRONG>in</STRONG> <STRONG>your</STRONG> <STRONG>name:</STRONG>
+            for  the current terminal.  This might be followed by
+            a prompt: <STRONG>echo</STRONG>  <STRONG>"${bold}Please</STRONG>  <STRONG>type</STRONG>  <STRONG>in</STRONG>  <STRONG>your</STRONG>  <STRONG>name:</STRONG>
             <STRONG>${offbold}\c"</STRONG>
 
        <STRONG>tput</STRONG> <STRONG>hc</STRONG>
-            Set exit code to indicate if the current terminal  is
+            Set  exit code to indicate if the current terminal is
             a hard copy terminal.
 
        <STRONG>tput</STRONG> <STRONG>cup</STRONG> <STRONG>23</STRONG> <STRONG>4</STRONG>
-            Send  the sequence to move the cursor to row 23, col-
+            Send the sequence to move the cursor to row 23,  col-
             umn 4.
 
        <STRONG>tput</STRONG> <STRONG>cup</STRONG>
@@ -221,8 +221,8 @@
             parameters substituted.
 
        <STRONG>tput</STRONG> <STRONG>longname</STRONG>
-            Print  the  long  name from the <STRONG>terminfo</STRONG> database for
-            the type of terminal specified in  the  environmental
+            Print the long name from the  <STRONG>terminfo</STRONG>  database  for
+            the  type  of terminal specified in the environmental
             variable <STRONG>TERM</STRONG>.
 
             <STRONG>tput</STRONG> <STRONG>-S</STRONG> <STRONG>&lt;&lt;!</STRONG>
@@ -231,10 +231,10 @@
             <STRONG>&gt;</STRONG> <STRONG>bold</STRONG>
             <STRONG>&gt;</STRONG> <STRONG>!</STRONG>
 
-            This  example shows <STRONG>tput</STRONG> processing several capabili-
-            ties in one invocation.  It clears the screen,  moves
-            the  cursor  to  position  10,  10  and turns on bold
-            (extra bright) mode.  The list is  terminated  by  an
+            This example shows <STRONG>tput</STRONG> processing several  capabili-
+            ties  in one invocation.  It clears the screen, moves
+            the cursor to position  10,  10  and  turns  on  bold
+            (extra  bright)  mode.   The list is terminated by an
             exclamation mark (<STRONG>!</STRONG>) on a line by itself.
 
 
@@ -245,8 +245,8 @@
 
        <STRONG>/usr/share/tabset/*</STRONG>
               tab settings for some terminals, in a format appro-
-              priate  to  be  output  to  the  terminal   (escape
-              sequences  that  set  margins  and  tabs); for more
+              priate   to  be  output  to  the  terminal  (escape
+              sequences that set  margins  and  tabs);  for  more
               information, see the "Tabs and Initialization" sec-
               tion of <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>
 
@@ -254,16 +254,16 @@
 </PRE>
 <H2>EXIT CODES</H2><PRE>
        If the <STRONG>-S</STRONG> option is used, <STRONG>tput</STRONG> checks for errors from each
-       line, and if any errors are found, will set the exit  code
-       to  4  plus the number of lines with errors.  If no errors
-       are found, the exit code is <STRONG>0</STRONG>.   No  indication  of  which
+       line,  and if any errors are found, will set the exit code
+       to 4 plus the number of lines with errors.  If  no  errors
+       are  found,  the  exit  code is <STRONG>0</STRONG>.  No indication of which
        line failed can be given so exit code <STRONG>1</STRONG> will never appear.
-       Exit codes <STRONG>2</STRONG>, <STRONG>3</STRONG>, and <STRONG>4</STRONG> retain their usual  interpretation.
+       Exit  codes <STRONG>2</STRONG>, <STRONG>3</STRONG>, and <STRONG>4</STRONG> retain their usual interpretation.
        If the <STRONG>-S</STRONG> option is not used, the exit code depends on the
        type of <EM>capname</EM>:
 
             <EM>boolean</EM>
-                   a value of <STRONG>0</STRONG> is set for TRUE and <STRONG>1</STRONG> for  FALSE.
+                   a value of <STRONG>0</STRONG> is set for TRUE and <STRONG>1</STRONG> for FALSE.
 
             <EM>string</EM> a  value of <STRONG>0</STRONG> is set if the <EM>capname</EM> is defined
                    for this terminal <EM>type</EM> (the value  of  <EM>capname</EM>
@@ -294,7 +294,6 @@
        <STRONG>tput</STRONG> prints the following error messages and sets the cor-
        responding exit codes.
 
-
        exit code   error message
        ---------------------------------------------------------------------
        <STRONG>0</STRONG>           (<EM>capname</EM> is a numeric variable that is not specified  in
@@ -318,9 +317,9 @@
        <STRONG>reset</STRONG>.   In this implementation, <STRONG>clear</STRONG> is part of the <EM>cap-</EM>
        <EM>name</EM> support.  Other implementations of <STRONG>tput</STRONG> on SVr4-based
        systems such as Solaris, IRIX64 and HPUX as well as others
-       such  as  AIX  and  Tru64  provide  support  for   <EM>capname</EM>
-       operands.  A few platforms such as FreeBSD and NetBSD rec-
-       ognize termcap names rather than terminfo capability names
+       such as AIX and Tru64 provide support  for  <EM>capname</EM>  oper-
+       ands.   A  few platforms such as FreeBSD and NetBSD recog-
+       nize termcap names rather than terminfo  capability  names
        in their respective <STRONG>tput</STRONG> commands.
 
 
@@ -328,7 +327,7 @@
 <H2>SEE ALSO</H2><PRE>
        <STRONG><A HREF="clear.1.html">clear(1)</A></STRONG>, <STRONG><A HREF="stty.1.html">stty(1)</A></STRONG>, <STRONG><A HREF="tabs.1.html">tabs(1)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>.
 
-       This describes <STRONG>ncurses</STRONG> version 5.6 (patch 20081011).
+       This describes <STRONG>ncurses</STRONG> version 5.7 (patch 20101002).
 
 
 
diff -Naur ncurses-5.7.orig/doc/html/man/tset.1.html ncurses-5.7/doc/html/man/tset.1.html
--- ncurses-5.7.orig/doc/html/man/tset.1.html	2008-10-11 17:34:19.000000000 -0400
+++ ncurses-5.7/doc/html/man/tset.1.html	2011-01-08 18:18:29.362656607 -0500
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 <!-- 
   ****************************************************************************
-  * Copyright (c) 1998-2005,2006 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,7 +27,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: tset.1,v 1.19 2006/12/24 15:00:30 tom Exp @
+  * @Id: tset.1,v 1.23 2010/07/31 15:59:30 tom Exp @
 -->
 <HTML>
 <HEAD>
@@ -70,9 +70,9 @@
 
        3.  (BSD  systems only.) The terminal type associated with
        the standard error output device in  the  <EM>/etc/ttys</EM>  file.
-       (On Linux and System-V-like UNIXes, <EM>getty</EM> does this job by
-       setting <STRONG>TERM</STRONG>  according  to  the  type  passed  to  it  by
-       <EM>/etc/inittab</EM>.)
+       (On  System-V-like  UNIXes  and systems using that conven-
+       tion, <EM>getty</EM> does this job by setting <STRONG>TERM</STRONG> according to the
+       type passed to it by <EM>/etc/inittab</EM>.)
 
        4. The default terminal type, ``unknown''.
 
@@ -141,9 +141,9 @@
 
        <STRONG>-r</STRONG>   Print the terminal type to the standard error output.
 
-       <STRONG>-s</STRONG>   Print  the  sequence  of shell commands to initialize
+       <STRONG>-s</STRONG>   Print the sequence of shell  commands  to  initialize
             the environment variable <STRONG>TERM</STRONG> to the standard output.
-            See  the section <STRONG>SETTING</STRONG> <STRONG>THE</STRONG> <STRONG>ENVIRONMENT</STRONG> for details.
+            See the section <STRONG>SETTING</STRONG> <STRONG>THE</STRONG> <STRONG>ENVIRONMENT</STRONG> for details.
 
        <STRONG>-V</STRONG>   reports the version of ncurses which was used in this
             program, and exits.
@@ -154,7 +154,8 @@
 
        The arguments for the <STRONG>-e</STRONG>, <STRONG>-i</STRONG>, and <STRONG>-k</STRONG> options may either be
        entered as actual characters or by using the  `hat'  nota-
-       tion, i.e. control-h may be specified as ``^H'' or ``^h''.
+       tion,  i.e.,  control-h  may  be  specified  as  ``^H'' or
+       ``^h''.
 
 
 </PRE>
@@ -318,7 +319,7 @@
        <STRONG><A HREF="csh.1.html">csh(1)</A></STRONG>, <STRONG><A HREF="sh.1.html">sh(1)</A></STRONG>, <STRONG><A HREF="stty.1.html">stty(1)</A></STRONG>,  <STRONG><A HREF="curs_terminfo.3x.html">curs_terminfo(3x)</A></STRONG>,  <STRONG><A HREF="tty.4.html">tty(4)</A></STRONG>,  ter-
        <STRONG><A HREF="minfo.5.html">minfo(5)</A></STRONG>, <STRONG><A HREF="ttys.5.html">ttys(5)</A></STRONG>, <STRONG><A HREF="environ.7.html">environ(7)</A></STRONG>
 
-       This describes <STRONG>ncurses</STRONG> version 5.6 (patch 20081011).
+       This describes <STRONG>ncurses</STRONG> version 5.7 (patch 20101002).
 
 
 
diff -Naur ncurses-5.7.orig/doc/html/man/wresize.3x.html ncurses-5.7/doc/html/man/wresize.3x.html
--- ncurses-5.7.orig/doc/html/man/wresize.3x.html	2006-09-23 16:43:23.000000000 -0400
+++ ncurses-5.7/doc/html/man/wresize.3x.html	2011-01-08 18:18:29.250657520 -0500
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 <!-- 
   ****************************************************************************
-  * 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 @@
   * authorization.                                                           *
   ****************************************************************************
   * Author: Thomas E. Dickey 1996
-  * @Id: wresize.3x,v 1.9 2006/02/25 21:47:06 tom Exp @
+  * @Id: wresize.3x,v 1.12 2010/08/14 23:12:04 Tim.van.der.Molen Exp @
 -->
 <HTML>
 <HEAD>
@@ -60,12 +60,12 @@
 
 </PRE>
 <H2>DESCRIPTION</H2><PRE>
-       The  <STRONG>wresize</STRONG>  function  reallocates storage for an <STRONG>ncurses</STRONG>
-       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 <STRONG>wbkgndset</STRONG>) merged into
-       them.
+       This  is  an  extension to the curses library.  It reallo-
+       cates storage for an <STRONG>ncurses</STRONG> window to adjust  its  dimen-
+       sions  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 rendi-
+       tion (as set by <STRONG>wbkgdset</STRONG>) merged into them.
 
 
 </PRE>
diff -Naur ncurses-5.7.orig/doc/html/ncurses-intro.html ncurses-5.7/doc/html/ncurses-intro.html
--- ncurses-5.7.orig/doc/html/ncurses-intro.html	2007-03-03 14:31:50.000000000 -0500
+++ ncurses-5.7/doc/html/ncurses-intro.html	2011-01-08 18:18:29.638657816 -0500
@@ -1,8 +1,8 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.0//EN">
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 <!--
-  $Id: ncurses-intro.html,v 1.43 2007/03/03 19:31:50 tom Exp $
+  $Id: ncurses-intro.html,v 1.44 2010/12/04 16:46:22 tom Exp $
   ****************************************************************************
-  * 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            *
diff -Naur ncurses-5.7.orig/form/Makefile.in ncurses-5.7/form/Makefile.in
--- ncurses-5.7.orig/form/Makefile.in	2007-04-28 10:56:11.000000000 -0400
+++ ncurses-5.7/form/Makefile.in	2011-01-08 18:18:29.566655997 -0500
@@ -1,6 +1,6 @@
-# $Id: Makefile.in,v 1.47 2007/04/28 14:56:11 tom Exp $
+# $Id: Makefile.in,v 1.53 2010/11/27 21:45:27 tom Exp $
 ##############################################################################
-# Copyright (c) 1998-2006,2007 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 "Software"), #
@@ -43,6 +43,7 @@
 .SUFFIXES:
 
 SHELL		= /bin/sh
+VPATH		= @srcdir@
 THIS		= Makefile
 
 x		= @EXEEXT@
@@ -63,6 +64,7 @@
 LIBTOOL_LINK	= @LIB_LINK@
 LIBTOOL_INSTALL	= @LIB_INSTALL@
 LIBTOOL_UNINSTALL = @LIB_UNINSTALL@
+LT_UNDEF	= @LT_UNDEF@
 
 INSTALL		= @INSTALL@
 INSTALL_LIB	= @INSTALL@ @INSTALL_LIB@
@@ -70,11 +72,14 @@
 INSTALL_DATA	= @INSTALL_DATA@
 
 AR		= @AR@
-AR_OPTS		= @AR_OPTS@
+ARFLAGS		= @ARFLAGS@
 AWK		= @AWK@
 LD		= @LD@
 LN_S		= @LN_S@
 
+CTAGS		= @CTAGS@
+ETAGS		= @ETAGS@
+
 CC		= @CC@
 CPP		= @CPP@
 CFLAGS		= @CFLAGS@
@@ -124,7 +129,7 @@
 
 $(DESTDIR)$(bindir) \
 $(DESTDIR)$(libdir) :
-	sh $(srcdir)/../mkdirs.sh $@
+	mkdir -p $@
 
 # make copies to simplify include-paths while still keeping form's include
 # file in this directory.
@@ -132,7 +137,7 @@
 	-rm -f $@
 	cp $(srcdir)/form.h $@
 
-FORM_PRIV_H = \
+HEADER_DEPS = \
 	$(srcdir)/form.priv.h \
 	$(srcdir)/form.h \
 	../include/mf_common.h \
@@ -140,10 +145,10 @@
 	../include/eti.h
 
 tags:
-	ctags *.[ch]
+	$(CTAGS) *.[ch]
 
 @MAKE_UPPER_TAGS@TAGS:
-@MAKE_UPPER_TAGS@	etags *.[ch]
+@MAKE_UPPER_TAGS@	$(ETAGS) *.[ch]
 
 mostlyclean ::
 	-rm -f core tags TAGS *~ *.bak *.i *.ln *.atac trace
diff -Naur ncurses-5.7.orig/form/f_trace.c ncurses-5.7/form/f_trace.c
--- ncurses-5.7.orig/form/f_trace.c	2004-12-25 18:28:49.000000000 -0500
+++ ncurses-5.7/form/f_trace.c	2011-01-08 18:13:50.439157211 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2004 Free Software Foundation, Inc.                        *
+ * Copyright (c) 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            *
@@ -32,33 +32,33 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: f_trace.c,v 1.1 2004/12/25 23:28:49 tom Exp $")
+MODULE_ID("$Id: f_trace.c,v 1.2 2010/01/23 21:14:36 tom Exp $")
 
 NCURSES_EXPORT(FIELD **)
 _nc_retrace_field_ptr(FIELD **code)
 {
-  T((T_RETURN("%p"), code));
+  T((T_RETURN("%p"), (void *)code));
   return code;
 }
 
 NCURSES_EXPORT(FIELD *)
 _nc_retrace_field(FIELD *code)
 {
-  T((T_RETURN("%p"), code));
+  T((T_RETURN("%p"), (void *)code));
   return code;
 }
 
 NCURSES_EXPORT(FIELDTYPE *)
 _nc_retrace_field_type(FIELDTYPE *code)
 {
-  T((T_RETURN("%p"), code));
+  T((T_RETURN("%p"), (void *)code));
   return code;
 }
 
 NCURSES_EXPORT(FORM *)
 _nc_retrace_form(FORM *code)
 {
-  T((T_RETURN("%p"), code));
+  T((T_RETURN("%p"), (void *)code));
   return code;
 }
 
diff -Naur ncurses-5.7.orig/form/fld_arg.c ncurses-5.7/form/fld_arg.c
--- ncurses-5.7.orig/form/fld_arg.c	2004-12-25 17:20:18.000000000 -0500
+++ ncurses-5.7/form/fld_arg.c	2011-01-08 18:13:50.439157211 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,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            *
@@ -32,7 +32,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: fld_arg.c,v 1.11 2004/12/25 22:20:18 tom Exp $")
+MODULE_ID("$Id: fld_arg.c,v 1.12 2010/01/23 21:14:35 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform
@@ -67,7 +67,7 @@
 		  void (*const free_arg) (void *))
 {
   T((T_CALLED("set_fieldtype_arg(%p,%p,%p,%p)"),
-     typ, make_arg, copy_arg, free_arg));
+     (void *)typ, make_arg, copy_arg, free_arg));
 
   if (typ != 0 && make_arg != (void *)0)
     {
@@ -91,7 +91,7 @@
 NCURSES_EXPORT(void *)
 field_arg(const FIELD *field)
 {
-  T((T_CALLED("field_arg(%p)"), field));
+  T((T_CALLED("field_arg(%p)"), (const void *)field));
   returnVoidPtr(Normalize_Field(field)->arg);
 }
 
diff -Naur ncurses-5.7.orig/form/fld_attr.c ncurses-5.7/form/fld_attr.c
--- ncurses-5.7.orig/form/fld_attr.c	2004-12-11 16:33:15.000000000 -0500
+++ ncurses-5.7/form/fld_attr.c	2011-01-08 18:13:50.439157211 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,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            *
@@ -32,7 +32,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: fld_attr.c,v 1.10 2004/12/11 21:33:15 tom Exp $")
+MODULE_ID("$Id: fld_attr.c,v 1.11 2010/01/23 21:12:08 tom Exp $")
 
 /*----------------------------------------------------------------------------
   Field-Attribute manipulation routines
@@ -66,7 +66,7 @@
 #define GEN_FIELD_ATTR_GET_FCT( name ) \
 NCURSES_IMPEXP chtype NCURSES_API field_ ## name (const FIELD * field)\
 {\
-   T((T_CALLED("field_" #name "(%p)"), field));\
+   T((T_CALLED("field_" #name "(%p)"), (const void *) field));\
    returnAttr( A_ATTRIBUTES & (Normalize_Field( field ) -> name) );\
 }
 
diff -Naur ncurses-5.7.orig/form/fld_current.c ncurses-5.7/form/fld_current.c
--- ncurses-5.7.orig/form/fld_current.c	2004-12-25 17:40:13.000000000 -0500
+++ ncurses-5.7/form/fld_current.c	2011-01-08 18:13:50.439157211 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,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            *
@@ -32,7 +32,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: fld_current.c,v 1.11 2004/12/25 22:40:13 tom Exp $")
+MODULE_ID("$Id: fld_current.c,v 1.12 2010/01/23 21:14:35 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform
@@ -52,7 +52,7 @@
 {
   int err = E_OK;
 
-  T((T_CALLED("set_current_field(%p,%p)"), form, field));
+  T((T_CALLED("set_current_field(%p,%p)"), (void *)form, (void *)field));
   if (form == 0 || field == 0)
     {
       RETURN(E_BAD_ARGUMENT);
@@ -113,7 +113,7 @@
 NCURSES_EXPORT(FIELD *)
 current_field(const FORM *form)
 {
-  T((T_CALLED("current_field(%p)"), form));
+  T((T_CALLED("current_field(%p)"), (const void *)form));
   returnField(Normalize_Form(form)->current);
 }
 
@@ -130,7 +130,7 @@
 NCURSES_EXPORT(int)
 field_index(const FIELD *field)
 {
-  T((T_CALLED("field_index(%p)"), field));
+  T((T_CALLED("field_index(%p)"), (const void *)field));
   returnCode((field != 0 && field->form != 0) ? (int)field->index : -1);
 }
 
diff -Naur ncurses-5.7.orig/form/fld_def.c ncurses-5.7/form/fld_def.c
--- ncurses-5.7.orig/form/fld_def.c	2007-10-13 15:29:58.000000000 -0400
+++ ncurses-5.7/form/fld_def.c	2011-01-08 18:13:50.439157211 -0500
@@ -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            *
@@ -32,7 +32,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: fld_def.c,v 1.36 2007/10/13 19:29:58 tom Exp $")
+MODULE_ID("$Id: fld_def.c,v 1.38 2010/01/23 21:14:35 tom Exp $")
 
 /* this can't be readonly */
 static FIELD default_field =
@@ -252,8 +252,8 @@
   if (field->type != 0)
     {
       field->type->ref--;
+      _nc_Free_Argument(field->type, (TypeArgument *)(field->arg));
     }
-  _nc_Free_Argument(field->type, (TypeArgument *)(field->arg));
 }
 
 /*---------------------------------------------------------------------------
@@ -291,7 +291,7 @@
       ((err = E_SYSTEM_ERROR) != 0) &&	/* trick: this resets the default error */
       (New_Field = typeMalloc(FIELD, 1)) != 0)
     {
-      T((T_CREATE("field %p"), New_Field));
+      T((T_CREATE("field %p"), (void *)New_Field));
       *New_Field = default_field;
       New_Field->rows = rows;
       New_Field->cols = cols;
@@ -355,7 +355,7 @@
 NCURSES_EXPORT(int)
 free_field(FIELD *field)
 {
-  T((T_CALLED("free_field(%p)"), field));
+  T((T_CALLED("free_field(%p)"), (void *)field));
   if (!field)
     {
       RETURN(E_BAD_ARGUMENT);
diff -Naur ncurses-5.7.orig/form/fld_dup.c ncurses-5.7/form/fld_dup.c
--- ncurses-5.7.orig/form/fld_dup.c	2007-10-13 15:30:21.000000000 -0400
+++ ncurses-5.7/form/fld_dup.c	2011-01-08 18:13:50.439157211 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2004,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            *
@@ -32,7 +32,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: fld_dup.c,v 1.12 2007/10/13 19:30:21 tom Exp $")
+MODULE_ID("$Id: fld_dup.c,v 1.13 2010/01/23 21:14:35 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform
@@ -53,12 +53,12 @@
   FIELD *New_Field = (FIELD *)0;
   int err = E_BAD_ARGUMENT;
 
-  T((T_CALLED("dup_field(%p,%d,%d)"), field, frow, fcol));
+  T((T_CALLED("dup_field(%p,%d,%d)"), (void *)field, frow, fcol));
   if (field && (frow >= 0) && (fcol >= 0) &&
       ((err = E_SYSTEM_ERROR) != 0) &&	/* trick : this resets the default error */
       (New_Field = typeMalloc(FIELD, 1)))
     {
-      T((T_CREATE("field %p"), New_Field));
+      T((T_CREATE("field %p"), (void *)New_Field));
       *New_Field = *_nc_Default_Field;
       New_Field->frow = frow;
       New_Field->fcol = fcol;
diff -Naur ncurses-5.7.orig/form/fld_ftchoice.c ncurses-5.7/form/fld_ftchoice.c
--- ncurses-5.7.orig/form/fld_ftchoice.c	2004-12-11 16:44:57.000000000 -0500
+++ ncurses-5.7/form/fld_ftchoice.c	2011-01-08 18:13:50.439157211 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,2004 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            *
@@ -32,7 +32,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: fld_ftchoice.c,v 1.9 2004/12/11 21:44:57 tom Exp $")
+MODULE_ID("$Id: fld_ftchoice.c,v 1.12 2010/01/23 21:14:35 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform  
@@ -51,14 +51,19 @@
 		     bool (*const next_choice) (FIELD *, const void *),
 		     bool (*const prev_choice) (FIELD *, const void *))
 {
-  T((T_CALLED("set_fieldtype_choice(%p,%p,%p)"), typ, next_choice, prev_choice));
+  T((T_CALLED("set_fieldtype_choice(%p,%p,%p)"), (void *)typ, next_choice, prev_choice));
 
   if (!typ || !next_choice || !prev_choice)
     RETURN(E_BAD_ARGUMENT);
 
   typ->status |= _HAS_CHOICE;
+#if NCURSES_INTEROP_FUNCS
+  typ->enum_next.onext = next_choice;
+  typ->enum_prev.oprev = prev_choice;
+#else
   typ->next = next_choice;
   typ->prev = prev_choice;
+#endif
   RETURN(E_OK);
 }
 
diff -Naur ncurses-5.7.orig/form/fld_ftlink.c ncurses-5.7/form/fld_ftlink.c
--- ncurses-5.7.orig/form/fld_ftlink.c	2007-10-13 15:30:35.000000000 -0400
+++ ncurses-5.7/form/fld_ftlink.c	2011-01-08 18:13:50.439157211 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2004,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            *
@@ -32,7 +32,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: fld_ftlink.c,v 1.13 2007/10/13 19:30:35 tom Exp $")
+MODULE_ID("$Id: fld_ftlink.c,v 1.14 2010/01/23 21:14:35 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform  
@@ -53,14 +53,14 @@
 {
   FIELDTYPE *nftyp = (FIELDTYPE *)0;
 
-  T((T_CALLED("link_fieldtype(%p,%p)"), type1, type2));
+  T((T_CALLED("link_fieldtype(%p,%p)"), (void *)type1, (void *)type2));
   if (type1 && type2)
     {
       nftyp = typeMalloc(FIELDTYPE, 1);
 
       if (nftyp)
 	{
-	  T((T_CREATE("fieldtype %p"), nftyp));
+	  T((T_CREATE("fieldtype %p"), (void *)nftyp));
 	  *nftyp = *_nc_Default_FieldType;
 	  nftyp->status |= _LINKED_TYPE;
 	  if ((type1->status & _HAS_ARGS) || (type2->status & _HAS_ARGS))
diff -Naur ncurses-5.7.orig/form/fld_info.c ncurses-5.7/form/fld_info.c
--- ncurses-5.7.orig/form/fld_info.c	2004-12-11 17:24:57.000000000 -0500
+++ ncurses-5.7/form/fld_info.c	2011-01-08 18:13:50.439157211 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,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            *
@@ -32,7 +32,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: fld_info.c,v 1.10 2004/12/11 22:24:57 tom Exp $")
+MODULE_ID("$Id: fld_info.c,v 1.11 2010/01/23 21:14:35 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform  
@@ -53,10 +53,10 @@
 	   int *nrow, int *nbuf)
 {
   T((T_CALLED("field_info(%p,%p,%p,%p,%p,%p,%p)"),
-     field,
-     rows, cols,
-     frow, fcol,
-     nrow, nbuf));
+     (const void *)field,
+     (void *)rows, (void *)cols,
+     (void *)frow, (void *)fcol,
+     (void *)nrow, (void *)nbuf));
 
   if (!field)
     RETURN(E_BAD_ARGUMENT);
@@ -91,7 +91,11 @@
 NCURSES_EXPORT(int)
 dynamic_field_info(const FIELD *field, int *drows, int *dcols, int *maxgrow)
 {
-  T((T_CALLED("dynamic_field_info(%p,%p,%p,%p)"), field, drows, dcols, maxgrow));
+  T((T_CALLED("dynamic_field_info(%p,%p,%p,%p)"),
+     (const void *)field,
+     (void *)drows,
+     (void *)dcols,
+     (void *)maxgrow));
 
   if (!field)
     RETURN(E_BAD_ARGUMENT);
diff -Naur ncurses-5.7.orig/form/fld_just.c ncurses-5.7/form/fld_just.c
--- ncurses-5.7.orig/form/fld_just.c	2004-12-11 17:55:48.000000000 -0500
+++ ncurses-5.7/form/fld_just.c	2011-01-08 18:13:50.439157211 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,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            *
@@ -32,7 +32,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: fld_just.c,v 1.11 2004/12/11 22:55:48 tom Exp $")
+MODULE_ID("$Id: fld_just.c,v 1.12 2010/01/23 21:14:35 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform  
@@ -49,7 +49,7 @@
 {
   int res = E_BAD_ARGUMENT;
 
-  T((T_CALLED("set_field_just(%p,%d)"), field, just));
+  T((T_CALLED("set_field_just(%p,%d)"), (void *)field, just));
 
   if ((just == NO_JUSTIFICATION) ||
       (just == JUSTIFY_LEFT) ||
@@ -79,7 +79,7 @@
 NCURSES_EXPORT(int)
 field_just(const FIELD *field)
 {
-  T((T_CALLED("field_just(%p)"), field));
+  T((T_CALLED("field_just(%p)"), (const void *)field));
   returnCode(Normalize_Field(field)->just);
 }
 
diff -Naur ncurses-5.7.orig/form/fld_link.c ncurses-5.7/form/fld_link.c
--- ncurses-5.7.orig/form/fld_link.c	2007-10-13 15:30:43.000000000 -0400
+++ ncurses-5.7/form/fld_link.c	2011-01-08 18:13:50.439157211 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2004,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            *
@@ -32,7 +32,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: fld_link.c,v 1.11 2007/10/13 19:30:43 tom Exp $")
+MODULE_ID("$Id: fld_link.c,v 1.12 2010/01/23 21:14:35 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform  
@@ -54,12 +54,12 @@
   FIELD *New_Field = (FIELD *)0;
   int err = E_BAD_ARGUMENT;
 
-  T((T_CALLED("link_field(%p,%d,%d)"), field, frow, fcol));
+  T((T_CALLED("link_field(%p,%d,%d)"), (void *)field, frow, fcol));
   if (field && (frow >= 0) && (fcol >= 0) &&
       ((err = E_SYSTEM_ERROR) != 0) &&	/* trick: this resets the default error */
       (New_Field = typeMalloc(FIELD, 1)))
     {
-      T((T_CREATE("field %p"), New_Field));
+      T((T_CREATE("field %p"), (void *)New_Field));
       *New_Field = *_nc_Default_Field;
       New_Field->frow = frow;
       New_Field->fcol = fcol;
diff -Naur ncurses-5.7.orig/form/fld_max.c ncurses-5.7/form/fld_max.c
--- ncurses-5.7.orig/form/fld_max.c	2004-12-11 16:51:54.000000000 -0500
+++ ncurses-5.7/form/fld_max.c	2011-01-08 18:13:50.439157211 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,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            *
@@ -32,7 +32,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: fld_max.c,v 1.9 2004/12/11 21:51:54 tom Exp $")
+MODULE_ID("$Id: fld_max.c,v 1.10 2010/01/23 21:14:36 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform  
@@ -47,7 +47,7 @@
 NCURSES_EXPORT(int)
 set_max_field(FIELD *field, int maxgrow)
 {
-  T((T_CALLED("set_max_field(%p,%d)"), field, maxgrow));
+  T((T_CALLED("set_max_field(%p,%d)"), (void *)field, maxgrow));
 
   if (!field || (maxgrow < 0))
     RETURN(E_BAD_ARGUMENT);
diff -Naur ncurses-5.7.orig/form/fld_move.c ncurses-5.7/form/fld_move.c
--- ncurses-5.7.orig/form/fld_move.c	2004-12-11 16:52:44.000000000 -0500
+++ ncurses-5.7/form/fld_move.c	2011-01-08 18:13:50.439157211 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,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            *
@@ -32,7 +32,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: fld_move.c,v 1.9 2004/12/11 21:52:44 tom Exp $")
+MODULE_ID("$Id: fld_move.c,v 1.10 2010/01/23 21:14:36 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform  
@@ -48,7 +48,7 @@
 NCURSES_EXPORT(int)
 move_field(FIELD *field, int frow, int fcol)
 {
-  T((T_CALLED("move_field(%p,%d,%d)"), field, frow, fcol));
+  T((T_CALLED("move_field(%p,%d,%d)"), (void *)field, frow, fcol));
 
   if (!field || (frow < 0) || (fcol < 0))
     RETURN(E_BAD_ARGUMENT);
diff -Naur ncurses-5.7.orig/form/fld_newftyp.c ncurses-5.7/form/fld_newftyp.c
--- ncurses-5.7.orig/form/fld_newftyp.c	2007-10-13 15:30:55.000000000 -0400
+++ ncurses-5.7/form/fld_newftyp.c	2011-01-08 18:13:50.443157187 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2004,2007 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            *
@@ -32,9 +32,9 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: fld_newftyp.c,v 1.15 2007/10/13 19:30:55 tom Exp $")
+MODULE_ID("$Id: fld_newftyp.c,v 1.19 2010/01/23 21:14:36 tom Exp $")
 
-static FIELDTYPE const default_fieldtype =
+static FIELDTYPE default_fieldtype =
 {
   0,				/* status                                      */
   0L,				/* reference count                             */
@@ -43,13 +43,16 @@
   NULL,				/* makearg function                            */
   NULL,				/* copyarg function                            */
   NULL,				/* freearg function                            */
-  NULL,				/* field validation function                   */
-  NULL,				/* Character check function                    */
-  NULL,				/* enumerate next function                     */
-  NULL				/* enumerate previous function                 */
+  INIT_FT_FUNC(NULL),		/* field validation function                   */
+  INIT_FT_FUNC(NULL),		/* Character check function                    */
+  INIT_FT_FUNC(NULL),		/* enumerate next function                     */
+  INIT_FT_FUNC(NULL),		/* enumerate previous function                 */
+#if NCURSES_INTEROP_FUNCS
+  NULL				/* generic callback alternative to makearg     */
+#endif
 };
 
-NCURSES_EXPORT_VAR(const FIELDTYPE *)
+NCURSES_EXPORT_VAR(FIELDTYPE *)
 _nc_Default_FieldType = &default_fieldtype;
 
 /*---------------------------------------------------------------------------
@@ -80,10 +83,15 @@
 
       if (nftyp)
 	{
-	  T((T_CREATE("fieldtype %p"), nftyp));
+	  T((T_CREATE("fieldtype %p"), (void *)nftyp));
 	  *nftyp = default_fieldtype;
+#if NCURSES_INTEROP_FUNCS
+	  nftyp->fieldcheck.ofcheck = field_check;
+	  nftyp->charcheck.occheck = char_check;
+#else
 	  nftyp->fcheck = field_check;
 	  nftyp->ccheck = char_check;
+#endif
 	}
       else
 	{
@@ -110,7 +118,7 @@
 NCURSES_EXPORT(int)
 free_fieldtype(FIELDTYPE *typ)
 {
-  T((T_CALLED("free_fieldtype(%p)"), typ));
+  T((T_CALLED("free_fieldtype(%p)"), (void *)typ));
 
   if (!typ)
     RETURN(E_BAD_ARGUMENT);
diff -Naur ncurses-5.7.orig/form/fld_opts.c ncurses-5.7/form/fld_opts.c
--- ncurses-5.7.orig/form/fld_opts.c	2004-12-11 16:55:46.000000000 -0500
+++ ncurses-5.7/form/fld_opts.c	2011-01-08 18:13:50.443157187 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,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            *
@@ -32,7 +32,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: fld_opts.c,v 1.11 2004/12/11 21:55:46 tom Exp $")
+MODULE_ID("$Id: fld_opts.c,v 1.12 2010/01/23 21:14:36 tom Exp $")
 
 /*----------------------------------------------------------------------------
   Field-Options manipulation routines
@@ -55,7 +55,7 @@
 {
   int res = E_BAD_ARGUMENT;
 
-  T((T_CALLED("set_field_opts(%p,%d)"), field, opts));
+  T((T_CALLED("set_field_opts(%p,%d)"), (void *)field, opts));
 
   opts &= ALL_FIELD_OPTS;
   if (!(opts & ~ALL_FIELD_OPTS))
@@ -74,7 +74,7 @@
 NCURSES_EXPORT(Field_Options)
 field_opts(const FIELD *field)
 {
-  T((T_CALLED("field_opts(%p)"), field));
+  T((T_CALLED("field_opts(%p)"), (const void *)field));
 
   returnCode(ALL_FIELD_OPTS & Normalize_Field(field)->opts);
 }
@@ -96,7 +96,7 @@
 {
   int res = E_BAD_ARGUMENT;
 
-  T((T_CALLED("field_opts_on(%p,%d)"), field, opts));
+  T((T_CALLED("field_opts_on(%p,%d)"), (void *)field, opts));
 
   opts &= ALL_FIELD_OPTS;
   if (!(opts & ~ALL_FIELD_OPTS))
@@ -124,7 +124,7 @@
 {
   int res = E_BAD_ARGUMENT;
 
-  T((T_CALLED("field_opts_off(%p,%d)"), field, opts));
+  T((T_CALLED("field_opts_off(%p,%d)"), (void *)field, opts));
 
   opts &= ALL_FIELD_OPTS;
   if (!(opts & ~ALL_FIELD_OPTS))
diff -Naur ncurses-5.7.orig/form/fld_pad.c ncurses-5.7/form/fld_pad.c
--- ncurses-5.7.orig/form/fld_pad.c	2004-12-11 16:56:49.000000000 -0500
+++ ncurses-5.7/form/fld_pad.c	2011-01-08 18:13:50.443157187 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,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            *
@@ -32,7 +32,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: fld_pad.c,v 1.9 2004/12/11 21:56:49 tom Exp $")
+MODULE_ID("$Id: fld_pad.c,v 1.10 2010/01/23 21:14:36 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform  
@@ -50,7 +50,7 @@
 {
   int res = E_BAD_ARGUMENT;
 
-  T((T_CALLED("set_field_pad(%p,%d)"), field, ch));
+  T((T_CALLED("set_field_pad(%p,%d)"), (void *)field, ch));
 
   Normalize_Field(field);
   if (isprint(UChar(ch)))
@@ -77,7 +77,7 @@
 NCURSES_EXPORT(int)
 field_pad(const FIELD *field)
 {
-  T((T_CALLED("field_pad(%p)"), field));
+  T((T_CALLED("field_pad(%p)"), (const void *)field));
 
   returnCode(Normalize_Field(field)->pad);
 }
diff -Naur ncurses-5.7.orig/form/fld_page.c ncurses-5.7/form/fld_page.c
--- ncurses-5.7.orig/form/fld_page.c	2004-12-11 16:58:19.000000000 -0500
+++ ncurses-5.7/form/fld_page.c	2011-01-08 18:13:50.443157187 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,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            *
@@ -32,7 +32,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: fld_page.c,v 1.9 2004/12/11 21:58:19 tom Exp $")
+MODULE_ID("$Id: fld_page.c,v 1.10 2010/01/23 21:14:36 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform  
@@ -47,7 +47,7 @@
 NCURSES_EXPORT(int)
 set_new_page(FIELD *field, bool new_page_flag)
 {
-  T((T_CALLED("set_new_page(%p,%d)"), field, new_page_flag));
+  T((T_CALLED("set_new_page(%p,%d)"), (void *)field, new_page_flag));
 
   Normalize_Field(field);
   if (field->form)
@@ -74,7 +74,7 @@
 NCURSES_EXPORT(bool)
 new_page(const FIELD *field)
 {
-  T((T_CALLED("new_page(%p)"), field));
+  T((T_CALLED("new_page(%p)"), (const void *)field));
 
   returnBool((Normalize_Field(field)->status & _NEWPAGE) ? TRUE : FALSE);
 }
diff -Naur ncurses-5.7.orig/form/fld_stat.c ncurses-5.7/form/fld_stat.c
--- ncurses-5.7.orig/form/fld_stat.c	2004-12-11 17:28:00.000000000 -0500
+++ ncurses-5.7/form/fld_stat.c	2011-01-08 18:13:50.443157187 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,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            *
@@ -32,7 +32,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: fld_stat.c,v 1.11 2004/12/11 22:28:00 tom Exp $")
+MODULE_ID("$Id: fld_stat.c,v 1.12 2010/01/23 21:14:36 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform  
@@ -46,7 +46,7 @@
 NCURSES_EXPORT(int)
 set_field_status(FIELD *field, bool status)
 {
-  T((T_CALLED("set_field_status(%p,%d)"), field, status));
+  T((T_CALLED("set_field_status(%p,%d)"), (void *)field, status));
 
   Normalize_Field(field);
 
@@ -71,7 +71,7 @@
 NCURSES_EXPORT(bool)
 field_status(const FIELD *field)
 {
-  T((T_CALLED("field_status(%p)"), field));
+  T((T_CALLED("field_status(%p)"), (const void *)field));
 
   returnBool((Normalize_Field(field)->status & _CHANGED) ? TRUE : FALSE);
 }
diff -Naur ncurses-5.7.orig/form/fld_type.c ncurses-5.7/form/fld_type.c
--- ncurses-5.7.orig/form/fld_type.c	2004-12-25 17:24:10.000000000 -0500
+++ ncurses-5.7/form/fld_type.c	2011-01-08 18:13:50.443157187 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,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            *
@@ -32,7 +32,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: fld_type.c,v 1.15 2004/12/25 22:24:10 tom Exp $")
+MODULE_ID("$Id: fld_type.c,v 1.16 2010/01/23 21:14:36 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform  
@@ -52,7 +52,7 @@
   int res = E_SYSTEM_ERROR;
   int err = 0;
 
-  T((T_CALLED("set_field_type(%p,%p)"), field, type));
+  T((T_CALLED("set_field_type(%p,%p)"), (void *)field, (void *)type));
 
   va_start(ap, type);
 
@@ -90,7 +90,7 @@
 NCURSES_EXPORT(FIELDTYPE *)
 field_type(const FIELD *field)
 {
-  T((T_CALLED("field_type(%p)"), field));
+  T((T_CALLED("field_type(%p)"), (const void *)field));
   returnFieldType(Normalize_Field(field)->type);
 }
 
diff -Naur ncurses-5.7.orig/form/fld_user.c ncurses-5.7/form/fld_user.c
--- ncurses-5.7.orig/form/fld_user.c	2004-12-25 17:24:50.000000000 -0500
+++ ncurses-5.7/form/fld_user.c	2011-01-08 18:13:50.443157187 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,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            *
@@ -32,7 +32,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: fld_user.c,v 1.15 2004/12/25 22:24:50 tom Exp $")
+MODULE_ID("$Id: fld_user.c,v 1.16 2010/01/23 21:14:36 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform  
@@ -46,7 +46,7 @@
 NCURSES_EXPORT(int)
 set_field_userptr(FIELD *field, void *usrptr)
 {
-  T((T_CALLED("set_field_userptr(%p,%p)"), field, usrptr));
+  T((T_CALLED("set_field_userptr(%p,%p)"), (void *)field, (void *)usrptr));
 
   Normalize_Field(field)->usrptr = usrptr;
   RETURN(E_OK);
@@ -65,7 +65,7 @@
 NCURSES_EXPORT(void *)
 field_userptr(const FIELD *field)
 {
-  T((T_CALLED("field_userptr(%p)"), field));
+  T((T_CALLED("field_userptr(%p)"), (const void *)field));
   returnVoidPtr(Normalize_Field(field)->usrptr);
 }
 
diff -Naur ncurses-5.7.orig/form/form.h ncurses-5.7/form/form.h
--- ncurses-5.7.orig/form/form.h	2004-12-04 17:22:10.000000000 -0500
+++ ncurses-5.7/form/form.h	2011-01-08 18:13:50.443157187 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,2004 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2004,2009 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -30,7 +30,7 @@
  *   Author:  Juergen Pfeifer, 1995,1997                                    *
  ****************************************************************************/
 
-/* $Id: form.h,v 0.20 2004/12/04 22:22:10 tom Exp $ */
+/* $Id: form.h,v 0.21 2009/11/07 19:31:11 tom Exp $ */
 
 #ifndef FORM_H
 #define FORM_H
@@ -105,34 +105,13 @@
   NCURSES_FIELD_INTERNALS
 } FIELD;
 
-	/**************
-	*  FIELDTYPE  *
-	**************/
-
-typedef struct typenode {
-  unsigned short	status;			/* flags		*/
-  long			ref;			/* reference count	*/
-  struct typenode *	left;			/* ptr to operand for | */
-  struct typenode *	right;			/* ptr to operand for | */
-
-  void* (*makearg)(va_list *);			/* make fieldtype arg	*/
-  void* (*copyarg)(const void *);		/* copy fieldtype arg	*/
-  void	(*freearg)(void *);			/* free fieldtype arg	*/
-
-  bool	(*fcheck)(FIELD *,const void *);	/* field validation	*/
-  bool	(*ccheck)(int,const void *);		/* character validation */
-
-  bool	(*next)(FIELD *,const void *);		/* enumerate next value */
-  bool	(*prev)(FIELD *,const void *);		/* enumerate prev value */
-
-} FIELDTYPE;
 
 	/*********
 	*  FORM  *
 	*********/
 
 typedef struct formnode {
-  unsigned short	status;		/* flags			*/
+  unsigned short	status;	  	/* flags			*/
   short			rows;		/* size in rows			*/
   short			cols;		/* size in cols			*/
   int			currow;		/* current row in field window	*/
@@ -158,6 +137,49 @@
 
 } FORM;
 
+
+	/**************
+	*  FIELDTYPE  *
+	**************/
+
+typedef struct typenode {
+  unsigned short	status;			/* flags		    */
+  long			ref;			/* reference count	    */
+  struct typenode *	left;			/* ptr to operand for |     */
+  struct typenode *	right;			/* ptr to operand for |     */
+
+  void* (*makearg)(va_list *);			/* make fieldtype arg	    */
+  void* (*copyarg)(const void *);		/* copy fieldtype arg 	    */
+  void	(*freearg)(void *);			/* free fieldtype arg	    */
+
+#if NCURSES_INTEROP_FUNCS
+  union {
+    bool (*ofcheck)(FIELD *,const void *);	/* field validation	    */
+    bool (*gfcheck)(FORM*,FIELD *,const void*);	/* generic field validation */
+  } fieldcheck;
+  union {
+    bool (*occheck)(int,const void *);		/* character validation     */
+    bool (*gccheck)(int,FORM*,
+		    FIELD*,const void*);        /* generic char validation  */
+  } charcheck;
+  union {
+    bool (*onext)(FIELD *,const void *);        /* enumerate next value     */
+    bool (*gnext)(FORM*,FIELD*,const void*);    /* generic enumerate next   */
+  } enum_next;
+  union {
+    bool (*oprev)(FIELD *,const void *);	/* enumerate prev value     */
+    bool (*gprev)(FORM*,FIELD*,const void*);    /* generic enumerate prev   */
+  } enum_prev;
+  void* (*genericarg)(void*);                   /* Alternate Arg method     */
+#else
+  bool	(*fcheck)(FIELD *,const void *);	/* field validation	*/
+  bool	(*ccheck)(int,const void *);		/* character validation */
+
+  bool	(*next)(FIELD *,const void *);		/* enumerate next value */
+  bool	(*prev)(FIELD *,const void *);		/* enumerate prev value */
+#endif
+} FIELDTYPE;
+
 typedef void (*Form_Hook)(FORM *);
 
 	/***************************
@@ -279,13 +301,6 @@
 extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_IPV4;      /* Internet IP Version 4 address */
 
 	/***********************
-	*   Default objects    *
-	***********************/
-extern NCURSES_EXPORT_VAR(FORM *)	_nc_Default_Form;
-extern NCURSES_EXPORT_VAR(FIELD *)	_nc_Default_Field;
-
-
-	/***********************
 	*  FIELDTYPE routines  *
 	***********************/
 extern NCURSES_EXPORT(FIELDTYPE *) new_fieldtype (
@@ -396,6 +411,10 @@
 extern NCURSES_EXPORT(bool)	data_ahead (const FORM *);
 extern NCURSES_EXPORT(bool)	data_behind (const FORM *);
 
+#if NCURSES_SP_FUNCS
+extern NCURSES_EXPORT(FORM *)	NCURSES_SP_NAME(new_form) (SCREEN*, FIELD **);
+#endif
+
 #ifdef __cplusplus
   }
 #endif
diff -Naur ncurses-5.7.orig/form/form.priv.h ncurses-5.7/form/form.priv.h
--- ncurses-5.7.orig/form/form.priv.h	2008-09-08 16:29:05.000000000 -0400
+++ ncurses-5.7/form/form.priv.h	2011-01-08 18:13:50.443157187 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2006,2008 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -30,7 +30,7 @@
  *   Author:  Juergen Pfeifer, 1995,1997                                    *
  ****************************************************************************/
 
-/* $Id: form.priv.h,v 0.27 2008/09/08 20:29:05 tom Exp $ */
+/* $Id: form.priv.h,v 0.32 2009/11/07 21:26:43 tom Exp $ */
 
 #ifndef FORM_PRIV_H
 #define FORM_PRIV_H 1
@@ -62,6 +62,13 @@
 
 #include "form.h"
 
+	/***********************
+	*   Default objects    *
+	***********************/
+extern NCURSES_EXPORT_VAR(FORM *)      _nc_Default_Form;
+extern NCURSES_EXPORT_VAR(FIELD *)     _nc_Default_Field;
+extern NCURSES_EXPORT_VAR(FIELDTYPE *) _nc_Default_FieldType;
+
 /* form  status values */
 #define _OVLMODE         (0x04U) /* Form is in overlay mode                */
 #define _WINDOW_MODIFIED (0x10U) /* Current field window has been modified */
@@ -78,6 +85,7 @@
 #define _HAS_ARGS        (0x02U) /* Type has arguments                     */
 #define _HAS_CHOICE      (0x04U) /* Type has choice methods                */
 #define _RESIDENT        (0x08U) /* Type is built-in                       */
+#define _GENERIC         (0x10U) /* A generic field type                   */
 
 /* This are the field options required to be a selectable field in field
    navigation requests */
@@ -91,9 +99,20 @@
 #define Normalize_Field(field) \
   ((field) = (field != 0) ? (field) : _nc_Default_Field)
 
+#if NCURSES_SP_FUNCS
+#define Get_Form_Screen(form) \
+  ((form)->win ? _nc_screen_of((form->win)):CURRENT_SCREEN)
+#else
+#define Get_Form_Screen(form) CURRENT_SCREEN
+#endif
+
 /* Retrieve forms window */
 #define Get_Form_Window(form) \
-  ((form)->sub?(form)->sub:((form)->win?(form)->win:stdscr))
+  ((form)->sub \
+   ? (form)->sub \
+   : ((form)->win \
+      ? (form)->win \
+      : StdScreen(Get_Form_Screen(form))))
 
 /* Calculate the size for a single buffer for this field */
 #define Buffer_Length(field) ((field)->drows * (field)->dcols)
@@ -144,8 +163,6 @@
 
 #define C_ZEROS '\0'
 
-extern NCURSES_EXPORT_VAR(const FIELDTYPE *) _nc_Default_FieldType;
-
 extern NCURSES_EXPORT(TypeArgument *) _nc_Make_Argument (const FIELDTYPE*, va_list*, int*);
 extern NCURSES_EXPORT(TypeArgument *) _nc_Copy_Argument (const FIELDTYPE*, const TypeArgument*, int*);
 extern NCURSES_EXPORT(void) _nc_Free_Argument (const FIELDTYPE*, TypeArgument*);
@@ -161,6 +178,36 @@
 extern NCURSES_EXPORT(int) _nc_Set_Current_Field (FORM*, FIELD*);
 extern NCURSES_EXPORT(int) _nc_Position_Form_Cursor (FORM*);
 
+#if NCURSES_INTEROP_FUNCS
+extern NCURSES_EXPORT(FIELDTYPE *) _nc_TYPE_INTEGER(void);
+extern NCURSES_EXPORT(FIELDTYPE *) _nc_TYPE_ALNUM(void);
+extern NCURSES_EXPORT(FIELDTYPE *) _nc_TYPE_ALPHA(void);
+extern NCURSES_EXPORT(FIELDTYPE *) _nc_TYPE_ENUM(void);
+extern NCURSES_EXPORT(FIELDTYPE *) _nc_TYPE_NUMERIC(void);
+extern NCURSES_EXPORT(FIELDTYPE *) _nc_TYPE_REGEXP(void);
+extern NCURSES_EXPORT(FIELDTYPE *) _nc_TYPE_IPV4(void);
+
+extern NCURSES_EXPORT(FIELDTYPE *)
+_nc_generic_fieldtype(bool (*const field_check) (FORM*, 
+						 FIELD *, 
+						 const void *),
+		      bool (*const char_check)  (int, 
+						 FORM*, 
+						 FIELD*, 
+						 const void *),
+		      bool (*const next)(FORM*,FIELD*,const void*),
+		      bool (*const prev)(FORM*,FIELD*,const void*),
+		      void (*freecallback)(void*));
+extern NCURSES_EXPORT(int) _nc_set_generic_fieldtype(FIELD*, FIELDTYPE*, int (*)(void**));
+extern NCURSES_EXPORT(WINDOW*) _nc_form_cursor(const FORM* , int* , int* );
+
+#define INIT_FT_FUNC(func) {func}
+#else
+#define INIT_FT_FUNC(func) func
+#endif
+
+extern NCURSES_EXPORT(void) _nc_get_fieldbuffer(FORM*, FIELD*, FIELD_CELL*);
+
 #if USE_WIDEC_SUPPORT
 extern NCURSES_EXPORT(wchar_t *) _nc_Widen_String(char *, int *);
 #endif
@@ -176,8 +223,8 @@
 extern NCURSES_EXPORT(FIELD **)	    _nc_retrace_field_ptr (FIELD **);
 extern NCURSES_EXPORT(FIELD *)	    _nc_retrace_field (FIELD *);
 extern NCURSES_EXPORT(FIELDTYPE *)  _nc_retrace_field_type (FIELDTYPE *);
-extern NCURSES_EXPORT(FORM *)  _nc_retrace_form (FORM *);
-extern NCURSES_EXPORT(Form_Hook)  _nc_retrace_form_hook (Form_Hook);
+extern NCURSES_EXPORT(FORM *)       _nc_retrace_form (FORM *);
+extern NCURSES_EXPORT(Form_Hook)    _nc_retrace_form_hook (Form_Hook);
 
 #else /* !TRACE */
 
diff -Naur ncurses-5.7.orig/form/frm_cursor.c ncurses-5.7/form/frm_cursor.c
--- ncurses-5.7.orig/form/frm_cursor.c	2004-12-11 17:01:03.000000000 -0500
+++ ncurses-5.7/form/frm_cursor.c	2011-01-08 18:13:50.443157187 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,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            *
@@ -32,7 +32,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: frm_cursor.c,v 1.9 2004/12/11 22:01:03 tom Exp $")
+MODULE_ID("$Id: frm_cursor.c,v 1.10 2010/01/23 21:14:36 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform  
@@ -53,7 +53,7 @@
 {
   int res;
 
-  T((T_CALLED("pos_form_cursor(%p)"), form));
+  T((T_CALLED("pos_form_cursor(%p)"), (void *)form));
 
   if (!form)
     res = E_BAD_ARGUMENT;
diff -Naur ncurses-5.7.orig/form/frm_data.c ncurses-5.7/form/frm_data.c
--- ncurses-5.7.orig/form/frm_data.c	2005-11-26 10:34:01.000000000 -0500
+++ ncurses-5.7/form/frm_data.c	2011-01-08 18:13:50.443157187 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2004,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            *
@@ -32,7 +32,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: frm_data.c,v 1.14 2005/11/26 15:34:01 tom Exp $")
+MODULE_ID("$Id: frm_data.c,v 1.15 2010/01/23 21:14:36 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform  
@@ -49,7 +49,7 @@
 {
   bool result = FALSE;
 
-  T((T_CALLED("data_behind(%p)"), form));
+  T((T_CALLED("data_behind(%p)"), (const void *)form));
 
   if (form && (form->status & _POSTED) && form->current)
     {
@@ -136,7 +136,7 @@
 {
   bool result = FALSE;
 
-  T((T_CALLED("data_ahead(%p)"), form));
+  T((T_CALLED("data_ahead(%p)"), (const void *)form));
 
   if (form && (form->status & _POSTED) && form->current)
     {
diff -Naur ncurses-5.7.orig/form/frm_def.c ncurses-5.7/form/frm_def.c
--- ncurses-5.7.orig/form/frm_def.c	2008-08-03 20:07:55.000000000 -0400
+++ ncurses-5.7/form/frm_def.c	2011-01-08 18:13:50.443157187 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2007,2008 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            *
@@ -32,7 +32,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: frm_def.c,v 1.23 2008/08/04 00:07:55 tom Exp $")
+MODULE_ID("$Id: frm_def.c,v 1.25 2010/01/23 21:14:36 tom Exp $")
 
 /* this can't be readonly */
 static FORM default_form =
@@ -160,7 +160,7 @@
   int maximum_row_in_field, maximum_col_in_field;
   _PAGE *pg;
 
-  T((T_CALLED("Connect_Fields(%p,%p)"), form, fields));
+  T((T_CALLED("Connect_Fields(%p,%p)"), (void *)form, (void *)fields));
 
   assert(form);
 
@@ -188,7 +188,7 @@
   /* allocate page structures */
   if ((pg = typeMalloc(_PAGE, page_nr)) != (_PAGE *) 0)
     {
-      T((T_CREATE("_PAGE %p"), pg));
+      T((T_CREATE("_PAGE %p"), (void *)pg));
       form->page = pg;
     }
   else
@@ -283,7 +283,7 @@
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform  
-|   Function      :  FORM *new_form( FIELD **fields )
+|   Function      :  FORM *new_form_sp(SCREEN* sp, FIELD** fields )
 |   
 |   Description   :  Create new form with given array of fields.
 |
@@ -295,21 +295,31 @@
 |                    E_SYSTEM_ERROR  - not enough memory
 +--------------------------------------------------------------------------*/
 NCURSES_EXPORT(FORM *)
-new_form(FIELD **fields)
+NCURSES_SP_NAME(new_form) (NCURSES_SP_DCLx FIELD **fields)
 {
   int err = E_SYSTEM_ERROR;
+  FORM *form = (FORM *)0;
 
-  FORM *form = typeMalloc(FORM, 1);
+  T((T_CALLED("new_form(%p,%p)"), (void *)SP_PARM, (void *)fields));
 
-  T((T_CALLED("new_form(%p)"), fields));
-  if (form)
+  if (IsValidScreen(SP_PARM))
     {
-      T((T_CREATE("form %p"), form));
-      *form = *_nc_Default_Form;
-      if ((err = Associate_Fields(form, fields)) != E_OK)
+      form = typeMalloc(FORM, 1);
+
+      if (form)
 	{
-	  free_form(form);
-	  form = (FORM *)0;
+	  T((T_CREATE("form %p"), (void *)form));
+	  *form = *_nc_Default_Form;
+	  /* This ensures win and sub are always non-null,
+	     so we can derive always the SCREEN that this form is
+	     running on. */
+	  form->win = StdScreen(SP_PARM);
+	  form->sub = StdScreen(SP_PARM);
+	  if ((err = Associate_Fields(form, fields)) != E_OK)
+	    {
+	      free_form(form);
+	      form = (FORM *)0;
+	    }
 	}
     }
 
@@ -321,6 +331,27 @@
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform  
+|   Function      :  FORM* new_form(FIELD** fields )
+|   
+|   Description   :  Create new form with given array of fields.
+|
+|   Return Values :  Pointer to form. NULL if error occurred.
+!                    Set errno:
+|                    E_OK            - success
+|                    E_BAD_ARGUMENT  - Invalid form pointer or field array
+|                    E_CONNECTED     - a field is already connected
+|                    E_SYSTEM_ERROR  - not enough memory
++--------------------------------------------------------------------------*/
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(FORM *)
+new_form(FIELD **fields)
+{
+  return NCURSES_SP_NAME(new_form) (CURRENT_SCREEN, fields);
+}
+#endif
+
+/*---------------------------------------------------------------------------
+|   Facility      :  libnform  
 |   Function      :  int free_form( FORM *form )
 |   
 |   Description   :  Release internal memory associated with form.
@@ -332,7 +363,7 @@
 NCURSES_EXPORT(int)
 free_form(FORM *form)
 {
-  T((T_CALLED("free_form(%p)"), form));
+  T((T_CALLED("free_form(%p)"), (void *)form));
 
   if (!form)
     RETURN(E_BAD_ARGUMENT);
@@ -366,7 +397,7 @@
   FIELD **old;
   int res;
 
-  T((T_CALLED("set_form_fields(%p,%p)"), form, fields));
+  T((T_CALLED("set_form_fields(%p,%p)"), (void *)form, (void *)fields));
 
   if (!form)
     RETURN(E_BAD_ARGUMENT);
@@ -394,7 +425,7 @@
 NCURSES_EXPORT(FIELD **)
 form_fields(const FORM *form)
 {
-  T((T_CALLED("form_field(%p)"), form));
+  T((T_CALLED("form_field(%p)"), (const void *)form));
   returnFieldPtr(Normalize_Form(form)->field);
 }
 
@@ -409,7 +440,7 @@
 NCURSES_EXPORT(int)
 field_count(const FORM *form)
 {
-  T((T_CALLED("field_count(%p)"), form));
+  T((T_CALLED("field_count(%p)"), (const void *)form));
 
   returnCode(Normalize_Form(form)->maxfield);
 }
diff -Naur ncurses-5.7.orig/form/frm_driver.c ncurses-5.7/form/frm_driver.c
--- ncurses-5.7.orig/form/frm_driver.c	2008-10-18 12:25:00.000000000 -0400
+++ ncurses-5.7/form/frm_driver.c	2011-01-08 18:13:50.447157090 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2007,2008 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            *
@@ -32,7 +32,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: frm_driver.c,v 1.88 2008/10/18 16:25:00 tom Exp $")
+MODULE_ID("$Id: frm_driver.c,v 1.98 2010/05/01 21:11:43 tom Exp $")
 
 /*----------------------------------------------------------------------------
   This is the core module of the form library. It contains the majority
@@ -188,7 +188,7 @@
 /* Macro to set the attributes for a fields window */
 #define Set_Field_Window_Attributes(field,win) \
 (  wbkgdset((win),(chtype)((field)->pad | (field)->back)), \
-   wattrset((win),(field)->fore) )
+   (void) wattrset((win),(field)->fore) )
 
 /* Logic to decide whether or not a field really appears on the form */
 #define Field_Really_Appears(field)         \
@@ -512,9 +512,10 @@
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform
-|   Function      :  static void Window_To_Buffer(
+|   Function      :  void _nc_get_fieldbuffer(
 |                                          WINDOW * win,
-|                                          FIELD  * field)
+|                                          FIELD  * field,
+|                                          FIELD_CELL * buf)
 |
 |   Description   :  Copy the content of the window into the buffer.
 |                    The multiple lines of a window are simply
@@ -523,18 +524,22 @@
 |
 |   Return Values :  -
 +--------------------------------------------------------------------------*/
-static void
-Window_To_Buffer(WINDOW *win, FIELD *field)
+NCURSES_EXPORT(void)
+_nc_get_fieldbuffer(FORM *form, FIELD *field, FIELD_CELL *buf)
 {
   int pad;
   int len = 0;
   FIELD_CELL *p;
   int row, height;
+  WINDOW *win;
 
-  assert(win && field && field->buf);
+  assert(form && field && buf);
+
+  win = form->w;
+  assert(win);
 
   pad = field->pad;
-  p = field->buf;
+  p = buf;
   height = getmaxy(win);
 
   for (row = 0; (row < height) && (row < field->drows); row++)
@@ -563,6 +568,25 @@
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform
+|   Function      :  static void Window_To_Buffer(
+|                                          FORM   * form,
+|                                          FIELD  * field)
+|
+|   Description   :  Copy the content of the window into the buffer.
+|                    The multiple lines of a window are simply
+|                    concatenated into the buffer. Pad characters in
+|                    the window will be replaced by blanks in the buffer.
+|
+|   Return Values :  -
++--------------------------------------------------------------------------*/
+static void
+Window_To_Buffer(FORM *form, FIELD *field)
+{
+  _nc_get_fieldbuffer(form, field, field->buf);
+}
+
+/*---------------------------------------------------------------------------
+|   Facility      :  libnform
 |   Function      :  static void Synchronize_Buffer(FORM * form)
 |
 |   Description   :  If there was a change, copy the content of the
@@ -579,7 +603,7 @@
     {
       form->status &= ~_WINDOW_MODIFIED;
       form->status |= _FCHECK_REQUIRED;
-      Window_To_Buffer(form->w, form->current);
+      Window_To_Buffer(form, form->current);
       wmove(form->w, form->currow, form->curcol);
     }
 }
@@ -663,7 +687,7 @@
 
 	  result = TRUE;	/* allow sharing of recovery on failure */
 
-	  T((T_CREATE("fieldcell %p"), newbuf));
+	  T((T_CREATE("fieldcell %p"), (void *)newbuf));
 	  field->buf = newbuf;
 	  for (i = 0; i <= field->nbuf; i++)
 	    {
@@ -752,7 +776,7 @@
 static int
 Field_encloses(FIELD *field, int ry, int rx)
 {
-  T((T_CALLED("Field_encloses(%p)"), field));
+  T((T_CALLED("Field_encloses(%p)"), (void *)field));
   if (field != 0
       && field->frow <= ry
       && (field->frow + field->rows) > ry
@@ -825,7 +849,7 @@
   WINDOW *formwin;
   FIELD *field;
 
-  T((T_CALLED("_nc_Refresh_Current_Field(%p)"), form));
+  T((T_CALLED("_nc_Refresh_Current_Field(%p)"), (void *)form));
 
   if (!form)
     RETURN(E_BAD_ARGUMENT);
@@ -1010,7 +1034,8 @@
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform
-|   Function      :  static bool Check_Char(
+|   Function      :  static bool Check_Char(FORM  *form,
+|                                           FIELD *field,
 |                                           FIELDTYPE * typ,
 |                                           int ch,
 |                                           TypeArgument *argp)
@@ -1022,7 +1047,11 @@
 |                    FALSE            - Character is invalid
 +--------------------------------------------------------------------------*/
 static bool
-Check_Char(FIELDTYPE *typ, int ch, TypeArgument *argp)
+Check_Char(FORM *form,
+	   FIELD *field,
+	   FIELDTYPE *typ,
+	   int ch,
+	   TypeArgument *argp)
 {
   if (typ)
     {
@@ -1030,13 +1059,23 @@
 	{
 	  assert(argp);
 	  return (
-		   Check_Char(typ->left, ch, argp->left) ||
-		   Check_Char(typ->right, ch, argp->right));
+		   Check_Char(form, field, typ->left, ch, argp->left) ||
+		   Check_Char(form, field, typ->right, ch, argp->right));
 	}
       else
 	{
+#if NCURSES_INTEROP_FUNCS
+	  if (typ->charcheck.occheck)
+	    {
+	      if (typ->status & _GENERIC)
+		return typ->charcheck.gccheck(ch, form, field, (void *)argp);
+	      else
+		return typ->charcheck.occheck(ch, (void *)argp);
+	    }
+#else
 	  if (typ->ccheck)
 	    return typ->ccheck(ch, (void *)argp);
+#endif
 	}
     }
   return (!iscntrl(UChar(ch)) ? TRUE : FALSE);
@@ -1073,9 +1112,13 @@
   else
     {
       if (field->opts & O_VISIBLE)
-	Set_Field_Window_Attributes(field, win);
+	{
+	  Set_Field_Window_Attributes(field, win);
+	}
       else
-	wattrset(win, WINDOW_ATTRS(fwin));
+	{
+	  (void)wattrset(win, WINDOW_ATTRS(fwin));
+	}
       werase(win);
     }
 
@@ -1197,7 +1240,7 @@
   int res = E_OK;
   WINDOW *formwin;
 
-  T((T_CALLED("_nc_Synchronize_Attributes(%p)"), field));
+  T((T_CALLED("_nc_Synchronize_Attributes(%p)"), (void *)field));
 
   if (!field)
     returnCode(E_BAD_ARGUMENT);
@@ -1264,7 +1307,7 @@
   FORM *form;
   int res = E_OK;
 
-  T((T_CALLED("_nc_Synchronize_Options(%p,%#x)"), field, newopts));
+  T((T_CALLED("_nc_Synchronize_Options(%p,%#x)"), (void *)field, newopts));
 
   if (!field)
     returnCode(E_BAD_ARGUMENT);
@@ -1276,14 +1319,13 @@
 
   if (form)
     {
-      if (form->current == field)
-	{
-	  field->opts = oldopts;
-	  returnCode(E_CURRENT);
-	}
-
       if (form->status & _POSTED)
 	{
+	  if (form->current == field)
+	    {
+	      field->opts = oldopts;
+	      returnCode(E_CURRENT);
+	    }
 	  if ((form->curpage == field->page))
 	    {
 	      if (changed_opts & O_VISIBLE)
@@ -1365,7 +1407,7 @@
   FIELD *field;
   WINDOW *new_window;
 
-  T((T_CALLED("_nc_Set_Current_Field(%p,%p)"), form, newfield));
+  T((T_CALLED("_nc_Set_Current_Field(%p,%p)"), (void *)form, (void *)newfield));
 
   if (!form || !newfield || !form->current || (newfield->form != form))
     returnCode(E_BAD_ARGUMENT);
@@ -1399,7 +1441,7 @@
 		{
 		  if (Justification_Allowed(field))
 		    {
-		      Window_To_Buffer(form->w, field);
+		      Window_To_Buffer(form, field);
 		      werase(form->w);
 		      Perform_Justification(field, form->w);
 		      wsyncup(form->w);
@@ -1472,7 +1514,7 @@
   FIELD *field = form->current;
   int step = myWCWIDTH(form->w, form->currow, form->curcol);
 
-  T((T_CALLED("IFN_Next_Character(%p)"), form));
+  T((T_CALLED("IFN_Next_Character(%p)"), (void *)form));
   if ((form->curcol += step) == field->dcols)
     {
       if ((++(form->currow)) == field->drows)
@@ -1514,7 +1556,7 @@
   int amount = myWCWIDTH(form->w, form->currow, form->curcol - 1);
   int oldcol = form->curcol;
 
-  T((T_CALLED("IFN_Previous_Character(%p)"), form));
+  T((T_CALLED("IFN_Previous_Character(%p)"), (void *)form));
   if ((form->curcol -= amount) < 0)
     {
       if ((--(form->currow)) < 0)
@@ -1542,7 +1584,7 @@
 {
   FIELD *field = form->current;
 
-  T((T_CALLED("IFN_Next_Line(%p)"), form));
+  T((T_CALLED("IFN_Next_Line(%p)"), (void *)form));
   if ((++(form->currow)) == field->drows)
     {
 #if GROW_IF_NAVIGATE
@@ -1568,7 +1610,7 @@
 static int
 IFN_Previous_Line(FORM *form)
 {
-  T((T_CALLED("IFN_Previous_Line(%p)"), form));
+  T((T_CALLED("IFN_Previous_Line(%p)"), (void *)form));
   if ((--(form->currow)) < 0)
     {
       form->currow++;
@@ -1595,7 +1637,7 @@
   FIELD_CELL *s;
   FIELD_CELL *t;
 
-  T((T_CALLED("IFN_Next_Word(%p)"), form));
+  T((T_CALLED("IFN_Next_Word(%p)"), (void *)form));
 
   /* We really need access to the data, so we have to synchronize */
   Synchronize_Buffer(form);
@@ -1638,7 +1680,7 @@
   FIELD_CELL *t;
   bool again = FALSE;
 
-  T((T_CALLED("IFN_Previous_Word(%p)"), form));
+  T((T_CALLED("IFN_Previous_Word(%p)"), (void *)form));
 
   /* We really need access to the data, so we have to synchronize */
   Synchronize_Buffer(form);
@@ -1688,7 +1730,7 @@
 {
   FIELD *field = form->current;
 
-  T((T_CALLED("IFN_Beginning_Of_Field(%p)"), form));
+  T((T_CALLED("IFN_Beginning_Of_Field(%p)"), (void *)form));
   Synchronize_Buffer(form);
   Adjust_Cursor_Position(form,
 			 Get_Start_Of_Data(field->buf, Buffer_Length(field)));
@@ -1712,7 +1754,7 @@
   FIELD *field = form->current;
   FIELD_CELL *pos;
 
-  T((T_CALLED("IFN_End_Of_Field(%p)"), form));
+  T((T_CALLED("IFN_End_Of_Field(%p)"), (void *)form));
   Synchronize_Buffer(form);
   pos = After_End_Of_Data(field->buf, Buffer_Length(field));
   if (pos == (field->buf + Buffer_Length(field)))
@@ -1735,7 +1777,7 @@
 {
   FIELD *field = form->current;
 
-  T((T_CALLED("IFN_Beginning_Of_Line(%p)"), form));
+  T((T_CALLED("IFN_Beginning_Of_Line(%p)"), (void *)form));
   Synchronize_Buffer(form);
   Adjust_Cursor_Position(form,
 			 Get_Start_Of_Data(Address_Of_Current_Row_In_Buffer(form),
@@ -1761,7 +1803,7 @@
   FIELD_CELL *pos;
   FIELD_CELL *bp;
 
-  T((T_CALLED("IFN_End_Of_Line(%p)"), form));
+  T((T_CALLED("IFN_End_Of_Line(%p)"), (void *)form));
   Synchronize_Buffer(form);
   bp = Address_Of_Current_Row_In_Buffer(form);
   pos = After_End_Of_Data(bp, field->dcols);
@@ -1787,7 +1829,7 @@
   int amount = myWCWIDTH(form->w, form->currow, form->curcol - 1);
   int oldcol = form->curcol;
 
-  T((T_CALLED("IFN_Left_Character(%p)"), form));
+  T((T_CALLED("IFN_Left_Character(%p)"), (void *)form));
   if ((form->curcol -= amount) < 0)
     {
       form->curcol = oldcol;
@@ -1812,7 +1854,7 @@
   int amount = myWCWIDTH(form->w, form->currow, form->curcol);
   int oldcol = form->curcol;
 
-  T((T_CALLED("IFN_Right_Character(%p)"), form));
+  T((T_CALLED("IFN_Right_Character(%p)"), (void *)form));
   if ((form->curcol += amount) >= form->current->dcols)
     {
 #if GROW_IF_NAVIGATE
@@ -1840,7 +1882,7 @@
 static int
 IFN_Up_Character(FORM *form)
 {
-  T((T_CALLED("IFN_Up_Character(%p)"), form));
+  T((T_CALLED("IFN_Up_Character(%p)"), (void *)form));
   if ((--(form->currow)) < 0)
     {
       form->currow++;
@@ -1864,7 +1906,7 @@
 {
   FIELD *field = form->current;
 
-  T((T_CALLED("IFN_Down_Character(%p)"), form));
+  T((T_CALLED("IFN_Down_Character(%p)"), (void *)form));
   if ((++(form->currow)) == field->drows)
     {
 #if GROW_IF_NAVIGATE
@@ -1973,7 +2015,7 @@
 static int
 VSC_Scroll_Line_Forward(FORM *form)
 {
-  T((T_CALLED("VSC_Scroll_Line_Forward(%p)"), form));
+  T((T_CALLED("VSC_Scroll_Line_Forward(%p)"), (void *)form));
   returnCode(VSC_Generic(form, 1));
 }
 
@@ -1989,7 +2031,7 @@
 static int
 VSC_Scroll_Line_Backward(FORM *form)
 {
-  T((T_CALLED("VSC_Scroll_Line_Backward(%p)"), form));
+  T((T_CALLED("VSC_Scroll_Line_Backward(%p)"), (void *)form));
   returnCode(VSC_Generic(form, -1));
 }
 
@@ -2005,7 +2047,7 @@
 static int
 VSC_Scroll_Page_Forward(FORM *form)
 {
-  T((T_CALLED("VSC_Scroll_Page_Forward(%p)"), form));
+  T((T_CALLED("VSC_Scroll_Page_Forward(%p)"), (void *)form));
   returnCode(VSC_Generic(form, form->current->rows));
 }
 
@@ -2021,7 +2063,7 @@
 static int
 VSC_Scroll_Half_Page_Forward(FORM *form)
 {
-  T((T_CALLED("VSC_Scroll_Half_Page_Forward(%p)"), form));
+  T((T_CALLED("VSC_Scroll_Half_Page_Forward(%p)"), (void *)form));
   returnCode(VSC_Generic(form, (form->current->rows + 1) / 2));
 }
 
@@ -2037,7 +2079,7 @@
 static int
 VSC_Scroll_Page_Backward(FORM *form)
 {
-  T((T_CALLED("VSC_Scroll_Page_Backward(%p)"), form));
+  T((T_CALLED("VSC_Scroll_Page_Backward(%p)"), (void *)form));
   returnCode(VSC_Generic(form, -(form->current->rows)));
 }
 
@@ -2053,7 +2095,7 @@
 static int
 VSC_Scroll_Half_Page_Backward(FORM *form)
 {
-  T((T_CALLED("VSC_Scroll_Half_Page_Backward(%p)"), form));
+  T((T_CALLED("VSC_Scroll_Half_Page_Backward(%p)"), (void *)form));
   returnCode(VSC_Generic(form, -((form->current->rows + 1) / 2)));
 }
 /*----------------------------------------------------------------------------
@@ -2147,7 +2189,7 @@
 static int
 HSC_Scroll_Char_Forward(FORM *form)
 {
-  T((T_CALLED("HSC_Scroll_Char_Forward(%p)"), form));
+  T((T_CALLED("HSC_Scroll_Char_Forward(%p)"), (void *)form));
   returnCode(HSC_Generic(form, 1));
 }
 
@@ -2163,7 +2205,7 @@
 static int
 HSC_Scroll_Char_Backward(FORM *form)
 {
-  T((T_CALLED("HSC_Scroll_Char_Backward(%p)"), form));
+  T((T_CALLED("HSC_Scroll_Char_Backward(%p)"), (void *)form));
   returnCode(HSC_Generic(form, -1));
 }
 
@@ -2179,7 +2221,7 @@
 static int
 HSC_Horizontal_Line_Forward(FORM *form)
 {
-  T((T_CALLED("HSC_Horizontal_Line_Forward(%p)"), form));
+  T((T_CALLED("HSC_Horizontal_Line_Forward(%p)"), (void *)form));
   returnCode(HSC_Generic(form, form->current->cols));
 }
 
@@ -2195,7 +2237,7 @@
 static int
 HSC_Horizontal_Half_Line_Forward(FORM *form)
 {
-  T((T_CALLED("HSC_Horizontal_Half_Line_Forward(%p)"), form));
+  T((T_CALLED("HSC_Horizontal_Half_Line_Forward(%p)"), (void *)form));
   returnCode(HSC_Generic(form, (form->current->cols + 1) / 2));
 }
 
@@ -2211,7 +2253,7 @@
 static int
 HSC_Horizontal_Line_Backward(FORM *form)
 {
-  T((T_CALLED("HSC_Horizontal_Line_Backward(%p)"), form));
+  T((T_CALLED("HSC_Horizontal_Line_Backward(%p)"), (void *)form));
   returnCode(HSC_Generic(form, -(form->current->cols)));
 }
 
@@ -2227,7 +2269,7 @@
 static int
 HSC_Horizontal_Half_Line_Backward(FORM *form)
 {
-  T((T_CALLED("HSC_Horizontal_Half_Line_Backward(%p)"), form));
+  T((T_CALLED("HSC_Horizontal_Half_Line_Backward(%p)"), (void *)form));
   returnCode(HSC_Generic(form, -((form->current->cols + 1) / 2)));
 }
 
@@ -2406,7 +2448,7 @@
 	    return E_SYSTEM_ERROR;
 	}
       bp = Address_Of_Current_Row_In_Buffer(form);
-      Window_To_Buffer(form->w, field);
+      Window_To_Buffer(form, field);
       split = After_Last_Whitespace_Character(bp, field->dcols);
       /* split points to the first character of the sequence to be brought
          on the next line */
@@ -2432,7 +2474,7 @@
       if (result != E_OK)
 	{
 	  DeleteChar(form);
-	  Window_To_Buffer(form->w, field);
+	  Window_To_Buffer(form, field);
 	  result = E_REQUEST_DENIED;
 	}
     }
@@ -2523,7 +2565,7 @@
   FIELD_CELL *bp, *t;
   bool Last_Row = ((field->drows - 1) == form->currow);
 
-  T((T_CALLED("FE_New_Line(%p)"), form));
+  T((T_CALLED("FE_New_Line(%p)"), (void *)form));
   if (form->status & _OVLMODE)
     {
       if (Last_Row &&
@@ -2606,8 +2648,9 @@
   FIELD *field = form->current;
   int result = E_REQUEST_DENIED;
 
-  T((T_CALLED("FE_Insert_Character(%p)"), form));
-  if (Check_Char(field->type, (int)C_BLANK, (TypeArgument *)(field->arg)))
+  T((T_CALLED("FE_Insert_Character(%p)"), (void *)form));
+  if (Check_Char(form, field, field->type, (int)C_BLANK,
+		 (TypeArgument *)(field->arg)))
     {
       bool There_Is_Room = Is_There_Room_For_A_Char_In_Line(form);
 
@@ -2641,8 +2684,9 @@
   FIELD *field = form->current;
   int result = E_REQUEST_DENIED;
 
-  T((T_CALLED("FE_Insert_Line(%p)"), form));
-  if (Check_Char(field->type, (int)C_BLANK, (TypeArgument *)(field->arg)))
+  T((T_CALLED("FE_Insert_Line(%p)"), (void *)form));
+  if (Check_Char(form, field,
+		 field->type, (int)C_BLANK, (TypeArgument *)(field->arg)))
     {
       bool Maybe_Done = (form->currow != (field->drows - 1)) &&
       Is_There_Room_For_A_Line(form);
@@ -2674,7 +2718,7 @@
 static int
 FE_Delete_Character(FORM *form)
 {
-  T((T_CALLED("FE_Delete_Character(%p)"), form));
+  T((T_CALLED("FE_Delete_Character(%p)"), (void *)form));
   DeleteChar(form);
   returnCode(E_OK);
 }
@@ -2697,7 +2741,7 @@
 {
   FIELD *field = form->current;
 
-  T((T_CALLED("FE_Delete_Previous(%p)"), form));
+  T((T_CALLED("FE_Delete_Previous(%p)"), (void *)form));
   if (First_Position_In_Current_Field(form))
     returnCode(E_REQUEST_DENIED);
 
@@ -2765,7 +2809,7 @@
 static int
 FE_Delete_Line(FORM *form)
 {
-  T((T_CALLED("FE_Delete_Line(%p)"), form));
+  T((T_CALLED("FE_Delete_Line(%p)"), (void *)form));
   form->curcol = 0;
   wdeleteln(form->w);
   returnCode(E_OK);
@@ -2789,7 +2833,7 @@
   FIELD_CELL *cp = bp + form->curcol;
   FIELD_CELL *s;
 
-  T((T_CALLED("FE_Delete_Word(%p)"), form));
+  T((T_CALLED("FE_Delete_Word(%p)"), (void *)form));
   Synchronize_Buffer(form);
   if (ISBLANK(*cp))
     returnCode(E_REQUEST_DENIED);	/* not in word */
@@ -2823,7 +2867,7 @@
 static int
 FE_Clear_To_End_Of_Line(FORM *form)
 {
-  T((T_CALLED("FE_Clear_To_End_Of_Line(%p)"), form));
+  T((T_CALLED("FE_Clear_To_End_Of_Line(%p)"), (void *)form));
   wmove(form->w, form->currow, form->curcol);
   wclrtoeol(form->w);
   returnCode(E_OK);
@@ -2840,7 +2884,7 @@
 static int
 FE_Clear_To_End_Of_Field(FORM *form)
 {
-  T((T_CALLED("FE_Clear_To_End_Of_Field(%p)"), form));
+  T((T_CALLED("FE_Clear_To_End_Of_Field(%p)"), (void *)form));
   wmove(form->w, form->currow, form->curcol);
   wclrtobot(form->w);
   returnCode(E_OK);
@@ -2857,7 +2901,7 @@
 static int
 FE_Clear_Field(FORM *form)
 {
-  T((T_CALLED("FE_Clear_Field(%p)"), form));
+  T((T_CALLED("FE_Clear_Field(%p)"), (void *)form));
   form->currow = form->curcol = 0;
   werase(form->w);
   returnCode(E_OK);
@@ -2881,7 +2925,7 @@
 static int
 EM_Overlay_Mode(FORM *form)
 {
-  T((T_CALLED("EM_Overlay_Mode(%p)"), form));
+  T((T_CALLED("EM_Overlay_Mode(%p)"), (void *)form));
   form->status |= _OVLMODE;
   returnCode(E_OK);
 }
@@ -2897,7 +2941,7 @@
 static int
 EM_Insert_Mode(FORM *form)
 {
-  T((T_CALLED("EM_Insert_Mode(%p)"), form));
+  T((T_CALLED("EM_Insert_Mode(%p)"), (void *)form));
   form->status &= ~_OVLMODE;
   returnCode(E_OK);
 }
@@ -2912,7 +2956,7 @@
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform
-|   Function      :  static bool Next_Choice(
+|   Function      :  static bool Next_Choice(FORM * form,
 |                                            FIELDTYPE * typ,
 |                                            FIELD * field,
 |                                            TypeArgument *argp)
@@ -2924,7 +2968,7 @@
 |                    FALSE   - couldn't retrieve next choice
 +--------------------------------------------------------------------------*/
 static bool
-Next_Choice(FIELDTYPE *typ, FIELD *field, TypeArgument *argp)
+Next_Choice(FORM *form, FIELDTYPE *typ, FIELD *field, TypeArgument *argp)
 {
   if (!typ || !(typ->status & _HAS_CHOICE))
     return FALSE;
@@ -2933,19 +2977,27 @@
     {
       assert(argp);
       return (
-	       Next_Choice(typ->left, field, argp->left) ||
-	       Next_Choice(typ->right, field, argp->right));
+	       Next_Choice(form, typ->left, field, argp->left) ||
+	       Next_Choice(form, typ->right, field, argp->right));
     }
   else
     {
+#if NCURSES_INTEROP_FUNCS
+      assert(typ->enum_next.onext);
+      if (typ->status & _GENERIC)
+	return typ->enum_next.gnext(form, field, (void *)argp);
+      else
+	return typ->enum_next.onext(field, (void *)argp);
+#else
       assert(typ->next);
       return typ->next(field, (void *)argp);
+#endif
     }
 }
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform
-|   Function      :  static bool Previous_Choice(
+|   Function      :  static bool Previous_Choice(FORM * form,
 |                                                FIELDTYPE * typ,
 |                                                FIELD * field,
 |                                                TypeArgument *argp)
@@ -2957,7 +3009,7 @@
 |                    FALSE   - couldn't retrieve previous choice
 +--------------------------------------------------------------------------*/
 static bool
-Previous_Choice(FIELDTYPE *typ, FIELD *field, TypeArgument *argp)
+Previous_Choice(FORM *form, FIELDTYPE *typ, FIELD *field, TypeArgument *argp)
 {
   if (!typ || !(typ->status & _HAS_CHOICE))
     return FALSE;
@@ -2966,13 +3018,21 @@
     {
       assert(argp);
       return (
-	       Previous_Choice(typ->left, field, argp->left) ||
-	       Previous_Choice(typ->right, field, argp->right));
+	       Previous_Choice(form, typ->left, field, argp->left) ||
+	       Previous_Choice(form, typ->right, field, argp->right));
     }
   else
     {
+#if NCURSES_INTEROP_FUNCS
+      assert(typ->enum_prev.oprev);
+      if (typ->status & _GENERIC)
+	return typ->enum_prev.gprev(form, field, (void *)argp);
+      else
+	return typ->enum_prev.oprev(field, (void *)argp);
+#else
       assert(typ->prev);
       return typ->prev(field, (void *)argp);
+#endif
     }
 }
 /*----------------------------------------------------------------------------
@@ -2997,9 +3057,9 @@
 {
   FIELD *field = form->current;
 
-  T((T_CALLED("CR_Next_Choice(%p)"), form));
+  T((T_CALLED("CR_Next_Choice(%p)"), (void *)form));
   Synchronize_Buffer(form);
-  returnCode((Next_Choice(field->type, field, (TypeArgument *)(field->arg)))
+  returnCode((Next_Choice(form, field->type, field, (TypeArgument *)(field->arg)))
 	     ? E_OK
 	     : E_REQUEST_DENIED);
 }
@@ -3018,9 +3078,9 @@
 {
   FIELD *field = form->current;
 
-  T((T_CALLED("CR_Previous_Choice(%p)"), form));
+  T((T_CALLED("CR_Previous_Choice(%p)"), (void *)form));
   Synchronize_Buffer(form);
-  returnCode((Previous_Choice(field->type, field, (TypeArgument *)(field->arg)))
+  returnCode((Previous_Choice(form, field->type, field, (TypeArgument *)(field->arg)))
 	     ? E_OK
 	     : E_REQUEST_DENIED);
 }
@@ -3034,7 +3094,7 @@
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform
-|   Function      :  static bool Check_Field(
+|   Function      :  static bool Check_Field(FORM* form,
 |                                            FIELDTYPE * typ,
 |                                            FIELD * field,
 |                                            TypeArgument * argp)
@@ -3047,7 +3107,7 @@
 |                    FALSE      - field is invalid.
 +--------------------------------------------------------------------------*/
 static bool
-Check_Field(FIELDTYPE *typ, FIELD *field, TypeArgument *argp)
+Check_Field(FORM *form, FIELDTYPE *typ, FIELD *field, TypeArgument *argp)
 {
   if (typ)
     {
@@ -3068,13 +3128,23 @@
 	{
 	  assert(argp);
 	  return (
-		   Check_Field(typ->left, field, argp->left) ||
-		   Check_Field(typ->right, field, argp->right));
+		   Check_Field(form, typ->left, field, argp->left) ||
+		   Check_Field(form, typ->right, field, argp->right));
 	}
       else
 	{
+#if NCURSES_INTEROP_FUNCS
+	  if (typ->fieldcheck.ofcheck)
+	    {
+	      if (typ->status & _GENERIC)
+		return typ->fieldcheck.gfcheck(form, field, (void *)argp);
+	      else
+		return typ->fieldcheck.ofcheck(field, (void *)argp);
+	    }
+#else
 	  if (typ->fcheck)
 	    return typ->fcheck(field, (void *)argp);
+#endif
 	}
     }
   return TRUE;
@@ -3100,7 +3170,7 @@
   if ((form->status & _FCHECK_REQUIRED) ||
       (!(field->opts & O_PASSOK)))
     {
-      if (!Check_Field(field->type, field, (TypeArgument *)(field->arg)))
+      if (!Check_Field(form, field->type, field, (TypeArgument *)(field->arg)))
 	return FALSE;
       form->status &= ~_FCHECK_REQUIRED;
       field->status |= _CHANGED;
@@ -3128,7 +3198,7 @@
 static int
 FV_Validation(FORM *form)
 {
-  T((T_CALLED("FV_Validation(%p)"), form));
+  T((T_CALLED("FV_Validation(%p)"), (void *)form));
   if (_nc_Internal_Validation(form))
     returnCode(E_OK);
   else
@@ -3506,7 +3576,7 @@
 static int
 FN_Next_Field(FORM *form)
 {
-  T((T_CALLED("FN_Next_Field(%p)"), form));
+  T((T_CALLED("FN_Next_Field(%p)"), (void *)form));
   returnCode(_nc_Set_Current_Field(form,
 				   Next_Field_On_Page(form->current)));
 }
@@ -3524,7 +3594,7 @@
 static int
 FN_Previous_Field(FORM *form)
 {
-  T((T_CALLED("FN_Previous_Field(%p)"), form));
+  T((T_CALLED("FN_Previous_Field(%p)"), (void *)form));
   returnCode(_nc_Set_Current_Field(form,
 				   Previous_Field_On_Page(form->current)));
 }
@@ -3541,7 +3611,7 @@
 static int
 FN_First_Field(FORM *form)
 {
-  T((T_CALLED("FN_First_Field(%p)"), form));
+  T((T_CALLED("FN_First_Field(%p)"), (void *)form));
   returnCode(_nc_Set_Current_Field(form,
 				   Next_Field_On_Page(form->field[form->page[form->curpage].pmax])));
 }
@@ -3558,7 +3628,7 @@
 static int
 FN_Last_Field(FORM *form)
 {
-  T((T_CALLED("FN_Last_Field(%p)"), form));
+  T((T_CALLED("FN_Last_Field(%p)"), (void *)form));
   returnCode(
 	      _nc_Set_Current_Field(form,
 				    Previous_Field_On_Page(form->field[form->page[form->curpage].pmin])));
@@ -3577,7 +3647,7 @@
 static int
 FN_Sorted_Next_Field(FORM *form)
 {
-  T((T_CALLED("FN_Sorted_Next_Field(%p)"), form));
+  T((T_CALLED("FN_Sorted_Next_Field(%p)"), (void *)form));
   returnCode(_nc_Set_Current_Field(form,
 				   Sorted_Next_Field(form->current)));
 }
@@ -3595,7 +3665,7 @@
 static int
 FN_Sorted_Previous_Field(FORM *form)
 {
-  T((T_CALLED("FN_Sorted_Previous_Field(%p)"), form));
+  T((T_CALLED("FN_Sorted_Previous_Field(%p)"), (void *)form));
   returnCode(_nc_Set_Current_Field(form,
 				   Sorted_Previous_Field(form->current)));
 }
@@ -3613,7 +3683,7 @@
 static int
 FN_Sorted_First_Field(FORM *form)
 {
-  T((T_CALLED("FN_Sorted_First_Field(%p)"), form));
+  T((T_CALLED("FN_Sorted_First_Field(%p)"), (void *)form));
   returnCode(_nc_Set_Current_Field(form,
 				   Sorted_Next_Field(form->field[form->page[form->curpage].smax])));
 }
@@ -3631,7 +3701,7 @@
 static int
 FN_Sorted_Last_Field(FORM *form)
 {
-  T((T_CALLED("FN_Sorted_Last_Field(%p)"), form));
+  T((T_CALLED("FN_Sorted_Last_Field(%p)"), (void *)form));
   returnCode(_nc_Set_Current_Field(form,
 				   Sorted_Previous_Field(form->field[form->page[form->curpage].smin])));
 }
@@ -3649,7 +3719,7 @@
 static int
 FN_Left_Field(FORM *form)
 {
-  T((T_CALLED("FN_Left_Field(%p)"), form));
+  T((T_CALLED("FN_Left_Field(%p)"), (void *)form));
   returnCode(_nc_Set_Current_Field(form,
 				   Left_Neighbor_Field(form->current)));
 }
@@ -3667,7 +3737,7 @@
 static int
 FN_Right_Field(FORM *form)
 {
-  T((T_CALLED("FN_Right_Field(%p)"), form));
+  T((T_CALLED("FN_Right_Field(%p)"), (void *)form));
   returnCode(_nc_Set_Current_Field(form,
 				   Right_Neighbor_Field(form->current)));
 }
@@ -3687,7 +3757,7 @@
 static int
 FN_Up_Field(FORM *form)
 {
-  T((T_CALLED("FN_Up_Field(%p)"), form));
+  T((T_CALLED("FN_Up_Field(%p)"), (void *)form));
   returnCode(_nc_Set_Current_Field(form,
 				   Upper_Neighbor_Field(form->current)));
 }
@@ -3707,7 +3777,7 @@
 static int
 FN_Down_Field(FORM *form)
 {
-  T((T_CALLED("FN_Down_Field(%p)"), form));
+  T((T_CALLED("FN_Down_Field(%p)"), (void *)form));
   returnCode(_nc_Set_Current_Field(form,
 				   Down_Neighbor_Field(form->current)));
 }
@@ -3851,7 +3921,7 @@
 static int
 PN_Next_Page(FORM *form)
 {
-  T((T_CALLED("PN_Next_Page(%p)"), form));
+  T((T_CALLED("PN_Next_Page(%p)"), (void *)form));
   returnCode(_nc_Set_Form_Page(form, Next_Page_Number(form), (FIELD *)0));
 }
 
@@ -3867,7 +3937,7 @@
 static int
 PN_Previous_Page(FORM *form)
 {
-  T((T_CALLED("PN_Previous_Page(%p)"), form));
+  T((T_CALLED("PN_Previous_Page(%p)"), (void *)form));
   returnCode(_nc_Set_Form_Page(form, Previous_Page_Number(form), (FIELD *)0));
 }
 
@@ -3883,7 +3953,7 @@
 static int
 PN_First_Page(FORM *form)
 {
-  T((T_CALLED("PN_First_Page(%p)"), form));
+  T((T_CALLED("PN_First_Page(%p)"), (void *)form));
   returnCode(_nc_Set_Form_Page(form, 0, (FIELD *)0));
 }
 
@@ -3899,7 +3969,7 @@
 static int
 PN_Last_Page(FORM *form)
 {
-  T((T_CALLED("PN_Last_Page(%p)"), form));
+  T((T_CALLED("PN_Last_Page(%p)"), (void *)form));
   returnCode(_nc_Set_Form_Page(form, form->maxpage - 1, (FIELD *)0));
 }
 
@@ -3928,7 +3998,7 @@
   FIELD *field = form->current;
   int result = E_REQUEST_DENIED;
 
-  T((T_CALLED("Data_Entry(%p,%s)"), form, _tracechtype((chtype)c)));
+  T((T_CALLED("Data_Entry(%p,%s)"), (void *)form, _tracechtype((chtype)c)));
   if ((field->opts & O_EDIT)
 #if FIX_FORM_INACTIVE_BUG
       && (field->opts & O_ACTIVE)
@@ -4129,7 +4199,7 @@
   const Binding_Info *BI = (Binding_Info *) 0;
   int res = E_UNKNOWN_COMMAND;
 
-  T((T_CALLED("form_driver(%p,%d)"), form, c));
+  T((T_CALLED("form_driver(%p,%d)"), (void *)form, c));
 
   if (!form)
     RETURN(E_BAD_ARGUMENT);
@@ -4194,7 +4264,7 @@
   else if (KEY_MOUSE == c)
     {
       MEVENT event;
-      WINDOW *win = form->win ? form->win : stdscr;
+      WINDOW *win = form->win ? form->win : StdScreen(Get_Form_Screen(form));
       WINDOW *sub = form->sub ? form->sub : win;
 
       getmouse(&event);
@@ -4281,7 +4351,7 @@
       if (!iscntrl(UChar(c)))
 #else
       if (isprint(UChar(c)) &&
-	  Check_Char(form->current->type, c,
+	  Check_Char(form, form->current, form->current->type, c,
 		     (TypeArgument *)(form->current->arg)))
 #endif
 	res = Data_Entry(form, c);
@@ -4326,7 +4396,7 @@
   FIELD_CELL *widevalue = 0;
 #endif
 
-  T((T_CALLED("set_field_buffer(%p,%d,%s)"), field, buffer, _nc_visbuf(value)));
+  T((T_CALLED("set_field_buffer(%p,%d,%s)"), (void *)field, buffer, _nc_visbuf(value)));
 
   if (!field || !value || ((buffer < 0) || (buffer > field->nbuf)))
     RETURN(E_BAD_ARGUMENT);
@@ -4347,7 +4417,9 @@
 						     * field->cols))))
 	    RETURN(E_SYSTEM_ERROR);
 
+#if !USE_WIDEC_SUPPORT
 	  len = vlen;
+#endif
 	}
     }
 
@@ -4360,14 +4432,15 @@
    * and other special cases that we really do not want to handle here.
    */
 #if NCURSES_EXT_FUNCS
-  if (wresize(field->working, field->drows, field->dcols) == ERR)
+  if (wresize(field->working, 1, Buffer_Length(field) + 1) == ERR)
 #endif
     {
       delwin(field->working);
-      field->working = newpad(field->drows, field->dcols);
+      field->working = newpad(1, Buffer_Length(field) + 1);
     }
+  len = Buffer_Length(field);
   wclear(field->working);
-  mvwaddstr(field->working, 0, 0, value);
+  (void)mvwaddstr(field->working, 0, 0, value);
 
   if ((widevalue = typeCalloc(FIELD_CELL, len + 1)) == 0)
     {
@@ -4377,9 +4450,9 @@
     {
       for (i = 0; i < (unsigned)field->drows; ++i)
 	{
-	  mvwin_wchnstr(field->working, i, 0,
-			widevalue + (i * field->dcols),
-			field->dcols);
+	  (void)mvwin_wchnstr(field->working, 0, i * field->dcols,
+			      widevalue + (i * field->dcols),
+			      field->dcols);
 	}
       for (i = 0; i < len; ++i)
 	{
@@ -4433,7 +4506,7 @@
 {
   char *result = 0;
 
-  T((T_CALLED("field_buffer(%p,%d)"), field, buffer));
+  T((T_CALLED("field_buffer(%p,%d)"), (const void *)field, buffer));
 
   if (field && (buffer >= 0) && (buffer <= field->nbuf))
     {
@@ -4446,7 +4519,7 @@
       /* determine the number of bytes needed to store the expanded string */
       for (n = 0; n < size; ++n)
 	{
-	  if (!isWidecExt(data[n]))
+	  if (!isWidecExt(data[n]) && data[n].chars[0] != L'\0')
 	    {
 	      mbstate_t state;
 	      size_t next;
@@ -4463,12 +4536,25 @@
 	free(field->expanded[buffer]);
       field->expanded[buffer] = typeMalloc(char, need + 1);
 
-      /* expand the multibyte data */
+      /*
+       * Expand the multibyte data.
+       *
+       * It may also be multi-column data.  In that case, the data for a row
+       * may be null-padded to align to the dcols/drows layout (or it may
+       * contain embedded wide-character extensions).  Change the null-padding
+       * to blanks as needed.
+       */
       if ((result = field->expanded[buffer]) != 0)
 	{
 	  wclear(field->working);
-	  mvwadd_wchnstr(field->working, 0, 0, data, size);
-	  mvwinnstr(field->working, 0, 0, result, (int)need);
+	  wmove(field->working, 0, 0);
+	  for (n = 0; n < size; ++n)
+	    {
+	      if (!isWidecExt(data[n]) && data[n].chars[0] != L'\0')
+		wadd_wch(field->working, &data[n]);
+	    }
+	  wmove(field->working, 0, 0);
+	  winnstr(field->working, result, (int)need);
 	}
 #else
       result = Address_Of_Nth_Buffer(field, buffer);
@@ -4479,22 +4565,6 @@
 
 #if USE_WIDEC_SUPPORT
 
-/* FIXME: see lib_get_wch.c */
-#if HAVE_MBTOWC && HAVE_MBLEN
-#define reset_mbytes(state) mblen(NULL, 0), mbtowc(NULL, NULL, 0)
-#define count_mbytes(buffer,length,state) mblen(buffer,length)
-#define trans_mbytes(wch,buffer,length,state) \
-	(int) mbtowc(&wch, buffer, length)
-#elif HAVE_MBRTOWC && HAVE_MBRLEN
-#define NEED_STATE
-#define reset_mbytes(state) init_mb(state)
-#define count_mbytes(buffer,length,state) mbrlen(buffer,length,&state)
-#define trans_mbytes(wch,buffer,length,state) \
-	(int) mbrtowc(&wch, buffer, length, &state)
-#else
-make an error
-#endif
-
 /*---------------------------------------------------------------------------
 | Convert a multibyte string to a wide-character string.  The result must be
 | freed by the caller.
@@ -4509,7 +4579,7 @@
   int pass;
   int status;
 
-#ifdef NEED_STATE
+#ifndef state_unused
   mbstate_t state;
 #endif
 
@@ -4528,8 +4598,8 @@
 
 	      source[passed + tries] = 0;
 	      reset_mbytes(state);
-	      status = trans_mbytes(wch, source + passed, tries, state);
-	      source[passed + tries] = save;
+	      status = check_mbytes(wch, source + passed, tries, state);
+	      source[passed + tries] = (char)save;
 
 	      if (status > 0)
 		{
diff -Naur ncurses-5.7.orig/form/frm_hook.c ncurses-5.7/form/frm_hook.c
--- ncurses-5.7.orig/form/frm_hook.c	2004-12-25 17:37:27.000000000 -0500
+++ ncurses-5.7/form/frm_hook.c	2011-01-08 18:13:50.447157090 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,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            *
@@ -32,7 +32,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: frm_hook.c,v 1.14 2004/12/25 22:37:27 tom Exp $")
+MODULE_ID("$Id: frm_hook.c,v 1.15 2010/01/23 21:12:08 tom Exp $")
 
 /* "Template" macro to generate function to set application specific hook */
 #define GEN_HOOK_SET_FUNCTION( typ, name ) \
@@ -47,7 +47,7 @@
 #define GEN_HOOK_GET_FUNCTION( typ, name ) \
 NCURSES_IMPEXP Form_Hook NCURSES_API typ ## _ ## name ( const FORM *form )\
 {\
-   T((T_CALLED(#typ "_" #name "(%p)"), form));\
+   T((T_CALLED(#typ "_" #name "(%p)"), (const void *) form));\
    returnFormHook( Normalize_Form( form ) -> typ ## name );\
 }
 
diff -Naur ncurses-5.7.orig/form/frm_opts.c ncurses-5.7/form/frm_opts.c
--- ncurses-5.7.orig/form/frm_opts.c	2005-04-16 12:59:18.000000000 -0400
+++ ncurses-5.7/form/frm_opts.c	2011-01-08 18:13:50.447157090 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2004,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            *
@@ -32,7 +32,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: frm_opts.c,v 1.14 2005/04/16 16:59:18 tom Exp $")
+MODULE_ID("$Id: frm_opts.c,v 1.15 2010/01/23 21:14:36 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform  
@@ -47,7 +47,7 @@
 NCURSES_EXPORT(int)
 set_form_opts(FORM *form, Form_Options opts)
 {
-  T((T_CALLED("set_form_opts(%p,%d)"), form, opts));
+  T((T_CALLED("set_form_opts(%p,%d)"), (void *)form, opts));
 
   opts &= ALL_FORM_OPTS;
   if (opts & ~ALL_FORM_OPTS)
@@ -70,7 +70,7 @@
 NCURSES_EXPORT(Form_Options)
 form_opts(const FORM *form)
 {
-  T((T_CALLED("form_opts(%p)"), form));
+  T((T_CALLED("form_opts(%p)"), (const void *)form));
   returnCode((int)(Normalize_Form(form)->opts & ALL_FORM_OPTS));
 }
 
@@ -87,7 +87,7 @@
 NCURSES_EXPORT(int)
 form_opts_on(FORM *form, Form_Options opts)
 {
-  T((T_CALLED("form_opts_on(%p,%d)"), form, opts));
+  T((T_CALLED("form_opts_on(%p,%d)"), (void *)form, opts));
 
   opts &= ALL_FORM_OPTS;
   if (opts & ~ALL_FORM_OPTS)
@@ -112,7 +112,7 @@
 NCURSES_EXPORT(int)
 form_opts_off(FORM *form, Form_Options opts)
 {
-  T((T_CALLED("form_opts_off(%p,%d)"), form, opts));
+  T((T_CALLED("form_opts_off(%p,%d)"), (void *)form, opts));
 
   opts &= ALL_FORM_OPTS;
   if (opts & ~ALL_FORM_OPTS)
diff -Naur ncurses-5.7.orig/form/frm_page.c ncurses-5.7/form/frm_page.c
--- ncurses-5.7.orig/form/frm_page.c	2004-12-11 17:08:21.000000000 -0500
+++ ncurses-5.7/form/frm_page.c	2011-01-08 18:13:50.447157090 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,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            *
@@ -32,7 +32,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: frm_page.c,v 1.10 2004/12/11 22:08:21 tom Exp $")
+MODULE_ID("$Id: frm_page.c,v 1.11 2010/01/23 21:14:36 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform  
@@ -51,7 +51,7 @@
 {
   int err = E_OK;
 
-  T((T_CALLED("set_form_page(%p,%d)"), form, page));
+  T((T_CALLED("set_form_page(%p,%d)"), (void *)form, page));
 
   if (!form || (page < 0) || (page >= form->maxpage))
     RETURN(E_BAD_ARGUMENT);
@@ -98,7 +98,7 @@
 NCURSES_EXPORT(int)
 form_page(const FORM *form)
 {
-  T((T_CALLED("form_page(%p)"), form));
+  T((T_CALLED("form_page(%p)"), (const void *)form));
 
   returnCode(Normalize_Form(form)->curpage);
 }
diff -Naur ncurses-5.7.orig/form/frm_post.c ncurses-5.7/form/frm_post.c
--- ncurses-5.7.orig/form/frm_post.c	2004-12-11 17:19:06.000000000 -0500
+++ ncurses-5.7/form/frm_post.c	2011-01-08 18:13:50.447157090 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,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            *
@@ -32,7 +32,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: frm_post.c,v 1.9 2004/12/11 22:19:06 tom Exp $")
+MODULE_ID("$Id: frm_post.c,v 1.10 2010/01/23 21:14:36 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform  
@@ -54,7 +54,7 @@
   int err;
   int page;
 
-  T((T_CALLED("post_form(%p)"), form));
+  T((T_CALLED("post_form(%p)"), (void *)form));
 
   if (!form)
     RETURN(E_BAD_ARGUMENT);
@@ -100,7 +100,7 @@
 NCURSES_EXPORT(int)
 unpost_form(FORM *form)
 {
-  T((T_CALLED("unpost_form(%p)"), form));
+  T((T_CALLED("unpost_form(%p)"), (void *)form));
 
   if (!form)
     RETURN(E_BAD_ARGUMENT);
diff -Naur ncurses-5.7.orig/form/frm_req_name.c ncurses-5.7/form/frm_req_name.c
--- ncurses-5.7.orig/form/frm_req_name.c	2008-07-05 19:22:08.000000000 -0400
+++ ncurses-5.7/form/frm_req_name.c	2011-01-08 18:13:50.447157090 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2005,2008 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -37,7 +37,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: frm_req_name.c,v 1.16 2008/07/05 23:22:08 tom Exp $")
+MODULE_ID("$Id: frm_req_name.c,v 1.17 2009/10/10 16:17:01 tom Exp $")
 
 static const char *request_names[MAX_FORM_COMMAND - MIN_FORM_COMMAND + 1] =
 {
@@ -154,14 +154,14 @@
       strncpy(buf, str, sizeof(buf));
       while ((i < sizeof(buf)) && (buf[i] != '\0'))
 	{
-	  buf[i] = toupper(UChar(buf[i]));
+	  buf[i] = (char)toupper(UChar(buf[i]));
 	  i++;
 	}
 
       for (i = 0; i < A_SIZE; i++)
 	{
 	  if (strncmp(request_names[i], buf, sizeof(buf)) == 0)
-	    returnCode(MIN_FORM_COMMAND + (int) i);
+	    returnCode(MIN_FORM_COMMAND + (int)i);
 	}
     }
   RETURN(E_NO_MATCH);
diff -Naur ncurses-5.7.orig/form/frm_scale.c ncurses-5.7/form/frm_scale.c
--- ncurses-5.7.orig/form/frm_scale.c	2004-12-11 17:12:34.000000000 -0500
+++ ncurses-5.7/form/frm_scale.c	2011-01-08 18:13:50.447157090 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,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            *
@@ -32,7 +32,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: frm_scale.c,v 1.9 2004/12/11 22:12:34 tom Exp $")
+MODULE_ID("$Id: frm_scale.c,v 1.10 2010/01/23 21:14:36 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform  
@@ -47,7 +47,10 @@
 NCURSES_EXPORT(int)
 scale_form(const FORM *form, int *rows, int *cols)
 {
-  T((T_CALLED("scale_form(%p,%p,%p)"), form, rows, cols));
+  T((T_CALLED("scale_form(%p,%p,%p)"),
+     (const void *)form,
+     (void *)rows,
+     (void *)cols));
 
   if (!form)
     RETURN(E_BAD_ARGUMENT);
diff -Naur ncurses-5.7.orig/form/frm_sub.c ncurses-5.7/form/frm_sub.c
--- ncurses-5.7.orig/form/frm_sub.c	2004-12-11 17:13:39.000000000 -0500
+++ ncurses-5.7/form/frm_sub.c	2011-01-08 18:13:50.447157090 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,2004 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            *
@@ -27,12 +27,12 @@
  ****************************************************************************/
 
 /****************************************************************************
- *   Author:  Juergen Pfeifer, 1995,1997                                    *
+ *   Author:  Juergen Pfeifer, 1995-1997,2009                               *
  ****************************************************************************/
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: frm_sub.c,v 1.9 2004/12/11 22:13:39 tom Exp $")
+MODULE_ID("$Id: frm_sub.c,v 1.12 2010/01/23 21:14:36 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform  
@@ -46,13 +46,22 @@
 NCURSES_EXPORT(int)
 set_form_sub(FORM *form, WINDOW *win)
 {
-  T((T_CALLED("set_form_sub(%p,%p)"), form, win));
+  T((T_CALLED("set_form_sub(%p,%p)"), (void *)form, (void *)win));
 
   if (form && (form->status & _POSTED))
     RETURN(E_POSTED);
-
-  Normalize_Form(form)->sub = win;
-  RETURN(E_OK);
+  else
+    {
+#if NCURSES_SP_FUNCS
+      FORM *f = Normalize_Form(form);
+
+      f->sub = win ? win : StdScreen(Get_Form_Screen(f));
+      RETURN(E_OK);
+#else
+      Normalize_Form(form)->sub = win;
+      RETURN(E_OK);
+#endif
+    }
 }
 
 /*---------------------------------------------------------------------------
@@ -68,7 +77,7 @@
 {
   const FORM *f;
 
-  T((T_CALLED("form_sub(%p)"), form));
+  T((T_CALLED("form_sub(%p)"), (const void *)form));
 
   f = Normalize_Form(form);
   returnWin(Get_Form_Window(f));
diff -Naur ncurses-5.7.orig/form/frm_user.c ncurses-5.7/form/frm_user.c
--- ncurses-5.7.orig/form/frm_user.c	2004-12-25 17:37:56.000000000 -0500
+++ ncurses-5.7/form/frm_user.c	2011-01-08 18:13:50.447157090 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,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            *
@@ -32,7 +32,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: frm_user.c,v 1.14 2004/12/25 22:37:56 tom Exp $")
+MODULE_ID("$Id: frm_user.c,v 1.15 2010/01/23 21:14:36 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform  
@@ -46,7 +46,7 @@
 NCURSES_EXPORT(int)
 set_form_userptr(FORM *form, void *usrptr)
 {
-  T((T_CALLED("set_form_userptr(%p,%p)"), form, usrptr));
+  T((T_CALLED("set_form_userptr(%p,%p)"), (void *)form, (void *)usrptr));
 
   Normalize_Form(form)->usrptr = usrptr;
   RETURN(E_OK);
@@ -65,7 +65,7 @@
 NCURSES_EXPORT(void *)
 form_userptr(const FORM *form)
 {
-  T((T_CALLED("form_userptr(%p)"), form));
+  T((T_CALLED("form_userptr(%p)"), (const void *)form));
   returnVoidPtr(Normalize_Form(form)->usrptr);
 }
 
diff -Naur ncurses-5.7.orig/form/frm_win.c ncurses-5.7/form/frm_win.c
--- ncurses-5.7.orig/form/frm_win.c	2004-12-11 17:15:27.000000000 -0500
+++ ncurses-5.7/form/frm_win.c	2011-01-08 18:13:50.447157090 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,2004 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            *
@@ -32,7 +32,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: frm_win.c,v 1.13 2004/12/11 22:15:27 tom Exp $")
+MODULE_ID("$Id: frm_win.c,v 1.16 2010/01/23 21:14:36 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform  
@@ -46,13 +46,22 @@
 NCURSES_EXPORT(int)
 set_form_win(FORM *form, WINDOW *win)
 {
-  T((T_CALLED("set_form_win(%p,%p)"), form, win));
+  T((T_CALLED("set_form_win(%p,%p)"), (void *)form, (void *)win));
 
   if (form && (form->status & _POSTED))
     RETURN(E_POSTED);
-
-  Normalize_Form(form)->win = win;
-  RETURN(E_OK);
+  else
+    {
+#if NCURSES_SP_FUNCS
+      FORM *f = Normalize_Form(form);
+
+      f->win = win ? win : StdScreen(Get_Form_Screen(f));
+      RETURN(E_OK);
+#else
+      Normalize_Form(form)->win = win;
+      RETURN(E_OK);
+#endif
+    }
 }
 
 /*---------------------------------------------------------------------------
@@ -66,12 +75,18 @@
 NCURSES_EXPORT(WINDOW *)
 form_win(const FORM *form)
 {
+  WINDOW *result;
   const FORM *f;
 
-  T((T_CALLED("form_win(%p)"), form));
+  T((T_CALLED("form_win(%p)"), (const void *)form));
 
   f = Normalize_Form(form);
-  returnWin(f->win ? f->win : stdscr);
+#if NCURSES_SP_FUNCS
+  result = (f->win ? f->win : StdScreen(Get_Form_Screen(f)));
+#else
+  result = (f->win ? f->win : stdscr);
+#endif
+  returnWin(result);
 }
 
 /* frm_win.c ends here */
diff -Naur ncurses-5.7.orig/form/fty_alnum.c ncurses-5.7/form/fty_alnum.c
--- ncurses-5.7.orig/form/fty_alnum.c	2007-10-13 15:31:52.000000000 -0400
+++ ncurses-5.7/form/fty_alnum.c	2011-01-08 18:13:50.447157090 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2006,2007 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            *
@@ -34,7 +34,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: fty_alnum.c,v 1.21 2007/10/13 19:31:52 tom Exp $")
+MODULE_ID("$Id: fty_alnum.c,v 1.24 2010/01/23 21:14:36 tom Exp $")
 
 #define thisARG alnumARG
 
@@ -46,28 +46,48 @@
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform
-|   Function      :  static void *Make_This_Type(va_list *ap)
+|   Function      :  static void *Generic_This_Type(void *arg)
 |
 |   Description   :  Allocate structure for alphanumeric type argument.
 |
 |   Return Values :  Pointer to argument structure or NULL on error
 +--------------------------------------------------------------------------*/
 static void *
-Make_This_Type(va_list *ap)
+Generic_This_Type(void *arg)
 {
-  thisARG *argp = typeMalloc(thisARG, 1);
+  thisARG *argp = (thisARG *) 0;
 
-  if (argp)
+  if (arg)
     {
-      T((T_CREATE("thisARG %p"), argp));
-      argp->width = va_arg(*ap, int);
-    }
+      argp = typeMalloc(thisARG, 1);
 
+      if (argp)
+	{
+	  T((T_CREATE("thisARG %p"), (void *)argp));
+	  argp->width = *((int *)arg);
+	}
+    }
   return ((void *)argp);
 }
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform
+|   Function      :  static void *Make_This_Type(va_list *ap)
+|
+|   Description   :  Allocate structure for alphanumeric type argument.
+|
+|   Return Values :  Pointer to argument structure or NULL on error
++--------------------------------------------------------------------------*/
+static void *
+Make_This_Type(va_list *ap)
+{
+  int w = va_arg(*ap, int);
+
+  return Generic_This_Type((void *)&w);
+}
+
+/*---------------------------------------------------------------------------
+|   Facility      :  libnform
 |   Function      :  static void *Copy_ThisType(const void *argp)
 |
 |   Description   :  Copy structure for alphanumeric type argument.
@@ -82,7 +102,7 @@
 
   if (result)
     {
-      T((T_CREATE("thisARG %p"), result));
+      T((T_CREATE("thisARG %p"), (void *)result));
       *result = *ap;
     }
 
@@ -156,12 +176,27 @@
   Make_This_Type,
   Copy_This_Type,
   Free_This_Type,
-  Check_This_Field,
-  Check_This_Character,
-  NULL,
-  NULL
+  INIT_FT_FUNC(Check_This_Field),
+  INIT_FT_FUNC(Check_This_Character),
+  INIT_FT_FUNC(NULL),
+  INIT_FT_FUNC(NULL),
+#if NCURSES_INTEROP_FUNCS
+  Generic_This_Type
+#endif
 };
 
 NCURSES_EXPORT_VAR(FIELDTYPE*) TYPE_ALNUM = &typeTHIS;
 
+#if NCURSES_INTEROP_FUNCS
+/* The next routines are to simplify the use of ncurses from
+   programming languages with restictions on interop with C level
+   constructs (e.g. variable access or va_list + ellipsis constructs)
+*/
+NCURSES_EXPORT(FIELDTYPE *)
+_nc_TYPE_ALNUM(void)
+{
+  return TYPE_ALNUM;
+}
+#endif
+
 /* fty_alnum.c ends here */
diff -Naur ncurses-5.7.orig/form/fty_alpha.c ncurses-5.7/form/fty_alpha.c
--- ncurses-5.7.orig/form/fty_alpha.c	2007-10-13 15:32:09.000000000 -0400
+++ ncurses-5.7/form/fty_alpha.c	2011-01-08 18:13:50.447157090 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2006,2007 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            *
@@ -34,7 +34,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: fty_alpha.c,v 1.23 2007/10/13 19:32:09 tom Exp $")
+MODULE_ID("$Id: fty_alpha.c,v 1.26 2010/01/23 21:14:36 tom Exp $")
 
 #define thisARG alphaARG
 
@@ -46,28 +46,48 @@
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform
-|   Function      :  static void *Make_This_Type(va_list *ap)
+|   Function      :  static void *Generic_This_Type(va_list *ap)
 |
 |   Description   :  Allocate structure for alpha type argument.
 |
 |   Return Values :  Pointer to argument structure or NULL on error
 +--------------------------------------------------------------------------*/
 static void *
-Make_This_Type(va_list *ap)
+Generic_This_Type(void *arg)
 {
-  thisARG *argp = typeMalloc(thisARG, 1);
+  thisARG *argp = (thisARG *) 0;
 
-  if (argp)
+  if (arg)
     {
-      T((T_CREATE("thisARG %p"), argp));
-      argp->width = va_arg(*ap, int);
-    }
+      argp = typeMalloc(thisARG, 1);
 
+      if (argp)
+	{
+	  T((T_CREATE("thisARG %p"), (void *)argp));
+	  argp->width = *((int *)arg);
+	}
+    }
   return ((void *)argp);
 }
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform
+|   Function      :  static void *Make_This_Type(va_list *ap)
+|
+|   Description   :  Allocate structure for alpha type argument.
+|
+|   Return Values :  Pointer to argument structure or NULL on error
++--------------------------------------------------------------------------*/
+static void *
+Make_This_Type(va_list *ap)
+{
+  int w = va_arg(*ap, int);
+
+  return Generic_This_Type((void *)&w);
+}
+
+/*---------------------------------------------------------------------------
+|   Facility      :  libnform
 |   Function      :  static void *Copy_This_Type(const void * argp)
 |
 |   Description   :  Copy structure for alpha type argument.
@@ -82,7 +102,7 @@
 
   if (result)
     {
-      T((T_CREATE("thisARG %p"), result));
+      T((T_CREATE("thisARG %p"), (void *)result));
       *result = *ap;
     }
 
@@ -156,12 +176,27 @@
   Make_This_Type,
   Copy_This_Type,
   Free_This_Type,
-  Check_This_Field,
-  Check_This_Character,
-  NULL,
-  NULL
+  INIT_FT_FUNC(Check_This_Field),
+  INIT_FT_FUNC(Check_This_Character),
+  INIT_FT_FUNC(NULL),
+  INIT_FT_FUNC(NULL),
+#if NCURSES_INTEROP_FUNCS
+  Generic_This_Type
+#endif
 };
 
 NCURSES_EXPORT_VAR(FIELDTYPE*) TYPE_ALPHA = &typeTHIS;
 
+#if NCURSES_INTEROP_FUNCS
+/* The next routines are to simplify the use of ncurses from
+   programming languages with restictions on interop with C level
+   constructs (e.g. variable access or va_list + ellipsis constructs)
+*/
+NCURSES_EXPORT(FIELDTYPE *)
+_nc_TYPE_ALPHA(void)
+{
+  return TYPE_ALPHA;
+}
+#endif
+
 /* fty_alpha.c ends here */
diff -Naur ncurses-5.7.orig/form/fty_enum.c ncurses-5.7/form/fty_enum.c
--- ncurses-5.7.orig/form/fty_enum.c	2007-10-13 15:32:26.000000000 -0400
+++ ncurses-5.7/form/fty_enum.c	2011-01-08 18:13:50.447157090 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2006,2007 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            *
@@ -34,7 +34,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: fty_enum.c,v 1.22 2007/10/13 19:32:26 tom Exp $")
+MODULE_ID("$Id: fty_enum.c,v 1.26 2010/05/01 21:11:07 tom Exp $")
 
 typedef struct
   {
@@ -45,43 +45,99 @@
   }
 enumARG;
 
+typedef struct
+  {
+    char **kwds;
+    int ccase;
+    int cunique;
+  }
+enumParams;
+
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform  
-|   Function      :  static void *Make_Enum_Type( va_list * ap )
+|   Function      :  static void *Generic_Enum_Type(void * arg)
 |   
 |   Description   :  Allocate structure for enumeration type argument.
 |
 |   Return Values :  Pointer to argument structure or NULL on error
 +--------------------------------------------------------------------------*/
 static void *
-Make_Enum_Type(va_list *ap)
+Generic_Enum_Type(void *arg)
 {
-  enumARG *argp = typeMalloc(enumARG, 1);
+  enumARG *argp = (enumARG *)0;
+  enumParams *params = (enumParams *) arg;
 
-  if (argp)
+  if (params)
     {
-      int cnt = 0;
-      char **kp = (char **)0;
-      int ccase, cunique;
-
-      T((T_CREATE("enumARG %p"), argp));
-      argp->kwds = va_arg(*ap, char **);
-      ccase = va_arg(*ap, int);
-      cunique = va_arg(*ap, int);
-
-      argp->checkcase = ccase ? TRUE : FALSE;
-      argp->checkunique = cunique ? TRUE : FALSE;
-
-      kp = argp->kwds;
-      while (kp && (*kp++))
-	cnt++;
-      argp->count = cnt;
+      argp = typeMalloc(enumARG, 1);
+
+      if (argp)
+	{
+	  int cnt = 0;
+	  char **kp = (char **)0;
+	  char **kwds = (char **)0;
+	  char **kptarget;
+	  int ccase, cunique;
+
+	  T((T_CREATE("enumARG %p"), (void *)argp));
+	  kwds = params->kwds;
+	  ccase = params->ccase;
+	  cunique = params->cunique;
+
+	  argp->checkcase = ccase ? TRUE : FALSE;
+	  argp->checkunique = cunique ? TRUE : FALSE;
+	  argp->kwds = (char **)0;
+
+	  kp = kwds;
+	  while (kp && (*kp++))
+	    cnt++;
+	  argp->count = cnt;
+
+	  if (cnt > 0)
+	    {
+	      /* We copy the keywords, because we can't rely on the fact
+	         that the caller doesn't relocate or free the memory used
+	         for the keywords (maybe he has GC)
+	       */
+	      argp->kwds = typeMalloc(char *, cnt + 1);
+
+	      kp = kwds;
+	      if ((kptarget = argp->kwds) != 0)
+		{
+		  while (kp && (*kp))
+		    {
+		      (*kptarget++) = strdup(*kp++);
+		    }
+		  *kptarget = (char *)0;
+		}
+	    }
+	}
     }
   return (void *)argp;
 }
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform  
+|   Function      :  static void *Make_Enum_Type( va_list * ap )
+|   
+|   Description   :  Allocate structure for enumeration type argument.
+|
+|   Return Values :  Pointer to argument structure or NULL on error
++--------------------------------------------------------------------------*/
+static void *
+Make_Enum_Type(va_list *ap)
+{
+  enumParams params;
+
+  params.kwds = va_arg(*ap, char **);
+  params.ccase = va_arg(*ap, int);
+  params.cunique = va_arg(*ap, int);
+
+  return Generic_Enum_Type((void *)&params);
+}
+
+/*---------------------------------------------------------------------------
+|   Facility      :  libnform  
 |   Function      :  static void *Copy_Enum_Type( const void * argp )
 |   
 |   Description   :  Copy structure for enumeration type argument.  
@@ -101,8 +157,24 @@
 
       if (result)
 	{
-	  T((T_CREATE("enumARG %p"), result));
+	  T((T_CREATE("enumARG %p"), (void *)result));
 	  *result = *ap;
+
+	  if (ap->count > 0)
+	    {
+	      char **kptarget;
+	      char **kp = ap->kwds;
+	      result->kwds = typeMalloc(char *, 1 + ap->count);
+
+	      if ((kptarget = result->kwds) != 0)
+		{
+		  while (kp && (*kp))
+		    {
+		      (*kptarget++) = strdup(*kp++);
+		    }
+		  *kptarget = (char *)0;
+		}
+	    }
 	}
     }
   return (void *)result;
@@ -120,7 +192,24 @@
 Free_Enum_Type(void *argp)
 {
   if (argp)
-    free(argp);
+    {
+      const enumARG *ap = (const enumARG *)argp;
+
+      if (ap->kwds && ap->count > 0)
+	{
+	  char **kp = ap->kwds;
+	  int cnt = 0;
+
+	  while (kp && (*kp))
+	    {
+	      free(*kp++);
+	      cnt++;
+	    }
+	  assert(cnt == ap->count);
+	  free(ap->kwds);
+	}
+      free(argp);
+    }
 }
 
 #define SKIP_SPACE(x) while(((*(x))!='\0') && (is_blank(*(x)))) (x)++
@@ -326,13 +415,28 @@
   Make_Enum_Type,
   Copy_Enum_Type,
   Free_Enum_Type,
-  Check_Enum_Field,
-  NULL,
-  Next_Enum,
-  Previous_Enum
+  INIT_FT_FUNC(Check_Enum_Field),
+  INIT_FT_FUNC(NULL),
+  INIT_FT_FUNC(Next_Enum),
+  INIT_FT_FUNC(Previous_Enum),
+#if NCURSES_INTEROP_FUNCS
+  Generic_Enum_Type
+#endif
 };
 
 NCURSES_EXPORT_VAR(FIELDTYPE *)
 TYPE_ENUM = &typeENUM;
 
+#if NCURSES_INTEROP_FUNCS
+/* The next routines are to simplify the use of ncurses from
+   programming languages with restictions on interop with C level
+   constructs (e.g. variable access or va_list + ellipsis constructs)
+*/
+NCURSES_EXPORT(FIELDTYPE *)
+_nc_TYPE_ENUM(void)
+{
+  return TYPE_ENUM;
+}
+#endif
+
 /* fty_enum.c ends here */
diff -Naur ncurses-5.7.orig/form/fty_generic.c ncurses-5.7/form/fty_generic.c
--- ncurses-5.7.orig/form/fty_generic.c	1969-12-31 19:00:00.000000000 -0500
+++ ncurses-5.7/form/fty_generic.c	2011-01-08 18:13:50.451157254 -0500
@@ -0,0 +1,297 @@
+/****************************************************************************
+ * Copyright (c) 2008-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            *
+ * "Software"), to deal in the Software without restriction, including      *
+ * without limitation the rights to use, copy, modify, merge, publish,      *
+ * distribute, distribute with modifications, sublicense, and/or sell       *
+ * copies of the Software, and to permit persons to whom the Software is    *
+ * furnished to do so, subject to the following conditions:                 *
+ *                                                                          *
+ * The above copyright notice and this permission notice shall be included  *
+ * in all copies or substantial portions of the Software.                   *
+ *                                                                          *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
+ *                                                                          *
+ * Except as contained in this notice, the name(s) of the above copyright   *
+ * holders shall not be used in advertising or otherwise to promote the     *
+ * sale, use or other dealings in this Software without prior written       *
+ * authorization.                                                           *
+ ****************************************************************************/
+
+/***************************************************************************
+*                                                                          *
+*  Author : Juergen Pfeifer                                                *
+*                                                                          *
+***************************************************************************/
+
+#include "form.priv.h"
+
+MODULE_ID("$Id: fty_generic.c,v 1.5 2010/01/23 21:14:36 tom Exp $")
+
+/*
+ * This is not a full implementation of a field type, but adds some
+ * support for higher level languages with some restrictions to interop
+ * with C language. Especially the collection of arguments for the
+ * various fieldtypes is not based on the vararg C mechanism, but on a
+ * iterator based callback mechanism that allowes the high level language
+ * to provide the arguments as a structure. Most languages have mechanisms
+ * to layout structures so that they can be passed to C.
+ * The languages can register a new generic fieldtype dynamically and store
+ * a handle (key) to the calling object as an argument. Together with that
+ * it can register a freearg callback, so that the high level language
+ * remains in control of the memory management of the arguments they pass.
+ * The design idea is, that the high-level language - typically a OO
+ * language like C# or Java, uses it's own dispatching mechanisms
+ * (polymorphism) to call the proper check routines responsible for the
+ * argument type. So these language implement typically only one generic
+ * fieldtype they register with the forms library using this call.
+ *
+ * For that purpose we have extended the fieldtype struc by a new element
+ * that gets the arguments from a single struct passed by the caller. 
+ * 
+ */
+#if NCURSES_INTEROP_FUNCS
+
+/*---------------------------------------------------------------------------
+|   Facility      :  libnform  
+|   Function      :  static void *Generic_This_Type( void * arg )
+|   
+|   Description   :  We interpret the passed arg just as a handle the
+|                    calling language uses to keep track of its allocated
+|                    argument structures. We can simply copy it back.
+|
+|   Return Values :  Pointer to argument structure
++--------------------------------------------------------------------------*/
+static void *
+Generic_This_Type(void *arg)
+{
+  return (arg);
+}
+
+/*---------------------------------------------------------------------------
+|   Facility      :  libnform
+|   Function      :  FIELDTYPE *_nc_generic_fieldtype(
+|                       bool (* const field_check)(FIELD *,const void *),
+|                       bool (* const char_check) (int, const void *),
+|   		        bool (*const next)(FORM*,FIELD*,const void*),
+|		        bool (*const prev)(FORM*,FIELD*,const void*),
+|                       void (*freecallback)(void*))
+|
+|   Description   :  Create a new fieldtype. The application programmer must
+|                    write a field_check and a char_check function and give
+|                    them as input to this call. A callback to allow the
+|                    release of the allocated memory must also be provided.
+|                    For generic field types, we provide some more 
+|                    information about the field as parameters.
+|
+|                    If an error occurs, errno is set to
+|                       E_BAD_ARGUMENT  - invalid arguments
+|                       E_SYSTEM_ERROR  - system error (no memory)
+|
+|   Return Values :  Fieldtype pointer or NULL if error occurred
++--------------------------------------------------------------------------*/
+NCURSES_EXPORT(FIELDTYPE *)
+_nc_generic_fieldtype(bool (*const field_check) (FORM *, FIELD *, const void *),
+		      bool (*const char_check) (int, FORM *, FIELD *, const
+						void *),
+		      bool (*const next) (FORM *, FIELD *, const void *),
+		      bool (*const prev) (FORM *, FIELD *, const void *),
+		      void (*freecallback) (void *))
+{
+  int code = E_SYSTEM_ERROR;
+  FIELDTYPE *res = (FIELDTYPE *)0;
+
+  T((T_CALLED("_nc_generic_fieldtype(%p,%p,%p,%p,%p)"),
+     field_check, char_check, next, prev, freecallback));
+
+  if (field_check || char_check)
+    {
+      res = typeMalloc(FIELDTYPE, 1);
+
+      if (res)
+	{
+	  *res = *_nc_Default_FieldType;
+	  res->status |= (_HAS_ARGS | _GENERIC);
+	  res->fieldcheck.gfcheck = field_check;
+	  res->charcheck.gccheck = char_check;
+	  res->genericarg = Generic_This_Type;
+	  res->freearg = freecallback;
+	  res->enum_next.gnext = next;
+	  res->enum_prev.gprev = prev;
+	  code = E_OK;
+	}
+    }
+  else
+    code = E_BAD_ARGUMENT;
+
+  if (E_OK != code)
+    SET_ERROR(code);
+
+  returnFieldType(res);
+}
+
+/*---------------------------------------------------------------------------
+|   Facility      :  libnform  
+|   Function      :  static TypeArgument *GenericArgument(
+|                      const FIELDTYPE* typ,
+|                      int (*argiterator)(void**),
+|                      int* err)
+|   
+|   Description   :  The iterator callback must browse through all fieldtype
+|                    parameters that have an argument associated with the
+|                    type. The iterator returns 1 if the operation to get
+|                    the next element was successfull, 0 otherwise. If the
+|                    iterator could move to the next argument, it fills
+|                    the void* pointer representing the argument into the
+|                    location provided as argument to the iterator.
+|                    The err reference is used to keep track of errors.
+|
+|   Return Values :  Pointer to argument structure
++--------------------------------------------------------------------------*/
+static TypeArgument *
+GenericArgument(const FIELDTYPE *typ,
+		int (*argiterator) (void **), int *err)
+{
+  TypeArgument *res = (TypeArgument *)0;
+
+  if (typ != 0 && (typ->status & _HAS_ARGS) != 0 && err != 0 && argiterator != 0)
+    {
+      if (typ->status & _LINKED_TYPE)
+	{
+	  /* Composite fieldtypes keep track internally of their own memory */
+	  TypeArgument *p = typeMalloc(TypeArgument, 1);
+
+	  if (p)
+	    {
+	      p->left = GenericArgument(typ->left, argiterator, err);
+	      p->right = GenericArgument(typ->right, argiterator, err);
+	      return p;
+	    }
+	  else
+	    *err += 1;
+	}
+      else
+	{
+	  assert(typ->genericarg != (void *)0);
+	  if (typ->genericarg == 0)
+	    *err += 1;
+	  else
+	    {
+	      void *argp;
+	      int valid = argiterator(&argp);
+
+	      if (valid == 0 || argp == 0 ||
+		  !(res = (TypeArgument *)typ->genericarg(argp)))
+		{
+		  *err += 1;
+		}
+	    }
+	}
+    }
+  return res;
+}
+
+/*---------------------------------------------------------------------------
+|   Facility      :  libnform  
+|   Function      :  int _nc_set_generic_fieldtype(
+|                      FIELD* field,
+|                      FIELDTYPE* ftyp,
+|                      int (*argiterator)(void**))
+|   
+|   Description   :  Assign the fieldtype to the field and use the iterator
+|                    mechanism to get the arguments when a check is 
+|                    performed.
+|
+|   Return Values :  E_OK if all went well
+|                    E_SYSTEM_ERROR if an error occurred
++--------------------------------------------------------------------------*/
+NCURSES_EXPORT(int)
+_nc_set_generic_fieldtype(FIELD *field,
+			  FIELDTYPE *ftyp,
+			  int (*argiterator) (void **))
+{
+  int code = E_SYSTEM_ERROR;
+  int err = 0;
+
+  if (field)
+    {
+      if (field && field->type)
+	_nc_Free_Type(field);
+
+      field->type = ftyp;
+      if (ftyp)
+	{
+	  if (argiterator)
+	    {
+	      /* The precondition is that the iterator is reset */
+	      field->arg = (void *)GenericArgument(field->type, argiterator, &err);
+
+	      if (err)
+		{
+		  _nc_Free_Argument(field->type, (TypeArgument *)(field->arg));
+		  field->type = (FIELDTYPE *)0;
+		  field->arg = (void *)0;
+		}
+	      else
+		{
+		  code = E_OK;
+		  if (field->type)
+		    field->type->ref++;
+		}
+	    }
+	}
+      else
+	{
+	  field->arg = (void *)0;
+	  code = E_OK;
+	}
+    }
+  return code;
+}
+
+/*---------------------------------------------------------------------------
+|   Facility      :  libnform  
+|   Function      :  WINDOW* _nc_form_cursor(
+|                      FORM* form,
+|                      int *pRow, int *pCol)
+|   
+|   Description   :  Get the current position of the form cursor position
+|                    We also return the field window
+|
+|   Return Values :  The fields Window or NULL on error
++--------------------------------------------------------------------------*/
+NCURSES_EXPORT(WINDOW *)
+_nc_form_cursor(const FORM *form, int *pRow, int *pCol)
+{
+  int code = E_SYSTEM_ERROR;
+  WINDOW *res = (WINDOW *)0;
+
+  if (!(form == 0 || pRow == 0 || pCol == 0))
+    {
+      *pRow = form->currow;
+      *pCol = form->curcol;
+      res = form->w;
+      code = E_OK;
+    }
+  if (code != E_OK)
+    SET_ERROR(code);
+  return res;
+}
+
+#else
+extern void _nc_fty_generic(void);
+void
+_nc_fty_generic(void)
+{
+}
+#endif
+
+/* fty_generic.c ends here */
diff -Naur ncurses-5.7.orig/form/fty_int.c ncurses-5.7/form/fty_int.c
--- ncurses-5.7.orig/form/fty_int.c	2007-10-13 15:32:40.000000000 -0400
+++ ncurses-5.7/form/fty_int.c	2011-01-08 18:13:50.451157254 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2006,2007 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            *
@@ -34,7 +34,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: fty_int.c,v 1.22 2007/10/13 19:32:40 tom Exp $")
+MODULE_ID("$Id: fty_int.c,v 1.25 2010/01/23 21:14:36 tom Exp $")
 
 #if USE_WIDEC_SUPPORT
 #define isDigit(c) (iswdigit((wint_t)(c)) || isdigit(UChar(c)))
@@ -52,31 +52,63 @@
   }
 thisARG;
 
+typedef struct
+  {
+    int precision;
+    long low;
+    long high;
+  }
+integerPARM;
+
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform  
-|   Function      :  static void *Make_This_Type( va_list * ap )
+|   Function      :  static void *Generic_This_Type( void * arg )
 |   
 |   Description   :  Allocate structure for integer type argument.
 |
 |   Return Values :  Pointer to argument structure or NULL on error
 +--------------------------------------------------------------------------*/
 static void *
-Make_This_Type(va_list *ap)
+Generic_This_Type(void *arg)
 {
-  thisARG *argp = typeMalloc(thisARG, 1);
+  thisARG *argp = (thisARG *) 0;
+  thisARG *param = (thisARG *) arg;
 
-  if (argp)
+  if (param)
     {
-      T((T_CREATE("thisARG %p"), argp));
-      argp->precision = va_arg(*ap, int);
-      argp->low = va_arg(*ap, long);
-      argp->high = va_arg(*ap, long);
+      argp = typeMalloc(thisARG, 1);
+
+      if (argp)
+	{
+	  T((T_CREATE("thisARG %p"), (void *)argp));
+	  *argp = *param;
+	}
     }
   return (void *)argp;
 }
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform  
+|   Function      :  static void *Make_This_Type( va_list * ap )
+|   
+|   Description   :  Allocate structure for integer type argument.
+|
+|   Return Values :  Pointer to argument structure or NULL on error
++--------------------------------------------------------------------------*/
+static void *
+Make_This_Type(va_list *ap)
+{
+  thisARG arg;
+
+  arg.precision = va_arg(*ap, int);
+  arg.low = va_arg(*ap, long);
+  arg.high = va_arg(*ap, long);
+
+  return Generic_This_Type((void *)&arg);
+}
+
+/*---------------------------------------------------------------------------
+|   Facility      :  libnform  
 |   Function      :  static void *Copy_This_Type(const void * argp)
 |   
 |   Description   :  Copy structure for integer type argument.  
@@ -94,7 +126,7 @@
       result = typeMalloc(thisARG, 1);
       if (result)
 	{
-	  T((T_CREATE("thisARG %p"), result));
+	  T((T_CREATE("thisARG %p"), (void *)result));
 	  *result = *ap;
 	}
     }
@@ -235,12 +267,27 @@
   Make_This_Type,
   Copy_This_Type,
   Free_This_Type,
-  Check_This_Field,
-  Check_This_Character,
-  NULL,
-  NULL
+  INIT_FT_FUNC(Check_This_Field),
+  INIT_FT_FUNC(Check_This_Character),
+  INIT_FT_FUNC(NULL),
+  INIT_FT_FUNC(NULL),
+#if NCURSES_INTEROP_FUNCS
+  Generic_This_Type
+#endif
 };
 
 NCURSES_EXPORT_VAR(FIELDTYPE*) TYPE_INTEGER = &typeTHIS;
 
+#if NCURSES_INTEROP_FUNCS
+/* The next routines are to simplify the use of ncurses from
+   programming languages with restictions on interop with C level
+   constructs (e.g. variable access or va_list + ellipsis constructs)
+*/
+NCURSES_EXPORT(FIELDTYPE *)
+_nc_TYPE_INTEGER(void)
+{
+  return TYPE_INTEGER;
+}
+#endif
+
 /* fty_int.c ends here */
diff -Naur ncurses-5.7.orig/form/fty_ipv4.c ncurses-5.7/form/fty_ipv4.c
--- ncurses-5.7.orig/form/fty_ipv4.c	2006-12-02 14:33:02.000000000 -0500
+++ ncurses-5.7/form/fty_ipv4.c	2011-01-08 18:13:50.451157254 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2004,2006 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2006,2009 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -34,7 +34,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: fty_ipv4.c,v 1.8 2006/12/02 19:33:02 tom Exp $")
+MODULE_ID("$Id: fty_ipv4.c,v 1.10 2009/11/07 20:17:58 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform  
@@ -94,12 +94,27 @@
   NULL,
   NULL,
   NULL,
-  Check_IPV4_Field,
-  Check_IPV4_Character,
-  NULL,
+  INIT_FT_FUNC(Check_IPV4_Field),
+  INIT_FT_FUNC(Check_IPV4_Character),
+  INIT_FT_FUNC(NULL),
+  INIT_FT_FUNC(NULL),
+#if NCURSES_INTEROP_FUNCS
   NULL
+#endif
 };
 
 NCURSES_EXPORT_VAR(FIELDTYPE*) TYPE_IPV4 = &typeIPV4;
 
+#if NCURSES_INTEROP_FUNCS
+/* The next routines are to simplify the use of ncurses from
+   programming languages with restictions on interop with C level
+   constructs (e.g. variable access or va_list + ellipsis constructs)
+*/
+NCURSES_EXPORT(FIELDTYPE *)
+_nc_TYPE_IPV4(void)
+{
+  return TYPE_IPV4;
+}
+#endif
+
 /* fty_ipv4.c ends here */
diff -Naur ncurses-5.7.orig/form/fty_num.c ncurses-5.7/form/fty_num.c
--- ncurses-5.7.orig/form/fty_num.c	2007-10-13 15:32:54.000000000 -0400
+++ ncurses-5.7/form/fty_num.c	2011-01-08 18:13:50.451157254 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2006,2007 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            *
@@ -34,7 +34,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: fty_num.c,v 1.25 2007/10/13 19:32:54 tom Exp $")
+MODULE_ID("$Id: fty_num.c,v 1.28 2010/01/23 21:14:36 tom Exp $")
 
 #if HAVE_LOCALE_H
 #include <locale.h>
@@ -63,37 +63,71 @@
   }
 thisARG;
 
+typedef struct
+  {
+    int precision;
+    double low;
+    double high;
+  }
+thisPARM;
+
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform
-|   Function      :  static void *Make_This_Type(va_list * ap)
+|   Function      :  static void *Generic_This_Type(void * arg)
 |
 |   Description   :  Allocate structure for numeric type argument.
 |
 |   Return Values :  Pointer to argument structure or NULL on error
 +--------------------------------------------------------------------------*/
 static void *
-Make_This_Type(va_list *ap)
+Generic_This_Type(void *arg)
 {
-  thisARG *argn = typeMalloc(thisARG, 1);
+  thisARG *argn = (thisARG *) 0;
+  thisPARM *args = (thisPARM *) arg;
 
-  if (argn)
+  if (args)
     {
-      T((T_CREATE("thisARG %p"), argn));
-      argn->precision = va_arg(*ap, int);
-      argn->low = va_arg(*ap, double);
-      argn->high = va_arg(*ap, double);
+      argn = typeMalloc(thisARG, 1);
+
+      if (argn)
+	{
+	  T((T_CREATE("thisARG %p"), (void *)argn));
+	  argn->precision = args->precision;
+	  argn->low = args->low;
+	  argn->high = args->high;
 
 #if HAVE_LOCALE_H
-      argn->L = localeconv();
+	  argn->L = localeconv();
 #else
-      argn->L = NULL;
+	  argn->L = NULL;
 #endif
+	}
     }
   return (void *)argn;
 }
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform
+|   Function      :  static void *Make_This_Type(va_list * ap)
+|
+|   Description   :  Allocate structure for numeric type argument.
+|
+|   Return Values :  Pointer to argument structure or NULL on error
++--------------------------------------------------------------------------*/
+static void *
+Make_This_Type(va_list *ap)
+{
+  thisPARM arg;
+
+  arg.precision = va_arg(*ap, int);
+  arg.low = va_arg(*ap, double);
+  arg.high = va_arg(*ap, double);
+
+  return Generic_This_Type((void *)&arg);
+}
+
+/*---------------------------------------------------------------------------
+|   Facility      :  libnform
 |   Function      :  static void *Copy_This_Type(const void * argp)
 |
 |   Description   :  Copy structure for numeric type argument.
@@ -111,7 +145,7 @@
       result = typeMalloc(thisARG, 1);
       if (result)
 	{
-	  T((T_CREATE("thisARG %p"), result));
+	  T((T_CREATE("thisARG %p"), (void *)result));
 	  *result = *ap;
 	}
     }
@@ -279,12 +313,27 @@
   Make_This_Type,
   Copy_This_Type,
   Free_This_Type,
-  Check_This_Field,
-  Check_This_Character,
-  NULL,
-  NULL
+  INIT_FT_FUNC(Check_This_Field),
+  INIT_FT_FUNC(Check_This_Character),
+  INIT_FT_FUNC(NULL),
+  INIT_FT_FUNC(NULL),
+#if NCURSES_INTEROP_FUNCS
+  Generic_This_Type
+#endif
 };
 
 NCURSES_EXPORT_VAR(FIELDTYPE*) TYPE_NUMERIC = &typeTHIS;
 
+#if NCURSES_INTEROP_FUNCS
+/* The next routines are to simplify the use of ncurses from
+   programming languages with restictions on interop with C level
+   constructs (e.g. variable access or va_list + ellipsis constructs)
+*/
+NCURSES_EXPORT(FIELDTYPE *)
+_nc_TYPE_NUMERIC(void)
+{
+  return TYPE_NUMERIC;
+}
+#endif
+
 /* fty_num.c ends here */
diff -Naur ncurses-5.7.orig/form/fty_regex.c ncurses-5.7/form/fty_regex.c
--- ncurses-5.7.orig/form/fty_regex.c	2007-10-13 15:33:50.000000000 -0400
+++ ncurses-5.7/form/fty_regex.c	2011-01-08 18:13:50.451157254 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2006,2007 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            *
@@ -34,7 +34,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: fty_regex.c,v 1.21 2007/10/13 19:33:50 tom Exp $")
+MODULE_ID("$Id: fty_regex.c,v 1.24 2010/01/23 21:14:37 tom Exp $")
 
 #if HAVE_REGEX_H_FUNCS		/* We prefer POSIX regex */
 #include <regex.h>
@@ -90,97 +90,109 @@
 
 #endif
 
+#if HAVE_REGEX_H_FUNCS | HAVE_REGEXP_H_FUNCS | HAVE_REGEXPR_H_FUNCS
+# define MAYBE_UNUSED
+#else
+# define MAYBE_UNUSED GCC_UNUSED
+#endif
+
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform
-|   Function      :  static void *Make_RegularExpression_Type(va_list * ap)
+|   Function      :  static void *Generic_RegularExpression_Type(void * arg)
 |
 |   Description   :  Allocate structure for regex type argument.
 |
 |   Return Values :  Pointer to argument structure or NULL on error
 +--------------------------------------------------------------------------*/
 static void *
-Make_RegularExpression_Type(va_list *ap)
+Generic_RegularExpression_Type(void *arg MAYBE_UNUSED)
 {
 #if HAVE_REGEX_H_FUNCS
-  char *rx = va_arg(*ap, char *);
-  RegExp_Arg *preg;
+  char *rx = (char *)arg;
+  RegExp_Arg *preg = (RegExp_Arg *)0;
 
-  preg = typeMalloc(RegExp_Arg, 1);
-
-  if (preg)
+  if (rx)
     {
-      T((T_CREATE("RegExp_Arg %p"), preg));
-      if (((preg->pRegExp = typeMalloc(regex_t, 1)) != 0)
-	  && !regcomp(preg->pRegExp, rx,
-		      (REG_EXTENDED | REG_NOSUB | REG_NEWLINE)))
-	{
-	  T((T_CREATE("regex_t %p"), preg->pRegExp));
-	  preg->refCount = typeMalloc(unsigned long, 1);
+      preg = typeMalloc(RegExp_Arg, 1);
 
-	  *(preg->refCount) = 1;
-	}
-      else
+      if (preg)
 	{
-	  if (preg->pRegExp)
-	    free(preg->pRegExp);
-	  free(preg);
-	  preg = (RegExp_Arg *)0;
+	  T((T_CREATE("RegExp_Arg %p"), (void *)preg));
+	  if (((preg->pRegExp = typeMalloc(regex_t, 1)) != 0)
+	      && !regcomp(preg->pRegExp, rx,
+			  (REG_EXTENDED | REG_NOSUB | REG_NEWLINE)))
+	    {
+	      T((T_CREATE("regex_t %p"), (void *)preg->pRegExp));
+	      preg->refCount = typeMalloc(unsigned long, 1);
+
+	      *(preg->refCount) = 1;
+	    }
+	  else
+	    {
+	      if (preg->pRegExp)
+		free(preg->pRegExp);
+	      free(preg);
+	      preg = (RegExp_Arg *)0;
+	    }
 	}
     }
   return ((void *)preg);
 #elif HAVE_REGEXP_H_FUNCS | HAVE_REGEXPR_H_FUNCS
-  char *rx = va_arg(*ap, char *);
-  RegExp_Arg *pArg;
+  char *rx = (char *)arg;
+  RegExp_Arg *pArg = (RegExp_Arg *)0;
 
-  pArg = typeMalloc(RegExp_Arg, 1);
-
-  if (pArg)
+  if (rx)
     {
-      int blen = RX_INCREMENT;
+      pArg = typeMalloc(RegExp_Arg, 1);
 
-      T((T_CREATE("RegExp_Arg %p"), pArg));
-      pArg->compiled_expression = NULL;
-      pArg->refCount = typeMalloc(unsigned long, 1);
+      if (pArg)
+	{
+	  int blen = RX_INCREMENT;
 
-      *(pArg->refCount) = 1;
+	  T((T_CREATE("RegExp_Arg %p"), pArg));
+	  pArg->compiled_expression = NULL;
+	  pArg->refCount = typeMalloc(unsigned long, 1);
 
-      do
-	{
-	  char *buf = typeMalloc(char, blen);
+	  *(pArg->refCount) = 1;
 
-	  if (buf)
+	  do
 	    {
+	      char *buf = typeMalloc(char, blen);
+
+	      if (buf)
+		{
 #if HAVE_REGEXP_H_FUNCS
-	      char *last_pos = compile(rx, buf, &buf[blen], '\0');
+		  char *last_pos = compile(rx, buf, &buf[blen], '\0');
 
 #else /* HAVE_REGEXPR_H_FUNCS */
-	      char *last_pos = compile(rx, buf, &buf[blen]);
+		  char *last_pos = compile(rx, buf, &buf[blen]);
 #endif
-	      if (reg_errno)
-		{
-		  free(buf);
-		  if (reg_errno == 50)
-		    blen += RX_INCREMENT;
+		  if (reg_errno)
+		    {
+		      free(buf);
+		      if (reg_errno == 50)
+			blen += RX_INCREMENT;
+		      else
+			{
+			  free(pArg);
+			  pArg = NULL;
+			  break;
+			}
+		    }
 		  else
 		    {
-		      free(pArg);
-		      pArg = NULL;
+		      pArg->compiled_expression = buf;
 		      break;
 		    }
 		}
-	      else
-		{
-		  pArg->compiled_expression = buf;
-		  break;
-		}
 	    }
+	  while (blen <= MAX_RX_LEN);
+	}
+      if (pArg && !pArg->compiled_expression)
+	{
+	  free(pArg);
+	  pArg = NULL;
 	}
-      while (blen <= MAX_RX_LEN);
-    }
-  if (pArg && !pArg->compiled_expression)
-    {
-      free(pArg);
-      pArg = NULL;
     }
   return (void *)pArg;
 #else
@@ -190,6 +202,22 @@
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform
+|   Function      :  static void *Make_RegularExpression_Type(va_list * ap)
+|
+|   Description   :  Allocate structure for regex type argument.
+|
+|   Return Values :  Pointer to argument structure or NULL on error
++--------------------------------------------------------------------------*/
+static void *
+Make_RegularExpression_Type(va_list *ap)
+{
+  char *rx = va_arg(*ap, char *);
+
+  return Generic_RegularExpression_Type((void *)rx);
+}
+
+/*---------------------------------------------------------------------------
+|   Facility      :  libnform
 |   Function      :  static void *Copy_RegularExpression_Type(
 |                                      const void * argp)
 |
@@ -198,7 +226,7 @@
 |   Return Values :  Pointer to argument structure or NULL on error.
 +--------------------------------------------------------------------------*/
 static void *
-Copy_RegularExpression_Type(const void *argp)
+Copy_RegularExpression_Type(const void *argp MAYBE_UNUSED)
 {
 #if (HAVE_REGEX_H_FUNCS | HAVE_REGEXP_H_FUNCS | HAVE_REGEXPR_H_FUNCS)
   const RegExp_Arg *ap = (const RegExp_Arg *)argp;
@@ -224,7 +252,7 @@
 |   Return Values :  -
 +--------------------------------------------------------------------------*/
 static void
-Free_RegularExpression_Type(void *argp)
+Free_RegularExpression_Type(void *argp MAYBE_UNUSED)
 {
 #if HAVE_REGEX_H_FUNCS | HAVE_REGEXP_H_FUNCS | HAVE_REGEXPR_H_FUNCS
   RegExp_Arg *ap = (RegExp_Arg *)argp;
@@ -264,7 +292,8 @@
 |                    FALSE - field is invalid
 +--------------------------------------------------------------------------*/
 static bool
-Check_RegularExpression_Field(FIELD *field, const void *argp)
+Check_RegularExpression_Field(FIELD *field MAYBE_UNUSED,
+			      const void *argp MAYBE_UNUSED)
 {
   bool match = FALSE;
 
@@ -295,12 +324,27 @@
   Make_RegularExpression_Type,
   Copy_RegularExpression_Type,
   Free_RegularExpression_Type,
-  Check_RegularExpression_Field,
-  NULL,
-  NULL,
-  NULL
+  INIT_FT_FUNC(Check_RegularExpression_Field),
+  INIT_FT_FUNC(NULL),
+  INIT_FT_FUNC(NULL),
+  INIT_FT_FUNC(NULL),
+#if NCURSES_INTEROP_FUNCS
+  Generic_RegularExpression_Type
+#endif
 };
 
 NCURSES_EXPORT_VAR(FIELDTYPE*) TYPE_REGEXP = &typeREGEXP;
 
+#if NCURSES_INTEROP_FUNCS
+/* The next routines are to simplify the use of ncurses from
+   programming languages with restictions on interop with C level
+   constructs (e.g. variable access or va_list + ellipsis constructs)
+*/
+NCURSES_EXPORT(FIELDTYPE *)
+_nc_TYPE_REGEXP(void)
+{
+  return TYPE_REGEXP;
+}
+#endif
+
 /* fty_regex.c ends here */
diff -Naur ncurses-5.7.orig/form/llib-lform ncurses-5.7/form/llib-lform
--- ncurses-5.7.orig/form/llib-lform	2005-03-05 14:41:01.000000000 -0500
+++ ncurses-5.7/form/llib-lform	2011-01-08 18:13:50.451157254 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2002,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            *
@@ -27,13 +27,13 @@
  ****************************************************************************/
 
 /****************************************************************************
- *  Author: Thomas E. Dickey       1996,1997,2002,2005                      *
+ *  Author: Thomas E. Dickey       1996-2005,2010                           *
  ****************************************************************************/
 /* LINTLIBRARY */
 
 /* ./f_trace.c */
 
-#include "form.priv.h"
+#include <form.priv.h>
 
 #undef _nc_retrace_field_ptr
 FIELD	**_nc_retrace_field_ptr(
@@ -264,7 +264,7 @@
 /* ./fld_newftyp.c */
 
 #undef _nc_Default_FieldType
-const FIELDTYPE *_nc_Default_FieldType = {0};
+FIELDTYPE *_nc_Default_FieldType;
 
 #undef new_fieldtype
 FIELDTYPE *new_fieldtype(
@@ -396,6 +396,12 @@
 #undef _nc_Default_Form
 FORM	*_nc_Default_Form;
 
+#undef new_form_sp
+FORM	*new_form_sp(
+		SCREEN	*sp, 
+		FIELD	**fields)
+		{ return(*(FORM **)0); }
+
 #undef new_form
 FORM	*new_form(
 		FIELD	**fields)
@@ -424,6 +430,13 @@
 
 /* ./frm_driver.c */
 
+#undef _nc_get_fieldbuffer
+void	_nc_get_fieldbuffer(
+		FORM	*form, 
+		FIELD	*field, 
+		char	*buf)
+		{ /* void */ }
+
 #undef _nc_Position_Form_Cursor
 int	_nc_Position_Form_Cursor(
 		FORM	*form)
@@ -683,9 +696,23 @@
   }
 enumARG;
 
+typedef struct
+  {
+    char **kwds;
+    int ccase;
+    int cunique;
+  }
+enumParams;
+
 #undef TYPE_ENUM
 FIELDTYPE *TYPE_ENUM;
 
+/* ./fty_generic.c */
+
+#undef _nc_fty_generic
+void	_nc_fty_generic(void)
+		{ /* void */ }
+
 /* ./fty_int.c */
 
 typedef struct
@@ -696,6 +723,14 @@
   }
 integerARG;
 
+typedef struct
+  {
+    int precision;
+    long low;
+    long high;
+  }
+integerPARM;
+
 #undef TYPE_INTEGER
 FIELDTYPE *TYPE_INTEGER;
 
@@ -716,6 +751,14 @@
   }
 numericARG;
 
+typedef struct
+  {
+    int precision;
+    double low;
+    double high;
+  }
+thisPARM;
+
 #undef TYPE_NUMERIC
 FIELDTYPE *TYPE_NUMERIC;
 
diff -Naur ncurses-5.7.orig/form/llib-lformt ncurses-5.7/form/llib-lformt
--- ncurses-5.7.orig/form/llib-lformt	1969-12-31 19:00:00.000000000 -0500
+++ ncurses-5.7/form/llib-lformt	2011-01-08 18:13:50.451157254 -0500
@@ -0,0 +1,777 @@
+/****************************************************************************
+ * 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.                                                           *
+ ****************************************************************************/
+
+/****************************************************************************
+ *  Author: Thomas E. Dickey       2010                                     *
+ ****************************************************************************/
+/* LINTLIBRARY */
+
+/* ./f_trace.c */
+
+#include <form.priv.h>
+
+#undef _nc_retrace_field_ptr
+FIELD	**_nc_retrace_field_ptr(
+		FIELD	**code)
+		{ return(*(FIELD ***)0); }
+
+#undef _nc_retrace_field
+FIELD	*_nc_retrace_field(
+		FIELD	*code)
+		{ return(*(FIELD **)0); }
+
+#undef _nc_retrace_field_type
+FIELDTYPE *_nc_retrace_field_type(
+		FIELDTYPE *code)
+		{ return(*(FIELDTYPE **)0); }
+
+#undef _nc_retrace_form
+FORM	*_nc_retrace_form(
+		FORM	*code)
+		{ return(*(FORM **)0); }
+
+#undef _nc_retrace_form_hook
+Form_Hook _nc_retrace_form_hook(
+		Form_Hook code)
+		{ return(*(Form_Hook *)0); }
+
+/* ./fld_arg.c */
+
+#undef set_fieldtype_arg
+int	set_fieldtype_arg(
+		FIELDTYPE *typ, 
+		void	*(*const make_arg)(
+		va_list	*p1), 
+		void	*(*const copy_arg)(
+		const void *p1), 
+		void	(*const free_arg)(
+		void	*p1))
+		{ return(*(int *)0); }
+
+#undef field_arg
+void	*field_arg(
+		const FIELD *field)
+		{ return(*(void **)0); }
+
+/* ./fld_attr.c */
+
+#undef set_field_fore
+int	set_field_fore(
+		FIELD	*field, 
+		chtype	attr)
+		{ return(*(int *)0); }
+
+#undef field_fore
+chtype	field_fore(
+		const FIELD *field)
+		{ return(*(chtype *)0); }
+
+#undef set_field_back
+int	set_field_back(
+		FIELD	*field, 
+		chtype	attr)
+		{ return(*(int *)0); }
+
+#undef field_back
+chtype	field_back(
+		const FIELD *field)
+		{ return(*(chtype *)0); }
+
+/* ./fld_current.c */
+
+#undef set_current_field
+int	set_current_field(
+		FORM	*form, 
+		FIELD	*field)
+		{ return(*(int *)0); }
+
+#undef current_field
+FIELD	*current_field(
+		const FORM *form)
+		{ return(*(FIELD **)0); }
+
+#undef field_index
+int	field_index(
+		const FIELD *field)
+		{ return(*(int *)0); }
+
+/* ./fld_def.c */
+
+#undef _nc_Default_Field
+FIELD	*_nc_Default_Field;
+
+#undef _nc_Make_Argument
+TypeArgument *_nc_Make_Argument(
+		const FIELDTYPE *typ, 
+		va_list	*ap, 
+		int	*err)
+		{ return(*(TypeArgument **)0); }
+
+#undef _nc_Copy_Argument
+TypeArgument *_nc_Copy_Argument(
+		const FIELDTYPE *typ, 
+		const TypeArgument *argp, 
+		int	*err)
+		{ return(*(TypeArgument **)0); }
+
+#undef _nc_Free_Argument
+void	_nc_Free_Argument(
+		const FIELDTYPE *typ, 
+		TypeArgument *argp)
+		{ /* void */ }
+
+#undef _nc_Copy_Type
+NCURSES_BOOL _nc_Copy_Type(
+		FIELD	*dst, 
+		FIELD const *src)
+		{ return(*(NCURSES_BOOL *)0); }
+
+#undef _nc_Free_Type
+void	_nc_Free_Type(
+		FIELD	*field)
+		{ /* void */ }
+
+#undef new_field
+FIELD	*new_field(
+		int	rows, 
+		int	cols, 
+		int	frow, 
+		int	fcol, 
+		int	nrow, 
+		int	nbuf)
+		{ return(*(FIELD **)0); }
+
+#undef free_field
+int	free_field(
+		FIELD	*field)
+		{ return(*(int *)0); }
+
+/* ./fld_dup.c */
+
+#undef dup_field
+FIELD	*dup_field(
+		FIELD	*field, 
+		int	frow, 
+		int	fcol)
+		{ return(*(FIELD **)0); }
+
+/* ./fld_ftchoice.c */
+
+#undef set_fieldtype_choice
+int	set_fieldtype_choice(
+		FIELDTYPE *typ, 
+		NCURSES_BOOL (*const next_choice)(
+		FIELD	*p1, 
+		const void *p2), 
+		NCURSES_BOOL (*const prev_choice)(
+		FIELD	*p1, 
+		const void *p2))
+		{ return(*(int *)0); }
+
+/* ./fld_ftlink.c */
+
+#undef link_fieldtype
+FIELDTYPE *link_fieldtype(
+		FIELDTYPE *type1, 
+		FIELDTYPE *type2)
+		{ return(*(FIELDTYPE **)0); }
+
+/* ./fld_info.c */
+
+#undef field_info
+int	field_info(
+		const FIELD *field, 
+		int	*rows, 
+		int	*cols, 
+		int	*frow, 
+		int	*fcol, 
+		int	*nrow, 
+		int	*nbuf)
+		{ return(*(int *)0); }
+
+#undef dynamic_field_info
+int	dynamic_field_info(
+		const FIELD *field, 
+		int	*drows, 
+		int	*dcols, 
+		int	*maxgrow)
+		{ return(*(int *)0); }
+
+/* ./fld_just.c */
+
+#undef set_field_just
+int	set_field_just(
+		FIELD	*field, 
+		int	just)
+		{ return(*(int *)0); }
+
+#undef field_just
+int	field_just(
+		const FIELD *field)
+		{ return(*(int *)0); }
+
+/* ./fld_link.c */
+
+#undef link_field
+FIELD	*link_field(
+		FIELD	*field, 
+		int	frow, 
+		int	fcol)
+		{ return(*(FIELD **)0); }
+
+/* ./fld_max.c */
+
+#undef set_max_field
+int	set_max_field(
+		FIELD	*field, 
+		int	maxgrow)
+		{ return(*(int *)0); }
+
+/* ./fld_move.c */
+
+#undef move_field
+int	move_field(
+		FIELD	*field, 
+		int	frow, 
+		int	fcol)
+		{ return(*(int *)0); }
+
+/* ./fld_newftyp.c */
+
+#undef _nc_Default_FieldType
+FIELDTYPE *_nc_Default_FieldType;
+
+#undef new_fieldtype
+FIELDTYPE *new_fieldtype(
+		NCURSES_BOOL (*const field_check)(
+		FIELD	*p1, 
+		const void *p2), 
+		NCURSES_BOOL (*const char_check)(
+		int	p1, 
+		const void *p2))
+		{ return(*(FIELDTYPE **)0); }
+
+#undef free_fieldtype
+int	free_fieldtype(
+		FIELDTYPE *typ)
+		{ return(*(int *)0); }
+
+/* ./fld_opts.c */
+
+#undef set_field_opts
+int	set_field_opts(
+		FIELD	*field, 
+		Field_Options opts)
+		{ return(*(int *)0); }
+
+#undef field_opts
+Field_Options field_opts(
+		const FIELD *field)
+		{ return(*(Field_Options *)0); }
+
+#undef field_opts_on
+int	field_opts_on(
+		FIELD	*field, 
+		Field_Options opts)
+		{ return(*(int *)0); }
+
+#undef field_opts_off
+int	field_opts_off(
+		FIELD	*field, 
+		Field_Options opts)
+		{ return(*(int *)0); }
+
+/* ./fld_pad.c */
+
+#undef set_field_pad
+int	set_field_pad(
+		FIELD	*field, 
+		int	ch)
+		{ return(*(int *)0); }
+
+#undef field_pad
+int	field_pad(
+		const FIELD *field)
+		{ return(*(int *)0); }
+
+/* ./fld_page.c */
+
+#undef set_new_page
+int	set_new_page(
+		FIELD	*field, 
+		NCURSES_BOOL new_page_flag)
+		{ return(*(int *)0); }
+
+#undef new_page
+NCURSES_BOOL new_page(
+		const FIELD *field)
+		{ return(*(NCURSES_BOOL *)0); }
+
+/* ./fld_stat.c */
+
+#undef set_field_status
+int	set_field_status(
+		FIELD	*field, 
+		NCURSES_BOOL status)
+		{ return(*(int *)0); }
+
+#undef field_status
+NCURSES_BOOL field_status(
+		const FIELD *field)
+		{ return(*(NCURSES_BOOL *)0); }
+
+/* ./fld_type.c */
+
+#undef set_field_type
+int	set_field_type(
+		FIELD	*field, 
+		FIELDTYPE *type, 
+		...)
+		{ return(*(int *)0); }
+
+#undef field_type
+FIELDTYPE *field_type(
+		const FIELD *field)
+		{ return(*(FIELDTYPE **)0); }
+
+/* ./fld_user.c */
+
+#undef set_field_userptr
+int	set_field_userptr(
+		FIELD	*field, 
+		void	*usrptr)
+		{ return(*(int *)0); }
+
+#undef field_userptr
+void	*field_userptr(
+		const FIELD *field)
+		{ return(*(void **)0); }
+
+/* ./frm_cursor.c */
+
+#undef pos_form_cursor
+int	pos_form_cursor(
+		FORM	*form)
+		{ return(*(int *)0); }
+
+/* ./frm_data.c */
+
+#undef data_behind
+NCURSES_BOOL data_behind(
+		const FORM *form)
+		{ return(*(NCURSES_BOOL *)0); }
+
+#undef data_ahead
+NCURSES_BOOL data_ahead(
+		const FORM *form)
+		{ return(*(NCURSES_BOOL *)0); }
+
+/* ./frm_def.c */
+
+#undef _nc_Default_Form
+FORM	*_nc_Default_Form;
+
+#undef new_form_sp
+FORM	*new_form_sp(
+		SCREEN	*sp, 
+		FIELD	**fields)
+		{ return(*(FORM **)0); }
+
+#undef new_form
+FORM	*new_form(
+		FIELD	**fields)
+		{ return(*(FORM **)0); }
+
+#undef free_form
+int	free_form(
+		FORM	*form)
+		{ return(*(int *)0); }
+
+#undef set_form_fields
+int	set_form_fields(
+		FORM	*form, 
+		FIELD	**fields)
+		{ return(*(int *)0); }
+
+#undef form_fields
+FIELD	**form_fields(
+		const FORM *form)
+		{ return(*(FIELD ***)0); }
+
+#undef field_count
+int	field_count(
+		const FORM *form)
+		{ return(*(int *)0); }
+
+/* ./frm_driver.c */
+
+#undef _nc_get_fieldbuffer
+void	_nc_get_fieldbuffer(
+		FORM	*form, 
+		FIELD	*field, 
+		char	*buf)
+		{ /* void */ }
+
+#undef _nc_Position_Form_Cursor
+int	_nc_Position_Form_Cursor(
+		FORM	*form)
+		{ return(*(int *)0); }
+
+#undef _nc_Refresh_Current_Field
+int	_nc_Refresh_Current_Field(
+		FORM	*form)
+		{ return(*(int *)0); }
+
+#undef _nc_Synchronize_Attributes
+int	_nc_Synchronize_Attributes(
+		FIELD	*field)
+		{ return(*(int *)0); }
+
+#undef _nc_Synchronize_Options
+int	_nc_Synchronize_Options(
+		FIELD	*field, 
+		Field_Options newopts)
+		{ return(*(int *)0); }
+
+#undef _nc_Set_Current_Field
+int	_nc_Set_Current_Field(
+		FORM	*form, 
+		FIELD	*newfield)
+		{ return(*(int *)0); }
+
+#undef _nc_Internal_Validation
+NCURSES_BOOL _nc_Internal_Validation(
+		FORM	*form)
+		{ return(*(NCURSES_BOOL *)0); }
+
+#undef _nc_First_Active_Field
+FIELD	*_nc_First_Active_Field(
+		FORM	*form)
+		{ return(*(FIELD **)0); }
+
+#undef _nc_Set_Form_Page
+int	_nc_Set_Form_Page(
+		FORM	*form, 
+		int	page, 
+		FIELD	*field)
+		{ return(*(int *)0); }
+
+typedef struct
+{
+  int keycode; 
+  int (*cmd) (FORM *); 
+}
+Binding_Info;
+
+#undef form_driver
+int	form_driver(
+		FORM	*form, 
+		int	c)
+		{ return(*(int *)0); }
+
+#undef set_field_buffer
+int	set_field_buffer(
+		FIELD	*field, 
+		int	buffer, 
+		const char *value)
+		{ return(*(int *)0); }
+
+#undef field_buffer
+char	*field_buffer(
+		const FIELD *field, 
+		int	buffer)
+		{ return(*(char **)0); }
+
+/* ./frm_hook.c */
+
+#undef set_field_init
+int	set_field_init(
+		FORM	*form, 
+		Form_Hook func)
+		{ return(*(int *)0); }
+
+#undef field_init
+Form_Hook field_init(
+		const FORM *form)
+		{ return(*(Form_Hook *)0); }
+
+#undef set_field_term
+int	set_field_term(
+		FORM	*form, 
+		Form_Hook func)
+		{ return(*(int *)0); }
+
+#undef field_term
+Form_Hook field_term(
+		const FORM *form)
+		{ return(*(Form_Hook *)0); }
+
+#undef set_form_init
+int	set_form_init(
+		FORM	*form, 
+		Form_Hook func)
+		{ return(*(int *)0); }
+
+#undef form_init
+Form_Hook form_init(
+		const FORM *form)
+		{ return(*(Form_Hook *)0); }
+
+#undef set_form_term
+int	set_form_term(
+		FORM	*form, 
+		Form_Hook func)
+		{ return(*(int *)0); }
+
+#undef form_term
+Form_Hook form_term(
+		const FORM *form)
+		{ return(*(Form_Hook *)0); }
+
+/* ./frm_opts.c */
+
+#undef set_form_opts
+int	set_form_opts(
+		FORM	*form, 
+		Form_Options opts)
+		{ return(*(int *)0); }
+
+#undef form_opts
+Form_Options form_opts(
+		const FORM *form)
+		{ return(*(Form_Options *)0); }
+
+#undef form_opts_on
+int	form_opts_on(
+		FORM	*form, 
+		Form_Options opts)
+		{ return(*(int *)0); }
+
+#undef form_opts_off
+int	form_opts_off(
+		FORM	*form, 
+		Form_Options opts)
+		{ return(*(int *)0); }
+
+/* ./frm_page.c */
+
+#undef set_form_page
+int	set_form_page(
+		FORM	*form, 
+		int	page)
+		{ return(*(int *)0); }
+
+#undef form_page
+int	form_page(
+		const FORM *form)
+		{ return(*(int *)0); }
+
+/* ./frm_post.c */
+
+#undef post_form
+int	post_form(
+		FORM	*form)
+		{ return(*(int *)0); }
+
+#undef unpost_form
+int	unpost_form(
+		FORM	*form)
+		{ return(*(int *)0); }
+
+/* ./frm_req_name.c */
+
+#undef form_request_name
+const char *form_request_name(
+		int	request)
+		{ return(*(const char **)0); }
+
+#undef form_request_by_name
+int	form_request_by_name(
+		const char *str)
+		{ return(*(int *)0); }
+
+/* ./frm_scale.c */
+
+#undef scale_form
+int	scale_form(
+		const FORM *form, 
+		int	*rows, 
+		int	*cols)
+		{ return(*(int *)0); }
+
+/* ./frm_sub.c */
+
+#undef set_form_sub
+int	set_form_sub(
+		FORM	*form, 
+		WINDOW	*win)
+		{ return(*(int *)0); }
+
+#undef form_sub
+WINDOW	*form_sub(
+		const FORM *form)
+		{ return(*(WINDOW **)0); }
+
+/* ./frm_user.c */
+
+#undef set_form_userptr
+int	set_form_userptr(
+		FORM	*form, 
+		void	*usrptr)
+		{ return(*(int *)0); }
+
+#undef form_userptr
+void	*form_userptr(
+		const FORM *form)
+		{ return(*(void **)0); }
+
+/* ./frm_win.c */
+
+#undef set_form_win
+int	set_form_win(
+		FORM	*form, 
+		WINDOW	*win)
+		{ return(*(int *)0); }
+
+#undef form_win
+WINDOW	*form_win(
+		const FORM *form)
+		{ return(*(WINDOW **)0); }
+
+/* ./fty_alnum.c */
+
+typedef struct
+  {
+    int width;
+  }
+alnumARG;
+
+#undef TYPE_ALNUM
+FIELDTYPE *TYPE_ALNUM;
+
+/* ./fty_alpha.c */
+
+typedef struct
+  {
+    int width;
+  }
+alphaARG;
+
+#undef TYPE_ALPHA
+FIELDTYPE *TYPE_ALPHA;
+
+/* ./fty_enum.c */
+
+typedef struct
+  {
+    char **kwds;
+    int count;
+    NCURSES_BOOL checkcase;
+    NCURSES_BOOL checkunique;
+  }
+enumARG;
+
+typedef struct
+  {
+    char **kwds;
+    int ccase;
+    int cunique;
+  }
+enumParams;
+
+#undef TYPE_ENUM
+FIELDTYPE *TYPE_ENUM;
+
+/* ./fty_generic.c */
+
+#undef _nc_fty_generic
+void	_nc_fty_generic(void)
+		{ /* void */ }
+
+/* ./fty_int.c */
+
+typedef struct
+  {
+    int precision;
+    long low;
+    long high;
+  }
+integerARG;
+
+typedef struct
+  {
+    int precision;
+    long low;
+    long high;
+  }
+integerPARM;
+
+#undef TYPE_INTEGER
+FIELDTYPE *TYPE_INTEGER;
+
+/* ./fty_ipv4.c */
+#undef TYPE_IPV4
+FIELDTYPE *TYPE_IPV4;
+
+/* ./fty_num.c */
+
+#include <locale.h>
+
+typedef struct
+  {
+    int precision;
+    double low;
+    double high;
+    struct lconv *L;
+  }
+numericARG;
+
+typedef struct
+  {
+    int precision;
+    double low;
+    double high;
+  }
+thisPARM;
+
+#undef TYPE_NUMERIC
+FIELDTYPE *TYPE_NUMERIC;
+
+/* ./fty_regex.c */
+
+#include <regex.h>
+
+typedef struct
+  {
+    regex_t *pRegExp;
+    unsigned long *refCount;
+  }
+RegExp_Arg;
+
+#undef TYPE_REGEXP
+FIELDTYPE *TYPE_REGEXP;
diff -Naur ncurses-5.7.orig/form/llib-lformtw ncurses-5.7/form/llib-lformtw
--- ncurses-5.7.orig/form/llib-lformtw	1969-12-31 19:00:00.000000000 -0500
+++ ncurses-5.7/form/llib-lformtw	2011-01-08 18:13:50.451157254 -0500
@@ -0,0 +1,783 @@
+/****************************************************************************
+ * 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.                                                           *
+ ****************************************************************************/
+
+/****************************************************************************
+ *  Author: Thomas E. Dickey       2010                                     *
+ ****************************************************************************/
+/* LINTLIBRARY */
+
+/* ./f_trace.c */
+
+#include <form.priv.h>
+
+#undef _nc_retrace_field_ptr
+FIELD	**_nc_retrace_field_ptr(
+		FIELD	**code)
+		{ return(*(FIELD ***)0); }
+
+#undef _nc_retrace_field
+FIELD	*_nc_retrace_field(
+		FIELD	*code)
+		{ return(*(FIELD **)0); }
+
+#undef _nc_retrace_field_type
+FIELDTYPE *_nc_retrace_field_type(
+		FIELDTYPE *code)
+		{ return(*(FIELDTYPE **)0); }
+
+#undef _nc_retrace_form
+FORM	*_nc_retrace_form(
+		FORM	*code)
+		{ return(*(FORM **)0); }
+
+#undef _nc_retrace_form_hook
+Form_Hook _nc_retrace_form_hook(
+		Form_Hook code)
+		{ return(*(Form_Hook *)0); }
+
+/* ./fld_arg.c */
+
+#undef set_fieldtype_arg
+int	set_fieldtype_arg(
+		FIELDTYPE *typ, 
+		void	*(*const make_arg)(
+		va_list	*p1), 
+		void	*(*const copy_arg)(
+		const void *p1), 
+		void	(*const free_arg)(
+		void	*p1))
+		{ return(*(int *)0); }
+
+#undef field_arg
+void	*field_arg(
+		const FIELD *field)
+		{ return(*(void **)0); }
+
+/* ./fld_attr.c */
+
+#undef set_field_fore
+int	set_field_fore(
+		FIELD	*field, 
+		chtype	attr)
+		{ return(*(int *)0); }
+
+#undef field_fore
+chtype	field_fore(
+		const FIELD *field)
+		{ return(*(chtype *)0); }
+
+#undef set_field_back
+int	set_field_back(
+		FIELD	*field, 
+		chtype	attr)
+		{ return(*(int *)0); }
+
+#undef field_back
+chtype	field_back(
+		const FIELD *field)
+		{ return(*(chtype *)0); }
+
+/* ./fld_current.c */
+
+#undef set_current_field
+int	set_current_field(
+		FORM	*form, 
+		FIELD	*field)
+		{ return(*(int *)0); }
+
+#undef current_field
+FIELD	*current_field(
+		const FORM *form)
+		{ return(*(FIELD **)0); }
+
+#undef field_index
+int	field_index(
+		const FIELD *field)
+		{ return(*(int *)0); }
+
+/* ./fld_def.c */
+
+#undef _nc_Default_Field
+FIELD	*_nc_Default_Field;
+
+#undef _nc_Make_Argument
+TypeArgument *_nc_Make_Argument(
+		const FIELDTYPE *typ, 
+		va_list	*ap, 
+		int	*err)
+		{ return(*(TypeArgument **)0); }
+
+#undef _nc_Copy_Argument
+TypeArgument *_nc_Copy_Argument(
+		const FIELDTYPE *typ, 
+		const TypeArgument *argp, 
+		int	*err)
+		{ return(*(TypeArgument **)0); }
+
+#undef _nc_Free_Argument
+void	_nc_Free_Argument(
+		const FIELDTYPE *typ, 
+		TypeArgument *argp)
+		{ /* void */ }
+
+#undef _nc_Copy_Type
+NCURSES_BOOL _nc_Copy_Type(
+		FIELD	*dst, 
+		FIELD const *src)
+		{ return(*(NCURSES_BOOL *)0); }
+
+#undef _nc_Free_Type
+void	_nc_Free_Type(
+		FIELD	*field)
+		{ /* void */ }
+
+#undef new_field
+FIELD	*new_field(
+		int	rows, 
+		int	cols, 
+		int	frow, 
+		int	fcol, 
+		int	nrow, 
+		int	nbuf)
+		{ return(*(FIELD **)0); }
+
+#undef free_field
+int	free_field(
+		FIELD	*field)
+		{ return(*(int *)0); }
+
+/* ./fld_dup.c */
+
+#undef dup_field
+FIELD	*dup_field(
+		FIELD	*field, 
+		int	frow, 
+		int	fcol)
+		{ return(*(FIELD **)0); }
+
+/* ./fld_ftchoice.c */
+
+#undef set_fieldtype_choice
+int	set_fieldtype_choice(
+		FIELDTYPE *typ, 
+		NCURSES_BOOL (*const next_choice)(
+		FIELD	*p1, 
+		const void *p2), 
+		NCURSES_BOOL (*const prev_choice)(
+		FIELD	*p1, 
+		const void *p2))
+		{ return(*(int *)0); }
+
+/* ./fld_ftlink.c */
+
+#undef link_fieldtype
+FIELDTYPE *link_fieldtype(
+		FIELDTYPE *type1, 
+		FIELDTYPE *type2)
+		{ return(*(FIELDTYPE **)0); }
+
+/* ./fld_info.c */
+
+#undef field_info
+int	field_info(
+		const FIELD *field, 
+		int	*rows, 
+		int	*cols, 
+		int	*frow, 
+		int	*fcol, 
+		int	*nrow, 
+		int	*nbuf)
+		{ return(*(int *)0); }
+
+#undef dynamic_field_info
+int	dynamic_field_info(
+		const FIELD *field, 
+		int	*drows, 
+		int	*dcols, 
+		int	*maxgrow)
+		{ return(*(int *)0); }
+
+/* ./fld_just.c */
+
+#undef set_field_just
+int	set_field_just(
+		FIELD	*field, 
+		int	just)
+		{ return(*(int *)0); }
+
+#undef field_just
+int	field_just(
+		const FIELD *field)
+		{ return(*(int *)0); }
+
+/* ./fld_link.c */
+
+#undef link_field
+FIELD	*link_field(
+		FIELD	*field, 
+		int	frow, 
+		int	fcol)
+		{ return(*(FIELD **)0); }
+
+/* ./fld_max.c */
+
+#undef set_max_field
+int	set_max_field(
+		FIELD	*field, 
+		int	maxgrow)
+		{ return(*(int *)0); }
+
+/* ./fld_move.c */
+
+#undef move_field
+int	move_field(
+		FIELD	*field, 
+		int	frow, 
+		int	fcol)
+		{ return(*(int *)0); }
+
+/* ./fld_newftyp.c */
+
+#undef _nc_Default_FieldType
+FIELDTYPE *_nc_Default_FieldType;
+
+#undef new_fieldtype
+FIELDTYPE *new_fieldtype(
+		NCURSES_BOOL (*const field_check)(
+		FIELD	*p1, 
+		const void *p2), 
+		NCURSES_BOOL (*const char_check)(
+		int	p1, 
+		const void *p2))
+		{ return(*(FIELDTYPE **)0); }
+
+#undef free_fieldtype
+int	free_fieldtype(
+		FIELDTYPE *typ)
+		{ return(*(int *)0); }
+
+/* ./fld_opts.c */
+
+#undef set_field_opts
+int	set_field_opts(
+		FIELD	*field, 
+		Field_Options opts)
+		{ return(*(int *)0); }
+
+#undef field_opts
+Field_Options field_opts(
+		const FIELD *field)
+		{ return(*(Field_Options *)0); }
+
+#undef field_opts_on
+int	field_opts_on(
+		FIELD	*field, 
+		Field_Options opts)
+		{ return(*(int *)0); }
+
+#undef field_opts_off
+int	field_opts_off(
+		FIELD	*field, 
+		Field_Options opts)
+		{ return(*(int *)0); }
+
+/* ./fld_pad.c */
+
+#undef set_field_pad
+int	set_field_pad(
+		FIELD	*field, 
+		int	ch)
+		{ return(*(int *)0); }
+
+#undef field_pad
+int	field_pad(
+		const FIELD *field)
+		{ return(*(int *)0); }
+
+/* ./fld_page.c */
+
+#undef set_new_page
+int	set_new_page(
+		FIELD	*field, 
+		NCURSES_BOOL new_page_flag)
+		{ return(*(int *)0); }
+
+#undef new_page
+NCURSES_BOOL new_page(
+		const FIELD *field)
+		{ return(*(NCURSES_BOOL *)0); }
+
+/* ./fld_stat.c */
+
+#undef set_field_status
+int	set_field_status(
+		FIELD	*field, 
+		NCURSES_BOOL status)
+		{ return(*(int *)0); }
+
+#undef field_status
+NCURSES_BOOL field_status(
+		const FIELD *field)
+		{ return(*(NCURSES_BOOL *)0); }
+
+/* ./fld_type.c */
+
+#undef set_field_type
+int	set_field_type(
+		FIELD	*field, 
+		FIELDTYPE *type, 
+		...)
+		{ return(*(int *)0); }
+
+#undef field_type
+FIELDTYPE *field_type(
+		const FIELD *field)
+		{ return(*(FIELDTYPE **)0); }
+
+/* ./fld_user.c */
+
+#undef set_field_userptr
+int	set_field_userptr(
+		FIELD	*field, 
+		void	*usrptr)
+		{ return(*(int *)0); }
+
+#undef field_userptr
+void	*field_userptr(
+		const FIELD *field)
+		{ return(*(void **)0); }
+
+/* ./frm_cursor.c */
+
+#undef pos_form_cursor
+int	pos_form_cursor(
+		FORM	*form)
+		{ return(*(int *)0); }
+
+/* ./frm_data.c */
+
+#undef data_behind
+NCURSES_BOOL data_behind(
+		const FORM *form)
+		{ return(*(NCURSES_BOOL *)0); }
+
+#undef data_ahead
+NCURSES_BOOL data_ahead(
+		const FORM *form)
+		{ return(*(NCURSES_BOOL *)0); }
+
+/* ./frm_def.c */
+
+#undef _nc_Default_Form
+FORM	*_nc_Default_Form;
+
+#undef new_form_sp
+FORM	*new_form_sp(
+		SCREEN	*sp, 
+		FIELD	**fields)
+		{ return(*(FORM **)0); }
+
+#undef new_form
+FORM	*new_form(
+		FIELD	**fields)
+		{ return(*(FORM **)0); }
+
+#undef free_form
+int	free_form(
+		FORM	*form)
+		{ return(*(int *)0); }
+
+#undef set_form_fields
+int	set_form_fields(
+		FORM	*form, 
+		FIELD	**fields)
+		{ return(*(int *)0); }
+
+#undef form_fields
+FIELD	**form_fields(
+		const FORM *form)
+		{ return(*(FIELD ***)0); }
+
+#undef field_count
+int	field_count(
+		const FORM *form)
+		{ return(*(int *)0); }
+
+/* ./frm_driver.c */
+
+#undef _nc_get_fieldbuffer
+void	_nc_get_fieldbuffer(
+		FORM	*form, 
+		FIELD	*field, 
+		cchar_t	*buf)
+		{ /* void */ }
+
+#undef _nc_Position_Form_Cursor
+int	_nc_Position_Form_Cursor(
+		FORM	*form)
+		{ return(*(int *)0); }
+
+#undef _nc_Refresh_Current_Field
+int	_nc_Refresh_Current_Field(
+		FORM	*form)
+		{ return(*(int *)0); }
+
+#undef _nc_Synchronize_Attributes
+int	_nc_Synchronize_Attributes(
+		FIELD	*field)
+		{ return(*(int *)0); }
+
+#undef _nc_Synchronize_Options
+int	_nc_Synchronize_Options(
+		FIELD	*field, 
+		Field_Options newopts)
+		{ return(*(int *)0); }
+
+#undef _nc_Set_Current_Field
+int	_nc_Set_Current_Field(
+		FORM	*form, 
+		FIELD	*newfield)
+		{ return(*(int *)0); }
+
+#undef _nc_Internal_Validation
+NCURSES_BOOL _nc_Internal_Validation(
+		FORM	*form)
+		{ return(*(NCURSES_BOOL *)0); }
+
+#undef _nc_First_Active_Field
+FIELD	*_nc_First_Active_Field(
+		FORM	*form)
+		{ return(*(FIELD **)0); }
+
+#undef _nc_Set_Form_Page
+int	_nc_Set_Form_Page(
+		FORM	*form, 
+		int	page, 
+		FIELD	*field)
+		{ return(*(int *)0); }
+
+typedef struct
+{
+  int keycode; 
+  int (*cmd) (FORM *); 
+}
+Binding_Info;
+
+#undef form_driver
+int	form_driver(
+		FORM	*form, 
+		int	c)
+		{ return(*(int *)0); }
+
+#undef set_field_buffer
+int	set_field_buffer(
+		FIELD	*field, 
+		int	buffer, 
+		const char *value)
+		{ return(*(int *)0); }
+
+#undef field_buffer
+char	*field_buffer(
+		const FIELD *field, 
+		int	buffer)
+		{ return(*(char **)0); }
+
+#undef _nc_Widen_String
+wchar_t	*_nc_Widen_String(
+		char	*source, 
+		int	*lengthp)
+		{ return(*(wchar_t **)0); }
+
+/* ./frm_hook.c */
+
+#undef set_field_init
+int	set_field_init(
+		FORM	*form, 
+		Form_Hook func)
+		{ return(*(int *)0); }
+
+#undef field_init
+Form_Hook field_init(
+		const FORM *form)
+		{ return(*(Form_Hook *)0); }
+
+#undef set_field_term
+int	set_field_term(
+		FORM	*form, 
+		Form_Hook func)
+		{ return(*(int *)0); }
+
+#undef field_term
+Form_Hook field_term(
+		const FORM *form)
+		{ return(*(Form_Hook *)0); }
+
+#undef set_form_init
+int	set_form_init(
+		FORM	*form, 
+		Form_Hook func)
+		{ return(*(int *)0); }
+
+#undef form_init
+Form_Hook form_init(
+		const FORM *form)
+		{ return(*(Form_Hook *)0); }
+
+#undef set_form_term
+int	set_form_term(
+		FORM	*form, 
+		Form_Hook func)
+		{ return(*(int *)0); }
+
+#undef form_term
+Form_Hook form_term(
+		const FORM *form)
+		{ return(*(Form_Hook *)0); }
+
+/* ./frm_opts.c */
+
+#undef set_form_opts
+int	set_form_opts(
+		FORM	*form, 
+		Form_Options opts)
+		{ return(*(int *)0); }
+
+#undef form_opts
+Form_Options form_opts(
+		const FORM *form)
+		{ return(*(Form_Options *)0); }
+
+#undef form_opts_on
+int	form_opts_on(
+		FORM	*form, 
+		Form_Options opts)
+		{ return(*(int *)0); }
+
+#undef form_opts_off
+int	form_opts_off(
+		FORM	*form, 
+		Form_Options opts)
+		{ return(*(int *)0); }
+
+/* ./frm_page.c */
+
+#undef set_form_page
+int	set_form_page(
+		FORM	*form, 
+		int	page)
+		{ return(*(int *)0); }
+
+#undef form_page
+int	form_page(
+		const FORM *form)
+		{ return(*(int *)0); }
+
+/* ./frm_post.c */
+
+#undef post_form
+int	post_form(
+		FORM	*form)
+		{ return(*(int *)0); }
+
+#undef unpost_form
+int	unpost_form(
+		FORM	*form)
+		{ return(*(int *)0); }
+
+/* ./frm_req_name.c */
+
+#undef form_request_name
+const char *form_request_name(
+		int	request)
+		{ return(*(const char **)0); }
+
+#undef form_request_by_name
+int	form_request_by_name(
+		const char *str)
+		{ return(*(int *)0); }
+
+/* ./frm_scale.c */
+
+#undef scale_form
+int	scale_form(
+		const FORM *form, 
+		int	*rows, 
+		int	*cols)
+		{ return(*(int *)0); }
+
+/* ./frm_sub.c */
+
+#undef set_form_sub
+int	set_form_sub(
+		FORM	*form, 
+		WINDOW	*win)
+		{ return(*(int *)0); }
+
+#undef form_sub
+WINDOW	*form_sub(
+		const FORM *form)
+		{ return(*(WINDOW **)0); }
+
+/* ./frm_user.c */
+
+#undef set_form_userptr
+int	set_form_userptr(
+		FORM	*form, 
+		void	*usrptr)
+		{ return(*(int *)0); }
+
+#undef form_userptr
+void	*form_userptr(
+		const FORM *form)
+		{ return(*(void **)0); }
+
+/* ./frm_win.c */
+
+#undef set_form_win
+int	set_form_win(
+		FORM	*form, 
+		WINDOW	*win)
+		{ return(*(int *)0); }
+
+#undef form_win
+WINDOW	*form_win(
+		const FORM *form)
+		{ return(*(WINDOW **)0); }
+
+/* ./fty_alnum.c */
+
+typedef struct
+  {
+    int width;
+  }
+alnumARG;
+
+#undef TYPE_ALNUM
+FIELDTYPE *TYPE_ALNUM;
+
+/* ./fty_alpha.c */
+
+typedef struct
+  {
+    int width;
+  }
+alphaARG;
+
+#undef TYPE_ALPHA
+FIELDTYPE *TYPE_ALPHA;
+
+/* ./fty_enum.c */
+
+typedef struct
+  {
+    char **kwds;
+    int count;
+    NCURSES_BOOL checkcase;
+    NCURSES_BOOL checkunique;
+  }
+enumARG;
+
+typedef struct
+  {
+    char **kwds;
+    int ccase;
+    int cunique;
+  }
+enumParams;
+
+#undef TYPE_ENUM
+FIELDTYPE *TYPE_ENUM;
+
+/* ./fty_generic.c */
+
+#undef _nc_fty_generic
+void	_nc_fty_generic(void)
+		{ /* void */ }
+
+/* ./fty_int.c */
+
+typedef struct
+  {
+    int precision;
+    long low;
+    long high;
+  }
+integerARG;
+
+typedef struct
+  {
+    int precision;
+    long low;
+    long high;
+  }
+integerPARM;
+
+#undef TYPE_INTEGER
+FIELDTYPE *TYPE_INTEGER;
+
+/* ./fty_ipv4.c */
+#undef TYPE_IPV4
+FIELDTYPE *TYPE_IPV4;
+
+/* ./fty_num.c */
+
+#include <locale.h>
+
+typedef struct
+  {
+    int precision;
+    double low;
+    double high;
+    struct lconv *L;
+  }
+numericARG;
+
+typedef struct
+  {
+    int precision;
+    double low;
+    double high;
+  }
+thisPARM;
+
+#undef TYPE_NUMERIC
+FIELDTYPE *TYPE_NUMERIC;
+
+/* ./fty_regex.c */
+
+#include <regex.h>
+
+typedef struct
+  {
+    regex_t *pRegExp;
+    unsigned long *refCount;
+  }
+RegExp_Arg;
+
+#undef TYPE_REGEXP
+FIELDTYPE *TYPE_REGEXP;
diff -Naur ncurses-5.7.orig/form/llib-lformw ncurses-5.7/form/llib-lformw
--- ncurses-5.7.orig/form/llib-lformw	2005-03-05 14:32:57.000000000 -0500
+++ ncurses-5.7/form/llib-lformw	2011-01-08 18:13:50.451157254 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2002,2005 Free Software Foundation, Inc.                        *
+ * Copyright (c) 2002-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            *
@@ -27,13 +27,13 @@
  ****************************************************************************/
 
 /****************************************************************************
- *  Author: Thomas E. Dickey                    2002,2005                   *
+ *  Author: Thomas E. Dickey                    2002-2005,2010              *
  ****************************************************************************/
 /* LINTLIBRARY */
 
 /* ./f_trace.c */
 
-#include "form.priv.h"
+#include <form.priv.h>
 
 #undef _nc_retrace_field_ptr
 FIELD	**_nc_retrace_field_ptr(
@@ -264,7 +264,7 @@
 /* ./fld_newftyp.c */
 
 #undef _nc_Default_FieldType
-const FIELDTYPE *_nc_Default_FieldType = {0};
+FIELDTYPE *_nc_Default_FieldType;
 
 #undef new_fieldtype
 FIELDTYPE *new_fieldtype(
@@ -396,6 +396,12 @@
 #undef _nc_Default_Form
 FORM	*_nc_Default_Form;
 
+#undef new_form_sp
+FORM	*new_form_sp(
+		SCREEN	*sp, 
+		FIELD	**fields)
+		{ return(*(FORM **)0); }
+
 #undef new_form
 FORM	*new_form(
 		FIELD	**fields)
@@ -424,6 +430,13 @@
 
 /* ./frm_driver.c */
 
+#undef _nc_get_fieldbuffer
+void	_nc_get_fieldbuffer(
+		FORM	*form, 
+		FIELD	*field, 
+		cchar_t	*buf)
+		{ /* void */ }
+
 #undef _nc_Position_Form_Cursor
 int	_nc_Position_Form_Cursor(
 		FORM	*form)
@@ -689,9 +702,23 @@
   }
 enumARG;
 
+typedef struct
+  {
+    char **kwds;
+    int ccase;
+    int cunique;
+  }
+enumParams;
+
 #undef TYPE_ENUM
 FIELDTYPE *TYPE_ENUM;
 
+/* ./fty_generic.c */
+
+#undef _nc_fty_generic
+void	_nc_fty_generic(void)
+		{ /* void */ }
+
 /* ./fty_int.c */
 
 typedef struct
@@ -702,6 +729,14 @@
   }
 integerARG;
 
+typedef struct
+  {
+    int precision;
+    long low;
+    long high;
+  }
+integerPARM;
+
 #undef TYPE_INTEGER
 FIELDTYPE *TYPE_INTEGER;
 
@@ -722,6 +757,14 @@
   }
 numericARG;
 
+typedef struct
+  {
+    int precision;
+    double low;
+    double high;
+  }
+thisPARM;
+
 #undef TYPE_NUMERIC
 FIELDTYPE *TYPE_NUMERIC;
 
diff -Naur ncurses-5.7.orig/form/modules ncurses-5.7/form/modules
--- ncurses-5.7.orig/form/modules	2006-12-23 19:52:58.000000000 -0500
+++ ncurses-5.7/form/modules	2011-01-08 18:13:50.451157254 -0500
@@ -1,6 +1,6 @@
-# $Id: modules,v 1.15 2006/12/24 00:52:58 tom Exp $
+# $Id: modules,v 1.17 2010/01/23 16:26:37 tom Exp $
 ##############################################################################
-# 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 "Software"), #
@@ -28,49 +28,51 @@
 ##############################################################################
 #
 # Author: Thomas E. Dickey	1995-on
+#    and: Juergen Pfeifer       2008
 #
 
 @ base
 # Library objects
-f_trace		lib		$(srcdir)	$(FORM_PRIV_H)
-fld_arg		lib		$(srcdir)	$(FORM_PRIV_H)
-fld_attr	lib		$(srcdir)	$(FORM_PRIV_H)
-fld_current	lib		$(srcdir)	$(FORM_PRIV_H)
-fld_def		lib		$(srcdir)	$(FORM_PRIV_H)
-fld_dup		lib		$(srcdir)	$(FORM_PRIV_H)
-fld_ftchoice	lib		$(srcdir)	$(FORM_PRIV_H)
-fld_ftlink	lib		$(srcdir)	$(FORM_PRIV_H)
-fld_info	lib		$(srcdir)	$(FORM_PRIV_H)
-fld_just	lib		$(srcdir)	$(FORM_PRIV_H)
-fld_link	lib		$(srcdir)	$(FORM_PRIV_H)
-fld_max		lib		$(srcdir)	$(FORM_PRIV_H)
-fld_move	lib		$(srcdir)	$(FORM_PRIV_H)
-fld_newftyp	lib		$(srcdir)	$(FORM_PRIV_H)
-fld_opts	lib		$(srcdir)	$(FORM_PRIV_H)
-fld_pad		lib		$(srcdir)	$(FORM_PRIV_H)
-fld_page	lib		$(srcdir)	$(FORM_PRIV_H)
-fld_stat	lib		$(srcdir)	$(FORM_PRIV_H)
-fld_type	lib		$(srcdir)	$(FORM_PRIV_H)
-fld_user	lib		$(srcdir)	$(FORM_PRIV_H)
-frm_cursor	lib		$(srcdir)	$(FORM_PRIV_H)
-frm_data	lib		$(srcdir)	$(FORM_PRIV_H)
-frm_def		lib		$(srcdir)	$(FORM_PRIV_H)
-frm_driver	lib		$(srcdir)	$(FORM_PRIV_H)
-frm_hook	lib		$(srcdir)	$(FORM_PRIV_H)
-frm_opts	lib		$(srcdir)	$(FORM_PRIV_H)
-frm_page	lib		$(srcdir)	$(FORM_PRIV_H)
-frm_post	lib		$(srcdir)	$(FORM_PRIV_H)
-frm_req_name	lib		$(srcdir)	$(FORM_PRIV_H)
-frm_scale	lib		$(srcdir)	$(FORM_PRIV_H)
-frm_sub		lib		$(srcdir)	$(FORM_PRIV_H)
-frm_user	lib		$(srcdir)	$(FORM_PRIV_H)
-frm_win		lib		$(srcdir)	$(FORM_PRIV_H)
-fty_alnum	lib		$(srcdir)	$(FORM_PRIV_H)
-fty_alpha	lib		$(srcdir)	$(FORM_PRIV_H)
-fty_enum	lib		$(srcdir)	$(FORM_PRIV_H)
-fty_int		lib		$(srcdir)	$(FORM_PRIV_H)
-fty_ipv4	lib		$(srcdir)	$(FORM_PRIV_H)
-fty_num		lib		$(srcdir)	$(FORM_PRIV_H)
-fty_regex	lib		$(srcdir)	$(FORM_PRIV_H)
+f_trace		lib		$(srcdir)	$(HEADER_DEPS)
+fld_arg		lib		$(srcdir)	$(HEADER_DEPS)
+fld_attr	lib		$(srcdir)	$(HEADER_DEPS)
+fld_current	lib		$(srcdir)	$(HEADER_DEPS)
+fld_def		lib		$(srcdir)	$(HEADER_DEPS)
+fld_dup		lib		$(srcdir)	$(HEADER_DEPS)
+fld_ftchoice	lib		$(srcdir)	$(HEADER_DEPS)
+fld_ftlink	lib		$(srcdir)	$(HEADER_DEPS)
+fld_info	lib		$(srcdir)	$(HEADER_DEPS)
+fld_just	lib		$(srcdir)	$(HEADER_DEPS)
+fld_link	lib		$(srcdir)	$(HEADER_DEPS)
+fld_max		lib		$(srcdir)	$(HEADER_DEPS)
+fld_move	lib		$(srcdir)	$(HEADER_DEPS)
+fld_newftyp	lib		$(srcdir)	$(HEADER_DEPS)
+fld_opts	lib		$(srcdir)	$(HEADER_DEPS)
+fld_pad		lib		$(srcdir)	$(HEADER_DEPS)
+fld_page	lib		$(srcdir)	$(HEADER_DEPS)
+fld_stat	lib		$(srcdir)	$(HEADER_DEPS)
+fld_type	lib		$(srcdir)	$(HEADER_DEPS)
+fld_user	lib		$(srcdir)	$(HEADER_DEPS)
+frm_cursor	lib		$(srcdir)	$(HEADER_DEPS)
+frm_data	lib		$(srcdir)	$(HEADER_DEPS)
+frm_def		lib		$(srcdir)	$(HEADER_DEPS)
+frm_driver	lib		$(srcdir)	$(HEADER_DEPS)
+frm_hook	lib		$(srcdir)	$(HEADER_DEPS)
+frm_opts	lib		$(srcdir)	$(HEADER_DEPS)
+frm_page	lib		$(srcdir)	$(HEADER_DEPS)
+frm_post	lib		$(srcdir)	$(HEADER_DEPS)
+frm_req_name	lib		$(srcdir)	$(HEADER_DEPS)
+frm_scale	lib		$(srcdir)	$(HEADER_DEPS)
+frm_sub		lib		$(srcdir)	$(HEADER_DEPS)
+frm_user	lib		$(srcdir)	$(HEADER_DEPS)
+frm_win		lib		$(srcdir)	$(HEADER_DEPS)
+fty_alnum	lib		$(srcdir)	$(HEADER_DEPS)
+fty_alpha	lib		$(srcdir)	$(HEADER_DEPS)
+fty_enum	lib		$(srcdir)	$(HEADER_DEPS)
+fty_generic	lib		$(srcdir)	$(HEADER_DEPS)
+fty_int		lib		$(srcdir)	$(HEADER_DEPS)
+fty_ipv4	lib		$(srcdir)	$(HEADER_DEPS)
+fty_num		lib		$(srcdir)	$(HEADER_DEPS)
+fty_regex	lib		$(srcdir)	$(HEADER_DEPS)
 
 # vile:makemode
diff -Naur ncurses-5.7.orig/include/Caps ncurses-5.7/include/Caps
--- ncurses-5.7.orig/include/Caps	2006-05-27 11:33:04.000000000 -0400
+++ ncurses-5.7/include/Caps	2011-01-08 18:18:29.638657816 -0500
@@ -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 "Software"), #
@@ -29,7 +29,7 @@
 # Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995
 #    and: Eric S. Raymond <esr@snark.thyrsus.com>
 #
-# $Id: Caps,v 1.36 2006/05/27 15:33:04 tom Exp $
+# $Id: Caps,v 1.37 2010/12/04 18:47:13 tom Exp $
 #
 # This is the master termcap/terminfo capability table.
 #
@@ -1256,9 +1256,3 @@
 # kcmd, kend, khlp, and kf11...kf63.
 #
 #############################################################################
-#
-# The following sets edit modes for GNU EMACS
-# Local Variables:
-# case-fold-search:nil
-# truncate-lines:t
-# End:
diff -Naur ncurses-5.7.orig/include/Caps.aix4 ncurses-5.7/include/Caps.aix4
--- ncurses-5.7.orig/include/Caps.aix4	2006-05-27 11:33:04.000000000 -0400
+++ ncurses-5.7/include/Caps.aix4	2011-01-08 18:18:29.638657816 -0500
@@ -1,5 +1,5 @@
 ##############################################################################
-# Copyright (c) 2001-2002,2006 Free Software Foundation, Inc.                #
+# Copyright (c) 2001-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 "Software"), #
@@ -28,7 +28,7 @@
 #
 # Author: Thomas Dickey
 #
-# $Id: Caps.aix4,v 1.7 2006/05/27 15:33:04 tom Exp $
+# $Id: Caps.aix4,v 1.8 2010/12/04 18:47:13 tom Exp $
 #
 # This is an adaptation of ncurses' termcap/terminfo capability table, which
 # is designed to align with AIX 4.x's terminfo.
@@ -1247,9 +1247,3 @@
 # kcmd, kend, khlp, and kf11...kf63.
 #
 #############################################################################
-#
-# The following sets edit modes for GNU EMACS
-# Local Variables:
-# case-fold-search:nil
-# truncate-lines:t
-# End:
diff -Naur ncurses-5.7.orig/include/Caps.hpux11 ncurses-5.7/include/Caps.hpux11
--- ncurses-5.7.orig/include/Caps.hpux11	2006-05-27 11:33:04.000000000 -0400
+++ ncurses-5.7/include/Caps.hpux11	2011-01-08 18:18:29.638657816 -0500
@@ -1,5 +1,5 @@
 ##############################################################################
-# Copyright (c) 2002-2003,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 "Software"), #
@@ -28,7 +28,7 @@
 #
 # Author: Thomas Dickey
 #
-# $Id: Caps.hpux11,v 1.4 2006/05/27 15:33:04 tom Exp $
+# $Id: Caps.hpux11,v 1.5 2010/12/04 18:47:13 tom Exp $
 #
 # This is an adaptation of ncurses' termcap/terminfo capability table, which
 # is designed to align with HPUX 11.x's terminfo.
@@ -1270,9 +1270,3 @@
 # kcmd, kend, khlp, and kf11...kf63.
 #
 #############################################################################
-#
-# The following sets edit modes for GNU EMACS
-# Local Variables:
-# case-fold-search:nil
-# truncate-lines:t
-# End:
diff -Naur ncurses-5.7.orig/include/Caps.keys ncurses-5.7/include/Caps.keys
--- ncurses-5.7.orig/include/Caps.keys	2006-05-27 11:33:04.000000000 -0400
+++ ncurses-5.7/include/Caps.keys	2011-01-08 18:18:29.642657998 -0500
@@ -1,5 +1,5 @@
 ##############################################################################
-# Copyright (c) 2001-2002,2006 Free Software Foundation, Inc.                #
+# Copyright (c) 2001-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 "Software"), #
@@ -29,7 +29,7 @@
 # Author: Thomas Dickey
 #    and: Ilya Zakharevich
 #
-# $Id: Caps.keys,v 1.3 2006/05/27 15:33:04 tom Exp $
+# $Id: Caps.keys,v 1.4 2010/12/04 18:47:13 tom Exp $
 #
 # This is an adaptation of ncurses' termcap/terminfo capability table, which
 # is illustrates an experimental extension to describe alt-, shift- and
@@ -1346,9 +1346,3 @@
 # kcmd, kend, khlp, and kf11...kf63.
 #
 #############################################################################
-#
-# The following sets edit modes for GNU EMACS
-# Local Variables:
-# case-fold-search:nil
-# truncate-lines:t
-# End:
diff -Naur ncurses-5.7.orig/include/Caps.osf1r5 ncurses-5.7/include/Caps.osf1r5
--- ncurses-5.7.orig/include/Caps.osf1r5	2006-05-27 11:33:04.000000000 -0400
+++ ncurses-5.7/include/Caps.osf1r5	2011-01-08 18:18:29.642657998 -0500
@@ -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 "Software"), #
@@ -28,7 +28,7 @@
 #
 # Author: Thomas Dickey
 #
-# $Id: Caps.osf1r5,v 1.4 2006/05/27 15:33:04 tom Exp $
+# $Id: Caps.osf1r5,v 1.5 2010/12/04 18:47:13 tom Exp $
 #
 # This is an adaptation of ncurses' termcap/terminfo capability table, which
 # is designed to align with OSF/1 version 5 (Tru64) terminfo.
@@ -1266,9 +1266,3 @@
 # kcmd, kend, khlp, and kf11...kf63.
 #
 #############################################################################
-#
-# The following sets edit modes for GNU EMACS
-# Local Variables:
-# case-fold-search:nil
-# truncate-lines:t
-# End:
diff -Naur ncurses-5.7.orig/include/Caps.uwin ncurses-5.7/include/Caps.uwin
--- ncurses-5.7.orig/include/Caps.uwin	2006-05-27 11:33:04.000000000 -0400
+++ ncurses-5.7/include/Caps.uwin	2011-01-08 18:18:29.642657998 -0500
@@ -1,5 +1,5 @@
 ##############################################################################
-# Copyright (c) 2001-2002,2006 Free Software Foundation, Inc.                #
+# Copyright (c) 2001-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 "Software"), #
@@ -28,7 +28,7 @@
 #
 # Author: Thomas Dickey
 #
-# $Id: Caps.uwin,v 1.4 2006/05/27 15:33:04 tom Exp $
+# $Id: Caps.uwin,v 1.5 2010/12/04 18:49:20 tom Exp $
 #
 # This is an adaptation of ncurses' termcap/terminfo capability table, which
 # is designed to align with U/Win's terminfo.
@@ -1082,9 +1082,3 @@
 # kcmd, kend, khlp, and kf11...kf63.
 #
 #############################################################################
-#
-# The following sets edit modes for GNU EMACS
-# Local Variables:
-# case-fold-search:nil
-# truncate-lines:t
-# End:
diff -Naur ncurses-5.7.orig/include/MKterm.h.awk.in ncurses-5.7/include/MKterm.h.awk.in
--- ncurses-5.7.orig/include/MKterm.h.awk.in	2008-05-24 19:13:59.000000000 -0400
+++ ncurses-5.7/include/MKterm.h.awk.in	2011-01-08 18:13:50.455157267 -0500
@@ -1,7 +1,7 @@
 # vile:awkmode
 BEGIN		{
 		    print  "/****************************************************************************"
-		    print  " * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc.              *"
+		    print  " * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc.              *"
 		    print  " *                                                                          *"
 		    print  " * Permission is hereby granted, free of charge, to any person obtaining a  *"
 		    print  " * copy of this software and associated documentation files (the            *"
@@ -34,7 +34,7 @@
 		    print  "/*    and: Thomas E. Dickey                        1995-on                  */"
 		    print  "/****************************************************************************/"
 		    print  ""
-		    print  "/* $Id: MKterm.h.awk.in,v 1.50 2008/05/24 23:13:59 tom Exp $ */"
+		    print  "/* $Id: MKterm.h.awk.in,v 1.58 2010/01/09 19:53:26 tom Exp $ */"
 		    print  ""
 		    print  "/*"
 		    print  "**	term.h -- Definition of struct term"
@@ -130,11 +130,15 @@
 		    print  ""
 		    print  "#else /* !HAVE_TERMIO_H */"
 		    print  ""
+		    print  "#if __MINGW32__"
+		    print  "#  include <ncurses_mingw.h>"
+		    print  "#  define TTY struct termios"
+		    print  "#else"
 		    print  "#undef TERMIOS"
 		    print  "#include <sgtty.h>"
 		    print  "#include <sys/ioctl.h>"
 		    print  "#define TTY struct sgttyb"
-		    print  ""
+		    print  "#endif /* MINGW32 */"
 		    print  "#endif /* HAVE_TERMIO_H */"
 		    print  ""
 		    print  "#endif /* HAVE_TERMIOS_H */"
@@ -228,8 +232,16 @@
 			print  "    char *      _termname;      /* used for termname() */"
 			print  "} TERMINAL;"
 			print  ""
-			print  "#if @BROKEN_LINKER@ || @cf_cv_enable_reentrant@"
+			print  "#if @BROKEN_LINKER@ && !@cf_cv_enable_reentrant@"
+			print  "extern NCURSES_EXPORT_VAR(TERMINAL *) cur_term;"
+			print  "#elif @cf_cv_enable_reentrant@"
 			print  "NCURSES_WRAPPED_VAR(TERMINAL *, cur_term);"
+			print  "#define cur_term   NCURSES_PUBLIC_VAR(cur_term())"
+			print  "#else"
+			print  "extern NCURSES_EXPORT_VAR(TERMINAL *) cur_term;"
+			print  "#endif"
+			print  ""
+			print  "#if @BROKEN_LINKER@ || @cf_cv_enable_reentrant@"
 			print  "NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, boolnames);"
 			print  "NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, boolcodes);"
 			print  "NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, boolfnames);"
@@ -240,7 +252,6 @@
 			print  "NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, strcodes);"
 			print  "NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, strfnames);"
 			print  ""
-			print  "#define cur_term   NCURSES_PUBLIC_VAR(cur_term())"
 			print  "#define boolnames  NCURSES_PUBLIC_VAR(boolnames())"
 			print  "#define boolcodes  NCURSES_PUBLIC_VAR(boolcodes())"
 			print  "#define boolfnames NCURSES_PUBLIC_VAR(boolfnames())"
@@ -253,8 +264,6 @@
 			print  ""
 			print  "#else"
 			print  ""
-			print  "extern NCURSES_EXPORT_VAR(TERMINAL *) cur_term;"
-			print  ""
 			print  "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) boolnames[];"
 			print  "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) boolcodes[];"
 			print  "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) boolfnames[];"
@@ -300,6 +309,8 @@
 			print  "extern NCURSES_EXPORT(char *) tparm_varargs (NCURSES_CONST char *, ...);	/* special */"
 			print  "#endif"
 			print  ""
+			print  "extern NCURSES_EXPORT(char *) tiparm (const char *, ...);		/* special */"
+			print  ""
 			print  "#endif /* __NCURSES_H */"
 			print  ""
 			print  "/* termcap database emulation (XPG4 uses const only for 2nd param of tgetent) */"
@@ -312,6 +323,37 @@
 			print  "extern NCURSES_EXPORT(int) tputs (const char *, int, int (*)(int));"
 			print  "#endif /* NCURSES_TERMCAP_H_incl */"
 			print  ""
+			print  "/*"
+			print  " * Include curses.h before term.h to enable these extensions."
+			print  " */"
+			print  "#if defined(NCURSES_SP_FUNCS) && (NCURSES_SP_FUNCS != 0)"
+			print  ""
+			print  "extern NCURSES_EXPORT(char *)  NCURSES_SP_NAME(tigetstr) (SCREEN*, NCURSES_CONST char *);"
+			print  "extern NCURSES_EXPORT(int)     NCURSES_SP_NAME(putp) (SCREEN*, const char *);"
+			print  "extern NCURSES_EXPORT(int)     NCURSES_SP_NAME(tigetflag) (SCREEN*, NCURSES_CONST char *);"
+			print  "extern NCURSES_EXPORT(int)     NCURSES_SP_NAME(tigetnum) (SCREEN*, NCURSES_CONST char *);"
+			print  ""
+			print  "#if @NCURSES_TPARM_VARARGS@ /* NCURSES_TPARM_VARARGS */"
+			print  "extern NCURSES_EXPORT(char *)  NCURSES_SP_NAME(tparm) (SCREEN*, NCURSES_CONST char *, ...);	/* special */"
+			print  "#else"
+			print  "extern NCURSES_EXPORT(char *)  NCURSES_SP_NAME(tparm) (SCREEN*, NCURSES_CONST char *, long,long,long,long,long,long,long,long,long);	/* special */"
+			print  "extern NCURSES_EXPORT(char *)  NCURSES_SP_NAME(tparm_varargs) (SCREEN*, NCURSES_CONST char *, ...);	/* special */"
+			print  "#endif"
+			print  ""
+			print  "/* termcap database emulation (XPG4 uses const only for 2nd param of tgetent) */"
+			print  "extern NCURSES_EXPORT(char *)  NCURSES_SP_NAME(tgetstr) (SCREEN*, NCURSES_CONST char *, char **);"
+			print  "extern NCURSES_EXPORT(char *)  NCURSES_SP_NAME(tgoto) (SCREEN*, const char *, int, int);"
+			print  "extern NCURSES_EXPORT(int)     NCURSES_SP_NAME(tgetent) (SCREEN*, char *, const char *);"
+			print  "extern NCURSES_EXPORT(int)     NCURSES_SP_NAME(tgetflag) (SCREEN*, NCURSES_CONST char *);"
+			print  "extern NCURSES_EXPORT(int)     NCURSES_SP_NAME(tgetnum) (SCREEN*, NCURSES_CONST char *);"
+			print  "extern NCURSES_EXPORT(int)     NCURSES_SP_NAME(tputs) (SCREEN*, const char *, int, NCURSES_SP_OUTC);"
+			print  ""
+			print  "extern NCURSES_EXPORT(TERMINAL *) NCURSES_SP_NAME(set_curterm) (SCREEN*, TERMINAL *);"
+			print  "extern NCURSES_EXPORT(int)     NCURSES_SP_NAME(del_curterm) (SCREEN*, TERMINAL *);"
+			print  ""
+			print  "extern NCURSES_EXPORT(int)     NCURSES_SP_NAME(restartterm) (SCREEN*, NCURSES_CONST char *, int, int *);"
+			print  "#endif /* NCURSES_SP_FUNCS */"
+			print  ""
 			print  "#ifdef __cplusplus"
 			print  "}"
 			print  "#endif"
diff -Naur ncurses-5.7.orig/include/Makefile.in ncurses-5.7/include/Makefile.in
--- ncurses-5.7.orig/include/Makefile.in	2001-12-08 13:50:06.000000000 -0500
+++ ncurses-5.7/include/Makefile.in	2011-01-08 18:18:29.566655997 -0500
@@ -1,6 +1,6 @@
-# $Id: Makefile.in,v 1.35 2001/12/08 18:50:06 tom Exp $
+# $Id: Makefile.in,v 1.40 2010/11/27 21:45:27 tom Exp $
 ##############################################################################
-# Copyright (c) 1998,2000,2001 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 "Software"), #
@@ -40,6 +40,7 @@
 .SUFFIXES:
 
 SHELL		= /bin/sh
+VPATH		= @srcdir@
 THIS		= Makefile
 
 DESTDIR		= @DESTDIR@
@@ -54,6 +55,9 @@
 AWK		= @AWK@
 LN_S		= @LN_S@
 
+CTAGS		= @CTAGS@
+ETAGS		= @ETAGS@
+
 VERSION		= @cf_cv_rel_version@
 
 # The "Caps" file specifies the terminfo database format, as well as the list
@@ -64,6 +68,7 @@
 CONFIG_SRC = \
 	MKterm.h.awk \
 	curses.head \
+	ncurses_dll.h \
 	termcap.h \
 	unctrl.h
 
@@ -73,6 +78,7 @@
 	hashsize.h \
 	ncurses_def.h \
 	parametrized.h \
+	config.h \
 	term.h
 
 ################################################################################
@@ -104,11 +110,15 @@
 parametrized.h: $(TERMINFO_CAPS) $(srcdir)/MKparametrized.sh
 	AWK=$(AWK) sh $(srcdir)/MKparametrized.sh $(TERMINFO_CAPS) >$@
 
+# This is required by pthread.h on MinGW
+config.h:
+	touch $@
+
 tags:
-	ctags *.[ch]
+	$(CTAGS) *.[ch]
 
 @MAKE_UPPER_TAGS@TAGS:
-@MAKE_UPPER_TAGS@	etags *.[ch]
+@MAKE_UPPER_TAGS@	$(ETAGS) *.[ch]
 
 mostlyclean ::
 	-rm -f core tags TAGS *~ *.bak *.i *.ln *.atac trace
@@ -117,7 +127,7 @@
 	-rm -f $(AUTO_SRC)
 
 distclean :: clean
-	-rm -f Makefile $(CONFIG_SRC)
+	-rm -f Makefile $(CONFIG_SRC) config.h
 
 realclean :: distclean
 
diff -Naur ncurses-5.7.orig/include/capdefaults.c ncurses-5.7/include/capdefaults.c
--- ncurses-5.7.orig/include/capdefaults.c	2008-08-04 08:33:42.000000000 -0400
+++ ncurses-5.7/include/capdefaults.c	2011-01-08 18:13:50.455157267 -0500
@@ -32,7 +32,7 @@
  *     and: Thomas E. Dickey                        1996-on                 *
  ****************************************************************************/
 
-/* $Id: capdefaults.c,v 1.13 2008/08/04 12:33:42 tom Exp $ */
+/* $Id: capdefaults.c,v 1.14 2008/11/16 00:19:59 juergen Exp $ */
 
     /*
      * Compute obsolete capabilities.  The reason this is an include file is
@@ -44,11 +44,11 @@
      * postprocess_termcap().
      */
 {
-    char *sp;
+    char *strp;
     short capval;
 
 #define EXTRACT_DELAY(str) \
-    	(short) (sp = strchr(str, '*'), sp ? atoi(sp+1) : 0)
+    	(short) (strp = strchr(str, '*'), strp ? atoi(strp+1) : 0)
 
     /* current (4.4BSD) capabilities marked obsolete */
     if (VALID_STRING(carriage_return)
diff -Naur ncurses-5.7.orig/include/curses.h.in ncurses-5.7/include/curses.h.in
--- ncurses-5.7.orig/include/curses.h.in	2008-08-30 16:11:29.000000000 -0400
+++ ncurses-5.7/include/curses.h.in	2011-01-08 18:18:29.814782179 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2007,2008 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            *
@@ -32,7 +32,7 @@
  *     and: Thomas E. Dickey                        1996-on                 *
  ****************************************************************************/
 
-/* $Id: curses.h.in,v 1.187 2008/08/30 20:11:29 tom Exp $ */
+/* $Id: curses.h.in,v 1.219 2011/01/01 21:52:45 tom Exp $ */
 
 #ifndef __NCURSES_H
 #define __NCURSES_H
@@ -40,12 +40,6 @@
 #define CURSES 1
 #define CURSES_H 1
 
-/* This should be defined for the enhanced functionality to be visible.
- * However, some of the wide-character (enhanced) functionality is missing.
- * So we do not define it (yet).
-#define _XOPEN_CURSES 1
- */
-
 /* These are defined only in curses.h, and are used for conditional compiles */
 #define NCURSES_VERSION_MAJOR @NCURSES_MAJOR@
 #define NCURSES_VERSION_MINOR @NCURSES_MINOR@
@@ -110,6 +104,19 @@
 #endif
 
 /*
+ * The reentrant code relies on the opaque setting, but adds features.
+ */
+#ifndef NCURSES_REENTRANT
+#define NCURSES_REENTRANT @cf_cv_enable_reentrant@
+#endif
+
+/*
+ * Control whether bindings for interop support are added.
+ */
+#undef	NCURSES_INTEROP_FUNCS
+#define	NCURSES_INTEROP_FUNCS @NCURSES_INTEROP_FUNCS@
+
+/*
  * The internal type used for window dimensions.
  */
 #undef	NCURSES_SIZE_T
@@ -137,12 +144,24 @@
 typedef unsigned @cf_cv_typeof_mmask_t@ mmask_t;
 #endif
 
+/*
+ * We need FILE, etc.  Include this before checking any feature symbols.
+ */
 #include <stdio.h>
-#include <unctrl.h>
+
+/*
+ * With XPG4, you must define _XOPEN_SOURCE_EXTENDED, it is redundant (or
+ * conflicting) when _XOPEN_SOURCE is 500 or greater.
+ */
+#undef NCURSES_WIDECHAR
+#if defined(_XOPEN_SOURCE_EXTENDED) || defined(_XPG5)
+#define NCURSES_WIDECHAR
+#endif
+
 #include <stdarg.h>	/* we need va_list */
-#ifdef _XOPEN_SOURCE_EXTENDED
+#ifdef NCURSES_WIDECHAR
 #include <stddef.h>	/* we want wchar_t */
-#endif /* _XOPEN_SOURCE_EXTENDED */
+#endif
 
 /* X/Open and SVr4 specify that curses implements 'bool'.  However, C++ may also
  * implement it.  If so, we must use the C++ compiler's type to avoid conflict
@@ -224,9 +243,9 @@
 
 /* line graphics */
 
-#if @BROKEN_LINKER@ || @cf_cv_enable_reentrant@
+#if @BROKEN_LINKER@ || NCURSES_REENTRANT
 NCURSES_WRAPPED_VAR(chtype*, acs_map);
-#define acs_map (_nc_acs_map())
+#define acs_map NCURSES_PUBLIC_VAR(acs_map())
 #else
 extern NCURSES_EXPORT_VAR(chtype) acs_map[];
 #endif
@@ -323,7 +342,7 @@
 
 typedef	chtype	attr_t;		/* ...must be at least as wide as chtype */
 
-#ifdef _XOPEN_SOURCE_EXTENDED
+#ifdef NCURSES_WIDECHAR
 
 #if @NCURSES_LIBUTF8@
 #ifdef mblen			/* libutf8.h defines it w/o undefining first */
@@ -344,7 +363,13 @@
 typedef unsigned int wint_t@NCURSES_OK_WCHAR_T@;
 #endif
 
-#define CCHARW_MAX	5
+/*
+ * cchar_t stores an array of CCHARW_MAX wide characters.  The first is
+ * normally a spacing character.  The others are non-spacing.  If those
+ * (spacing and nonspacing) do not fill the array, a null L'\0' follows. 
+ * Otherwise, a null is assumed to follow when extracting via getcchar().
+ */
+#define CCHARW_MAX	@NCURSES_CCHARW_MAX@
 typedef struct
 {
     attr_t	attr;
@@ -357,7 +382,7 @@
 }
 cchar_t;
 
-#endif /* _XOPEN_SOURCE_EXTENDED */
+#endif /* NCURSES_WIDECHAR */
 
 #if !NCURSES_OPAQUE
 struct ldat;
@@ -409,7 +434,7 @@
 
 	NCURSES_SIZE_T _yoffset; /* real begy is _begy + _yoffset */
 
-#ifdef _XOPEN_SOURCE_EXTENDED
+#ifdef NCURSES_WIDECHAR
 	cchar_t  _bkgrnd;	/* current background char/attribute pair */
 #if @NCURSES_EXT_COLORS@
 	int	_color;		/* current color-pair for non-space character */
@@ -461,8 +486,8 @@
     _nc_event *events[1];
 } _nc_eventlist;
 
-extern NCURSES_EXPORT(int) wgetch_events(WINDOW *, _nc_eventlist *);	/* experimental */
-extern NCURSES_EXPORT(int) wgetnstr_events(WINDOW *,char *,int,_nc_eventlist *);/* experimental */
+extern NCURSES_EXPORT(int) wgetch_events (WINDOW *, _nc_eventlist *);	/* experimental */
+extern NCURSES_EXPORT(int) wgetnstr_events (WINDOW *,char *,int,_nc_eventlist *);/* experimental */
 
 #endif /* NCURSES_WGETCH_EVENTS */
 #endif /* NCURSES_EXT_FUNCS */
@@ -511,6 +536,12 @@
 #endif
 
 /*
+ * Curses uses a helper function.  Define our type for this to simplify
+ * extending it for the sp-funcs feature.
+ */
+typedef int (*NCURSES_OUTC)(int);
+
+/*
  * Function prototypes.  This is the complete X/Open Curses list of required
  * functions.  Those marked `generated' will have sources generated from the
  * macro definitions later in this file, in order to satisfy XPG4.2
@@ -646,7 +677,7 @@
 extern NCURSES_EXPORT(int) mvwinnstr (WINDOW *, int, int, char *, int);		/* generated */
 extern NCURSES_EXPORT(int) mvwinsch (WINDOW *, int, int, chtype);		/* generated */
 extern NCURSES_EXPORT(int) mvwinsnstr (WINDOW *, int, int, const char *, int);	/* generated */
-extern NCURSES_EXPORT(int) mvwinsstr (WINDOW *, int, int, const char *);		/* generated */
+extern NCURSES_EXPORT(int) mvwinsstr (WINDOW *, int, int, const char *);	/* generated */
 extern NCURSES_EXPORT(int) mvwinstr (WINDOW *, int, int, char *);		/* generated */
 extern NCURSES_EXPORT(int) mvwprintw (WINDOW*,int,int, const char *,...)	/* implemented */
 		GCC_PRINTFLIKE(4,5);
@@ -654,9 +685,9 @@
 		GCC_SCANFLIKE(4,5);
 extern NCURSES_EXPORT(int) mvwvline (WINDOW *,int, int, chtype, int);	/* generated */
 extern NCURSES_EXPORT(int) napms (int);					/* implemented */
-extern NCURSES_EXPORT(WINDOW *) newpad (int,int);				/* implemented */
+extern NCURSES_EXPORT(WINDOW *) newpad (int,int);		       	/* implemented */
 extern NCURSES_EXPORT(SCREEN *) newterm (NCURSES_CONST char *,FILE *,FILE *);	/* implemented */
-extern NCURSES_EXPORT(WINDOW *) newwin (int,int,int,int);			/* implemented */
+extern NCURSES_EXPORT(WINDOW *) newwin (int,int,int,int);	       	/* implemented */
 extern NCURSES_EXPORT(int) nl (void);					/* implemented */
 extern NCURSES_EXPORT(int) nocbreak (void);				/* implemented */
 extern NCURSES_EXPORT(int) nodelay (WINDOW *,bool);			/* implemented */
@@ -710,7 +741,7 @@
 extern NCURSES_EXPORT(int) slk_refresh (void);				/* implemented */
 extern NCURSES_EXPORT(int) slk_restore (void);				/* implemented */
 extern NCURSES_EXPORT(int) slk_set (int,const char *,int);		/* implemented */
-extern NCURSES_EXPORT(int) slk_touch (void);				/* implemented */
+extern NCURSES_EXPORT(int) slk_touch (void);	      	       		/* implemented */
 extern NCURSES_EXPORT(int) standout (void);				/* generated */
 extern NCURSES_EXPORT(int) standend (void);				/* generated */
 extern NCURSES_EXPORT(int) start_color (void);				/* implemented */
@@ -727,7 +758,7 @@
 extern NCURSES_EXPORT(int) untouchwin (WINDOW *);			/* generated */
 extern NCURSES_EXPORT(void) use_env (bool);				/* implemented */
 extern NCURSES_EXPORT(int) vidattr (chtype);				/* implemented */
-extern NCURSES_EXPORT(int) vidputs (chtype, int (*)(int));		/* implemented */
+extern NCURSES_EXPORT(int) vidputs (chtype, NCURSES_OUTC);		/* implemented */
 extern NCURSES_EXPORT(int) vline (chtype, int);				/* generated */
 extern NCURSES_EXPORT(int) vwprintw (WINDOW *, const char *,va_list);	/* implemented */
 extern NCURSES_EXPORT(int) vw_printw (WINDOW *, const char *,va_list);	/* generated */
@@ -805,6 +836,8 @@
 extern NCURSES_EXPORT(char *) tparm_varargs (NCURSES_CONST char *, ...);	/* special */
 #endif
 
+extern NCURSES_EXPORT(char *) tiparm (const char *, ...);		/* special */
+
 /*
  * These functions are not in X/Open, but we use them in macro definitions:
  */
@@ -821,7 +854,7 @@
 /*
  * vid_attr() was implemented originally based on a draft of X/Open curses.
  */
-#ifndef _XOPEN_SOURCE_EXTENDED
+#ifndef NCURSES_WIDECHAR
 #define vid_attr(a,pair,opts) vidattr(a)
 #endif
 
@@ -838,6 +871,7 @@
 extern NCURSES_EXPORT(const char *) curses_version (void);
 extern NCURSES_EXPORT(int) assume_default_colors (int, int);
 extern NCURSES_EXPORT(int) define_key (const char *, int);
+extern NCURSES_EXPORT(int) get_escdelay (void);
 extern NCURSES_EXPORT(int) key_defined (const char *);
 extern NCURSES_EXPORT(int) keyok (int, bool);
 extern NCURSES_EXPORT(int) resize_term (int, int);
@@ -856,23 +890,135 @@
  * These extensions provide access to information stored in the WINDOW even
  * when NCURSES_OPAQUE is set:
  */
-extern NCURSES_EXPORT(WINDOW *) wgetparent (const WINDOW *);	/* generated */
-extern NCURSES_EXPORT(bool) is_cleared (const WINDOW *);	/* generated */
-extern NCURSES_EXPORT(bool) is_idcok (const WINDOW *);		/* generated */
-extern NCURSES_EXPORT(bool) is_idlok (const WINDOW *);		/* generated */
-extern NCURSES_EXPORT(bool) is_immedok (const WINDOW *);	/* generated */
-extern NCURSES_EXPORT(bool) is_keypad (const WINDOW *);		/* generated */
-extern NCURSES_EXPORT(bool) is_leaveok (const WINDOW *);	/* generated */
-extern NCURSES_EXPORT(bool) is_nodelay (const WINDOW *);	/* generated */
-extern NCURSES_EXPORT(bool) is_notimeout (const WINDOW *);	/* generated */
-extern NCURSES_EXPORT(bool) is_scrollok (const WINDOW *);	/* generated */
-extern NCURSES_EXPORT(bool) is_syncok (const WINDOW *);		/* generated */
-extern NCURSES_EXPORT(int) wgetscrreg (const WINDOW *, int *, int *); /* generated */
+extern NCURSES_EXPORT(WINDOW *) wgetparent (const WINDOW *);	/* @GENERATED_EXT_FUNCS@ */
+extern NCURSES_EXPORT(bool) is_cleared (const WINDOW *);	/* @GENERATED_EXT_FUNCS@ */
+extern NCURSES_EXPORT(bool) is_idcok (const WINDOW *);		/* @GENERATED_EXT_FUNCS@ */
+extern NCURSES_EXPORT(bool) is_idlok (const WINDOW *);		/* @GENERATED_EXT_FUNCS@ */
+extern NCURSES_EXPORT(bool) is_immedok (const WINDOW *);	/* @GENERATED_EXT_FUNCS@ */
+extern NCURSES_EXPORT(bool) is_keypad (const WINDOW *);		/* @GENERATED_EXT_FUNCS@ */
+extern NCURSES_EXPORT(bool) is_leaveok (const WINDOW *);	/* @GENERATED_EXT_FUNCS@ */
+extern NCURSES_EXPORT(bool) is_nodelay (const WINDOW *);	/* @GENERATED_EXT_FUNCS@ */
+extern NCURSES_EXPORT(bool) is_notimeout (const WINDOW *);	/* @GENERATED_EXT_FUNCS@ */
+extern NCURSES_EXPORT(bool) is_pad (const WINDOW *);		/* @GENERATED_EXT_FUNCS@ */
+extern NCURSES_EXPORT(bool) is_scrollok (const WINDOW *);	/* @GENERATED_EXT_FUNCS@ */
+extern NCURSES_EXPORT(bool) is_subwin (const WINDOW *);		/* @GENERATED_EXT_FUNCS@ */
+extern NCURSES_EXPORT(bool) is_syncok (const WINDOW *);		/* @GENERATED_EXT_FUNCS@ */
+extern NCURSES_EXPORT(int) wgetscrreg (const WINDOW *, int *, int *); /* @GENERATED_EXT_FUNCS@ */
 
 #else
 #define curses_version() NCURSES_VERSION
 #endif
 
+/*
+ * Extra extension-functions, which pass a SCREEN pointer rather than using
+ * a global variable SP.
+ */
+#if @NCURSES_SP_FUNCS@
+#undef  NCURSES_SP_FUNCS
+#define NCURSES_SP_FUNCS @NCURSES_PATCH@
+#define NCURSES_SP_NAME(name) name##_sp
+
+/* Define the sp-funcs helper function */
+#define NCURSES_SP_OUTC NCURSES_SP_NAME(NCURSES_OUTC)
+typedef int (*NCURSES_SP_OUTC)(SCREEN*, int);
+
+extern NCURSES_EXPORT(SCREEN *) new_prescr (void); /* implemented:SP_FUNC */
+
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(baudrate) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(beep) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(bool) NCURSES_SP_NAME(can_change_color) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(cbreak) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(curs_set) (SCREEN*, int); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(color_content) (SCREEN*, short, short*, short*, short*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(def_prog_mode) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(def_shell_mode) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(delay_output) (SCREEN*, int); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(doupdate) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(echo) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(endwin) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(char) NCURSES_SP_NAME(erasechar) (SCREEN*);/* implemented:SP_FUNC */
+extern NCURSES_EXPORT(void) NCURSES_SP_NAME(filter) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(flash) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(flushinp) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(WINDOW *) NCURSES_SP_NAME(getwin) (SCREEN*, FILE *);			/* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(halfdelay) (SCREEN*, int); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(bool) NCURSES_SP_NAME(has_colors) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(bool) NCURSES_SP_NAME(has_ic) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(bool) NCURSES_SP_NAME(has_il) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(init_color) (SCREEN*, short, short, short, short); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(init_pair) (SCREEN*, short, short, short); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(intrflush) (SCREEN*, WINDOW*, bool);	/* implemented:SP_FUNC */
+extern NCURSES_EXPORT(bool) NCURSES_SP_NAME(isendwin) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(NCURSES_CONST char *) NCURSES_SP_NAME(keyname) (SCREEN*, int); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(char) NCURSES_SP_NAME(killchar) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(char *) NCURSES_SP_NAME(longname) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(mvcur) (SCREEN*, int, int, int, int); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(napms) (SCREEN*, int); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(WINDOW *) NCURSES_SP_NAME(newpad) (SCREEN*, int, int); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(SCREEN *) NCURSES_SP_NAME(newterm) (SCREEN*, NCURSES_CONST char *, FILE *, FILE *); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(WINDOW *) NCURSES_SP_NAME(newwin) (SCREEN*, int, int, int, int); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(nl) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(nocbreak) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(noecho) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(nonl) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(void) NCURSES_SP_NAME(noqiflush) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(noraw) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(pair_content) (SCREEN*, short, short*, short*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(void) NCURSES_SP_NAME(qiflush) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(raw) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(reset_prog_mode) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(reset_shell_mode) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(resetty) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(ripoffline) (SCREEN*, int, int (*)(WINDOW *, int));	/* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(savetty) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(scr_init) (SCREEN*, const char *); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(scr_restore) (SCREEN*, const char *); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(scr_set) (SCREEN*, const char *); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_attroff) (SCREEN*, const chtype); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_attron) (SCREEN*, const chtype); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_attrset) (SCREEN*, const chtype); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(attr_t) NCURSES_SP_NAME(slk_attr) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_attr_set) (SCREEN*, const attr_t, short, void*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_clear) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_color) (SCREEN*, short); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_init) (SCREEN*, int); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(char *) NCURSES_SP_NAME(slk_label) (SCREEN*, int); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_noutrefresh) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_refresh) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_restore) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_set) (SCREEN*, int, const char *, int); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_touch) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(start_color) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(chtype) NCURSES_SP_NAME(termattrs) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(char *) NCURSES_SP_NAME(termname) (SCREEN*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(typeahead) (SCREEN*, int); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(ungetch) (SCREEN*, int); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(void) NCURSES_SP_NAME(use_env) (SCREEN*, bool); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(vidattr) (SCREEN*, chtype);	/* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(vidputs) (SCREEN*, chtype, NCURSES_SP_OUTC); /* implemented:SP_FUNC */
+#if @NCURSES_EXT_FUNCS@
+extern NCURSES_EXPORT(char *) NCURSES_SP_NAME(keybound) (SCREEN*, int, int);	/* implemented:EXT_SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(assume_default_colors) (SCREEN*, int, int);	/* implemented:EXT_SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(define_key) (SCREEN*, const char *, int);	/* implemented:EXT_SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(get_escdelay) (SCREEN*);	/* implemented:EXT_SP_FUNC */
+extern NCURSES_EXPORT(bool) NCURSES_SP_NAME(is_term_resized) (SCREEN*, int, int);	/* implemented:EXT_SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(key_defined) (SCREEN*, const char *);	/* implemented:EXT_SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(keyok) (SCREEN*, int, bool);	/* implemented:EXT_SP_FUNC */
+extern NCURSES_EXPORT(void) NCURSES_SP_NAME(nofilter) (SCREEN*); /* implemented */	/* implemented:EXT_SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(resize_term) (SCREEN*, int, int);	/* implemented:EXT_SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(resizeterm) (SCREEN*, int, int);	/* implemented:EXT_SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(set_escdelay) (SCREEN*, int);	/* implemented:EXT_SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(set_tabsize) (SCREEN*, int);	/* implemented:EXT_SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(use_default_colors) (SCREEN*);	/* implemented:EXT_SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(use_legacy_coding) (SCREEN*, int);	/* implemented:EXT_SP_FUNC */
+#endif
+#else
+#undef  NCURSES_SP_FUNCS
+#define NCURSES_SP_FUNCS 0
+#define NCURSES_SP_NAME(name) name
+#define NCURSES_SP_OUTC NCURSES_OUTC
+#endif
+
 /* attributes */
 
 #define NCURSES_ATTR_SHIFT       8
@@ -951,7 +1097,7 @@
 
 /* It seems older SYSV curses versions define these */
 #if !NCURSES_OPAQUE
-#define getattrs(win)		((win) ? (win)->_attrs : A_NORMAL)
+#define getattrs(win)		NCURSES_CAST(int, (win) ? (win)->_attrs : A_NORMAL)
 #define getcurx(win)		((win) ? (win)->_curx : ERR)
 #define getcury(win)		((win) ? (win)->_cury : ERR)
 #define getbegx(win)		((win) ? (win)->_begx : ERR)
@@ -969,11 +1115,17 @@
 #define wattroff(win,at)	wattr_off(win, NCURSES_CAST(attr_t, at), NULL)
 
 #if !NCURSES_OPAQUE
-#if defined(_XOPEN_SOURCE_EXTENDED) && @NCURSES_EXT_COLORS@
-#define wattrset(win,at)	((win)->_color = PAIR_NUMBER(at), \
-				 (win)->_attrs = (at))
+#if defined(NCURSES_WIDECHAR) && @NCURSES_EXT_COLORS@
+#define wattrset(win,at)	((win) \
+				  ? ((win)->_color = PAIR_NUMBER(at), \
+                                     (win)->_attrs = NCURSES_CAST(attr_t, at), \
+                                     OK) \
+				  : ERR)
 #else
-#define wattrset(win,at)	((win)->_attrs = (at))
+#define wattrset(win,at)        ((win) \
+				  ? ((win)->_attrs = NCURSES_CAST(attr_t, at), \
+				     OK) \
+				  : ERR)
 #endif
 #endif /* NCURSES_OPAQUE */
 
@@ -1003,7 +1155,7 @@
  * These apply to the first 256 color pairs.
  */
 #define COLOR_PAIR(n)	NCURSES_BITS(n, 0)
-#define PAIR_NUMBER(a)	(NCURSES_CAST(int,(((a) & A_COLOR) >> NCURSES_ATTR_SHIFT)))
+#define PAIR_NUMBER(a)	(NCURSES_CAST(int,((NCURSES_CAST(unsigned long,a) & A_COLOR) >> NCURSES_ATTR_SHIFT)))
 
 /*
  * pseudo functions for standard screen
@@ -1111,17 +1263,17 @@
 #define slk_attr_on(a,v)		((v) ? ERR : slk_attron(a))
 
 #if !NCURSES_OPAQUE
-#if defined(_XOPEN_SOURCE_EXTENDED) && @NCURSES_EXT_COLORS@
+#if defined(NCURSES_WIDECHAR) && @NCURSES_EXT_COLORS@
 #define wattr_set(win,a,p,opts)		((win)->_attrs = ((a) & ~A_COLOR), \
 					 (win)->_color = (p), \
 					 OK)
 #define wattr_get(win,a,p,opts)		((void)((a) != (void *)0 && (*(a) = (win)->_attrs)), \
-					 (void)((p) != (void *)0 && (*(p) = (win)->_color)), \
+					 (void)((p) != (void *)0 && (*(p) = (short)(win)->_color)), \
 					 OK)
 #else
-#define wattr_set(win,a,p,opts)		((win)->_attrs = (((a) & ~A_COLOR) | COLOR_PAIR(p)), OK)
+#define wattr_set(win,a,p,opts)		((win)->_attrs = (((a) & ~A_COLOR) | (attr_t)COLOR_PAIR(p)), OK)
 #define wattr_get(win,a,p,opts)		((void)((a) != (void *)0 && (*(a) = (win)->_attrs)), \
-					 (void)((p) != (void *)0 && (*(p) = PAIR_NUMBER((win)->_attrs))), \
+					 (void)((p) != (void *)0 && (*(p) = (short)PAIR_NUMBER((win)->_attrs))), \
 					 OK)
 #endif
 #endif /* NCURSES_OPAQUE */
@@ -1148,16 +1300,18 @@
  */
 #if @NCURSES_EXT_FUNCS@
 #if !NCURSES_OPAQUE
-#define is_cleared(win)		((win)->_clear)
-#define is_idcok(win)		((win)->_idcok)
-#define is_idlok(win)		((win)->_idlok)
-#define is_immedok(win)		((win)->_immed)
-#define is_keypad(win)		((win)->_use_keypad)
-#define is_leaveok(win)		((win)->_leaveok)
-#define is_nodelay(win)		((win)->_delay == 0)
-#define is_notimeout(win)	((win)->_notimeout)
-#define is_scrollok(win)	((win)->_scroll)
-#define is_syncok(win)		((win)->_sync)
+#define is_cleared(win)		((win) ? (win)->_clear : FALSE)
+#define is_idcok(win)		((win) ? (win)->_idcok : FALSE)
+#define is_idlok(win)		((win) ? (win)->_idlok : FALSE)
+#define is_immedok(win)		((win) ? (win)->_immed : FALSE)
+#define is_keypad(win)		((win) ? (win)->_use_keypad : FALSE)
+#define is_leaveok(win)		((win) ? (win)->_leaveok : FALSE)
+#define is_nodelay(win)		((win) ? ((win)->_delay == 0) : FALSE)
+#define is_notimeout(win)	((win) ? (win)->_notimeout : FALSE)
+#define is_pad(win)		((win) ? ((win)->_flags & _ISPAD) != 0 : FALSE)
+#define is_scrollok(win)	((win) ? (win)->_scroll : FALSE)
+#define is_subwin(win)		((win) ? ((win)->_flags & _SUBWIN) != 0 : FALSE)
+#define is_syncok(win)		((win) ? (win)->_sync : FALSE)
 #define wgetparent(win)		((win) ? (win)->_parent : 0)
 #define wgetscrreg(win,t,b)	((win) ? (*(t) = (win)->_regtop, *(b) = (win)->_regbottom, OK) : ERR)
 #endif
@@ -1173,7 +1327,7 @@
  *	   It gives the ESC expire time in milliseconds.
  *	b. ttytype is needed for backward compatibility
  */
-#if @cf_cv_enable_reentrant@
+#if NCURSES_REENTRANT
 
 NCURSES_WRAPPED_VAR(WINDOW *, curscr);
 NCURSES_WRAPPED_VAR(WINDOW *, newscr);
diff -Naur ncurses-5.7.orig/include/curses.tail ncurses-5.7/include/curses.tail
--- ncurses-5.7.orig/include/curses.tail	2008-07-05 16:20:38.000000000 -0400
+++ ncurses-5.7/include/curses.tail	2011-01-08 18:13:50.455157267 -0500
@@ -1,4 +1,4 @@
-/* $Id: curses.tail,v 1.16 2008/07/05 20:20:38 tom Exp $ */
+/* $Id: curses.tail,v 1.20 2010/03/28 19:10:55 tom Exp $ */
 /*
  * vile:cmode:
  * This file is part of ncurses, designed to be appended after curses.h.in
@@ -94,13 +94,22 @@
 }
 MEVENT;
 
-extern NCURSES_EXPORT(int) getmouse (MEVENT *);
-extern NCURSES_EXPORT(int) ungetmouse (MEVENT *);
+extern NCURSES_EXPORT(bool)    has_mouse(void);
+extern NCURSES_EXPORT(int)     getmouse (MEVENT *);
+extern NCURSES_EXPORT(int)     ungetmouse (MEVENT *);
 extern NCURSES_EXPORT(mmask_t) mousemask (mmask_t, mmask_t *);
-extern NCURSES_EXPORT(bool) wenclose (const WINDOW *, int, int);
-extern NCURSES_EXPORT(int) mouseinterval (int);
-extern NCURSES_EXPORT(bool) wmouse_trafo (const WINDOW*, int*, int*, bool);
-extern NCURSES_EXPORT(bool) mouse_trafo (int*, int*, bool);              /* generated */
+extern NCURSES_EXPORT(bool)    wenclose (const WINDOW *, int, int);
+extern NCURSES_EXPORT(int)     mouseinterval (int);
+extern NCURSES_EXPORT(bool)    wmouse_trafo (const WINDOW*, int*, int*, bool);
+extern NCURSES_EXPORT(bool)    mouse_trafo (int*, int*, bool);              /* generated */
+
+#if NCURSES_SP_FUNCS
+extern NCURSES_EXPORT(bool)    NCURSES_SP_NAME(has_mouse) (SCREEN*);
+extern NCURSES_EXPORT(int)     NCURSES_SP_NAME(getmouse) (SCREEN*, MEVENT *);
+extern NCURSES_EXPORT(int)     NCURSES_SP_NAME(ungetmouse) (SCREEN*,MEVENT *);
+extern NCURSES_EXPORT(mmask_t) NCURSES_SP_NAME(mousemask) (SCREEN*, mmask_t, mmask_t *);
+extern NCURSES_EXPORT(int)     NCURSES_SP_NAME(mouseinterval) (SCREEN*, int);
+#endif
 
 #define mouse_trafo(y,x,to_screen) wmouse_trafo(stdscr,y,x,to_screen)
 
@@ -109,6 +118,11 @@
 extern NCURSES_EXPORT(int) mcprint (char *, int);	/* direct data to printer */
 extern NCURSES_EXPORT(int) has_key (int);		/* do we have given key? */
 
+#if NCURSES_SP_FUNCS
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(has_key) (SCREEN*, int);    /* do we have given key? */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(mcprint) (SCREEN*, char *, int);	/* direct data to printer */
+#endif
+
 /* Debugging : use with libncurses_g.a */
 
 extern NCURSES_EXPORT(void) _tracef (const char *, ...) GCC_PRINTFLIKE(1,2);
@@ -119,7 +133,7 @@
 extern NCURSES_EXPORT(char *) _tracechar (int);
 extern NCURSES_EXPORT(char *) _tracechtype (chtype);
 extern NCURSES_EXPORT(char *) _tracechtype2 (int, chtype);
-#ifdef _XOPEN_SOURCE_EXTENDED
+#ifdef NCURSES_WIDECHAR
 #define _tracech_t		_tracecchar_t
 extern NCURSES_EXPORT(char *) _tracecchar_t (const cchar_t *);
 #define _tracech_t2		_tracecchar_t2
@@ -160,6 +174,8 @@
 #define OPTIMIZE_ALL		0xff	/* enable all optimizations (dflt) */
 #endif
 
+#include <unctrl.h>
+
 #ifdef __cplusplus
 
 #ifndef NCURSES_NOMACROS
diff -Naur ncurses-5.7.orig/include/curses.wide ncurses-5.7/include/curses.wide
--- ncurses-5.7.orig/include/curses.wide	2007-03-10 12:52:23.000000000 -0500
+++ ncurses-5.7/include/curses.wide	2011-01-08 18:13:50.455157267 -0500
@@ -1,10 +1,12 @@
-/* $Id: curses.wide,v 1.34 2007/03/10 17:52:23 tom Exp $ */
+/* $Id: curses.wide,v 1.42 2010/03/30 00:39:41 tom Exp $ */
 /*
  * vile:cmode:
  * This file is part of ncurses, designed to be appended after curses.h.in
  * (see that file for the relevant copyright).
  */
-#ifdef _XOPEN_SOURCE_EXTENDED
+#define _XOPEN_CURSES 1
+
+#ifdef NCURSES_WIDECHAR
 
 extern NCURSES_EXPORT_VAR(cchar_t *) _nc_wacs;
 
@@ -60,6 +62,56 @@
 #define WACS_NEQUAL	NCURSES_WACS('|') /* not equal */
 #define WACS_STERLING	NCURSES_WACS('}') /* UK pound sign */
 
+	/* double lines */
+#define WACS_BDDB	NCURSES_WACS('C')
+#define WACS_DDBB	NCURSES_WACS('D')
+#define WACS_BBDD	NCURSES_WACS('B')
+#define WACS_DBBD	NCURSES_WACS('A')
+#define WACS_DBDD	NCURSES_WACS('G')
+#define WACS_DDDB	NCURSES_WACS('F')
+#define WACS_DDBD	NCURSES_WACS('H')
+#define WACS_BDDD	NCURSES_WACS('I')
+#define WACS_BDBD	NCURSES_WACS('R')
+#define WACS_DBDB	NCURSES_WACS('Y')
+#define WACS_DDDD	NCURSES_WACS('E')
+
+#define WACS_D_ULCORNER	WACS_BDDB
+#define WACS_D_LLCORNER	WACS_DDBB
+#define WACS_D_URCORNER	WACS_BBDD
+#define WACS_D_LRCORNER	WACS_DBBD
+#define WACS_D_RTEE	WACS_DBDD
+#define WACS_D_LTEE	WACS_DDDB
+#define WACS_D_BTEE	WACS_DDBD
+#define WACS_D_TTEE	WACS_BDDD
+#define WACS_D_HLINE	WACS_BDBD
+#define WACS_D_VLINE	WACS_DBDB
+#define WACS_D_PLUS	WACS_DDDD
+
+	/* thick lines */
+#define WACS_BTTB	NCURSES_WACS('L')
+#define WACS_TTBB	NCURSES_WACS('M')
+#define WACS_BBTT	NCURSES_WACS('K')
+#define WACS_TBBT	NCURSES_WACS('J')
+#define WACS_TBTT	NCURSES_WACS('U')
+#define WACS_TTTB	NCURSES_WACS('T')
+#define WACS_TTBT	NCURSES_WACS('V')
+#define WACS_BTTT	NCURSES_WACS('W')
+#define WACS_BTBT	NCURSES_WACS('Q')
+#define WACS_TBTB	NCURSES_WACS('X')
+#define WACS_TTTT	NCURSES_WACS('N')
+
+#define WACS_T_ULCORNER	WACS_BTTB
+#define WACS_T_LLCORNER	WACS_TTBB
+#define WACS_T_URCORNER	WACS_BBTT
+#define WACS_T_LRCORNER	WACS_TBBT
+#define WACS_T_RTEE	WACS_TBTT
+#define WACS_T_LTEE	WACS_TTTB
+#define WACS_T_BTEE	WACS_TTBT
+#define WACS_T_TTEE	WACS_BTTT
+#define WACS_T_HLINE	WACS_BTBT
+#define WACS_T_VLINE	WACS_TBTB
+#define WACS_T_PLUS	WACS_TTTT
+
 /*
  * Function prototypes for wide-character operations.
  *
@@ -138,7 +190,7 @@
 extern NCURSES_EXPORT(attr_t) term_attrs (void);			/* implemented */
 extern NCURSES_EXPORT(int) unget_wch (const wchar_t);			/* implemented */
 extern NCURSES_EXPORT(int) vid_attr (attr_t, short, void *);		/* implemented */
-extern NCURSES_EXPORT(int) vid_puts (attr_t, short, void *, int (*)(int)); /* implemented */
+extern NCURSES_EXPORT(int) vid_puts (attr_t, short, void *, NCURSES_OUTC); /* implemented */
 extern NCURSES_EXPORT(int) vline_set (const cchar_t *, int);		/* generated:WIDEC */
 extern NCURSES_EXPORT(int) wadd_wch (WINDOW *,const cchar_t *);		/* implemented */
 extern NCURSES_EXPORT(int) wadd_wchnstr (WINDOW *,const cchar_t *,int);	/* implemented */
@@ -165,6 +217,14 @@
 extern NCURSES_EXPORT(wchar_t*) wunctrl (cchar_t *);			/* implemented */
 extern NCURSES_EXPORT(int) wvline_set (WINDOW *, const cchar_t *, int);	/* implemented */
 
+#if NCURSES_SP_FUNCS
+extern NCURSES_EXPORT(attr_t) NCURSES_SP_NAME(term_attrs) (SCREEN*);		/* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(unget_wch) (SCREEN*, const wchar_t);	/* implemented:SP_FUNC */
+extern NCURSES_EXPORT(wchar_t*) NCURSES_SP_NAME(wunctrl) (SCREEN*, cchar_t *);	/* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(vid_attr) (SCREEN*, attr_t, short, void *);	/* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(vid_puts) (SCREEN*, attr_t, short, void *, NCURSES_SP_OUTC);	/* implemented:SP_FUNC */
+#endif
+
 #ifndef NCURSES_NOMACROS
 
 /*
@@ -249,4 +309,4 @@
 extern NCURSES_EXPORT(const char *) _nc_viswibuf(const wint_t *);
 #endif
 
-#endif /* _XOPEN_SOURCE_EXTENDED */
+#endif /* NCURSES_WIDECHAR */
diff -Naur ncurses-5.7.orig/include/headers ncurses-5.7/include/headers
--- ncurses-5.7.orig/include/headers	2007-01-20 14:57:04.000000000 -0500
+++ ncurses-5.7/include/headers	2011-01-08 18:13:50.455157267 -0500
@@ -1,6 +1,6 @@
-# $Id: headers,v 1.9 2007/01/20 19:57:04 Miroslav.Lichvar Exp $
+# $Id: headers,v 1.10 2009/09/05 17:46:30 tom Exp $
 ##############################################################################
-# Copyright (c) 1998-2006,2007 Free Software Foundation, Inc.                #
+# Copyright (c) 1998-2007,2009 Free Software Foundation, Inc.                #
 #                                                                            #
 # Permission is hereby granted, free of charge, to any person obtaining a    #
 # copy of this software and associated documentation files (the "Software"), #
@@ -33,7 +33,7 @@
 curses.h
 unctrl.h
 termcap.h
-$(srcdir)/ncurses_dll.h
+ncurses_dll.h
 @ ticlib
 $(srcdir)/tic.h
 $(srcdir)/term_entry.h
diff -Naur ncurses-5.7.orig/include/nc_alloc.h ncurses-5.7/include/nc_alloc.h
--- ncurses-5.7.orig/include/nc_alloc.h	2008-09-27 18:30:33.000000000 -0400
+++ ncurses-5.7/include/nc_alloc.h	2011-01-08 18:18:29.530656231 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2007,2008 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            *
@@ -29,7 +29,7 @@
 /****************************************************************************
  *  Author: Thomas E. Dickey                    1996-on                     *
  ****************************************************************************/
-/* $Id: nc_alloc.h,v 1.16 2008/09/27 22:30:33 tom Exp $ */
+/* $Id: nc_alloc.h,v 1.18 2010/11/20 22:59:49 tom Exp $ */
 
 #ifndef NC_ALLOC_included
 #define NC_ALLOC_included 1
@@ -38,7 +38,7 @@
 extern "C" {
 #endif
 
-#if HAVE_LIBDMALLOC
+#if defined(HAVE_LIBDMALLOC) && HAVE_LIBDMALLOC
 #include <string.h>
 #undef strndup		/* workaround for #define in GLIBC 2.7 */
 #include <dmalloc.h>    /* Gray Watson's library */
@@ -47,14 +47,14 @@
 #define HAVE_LIBDMALLOC 0
 #endif
 
-#if HAVE_LIBDBMALLOC
+#if defined(HAVE_LIBDBMALLOC) && HAVE_LIBDBMALLOC
 #include <dbmalloc.h>   /* Conor Cahill's library */
 #else
 #undef  HAVE_LIBDBMALLOC
 #define HAVE_LIBDBMALLOC 0
 #endif
 
-#if HAVE_LIBMPATROL
+#if defined(HAVE_LIBMPATROL) && HAVE_LIBMPATROL
 #include <mpatrol.h>    /* Memory-Patrol library */
 #else
 #undef  HAVE_LIBMPATROL
@@ -74,9 +74,15 @@
 extern NCURSES_EXPORT(void) _nc_free_tparm(void);
 extern NCURSES_EXPORT(void) _nc_leaks_dump_entry(void);
 extern NCURSES_EXPORT(void) _nc_leaks_tic(void);
-#define ExitProgram(code) _nc_free_and_exit(code)
+
+#if NCURSES_SP_FUNCS
+extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_free_and_exit)(SCREEN*, int) GCC_NORETURN;
 #endif
 
+#define ExitProgram(code) _nc_free_and_exit(code)
+
+#endif /* NO_LEAKS, etc */
+
 #ifndef HAVE_NC_FREEALL
 #define HAVE_NC_FREEALL 0
 #endif
diff -Naur ncurses-5.7.orig/include/nc_mingw.h ncurses-5.7/include/nc_mingw.h
--- ncurses-5.7.orig/include/nc_mingw.h	1969-12-31 19:00:00.000000000 -0500
+++ ncurses-5.7/include/nc_mingw.h	2011-01-08 18:18:29.298657141 -0500
@@ -0,0 +1,69 @@
+/****************************************************************************
+ * Copyright (c) 2008-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            *
+ * "Software"), to deal in the Software without restriction, including      *
+ * without limitation the rights to use, copy, modify, merge, publish,      *
+ * distribute, distribute with modifications, sublicense, and/or sell       *
+ * copies of the Software, and to permit persons to whom the Software is    *
+ * furnished to do so, subject to the following conditions:                 *
+ *                                                                          *
+ * The above copyright notice and this permission notice shall be included  *
+ * in all copies or substantial portions of the Software.                   *
+ *                                                                          *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
+ *                                                                          *
+ * Except as contained in this notice, the name(s) of the above copyright   *
+ * holders shall not be used in advertising or otherwise to promote the     *
+ * sale, use or other dealings in this Software without prior written       *
+ * authorization.                                                           *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Author: Thomas Dickey, 2008-on                                           * 
+ *                                                                          *
+ ****************************************************************************/
+
+/* $Id: nc_mingw.h,v 1.3 2010/09/25 22:16:12 juergen Exp $ */
+
+#ifndef NC_MINGW_H
+#define NC_MINGW_H 1
+
+#ifdef WINVER
+#  if WINVER < 0x0501
+#    error WINVER must at least be 0x0501
+#  endif  
+#else
+#  define WINVER 0x0501
+#endif
+#include <windows.h>
+
+#undef sleep
+#define sleep(n) Sleep((n) * 1000)
+
+#undef gettimeofday
+#define gettimeofday(tv,tz) _nc_gettimeofday(tv,tz)
+
+#include <sys/time.h>	/* for struct timeval */
+
+extern int _nc_gettimeofday(struct timeval *, void *);
+
+#undef HAVE_GETTIMEOFDAY
+#define HAVE_GETTIMEOFDAY 1
+
+#define SIGHUP  1
+#define SIGKILL 9
+#define getlogin() "username"
+
+#undef wcwidth
+#define wcwidth(ucs) _nc_wcwidth(ucs)
+extern int _nc_wcwidth(wchar_t);
+
+#endif /* NC_MINGW_H */
diff -Naur ncurses-5.7.orig/include/nc_panel.h ncurses-5.7/include/nc_panel.h
--- ncurses-5.7.orig/include/nc_panel.h	2008-08-04 14:26:46.000000000 -0400
+++ ncurses-5.7/include/nc_panel.h	2011-01-08 18:13:50.455157267 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2000,2008 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -31,9 +31,8 @@
  *     and: Thomas E. Dickey                                                *
  ****************************************************************************/
 
-
 /*
- * $Id: nc_panel.h,v 1.5 2008/08/04 18:26:46 tom Exp $
+ * $Id: nc_panel.h,v 1.7 2009/07/04 18:20:02 tom Exp $
  *
  *	nc_panel.h
  *
@@ -45,25 +44,33 @@
 #define NC_PANEL_H 1
 
 #ifdef __cplusplus
-extern "C" {
+extern "C"
+{
 #endif
 
-struct panel; /* Forward Declaration */
+  struct panel;			/* Forward Declaration */
 
-struct panelhook {
-  struct panel*   top_panel;
-  struct panel*   bottom_panel;
-  struct panel*   stdscr_pseudo_panel;
+  struct panelhook
+    {
+      struct panel *top_panel;
+      struct panel *bottom_panel;
+      struct panel *stdscr_pseudo_panel;
 #if NO_LEAKS
-  int (*destroy)(struct panel *);
+      int (*destroy) (struct panel *);
 #endif
-};
+    };
 
-/* Retrieve the panelhook of the current screen */
-extern NCURSES_EXPORT(struct panelhook*) _nc_panelhook (void);
+  struct screen;		/* Forward declaration */
+/* Retrieve the panelhook of the specified screen */
+  extern NCURSES_EXPORT(struct panelhook *)
+    _nc_panelhook (void);
+#if NCURSES_SP_FUNCS
+  extern NCURSES_EXPORT(struct panelhook *)
+    NCURSES_SP_NAME(_nc_panelhook) (SCREEN *);
+#endif
 
 #ifdef __cplusplus
 }
 #endif
 
-#endif /* NC_PANEL_H */
+#endif				/* NC_PANEL_H */
diff -Naur ncurses-5.7.orig/include/nc_tparm.h ncurses-5.7/include/nc_tparm.h
--- ncurses-5.7.orig/include/nc_tparm.h	2006-11-25 19:49:25.000000000 -0500
+++ ncurses-5.7/include/nc_tparm.h	2011-01-08 18:18:29.746780939 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2006 Free Software Foundation, Inc.                        *
+ * Copyright (c) 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            *
@@ -30,13 +30,19 @@
  *  Author: Thomas E. Dickey                        2006                    *
  ****************************************************************************/
 
-/* $Id: nc_tparm.h,v 1.4 2006/11/26 00:49:25 tom Exp $ */
+/* $Id: nc_tparm.h,v 1.5 2010/12/25 20:27:22 tom Exp $ */
+
+#ifndef NC_TPARM_included
+#define NC_TPARM_included 1
 
 /*
  * Cast parameters past the formatting-string for tparm() to match the
  * assumption of the varargs code.
  */
+#ifndef TPARM_ARG
 #define TPARM_ARG long
+#endif
+
 #define TPARM_N(n) (TPARM_ARG)(n)
 
 #define TPARM_9(a,b,c,d,e,f,g,h,i,j) tparm(a,TPARM_N(b),TPARM_N(c),TPARM_N(d),TPARM_N(e),TPARM_N(f),TPARM_N(g),TPARM_N(h),TPARM_N(i),TPARM_N(j))
@@ -63,3 +69,5 @@
 #define TPARM_1(a,b) TPARM_2(a,b,0)
 #define TPARM_0(a) TPARM_1(a,0)
 #endif
+
+#endif /* NC_TPARM_included */
diff -Naur ncurses-5.7.orig/include/ncurses_defs ncurses-5.7/include/ncurses_defs
--- ncurses-5.7.orig/include/ncurses_defs	2008-09-06 11:57:41.000000000 -0400
+++ ncurses-5.7/include/ncurses_defs	2011-01-08 18:18:29.570656837 -0500
@@ -1,6 +1,6 @@
-# $Id: ncurses_defs,v 1.40 2008/09/06 15:57:41 tom Exp $
+# $Id: ncurses_defs,v 1.44 2010/11/28 00:13:09 tom Exp $
 ##############################################################################
-# Copyright (c) 2000-2007,2008 Free Software Foundation, Inc.                #
+# Copyright (c) 2000-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 "Software"), #
@@ -115,6 +115,7 @@
 HAVE_SETBUFFER
 HAVE_SETUPTERM	1
 HAVE_SETVBUF
+HAVE_SGTTY_H
 HAVE_SIGACTION
 HAVE_SIGVEC
 HAVE_SIZECHANGE
@@ -140,6 +141,7 @@
 HAVE_TERMIO_H
 HAVE_TERMNAME	1
 HAVE_TERM_H	1
+HAVE_TERM_ENTRY_H	1
 HAVE_TGETENT	1
 HAVE_TIGETNUM	1
 HAVE_TIGETSTR	1
@@ -171,7 +173,6 @@
 NCURSES_EXT_FUNCS
 NCURSES_NO_PADDING
 NCURSES_PATHSEP	':'
-NDEBUG
 NEED_PTEM_H
 NO_LEAKS
 PURE_TERMINFO
@@ -195,6 +196,7 @@
 USE_LINKS
 USE_MY_MEMMOVE
 USE_OK_BCOPY
+USE_PTHREADS_EINTR
 USE_RCS_IDS
 USE_REENTRANT
 USE_SAFE_SPRINTF
diff -Naur ncurses-5.7.orig/include/ncurses_dll.h ncurses-5.7/include/ncurses_dll.h
--- ncurses-5.7.orig/include/ncurses_dll.h	2007-03-10 14:21:49.000000000 -0500
+++ ncurses-5.7/include/ncurses_dll.h	1969-12-31 19:00:00.000000000 -0500
@@ -1,86 +0,0 @@
-/****************************************************************************
- * Copyright (c) 1998-2006,2007 Free Software Foundation, Inc.              *
- *                                                                          *
- * Permission is hereby granted, free of charge, to any person obtaining a  *
- * copy of this software and associated documentation files (the            *
- * "Software"), to deal in the Software without restriction, including      *
- * without limitation the rights to use, copy, modify, merge, publish,      *
- * distribute, distribute with modifications, sublicense, and/or sell       *
- * copies of the Software, and to permit persons to whom the Software is    *
- * furnished to do so, subject to the following conditions:                 *
- *                                                                          *
- * The above copyright notice and this permission notice shall be included  *
- * in all copies or substantial portions of the Software.                   *
- *                                                                          *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
- * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
- * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
- * THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
- *                                                                          *
- * Except as contained in this notice, the name(s) of the above copyright   *
- * holders shall not be used in advertising or otherwise to promote the     *
- * sale, use or other dealings in this Software without prior written       *
- * authorization.                                                           *
- ****************************************************************************/
-/* $Id: ncurses_dll.h,v 1.6 2007/03/10 19:21:49 tom Exp $ */
-
-#ifndef NCURSES_DLL_H_incl
-#define NCURSES_DLL_H_incl 1
-
-/* no longer needed on cygwin or mingw, thanks to auto-import       */
-/* but this structure may be useful at some point for an MSVC build */
-/* so, for now unconditionally define the important flags           */
-/* "the right way" for proper static and dll+auto-import behavior   */
-#undef NCURSES_DLL
-#define NCURSES_STATIC
-
-#if defined(__CYGWIN__)
-#  if defined(NCURSES_DLL)
-#    if defined(NCURSES_STATIC)
-#      undef NCURSES_STATIC
-#    endif
-#  endif
-#  undef NCURSES_IMPEXP
-#  undef NCURSES_API
-#  undef NCURSES_EXPORT
-#  undef NCURSES_EXPORT_VAR
-#  if defined(NCURSES_DLL)
-/* building a DLL */
-#    define NCURSES_IMPEXP __declspec(dllexport)
-#  elif defined(NCURSES_STATIC)
-/* building or linking to a static library */
-#    define NCURSES_IMPEXP /* nothing */
-#  else
-/* linking to the DLL */
-#    define NCURSES_IMPEXP __declspec(dllimport)
-#  endif
-#  define NCURSES_API __cdecl
-#  define NCURSES_EXPORT(type) NCURSES_IMPEXP type NCURSES_API
-#  define NCURSES_EXPORT_VAR(type) NCURSES_IMPEXP type
-#endif
-
-/* Take care of non-cygwin platforms */
-#if !defined(NCURSES_IMPEXP)
-#  define NCURSES_IMPEXP /* nothing */
-#endif
-#if !defined(NCURSES_API)
-#  define NCURSES_API /* nothing */
-#endif
-#if !defined(NCURSES_EXPORT)
-#  define NCURSES_EXPORT(type) NCURSES_IMPEXP type NCURSES_API
-#endif
-#if !defined(NCURSES_EXPORT_VAR)
-#  define NCURSES_EXPORT_VAR(type) NCURSES_IMPEXP type
-#endif
-
-/*
- * For reentrant code, we map the various global variables into SCREEN by
- * using functions to access them.
- */
-#define NCURSES_PUBLIC_VAR(name) _nc_##name
-#define NCURSES_WRAPPED_VAR(type,name) extern type NCURSES_PUBLIC_VAR(name)(void)
-
-#endif /* NCURSES_DLL_H_incl */
diff -Naur ncurses-5.7.orig/include/ncurses_dll.h.in ncurses-5.7/include/ncurses_dll.h.in
--- ncurses-5.7.orig/include/ncurses_dll.h.in	1969-12-31 19:00:00.000000000 -0500
+++ ncurses-5.7/include/ncurses_dll.h.in	2011-01-08 18:13:50.455157267 -0500
@@ -0,0 +1,86 @@
+/****************************************************************************
+ * Copyright (c) 1998-2007,2009 Free Software Foundation, Inc.              *
+ *                                                                          *
+ * Permission is hereby granted, free of charge, to any person obtaining a  *
+ * copy of this software and associated documentation files (the            *
+ * "Software"), to deal in the Software without restriction, including      *
+ * without limitation the rights to use, copy, modify, merge, publish,      *
+ * distribute, distribute with modifications, sublicense, and/or sell       *
+ * copies of the Software, and to permit persons to whom the Software is    *
+ * furnished to do so, subject to the following conditions:                 *
+ *                                                                          *
+ * The above copyright notice and this permission notice shall be included  *
+ * in all copies or substantial portions of the Software.                   *
+ *                                                                          *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
+ *                                                                          *
+ * Except as contained in this notice, the name(s) of the above copyright   *
+ * holders shall not be used in advertising or otherwise to promote the     *
+ * sale, use or other dealings in this Software without prior written       *
+ * authorization.                                                           *
+ ****************************************************************************/
+/* $Id: ncurses_dll.h.in,v 1.8 2009/04/04 22:26:27 tom Exp $ */
+
+#ifndef NCURSES_DLL_H_incl
+#define NCURSES_DLL_H_incl 1
+
+/*
+ * For reentrant code, we map the various global variables into SCREEN by
+ * using functions to access them.
+ */
+#define NCURSES_PUBLIC_VAR(name) @NCURSES_WRAP_PREFIX@##name
+#define NCURSES_WRAPPED_VAR(type,name) extern type NCURSES_PUBLIC_VAR(name)(void)
+
+/* no longer needed on cygwin or mingw, thanks to auto-import       */
+/* but this structure may be useful at some point for an MSVC build */
+/* so, for now unconditionally define the important flags           */
+/* "the right way" for proper static and dll+auto-import behavior   */
+#undef NCURSES_DLL
+#define NCURSES_STATIC
+
+#if defined(__CYGWIN__) || defined(__MINGW32__)
+#  if defined(NCURSES_DLL)
+#    if defined(NCURSES_STATIC)
+#      undef NCURSES_STATIC
+#    endif
+#  endif
+#  undef NCURSES_IMPEXP
+#  undef NCURSES_API
+#  undef NCURSES_EXPORT
+#  undef NCURSES_EXPORT_VAR
+#  if defined(NCURSES_DLL)
+/* building a DLL */
+#    define NCURSES_IMPEXP __declspec(dllexport)
+#  elif defined(NCURSES_STATIC)
+/* building or linking to a static library */
+#    define NCURSES_IMPEXP /* nothing */
+#  else
+/* linking to the DLL */
+#    define NCURSES_IMPEXP __declspec(dllimport)
+#  endif
+#  define NCURSES_API __cdecl
+#  define NCURSES_EXPORT(type) NCURSES_IMPEXP type NCURSES_API
+#  define NCURSES_EXPORT_VAR(type) NCURSES_IMPEXP type
+#endif
+
+/* Take care of non-cygwin platforms */
+#if !defined(NCURSES_IMPEXP)
+#  define NCURSES_IMPEXP /* nothing */
+#endif
+#if !defined(NCURSES_API)
+#  define NCURSES_API /* nothing */
+#endif
+#if !defined(NCURSES_EXPORT)
+#  define NCURSES_EXPORT(type) NCURSES_IMPEXP type NCURSES_API
+#endif
+#if !defined(NCURSES_EXPORT_VAR)
+#  define NCURSES_EXPORT_VAR(type) NCURSES_IMPEXP type
+#endif
+
+#endif /* NCURSES_DLL_H_incl */
diff -Naur ncurses-5.7.orig/include/ncurses_mingw.h ncurses-5.7/include/ncurses_mingw.h
--- ncurses-5.7.orig/include/ncurses_mingw.h	1969-12-31 19:00:00.000000000 -0500
+++ ncurses-5.7/include/ncurses_mingw.h	2011-01-08 18:13:50.455157267 -0500
@@ -0,0 +1,164 @@
+/****************************************************************************
+ * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc.              *
+ *                                                                          *
+ * Permission is hereby granted, free of charge, to any person obtaining a  *
+ * copy of this software and associated documentation files (the            *
+ * "Software"), to deal in the Software without restriction, including      *
+ * without limitation the rights to use, copy, modify, merge, publish,      *
+ * distribute, distribute with modifications, sublicense, and/or sell       *
+ * copies of the Software, and to permit persons to whom the Software is    *
+ * furnished to do so, subject to the following conditions:                 *
+ *                                                                          *
+ * The above copyright notice and this permission notice shall be included  *
+ * in all copies or substantial portions of the Software.                   *
+ *                                                                          *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
+ *                                                                          *
+ * Except as contained in this notice, the name(s) of the above copyright   *
+ * holders shall not be used in advertising or otherwise to promote the     *
+ * sale, use or other dealings in this Software without prior written       *
+ * authorization.                                                           *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Author: Juergen Pfeifer, 2008-on                                         * 
+ *                                                                          *
+ ****************************************************************************/
+
+/* $Id: ncurses_mingw.h,v 1.1 2008/12/14 19:22:16 juergen Exp $ */
+
+/*
+ * This is a placholder up to now and describes what needs to be implemented
+ * to support I/O to external terminals with ncurses on the Windows OS.
+ */
+
+#if __MINGW32__
+#ifndef _NC_MINGWH
+#define _NC_MINGWH
+
+#define USE_CONSOLE_DRIVER 1
+
+#undef  TERMIOS
+#define TERMIOS 1
+
+#define InvalidHandle ((TERM_HANDLE)-1)
+#define InvalidConsoleHandle(s) ((s)==InvalidHandle)
+
+typedef unsigned char cc_t;
+typedef unsigned int  speed_t;
+typedef unsigned int  tcflag_t;
+
+#define NCCS 32
+struct termios
+{
+  tcflag_t   c_iflag;     /* input mode         */
+  tcflag_t   c_oflag;     /* output mode        */
+  tcflag_t   c_cflag;     /* control mode       */
+  tcflag_t   c_lflag;     /* local mode         */
+  cc_t       c_line;      /* line discipline    */
+  cc_t       c_cc[NCCS];  /* control characters */
+  speed_t    c_ispeed;    /* input speed        */
+  speed_t    c_ospeed;    /* c_ospeed           */
+};
+
+/* c_cc chars */
+#define VINTR     0
+#define VQUIT     1
+#define VERASE    2
+#define VKILL     3
+#define VEOF      4
+#define VTIME     5
+#define VMIN      6
+
+/* c_iflag bits */
+#define ISTRIP	0000040
+#define INLCR	0000100
+#define IGNCR	0000200
+#define ICRNL	0000400
+#define BRKINT	0000002
+#define PARMRK	0000010
+#define IXON	0002000
+#define IGNBRK	0000001
+#define IGNPAR	0000004
+#define INPCK	0000020
+#define IXOFF	0010000
+
+/* c_oflag bits */
+#define OPOST	0000001
+
+/* c_cflag bit meaning */
+#define CBAUD	   0010017
+#define CSIZE	   0000060
+#define CS8	   0000060
+#define B0	   0000000
+#define B50	   0000001
+#define B75	   0000002
+#define B110	   0000003
+#define B134	   0000004
+#define B150	   0000005
+#define B200	   0000006
+#define B300	   0000007
+#define B600	   0000010
+#define B1200	   0000011
+#define B1800	   0000012
+#define B2400	   0000013
+#define B4800	   0000014
+#define B9600	   0000015
+#define CLOCAL	   0004000
+#define CREAD	   0000200
+#define CSTOPB	   0000100
+#define HUPCL	   0002000
+#define PARENB	   0000400
+#define PARODD	   0001000
+
+/* c_lflag bits */
+#define ECHO	0000010
+#define ECHONL	0000100
+#define ISIG	0000001
+#define IEXTEN	0100000
+#define ICANON	0000002
+#define NOFLSH	0000200
+#define ECHOE	0000020
+#define ECHOK	0000040
+
+/* tcflush() */
+#define	TCIFLUSH	0
+
+/* tcsetattr uses these */
+#define	TCSADRAIN	1
+
+/* ioctls */
+#define TCGETA		0x5405
+#define TCFLSH		0x540B
+#define TIOCGWINSZ	0x5413
+
+extern int _nc_mingw_ioctl(int fd, long int request, struct termios* arg);
+extern void _nc_set_term_driver(void* term);
+
+#ifndef cfgetospeed
+#define cfgetospeed(t) ((t)->c_cflag & CBAUD)
+#endif
+
+#ifndef tcsetattr
+#define tcsetattr(fd, cmd, arg) _nc_mingw_ioctl(fd, cmd, arg)
+#endif
+
+#ifndef tcgetattr
+#define tcgetattr(fd, arg) _nc_mingw_ioctl(fd, TCGETA, arg)
+#endif
+
+#ifndef tcflush
+#define tcflush(fd, arg) _nc_mingw_ioctl(fd, TCFLSH, arg)
+#endif
+
+#undef  ttyname
+#define ttyname(fd) NULL
+
+#endif
+#endif
diff -Naur ncurses-5.7.orig/include/term_entry.h ncurses-5.7/include/term_entry.h
--- ncurses-5.7.orig/include/term_entry.h	2008-08-16 12:16:03.000000000 -0400
+++ ncurses-5.7/include/term_entry.h	2011-01-08 18:13:50.459156922 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2005,2008 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -32,7 +32,7 @@
  *     and: Thomas E. Dickey                        1998-on                 *
  ****************************************************************************/
 
-/* $Id: term_entry.h,v 1.35 2008/08/16 16:16:03 tom Exp $ */
+/* $Id: term_entry.h,v 1.37 2009/07/11 16:52:29 tom Exp $ */
 
 /*
  *	term_entry.h -- interface to entry-manipulation code
@@ -81,12 +81,18 @@
 #define EXT_NAMES(tp,i,limit,index,table) table[i]
 #endif
 
-#define NUM_EXT_NAMES(tp) ((tp)->ext_Booleans + (tp)->ext_Numbers + (tp)->ext_Strings)
+#define NUM_EXT_NAMES(tp) (unsigned) ((tp)->ext_Booleans + (tp)->ext_Numbers + (tp)->ext_Strings)
 
 #define for_each_boolean(n,tp) for(n = 0; n < NUM_BOOLEANS(tp); n++)
 #define for_each_number(n,tp)  for(n = 0; n < NUM_NUMBERS(tp);  n++)
 #define for_each_string(n,tp)  for(n = 0; n < NUM_STRINGS(tp);  n++)
 
+#if NCURSES_XNAMES
+#define for_each_ext_boolean(n,tp) for(n = BOOLCOUNT; n < NUM_BOOLEANS(tp); n++)
+#define for_each_ext_number(n,tp)  for(n = NUMCOUNT; n < NUM_NUMBERS(tp);  n++)
+#define for_each_ext_string(n,tp)  for(n = STRCOUNT; n < NUM_STRINGS(tp);  n++)
+#endif
+
 #define ExtBoolname(tp,i,names) EXT_NAMES(tp, i, BOOLCOUNT, (i - (tp->num_Booleans - tp->ext_Booleans)), names)
 #define ExtNumname(tp,i,names)  EXT_NAMES(tp, i, NUMCOUNT, (i - (tp->num_Numbers - tp->ext_Numbers)) + tp->ext_Booleans, names)
 #define ExtStrname(tp,i,names)  EXT_NAMES(tp, i, STRCOUNT, (i - (tp->num_Strings - tp->ext_Strings)) + (tp->ext_Numbers + tp->ext_Booleans), names)
diff -Naur ncurses-5.7.orig/include/tic.h ncurses-5.7/include/tic.h
--- ncurses-5.7.orig/include/tic.h	2007-08-11 12:12:43.000000000 -0400
+++ ncurses-5.7/include/tic.h	2011-01-08 18:13:50.459156922 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2006,2007 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2007,2009 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -33,7 +33,7 @@
  ****************************************************************************/
 
 /*
- * $Id: tic.h,v 1.62 2007/08/11 16:12:43 tom Exp $
+ * $Id: tic.h,v 1.65 2009/08/08 17:52:46 tom Exp $
  *	tic.h - Global variables and structures for the terminfo
  *			compiler.
  */
@@ -183,6 +183,8 @@
 
 #endif
 
+typedef short HashValue;
+
 	/*
 	 * The file comp_captab.c contains an array of these structures, one
 	 * per possible capability.  These are indexed by a hash table array of
@@ -193,10 +195,21 @@
 {
 	const char *nte_name;	/* name to hash on */
 	int	nte_type;	/* BOOLEAN, NUMBER or STRING */
-	short	nte_index;	/* index of associated variable in its array */
-	short	nte_link;	/* index in table of next hash, or -1 */
+	HashValue nte_index;	/* index of associated variable in its array */
+	HashValue nte_link;	/* index in table of next hash, or -1 */
 };
 
+	/*
+	 * Use this structure to hide differences between terminfo and termcap
+	 * tables.
+	 */
+typedef struct {
+	unsigned table_size;
+	const HashValue *table_data;
+	HashValue (*hash_of)(const char *);
+	int (*compare_names)(const char *, const char *);
+} HashData;
+
 struct alias
 {
 	const char	*from;
@@ -205,7 +218,8 @@
 };
 
 extern NCURSES_EXPORT(const struct name_table_entry *) _nc_get_table (bool);
-extern NCURSES_EXPORT(const short *) _nc_get_hash_table (bool);
+extern NCURSES_EXPORT(const HashData *) _nc_get_hash_info (bool);
+extern NCURSES_EXPORT(const HashValue *) _nc_get_hash_table (bool);
 extern NCURSES_EXPORT(const struct alias *) _nc_get_alias_table (bool);
 
 #define NOTFOUND	((struct name_table_entry *) 0)
@@ -244,9 +258,9 @@
 
 /* comp_hash.c: name lookup */
 extern NCURSES_EXPORT(struct name_table_entry const *) _nc_find_entry
-	(const char *, const short *);
+	(const char *, const HashValue *);
 extern NCURSES_EXPORT(struct name_table_entry const *) _nc_find_type_entry
-	(const char *, int, const struct name_table_entry *);
+	(const char *, int, bool);
 
 /* comp_scan.c: lexical analysis */
 extern NCURSES_EXPORT(int)  _nc_get_token (bool);
diff -Naur ncurses-5.7.orig/include/unctrl.h.in ncurses-5.7/include/unctrl.h.in
--- ncurses-5.7.orig/include/unctrl.h.in	2001-03-24 16:53:25.000000000 -0500
+++ ncurses-5.7/include/unctrl.h.in	2011-01-08 18:13:50.459156922 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998,2000 Free Software Foundation, Inc.                   *
+ * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -39,7 +39,7 @@
  * as ^?. Printable characters are displayed as is.
  */
 
-/* $Id: unctrl.h.in,v 1.10 2001/03/24 21:53:25 tom Exp $ */
+/* $Id: unctrl.h.in,v 1.11 2009/04/18 21:00:52 tom Exp $ */
 
 #ifndef NCURSES_UNCTRL_H_incl
 #define NCURSES_UNCTRL_H_incl	1
@@ -56,6 +56,10 @@
 #undef unctrl
 NCURSES_EXPORT(NCURSES_CONST char *) unctrl (chtype);
 
+#if @NCURSES_SP_FUNCS@
+NCURSES_EXPORT(NCURSES_CONST char *) NCURSES_SP_NAME(unctrl) (SCREEN*, chtype);
+#endif
+
 #ifdef __cplusplus
 }
 #endif
diff -Naur ncurses-5.7.orig/man/MKada_config.in ncurses-5.7/man/MKada_config.in
--- ncurses-5.7.orig/man/MKada_config.in	1969-12-31 19:00:00.000000000 -0500
+++ ncurses-5.7/man/MKada_config.in	2011-01-08 18:13:50.459156922 -0500
@@ -0,0 +1,56 @@
+.\"***************************************************************************
+.\" 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: MKada_config.in,v 1.3 2010/03/06 22:29:06 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 adacurses
+.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 -Naur ncurses-5.7.orig/man/MKncu_config.in ncurses-5.7/man/MKncu_config.in
--- ncurses-5.7.orig/man/MKncu_config.in	1969-12-31 19:00:00.000000000 -0500
+++ ncurses-5.7/man/MKncu_config.in	2011-01-08 18:13:50.459156922 -0500
@@ -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 -Naur ncurses-5.7.orig/man/Makefile.in ncurses-5.7/man/Makefile.in
--- ncurses-5.7.orig/man/Makefile.in	2007-03-31 11:54:06.000000000 -0400
+++ ncurses-5.7/man/Makefile.in	2011-01-08 18:18:29.570656837 -0500
@@ -1,6 +1,6 @@
-# $Id: Makefile.in,v 1.41 2007/03/31 15:54:06 tom Exp $
+# $Id: Makefile.in,v 1.45 2010/11/27 21:45:27 tom Exp $
 ##############################################################################
-# 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 "Software"), #
@@ -35,6 +35,7 @@
 # the top-level MANIFEST and any man/*.renames files!
 
 SHELL		= /bin/sh
+VPATH		= @srcdir@
 
 DESTDIR		= @DESTDIR@
 srcdir		= @srcdir@
@@ -52,9 +53,9 @@
 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)
@@ -77,4 +78,4 @@
 	sh $(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 -Naur ncurses-5.7.orig/man/captoinfo.1m ncurses-5.7/man/captoinfo.1m
--- ncurses-5.7.orig/man/captoinfo.1m	2007-06-02 16:40:07.000000000 -0400
+++ ncurses-5.7/man/captoinfo.1m	2011-01-08 18:18:29.642657998 -0500
@@ -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 -Naur ncurses-5.7.orig/man/clear.1 ncurses-5.7/man/clear.1
--- ncurses-5.7.orig/man/clear.1	2006-12-24 13:07:53.000000000 -0500
+++ ncurses-5.7/man/clear.1	2011-01-08 18:18:29.642657998 -0500
@@ -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,11 +26,11 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: clear.1,v 1.6 2006/12/24 18:07:53 tom Exp $
+.\" $Id: clear.1,v 1.8 2010/12/04 18:36:44 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
@@ -45,9 +45,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 -Naur ncurses-5.7.orig/man/curs_add_wch.3x ncurses-5.7/man/curs_add_wch.3x
--- ncurses-5.7.orig/man/curs_add_wch.3x	2006-12-24 10:22:22.000000000 -0500
+++ ncurses-5.7/man/curs_add_wch.3x	2011-01-08 18:18:29.642657998 -0500
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 2001-2002,2006 Free Software Foundation, Inc.              *
+.\" Copyright (c) 2001-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,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.10 2010/12/04 18:36:44 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
@@ -63,23 +66,20 @@
 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.
@@ -102,6 +102,10 @@
 .SH RETURN VALUES
 .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
@@ -127,9 +131,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 -Naur ncurses-5.7.orig/man/curs_add_wchstr.3x ncurses-5.7/man/curs_add_wchstr.3x
--- ncurses-5.7.orig/man/curs_add_wchstr.3x	2005-01-01 20:28:49.000000000 -0500
+++ ncurses-5.7/man/curs_add_wchstr.3x	2011-01-08 18:18:29.642657998 -0500
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 2002-2004,2005 Free Software Foundation, Inc.              *
+.\" Copyright (c) 2002-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_add_wchstr.3x,v 1.6 2005/01/02 01:28:49 tom Exp $
+.\" $Id: curs_add_wchstr.3x,v 1.9 2010/12/04 18:36:44 tom Exp $
 .TH curs_add_wchstr 3X ""
 .SH NAME
 \fBadd_wchstr\fR,
@@ -62,7 +62,7 @@
 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,
+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.
@@ -83,15 +83,13 @@
 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.
+.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
 All these entry points are described in the XSI Curses standard, Issue 4.
 .SH SEE ALSO
 \fBcurses\fR(3X),
 \fBcurs_addchstr\fR(3X),
 \fBcurs_addwstr\fR(3X)
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff -Naur ncurses-5.7.orig/man/curs_addch.3x ncurses-5.7/man/curs_addch.3x
--- ncurses-5.7.orig/man/curs_addch.3x	2007-06-02 16:40:07.000000000 -0400
+++ ncurses-5.7/man/curs_addch.3x	2011-01-08 18:18:29.642657998 -0500
@@ -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,12 +27,15 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: curs_addch.3x,v 1.27 2007/06/02 20:40:07 tom Exp $
+.\" $Id: curs_addch.3x,v 1.31 2010/12/04 18:36:44 tom Exp $
 .TH curs_addch 3X ""
 .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
@@ -105,7 +108,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 +121,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 +137,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.
@@ -168,14 +175,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 -Naur ncurses-5.7.orig/man/curs_addchstr.3x ncurses-5.7/man/curs_addchstr.3x
--- ncurses-5.7.orig/man/curs_addchstr.3x	2006-12-02 12:02:45.000000000 -0500
+++ ncurses-5.7/man/curs_addchstr.3x	2011-01-08 18:18:29.642657998 -0500
@@ -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_addchstr.3x,v 1.12 2006/12/02 17:02:45 tom Exp $
+.\" $Id: curs_addchstr.3x,v 1.15 2010/12/04 18:36:44 tom Exp $
 .TH curs_addchstr 3X ""
 .na
 .hy 0
@@ -38,7 +38,7 @@
 \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
@@ -63,7 +63,7 @@
 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
+If \fBn\fR=\fB\-1\fR then the whole string 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
@@ -81,6 +81,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
 Note that all routines except \fBwaddchnstr\fR may be macros.
 .SH PORTABILITY
@@ -91,9 +95,3 @@
 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 -Naur ncurses-5.7.orig/man/curs_addstr.3x ncurses-5.7/man/curs_addstr.3x
--- ncurses-5.7.orig/man/curs_addstr.3x	2005-05-15 12:17:14.000000000 -0400
+++ ncurses-5.7/man/curs_addstr.3x	2011-01-08 18:18:29.642657998 -0500
@@ -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_addstr.3x,v 1.13 2005/05/15 16:17:14 tom Exp $
+.\" $Id: curs_addstr.3x,v 1.16 2010/12/04 18:36:44 tom Exp $
 .TH curs_addstr 3X ""
 .na
 .hy 0
@@ -38,7 +38,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
@@ -67,7 +67,7 @@
 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,
+If \fIn\fR is \-1, then the entire string will be added,
 up to the maximum number of characters that will fit on the line,
 or until a terminating null is reached.
 .SH RETURN VALUE
@@ -80,6 +80,10 @@
 if the window pointer is null or
 if the string pointer is null or
 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.
@@ -89,9 +93,3 @@
 are not yet detected.
 .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:
diff -Naur ncurses-5.7.orig/man/curs_addwstr.3x ncurses-5.7/man/curs_addwstr.3x
--- ncurses-5.7.orig/man/curs_addwstr.3x	2006-02-25 15:59:08.000000000 -0500
+++ ncurses-5.7/man/curs_addwstr.3x	2011-01-08 18:18:29.642657998 -0500
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 2002-2005,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_addwstr.3x,v 1.7 2006/02/25 20:59:08 tom Exp $
+.\" $Id: curs_addwstr.3x,v 1.10 2010/12/04 18:36:44 tom Exp $
 .TH curs_addwstr 3X ""
 .na
 .hy 0
@@ -74,11 +74,15 @@
 .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,
+If \fIn\fR is \-1, then the entire string will be added,
 up to the maximum number of characters that will fit on the line,
 or until a terminating null is reached.
 .SH RETURN VALUES
 All routines return the integer \fBERR\fR upon failure and \fBOK\fR on success.
+.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.
 .SH PORTABILITY
@@ -86,9 +90,3 @@
 .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 -Naur ncurses-5.7.orig/man/curs_attr.3x ncurses-5.7/man/curs_attr.3x
--- ncurses-5.7.orig/man/curs_attr.3x	2007-03-17 16:30:33.000000000 -0400
+++ ncurses-5.7/man/curs_attr.3x	2011-01-08 18:18:29.642657998 -0500
@@ -1,6 +1,6 @@
 '\" t
 .\"***************************************************************************
-.\" Copyright (c) 1998-2006,2007 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            *
@@ -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.36 2010/12/04 18:36:44 tom Exp $
 .TH curs_attr 3X ""
 .na
 .hy 0
@@ -56,7 +56,7 @@
 \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
@@ -152,7 +152,7 @@
 .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
+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
@@ -223,6 +223,7 @@
 when changing the attributes.
 Use \fBtouchwin\fR to force the screen to match the updated attributes.
 .PP
+.ne 9
 .TS
 center ;
 l l .
@@ -252,19 +253,18 @@
 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
 \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 -Naur ncurses-5.7.orig/man/curs_beep.3x ncurses-5.7/man/curs_beep.3x
--- ncurses-5.7.orig/man/curs_beep.3x	2005-01-08 12:55:51.000000000 -0500
+++ ncurses-5.7/man/curs_beep.3x	2011-01-08 18:18:29.642657998 -0500
@@ -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 -Naur ncurses-5.7.orig/man/curs_bkgd.3x ncurses-5.7/man/curs_bkgd.3x
--- ncurses-5.7.orig/man/curs_bkgd.3x	2003-12-27 13:50:40.000000000 -0500
+++ ncurses-5.7/man/curs_bkgd.3x	2011-01-08 18:18:29.642657998 -0500
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 1998-2002,2003 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2003,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,12 +26,12 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: curs_bkgd.3x,v 1.19 2003/12/27 18:50:40 tom Exp $
+.\" $Id: curs_bkgd.3x,v 1.22 2010/12/04 18:36:44 tom Exp $
 .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
@@ -83,16 +83,10 @@
 Note that \fBbkgdset\fR and \fBbkgd\fR may be macros.
 .SH PORTABILITY
 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
 \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 -Naur ncurses-5.7.orig/man/curs_bkgrnd.3x ncurses-5.7/man/curs_bkgrnd.3x
--- ncurses-5.7.orig/man/curs_bkgrnd.3x	2006-02-25 16:49:19.000000000 -0500
+++ ncurses-5.7/man/curs_bkgrnd.3x	2011-01-08 18:18:29.646657964 -0500
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 2002-2004,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_bkgrnd.3x,v 1.3 2006/02/25 21:49:19 tom Exp $
+.\" $Id: curs_bkgrnd.3x,v 1.4 2010/12/04 18:49:20 tom Exp $
 .TH curs_bkgrnd 3X ""
 .SH NAME
 \fBbkgrnd\fR,
@@ -98,9 +98,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 -Naur ncurses-5.7.orig/man/curs_border.3x ncurses-5.7/man/curs_border.3x
--- ncurses-5.7.orig/man/curs_border.3x	2007-02-24 11:15:38.000000000 -0500
+++ ncurses-5.7/man/curs_border.3x	2011-01-08 18:18:29.646657964 -0500
@@ -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 -Naur ncurses-5.7.orig/man/curs_border_set.3x ncurses-5.7/man/curs_border_set.3x
--- ncurses-5.7.orig/man/curs_border_set.3x	2005-05-15 12:17:37.000000000 -0400
+++ ncurses-5.7/man/curs_border_set.3x	2011-01-08 18:18:29.646657964 -0500
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 2002-2004,2005 Free Software Foundation, Inc.              *
+.\" Copyright (c) 2002-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_border_set.3x,v 1.6 2005/05/15 16:17:37 tom Exp $
+.\" $Id: curs_border_set.3x,v 1.9 2010/12/04 18:36:44 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
@@ -195,13 +195,11 @@
 \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_border\fR(3X),
 \fBcurs_outopts\fR(3X)
-.\"#
-.\"# The following sets edit modes for GNU EMACS
-.\"# Local Variables:
-.\"# mode:nroff
-.\"# fill-column:79
-.\"# End:
diff -Naur ncurses-5.7.orig/man/curs_clear.3x ncurses-5.7/man/curs_clear.3x
--- ncurses-5.7.orig/man/curs_clear.3x	2007-12-29 10:58:38.000000000 -0500
+++ ncurses-5.7/man/curs_clear.3x	2011-01-08 18:18:29.646657964 -0500
@@ -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 -Naur ncurses-5.7.orig/man/curs_color.3x ncurses-5.7/man/curs_color.3x
--- ncurses-5.7.orig/man/curs_color.3x	2005-12-17 19:00:37.000000000 -0500
+++ ncurses-5.7/man/curs_color.3x	2011-01-08 18:18:29.746780939 -0500
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 1998-2004,2005 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            *
@@ -26,8 +26,11 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: curs_color.3x,v 1.28 2005/12/18 00:00:37 tom Exp $
+.\" $Id: curs_color.3x,v 1.35 2010/12/20 00:50:58 tom Exp $
 .TH curs_color 3X ""
+.de bP
+.IP \(bu 4
+..
 .na
 .hy 0
 .SH NAME
@@ -38,12 +41,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
@@ -93,12 +96,13 @@
 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
--
+.bP
 The value of the first argument
-must be between \fB1\fR and \fBCOLOR_PAIRS-1\fR.
-.TP 5
--
+must be between \fB1\fR and \fBCOLOR_PAIRS\-1\fR,
+except that 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 value of the second and
 third arguments must be between 0 and \fBCOLORS\fR.
 Color pair 0 is assumed to be white on black,
@@ -111,7 +115,7 @@
 .PP
 As an extension, ncurses allows you to set color pair 0 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
@@ -147,7 +151,7 @@
 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
+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.
 .SS Colors
 In \fB<curses.h>\fR the following macros are defined.  These are the default
@@ -174,15 +178,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 0 to COLORS\-1
 (except for the default colors extension),
-or use color pairs outside the range 0 to COLOR_PAIR-1.
+or use color pairs outside the range 0 to COLOR_PAIRS\-1.
 Color values used in \fBinit_color\fP must be in the range 0 to 1000.
 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,8 +194,7 @@
 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,
@@ -206,18 +209,15 @@
 scrolling operations, see \fBcurs_bkgd\fR(3X).
 .PP
 Several caveats apply on 386 and 486 machines with VGA-compatible graphics:
-.TP 5
--
+.bP
 COLOR_YELLOW is actually brown.  To get yellow, use COLOR_YELLOW combined with
 the \fBA_BOLD\fR attribute.
-.TP 5
--
+.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 +239,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 -Naur ncurses-5.7.orig/man/curs_delch.3x ncurses-5.7/man/curs_delch.3x
--- ncurses-5.7.orig/man/curs_delch.3x	2006-02-25 16:42:57.000000000 -0500
+++ ncurses-5.7/man/curs_delch.3x	2011-01-08 18:18:29.646657964 -0500
@@ -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 -Naur ncurses-5.7.orig/man/curs_deleteln.3x ncurses-5.7/man/curs_deleteln.3x
--- ncurses-5.7.orig/man/curs_deleteln.3x	2007-06-02 16:40:07.000000000 -0400
+++ ncurses-5.7/man/curs_deleteln.3x	2011-01-08 18:18:29.646657964 -0500
@@ -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 -Naur ncurses-5.7.orig/man/curs_extend.3x ncurses-5.7/man/curs_extend.3x
--- ncurses-5.7.orig/man/curs_extend.3x	2006-12-24 13:01:48.000000000 -0500
+++ ncurses-5.7/man/curs_extend.3x	2011-01-08 18:18:29.646657964 -0500
@@ -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 -Naur ncurses-5.7.orig/man/curs_get_wch.3x ncurses-5.7/man/curs_get_wch.3x
--- ncurses-5.7.orig/man/curs_get_wch.3x	2006-02-25 16:47:06.000000000 -0500
+++ ncurses-5.7/man/curs_get_wch.3x	2011-01-08 18:18:29.091413834 -0500
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 2002-2003,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_get_wch.3x,v 1.6 2006/02/25 21:47:06 tom Exp $
+.\" $Id: curs_get_wch.3x,v 1.7 2010/08/14 23:31:42 tom Exp $
 .TH curs_get_wch 3X ""
 .SH NAME
 \fBget_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 -Naur ncurses-5.7.orig/man/curs_get_wstr.3x ncurses-5.7/man/curs_get_wstr.3x
--- ncurses-5.7.orig/man/curs_get_wstr.3x	2006-02-25 16:49:19.000000000 -0500
+++ ncurses-5.7/man/curs_get_wstr.3x	2011-01-08 18:18:29.646657964 -0500
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 2002-2005,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_get_wstr.3x,v 1.6 2006/02/25 21:49:19 tom Exp $
+.\" $Id: curs_get_wstr.3x,v 1.8 2010/12/04 18:36:44 tom Exp $
 .TH curs_get_wstr 3X ""
 .na
 .hy 0
@@ -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 -Naur ncurses-5.7.orig/man/curs_getcchar.3x ncurses-5.7/man/curs_getcchar.3x
--- ncurses-5.7.orig/man/curs_getcchar.3x	2008-05-17 15:37:05.000000000 -0400
+++ ncurses-5.7/man/curs_getcchar.3x	2011-01-08 18:18:29.646657964 -0500
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 2001-2006,2008 Free Software Foundation, Inc.              *
+.\" Copyright (c) 2001-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            *
@@ -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.15 2010/12/04 18:36:44 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
@@ -63,17 +66,13 @@
 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,11 +81,9 @@
 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
@@ -94,22 +91,19 @@
 .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.
@@ -126,7 +120,8 @@
 .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 +136,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 -Naur ncurses-5.7.orig/man/curs_getch.3x ncurses-5.7/man/curs_getch.3x
--- ncurses-5.7.orig/man/curs_getch.3x	2006-12-02 12:02:53.000000000 -0500
+++ ncurses-5.7/man/curs_getch.3x	2011-01-08 18:18:29.646657964 -0500
@@ -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,7 +27,7 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: curs_getch.3x,v 1.30 2006/12/02 17:02:53 tom Exp $
+.\" $Id: curs_getch.3x,v 1.33 2010/12/04 18:36:44 tom Exp $
 .TH curs_getch 3X ""
 .na
 .hy 0
@@ -71,7 +71,7 @@
 Unless \fBnoecho\fR has been set,
 then the character will also be echoed into the
 designated window according to the following rules:
-If the character is the current erase character, left arrow, or backspace,
+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.
 If the character value is any other \fBKEY_\fR define, the user is alerted
@@ -245,6 +245,10 @@
 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
@@ -320,9 +324,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 -Naur ncurses-5.7.orig/man/curs_getstr.3x ncurses-5.7/man/curs_getstr.3x
--- ncurses-5.7.orig/man/curs_getstr.3x	2006-01-11 19:30:58.000000000 -0500
+++ ncurses-5.7/man/curs_getstr.3x	2011-01-08 18:18:29.646657964 -0500
@@ -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 -Naur ncurses-5.7.orig/man/curs_getyx.3x ncurses-5.7/man/curs_getyx.3x
--- ncurses-5.7.orig/man/curs_getyx.3x	2007-05-12 12:34:49.000000000 -0400
+++ ncurses-5.7/man/curs_getyx.3x	2011-01-08 18:18:29.646657964 -0500
@@ -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 -Naur ncurses-5.7.orig/man/curs_in_wch.3x ncurses-5.7/man/curs_in_wch.3x
--- ncurses-5.7.orig/man/curs_in_wch.3x	2006-02-25 16:42:22.000000000 -0500
+++ ncurses-5.7/man/curs_in_wch.3x	2011-01-08 18:18:29.646657964 -0500
@@ -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 -Naur ncurses-5.7.orig/man/curs_in_wchstr.3x ncurses-5.7/man/curs_in_wchstr.3x
--- ncurses-5.7.orig/man/curs_in_wchstr.3x	2006-12-02 12:03:07.000000000 -0500
+++ ncurses-5.7/man/curs_in_wchstr.3x	2011-01-08 18:18:29.646657964 -0500
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 2002-2005,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_in_wchstr.3x,v 1.6 2006/12/02 17:03:07 tom Exp $
+.\" $Id: curs_in_wchstr.3x,v 1.8 2010/12/04 18:36:44 tom Exp $
 .TH curs_in_wchstr 3X ""
 .na
 .hy 0
@@ -103,6 +103,10 @@
 \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 -Naur ncurses-5.7.orig/man/curs_inch.3x ncurses-5.7/man/curs_inch.3x
--- ncurses-5.7.orig/man/curs_inch.3x	2006-12-02 11:58:55.000000000 -0500
+++ ncurses-5.7/man/curs_inch.3x	2011-01-08 18:18:29.646657964 -0500
@@ -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 -Naur ncurses-5.7.orig/man/curs_inchstr.3x ncurses-5.7/man/curs_inchstr.3x
--- ncurses-5.7.orig/man/curs_inchstr.3x	2006-12-02 12:00:58.000000000 -0500
+++ ncurses-5.7/man/curs_inchstr.3x	2011-01-08 18:18:29.646657964 -0500
@@ -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 -Naur ncurses-5.7.orig/man/curs_initscr.3x ncurses-5.7/man/curs_initscr.3x
--- ncurses-5.7.orig/man/curs_initscr.3x	2005-05-15 12:18:01.000000000 -0400
+++ ncurses-5.7/man/curs_initscr.3x	2011-01-08 18:18:29.650656432 -0500
@@ -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_initscr.3x,v 1.14 2005/05/15 16:18:01 tom Exp $
+.\" $Id: curs_initscr.3x,v 1.17 2010/12/04 18:36:58 tom Exp $
 .TH curs_initscr 3X ""
 .na
 .hy 0
@@ -36,7 +36,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
@@ -122,11 +122,9 @@
 It is safe but redundant to check the return value of \fBinitscr\fR
 in XSI Curses.
 .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_util\fR(3X),
+\fBcurs_variables\fR(3X).
diff -Naur ncurses-5.7.orig/man/curs_inopts.3x ncurses-5.7/man/curs_inopts.3x
--- ncurses-5.7.orig/man/curs_inopts.3x	2005-05-15 12:18:07.000000000 -0400
+++ ncurses-5.7/man/curs_inopts.3x	2011-01-08 18:18:29.650656432 -0500
@@ -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_inopts.3x,v 1.13 2005/05/15 16:18:07 tom Exp $
+.\" $Id: curs_inopts.3x,v 1.15 2010/12/04 18:40:45 tom Exp $
 .TH curs_inopts 3X ""
 .na
 .hy 0
@@ -47,7 +47,7 @@
 \fBqiflush\fR,
 \fBtimeout\fR,
 \fBwtimeout\fR,
-\fBtypeahead\fR - \fBcurses\fR input options
+\fBtypeahead\fR \- \fBcurses\fR input options
 .ad
 .hy
 .SH SYNOPSIS
@@ -197,7 +197,7 @@
 \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.
+\-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
@@ -234,9 +234,3 @@
 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:
diff -Naur ncurses-5.7.orig/man/curs_ins_wch.3x ncurses-5.7/man/curs_ins_wch.3x
--- ncurses-5.7.orig/man/curs_ins_wch.3x	2006-02-25 16:42:22.000000000 -0500
+++ ncurses-5.7/man/curs_ins_wch.3x	2011-01-08 18:18:29.650656432 -0500
@@ -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 -Naur ncurses-5.7.orig/man/curs_ins_wstr.3x ncurses-5.7/man/curs_ins_wstr.3x
--- ncurses-5.7.orig/man/curs_ins_wstr.3x	2005-05-15 13:02:54.000000000 -0400
+++ ncurses-5.7/man/curs_ins_wstr.3x	2011-01-08 18:18:29.650656432 -0500
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 2002,2005 Free Software Foundation, Inc.                   *
+.\" Copyright (c) 2002-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_ins_wstr.3x,v 1.4 2005/05/15 17:02:54 tom Exp $
+.\" $Id: curs_ins_wstr.3x,v 1.6 2010/12/04 18:38:55 tom Exp $
 .TH curs_ins_wstr 3X ""
 .na
 .hy 0
@@ -95,14 +95,12 @@
 .SH RETURN VALUES
 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 -Naur ncurses-5.7.orig/man/curs_insch.3x ncurses-5.7/man/curs_insch.3x
--- ncurses-5.7.orig/man/curs_insch.3x	2006-12-02 12:01:50.000000000 -0500
+++ ncurses-5.7/man/curs_insch.3x	2011-01-08 18:18:29.650656432 -0500
@@ -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 -Naur ncurses-5.7.orig/man/curs_insstr.3x ncurses-5.7/man/curs_insstr.3x
--- ncurses-5.7.orig/man/curs_insstr.3x	2006-12-24 09:59:30.000000000 -0500
+++ ncurses-5.7/man/curs_insstr.3x	2011-01-08 18:18:29.650656432 -0500
@@ -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 -Naur ncurses-5.7.orig/man/curs_instr.3x ncurses-5.7/man/curs_instr.3x
--- ncurses-5.7.orig/man/curs_instr.3x	2006-02-25 16:49:19.000000000 -0500
+++ ncurses-5.7/man/curs_instr.3x	2011-01-08 18:18:29.650656432 -0500
@@ -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 -Naur ncurses-5.7.orig/man/curs_inwstr.3x ncurses-5.7/man/curs_inwstr.3x
--- ncurses-5.7.orig/man/curs_inwstr.3x	2006-02-25 16:20:20.000000000 -0500
+++ ncurses-5.7/man/curs_inwstr.3x	2011-01-08 18:18:29.650656432 -0500
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 2002-2005,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_inwstr.3x,v 1.5 2006/02/25 21:20:20 tom Exp $
+.\" $Id: curs_inwstr.3x,v 1.7 2010/12/04 18:38:55 tom Exp $
 .TH curs_inwstr 3X ""
 .SH NAME
 \fBinwstr\fR,
@@ -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 -Naur ncurses-5.7.orig/man/curs_kernel.3x ncurses-5.7/man/curs_kernel.3x
--- ncurses-5.7.orig/man/curs_kernel.3x	2005-05-15 12:18:13.000000000 -0400
+++ ncurses-5.7/man/curs_kernel.3x	2011-01-08 18:18:29.650656432 -0500
@@ -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_kernel.3x,v 1.15 2005/05/15 16:18:13 tom Exp $
+.\" $Id: curs_kernel.3x,v 1.19 2010/12/04 18:38:55 tom Exp $
 .TH curs_kernel 3X ""
 .na
 .hy 0
@@ -41,7 +41,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
@@ -71,7 +71,7 @@
 .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.
 .PP
 The \fBdef_prog_mode\fR and \fBdef_shell_mode\fR routines save the
@@ -94,13 +94,13 @@
 .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.
 .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
@@ -127,7 +127,7 @@
 \fBripoffline\fR can be called up to five times before calling \fBinitscr\fR or
 \fBnewterm\fR.
 .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
@@ -176,11 +176,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 -Naur ncurses-5.7.orig/man/curs_legacy.3x ncurses-5.7/man/curs_legacy.3x
--- ncurses-5.7.orig/man/curs_legacy.3x	2007-04-07 19:54:29.000000000 -0400
+++ ncurses-5.7/man/curs_legacy.3x	2011-01-08 18:18:29.650656432 -0500
@@ -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 -Naur ncurses-5.7.orig/man/curs_memleaks.3x ncurses-5.7/man/curs_memleaks.3x
--- ncurses-5.7.orig/man/curs_memleaks.3x	2008-10-25 19:38:13.000000000 -0400
+++ ncurses-5.7/man/curs_memleaks.3x	2011-01-08 18:18:29.650656432 -0500
@@ -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 -Naur ncurses-5.7.orig/man/curs_mouse.3x ncurses-5.7/man/curs_mouse.3x
--- ncurses-5.7.orig/man/curs_mouse.3x	2006-12-30 18:43:34.000000000 -0500
+++ ncurses-5.7/man/curs_mouse.3x	2011-01-08 18:18:29.650656432 -0500
@@ -1,6 +1,6 @@
 '\" t
 .\"***************************************************************************
-.\" Copyright (c) 1998-2005,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            *
@@ -27,15 +27,16 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: curs_mouse.3x,v 1.30 2006/12/30 23:43:34 tom Exp $
+.\" $Id: curs_mouse.3x,v 1.38 2010/12/04 18:38:55 tom Exp $
 .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
@@ -53,6 +54,8 @@
 MEVENT;\fR
 .fi
 .br
+\fBbool has_mouse(void);\fR
+.br
 \fBint getmouse(MEVENT *event);\fR
 .br
 \fBint ungetmouse(MEVENT *event);\fR
@@ -146,6 +149,9 @@
 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.
 .PP
 The \fBungetmouse\fR function behaves analogously to \fBungetch\fR.
 It pushes
@@ -194,9 +200,12 @@
 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.
 .PP
+The \fBhas_mouse\fP function returns TRUE 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
 function such as \fBgetstr\fR that expects a linefeed for input-loop
@@ -211,6 +220,7 @@
 returns an error.
 If no mouse driver was initialized, or
 if the mask parameter is zero,
+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.
@@ -256,7 +266,7 @@
 xterm's built-in mouse-tracking API or
 platform-specific drivers including
 .RS
-Alessandro Rubini's gpm server.
+Alessandro Rubini's gpm server
 .br
 FreeBSD sysmouse
 .br
@@ -301,10 +311,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 -Naur ncurses-5.7.orig/man/curs_move.3x ncurses-5.7/man/curs_move.3x
--- ncurses-5.7.orig/man/curs_move.3x	2006-02-25 16:49:19.000000000 -0500
+++ ncurses-5.7/man/curs_move.3x	2011-01-08 18:18:29.650656432 -0500
@@ -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 -Naur ncurses-5.7.orig/man/curs_opaque.3x ncurses-5.7/man/curs_opaque.3x
--- ncurses-5.7.orig/man/curs_opaque.3x	2007-09-08 14:49:13.000000000 -0400
+++ ncurses-5.7/man/curs_opaque.3x	2011-01-08 18:18:29.650656432 -0500
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 2007 Free Software Foundation, Inc.                        *
+.\" Copyright (c) 2007-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            *
@@ -26,7 +26,7 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: curs_opaque.3x,v 1.6 2007/09/08 18:49:13 tom Exp $
+.\" $Id: curs_opaque.3x,v 1.9 2010/12/04 18:40:45 tom Exp $
 .TH curs_opaque 3X ""
 .na
 .hy 0
@@ -38,9 +38,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,8 +64,12 @@
 .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
@@ -99,9 +105,17 @@
 \fBis_notimeout\fR
 returns the value set in \fBnotimeout\fR
 .TP 5
+\fBis_pad\fR
+returns TRUE 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 TRUE 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
@@ -125,9 +139,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 -Naur ncurses-5.7.orig/man/curs_outopts.3x ncurses-5.7/man/curs_outopts.3x
--- ncurses-5.7.orig/man/curs_outopts.3x	2007-06-02 16:40:07.000000000 -0400
+++ ncurses-5.7/man/curs_outopts.3x	2011-01-08 18:18:29.650656432 -0500
@@ -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_outopts.3x,v 1.21 2007/06/02 20:40:07 tom Exp $
+.\" $Id: curs_outopts.3x,v 1.25 2010/12/04 18:38:55 tom Exp $
 .TH curs_outopts 3X ""
 .na
 .hy 0
@@ -40,7 +40,7 @@
 \fBwsetscrreg\fR,
 \fBscrollok\fR,
 \fBnl\fR,
-\fBnonl\fR - \fBcurses\fR output options
+\fBnonl\fR \- \fBcurses\fR output options
 .ad
 .hy
 .SH SYNOPSIS
@@ -118,8 +118,9 @@
 .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
@@ -212,11 +213,10 @@
 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:
+\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 -Naur ncurses-5.7.orig/man/curs_overlay.3x ncurses-5.7/man/curs_overlay.3x
--- ncurses-5.7.orig/man/curs_overlay.3x	2006-02-25 16:49:19.000000000 -0500
+++ ncurses-5.7/man/curs_overlay.3x	2011-01-08 18:18:29.650656432 -0500
@@ -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_overlay.3x,v 1.14 2006/02/25 21:49:19 tom Exp $
+.\" $Id: curs_overlay.3x,v 1.16 2010/12/04 18:40:45 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
@@ -79,9 +79,3 @@
 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 -Naur ncurses-5.7.orig/man/curs_pad.3x ncurses-5.7/man/curs_pad.3x
--- ncurses-5.7.orig/man/curs_pad.3x	2005-05-15 12:18:43.000000000 -0400
+++ ncurses-5.7/man/curs_pad.3x	2011-01-08 18:18:29.650656432 -0500
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 1998-2004,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_pad.3x,v 1.14 2005/05/15 16:18:43 tom Exp $
+.\" $Id: curs_pad.3x,v 1.17 2010/12/04 18:41:07 tom Exp $
 .TH curs_pad 3X ""
 .na
 .hy 0
@@ -36,7 +36,7 @@
 \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
@@ -90,10 +90,11 @@
 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,
@@ -154,9 +155,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 -Naur ncurses-5.7.orig/man/curs_print.3x ncurses-5.7/man/curs_print.3x
--- ncurses-5.7.orig/man/curs_print.3x	2006-02-25 16:49:19.000000000 -0500
+++ ncurses-5.7/man/curs_print.3x	2011-01-08 18:18:29.650656432 -0500
@@ -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 -Naur ncurses-5.7.orig/man/curs_printw.3x ncurses-5.7/man/curs_printw.3x
--- ncurses-5.7.orig/man/curs_printw.3x	2006-12-24 11:05:17.000000000 -0500
+++ ncurses-5.7/man/curs_printw.3x	2011-01-08 18:18:29.654656342 -0500
@@ -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 -Naur ncurses-5.7.orig/man/curs_refresh.3x ncurses-5.7/man/curs_refresh.3x
--- ncurses-5.7.orig/man/curs_refresh.3x	2005-05-15 12:18:49.000000000 -0400
+++ ncurses-5.7/man/curs_refresh.3x	2011-01-08 18:18:29.654656342 -0500
@@ -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 -Naur ncurses-5.7.orig/man/curs_scanw.3x ncurses-5.7/man/curs_scanw.3x
--- ncurses-5.7.orig/man/curs_scanw.3x	2006-12-24 11:05:49.000000000 -0500
+++ ncurses-5.7/man/curs_scanw.3x	2011-01-08 18:18:29.654656342 -0500
@@ -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 -Naur ncurses-5.7.orig/man/curs_scr_dump.3x ncurses-5.7/man/curs_scr_dump.3x
--- ncurses-5.7.orig/man/curs_scr_dump.3x	2006-12-24 11:05:49.000000000 -0500
+++ ncurses-5.7/man/curs_scr_dump.3x	2011-01-08 18:18:29.654656342 -0500
@@ -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 -Naur ncurses-5.7.orig/man/curs_scroll.3x ncurses-5.7/man/curs_scroll.3x
--- ncurses-5.7.orig/man/curs_scroll.3x	2006-02-25 16:49:19.000000000 -0500
+++ ncurses-5.7/man/curs_scroll.3x	2011-01-08 18:18:29.654656342 -0500
@@ -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 -Naur ncurses-5.7.orig/man/curs_slk.3x ncurses-5.7/man/curs_slk.3x
--- ncurses-5.7.orig/man/curs_slk.3x	2007-06-02 16:40:07.000000000 -0400
+++ ncurses-5.7/man/curs_slk.3x	2011-01-08 18:18:29.654656342 -0500
@@ -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 -Naur ncurses-5.7.orig/man/curs_sp_funcs.3x ncurses-5.7/man/curs_sp_funcs.3x
--- ncurses-5.7.orig/man/curs_sp_funcs.3x	1969-12-31 19:00:00.000000000 -0500
+++ ncurses-5.7/man/curs_sp_funcs.3x	2011-01-08 18:18:29.654656342 -0500
@@ -0,0 +1,353 @@
+.\"***************************************************************************
+.\" 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: curs_sp_funcs.3x,v 1.5 2010/12/04 18:38:55 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 -Naur ncurses-5.7.orig/man/curs_termattrs.3x ncurses-5.7/man/curs_termattrs.3x
--- ncurses-5.7.orig/man/curs_termattrs.3x	2007-06-02 16:40:07.000000000 -0400
+++ ncurses-5.7/man/curs_termattrs.3x	2011-01-08 18:18:29.654656342 -0500
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 1998-2003,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_termattrs.3x,v 1.10 2007/06/02 20:40:07 tom Exp $
+.\" $Id: curs_termattrs.3x,v 1.12 2010/12/04 18:40:45 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
@@ -126,9 +126,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 -Naur ncurses-5.7.orig/man/curs_termcap.3x ncurses-5.7/man/curs_termcap.3x
--- ncurses-5.7.orig/man/curs_termcap.3x	2007-06-02 16:40:07.000000000 -0400
+++ ncurses-5.7/man/curs_termcap.3x	2011-01-08 18:18:29.654656342 -0500
@@ -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,16 +26,24 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: curs_termcap.3x,v 1.22 2007/06/02 20:40:07 tom Exp $
+.\" $Id: curs_termcap.3x,v 1.26 2010/12/04 18:38:55 tom Exp $
 .TH curs_termcap 3X ""
+.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
@@ -69,7 +77,7 @@
 terminfo entry has been compiled.
 .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
+It returns 1 on success, 0 if there is no such entry, and \-1 if the
 terminfo database could not be found.
 The emulation ignores the buffer pointer \fIbp\fR.
 .PP
@@ -77,7 +85,7 @@
 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.
@@ -158,10 +166,7 @@
 In particular, some applications are reported to declare and/or
 modify \fBospeed\fR.
 .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).
diff -Naur ncurses-5.7.orig/man/curs_terminfo.3x ncurses-5.7/man/curs_terminfo.3x
--- ncurses-5.7.orig/man/curs_terminfo.3x	2008-08-16 16:53:27.000000000 -0400
+++ ncurses-5.7/man/curs_terminfo.3x	2011-01-08 18:18:29.654656342 -0500
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 1999-2007,2008 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            *
@@ -26,7 +26,7 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: curs_terminfo.3x,v 1.30 2008/08/16 20:53:27 tom Exp $
+.\" $Id: curs_terminfo.3x,v 1.35 2010/12/04 18:38:55 tom Exp $
 .TH curs_terminfo 3X ""
 .ds n 5
 .na
@@ -42,12 +42,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
@@ -88,6 +89,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
@@ -153,7 +156,7 @@
 or that it is a generic type,
 having too little information for curses applications to run.
 .TP 5
-.B -1
+.B \-1
 means that the \fBterminfo\fR database could not be found.
 .RE
 .PP
@@ -196,6 +199,10 @@
 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.
+.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
@@ -233,15 +240,15 @@
 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
+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
+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.
+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
+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
@@ -319,10 +326,14 @@
 .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 \fBtiparam\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.
@@ -332,21 +343,17 @@
 \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,
+Extended terminal capability names, e.g., as defined by \fBtic\ \-x\fP,
 are not stored in the arrays described in this section.
 .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 -Naur ncurses-5.7.orig/man/curs_threads.3x ncurses-5.7/man/curs_threads.3x
--- ncurses-5.7.orig/man/curs_threads.3x	2008-04-12 14:22:51.000000000 -0400
+++ ncurses-5.7/man/curs_threads.3x	2011-01-08 18:18:29.654656342 -0500
@@ -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,21 +26,27 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: curs_threads.3x,v 1.12 2008/04/12 18:22:51 tom Exp $
+.\" $Id: curs_threads.3x,v 1.18 2010/12/04 18:38:55 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
@@ -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
@@ -594,10 +597,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 -Naur ncurses-5.7.orig/man/curs_touch.3x ncurses-5.7/man/curs_touch.3x
--- ncurses-5.7.orig/man/curs_touch.3x	2006-02-25 16:49:19.000000000 -0500
+++ ncurses-5.7/man/curs_touch.3x	2011-01-08 18:18:29.654656342 -0500
@@ -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_touch.3x,v 1.11 2006/02/25 21:49:19 tom Exp $
+.\" $Id: curs_touch.3x,v 1.14 2010/12/04 18:38:55 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
@@ -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 -Naur ncurses-5.7.orig/man/curs_trace.3x ncurses-5.7/man/curs_trace.3x
--- ncurses-5.7.orig/man/curs_trace.3x	2007-02-24 12:33:49.000000000 -0500
+++ ncurses-5.7/man/curs_trace.3x	2011-01-08 18:18:29.654656342 -0500
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 2000-2005,2007 Free Software Foundation, Inc.              *
+.\" Copyright (c) 2000-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            *
@@ -26,7 +26,7 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: curs_trace.3x,v 1.8 2007/02/24 17:33:49 tom Exp $
+.\" $Id: curs_trace.3x,v 1.12 2010/12/04 18:40:45 tom Exp $
 .TH curs_trace 3X ""
 .na
 .hy 0
@@ -36,11 +36,13 @@
 \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
@@ -56,7 +58,11 @@
 .br
 \fBchar *_nc_tracebits(void);\fR
 .br
-\fBchar *_tracechar(int);\fR
+\fBchar * _tracecchar_t(const cchar_t *string);\fR
+.br
+\fBchar * _tracecchar_t2(int buffer, const cchar_t *string);\fR
+.br
+\fBchar *_tracechar(int ch);\fR
 .br
 \fBchar *_tracechtype(chtype ch);\fR
 .br
@@ -71,6 +77,8 @@
 These functions are normally available only with the debugging library
 \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
@@ -135,6 +143,21 @@
 Some tracing features are enabled whenever the \fBtrace\fR parameter
 is nonzero.  Some features overlap.
 The specific names are used as a guideline.
+.PP
+These functions check the \fBNCURSES_TRACE\fP environment variable,
+to set the tracing feature as if \fBtrace\fP was called:
+.RS
+filter,
+initscr,
+new_prescr,
+newterm,
+nofilter,
+ripoffline,
+setupterm,
+slk_init,
+tgetent
+.RE
+
 .SH RETURN VALUE
 Routines which return a value are designed to be used as parameters
 to the \fB_tracef\fR routine.
@@ -145,9 +168,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 -Naur ncurses-5.7.orig/man/curs_util.3x ncurses-5.7/man/curs_util.3x
--- ncurses-5.7.orig/man/curs_util.3x	2008-10-25 19:45:41.000000000 -0400
+++ ncurses-5.7/man/curs_util.3x	2011-01-08 18:18:29.654656342 -0500
@@ -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,8 +26,11 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: curs_util.3x,v 1.27 2008/10/25 23:45:41 tom Exp $
+.\" $Id: curs_util.3x,v 1.32 2010/12/04 18:38:55 tom Exp $
 .TH curs_util 3X ""
+.de bP
+.IP \(bu 4
+..
 .na
 .hy 0
 .SH NAME
@@ -41,7 +44,7 @@
 \fBputwin\fR,
 \fBunctrl\fR,
 \fBuse_env\fR,
-\fBwunctrl\fR - miscellaneous \fBcurses\fR utility routines
+\fBwunctrl\fR \- miscellaneous \fBcurses\fR utility routines
 .ad
 .hy
 .SH SYNOPSIS
@@ -75,33 +78,27 @@
 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.
 .PP
 The \fBkeyname\fR routine returns a character string corresponding to the key \fIc\fR:
 .RS 3
-.TP 3
--
+.bP
 Printable characters are displayed as themselves, e.g., a one-character string containing the key.
-.TP 3
--
+.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,
+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
@@ -177,14 +174,12 @@
 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.
+.RS 3
+.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.
@@ -194,8 +189,7 @@
 initializing curses.
 This implementation permits that,
 and returns the ``~@'', etc., values in that case.
-.TP 5
--
+.bP
 parameter values outside the 0 to 255 range.
 \fBunctrl\fP returns a null pointer.
 .RE
@@ -219,17 +213,17 @@
 .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
+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. 
 X/Open Curses does not document the treatment of codes 128 to 159.
 When treating them as ``meta'' keys
 (or if \fBkeyname\fP is called before initializing curses),
-this implementation returns strings ``M-^@'', ``M-^A'', etc.
+this implementation returns strings ``M\-^@'', ``M\-^A'', etc.
 .PP
 The \fBkeyname\fP function may return the names of user-defined
-string capabilities which are defined in the terminfo entry via the \fB-x\fP
+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".
@@ -249,10 +243,5 @@
 \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 -Naur ncurses-5.7.orig/man/curs_variables.3x ncurses-5.7/man/curs_variables.3x
--- ncurses-5.7.orig/man/curs_variables.3x	1969-12-31 19:00:00.000000000 -0500
+++ ncurses-5.7/man/curs_variables.3x	2011-01-08 18:18:29.654656342 -0500
@@ -0,0 +1,135 @@
+.\"***************************************************************************
+.\" 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: curs_variables.3x,v 1.4 2010/12/04 18:38:55 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))
+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_threads\fR(3X),
+\fBterm_variables\fR(3X),
+\fBterminfo\fR(3X),
+\fBterminfo\fR(\*n).
diff -Naur ncurses-5.7.orig/man/curs_window.3x ncurses-5.7/man/curs_window.3x
--- ncurses-5.7.orig/man/curs_window.3x	2006-02-25 16:49:19.000000000 -0500
+++ ncurses-5.7/man/curs_window.3x	2011-01-08 18:18:29.654656342 -0500
@@ -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_window.3x,v 1.14 2006/02/25 21:49:19 tom Exp $
+.\" $Id: curs_window.3x,v 1.17 2010/12/04 18:38:55 tom Exp $
 .TH curs_window 3X ""
 .na
 .hy 0
@@ -41,7 +41,7 @@
 \fBwsyncup\fR,
 \fBsyncok\fR,
 \fBwcursyncup\fR,
-\fBwsyncdown\fR - create \fBcurses\fR windows
+\fBwsyncdown\fR \- create \fBcurses\fR windows
 .ad
 .hy
 .SH SYNOPSIS
@@ -76,8 +76,8 @@
 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
+\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.
 .PP
 Calling \fBdelwin\fR deletes the named window, freeing all memory
@@ -179,10 +179,7 @@
 .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 -Naur ncurses-5.7.orig/man/default_colors.3x ncurses-5.7/man/default_colors.3x
--- ncurses-5.7.orig/man/default_colors.3x	2006-12-24 10:02:53.000000000 -0500
+++ ncurses-5.7/man/default_colors.3x	2011-01-08 18:18:29.654656342 -0500
@@ -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            *
@@ -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.22 2010/12/04 18:40:45 tom 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.
@@ -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 -Naur ncurses-5.7.orig/man/define_key.3x ncurses-5.7/man/define_key.3x
--- ncurses-5.7.orig/man/define_key.3x	2006-02-25 16:49:19.000000000 -0500
+++ ncurses-5.7/man/define_key.3x	2011-01-08 18:18:29.654656342 -0500
@@ -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 -Naur ncurses-5.7.orig/man/form.3x ncurses-5.7/man/form.3x
--- ncurses-5.7.orig/man/form.3x	2008-10-11 16:48:11.000000000 -0400
+++ ncurses-5.7/man/form.3x	2011-01-08 18:18:29.654656342 -0500
@@ -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: form.3x,v 1.22 2008/10/11 20:48:11 tom Exp $
+.\" $Id: form.3x,v 1.24 2010/12/04 18:40:45 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
@@ -197,7 +197,7 @@
 \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
@@ -208,9 +208,3 @@
 .SH SEE ALSO
 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 -Naur ncurses-5.7.orig/man/form_cursor.3x ncurses-5.7/man/form_cursor.3x
--- ncurses-5.7.orig/man/form_cursor.3x	2006-11-04 13:50:24.000000000 -0500
+++ ncurses-5.7/man/form_cursor.3x	2011-01-08 18:18:29.654656342 -0500
@@ -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 -Naur ncurses-5.7.orig/man/form_data.3x ncurses-5.7/man/form_data.3x
--- ncurses-5.7.orig/man/form_data.3x	2006-02-25 16:38:26.000000000 -0500
+++ ncurses-5.7/man/form_data.3x	2011-01-08 18:18:29.654656342 -0500
@@ -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 -Naur ncurses-5.7.orig/man/form_driver.3x ncurses-5.7/man/form_driver.3x
--- ncurses-5.7.orig/man/form_driver.3x	2008-06-21 17:55:39.000000000 -0400
+++ ncurses-5.7/man/form_driver.3x	2011-01-08 18:18:29.654656342 -0500
@@ -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: form_driver.3x,v 1.16 2008/06/21 21:55:39 tom Exp $
+.\" $Id: form_driver.3x,v 1.22 2010/12/04 18:38:55 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
@@ -38,18 +41,15 @@
 .SH DESCRIPTION
 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
--
+.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 form driver requests are as follows:
@@ -238,11 +238,11 @@
 .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 +252,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 +262,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,8 +274,7 @@
 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
@@ -321,7 +318,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 +329,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 -Naur ncurses-5.7.orig/man/form_field.3x ncurses-5.7/man/form_field.3x
--- ncurses-5.7.orig/man/form_field.3x	2006-11-04 13:01:38.000000000 -0500
+++ ncurses-5.7/man/form_field.3x	2011-01-08 18:18:29.654656342 -0500
@@ -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.3x,v 1.8 2006/11/04 18:01:38 tom Exp $
+.\" $Id: form_field.3x,v 1.10 2010/12/04 18:40:45 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
@@ -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 -Naur ncurses-5.7.orig/man/form_field_attributes.3x ncurses-5.7/man/form_field_attributes.3x
--- ncurses-5.7.orig/man/form_field_attributes.3x	2006-11-04 13:51:26.000000000 -0500
+++ ncurses-5.7/man/form_field_attributes.3x	2011-01-08 18:18:29.654656342 -0500
@@ -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 -Naur ncurses-5.7.orig/man/form_field_buffer.3x ncurses-5.7/man/form_field_buffer.3x
--- ncurses-5.7.orig/man/form_field_buffer.3x	2008-10-18 14:35:17.000000000 -0400
+++ ncurses-5.7/man/form_field_buffer.3x	2011-01-08 18:18:29.654656342 -0500
@@ -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 -Naur ncurses-5.7.orig/man/form_field_info.3x ncurses-5.7/man/form_field_info.3x
--- ncurses-5.7.orig/man/form_field_info.3x	2006-11-04 12:14:31.000000000 -0500
+++ ncurses-5.7/man/form_field_info.3x	2011-01-08 18:18:29.654656342 -0500
@@ -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 -Naur ncurses-5.7.orig/man/form_field_just.3x ncurses-5.7/man/form_field_just.3x
--- ncurses-5.7.orig/man/form_field_just.3x	2006-11-04 12:12:00.000000000 -0500
+++ ncurses-5.7/man/form_field_just.3x	2011-01-08 18:18:29.654656342 -0500
@@ -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 -Naur ncurses-5.7.orig/man/form_field_new.3x ncurses-5.7/man/form_field_new.3x
--- ncurses-5.7.orig/man/form_field_new.3x	2007-06-02 16:40:07.000000000 -0400
+++ ncurses-5.7/man/form_field_new.3x	2011-01-08 18:18:29.654656342 -0500
@@ -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 -Naur ncurses-5.7.orig/man/form_field_opts.3x ncurses-5.7/man/form_field_opts.3x
--- ncurses-5.7.orig/man/form_field_opts.3x	2007-02-24 12:34:27.000000000 -0500
+++ ncurses-5.7/man/form_field_opts.3x	2011-01-08 18:18:29.658657902 -0500
@@ -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_opts.3x,v 1.13 2007/02/24 17:34:27 tom Exp $
+.\" $Id: form_field_opts.3x,v 1.16 2010/12/04 18:41:07 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
@@ -106,7 +106,6 @@
 System error occurred (see \fBerrno\fR).
 .SH SEE ALSO
 \fBcurses\fR(3X), \fBform\fR(3X).
-.TP 5
 .SH NOTES
 The header file \fB<form.h>\fR automatically includes the header file
 \fB<curses.h>\fR.
@@ -116,9 +115,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 -Naur ncurses-5.7.orig/man/form_field_userptr.3x ncurses-5.7/man/form_field_userptr.3x
--- ncurses-5.7.orig/man/form_field_userptr.3x	2006-11-04 13:04:37.000000000 -0500
+++ ncurses-5.7/man/form_field_userptr.3x	2011-01-08 18:18:29.658657902 -0500
@@ -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 -Naur ncurses-5.7.orig/man/form_field_validation.3x ncurses-5.7/man/form_field_validation.3x
--- ncurses-5.7.orig/man/form_field_validation.3x	2006-12-24 11:08:08.000000000 -0500
+++ ncurses-5.7/man/form_field_validation.3x	2011-01-08 18:18:29.658657902 -0500
@@ -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 -Naur ncurses-5.7.orig/man/form_fieldtype.3x ncurses-5.7/man/form_fieldtype.3x
--- ncurses-5.7.orig/man/form_fieldtype.3x	2006-11-04 12:12:00.000000000 -0500
+++ ncurses-5.7/man/form_fieldtype.3x	2011-01-08 18:18:29.658657902 -0500
@@ -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 -Naur ncurses-5.7.orig/man/form_hook.3x ncurses-5.7/man/form_hook.3x
--- ncurses-5.7.orig/man/form_hook.3x	2007-02-24 12:34:18.000000000 -0500
+++ ncurses-5.7/man/form_hook.3x	2011-01-08 18:18:29.658657902 -0500
@@ -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 -Naur ncurses-5.7.orig/man/form_new.3x ncurses-5.7/man/form_new.3x
--- ncurses-5.7.orig/man/form_new.3x	2006-11-04 12:12:00.000000000 -0500
+++ ncurses-5.7/man/form_new.3x	2011-01-08 18:18:29.658657902 -0500
@@ -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 -Naur ncurses-5.7.orig/man/form_new_page.3x ncurses-5.7/man/form_new_page.3x
--- ncurses-5.7.orig/man/form_new_page.3x	2006-11-04 12:12:00.000000000 -0500
+++ ncurses-5.7/man/form_new_page.3x	2011-01-08 18:18:29.658657902 -0500
@@ -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 -Naur ncurses-5.7.orig/man/form_opts.3x ncurses-5.7/man/form_opts.3x
--- ncurses-5.7.orig/man/form_opts.3x	2007-02-24 12:34:36.000000000 -0500
+++ ncurses-5.7/man/form_opts.3x	2011-01-08 18:18:29.658657902 -0500
@@ -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 -Naur ncurses-5.7.orig/man/form_page.3x ncurses-5.7/man/form_page.3x
--- ncurses-5.7.orig/man/form_page.3x	2006-11-04 13:52:32.000000000 -0500
+++ ncurses-5.7/man/form_page.3x	2011-01-08 18:18:29.658657902 -0500
@@ -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 -Naur ncurses-5.7.orig/man/form_post.3x ncurses-5.7/man/form_post.3x
--- ncurses-5.7.orig/man/form_post.3x	2006-11-04 13:53:20.000000000 -0500
+++ ncurses-5.7/man/form_post.3x	2011-01-08 18:18:29.658657902 -0500
@@ -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 -Naur ncurses-5.7.orig/man/form_requestname.3x ncurses-5.7/man/form_requestname.3x
--- ncurses-5.7.orig/man/form_requestname.3x	2006-11-04 12:57:49.000000000 -0500
+++ ncurses-5.7/man/form_requestname.3x	2011-01-08 18:18:29.658657902 -0500
@@ -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 -Naur ncurses-5.7.orig/man/form_userptr.3x ncurses-5.7/man/form_userptr.3x
--- ncurses-5.7.orig/man/form_userptr.3x	2006-11-04 13:43:24.000000000 -0500
+++ ncurses-5.7/man/form_userptr.3x	2011-01-08 18:18:29.658657902 -0500
@@ -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 -Naur ncurses-5.7.orig/man/form_variables.3x ncurses-5.7/man/form_variables.3x
--- ncurses-5.7.orig/man/form_variables.3x	1969-12-31 19:00:00.000000000 -0500
+++ ncurses-5.7/man/form_variables.3x	2011-01-08 18:18:29.658657902 -0500
@@ -0,0 +1,82 @@
+.\"***************************************************************************
+.\" 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: form_variables.3x,v 1.3 2010/12/04 18:38:55 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
+.br
+.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
+.br
+.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 -Naur ncurses-5.7.orig/man/form_win.3x ncurses-5.7/man/form_win.3x
--- ncurses-5.7.orig/man/form_win.3x	2006-11-04 12:12:00.000000000 -0500
+++ ncurses-5.7/man/form_win.3x	2011-01-08 18:18:29.658657902 -0500
@@ -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 -Naur ncurses-5.7.orig/man/infocmp.1m ncurses-5.7/man/infocmp.1m
--- ncurses-5.7.orig/man/infocmp.1m	2006-12-24 13:16:31.000000000 -0500
+++ ncurses-5.7/man/infocmp.1m	2011-01-08 18:18:29.658657902 -0500
@@ -1,6 +1,6 @@
 '\" t
 .\"***************************************************************************
-.\" Copyright (c) 1998-2004,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,14 +27,14 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: infocmp.1m,v 1.44 2006/12/24 18:16:31 tom Exp $
+.\" $Id: infocmp.1m,v 1.46 2010/12/04 18:40:45 tom Exp $
 .TH @INFOCMP@ 1M ""
 .ds n 5
 .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\
 E\
@@ -60,9 +60,9 @@
 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
@@ -74,45 +74,45 @@
 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
 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
+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
+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.
+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
+The \fB\-n\fR option produces a list of each capability that is in neither
 entry.  If no \fItermnames\fR are given, the environment variable \fBTERM\fR
 will be used for both of the \fItermnames\fR.  This can be used as a quick
 check to see if anything was left out of a description.
-.SS Source Listing Options [-I] [-L] [-C] [-r]
-The \fB-I\fR, \fB-L\fR, and \fB-C\fR options will produce a source listing for
+.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
 .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
 parameterized information, and anything not converted will be plainly marked in
@@ -125,7 +125,7 @@
 All \fBtermcap\fR variables no longer supported by \fBterminfo\fR, but which
 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.
 .PP
@@ -153,8 +153,8 @@
 \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
 analyzing the differences between the first \fItermname\fR and the other
@@ -189,29 +189,29 @@
 the compilation time, is specifying extra \fBuse=\fR fields that are
 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]
+.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
+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
 compare descriptions for a terminal with the same name located in two different
 databases.  This is useful for comparing descriptions for the same terminal
 created by different people.
 .SS Other Options
 .TP 5
-\fB-1\fR
+\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.
 .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,17 +220,17 @@
 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
+\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.
@@ -239,25 +239,25 @@
 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
 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
 of the capability name, followed by a colon and space, followed by a printable
@@ -291,38 +291,38 @@
 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).
+REVERSE.  All but NORMAL may be prefixed with `+' (turn on) or `\-' (turn off).
 .PP
 An SGR0 designates an empty highlight sequence (equivalent to {SGR:NORMAL}).
 .TP 5
-\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
+\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
@@ -331,8 +331,8 @@
 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 +350,70 @@
 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
+\fB\-t\fR
 tells \fBtic\fP to discard commented-out capabilities.
 Normally when translating from terminfo to termcap,
 untranslatable capabilities are commented-out.
 .TP 5
-\fB-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 \fBtic\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\-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.
+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.
+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),
@@ -429,9 +429,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 -Naur ncurses-5.7.orig/man/infotocap.1m ncurses-5.7/man/infotocap.1m
--- ncurses-5.7.orig/man/infotocap.1m	2006-12-24 15:13:56.000000000 -0500
+++ ncurses-5.7/man/infotocap.1m	2011-01-08 18:18:29.658657902 -0500
@@ -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 -Naur ncurses-5.7.orig/man/key_defined.3x ncurses-5.7/man/key_defined.3x
--- ncurses-5.7.orig/man/key_defined.3x	2006-02-25 16:50:01.000000000 -0500
+++ ncurses-5.7/man/key_defined.3x	2011-01-08 18:18:29.658657902 -0500
@@ -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 -Naur ncurses-5.7.orig/man/keybound.3x ncurses-5.7/man/keybound.3x
--- ncurses-5.7.orig/man/keybound.3x	2006-02-25 16:47:06.000000000 -0500
+++ ncurses-5.7/man/keybound.3x	2011-01-08 18:18:29.658657902 -0500
@@ -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 -Naur ncurses-5.7.orig/man/keyok.3x ncurses-5.7/man/keyok.3x
--- ncurses-5.7.orig/man/keyok.3x	2006-02-25 16:47:06.000000000 -0500
+++ ncurses-5.7/man/keyok.3x	2011-01-08 18:18:29.658657902 -0500
@@ -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 -Naur ncurses-5.7.orig/man/legacy_coding.3x ncurses-5.7/man/legacy_coding.3x
--- ncurses-5.7.orig/man/legacy_coding.3x	2006-12-24 10:12:55.000000000 -0500
+++ ncurses-5.7/man/legacy_coding.3x	2011-01-08 18:18:29.658657902 -0500
@@ -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 -Naur ncurses-5.7.orig/man/man_db.renames ncurses-5.7/man/man_db.renames
--- ncurses-5.7.orig/man/man_db.renames	2008-10-25 19:24:03.000000000 -0400
+++ ncurses-5.7/man/man_db.renames	2011-01-08 18:18:29.250657520 -0500
@@ -1,5 +1,5 @@
 ##############################################################################
-# Copyright (c) 1998-2007,2008 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 "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.47 2010/09/18 15:43:20 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,15 @@
 regcomp.3x			regcomp.3
 regexec.3x			regexec.3
 #
+# Generated:
+adacurses-config.1		adacurses-config.1
+#
+ncurses5-config.1		ncurses5-config.1
+ncursesw5-config.1		ncursesw5-config.1
+#
+ncurses6-config.1		ncurses6-config.1
+ncursesw6-config.1		ncursesw6-config.1
+ncursest6-config.1		ncursest6-config.1
+ncurseswt6-config.1		ncurseswt6-config.1
+#
 # vile:cfgmode
diff -Naur ncurses-5.7.orig/man/menu.3x ncurses-5.7/man/menu.3x
--- ncurses-5.7.orig/man/menu.3x	2006-11-04 13:38:29.000000000 -0500
+++ ncurses-5.7/man/menu.3x	2011-01-08 18:18:29.658657902 -0500
@@ -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: menu.3x,v 1.19 2006/11/04 18:38:29 tom Exp $
+.\" $Id: menu.3x,v 1.21 2010/12/04 18:40:45 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
 .
@@ -174,7 +174,7 @@
 \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
@@ -185,9 +185,3 @@
 .SH SEE ALSO
 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 -Naur ncurses-5.7.orig/man/menu_attributes.3x ncurses-5.7/man/menu_attributes.3x
--- ncurses-5.7.orig/man/menu_attributes.3x	2008-08-23 14:24:23.000000000 -0400
+++ ncurses-5.7/man/menu_attributes.3x	2011-01-08 18:18:29.658657902 -0500
@@ -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 -Naur ncurses-5.7.orig/man/menu_cursor.3x ncurses-5.7/man/menu_cursor.3x
--- ncurses-5.7.orig/man/menu_cursor.3x	2006-11-04 12:13:57.000000000 -0500
+++ ncurses-5.7/man/menu_cursor.3x	2011-01-08 18:18:29.658657902 -0500
@@ -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 -Naur ncurses-5.7.orig/man/menu_driver.3x ncurses-5.7/man/menu_driver.3x
--- ncurses-5.7.orig/man/menu_driver.3x	2008-06-21 17:55:30.000000000 -0400
+++ ncurses-5.7/man/menu_driver.3x	2011-01-08 18:18:29.658657902 -0500
@@ -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 -Naur ncurses-5.7.orig/man/menu_format.3x ncurses-5.7/man/menu_format.3x
--- ncurses-5.7.orig/man/menu_format.3x	2006-11-04 12:12:00.000000000 -0500
+++ ncurses-5.7/man/menu_format.3x	2011-01-08 18:18:29.658657902 -0500
@@ -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 -Naur ncurses-5.7.orig/man/menu_hook.3x ncurses-5.7/man/menu_hook.3x
--- ncurses-5.7.orig/man/menu_hook.3x	2007-02-24 12:34:08.000000000 -0500
+++ ncurses-5.7/man/menu_hook.3x	2011-01-08 18:18:29.658657902 -0500
@@ -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 -Naur ncurses-5.7.orig/man/menu_items.3x ncurses-5.7/man/menu_items.3x
--- ncurses-5.7.orig/man/menu_items.3x	2006-11-04 13:35:31.000000000 -0500
+++ ncurses-5.7/man/menu_items.3x	2011-01-08 18:18:29.658657902 -0500
@@ -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_items.3x,v 1.7 2006/11/04 18:35:31 tom Exp $
+.\" $Id: menu_items.3x,v 1.9 2010/12/04 18:40:45 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
@@ -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 -Naur ncurses-5.7.orig/man/menu_mark.3x ncurses-5.7/man/menu_mark.3x
--- ncurses-5.7.orig/man/menu_mark.3x	2006-11-04 13:33:18.000000000 -0500
+++ ncurses-5.7/man/menu_mark.3x	2011-01-08 18:18:29.658657902 -0500
@@ -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 -Naur ncurses-5.7.orig/man/menu_new.3x ncurses-5.7/man/menu_new.3x
--- ncurses-5.7.orig/man/menu_new.3x	2006-11-04 13:31:37.000000000 -0500
+++ ncurses-5.7/man/menu_new.3x	2011-01-08 18:18:29.658657902 -0500
@@ -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 -Naur ncurses-5.7.orig/man/menu_opts.3x ncurses-5.7/man/menu_opts.3x
--- ncurses-5.7.orig/man/menu_opts.3x	2007-02-24 12:33:59.000000000 -0500
+++ ncurses-5.7/man/menu_opts.3x	2011-01-08 18:18:29.658657902 -0500
@@ -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 -Naur ncurses-5.7.orig/man/menu_pattern.3x ncurses-5.7/man/menu_pattern.3x
--- ncurses-5.7.orig/man/menu_pattern.3x	2008-06-21 17:58:20.000000000 -0400
+++ ncurses-5.7/man/menu_pattern.3x	2011-01-08 18:18:29.662656834 -0500
@@ -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 -Naur ncurses-5.7.orig/man/menu_post.3x ncurses-5.7/man/menu_post.3x
--- ncurses-5.7.orig/man/menu_post.3x	2006-11-04 12:12:00.000000000 -0500
+++ ncurses-5.7/man/menu_post.3x	2011-01-08 18:18:29.662656834 -0500
@@ -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 -Naur ncurses-5.7.orig/man/menu_requestname.3x ncurses-5.7/man/menu_requestname.3x
--- ncurses-5.7.orig/man/menu_requestname.3x	2006-11-04 12:56:09.000000000 -0500
+++ ncurses-5.7/man/menu_requestname.3x	2011-01-08 18:18:29.662656834 -0500
@@ -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 -Naur ncurses-5.7.orig/man/menu_spacing.3x ncurses-5.7/man/menu_spacing.3x
--- ncurses-5.7.orig/man/menu_spacing.3x	2004-12-11 18:39:07.000000000 -0500
+++ ncurses-5.7/man/menu_spacing.3x	2011-01-08 18:18:29.662656834 -0500
@@ -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 -Naur ncurses-5.7.orig/man/menu_userptr.3x ncurses-5.7/man/menu_userptr.3x
--- ncurses-5.7.orig/man/menu_userptr.3x	2006-11-04 13:21:03.000000000 -0500
+++ ncurses-5.7/man/menu_userptr.3x	2011-01-08 18:18:29.662656834 -0500
@@ -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 -Naur ncurses-5.7.orig/man/menu_win.3x ncurses-5.7/man/menu_win.3x
--- ncurses-5.7.orig/man/menu_win.3x	2006-11-04 12:12:00.000000000 -0500
+++ ncurses-5.7/man/menu_win.3x	2011-01-08 18:18:29.662656834 -0500
@@ -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 -Naur ncurses-5.7.orig/man/mitem_current.3x ncurses-5.7/man/mitem_current.3x
--- ncurses-5.7.orig/man/mitem_current.3x	2006-11-04 13:18:19.000000000 -0500
+++ ncurses-5.7/man/mitem_current.3x	2011-01-08 18:18:29.662656834 -0500
@@ -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 -Naur ncurses-5.7.orig/man/mitem_name.3x ncurses-5.7/man/mitem_name.3x
--- ncurses-5.7.orig/man/mitem_name.3x	2006-11-04 12:53:40.000000000 -0500
+++ ncurses-5.7/man/mitem_name.3x	2011-01-08 18:18:29.662656834 -0500
@@ -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 -Naur ncurses-5.7.orig/man/mitem_new.3x ncurses-5.7/man/mitem_new.3x
--- ncurses-5.7.orig/man/mitem_new.3x	2006-11-04 13:16:36.000000000 -0500
+++ ncurses-5.7/man/mitem_new.3x	2011-01-08 18:18:29.662656834 -0500
@@ -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 -Naur ncurses-5.7.orig/man/mitem_opts.3x ncurses-5.7/man/mitem_opts.3x
--- ncurses-5.7.orig/man/mitem_opts.3x	2007-02-24 12:33:32.000000000 -0500
+++ ncurses-5.7/man/mitem_opts.3x	2011-01-08 18:18:29.662656834 -0500
@@ -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 -Naur ncurses-5.7.orig/man/mitem_userptr.3x ncurses-5.7/man/mitem_userptr.3x
--- ncurses-5.7.orig/man/mitem_userptr.3x	2006-11-04 13:21:03.000000000 -0500
+++ ncurses-5.7/man/mitem_userptr.3x	2011-01-08 18:18:29.662656834 -0500
@@ -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 -Naur ncurses-5.7.orig/man/mitem_value.3x ncurses-5.7/man/mitem_value.3x
--- ncurses-5.7.orig/man/mitem_value.3x	2006-11-04 12:12:00.000000000 -0500
+++ ncurses-5.7/man/mitem_value.3x	2011-01-08 18:18:29.662656834 -0500
@@ -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 -Naur ncurses-5.7.orig/man/mitem_visible.3x ncurses-5.7/man/mitem_visible.3x
--- ncurses-5.7.orig/man/mitem_visible.3x	1998-11-28 20:12:55.000000000 -0500
+++ ncurses-5.7/man/mitem_visible.3x	2011-01-08 18:18:29.662656834 -0500
@@ -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 -Naur ncurses-5.7.orig/man/ncurses.3x ncurses-5.7/man/ncurses.3x
--- ncurses-5.7.orig/man/ncurses.3x	2008-10-25 19:31:45.000000000 -0400
+++ ncurses-5.7/man/ncurses.3x	2011-01-08 18:18:29.662656834 -0500
@@ -1,6 +1,6 @@
 '\" t
 .\"***************************************************************************
-.\" Copyright (c) 1998-2007,2008 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            *
@@ -27,13 +27,16 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: ncurses.3x,v 1.92 2008/10/25 23:31:45 tom Exp $
+.\" $Id: ncurses.3x,v 1.101 2010/12/04 18:38:55 tom Exp $
 .hy 0
 .TH ncurses 3X ""
+.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
@@ -46,7 +49,7 @@
 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.
@@ -60,10 +63,10 @@
 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.
@@ -80,7 +83,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.
@@ -246,7 +249,7 @@
 .TP 5
 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:
@@ -256,7 +259,7 @@
 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 +270,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
@@ -756,6 +759,10 @@
 (i.e., the \fBcmdch\fP capability)
 of the loaded terminfo entries to the value of this symbol.
 Very few terminfo entries provide this feature.
+.IP
+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.
 .TP 5
 COLUMNS
 Specify the width of the screen in characters.
@@ -831,7 +838,7 @@
 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.
+The symbol must be three numeric digits 1\-3 in any order, e.g., 123 or 321.
 If it is not specified, \fBncurses\fR uses 132.
 .TP 5
 NCURSES_ASSUMED_COLORS
@@ -841,7 +848,7 @@
 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
@@ -911,7 +918,7 @@
 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.
@@ -922,7 +929,7 @@
 .IP
 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.
+disables the special check for "linux" and "screen".
 .TP 5
 NCURSES_TRACE
 During initialization, the \fBncurses\fR debugging library
@@ -956,20 +963,15 @@
 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
--
+.bP
 the last directory to which \fBncurses\fR wrote, if any, is searched first
-.TP 3
--
+.bP
 the directory specified by the TERMINFO symbol
-.TP 3
--
+.bP
 $HOME/.terminfo
-.TP 3
--
+.bP
 directories listed in the TERMINFO_DIRS symbol
-.TP 3
--
+.bP
 one or more directories whose names are configured and compiled into the
 ncurses library, e.g.,
 @TERMINFO@
@@ -998,7 +1000,7 @@
 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
 .sp
@@ -1014,23 +1016,23 @@
 \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
+\-\-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
 .sp
-\fB-lncurses\fR
+\fB\-lncurses\fR
 .RE
 .IP
 you link with
 .RS
 .sp
-\fB-lncursesw\fR
+\fB\-lncursesw\fR
 .RE
 .IP
 You must also define \fB_XOPEN_SOURCE_EXTENDED\fP when compiling for the
@@ -1044,20 +1046,20 @@
 to allow applications to be built using either library
 from the same set of headers.
 .TP 5
---with-shared
+\-\-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
@@ -1071,8 +1073,10 @@
 .SH SEE ALSO
 \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 +1102,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
@@ -1119,29 +1123,35 @@
 sections of the library man pages.
 .PP
 This implementation also contains several extensions:
-.RS 5
-.PP
+.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 +1170,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 -Naur ncurses-5.7.orig/man/panel.3x ncurses-5.7/man/panel.3x
--- ncurses-5.7.orig/man/panel.3x	2007-05-12 16:45:20.000000000 -0400
+++ ncurses-5.7/man/panel.3x	2011-01-08 18:18:29.366656739 -0500
@@ -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,16 +26,16 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: panel.3x,v 1.14 2007/05/12 20:45:20 tom Exp $
+.\" $Id: panel.3x,v 1.17 2010/10/02 23:22:44 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
@@ -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 -Naur ncurses-5.7.orig/man/resizeterm.3x ncurses-5.7/man/resizeterm.3x
--- ncurses-5.7.orig/man/resizeterm.3x	2005-06-25 18:19:42.000000000 -0400
+++ ncurses-5.7/man/resizeterm.3x	2011-01-08 18:18:29.662656834 -0500
@@ -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            *
@@ -28,12 +28,12 @@
 .\"
 .\" Author: Thomas E. Dickey 1996-2005
 .\"
-.\" $Id: resizeterm.3x,v 1.11 2005/06/25 22:19:42 tom Exp $
+.\" $Id: resizeterm.3x,v 1.14 2010/12/04 18:38:55 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
@@ -89,12 +89,7 @@
 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_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 -Naur ncurses-5.7.orig/man/tabs.1 ncurses-5.7/man/tabs.1
--- ncurses-5.7.orig/man/tabs.1	1969-12-31 19:00:00.000000000 -0500
+++ ncurses-5.7/man/tabs.1	2011-01-08 18:18:29.662656834 -0500
@@ -0,0 +1,141 @@
+.\"***************************************************************************
+.\" Copyright (c) 2008-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            *
+.\" "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.8 2010/12/04 18:40:45 tom Exp $
+.TH @TABS@ 1 ""
+.ds n 5
+.SH NAME
+\fBtabs\fR \- set tabs on a terminal
+.SH SYNOPSIS
+\fBtabs\fR [\fB\-v\fR[\fIn\fR]] [\fB\-ahuUV\fR] \fIfile...\fR
+.br
+.SH DESCRIPTION
+.PP
+The \fBtabs\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, \fBtabs\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 \fBtabs\fP which terminal type to use.
+If this option is not given, \fBtabs\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 \fBtabs\fP to check the options and run any debugging
+option, but not to modify the terminal settings.
+.PP
+The \fBtabs\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 -Naur ncurses-5.7.orig/man/term.5 ncurses-5.7/man/term.5
--- ncurses-5.7.orig/man/term.5	2006-12-24 13:12:38.000000000 -0500
+++ ncurses-5.7/man/term.5	2011-01-08 18:18:29.662656834 -0500
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 1998-2004,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: term.5,v 1.19 2006/12/24 18:12:38 tom Exp $
+.\" $Id: term.5,v 1.21 2010/12/04 18:40:45 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
@@ -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 -Naur ncurses-5.7.orig/man/term.7 ncurses-5.7/man/term.7
--- ncurses-5.7.orig/man/term.7	2007-06-02 16:40:07.000000000 -0400
+++ ncurses-5.7/man/term.7	2011-01-08 18:18:29.662656834 -0500
@@ -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: term.7,v 1.18 2007/06/02 20:40:07 tom Exp $
+.\" $Id: term.7,v 1.22 2010/12/04 18:41:07 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
@@ -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 -Naur ncurses-5.7.orig/man/term_variables.3x ncurses-5.7/man/term_variables.3x
--- ncurses-5.7.orig/man/term_variables.3x	1969-12-31 19:00:00.000000000 -0500
+++ ncurses-5.7/man/term_variables.3x	2011-01-08 18:18:29.662656834 -0500
@@ -0,0 +1,153 @@
+.\"***************************************************************************
+.\" 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: term_variables.3x,v 1.2 2010/12/04 18:38:55 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
+.br
+\fBNCURSES_CONST char * const * boolcodes;\fR
+.br
+\fBNCURSES_CONST char * const * boolfnames;\fR
+.br
+\fBNCURSES_CONST char * const * boolnames;\fR
+.br
+\fBTERMINAL * cur_term;\fR
+.br
+\fBNCURSES_CONST char * const * numcodes;\fR
+.br
+\fBNCURSES_CONST char * const * numfnames;\fR
+.br
+\fBNCURSES_CONST char * const * numnames;\fR
+.br
+\fBNCURSES_CONST char * const * strcodes;\fR
+.br
+\fBNCURSES_CONST char * const * strfnames;\fR
+.br
+\fBNCURSES_CONST char * const * strnames;\fR
+.br
+\fBchar ttytype[];\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 \fBtic\fP(1) and \fBinfocmp\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,
+though the hash-tables are not available.
+.PP
+The long terminfo capability names use a "l" (ell) in their names:
+boolfnames
+numfnames
+strfnames
+.PP
+These are the short names for terminfo capabilities:
+boolnames,
+numnames, and
+strnames.
+.PP
+These are the corresponding names used for termcap descriptions:
+boolcodes,
+numcodes, and
+strcodes.
+.SS Terminal Type
+On initialization of the curses or terminfo interfaces,
+\fBsetupterm\fP copies the terminal name to the array \fBttytype\fP.
+.SH NOTES
+The low-level terminfo interface is initialized using \fBsetupterm\fR(3X).
+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.
+.SH SEE ALSO
+\fBcurses\fR(3X),
+\fBcurs_terminfo\fR(3X),
+\fBcurs_threads\fR(3X),
+\fBterminfo\fR(3X),
+\fBterminfo\fR(\*n).
diff -Naur ncurses-5.7.orig/man/terminfo.head ncurses-5.7/man/terminfo.head
--- ncurses-5.7.orig/man/terminfo.head	2007-03-03 19:09:46.000000000 -0500
+++ ncurses-5.7/man/terminfo.head	2011-01-08 18:13:50.491156932 -0500
@@ -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            *
@@ -26,7 +26,7 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: terminfo.head,v 1.16 2007/03/04 00:09:46 tom Exp $
+.\" $Id: terminfo.head,v 1.18 2010/07/31 16:08:48 tom Exp $
 .TH terminfo 5 "" "" "File Formats"
 .ds n 5
 .ds d @TERMINFO@
@@ -68,7 +68,7 @@
 .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
@@ -78,7 +78,7 @@
 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,19 +86,19 @@
 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.
diff -Naur ncurses-5.7.orig/man/terminfo.tail ncurses-5.7/man/terminfo.tail
--- ncurses-5.7.orig/man/terminfo.tail	2008-02-16 15:57:43.000000000 -0500
+++ ncurses-5.7/man/terminfo.tail	2011-01-08 18:18:29.662656834 -0500
@@ -1,4 +1,4 @@
-.\" $Id: terminfo.tail,v 1.49 2008/02/16 20:57:43 tom Exp $
+.\" $Id: terminfo.tail,v 1.53 2010/12/04 18:38:55 tom Exp $
 .\" Beginning of terminfo.tail file
 .\" This file is part of ncurses.
 .\" See "terminfo.head" for copyright.
@@ -25,7 +25,7 @@
         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,
+        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,
@@ -325,9 +325,9 @@
 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.
+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
@@ -335,20 +335,20 @@
 %s
 print pop() like %s in \fBprintf\fP
 .TP
-%p[1-9]
+%p[1\-9]
 push \fIi\fP'th parameter
 .TP
-%P[a-z]
-set dynamic variable [a-z] to pop()
+%P[a\-z]
+set dynamic variable [a\-z] to pop()
 .TP
-%g[a-z]
-get dynamic variable [a-z] and push it
+%g[a\-z]
+get dynamic variable [a\-z] and push it
 .TP
-%P[A-Z]
-set static variable [a-z] to pop()
+%P[A\-Z]
+set static variable [a\-z] to pop()
 .TP
-%g[A-Z]
-get static variable [a-z] and push it
+%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,
@@ -365,7 +365,7 @@
 %l
 push strlen(pop)
 .TP
-%+ %- %* %/ %m
+%+ %\- %* %/ %m
 arithmetic (%m is mod): push(pop() op pop())
 .TP
 %& %| %^
@@ -397,14 +397,14 @@
 .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 \fBtic\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}%-".
+That is, to get x\-5 one would use "%gx%{5}%-".
 %P and %g variables are
 persistent across escape-string evaluations.
 .PP
@@ -542,7 +542,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
@@ -759,9 +759,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
@@ -794,9 +794,9 @@
 .PP
 .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
 
 \\E[0	always	\\E[0
@@ -1174,9 +1174,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 +1184,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 +1192,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 +1201,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
@@ -1227,7 +1227,7 @@
 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.
@@ -1312,7 +1312,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 +1324,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.
@@ -1525,9 +1525,9 @@
 use reference that imports it, where \fIxx\fP is the capability.
 For example, the entry
 .PP
-	2621-nl, smkx@, rmkx@, use=2621,
+	2621\-nl, smkx@, rmkx@, use=2621,
 .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 +1544,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.
@@ -1612,16 +1612,16 @@
 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
@@ -1657,30 +1657,30 @@
 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.
 .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 +1692,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 -Naur ncurses-5.7.orig/man/tic.1m ncurses-5.7/man/tic.1m
--- ncurses-5.7.orig/man/tic.1m	2006-12-24 12:59:11.000000000 -0500
+++ ncurses-5.7/man/tic.1m	2011-01-08 18:18:29.662656834 -0500
@@ -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,15 +26,15 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: tic.1m,v 1.44 2006/12/24 17:59:11 tom Exp $
+.\" $Id: tic.1m,v 1.47 2010/12/04 18:38:55 tom Exp $
 .TH @TIC@ 1M ""
 .ds n 5
 .ds d @TERMINFO@
 .SH NAME
-\fBtic\fR - the \fIterminfo\fR entry-description compiler
+\fBtic\fR \- the \fIterminfo\fR entry-description compiler
 .SH SYNOPSIS
 \fBtic\fR
-[\fB-\
+[\fB\-\
 1\
 C\
 G\
@@ -53,20 +53,22 @@
 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
+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.
+directory \fB\*d\fR.
+There are two ways to change this behavior.
 .PP
 First, you may override the system default by setting the variable
 \fBTERMINFO\fR in your shell environment to a valid (existing) directory name.
@@ -79,33 +81,38 @@
 directory first, look at \fI$HOME/.terminfo\fR if TERMINFO is not set, and
 finally look in \fI\*d\fR.
 .TP
-\fB-1\fR
+\fB\-1\fR
 restricts the output to a single column
 .TP
-\fB-a\fR
+\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
+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.
 .TP
-\fB-c\fR
+\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
+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
+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.
 .TP
-\fB-e \fR\fInames\fR
+\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,80 +120,85 @@
 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\-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
+\fB\-o\fR\fIdir\fR
+Write compiled entries to given directory.
+Overrides the TERMINFO environment
 variable.
 .TP
-\fB-R\fR\fIsubset\fR
-Restrict output to a given subset.  This option is for use with archaic
+\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
+\fB\-s\fR
 Summarize the compile by showing the directory into which entries
 are written, and the number of entries which are compiled.
 .TP
-\fB-T\fR
+\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
+\fB\-t\fR
 tells \fBtic\fP to discard commented-out capabilities.
 Normally when translating from terminfo to termcap,
 untranslatable capabilities are commented-out.
 .TP 5
-\fB-U\fR
+\fB\-U\fR
 tells \fBtic\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.
 The optional parameter \fIn\fR is a number from 1 to 10, inclusive,
@@ -195,12 +207,12 @@
 If \fIn\fR is specified and greater than 1, the level of
 detail is increased.
 .TP
-\fB-w\fR\fIn\fR
+\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
+\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
@@ -210,7 +222,8 @@
 .TP
 \fIfile\fR
 contains one or more \fBterminfo\fR terminal descriptions in source
-format [see \fBterminfo\fR(\*n)].  Each description in the file
+format [see \fBterminfo\fR(\*n)].
+Each description in the file
 describes the capabilities of a particular terminal.
 .PP
 The debug flag levels are as follows:
@@ -239,15 +252,18 @@
 If the debug level \fIn\fR is not given, it is taken to be one.
 .PP
 All but one of the capabilities recognized by \fBtic\fR are documented
-in \fBterminfo\fR(\*n).  The exception is the \fBuse\fR capability.
+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
+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
+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
+\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
@@ -259,20 +275,25 @@
 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
 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 \fBtic\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
+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
@@ -287,25 +308,25 @@
 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\-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.
@@ -323,9 +344,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 -Naur ncurses-5.7.orig/man/toe.1m ncurses-5.7/man/toe.1m
--- ncurses-5.7.orig/man/toe.1m	2008-01-05 15:57:16.000000000 -0500
+++ ncurses-5.7/man/toe.1m	2011-01-08 18:18:29.662656834 -0500
@@ -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,14 +26,14 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: toe.1m,v 1.21 2008/01/05 20:57:16 tom Exp $
+.\" $Id: toe.1m,v 1.23 2010/12/04 18:40:45 tom Exp $
 .TH @TOE@ 1M ""
 .ds n 5
 .ds d @TERMINFO@
 .SH NAME
-\fBtoe\fR - table of (terminfo) entries
+\fBtoe\fR \- table of (terminfo) entries
 .SH SYNOPSIS
-\fBtoe\fR [\fB-v\fR[\fIn\fR]] [\fB-ahuUV\fR] \fIfile...\fR
+\fBtoe\fR [\fB\-v\fR[\fIn\fR]] [\fB\-ahuUV\fR] \fIfile...\fR
 .br
 .SH DESCRIPTION
 .PP
@@ -43,17 +43,17 @@
 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.
 .TP
-\fB-u\fR \fIfile\fR
+\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 +65,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 +76,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.
 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 +99,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 -Naur ncurses-5.7.orig/man/tput.1 ncurses-5.7/man/tput.1
--- ncurses-5.7.orig/man/tput.1	2006-12-24 13:11:31.000000000 -0500
+++ ncurses-5.7/man/tput.1	2011-01-08 18:18:29.662656834 -0500
@@ -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,24 +27,24 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: tput.1,v 1.27 2006/12/24 18:11:31 tom Exp $
+.\" $Id: tput.1,v 1.29 2010/12/04 18:41:07 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,10 +76,10 @@
 For a complete list of capabilities
 and the \fIcapname\fR associated with each, see \fBterminfo\fR(5).
 .TP
-\fB-T\fR\fItype\fR
+\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
+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.
 .TP
@@ -99,12 +99,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 +112,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,7 +152,7 @@
 .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)].
@@ -169,7 +169,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 +184,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 +208,7 @@
 variable \fBTERM\fR.
 .PP
 .RS 5
-\fB@TPUT@ -S <<!\fR
+\fB@TPUT@ \-S <<!\fR
 .br
 \fB> clear\fR
 .br
@@ -237,7 +237,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 +245,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 +265,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
@@ -286,18 +286,18 @@
 \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
@@ -317,9 +317,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 -Naur ncurses-5.7.orig/man/tset.1 ncurses-5.7/man/tset.1
--- ncurses-5.7.orig/man/tset.1	2006-12-24 10:00:30.000000000 -0500
+++ ncurses-5.7/man/tset.1	2011-01-08 18:18:29.662656834 -0500
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 1998-2005,2006 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,14 +26,14 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: tset.1,v 1.19 2006/12/24 15:00:30 tom Exp $
-.TH tset 1 ""
+.\" $Id: tset.1,v 1.25 2010/12/04 18:38:55 tom Exp $
+.TH @TSET@ 1 ""
 .SH NAME
-\fBtset\fR, \fBreset\fR - terminal initialization
+\fBtset\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]
+\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]
 .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,13 +44,14 @@
 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''.
 .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).
@@ -67,7 +68,7 @@
 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
@@ -86,64 +87,64 @@
 .PP
 The options are as follows:
 .TP 5
-.B -c
+.B \-c
 Set control characters and modes.
-.B -e
+.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
 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
 are for \fBcsh\fR, otherwise, they are for \fBsh\fR.
@@ -151,7 +152,7 @@
 \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
@@ -161,13 +162,13 @@
 When \fBtset\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''.
 .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
@@ -178,7 +179,7 @@
 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,16 +194,16 @@
 .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,
+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
@@ -216,34 +217,34 @@
 \fBtset\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
+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
+terminfo-based \fBncurses\fR, which makes \fBtset \-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
+The \fB\-A\fR, \fB\-E\fR, \fB\-h\fR, \fB\-u\fR and \fB\-v\fR
 options were deleted from the \fBtset\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
+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
+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
+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.
 .SH ENVIRONMENT
 The \fBtset\fR command uses these environment variables:
@@ -280,9 +281,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 -Naur ncurses-5.7.orig/man/wresize.3x ncurses-5.7/man/wresize.3x
--- ncurses-5.7.orig/man/wresize.3x	2006-02-25 16:47:06.000000000 -0500
+++ ncurses-5.7/man/wresize.3x	2011-01-08 18:18:29.662656834 -0500
@@ -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:
diff -Naur ncurses-5.7.orig/menu/Makefile.in ncurses-5.7/menu/Makefile.in
--- ncurses-5.7.orig/menu/Makefile.in	2007-04-28 10:56:11.000000000 -0400
+++ ncurses-5.7/menu/Makefile.in	2011-01-08 18:18:29.570656837 -0500
@@ -1,6 +1,6 @@
-# $Id: Makefile.in,v 1.48 2007/04/28 14:56:11 tom Exp $
+# $Id: Makefile.in,v 1.54 2010/11/27 21:45:27 tom Exp $
 ##############################################################################
-# Copyright (c) 1998-2006,2007 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 "Software"), #
@@ -43,6 +43,7 @@
 .SUFFIXES:
 
 SHELL		= /bin/sh
+VPATH		= @srcdir@
 THIS		= Makefile
 
 x		= @EXEEXT@
@@ -63,6 +64,7 @@
 LIBTOOL_LINK	= @LIB_LINK@
 LIBTOOL_INSTALL	= @LIB_INSTALL@
 LIBTOOL_UNINSTALL = @LIB_UNINSTALL@
+LT_UNDEF	= @LT_UNDEF@
 
 INSTALL		= @INSTALL@
 INSTALL_LIB	= @INSTALL@ @INSTALL_LIB@
@@ -70,11 +72,14 @@
 INSTALL_DATA	= @INSTALL_DATA@
 
 AR		= @AR@
-AR_OPTS		= @AR_OPTS@
+ARFLAGS		= @ARFLAGS@
 AWK		= @AWK@
 LD		= @LD@
 LN_S		= @LN_S@
 
+CTAGS		= @CTAGS@
+ETAGS		= @ETAGS@
+
 CC		= @CC@
 CPP		= @CPP@
 CFLAGS		= @CFLAGS@
@@ -126,7 +131,7 @@
 
 $(DESTDIR)$(bindir) \
 $(DESTDIR)$(libdir) :
-	sh $(srcdir)/../mkdirs.sh $@
+	mkdir -p $@
 
 # make copies to simplify include-paths while still keeping menu's include
 # file in this directory.
@@ -140,16 +145,16 @@
 	-rm -f $@
 	cp $(srcdir)/mf_common.h $@
 
-MENU_PRIV_H = \
+HEADER_DEPS = \
 	$(srcdir)/menu.priv.h \
 	$(AUTO_SRC) \
 	../include/curses.h
 
 tags:
-	ctags *.[ch]
+	$(CTAGS) *.[ch]
 
 @MAKE_UPPER_TAGS@TAGS:
-@MAKE_UPPER_TAGS@	etags *.[ch]
+@MAKE_UPPER_TAGS@	$(ETAGS) *.[ch]
 
 mostlyclean ::
 	-rm -f core tags TAGS *~ *.bak *.i *.ln *.atac trace
diff -Naur ncurses-5.7.orig/menu/llib-lmenu ncurses-5.7/menu/llib-lmenu
--- ncurses-5.7.orig/menu/llib-lmenu	2005-03-05 14:42:46.000000000 -0500
+++ ncurses-5.7/menu/llib-lmenu	2011-01-08 18:13:50.495156782 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1999-2002,2005 Free Software Foundation, Inc.              *
+ * Copyright (c) 1999-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            *
@@ -27,13 +27,13 @@
  ****************************************************************************/
 
 /****************************************************************************
- *  Author: Thomas E. Dickey        1996-2002,2005                          *
+ *  Author: Thomas E. Dickey        1996-2005,2010                          *
  ****************************************************************************/
 /* LINTLIBRARY */
 
 /* ./m_attribs.c */
 
-#include "menu.priv.h"
+#include <menu.priv.h>
 
 #undef set_menu_fore
 int	set_menu_fore(
@@ -350,6 +350,12 @@
 
 /* ./m_new.c */
 
+#undef new_menu_sp
+MENU	*new_menu_sp(
+		SCREEN	*sp, 
+		ITEM	**items)
+		{ return(*(MENU **)0); }
+
 #undef new_menu
 MENU	*new_menu(
 		ITEM	**items)
diff -Naur ncurses-5.7.orig/menu/llib-lmenut ncurses-5.7/menu/llib-lmenut
--- ncurses-5.7.orig/menu/llib-lmenut	1969-12-31 19:00:00.000000000 -0500
+++ ncurses-5.7/menu/llib-lmenut	2011-01-08 18:13:50.495156782 -0500
@@ -0,0 +1,551 @@
+/****************************************************************************
+ * 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.                                                           *
+ ****************************************************************************/
+
+/****************************************************************************
+ *  Author: Thomas E. Dickey        2010                                    *
+ ****************************************************************************/
+/* LINTLIBRARY */
+
+/* ./m_attribs.c */
+
+#include <menu.priv.h>
+
+#undef set_menu_fore
+int	set_menu_fore(
+		MENU	*menu, 
+		chtype	attr)
+		{ return(*(int *)0); }
+
+#undef menu_fore
+chtype	menu_fore(
+		const MENU *menu)
+		{ return(*(chtype *)0); }
+
+#undef set_menu_back
+int	set_menu_back(
+		MENU	*menu, 
+		chtype	attr)
+		{ return(*(int *)0); }
+
+#undef menu_back
+chtype	menu_back(
+		const MENU *menu)
+		{ return(*(chtype *)0); }
+
+#undef set_menu_grey
+int	set_menu_grey(
+		MENU	*menu, 
+		chtype	attr)
+		{ return(*(int *)0); }
+
+#undef menu_grey
+chtype	menu_grey(
+		const MENU *menu)
+		{ return(*(chtype *)0); }
+
+/* ./m_cursor.c */
+
+#undef _nc_menu_cursor_pos
+int	_nc_menu_cursor_pos(
+		const MENU *menu, 
+		const ITEM *item, 
+		int	*pY, 
+		int	*pX)
+		{ return(*(int *)0); }
+
+#undef pos_menu_cursor
+int	pos_menu_cursor(
+		const MENU *menu)
+		{ return(*(int *)0); }
+
+/* ./m_driver.c */
+
+#undef _nc_Match_Next_Character_In_Item_Name
+int	_nc_Match_Next_Character_In_Item_Name(
+		MENU	*menu, 
+		int	ch, 
+		ITEM	**item)
+		{ return(*(int *)0); }
+
+#undef menu_driver
+int	menu_driver(
+		MENU	*menu, 
+		int	c)
+		{ return(*(int *)0); }
+
+/* ./m_format.c */
+
+#undef set_menu_format
+int	set_menu_format(
+		MENU	*menu, 
+		int	rows, 
+		int	cols)
+		{ return(*(int *)0); }
+
+#undef menu_format
+void	menu_format(
+		const MENU *menu, 
+		int	*rows, 
+		int	*cols)
+		{ /* void */ }
+
+/* ./m_global.c */
+
+#undef _nc_Default_Menu
+MENU	_nc_Default_Menu;
+#undef _nc_Default_Item
+ITEM	_nc_Default_Item;
+
+#undef _nc_Connect_Items
+NCURSES_BOOL _nc_Connect_Items(
+		MENU	*menu, 
+		ITEM	**items)
+		{ return(*(NCURSES_BOOL *)0); }
+
+#undef _nc_Disconnect_Items
+void	_nc_Disconnect_Items(
+		MENU	*menu)
+		{ /* void */ }
+
+#undef _nc_Calculate_Text_Width
+int	_nc_Calculate_Text_Width(
+		const TEXT *item)
+		{ return(*(int *)0); }
+
+#undef _nc_Calculate_Item_Length_and_Width
+void	_nc_Calculate_Item_Length_and_Width(
+		MENU	*menu)
+		{ /* void */ }
+
+#undef _nc_Link_Items
+void	_nc_Link_Items(
+		MENU	*menu)
+		{ /* void */ }
+
+#undef _nc_Show_Menu
+void	_nc_Show_Menu(
+		const MENU *menu)
+		{ /* void */ }
+
+#undef _nc_New_TopRow_and_CurrentItem
+void	_nc_New_TopRow_and_CurrentItem(
+		MENU	*menu, 
+		int	new_toprow, 
+		ITEM	*new_current_item)
+		{ /* void */ }
+
+/* ./m_hook.c */
+
+#undef set_menu_init
+int	set_menu_init(
+		MENU	*menu, 
+		Menu_Hook func)
+		{ return(*(int *)0); }
+
+#undef menu_init
+Menu_Hook menu_init(
+		const MENU *menu)
+		{ return(*(Menu_Hook *)0); }
+
+#undef set_menu_term
+int	set_menu_term(
+		MENU	*menu, 
+		Menu_Hook func)
+		{ return(*(int *)0); }
+
+#undef menu_term
+Menu_Hook menu_term(
+		const MENU *menu)
+		{ return(*(Menu_Hook *)0); }
+
+#undef set_item_init
+int	set_item_init(
+		MENU	*menu, 
+		Menu_Hook func)
+		{ return(*(int *)0); }
+
+#undef item_init
+Menu_Hook item_init(
+		const MENU *menu)
+		{ return(*(Menu_Hook *)0); }
+
+#undef set_item_term
+int	set_item_term(
+		MENU	*menu, 
+		Menu_Hook func)
+		{ return(*(int *)0); }
+
+#undef item_term
+Menu_Hook item_term(
+		const MENU *menu)
+		{ return(*(Menu_Hook *)0); }
+
+/* ./m_item_cur.c */
+
+#undef set_current_item
+int	set_current_item(
+		MENU	*menu, 
+		ITEM	*item)
+		{ return(*(int *)0); }
+
+#undef current_item
+ITEM	*current_item(
+		const MENU *menu)
+		{ return(*(ITEM **)0); }
+
+#undef item_index
+int	item_index(
+		const ITEM *item)
+		{ return(*(int *)0); }
+
+/* ./m_item_nam.c */
+
+#undef item_name
+const char *item_name(
+		const ITEM *item)
+		{ return(*(const char **)0); }
+
+#undef item_description
+const char *item_description(
+		const ITEM *item)
+		{ return(*(const char **)0); }
+
+/* ./m_item_new.c */
+
+#undef new_item
+ITEM	*new_item(
+		const char *name, 
+		const char *description)
+		{ return(*(ITEM **)0); }
+
+#undef free_item
+int	free_item(
+		ITEM	*item)
+		{ return(*(int *)0); }
+
+#undef set_menu_mark
+int	set_menu_mark(
+		MENU	*menu, 
+		const char *mark)
+		{ return(*(int *)0); }
+
+#undef menu_mark
+const char *menu_mark(
+		const MENU *menu)
+		{ return(*(const char **)0); }
+
+/* ./m_item_opt.c */
+
+#undef set_item_opts
+int	set_item_opts(
+		ITEM	*item, 
+		Item_Options opts)
+		{ return(*(int *)0); }
+
+#undef item_opts_off
+int	item_opts_off(
+		ITEM	*item, 
+		Item_Options opts)
+		{ return(*(int *)0); }
+
+#undef item_opts_on
+int	item_opts_on(
+		ITEM	*item, 
+		Item_Options opts)
+		{ return(*(int *)0); }
+
+#undef item_opts
+Item_Options item_opts(
+		const ITEM *item)
+		{ return(*(Item_Options *)0); }
+
+/* ./m_item_top.c */
+
+#undef set_top_row
+int	set_top_row(
+		MENU	*menu, 
+		int	row)
+		{ return(*(int *)0); }
+
+#undef top_row
+int	top_row(
+		const MENU *menu)
+		{ return(*(int *)0); }
+
+/* ./m_item_use.c */
+
+#undef set_item_userptr
+int	set_item_userptr(
+		ITEM	*item, 
+		void	*userptr)
+		{ return(*(int *)0); }
+
+#undef item_userptr
+void	*item_userptr(
+		const ITEM *item)
+		{ return(*(void **)0); }
+
+/* ./m_item_val.c */
+
+#undef set_item_value
+int	set_item_value(
+		ITEM	*item, 
+		NCURSES_BOOL value)
+		{ return(*(int *)0); }
+
+#undef item_value
+NCURSES_BOOL item_value(
+		const ITEM *item)
+		{ return(*(NCURSES_BOOL *)0); }
+
+/* ./m_item_vis.c */
+
+#undef item_visible
+NCURSES_BOOL item_visible(
+		const ITEM *item)
+		{ return(*(NCURSES_BOOL *)0); }
+
+/* ./m_items.c */
+
+#undef set_menu_items
+int	set_menu_items(
+		MENU	*menu, 
+		ITEM	**items)
+		{ return(*(int *)0); }
+
+#undef menu_items
+ITEM	**menu_items(
+		const MENU *menu)
+		{ return(*(ITEM ***)0); }
+
+#undef item_count
+int	item_count(
+		const MENU *menu)
+		{ return(*(int *)0); }
+
+/* ./m_new.c */
+
+#undef new_menu_sp
+MENU	*new_menu_sp(
+		SCREEN	*sp, 
+		ITEM	**items)
+		{ return(*(MENU **)0); }
+
+#undef new_menu
+MENU	*new_menu(
+		ITEM	**items)
+		{ return(*(MENU **)0); }
+
+#undef free_menu
+int	free_menu(
+		MENU	*menu)
+		{ return(*(int *)0); }
+
+/* ./m_opts.c */
+
+#undef set_menu_opts
+int	set_menu_opts(
+		MENU	*menu, 
+		Menu_Options opts)
+		{ return(*(int *)0); }
+
+#undef menu_opts_off
+int	menu_opts_off(
+		MENU	*menu, 
+		Menu_Options opts)
+		{ return(*(int *)0); }
+
+#undef menu_opts_on
+int	menu_opts_on(
+		MENU	*menu, 
+		Menu_Options opts)
+		{ return(*(int *)0); }
+
+#undef menu_opts
+Menu_Options menu_opts(
+		const MENU *menu)
+		{ return(*(Menu_Options *)0); }
+
+/* ./m_pad.c */
+
+#undef set_menu_pad
+int	set_menu_pad(
+		MENU	*menu, 
+		int	pad)
+		{ return(*(int *)0); }
+
+#undef menu_pad
+int	menu_pad(
+		const MENU *menu)
+		{ return(*(int *)0); }
+
+/* ./m_pattern.c */
+
+#undef menu_pattern
+char	*menu_pattern(
+		const MENU *menu)
+		{ return(*(char **)0); }
+
+#undef set_menu_pattern
+int	set_menu_pattern(
+		MENU	*menu, 
+		const char *p)
+		{ return(*(int *)0); }
+
+/* ./m_post.c */
+
+#undef _nc_Post_Item
+void	_nc_Post_Item(
+		const MENU *menu, 
+		const ITEM *item)
+		{ /* void */ }
+
+#undef _nc_Draw_Menu
+void	_nc_Draw_Menu(
+		const MENU *menu)
+		{ /* void */ }
+
+#undef post_menu
+int	post_menu(
+		MENU	*menu)
+		{ return(*(int *)0); }
+
+#undef unpost_menu
+int	unpost_menu(
+		MENU	*menu)
+		{ return(*(int *)0); }
+
+/* ./m_req_name.c */
+
+#undef menu_request_name
+const char *menu_request_name(
+		int	request)
+		{ return(*(const char **)0); }
+
+#undef menu_request_by_name
+int	menu_request_by_name(
+		const char *str)
+		{ return(*(int *)0); }
+
+/* ./m_scale.c */
+
+#undef scale_menu
+int	scale_menu(
+		const MENU *menu, 
+		int	*rows, 
+		int	*cols)
+		{ return(*(int *)0); }
+
+/* ./m_spacing.c */
+
+#undef set_menu_spacing
+int	set_menu_spacing(
+		MENU	*menu, 
+		int	s_desc, 
+		int	s_row, 
+		int	s_col)
+		{ return(*(int *)0); }
+
+#undef menu_spacing
+int	menu_spacing(
+		const MENU *menu, 
+		int	*s_desc, 
+		int	*s_row, 
+		int	*s_col)
+		{ return(*(int *)0); }
+
+/* ./m_sub.c */
+
+#undef set_menu_sub
+int	set_menu_sub(
+		MENU	*menu, 
+		WINDOW	*win)
+		{ return(*(int *)0); }
+
+#undef menu_sub
+WINDOW	*menu_sub(
+		const MENU *menu)
+		{ return(*(WINDOW **)0); }
+
+/* ./m_trace.c */
+
+#undef _nc_retrace_item
+ITEM	*_nc_retrace_item(
+		ITEM	*code)
+		{ return(*(ITEM **)0); }
+
+#undef _nc_retrace_item_ptr
+ITEM	**_nc_retrace_item_ptr(
+		ITEM	**code)
+		{ return(*(ITEM ***)0); }
+
+#undef _nc_retrace_item_opts
+Item_Options _nc_retrace_item_opts(
+		Item_Options code)
+		{ return(*(Item_Options *)0); }
+
+#undef _nc_retrace_menu
+MENU	*_nc_retrace_menu(
+		MENU	*code)
+		{ return(*(MENU **)0); }
+
+#undef _nc_retrace_menu_hook
+Menu_Hook _nc_retrace_menu_hook(
+		Menu_Hook code)
+		{ return(*(Menu_Hook *)0); }
+
+#undef _nc_retrace_menu_opts
+Menu_Options _nc_retrace_menu_opts(
+		Menu_Options code)
+		{ return(*(Menu_Options *)0); }
+
+/* ./m_userptr.c */
+
+#undef set_menu_userptr
+int	set_menu_userptr(
+		MENU	*menu, 
+		void	*userptr)
+		{ return(*(int *)0); }
+
+#undef menu_userptr
+void	*menu_userptr(
+		const MENU *menu)
+		{ return(*(void **)0); }
+
+/* ./m_win.c */
+
+#undef set_menu_win
+int	set_menu_win(
+		MENU	*menu, 
+		WINDOW	*win)
+		{ return(*(int *)0); }
+
+#undef menu_win
+WINDOW	*menu_win(
+		const MENU *menu)
+		{ return(*(WINDOW **)0); }
diff -Naur ncurses-5.7.orig/menu/llib-lmenutw ncurses-5.7/menu/llib-lmenutw
--- ncurses-5.7.orig/menu/llib-lmenutw	1969-12-31 19:00:00.000000000 -0500
+++ ncurses-5.7/menu/llib-lmenutw	2011-01-08 18:13:50.495156782 -0500
@@ -0,0 +1,553 @@
+/****************************************************************************
+ * 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.                                                           *
+ ****************************************************************************/
+
+/****************************************************************************
+ *  Author: Thomas E. Dickey                    2010                        *
+ ****************************************************************************/
+/* LINTLIBRARY */
+
+/* ./m_attribs.c */
+
+#include <menu.priv.h>
+
+#undef set_menu_fore
+int	set_menu_fore(
+		MENU	*menu, 
+		chtype	attr)
+		{ return(*(int *)0); }
+
+#undef menu_fore
+chtype	menu_fore(
+		const MENU *menu)
+		{ return(*(chtype *)0); }
+
+#undef set_menu_back
+int	set_menu_back(
+		MENU	*menu, 
+		chtype	attr)
+		{ return(*(int *)0); }
+
+#undef menu_back
+chtype	menu_back(
+		const MENU *menu)
+		{ return(*(chtype *)0); }
+
+#undef set_menu_grey
+int	set_menu_grey(
+		MENU	*menu, 
+		chtype	attr)
+		{ return(*(int *)0); }
+
+#undef menu_grey
+chtype	menu_grey(
+		const MENU *menu)
+		{ return(*(chtype *)0); }
+
+/* ./m_cursor.c */
+
+#undef _nc_menu_cursor_pos
+int	_nc_menu_cursor_pos(
+		const MENU *menu, 
+		const ITEM *item, 
+		int	*pY, 
+		int	*pX)
+		{ return(*(int *)0); }
+
+#undef pos_menu_cursor
+int	pos_menu_cursor(
+		const MENU *menu)
+		{ return(*(int *)0); }
+
+/* ./m_driver.c */
+
+#undef _nc_Match_Next_Character_In_Item_Name
+int	_nc_Match_Next_Character_In_Item_Name(
+		MENU	*menu, 
+		int	ch, 
+		ITEM	**item)
+		{ return(*(int *)0); }
+
+#undef menu_driver
+int	menu_driver(
+		MENU	*menu, 
+		int	c)
+		{ return(*(int *)0); }
+
+/* ./m_format.c */
+
+#undef set_menu_format
+int	set_menu_format(
+		MENU	*menu, 
+		int	rows, 
+		int	cols)
+		{ return(*(int *)0); }
+
+#undef menu_format
+void	menu_format(
+		const MENU *menu, 
+		int	*rows, 
+		int	*cols)
+		{ /* void */ }
+
+/* ./m_global.c */
+
+#undef _nc_Default_Menu
+MENU	_nc_Default_Menu;
+#undef _nc_Default_Item
+ITEM	_nc_Default_Item;
+
+#undef _nc_Connect_Items
+NCURSES_BOOL _nc_Connect_Items(
+		MENU	*menu, 
+		ITEM	**items)
+		{ return(*(NCURSES_BOOL *)0); }
+
+#undef _nc_Disconnect_Items
+void	_nc_Disconnect_Items(
+		MENU	*menu)
+		{ /* void */ }
+
+#undef _nc_Calculate_Text_Width
+int	_nc_Calculate_Text_Width(
+		const TEXT *item)
+		{ return(*(int *)0); }
+
+#undef _nc_Calculate_Item_Length_and_Width
+void	_nc_Calculate_Item_Length_and_Width(
+		MENU	*menu)
+		{ /* void */ }
+
+#undef _nc_Link_Items
+void	_nc_Link_Items(
+		MENU	*menu)
+		{ /* void */ }
+
+#undef _nc_Show_Menu
+void	_nc_Show_Menu(
+		const MENU *menu)
+		{ /* void */ }
+
+#undef _nc_New_TopRow_and_CurrentItem
+void	_nc_New_TopRow_and_CurrentItem(
+		MENU	*menu, 
+		int	new_toprow, 
+		ITEM	*new_current_item)
+		{ /* void */ }
+
+/* ./m_hook.c */
+
+#undef set_menu_init
+int	set_menu_init(
+		MENU	*menu, 
+		Menu_Hook func)
+		{ return(*(int *)0); }
+
+#undef menu_init
+Menu_Hook menu_init(
+		const MENU *menu)
+		{ return(*(Menu_Hook *)0); }
+
+#undef set_menu_term
+int	set_menu_term(
+		MENU	*menu, 
+		Menu_Hook func)
+		{ return(*(int *)0); }
+
+#undef menu_term
+Menu_Hook menu_term(
+		const MENU *menu)
+		{ return(*(Menu_Hook *)0); }
+
+#undef set_item_init
+int	set_item_init(
+		MENU	*menu, 
+		Menu_Hook func)
+		{ return(*(int *)0); }
+
+#undef item_init
+Menu_Hook item_init(
+		const MENU *menu)
+		{ return(*(Menu_Hook *)0); }
+
+#undef set_item_term
+int	set_item_term(
+		MENU	*menu, 
+		Menu_Hook func)
+		{ return(*(int *)0); }
+
+#undef item_term
+Menu_Hook item_term(
+		const MENU *menu)
+		{ return(*(Menu_Hook *)0); }
+
+/* ./m_item_cur.c */
+
+#undef set_current_item
+int	set_current_item(
+		MENU	*menu, 
+		ITEM	*item)
+		{ return(*(int *)0); }
+
+#undef current_item
+ITEM	*current_item(
+		const MENU *menu)
+		{ return(*(ITEM **)0); }
+
+#undef item_index
+int	item_index(
+		const ITEM *item)
+		{ return(*(int *)0); }
+
+/* ./m_item_nam.c */
+
+#undef item_name
+const char *item_name(
+		const ITEM *item)
+		{ return(*(const char **)0); }
+
+#undef item_description
+const char *item_description(
+		const ITEM *item)
+		{ return(*(const char **)0); }
+
+/* ./m_item_new.c */
+
+#include <wctype.h>
+
+#undef new_item
+ITEM	*new_item(
+		const char *name, 
+		const char *description)
+		{ return(*(ITEM **)0); }
+
+#undef free_item
+int	free_item(
+		ITEM	*item)
+		{ return(*(int *)0); }
+
+#undef set_menu_mark
+int	set_menu_mark(
+		MENU	*menu, 
+		const char *mark)
+		{ return(*(int *)0); }
+
+#undef menu_mark
+const char *menu_mark(
+		const MENU *menu)
+		{ return(*(const char **)0); }
+
+/* ./m_item_opt.c */
+
+#undef set_item_opts
+int	set_item_opts(
+		ITEM	*item, 
+		Item_Options opts)
+		{ return(*(int *)0); }
+
+#undef item_opts_off
+int	item_opts_off(
+		ITEM	*item, 
+		Item_Options opts)
+		{ return(*(int *)0); }
+
+#undef item_opts_on
+int	item_opts_on(
+		ITEM	*item, 
+		Item_Options opts)
+		{ return(*(int *)0); }
+
+#undef item_opts
+Item_Options item_opts(
+		const ITEM *item)
+		{ return(*(Item_Options *)0); }
+
+/* ./m_item_top.c */
+
+#undef set_top_row
+int	set_top_row(
+		MENU	*menu, 
+		int	row)
+		{ return(*(int *)0); }
+
+#undef top_row
+int	top_row(
+		const MENU *menu)
+		{ return(*(int *)0); }
+
+/* ./m_item_use.c */
+
+#undef set_item_userptr
+int	set_item_userptr(
+		ITEM	*item, 
+		void	*userptr)
+		{ return(*(int *)0); }
+
+#undef item_userptr
+void	*item_userptr(
+		const ITEM *item)
+		{ return(*(void **)0); }
+
+/* ./m_item_val.c */
+
+#undef set_item_value
+int	set_item_value(
+		ITEM	*item, 
+		NCURSES_BOOL value)
+		{ return(*(int *)0); }
+
+#undef item_value
+NCURSES_BOOL item_value(
+		const ITEM *item)
+		{ return(*(NCURSES_BOOL *)0); }
+
+/* ./m_item_vis.c */
+
+#undef item_visible
+NCURSES_BOOL item_visible(
+		const ITEM *item)
+		{ return(*(NCURSES_BOOL *)0); }
+
+/* ./m_items.c */
+
+#undef set_menu_items
+int	set_menu_items(
+		MENU	*menu, 
+		ITEM	**items)
+		{ return(*(int *)0); }
+
+#undef menu_items
+ITEM	**menu_items(
+		const MENU *menu)
+		{ return(*(ITEM ***)0); }
+
+#undef item_count
+int	item_count(
+		const MENU *menu)
+		{ return(*(int *)0); }
+
+/* ./m_new.c */
+
+#undef new_menu_sp
+MENU	*new_menu_sp(
+		SCREEN	*sp, 
+		ITEM	**items)
+		{ return(*(MENU **)0); }
+
+#undef new_menu
+MENU	*new_menu(
+		ITEM	**items)
+		{ return(*(MENU **)0); }
+
+#undef free_menu
+int	free_menu(
+		MENU	*menu)
+		{ return(*(int *)0); }
+
+/* ./m_opts.c */
+
+#undef set_menu_opts
+int	set_menu_opts(
+		MENU	*menu, 
+		Menu_Options opts)
+		{ return(*(int *)0); }
+
+#undef menu_opts_off
+int	menu_opts_off(
+		MENU	*menu, 
+		Menu_Options opts)
+		{ return(*(int *)0); }
+
+#undef menu_opts_on
+int	menu_opts_on(
+		MENU	*menu, 
+		Menu_Options opts)
+		{ return(*(int *)0); }
+
+#undef menu_opts
+Menu_Options menu_opts(
+		const MENU *menu)
+		{ return(*(Menu_Options *)0); }
+
+/* ./m_pad.c */
+
+#undef set_menu_pad
+int	set_menu_pad(
+		MENU	*menu, 
+		int	pad)
+		{ return(*(int *)0); }
+
+#undef menu_pad
+int	menu_pad(
+		const MENU *menu)
+		{ return(*(int *)0); }
+
+/* ./m_pattern.c */
+
+#undef menu_pattern
+char	*menu_pattern(
+		const MENU *menu)
+		{ return(*(char **)0); }
+
+#undef set_menu_pattern
+int	set_menu_pattern(
+		MENU	*menu, 
+		const char *p)
+		{ return(*(int *)0); }
+
+/* ./m_post.c */
+
+#undef _nc_Post_Item
+void	_nc_Post_Item(
+		const MENU *menu, 
+		const ITEM *item)
+		{ /* void */ }
+
+#undef _nc_Draw_Menu
+void	_nc_Draw_Menu(
+		const MENU *menu)
+		{ /* void */ }
+
+#undef post_menu
+int	post_menu(
+		MENU	*menu)
+		{ return(*(int *)0); }
+
+#undef unpost_menu
+int	unpost_menu(
+		MENU	*menu)
+		{ return(*(int *)0); }
+
+/* ./m_req_name.c */
+
+#undef menu_request_name
+const char *menu_request_name(
+		int	request)
+		{ return(*(const char **)0); }
+
+#undef menu_request_by_name
+int	menu_request_by_name(
+		const char *str)
+		{ return(*(int *)0); }
+
+/* ./m_scale.c */
+
+#undef scale_menu
+int	scale_menu(
+		const MENU *menu, 
+		int	*rows, 
+		int	*cols)
+		{ return(*(int *)0); }
+
+/* ./m_spacing.c */
+
+#undef set_menu_spacing
+int	set_menu_spacing(
+		MENU	*menu, 
+		int	s_desc, 
+		int	s_row, 
+		int	s_col)
+		{ return(*(int *)0); }
+
+#undef menu_spacing
+int	menu_spacing(
+		const MENU *menu, 
+		int	*s_desc, 
+		int	*s_row, 
+		int	*s_col)
+		{ return(*(int *)0); }
+
+/* ./m_sub.c */
+
+#undef set_menu_sub
+int	set_menu_sub(
+		MENU	*menu, 
+		WINDOW	*win)
+		{ return(*(int *)0); }
+
+#undef menu_sub
+WINDOW	*menu_sub(
+		const MENU *menu)
+		{ return(*(WINDOW **)0); }
+
+/* ./m_trace.c */
+
+#undef _nc_retrace_item
+ITEM	*_nc_retrace_item(
+		ITEM	*code)
+		{ return(*(ITEM **)0); }
+
+#undef _nc_retrace_item_ptr
+ITEM	**_nc_retrace_item_ptr(
+		ITEM	**code)
+		{ return(*(ITEM ***)0); }
+
+#undef _nc_retrace_item_opts
+Item_Options _nc_retrace_item_opts(
+		Item_Options code)
+		{ return(*(Item_Options *)0); }
+
+#undef _nc_retrace_menu
+MENU	*_nc_retrace_menu(
+		MENU	*code)
+		{ return(*(MENU **)0); }
+
+#undef _nc_retrace_menu_hook
+Menu_Hook _nc_retrace_menu_hook(
+		Menu_Hook code)
+		{ return(*(Menu_Hook *)0); }
+
+#undef _nc_retrace_menu_opts
+Menu_Options _nc_retrace_menu_opts(
+		Menu_Options code)
+		{ return(*(Menu_Options *)0); }
+
+/* ./m_userptr.c */
+
+#undef set_menu_userptr
+int	set_menu_userptr(
+		MENU	*menu, 
+		void	*userptr)
+		{ return(*(int *)0); }
+
+#undef menu_userptr
+void	*menu_userptr(
+		const MENU *menu)
+		{ return(*(void **)0); }
+
+/* ./m_win.c */
+
+#undef set_menu_win
+int	set_menu_win(
+		MENU	*menu, 
+		WINDOW	*win)
+		{ return(*(int *)0); }
+
+#undef menu_win
+WINDOW	*menu_win(
+		const MENU *menu)
+		{ return(*(WINDOW **)0); }
diff -Naur ncurses-5.7.orig/menu/llib-lmenuw ncurses-5.7/menu/llib-lmenuw
--- ncurses-5.7.orig/menu/llib-lmenuw	2005-08-20 14:41:56.000000000 -0400
+++ ncurses-5.7/menu/llib-lmenuw	2011-01-08 18:13:50.507157863 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2002,2005 Free Software Foundation, Inc.                   *
+ * Copyright (c) 2002-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            *
@@ -27,13 +27,13 @@
  ****************************************************************************/
 
 /****************************************************************************
- *  Author: Thomas E. Dickey                    2002,2005                   *
+ *  Author: Thomas E. Dickey                    2002-2005,2010              *
  ****************************************************************************/
 /* LINTLIBRARY */
 
 /* ./m_attribs.c */
 
-#include "menu.priv.h"
+#include <menu.priv.h>
 
 #undef set_menu_fore
 int	set_menu_fore(
@@ -352,6 +352,12 @@
 
 /* ./m_new.c */
 
+#undef new_menu_sp
+MENU	*new_menu_sp(
+		SCREEN	*sp, 
+		ITEM	**items)
+		{ return(*(MENU **)0); }
+
 #undef new_menu
 MENU	*new_menu(
 		ITEM	**items)
diff -Naur ncurses-5.7.orig/menu/m_attribs.c ncurses-5.7/menu/m_attribs.c
--- ncurses-5.7.orig/menu/m_attribs.c	2004-12-11 18:29:12.000000000 -0500
+++ ncurses-5.7/menu/m_attribs.c	2011-01-08 18:13:50.507157863 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,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            *
@@ -37,7 +37,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_attribs.c,v 1.14 2004/12/11 23:29:12 tom Exp $")
+MODULE_ID("$Id: m_attribs.c,v 1.16 2010/01/23 21:16:54 tom Exp $")
 
 /* Macro to redraw menu if it is posted and changed */
 #define Refresh_Menu(menu) \
@@ -49,9 +49,9 @@
 
 /* "Template" macro to generate a function to set a menus attribute */
 #define GEN_MENU_ATTR_SET_FCT( name ) \
-NCURSES_IMPEXP int NCURSES_API set_menu_ ## name (MENU * menu, chtype attr)\
+NCURSES_IMPEXP int NCURSES_API set_menu_ ## name (MENU* menu, chtype attr) \
 {\
-   T((T_CALLED("set_menu_" #name "(%p,%s)"), menu, _traceattr(attr)));\
+  T((T_CALLED("set_menu_" #name "(%p,%s)"), menu, _traceattr(attr))); \
    if (!(attr==A_NORMAL || (attr & A_ATTRIBUTES)==attr))\
       RETURN(E_BAD_ARGUMENT);\
    if (menu && ( menu -> name != attr))\
@@ -67,7 +67,7 @@
 #define GEN_MENU_ATTR_GET_FCT( name ) \
 NCURSES_IMPEXP chtype NCURSES_API menu_ ## name (const MENU * menu)\
 {\
-   T((T_CALLED("menu_" #name "(%p)"), menu));\
+   T((T_CALLED("menu_" #name "(%p)"), (const void *) menu));\
    returnAttr(Normalize_Menu( menu ) -> name);\
 }
 
@@ -140,4 +140,5 @@
 |   Return Values :  Attribute value
 +--------------------------------------------------------------------------*/
 GEN_MENU_ATTR_GET_FCT(grey)
+
 /* m_attribs.c ends here */
diff -Naur ncurses-5.7.orig/menu/m_cursor.c ncurses-5.7/menu/m_cursor.c
--- ncurses-5.7.orig/menu/m_cursor.c	2005-10-22 19:03:32.000000000 -0400
+++ ncurses-5.7/menu/m_cursor.c	2011-01-08 18:13:50.507157863 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2004,2005 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            *
@@ -37,7 +37,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_cursor.c,v 1.20 2005/10/22 23:03:32 tom Exp $")
+MODULE_ID("$Id: m_cursor.c,v 1.22 2010/01/23 21:20:10 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu
@@ -86,11 +86,11 @@
   int x = 0, y = 0;
   int err = _nc_menu_cursor_pos(menu, (ITEM *) 0, &y, &x);
 
-  T((T_CALLED("pos_menu_cursor(%p)"), menu));
+  T((T_CALLED("pos_menu_cursor(%p)"), (const void *)menu));
 
   if (E_OK == err)
     {
-      win = menu->userwin ? menu->userwin : stdscr;
+      win = Get_Menu_UserWin(menu);
       sub = menu->usersub ? menu->usersub : win;
       assert(win && sub);
 
diff -Naur ncurses-5.7.orig/menu/m_driver.c ncurses-5.7/menu/m_driver.c
--- ncurses-5.7.orig/menu/m_driver.c	2008-08-03 18:08:22.000000000 -0400
+++ ncurses-5.7/menu/m_driver.c	2011-01-08 18:13:50.511157444 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2005,2008 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            *
@@ -37,7 +37,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_driver.c,v 1.27 2008/08/03 22:08:22 tom Exp $")
+MODULE_ID("$Id: m_driver.c,v 1.29 2010/01/23 21:20:10 tom Exp $")
 
 /* Macros */
 
@@ -121,7 +121,8 @@
   bool found = FALSE, passed = FALSE;
   int idx, last;
 
-  T((T_CALLED("_nc_Match_Next_Character(%p,%d,%p)"), menu, ch, item));
+  T((T_CALLED("_nc_Match_Next_Character(%p,%d,%p)"),
+     (void *)menu, ch, (void *)item));
 
   assert(menu && item && *item);
   idx = (*item)->index;
@@ -197,7 +198,7 @@
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu
-|   Function      :  int menu_driver(MENU *menu, int c)
+|   Function      :  int menu_driver(MENU* menu, int c)
 |
 |   Description   :  Central dispatcher for the menu. Translates the logical
 |                    request 'c' into a menu action.
@@ -220,7 +221,7 @@
   ITEM *item;
   int my_top_row, rdiff;
 
-  T((T_CALLED("menu_driver(%p,%d)"), menu, c));
+  T((T_CALLED("menu_driver(%p,%d)"), (void *)menu, c));
 
   if (!menu)
     RETURN(E_BAD_ARGUMENT);
diff -Naur ncurses-5.7.orig/menu/m_format.c ncurses-5.7/menu/m_format.c
--- ncurses-5.7.orig/menu/m_format.c	2004-12-11 18:11:21.000000000 -0500
+++ ncurses-5.7/menu/m_format.c	2011-01-08 18:13:50.511157444 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,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            *
@@ -37,7 +37,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_format.c,v 1.15 2004/12/11 23:11:21 tom Exp $")
+MODULE_ID("$Id: m_format.c,v 1.16 2010/01/23 21:20:10 tom Exp $")
 
 #define minimum(a,b) ((a)<(b) ? (a): (b))
 
@@ -60,7 +60,7 @@
 {
   int total_rows, total_cols;
 
-  T((T_CALLED("set_menu_format(%p,%d,%d)"), menu, rows, cols));
+  T((T_CALLED("set_menu_format(%p,%d,%d)"), (void *)menu, rows, cols));
 
   if (rows < 0 || cols < 0)
     RETURN(E_BAD_ARGUMENT);
diff -Naur ncurses-5.7.orig/menu/m_global.c ncurses-5.7/menu/m_global.c
--- ncurses-5.7.orig/menu/m_global.c	2005-12-31 16:51:52.000000000 -0500
+++ ncurses-5.7/menu/m_global.c	2011-01-08 18:13:50.511157444 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2004,2005 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            *
@@ -37,7 +37,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_global.c,v 1.23 2005/12/31 21:51:52 tom Exp $")
+MODULE_ID("$Id: m_global.c,v 1.25 2010/01/23 21:20:10 tom Exp $")
 
 static char mark[] = "-";
 /* *INDENT-OFF* */
@@ -253,7 +253,7 @@
 #if USE_WIDEC_SUPPORT
   int result = item->length;
 
-  T((T_CALLED("_nc_menu_text_width(%p)"), item));
+  T((T_CALLED("_nc_menu_text_width(%p)"), (const void *)item));
   if (result != 0 && item->str != 0)
     {
       int count = mbstowcs(0, item->str, 0);
@@ -496,7 +496,7 @@
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu  
-|   Function      :  void _nc_Show_Menu(const MENU *menu)
+|   Function      :  void _nc_Show_Menu(const MENU* menu)
 |   
 |   Description   :  Update the window that is associated with the menu
 |
@@ -543,8 +543,10 @@
 |   Return Values :  -
 +--------------------------------------------------------------------------*/
 NCURSES_EXPORT(void)
-  _nc_New_TopRow_and_CurrentItem
-  (MENU * menu, int new_toprow, ITEM * new_current_item)
+_nc_New_TopRow_and_CurrentItem(
+				MENU * menu,
+				int new_toprow,
+				ITEM * new_current_item)
 {
   ITEM *cur_item;
   bool mterm_called = FALSE;
diff -Naur ncurses-5.7.orig/menu/m_hook.c ncurses-5.7/menu/m_hook.c
--- ncurses-5.7.orig/menu/m_hook.c	2004-12-25 16:39:52.000000000 -0500
+++ ncurses-5.7/menu/m_hook.c	2011-01-08 18:13:50.511157444 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,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            *
@@ -37,7 +37,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_hook.c,v 1.14 2004/12/25 21:39:52 tom Exp $")
+MODULE_ID("$Id: m_hook.c,v 1.15 2010/01/23 21:16:54 tom Exp $")
 
 /* "Template" macro to generate function to set application specific hook */
 #define GEN_HOOK_SET_FUNCTION( typ, name ) \
@@ -52,7 +52,7 @@
 #define GEN_HOOK_GET_FUNCTION( typ, name ) \
 NCURSES_IMPEXP Menu_Hook NCURSES_API typ ## _ ## name ( const MENU *menu )\
 {\
-   T((T_CALLED(#typ "_" #name "(%p)"), menu));\
+   T((T_CALLED(#typ "_" #name "(%p)"), (const void *) menu));\
    returnMenuHook(Normalize_Menu(menu) -> typ ## name);\
 }
 
diff -Naur ncurses-5.7.orig/menu/m_item_cur.c ncurses-5.7/menu/m_item_cur.c
--- ncurses-5.7.orig/menu/m_item_cur.c	2004-12-25 16:57:38.000000000 -0500
+++ ncurses-5.7/menu/m_item_cur.c	2011-01-08 18:13:50.511157444 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,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            *
@@ -37,7 +37,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_item_cur.c,v 1.17 2004/12/25 21:57:38 tom Exp $")
+MODULE_ID("$Id: m_item_cur.c,v 1.18 2010/01/23 21:20:10 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu  
@@ -50,7 +50,7 @@
 NCURSES_EXPORT(int)
 set_current_item(MENU * menu, ITEM * item)
 {
-  T((T_CALLED("set_current_item(%p,%p)"), menu, item));
+  T((T_CALLED("set_current_item(%p,%p)"), (void *)menu, (void *)item));
 
   if (menu && item && (item->imenu == menu))
     {
@@ -91,7 +91,7 @@
 NCURSES_EXPORT(ITEM *)
 current_item(const MENU * menu)
 {
-  T((T_CALLED("current_item(%p)"), menu));
+  T((T_CALLED("current_item(%p)"), (const void *)menu));
   returnItem((menu && menu->items) ? menu->curitem : (ITEM *) 0);
 }
 
@@ -106,7 +106,7 @@
 NCURSES_EXPORT(int)
 item_index(const ITEM * item)
 {
-  T((T_CALLED("item_index(%p)"), item));
+  T((T_CALLED("item_index(%p)"), (const void *)item));
   returnCode((item && item->imenu) ? item->index : ERR);
 }
 
diff -Naur ncurses-5.7.orig/menu/m_item_nam.c ncurses-5.7/menu/m_item_nam.c
--- ncurses-5.7.orig/menu/m_item_nam.c	2004-12-25 16:41:54.000000000 -0500
+++ ncurses-5.7/menu/m_item_nam.c	2011-01-08 18:13:50.511157444 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,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            *
@@ -37,7 +37,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_item_nam.c,v 1.14 2004/12/25 21:41:54 tom Exp $")
+MODULE_ID("$Id: m_item_nam.c,v 1.15 2010/01/23 21:20:10 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu  
@@ -50,7 +50,7 @@
 NCURSES_EXPORT(const char *)
 item_name(const ITEM * item)
 {
-  T((T_CALLED("item_name(%p)"), item));
+  T((T_CALLED("item_name(%p)"), (const void *)item));
   returnCPtr((item) ? item->name.str : (char *)0);
 }
 
@@ -65,7 +65,7 @@
 NCURSES_EXPORT(const char *)
 item_description(const ITEM * item)
 {
-  T((T_CALLED("item_description(%p)"), item));
+  T((T_CALLED("item_description(%p)"), (const void *)item));
   returnCPtr((item) ? item->description.str : (char *)0);
 }
 
diff -Naur ncurses-5.7.orig/menu/m_item_new.c ncurses-5.7/menu/m_item_new.c
--- ncurses-5.7.orig/menu/m_item_new.c	2006-12-17 14:47:09.000000000 -0500
+++ ncurses-5.7/menu/m_item_new.c	2011-01-08 18:13:50.511157444 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2005,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            *
@@ -44,7 +44,7 @@
 #endif
 #endif
 
-MODULE_ID("$Id: m_item_new.c,v 1.27 2006/12/17 19:47:09 tom Exp $")
+MODULE_ID("$Id: m_item_new.c,v 1.30 2010/01/23 21:20:11 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu  
@@ -122,7 +122,7 @@
     }
   else
     {
-      item = (ITEM *) calloc(1, sizeof(ITEM));
+      item = typeCalloc(ITEM, 1);
       if (item)
 	{
 	  *item = _nc_Default_Item;	/* hope we have struct assignment */
@@ -162,7 +162,7 @@
 NCURSES_EXPORT(int)
 free_item(ITEM * item)
 {
-  T((T_CALLED("free_item(%p)"), item));
+  T((T_CALLED("free_item(%p)"), (void *)item));
 
   if (!item)
     RETURN(E_BAD_ARGUMENT);
@@ -197,7 +197,7 @@
 {
   unsigned l;
 
-  T((T_CALLED("set_menu_mark(%p,%s)"), menu, _nc_visbuf(mark)));
+  T((T_CALLED("set_menu_mark(%p,%s)"), (void *)menu, _nc_visbuf(mark)));
 
   if (mark && (*mark != '\0') && Is_Printable_String(mark))
     l = strlen(mark);
@@ -219,7 +219,7 @@
       menu->marklen = l;
       if (l)
 	{
-	  menu->mark = (char *)malloc(l + 1);
+	  menu->mark = strdup(mark);
 	  if (menu->mark)
 	    {
 	      strcpy(menu->mark, mark);
@@ -229,6 +229,7 @@
 	  else
 	    {
 	      menu->mark = old_mark;
+	      menu->marklen = (old_mark != 0) ? strlen(old_mark) : 0;
 	      RETURN(E_SYSTEM_ERROR);
 	    }
 	}
@@ -267,7 +268,7 @@
 NCURSES_EXPORT(const char *)
 menu_mark(const MENU * menu)
 {
-  T((T_CALLED("menu_mark(%p)"), menu));
+  T((T_CALLED("menu_mark(%p)"), (const void *)menu));
   returnPtr(Normalize_Menu(menu)->mark);
 }
 
diff -Naur ncurses-5.7.orig/menu/m_item_opt.c ncurses-5.7/menu/m_item_opt.c
--- ncurses-5.7.orig/menu/m_item_opt.c	2004-12-25 16:32:54.000000000 -0500
+++ ncurses-5.7/menu/m_item_opt.c	2011-01-08 18:13:50.511157444 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,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            *
@@ -37,7 +37,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_item_opt.c,v 1.17 2004/12/25 21:32:54 tom Exp $")
+MODULE_ID("$Id: m_item_opt.c,v 1.18 2010/01/23 21:20:10 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu  
@@ -53,7 +53,7 @@
 NCURSES_EXPORT(int)
 set_item_opts(ITEM * item, Item_Options opts)
 {
-  T((T_CALLED("set_menu_opts(%p,%d)"), item, opts));
+  T((T_CALLED("set_menu_opts(%p,%d)"), (void *)item, opts));
 
   opts &= ALL_ITEM_OPTS;
 
@@ -100,7 +100,7 @@
 
 				   NULL item itself to adjust its behavior */
 
-  T((T_CALLED("item_opts_off(%p,%d)"), item, opts));
+  T((T_CALLED("item_opts_off(%p,%d)"), (void *)item, opts));
 
   if (opts & ~ALL_ITEM_OPTS)
     RETURN(E_BAD_ARGUMENT);
@@ -128,7 +128,7 @@
 
 				   NULL item itself to adjust its behavior */
 
-  T((T_CALLED("item_opts_on(%p,%d)"), item, opts));
+  T((T_CALLED("item_opts_on(%p,%d)"), (void *)item, opts));
 
   opts &= ALL_ITEM_OPTS;
   if (opts & ~ALL_ITEM_OPTS)
@@ -152,7 +152,7 @@
 NCURSES_EXPORT(Item_Options)
 item_opts(const ITEM * item)
 {
-  T((T_CALLED("item_opts(%p)"), item));
+  T((T_CALLED("item_opts(%p)"), (const void *)item));
   returnItemOpts(ALL_ITEM_OPTS & Normalize_Item(item)->opt);
 }
 
diff -Naur ncurses-5.7.orig/menu/m_item_top.c ncurses-5.7/menu/m_item_top.c
--- ncurses-5.7.orig/menu/m_item_top.c	2004-12-11 18:29:34.000000000 -0500
+++ ncurses-5.7/menu/m_item_top.c	2011-01-08 18:13:50.511157444 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,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            *
@@ -37,7 +37,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_item_top.c,v 1.10 2004/12/11 23:29:34 tom Exp $")
+MODULE_ID("$Id: m_item_top.c,v 1.11 2010/01/23 21:20:10 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu  
@@ -54,7 +54,7 @@
 {
   ITEM *item;
 
-  T((T_CALLED("set_top_row(%p,%d)"), menu, row));
+  T((T_CALLED("set_top_row(%p,%d)"), (void *)menu, row));
 
   if (menu)
     {
@@ -94,7 +94,7 @@
 NCURSES_EXPORT(int)
 top_row(const MENU * menu)
 {
-  T((T_CALLED("top_row(%p)"), menu));
+  T((T_CALLED("top_row(%p)"), (const void *)menu));
   if (menu && menu->items && *(menu->items))
     {
       assert((menu->toprow >= 0) && (menu->toprow < menu->rows));
diff -Naur ncurses-5.7.orig/menu/m_item_use.c ncurses-5.7/menu/m_item_use.c
--- ncurses-5.7.orig/menu/m_item_use.c	2004-12-25 16:33:31.000000000 -0500
+++ ncurses-5.7/menu/m_item_use.c	2011-01-08 18:13:50.511157444 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,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            *
@@ -37,7 +37,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_item_use.c,v 1.16 2004/12/25 21:33:31 tom Exp $")
+MODULE_ID("$Id: m_item_use.c,v 1.17 2010/01/23 21:20:10 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu  
@@ -51,7 +51,7 @@
 NCURSES_EXPORT(int)
 set_item_userptr(ITEM * item, void *userptr)
 {
-  T((T_CALLED("set_item_userptr(%p,%p)"), item, userptr));
+  T((T_CALLED("set_item_userptr(%p,%p)"), (void *)item, (void *)userptr));
   Normalize_Item(item)->userptr = userptr;
   RETURN(E_OK);
 }
@@ -69,7 +69,7 @@
 NCURSES_EXPORT(void *)
 item_userptr(const ITEM * item)
 {
-  T((T_CALLED("item_userptr(%p)"), item));
+  T((T_CALLED("item_userptr(%p)"), (const void *)item));
   returnVoidPtr(Normalize_Item(item)->userptr);
 }
 
diff -Naur ncurses-5.7.orig/menu/m_item_val.c ncurses-5.7/menu/m_item_val.c
--- ncurses-5.7.orig/menu/m_item_val.c	2004-12-11 18:29:34.000000000 -0500
+++ ncurses-5.7/menu/m_item_val.c	2011-01-08 18:13:50.511157444 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,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            *
@@ -37,7 +37,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_item_val.c,v 1.14 2004/12/11 23:29:34 tom Exp $")
+MODULE_ID("$Id: m_item_val.c,v 1.15 2010/01/23 21:20:10 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu  
@@ -57,7 +57,7 @@
 {
   MENU *menu;
 
-  T((T_CALLED("set_item_value(%p,%d)"), item, value));
+  T((T_CALLED("set_item_value(%p,%d)"), (void *)item, value));
   if (item)
     {
       menu = item->imenu;
@@ -97,7 +97,7 @@
 NCURSES_EXPORT(bool)
 item_value(const ITEM * item)
 {
-  T((T_CALLED("item_value(%p)"), item));
+  T((T_CALLED("item_value(%p)"), (const void *)item));
   returnBool((Normalize_Item(item)->value) ? TRUE : FALSE);
 }
 
diff -Naur ncurses-5.7.orig/menu/m_item_vis.c ncurses-5.7/menu/m_item_vis.c
--- ncurses-5.7.orig/menu/m_item_vis.c	2004-12-25 16:40:09.000000000 -0500
+++ ncurses-5.7/menu/m_item_vis.c	2011-01-08 18:13:50.511157444 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,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            *
@@ -37,7 +37,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_item_vis.c,v 1.15 2004/12/25 21:40:09 tom Exp $")
+MODULE_ID("$Id: m_item_vis.c,v 1.16 2010/01/23 21:20:10 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu  
@@ -54,7 +54,7 @@
 {
   MENU *menu;
 
-  T((T_CALLED("item_visible(%p)"), item));
+  T((T_CALLED("item_visible(%p)"), (const void *)item));
   if (item &&
       (menu = item->imenu) &&
       (menu->status & _POSTED) &&
diff -Naur ncurses-5.7.orig/menu/m_items.c ncurses-5.7/menu/m_items.c
--- ncurses-5.7.orig/menu/m_items.c	2005-01-15 20:02:23.000000000 -0500
+++ ncurses-5.7/menu/m_items.c	2011-01-08 18:13:50.515157538 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2004,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            *
@@ -37,7 +37,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_items.c,v 1.16 2005/01/16 01:02:23 tom Exp $")
+MODULE_ID("$Id: m_items.c,v 1.17 2010/01/23 21:20:10 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu  
@@ -55,7 +55,7 @@
 NCURSES_EXPORT(int)
 set_menu_items(MENU * menu, ITEM ** items)
 {
-  T((T_CALLED("set_menu_items(%p,%p)"), menu, items));
+  T((T_CALLED("set_menu_items(%p,%p)"), (void *)menu, (void *)items));
 
   if (!menu || (items && !(*items)))
     RETURN(E_BAD_ARGUMENT);
@@ -87,7 +87,7 @@
 NCURSES_EXPORT(ITEM **)
 menu_items(const MENU * menu)
 {
-  T((T_CALLED("menu_items(%p)"), menu));
+  T((T_CALLED("menu_items(%p)"), (const void *)menu));
   returnItemPtr(menu ? menu->items : (ITEM **) 0);
 }
 
@@ -103,7 +103,7 @@
 NCURSES_EXPORT(int)
 item_count(const MENU * menu)
 {
-  T((T_CALLED("item_count(%p)"), menu));
+  T((T_CALLED("item_count(%p)"), (const void *)menu));
   returnCode(menu ? menu->nitems : -1);
 }
 
diff -Naur ncurses-5.7.orig/menu/m_new.c ncurses-5.7/menu/m_new.c
--- ncurses-5.7.orig/menu/m_new.c	2006-11-04 14:04:06.000000000 -0500
+++ ncurses-5.7/menu/m_new.c	2011-01-08 18:13:50.515157538 -0500
@@ -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            *
@@ -37,11 +37,11 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_new.c,v 1.18 2006/11/04 19:04:06 tom Exp $")
+MODULE_ID("$Id: m_new.c,v 1.21 2010/01/23 21:20:11 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu  
-|   Function      :  MENU *new_menu(ITEM **items)
+|   Function      :  MENU* _nc_new_menu(SCREEN*, ITEM **items)
 |   
 |   Description   :  Creates a new menu connected to the item pointer
 |                    array items and returns a pointer to the new menu.
@@ -51,18 +51,25 @@
 |   Return Values :  NULL on error
 +--------------------------------------------------------------------------*/
 NCURSES_EXPORT(MENU *)
-new_menu(ITEM ** items)
+NCURSES_SP_NAME(new_menu) (NCURSES_SP_DCLx ITEM ** items)
 {
   int err = E_SYSTEM_ERROR;
-  MENU *menu = (MENU *) calloc(1, sizeof(MENU));
+  MENU *menu = typeCalloc(MENU, 1);
 
-  T((T_CALLED("new_menu(%p)"), items));
+  T((T_CALLED("new_menu(%p,%p)"), (void *)SP_PARM, (void *)items));
   if (menu)
     {
       *menu = _nc_Default_Menu;
       menu->status = 0;
       menu->rows = menu->frows;
       menu->cols = menu->fcols;
+#if NCURSES_SP_FUNCS
+      /* This ensures userwin and usersub are always non-null,
+         so we can derive always the SCREEN that this menu is
+         running on. */
+      menu->userwin = SP_PARM->_stdscr;
+      menu->usersub = SP_PARM->_stdscr;
+#endif
       if (items && *items)
 	{
 	  if (!_nc_Connect_Items(menu, items))
@@ -71,6 +78,8 @@
 	      free(menu);
 	      menu = (MENU *) 0;
 	    }
+	  else
+	    err = E_OK;
 	}
     }
 
@@ -82,6 +91,25 @@
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu  
+|   Function      :  MENU *new_menu(ITEM **items)
+|   
+|   Description   :  Creates a new menu connected to the item pointer
+|                    array items and returns a pointer to the new menu.
+|                    The new menu is initialized with the values from the
+|                    default menu.
+|
+|   Return Values :  NULL on error
++--------------------------------------------------------------------------*/
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(MENU *)
+new_menu(ITEM ** items)
+{
+  return NCURSES_SP_NAME(new_menu) (CURRENT_SCREEN, items);
+}
+#endif
+
+/*---------------------------------------------------------------------------
+|   Facility      :  libnmenu  
 |   Function      :  int free_menu(MENU *menu)  
 |   
 |   Description   :  Disconnects menu from its associated item pointer 
@@ -94,7 +122,7 @@
 NCURSES_EXPORT(int)
 free_menu(MENU * menu)
 {
-  T((T_CALLED("free_menu(%p)"), menu));
+  T((T_CALLED("free_menu(%p)"), (void *)menu));
   if (!menu)
     RETURN(E_BAD_ARGUMENT);
 
diff -Naur ncurses-5.7.orig/menu/m_opts.c ncurses-5.7/menu/m_opts.c
--- ncurses-5.7.orig/menu/m_opts.c	2004-12-25 16:36:12.000000000 -0500
+++ ncurses-5.7/menu/m_opts.c	2011-01-08 18:13:50.515157538 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,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            *
@@ -37,7 +37,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_opts.c,v 1.19 2004/12/25 21:36:12 tom Exp $")
+MODULE_ID("$Id: m_opts.c,v 1.20 2010/01/23 21:20:10 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu
@@ -55,7 +55,7 @@
 NCURSES_EXPORT(int)
 set_menu_opts(MENU * menu, Menu_Options opts)
 {
-  T((T_CALLED("set_menu_opts(%p,%d)"), menu, opts));
+  T((T_CALLED("set_menu_opts(%p,%d)"), (void *)menu, opts));
 
   opts &= ALL_MENU_OPTS;
 
@@ -119,7 +119,7 @@
 
 				   NULL menu itself to adjust its behavior */
 
-  T((T_CALLED("menu_opts_off(%p,%d)"), menu, opts));
+  T((T_CALLED("menu_opts_off(%p,%d)"), (void *)menu, opts));
 
   opts &= ALL_MENU_OPTS;
   if (opts & ~ALL_MENU_OPTS)
@@ -152,7 +152,7 @@
 
 				   NULL menu itself to adjust its behavior */
 
-  T((T_CALLED("menu_opts_on(%p,%d)"), menu, opts));
+  T((T_CALLED("menu_opts_on(%p,%d)"), (void *)menu, opts));
 
   opts &= ALL_MENU_OPTS;
   if (opts & ~ALL_MENU_OPTS)
@@ -176,7 +176,7 @@
 NCURSES_EXPORT(Menu_Options)
 menu_opts(const MENU * menu)
 {
-  T((T_CALLED("menu_opts(%p)"), menu));
+  T((T_CALLED("menu_opts(%p)"), (const void *)menu));
   returnMenuOpts(ALL_MENU_OPTS & Normalize_Menu(menu)->opt);
 }
 
diff -Naur ncurses-5.7.orig/menu/m_pad.c ncurses-5.7/menu/m_pad.c
--- ncurses-5.7.orig/menu/m_pad.c	2004-12-25 16:40:58.000000000 -0500
+++ ncurses-5.7/menu/m_pad.c	2011-01-08 18:13:50.515157538 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,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            *
@@ -37,19 +37,19 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_pad.c,v 1.10 2004/12/25 21:40:58 tom Exp $")
+MODULE_ID("$Id: m_pad.c,v 1.12 2010/01/23 21:20:10 tom Exp $")
 
 /* Macro to redraw menu if it is posted and changed */
 #define Refresh_Menu(menu) \
    if ( (menu) && ((menu)->status & _POSTED) )\
    {\
       _nc_Draw_Menu( menu );\
-      _nc_Show_Menu( menu );\
+      _nc_Show_Menu( menu ); \
    }
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu  
-|   Function      :  int set_menu_pad(MENU *menu, int pad)
+|   Function      :  int set_menu_pad(MENU* menu, int pad)
 |   
 |   Description   :  Set the character to be used to separate the item name
 |                    from its description. This must be a printable 
@@ -63,7 +63,7 @@
 {
   bool do_refresh = (menu != (MENU *) 0);
 
-  T((T_CALLED("set_menu_pad(%p,%d)"), menu, pad));
+  T((T_CALLED("set_menu_pad(%p,%d)"), (void *)menu, pad));
 
   if (!isprint(UChar(pad)))
     RETURN(E_BAD_ARGUMENT);
@@ -88,7 +88,7 @@
 NCURSES_EXPORT(int)
 menu_pad(const MENU * menu)
 {
-  T((T_CALLED("menu_pad(%p)"), menu));
+  T((T_CALLED("menu_pad(%p)"), (const void *)menu));
   returnCode(Normalize_Menu(menu)->pad);
 }
 
diff -Naur ncurses-5.7.orig/menu/m_pattern.c ncurses-5.7/menu/m_pattern.c
--- ncurses-5.7.orig/menu/m_pattern.c	2006-11-04 13:46:39.000000000 -0500
+++ ncurses-5.7/menu/m_pattern.c	2011-01-08 18:13:50.515157538 -0500
@@ -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            *
@@ -37,7 +37,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_pattern.c,v 1.15 2006/11/04 18:46:39 tom Exp $")
+MODULE_ID("$Id: m_pattern.c,v 1.16 2010/01/23 21:20:10 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu  
@@ -55,7 +55,7 @@
 {
   static char empty[] = "";
 
-  T((T_CALLED("menu_pattern(%p)"), menu));
+  T((T_CALLED("menu_pattern(%p)"), (const void *)menu));
   returnPtr(menu ? (menu->pattern ? menu->pattern : empty) : 0);
 }
 
@@ -78,7 +78,7 @@
   ITEM *matchitem;
   int matchpos;
 
-  T((T_CALLED("set_menu_pattern(%p,%s)"), menu, _nc_visbuf(p)));
+  T((T_CALLED("set_menu_pattern(%p,%s)"), (void *)menu, _nc_visbuf(p)));
 
   if (!menu || !p)
     RETURN(E_BAD_ARGUMENT);
diff -Naur ncurses-5.7.orig/menu/m_post.c ncurses-5.7/menu/m_post.c
--- ncurses-5.7.orig/menu/m_post.c	2004-12-25 18:57:04.000000000 -0500
+++ ncurses-5.7/menu/m_post.c	2011-01-08 18:13:50.515157538 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,2004 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            *
@@ -37,7 +37,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_post.c,v 1.26 2004/12/25 23:57:04 tom Exp $")
+MODULE_ID("$Id: m_post.c,v 1.29 2010/05/01 19:18:27 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu
@@ -171,7 +171,7 @@
 		    waddch(menu->win, ' ');
 		}
 	      if ((cy + j) < getmaxy(menu->win))
-		mvwaddch(menu->win, cy + j, cx - 1, menu->pad);
+		(void)mvwaddch(menu->win, cy + j, cx - 1, menu->pad);
 	    }
 	  wmove(menu->win, ncy, ncx);
 	  if (!isback)
@@ -255,7 +255,7 @@
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu
-|   Function      :  int post_menu(MENU *)
+|   Function      :  int post_menu(MENU* menu)
 |
 |   Description   :  Post a menu to the screen. This makes it visible.
 |
@@ -269,7 +269,7 @@
 NCURSES_EXPORT(int)
 post_menu(MENU * menu)
 {
-  T((T_CALLED("post_menu(%p)"), menu));
+  T((T_CALLED("post_menu(%p)"), (void *)menu));
 
   if (!menu)
     RETURN(E_BAD_ARGUMENT);
@@ -329,7 +329,7 @@
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu
-|   Function      :  int unpost_menu(MENU *)
+|   Function      :  int unpost_menu(MENU*)
 |
 |   Description   :  Detach menu from screen
 |
@@ -343,7 +343,7 @@
 {
   WINDOW *win;
 
-  T((T_CALLED("unpost_menu(%p)"), menu));
+  T((T_CALLED("unpost_menu(%p)"), (void *)menu));
 
   if (!menu)
     RETURN(E_BAD_ARGUMENT);
diff -Naur ncurses-5.7.orig/menu/m_req_name.c ncurses-5.7/menu/m_req_name.c
--- ncurses-5.7.orig/menu/m_req_name.c	2008-09-13 14:59:17.000000000 -0400
+++ ncurses-5.7/menu/m_req_name.c	2011-01-08 18:13:50.515157538 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2005,2008 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -37,7 +37,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_req_name.c,v 1.20 2008/09/13 18:59:17 tom Exp $")
+MODULE_ID("$Id: m_req_name.c,v 1.21 2009/10/10 16:17:23 tom Exp $")
 
 static const char *request_names[MAX_MENU_COMMAND - MIN_MENU_COMMAND + 1] =
 {
@@ -109,7 +109,7 @@
       strncpy(buf, str, sizeof(buf));
       while ((i < sizeof(buf)) && (buf[i] != '\0'))
 	{
-	  buf[i] = toupper(UChar(buf[i]));
+	  buf[i] = (char)toupper(UChar(buf[i]));
 	  i++;
 	}
 
diff -Naur ncurses-5.7.orig/menu/m_scale.c ncurses-5.7/menu/m_scale.c
--- ncurses-5.7.orig/menu/m_scale.c	2004-12-11 18:29:34.000000000 -0500
+++ ncurses-5.7/menu/m_scale.c	2011-01-08 18:13:50.515157538 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,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            *
@@ -37,7 +37,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_scale.c,v 1.9 2004/12/11 23:29:34 tom Exp $")
+MODULE_ID("$Id: m_scale.c,v 1.10 2010/01/23 21:20:10 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu  
@@ -53,7 +53,10 @@
 NCURSES_EXPORT(int)
 scale_menu(const MENU * menu, int *rows, int *cols)
 {
-  T((T_CALLED("scale_menu(%p,%p,%p)"), menu, rows, cols));
+  T((T_CALLED("scale_menu(%p,%p,%p)"),
+     (const void *)menu,
+     (void *)rows,
+     (void *)cols));
 
   if (!menu)
     RETURN(E_BAD_ARGUMENT);
diff -Naur ncurses-5.7.orig/menu/m_spacing.c ncurses-5.7/menu/m_spacing.c
--- ncurses-5.7.orig/menu/m_spacing.c	2004-12-11 18:29:34.000000000 -0500
+++ ncurses-5.7/menu/m_spacing.c	2011-01-08 18:13:50.515157538 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,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            *
@@ -37,7 +37,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_spacing.c,v 1.17 2004/12/11 23:29:34 tom Exp $")
+MODULE_ID("$Id: m_spacing.c,v 1.18 2010/01/23 21:20:10 tom Exp $")
 
 #define MAX_SPC_DESC ((TABSIZE) ? (TABSIZE) : 8)
 #define MAX_SPC_COLS ((TABSIZE) ? (TABSIZE) : 8)
@@ -56,7 +56,8 @@
 {
   MENU *m;			/* split for ATAC workaround */
 
-  T((T_CALLED("set_menu_spacing(%p,%d,%d,%d)"), menu, s_desc, s_row, s_col));
+  T((T_CALLED("set_menu_spacing(%p,%d,%d,%d)"),
+     (void *)menu, s_desc, s_row, s_col));
 
   m = Normalize_Menu(menu);
 
@@ -90,7 +91,11 @@
 {
   const MENU *m;		/* split for ATAC workaround */
 
-  T((T_CALLED("menu_spacing(%p,%p,%p,%p)"), menu, s_desc, s_row, s_col));
+  T((T_CALLED("menu_spacing(%p,%p,%p,%p)"),
+     (const void *)menu,
+     (void *)s_desc,
+     (void *)s_row,
+     (void *)s_col));
 
   m = Normalize_Menu(menu);
 
diff -Naur ncurses-5.7.orig/menu/m_sub.c ncurses-5.7/menu/m_sub.c
--- ncurses-5.7.orig/menu/m_sub.c	2004-12-25 16:38:31.000000000 -0500
+++ ncurses-5.7/menu/m_sub.c	2011-01-08 18:13:50.515157538 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,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            *
@@ -37,7 +37,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_sub.c,v 1.10 2004/12/25 21:38:31 tom Exp $")
+MODULE_ID("$Id: m_sub.c,v 1.12 2010/01/23 21:20:11 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu  
@@ -51,14 +51,28 @@
 NCURSES_EXPORT(int)
 set_menu_sub(MENU * menu, WINDOW *win)
 {
-  T((T_CALLED("set_menu_sub(%p,%p)"), menu, win));
+  T((T_CALLED("set_menu_sub(%p,%p)"), (void *)menu, (void *)win));
 
   if (menu)
     {
       if (menu->status & _POSTED)
 	RETURN(E_POSTED);
-      menu->usersub = win;
-      _nc_Calculate_Item_Length_and_Width(menu);
+      else
+#if NCURSES_SP_FUNCS
+	{
+	  /* We ensure that usersub is never null. So even if a null
+	     WINDOW parameter is passed, we store the SCREENS stdscr.
+	     The only MENU that can have a null usersub is the static
+	     _nc_default_Menu.
+	   */
+	  SCREEN *sp = _nc_screen_of(menu->usersub);
+
+	  menu->usersub = win ? win : sp->_stdscr;
+	  _nc_Calculate_Item_Length_and_Width(menu);
+	}
+#else
+	menu->usersub = win;
+#endif
     }
   else
     _nc_Default_Menu.usersub = win;
@@ -68,7 +82,7 @@
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu  
-|   Function      :  WINDOW *menu_sub(const MENU *menu)
+|   Function      :  WINDOW* menu_sub(const MENU *menu)
 |   
 |   Description   :  Returns a pointer to the subwindow of the menu
 |
@@ -79,7 +93,7 @@
 {
   const MENU *m = Normalize_Menu(menu);
 
-  T((T_CALLED("menu_sub(%p)"), menu));
+  T((T_CALLED("menu_sub(%p)"), (const void *)menu));
   returnWin(Get_Menu_Window(m));
 }
 
diff -Naur ncurses-5.7.orig/menu/m_trace.c ncurses-5.7/menu/m_trace.c
--- ncurses-5.7.orig/menu/m_trace.c	2005-01-15 20:06:11.000000000 -0500
+++ ncurses-5.7/menu/m_trace.c	2011-01-08 18:13:50.515157538 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2004,2005 Free Software Foundation, Inc.                   *
+ * Copyright (c) 2004-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            *
@@ -32,19 +32,19 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_trace.c,v 1.3 2005/01/16 01:06:11 tom Exp $")
+MODULE_ID("$Id: m_trace.c,v 1.4 2010/01/23 21:20:10 tom Exp $")
 
 NCURSES_EXPORT(ITEM *)
 _nc_retrace_item(ITEM * code)
 {
-  T((T_RETURN("%p"), code));
+  T((T_RETURN("%p"), (void *)code));
   return code;
 }
 
 NCURSES_EXPORT(ITEM **)
 _nc_retrace_item_ptr(ITEM ** code)
 {
-  T((T_RETURN("%p"), code));
+  T((T_RETURN("%p"), (void *)code));
   return code;
 }
 
@@ -58,7 +58,7 @@
 NCURSES_EXPORT(MENU *)
 _nc_retrace_menu(MENU * code)
 {
-  T((T_RETURN("%p"), code));
+  T((T_RETURN("%p"), (void *)code));
   return code;
 }
 
diff -Naur ncurses-5.7.orig/menu/m_userptr.c ncurses-5.7/menu/m_userptr.c
--- ncurses-5.7.orig/menu/m_userptr.c	2004-12-25 16:38:55.000000000 -0500
+++ ncurses-5.7/menu/m_userptr.c	2011-01-08 18:13:50.515157538 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,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            *
@@ -37,7 +37,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_userptr.c,v 1.16 2004/12/25 21:38:55 tom Exp $")
+MODULE_ID("$Id: m_userptr.c,v 1.17 2010/01/23 21:20:10 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu  
@@ -51,7 +51,7 @@
 NCURSES_EXPORT(int)
 set_menu_userptr(MENU * menu, void *userptr)
 {
-  T((T_CALLED("set_menu_userptr(%p,%p)"), menu, userptr));
+  T((T_CALLED("set_menu_userptr(%p,%p)"), (void *)menu, (void *)userptr));
   Normalize_Menu(menu)->userptr = userptr;
   RETURN(E_OK);
 }
@@ -69,7 +69,7 @@
 NCURSES_EXPORT(void *)
 menu_userptr(const MENU * menu)
 {
-  T((T_CALLED("menu_userptr(%p)"), menu));
+  T((T_CALLED("menu_userptr(%p)"), (const void *)menu));
   returnVoidPtr(Normalize_Menu(menu)->userptr);
 }
 
diff -Naur ncurses-5.7.orig/menu/m_win.c ncurses-5.7/menu/m_win.c
--- ncurses-5.7.orig/menu/m_win.c	2004-12-25 16:39:20.000000000 -0500
+++ ncurses-5.7/menu/m_win.c	2011-01-08 18:13:50.515157538 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,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            *
@@ -37,7 +37,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_win.c,v 1.15 2004/12/25 21:39:20 tom Exp $")
+MODULE_ID("$Id: m_win.c,v 1.17 2010/01/23 21:20:11 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu  
@@ -51,14 +51,28 @@
 NCURSES_EXPORT(int)
 set_menu_win(MENU * menu, WINDOW *win)
 {
-  T((T_CALLED("set_menu_win(%p,%p)"), menu, win));
+  T((T_CALLED("set_menu_win(%p,%p)"), (void *)menu, (void *)win));
 
   if (menu)
     {
       if (menu->status & _POSTED)
 	RETURN(E_POSTED);
-      menu->userwin = win;
-      _nc_Calculate_Item_Length_and_Width(menu);
+      else
+#if NCURSES_SP_FUNCS
+	{
+	  /* We ensure that userwin is never null. So even if a null
+	     WINDOW parameter is passed, we store the SCREENS stdscr.
+	     The only MENU that can have a null userwin is the static
+	     _nc_default_Menu.
+	   */
+	  SCREEN *sp = _nc_screen_of(menu->userwin);
+
+	  menu->userwin = win ? win : sp->_stdscr;
+	  _nc_Calculate_Item_Length_and_Width(menu);
+	}
+#else
+	menu->userwin = win;
+#endif
     }
   else
     _nc_Default_Menu.userwin = win;
@@ -68,7 +82,7 @@
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu  
-|   Function      :  WINDOW *menu_win(const MENU *)
+|   Function      :  WINDOW* menu_win(const MENU*)
 |   
 |   Description   :  Returns pointer to the window of the menu
 |
@@ -79,8 +93,8 @@
 {
   const MENU *m = Normalize_Menu(menu);
 
-  T((T_CALLED("menu_win(%p)"), menu));
-  returnWin(m->userwin ? m->userwin : stdscr);
+  T((T_CALLED("menu_win(%p)"), (const void *)menu));
+  returnWin(Get_Menu_UserWin(m));
 }
 
 /* m_win.c ends here */
diff -Naur ncurses-5.7.orig/menu/menu.h ncurses-5.7/menu/menu.h
--- ncurses-5.7.orig/menu/menu.h	2007-02-24 12:32:13.000000000 -0500
+++ ncurses-5.7/menu/menu.h	2011-01-08 18:13:50.515157538 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,2007 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2007,2009 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -30,7 +30,7 @@
  *   Author:  Juergen Pfeifer, 1995,1997                                    *
  ****************************************************************************/
 
-/* $Id: menu.h,v 1.19 2007/02/24 17:32:13 tom Exp $ */
+/* $Id: menu.h,v 1.20 2009/04/05 00:28:07 tom Exp $ */
 
 #ifndef ETI_MENU
 #define ETI_MENU
@@ -249,6 +249,10 @@
 
 extern NCURSES_EXPORT(void)	menu_format (const MENU *,int *,int *);
 
+#if NCURSES_SP_FUNCS
+extern NCURSES_EXPORT(MENU *)	NCURSES_SP_NAME(new_menu) (SCREEN*, ITEM **);
+#endif
+
 #ifdef __cplusplus
   }
 #endif
diff -Naur ncurses-5.7.orig/menu/menu.priv.h ncurses-5.7/menu/menu.priv.h
--- ncurses-5.7.orig/menu/menu.priv.h	2005-01-15 20:02:23.000000000 -0500
+++ ncurses-5.7/menu/menu.priv.h	2011-01-08 18:13:50.515157538 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2004,2005 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2005,2009 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -30,7 +30,7 @@
  *   Author:  Juergen Pfeifer, 1995,1997                                    *
  ****************************************************************************/
 
-/* $Id: menu.priv.h,v 1.22 2005/01/16 01:02:23 tom Exp $ */
+/* $Id: menu.priv.h,v 1.23 2009/02/28 21:02:57 juergen Exp $ */
 
 /***************************************************************************
 * Module menu.priv.h                                                       *
@@ -56,8 +56,12 @@
 /* Normalize menu to default if none was given */
 #define Normalize_Menu( menu ) ((menu)=(menu)?(menu):&_nc_Default_Menu)
 
+#define Get_Menu_Screen( menu ) (menu->userwin ? \
+				 _nc_screen_of(menu->userwin) : CURRENT_SCREEN)
+
 /* Get the user defined (framing) window of the menu */
-#define Get_Menu_UserWin(menu) ((menu)->userwin ? (menu)->userwin : stdscr)
+#define Get_Menu_UserWin(menu) ((menu)->userwin ? \
+    (menu)->userwin : CURRENT_SCREEN->_stdscr)
 
 /* Normalize menu window */
 #define Get_Menu_Window(  menu ) \
diff -Naur ncurses-5.7.orig/menu/modules ncurses-5.7/menu/modules
--- ncurses-5.7.orig/menu/modules	2006-12-23 19:52:39.000000000 -0500
+++ ncurses-5.7/menu/modules	2011-01-08 18:13:50.515157538 -0500
@@ -1,6 +1,6 @@
-# $Id: modules,v 1.17 2006/12/24 00:52:39 tom Exp $
+# $Id: modules,v 1.18 2010/01/23 16:36:23 tom Exp $
 ##############################################################################
-# Copyright (c) 1998-2004,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 "Software"), #
@@ -32,32 +32,32 @@
 
 @ base
 # Library objects
-m_attribs	lib		$(srcdir)	$(MENU_PRIV_H)
-m_cursor	lib		$(srcdir)	$(MENU_PRIV_H)
-m_driver	lib		$(srcdir)	$(MENU_PRIV_H)
-m_format	lib		$(srcdir)	$(MENU_PRIV_H)
-m_global	lib		$(srcdir)	$(MENU_PRIV_H)
-m_hook		lib		$(srcdir)	$(MENU_PRIV_H)
-m_item_cur	lib		$(srcdir)	$(MENU_PRIV_H)
-m_item_nam	lib		$(srcdir)	$(MENU_PRIV_H)
-m_item_new	lib		$(srcdir)	$(MENU_PRIV_H)
-m_item_opt	lib		$(srcdir)	$(MENU_PRIV_H)
-m_item_top	lib		$(srcdir)	$(MENU_PRIV_H)
-m_item_use	lib		$(srcdir)	$(MENU_PRIV_H)
-m_item_val	lib		$(srcdir)	$(MENU_PRIV_H)
-m_item_vis	lib		$(srcdir)	$(MENU_PRIV_H)
-m_items		lib		$(srcdir)	$(MENU_PRIV_H)
-m_new		lib		$(srcdir)	$(MENU_PRIV_H)
-m_opts		lib		$(srcdir)	$(MENU_PRIV_H)
-m_pad		lib		$(srcdir)	$(MENU_PRIV_H)
-m_pattern	lib		$(srcdir)	$(MENU_PRIV_H)
-m_post		lib		$(srcdir)	$(MENU_PRIV_H)
-m_req_name	lib		$(srcdir)	$(MENU_PRIV_H)
-m_scale		lib		$(srcdir)	$(MENU_PRIV_H)
-m_spacing	lib		$(srcdir)	$(MENU_PRIV_H)
-m_sub		lib		$(srcdir)	$(MENU_PRIV_H)
-m_trace		lib		$(srcdir)	$(MENU_PRIV_H)
-m_userptr	lib		$(srcdir)	$(MENU_PRIV_H)
-m_win		lib		$(srcdir)	$(MENU_PRIV_H)
+m_attribs	lib		$(srcdir)	$(HEADER_DEPS)
+m_cursor	lib		$(srcdir)	$(HEADER_DEPS)
+m_driver	lib		$(srcdir)	$(HEADER_DEPS)
+m_format	lib		$(srcdir)	$(HEADER_DEPS)
+m_global	lib		$(srcdir)	$(HEADER_DEPS)
+m_hook		lib		$(srcdir)	$(HEADER_DEPS)
+m_item_cur	lib		$(srcdir)	$(HEADER_DEPS)
+m_item_nam	lib		$(srcdir)	$(HEADER_DEPS)
+m_item_new	lib		$(srcdir)	$(HEADER_DEPS)
+m_item_opt	lib		$(srcdir)	$(HEADER_DEPS)
+m_item_top	lib		$(srcdir)	$(HEADER_DEPS)
+m_item_use	lib		$(srcdir)	$(HEADER_DEPS)
+m_item_val	lib		$(srcdir)	$(HEADER_DEPS)
+m_item_vis	lib		$(srcdir)	$(HEADER_DEPS)
+m_items		lib		$(srcdir)	$(HEADER_DEPS)
+m_new		lib		$(srcdir)	$(HEADER_DEPS)
+m_opts		lib		$(srcdir)	$(HEADER_DEPS)
+m_pad		lib		$(srcdir)	$(HEADER_DEPS)
+m_pattern	lib		$(srcdir)	$(HEADER_DEPS)
+m_post		lib		$(srcdir)	$(HEADER_DEPS)
+m_req_name	lib		$(srcdir)	$(HEADER_DEPS)
+m_scale		lib		$(srcdir)	$(HEADER_DEPS)
+m_spacing	lib		$(srcdir)	$(HEADER_DEPS)
+m_sub		lib		$(srcdir)	$(HEADER_DEPS)
+m_trace		lib		$(srcdir)	$(HEADER_DEPS)
+m_userptr	lib		$(srcdir)	$(HEADER_DEPS)
+m_win		lib		$(srcdir)	$(HEADER_DEPS)
 
 # vile:makemode
diff -Naur ncurses-5.7.orig/misc/Makefile.in ncurses-5.7/misc/Makefile.in
--- ncurses-5.7.orig/misc/Makefile.in	2007-03-31 11:54:17.000000000 -0400
+++ ncurses-5.7/misc/Makefile.in	2011-01-08 18:18:29.570656837 -0500
@@ -1,6 +1,6 @@
-# $Id: Makefile.in,v 1.43 2007/03/31 15:54:17 tom Exp $
+# $Id: Makefile.in,v 1.54 2010/11/27 21:45:27 tom Exp $
 ##############################################################################
-# Copyright (c) 1998-2006,2007 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 "Software"), #
@@ -43,6 +43,7 @@
 .SUFFIXES :
 
 SHELL		= /bin/sh
+VPATH		= @srcdir@
 THIS		= Makefile
 
 CF_MFLAGS 	= @cf_cv_makeflags@
@@ -57,24 +58,23 @@
 libdir		= @libdir@
 datadir		= @datadir@
 
-CC		= @CC@
-HOSTCC		= @BUILD_CC@
-
 tabsetdir	= $(datadir)/tabset
 ticdir		= @TERMINFO@
 ticfile		= $(ticdir).db
 source		= @TERMINFO_SRC@
 
 INSTALL		= @INSTALL@
-INSTALL_PROG	= @INSTALL_PROGRAM@
+INSTALL_PROG	= @INSTALL_SCRIPT@
 INSTALL_DATA	= @INSTALL_DATA@
 
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+
 ################################################################################
 all :	terminfo.tmp
 
 depend :
 
-sources :
+sources :: terminfo.tmp 
 
 install : install.data install.libs
 
@@ -91,8 +91,7 @@
 	datadir=${datadir} \
 	ticdir=${ticdir} \
 	source=terminfo.tmp \
-	THIS_CC="$(CC)" \
-	THAT_CC="$(HOSTCC)" \
+	cross_compiling=@cross_compiling@ \
 	$(SHELL) ./run_tic.sh
 	@cd $(srcdir)/tabset && \
 		$(SHELL) -c 'for i in * ; do \
@@ -103,9 +102,17 @@
 
 NCURSES_CONFIG	= ncurses@DFT_ARG_SUFFIX@@cf_cv_abi_version@-config
 
-install.libs : $(DESTDIR)$(bindir) ncurses-config
+install.libs :: $(DESTDIR)$(bindir) ncurses-config
 	$(INSTALL_PROG) ncurses-config $(DESTDIR)$(bindir)/$(NCURSES_CONFIG)
 
+@MAKE_PC_FILES@install.libs :: pc-files $(DESTDIR)$(PKG_CONFIG_LIBDIR)
+@MAKE_PC_FILES@	$(SHELL) -c 'for name in *.pc; do $(INSTALL_DATA) $$name $(DESTDIR)$(PKG_CONFIG_LIBDIR)/$$name; done'
+
+@MAKE_PC_FILES@sources :: pc-files
+@MAKE_PC_FILES@pc-files :
+@MAKE_PC_FILES@	$(SHELL) ./gen-pkgconfig
+@MAKE_PC_FILES@	touch $@
+
 terminfo.tmp : run_tic.sed $(source)
 	echo '** adjusting tabset paths'
 	sed -f run_tic.sed $(source) >terminfo.tmp
@@ -118,8 +125,9 @@
 $(DESTDIR)$(bindir) \
 $(DESTDIR)$(libdir) \
 $(DESTDIR)$(datadir) \
-$(DESTDIR)$(tabsetdir) :
-	$(SHELL) $(top_srcdir)/mkdirs.sh $@
+$(DESTDIR)$(tabsetdir) \
+$(DESTDIR)$(PKG_CONFIG_LIBDIR) :
+	mkdir -p $@
 
 uninstall : uninstall.data uninstall.libs
 
@@ -130,6 +138,7 @@
 
 uninstall.libs :
 	-rm -f $(DESTDIR)$(bindir)/$(NCURSES_CONFIG)
+@MAKE_PC_FILES@	$(SHELL) 'for name in *.pc; do rm -f $(DESTDIR)$(PKG_CONFIG_LIBDIR)/$$name; done'
 
 tags :
 
@@ -138,11 +147,13 @@
 mostlyclean :
 	-rm -f terminfo.tmp
 	-rm -f run_tic.sed
+@MAKE_PC_FILES@	-rm -f *.pc pc-files
 	-rm -f core tags TAGS *~ *.bak *.ln *.atac trace
 
 clean :: mostlyclean
 
 distclean : clean
+@MAKE_PC_FILES@	-rm -f gen-pkgconfig
 	-rm -f Makefile run_tic.sh ncurses-config
 
 realclean : distclean
diff -Naur ncurses-5.7.orig/misc/gen-pkgconfig.in ncurses-5.7/misc/gen-pkgconfig.in
--- ncurses-5.7.orig/misc/gen-pkgconfig.in	1969-12-31 19:00:00.000000000 -0500
+++ ncurses-5.7/misc/gen-pkgconfig.in	2011-01-08 18:13:50.527157745 -0500
@@ -0,0 +1,139 @@
+#!@SHELL@
+# $Id: gen-pkgconfig.in,v 1.8 2010/02/06 22:12:07 Miroslav.Lichvar Exp $
+##############################################################################
+# Copyright (c) 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 "Software"), #
+# to deal in the Software without restriction, including without limitation  #
+# the rights to use, copy, modify, merge, publish, distribute, distribute    #
+# with modifications, sublicense, and/or sell copies of the Software, and to #
+# permit persons to whom the Software is furnished to do so, subject to the  #
+# following conditions:                                                      #
+#                                                                            #
+# The above copyright notice and this permission notice shall be included in #
+# all copies or substantial portions of the Software.                        #
+#                                                                            #
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR #
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,   #
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL    #
+# THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER      #
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING    #
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER        #
+# DEALINGS IN THE SOFTWARE.                                                  #
+#                                                                            #
+# Except as contained in this notice, the name(s) of the above copyright     #
+# holders shall not be used in advertising or otherwise to promote the sale, #
+# use or other dealings in this Software without prior written               #
+# authorization.                                                             #
+##############################################################################
+#
+# Author: Thomas E. Dickey, 2009
+#
+# The complete configure script for ncurses is the ncurses5-config (or similar
+# name, depending on the flavor, e.g., ncursesw5-config, ncurses6-config, etc).
+# That provides more information than pkg-config, and is the portable and
+# recommended solution.
+#
+# For each library, generate a ".pc" file which depends on the base ncurses
+# library, except that the tinfo library does not depend on ncurses.
+LIB_NAME=@LIB_NAME@
+TINFO_NAME=@TINFO_NAME@
+PANEL_NAME=panel # @PANEL_NAME@
+MENU_NAME=menu # @MENU_NAME@
+FORM_NAME=form # @FORM_NAME@
+CXX_NAME=ncurses++ # @CXX_NAME@
+DFT_DEP_SUFFIX=@DFT_DEP_SUFFIX@
+TINFO_ARG_SUFFIX=@TINFO_ARG_SUFFIX@
+CXX_LIB_SUFFIX=@CXX_LIB_SUFFIX@
+
+prefix="@prefix@"
+exec_prefix="@exec_prefix@"
+includedir="@includedir@"
+libdir="@libdir@"
+
+show_prefix='@prefix@'
+show_exec_prefix='@exec_prefix@'
+show_includedir='@includedir@'
+show_libdir='@libdir@'
+
+MAIN_LIBRARY="${LIB_NAME}@DFT_ARG_SUFFIX@"
+SUB_LIBRARY="${TINFO_ARG_SUFFIX}"
+PANEL_LIBRARY="${PANEL_NAME}@DFT_ARG_SUFFIX@"
+MENU_LIBRARY="${MENU_NAME}@DFT_ARG_SUFFIX@"
+FORM_LIBRARY="${FORM_NAME}@DFT_ARG_SUFFIX@"
+
+SUB_LIBRARY_REQ=${SUB_LIBRARY}
+if test $TINFO_NAME = $LIB_NAME ; then
+	SUB_LIBRARY_REQ=
+fi
+
+for lib in ../lib/*
+do
+	name=`basename $lib`
+	if test "$name" = "*" ; then
+		break
+	fi
+
+	root=`basename $name "$DFT_DEP_SUFFIX"`
+	if test "$name" = "$root" ; then
+		root=`basename $name "$CXX_LIB_SUFFIX"`
+		if test "$name" = "$root" ; then
+			continue
+		fi
+	fi
+
+	name=`echo "$name" | sed -e 's/^lib//' -e 's/\..*$//'`
+
+	desc="ncurses @NCURSES_MAJOR@.@NCURSES_MINOR@"
+	if test $name = $MAIN_LIBRARY ; then
+		reqs=$SUB_LIBRARY_REQ
+		desc="$desc library"
+	elif test $name = $SUB_LIBRARY ; then
+		reqs=
+		desc="$desc terminal interface library"
+	elif expr $name : ".*${CXX_NAME}.*" >/dev/null ; then
+		reqs="$PANEL_LIBRARY $MENU_LIBRARY $FORM_LIBRARY $MAIN_LIBRARY $SUB_LIBRARY_REQ"
+		desc="$desc add-on library"
+	else
+		reqs="$MAIN_LIBRARY $SUB_LIBRARY_REQ"
+		desc="$desc add-on library"
+	fi
+
+	if test "$includedir" = "/usr/include" ; then
+		cflags=
+	else
+		cflags="-I\${includedir}"
+	fi
+
+	if test "$libdir" = "/usr/lib" ; then
+		libs=
+	else
+		libs="-L\${libdir}"
+	fi
+	libs="$libs -l$name"
+
+	# add dependencies that pkg-config cannot guess about
+	if test -z "$reqs" ; then
+		libs="$libs @LIBS@"
+	fi
+
+	echo "** creating ${name}.pc"
+	cat >${name}.pc <<EOF
+prefix=$show_prefix
+exec_prefix=$show_exec_prefix
+libdir=$show_libdir
+includedir=$show_includedir
+major_version=@NCURSES_MAJOR@
+version=@NCURSES_MAJOR@.@NCURSES_MINOR@.@NCURSES_PATCH@
+
+Name: $name
+Description: $desc
+Version: \${version}
+Requires: $reqs
+Libs: $libs
+Cflags: $cflags
+EOF
+	# pr -f ${name}.pc
+done
+# vile:shmode
diff -Naur ncurses-5.7.orig/misc/ncu-indent ncurses-5.7/misc/ncu-indent
--- ncurses-5.7.orig/misc/ncu-indent	2008-08-03 11:46:44.000000000 -0400
+++ ncurses-5.7/misc/ncu-indent	2011-01-08 18:13:50.527157745 -0500
@@ -1,6 +1,6 @@
 #!/bin/sh
 #****************************************************************************
-#* Copyright (c) 2001-2006,2008 Thomas E. Dickey                            *
+#* Copyright (c) 2001-2009,2010 Thomas E. Dickey                            *
 #*                                                                          *
 #* 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 @@
 #* sale, use or other dealings in this Software without prior written       *
 #* authorization.                                                           *
 #****************************************************************************/
-# $Id: ncu-indent,v 1.17 2008/08/03 15:46:44 tom Exp $
+# $Id: ncu-indent,v 1.21 2010/07/24 11:25:18 tom Exp $
 NOOP=no
 OPTS='
 --blank-lines-after-procedures
@@ -44,6 +44,8 @@
 --swallow-optional-blank-lines
 --tab-size8
 
+-T NCURSES_SP_ARGx
+-T NCURSES_SP_DCLx
 -T NCURSES_EXPORT_VAR
 -T NCURSES_INLINE
 -T SCREEN
@@ -88,11 +90,12 @@
 		mv "$name" "$save"
 		sed \
 			-e '/EMPTY_MODULE(/s/)$/);/' \
+			-e 's,\(MODULEID(\),//\1,' \
 			-e '/MODULE_ID(/s/)$/);/' \
-			-e 's,\<GCC_NORETURN;,;//GCC_NORETURN;,' \
-			-e 's,\<GCC_PRINTFLIKE(,;//GCC_PRINTFLIKE(,' \
-			-e 's,\<GCC_SCANFLIKE(,;//GCC_SCANFLIKE(,' \
-			-e 's,\(\<NCURSES_EXPORT_VAR\>\),//\1,' \
+			-e 's,\<GCC_NORETURN\(.*\);,;//GCC_NORETURN\1,' \
+			-e 's,\<GCC_PRINTFLIKE(\(.*\);,;//GCC_PRINTFLIKE(\1,' \
+			-e 's,\<GCC_SCANFLIKE(\(.*\);,;//GCC_SCANFLIKE(\1,' \
+			-e 's,\(\<NCURSES_EXPORT_VAR\>.*;\),//\1,' \
 			"$save" >"$test"
 		cp "$test" "$name"
 		chmod u+w "$name"
@@ -100,11 +103,14 @@
 		${INDENT_PROG-indent} -npro $OPTS "$name"
 		sed \
 			-e '/EMPTY_MODULE(/s/);$/)/' \
+			-e 's,//\(MODULEID(\),\1,' \
 			-e '/MODULE_ID(/s/);$/)/' \
-			-e 's,;[ 	]*//GCC_NORETURN;, GCC_NORETURN;,' \
-			-e 's,;[ 	]*//GCC_PRINTFLIKE(, GCC_PRINTFLIKE(,' \
-			-e 's,;[ 	]*//GCC_SCANFLIKE(, GCC_SCANFLIKE(,' \
-			-e 's,//\(\<NCURSES_EXPORT_VAR\>\),\1,' \
+			-e 's,;[ 	]*//GCC_NORETURN\(.*\);, GCC_NORETURN\1;,' \
+			-e 's,;[ 	]*//GCC_PRINTFLIKE(\(.*\);, GCC_PRINTFLIKE(\1;,' \
+			-e 's,;[ 	]*//GCC_SCANFLIKE(\(.*\);, GCC_SCANFLIKE(\1;,' \
+			-e 's,;[	]*//\(.*\), \1;,' \
+			-e 's,[ 	][	]*\<GCC_, GCC_,g' \
+			-e 's,//\(\<NCURSES_EXPORT_VAR\>[ ]*\),\1,' \
 			"$name" >"$test"
 		mv "$test" "$name"
 		rm -f "${name}~"
diff -Naur ncurses-5.7.orig/misc/ncurses-config.in ncurses-5.7/misc/ncurses-config.in
--- ncurses-5.7.orig/misc/ncurses-config.in	2007-03-17 16:02:19.000000000 -0400
+++ ncurses-5.7/misc/ncurses-config.in	2011-01-08 18:13:50.527157745 -0500
@@ -1,7 +1,7 @@
 #!@SHELL@
-# $Id: ncurses-config.in,v 1.12 2007/03/17 20:02:19 tom Exp $
+# $Id: ncurses-config.in,v 1.24 2010/02/06 22:12:16 Miroslav.Lichvar Exp $
 ##############################################################################
-# Copyright (c) 2006,2007 Free Software Foundation, Inc.                     #
+# Copyright (c) 2006-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 "Software"), #
@@ -28,67 +28,70 @@
 # authorization.                                                             #
 ##############################################################################
 #
-# Author: Thomas E. Dickey, 2006
+# Author: Thomas E. Dickey, 2006-on
 
 prefix="@prefix@"
 exec_prefix="@exec_prefix@"
 
 bindir="@bindir@"
+includedir="@includedir@"
 libdir="@libdir@"
 datadir="@datadir@"
 mandir="@mandir@"
 
-THIS="ncurses@DFT_ARG_SUFFIX@"
+THIS="@LIB_NAME@@DFT_ARG_SUFFIX@"
+TINFO_LIB="@TINFO_ARG_SUFFIX@"
 
 LANG=C;		export LANG
 LANGUAGE=C;	export LANGUAGE
 LC_ALL=C;	export LC_ALL
 LC_CTYPE=C;	export LC_CTYPE
 
-test $# = 0 && exec @SHELL@ $0 --error
-
-while test $# -gt 0; do
-	case "$1" in
-	-*=*)
-		ARG=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'`
-		;;
-	*)
-		ARG=
+# with --disable-overwrite, we installed into a subdirectory, but transformed
+# the headers to include like this:
+#	<ncurses@LIB_SUFFIX@/curses.h>
+if test x@WITH_OVERWRITE@ = xno ; then
+	case $includedir in
+	$prefix/include/ncurses@LIB_SUFFIX@)
+		includedir=`echo "$includedir" | sed -e 's,/[^/]*$,,'`
 		;;
 	esac
+fi
+
+test $# = 0 && exec @SHELL@ $0 --error
 
+while test $# -gt 0; do
 	case "$1" in
 	# basic configuration
-	--prefix=*)
-		prefix="$ARG"
-		test -z "$exec_prefix" && exec_prefix="$ARG"
-		;;
 	--prefix)
 		echo "$prefix"
 		;;
-	--exec-prefix=*)
-		exec_prefix="$ARG"
-		;;
 	--exec-prefix)
 		echo "$exec_prefix"
 		;;
 	# compile/link
 	--cflags)
 		INCS=
-		if test "${prefix}/include" != /usr/include ; then
-			INCS="-I${prefix}/include"
+		if test "${includedir}" != /usr/include ; then
+			INCS="-I${includedir}"
 		fi
-		if test "@WITH_OVERWRITE@" != no ; then
-			INCS="$INCS -I${prefix}/include/${THIS}"
+		if test "x@WITH_OVERWRITE@" = xno ; then
+			INCS="$INCS -I${includedir}/${THIS}"
 		fi
 		sed -e 's,^[ ]*,,' -e 's, [ ]*, ,g' -e 's,[ ]*$,,' <<-ENDECHO
 			$INCS
 ENDECHO
 		;;
 	--libs)
+		if test @TINFO_NAME@ = @LIB_NAME@ ; then
 		sed -e 's,^[ ]*,,' -e 's, [ ]*, ,g' -e 's,[ ]*$,,' <<-ENDECHO
-			-L${exec_prefix}/lib @EXTRA_LDFLAGS@ -l${THIS} @LIBS@
+			-L$libdir @EXTRA_LDFLAGS@ -l${THIS} @LIBS@
 ENDECHO
+		else
+		sed -e 's,^[ ]*,,' -e 's, [ ]*, ,g' -e 's,[ ]*$,,' <<-ENDECHO
+			-L$libdir @EXTRA_LDFLAGS@ -l${THIS} -l${TINFO_LIB} @LIBS@
+ENDECHO
+		fi
 		;;
 	# identification
 	--version)
@@ -107,6 +110,9 @@
 	--datadir)
 		echo "${datadir}"
 		;;
+	--includedir)
+		echo "${includedir}"
+		;;
 	--libdir)
 		echo "${libdir}"
 		;;
@@ -129,9 +135,7 @@
 
 Options:
   --prefix           echos the package-prefix of ${THIS}
-  --prefix=ARG       sets the package-prefix of ${THIS}
   --exec-prefix      echos the executable-prefix of ${THIS}
-  --exec-prefix=ARG  sets the executable-prefix of ${THIS}
 
   --cflags           echos the C compiler flags needed to compile with ${THIS}
   --libs             echos the libraries needed to link with ${THIS}
@@ -142,6 +146,7 @@
 
   --bindir           echos the directory containing ${THIS} programs
   --datadir          echos the directory containing ${THIS} data
+  --includedir       echos the directory containing ${THIS} header files
   --libdir           echos the directory containing ${THIS} libraries
   --mandir           echos the directory containing ${THIS} manpages
   --terminfo         echos the \$TERMINFO terminfo database path
diff -Naur ncurses-5.7.orig/misc/run_tic.in ncurses-5.7/misc/run_tic.in
--- ncurses-5.7.orig/misc/run_tic.in	2006-10-28 15:43:30.000000000 -0400
+++ ncurses-5.7/misc/run_tic.in	2011-01-08 18:18:29.430658518 -0500
@@ -1,7 +1,7 @@
 #!@SHELL@
-# $Id: run_tic.in,v 1.23 2006/10/28 19:43:30 tom Exp $
+# $Id: run_tic.in,v 1.29 2010/10/23 20:49:04 tom Exp $
 ##############################################################################
-# Copyright (c) 1998-2005,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 "Software"), #
@@ -28,7 +28,7 @@
 # authorization.                                                             #
 ##############################################################################
 #
-# Author: Thomas E. Dickey 1996,2000
+# Author: Thomas E. Dickey 1996-on
 #
 # This script is used to install terminfo.src using tic.  We use a script
 # because the path checking is too awkward to do in a makefile.
@@ -41,38 +41,51 @@
 # The script is designed to be run from the misc/Makefile as
 #	make install.data
 
-: ${suffix=@PROG_EXT@}
-: ${DESTDIR=@DESTDIR@}
-: ${prefix=@prefix@}
-: ${exec_prefix=@exec_prefix@}
-: ${bindir=@bindir@}
-: ${top_srcdir=@top_srcdir@}
-: ${srcdir=@srcdir@}
-: ${datadir=@datadir@}
-: ${ticdir=@TERMINFO@}
-: ${source=@TERMINFO_SRC@}
-: ${LN_S="@LN_S@"}
-: ${THAT_CC=cc}
-: ${THIS_CC=cc}
-: ${ext_funcs=@NCURSES_EXT_FUNCS@}
+: ${suffix:=@PROG_EXT@}
+: ${DESTDIR:=@DESTDIR@}
+: ${prefix:=@prefix@}
+: ${exec_prefix:=@exec_prefix@}
+: ${bindir:=@bindir@}
+: ${top_srcdir:=@top_srcdir@}
+: ${srcdir:=@srcdir@}
+: ${datadir:=@datadir@}
+: ${TIC_PATH:=@TIC_PATH@}
+: ${ticdir:=@TERMINFO@}
+: ${source:=@TERMINFO_SRC@}
+: ${LN_S:="@LN_S@"}
+: ${cross_compiling:=no}
+: ${ext_funcs:=@NCURSES_EXT_FUNCS@}
 
 test -z "${DESTDIR}" && DESTDIR=
 
 # Allow tic to run either from the install-path, or from the build-directory.
 # Do not do this if we appear to be cross-compiling.  In that case, we rely
 # on the host's copy of tic to compile the terminfo database.
-if test "$THAT_CC" = "$THIS_CC" ; then
-case "$PATH" in
-:*) PATH=../progs:../lib:${DESTDIR}$bindir$PATH ;;
-*) PATH=../progs:../lib:${DESTDIR}$bindir:$PATH ;;
-esac
-export PATH
-SHLIB="sh $srcdir/shlib"
+if test "x$cross_compiling" = "xno"
+then
+	if test -f ../progs/tic$suffix
+	then
+		case "$PATH" in
+		@PATH_SEPARATOR@*)
+			PATH=../progs@PATH_SEPARATOR@../lib@PATH_SEPARATOR@${DESTDIR}$bindir$PATH
+			;;
+		*)
+			PATH=../progs@PATH_SEPARATOR@../lib@PATH_SEPARATOR@${DESTDIR}$bindir@PATH_SEPARATOR@$PATH
+			;;
+		esac
+		export PATH
+		SHLIB="sh $srcdir/shlib"
+		TIC_PATH="$SHLIB tic"
+	elif test "$TIC_PATH" = unknown
+	then
+		echo '? no tic program found'
+		exit 1
+	fi
 else
-# Cross-compiling, so don't set PATH or run shlib.
-SHLIB=
-# reset $suffix, since it applies to the target, not the build platform.
-suffix=
+	# Cross-compiling, so don't set PATH or run shlib.
+	SHLIB=
+	# reset $suffix, since it applies to the target, not the build platform.
+	suffix=
 fi
 
 
@@ -100,7 +113,7 @@
 
 if test "$ext_funcs" = 1 ; then
 cat <<EOF
-Running tic to install $TERMINFO ...
+Running $TIC_PATH to install $TERMINFO ...
 
 	You may see messages regarding extended capabilities, e.g., AX.
 	These are extended terminal capabilities which are compiled
@@ -110,7 +123,7 @@
 	document, and install the terminfo without the -x option.
 
 EOF
-if ( $SHLIB tic$suffix -x -s -o $TERMINFO $source )
+if ( $TIC_PATH -x -s -o $TERMINFO $source )
 then
 	echo '** built new '$TERMINFO
 else
@@ -119,7 +132,7 @@
 fi
 else
 cat <<EOF
-Running tic to install $TERMINFO ...
+Running $TIC_PATH to install $TERMINFO ...
 
 	You may see messages regarding unknown capabilities, e.g., AX.
 	These are extended terminal capabilities which may be compiled
@@ -129,7 +142,7 @@
 	document, and install the terminfo without the -x option.
 
 EOF
-if ( $SHLIB tic$suffix -s -o $TERMINFO $source )
+if ( $TIC_PATH -s -o $TERMINFO $source )
 then
 	echo '** built new '$TERMINFO
 else
diff -Naur ncurses-5.7.orig/misc/terminfo.src ncurses-5.7/misc/terminfo.src
--- ncurses-5.7.orig/misc/terminfo.src	2008-10-12 19:03:54.000000000 -0400
+++ ncurses-5.7/misc/terminfo.src	2011-01-08 18:18:29.726781669 -0500
@@ -6,8 +6,8 @@
 # Report bugs and new terminal descriptions to
 #	bug-ncurses@gnu.org
 #
-#	$Revision: 1.341 $
-#	$Date: 2008/10/12 23:03:54 $
+#	$Revision: 1.381 $
+#	$Date: 2010/12/11 23:39:36 $
 #
 # The original header is preserved below for reference.  It is noted that there
 # is a "newer" version which differs in some cosmetic details (but actually
@@ -340,7 +340,7 @@
 	cub=\E[%p1%dD, cud=\E[%p1%dB, cuf=\E[%p1%dC,
 	cuu=\E[%p1%dA, use=ansi+local1,
 ansi+tabs,
-	cbt=\E[Z, ht=^I, hts=\EH, tbc=\E[2g,
+	cbt=\E[Z, ht=^I, hts=\EH, tbc=\E[3g,
 ansi+inittabs,
 	it#8, use=ansi+tabs,
 ansi+erase,
@@ -452,8 +452,9 @@
 # For more detail on this rather pathetic standard, see the comments
 # near the end of this file.
 ibcs2|Intel Binary Compatibility Standard prescriptions,
-	cbt=\E[Z, clear=\Ec, cub=\E[%p1%dD, cud=\E[%p1%dB,
-	cuf=\E[%p1%dC, cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA,
+	cbt=\E[Z, clear=\Ec, cub=\E[%p1%dD, cub1=\E[1D,
+	cud=\E[%p1%dB, cud1=\E[1B, cuf=\E[%p1%dC, cuf1=\E[1C,
+	cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[1A,
 	dch=\E[%p1%dP, dispc=\E=%p1%dg, ech=\E[%p1%dX,
 	hpa=\E[%i%p1%dG, hts=\EH, ich=\E[%p1%d@, il=\E[%p1%dL,
 	indn=\E[%p1%dS, rc=\E7, rin=\E[%p1%dT, rmam=\E[?7l, sc=\E7,
@@ -545,7 +546,7 @@
 	cud1=\E[B, cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH, cuu1=\E[A,
 	dch1=\E[P, dl1=\E[M, ed=\E[J, el=\E[K, home=\E[H, ht=^I,
 	hts=\EH, il1=\E[L, ind=^J, kbs=^H, kcub1=\E[D, kcud1=\E[B,
-	kcuf1=\E[C, kcuu1=\E[A, khome=\E[H, tbc=\E[2g,
+	kcuf1=\E[C, kcuu1=\E[A, khome=\E[H, tbc=\E[3g,
 	use=klone+sgr-dumb,
 pcansi-25-m|pcansi25m|ibm-pc terminal programs with 25 lines (mono mode),
 	lines#25, use=pcansi-m,
@@ -576,7 +577,7 @@
 	kcbt=\E[Z, kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A,
 	kich1=\E[L, mc4=\E[4i, mc5=\E[5i, nel=\r\E[S,
 	rep=%p1%c\E[%p2%{1}%-%db, rin=\E[%p1%dT, s0ds=\E(B,
-	s1ds=\E)B, s2ds=\E*B, s3ds=\E+B, tbc=\E[2g,
+	s1ds=\E)B, s2ds=\E*B, s3ds=\E+B, tbc=\E[3g,
 	vpa=\E[%i%p1%dd, use=pcansi-m,
 
 ansi+enq|ncurses extension for ANSI ENQ,
@@ -617,11 +618,45 @@
 	clear=\E[2J, cub1=^H, cud1=\E[B, cuf1=\E[C,
 	cup=\E[%i%p1%d;%p2%dH, cuu1=\E[A, el=\E[k, home=\E[H,
 	is2=\E[m\E[?7h, kcub1=^H, kcud1=^J, kcuf1=^L, kcuu1=^K,
-	khome=^^, pfkey=\E[0;%p1%{58}%+%d;%p2"%s", rc=\E[u,
+	khome=^^, pfkey=\E[0;%p1%{58}%+%d;%p2"%s"p, rc=\E[u,
 	rmam=\E[?7l, sc=\E[s, smam=\E[?7h, u6=\E[%i%d;%dR,
 	u7=\E[6n, use=klone+color, use=klone+sgr8,
+
+# Keypad:	Home=\0G	Up=\0H	PrPag=\0I
+#		ka1,kh		kcuu1		kpp,ka3
+#
+#		Left=\0K	5=\0L		Right=\0M
+#		kcub1		kb2		kcuf1
+#
+#		End=\0O		Down=\0P	NxPag=\0Q
+#		kc1,kend	kcud1		kc3,knp
+#
+#		Ins=\0R		Del=\0S
+#		kich1		kdch1
+#
+# On keyboard with 12 function keys,
+#	shifted f-keys: F13-F24
+#	control f-keys: F25-F36
+#	alt f-keys:     F37-F48
+# The shift/control/alt keys do not modify each other, but alt overrides both,
+# and control overrides shift.
+#
+# <pfkey> capability for F1-F48 -TD
 ansi.sys|ANSI.SYS 3.1 and later versions,
-	el=\E[K, use=ansi.sys-old,
+	el=\E[K, ka1=\0G, ka3=\0I, kb2=\0L, kbs=^H, kc1=\0O, kc3=\0Q,
+	kcbt=\0^O, kcub1=\0K, kcud1=\0P, kcuf1=\0M, kcuu1=\0H,
+	kdch1=\0S, kend=\0O, kf1=\0;, kf10=\0D, kf11=\0\205,
+	kf12=\0\206, kf13=\0T, kf14=\0U, kf15=\0V, kf16=\0W,
+	kf17=\0X, kf18=\0Y, kf19=\0Z, kf2=\0<, kf20=\0[, kf21=\0\\,
+	kf22=\0], kf23=\0\207, kf24=\0\210, kf25=\0\^, kf26=\0_,
+	kf27=\0`, kf28=\0a, kf29=\0b, kf3=\0=, kf30=\0c, kf31=\0d,
+	kf32=\0e, kf33=\0f, kf34=\0g, kf35=\0\211, kf36=\0\212,
+	kf37=\0h, kf38=\0i, kf39=\0j, kf4=\0>, kf40=\0k, kf41=\0l,
+	kf42=\0m, kf43=\0n, kf44=\0o, kf45=\0p, kf46=\0q,
+	kf47=\0\213, kf48=\0\214, kf5=\0?, kf6=\0@, kf7=\0A, kf8=\0B,
+	kf9=\0C, khome=\0G, kich1=\0R, knp=\0Q, kpp=\0I,
+	pfkey=\E[0;%?%p1%{11}%<%t%'\:'%e%?%p1%{13}%<%t%'z'%e%?%p1%{23}%<%t%'G'%e%?%p1%{25}%<%t%'p'%e%?%p1%'#'%<%t%'E'%e%?%p1%'%'%<%t%'f'%e%?%p1%'/'%<%t%'C'%e%{92}%;%;%;%;%;%;%;%p1%+%d;%p2"%s"p,
+	use=ansi.sys-old,
 
 #
 # Define IBM PC keypad keys for vi as per MS-Kermit while using ANSI.SYS.
@@ -657,6 +692,149 @@
 #### ANSI console types
 #
 
+#############################################################################
+#
+# Atari ST terminals.
+# From Guido Flohr <gufl0000@stud.uni-sb.de>.
+#
+tw52|tw52-color|Toswin window manager with color,
+	bce,
+	colors#16, pairs#256,
+	oc=\Eb?\Ec0, op=\Eb?\Ec0,
+	setab=\Ec%?%p1%{0}%=%t?%e%p1%{7}%=%t0%e%p1%{15}%=%t7%e%p1%{48}%+%c,
+	setaf=\Eb%?%p1%{0}%=%t?%e%p1%{7}%=%t0%e%p1%{15}%=%t7%e%p1%{48}%+%c,
+	setb=\Ec%?%p1%{0}%=%t?%e%p1%{7}%=%t0%e%p1%{15}%=%t7%e%p1%{48}%+%c,
+	setf=\Eb%?%p1%{0}%=%t?%e%p1%{7}%=%t0%e%p1%{15}%=%t7%e%p1%{48}%+%c,
+	use=tw52-m,
+tw52-m|Toswin window manager monochrome,
+	ul,
+	ma#999,
+	bold=\Eya, dch1=\Ea, dim=\EyB,
+	is2=\Ev\Eq\Ez_\Ee\Ei\Eb?\Ec0, rev=\EyP, rmso=\EzQ,
+	rmul=\EzH, rs2=\Ev\Eq\Ez_\Ee\Ei\Eb?\Ec0, sgr0=\Ez_,
+	smso=\EyQ, smul=\EyH, use=at-m,
+tt52|Atari TT medium and high resolution,
+	lines#30, use=at-color,
+st52-color|at-color|atari-color|atari_st-color|Atari ST with color,
+	bce,
+	colors#16, pairs#256,
+	is2=\Ev\Eq\Ee\Eb1\Ec0, rs2=\Ev\Eq\Ee\Eb1\Ec0,
+	setab=\Ec%?%p1%{0}%=%t1%e%p1%{1}%=%t2%e%p1%{2}%=%t3%e%p1%{3}%=%t>%e%p1%{4}%=%t4%e%p1%{5}%=%t7%e%p1%{6}%=%t5%e%p1%{7}%=%t0%e%p1%{8}%=%t8%e%p1%{9}%=%t9%e%p1%{10}%=%t\:%e%p1%{11}%=%t;%e%p1%{12}%=%t<%e%p1%{13}%=%t=%e%p1%{14}%=%t6%e?,
+	setaf=\Eb%?%p1%{0}%=%t1%e%p1%{1}%=%t2%e%p1%{2}%=%t3%e%p1%{3}%=%t>%e%p1%{4}%=%t4%e%p1%{5}%=%t7%e%p1%{6}%=%t5%e%p1%{7}%=%t0%e%p1%{8}%=%t8%e%p1%{9}%=%t9%e%p1%{10}%=%t\:%e%p1%{11}%=%t;%e%p1%{12}%=%t<%e%p1%{13}%=%t=%e%p1%{14}%=%t6%e?,
+	setb=\Ec%?%p1%{0}%=%t1%e%p1%{1}%=%t2%e%p1%{2}%=%t3%e%p1%{3}%=%t>%e%p1%{4}%=%t4%e%p1%{5}%=%t7%e%p1%{6}%=%t5%e%p1%{7}%=%t0%e%p1%{8}%=%t8%e%p1%{9}%=%t9%e%p1%{10}%=%t\:%e%p1%{11}%=%t;%e%p1%{12}%=%t<%e%p1%{13}%=%t=%e%p1%{14}%=%t6%e?,
+	setf=\Eb%?%p1%{0}%=%t1%e%p1%{1}%=%t2%e%p1%{2}%=%t3%e%p1%{3}%=%t>%e%p1%{4}%=%t4%e%p1%{5}%=%t7%e%p1%{6}%=%t5%e%p1%{7}%=%t0%e%p1%{8}%=%t8%e%p1%{9}%=%t9%e%p1%{10}%=%t\:%e%p1%{11}%=%t;%e%p1%{12}%=%t<%e%p1%{13}%=%t=%e%p1%{14}%=%t6%e?,
+	use=st52,
+st52|st52-m|at|at-m|atari|atari-m|atari_st|atarist-m|Atari ST,
+	am, eo, mir, npc,
+	cols#80, it#8, lines#24,
+	bel=^G, civis=\Ef, clear=\EE, cnorm=\Ee, cr=^M, cub1=\ED,
+	cud1=\EB, cuf1=\EC, cup=\EY%p1%{32}%+%c%p2%{32}%+%c,
+	cuu1=\EA, dl1=\EM, ed=\EJ, el=\EK, el1=\Eo, home=\EH, ht=^I,
+	il1=\EL, ind=^J, is2=\Ev\Eq\Ee, kLFT=\Ed, kRIT=\Ec, kbs=^H,
+	kcub1=\ED, kcud1=\EB, kcuf1=\EC, kcuu1=\EA, kdch1=\177,
+	kf1=\EP, kf10=\EY, kf11=\Ep, kf12=\Eq, kf13=\Er, kf14=\Es,
+	kf15=\Et, kf16=\Eu, kf17=\Ev, kf18=\Ew, kf19=\Ex, kf2=\EQ,
+	kf20=\Ey, kf3=\ER, kf4=\ES, kf5=\ET, kf6=\EU, kf7=\EV, kf8=\EW,
+	kf9=\EX, khlp=\EH, khome=\EE, kich1=\EI, knp=\Eb, kpp=\Ea,
+	kund=\EK, nel=^M^J, rc=\Ek, rev=\Ep, ri=\EI, rmso=\Eq,
+	rs2=\Ev\Eq\Ee, sc=\Ej, sgr0=\Eq, smso=\Ep,
+tw100|toswin vt100 window mgr,
+	eo, mir, msgr, xon,
+	colors#8, cols#80, it#8, lines#24, pairs#64, vt#3,
+	acsc=++\,\,--..00II``aaffgghhjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
+	bel=^G, blink=\E[5m, bold=\E[1m, civis=\Ef,
+	clear=\E[2J\E[H, cnorm=\Ee, cr=^M, csr=\E[%i%p1%d;%p2%dr,
+	cub=\E[%p1%dD, cub1=^H, cud=\E[%p1%dB, cud1=\EB,
+	cuf=\E[%p1%dC, cuf1=\EC, cup=\E[%i%p1%d;%p2%dH,
+	cuu=\E[%p1%dA, cuu1=\EA, dch1=\Ea, dim=\E[2m, dl=\E[%p1%dM,
+	dl1=\E[M, ed=\E[J, el=\E[K, el1=\E[1K, home=\E[H, ht=^I,
+	hts=\EH, ich=\E[%p1%d@, il1=\EL, ind=^J, is2=\E<\E)0, kbs=^H,
+	kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA, kdch1=\177,
+	kf1=\EOP, kf10=\EOY, kf11=\Ep, kf12=\Eq, kf13=\Er, kf14=\Es,
+	kf15=\Et, kf16=\Eu, kf17=\Ev, kf18=\Ew, kf19=\Ex, kf2=\EOQ,
+	kf20=\Ey, kf3=\EOR, kf4=\EOS, kf5=\EOT, kf6=\EOU, kf7=\EOV,
+	kf8=\EOW, kf9=\EOX, khlp=\EH, khome=\E\EE, kich1=\EI,
+	knp=\Eb, kpp=\E\Ea, kund=\EK, ll=\E[24H, nel=\EE,
+	oc=\E[30;47m, op=\E[30;47m, rc=\E8, rev=\E[7m, ri=\EM,
+	rmacs=^O, rmcup=\E[?7h, rmir=\Ei, rmkx=\E[?1l\E>,
+	rmso=\E[m, rmul=\E[m,
+	rs1=\E<\E[20l\E[?3;6;9l\E[r\Eq\E(B\017\E)0\E>,
+	sc=\E7,
+	setb=\E[4%p1%'0'%+%Pa%?%ga%'0'%=%t0%e%ga%'1'%=%t4%e%ga%'2'%=%t2%e%ga%'3'%=%t6%e%ga%'4'%=%t1%e%ga%'5'%=%t5%e%ga%'6'%=%t3%e7%;m,
+	setf=\E[3%p1%'0'%+%Pa%?%ga%'0'%=%t0%e%ga%'1'%=%t4%e%ga%'2'%=%t2%e%ga%'3'%=%t6%e%ga%'4'%=%t1%e%ga%'5'%=%t5%e%ga%'6'%=%t3%e7%;m,
+	sgr0=\E[m, smacs=^N, smcup=\E[?7l, smir=\Eh,
+	smkx=\E[?1h\E=, smso=\E[7m, smul=\E[4m, tbc=\E[3g,
+# The entries for stv52 and stv52pc probably need a revision.
+stv52|MiNT virtual console,
+	am, msgr,
+	cols#80, it#8, lines#30,
+	bel=^G, blink=\Er, bold=\EyA, civis=\Ef, clear=\EE,
+	cnorm=\E. \Ee, cr=^M, cub1=^H, cud1=\EB, cuf1=\EC,
+	cup=\EY%p1%{32}%+%c%p2%{32}%+%c, cuu1=\EA, cvvis=\E.",
+	dim=\Em, dl1=\EM, ed=\EJ, el=\EK, home=\EH, ht=^I, il1=\EL,
+	ind=\n$<2*/>, kbs=^H, kcub1=\ED, kcud1=\EB, kcuf1=\EC,
+	kcuu1=\EA, kdch1=\177, kf1=\EP, kf10=\EY, kf11=\Ep, kf12=\Eq,
+	kf13=\Er, kf14=\Es, kf15=\Et, kf16=\Eu, kf17=\Ev, kf18=\Ew,
+	kf19=\Ex, kf2=\EQ, kf20=\Ey, kf3=\ER, kf4=\ES, kf5=\ET,
+	kf6=\EU, kf7=\EV, kf8=\EW, kf9=\EX, khlp=\EH, khome=\EE,
+	kich1=\EI, knp=\Eb, kpp=\Ea, kund=\EK, nel=\r\n$<2*/>,
+	op=\Eb@\EcO, rev=\Ep, ri=\EI$<2*/>, rmcup=\Ev\E. \Ee\Ez_,
+	rmso=\Eq, rmul=\EzH, rs1=\Ez_\Eb@\EcA, sgr0=\Ez_,
+	smcup=\Ev\Ee\Ez_, smso=\Ep, smul=\EyH,
+stv52pc|MiNT virtual console with PC charset,
+	am, msgr,
+	cols#80, it#8, lines#30,
+	acsc=+\257\,\256-\^.v0\333I\374`\177a\260f\370g\361h\261j\331k\277l\332m\300n\305o\377p-q\304r-s_t+u+v+w+x\263y\363z\362{\343|\366}\234~\371,
+	bel=^G, blink=\Er, bold=\EyA, civis=\Ef, clear=\EE,
+	cnorm=\E. \Ee, cr=^M, cub1=^H, cud1=\EB, cuf1=\EC,
+	cup=\EY%p1%{32}%+%c%p2%{32}%+%c, cuu1=\EA, cvvis=\E.",
+	dim=\Em, dl1=\EM, ed=\EJ, el=\EK, home=\EH, ht=^I, il1=\EL,
+	ind=\n$<2*/>, kbs=^H, kcub1=\ED, kcud1=\EB, kcuf1=\EC,
+	kcuu1=\EA, kdch1=\177, kf1=\EP, kf10=\EY, kf11=\Ep, kf12=\Eq,
+	kf13=\Er, kf14=\Es, kf15=\Et, kf16=\Eu, kf17=\Ev, kf18=\Ew,
+	kf19=\Ex, kf2=\EQ, kf20=\Ey, kf3=\ER, kf4=\ES, kf5=\ET,
+	kf6=\EU, kf7=\EV, kf8=\EW, kf9=\EX, khlp=\EH, khome=\EE,
+	kich1=\EI, knp=\Eb, kpp=\Ea, kund=\EK, nel=\r\n$<2*/>,
+	rev=\Ep, ri=\EI$<2*/>, rmcup=\Ev\E. \Ee\Ez_, rmso=\Eq,
+	rmul=\EzH, rs1=\Ez_\Eb@\EcA, sgr0=\Ez_, smcup=\Ev\Ee\Ez_,
+	smso=\Ep, smul=\EyH,
+
+#### Atari ST
+#
+
+# From: Simson L. Garfinkel <simsong@media-lab.mit.edu>
+atari-old|atari st,
+	OTbs, am,
+	cols#80, it#8, lines#25,
+	clear=\EH\EJ, cub1=\ED, cud1=\EB, cuf1=\EC,
+	cup=\EY%p1%{32}%+%c%p2%{32}%+%c, cuu1=\EA, dl1=\EM,
+	ed=\EJ, el=\EK, ht=^I, il1=\EL, kcub1=\ED, kcud1=\EB,
+	kcuf1=\EC, kcuu1=\EA, ri=\EI, rmso=\Eq, sgr0=\Eq, smso=\Ep,
+# UniTerm terminal program for the Atari ST:  49-line VT220 emulation mode
+# From: Paul M. Aoki <aoki@ucbvax.berkeley.edu>
+uniterm|uniterm49|UniTerm VT220 emulator with 49 lines,
+	lines#49,
+	is2=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h\E[1;49r\E[49;1H,
+	use=vt220,
+# MiNT VT52 emulation. 80 columns, 25 rows.
+# MiNT is Now TOS, the operating system which comes with all Ataris now
+# (mainly Atari Falcon). This termcap is for the VT52 emulation you get
+# under tcsh/zsh/bash/sh/ksh/ash/csh when you run MiNT in `console' mode
+# From: Per Persson <pp@gnu.ai.mit.edu>, 27 Feb 1996
+st52-old|Atari ST with VT52 emulation,
+	am, km,
+	cols#80, lines#25,
+	bel=^G, civis=\Ef, clear=\EH\EJ, cnorm=\Ee, cr=^M, cub1=\ED,
+	cud1=\EB, cuf1=\EC, cup=\EY%p1%{32}%+%c%p2%{32}%+%c,
+	cuu1=\EA, dl1=\EM, ed=\EJ, el=\EK, home=\EH, ht=^I, il1=\EL,
+	ind=^J, ka1=\E#7, ka3=\E#5, kb2=\E#9, kbs=^H, kc1=\E#1,
+	kc3=\E#3, kclr=\E#7, kcub1=\E#K, kcud1=\E#P, kcuf1=\E#M,
+	kcuu1=\E#H, kf0=\E#D, kf1=\E#;, kf2=\E#<, kf3=\E#=, kf4=\E#>,
+	kf5=\E#?, kf6=\E#@, kf7=\E#A, kf8=\E#B, kf9=\E#C, khome=\E#G,
+	kil1=\E#R, kind=\E#2, kri=\E#8, lf0=f10, nel=^M^J, rc=\Ek,
+	ri=\EI, rmcup=, rmso=\Eq, rs1=\Ez_\Eb@\EcA, sc=\Ej, sgr0=\Eq,
+	smcup=\Ee, smso=\Ep,
+
 #### BeOS
 #
 # BeOS entry for Terminal program Seems to be almost ANSI
@@ -715,10 +893,11 @@
 	it#8, ncv#18,
 	acsc=+\020\,\021-\030.^Y0\333`\004a\261f\370g\361h\260i\316j\331k\277l\332m\300n\305o~p\304q\304r\304s_t\303u\264v\301w\302x\263y\363z\362{\343|\330}\234~\376,
 	bel=^G, clear=\E[H\E[J, cr=^M, csr=\E[%i%p1%d;%p2%dr,
-	cub1=^H, cud1=^J, cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH,
-	cuu1=\E[A, dch=\E[%p1%dP, dch1=\E[P, dim=\E[2m,
-	dl=\E[%p1%dM, dl1=\E[M, ech=\E[%p1%dX, ed=\E[J, el=\E[K,
-	el1=\E[1K, flash=\E[?5h\E[?5l$<200/>, home=\E[H,
+	cub=\E[%p1%dD, cub1=^H, cud=\E[%p1%dB, cud1=^J,
+	cuf=\E[%p1%dC, cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH,
+	cuu=\E[%p1%dA, cuu1=\E[A, dch=\E[%p1%dP, dch1=\E[P,
+	dim=\E[2m, dl=\E[%p1%dM, dl1=\E[M, ech=\E[%p1%dX, ed=\E[J,
+	el=\E[K, el1=\E[1K, flash=\E[?5h\E[?5l$<200/>, home=\E[H,
 	hpa=\E[%i%p1%dG, ht=^I, hts=\EH, ich=\E[%p1%d@, ich1=\E[@,
 	il=\E[%p1%dL, il1=\E[L, ind=^J, kb2=\E[G, kbs=\177,
 	kcbt=\E[Z, kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A,
@@ -746,12 +925,12 @@
 # 1.9.9.
 linux-c-nc|linux console with color-change,
 	ccc,
-	initc=\E]P%p1%x%p2%{256}%*%{1000}%/%02x%p3%{256}%*%{1000}%/%02x%p4%{256}%*%{1000}%/%02x,
+	initc=\E]P%p1%x%p2%{255}%*%{1000}%/%02x%p3%{255}%*%{1000}%/%02x%p4%{255}%*%{1000}%/%02x,
 	oc=\E]R, use=linux-basic,
 # From: Dennis Henriksen <opus@osrl.dk>, 9 July 1996
 linux-c|linux console 1.3.6+ for older ncurses,
 	ccc,
-	initc=\E]P%?%p1%{9}%>%t%p1%{10}%-%'a'%+%c%e%p1%d%;%p2%{256}%*%{1000}%/%Pr%gr%{16}%/%Px%?%gx%{9}%>%t%gx%{10}%-%'a'%+%c%e%gx%d%;%gr%{15}%&%Px%?%gx%{9}%>%t%gx%{10}%-%'a'%+%c%e%gx%d%;%p3%{256}%*%{1000}%/%Pr%gr%{16}%/%Px%?%gx%{9}%>%t%gx%{10}%-%'a'%+%c%e%gx%d%;%gr%{15}%&%Px%?%gx%{9}%>%t%gx%{10}%-%'a'%+%c%e%gx%d%;%p4%{256}%*%{1000}%/%Pr%gr%{16}%/%Px%?%gx%{9}%>%t%gx%{10}%-%'a'%+%c%e%gx%d%;%gr%{15}%&%Px%?%gx%{9}%>%t%gx%{10}%-%'a'%+%c%e%gx%d%;,
+	initc=\E]P%?%p1%{9}%>%t%p1%{10}%-%'a'%+%c%e%p1%d%;%p2%{255}%*%{1000}%/%Pr%gr%{16}%/%Px%?%gx%{9}%>%t%gx%{10}%-%'a'%+%c%e%gx%d%;%gr%{15}%&%Px%?%gx%{9}%>%t%gx%{10}%-%'a'%+%c%e%gx%d%;%p3%{255}%*%{1000}%/%Pr%gr%{16}%/%Px%?%gx%{9}%>%t%gx%{10}%-%'a'%+%c%e%gx%d%;%gr%{15}%&%Px%?%gx%{9}%>%t%gx%{10}%-%'a'%+%c%e%gx%d%;%p4%{255}%*%{1000}%/%Pr%gr%{16}%/%Px%?%gx%{9}%>%t%gx%{10}%-%'a'%+%c%e%gx%d%;%gr%{15}%&%Px%?%gx%{9}%>%t%gx%{10}%-%'a'%+%c%e%gx%d%;,
 	oc=\E]R, use=linux-basic,
 
 # The 2.2.x kernels add a private mode that sets the cursor type; use that to
@@ -814,6 +993,41 @@
 	initp@, kcbt@, oc@, op=\E[37;40m, rs1=\Ec, tsl=\E[?T,
 	use=linux,
 
+# 16-color linux console entry; this works with a 256-character
+# console font but bright background colors turn into dim ones when
+# you use a 512-character console font. This uses bold for bright
+# foreground colors and blink for bright background colors.
+linux-16color|linux console with 16 colors,
+	colors#16, ncv#54, pairs#256,
+	setab=\E[4%p1%{8}%m%d%?%p1%{8}%>%t;5%e%p1%{8}%=%t;2%e;25%;m,
+	setaf=\E[3%p1%{8}%m%d%?%p1%{8}%>%t;1%e%p1%{8}%=%t;2%e;21%;m,
+	use=linux,
+
+# bterm (bogl 0.1.18)
+# Implementation is in bogl-term.c
+# Key capabilities from linux terminfo entry
+#
+# Notes:
+# bterm only supports acs using wide-characters, has case for these: qjxamlkut
+# bterm does not support sgr, since it only processes one parameter -TD
+bterm|bogl virtual terminal,
+	am, bce,
+	colors#8, cols#80, lines#24, pairs#64,
+	acsc=aajjkkllmmqqttuuxx, bold=\E[1m, civis=\E[?25l,
+	clear=\E[H\E[2J, cnorm=\E[?25h, cr=^M, cub1=^H, cud1=^J,
+	cup=\E[%i%p1%d;%p2%dH, ed=\E[J, el=\E[K, home=\E[H, ind=^J,
+	kb2=\E[G, kbs=\177, kcbt=\E[Z, kcub1=\E[D, kcud1=\E[B,
+	kcuf1=\E[C, kcuu1=\E[A, kdch1=\E[3~, kend=\E[4~, kf1=\E[[A,
+	kf10=\E[21~, kf11=\E[23~, kf12=\E[24~, kf13=\E[25~,
+	kf14=\E[26~, kf15=\E[28~, kf16=\E[29~, kf17=\E[31~,
+	kf18=\E[32~, kf19=\E[33~, kf2=\E[[B, kf20=\E[34~,
+	kf3=\E[[C, kf4=\E[[D, kf5=\E[[E, kf6=\E[17~, kf7=\E[18~,
+	kf8=\E[19~, kf9=\E[20~, khome=\E[1~, kich1=\E[2~,
+	kmous=\E[M, knp=\E[6~, kpp=\E[5~, kspd=^Z, nel=^M^J,
+	op=\E49;39m, rev=\E[7m, ri=\EM, rmacs=^O, rmso=\E[27m,
+	rmul=\E[24m, setab=\E[4%p1%dm, setaf=\E[3%p1%dm,
+	sgr0=\E[0m, smacs=^N, smso=\E[7m, smul=\E[4m,
+
 #### Mach
 #
 
@@ -869,7 +1083,7 @@
 hurd|The GNU Hurd console server,
 	am, bce, bw, eo, km, mir, msgr, xon,
 	colors#8, it#8, ncv#18, pairs#64,
-	acsc=++\,\,--..00ii``aaffgghhjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
+	acsc=++\,\,--..00``aaffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
 	bel=^G, blink=\E[5m, bold=\E[1m, cbt=\E[Z, civis=\E[?25l,
 	clear=\Ec, cnorm=\E[?25h, cr=^M, csr=\E[%i%p1%d;%p2%dr,
 	cub=\E[%p1%dD, cub1=^H, cud=\E[%p1%dB, cud1=\E[B,
@@ -938,7 +1152,7 @@
 scoansi-old|SCO Extended ANSI standard crt (5.0.5),
 	OTbs, am, bce, eo, xon,
 	colors#8, cols#80, it#8, lines#25, pairs#64,
-	acsc=-\230.\231\,.+/0[5566778899\:\:;;<<==>>FFGGHHIIJJKKLLMMNNOOPPQQRRSSTTUUVVWWXX`\204a0fxgqh2jYk?lZm@nEqDtCu4vAwBx3yszr{c}\034~\207,
+	acsc=+/\,.-\230.\2310[5566778899\:\:;;<<==>>FFGGHHIIJJKKLLMMNNOOPPQQRRSSTTUUVVWWXX`\204a0fxgqh2jYk?lZm@nEqDtCu4vAwBx3yszr{c}\034~\207,
 	bel=^G, blink=\E[5m, bold=\E[1m, cbt=\E[Z,
 	civis=\E[=14;12C, clear=\E[H\E[2J, cnorm=\E[=10;12C,
 	cub=\E[%p1%dD, cub1=^H, cud=\E[%p1%dB, cud1=\E[B,
@@ -1005,7 +1219,7 @@
 	sc=\E7,
 	sgr=\E[10m\E[0%?%p1%p3%|%t;7%;%?%p2%t;4%;%?%p4%t;5%;%?%p5%t;2%;%?%p6%t;1%;%?%p9%t;12%e;10%;%?%p7%t;9%;m,
 	sgr0=\E[0;10m, smacs=\E[12m, smso=\E[7m, smul=\E[4m,
-	tbc=\E[2g, vpa=\E[%i%p1%dd, use=klone+color,
+	tbc=\E[3g, vpa=\E[%i%p1%dd, use=klone+color,
 # (pc6300plus: removed ":KM=/usr/lib/ua/kmap.s5:"; renamed BO/EE/CI/CV -- esr)
 pc6300plus|AT&T 6300 plus,
 	OTbs, am, xon,
@@ -1373,7 +1587,7 @@
 qansi-g|QNX ANSI,
 	am, eslok, hs, xon,
 	colors#8, cols#80, it#8, lines#25, ncv#19, pairs#64, wsl#80,
-	acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~Oa,
+	acsc=Oa``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
 	bel=^G, blink=\E[5m, bold=\E[1m, cbt=\E[Z, civis=\E[?25l,
 	clear=\E[2J\E[H, cnorm=\E[?25h\E[?12l, cr=^M,
 	csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=\E[D,
@@ -1416,7 +1630,7 @@
 	setf=\E[3%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m,
 	sgr=\E[0%?%p6%t;1%;%?%p5%t;2%;%?%p2%t;4%;%?%p4%t;5%;%?%p3%p1%|%t;7%;%?%p7%t;9%;m%?%p9%t\016%e\017%;,
 	sgr0=\E[m\017, smacs=^N, smam=\E[?7h, smso=\E[7m,
-	smul=\E[4m, tbc=\E[2g,
+	smul=\E[4m, tbc=\E[3g,
 	tsl=\E7\E1;24r\E[?6l\E[25;%i%p1%dH,
 #
 qansi|QNX ansi with console writes,
@@ -1605,8 +1819,8 @@
 	is2=\E[r\E[25;1H, kend=\E[8~, kf1=\E[11~, kf10=\E[21~,
 	kf11=\E[23~, kf12=\E[24~, kf2=\E[12~, kf3=\E[13~,
 	kf4=\E[14~, kf5=\E[15~, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~,
-	kf9=\E[20~, khome=\E[7~, op=\E[m, setab=\E[4%p1%dm,
-	setaf=\E[3%p1%dm, use=vt220,
+	kf9=\E[20~, khome=\E[7~, op=\E[m, rs1=\Ec,
+	setab=\E[4%p1%dm, setaf=\E[3%p1%dm, use=vt220,
 
 wsvt25m|NetBSD wscons in 25 line DEC VT220 mode with Meta,
 	km, use=wsvt25,
@@ -1849,7 +2063,7 @@
 vt52|dec vt52,
 	OTbs,
 	cols#80, it#8, lines#24,
-	acsc=ffgghhompoqqss.k, bel=^G, clear=\EH\EJ, cr=^M,
+	acsc=+h.k0affggolpnqprrss, bel=^G, clear=\EH\EJ, cr=^M,
 	cub1=\ED, cud1=\EB, cuf1=\EC,
 	cup=\EY%p1%{32}%+%c%p2%{32}%+%c, cuu1=\EA, ed=\EJ,
 	el=\EK, home=\EH, ht=^I, ind=^J, kbs=^H, kcub1=\ED, kcud1=\EB,
@@ -2283,9 +2497,9 @@
 	am,
 	cols#80,
 	bel=^G, clear=\E[H\E[J, cr=^M, csr=\E[%i%p1%d;%p2%dr,
-	cub1=^H, cud1=^J, cup=\E[%i%p1%d;%p2%dH, cuu1=\E[A,
-	dch1=\E[P, dl1=\E[M, ed=\E[J, el=\E[K, home=\E[H, ht=^I,
-	il1=\E[L, ind=\ED,
+	cub1=^H, cud1=^J, cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH,
+	cuu1=\E[A, dch1=\E[P, dl1=\E[M, ed=\E[J, el=\E[K, home=\E[H,
+	ht=^I, il1=\E[L, ind=\ED,
 	is2=\E[61"p\E[H\E[?3l\E[?4l\E[?1l\E[?5l\E[?6l\E[?7h\E[?8h\E[?25h\E>\E[m,
 	kbs=^H, kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA,
 	kf1=\EOP, kf2=\EOQ, kf3=\EOR, kf4=\EOS, nel=^M\ED, rc=\E8,
@@ -2671,7 +2885,7 @@
 # the default behavior -TD
 
 putty|PuTTY terminal emulator,
-	am, bce, bw, ccc, hs, mir, msgr, xenl, xon,
+	am, bce, bw, ccc, hs, mir, msgr, xenl, xon, XT,
 	colors#8, it#8, ncv#22, pairs#64,
 	acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
 	bel=^G, blink=\E[5m, bold=\E[1m, cbt=\E[Z, civis=\E[?25l,
@@ -2688,13 +2902,13 @@
 	indn=\E[%p1%dS,
 	initc=\E]P%p1%x%p2%{255}%*%{1000}%/%02x%p3%{255}%*%{1000}%/%02x%p4%{255}%*%{1000}%/%02x,
 	is2=\E7\E[r\E[m\E[?7h\E[?1;4;6l\E[4l\E8\E>\E]R,
-	kb2=\E[G, kbs=\177, kcan=^C, kcbt=\E[Z, kcub1=\E[D,
-	kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, kdch1=\E[3~,
-	kend=\E[4~, kf1=\E[11~, kf10=\E[21~, kf11=\E[23~,
-	kf12=\E[24~, kf13=\E[25~, kf14=\E[26~, kf15=\E[28~,
-	kf16=\E[29~, kf17=\E[31~, kf18=\E[32~, kf19=\E[33~,
-	kf2=\E[12~, kf20=\E[34~, kf3=\E[13~, kf4=\E[14~,
-	kf5=\E[15~, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~,
+	kb2=\E[G, kbs=\177, kcbt=\E[Z, kcub1=\E[D, kcud1=\E[B,
+	kcuf1=\E[C, kcuu1=\E[A, kdch1=\E[3~, kend=\E[4~,
+	kf1=\E[11~, kf10=\E[21~, kf11=\E[23~, kf12=\E[24~,
+	kf13=\E[25~, kf14=\E[26~, kf15=\E[28~, kf16=\E[29~,
+	kf17=\E[31~, kf18=\E[32~, kf19=\E[33~, kf2=\E[12~,
+	kf20=\E[34~, kf3=\E[13~, kf4=\E[14~, kf5=\E[15~,
+	kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~,
 	khome=\E[1~, kich1=\E[2~, kmous=\E[M, knp=\E[6~, kpp=\E[5~,
 	kspd=^Z, nel=^M^J, oc=\E]R, op=\E[39;49m, rc=\E8, rev=\E[7m,
 	ri=\EM, rin=\E[%p1%dT, rmacs=^O, rmam=\E[?7l,
@@ -2864,11 +3078,15 @@
 ms-vt-utf8|vt-utf8|UTF-8 flavor of vt100+,
 	use=ms-vt100+,
 
+# expect-5.44.1.15/example/tkterm
 # a minimal subset of a vt100 (compare with "news-unk).
+#
+# The missing "=" in smkx is not a typo (here), but an error in tkterm.
 tt|tkterm|Don Libes' tk text widget terminal emulator,
-	clear=\E[H\E[J, cr=^M, cuf1=\E[C, cup=\E[%p1%d;%p2%dH,
-	cuu1=\E[A, ind=^J, kf1=\EOP, kf2=\EOQ, kf3=\EOR, kf4=\EOS,
-	kf5=\EOT, kf6=\EOU, kf7=\EOV, kf8=\EOW, kf9=\EOX, rmso=\E[m,
+	clear=\E[H\E[J, cr=^M, cub1=^H, cud1=^J, cuf1=\E[C,
+	cup=\E[%p1%d;%p2%dH, cuu1=\E[A, ind=^J, kf1=\EOP, kf2=\EOQ,
+	kf3=\EOR, kf4=\EOS, kf5=\EOT, kf6=\EOU, kf7=\EOV, kf8=\EOW,
+	kf9=\EOX, rmkx=\E[?1l\E>, rmso=\E[m, smkx=\E[?1h\E,
 	smso=\E[7m,
 
 #### X terminal emulators
@@ -3256,11 +3474,15 @@
 xterm-xi|xterm on XI Graphics Accelerated X under BSD/OS 3.1,
 	rmso=\E[m, rmul=\E[m, use=xterm-xf86-v33,
 
-# This is one of the variants of XFree86 3.3 xterm, updated for 4.0 (T.Dickey)
+# 16-colors is one of the variants of XFree86 3.3 xterm, updated for 4.0 (T.Dickey)
+# If configured to support 88- or 256-colors (which is fairly common in 2009),
+# xterm also recognizes the control sequences for initc -TD
 xterm-16color|xterm with 16 colors like aixterm,
+	ccc,
+	initc=\E]4;%p1%d;rgb\:%p2%{255}%*%{1000}%/%2.2X/%p3%{255}%*%{1000}%/%2.2X/%p4%{255}%*%{1000}%/%2.2X\E\\,
 	use=ibm+16color, use=xterm-new,
 
-# This is a compile-time feature of XFree86 xterm beginning with
+# 256-colors is a compile-time feature of XFree86 xterm beginning with
 # patch #111 (1999/7/10) -TD
 xterm+256color|xterm 256-color feature,
 	ccc,
@@ -3270,7 +3492,7 @@
 	setaf=\E[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m,
 	setb@, setf@,
 
-# This is a compile-time feature of XFree86 xterm beginning with
+# 88-colors is a compile-time feature of XFree86 xterm beginning with
 # patch #115 (1999/9/18) -TD
 #
 # Note that the escape sequences used are the same as for 256-colors - xterm
@@ -3437,7 +3659,7 @@
 #  -- MATSUMOTO Shoji)
 # kterm implements acsc via built-in table of X Drawable's
 kterm|kterm kanji terminal emulator (X window system),
-	eslok, hs,
+	eslok, hs, XT,
 	ncv@,
 	acsc=``aajjkkllmmnnooppqqrrssttuuvvwwxx~~,
 	csr=\E[%i%p1%d;%p2%dr, dsl=\E[?H, enacs=, fsl=\E[?F,
@@ -3461,7 +3683,7 @@
 # The README's with the distribution also say that it supports SGR 21, 24, 25
 # and 27, but they are not present in the terminfo or termcap.
 color_xterm|cx|cx100|color_xterm color terminal emulator for X,
-	OTbs, am, km, mir, msgr, xenl,
+	OTbs, am, km, mir, msgr, xenl, XT,
 	cols#80, it#8, lines#65, ncv@,
 	acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
 	bel=^G, bold=\E[1m, clear=\E[H\E[2J, cr=^M,
@@ -3574,8 +3796,10 @@
 # of the keys (which more/less correspond to the termcap values), and will
 # interpret those according to the $TERM value, but others not in the
 # terminfo according to some constantly changing set of hacker guidelines -TD
-gnome-2007|GNOME Terminal snapshot 2.18.1,
+vte-2007|VTE in GNOME Terminal snapshot 2.18.1,
 	use=xterm+pcc2, use=gnome-fc5,
+gnome-2007|GNOME Terminal snapshot 2.18.1,
+	use=vte-2007,
 
 # GNOME Terminal 2.22.3 (2008 snapshot)
 #
@@ -3584,8 +3808,10 @@
 # vt220's behavior, which will make it less usable on a VMS system (unclear
 # what the intent of the developer is, since the NRC feature exposed in vttest
 # by this change does not work).
+vte-2008|VTE in GNOME Terminal snapshot 2.22.3,
+	use=vte+pcfkeys, use=vte-2007,
 gnome-2008|GNOME Terminal snapshot 2.22.3,
-	use=gnome+pcfkeys, use=gnome-2007,
+	use=vte-2008,
 
 # GNOME terminal may automatically use the contents of the "xterm" terminfo to
 # supply key information which is not built into the program.  With 2.22.3,
@@ -3603,7 +3829,7 @@
 #
 # The parameters with \EO (SS3) are technically an error, since SS3 should have
 # no parameters.  This appears to be rote copying based on xterm+pcc0.
-gnome+pcfkeys|gnome variation on xterm+pcfkeys,
+vte+pcfkeys|VTE's variation on xterm+pcfkeys,
 	kf1=\EOP, kf13=\EO1;2P, kf14=\EO1;2Q, kf15=\EO1;2R,
 	kf16=\EO1;2S, kf2=\EOQ, kf25=\EO1;5P, kf26=\EO1;5Q,
 	kf27=\EO1;5R, kf28=\EO1;5S, kf3=\EOR, kf37=\EO1;6P,
@@ -3611,13 +3837,19 @@
 	kf49=\EO1;3P, kf50=\EO1;3Q, kf51=\EO1;3R, kf52=\EO1;3S,
 	kf61=\EO1;4P, kf62=\EO1;4Q, kf63=\EO1;4R,
 	use=xterm+pcfkeys,
+gnome+pcfkeys|VTE's variation on xterm+pcfkeys,
+	use=vte+pcfkeys,
 
+vte|VTE aka GNOME Terminal,
+	use=vte-2008,
 gnome|GNOME Terminal,
-	use=gnome-2008,
+	use=vte,
 
 # palette is hardcoded...
+vte-256color|VTE with xterm 256-colors,
+	initc@, use=xterm+256color, use=vte,
 gnome-256color|GNOME Terminal with xterm 256-colors,
-	initc@, use=xterm+256color, use=gnome,
+	use=vte-256color,
 
 # XFCE Terminal 0.2.5.4beta2
 #
@@ -3626,7 +3858,7 @@
 # Since most of the terminfo-related behavior is due to the VTE library,
 # the terminfo is the same as gnome-terminal.
 xfce|Xfce Terminal,
-	use=gnome,
+	use=vte,
 
 # Multi-Gnome-Terminal 1.6.2
 #
@@ -3679,7 +3911,8 @@
 # different from xterm (and vt100's).  They have the same behavior in this
 # detail, but it is unclear which copies the other.
 konsole-base|KDE console window,
-	bce, km@, npc,
+	bce, km@, npc, XT,
+	ncv@,
 	bel@, blink=\E[5m, civis=\E[?25l, cnorm=\E[?25h,
 	ech=\E[%p1%dX, flash=\E[?5h$<100/>\E[?5l,
 	hpa=\E[%i%p1%dG, indn=\E[%p1%dS, kbs=\177, kdch1@,
@@ -3752,7 +3985,7 @@
 #	control/shift/alt	kf1 to kf12	\E[11;8~ to \E[24;8~
 #
 mlterm|multi lingual terminal emulator,
-	am, eslok, km, mc5i, mir, msgr, npc, xenl,
+	am, eslok, km, mc5i, mir, msgr, npc, xenl, XT,
 	colors#8, cols#80, it#8, lines#24, pairs#64,
 	acsc=00``aaffgghhjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
 	bel=^G, bold=\E[1m, cbt=\E[Z, civis=\E[?25l,
@@ -3794,6 +4027,9 @@
 	kRIT6=\EO1;6C, kRIT7=\EO1;7C, kUP=\EO1;2A, kUP3=\EO1;3A,
 	kUP4=\EO1;4A, kUP5=\EO1;5A, kUP6=\EO1;6A, kUP7=\EO1;7A,
 
+mlterm-256color|mlterm 3.0 with xterm 256-colors,
+	use=xterm+256color, use=rxvt,
+
 # From: Thomas Dickey <dickey@clark.net> 04 Oct 1997
 # Updated: Oezguer Kesim <kesim@math.fu-berlin.de> 02 Nov 1997
 # Notes:
@@ -3816,7 +4052,7 @@
 # removed dch/dch1 because they are inconsistent with bce/ech -TD
 # remove km as per tack test -TD
 rxvt-basic|rxvt terminal base (X Window System),
-	OTbs, am, bce, eo, mir, msgr, xenl, xon,
+	OTbs, am, bce, eo, mir, msgr, xenl, xon, XT,
 	cols#80, it#8, lines#24,
 	acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
 	bel=^G, blink=\E[5m, bold=\E[1m, civis=\E[?25l,
@@ -3934,12 +4170,12 @@
 	kf38=\E[29\^, kf39=\E[31\^, kf4=\E[14~, kf40=\E[32\^,
 	kf41=\E[33\^, kf42=\E[34\^, kf43=\E[23@, kf44=\E[24@,
 	kf5=\E[15~, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~,
-	kfnd=\E[1~, khome=\E[7~, kich1=\E[2~, knp=\E[6~, kpp=\E[5~,
-	kslt=\E[4~, kDC5=\E[3\^, kDC6=\E[3@, kDN=\E[b, kDN5=\EOb,
-	kEND5=\E[8\^, kEND6=\E[8@, kHOM5=\E[7\^, kHOM6=\E[7@,
-	kIC5=\E[2\^, kIC6=\E[2@, kLFT5=\EOd, kNXT5=\E[6\^,
-	kNXT6=\E[6@, kPRV5=\E[5\^, kPRV6=\E[5@, kRIT5=\EOc,
-	kUP=\E[a, kUP5=\EOa,
+	kfnd=\E[1~, khome=\E[7~, kich1=\E[2~, kind=\E[a, knp=\E[6~,
+	kpp=\E[5~, kri=\E[b, kslt=\E[4~, kDC5=\E[3\^, kDC6=\E[3@,
+	kDN=\E[b, kDN5=\EOb, kEND5=\E[8\^, kEND6=\E[8@,
+	kHOM5=\E[7\^, kHOM6=\E[7@, kIC5=\E[2\^, kIC6=\E[2@,
+	kLFT5=\EOd, kNXT5=\E[6\^, kNXT6=\E[6@, kPRV5=\E[5\^,
+	kPRV6=\E[5@, kRIT5=\EOc, kUP=\E[a, kUP5=\EOa,
 
 rxvt|rxvt terminal emulator (X Window System),
 	ncv@,
@@ -3954,10 +4190,10 @@
 rxvt-xpm|rxvt terminal emulator (X Window System),
 	use=rxvt,
 rxvt-cygwin|rxvt terminal emulator (X Window System) on cygwin,
-	acsc=0\333+\257\,\256-\^`\004a\261f\370g\361h\260j\331k\277l\332m\300n\305o~p\304q\304r\304s_t\303u\264v\301w\302x\263y\363z\362{\343|\330}\234~\376,
+	acsc=+\257\,\256-\^0\333`\004a\261f\370g\361h\260j\331k\277l\332m\300n\305o~p\304q\304r\304s_t\303u\264v\301w\302x\263y\363z\362{\343|\330}\234~\376,
 	use=rxvt,
 rxvt-cygwin-native|rxvt terminal emulator (native MS Window System port) on cygwin,
-	acsc=0\333+\257\,\256-\^`\004a\261f\370g\361h\260j\331k\277l\332m\300n\305o~p\304q\304r\304s_t\303u\264v\301w\302x\263y\363z\362{\343|\330~\376,
+	acsc=+\257\,\256-\^0\333`\004a\261f\370g\361h\260j\331k\277l\332m\300n\305o~p\304q\304r\304s_t\303u\264v\301w\302x\263y\363z\362{\343|\330~\376,
 	use=rxvt-cygwin,
 
 # This variant is supposed to work with rxvt 2.7.7 when compiled with
@@ -3965,12 +4201,22 @@
 rxvt-16color|xterm with 16 colors like aixterm,
 	ncv#32, use=ibm+16color, use=rxvt,
 
-# mrxvt 0.5.3
+# mrxvt 0.5.4
 #
 # mrxvt is based on rxvt 2.7.11, but has by default XTERM_FKEYS defined, which
 # makes its function-keys different from other flavors of rxvt -TD
 mrxvt|multitabbed rxvt,
-	use=xterm+pcc2, use=xterm+r6f2, use=rxvt,
+	XT,
+	kEND=\E[8;2~, kHOM=\E[7;2~, kcub1=\E[D, kcud1=\E[B,
+	kcuf1=\E[C, kcuu1=\E[A, kend=\E[8~, khome=\E[7~,
+	kEND3=\E[8;3~, kEND4=\E[8;4~, kEND5=\E[8;5~,
+	kEND6=\E[8;6~, kEND7=\E[8;7~, kHOM3=\E[7;3~,
+	kHOM4=\E[7;4~, kHOM5=\E[7;5~, kHOM6=\E[7;6~,
+	kHOM7=\E[7;7~, use=xterm+r6f2, use=xterm+pcfkeys,
+	use=rxvt,
+
+mrxvt-256color|multitabbed rxvt with 256 colors,
+	use=xterm+256color, use=mrxvt,
 
 # From: Michael Jennings <mej@valinux.com>
 #
@@ -3983,7 +4229,7 @@
 # remove nonworking flash -TD
 # remove km as per tack test -TD
 Eterm|Eterm-color|Eterm with xterm-style color support (X Window System),
-	am, bce, bw, eo, mc5i, mir, msgr, xenl, xon,
+	am, bce, bw, eo, mc5i, mir, msgr, xenl, xon, XT,
 	btns#5, cols#80, it#8, lines#24, lm#0, ncv@,
 	acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
 	bel=^G, blink=\E[5m, bold=\E[1m, civis=\E[?25l,
@@ -4019,6 +4265,7 @@
 
 # Based on rxvt 2.4.8, it has a few differences in key bindings
 aterm|AfterStep terminal,
+	XT,
 	kbs=\177, kf1=\EOP, kf2=\EOQ, kf3=\EOR, kf4=\EOS, use=rxvt,
 
 # xiterm  0.5-5.2
@@ -4037,7 +4284,7 @@
 	btns#3, cols#80, it#8, lines#24,
 	acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
 	bel=^G, blink@, bold=\E[1m, clear=\E[H\E[2J, cr=^M,
-	csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=\E[1D,
+	csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=\E[D,
 	cud=\E[%p1%dB, cud1=^J, cuf=\E[%p1%dC, cuf1=\E[C,
 	cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A,
 	dch=\E[%p1%dP, dch1=\E[P, dl=\E[%p1%dM, dl1=\E[M, ed=\E[J,
@@ -4140,7 +4387,7 @@
 	acsc=61a\202f\260g2j\213k\214l\215m\216n\217o\220q\222s\224t\225u\226v\227w\230x\231~\244,
 	bel=^G, blink=\EW, bold=\EU, civis=\EZ, clear=\EP\EE0;0;,
 	cnorm=\Ea, cr=^M, csr=\Ek%p1%d;%p2%d;, cub=\Eq-%p1%d;,
-	cub1=^H, cud=\Ep%p1%d;, cud1=\EB, cuf=\Eq%p1%d;, cuf1=\ED,
+	cub1=^H, cud=\Ep%p1%d;, cud1=\EB, cuf=\Eq%p1%d;, cuf1=\EC,
 	cup=\EE%p1%d;%p2%d;, cuu=\Ep-%p1%d;, cuu1=\EA,
 	dch=\EI%p1%d;, dch1=\EI1;, dl=\ER%p1%d;, dl1=\ER1;,
 	ech=\Ej%p1%d;, ed=\EN, el=\EK, el1=\EL, home=\EE0;0;, ht=^I,
@@ -4285,6 +4532,31 @@
 	smkx=\E[?1h\E=, smso=\E[7m, smul=\E[4m, u6=\E[%i%d;%dR,
 	u7=\E[6n, vpa=\E[%i%p1%dd,
 
+#### VWM
+#
+# vwmterm is a terminal emulator written for the VWM console window manager
+#
+vwmterm|(vwm term),
+	am, bce, ccc, mir, msgr, npc, xenl, xon,
+	colors#8, pairs#64,
+	acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
+	bel=^G, blink=\E[5m, bold=\E[1m, civis=\E[?25l,
+	clear=\E[H\E[J, cnorm=\E[?25h, cr=^M, cub=\E[%p1%dD,
+	cub1=^H, cud=\E[%p1%dB, cud1=\E[B, cuf=\E[%p1%dC,
+	cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA,
+	cuu1=\E[A, cvvis=\E[?25h, dim=\E[2m, ed=\E[J, el=\E[K,
+	home=\E[H, il1=\E[L, ind=^J, invis=\E[8m, kcub1=\E[D,
+	kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, kdch1=\E[3~,
+	kend=\E[4~, kf1=\E[[A, kf10=\E[21~, kf11=\E[22~,
+	kf12=\E[23~, kf2=\E[[B, kf3=\E[[C, kf4=\E[[D, kf5=\E[[E,
+	kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~,
+	khome=\E[1~, knp=\E[6~, kpp=\E[5~, rev=\E[7m, rmacs=\E[10m,
+	rmam=\E[?7l, rmcup=\E[?1049l, rs1=\E[H\E[J\E[m\Ec,
+	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, smam=\E[?7h,
+	smcup=\E[?1049h, smso=\E[3m, smul=\E[4m,
+
 #### MGR
 #
 # MGR is a Bell Labs window system lighter-weight than X.
@@ -4357,6 +4629,26 @@
 	sgr0=\E[m, smcup=\E7\E[?47h, smir=\E[4h, smso=\E[7m,
 	smul=\E[4m,
 
+# The codes supported by the term.el terminal emulation in GNU Emacs 22.2
+eterm-color|Emacs term.el terminal emulator term-protocol-version 0.96,
+	am, mir, msgr, xenl,
+	colors#8, cols#80, lines#24, pairs#64,
+	bel=^G, blink=\E[5m, bold=\E[1m, clear=\E[H\E[J, cr=^M,
+	csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H,
+	cud=\E[%p1%dB, cud1=^J, cuf=\E[%p1%dC, cuf1=\E[C,
+	cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A,
+	dch=\E[%p1%dP, dch1=\E[P, dl=\E[%p1%dM, dl1=\E[M, ed=\E[J,
+	el=\E[K, el1=\E[1K, home=\E[H, ht=^I, ich=\E[%p1%d@,
+	il=\E[%p1%dL, il1=\E[L, ind=^J, invis=\E[8m, kbs=\177,
+	kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA,
+	kdch1=\E[3~, kend=\E[4~, khome=\E[1~, kich1=\E[2~,
+	knp=\E[6~, kpp=\E[5~, op=\E[39;49m, rc=\E8, rev=\E[7m,
+	ri=\EM, rmir=\E[4l, rmso=\E[27m, rmul=\E[24m, rs1=\Ec,
+	sc=\E7, setab=\E[%p1%'('%+%dm, setaf=\E[%p1%{30}%+%dm,
+	sgr=\E[0%?%p1%p3%|%t;7%;%?%p2%t;4%;%?%p4%t;5%;%?%p6%t;1%;%?%p7%t;8%;m,
+	sgr0=\E[m, smir=\E[4h, smso=\E[7m, smul=\E[4m,
+	u6=\E[%i%d;%dR, u7=\E[6n,
+
 # Entries for use by the `screen' program by Juergen Weigert,
 # Michael Schroeder, Oliver Laumann.  The screen and
 # screen-w entries came with version 3.7.1.  The screen2 and screen3 entries
@@ -4374,7 +4666,7 @@
 # tested with screen 3.09.08
 screen|VT 100/ANSI X3.64 virtual terminal,
 	OTbs, OTpt, am, km, mir, msgr, xenl, G0,
-	colors#8, cols#80, it#8, lines#24, pairs#64,
+	colors#8, cols#80, it#8, lines#24, ncv@, pairs#64,
 	acsc=++\,\,--..00``aaffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
 	bel=^G, blink=\E[5m, bold=\E[1m, cbt=\E[Z, civis=\E[?25l,
 	clear=\E[H\E[J, cnorm=\E[34h\E[?25h, cr=^M,
@@ -4400,7 +4692,8 @@
 # The bce and status-line entries are from screen 3.9.13 (and require some
 # changes to .screenrc).
 screen-bce|VT 100/ANSI X3.64 virtual terminal with bce,
-	bce, use=screen,
+	bce,
+	ech@, use=screen,
 screen-s|VT 100/ANSI X3.64 virtual terminal with hardstatus line,
 	dsl=\E_\E\\, fsl=\E\\, tsl=\E_, use=screen,
 
@@ -4493,10 +4786,20 @@
 	use=screen+fkeys, use=screen,
 # Other terminals
 screen.rxvt|screen in rxvt,
-	bw,
+	bw, XT,
 	cvvis@, flash@, kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC,
 	kcuu1=\EOA, use=screen+fkeys, use=vt100+enq,
 	use=rxvt+pcfkeys, use=vt220+keypad, use=screen,
+screen.Eterm|screen in Eterm,
+	use=screen+fkeys, use=Eterm,
+screen.mrxvt|screen in mrxvt,
+	use=screen+fkeys, use=mrxvt,
+screen.vte|screen in any VTE-based terminal,
+	use=screen+fkeys, use=vte,
+screen.gnome|screen in GNOME Terminal,
+	use=screen+fkeys, use=gnome,
+screen.konsole|screen in KDE console window,
+	use=screen+fkeys, use=konsole,
 # fix the backspace key
 screen.linux|screen in linux console,
 	bw,
@@ -4504,6 +4807,44 @@
 screen.mlterm|screen in mlterm,
 	use=screen+fkeys, use=mlterm,
 
+# The default "screen" entry is reasonably portable, but not optimal for the
+# most widely-used terminal emulators.  The "bce" capability is supported in
+# screen since 3.9.13, and when used, will require fewer characters to be sent
+# to the terminal for updates.
+#
+# If you are using only terminals which support bce, then you can use this
+# feature in your screen configuration.
+#
+# Adding these lines to your ".screenrc" file will allow using these customized
+# entries:
+#	term screen-bce
+#	bce on
+#	defbce on
+screen-bce.xterm-new|screen optimized for modern xterm,
+	bce,
+	ech@, use=screen.xterm-new,
+screen-bce.rxvt|screen optimized for rxvt,
+	bce,
+	ech@, use=screen.rxvt,
+screen-bce.Eterm|screen optimized for Eterm,
+	bce,
+	ech@, use=screen.Eterm,
+screen-bce.mrxvt|screen optimized for mrxvt,
+	bce,
+	ech@, use=screen.mrxvt,
+screen-bce.gnome|screen optimized for GNOME-Terminal,
+	bce,
+	ech@, use=screen.gnome,
+screen-bce.konsole|screen optimized for KDE console window,
+	bce,
+	ech@, use=screen.konsole,
+screen-bce.linux|screen optimized for linux console,
+	bce,
+	ech@, use=screen.linux,
+screen-bce.mlterm|screen optimized for mlterm,
+	bce,
+	ech@, use=screen.mlterm,
+
 screen-w|VT 100/ANSI X3.64 virtual terminal with 132 cols,
 	cols#132, use=screen,
 
@@ -4762,11 +5103,28 @@
 # Most of the current references to sun-color are from users wondering why this
 # is the default on install.  Details from reading the wscons manpage, adding
 # cub, etc., here (rather than in the base sun-il entry) since it is not clear
-# when those were added -TD
+# when those were added -TD (2005-05-28)
+#
+# According to wscons manpage, color is supported only on IA systems.
+# Sun's terminfo entry documents bold and smul/rmul capabilities, but wscons
+# does not list these.  It also sets ncv#3, however that corresponds to
+# underline and standout.
+#
+# Since the documentation and terminfo do not agree, see also current code at
+# http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/uts/common/io/tem_safe.c
+#
+# That (actually a different driver which "supports" sun-color) also supports
+# these features:
+#	vpa=\E[%i%p1%dd
+#	hpa=\E[%i%p1%d`
+#	cbt=\E[Z
+#	dim=\E[2m
+#	blink=\E[5m
+# It supports bold, but not underline -TD (2009-09-19)
 sun-color|Sun Microsystems Workstation console with color support (IA systems),
-	colors#8, pairs#64,
+	colors#8, ncv#3, pairs#64,
 	cub=\E[%p1%dD, cud=\E[%p1%dB, cuf=\E[%p1%dC,
-	cuu=\E[%p1%dA, home=\E[H, op=\E[m\E[p, setab=\E[4%p1%dm,
+	cuu=\E[%p1%dA, home=\E[H, op=\E[0m, 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,
@@ -4978,7 +5336,7 @@
 nwp511|nwp-511|nwp-511 vt100,
 	OTbs, OTpt, am, xenl,
 	cols#80, lines#24,
-	clear=\E[;H\E[2J$<20/>, cuf1=\E[C,
+	clear=\E[;H\E[2J$<20/>, cub1=\E[D, cud1=\E[B, cuf1=\E[C,
 	cup=\E[%i%p1%d;%p2%dH, cuu1=\E[A$<2/>, dl1=\E[M,
 	ed=\E[J$<30/>, el=\E[K$<3/>,
 	flash=\E[?5h\0\0\0\0\0\0\0\0\0\0\0\0\0\E[?5l,
@@ -5042,44 +5400,13 @@
 
 ### EMX termcap.dat compatibility modes
 #
-# Keypad:	Home=\0G	Up=\0H	PrPag=\0I
-#		ka1,kh		kcuu1		kpp,ka3
-#
-#		Left=\0K	5=\0L		Right=\0M
-#		kcub1		kb2		kcuf1
-#
-#		End=\0O		Down=\0P	NxPag=\0Q
-#		kc1,kend	kcud1		kc3,knp
-#
-#		Ins=\0R		Del=\0S
-#		kich1		kdch1
-#
-# On keyboard with 12 function keys,
-#	shifted f-keys: F13-F24
-#	control f-keys: F25-F36
-#	alt f-keys:     F37-F48
-# The shift/control/alt keys do not modify each other, but alt overrides both,
-# and control overrides shift.
-#
 # Also (possibly only EMX, so we don't put it in ansi.sys, etc): set the
 # no_color_video to inform the application that standout(1), underline(2)
 # reverse(4) and invisible(64) don't work with color.
 emx-base|DOS special keys,
 	bce, bw,
 	it#8, ncv#71,
-	bel=^G, ka1=\0G, ka3=\0I, kb2=\0L, kbs=^H, kc1=\0O, kc3=\0Q,
-	kcbt=\0^O, kcub1=\0K, kcud1=\0P, kcuf1=\0M, kcuu1=\0H,
-	kdch1=\0S, kend=\0O, kf1=\0;, kf10=\0D, kf11=\0\205,
-	kf12=\0\206, kf13=\0T, kf14=\0U, kf15=\0V, kf16=\0W,
-	kf17=\0X, kf18=\0Y, kf19=\0Z, kf2=\0<, kf20=\0[, kf21=\0\\,
-	kf22=\0], kf23=\0\207, kf24=\0\210, kf25=\0\^, kf26=\0_,
-	kf27=\0`, kf28=\0a, kf29=\0b, kf3=\0=, kf30=\0c, kf31=\0d,
-	kf32=\0e, kf33=\0f, kf34=\0g, kf35=\0\211, kf36=\0\212,
-	kf37=\0h, kf38=\0i, kf39=\0j, kf4=\0>, kf40=\0k, kf41=\0l,
-	kf42=\0m, kf43=\0n, kf44=\0o, kf45=\0p, kf46=\0q,
-	kf47=\0\213, kf48=\0\214, kf5=\0?, kf6=\0@, kf7=\0A, kf8=\0B,
-	kf9=\0C, khome=\0G, kich1=\0R, knp=\0Q, kpp=\0I,
-	use=ansi.sys,
+	bel=^G, use=ansi.sys,
 
 # Except for the "-emx" suffixes, these are as distributed with EMX 0.9b,
 # a Unix-style environment used on OS/2.  (Note that the suffix makes some
@@ -5247,7 +5574,7 @@
 	setab=\E[4%p1%dm, setaf=\E[3%p1%dm,
 	sgr=\E[0;10%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p6%t;1%;%?%p7%t;8%;%?%p9%t;12%;m,
 	sgr0=\E[0;10m, smacs=\E[11m, smir=\E[4h, smso=\E[7m,
-	smul=\E[4m, tbc=\E[2g, vpa=\E[%i%p1%dd, use=vt102+enq,
+	smul=\E[4m, tbc=\E[3g, vpa=\E[%i%p1%dd, use=vt102+enq,
 
 # Key definitions:
 # The encodings for unshifted arrow keys, F1-F12, Home, Insert, etc.  match the
@@ -5510,7 +5837,7 @@
 interix|opennt|opennt-25|ntconsole|ntconsole-25|OpenNT-term compatible with color,
 	am, bw, msgr,
 	colors#8, cols#80, lines#25, ncv#3, pairs#64,
-	acsc=`\004a\261f\370g\361h\260j\331k\277l\332m\300n\305o~q\304r\362s_t\303u\264v\301w\302x\263y\371z\372{\373|\374}\375~\376.\031-\030\,\021+^P0\333p\304r\304y\363z\362{\343|\330}\234,
+	acsc=+\020\,\021-\030.^Y0\333`\004a\261f\370g\361h\260j\331k\277l\332m\300n\305o~p\304q\304r\304s_t\303u\264v\301w\302x\263y\363z\362{\343|\330}\234~\376,
 	bel=^G, bold=\E[1m, cbt=\E[Z, clear=\E[2J, cub=\E[%p1%dD,
 	cub1=\E[D, cud=\E[%p1%dB, cud1=^J, cuf=\E[%p1%dC,
 	cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA,
@@ -5536,7 +5863,7 @@
 	rmcup=\E[2b\E[u\r\E[K, rmso=\E[m, rmul=\E[m, rs1=\Ec,
 	sc=\E[s, setab=\E[4%p1%dm, setaf=\E[3%p1%dm,
 	setb=\E[%p1%{40}%+%dm, setf=\E[%p1%{30}%+%dm,
-	sgr0=\E[0m, smcup=\E[s\E[1b, smso=\E[1m, smul=\E[4m,
+	sgr0=\E[0m, smcup=\E[s\E[1b, smso=\E[7m, smul=\E[4m,
 
 opennt-35|ntconsole-35|OpenNT-term35 compatible with color,
 	lines#35, use=opennt,
@@ -6208,10 +6535,10 @@
 hp9845|HP 9845,
 	OTbs, am, da, db, eo, mir, xhp,
 	cols#80, lines#21,
-	OTbc=\ED, clear=\EH\EJ, cuf1=\EC, cup=\E&a%p2%2dc%p1%2dY,
-	cuu1=\EA, dch1=\EP, dl1=\EM, ed=\EJ, el=\EK,
-	if=/usr/share/tabset/std, il1=\EL, rmir=\ER, rmso=\E&d@,
-	smir=\EQ, smso=\E&dB,
+	OTbc=\ED, clear=\EH\EJ, cub1=\ED, cud1=\EB, cuf1=\EC,
+	cup=\E&a%p2%2dc%p1%2dY, cuu1=\EA, dch1=\EP, dl1=\EM,
+	ed=\EJ, el=\EK, if=/usr/share/tabset/std, il1=\EL,
+	rmir=\ER, rmso=\E&d@, smir=\EQ, smso=\E&dB,
 # From: Charles A. Finnell of MITRE <finnell@mitre.org>, developed 07SEP90
 # (hp98550: replaced /usr/share/tabset/9837 with std because <it#8>,<hts=\E1>;
 # added empty <acsc> to avoid warnings re <smacs>/<rmacs> --esr)
@@ -8252,7 +8579,7 @@
 wy120|wyse120|wy150|wyse150|Wyse 120/150,
 	am, bw, hs, km, mc5i, mir, msgr, xon,
 	cols#80, it#8, lh#1, lines#24, lw#8, nlab#8, pb#9601, wsl#45,
-	acsc=+/\,.0[iha2fxgqh1jYk?lZm@nEqDtCu4vAwBx3yszr{c~~,
+	acsc=+/\,.0[a2fxgqh1ihjYk?lZm@nEqDtCu4vAwBx3yszr{c~~,
 	bel=^G, blink=\EG2, cbt=\EI, civis=\E`0, clear=\E+$<50>,
 	cnorm=\E`1, cr=^M, cub1=^H, cud1=^J, cuf1=^L,
 	cup=\E=%p1%{32}%+%c%p2%{32}%+%c, cuu1=^K, dch1=\EW$<7>,
@@ -8331,7 +8658,7 @@
 wy60|wyse60|Wyse 60,
 	am, bw, hs, km, mc5i, mir, msgr,
 	cols#80, lh#1, lines#24, lw#8, nlab#8, wsl#45,
-	acsc=+/\,.0[iha2fxgqh1jYk?lZm@nEqDtCu4vAwBx3yszr{c~~,
+	acsc=+/\,.0[a2fxgqh1ihjYk?lZm@nEqDtCu4vAwBx3yszr{c~~,
 	bel=^G, blink=\EG2, cbt=\EI, civis=\E`0, clear=\E+$<100>,
 	cnorm=\E`1, cr=^M, cub1=^H, cud1=^J, cuf1=^L,
 	cup=\E=%p1%{32}%+%c%p2%{32}%+%c, cuu1=^K,
@@ -8500,7 +8827,7 @@
 wy99f|wy99fgt|wy-99fgt|Wyse WY-99GT (int'l PC keyboard),
 	am, bw, hs, km, mc5i, mir, msgr, xon,
 	cols#80, it#8, lines#25, wsl#46,
-	acsc='x+y.wi~_vj(k'l&m%n)o9q*s8t-u.v\,w+x=, bel=^G,
+	acsc='x+y.w_vi~j(k'l&m%n)o9q*s8t-u.v\,w+x=, bel=^G,
 	blink=\EG2, cbt=\EI, civis=\E`0, clear=\E'\E(\032,
 	cnorm=\E`4\E`1, cr=^M, cub1=^H, cud1=\Ej, cuf1=^L,
 	cup=\E=%p1%{32}%+%c%p2%{32}%+%c, cuu1=^K,
@@ -8552,7 +8879,7 @@
 wy160|wyse160|Wyse 160,
 	am, bw, hs, km, mc5i, mir, msgr,
 	cols#80, lh#1, lines#24, lw#8, nlab#8, wsl#38,
-	acsc=+/\,.0[iha2fxgqh1jYk?lZm@nEqDtCu4vAwBx3yszr{c~~,
+	acsc=+/\,.0[a2fxgqh1ihjYk?lZm@nEqDtCu4vAwBx3yszr{c~~,
 	bel=^G, blink=\EG2, cbt=\EI, civis=\E`0, clear=\E+$<30>,
 	cnorm=\E`1, cr=^M, cub1=^H, cud1=^J, cuf1=^L,
 	cup=\E=%p1%{32}%+%c%p2%{32}%+%c, cuu1=^K, dch1=\EW$<5>,
@@ -8860,7 +9187,7 @@
 wy325|wyse325|Wyse epc,
 	am, bw, hs, mc5i, mir,
 	cols#80, lh#1, lines#24, lw#8, nlab#8, pb#9601, wsl#45,
-	acsc=+/\,.0[iha2fxgqh1jYk?lZm@nEqDtCu4vAwBx3yszr{c~~,
+	acsc=+/\,.0[a2fxgqh1ihjYk?lZm@nEqDtCu4vAwBx3yszr{c~~,
 	bel=^G, blink=\EG2, cbt=\EI, civis=\E`0, clear=\E+$<50>,
 	cnorm=\E`1, cr=^M, cub1=^H, cud1=^J, cuf1=^L,
 	cup=\E=%p1%{32}%+%c%p2%{32}%+%c, cuu1=^K, dch1=\EW$<7>,
@@ -9307,7 +9634,7 @@
 kermit|standard kermit,
 	OTbs,
 	cols#80, lines#24,
-	clear=\EE, cub1=^H, cuf1=\EC,
+	clear=\EE, cub1=^H, cud1=\EB, cuf1=\EC,
 	cup=\EY%p1%{32}%+%c%p2%{32}%+%c, cuu1=\EA, ed=\EJ,
 	el=\EK, home=\EH, is2=K0 Standard Kermit  9-25-84\n,
 	kcub1=^H, kcud1=^J, kcuf1=^L, kcuu1=^K, khome=^^,
@@ -9792,14 +10119,14 @@
 	acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
 	blink=\E[5m, cbt=\E[1Z, clear=\EH\EJ, cnorm=\E[11;0j,
 	cr=\EG, csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H,
-	cud1=\E[1B, cuf=\E[%p1%dC, cuf1=\E[1C,
-	cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cvvis=\E[11;1j,
-	dch=\E[%p1%dP, dch1=\E[P, dim=\E[2m, dl=\E[%p1%dM,
-	dl1=\E[M, ech=\E[%p1%ds\E[%p1%dD, ed=\E[0J, el=\E[0K,
-	el1=\E[1K, flash=\E[?5h$<200>\E[?5l, fsl=\E8, home=\E[H,
-	hpa=\E[%p1%{1}%+%dG, ht=^I, hts=\EH, ich=\E[%p1%d@,
-	ich1=\E[@, il=\E[%p1%dL, il1=\E[L, ind=^J, indn=\E[%p1%dE,
-	invis=\E[8m,
+	cud=\E[%p1%dB, cud1=\E[1B, cuf=\E[%p1%dC, cuf1=\E[1C,
+	cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[1A,
+	cvvis=\E[11;1j, dch=\E[%p1%dP, dch1=\E[P, dim=\E[2m,
+	dl=\E[%p1%dM, dl1=\E[M, ech=\E[%p1%ds\E[%p1%dD, ed=\E[0J,
+	el=\E[0K, el1=\E[1K, flash=\E[?5h$<200>\E[?5l, fsl=\E8,
+	home=\E[H, hpa=\E[%p1%{1}%+%dG, ht=^I, hts=\EH,
+	ich=\E[%p1%d@, ich1=\E[@, il=\E[%p1%dL, il1=\E[L, ind=^J,
+	indn=\E[%p1%dE, invis=\E[8m,
 	is1=\E[0;23r\Ex\Ey\E[2;0j\E[3;3j\E[4;0j\E[5;0j\E[6;0j\E[7;0j\E[8;0j\E[9;1j\E[10;0j\E[15;0j\E[16;1j\E[19;0j\E[20;1j\E[29;0j\E[1;24r,
 	kbeg=\Et, kbs=^H, kcbt=\E[Z, kclr=\E[2J, kcub1=\E[D,
 	kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, kdch1=\E[P, kdl1=\E[M,
@@ -9972,7 +10299,7 @@
 	bel=^G, bold=\E[5m, clear=\E[H\E[2J\E[1U\E[H\E[2J\E[1V,
 	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=\EA, dch=\E[%p1%dP, dch1=\EP,
+	cuu=\E[%p1%dA, cuu1=\E[A, dch=\E[%p1%dP, dch1=\EP,
 	dl=\E[%p1%dM, dl1=\E[M, ed=\E[J, el=\E[0K, home=\E[H,
 	hpa=\E[%p1%dG, ht=^I, hts=\E1, ich=\E[%p1%d@, ich1=\E\^,
 	il=\E[%p1%dL, il1=\EL, ind=^J, indn=\E[%p1%dS,
@@ -10000,7 +10327,7 @@
 	acsc=+g\,h-f.e`bhrisjjkkllmmnnqqttuuvvwwxx{{||}}~~,
 	bel=^G, blink=\E[5m, bold=\E[2;7m, cbt=\E[Z,
 	civis=\E[11;0|, clear=\E[H\E[J, cnorm=\E[11;3|, cr=^M,
-	cub=\E[%p1%dD, cub1=^H, cud=\E[%p1%dB, cud1=\E[1B,
+	cub=\E[%p1%dD, cub1=^H, cud=\E[%p1%dB, cud1=\E[B,
 	cuf=\E[%p1%dC, cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH,
 	cuu=\E[%p1%dA, cuu1=\E[A, cvvis=\E[11;2|, dch=\E[%p1%dP,
 	dch1=\E[P, dim=\E[2m, dl=\E[%p1%dM, dl1=\E[M, ed=\E[0J,
@@ -10033,7 +10360,7 @@
 	acsc=+g\,h-f.e`bhrisjjkkllmmnnqqttuuvvwwxx{{||}}~~,
 	bel=^G, blink=\E[5m, bold=\E[2;7m, cbt=\E[Z,
 	clear=\E[H\E[J, cnorm=\E[11;3|, cr=^M, cub=\E[%p1%dD,
-	cub1=^H, cud=\E[%p1%dB, cud1=\E[1B, cuf=\E[%p1%dC,
+	cub1=^H, cud=\E[%p1%dB, cud1=\E[B, cuf=\E[%p1%dC,
 	cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA,
 	cuu1=\E[A, cvvis=\E[11;2|, dch=\E[%p1%dP, dch1=\E[P,
 	dim=\E[2m, dl=\E[%p1%dM, dl1=\E[M, ed=\E[0J, el=\E[0K,
@@ -11060,7 +11387,7 @@
 	sgr=\E[%?%p1%t7;%;%?%p2%t4;%;%?%p3%t7;%;%?%p4%t5;%;%?%p6%t1;%;m,
 	sgr0=\E[m,
 	smkx=\EP`>z~[[J`8xz~[[A`4xz~[[D`6xz~[[C`2xz~[[B\E\\,
-	smm=\E[>52h, smso=\E[7m, smul=\E[4m, tbc=\E[2g,
+	smm=\E[>52h, smso=\E[7m, smul=\E[4m, tbc=\E[3g,
 	vpa=\E[%p1%{1}%+%dd,
 
 aaa+rv|ann arbor ambassador in reverse video,
@@ -11430,7 +11757,7 @@
 cit80|cit-80|citoh 80,
 	OTbs, am,
 	cols#80, lines#24,
-	clear=\E[H\EJ, cr=^M, cub1=^H, cuf1=\E[C,
+	clear=\E[H\EJ, cr=^M, cub1=^H, cud1=\E[B, cuf1=\E[C,
 	cup=\E[%i%p1%2d;%p2%2dH, cuu1=\E[A, ed=\EJ, el=\EK, ff=^L,
 	ind=^J, is2=\E>, kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC,
 	kcuu1=\EOA, rmkx=\E[?1l\E>, smkx=\E[?1h\E=,
@@ -11439,9 +11766,9 @@
 cit101|citc|C.itoh fast vt100,
 	OTbs, am, xenl,
 	cols#80, lines#24,
-	bel=^G, clear=\E[H\E[2J, cnorm=\E[V\E8, cub1=^H, cuf1=\E[C,
-	cup=\E[%i%p1%d;%p2%dH, cuu1=\E[A, cvvis=\E7\E[U,
-	dch1=\E[P, dl1=\E[M, ed=\E[J, el=\E[K,
+	bel=^G, clear=\E[H\E[2J, cnorm=\E[V\E8, cub1=^H, cud1=\E[B,
+	cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH, cuu1=\E[A,
+	cvvis=\E7\E[U, dch1=\E[P, dl1=\E[M, ed=\E[J, el=\E[K,
 	flash=\E[?5h$<200/>\E[?5l, ich1=\E[@, il1=\E[L,
 	is2=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h\E[3g\E[>5g,
 	kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA,
@@ -11459,9 +11786,9 @@
 	OTbs, OTpt, am, mir, msgr,
 	cols#80, it#8, lines#24,
 	acsc=, clear=\E[H\E[J, cnorm=, csr=\E[%i%p1%2d;%p2%2dr,
-	cud1=\E[B, cuf1=\E[C, cup=\E[%i%p1%2d;%p2%2dH, cuu1=\E[A,
-	cvvis=\E[?1l\E[?4l\E[?7h, dch1=\E[P, dl1=\E[M, ed=\E[J,
-	el=\E[K, if=/usr/share/tabset/vt100, il1=\E[L,
+	cub1=\E[D, cud1=\E[B, cuf1=\E[C, cup=\E[%i%p1%2d;%p2%2dH,
+	cuu1=\E[A, cvvis=\E[?1l\E[?4l\E[?7h, dch1=\E[P, dl1=\E[M,
+	ed=\E[J, el=\E[K, if=/usr/share/tabset/vt100, il1=\E[L,
 	kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, kf0=\EOT,
 	kf1=\EOP, kf2=\EOQ, kf3=\EOR, kf4=\EOS, kf5=\EOm, kf6=\EOl,
 	kf7=\EOM, kf8=\EOn, rc=\E8, ri=\EM, rmacs=^O, rmir=\E[4l,
@@ -12147,7 +12474,7 @@
 	sgr=\E[%?%p1%t7;%;%?%p2%t4;%;%?%p3%t7;%;%?%p4%t5;%;%?%p6%t1;%;m,
 	sgr0=\E[m, smacs=\017$<1>, smcup=\E[=4l\E[1;24w\E2\r,
 	smir=\E[4h, smkx=\E[1!z\E[0;3u, smso=\E[7m, smul=\E[4m,
-	tbc=\E[2g, vpa=\E[%p1%{1}%+%dd,
+	tbc=\E[3g, vpa=\E[%p1%{1}%+%dd,
 avt-rv-ns|concept avt in reverse video mode/no status line,
 	flash=\E[=205l$<200>\E[=205h, is1=\E[=103l\E[=205h,
 	use=avt-ns,
@@ -12357,7 +12684,7 @@
 dgunix+ccc|Configurable color info for DG D430C terminals in DG-UNIX mode,
 	bce, ccc,
 	colors#52, ncv#53, pairs#26,
-	initp=\036RG0%p1%02X%p2%{256}%*%{1001}%/%02X%p3%{256}%*%{1001}%/%02X%p4%{256}%*%{1001}%/%02X%p5%{256}%*%{1001}%/%02X%p6%{256}%*%{1001}%/%02X%p7%{256}%*%{1001}%/%02X,
+	initp=\036RG0%p1%02X%p2%{255}%*%{1000}%/%02X%p3%{255}%*%{1000}%/%02X%p4%{255}%*%{1000}%/%02X%p5%{255}%*%{1000}%/%02X%p6%{255}%*%{1000}%/%02X%p7%{255}%*%{1000}%/%02X,
 	oc=\036RG01A00FF00000000\036RG01B00000000FF00\036RG01C007F00000000\036RG01D000000007F00,
 	op=\036RF4831A\036RF2E31B\036RF1D31C\036RF3F31D,
 	scp=\036RG2%p1%02X,
@@ -12366,7 +12693,7 @@
 dg+ccc|Configurable color info for DG D430C terminals in DG mode,
 	bce, ccc,
 	colors#52, ncv#53, pairs#26,
-	initp=\036RG0%p1%{16}%/%{48}%+%c%p1%{16}%m%{48}%+%c%p2%{256}%*%{1001}%/%Pa%ga%{16}%/%{48}%+%c%ga%{16}%m%{48}%+%c%p3%{256}%*%{1001}%/%Pa%ga%{16}%/%{48}%+%c%ga%{16}%m%{48}%+%c%p4%{256}%*%{1001}%/%Pa%ga%{16}%/%{48}%+%c%ga%{16}%m%{48}%+%c%p5%{256}%*%{1001}%/%Pa%ga%{16}%/%{48}%+%c%ga%{16}%m%{48}%+%c%p6%{256}%*%{1001}%/%Pa%ga%{16}%/%{48}%+%c%ga%{16}%m%{48}%+%c%p7%{256}%*%{1001}%/%Pa%ga%{16}%/%{48}%+%c%ga%{16}%m%{48}%+%c,
+	initp=\036RG0%p1%{16}%/%{48}%+%c%p1%{16}%m%{48}%+%c%p2%{255}%*%{1000}%/%Pa%ga%{16}%/%{48}%+%c%ga%{16}%m%{48}%+%c%p3%{255}%*%{1000}%/%Pa%ga%{16}%/%{48}%+%c%ga%{16}%m%{48}%+%c%p4%{255}%*%{1000}%/%Pa%ga%{16}%/%{48}%+%c%ga%{16}%m%{48}%+%c%p5%{255}%*%{1000}%/%Pa%ga%{16}%/%{48}%+%c%ga%{16}%m%{48}%+%c%p6%{255}%*%{1000}%/%Pa%ga%{16}%/%{48}%+%c%ga%{16}%m%{48}%+%c%p7%{255}%*%{1000}%/%Pa%ga%{16}%/%{48}%+%c%ga%{16}%m%{48}%+%c,
 	oc=\036RG01\:00??00000000\036RG01;00000000??00\036RG01<007?00000000\036RG01=000000007?00,
 	op=\036RF4831\:\036RF2>31;\036RF1=31<\036RF3?31=,
 	scp=\036RG2%p1%{16}%/%{48}%+%c%p1%{16}%m%{48}%+%c,
@@ -12402,11 +12729,11 @@
 dg210|dg-ansi|Data General 210/211,
 	am,
 	cols#80, lines#24,
-	OTnl=\E[B, clear=\E[2J, cud1=\E[B, cup=\E[%i%p1%d;%p2%dH,
-	cuu1=\E[A, ed=\E[J, el=\E[K, home=\E[H, kcub1=\E[D,
-	kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, khome=\E[H,
-	nel=\r\E[H\E[A\n, rmso=\E[0;m, rmul=\E[0;m, smso=\E[7;m,
-	smul=\E[4;m,
+	OTnl=\E[B, clear=\E[2J, cub1=\E[D, cud1=\E[B, cuf1=\E[C,
+	cup=\E[%i%p1%d;%p2%dH, cuu1=\E[A, ed=\E[J, el=\E[K,
+	home=\E[H, kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A,
+	khome=\E[H, nel=\r\E[H\E[A\n, rmso=\E[0;m, rmul=\E[0;m,
+	smso=\E[7;m, smul=\E[4;m,
 # From: Peter N. Wan <ihnp4!gatech!gacsr!wan>
 # courtesy of Carlos Rucalde of Vantage Software, Inc.
 # (dg211: this had <cup=\020%r%.%>., which was an ancient termcap hangover.
@@ -13278,7 +13605,7 @@
 go140|graphon go-140,
 	OTbs,
 	cols#80, it#8, lines#24,
-	clear=\E[H\E[2J$<10/>, cub1=^H, cuf1=\E[C,
+	clear=\E[H\E[2J$<10/>, cub1=^H, cud1=\E[B, cuf1=\E[C,
 	cup=\E[%i%p1%2d;%p2%2dH, cuu1=\E[A, dch1=\E[P, dl1=\E[M,
 	ed=\E[J$<10/>, el=\E[K, ht=^I,
 	if=/usr/share/tabset/vt100, il1=\E[L,
@@ -14274,9 +14601,9 @@
 intext2|intextii|INTERACTIVE modified owl 1251,
 	am, bw, ul,
 	cols#80, lines#24, xmc#0,
-	bel=^G, cbt=\E[Z, clear=\E[H\E[2J, cr=^M, cud1=\E[B,
-	cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH, cuu1=\E[A, dch1=\E[P,
-	dl1=\E[M, ed=\E[J, el=\E[K,
+	bel=^G, cbt=\E[Z, clear=\E[H\E[2J, cr=^M, cub1=\E[D,
+	cud1=\E[B, cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH, cuu1=\E[A,
+	dch1=\E[P, dl1=\E[M, ed=\E[J, el=\E[K,
 	flash=\E[;;;;;;;;;2;;u$<200/>\E[;;;;;;;;;1;;u,
 	hpa=\E[%p1%{1}%+%dG, ht=^I, ich1=\E[@, il1=\E[L, ind=\E[S,
 	kbs=^H, kcub1=\ED\r, kcud1=\EB\r, kcuf1=\EC\r, kcuu1=\EA\r,
@@ -14584,7 +14911,7 @@
 	sc=\E[%y,
 	sgr=\E[%{0}%?%p1%p3%|%t%{7}%+%;%?%p2%t%{2}%+%;%?%p4%t%{5}%+%;%?%p6%t%{1}%+%;m%?%p8%t\E[%{32}%+%d%%{%;%?%p9%t\016%e\017%;,
 	sgr0=\E[0m\017, smir=\E[4h, smso=\E[7m, smul=\E[4m,
-	tbc=\E[2g, tsl=\E[%i%p1%d%%}, vpa=\E[%i%p1%dd,
+	tbc=\E[3g, tsl=\E[%i%p1%d%%}, vpa=\E[%i%p1%dd,
 
 # p9-w: Prism-9 in 132 column mode
 # --------------------------------
@@ -15458,7 +15785,7 @@
 ndr9500|nd9500|Newbury Data 9500,
 	am, bw, hs, mc5i, mir, msgr, ul, xon,
 	cols#80, lines#24, wsl#79,
-	acsc=qKnImAjDwNuLtMvOlBkCxJ, bel=^G, cbt=\EI, civis=\E.0,
+	acsc=jDkClBmAnIqKtMuLvOwNxJ, bel=^G, cbt=\EI, civis=\E.0,
 	clear=\E;, cnorm=\E.1, cr=^M, cub1=^H, cud1=^V, cuf1=^L,
 	cup=\E=%p1%{32}%+%c%p2%{32}%+%c, cuu1=^K, dch1=\EW,
 	dim=\E), dl1=\ER, dsl=\Eh, ed=\EY, el=\ET,
@@ -15578,8 +15905,8 @@
 	acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
 	bel=^G, blink=\E[5m, bold=\E[1m, civis=\ER, clear=^L,
 	cnorm=\ES, cr=^M, csr=\EU%p1%{32}%+%c%p2%{32}%+%c,
-	cub=\E[%p1%dD, cub1=^H, cud=\E[%p1%dB, cud1=\EB,
-	cuf=\E[%p1%dC, cuf1=\EC, cup=\E[%i%p1%d;%p2%dH,
+	cub=\E[%p1%dD, cub1=^H, cud=\E[%p1%dB, cud1=\E[B,
+	cuf=\E[%p1%dC, cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH,
 	cuu=\E[%p1%dA, cuu1=\E[A, dch=\E[%p1%dP, dch1=\EM,
 	dl=\E[%p1%dM, dl1=\EL, ed=\E[J, el=\E[K, fsl=^M, home=\E[H,
 	ht=^I, ich=\E[%p1%d@, ich1=\EO, il=\E[%p1%dL, il1=\EN,
@@ -15654,8 +15981,8 @@
 	cols#80, lines#24,
 	acsc=jjkkllmmnnqqttuuvvwwxx, bel=^G, civis=\E[?25l,
 	clear=\E[H\E[2J, cnorm=\E[?25h, cr=^M,
-	csr=\E[%i%p1%d;%p2%dr, cub1=^H, cud1=\E[0B, cuf1=\E[C,
-	cup=\010\E[%i%p1%d;%p2%dH, cuu1=\E[0A, dch1=\E[0P,
+	csr=\E[%i%p1%d;%p2%dr, cub1=^H, cud1=\E[B, cuf1=\E[C,
+	cup=\010\E[%i%p1%d;%p2%dH, cuu1=\E[A, dch1=\E[0P,
 	dl1=\E[0M, ed=\E[0J, el=\E[0K, enacs=\E(B\E)0, home=\E[H,
 	ht=^I, ich1=\E[0@, il1=\E[0L, ind=^J, is2=\E[?3l\E)0\E(B,
 	kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, kend=\E[K,
@@ -15806,7 +16133,7 @@
 	OTbs, am, mir, msgr, ul, xenl, xt,
 	cols#79, it#8, lines#29,
 	acsc=, bel=^G, blink=\E[=3;<7m, bold=\E[=7;<4m, cbt=\E[Z,
-	clear=\E[2J\E[H, cr=^M, cud1=\E[1B, cuf1=\E[1C,
+	clear=\E[2J\E[H, cr=^M, cub1=\E[1D, cud1=\E[1B, cuf1=\E[1C,
 	cup=\E[%i%p1%2d;%p2%2dH, cuu1=\E[1A, dch1=\E[1P,
 	dim=\E[=1;<6m, dl1=\E[1M, ed=\E[J, el=\E[K, home=\E[H, ht=^I,
 	il1=\E[1L, ind=\E[S, invis=\E[=6;<5, is1=\E%!1\E[m,
@@ -15925,6 +16252,15 @@
 	sc=\E7, sgr0=\E[m, smacs=^N, smcup=\E[?6l, smir=\E[4h,
 	smkx=\E[?1h\E=, smso=\E[7;42m, smul=\E[4m, tbc=\E[3g,
 
+# Tektronix 4107/4109 interpret 4 modes using "\E%!" followed by a code:
+# 0 selects Tek mode, i.e., \E%!0
+# 1 selects ANSI mode
+# 2 selects ANSI edit-mode
+# 3 selects VT52 mode
+#
+# One odd thing about the description (which has been unchanged since the 90s)
+# is that the cursor addressing is using VT52 mode, and a few others use the
+# VT52's non-CSI versions of ANSI, e.g., \EJ.
 tek4107|tek4109|tektronix terminals 4107 4109,
 	OTbs, am, mir, msgr, ul, xenl, xt,
 	cols#79, it#8, lines#29,
@@ -15934,7 +16270,7 @@
 	cup=\EY%p1%{32}%+%c%p2%{32}%+%c, cuu1=\EA, cvvis=\E%!3,
 	dim=\E%!1\E[<0m$<2>\E%!0, ed=\EJ, el=\EK, ht=^I, ind=^J,
 	kbs=^H, kcub1=\ED, kcud1=\EB, kcuf1=\EC, kcuu1=\EA,
-	rev=\E%!1\E[7m$<2>\E%0, ri=\EI,
+	rev=\E%!1\E[7m$<2>\E%!0, ri=\EI,
 	rmso=\E%!1\E[m$<2>\E%!0, rmul=\E%!1\E[m$<2>\E%!0,
 	sgr=\E%%!1\E[%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p6%t;1%;m$<2>\E%%!0,
 	sgr0=\E%!1\E[m$<2>\E%!0, smso=\E%!1\E[7;5m$<2>\E%!0,
@@ -15971,9 +16307,9 @@
 tek4112|tek4114|tektronix 4110 series,
 	OTbs, am, db,
 	cols#80, lines#34,
-	cbt=\E[Z, clear=\E[2J\E[0;0H, cub1=^H, cuf1=\E[C,
-	cup=\E[%i%p1%d;%p2%dH, cuu1=\EM, dch1=\E[P, dl1=\E[M,
-	ed=\E[0J, el=\E[0K, ich1=\E[@, il1=\E[L,
+	cbt=\E[Z, clear=\E[2J\E[0;0H, cub1=^H, cud1=\E[B,
+	cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH, cuu1=\EM, dch1=\E[P,
+	dl1=\E[M, ed=\E[0J, el=\E[0K, ich1=\E[@, il1=\E[L,
 	ind=\E7\E[0;0H\E[M\E8, is2=\E3!1, ri=\E7\E[0;0H\E[L\E8,
 	rmso=\E[m, rmul=\E[m, sgr0=\E[m, smso=\E[7m, smul=\E[4m,
 tek4112-nd|4112 not in dialog area,
@@ -16036,8 +16372,8 @@
 	kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, khome=\E[H,
 	rep=%p1%c\E[%p2%{1}%-%db, rev=\E[7m, rmam=\E[?7l,
 	rmso=\E[m, rmul=\E[m,
-	sgr=\E[%?%p1%t7;%;%?%p2%t4;%;%?%p3%t7;%;%?%p4%t5;%;%?%p6%t1;%;m,
-	sgr0=\E[m, smam=\E[?7h, smso=\E[7m, smul=\E[4m, tbc=\E[2g,
+	sgr=\E[%?%p1%t7;%;%?%p2%t4;%;%?%p3%t7;%;%?%p4%t5;%;%?%p6%t1;%;%?%p7%t8;%;m,
+	sgr0=\E[m, smam=\E[?7h, smso=\E[7m, smul=\E[4m, tbc=\E[3g,
 	vpa=\E[%p1%{1}%+%dd,
 # The tek4125 emulates a vt100 incorrectly - the scrolling region
 # command is ignored.  The following entry replaces <csr> with the needed
@@ -16408,7 +16744,7 @@
 # This entry assumes that you are using an apple with the UCSD Pascal
 # language card.  SYSTEM.MISCINFO is assumed to be the same as that
 # supplied with the standard apple except that screenwidth should be set
-# using SETUP to 80 columns.  Note that the right arrow in not mapped in
+# using SETUP to 80 columns.  Note that the right arrow is not mapped in
 # this termcap entry.  This is because that key, on the Apple, transmits
 # a ^U and would thus preempt the more useful "up" function of vi.
 #
@@ -16444,15 +16780,16 @@
 apple-videx3|vapple|Apple II with 80 col card,
 	OTbs, am,
 	cols#80, lines#24,
-	clear=\Ev, cuf1=\EC, cup=\EY%p1%{32}%+%c%p2%{32}%+%c,
-	cuu1=\EA, el=\Ex, home=\EH, kcub1=\ED, kcud1=\EB, kcuf1=\EC,
-	kcuu1=\EA, kf0=\EP, kf1=\EQ, kf2=\ER, kf3=\E\s, kf4=\E!,
-	kf5=\E", kf6=\E#, kf7=\E$, kf8=\E%%, kf9=\E&, khome=\EH,
+	clear=\Ev, cub1=\ED, cud1=\EB, cuf1=\EC,
+	cup=\EY%p1%{32}%+%c%p2%{32}%+%c, cuu1=\EA, el=\Ex,
+	home=\EH, kcub1=\ED, kcud1=\EB, kcuf1=\EC, kcuu1=\EA,
+	kf0=\EP, kf1=\EQ, kf2=\ER, kf3=\E\s, kf4=\E!, kf5=\E", kf6=\E#,
+	kf7=\E$, kf8=\E%%, kf9=\E&, khome=\EH,
 #From: decvax!cbosgd!cbdkc1!mww Mike Warren via BRL
 aepro|Apple II+ running ASCII Express Pro--vt52,
 	OTbs,
 	cols#80, lines#24,
-	clear=\014$<300/>, cuf1=\EC,
+	clear=\014$<300/>, cub1=\ED, cud1=\EB, cuf1=\EC,
 	cup=\EY%p1%{32}%+%c%p2%{32}%+%c, cuu1=\EA, ed=\EJ,
 	el=\EK, home=\EH,
 # UCSD addition: Yet another termcap from Brian Kantor's Micro Munger Factory
@@ -16524,17 +16861,102 @@
 mac-w|macterminal-w|Apple Macintosh with Macterminal in 132 column mode,
 	cols#132, use=mac,
 
+# nsterm*|Apple_Terminal - AppKit Terminal.app
+#
+# Terminal.app is a Terminal emulator bundled with NeXT's NeXTStep and
+# OPENSTEP/Mach operating systems, and with Apple's Rhapsody, Mac OS X
+# Server and Mac OS X operating systems. There is also a
+# "terminal.app" in GNUStep, but I believe it to be an unrelated
+# codebase and I have not attempted to describe it here.
+#
+# For NeXTStep, OPENSTEP/Mach, Rhapsody and Mac OS X Server 1.0, you
+# are pretty much on your own. Use "nsterm-7-m" and hope for the best.
+# You might also try "nsterm-7" and "nsterm-old" if you suspect your
+# version supports color.
+#
+# To determine the version of Terminal.app you're using by running:
+#
+#     echo "$TERM_PROGRAM" "$TERM_PROGRAM_VERSION"
+#
+# For Apple_Terminal v200+, use "nsterm-16color" (a.k.a. "nsterm")
+#
+# For Apple_Terminal v71+/v100+, use "nsterm-bce".
+#
+# For Apple_Terminal v51+, use "nsterm-7-c" or "nsterm-7-c-s".
+#
+# For Apple_Terminal v41+, use "nsterm-old", or "nsterm-s".
+#
+# For all earlier versions (Apple_Terminal), try "nsterm-7-m"
+# (monochrome) or "nsterm-7" (color); "nsterm-7-m-s" and "nsterm-7-s"
+# might work too, but really you're on your own here since these
+# systems are very obsolete and I can't test them. I do welcome
+# patches, though :).
+
+# Other Terminals:
+#
+# For GNUstep_Terminal, you're probably best off using "linux" or
+# writing your own terminfo.
+
+# For MacTelnet, you're on your own. It's a different codebase, and
+# seems to be somewhere between "vt102", "ncsa" and "xterm-color".
+
+# For iTerm.app, see "iterm".
+
+#
 # The AppKit Terminal.app descriptions all have names beginning with
 # "nsterm". Note that the statusline (-s) versions use the window
 # titlebar as a phony status line, and may produce warnings during
-# compilation as a result ("tsl uses 0 parameters, expected 1".) Ignore
-# these warnings, or even ignore these entries entirely. Apps which
-# need to position the cursor or do other fancy stuff inside the status
-# line won't work with these entries. They're primarily useful for
-# programs like Pine which provide simple notifications in the status
-# line. Please note that non-ASCII characters don't work right in the
-# status line, since Terminal.app incorrectly interprets their Unicode
-# codepoints as MacRoman codepoints.
+# compilation as a result ("tsl uses 0 parameters, expected 1".)
+# Ignore these warnings, or even ignore these entries entirely. Apps
+# which need to position the cursor or do other fancy stuff inside the
+# status line won't work with these entries. They're primarily useful
+# for programs like Pine which provide simple notifications in the
+# status line. Please note that non-ASCII characters don't work right
+# in the status line, since Terminal.app incorrectly interprets their
+# Unicode codepoints as MacRoman codepoints (in earlier Mac OS X
+# versions) or only accepts status lines consisting entirely of
+# characters from the first 256 Unicode positions (including C1 but
+# not C0 or DEL.)
+#
+# The Mythology* of AppKit Terminal.app:
+#
+# In the days of NeXTSTep 0.x and 1.x there were two incompatible
+# bundled terminal emulators, Shell and Terminal. Scott Hess wrote a
+# shareware replacement for Terminal called "Stuart" which NeXT bought
+# and used as the basis for the Terminal.app in NeXTstep 2+,
+# OPENSTEP/Mach, Apple Rhapsody, Mac OS X Server 1.0, and Mac OS X. I
+# don't know the TERM_PROGRAM and TERM_PROGRAM_VERSION settings or
+# capabilities for the early versions, but I believe that the
+# TERM_PROGRAM_VERSION may have been reset at some point.
+#
+# The early versions were tailored to the NeXT character set. Sometime
+# after the Apple aquisition the encoding was swiched to MacRoman
+# (initally with serious altcharset bugs due to incomplete conversion
+# of the old NeXT code,) and then later to UTF-8. Alos sometime during
+# or just prior to the early days of Mac OS X, the Terminal grew ANSI
+# 8-color support (initially buggy when combined with attributes, but
+# that was later fixed.) More recently, around Mac OS X version 10.3
+# or so (Terminal.app v100+) xterm-like 16-color support was added. In
+# some versions (for instance 133-1 which shipped with Mac OS X
+# version 10.4) this suffered from the <bce> bug, but that seems to
+# have been fixed in Mac OS X version 10.5 (Terminal.app v240.2+).
+#
+# In the early days of Mac OS X the terminal was fairly buggy and
+# would routinely crash under load. Many of these bugs seem to have
+# been fixed around Mac OS X version 10.3 (Terminal.app v100+) but
+# some may still remain. This change seems to correspond to
+# Terminal.app reporting "xterm-color" as $TERM rather than "vt100" as
+# it did previously.
+#
+# * This may correspond with what actually happened, but I don't
+#   know. It is based on guesswork, hearsay, private correspondence,
+#   my faulty memory, and the following online sources and references:
+#
+# [1] "Three Scotts and a Duane" by Simson L. Garfinkel
+# http://www.nextcomputers.org/NeXTfiles/Articles/NeXTWORLD/93.8/93.8.Dec.Community1.html
+#
+# [2] NeXTSTEP entry from Wikipedia, the free encyclopedia
+# https://secure.wikimedia.org/wikipedia/en/wiki/Nextstep
 #
 # * Renamed the AppKit Terminal.app entry from "Apple_Terminal" to
 #   "nsterm" to comply with the name length and case conventions and
@@ -16624,7 +17046,7 @@
 #     export TERM
 #     if [ :"$TERM_PROGRAM_VERSION" = :41 ]
 #     then
-#         TERM="nsterm"
+#         TERM="nsterm-old"
 #     else
 #         TERM="nsterm-c-7"
 #     fi
@@ -16635,7 +17057,7 @@
 # if ( $?TERM && $?TERM_PROGRAM && $?TERM_PROGRAM_VERSION) then
 #     if ( :"$TERM" == :"vt100" && :"$TERM_PROGRAM" == :"Apple_Terminal" ) then
 #          if ( :"$TERM_PROGRAM_VERSION" == :41 ) then
-#              setenv TERM "nsterm"
+#              setenv TERM "nsterm-old"
 #          else
 #              setenv TERM "nsterm-c-7"
 #          endif
@@ -16652,25 +17074,25 @@
 	cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A,
 	dl=\E[%p1%dM, dl1=\E[M, ed=\E[J, el=\E[K, el1=\E[1K,
 	home=\E[H, ht=^I, hts=\EH, il=\E[%p1%dL, il1=\E[L, ind=^J,
-	kbs=\177, kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA,
-	kent=\EOM, rc=\E8, rev=\E[7m, ri=\EM, rmam=\E[?7l,
-	rmkx=\E[?1l\E>, rmso=\E[m, rmul=\E[m,
+	invis=\E[8m, kbs=\177, kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC,
+	kcuu1=\EOA, kent=\EOM, rc=\E8, rev=\E[7m, ri=\EM,
+	rmam=\E[?7l, rmkx=\E[?1l\E>, rmso=\E[m, rmul=\E[m,
 	rs2=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h, sc=\E7,
-	sgr=\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;m,
-	sgr0=\E[m\017, smam=\E[?7h, smkx=\E[?1h\E=, smso=\E[7m,
+	sgr=\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;%?%p7%t;8%;m,
+	sgr0=\E[m, smam=\E[?7h, smkx=\E[?1h\E=, smso=\E[7m,
 	smul=\E[4m, tbc=\E[3g, use=vt100+enq, use=vt100+pfkeys,
 
 nsterm+acs|AppKit Terminal.app v41+ basic capabilities w/VT100 alternate-charset,
 	acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
 	enacs=\E(B\E)0, rmacs=^O,
-	sgr=\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;m%?%p9%t\016%e\017%;,
-	smacs=^N, use=nsterm+7,
+	sgr=\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;%?%p7%t;8%;m%?%p9%t\016%e\017%;,
+	sgr0=\E[m\017, smacs=^N, use=nsterm+7,
 
 nsterm+mac|AppKit Terminal.app v41+ basic capabilities w/MacRoman alternate-charset,
-	acsc=0#`\327a\:f\241g\261h#i\360jjkkllmmnno\370p\370q\321rrssttuuvvwwxxy\262z\263{\271|\255}\243~\245+\335-\366\,\334.\377,
+	acsc=+\335\,\334-\366.\3770#`\327a\:f\241g\261h#i\360jjkkllmmnno\370p\370q\321rrssttuuvvwwxxy\262z\263{\271|\255}\243~\245,
 	enacs=\E(B\E)0, rmacs=^O,
-	sgr=\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;m%?%p9%t\016%e\017%;,
-	smacs=^N, use=nsterm+7,
+	sgr=\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;%?%p7%t;8%;m%?%p9%t\016%e\017%;,
+	sgr0=\E[m\017, smacs=^N, use=nsterm+7,
 
 nsterm+s|AppKit Terminal.app v41+ status-line (window titlebar) support,
 	hs,
@@ -16731,7 +17153,7 @@
 nsterm-m-s|AppKit Terminal.app v41+ w/MacRoman charset (monochrome w/statusline),
 	use=nsterm+s, use=nsterm+mac,
 
-nsterm|Apple_Terminal|AppKit Terminal.app v41+ w/MacRoman charset (color),
+nsterm-old|AppKit Terminal.app v41+ w/MacRoman charset (color),
 	use=nsterm+c41, use=nsterm+mac,
 
 nsterm-c|AppKit Terminal.app v51+ w/MacRoman charset (full color),
@@ -16743,17 +17165,66 @@
 nsterm-c-s|AppKit Terminal.app v51+ w/MacRoman charset (full color w/statusline),
 	use=nsterm+s, use=nsterm+c, use=nsterm+mac,
 
-
+# In Mac OS X version 10.5 the format of the preferences has changed
+# and a new, more complex technique is needed, e.g.,
+#
+#       python -c 'import sys,objc;NSUserDefaults=objc.lookUpClass(
+#       "NSUserDefaults");ud=NSUserDefaults.alloc();
+#       ud.init();prefs=ud.persistentDomainForName_(
+#       "com.apple.Terminal");prefs["Window Settings"][
+#       prefs["Default Window Settings"]]["TerminalType"
+#       ]=sys.argv[1];ud.setPersistentDomain_forName_(prefs,
+#       "com.apple.Terminal")' nsterm-16color
+#
+# and it is still not settable from the preferences dialog. This is
+# tracked under rdar://problem/7365108 and rdar://problem/7365134
+# in Apple's bug reporter.
+nsterm-16color|AppKit Terminal.app v240.2+ with Mac OS X version 10.5,
+	bw@, mir, npc,
+	civis=\E[?25l, cnorm=\E[?25h, dch=\E[%p1%dP, dch1=\E[P,
+	flash=\E[?5h$<200/>\E[?5l, hpa=\E[%i%p1%dG,
+	ich=\E[%p1%d@, ich1=\E[@, kdch1=\E[3~, kend=\E[F,
+	kf10=\E[21~, kf11=\E[23~, kf12=\E[24~, kf13=\E[25~,
+	kf14=\E[26~, kf15=\E[28~, kf16=\E[29~, kf17=\E[31~,
+	kf18=\E[22~, kf19=\E[33~, kf20=\E[34~, kf5=\E[15~,
+	kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~, khome=\E[H,
+	knp=\E[6~, kpp=\E[5~, rmcup=\E[2J\E[?47l\E8, rmir=\E[4l,
+	smcup=\E7\E[?47h, smir=\E[4h, vpa=\E[%i%p1%dd,
+	use=nsterm-c-s-acs,
+
+# The versions of Terminal.app in Mac OS X version 10.3.x seem to have
+# the background color erase bug. The newer version 240.2 in Mac OS X
+# version 10.5 does not.
+#
 # This entry is based on newsgroup comments by Alain Bench, Christian Ebert,
 # and D P Schreber comparing to nsterm-c-s-acs.
 #
-# D P Schreber notes that $TERM can be set in Terminal.app, e.g.,
-#	defaults write com.apple.Terminal TermCapString nsterm-c-s-acs
+# In Mac OS X version 10.4 and earlier, D P Schreber notes that $TERM
+# can be set in Terminal.app, e.g.,
+#
+#	defaults write com.apple.Terminal TermCapString nsterm-bce
+#
 # and that it is not set in Terminal's preferences dialog.
-nsterm-16color|AppKit Terminal.app v100.1.8 with MacOS X 10.3.9,
-	kdch1=\E[3~, kf10=\E[21~, kf11=\E[23~, kf12=\E[24~,
-	kf5=\E[15~, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~,
-	knp=\E[6~, kpp=\E[5~, use=nsterm-c-s-acs,
+nsterm-bce|AppKit Terminal.app v71+/v100.1.8+ with Mac OS X version 10.3/10.4 (bce),
+	bce, bw, use=nsterm-16color,
+
+# This is an alias which should always point to the "current" version
+nsterm|Apple_Terminal|AppKit Terminal.app,
+	use=nsterm-16color,
+
+# iTerm.app from http://iterm.sourceforge.net/ is an alternative (and
+# more featureful) terminal emulator for Mac OS X. It is similar
+# enough in capabilities to nsterm-16color that I have derived this
+# description from that one, but as far as I know they share no code.
+# Many of the features are user-configurable, but I attempt only to
+# describe the default configuration.
+#
+# NOTE: When tack tests (csr) + (nel) iTerm.app crashes, so (csr) is
+# disabled.
+iTerm.app|iTerm.app terminal emulator for Mac OS X,
+	bce, bw@, ccc@,
+	csr@, initc@, kend=\EOF, khome=\EOH, use=xterm+256color,
+	use=nsterm-16color,
 
 # xnuppc - Darwin PowerPC Console (a.k.a. "darwin")
 #
@@ -16863,7 +17334,7 @@
 	rmul=\E[m, rs2=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h,
 	sc=\E7,
 	sgr=\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;m,
-	sgr0=\E[m\017, smam=\E[?7h, smkx=\E[?1h\E=, smso=\E[7m,
+	sgr0=\E[m, smam=\E[?7h, smkx=\E[?1h\E=, smso=\E[7m,
 	smul=\E[4m, tbc=\E[3g, use=vt100+keypad,
 
 xnuppc+c|Darwin PowerPC Console ANSI color support,
@@ -17064,42 +17535,6 @@
 	lf7=f8, mc4=\E]+, mc5=\E]=, rmacs=\ERg, rmso=\ER@, sgr0=\ER@,
 	smacs=\ERG, smso=\ERD,
 
-#### Atari ST
-#
-
-# From: Simson L. Garfinkel <simsong@media-lab.mit.edu>
-atari|atari st,
-	OTbs, am,
-	cols#80, it#8, lines#25,
-	clear=\EH\EJ, cub1=\ED, cud1=\EB, cuf1=\EC,
-	cup=\EY%p1%{32}%+%c%p2%{32}%+%c, cuu1=\EA, dl1=\EM,
-	ed=\EJ, el=\EK, ht=^I, il1=\EL, kcub1=\ED, kcud1=\EB,
-	kcuf1=\EC, kcuu1=\EA, ri=\EI, rmso=\Eq, sgr0=\Eq, smso=\Ep,
-# UniTerm terminal program for the Atari ST:  49-line VT220 emulation mode
-# From: Paul M. Aoki <aoki@ucbvax.berkeley.edu>
-uniterm|uniterm49|UniTerm VT220 emulator with 49 lines,
-	lines#49,
-	is2=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h\E[1;49r\E[49;1H,
-	use=vt220,
-# MiNT VT52 emulation. 80 columns, 25 rows.
-# MiNT is Now TOS, the operating system which comes with all Ataris now
-# (mainly Atari Falcon). This termcap is for the VT52 emulation you get
-# under tcsh/zsh/bash/sh/ksh/ash/csh when you run MiNT in `console' mode
-# From: Per Persson <pp@gnu.ai.mit.edu>, 27 Feb 1996
-st52|Atari ST with VT52 emulation,
-	am, km,
-	cols#80, lines#25,
-	bel=^G, civis=\Ef, clear=\EH\EJ, cnorm=\Ee, cr=^M, cub1=\ED,
-	cud1=\EB, cuf1=\EC, cup=\EY%p1%{32}%+%c%p2%{32}%+%c,
-	cuu1=\EA, dl1=\EM, ed=\EJ, el=\EK, home=\EH, ht=^I, il1=\EL,
-	ind=^J, ka1=\E#7, ka3=\E#5, kb2=\E#9, kbs=^H, kc1=\E#1,
-	kc3=\E#3, kclr=\E#7, kcub1=\E#K, kcud1=\E#P, kcuf1=\E#M,
-	kcuu1=\E#H, kf0=\E#D, kf1=\E#;, kf2=\E#<, kf3=\E#=, kf4=\E#>,
-	kf5=\E#?, kf6=\E#@, kf7=\E#A, kf8=\E#B, kf9=\E#C, khome=\E#G,
-	kil1=\E#R, kind=\E#2, kri=\E#8, lf0=f10, nel=^M^J, rc=\Ek,
-	ri=\EI, rmcup=, rmso=\Eq, rs1=\Ez_\Eb@\EcA, sc=\Ej, sgr0=\Eq,
-	smcup=\Ee, smso=\Ep,
-
 #### Commodore Business Machines
 #
 # Formerly located in West Chester, PA; went spectacularly bust in 1994
@@ -17307,23 +17742,31 @@
 # even as single processes under SunOS and the Macintosh OS.
 #
 
+# See
+#	http://www.minix3.org/manpages/man4/console.4.html
+minix|minix console (v3),
+	use=ecma+color, use=minix-1.7,
+
+# See
+#	http://www.minix-vmd.org/pub/Minix-vmd/1.7.0/wwwman/man4/console.4.html
 # This is the entry provided with minix 1.7.4, with bogus :ri: removed.
-minix|minix console (v1.7),
+minix-1.7|minix console (v1.7),
 	am, xenl,
 	cols#80, it#8, lines#25,
 	bel=^G, blink=\E[5m, bold=\E[1m, clear=\E[H\E[0J, cr=^M,
 	cub=\E[%p1%dD, cub1=^H, cud=\E[%p1%dB, cud1=\E[B,
 	cuf=\E[%p1%dC, cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH,
 	cuu=\E[%p1%dA, cuu1=\E[A, dch=\E[%p1%dP, dch1=\E[P,
-	dl=\E[%p1%dM, dl1=\E[M, ed=\E[0J, el=\E[K, home=\E[H, ht=^I,
-	ich=\E[%p1%d@, ich1=\E[@, il=\E[%p1%dL, il1=\E[L, ind=^J,
-	is2=\E[0m, kbs=^H, kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C,
-	kcuu1=\E[A, kf0=\E[Y, kf1=\E[V, kf2=\E[U, kf3=\E[T, kf4=\E[S,
-	kf5=\E[G, khome=\E[H, lf0=End, lf1=PgUp, lf2=PgDn, lf3=Num +,
-	lf4=Num -, lf5=Num 5, nel=^M^J, rev=\E[7m, ri=\EM,
-	rmso=\E[0m, rmul=\E[0m, sgr0=\E[0m, smso=\E[7m, smul=\E[4m,
+	dl=\E[%p1%dM, dl1=\E[M, ed=\E[0J, el=\E[K, el1=\E[2K,
+	home=\E[H, ht=^I, ich=\E[%p1%d@, ich1=\E[@, il=\E[%p1%dL,
+	il1=\E[L, ind=^J, is2=\E[0m, kbs=^H, kcub1=\E[D, kcud1=\E[B,
+	kcuf1=\E[C, kcuu1=\E[A, kf0=\E[Y, kf1=\E[V, kf2=\E[U,
+	kf3=\E[T, kf4=\E[S, kf5=\E[G, khome=\E[H, lf0=End, lf1=PgUp,
+	lf2=PgDn, lf3=Num +, lf4=Num -, lf5=Num 5, nel=^M^J,
+	rev=\E[7m, ri=\EM, rmso=\E[0m, rmul=\E[0m, sgr0=\E[0m,
+	smso=\E[7m, smul=\E[4m,
 # Corrected Jan 14, 1997 by Vincent Broman <broman@nosc.mil>
-minix-old|minix console (v1.5),
+minix-old|minix-1.5|minix console (v1.5),
 	xon,
 	cols#80, it#8, lines#25,
 	bel=^G, blink=\E[5m, bold=\E[1m, clear=\E[H\E[0J, cr=^M,
@@ -17729,7 +18172,7 @@
 	rmul=\E[m, rs2=\E[?=h\Ec, s0ds=^O, s1ds=^N,
 	sgr=\E[0%?%p1%p3%|%t;7%;%?%p2%t;4%;%?%p4%t;5%;%?%p5%t;2%;%?%p7%t;8%;m%?%p9%t\016%e\017%;,
 	sgr0=\E[m\017, smacs=^N, smcup=\E[?>h\EPY99\:98\E\\,
-	smir=\E[4h, smso=\E[0;7m, smul=\E[0;4m, tbc=\E[2g,
+	smir=\E[4h, smso=\E[0;7m, smul=\E[0;4m, tbc=\E[3g,
 	tsl=\EPY99\:98\E\\\E[0;98v\E[2;7m,
 tws2102-sna|dku7102-sna|BULL Questar tws2102 for SNA,
 	dsl=\E[0;98v\E[2J\E[v, fsl=\E[v, is3=\Eb, tsl=\E[0;98v,
@@ -17930,8 +18373,9 @@
 	acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
 	bel=^G, blink=\2335m, bold=\2331m, civis=\233?25l,
 	clear=\233H\233J, cnorm=\233?25h, cr=^M,
-	csr=\233%i%p1%d;%p2%dr, cub=\233%p1%dD, cud=\233%p1%dB,
-	cuf=\233%p1%dC, cup=\233%i%p1%d;%p2%dH, cuu=\233%p1%dA,
+	csr=\233%i%p1%d;%p2%dr, cub=\233%p1%dD, cub1=\2331D,
+	cud=\233%p1%dB, cud1=\2331B, cuf=\233%p1%dC, cuf1=\2331C,
+	cup=\233%i%p1%d;%p2%dH, cuu=\233%p1%dA, cuu1=\2331A,
 	dch=\233%p1%dP, dch1=\233P, dl=\233%p1%dM,
 	dsl=\2331$}\2332$~\n\2330$}, ech=\233%p1%dX, ed=\233J,
 	el=\233K, el1=\2331K, enacs=\E(B\E)0,
@@ -18472,7 +18916,7 @@
 h19|heath|h19-b|heathkit|heath-19|z19|zenith|heathkit h19,
 	OTbs, am, eslok, hs, mir, msgr,
 	cols#80, it#8, lines#24,
-	acsc=~\^x`qanbkcjdmelfgg+hai.kwsutvutvozs{, bel=^G,
+	acsc=+h.kaiggjdkclfmenbozqas{tvutvuwsx`~\^, bel=^G,
 	clear=\EE, cnorm=\Ey4, cr=^M, cub1=^H, cud1=\EB, cuf1=\EC,
 	cup=\EY%p1%{32}%+%c%p2%{32}%+%c, cuu1=\EA, cvvis=\Ex4,
 	dch1=\EN, ed=\EJ, el=\EK, fsl=\Ek\Ey5, home=\EH, ht=^I, ind=^J,
@@ -18610,7 +19054,7 @@
 z100bw|h100bw|z110bw|z-100bw|h-100bw|heath/zenith z-100 pc,
 	OTbs, OTpt, mir, msgr,
 	OTkn#10, cols#80, it#8, lines#24,
-	acsc=~\^x`qanbkcjdmelfgg+hai.kwsutvutvozs{,
+	acsc=+h.kaiggjdkclfmenbozqas{tvutvuwsx`~\^,
 	clear=\EE$<5*/>, cnorm=\Ey4, cub1=^H, cud1=\EB, cuf1=\EC,
 	cup=\EY%p1%{32}%+%c%p2%{32}%+%c$<1*/>, cuu1=\EA,
 	cvvis=\Ex4, dch1=\EN$<1*/>, dl1=\EM$<5*/>, ed=\EJ, el=\EK,
@@ -18658,7 +19102,7 @@
 ims-ansi|ultima2|ultimaII|IMS Ultima II,
 	OTbs, am,
 	cols#80, it#8, lines#24,
-	clear=\E[H\E[2J, cub1=^H, cud1=\ED,
+	clear=\E[H\E[2J, cub1=^H, cud1=\ED, cuf1=\EC,
 	cup=\E[%i%p1%2d;%p2%2dH, cuu1=\EM, ed=\E[0J, el=\E[0K,
 	ht=^I, if=/usr/share/tabset/vt100,
 	is2=\E[m\E[>14l\E[?1;?5;20l\E>\E[1m\r, kcub1=\E[D,
@@ -18769,9 +19213,9 @@
 modgraph2|modgraph gx-1000 80x24 with keypad not enabled,
 	am, da, db,
 	cols#80, it#8, lines#24,
-	clear=\EH\EJ$<50/>, cub1=^H, cuf1=\EC$<2/>,
-	cup=\EY%p1%{32}%+%c%p2%{32}%+%c$<5/>, cuu1=\EA$<2/>,
-	ed=\EJ$<50/>, el=\EK$<3/>, ht=^I,
+	clear=\EH\EJ$<50/>, cub1=^H, cud1=\EB$<2/>,
+	cuf1=\EC$<2/>, cup=\EY%p1%{32}%+%c%p2%{32}%+%c$<5/>,
+	cuu1=\EA$<2/>, ed=\EJ$<50/>, el=\EK$<3/>, ht=^I,
 	is2=\E<\E\^5;2s\E\^7;1s\E[3g\E\^11;9s\E\^11;17s\E\^11;25s\E\^11;33s\E\^11;41s\E\^11;49s\E\^11;57s\E\^11;65s\E\^11;73s\E\^11;81s\E\^11;89s\E\^12;0s\E\^14;2s\E\^15;9s\E\^25;1s\E\^9;1s\E\^27;1,
 	ri=\EI$<5/>,
 #
@@ -18842,9 +19286,9 @@
 ex155|Motorola Exorterm 155,
 	OTbs, am, bw,
 	OTkn#5, OTug#1, cols#80, lines#24,
-	cbt=\E[, clear=\EX, cud1=\EB, cuf1=\ED,
-	cup=\EE%p1%{32}%+%c%p2%{32}%+%c, ed=\ET, el=\EU,
-	home=\E@, ht=\EZ, kbs=^H, kcbt=\E[, kclr=\EX, kcub1=^H,
+	cbt=\E[, clear=\EX, cub1=\ED, cud1=\EB, cuf1=\EC,
+	cup=\EE%p1%{32}%+%c%p2%{32}%+%c, cuu1=\EA, ed=\ET,
+	el=\EU, home=\E@, ht=\EZ, kbs=^H, kcbt=\E[, kclr=\EX, kcub1=^H,
 	kcud1=^J, kcuf1=^L, kcuu1=^K, ked=\ET, kel=\EU, khome=\E@,
 	rmso=\Ec\ED, rmul=\Eg\ED, smso=\Eb\ED, smul=\Ef\ED,
 
@@ -19140,7 +19584,7 @@
 t10|teleray 10 special,
 	OTbs, km, xhp, xt,
 	cols#80, it#8, lines#24, xmc#2,
-	clear=\Ej$<30/>, cub1=^H, cuf1=\EC,
+	clear=\Ej$<30/>, cub1=^H, cud1=\EB, cuf1=\EC,
 	cup=\EY%p1%{32}%+%c%p2%{32}%+%c, cuu1=\EA, dch1=\EQ,
 	dl1=\EM, ed=\EJ, el=\EK, home=\EH, ht=^I, ich1=\EP, il1=\EL,
 	ind=\Eq, pad=\0, ri=\Ep, rmso=\ER@, rmul=\ER@, smso=\ERD,
@@ -19862,7 +20306,7 @@
 v3220|LANPAR Vision II model 3220/3221/3222,
 	OTbs, am, mir, xenl,
 	cols#80, it#8, lines#24,
-	clear=\E[H\E[J, cub1=^H, cuf1=\E[C,
+	clear=\E[H\E[J, cub1=^H, cud1=\E[B, cuf1=\E[C,
 	cup=\E[%i%p1%d;%p2%dH, cuu1=\E[A, dch1=\E[P, dl1=\E[M,
 	ed=\E[J, el=\E[K, ht=^I, il1=\E[L,
 	is2=\E>\E[?3l\E[?7h\E[?8h\E[p, kcub1=\E[D, kcud1=\E[B,
@@ -21791,13 +22235,110 @@
 #	* add "aterm" -TD
 #	* add "linux2.6.26" -TD
 #
-# The following sets edit modes for GNU EMACS.
-# Local Variables:
-# fill-prefix:"\t"
-# fill-column:75
-# comment-column:0
-# comment-start-skip:"^#+"
-# comment-start:"# "
-# compile-command:"tic -c terminfo.master"
-# End:
+# 2008-11-15
+#	* change several \E[2g (clear tab at current column) to \E[3g
+#	  (clear all tabs) to match definition for tbc capability -TD
+#
+# 2008-11-29
+#	* add eterm-color -TD
+#
+# 2009-01-10
+#	* add screen.Eterm -TD
+#
+# 2009-03-28
+#	* correct typo in pfkey of ansi.sys-old
+#	  (report by Kalle Olavi Niemitalo)
+#	* move function- and cursor-keys from emx-base to ansi.sys, and create
+#	  a pfkey capability which handles F1-F48 -TD
+#
+# 2009-05-02
+#	* add vwmterm entry (Bryan Christ)
+#
+# 2009-09-19
+#	* change ncv and op capabilities in sun-color to match Sun's entry for
+#	  this (report by Laszlo Peter)
+#	* improve interix smso by using reverse rather than bold (report by
+#	  Kristof Zelechovski).
+#
+# 2009-10-03
+#	* remove unnecessary kcan assignment to ^C from putty (Sven Joachim)
+#	* add linux-16color (Benjamin Sittler)
+#	* correct initc capability of linux-c-nc end-of-range (Benjamin Sittler)
+#	* similar change for dg+ccc and dgunix+ccc (Benjamin Sittler)
+#	* add ccc and initc capabilities to xterm-16color -TD
+#
+# 2009-10-31
+#	* updated nsterm* entries (Benjamin Sittler, prompted by GenToo #206201)
+#
+# 2009-12-12
+#	* updated nsterm* entries (Benjamin Sittler, Emanuele Giaquinta)
+#
+# 2009-12-12
+#	* add bw (auto-left-margin) to nsterm* entries (Benjamin Sittler)
+#	* rename minix to minix-1.7, add minix entry for Minux3 -TD
+#
+# 2009-12-26
+#	* add bterm (bogl 0.1.18) -TD
+#	* minor fix to rxvt+pcfkeys -TD
+#
+# 2010-02-06
+#	* update mrxvt to 0.5.4, add mrxvt-256color -TD
+#
+# 2010-02-13
+#	* add several screen-bce.XXX entries -TD
+#
+# 2010-02-23
+#	* modify screen-bce.XXX entries to exclude ech, since screen's color
+#	  model does not clear with color for that feature -TD
+#
+# 2010-03-20
+#	* rename atari and st52 to atari-old, st52-old, use newer entries from
+#	  FreeMiNT by Guido Flohr (from patch/report by Alan Hourihane).
+#
+# 2010-06-12
+#	* add mlterm+256color entry -TD
+#
+# 2010-07-17
+#	* add hard-reset for rs2 to wsvt25 to help ensure that reset ends
+#	  the alternate character set (patch by Nicholas Marriott)
+#
+# 2010-08-28
+#	* improve acsc for vt52 (Benjamin Sittler)
+#	* modify nsterm entries for consistent sgr/sgr0 -TD
+#	* modify xnuppc entries for consistent sgr/sgr0 -TD
+#	* add invis to tek4115 sgr -TD
+#
+# 2010-09-11
+#	* reformat acsc strings to canonical format -TD
+#
+# 2010-09-25
+#	* add "XT" capability to entries for terminals that support both
+#	  xterm-style mouse- and title-controls, for "screen" which
+#	  special-cases TERM beginning with "xterm" or "rxvt" -TD
+#
+# 2010-10-02
+#	* fill in no-parameter forms of cursor-movement where a parameterized
+#	  form is available -TD
+#	* fill in missing cursor controls where the form of the controls is
+#	  ANSI -TD
+#	* add parameterized cursor-controls to linux-basic (report by Dae) -TD
+#
+# 2010-10-09
+#	* correct comparison used for setting 16-colors in linux-16color
+#	  entry (Novell #644831) -TD
+#	* improve linux-16color entry, using "dim" for color-8 which makes it
+#	  gray rather than black like color-0 -TD
+#
+# 2010-11-20
+#	* make "vte" the principal entry defining "gnome", since GNOME terminal
+#	  is merely one of several terminals whose behavior is provided by this
+#	  library -TD
+#
+# 2010-11-27
+#	* fix typo in rmso for tek4106 -Goran Weinholt
+#
+# 2010-12-11
+#	* suppress ncv in screen entry, allowing underline -Alejandro R. Sedeno
+#	* also suppress ncv in konsole-base -TD
+#
 ######## SHANTIH!  SHANTIH!  SHANTIH!
diff -Naur ncurses-5.7.orig/mk-0th.awk ncurses-5.7/mk-0th.awk
--- ncurses-5.7.orig/mk-0th.awk	2005-01-22 11:31:40.000000000 -0500
+++ ncurses-5.7/mk-0th.awk	2011-01-08 18:13:50.539157385 -0500
@@ -1,6 +1,6 @@
-# $Id: mk-0th.awk,v 1.17 2005/01/22 16:31:40 tom Exp $
+# $Id: mk-0th.awk,v 1.18 2010/01/09 21:45:41 tom Exp $
 ##############################################################################
-# Copyright (c) 1998-2004,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 "Software"), #
@@ -27,7 +27,7 @@
 # authorization.                                                             #
 ##############################################################################
 #
-# Author: Thomas E. Dickey <dickey@clark.net> 1996,1997
+# Author: Thomas E. Dickey 1996-on
 #
 # Generate list of sources for a library, together with lint/lintlib rules
 #
@@ -36,9 +36,13 @@
 #	subsets (is used here to decide if wide-character code is used)
 #
 BEGIN	{
+		which = libname;
 		using = 0;
 		found = 0;
 	}
+	/^@/ {
+		which = $0;
+	}
 	!/^[@#]/ {
 		if (using == 0)
 		{
@@ -57,7 +61,11 @@
 			print  ""
 			using = 1;
 		}
-		if ( $0 != "" && $1 != "link_test" )
+		if (which ~ /port_/ )
+		{
+			# skip win32 source
+		}
+		else if ( $0 != "" && $1 != "link_test" )
 		{
 			if ( found == 0 )
 			{
diff -Naur ncurses-5.7.orig/mk-1st.awk ncurses-5.7/mk-1st.awk
--- ncurses-5.7.orig/mk-1st.awk	2007-03-24 18:10:55.000000000 -0400
+++ ncurses-5.7/mk-1st.awk	2011-01-08 18:18:29.074996288 -0500
@@ -1,6 +1,6 @@
-# $Id: mk-1st.awk,v 1.78 2007/03/24 22:10:55 tom Exp $
+# $Id: mk-1st.awk,v 1.85 2010/08/07 20:42:30 Gabriele.Balducci Exp $
 ##############################################################################
-# Copyright (c) 1998-2006,2007 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 "Software"), #
@@ -40,8 +40,9 @@
 #	subset		  ("none", "base", "base+ext_funcs" or "termlib", etc.)
 #	ShlibVer	  ("rel", "abi" or "auto", to augment DoLinks variable)
 #	ShlibVerInfix ("yes" or "no", determines location of version #)
-#   TermlibRoot   ("tinfo" or other root for libterm.so)
-#   TermlibSuffix (".so" or other suffix for libterm.so)
+#	SymLink		  ("ln -s", etc)
+#	TermlibRoot	  ("tinfo" or other root for libterm.so)
+#	TermlibSuffix (".so" or other suffix for libterm.so)
 #	ReLink		  ("yes", or "no", flag to rebuild shared libs on install)
 #	DoLinks		  ("yes", "reverse" or "no", flag to add symbolic links)
 #	rmSoLocs	  ("yes" or "no", flag to add extra clean target)
@@ -49,6 +50,7 @@
 #	overwrite	  ("yes" or "no", flag to add link to libcurses.a
 #	depend		  (optional dependencies for all objects, e.g, ncurses_cfg.h)
 #	host		  (cross-compile host, if any)
+#	libtool_version (libtool "-version-info" or "-version-number")
 #
 # Notes:
 #	CLIXs nawk does not like underscores in command-line variable names.
@@ -59,7 +61,7 @@
 		return ( subset ~ /^ticlib$/ );
 	}
 function is_termlib() {
-		return ( subset ~ /^(ticlib\+)?termlib(\+ext_tinfo)?$/ );
+		return ( subset ~ /^(ticlib\+)?termlib((\+[^+ ]+)*\+[a-z_]+_tinfo)?$/ );
 	}
 # see lib_name
 function lib_name_of(a_name) {
@@ -115,7 +117,9 @@
 	}
 function symlink(src,dst) {
 		if ( src != dst ) {
-			printf "rm -f %s; ", dst
+			if ( SymLink !~ /.*-f.*/ ) {
+				printf "rm -f %s; ", dst
+			}
 			printf "$(LN_S) %s %s; ", src, dst
 		}
 	}
@@ -240,6 +244,7 @@
 					printf "#  subset:        %s\n", subset 
 					printf "#  ShlibVer:      %s\n", ShlibVer 
 					printf "#  ShlibVerInfix: %s\n", ShlibVerInfix 
+					printf "#  SymLink:       %s\n", SymLink 
 					printf "#  TermlibRoot:   %s\n", TermlibRoot 
 					printf "#  TermlibSuffix: %s\n", TermlibSuffix 
 					printf "#  ReLink:        %s\n", ReLink 
@@ -335,11 +340,15 @@
 					if ( ShlibVer == "cygdll" ) {
 						ovr_name = sprintf("libcurses%s.a", suffix)
 						printf "\t@echo linking %s to %s\n", imp_name, ovr_name
-						printf "\tcd $(DESTDIR)$(libdir) && (rm -f %s; $(LN_S) %s %s; )\n", ovr_name, imp_name, ovr_name
+						printf "\tcd $(DESTDIR)$(libdir) && ("
+						symlink(imp_name, ovr_name)
+						printf ")\n"
 					} else {
 						ovr_name = sprintf("libcurses%s", suffix)
 						printf "\t@echo linking %s to %s\n", end_name, ovr_name
-						printf "\tcd $(DESTDIR)$(libdir) && (rm -f %s; $(LN_S) %s %s; )\n", ovr_name, end_name, ovr_name
+						printf "\tcd $(DESTDIR)$(libdir) && ("
+						symlink(end_name, ovr_name)
+						printf ")\n"
 					}
 				}
 				if ( ldconfig != "" && ldconfig != ":" ) {
@@ -386,7 +395,13 @@
 				}
 				end_name = lib_name;
 				printf "../lib/%s : $(%s_OBJS)\n", lib_name, OBJS
-				printf "\tcd ../lib && $(LIBTOOL_LINK) $(%s) -o %s $(%s_OBJS:$o=.lo) -rpath $(DESTDIR)$(libdir) -version-info $(NCURSES_MAJOR):$(NCURSES_MINOR) $(SHLIB_LIST)\n", compile, lib_name, OBJS
+				if ( is_ticlib() ) {
+					printf "\tcd ../lib && $(LIBTOOL_LINK) $(%s) -o %s $(%s_OBJS:$o=.lo) -rpath $(DESTDIR)$(libdir) %s $(NCURSES_MAJOR):$(NCURSES_MINOR) $(LT_UNDEF) $(TICS_LIST)\n", compile, lib_name, OBJS, libtool_version
+				} else if ( is_termlib() ) {
+					printf "\tcd ../lib && $(LIBTOOL_LINK) $(%s) -o %s $(%s_OBJS:$o=.lo) -rpath $(DESTDIR)$(libdir) %s $(NCURSES_MAJOR):$(NCURSES_MINOR) $(LT_UNDEF) $(TINFO_LIST)\n", compile, lib_name, OBJS, libtool_version
+				} else {
+					printf "\tcd ../lib && $(LIBTOOL_LINK) $(%s) -o %s $(%s_OBJS:$o=.lo) -rpath $(DESTDIR)$(libdir) %s $(NCURSES_MAJOR):$(NCURSES_MINOR) $(LT_UNDEF) $(SHLIB_LIST)\n", compile, lib_name, OBJS, libtool_version
+				}
 				print  ""
 				print  "install \\"
 				print  "install.libs \\"
@@ -404,7 +419,7 @@
 			{
 				end_name = lib_name;
 				printf "../lib/%s : $(%s_OBJS)\n", lib_name, OBJS
-				printf "\t$(AR) $(AR_OPTS) $@ $?\n"
+				printf "\t$(AR) $(ARFLAGS) $@ $?\n"
 				printf "\t$(RANLIB) $@\n"
 				if ( host == "vxworks" )
 				{
@@ -420,7 +435,9 @@
 				{
 					printf "\t@echo linking libcurses.a to libncurses.a\n"
 					printf "\t-@rm -f $(DESTDIR)$(libdir)/libcurses.a\n"
-					printf "\t(cd $(DESTDIR)$(libdir) && $(LN_S) libncurses.a libcurses.a)\n"
+					printf "\t(cd $(DESTDIR)$(libdir) && "
+					symlink("libncurses.a", "libcurses.a")
+					printf ")\n"
 				}
 				printf "\t$(RANLIB) $(DESTDIR)$(libdir)/%s\n", lib_name
 				if ( host == "vxworks" )
diff -Naur ncurses-5.7.orig/mk-dlls.sh ncurses-5.7/mk-dlls.sh
--- ncurses-5.7.orig/mk-dlls.sh	1969-12-31 19:00:00.000000000 -0500
+++ ncurses-5.7/mk-dlls.sh	2011-01-08 18:13:50.539157385 -0500
@@ -0,0 +1,93 @@
+#!/bin/sh
+# $Id: mk-dlls.sh,v 1.2 2010/01/30 19:23:49 tom Exp $
+##############################################################################
+# 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 "Software"), #
+# to deal in the Software without restriction, including without limitation  #
+# the rights to use, copy, modify, merge, publish, distribute, distribute    #
+# with modifications, sublicense, and/or sell copies of the Software, and to #
+# permit persons to whom the Software is furnished to do so, subject to the  #
+# following conditions:                                                      #
+#                                                                            #
+# The above copyright notice and this permission notice shall be included in #
+# all copies or substantial portions of the Software.                        #
+#                                                                            #
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR #
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,   #
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL    #
+# THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER      #
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING    #
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER        #
+# DEALINGS IN THE SOFTWARE.                                                  #
+#                                                                            #
+# Except as contained in this notice, the name(s) of the above copyright     #
+# holders shall not be used in advertising or otherwise to promote the sale, #
+# use or other dealings in this Software without prior written               #
+# authorization.                                                             #
+##############################################################################
+#
+# Author: Juergen Pfeifer
+#
+# Build DLLs on MinGW
+#
+gcc -v 2>&1 | grep specs | grep mingw
+if [ $? -eq 1 ]; then
+  echo "$0 requires a mingw environment" >&2
+else
+  if [ -d lib ]; then
+    cf="-shared"
+    lf="--enable-auto-import"
+    pushd lib 2>&1 >/dev/null
+      for t in "" "t"
+      do
+        for m in "" "_g"
+        do
+          if [ -f libncurses${t}${m}.a ]; then
+            f=libncurses${t}${m}.a
+            g=`basename $f .a | cut -c 4-`
+            gi=libw${g}.a
+            td=tmp-${g}
+            rm -rf "${td}"
+            mkdir "${td}"
+            cd "${td}"
+              ar x ../${f} `ar t ../${f}`
+              gcc $cf -o w${g}.dll -Wl,--out-implib,${gi} -Wl,--output-def,w${g}.def -Wl,$lf `ar t ../$f`
+              lib //NOLOGO /MACHINE:i386 /DEF:w${g}.def
+              rm -f `ar t ../$f`
+              mv w${g}.dll ..
+              mv w${g}.lib ..
+              mv libw${g}.a ..
+            cd ..
+            rm -rf "${td}"
+
+            for l in panel menu form
+            do
+              for f in lib${l}${t}${m}.a
+              do
+                g=`basename $f .a | cut -c 4-`
+                td=tmp-${g}
+                rm -rf "${td}"
+                mkdir "${td}"
+                echo $g
+                cd "${td}"
+                  ar x ../$f `ar t ../$f`
+                  gcc $cf -o w${g}.dll -Wl,--out-implib,libw${g}.a -Wl,--output-def,w${g}.def -Wl,$lf `ar t ../$f` ../${gi}
+                  lib //NOLOGO /MACHINE:i386 /DEF:w${g}.def
+                  rm -f `ar t ../$f`
+                  mv w${g}.dll ..
+                  mv w${g}.lib ..
+                  mv libw${g}.a ..
+                cd ..
+                rm -rf "${td}"
+              done
+            done
+          fi
+        done
+      done
+    popd
+  else
+    echo lib has not been built >&2
+  fi
+fi
diff -Naur ncurses-5.7.orig/mk-dlls.sh.in ncurses-5.7/mk-dlls.sh.in
--- ncurses-5.7.orig/mk-dlls.sh.in	1969-12-31 19:00:00.000000000 -0500
+++ ncurses-5.7/mk-dlls.sh.in	2011-01-08 18:18:29.746780939 -0500
@@ -0,0 +1,114 @@
+#!/bin/sh
+# $Id: mk-dlls.sh.in,v 1.3 2010/12/25 22:25:41 tom Exp $
+##############################################################################
+# 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 "Software"), #
+# to deal in the Software without restriction, including without limitation  #
+# the rights to use, copy, modify, merge, publish, distribute, distribute    #
+# with modifications, sublicense, and/or sell copies of the Software, and to #
+# permit persons to whom the Software is furnished to do so, subject to the  #
+# following conditions:                                                      #
+#                                                                            #
+# The above copyright notice and this permission notice shall be included in #
+# all copies or substantial portions of the Software.                        #
+#                                                                            #
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR #
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,   #
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL    #
+# THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER      #
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING    #
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER        #
+# DEALINGS IN THE SOFTWARE.                                                  #
+#                                                                            #
+# Except as contained in this notice, the name(s) of the above copyright     #
+# holders shall not be used in advertising or otherwise to promote the sale, #
+# use or other dealings in this Software without prior written               #
+# authorization.                                                             #
+##############################################################################
+#
+# Author: Juergen Pfeifer
+#
+# Build DLLs on MinGW
+#
+LC_ALL=C @CC@ -v 2>&1 | grep Target | grep mingw
+if [ $? -eq 1 ]; then
+  echo "$0 requires a mingw environment" >&2
+else
+  mkdir "$TEMP/tmp-dll"
+  cat > "$TEMP/tmp-dll/arch.c" <<EOF
+#include <stdio.h>
+int main()
+{
+    printf("%d",8*sizeof(void*));
+    return(0);
+}
+EOF
+  pushd "$TEMP/tmp-dll"
+    @CC@ -o arch arch.c
+    ARCH=`./arch`
+    cd ..
+    rm -rf tmp-dll
+  popd
+  echo $ARCH > mingw_arch
+  echo Building DLLs and Import Libraries for Win${ARCH}
+
+  if [ -d lib ]; then
+    cf="-shared"
+    lf="--enable-auto-import"
+    pushd lib 2>&1 >/dev/null
+      for t in "" "t"
+      do
+        for m in "" "_g"
+        do
+          if [ -f libncurses${t}${m}.a ]; then
+            f=libncurses${t}${m}.a
+            g=ncurses${t}${m}
+            gi=libw${g}.dll.a
+            td=$TEMP/tmp-${g}
+            bd=`pwd`
+            rm -rf "${td}"
+            mkdir "${td}"
+            pushd "${td}"
+              ar x "${bd}/${f}" `ar t "${bd}/${f}"`
+              @CC@ $cf -o w${g}.dll -Wl,--out-implib,${gi} -Wl,--output-def,w${g}.def -Wl,$lf `ar t "${bd}/$f"` @LIBS@
+              lib //NOLOGO /MACHINE:i386 /DEF:w${g}.def
+              rm -f `ar t "${bd}/$f"`
+              mv w${g}.dll "${bd}"
+              mv w${g}.lib "${bd}"
+              mv ${gi} "${bd}"
+            popd
+            rm -rf "${td}"
+
+            for l in panel menu form
+            do
+              for f in lib${l}${t}${m}.a
+              do
+                g=${l}${t}${m}
+                td=$TEMP/tmp-${g}
+                gi2=libw${g}.dll.a
+                bd=`pwd`
+                rm -rf "${td}"
+                mkdir "${td}"
+                echo $g
+                pushd "${td}"
+                  ar x "${bd}/$f" `ar t "${bd}/$f"`
+                  @CC@ $cf -o w${g}.dll -Wl,--out-implib,${gi2} -Wl,--output-def,w${g}.def -Wl,$lf `ar t "${bd}/$f"` "${bd}/${gi}" @LIBS@
+                  lib //NOLOGO /MACHINE:i386 /DEF:w${g}.def
+                  rm -f `ar t "${bd}/$f"`
+                  mv w${g}.dll "${bd}"
+                  mv w${g}.lib "${bd}"
+                  mv ${gi2} "${bd}"
+                popd
+                rm -rf "${td}"
+              done
+            done
+          fi
+        done
+      done
+    popd
+  else
+    echo lib has not been built >&2
+  fi
+fi
diff -Naur ncurses-5.7.orig/mk-hdr.awk ncurses-5.7/mk-hdr.awk
--- ncurses-5.7.orig/mk-hdr.awk	2007-03-31 11:48:45.000000000 -0400
+++ ncurses-5.7/mk-hdr.awk	2011-01-08 18:13:50.539157385 -0500
@@ -1,6 +1,6 @@
-# $Id: mk-hdr.awk,v 1.2 2007/03/31 15:48:45 tom Exp $
+# $Id: mk-hdr.awk,v 1.3 2010/05/15 20:10:42 tom Exp $
 ##############################################################################
-# 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 "Software"), #
@@ -74,7 +74,7 @@
 		if ( count > 0 )
 		{
 			print "${DESTDIR}${includedir} :"
-			print "	sh ${srcdir}/../mkdirs.sh $@"
+			print "	mkdir -p $@"
 			print ""
 			print "install \\"
 			print "install.libs \\"
diff -Naur ncurses-5.7.orig/ncurses/Makefile.in ncurses-5.7/ncurses/Makefile.in
--- ncurses-5.7.orig/ncurses/Makefile.in	2008-10-18 10:11:54.000000000 -0400
+++ ncurses-5.7/ncurses/Makefile.in	2011-01-08 18:18:29.574661327 -0500
@@ -1,6 +1,6 @@
-# $Id: Makefile.in,v 1.113 2008/10/18 14:11:54 tom Exp $
+# $Id: Makefile.in,v 1.130 2010/11/27 21:45:27 tom Exp $
 ##############################################################################
-# Copyright (c) 1998-2007,2008 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 "Software"), #
@@ -46,6 +46,7 @@
 .SUFFIXES:
 
 SHELL		= /bin/sh
+VPATH		= @srcdir@
 THIS		= Makefile
 
 CF_MFLAGS 	= @cf_cv_makeflags@
@@ -71,6 +72,7 @@
 LIBTOOL_LINK	= @LIB_LINK@
 LIBTOOL_INSTALL	= @LIB_INSTALL@
 LIBTOOL_UNINSTALL = @LIB_UNINSTALL@
+LT_UNDEF	= @LT_UNDEF@
 
 INSTALL		= @INSTALL@
 INSTALL_LIB	= @INSTALL@ @INSTALL_LIB@
@@ -78,11 +80,14 @@
 INSTALL_DATA	= @INSTALL_DATA@
 
 AR		= @AR@
-AR_OPTS		= @AR_OPTS@
+ARFLAGS		= @ARFLAGS@
 AWK		= @AWK@
 LD		= @LD@
 LN_S		= @LN_S@
 
+CTAGS		= @CTAGS@
+ETAGS		= @ETAGS@
+
 CC		= @CC@
 CPP		= @CPP@
 CFLAGS		= @CFLAGS@
@@ -92,7 +97,7 @@
 
 CCFLAGS		= $(CPPFLAGS) $(CFLAGS)
 
-BUILD_CPPFLAGS	= -I../include @BUILD_CPPFLAGS@
+BUILD_CPPFLAGS	= -I../include -DUSE_BUILD_CC @BUILD_CPPFLAGS@
 BUILD_CC	= @BUILD_CC@
 BUILD_CCFLAGS	= -DHAVE_CONFIG_H -I../ncurses -I$(srcdir) -I$(INCDIR) $(BUILD_CPPFLAGS) @BUILD_CFLAGS@
 BUILD_LDFLAGS	= @BUILD_LDFLAGS@
@@ -140,6 +145,10 @@
 USE_BIG_STRINGS	= @USE_BIG_STRINGS@
 TERMINFO_CAPS	= $(top_srcdir)/include/@TERMINFO_CAPS@
 
+TERMINFO	= @TERMINFO@
+TERMINFO_SRC	= @TERMINFO_SRC@
+TIC_PATH	= @TIC_PATH@
+
 AUTO_SRC = \
 	./codes.c \
 	./comp_captab.c \
@@ -153,6 +162,18 @@
 	init_keytry.h \
 	keys.list
 
+HEADER_DEPS	= \
+	$(srcdir)/curses.priv.h \
+	../include/ncurses_dll.h \
+	../include/ncurses_cfg.h \
+	../include/curses.h \
+	$(INCDIR)/nc_panel.h \
+	../include/term.h \
+	$(INCDIR)/term_entry.h \
+	$(INCDIR)/nc_tparm.h \
+	$(INCDIR)/nc_alloc.h \
+	$(INCDIR)/nc_mingw.h
+
 TEST_DEPS	= ../lib/@LIB_PREFIX@ncurses@DFT_DEP_SUFFIX@
 TEST_ARGS	= @LDFLAGS_STATIC@ @TEST_ARGS@ @LDFLAGS_SHARED@ 
 TEST_LDFLAGS	= @LD_MODEL@ $(TEST_ARGS) @LIBS@ @LOCAL_LDFLAGS@ @LDFLAGS@
@@ -164,11 +185,12 @@
 	hashmap$x \
 	lib_mvcur$x
 
-base	= $(srcdir)/base
-serial	= $(srcdir)/tty
-tinfo	= $(srcdir)/tinfo
-trace	= $(srcdir)/trace
-wide	= $(srcdir)/widechar
+base	 = $(srcdir)/base
+serial	 = $(srcdir)/tty
+tinfo	 = $(srcdir)/tinfo
+trace	 = $(srcdir)/trace
+wide	 = $(srcdir)/widechar
+win32con = $(srcdir)/win32con
 
 ################################################################################
 all \
@@ -178,12 +200,12 @@
 
 $(DESTDIR)$(bindir) \
 $(DESTDIR)$(libdir) :
-	sh $(srcdir)/../mkdirs.sh $@
+	mkdir -p $@
 
 ../lib : ; mkdir $@
 
 ./fallback.c : $(tinfo)/MKfallback.sh
-	sh -e $(tinfo)/MKfallback.sh @TERMINFO@ @TERMINFO_SRC@ $(FALLBACK_LIST) >$@
+	sh -e $(tinfo)/MKfallback.sh $(TERMINFO) $(TERMINFO_SRC) $(TIC_PATH) $(FALLBACK_LIST) >$@
 
 ./lib_gen.c : $(base)/MKlib_gen.sh ../include/curses.h
 	sh -e $(base)/MKlib_gen.sh "$(CPP) $(CPPFLAGS)" "$(AWK)" generated <../include/curses.h >$@
@@ -200,11 +222,11 @@
 	$(BUILD_CC) -o $@ $(BUILD_CCFLAGS) $(tinfo)/make_keys.c $(BUILD_LDFLAGS) $(BUILD_LIBS)
 
 make_hash$(BUILD_EXEEXT) : \
-		$(tinfo)/comp_hash.c \
+		$(tinfo)/make_hash.c \
 		../include/hashsize.h
-	$(BUILD_CC) -o $@ $(BUILD_CCFLAGS) -DMAIN_PROGRAM $(tinfo)/comp_hash.c $(BUILD_LDFLAGS) $(BUILD_LIBS)
+	$(BUILD_CC) -o $@ $(BUILD_CCFLAGS) $(tinfo)/make_hash.c $(BUILD_LDFLAGS) $(BUILD_LIBS)
 
-./expanded.c : $(serial)/MKexpanded.sh
+./expanded.c : $(srcdir)/curses.priv.h $(serial)/MKexpanded.sh
 	sh -e $(serial)/MKexpanded.sh "$(CPP)" $(CPPFLAGS) > $@
 
 ./comp_captab.c: \
@@ -227,10 +249,10 @@
 	echo | $(AWK) -f $(base)/MKunctrl.awk bigstrings=$(USE_BIG_STRINGS) >$@
 
 tags:
-	ctags *.[ch] */*.[ch]
+	$(CTAGS) *.[ch] */*.[ch]
 
 @MAKE_UPPER_TAGS@TAGS:
-@MAKE_UPPER_TAGS@	etags *.[ch] */*.[ch]
+@MAKE_UPPER_TAGS@	$(ETAGS) *.[ch] */*.[ch]
 
 mostlyclean ::
 	-rm -f core tags TAGS *~ *.bak *.i *.ln *.atac trace
diff -Naur ncurses-5.7.orig/ncurses/README ncurses-5.7/ncurses/README
--- ncurses-5.7.orig/ncurses/README	2006-04-22 18:19:37.000000000 -0400
+++ ncurses-5.7/ncurses/README	2011-01-08 18:13:50.539157385 -0500
@@ -1,5 +1,5 @@
 -------------------------------------------------------------------------------
--- Copyright (c) 1998-2000,2006 Free Software Foundation, Inc.               --
+-- Copyright (c) 1998-2006,2009 Free Software Foundation, Inc.               --
 --                                                                           --
 -- Permission is hereby granted, free of charge, to any person obtaining a   --
 -- copy of this software and associated documentation files (the             --
@@ -25,7 +25,26 @@
 -- sale, use or other dealings in this Software without prior written        --
 -- authorization.                                                            --
 -------------------------------------------------------------------------------
--- $Id: README,v 1.9 2006/04/22 22:19:37 tom Exp $
+-- $Id: README,v 1.10 2009/06/27 14:44:30 tom Exp $
 -------------------------------------------------------------------------------
 For discussion of the package internals, see hackguide.html in the doc/html
 directory.
+
+-------------------------------------------------------------------------------
+The llib-lXXXX files could be used as lint-library sources (and were, at one
+time).  However, they are actually used as a documentation aid to keep track
+of changes to the public/private interfaces in ncurses.  Most of the text in
+these files is generated using cproto; some manual cleanup and adjustment of
+types (to reflect #define's in curses.h) is needed.  The functions listed in
+the llib-lXXXX files do not correspond to the default configure options; some
+additional ones are added to include "all" of the entrypoints for each of the
+major configurations (normal, wide-character, threaded):
+
+	--disable-macros
+	--disable-root-environ
+	--enable-expanded
+	--enable-getcap
+	--enable-getcap-cache
+	--enable-sp-funcs
+	--enable-termcap
+	--with-develop
diff -Naur ncurses-5.7.orig/ncurses/base/MKkeyname.awk ncurses-5.7/ncurses/base/MKkeyname.awk
--- ncurses-5.7.orig/ncurses/base/MKkeyname.awk	2008-07-12 14:40:00.000000000 -0400
+++ ncurses-5.7/ncurses/base/MKkeyname.awk	2011-01-08 18:18:29.746780939 -0500
@@ -1,6 +1,6 @@
-# $Id: MKkeyname.awk,v 1.40 2008/07/12 18:40:00 tom Exp $
+# $Id: MKkeyname.awk,v 1.45 2010/12/19 01:36:14 tom Exp $
 ##############################################################################
-# Copyright (c) 1999-2007,2008 Free Software Foundation, Inc.                #
+# Copyright (c) 1999-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 "Software"), #
@@ -31,7 +31,6 @@
 	print ""
 	print "#include <curses.priv.h>"
 	print "#include <tic.h>"
-	print "#include <term_entry.h>"
 	print ""
 	first = 1;
 }
@@ -67,7 +66,8 @@
 	print "#define SIZEOF_TABLE 256"
 	print "#define MyTable _nc_globals.keyname_table"
 	print ""
-	print "NCURSES_EXPORT(NCURSES_CONST char *) _nc_keyname (SCREEN *sp, int c)"
+	print "NCURSES_EXPORT(NCURSES_CONST char *)"
+	print "safe_keyname (SCREEN *sp, int c)"
 	print "{"
 	print "	int i;"
 	print "	char name[20];"
@@ -116,14 +116,14 @@
 	print "				result = MyTable[c];"
 	print "			}"
 	print "#if NCURSES_EXT_FUNCS && NCURSES_XNAMES"
-	print "		} else if (result == 0 && cur_term != 0) {"
+	print "		} else if (result == 0 && HasTerminal(sp)) {"
 	print "			int j, k;"
 	print "			char * bound;"
-	print "			TERMTYPE *tp = &(cur_term->type);"
-	print "			int save_trace = _nc_tracing;"
+	print "			TERMTYPE *tp = &(TerminalOf(sp)->type);"
+	print "			unsigned save_trace = _nc_tracing;"
 	print ""
 	print "			_nc_tracing = 0;	/* prevent recursion via keybound() */"
-	print "			for (j = 0; (bound = keybound(c, j)) != 0; ++j) {"
+	print "			for (j = 0; (bound = NCURSES_SP_NAME(keybound)(NCURSES_SP_ARGx c, j)) != 0; ++j) {"
 	print "				for(k = STRCOUNT; k < (int) NUM_STRINGS(tp);  k++) {"
 	print "					if (tp->Strings[k] != 0 && !strcmp(bound, tp->Strings[k])) {"
 	print "						result = ExtStrname(tp, k, strnames);"
@@ -141,9 +141,10 @@
 	print "	return result;"
 	print "}"
 	print ""
-	print "NCURSES_EXPORT(NCURSES_CONST char *) keyname (int c)"
+	print "NCURSES_EXPORT(NCURSES_CONST char *)"
+	print "keyname (int c)"
 	print "{"
-	print "\treturn _nc_keyname(SP, c);"
+	print "	return safe_keyname (CURRENT_SCREEN, c);"
 	print "}"
 	print ""
 	print "#if NO_LEAKS"
diff -Naur ncurses-5.7.orig/ncurses/base/MKlib_gen.sh ncurses-5.7/ncurses/base/MKlib_gen.sh
--- ncurses-5.7.orig/ncurses/base/MKlib_gen.sh	2008-08-30 15:20:50.000000000 -0400
+++ ncurses-5.7/ncurses/base/MKlib_gen.sh	2011-01-08 18:18:29.814782179 -0500
@@ -2,10 +2,10 @@
 #
 # MKlib_gen.sh -- generate sources from curses.h macro definitions
 #
-# ($Id: MKlib_gen.sh,v 1.34 2008/08/30 19:20:50 tom Exp $)
+# ($Id: MKlib_gen.sh,v 1.42 2011/01/01 22:06:52 tom Exp $)
 #
 ##############################################################################
-# Copyright (c) 1998-2007,2008 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 "Software"), #
@@ -51,7 +51,7 @@
 #         them.
 # 5. cpp: macro-expand the file so the macro calls turn into C calls
 # 6. awk: strip the expansion junk off the front and add the new header
-# 7. sed: squeeze spaces, strip off gen_ prefix, create needed #undef
+# 7. sed: squeeze spaces, strip off gen_ prefix.
 #
 
 # keep the editing independent of locale:
@@ -82,6 +82,8 @@
 	cat >$ED1 <<EOF1
 /^extern.*implemented/{
 	h
+	s/NCURSES_SP_NAME(\([^)]*\))/NCURSES_SP_NAME___\1/
+	h
 	s/^.*implemented:\([^ 	*]*\).*/P_POUNDCif_USE_\1_SUPPORT/p
 	g
 	s/^extern \([^;]*\);.*/\1/p
@@ -151,14 +153,13 @@
 	s/( /(/g
 	s/ )/)/g
 	s/ gen_/ /
-	s/^M_/#undef /
 	s/^[ 	]*@[ 	]*@[ 	]*/	/
 :done
 EOF3
 
 if test "$USE" = generated ; then
 cat >$ED4 <<EOF
-	s/^\(.*\) \(.*\) (\(.*\))\$/NCURSES_EXPORT(\1) \2 (\3)/
+	s/^\(.*\) \(.*\) (\(.*\))\$/NCURSES_EXPORT(\1) (\2) (\3)/
 EOF
 else
 cat >$ED4 <<EOF
@@ -169,6 +170,7 @@
 	g
 	s/^\(.*\) \(.*\) (\(.*\))\$/\1 call_\2 (\3)/
 	}
+s/\([^_]\)NCURSES_SP_NAME___\([a-zA-Z][a-zA-Z_]*\)/\1NCURSES_SP_NAME(\2)/g
 EOF
 fi
 
@@ -198,14 +200,16 @@
 		}
 	}
 	second = first + 1;
+	returnCast = "";
 	if ( $first == "chtype" ) {
-		returnType = "Char";
+		returnType = "Chtype";
 	} else if ( $first == "SCREEN" ) {
 		returnType = "SP";
 	} else if ( $first == "WINDOW" ) {
 		returnType = "Win";
 	} else if ( $first == "attr_t" || $second == "attrset" || $second == "standout" || $second == "standend" || $second == "wattrset" || $second == "wstandout" || $second == "wstandend" ) {
-		returnType = "Attr";
+		returnType = "IntAttr";
+		returnCast = "(attr_t)";
 	} else if ( $first == "bool" || $first == "NCURSES_BOOL" ) {
 		returnType = "Bool";
 	} else if ( $second == "*" ) {
@@ -220,9 +224,6 @@
 			break;
 		}
 	}
-	if (using == "generated") {
-		print "M_" $myfunc
-	}
 	print $0;
 	print "{";
 	argcount = 1;
@@ -247,6 +248,9 @@
 	if ($myfunc ~ /ripoffline/) {
 		dotrace = 0;
 		argcount = 2;
+		if ($myfunc ~ /NCURSES_SP_NAME/) {
+			argcount = 3;
+		}
 	}
 	if ($myfunc ~ /wunctrl/) {
 		dotrace = 0;
@@ -262,24 +266,26 @@
 	argtype = ""
 	for (i = myfunc; i <= NF; i++) {
 		ch = $i;
-		if ( ch == "*" )
+		if ( ch == "*" ) {
 			pointer = 1;
-		else if ( ch == "va_list" )
+		} else if ( ch == "va_list" ) {
 			va_list = 1;
-		else if ( ch == "..." )
+		} else if ( ch == "..." ) {
 			varargs = 1;
-		else if ( ch == "char" )
+		} else if ( ch == "char" ) {
 			argtype = "char";
-		else if ( ch == "int" )
+		} else if ( ch == "int" ) {
 			argtype = "int";
-		else if ( ch == "short" )
+		} else if ( ch == "short" ) {
 			argtype = "short";
-		else if ( ch == "chtype" )
+		} else if ( ch == "chtype" ) {
 			argtype = "chtype";
-		else if ( ch == "attr_t" || ch == "NCURSES_ATTR_T" )
+		} else if ( ch == "attr_t" || ch == "NCURSES_ATTR_T" ) {
 			argtype = "attr";
+		}
 
 		if ( ch == "," || ch == ")" ) {
+			argcast = "";
 			if (va_list) {
 				call = call "%s"
 			} else if (varargs) {
@@ -289,8 +295,10 @@
 					call = call "%s"
 					comma = comma "_nc_visbuf2(" num ","
 					pointer = 0;
-				} else
+				} else {
 					call = call "%p"
+					comma = comma "(const void *)"
+				}
 			} else if (argcount != 0) {
 				if ( argtype == "int" || argtype == "short" ) {
 					call = call "%d"
@@ -298,6 +306,9 @@
 				} else if ( argtype != "" ) {
 					call = call "%s"
 					comma = comma "_trace" argtype "2(" num ","
+					if (argtype == "attr") {
+						argcast = "(chtype)";
+					}
 				} else {
 					call = call "%#lx"
 					comma = comma "(long)"
@@ -311,7 +322,7 @@
 				} else if ( varargs ) {
 					args = args comma "\"...\""
 				} else {
-					args = args comma "z"
+					args = args comma argcast "z"
 				}
 			}
 			call = call ch
@@ -322,7 +333,7 @@
 			pointer = 0;
 			argtype = ""
 		}
-		if ( i == 2 || ch == "(" )
+		if ( i == myfunc || ch == "(" )
 			call = call ch
 	}
 	call = call "\")"
@@ -333,12 +344,16 @@
 	if (dotrace)
 		printf "%s", call
 
-	if (match($0, "^void"))
+	if (match($0, "^void")) {
 		call = ""
-	else if (dotrace)
+	} else if (dotrace) {
 		call = sprintf("return%s( ", returnType);
-	else
+		if (returnCast != "") {
+			call = call returnCast;
+		}
+	} else {
 		call = "@@return ";
+	}
 
 	call = call $myfunc "(";
 	for (i = 1; i < argcount; i++) {
@@ -353,8 +368,9 @@
 	}
 	if (!match($0, "^void"))
 		call = call ") ";
-	if (dotrace)
+	if (dotrace) {
 		call = call ")";
+	}
 	print call ";"
 
 	if (match($0, "^void"))
@@ -381,8 +397,17 @@
 		}
 		print " */"
 		print "#define NCURSES_ATTR_T int"
+		print "#include <ncurses_cfg.h>"
+		print ""
+		print "#undef NCURSES_NOMACROS	/* _this_ file uses macros */"
+		print ""
 		print "#include <curses.priv.h>"
 		print ""
+		print "#undef vw_scanw"
+		print "#undef vwscanw"
+		print ""
+		print "#undef vw_printw"
+		print "#undef vwprintw"
 		}
 /^DECLARATIONS/	{start = 1; next;}
 		{if (start) print \$0;}
diff -Naur ncurses-5.7.orig/ncurses/base/MKunctrl.awk ncurses-5.7/ncurses/base/MKunctrl.awk
--- ncurses-5.7.orig/ncurses/base/MKunctrl.awk	2008-10-04 17:40:24.000000000 -0400
+++ ncurses-5.7/ncurses/base/MKunctrl.awk	2011-01-08 18:13:50.539157385 -0500
@@ -1,6 +1,6 @@
-# $Id: MKunctrl.awk,v 1.23 2008/10/04 21:40:24 tom Exp $
+# $Id: MKunctrl.awk,v 1.26 2009/07/04 22:05:15 Clemens.Ladisch Exp $
 ##############################################################################
-# Copyright (c) 1998-2007,2008 Free Software Foundation, Inc.                #
+# Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.                #
 #                                                                            #
 # Permission is hereby granted, free of charge, to any person obtaining a    #
 # copy of this software and associated documentation files (the "Software"), #
@@ -36,19 +36,12 @@
 		print "#include <curses.priv.h>"
 		print "#include <ctype.h>"
 		print ""
-		print "#if USE_WIDEC_SUPPORT"
-		print "#if HAVE_WCTYPE_H"
-		print "#include <wctype.h>"
-		print "#endif"
-		print "#endif"
-		print ""
 		print "#undef unctrl"
 		print ""
 	}
 END	{
-		print "NCURSES_EXPORT(NCURSES_CONST char *) _nc_unctrl (SCREEN *sp, chtype ch)"
+		print "NCURSES_EXPORT(NCURSES_CONST char *) safe_unctrl(SCREEN *sp, chtype ch)"
 		print "{"
-
 		blob=""
 		offset=0
 		if (bigstrings) {
@@ -158,16 +151,6 @@
 		print  "\t\t && (check < 160))"
 		printf "\t\t\tresult = %s_c1[check - 128];\n", stringname;
 		print  "\t\telse"
-		print  "#if USE_WIDEC_SUPPORT"
-		print  "\t\tif ((check >= 160)"
-		print  "\t\t && (check < 256)"
-		print  "\t\t && ((sp != 0)"
-		print  "\t\t  && ((sp->_legacy_coding > 0)"
-		print  "\t\t   || (sp->_legacy_coding == 0"
-		print  "\t\t       && (isprint(check) || iswprint(check))))))"
-		printf "\t\t\tresult = %s_c1[check - 128];\n", stringname;
-		print  "\t\telse"
-		print  "#else"
 		print  "\t\tif ((check >= 160)"
 		print  "\t\t && (check < 256)"
 		print  "\t\t && ((sp != 0)"
@@ -176,7 +159,6 @@
 		print  "\t\t       && isprint(check)))))"
 		printf "\t\t\tresult = %s_c1[check - 128];\n", stringname;
 		print  "\t\telse"
-		print  "#endif /* USE_WIDEC_SUPPORT */"
 		print  "#endif /* NCURSES_EXT_FUNCS */"
 		printf "\t\t\tresult = %s_table[check];\n", stringname;
 		print  "\t} else {"
@@ -187,6 +169,6 @@
 		print  ""
 		print  "NCURSES_EXPORT(NCURSES_CONST char *) unctrl (chtype ch)"
 		print  "{"
-		print  "\treturn _nc_unctrl(SP, ch);"
+		print  "\treturn safe_unctrl(CURRENT_SCREEN, ch);"
 		print  "}"
 	}
diff -Naur ncurses-5.7.orig/ncurses/base/define_key.c ncurses-5.7/ncurses/base/define_key.c
--- ncurses-5.7.orig/ncurses/base/define_key.c	2006-12-30 18:23:31.000000000 -0500
+++ ncurses-5.7/ncurses/base/define_key.c	2011-01-08 18:13:50.539157385 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2005,2006 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2006,2009 Free 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,33 +27,40 @@
  ****************************************************************************/
 
 /****************************************************************************
- *  Author: Thomas E. Dickey                    1997-on                     *
+ *  Author: Thomas E. Dickey                        1997-on                 *
+ *     and: Juergen Pfeifer                         2009                    *
  ****************************************************************************/
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: define_key.c,v 1.13 2006/12/30 23:23:31 tom Exp $")
+MODULE_ID("$Id: define_key.c,v 1.20 2009/11/28 22:53:17 tom Exp $")
 
 NCURSES_EXPORT(int)
-define_key(const char *str, int keycode)
+NCURSES_SP_NAME(define_key) (NCURSES_SP_DCLx const char *str, int keycode)
 {
     int code = ERR;
 
-    T((T_CALLED("define_key(%s,%d)"), _nc_visbuf(str), keycode));
-    if (SP == 0) {
+    T((T_CALLED("define_key(%p, %s,%d)"), (void *) SP_PARM, _nc_visbuf(str), keycode));
+    if (SP_PARM == 0 || !HasTInfoTerminal(SP_PARM)) {
 	code = ERR;
     } else if (keycode > 0) {
 	unsigned ukey = (unsigned) keycode;
 
+#ifdef USE_TERM_DRIVER
+#define CallHasKey(keycode) CallDriver_1(SP_PARM, kyExist, keycode)
+#else
+#define CallHasKey(keycode) NCURSES_SP_NAME(has_key)(NCURSES_SP_ARGx keycode)
+#endif
+
 	if (str != 0) {
-	    define_key(str, 0);
-	} else if (has_key(keycode)) {
-	    while (_nc_remove_key(&(SP->_keytry), ukey))
+	    NCURSES_SP_NAME(define_key) (NCURSES_SP_ARGx str, 0);
+	} else if (CallHasKey(keycode)) {
+	    while (_nc_remove_key(&(SP_PARM->_keytry), ukey))
 		code = OK;
 	}
 	if (str != 0) {
-	    if (key_defined(str) == 0) {
-		if (_nc_add_to_try(&(SP->_keytry), str, ukey) == OK) {
+	    if (NCURSES_SP_NAME(key_defined) (NCURSES_SP_ARGx str) == 0) {
+		if (_nc_add_to_try(&(SP_PARM->_keytry), str, ukey) == OK) {
 		    code = OK;
 		} else {
 		    code = ERR;
@@ -63,8 +70,16 @@
 	    }
 	}
     } else {
-	while (_nc_remove_string(&(SP->_keytry), str))
+	while (_nc_remove_string(&(SP_PARM->_keytry), str))
 	    code = OK;
     }
     returnCode(code);
 }
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+define_key(const char *str, int keycode)
+{
+    return NCURSES_SP_NAME(define_key) (CURRENT_SCREEN, str, keycode);
+}
+#endif
diff -Naur ncurses-5.7.orig/ncurses/base/key_defined.c ncurses-5.7/ncurses/base/key_defined.c
--- ncurses-5.7.orig/ncurses/base/key_defined.c	2006-12-30 18:22:55.000000000 -0500
+++ ncurses-5.7/ncurses/base/key_defined.c	2011-01-08 18:13:50.539157385 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2003,2006 Free Software Foundation, Inc.                   *
+ * Copyright (c) 2003-2006,2009 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -32,7 +32,7 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: key_defined.c,v 1.6 2006/12/30 23:22:55 tom Exp $")
+MODULE_ID("$Id: key_defined.c,v 1.9 2009/10/24 22:15:47 tom Exp $")
 
 static int
 find_definition(TRIES * tree, const char *str)
@@ -65,14 +65,22 @@
  * Otherwise, return the keycode's value (neither OK/ERR).
  */
 NCURSES_EXPORT(int)
-key_defined(const char *str)
+NCURSES_SP_NAME(key_defined) (NCURSES_SP_DCLx const char *str)
 {
     int code = ERR;
 
-    T((T_CALLED("key_defined(%s)"), _nc_visbuf(str)));
-    if (SP != 0 && str != 0) {
-	code = find_definition(SP->_keytry, str);
+    T((T_CALLED("key_defined(%p, %s)"), (void *) SP_PARM, _nc_visbuf(str)));
+    if (SP_PARM != 0 && str != 0) {
+	code = find_definition(SP_PARM->_keytry, str);
     }
 
     returnCode(code);
 }
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+key_defined(const char *str)
+{
+    return NCURSES_SP_NAME(key_defined) (CURRENT_SCREEN, str);
+}
+#endif
diff -Naur ncurses-5.7.orig/ncurses/base/keybound.c ncurses-5.7/ncurses/base/keybound.c
--- ncurses-5.7.orig/ncurses/base/keybound.c	2006-06-17 14:19:24.000000000 -0400
+++ ncurses-5.7/ncurses/base/keybound.c	2011-01-08 18:13:50.555157600 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1999-2005,2006 Free Software Foundation, Inc.              *
+ * Copyright (c) 1999-2006,2009 Free 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,25 +27,34 @@
  ****************************************************************************/
 
 /****************************************************************************
- *  Author: Thomas E. Dickey                 1999-on                        *
+ *  Author: Thomas E. Dickey                        1999-on                 *
+ *     and: Juergen Pfeifer                         2009                    *
  ****************************************************************************/
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: keybound.c,v 1.7 2006/06/17 18:19:24 tom Exp $")
+MODULE_ID("$Id: keybound.c,v 1.10 2009/10/24 22:15:47 tom Exp $")
 
 /*
  * Returns the count'th string definition which is associated with the
  * given keycode.  The result is malloc'd, must be freed by the caller.
  */
 NCURSES_EXPORT(char *)
-keybound(int code, int count)
+NCURSES_SP_NAME(keybound) (NCURSES_SP_DCLx int code, int count)
 {
     char *result = 0;
 
-    T((T_CALLED("keybound(%d,%d)"), code, count));
-    if (SP != 0 && code >= 0) {
-	result = _nc_expand_try(SP->_keytry, (unsigned) code, &count, 0);
+    T((T_CALLED("keybound(%p, %d,%d)"), (void *) SP_PARM, code, count));
+    if (SP_PARM != 0 && code >= 0) {
+	result = _nc_expand_try(SP_PARM->_keytry, (unsigned) code, &count, 0);
     }
     returnPtr(result);
 }
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(char *)
+keybound(int code, int count)
+{
+    return NCURSES_SP_NAME(keybound) (CURRENT_SCREEN, code, count);
+}
+#endif
diff -Naur ncurses-5.7.orig/ncurses/base/keyok.c ncurses-5.7/ncurses/base/keyok.c
--- ncurses-5.7.orig/ncurses/base/keyok.c	2006-12-30 11:22:33.000000000 -0500
+++ ncurses-5.7/ncurses/base/keyok.c	2011-01-08 18:13:50.555157600 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2000,2006 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2006,2009 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -27,12 +27,13 @@
  ****************************************************************************/
 
 /****************************************************************************
- *  Author: Thomas E. Dickey            1997-on                             *
+ *  Author: Thomas E. Dickey                        1997-on                 *
+ *     and: Juergen Pfeifer                         2009                    *
  ****************************************************************************/
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: keyok.c,v 1.7 2006/12/30 16:22:33 tom Exp $")
+MODULE_ID("$Id: keyok.c,v 1.10 2009/10/24 22:15:47 tom Exp $")
 
 /*
  * Enable (or disable) ncurses' interpretation of a keycode by adding (or
@@ -45,28 +46,33 @@
  */
 
 NCURSES_EXPORT(int)
-keyok(int c, bool flag)
+NCURSES_SP_NAME(keyok) (NCURSES_SP_DCLx int c, bool flag)
 {
     int code = ERR;
-    int count = 0;
-    char *s;
 
+    T((T_CALLED("keyok(%p, %d,%d)"), (void *) SP_PARM, c, flag));
+#ifdef USE_TERM_DRIVER
+    code = CallDriver_2(sp, kyOk, c, flag);
+#else
     T((T_CALLED("keyok(%d,%d)"), c, flag));
     if (c >= 0) {
+	int count = 0;
+	char *s;
 	unsigned ch = (unsigned) c;
+
 	if (flag) {
-	    while ((s = _nc_expand_try(SP->_key_ok, ch, &count, 0)) != 0
-		   && _nc_remove_key(&(SP->_key_ok), ch)) {
-		code = _nc_add_to_try(&(SP->_keytry), s, ch);
+	    while ((s = _nc_expand_try(SP_PARM->_key_ok, ch, &count, 0)) != 0
+		   && _nc_remove_key(&(SP_PARM->_key_ok), ch)) {
+		code = _nc_add_to_try(&(SP_PARM->_keytry), s, ch);
 		free(s);
 		count = 0;
 		if (code != OK)
 		    break;
 	    }
 	} else {
-	    while ((s = _nc_expand_try(SP->_keytry, ch, &count, 0)) != 0
-		   && _nc_remove_key(&(SP->_keytry), ch)) {
-		code = _nc_add_to_try(&(SP->_key_ok), s, ch);
+	    while ((s = _nc_expand_try(SP_PARM->_keytry, ch, &count, 0)) != 0
+		   && _nc_remove_key(&(SP_PARM->_keytry), ch)) {
+		code = _nc_add_to_try(&(SP_PARM->_key_ok), s, ch);
 		free(s);
 		count = 0;
 		if (code != OK)
@@ -74,5 +80,14 @@
 	    }
 	}
     }
+#endif
     returnCode(code);
 }
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+keyok(int c, bool flag)
+{
+    return NCURSES_SP_NAME(keyok) (CURRENT_SCREEN, c, flag);
+}
+#endif
diff -Naur ncurses-5.7.orig/ncurses/base/legacy_coding.c ncurses-5.7/ncurses/base/legacy_coding.c
--- ncurses-5.7.orig/ncurses/base/legacy_coding.c	2005-12-17 18:38:17.000000000 -0500
+++ ncurses-5.7/ncurses/base/legacy_coding.c	2011-01-08 18:13:50.555157600 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2005 Free Software Foundation, Inc.                        *
+ * Copyright (c) 2005,2009 Free 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,22 +27,31 @@
  ****************************************************************************/
 
 /****************************************************************************
- *  Author: Thomas E. Dickey                                                *
+ *  Author: Thomas E. Dickey          2005                                  *
+ *          Juergen Pfeifer           2009                                  *
  ****************************************************************************/
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: legacy_coding.c,v 1.2 2005/12/17 23:38:17 tom Exp $")
+MODULE_ID("$Id: legacy_coding.c,v 1.5 2009/10/24 22:15:00 tom Exp $")
 
 NCURSES_EXPORT(int)
-use_legacy_coding(int level)
+NCURSES_SP_NAME(use_legacy_coding) (NCURSES_SP_DCLx int level)
 {
     int result = ERR;
 
-    T((T_CALLED("use_legacy_coding(%d)"), level));
-    if (level >= 0 && level <= 2 && SP != 0) {
-	result = SP->_legacy_coding;
-	SP->_legacy_coding = level;
+    T((T_CALLED("use_legacy_coding(%p,%d)"), (void *) SP_PARM, level));
+    if (level >= 0 && level <= 2 && SP_PARM != 0) {
+	result = SP_PARM->_legacy_coding;
+	SP_PARM->_legacy_coding = level;
     }
     returnCode(result);
 }
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+use_legacy_coding(int level)
+{
+    return NCURSES_SP_NAME(use_legacy_coding) (CURRENT_SCREEN, level);
+}
+#endif
diff -Naur ncurses-5.7.orig/ncurses/base/lib_addch.c ncurses-5.7/ncurses/base/lib_addch.c
--- ncurses-5.7.orig/ncurses/base/lib_addch.c	2008-08-16 15:20:04.000000000 -0400
+++ ncurses-5.7/ncurses/base/lib_addch.c	2011-01-08 18:13:50.555157600 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2006,2008 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            *
@@ -36,7 +36,7 @@
 #include <curses.priv.h>
 #include <ctype.h>
 
-MODULE_ID("$Id: lib_addch.c,v 1.113 2008/08/16 19:20:04 tom Exp $")
+MODULE_ID("$Id: lib_addch.c,v 1.124 2010/04/24 22:41:05 tom Exp $")
 
 static const NCURSES_CH_T blankchar = NewChar(BLANK_TEXT);
 
@@ -77,12 +77,6 @@
 	    if ((pair = GET_WINDOW_PAIR(win)) == 0)
 		pair = GetPair(win->_nc_bkgd);
 	}
-#if 0
-	if (pair > 255) {
-	    NCURSES_CH_T fixme = ch;
-	    SetPair(fixme, pair);
-	}
-#endif
 	AddAttr(ch, (a & COLOR_MASK(AttrOf(ch))));
 	SetPair(ch, pair);
     }
@@ -131,7 +125,7 @@
 	*ypos = win->_regbottom;
 	result = TRUE;
     } else {
-	*ypos += 1;
+	*ypos = (NCURSES_SIZE_T) (*ypos + 1);
     }
     return result;
 }
@@ -176,8 +170,8 @@
 	if (waddch_literal(win, blank) == ERR)
 	    break;
     }
-    win->_curx = save_x;
-    win->_cury = save_y;
+    win->_curx = (NCURSES_SIZE_T) save_x;
+    win->_cury = (NCURSES_SIZE_T) save_y;
 }
 #endif
 
@@ -213,9 +207,9 @@
     buffer[WINDOW_EXT(win, addch_used)] = (char) CharOf(CHDEREF(ch));
     WINDOW_EXT(win, addch_used) += 1;
     buffer[WINDOW_EXT(win, addch_used)] = '\0';
-    if ((len = mbrtowc(&result,
-		       buffer,
-		       WINDOW_EXT(win, addch_used), &state)) > 0) {
+    if ((len = (int) mbrtowc(&result,
+			     buffer,
+			     WINDOW_EXT(win, addch_used), &state)) > 0) {
 	attr_t attrs = AttrOf(CHDEREF(ch));
 	if_EXT_COLORS(int pair = GetPair(CHDEREF(ch)));
 	SetChar(CHDEREF(ch), result, attrs);
@@ -260,20 +254,37 @@
     /*
      * Build up multibyte characters until we have a wide-character.
      */
+#if NCURSES_SP_FUNCS
+#define DeriveSP() SCREEN *sp = _nc_screen_of(win);
+#else
+#define DeriveSP()		/*nothing */
+#endif
     if_WIDEC({
+	DeriveSP();
 	if (WINDOW_EXT(win, addch_used) != 0 || !Charable(ch)) {
 	    int len = _nc_build_wch(win, CHREF(ch));
 
 	    if (len >= -1) {
-		/* handle EILSEQ */
-		if (is8bits(CharOf(ch))) {
-		    const char *s = unctrl((chtype) CharOf(ch));
-		    if (s[1] != 0) {
-			return waddstr(win, s);
+		attr_t attr = AttrOf(ch);
+
+		/* handle EILSEQ (i.e., when len >= -1) */
+		if (len == -1 && is8bits(CharOf(ch))) {
+		    int rc = OK;
+		    const char *s = NCURSES_SP_NAME(unctrl)
+		      (NCURSES_SP_ARGx (chtype) CharOf(ch));
+
+		    if (s[1] != '\0') {
+			while (*s != '\0') {
+			    rc = waddch(win, UChar(*s) | attr);
+			    if (rc != OK)
+				break;
+			    ++s;
+			}
+			return rc;
 		    }
 		}
 		if (len == -1)
-		    return waddch(win, ' ');
+		    return waddch(win, ' ' | attr);
 	    } else {
 		return OK;
 	    }
@@ -327,6 +338,7 @@
 		    return ERR;
 		x = win->_curx;
 		y = win->_cury;
+		line = win->_line + y;
 	    }
 	    /*
 	     * Check for cells which are orphaned by adding this character, set
@@ -384,7 +396,7 @@
     if (x > win->_maxx) {
 	return wrap_to_next_line(win);
     }
-    win->_curx = x;
+    win->_curx = (NCURSES_SIZE_T) x;
     return OK;
 }
 
@@ -393,9 +405,12 @@
 /* the workhorse function -- add a character to the given window */
 {
     NCURSES_SIZE_T x, y;
-    chtype t = CharOf(ch);
-    const char *s = unctrl(t);
-
+    chtype t = (chtype) CharOf(ch);
+#if USE_WIDEC_SUPPORT || NCURSES_SP_FUNCS || USE_REENTRANT
+    SCREEN *sp = _nc_screen_of(win);
+#endif
+    const char *s = NCURSES_SP_NAME(unctrl) (NCURSES_SP_ARGx t);
+    int tabsize = 8;
     /*
      * If we are using the alternate character set, forget about locale.
      * Otherwise, if unctrl() returns a single-character or the locale
@@ -404,14 +419,14 @@
     if ((AttrOf(ch) & A_ALTCHARSET)
 	|| (
 #if USE_WIDEC_SUPPORT
-	       (SP != 0 && SP->_legacy_coding) &&
+	       (sp != 0 && sp->_legacy_coding) &&
 #endif
 	       s[1] == 0
 	)
 	|| (
 	       isprint(t)
 #if USE_WIDEC_SUPPORT
-	       || ((SP == 0 || !SP->_legacy_coding) &&
+	       || ((sp == 0 || !sp->_legacy_coding) &&
 		   (WINDOW_EXT(win, addch_used)
 		    || !_nc_is_charable(CharOf(ch))))
 #endif
@@ -427,8 +442,12 @@
 
     switch (t) {
     case '\t':
-	x += (TABSIZE - (x % TABSIZE));
-
+#if USE_REENTRANT
+	tabsize = *ptrTabsize(sp);
+#else
+	tabsize = TABSIZE;
+#endif
+	x = (NCURSES_SIZE_T) (x + (tabsize - (x % tabsize)));
 	/*
 	 * Space-fill the tab on the bottom line so that we'll get the
 	 * "correct" cursor position.
@@ -514,7 +533,7 @@
     NCURSES_CH_T wch;
     SetChar2(wch, ch);
 
-    TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_CALLED("waddch(%p, %s)"), win,
+    TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_CALLED("waddch(%p, %s)"), (void *) win,
 				      _tracechtype(ch)));
 
     if (win && (waddch_nosync(win, wch) != ERR)) {
@@ -533,7 +552,8 @@
     NCURSES_CH_T wch;
     SetChar2(wch, ch);
 
-    TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_CALLED("wechochar(%p, %s)"), win,
+    TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_CALLED("wechochar(%p, %s)"),
+				      (void *) win,
 				      _tracechtype(ch)));
 
     if (win && (waddch_nosync(win, wch) != ERR)) {
diff -Naur ncurses-5.7.orig/ncurses/base/lib_addstr.c ncurses-5.7/ncurses/base/lib_addstr.c
--- ncurses-5.7.orig/ncurses/base/lib_addstr.c	2007-10-13 15:56:57.000000000 -0400
+++ ncurses-5.7/ncurses/base/lib_addstr.c	2011-01-08 18:18:29.746780939 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2006,2007 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            *
@@ -44,7 +44,7 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_addstr.c,v 1.48 2007/10/13 19:56:57 tom Exp $")
+MODULE_ID("$Id: lib_addstr.c,v 1.51 2010/12/19 01:22:58 tom Exp $")
 
 NCURSES_EXPORT(int)
 waddnstr(WINDOW *win, const char *astr, int n)
@@ -52,7 +52,7 @@
     const char *str = astr;
     int code = ERR;
 
-    T((T_CALLED("waddnstr(%p,%s,%d)"), win, _nc_visbufn(astr, n), n));
+    T((T_CALLED("waddnstr(%p,%s,%d)"), (void *) win, _nc_visbufn(astr, n), n));
 
     if (win && (str != 0)) {
 	TR(TRACE_VIRTPUT | TRACE_ATTRS,
@@ -85,7 +85,7 @@
     int i;
     struct ldat *line;
 
-    T((T_CALLED("waddchnstr(%p,%p,%d)"), win, astr, n));
+    T((T_CALLED("waddchnstr(%p,%p,%d)"), (void *) win, (const void *) astr, n));
 
     if (!win)
 	returnCode(ERR);
@@ -107,7 +107,7 @@
     for (i = 0; i < n && ChCharOf(astr[i]) != '\0'; ++i) {
 	SetChar2(line->text[i + x], astr[i]);
     }
-    CHANGED_RANGE(line, x, x + n - 1);
+    CHANGED_RANGE(line, x, (NCURSES_SIZE_T) (x + n - 1));
 
     _nc_synchook(win);
     returnCode(code);
@@ -135,7 +135,10 @@
     struct ldat *line;
     int i, j, start, len, end;
 
-    T((T_CALLED("wadd_wchnstr(%p,%s,%d)"), win, _nc_viscbuf(astr, n), n));
+    T((T_CALLED("wadd_wchnstr(%p,%s,%d)"),
+       (void *) win,
+       _nc_viscbuf(astr, n),
+       n));
 
     if (!win)
 	returnCode(ERR);
@@ -190,7 +193,7 @@
 		    SetWidecExt(line->text[x + j], j);
 		}
 	    }
-	    x += len;
+	    x = (NCURSES_SIZE_T) (x + len);
 	    end += len - 1;
 	} else {
 	    break;
@@ -217,7 +220,7 @@
 {
     int code = ERR;
 
-    T((T_CALLED("waddnwstr(%p,%s,%d)"), win, _nc_viswbufn(str, n), n));
+    T((T_CALLED("waddnwstr(%p,%s,%d)"), (void *) win, _nc_viswbufn(str, n), n));
 
     if (win && (str != 0)) {
 	TR(TRACE_VIRTPUT | TRACE_ATTRS,
diff -Naur ncurses-5.7.orig/ncurses/base/lib_beep.c ncurses-5.7/ncurses/base/lib_beep.c
--- ncurses-5.7.orig/ncurses/base/lib_beep.c	2005-04-09 11:20:04.000000000 -0400
+++ ncurses-5.7/ncurses/base/lib_beep.c	2011-01-08 18:13:50.555157600 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -30,6 +30,7 @@
  *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995               *
  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
  *     and: Thomas E. Dickey                        1996-on                 *
+ *     and: Juergen Pfeifer                         2009                    *
  ****************************************************************************/
 
 /*
@@ -40,9 +41,12 @@
  */
 
 #include <curses.priv.h>
-#include <term.h>		/* beep, flash */
 
-MODULE_ID("$Id: lib_beep.c,v 1.10 2005/04/09 15:20:04 tom Exp $")
+#ifndef CUR
+#define CUR SP_TERMTYPE
+#endif
+
+MODULE_ID("$Id: lib_beep.c,v 1.15 2009/10/24 22:02:14 tom Exp $")
 
 /*
  *	beep()
@@ -53,12 +57,16 @@
  */
 
 NCURSES_EXPORT(int)
-beep(void)
+NCURSES_SP_NAME(beep) (NCURSES_SP_DCL0)
 {
     int res = ERR;
 
-    T((T_CALLED("beep()")));
+    T((T_CALLED("beep(%p)"), (void *) SP_PARM));
 
+#ifdef USE_TERM_DRIVER
+    if (SP_PARM != 0)
+	res = CallDriver_1(SP_PARM, doBeepOrFlash, TRUE);
+#else
     /* FIXME: should make sure that we are not in altchar mode */
     if (cur_term == 0) {
 	res = ERR;
@@ -71,6 +79,15 @@
 	res = putp(flash_screen);
 	_nc_flush();
     }
+#endif
 
     returnCode(res);
 }
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+beep(void)
+{
+    return NCURSES_SP_NAME(beep) (CURRENT_SCREEN);
+}
+#endif
diff -Naur ncurses-5.7.orig/ncurses/base/lib_bkgd.c ncurses-5.7/ncurses/base/lib_bkgd.c
--- ncurses-5.7.orig/ncurses/base/lib_bkgd.c	2008-03-22 20:09:14.000000000 -0400
+++ ncurses-5.7/ncurses/base/lib_bkgd.c	2011-01-08 18:18:29.814782179 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2006,2008 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            *
@@ -36,7 +36,7 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_bkgd.c,v 1.36 2008/03/23 00:09:14 tom Exp $")
+MODULE_ID("$Id: lib_bkgd.c,v 1.42 2011/01/01 17:18:52 tom Exp $")
 
 /*
  * Set the window's background information.
@@ -48,7 +48,7 @@
 #endif
 wbkgrndset(WINDOW *win, const ARG_CH_T ch)
 {
-    T((T_CALLED("wbkgdset(%p,%s)"), win, _tracech_t(ch)));
+    T((T_CALLED("wbkgdset(%p,%s)"), (void *) win, _tracech_t(ch)));
 
     if (win) {
 	attr_t off = AttrOf(win->_nc_bkgd);
@@ -85,12 +85,12 @@
 	    cchar_t wch;
 	    int tmp;
 
-	    wgetbkgrnd(win, &wch);
+	    (void) wgetbkgrnd(win, &wch);
 	    tmp = _nc_to_char((wint_t) CharOf(wch));
 
 	    win->_bkgd = (((tmp == EOF) ? ' ' : (chtype) tmp)
 			  | (AttrOf(wch) & ALL_BUT_COLOR)
-			  | COLOR_PAIR(GET_WINDOW_PAIR(win)));
+			  | (chtype) ColorPair(GET_WINDOW_PAIR(win)));
 	}
 #endif
     }
@@ -120,14 +120,14 @@
     int x, y;
     NCURSES_CH_T new_bkgd = CHDEREF(ch);
 
-    T((T_CALLED("wbkgd(%p,%s)"), win, _tracech_t(ch)));
+    T((T_CALLED("wbkgd(%p,%s)"), (void *) win, _tracech_t(ch)));
 
     if (win) {
 	NCURSES_CH_T old_bkgrnd;
 	wgetbkgrnd(win, &old_bkgrnd);
 
-	wbkgrndset(win, CHREF(new_bkgd));
-	wattrset(win, AttrOf(win->_nc_bkgd));
+	(void) wbkgrndset(win, CHREF(new_bkgd));
+	(void) wattrset(win, AttrOf(win->_nc_bkgd));
 
 	for (y = 0; y <= win->_maxy; y++) {
 	    for (x = 0; x <= win->_maxx; x++) {
diff -Naur ncurses-5.7.orig/ncurses/base/lib_box.c ncurses-5.7/ncurses/base/lib_box.c
--- ncurses-5.7.orig/ncurses/base/lib_box.c	2005-11-26 10:39:42.000000000 -0500
+++ ncurses-5.7/ncurses/base/lib_box.c	2011-01-08 18:13:50.555157600 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2002,2005 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            *
@@ -42,7 +42,7 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_box.c,v 1.22 2005/11/26 15:39:42 tom Exp $")
+MODULE_ID("$Id: lib_box.c,v 1.24 2010/04/24 23:51:57 tom Exp $")
 
 #if USE_WIDEC_SUPPORT
 static NCURSES_INLINE chtype
@@ -51,8 +51,9 @@
     NCURSES_CH_T wch;
     SetChar2(wch, ch);
     wch = _nc_render(win, wch);
-    return CharOf(wch) | AttrOf(wch);
+    return ((attr_t) CharOf(wch)) | AttrOf(wch);
 }
+
 #define RENDER_WITH_DEFAULT(ch,def) w ## ch = _my_render(win, (ch == 0) ? def : ch)
 #else
 #define RENDER_WITH_DEFAULT(ch,def) w ## ch = _nc_render(win, (ch == 0) ? def : ch)
@@ -70,7 +71,7 @@
     chtype wls, wrs, wts, wbs, wtl, wtr, wbl, wbr;
 
     T((T_CALLED("wborder(%p,%s,%s,%s,%s,%s,%s,%s,%s)"),
-       win,
+       (void *) win,
        _tracechtype2(1, ls),
        _tracechtype2(2, rs),
        _tracechtype2(3, ts),
diff -Naur ncurses-5.7.orig/ncurses/base/lib_chgat.c ncurses-5.7/ncurses/base/lib_chgat.c
--- ncurses-5.7.orig/ncurses/base/lib_chgat.c	2006-07-15 18:07:11.000000000 -0400
+++ ncurses-5.7/ncurses/base/lib_chgat.c	2011-01-08 18:13:50.559157414 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2005,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            *
@@ -42,19 +42,19 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_chgat.c,v 1.7 2006/07/15 22:07:11 tom Exp $")
+MODULE_ID("$Id: lib_chgat.c,v 1.9 2010/03/31 23:38:02 tom Exp $")
 
 NCURSES_EXPORT(int)
 wchgat(WINDOW *win, int n, attr_t attr, short color, const void *opts GCC_UNUSED)
 {
     int i;
 
-    T((T_CALLED("wchgat(%p,%d,%s,%d)"), win, n, _traceattr(attr), color));
+    T((T_CALLED("wchgat(%p,%d,%s,%d)"), (void *) win, n, _traceattr(attr), color));
 
     if (win) {
 	struct ldat *line = &(win->_line[win->_cury]);
 
-	toggle_attr_on(attr, COLOR_PAIR(color));
+	toggle_attr_on(attr, ColorPair(color));
 
 	for (i = win->_curx; i <= win->_maxx && (n == -1 || (n-- > 0)); i++) {
 	    SetAttr(line->text[i], attr);
diff -Naur ncurses-5.7.orig/ncurses/base/lib_clear.c ncurses-5.7/ncurses/base/lib_clear.c
--- ncurses-5.7.orig/ncurses/base/lib_clear.c	2000-12-09 21:43:26.000000000 -0500
+++ ncurses-5.7/ncurses/base/lib_clear.c	2011-01-08 18:13:50.563157403 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998,2000 Free Software Foundation, Inc.                   *
+ * Copyright (c) 1998-2000,2009 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -40,14 +40,14 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_clear.c,v 1.7 2000/12/10 02:43:26 tom Exp $")
+MODULE_ID("$Id: lib_clear.c,v 1.8 2009/10/24 22:33:29 tom Exp $")
 
 NCURSES_EXPORT(int)
 wclear(WINDOW *win)
 {
     int code = ERR;
 
-    T((T_CALLED("wclear(%p)"), win));
+    T((T_CALLED("wclear(%p)"), (void *) win));
 
     if ((code = werase(win)) != ERR)
 	win->_clear = TRUE;
diff -Naur ncurses-5.7.orig/ncurses/base/lib_clearok.c ncurses-5.7/ncurses/base/lib_clearok.c
--- ncurses-5.7.orig/ncurses/base/lib_clearok.c	2000-12-09 21:43:26.000000000 -0500
+++ ncurses-5.7/ncurses/base/lib_clearok.c	2011-01-08 18:13:50.563157403 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998,2000 Free Software Foundation, Inc.                   *
+ * Copyright (c) 1998-2000,2009 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -40,12 +40,12 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_clearok.c,v 1.4 2000/12/10 02:43:26 tom Exp $")
+MODULE_ID("$Id: lib_clearok.c,v 1.5 2009/10/24 22:34:53 tom Exp $")
 
 NCURSES_EXPORT(int)
 clearok(WINDOW *win, bool flag)
 {
-    T((T_CALLED("clearok(%p,%d)"), win, flag));
+    T((T_CALLED("clearok(%p,%d)"), (void *) win, flag));
 
     if (win) {
 	win->_clear = flag;
diff -Naur ncurses-5.7.orig/ncurses/base/lib_clrbot.c ncurses-5.7/ncurses/base/lib_clrbot.c
--- ncurses-5.7.orig/ncurses/base/lib_clrbot.c	2006-10-14 16:43:31.000000000 -0400
+++ ncurses-5.7/ncurses/base/lib_clrbot.c	2011-01-08 18:13:50.563157403 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2001,2006 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2006,2009 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -40,14 +40,14 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_clrbot.c,v 1.20 2006/10/14 20:43:31 tom Exp $")
+MODULE_ID("$Id: lib_clrbot.c,v 1.21 2009/10/24 22:33:19 tom Exp $")
 
 NCURSES_EXPORT(int)
 wclrtobot(WINDOW *win)
 {
     int code = ERR;
 
-    T((T_CALLED("wclrtobot(%p)"), win));
+    T((T_CALLED("wclrtobot(%p)"), (void *) win));
 
     if (win) {
 	NCURSES_SIZE_T y;
diff -Naur ncurses-5.7.orig/ncurses/base/lib_clreol.c ncurses-5.7/ncurses/base/lib_clreol.c
--- ncurses-5.7.orig/ncurses/base/lib_clreol.c	2001-12-18 20:06:04.000000000 -0500
+++ ncurses-5.7/ncurses/base/lib_clreol.c	2011-01-08 18:13:50.563157403 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998,1999,2000,2001 Free Software Foundation, Inc.         *
+ * Copyright (c) 1998-2001,2009 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -40,14 +40,14 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_clreol.c,v 1.21 2001/12/19 01:06:04 tom Exp $")
+MODULE_ID("$Id: lib_clreol.c,v 1.22 2009/10/24 22:33:06 tom Exp $")
 
 NCURSES_EXPORT(int)
 wclrtoeol(WINDOW *win)
 {
     int code = ERR;
 
-    T((T_CALLED("wclrtoeol(%p)"), win));
+    T((T_CALLED("wclrtoeol(%p)"), (void *) win));
 
     if (win) {
 	NCURSES_CH_T blank;
diff -Naur ncurses-5.7.orig/ncurses/base/lib_color.c ncurses-5.7/ncurses/base/lib_color.c
--- ncurses-5.7.orig/ncurses/base/lib_color.c	2007-04-07 13:07:28.000000000 -0400
+++ ncurses-5.7/ncurses/base/lib_color.c	2011-01-08 18:13:50.567157407 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2006,2007 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            *
@@ -30,6 +30,7 @@
  *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995               *
  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
  *     and: Thomas E. Dickey                        1996-on                 *
+ *     and: Juergen Pfeifer                         2009                    *
  ****************************************************************************/
 
 /* lib_color.c
@@ -38,12 +39,33 @@
  */
 
 #include <curses.priv.h>
-
-#include <term.h>
 #include <tic.h>
 
-MODULE_ID("$Id: lib_color.c,v 1.85 2007/04/07 17:07:28 tom Exp $")
+#ifndef CUR
+#define CUR SP_TERMTYPE
+#endif
+
+MODULE_ID("$Id: lib_color.c,v 1.98 2010/04/24 22:57:53 tom Exp $")
+
+#ifdef USE_TERM_DRIVER
+#define CanChange      InfoOf(SP_PARM).canchange
+#define DefaultPalette InfoOf(SP_PARM).defaultPalette
+#define HasColor       InfoOf(SP_PARM).hascolor
+#define InitColor      InfoOf(SP_PARM).initcolor
+#define MaxColors      InfoOf(SP_PARM).maxcolors
+#define MaxPairs       InfoOf(SP_PARM).maxpairs
+#define UseHlsPalette  (DefaultPalette == _nc_hls_palette)
+#else
+#define CanChange      can_change
+#define DefaultPalette (hue_lightness_saturation ? hls_palette : cga_palette)
+#define HasColor       has_color
+#define InitColor      initialize_color
+#define MaxColors      max_colors
+#define MaxPairs       max_pairs
+#define UseHlsPalette  (hue_lightness_saturation)
+#endif
 
+#ifndef USE_TERM_DRIVER
 /*
  * These should be screen structure members.  They need to be globals for
  * historical reasons.  So we assign them in start_color() and also in
@@ -64,6 +86,7 @@
 NCURSES_EXPORT_VAR(int) COLOR_PAIRS = 0;
 NCURSES_EXPORT_VAR(int) COLORS = 0;
 #endif
+#endif /* !USE_TERM_DRIVER */
 
 #define DATA(r,g,b) {r,g,b, 0,0,0, 0}
 
@@ -71,7 +94,7 @@
 
 #define MAX_PALETTE	8
 
-#define OkColorHi(n)	(((n) < COLORS) && ((n) < max_colors))
+#define OkColorHi(n)	(((n) < COLORS) && ((n) < maxcolors))
 #define InPalette(n)	((n) >= 0 && (n) < MAX_PALETTE)
 
 /*
@@ -106,29 +129,43 @@
     DATA(	300,	50,	100),		/* COLOR_CYAN */
     DATA(	0,	50,	100),		/* COLOR_WHITE */
 };
+
+#ifdef USE_TERM_DRIVER
+NCURSES_EXPORT_VAR(const color_t*) _nc_cga_palette = cga_palette;
+NCURSES_EXPORT_VAR(const color_t*) _nc_hls_palette = hls_palette;
+#endif
+
 /* *INDENT-ON* */
 
+/*
+ * Ensure that we use color pairs only when colors have been started, and also
+ * that the index is within the limits of the table which we allocated.
+ */
+#define ValidPair(pair) \
+    ((SP_PARM != 0) && (pair >= 0) && (pair < SP_PARM->_pair_limit) && SP_PARM->_coloron)
+
 #if NCURSES_EXT_FUNCS
 /*
  * These are called from _nc_do_color(), which in turn is called from
- * vidattr - so we have to assume that SP may be null.
+ * vidattr - so we have to assume that sp may be null.
  */
 static int
-default_fg(void)
+default_fg(NCURSES_SP_DCL0)
 {
-    return (SP != 0) ? SP->_default_fg : COLOR_WHITE;
+    return (SP_PARM != 0) ? SP_PARM->_default_fg : COLOR_WHITE;
 }
 
 static int
-default_bg(void)
+default_bg(NCURSES_SP_DCL0)
 {
-    return SP != 0 ? SP->_default_bg : COLOR_BLACK;
+    return SP_PARM != 0 ? SP_PARM->_default_bg : COLOR_BLACK;
 }
 #else
-#define default_fg() COLOR_WHITE
-#define default_bg() COLOR_BLACK
+#define default_fg(sp) COLOR_WHITE
+#define default_bg(sp) COLOR_BLACK
 #endif
 
+#ifndef USE_TERM_DRIVER
 /*
  * SVr4 curses is known to interchange color codes (1,4) and (3,6), possibly
  * to maintain compatibility with a pre-ANSI scheme.  The same scheme is
@@ -145,52 +182,70 @@
     }
     return c;
 }
+#endif
 
 static void
-set_background_color(int bg, int (*outc) (int))
+set_background_color(NCURSES_SP_DCLx int bg, NCURSES_SP_OUTC outc)
 {
+#ifdef USE_TERM_DRIVER
+    CallDriver_3(SP_PARM, color, FALSE, bg, outc);
+#else
     if (set_a_background) {
 	TPUTS_TRACE("set_a_background");
-	tputs(TPARM_1(set_a_background, bg), 1, outc);
+	NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx
+				TPARM_1(set_a_background, bg),
+				1, outc);
     } else {
 	TPUTS_TRACE("set_background");
-	tputs(TPARM_1(set_background, toggled_colors(bg)), 1, outc);
+	NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx
+				TPARM_1(set_background, toggled_colors(bg)),
+				1, outc);
     }
+#endif
 }
 
 static void
-set_foreground_color(int fg, int (*outc) (int))
+set_foreground_color(NCURSES_SP_DCLx int fg, NCURSES_SP_OUTC outc)
 {
+#ifdef USE_TERM_DRIVER
+    CallDriver_3(SP_PARM, color, TRUE, fg, outc);
+#else
     if (set_a_foreground) {
 	TPUTS_TRACE("set_a_foreground");
-	tputs(TPARM_1(set_a_foreground, fg), 1, outc);
+	NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx
+				TPARM_1(set_a_foreground, fg),
+				1, outc);
     } else {
 	TPUTS_TRACE("set_foreground");
-	tputs(TPARM_1(set_foreground, toggled_colors(fg)), 1, outc);
+	NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx
+				TPARM_1(set_foreground, toggled_colors(fg)),
+				1, outc);
     }
+#endif
 }
 
 static void
-init_color_table(void)
+init_color_table(NCURSES_SP_DCL0)
 {
-    const color_t *tp;
+    const color_t *tp = DefaultPalette;
     int n;
 
-    tp = (hue_lightness_saturation) ? hls_palette : cga_palette;
+    assert(tp != 0);
+
     for (n = 0; n < COLORS; n++) {
 	if (InPalette(n)) {
-	    SP->_color_table[n] = tp[n];
+	    SP_PARM->_color_table[n] = tp[n];
 	} else {
-	    SP->_color_table[n] = tp[n % MAX_PALETTE];
-	    if (hue_lightness_saturation) {
-		SP->_color_table[n].green = 100;
+	    SP_PARM->_color_table[n] = tp[n % MAX_PALETTE];
+	    if (UseHlsPalette) {
+		SP_PARM->_color_table[n].green = 100;
 	    } else {
-		if (SP->_color_table[n].red)
-		    SP->_color_table[n].red = 1000;
-		if (SP->_color_table[n].green)
-		    SP->_color_table[n].green = 1000;
-		if (SP->_color_table[n].blue)
-		    SP->_color_table[n].blue = 1000;
+		if (SP_PARM->_color_table[n].red)
+		    SP_PARM->_color_table[n].red = 1000;
+		if (SP_PARM->_color_table[n].green)
+		    SP_PARM->_color_table[n].green = 1000;
+		if (SP_PARM->_color_table[n].blue)
+		    SP_PARM->_color_table[n].blue = 1000;
 	    }
 	}
     }
@@ -200,16 +255,21 @@
  * Reset the color pair, e.g., to whatever color pair 0 is.
  */
 static bool
-reset_color_pair(void)
+reset_color_pair(NCURSES_SP_DCL0)
 {
+#ifdef USE_TERM_DRIVER
+    return CallDriver(SP_PARM, rescol);
+#else
     bool result = FALSE;
 
+    (void) SP_PARM;
     if (orig_pair != 0) {
 	TPUTS_TRACE("orig_pair");
 	putp(orig_pair);
 	result = TRUE;
     }
     return result;
+#endif
 }
 
 /*
@@ -217,65 +277,93 @@
  * badly-written terminal descriptions than for the relatively rare case where
  * someone has changed the color definitions.
  */
-bool
-_nc_reset_colors(void)
+NCURSES_EXPORT(bool)
+NCURSES_SP_NAME(_nc_reset_colors) (NCURSES_SP_DCL0)
 {
     int result = FALSE;
 
-    T((T_CALLED("_nc_reset_colors()")));
-    if (SP->_color_defs > 0)
-	SP->_color_defs = -(SP->_color_defs);
-
-    if (reset_color_pair())
+    T((T_CALLED("_nc_reset_colors(%p)"), (void *) SP_PARM));
+    if (SP_PARM->_color_defs > 0)
+	SP_PARM->_color_defs = -(SP_PARM->_color_defs);
+    if (reset_color_pair(NCURSES_SP_ARG))
 	result = TRUE;
+
+#ifdef USE_TERM_DRIVER
+    result = CallDriver(SP_PARM, rescolors);
+#else
     if (orig_colors != 0) {
 	TPUTS_TRACE("orig_colors");
 	putp(orig_colors);
 	result = TRUE;
     }
+#endif
     returnBool(result);
 }
 
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(bool)
+_nc_reset_colors(void)
+{
+    return NCURSES_SP_NAME(_nc_reset_colors) (CURRENT_SCREEN);
+}
+#endif
+
 NCURSES_EXPORT(int)
-start_color(void)
+NCURSES_SP_NAME(start_color) (NCURSES_SP_DCL0)
 {
     int result = ERR;
+    int maxpairs = 0, maxcolors = 0;
 
-    T((T_CALLED("start_color()")));
+    T((T_CALLED("start_color(%p)"), (void *) SP_PARM));
 
-    if (SP == 0) {
+    if (SP_PARM == 0) {
 	result = ERR;
-    } else if (SP->_coloron) {
+    } else if (SP_PARM->_coloron) {
 	result = OK;
     } else {
-
-	if (reset_color_pair() != TRUE) {
-	    set_foreground_color(default_fg(), _nc_outch);
-	    set_background_color(default_bg(), _nc_outch);
+	maxpairs = MaxPairs;
+	maxcolors = MaxColors;
+	if (reset_color_pair(NCURSES_SP_ARG) != TRUE) {
+	    set_foreground_color(NCURSES_SP_ARGx
+				 default_fg(NCURSES_SP_ARG),
+				 NCURSES_SP_NAME(_nc_outch));
+	    set_background_color(NCURSES_SP_ARGx
+				 default_bg(NCURSES_SP_ARG),
+				 NCURSES_SP_NAME(_nc_outch));
 	}
 
-	if (max_pairs > 0 && max_colors > 0) {
-	    SP->_pair_count = max_pairs;
-	    SP->_color_count = max_colors;
+	if (maxpairs > 0 && maxcolors > 0) {
+	    SP_PARM->_pair_limit = maxpairs;
+
+#if NCURSES_EXT_FUNCS
+	    /*
+	     * If using default colors, allocate extra space in table to
+	     * allow for default-color as a component of a color-pair.
+	     */
+	    SP_PARM->_pair_limit += (1 + (2 * maxcolors));
+#endif
+	    SP_PARM->_pair_count = maxpairs;
+	    SP_PARM->_color_count = maxcolors;
 #if !USE_REENTRANT
-	    COLOR_PAIRS = max_pairs;
-	    COLORS = max_colors;
+	    COLOR_PAIRS = maxpairs;
+	    COLORS = maxcolors;
 #endif
 
-	    if ((SP->_color_pairs = TYPE_CALLOC(colorpair_t,
-						max_pairs)) != 0) {
-		if ((SP->_color_table = TYPE_CALLOC(color_t,
-						    max_colors)) != 0) {
-		    SP->_color_pairs[0] = PAIR_OF(default_fg(), default_bg());
-		    init_color_table();
+	    SP_PARM->_color_pairs = TYPE_CALLOC(colorpair_t, SP_PARM->_pair_limit);
+	    if (SP_PARM->_color_pairs != 0) {
+		SP_PARM->_color_table = TYPE_CALLOC(color_t, maxcolors);
+		if (SP_PARM->_color_table != 0) {
+		    SP_PARM->_color_pairs[0] = PAIR_OF(default_fg(NCURSES_SP_ARG),
+						       default_bg(NCURSES_SP_ARG));
+		    init_color_table(NCURSES_SP_ARG);
 
 		    T(("started color: COLORS = %d, COLOR_PAIRS = %d",
 		       COLORS, COLOR_PAIRS));
 
-		    SP->_coloron = 1;
+		    SP_PARM->_coloron = 1;
 		    result = OK;
-		} else if (SP->_color_pairs != 0) {
-		    FreeAndNull(SP->_color_pairs);
+		} else if (SP_PARM->_color_pairs != 0) {
+		    FreeAndNull(SP_PARM->_color_pairs);
 		}
 	    }
 	} else {
@@ -285,6 +373,14 @@
     returnCode(result);
 }
 
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+start_color(void)
+{
+    return NCURSES_SP_NAME(start_color) (CURRENT_SCREEN);
+}
+#endif
+
 /* This function was originally written by Daniel Weaver <danw@znyx.com> */
 static void
 rgb2hls(short r, short g, short b, short *h, short *l, short *s)
@@ -298,7 +394,7 @@
 	max = b;
 
     /* calculate lightness */
-    *l = (min + max) / 20;
+    *l = (short) ((min + max) / 20);
 
     if (min == max) {		/* black, white and all shades of gray */
 	*h = 0;
@@ -308,17 +404,17 @@
 
     /* calculate saturation */
     if (*l < 50)
-	*s = ((max - min) * 100) / (max + min);
+	*s = (short) (((max - min) * 100) / (max + min));
     else
-	*s = ((max - min) * 100) / (2000 - max - min);
+	*s = (short) (((max - min) * 100) / (2000 - max - min));
 
     /* calculate hue */
     if (r == max)
-	t = 120 + ((g - b) * 60) / (max - min);
+	t = (short) (120 + ((g - b) * 60) / (max - min));
     else if (g == max)
-	t = 240 + ((b - r) * 60) / (max - min);
+	t = (short) (240 + ((b - r) * 60) / (max - min));
     else
-	t = 360 + ((r - g) * 60) / (max - min);
+	t = (short) (360 + ((r - g) * 60) / (max - min));
 
     *h = t % 360;
 }
@@ -328,24 +424,75 @@
  * values.
  */
 NCURSES_EXPORT(int)
-init_pair(short pair, short f, short b)
+NCURSES_SP_NAME(init_pair) (NCURSES_SP_DCLx short pair, short f, short b)
 {
     colorpair_t result;
+    colorpair_t previous;
+    int maxcolors;
 
-    T((T_CALLED("init_pair(%d,%d,%d)"), pair, f, b));
+    T((T_CALLED("init_pair(%p,%d,%d,%d)"), (void *) SP_PARM, pair, f, b));
 
-    if ((pair < 0) || (pair >= COLOR_PAIRS) || SP == 0 || !SP->_coloron)
+    if (!ValidPair(pair))
 	returnCode(ERR);
+
+    maxcolors = MaxColors;
+
+    previous = SP_PARM->_color_pairs[pair];
 #if NCURSES_EXT_FUNCS
-    if (SP->_default_color) {
-	if (f < 0)
+    if (SP_PARM->_default_color) {
+	bool isDefault = FALSE;
+	bool wasDefault = FALSE;
+	int default_pairs = SP_PARM->_default_pairs;
+
+	/*
+	 * Map caller's color number, e.g., -1, 0, 1, .., 7, etc., into
+	 * internal unsigned values which we will store in the _color_pairs[]
+	 * table.
+	 */
+	if (isDefaultColor(f)) {
 	    f = COLOR_DEFAULT;
-	if (b < 0)
+	    isDefault = TRUE;
+	} else if (!OkColorHi(f)) {
+	    returnCode(ERR);
+	}
+
+	if (isDefaultColor(b)) {
 	    b = COLOR_DEFAULT;
-	if (!OkColorHi(f) && !isDefaultColor(f))
+	    isDefault = TRUE;
+	} else if (!OkColorHi(b)) {
 	    returnCode(ERR);
-	if (!OkColorHi(b) && !isDefaultColor(b))
+	}
+
+	/*
+	 * Check if the table entry that we are going to init/update used
+	 * default colors.
+	 */
+	if ((FORE_OF(previous) == COLOR_DEFAULT)
+	    || (BACK_OF(previous) == COLOR_DEFAULT))
+	    wasDefault = TRUE;
+
+	/*
+	 * Keep track of the number of entries in the color pair table which
+	 * used a default color.
+	 */
+	if (isDefault && !wasDefault) {
+	    ++default_pairs;
+	} else if (wasDefault && !isDefault) {
+	    --default_pairs;
+	}
+
+	/*
+	 * As an extension, ncurses allows the pair number to exceed the
+	 * terminal's color_pairs value for pairs using a default color.
+	 *
+	 * Note that updating a pair which used a default color with one
+	 * that does not will decrement the count - and possibly interfere
+	 * with sequentially adding new pairs.
+	 */
+	if (pair > (SP_PARM->_pair_count + default_pairs)) {
 	    returnCode(ERR);
+	}
+	SP_PARM->_default_pairs = default_pairs;
     } else
 #endif
     {
@@ -361,14 +508,14 @@
      * pair colors with the new ones).
      */
     result = PAIR_OF(f, b);
-    if (SP->_color_pairs[pair] != 0
-	&& SP->_color_pairs[pair] != result) {
+    if (previous != 0
+	&& previous != result) {
 	int y, x;
 
-	for (y = 0; y <= curscr->_maxy; y++) {
-	    struct ldat *ptr = &(curscr->_line[y]);
+	for (y = 0; y <= CurScreen(SP_PARM)->_maxy; y++) {
+	    struct ldat *ptr = &(CurScreen(SP_PARM)->_line[y]);
 	    bool changed = FALSE;
-	    for (x = 0; x <= curscr->_maxx; x++) {
+	    for (x = 0; x <= CurScreen(SP_PARM)->_maxx; x++) {
 		if (GetPair(ptr->text[x]) == pair) {
 		    /* Set the old cell to zero to ensure it will be
 		       updated on the next doupdate() */
@@ -378,15 +525,19 @@
 		}
 	    }
 	    if (changed)
-		_nc_make_oldhash(y);
+		NCURSES_SP_NAME(_nc_make_oldhash) (NCURSES_SP_ARGx y);
 	}
     }
-    SP->_color_pairs[pair] = result;
-    if (GET_SCREEN_PAIR(SP) == pair)
-	SET_SCREEN_PAIR(SP, (chtype) (~0));	/* force attribute update */
 
+    SP_PARM->_color_pairs[pair] = result;
+    if (GET_SCREEN_PAIR(SP_PARM) == pair)
+	SET_SCREEN_PAIR(SP_PARM, (chtype) (~0));	/* force attribute update */
+
+#ifdef USE_TERM_DRIVER
+    CallDriver_3(SP_PARM, initpair, pair, f, b);
+#else
     if (initialize_pair && InPalette(f) && InPalette(b)) {
-	const color_t *tp = hue_lightness_saturation ? hls_palette : cga_palette;
+	const color_t *tp = DefaultPalette;
 
 	TR(TRACE_ATTRS,
 	   ("initializing pair: pair = %d, fg=(%d,%d,%d), bg=(%d,%d,%d)",
@@ -400,80 +551,148 @@
 		     tp[f].red, tp[f].green, tp[f].blue,
 		     tp[b].red, tp[b].green, tp[b].blue));
     }
+#endif
 
     returnCode(OK);
 }
 
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+init_pair(short pair, short f, short b)
+{
+    return NCURSES_SP_NAME(init_pair) (CURRENT_SCREEN, pair, f, b);
+}
+#endif
+
 #define okRGB(n) ((n) >= 0 && (n) <= 1000)
 
 NCURSES_EXPORT(int)
-init_color(short color, short r, short g, short b)
+NCURSES_SP_NAME(init_color) (NCURSES_SP_DCLx
+			     short color, short r, short g, short b)
 {
     int result = ERR;
+    int maxcolors;
+
+    T((T_CALLED("init_color(%p,%d,%d,%d,%d)"),
+       (void *) SP_PARM,
+       color,
+       r, g, b));
 
-    T((T_CALLED("init_color(%d,%d,%d,%d)"), color, r, g, b));
+    if (SP_PARM == 0)
+	returnCode(result);
 
-    if (initialize_color != NULL
-	&& SP != 0
-	&& SP->_coloron
+    maxcolors = MaxColors;
+
+    if (InitColor
+	&& SP_PARM->_coloron
 	&& (color >= 0 && OkColorHi(color))
 	&& (okRGB(r) && okRGB(g) && okRGB(b))) {
 
-	SP->_color_table[color].init = 1;
-	SP->_color_table[color].r = r;
-	SP->_color_table[color].g = g;
-	SP->_color_table[color].b = b;
+	SP_PARM->_color_table[color].init = 1;
+	SP_PARM->_color_table[color].r = r;
+	SP_PARM->_color_table[color].g = g;
+	SP_PARM->_color_table[color].b = b;
 
-	if (hue_lightness_saturation) {
+	if (UseHlsPalette) {
 	    rgb2hls(r, g, b,
-		    &SP->_color_table[color].red,
-		    &SP->_color_table[color].green,
-		    &SP->_color_table[color].blue);
+		    &SP_PARM->_color_table[color].red,
+		    &SP_PARM->_color_table[color].green,
+		    &SP_PARM->_color_table[color].blue);
 	} else {
-	    SP->_color_table[color].red = r;
-	    SP->_color_table[color].green = g;
-	    SP->_color_table[color].blue = b;
+	    SP_PARM->_color_table[color].red = r;
+	    SP_PARM->_color_table[color].green = g;
+	    SP_PARM->_color_table[color].blue = b;
 	}
 
+#ifdef USE_TERM_DRIVER
+	CallDriver_4(SP_PARM, initcolor, color, r, g, b);
+#else
 	TPUTS_TRACE("initialize_color");
 	putp(TPARM_4(initialize_color, color, r, g, b));
-	SP->_color_defs = max(color + 1, SP->_color_defs);
+#endif
+	SP_PARM->_color_defs = max(color + 1, SP_PARM->_color_defs);
+
 	result = OK;
     }
     returnCode(result);
 }
 
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+init_color(short color, short r, short g, short b)
+{
+    return NCURSES_SP_NAME(init_color) (CURRENT_SCREEN, color, r, g, b);
+}
+#endif
+
+NCURSES_EXPORT(bool)
+NCURSES_SP_NAME(can_change_color) (NCURSES_SP_DCL)
+{
+    T((T_CALLED("can_change_color(%p)"), (void *) SP_PARM));
+    returnCode((CanChange != 0) ? TRUE : FALSE);
+}
+
+#if NCURSES_SP_FUNCS
 NCURSES_EXPORT(bool)
 can_change_color(void)
 {
-    T((T_CALLED("can_change_color()")));
-    returnCode((can_change != 0) ? TRUE : FALSE);
+    return NCURSES_SP_NAME(can_change_color) (CURRENT_SCREEN);
 }
+#endif
 
 NCURSES_EXPORT(bool)
-has_colors(void)
+NCURSES_SP_NAME(has_colors) (NCURSES_SP_DCL0)
 {
+    int code;
+
+    (void) SP_PARM;
     T((T_CALLED("has_colors()")));
-    returnCode((VALID_NUMERIC(max_colors) && VALID_NUMERIC(max_pairs)
-		&& (((set_foreground != NULL)
-		     && (set_background != NULL))
-		    || ((set_a_foreground != NULL)
-			&& (set_a_background != NULL))
-		    || set_color_pair)) ? TRUE : FALSE);
+#ifdef USE_TERM_DRIVER
+    code = HasColor;
+#else
+    code = ((VALID_NUMERIC(max_colors) && VALID_NUMERIC(max_pairs)
+	     && (((set_foreground != NULL)
+		  && (set_background != NULL))
+		 || ((set_a_foreground != NULL)
+		     && (set_a_background != NULL))
+		 || set_color_pair)) ? TRUE : FALSE);
+#endif
+    returnCode(code);
 }
 
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(bool)
+has_colors(void)
+{
+    return NCURSES_SP_NAME(has_colors) (CURRENT_SCREEN);
+}
+#endif
+
 NCURSES_EXPORT(int)
-color_content(short color, short *r, short *g, short *b)
+NCURSES_SP_NAME(color_content) (NCURSES_SP_DCLx
+				short color, short *r, short *g, short *b)
 {
-    int result;
+    int result = ERR;
+    int maxcolors;
+
+    T((T_CALLED("color_content(%p,%d,%p,%p,%p)"),
+       (void *) SP_PARM,
+       color,
+       (void *) r,
+       (void *) g,
+       (void *) b));
+
+    if (SP_PARM == 0)
+	returnCode(result);
 
-    T((T_CALLED("color_content(%d,%p,%p,%p)"), color, r, g, b));
-    if (color < 0 || !OkColorHi(color) || SP == 0 || !SP->_coloron) {
+    maxcolors = MaxColors;
+
+    if (color < 0 || !OkColorHi(color) || !SP_PARM->_coloron) {
 	result = ERR;
     } else {
-	NCURSES_COLOR_T c_r = SP->_color_table[color].red;
-	NCURSES_COLOR_T c_g = SP->_color_table[color].green;
-	NCURSES_COLOR_T c_b = SP->_color_table[color].blue;
+	NCURSES_COLOR_T c_r = SP_PARM->_color_table[color].red;
+	NCURSES_COLOR_T c_g = SP_PARM->_color_table[color].green;
+	NCURSES_COLOR_T c_b = SP_PARM->_color_table[color].blue;
 
 	if (r)
 	    *r = c_r;
@@ -489,18 +708,31 @@
     returnCode(result);
 }
 
+#if NCURSES_SP_FUNCS
 NCURSES_EXPORT(int)
-pair_content(short pair, short *f, short *b)
+color_content(short color, short *r, short *g, short *b)
+{
+    return NCURSES_SP_NAME(color_content) (CURRENT_SCREEN, color, r, g, b);
+}
+#endif
+
+NCURSES_EXPORT(int)
+NCURSES_SP_NAME(pair_content) (NCURSES_SP_DCLx
+			       short pair, short *f, short *b)
 {
     int result;
 
-    T((T_CALLED("pair_content(%d,%p,%p)"), pair, f, b));
+    T((T_CALLED("pair_content(%p,%d,%p,%p)"),
+       (void *) SP_PARM,
+       pair,
+       (void *) f,
+       (void *) b));
 
-    if ((pair < 0) || (pair >= COLOR_PAIRS) || SP == 0 || !SP->_coloron) {
+    if (!ValidPair(pair)) {
 	result = ERR;
     } else {
-	NCURSES_COLOR_T fg = ((SP->_color_pairs[pair] >> C_SHIFT) & C_MASK);
-	NCURSES_COLOR_T bg = (SP->_color_pairs[pair] & C_MASK);
+	NCURSES_COLOR_T fg = FORE_OF(SP_PARM->_color_pairs[pair]);
+	NCURSES_COLOR_T bg = BACK_OF(SP_PARM->_color_pairs[pair]);
 
 #if NCURSES_EXT_FUNCS
 	if (fg == COLOR_DEFAULT)
@@ -514,33 +746,53 @@
 	if (b)
 	    *b = bg;
 
-	TR(TRACE_ATTRS, ("...pair_content(%d,%d,%d)", pair, fg, bg));
+	TR(TRACE_ATTRS, ("...pair_content(%p,%d,%d,%d)",
+			 (void *) SP_PARM,
+			 pair,
+			 fg, bg));
 	result = OK;
     }
     returnCode(result);
 }
 
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+pair_content(short pair, short *f, short *b)
+{
+    return NCURSES_SP_NAME(pair_content) (CURRENT_SCREEN, pair, f, b);
+}
+#endif
+
 NCURSES_EXPORT(void)
-_nc_do_color(short old_pair, short pair, bool reverse, int (*outc) (int))
+NCURSES_SP_NAME(_nc_do_color) (NCURSES_SP_DCLx
+			       short old_pair,
+			       short pair,
+			       bool reverse,
+			       NCURSES_SP_OUTC outc)
 {
+#ifdef USE_TERM_DRIVER
+    CallDriver_4(SP_PARM, docolor, old_pair, pair, reverse, outc);
+#else
     NCURSES_COLOR_T fg = COLOR_DEFAULT;
     NCURSES_COLOR_T bg = COLOR_DEFAULT;
     NCURSES_COLOR_T old_fg, old_bg;
 
-    if (pair < 0 || pair >= COLOR_PAIRS) {
+    if (!ValidPair(pair)) {
 	return;
     } else if (pair != 0) {
 	if (set_color_pair) {
 	    TPUTS_TRACE("set_color_pair");
-	    tputs(TPARM_1(set_color_pair, pair), 1, outc);
+	    NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx
+				    TPARM_1(set_color_pair, pair),
+				    1, outc);
 	    return;
-	} else if (SP != 0) {
+	} else if (SP_PARM != 0) {
 	    pair_content((short) pair, &fg, &bg);
 	}
     }
 
     if (old_pair >= 0
-	&& SP != 0
+	&& SP_PARM != 0
 	&& pair_content(old_pair, &old_fg, &old_bg) != ERR) {
 	if ((isDefaultColor(fg) && !isDefaultColor(old_fg))
 	    || (isDefaultColor(bg) && !isDefaultColor(old_bg))) {
@@ -550,29 +802,29 @@
 	     * the terminal description, treat it as screen's indicator of ECMA
 	     * SGR 39 and SGR 49, and assume the two sequences are independent.
 	     */
-	    if (SP->_has_sgr_39_49
+	    if (SP_PARM->_has_sgr_39_49
 		&& isDefaultColor(old_bg)
 		&& !isDefaultColor(old_fg)) {
-		tputs("\033[39m", 1, outc);
-	    } else if (SP->_has_sgr_39_49
+		NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx "\033[39m", 1, outc);
+	    } else if (SP_PARM->_has_sgr_39_49
 		       && isDefaultColor(old_fg)
 		       && !isDefaultColor(old_bg)) {
-		tputs("\033[49m", 1, outc);
+		NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx "\033[49m", 1, outc);
 	    } else
 #endif
-		reset_color_pair();
+		reset_color_pair(NCURSES_SP_ARG);
 	}
     } else {
-	reset_color_pair();
+	reset_color_pair(NCURSES_SP_ARG);
 	if (old_pair < 0)
 	    return;
     }
 
 #if NCURSES_EXT_FUNCS
     if (isDefaultColor(fg))
-	fg = default_fg();
+	fg = (short) default_fg(NCURSES_SP_ARG);
     if (isDefaultColor(bg))
-	bg = default_bg();
+	bg = (short) default_bg(NCURSES_SP_ARG);
 #endif
 
     if (reverse) {
@@ -585,9 +837,23 @@
 		     fg, bg));
 
     if (!isDefaultColor(fg)) {
-	set_foreground_color(fg, outc);
+	set_foreground_color(NCURSES_SP_ARGx fg, outc);
     }
     if (!isDefaultColor(bg)) {
-	set_background_color(bg, outc);
+	set_background_color(NCURSES_SP_ARGx bg, outc);
     }
+#endif
 }
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(void)
+_nc_do_color(short old_pair, short pair, bool reverse, NCURSES_OUTC outc)
+{
+    SetSafeOutcWrapper(outc);
+    NCURSES_SP_NAME(_nc_do_color) (CURRENT_SCREEN,
+				   old_pair,
+				   pair,
+				   reverse,
+				   _nc_outc_wrapper);
+}
+#endif
diff -Naur ncurses-5.7.orig/ncurses/base/lib_colorset.c ncurses-5.7/ncurses/base/lib_colorset.c
--- ncurses-5.7.orig/ncurses/base/lib_colorset.c	2005-01-29 16:40:51.000000000 -0500
+++ ncurses-5.7/ncurses/base/lib_colorset.c	2011-01-08 18:13:50.567157407 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,2005 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2005,2009 Free 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: Juergen Pfeifer,  1998                                          *
- *     and: Thomas E. Dickey, 2005                                          *
+ *     and: Thomas E. Dickey, 2005-on                                       *
  ****************************************************************************/
 
 /*
@@ -41,20 +41,23 @@
 #include <curses.priv.h>
 #include <ctype.h>
 
-MODULE_ID("$Id: lib_colorset.c,v 1.11 2005/01/29 21:40:51 tom Exp $")
+MODULE_ID("$Id: lib_colorset.c,v 1.13 2009/10/24 22:02:14 tom Exp $")
 
 NCURSES_EXPORT(int)
 wcolor_set(WINDOW *win, short color_pair_number, void *opts)
 {
-    T((T_CALLED("wcolor_set(%p,%d)"), win, color_pair_number));
+    int code = ERR;
+
+    T((T_CALLED("wcolor_set(%p,%d)"), (void *) win, color_pair_number));
     if (win
 	&& !opts
+	&& (SP != 0)
 	&& (color_pair_number >= 0)
-	&& (color_pair_number < COLOR_PAIRS)) {
+	&& (color_pair_number < SP->_pair_limit)) {
 	TR(TRACE_ATTRS, ("... current %ld", (long) GET_WINDOW_PAIR(win)));
 	SET_WINDOW_PAIR(win, color_pair_number);
 	if_EXT_COLORS(win->_color = color_pair_number);
-	returnCode(OK);
-    } else
-	returnCode(ERR);
+	code = OK;
+    }
+    returnCode(code);
 }
diff -Naur ncurses-5.7.orig/ncurses/base/lib_delch.c ncurses-5.7/ncurses/base/lib_delch.c
--- ncurses-5.7.orig/ncurses/base/lib_delch.c	2001-12-18 20:06:09.000000000 -0500
+++ ncurses-5.7/ncurses/base/lib_delch.c	2011-01-08 18:13:50.567157407 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998,2000,2001 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2001,2009 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -40,14 +40,14 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_delch.c,v 1.12 2001/12/19 01:06:09 tom Exp $")
+MODULE_ID("$Id: lib_delch.c,v 1.13 2009/10/24 22:32:47 tom Exp $")
 
 NCURSES_EXPORT(int)
 wdelch(WINDOW *win)
 {
     int code = ERR;
 
-    T((T_CALLED("wdelch(%p)"), win));
+    T((T_CALLED("wdelch(%p)"), (void *) win));
 
     if (win) {
 	NCURSES_CH_T blank = win->_nc_bkgd;
diff -Naur ncurses-5.7.orig/ncurses/base/lib_delwin.c ncurses-5.7/ncurses/base/lib_delwin.c
--- ncurses-5.7.orig/ncurses/base/lib_delwin.c	2008-06-07 10:10:56.000000000 -0400
+++ ncurses-5.7/ncurses/base/lib_delwin.c	2011-01-08 18:13:50.567157407 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -29,6 +29,8 @@
 /****************************************************************************
  *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995               *
  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
+ *     and: Thomas E. Dickey                        1996-on                 *
+ *     and: Juergen Pfeifer                         2008                    *
  ****************************************************************************/
 
 /*
@@ -40,15 +42,18 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_delwin.c,v 1.17 2008/06/07 14:10:56 tom Exp $")
+MODULE_ID("$Id: lib_delwin.c,v 1.20 2009/10/24 22:02:14 tom Exp $")
 
 static bool
 cannot_delete(WINDOW *win)
 {
     WINDOWLIST *p;
     bool result = TRUE;
+#ifdef USE_SP_WINDOWLIST
+    SCREEN *sp = _nc_screen_of(win);
+#endif
 
-    for (each_window(p)) {
+    for (each_window(SP_PARM, p)) {
 	if (&(p->win) == win) {
 	    result = FALSE;
 	} else if ((p->win._flags & _SUBWIN) != 0
@@ -65,18 +70,20 @@
 {
     int result = ERR;
 
-    T((T_CALLED("delwin(%p)"), win));
+    T((T_CALLED("delwin(%p)"), (void *) win));
 
     if (_nc_try_global(curses) == 0) {
 	if (win == 0
 	    || cannot_delete(win)) {
 	    result = ERR;
 	} else {
-
+#if NCURSES_SP_FUNCS
+	    SCREEN *sp = _nc_screen_of(win);
+#endif
 	    if (win->_flags & _SUBWIN)
 		touchwin(win->_parent);
-	    else if (curscr != 0)
-		touchwin(curscr);
+	    else if (CurScreen(SP_PARM) != 0)
+		touchwin(CurScreen(SP_PARM));
 
 	    result = _nc_freewin(win);
 	}
diff -Naur ncurses-5.7.orig/ncurses/base/lib_dft_fgbg.c ncurses-5.7/ncurses/base/lib_dft_fgbg.c
--- ncurses-5.7.orig/ncurses/base/lib_dft_fgbg.c	2005-11-26 15:03:38.000000000 -0500
+++ ncurses-5.7/ncurses/base/lib_dft_fgbg.c	2011-01-08 18:13:50.567157407 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2004,2005 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2005,2009 Free 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,49 +27,73 @@
  ****************************************************************************/
 
 /****************************************************************************
- *  Author: Thomas E. Dickey                                                *
+ *  Author: Thomas E. Dickey          1998-on                               *
+ *          Juergen Pfeifer           2009                                  *
  ****************************************************************************/
 
 #include <curses.priv.h>
-#include <term.h>
 
-MODULE_ID("$Id: lib_dft_fgbg.c,v 1.18 2005/11/26 20:03:38 tom Exp $")
+#ifndef CUR
+#define CUR SP_TERMTYPE
+#endif
+
+MODULE_ID("$Id: lib_dft_fgbg.c,v 1.25 2009/10/24 22:15:00 tom Exp $")
 
 /*
  * Modify the behavior of color-pair 0 so that the library doesn't assume that
  * it is white on black.  This is an extension to XSI curses.
  */
 NCURSES_EXPORT(int)
+NCURSES_SP_NAME(use_default_colors) (NCURSES_SP_DCL0)
+{
+    T((T_CALLED("use_default_colors(%p)"), (void *) SP_PARM));
+    returnCode(NCURSES_SP_NAME(assume_default_colors) (NCURSES_SP_ARGx -1, -1));
+}
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
 use_default_colors(void)
 {
-    T((T_CALLED("use_default_colors()")));
-    returnCode(assume_default_colors(-1, -1));
+    return NCURSES_SP_NAME(use_default_colors) (CURRENT_SCREEN);
 }
+#endif
 
 /*
  * Modify the behavior of color-pair 0 so that the library assumes that it
  * is something specific, possibly not white on black.
  */
 NCURSES_EXPORT(int)
-assume_default_colors(int fg, int bg)
+NCURSES_SP_NAME(assume_default_colors) (NCURSES_SP_DCLx int fg, int bg)
 {
-    T((T_CALLED("assume_default_colors(%d,%d)"), fg, bg));
-
-    if (!orig_pair && !orig_colors)
-	returnCode(ERR);
+    int code = ERR;
 
-    if (initialize_pair)	/* don't know how to handle this */
-	returnCode(ERR);
-
-    SP->_default_color = isDefaultColor(fg) || isDefaultColor(bg);
-    SP->_has_sgr_39_49 = (tigetflag("AX") == TRUE);
-    SP->_default_fg = isDefaultColor(fg) ? COLOR_DEFAULT : (fg & C_MASK);
-    SP->_default_bg = isDefaultColor(bg) ? COLOR_DEFAULT : (bg & C_MASK);
-    if (SP->_color_pairs != 0) {
-	bool save = SP->_default_color;
-	SP->_default_color = TRUE;
-	init_pair(0, (short) fg, (short) bg);
-	SP->_default_color = save;
+    T((T_CALLED("assume_default_colors(%p,%d,%d)"), (void *) SP_PARM, fg, bg));
+#ifdef USE_TERM_DRIVER
+    if (sp != 0)
+	code = CallDriver_2(sp, defaultcolors, fg, bg);
+#else
+    if ((orig_pair || orig_colors) && !initialize_pair) {
+
+	SP_PARM->_default_color = isDefaultColor(fg) || isDefaultColor(bg);
+	SP_PARM->_has_sgr_39_49 = (tigetflag("AX") == TRUE);
+	SP_PARM->_default_fg = isDefaultColor(fg) ? COLOR_DEFAULT : (fg & C_MASK);
+	SP_PARM->_default_bg = isDefaultColor(bg) ? COLOR_DEFAULT : (bg & C_MASK);
+	if (SP_PARM->_color_pairs != 0) {
+	    bool save = SP_PARM->_default_color;
+	    SP_PARM->_default_color = TRUE;
+	    init_pair(0, (short) fg, (short) bg);
+	    SP_PARM->_default_color = save;
+	}
+	code = OK;
     }
-    returnCode(OK);
+#endif
+    returnCode(code);
+}
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+assume_default_colors(int fg, int bg)
+{
+    return NCURSES_SP_NAME(assume_default_colors) (CURRENT_SCREEN, fg, bg);
 }
+#endif
diff -Naur ncurses-5.7.orig/ncurses/base/lib_driver.c ncurses-5.7/ncurses/base/lib_driver.c
--- ncurses-5.7.orig/ncurses/base/lib_driver.c	1969-12-31 19:00:00.000000000 -0500
+++ ncurses-5.7/ncurses/base/lib_driver.c	2011-01-08 18:18:29.746780939 -0500
@@ -0,0 +1,143 @@
+/****************************************************************************
+ * Copyright (c) 2008-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            *
+ * "Software"), to deal in the Software without restriction, including      *
+ * without limitation the rights to use, copy, modify, merge, publish,      *
+ * distribute, distribute with modifications, sublicense, and/or sell       *
+ * copies of the Software, and to permit persons to whom the Software is    *
+ * furnished to do so, subject to the following conditions:                 *
+ *                                                                          *
+ * The above copyright notice and this permission notice shall be included  *
+ * in all copies or substantial portions of the Software.                   *
+ *                                                                          *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
+ *                                                                          *
+ * Except as contained in this notice, the name(s) of the above copyright   *
+ * holders shall not be used in advertising or otherwise to promote the     *
+ * sale, use or other dealings in this Software without prior written       *
+ * authorization.                                                           *
+ ****************************************************************************/
+
+/****************************************************************************
+ *  Author: Juergen Pfeifer                                                 *
+ *                                                                          *
+ ****************************************************************************/
+
+#include <curses.priv.h>
+
+MODULE_ID("$Id: lib_driver.c,v 1.3 2010/12/20 00:29:17 tom Exp $")
+
+typedef struct DriverEntry {
+    const char *name;
+    TERM_DRIVER *driver;
+} DRIVER_ENTRY;
+
+static DRIVER_ENTRY DriverTable[] =
+{
+#ifdef __MINGW32__
+    {"win", &_nc_WIN_DRIVER},
+#endif
+    {"tinfo", &_nc_TINFO_DRIVER}
+};
+
+NCURSES_EXPORT(int)
+_nc_get_driver(TERMINAL_CONTROL_BLOCK * TCB, const char *name, int *errret)
+{
+    int code = ERR;
+    size_t i;
+    TERM_DRIVER *res = (TERM_DRIVER *) 0;
+    TERM_DRIVER *use = 0;
+
+    T((T_CALLED("_nc_get_driver(%p, %s, %p)"),
+       (void *) TCB, NonNull(name), (void *) errret));
+
+    assert(TCB != 0);
+
+    for (i = 0; i < SIZEOF(DriverTable); i++) {
+	res = DriverTable[i].driver;
+	if (res->CanHandle(TCB, name, errret)) {
+	    use = res;
+	    break;
+	}
+    }
+    if (use != 0) {
+	TCB->drv = use;
+	code = OK;
+    }
+    returnCode(code);
+}
+
+NCURSES_EXPORT(int)
+NCURSES_SP_NAME(has_key) (SCREEN *sp, int keycode)
+{
+    T((T_CALLED("has_key(%p, %d)"), (void *) sp, keycode));
+    returnCode(IsValidTIScreen(sp) ? CallDriver_1(sp, kyExist, keycode) : FALSE);
+}
+
+NCURSES_EXPORT(int)
+has_key(int keycode)
+{
+    return NCURSES_SP_NAME(has_key) (CURRENT_SCREEN, keycode);
+}
+
+NCURSES_EXPORT(int)
+NCURSES_SP_NAME(_nc_mcprint) (SCREEN *sp, char *data, int len)
+{
+    int code = ERR;
+
+    if (0 != TerminalOf(sp))
+	code = CallDriver_2(sp, print, data, len);
+    return (code);
+}
+
+NCURSES_EXPORT(int)
+mcprint(char *data, int len)
+{
+    return NCURSES_SP_NAME(_nc_mcprint) (CURRENT_SCREEN, data, len);
+}
+
+NCURSES_EXPORT(int)
+NCURSES_SP_NAME(doupdate) (SCREEN *sp)
+{
+    int code = ERR;
+
+    T((T_CALLED("doupdate(%p)"), (void *) sp));
+
+    if (IsValidScreen(sp))
+	code = CallDriver(sp, update);
+
+    returnCode(code);
+}
+
+NCURSES_EXPORT(int)
+doupdate(void)
+{
+    return NCURSES_SP_NAME(doupdate) (CURRENT_SCREEN);
+}
+
+NCURSES_EXPORT(int)
+NCURSES_SP_NAME(mvcur) (SCREEN *sp, int yold, int xold, int ynew, int xnew)
+{
+    int code = ERR;
+    TR(TRACE_CALLS | TRACE_MOVE, (T_CALLED("mvcur(%p,%d,%d,%d,%d)"),
+				  (void *) sp, yold, xold, ynew, xnew));
+    if (HasTerminal(sp)) {
+	code = CallDriver_4(sp, hwcur, yold, xold, ynew, xnew);
+    }
+    returnCode(code);
+}
+
+NCURSES_EXPORT(int)
+mvcur(int yold, int xold, int ynew, int xnew)
+/* optimized cursor move from (yold, xold) to (ynew, xnew) */
+{
+    return NCURSES_SP_NAME(mvcur) (CURRENT_SCREEN, yold, xold, ynew, xnew);
+}
diff -Naur ncurses-5.7.orig/ncurses/base/lib_echo.c ncurses-5.7/ncurses/base/lib_echo.c
--- ncurses-5.7.orig/ncurses/base/lib_echo.c	2000-12-09 21:43:27.000000000 -0500
+++ ncurses-5.7/ncurses/base/lib_echo.c	2011-01-08 18:13:50.567157407 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998,2000 Free Software Foundation, Inc.                   *
+ * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -29,6 +29,8 @@
 /****************************************************************************
  *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995               *
  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
+ *     and: Thomas E. Dickey                        1996-on                 *
+ *     and: Juergen Pfeifer                         2009                    *
  ****************************************************************************/
 
 /*
@@ -42,20 +44,40 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_echo.c,v 1.5 2000/12/10 02:43:27 tom Exp $")
+MODULE_ID("$Id: lib_echo.c,v 1.8 2009/10/24 22:02:14 tom Exp $")
 
 NCURSES_EXPORT(int)
+NCURSES_SP_NAME(echo) (NCURSES_SP_DCL0)
+{
+    T((T_CALLED("echo(%p)"), (void *) SP_PARM));
+    if (0 == SP_PARM)
+	returnCode(ERR);
+    SP_PARM->_echo = TRUE;
+    returnCode(OK);
+}
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
 echo(void)
 {
-    T((T_CALLED("echo()")));
-    SP->_echo = TRUE;
+    return NCURSES_SP_NAME(echo) (CURRENT_SCREEN);
+}
+#endif
+
+NCURSES_EXPORT(int)
+NCURSES_SP_NAME(noecho) (NCURSES_SP_DCL0)
+{
+    T((T_CALLED("noecho(%p)"), (void *) SP_PARM));
+    if (0 == SP_PARM)
+	returnCode(ERR);
+    SP_PARM->_echo = FALSE;
     returnCode(OK);
 }
 
+#if NCURSES_SP_FUNCS
 NCURSES_EXPORT(int)
 noecho(void)
 {
-    T((T_CALLED("noecho()")));
-    SP->_echo = FALSE;
-    returnCode(OK);
+    return NCURSES_SP_NAME(noecho) (CURRENT_SCREEN);
 }
+#endif
diff -Naur ncurses-5.7.orig/ncurses/base/lib_endwin.c ncurses-5.7/ncurses/base/lib_endwin.c
--- ncurses-5.7.orig/ncurses/base/lib_endwin.c	2000-12-09 21:43:27.000000000 -0500
+++ ncurses-5.7/ncurses/base/lib_endwin.c	2011-01-08 18:13:50.567157407 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998,2000 Free Software Foundation, Inc.                   *
+ * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -29,6 +29,8 @@
 /****************************************************************************
  *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995               *
  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
+ *     and: Thomas E. Dickey                        1996-on                 *
+ *     and: Juergen Pfeifer                         2009                    *
  ****************************************************************************/
 
 /*
@@ -39,22 +41,39 @@
 */
 
 #include <curses.priv.h>
-#include <term.h>
 
-MODULE_ID("$Id: lib_endwin.c,v 1.19 2000/12/10 02:43:27 tom Exp $")
+MODULE_ID("$Id: lib_endwin.c,v 1.22 2009/10/24 22:02:14 tom Exp $")
 
 NCURSES_EXPORT(int)
-endwin(void)
+NCURSES_SP_NAME(endwin) (NCURSES_SP_DCL0)
 {
-    T((T_CALLED("endwin()")));
+    int code = ERR;
+
+    T((T_CALLED("endwin(%p)"), (void *) SP_PARM));
 
-    if (SP) {
-	SP->_endwin = TRUE;
-	SP->_mouse_wrap(SP);
+    if (SP_PARM) {
+#ifdef USE_TERM_DRIVER
+	TERMINAL_CONTROL_BLOCK *TCB = TCBOf(SP_PARM);
+
+	SP_PARM->_endwin = TRUE;
+	if (TCB && TCB->drv && TCB->drv->scexit)
+	    TCB->drv->scexit(SP_PARM);
+#else
+	SP_PARM->_endwin = TRUE;
+	SP_PARM->_mouse_wrap(SP_PARM);
 	_nc_screen_wrap();
 	_nc_mvcur_wrap();	/* wrap up cursor addressing */
-	returnCode(reset_shell_mode());
+#endif
+	code = NCURSES_SP_NAME(reset_shell_mode) (NCURSES_SP_ARG);
     }
 
-    returnCode(ERR);
+    returnCode(code);
+}
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+endwin(void)
+{
+    return NCURSES_SP_NAME(endwin) (CURRENT_SCREEN);
 }
+#endif
diff -Naur ncurses-5.7.orig/ncurses/base/lib_erase.c ncurses-5.7/ncurses/base/lib_erase.c
--- ncurses-5.7.orig/ncurses/base/lib_erase.c	2005-10-29 20:36:36.000000000 -0400
+++ ncurses-5.7/ncurses/base/lib_erase.c	2011-01-08 18:13:50.567157407 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998,2000,2001 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2005,2009 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -41,7 +41,7 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_erase.c,v 1.16 2005/10/30 00:36:36 tom Exp $")
+MODULE_ID("$Id: lib_erase.c,v 1.17 2009/10/24 22:32:29 tom Exp $")
 
 NCURSES_EXPORT(int)
 werase(WINDOW *win)
@@ -51,7 +51,7 @@
     NCURSES_CH_T blank;
     NCURSES_CH_T *sp, *end, *start;
 
-    T((T_CALLED("werase(%p)"), win));
+    T((T_CALLED("werase(%p)"), (void *) win));
 
     if (win) {
 	blank = win->_nc_bkgd;
diff -Naur ncurses-5.7.orig/ncurses/base/lib_flash.c ncurses-5.7/ncurses/base/lib_flash.c
--- ncurses-5.7.orig/ncurses/base/lib_flash.c	2000-12-09 21:43:27.000000000 -0500
+++ ncurses-5.7/ncurses/base/lib_flash.c	2011-01-08 18:13:50.567157407 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998,2000 Free Software Foundation, Inc.                   *
+ * Copyright (c) 1998-2000,2009 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -29,6 +29,8 @@
 /****************************************************************************
  *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995               *
  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
+ *     and: Thomas E. Dickey                        1996-on                 *
+ *     and: Juergen Pfeifer                         2009                    *
  ****************************************************************************/
 
 /*
@@ -39,9 +41,12 @@
  */
 
 #include <curses.priv.h>
-#include <term.h>		/* beep, flash */
 
-MODULE_ID("$Id: lib_flash.c,v 1.6 2000/12/10 02:43:27 tom Exp $")
+#ifndef CUR
+#define CUR SP_TERMTYPE
+#endif
+
+MODULE_ID("$Id: lib_flash.c,v 1.11 2009/10/24 22:02:14 tom Exp $")
 
 /*
  *	flash()
@@ -52,12 +57,15 @@
  */
 
 NCURSES_EXPORT(int)
-flash(void)
+NCURSES_SP_NAME(flash) (NCURSES_SP_DCL0)
 {
     int res = ERR;
 
-    T((T_CALLED("flash()")));
-
+    T((T_CALLED("flash(%p)"), (void *) SP_PARM));
+#ifdef USE_TERM_DRIVER
+    if (SP_PARM != 0)
+	res = CallDriver_1(SP_PARM, doBeepOrFlash, FALSE);
+#else
     /* FIXME: should make sure that we are not in altchar mode */
     if (flash_screen) {
 	TPUTS_TRACE("flash_screen");
@@ -68,6 +76,14 @@
 	res = putp(bell);
 	_nc_flush();
     }
-
+#endif
     returnCode(res);
 }
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+flash(void)
+{
+    return NCURSES_SP_NAME(flash) (CURRENT_SCREEN);
+}
+#endif
diff -Naur ncurses-5.7.orig/ncurses/base/lib_freeall.c ncurses-5.7/ncurses/base/lib_freeall.c
--- ncurses-5.7.orig/ncurses/base/lib_freeall.c	2008-09-27 09:09:57.000000000 -0400
+++ ncurses-5.7/ncurses/base/lib_freeall.c	2011-01-08 18:13:50.567157407 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2007,2008 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            *
@@ -31,7 +31,6 @@
  ****************************************************************************/
 
 #include <curses.priv.h>
-#include <term_entry.h>
 #include <tic.h>
 
 #if HAVE_NC_FREEALL
@@ -40,40 +39,40 @@
 extern int malloc_errfd;	/* FIXME */
 #endif
 
-MODULE_ID("$Id: lib_freeall.c,v 1.54 2008/09/27 13:09:57 tom Exp $")
+MODULE_ID("$Id: lib_freeall.c,v 1.59 2010/01/23 17:57:43 tom Exp $")
 
 /*
  * Free all ncurses data.  This is used for testing only (there's no practical
  * use for it as an extension).
  */
 NCURSES_EXPORT(void)
-_nc_freeall(void)
+NCURSES_SP_NAME(_nc_freeall) (NCURSES_SP_DCL0)
 {
     WINDOWLIST *p, *q;
     static va_list empty_va;
 
     T((T_CALLED("_nc_freeall()")));
 #if NO_LEAKS
-    if (SP != 0) {
-	if (SP->_oldnum_list != 0) {
-	    FreeAndNull(SP->_oldnum_list);
+    if (SP_PARM != 0) {
+	if (SP_PARM->_oldnum_list != 0) {
+	    FreeAndNull(SP_PARM->_oldnum_list);
 	}
-	if (SP->_panelHook.destroy != 0) {
-	    SP->_panelHook.destroy(SP->_panelHook.stdscr_pseudo_panel);
+	if (SP_PARM->_panelHook.destroy != 0) {
+	    SP_PARM->_panelHook.destroy(SP_PARM->_panelHook.stdscr_pseudo_panel);
 	}
     }
 #endif
-    if (SP != 0) {
+    if (SP_PARM != 0) {
 	_nc_lock_global(curses);
 
-	while (_nc_windows != 0) {
+	while (WindowList(SP_PARM) != 0) {
 	    bool deleted = FALSE;
 
 	    /* Delete only windows that're not a parent */
-	    for (each_window(p)) {
+	    for (each_window(SP_PARM, p)) {
 		bool found = FALSE;
 
-		for (each_window(q)) {
+		for (each_window(SP_PARM, q)) {
 		    if ((p != q)
 			&& (q->win._flags & _SUBWIN)
 			&& (&(p->win) == q->win._parent)) {
@@ -95,11 +94,9 @@
 	    if (!deleted)
 		break;
 	}
-	delscreen(SP);
+	delscreen(SP_PARM);
 	_nc_unlock_global(curses);
     }
-    if (cur_term != 0)
-	del_curterm(cur_term);
 
     (void) _nc_printf_string(0, empty_va);
 #ifdef TRACE
@@ -121,12 +118,20 @@
     returnVoid;
 }
 
+#if NCURSES_SP_FUNCS
 NCURSES_EXPORT(void)
-_nc_free_and_exit(int code)
+_nc_freeall(void)
+{
+    NCURSES_SP_NAME(_nc_freeall) (CURRENT_SCREEN);
+}
+#endif
+
+NCURSES_EXPORT(void)
+NCURSES_SP_NAME(_nc_free_and_exit) (NCURSES_SP_DCLx int code)
 {
-    char *last_setbuf = (SP != 0) ? SP->_setbuf : 0;
+    char *last_setbuf = (SP_PARM != 0) ? SP_PARM->_setbuf : 0;
 
-    _nc_freeall();
+    NCURSES_SP_NAME(_nc_freeall) (NCURSES_SP_ARG);
 #ifdef TRACE
     trace(0);			/* close trace file, freeing its setbuf */
     {
@@ -146,12 +151,21 @@
 }
 
 NCURSES_EXPORT(void)
-_nc_free_and_exit(int code)
+NCURSES_SP_NAME(_nc_free_and_exit) (NCURSES_SP_DCLx int code)
 {
-    if (SP)
-	delscreen(SP);
-    if (cur_term != 0)
-	del_curterm(cur_term);
+    if (SP_PARM) {
+	delscreen(SP_PARM);
+	if (SP_PARM->_term)
+	    NCURSES_SP_NAME(del_curterm) (NCURSES_SP_ARGx SP_PARM->_term);
+    }
     exit(code);
 }
 #endif
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(void)
+_nc_free_and_exit(int code)
+{
+    NCURSES_SP_NAME(_nc_free_and_exit) (CURRENT_SCREEN, code);
+}
+#endif
diff -Naur ncurses-5.7.orig/ncurses/base/lib_getch.c ncurses-5.7/ncurses/base/lib_getch.c
--- ncurses-5.7.orig/ncurses/base/lib_getch.c	2008-09-20 15:46:13.000000000 -0400
+++ ncurses-5.7/ncurses/base/lib_getch.c	2011-01-08 18:18:29.746780939 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2007,2008 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            *
@@ -30,6 +30,7 @@
  *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995               *
  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
  *     and: Thomas E. Dickey                        1996-on                 *
+ *     and: Juergen Pfeifer                         2009                    *
  ****************************************************************************/
 
 /*
@@ -41,40 +42,80 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_getch.c,v 1.99 2008/09/20 19:46:13 tom Exp $")
+MODULE_ID("$Id: lib_getch.c,v 1.121 2010/12/25 23:24:04 tom Exp $")
 
 #include <fifo_defs.h>
 
 #if USE_REENTRANT
-#define GetEscdelay(sp) (sp)->_ESCDELAY
+#define GetEscdelay(sp) *_nc_ptr_Escdelay(sp)
 NCURSES_EXPORT(int)
 NCURSES_PUBLIC_VAR(ESCDELAY) (void)
 {
-    return SP ? GetEscdelay(SP) : 1000;
+    return *(_nc_ptr_Escdelay(CURRENT_SCREEN));
+}
+
+NCURSES_EXPORT(int *)
+_nc_ptr_Escdelay(SCREEN *sp)
+{
+    return ptrEscdelay(sp);
 }
 #else
 #define GetEscdelay(sp) ESCDELAY
-NCURSES_EXPORT_VAR(int)
-ESCDELAY = 1000;		/* max interval betw. chars in funkeys, in millisecs */
+NCURSES_EXPORT_VAR(int) ESCDELAY = 1000;
 #endif
 
 #if NCURSES_EXT_FUNCS
 NCURSES_EXPORT(int)
-set_escdelay(int value)
+NCURSES_SP_NAME(set_escdelay) (NCURSES_SP_DCLx int value)
 {
     int code = OK;
 #if USE_REENTRANT
-    if (SP) {
-	SP->_ESCDELAY = value;
+    if (SP_PARM) {
+	SET_ESCDELAY(value);
     } else {
 	code = ERR;
     }
 #else
+    (void) SP_PARM;
     ESCDELAY = value;
 #endif
     return code;
 }
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+set_escdelay(int value)
+{
+    int code;
+#if USE_REENTRANT
+    code = NCURSES_SP_NAME(set_escdelay) (CURRENT_SCREEN, value);
+#else
+    ESCDELAY = value;
+    code = OK;
+#endif
+    return code;
+}
+#endif
+#endif /* NCURSES_EXT_FUNCS */
+
+#if NCURSES_EXT_FUNCS
+NCURSES_EXPORT(int)
+NCURSES_SP_NAME(get_escdelay) (NCURSES_SP_DCL0)
+{
+#if !USE_REENTRANT
+    (void) SP_PARM;
+#endif
+    return GetEscdelay(SP_PARM);
+}
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+get_escdelay(void)
+{
+    return NCURSES_SP_NAME(get_escdelay) (CURRENT_SCREEN);
+}
 #endif
+#endif /* NCURSES_EXT_FUNCS */
 
 static int
 _nc_use_meta(WINDOW *win)
@@ -83,12 +124,6 @@
     return (sp ? sp->_use_meta : 0);
 }
 
-#ifdef NCURSES_WGETCH_EVENTS
-#define TWAIT_MASK 7
-#else
-#define TWAIT_MASK 3
-#endif
-
 /*
  * Check for mouse activity, returning nonzero if we find any.
  */
@@ -97,19 +132,29 @@
 {
     int rc;
 
+#ifdef USE_TERM_DRIVER
+    rc = TCBOf(sp)->drv->testmouse(TCBOf(sp), delay);
+#else
 #if USE_SYSMOUSE
     if ((sp->_mouse_type == M_SYSMOUSE)
 	&& (sp->_sysmouse_head < sp->_sysmouse_tail)) {
-	return 2;
-    }
+	rc = TW_MOUSE;
+    } else
 #endif
-    rc = _nc_timed_wait(sp, TWAIT_MASK, delay, (int *) 0 EVENTLIST_2nd(evl));
+    {
+	rc = _nc_timed_wait(sp,
+			    TWAIT_MASK,
+			    delay,
+			    (int *) 0
+			    EVENTLIST_2nd(evl));
 #if USE_SYSMOUSE
-    if ((sp->_mouse_type == M_SYSMOUSE)
-	&& (sp->_sysmouse_head < sp->_sysmouse_tail)
-	&& (rc == 0)
-	&& (errno == EINTR)) {
-	rc |= 2;
+	if ((sp->_mouse_type == M_SYSMOUSE)
+	    && (sp->_sysmouse_head < sp->_sysmouse_tail)
+	    && (rc == 0)
+	    && (errno == EINTR)) {
+	    rc |= TW_MOUSE;
+	}
+#endif
     }
 #endif
     return rc;
@@ -173,9 +218,9 @@
     } else
 	mask = 0;
 
-    if (mask & 4) {
+    if (mask & TW_EVENT) {
 	T(("fifo_push: ungetch KEY_EVENT"));
-	_nc_ungetch(sp, KEY_EVENT);
+	safe_ungetch(sp, KEY_EVENT);
 	return KEY_EVENT;
     }
 #elif USE_GPM_SUPPORT || USE_EMX_MOUSE || USE_SYSMOUSE
@@ -185,7 +230,7 @@
 #endif
 
 #if USE_GPM_SUPPORT || USE_EMX_MOUSE
-    if ((sp->_mouse_fd >= 0) && (mask & 2)) {
+    if ((sp->_mouse_fd >= 0) && (mask & TW_MOUSE)) {
 	sp->_mouse_event(sp);
 	ch = KEY_MOUSE;
 	n = 1;
@@ -204,10 +249,33 @@
 	n = 1;
     } else
 #endif
+#ifdef USE_TERM_DRIVER
+	if ((sp->_mouse_type == M_TERM_DRIVER)
+	    && (sp->_drv_mouse_head < sp->_drv_mouse_tail)) {
+	sp->_mouse_event(sp);
+	ch = KEY_MOUSE;
+	n = 1;
+    } else
+#endif
     {				/* Can block... */
+#ifdef USE_TERM_DRIVER
+	int buf;
+	n = CallDriver_1(sp, read, &buf);
+	ch = buf;
+#else
 	unsigned char c2 = 0;
-	n = read(sp->_ifd, &c2, 1);
+# if USE_PTHREADS_EINTR
+#  if USE_WEAK_SYMBOLS
+	if ((pthread_self) && (pthread_kill) && (pthread_equal))
+#  endif
+	    _nc_globals.read_thread = pthread_self();
+# endif
+	n = (int) read(sp->_ifd, &c2, 1);
+#if USE_PTHREADS_EINTR
+	_nc_globals.read_thread = 0;
+#endif
 	ch = c2;
+#endif
     }
 
 #ifdef HIDE_EINTR
@@ -220,7 +288,11 @@
      * We don't want this difference to show.  This piece of code
      * tries to make it look like we always have restarting signals.
      */
-    if (n <= 0 && errno == EINTR)
+    if (n <= 0 && errno == EINTR
+# if USE_PTHREADS_EINTR
+	&& (_nc_globals.have_sigwinch == 0)
+# endif
+	)
 	goto again;
 #endif
 
@@ -260,12 +332,12 @@
 {
 #ifdef USE_PTHREADS
     SCREEN *sp = _nc_screen_of(win);
-    if (_nc_use_pthreads && sp != SP) {
+    if (_nc_use_pthreads && sp != CURRENT_SCREEN) {
 	SCREEN *save_SP;
 
 	/* temporarily switch to the window's screen to check/refresh */
 	_nc_lock_global(curses);
-	save_SP = SP;
+	save_SP = CURRENT_SCREEN;
 	_nc_set_screen(sp);
 	recur_wrefresh(win);
 	_nc_set_screen(save_SP);
@@ -286,12 +358,12 @@
 
     if (sp != 0) {
 #ifdef USE_PTHREADS
-	if (_nc_use_pthreads && sp != SP) {
+	if (_nc_use_pthreads && sp != CURRENT_SCREEN) {
 	    SCREEN *save_SP;
 
 	    /* temporarily switch to the window's screen to get cooked input */
 	    _nc_lock_global(curses);
-	    save_SP = SP;
+	    save_SP = CURRENT_SCREEN;
 	    _nc_set_screen(sp);
 	    rc = recur_wgetnstr(win, buf);
 	    _nc_set_screen(save_SP);
@@ -311,17 +383,18 @@
 
 NCURSES_EXPORT(int)
 _nc_wgetch(WINDOW *win,
-	   unsigned long *result,
+	   int *result,
 	   int use_meta
 	   EVENTLIST_2nd(_nc_eventlist * evl))
 {
     SCREEN *sp;
     int ch;
+    int rc = 0;
 #ifdef NCURSES_WGETCH_EVENTS
     long event_delay = -1;
 #endif
 
-    T((T_CALLED("_nc_wgetch(%p)"), win));
+    T((T_CALLED("_nc_wgetch(%p)"), (void *) win));
 
     *result = 0;
 
@@ -352,19 +425,20 @@
 	!sp->_cbreak &&
 	!sp->_called_wgetch) {
 	char buf[MAXCOLUMNS], *bufp;
-	int rc;
 
 	TR(TRACE_IEVENT, ("filling queue in cooked mode"));
 
-	rc = recur_wgetnstr(win, buf);
-
 	/* ungetch in reverse order */
 #ifdef NCURSES_WGETCH_EVENTS
+	rc = recur_wgetnstr(win, buf);
 	if (rc != KEY_EVENT)
+	    safe_ungetch(sp, '\n');
+#else
+	(void) recur_wgetnstr(win, buf);
+	safe_ungetch(sp, '\n');
 #endif
-	    _nc_ungetch(sp, '\n');
 	for (bufp = buf + strlen(buf); bufp > buf; bufp--)
-	    _nc_ungetch(sp, bufp[-1]);
+	    safe_ungetch(sp, bufp[-1]);
 
 #ifdef NCURSES_WGETCH_EVENTS
 	/* Return it first */
@@ -384,7 +458,6 @@
     if (win->_notimeout || (win->_delay >= 0) || (sp->_cbreak > 1)) {
 	if (head == -1) {	/* fifo is empty */
 	    int delay;
-	    int rc;
 
 	    TR(TRACE_IEVENT, ("timed delay in wgetch()"));
 	    if (sp->_cbreak > 1)
@@ -402,13 +475,13 @@
 	    rc = check_mouse_activity(sp, delay EVENTLIST_2nd(evl));
 
 #ifdef NCURSES_WGETCH_EVENTS
-	    if (rc & 4) {
+	    if (rc & TW_EVENT) {
 		*result = KEY_EVENT;
 		returnCode(KEY_CODE_YES);
 	    }
 #endif
 	    if (!rc) {
-		returnCode(ERR);
+		goto check_sigwinch;
 	    }
 	}
 	/* else go on to read data available */
@@ -427,7 +500,6 @@
 	 * increase the wait with mouseinterval().
 	 */
 	int runcount = 0;
-	int rc;
 
 	do {
 	    ch = kgetch(sp EVENTLIST_2nd(evl));
@@ -442,11 +514,11 @@
 	    (ch == KEY_MOUSE
 	     && (((rc = check_mouse_activity(sp, sp->_maxclick
 					     EVENTLIST_2nd(evl))) != 0
-		  && !(rc & 4))
+		  && !(rc & TW_EVENT))
 		 || !sp->_mouse_parse(sp, runcount)));
 #ifdef NCURSES_WGETCH_EVENTS
-	if ((rc & 4) && !ch == KEY_EVENT) {
-	    _nc_ungetch(sp, ch);
+	if ((rc & TW_EVENT) && !(ch == KEY_EVENT)) {
+	    safe_ungetch(sp, ch);
 	    ch = KEY_EVENT;
 	}
 #endif
@@ -454,12 +526,12 @@
 #ifdef NCURSES_WGETCH_EVENTS
 	    /* mouse event sequence ended by an event, report event */
 	    if (ch == KEY_EVENT) {
-		_nc_ungetch(sp, KEY_MOUSE);	/* FIXME This interrupts a gesture... */
+		safe_ungetch(sp, KEY_MOUSE);	/* FIXME This interrupts a gesture... */
 	    } else
 #endif
 	    {
 		/* mouse event sequence ended by keystroke, store keystroke */
-		_nc_ungetch(sp, ch);
+		safe_ungetch(sp, ch);
 		ch = KEY_MOUSE;
 	    }
 	}
@@ -470,12 +542,19 @@
     }
 
     if (ch == ERR) {
+      check_sigwinch:
 #if USE_SIZECHANGE
 	if (_nc_handle_sigwinch(sp)) {
 	    _nc_update_screensize(sp);
 	    /* resizeterm can push KEY_RESIZE */
 	    if (cooked_key_in_fifo()) {
 		*result = fifo_pull(sp);
+		/*
+		 * Get the ERR from queue -- it is from WINCH,
+		 * so we should take it out, the "error" is handled.
+		 */
+		if (fifo_peek(sp) == -1)
+		    fifo_pull(sp);
 		returnCode(*result >= KEY_MIN ? KEY_CODE_YES : OK);
 	    }
 	}
@@ -502,7 +581,7 @@
      * cursor to the left.
      */
     if (sp->_echo && !(win->_flags & _ISPAD)) {
-	chtype backup = (ch == KEY_BACKSPACE) ? '\b' : ch;
+	chtype backup = (chtype) ((ch == KEY_BACKSPACE) ? '\b' : ch);
 	if (backup < KEY_MIN)
 	    wechochar(win, backup);
     }
@@ -533,7 +612,7 @@
 wgetch_events(WINDOW *win, _nc_eventlist * evl)
 {
     int code;
-    unsigned long value;
+    int value;
 
     T((T_CALLED("wgetch_events(%p,%p)"), win, evl));
     code = _nc_wgetch(win,
@@ -550,9 +629,9 @@
 wgetch(WINDOW *win)
 {
     int code;
-    unsigned long value;
+    int value;
 
-    T((T_CALLED("wgetch(%p)"), win));
+    T((T_CALLED("wgetch(%p)"), (void *) win));
     code = _nc_wgetch(win,
 		      &value,
 		      _nc_use_meta(win)
@@ -626,7 +705,7 @@
 	    break;
 	}
 	TR(TRACE_IEVENT, ("ptr=%p, ch=%d, value=%d",
-			  ptr, ptr->ch, ptr->value));
+			  (void *) ptr, ptr->ch, ptr->value));
 
 	if (ptr->value != 0) {	/* sequence terminated */
 	    TR(TRACE_IEVENT, ("end of sequence"));
@@ -645,7 +724,7 @@
 	    TR(TRACE_IEVENT, ("waiting for rest of sequence"));
 	    rc = check_mouse_activity(sp, timeleft EVENTLIST_2nd(evl));
 #ifdef NCURSES_WGETCH_EVENTS
-	    if (rc & 4) {
+	    if (rc & TW_EVENT) {
 		TR(TRACE_IEVENT, ("interrupted by a user event"));
 		/* FIXME Should have preserved remainder timeleft for reuse... */
 		peek = head;	/* Restart interpreting later */
diff -Naur ncurses-5.7.orig/ncurses/base/lib_getstr.c ncurses-5.7/ncurses/base/lib_getstr.c
--- ncurses-5.7.orig/ncurses/base/lib_getstr.c	2008-08-16 15:20:04.000000000 -0400
+++ ncurses-5.7/ncurses/base/lib_getstr.c	2011-01-08 18:13:50.571157447 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2006,2008 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -39,9 +39,8 @@
 */
 
 #include <curses.priv.h>
-#include <term.h>
 
-MODULE_ID("$Id: lib_getstr.c,v 1.27 2008/08/16 19:20:04 tom Exp $")
+MODULE_ID("$Id: lib_getstr.c,v 1.29 2009/10/24 21:59:02 tom Exp $")
 
 /*
  * This wipes out the last character, no matter whether it was a tab, control
@@ -84,24 +83,24 @@
     int ch;
     int y, x;
 
-    T((T_CALLED("wgetnstr(%p,%p, %d)"), win, str, maxlen));
+    T((T_CALLED("wgetnstr(%p,%p,%d)"), (void *) win, (void *) str, maxlen));
 
     if (!win)
 	returnCode(ERR);
 
-    _nc_get_tty_mode(&buf);
+    NCURSES_SP_NAME(_nc_get_tty_mode) (NCURSES_SP_ARGx &buf);
 
     oldnl = sp->_nl;
     oldecho = sp->_echo;
     oldraw = sp->_raw;
     oldcbreak = sp->_cbreak;
-    nl();
-    noecho();
-    noraw();
-    cbreak();
+    NCURSES_SP_NAME(nl) (NCURSES_SP_ARG);
+    NCURSES_SP_NAME(noecho) (NCURSES_SP_ARG);
+    NCURSES_SP_NAME(noraw) (NCURSES_SP_ARG);
+    NCURSES_SP_NAME(cbreak) (NCURSES_SP_ARG);
 
-    erasec = erasechar();
-    killc = killchar();
+    erasec = NCURSES_SP_NAME(erasechar) (NCURSES_SP_ARG);
+    killc = NCURSES_SP_NAME(killchar) (NCURSES_SP_ARG);
 
     oldstr = str;
     getyx(win, y, x);
@@ -144,7 +143,7 @@
 	    }
 	} else if (ch >= KEY_MIN
 		   || (maxlen >= 0 && str - oldstr >= maxlen)) {
-	    beep();
+	    NCURSES_SP_NAME(beep) (NCURSES_SP_ARG);
 	} else {
 	    *str++ = (char) ch;
 	    if (oldecho == TRUE) {
@@ -193,7 +192,7 @@
     sp->_raw = oldraw;
     sp->_cbreak = oldcbreak;
 
-    _nc_set_tty_mode(&buf);
+    NCURSES_SP_NAME(_nc_set_tty_mode) (NCURSES_SP_ARGx &buf);
 
     *str = '\0';
     if (ch == ERR)
diff -Naur ncurses-5.7.orig/ncurses/base/lib_hline.c ncurses-5.7/ncurses/base/lib_hline.c
--- ncurses-5.7.orig/ncurses/base/lib_hline.c	2006-03-11 16:52:27.000000000 -0500
+++ ncurses-5.7/ncurses/base/lib_hline.c	2011-01-08 18:18:29.746780939 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2001,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            *
@@ -40,16 +40,16 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_hline.c,v 1.11 2006/03/11 21:52:27 tom Exp $")
+MODULE_ID("$Id: lib_hline.c,v 1.13 2010/12/19 01:48:39 tom Exp $")
 
 NCURSES_EXPORT(int)
 whline(WINDOW *win, chtype ch, int n)
 {
     int code = ERR;
-    NCURSES_SIZE_T start;
-    NCURSES_SIZE_T end;
+    int start;
+    int end;
 
-    T((T_CALLED("whline(%p,%s,%d)"), win, _tracechtype(ch), n));
+    T((T_CALLED("whline(%p,%s,%d)"), (void *) win, _tracechtype(ch), n));
 
     if (win) {
 	struct ldat *line = &(win->_line[win->_cury]);
diff -Naur ncurses-5.7.orig/ncurses/base/lib_immedok.c ncurses-5.7/ncurses/base/lib_immedok.c
--- ncurses-5.7.orig/ncurses/base/lib_immedok.c	2000-12-09 21:43:27.000000000 -0500
+++ ncurses-5.7/ncurses/base/lib_immedok.c	2011-01-08 18:13:50.663157225 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998,2000 Free Software Foundation, Inc.                   *
+ * Copyright (c) 1998-2000,2009 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -40,12 +40,12 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_immedok.c,v 1.4 2000/12/10 02:43:27 tom Exp $")
+MODULE_ID("$Id: lib_immedok.c,v 1.5 2009/10/24 22:32:11 tom Exp $")
 
 NCURSES_EXPORT(void)
 immedok(WINDOW *win, bool flag)
 {
-    T((T_CALLED("immedok(%p,%d)"), win, flag));
+    T((T_CALLED("immedok(%p,%d)"), (void *) win, flag));
 
     if (win)
 	win->_immed = flag;
diff -Naur ncurses-5.7.orig/ncurses/base/lib_inchstr.c ncurses-5.7/ncurses/base/lib_inchstr.c
--- ncurses-5.7.orig/ncurses/base/lib_inchstr.c	2001-06-02 19:37:58.000000000 -0400
+++ ncurses-5.7/ncurses/base/lib_inchstr.c	2011-01-08 18:18:29.746780939 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998,2000,2001 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            *
@@ -29,6 +29,7 @@
 /****************************************************************************
  *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995               *
  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
+ *     and: Thomas E. Dickey                        1996-on                 *
  ****************************************************************************/
 
 /*
@@ -40,14 +41,14 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_inchstr.c,v 1.10 2001/06/02 23:37:58 skimo Exp $")
+MODULE_ID("$Id: lib_inchstr.c,v 1.12 2010/12/20 01:37:41 tom Exp $")
 
 NCURSES_EXPORT(int)
-winchnstr(WINDOW *win, chtype * str, int n)
+winchnstr(WINDOW *win, chtype *str, int n)
 {
     int i = 0;
 
-    T((T_CALLED("winchnstr(%p,%p,%d)"), win, str, n));
+    T((T_CALLED("winchnstr(%p,%p,%d)"), (void *) win, (void *) str, n));
 
     if (!str)
 	returnCode(0);
@@ -55,7 +56,7 @@
     if (win) {
 	for (; (n < 0 || (i < n)) && (win->_curx + i <= win->_maxx); i++)
 	    str[i] =
-		CharOf(win->_line[win->_cury].text[win->_curx + i]) |
+		(chtype) CharOf(win->_line[win->_cury].text[win->_curx + i]) |
 		AttrOf(win->_line[win->_cury].text[win->_curx + i]);
     }
     str[i] = (chtype) 0;
diff -Naur ncurses-5.7.orig/ncurses/base/lib_initscr.c ncurses-5.7/ncurses/base/lib_initscr.c
--- ncurses-5.7.orig/ncurses/base/lib_initscr.c	2008-08-16 17:20:48.000000000 -0400
+++ ncurses-5.7/ncurses/base/lib_initscr.c	2011-01-08 18:13:50.663157225 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -45,7 +45,7 @@
 #include <sys/termio.h>		/* needed for ISC */
 #endif
 
-MODULE_ID("$Id: lib_initscr.c,v 1.38 2008/08/16 21:20:48 Werner.Fink Exp $")
+MODULE_ID("$Id: lib_initscr.c,v 1.39 2009/02/14 20:55:49 tom Exp $")
 
 NCURSES_EXPORT(WINDOW *)
 initscr(void)
@@ -90,7 +90,11 @@
 	}
 
 	/* def_shell_mode - done in newterm/_nc_setupscreen */
+#if NCURSES_SP_FUNCS
+	NCURSES_SP_NAME(def_prog_mode) (CURRENT_SCREEN);
+#else
 	def_prog_mode();
+#endif
     }
     result = stdscr;
     _nc_unlock_global(curses);
diff -Naur ncurses-5.7.orig/ncurses/base/lib_insch.c ncurses-5.7/ncurses/base/lib_insch.c
--- ncurses-5.7.orig/ncurses/base/lib_insch.c	2008-02-02 19:14:37.000000000 -0500
+++ ncurses-5.7/ncurses/base/lib_insch.c	2011-01-08 18:13:50.663157225 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2005,2008 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -43,24 +43,31 @@
 #include <curses.priv.h>
 #include <ctype.h>
 
-MODULE_ID("$Id: lib_insch.c,v 1.25 2008/02/03 00:14:37 tom Exp $")
+MODULE_ID("$Id: lib_insch.c,v 1.32 2009/10/24 22:04:35 tom Exp $")
 
 /*
  * Insert the given character, updating the current location to simplify
  * inserting a string.
  */
 NCURSES_EXPORT(int)
-_nc_insert_ch(WINDOW *win, chtype ch)
+_nc_insert_ch(SCREEN *sp, WINDOW *win, chtype ch)
 {
     int code = OK;
     NCURSES_CH_T wch;
     int count;
     NCURSES_CONST char *s;
+    int tabsize = (
+#if USE_REENTRANT
+		      sp->_TABSIZE
+#else
+		      TABSIZE
+#endif
+    );
 
     switch (ch) {
     case '\t':
-	for (count = (TABSIZE - (win->_curx % TABSIZE)); count > 0; count--) {
-	    if ((code = _nc_insert_ch(win, ' ')) != OK)
+	for (count = (tabsize - (win->_curx % tabsize)); count > 0; count--) {
+	    if ((code = _nc_insert_ch(sp, win, ' ')) != OK)
 		break;
 	}
 	break;
@@ -76,7 +83,9 @@
 	       WINDOW_EXT(win, addch_used) == 0 &&
 #endif
 	       is8bits(ChCharOf(ch)) &&
-	       isprint(ChCharOf(ch))) {
+	       (isprint(ChCharOf(ch)) ||
+		(ChAttrOf(ch) & A_ALTCHARSET) ||
+		(sp != 0 && sp->_legacy_coding && !iscntrl(ChCharOf(ch))))) {
 	    if (win->_curx <= win->_maxx) {
 		struct ldat *line = &(win->_line[win->_cury]);
 		NCURSES_CH_T *end = &(line->text[win->_curx]);
@@ -93,9 +102,9 @@
 		win->_curx++;
 	    }
 	} else if (is8bits(ChCharOf(ch)) && iscntrl(ChCharOf(ch))) {
-	    s = unctrl(ChCharOf(ch));
+	    s = NCURSES_SP_NAME(unctrl) (NCURSES_SP_ARGx ChCharOf(ch));
 	    while (*s != '\0') {
-		code = _nc_insert_ch(win, ChAttrOf(ch) | UChar(*s));
+		code = _nc_insert_ch(sp, win, ChAttrOf(ch) | UChar(*s));
 		if (code != OK)
 		    break;
 		++s;
@@ -110,16 +119,21 @@
 	    wch = _nc_render(win, wch);
 	    count = _nc_build_wch(win, &wch);
 	    if (count > 0) {
-		code = wins_wch(win, &wch);
+		code = _nc_insert_wch(win, &wch);
 	    } else if (count == -1) {
 		/* handle EILSEQ */
 		if (is8bits(ch)) {
-		    s = unctrl(ChCharOf(ch));
-		    while (*s != '\0') {
-			code = _nc_insert_ch(win, ChAttrOf(ch) | UChar(*s));
-			if (code != OK)
-			    break;
-			++s;
+		    s = NCURSES_SP_NAME(unctrl) (NCURSES_SP_ARGx ChCharOf(ch));
+		    if (strlen(s) > 1) {
+			while (*s != '\0') {
+			    code = _nc_insert_ch(sp, win,
+						 ChAttrOf(ch) | UChar(*s));
+			    if (code != OK)
+				break;
+			    ++s;
+			}
+		    } else {
+			code = ERR;
 		    }
 		} else {
 		    code = ERR;
@@ -139,13 +153,13 @@
     NCURSES_SIZE_T ox;
     int code = ERR;
 
-    T((T_CALLED("winsch(%p, %s)"), win, _tracechtype(c)));
+    T((T_CALLED("winsch(%p, %s)"), (void *) win, _tracechtype(c)));
 
     if (win != 0) {
 	oy = win->_cury;
 	ox = win->_curx;
 
-	code = _nc_insert_ch(win, c);
+	code = _nc_insert_ch(_nc_screen_of(win), win, c);
 
 	win->_curx = ox;
 	win->_cury = oy;
diff -Naur ncurses-5.7.orig/ncurses/base/lib_insdel.c ncurses-5.7/ncurses/base/lib_insdel.c
--- ncurses-5.7.orig/ncurses/base/lib_insdel.c	2003-07-26 18:40:06.000000000 -0400
+++ ncurses-5.7/ncurses/base/lib_insdel.c	2011-01-08 18:13:50.663157225 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2001,2003 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -42,14 +42,14 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_insdel.c,v 1.12 2003/07/26 22:40:06 tom Exp $")
+MODULE_ID("$Id: lib_insdel.c,v 1.13 2009/10/24 22:34:41 tom Exp $")
 
 NCURSES_EXPORT(int)
 winsdelln(WINDOW *win, int n)
 {
     int code = ERR;
 
-    T((T_CALLED("winsdelln(%p,%d)"), win, n));
+    T((T_CALLED("winsdelln(%p,%d)"), (void *) win, n));
 
     if (win) {
 	if (n != 0) {
diff -Naur ncurses-5.7.orig/ncurses/base/lib_insnstr.c ncurses-5.7/ncurses/base/lib_insnstr.c
--- ncurses-5.7.orig/ncurses/base/lib_insnstr.c	2004-02-28 18:44:56.000000000 -0500
+++ ncurses-5.7/ncurses/base/lib_insnstr.c	2011-01-08 18:13:50.663157225 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2004 Free Software Foundation, Inc.                        *
+ * Copyright (c) 2004,2009 Free Software Foundation, Inc.                   *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -40,7 +40,7 @@
 #include <curses.priv.h>
 #include <ctype.h>
 
-MODULE_ID("$Id: lib_insnstr.c,v 1.1 2004/02/28 23:44:56 tom Exp $")
+MODULE_ID("$Id: lib_insnstr.c,v 1.3 2009/10/24 22:04:35 tom Exp $")
 
 NCURSES_EXPORT(int)
 winsnstr(WINDOW *win, const char *s, int n)
@@ -51,13 +51,15 @@
     const unsigned char *str = (const unsigned char *) s;
     const unsigned char *cp;
 
-    T((T_CALLED("winsnstr(%p,%s,%d)"), win, _nc_visbufn(s, n), n));
+    T((T_CALLED("winsnstr(%p,%s,%d)"), (void *) win, _nc_visbufn(s, n), n));
 
     if (win != 0 && str != 0) {
+	SCREEN *sp = _nc_screen_of(win);
+
 	oy = win->_cury;
 	ox = win->_curx;
 	for (cp = str; *cp && (n <= 0 || (cp - str) < n); cp++) {
-	    _nc_insert_ch(win, (chtype) UChar(*cp));
+	    _nc_insert_ch(sp, win, (chtype) UChar(*cp));
 	}
 	win->_curx = ox;
 	win->_cury = oy;
diff -Naur ncurses-5.7.orig/ncurses/base/lib_instr.c ncurses-5.7/ncurses/base/lib_instr.c
--- ncurses-5.7.orig/ncurses/base/lib_instr.c	2007-07-21 16:18:10.000000000 -0400
+++ ncurses-5.7/ncurses/base/lib_instr.c	2011-01-08 18:13:50.663157225 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2005,2007 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2007,2009 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -41,14 +41,14 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_instr.c,v 1.16 2007/07/21 20:18:10 tom Exp $")
+MODULE_ID("$Id: lib_instr.c,v 1.17 2009/10/24 22:55:45 tom Exp $")
 
 NCURSES_EXPORT(int)
 winnstr(WINDOW *win, char *str, int n)
 {
     int i = 0, row, col;
 
-    T((T_CALLED("winnstr(%p,%p,%d)"), win, str, n));
+    T((T_CALLED("winnstr(%p,%p,%d)"), (void *) win, str, n));
 
     if (!str)
 	returnCode(0);
@@ -79,18 +79,18 @@
 
 			init_mb(state);
 			n3 = wcstombs(0, wch, 0);
-			if (isEILSEQ(n3) || (n3 == 0)) {
-			    ;
-			} else if ((int) (n3 + i) > n) {
-			    done = TRUE;
-			} else if ((tmp = typeCalloc(char, n3 + 10)) == 0) {
-			    done = TRUE;
-			} else {
-			    init_mb(state);
-			    wcstombs(tmp, wch, n3);
-			    for (i3 = 0; i3 < n3; ++i3)
-				str[i++] = tmp[i3];
-			    free(tmp);
+			if (!isEILSEQ(n3) && (n3 != 0)) {
+			    if (((int) n3 + i) > n) {
+				done = TRUE;
+			    } else if ((tmp = typeCalloc(char, n3 + 10)) == 0) {
+				done = TRUE;
+			    } else {
+				init_mb(state);
+				wcstombs(tmp, wch, n3);
+				for (i3 = 0; i3 < n3; ++i3)
+				    str[i++] = tmp[i3];
+				free(tmp);
+			    }
 			}
 		    }
 		    free(wch);
diff -Naur ncurses-5.7.orig/ncurses/base/lib_isendwin.c ncurses-5.7/ncurses/base/lib_isendwin.c
--- ncurses-5.7.orig/ncurses/base/lib_isendwin.c	2000-12-09 21:43:27.000000000 -0500
+++ ncurses-5.7/ncurses/base/lib_isendwin.c	2011-01-08 18:13:50.663157225 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998,2000 Free Software Foundation, Inc.                   *
+ * Copyright (c) 1998-2000,2009 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -29,6 +29,8 @@
 /****************************************************************************
  *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995               *
  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
+ *     and: Thomas E. Dickey                        1996-on                 *
+ *     and: Juergen Pfeifer                         2009                    *
  ****************************************************************************/
 
 /*
@@ -40,12 +42,20 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_isendwin.c,v 1.6 2000/12/10 02:43:27 tom Exp $")
+MODULE_ID("$Id: lib_isendwin.c,v 1.7 2009/02/15 00:36:24 tom Exp $")
 
 NCURSES_EXPORT(bool)
-isendwin(void)
+NCURSES_SP_NAME(isendwin) (NCURSES_SP_DCL0)
 {
-    if (SP == NULL)
+    if (SP_PARM == NULL)
 	return FALSE;
-    return SP->_endwin;
+    return SP_PARM->_endwin;
+}
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(bool)
+isendwin(void)
+{
+    return NCURSES_SP_NAME(isendwin) (CURRENT_SCREEN);
 }
+#endif
diff -Naur ncurses-5.7.orig/ncurses/base/lib_leaveok.c ncurses-5.7/ncurses/base/lib_leaveok.c
--- ncurses-5.7.orig/ncurses/base/lib_leaveok.c	2000-12-09 21:43:27.000000000 -0500
+++ ncurses-5.7/ncurses/base/lib_leaveok.c	2011-01-08 18:13:50.663157225 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998,2000 Free Software Foundation, Inc.                   *
+ * Copyright (c) 1998-2000,2009 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -40,12 +40,12 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_leaveok.c,v 1.5 2000/12/10 02:43:27 tom Exp $")
+MODULE_ID("$Id: lib_leaveok.c,v 1.6 2009/10/24 22:34:23 tom Exp $")
 
 NCURSES_EXPORT(int)
 leaveok(WINDOW *win, bool flag)
 {
-    T((T_CALLED("leaveok(%p,%d)"), win, flag));
+    T((T_CALLED("leaveok(%p,%d)"), (void *) win, flag));
 
     if (win) {
 	win->_leaveok = flag;
diff -Naur ncurses-5.7.orig/ncurses/base/lib_mouse.c ncurses-5.7/ncurses/base/lib_mouse.c
--- ncurses-5.7.orig/ncurses/base/lib_mouse.c	2008-10-18 17:48:55.000000000 -0400
+++ ncurses-5.7/ncurses/base/lib_mouse.c	2011-01-08 18:18:29.814782179 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2007,2008 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            *
@@ -30,6 +30,7 @@
  *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995               *
  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
  *     and: Thomas E. Dickey                        1996-on                 *
+ *     and: Juergen Pfeifer                         2008                    *
  ****************************************************************************/
 
 /*
@@ -79,9 +80,12 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_mouse.c,v 1.102 2008/10/18 21:48:55 tom Exp $")
+#ifndef CUR
+#define CUR SP_TERMTYPE
+#endif
+
+MODULE_ID("$Id: lib_mouse.c,v 1.120 2011/01/01 22:25:49 tom Exp $")
 
-#include <term.h>
 #include <tic.h>
 
 #if USE_GPM_SUPPORT
@@ -118,12 +122,12 @@
 
 #define MY_TRACE TRACE_ICALLS|TRACE_IEVENT
 
-#define	MASK_RELEASE(x)		NCURSES_MOUSE_MASK(x, 001)
-#define	MASK_PRESS(x)		NCURSES_MOUSE_MASK(x, 002)
-#define	MASK_CLICK(x)		NCURSES_MOUSE_MASK(x, 004)
-#define	MASK_DOUBLE_CLICK(x)	NCURSES_MOUSE_MASK(x, 010)
-#define	MASK_TRIPLE_CLICK(x)	NCURSES_MOUSE_MASK(x, 020)
-#define	MASK_RESERVED_EVENT(x)	NCURSES_MOUSE_MASK(x, 040)
+#define	MASK_RELEASE(x)		(mmask_t) NCURSES_MOUSE_MASK(x, 001)
+#define	MASK_PRESS(x)		(mmask_t) NCURSES_MOUSE_MASK(x, 002)
+#define	MASK_CLICK(x)		(mmask_t) NCURSES_MOUSE_MASK(x, 004)
+#define	MASK_DOUBLE_CLICK(x)	(mmask_t) NCURSES_MOUSE_MASK(x, 010)
+#define	MASK_TRIPLE_CLICK(x)	(mmask_t) NCURSES_MOUSE_MASK(x, 020)
+#define	MASK_RESERVED_EVENT(x)	(mmask_t) NCURSES_MOUSE_MASK(x, 040)
 
 #if NCURSES_MOUSE_VERSION == 1
 #define BUTTON_CLICKED        (BUTTON1_CLICKED        | BUTTON2_CLICKED        | BUTTON3_CLICKED        | BUTTON4_CLICKED)
@@ -150,7 +154,7 @@
 #define LIBGPM_SONAME "libgpm.so"
 #endif
 
-#define GET_DLSYM(name) (my_##name = (TYPE_##name) dlsym(SP->_dlopen_gpm, #name))
+#define GET_DLSYM(name) (my_##name = (TYPE_##name) dlsym(sp->_dlopen_gpm, #name))
 
 #endif				/* USE_GPM_SUPPORT */
 
@@ -164,13 +168,13 @@
 #define LastEV(sp)	((sp)->_mouse_events + EV_MAX - 1)
 
 #undef  NEXT
-#define NEXT(ep)	((ep >= LastEV(sp)) \
-			 ? FirstEV(sp) \
+#define NEXT(ep)	((ep >= LastEV(SP_PARM)) \
+			 ? FirstEV(SP_PARM) \
 			 : ep + 1)
 
 #undef  PREV
-#define PREV(ep)	((ep <= FirstEV(sp)) \
-			 ? LastEV(sp) \
+#define PREV(ep)	((ep <= FirstEV(SP_PARM)) \
+			 ? LastEV(SP_PARM) \
 			 : ep - 1)
 
 #define IndexEV(sp, ep)	(ep - FirstEV(sp))
@@ -185,7 +189,7 @@
 {
     MEVENT *ep;
 
-    _tracef(tag);
+    _tracef("%s", tag);
 
     for (ep = FirstEV(sp); ep <= LastEV(sp); ep++)
 	_tracef("mouse event queue slot %ld = %s",
@@ -340,10 +344,13 @@
 static void
 handle_sysmouse(int sig GCC_UNUSED)
 {
-    sysmouse_server(SP);
+    sysmouse_server(CURRENT_SCREEN);
 }
 #endif /* USE_SYSMOUSE */
 
+#ifndef USE_TERM_DRIVER
+#define xterm_kmous "\033[M"
+
 static void
 init_xterm_mouse(SCREEN *sp)
 {
@@ -352,6 +359,7 @@
     if (!VALID_STRING(sp->_mouse_xtermcap))
 	sp->_mouse_xtermcap = "\033[?1000%?%p1%{1}%=%th%el%;";
 }
+#endif
 
 static void
 enable_xterm_mouse(SCREEN *sp, int enable)
@@ -359,7 +367,9 @@
 #if USE_EMX_MOUSE
     sp->_emxmouse_activated = enable;
 #else
-    putp(TPARM_1(sp->_mouse_xtermcap, enable));
+    NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx
+			       "xterm-mouse",
+			       TPARM_1(sp->_mouse_xtermcap, enable));
 #endif
     sp->_mouse_active = enable;
 }
@@ -398,7 +408,7 @@
 static void
 unload_gpm_library(SCREEN *sp)
 {
-    if (SP->_dlopen_gpm != 0) {
+    if (sp->_dlopen_gpm != 0) {
 	T(("unload GPM library"));
 	sp->_mouse_gpm_loaded = FALSE;
 	sp->_mouse_fd = -1;
@@ -440,6 +450,8 @@
 	}
 #endif
 	if (sp->_mouse_gpm_loaded) {
+	    int code;
+
 	    /* GPM: initialize connection to gpm server */
 	    sp->_mouse_gpm_connect.eventMask = GPM_DOWN | GPM_UP;
 	    sp->_mouse_gpm_connect.defaultMask =
@@ -454,7 +466,16 @@
 	     * The former is recognized by wscons (SunOS), and the latter by
 	     * xterm.  Those will not show up in ncurses' traces.
 	     */
-	    result = (my_Gpm_Open(&sp->_mouse_gpm_connect, 0) >= 0);
+	    code = my_Gpm_Open(&sp->_mouse_gpm_connect, 0);
+	    result = (code >= 0);
+
+	    /*
+	     * GPM can return a -2 if it is trying to do something with xterm.
+	     * Ignore that, since it conflicts with our use of stdin.
+	     */
+	    if (code == -2) {
+		my_Gpm_Close();
+	    }
 	} else {
 	    result = FALSE;
 	}
@@ -478,8 +499,6 @@
 }
 #endif /* USE_GPM_SUPPORT */
 
-#define xterm_kmous "\033[M"
-
 static void
 initialize_mousetype(SCREEN *sp)
 {
@@ -514,7 +533,7 @@
     /* OS/2 VIO */
 #if USE_EMX_MOUSE
     if (!sp->_emxmouse_thread
-	&& strstr(cur_term->type.term_names, "xterm") == 0
+	&& strstr(TerminalOf(sp)->type.term_names, "xterm") == 0
 	&& key_mouse) {
 	int handles[2];
 
@@ -621,16 +640,21 @@
     }
 #endif /* USE_SYSMOUSE */
 
+#ifdef USE_TERM_DRIVER
+    CallDriver(sp, initmouse);
+#else
     /* we know how to recognize mouse events under "xterm" */
     if (key_mouse != 0) {
 	if (!strcmp(key_mouse, xterm_kmous)
-	    || strstr(cur_term->type.term_names, "xterm") != 0) {
+	    || strstr(TerminalOf(sp)->type.term_names, "xterm") != 0) {
 	    init_xterm_mouse(sp);
 	}
-    } else if (strstr(cur_term->type.term_names, "xterm") != 0) {
+    } else if (strstr(TerminalOf(sp)->type.term_names, "xterm") != 0) {
 	if (_nc_add_to_try(&(sp->_keytry), xterm_kmous, KEY_MOUSE) == OK)
 	    init_xterm_mouse(sp);
     }
+#endif
+
     returnVoid;
 }
 
@@ -665,7 +689,7 @@
  * fifo_push() in lib_getch.c
  */
 static bool
-_nc_mouse_event(SCREEN *sp GCC_UNUSED)
+_nc_mouse_event(SCREEN *sp)
 {
     MEVENT *eventp = sp->_mouse_eventp;
     bool result = FALSE;
@@ -694,11 +718,16 @@
 
 #if USE_GPM_SUPPORT
     case M_GPM:
-	{
+	if (sp->_mouse_fd >= 0) {
 	    /* query server for event, return TRUE if we find one */
 	    Gpm_Event ev;
 
-	    if (my_Gpm_GetEvent(&ev) == 1) {
+	    switch (my_Gpm_GetEvent(&ev)) {
+	    case 0:
+		/* Connection closed, drop the mouse. */
+		sp->_mouse_fd = -1;
+		break;
+	    case 1:
 		/* there's only one mouse... */
 		eventp->id = NORMAL_EVENT;
 
@@ -729,8 +758,9 @@
 		eventp->z = 0;
 
 		/* bump the next-free pointer into the circular list */
-		sp->_mouse_eventp = eventp = NEXT(eventp);
+		sp->_mouse_eventp = NEXT(eventp);
 		result = TRUE;
+		break;
 	    }
 	}
 	break;
@@ -759,6 +789,28 @@
 	break;
 #endif /* USE_SYSMOUSE */
 
+#ifdef USE_TERM_DRIVER
+    case M_TERM_DRIVER:
+	while (sp->_drv_mouse_head < sp->_drv_mouse_tail) {
+	    *eventp = sp->_drv_mouse_fifo[sp->_drv_mouse_head];
+
+	    /*
+	     * Point the fifo-head to the next possible location.  If there
+	     * are none, reset the indices.
+	     */
+	    sp->_drv_mouse_head += 1;
+	    if (sp->_drv_mouse_head == sp->_drv_mouse_tail) {
+		sp->_drv_mouse_tail = 0;
+		sp->_drv_mouse_head = 0;
+	    }
+
+	    /* bump the next-free pointer into the circular list */
+	    sp->_mouse_eventp = eventp = NEXT(eventp);
+	    result = TRUE;
+	}
+	break;
+#endif
+
     case M_NONE:
 	break;
     }
@@ -814,17 +866,26 @@
 	 * Wheel mice may return buttons 4 and 5 when the wheel is turned.
 	 * We encode those as button presses.
 	 */
+# if USE_PTHREADS_EINTR
+#  if USE_WEAK_SYMBOLS
+	if ((pthread_self) && (pthread_kill) && (pthread_equal))
+#  endif
+	    _nc_globals.read_thread = pthread_self();
+# endif
 	for (grabbed = 0; grabbed < 3; grabbed += (size_t) res) {
 
 	    /* For VIO mouse we add extra bit 64 to disambiguate button-up. */
 #if USE_EMX_MOUSE
-	    res = read(M_FD(sp) >= 0 ? M_FD(sp) : sp->_ifd, &kbuf, 3);
+	    res = (int) read(M_FD(sp) >= 0 ? M_FD(sp) : sp->_ifd, &kbuf, 3);
 #else
-	    res = read(sp->_ifd, kbuf + grabbed, 3 - grabbed);
+	    res = (int) read(sp->_ifd, kbuf + grabbed, 3 - grabbed);
 #endif
 	    if (res == -1)
 		break;
 	}
+#if USE_PTHREADS_EINTR
+	_nc_globals.read_thread = 0;
+#endif
 	kbuf[3] = '\0';
 
 	TR(TRACE_IEVENT,
@@ -937,7 +998,7 @@
 	switch (sp->_mouse_type) {
 	case M_XTERM:
 #if NCURSES_EXT_FUNCS
-	    keyok(KEY_MOUSE, on);
+	    NCURSES_SP_NAME(keyok) (NCURSES_SP_ARGx KEY_MOUSE, on);
 #endif
 	    TPUTS_TRACE("xterm mouse initialization");
 	    enable_xterm_mouse(sp, 1);
@@ -956,6 +1017,11 @@
 	    sp->_mouse_active = TRUE;
 	    break;
 #endif
+#ifdef USE_TERM_DRIVER
+	case M_TERM_DRIVER:
+	    sp->_mouse_active = TRUE;
+	    break;
+#endif
 	case M_NONE:
 	    return;
 	}
@@ -985,11 +1051,16 @@
 	    sp->_mouse_active = FALSE;
 	    break;
 #endif
+#ifdef USE_TERM_DRIVER
+	case M_TERM_DRIVER:
+	    sp->_mouse_active = FALSE;
+	    break;
+#endif
 	case M_NONE:
 	    return;
 	}
     }
-    _nc_flush();
+    NCURSES_SP_NAME(_nc_flush) (NCURSES_SP_ARG);
 }
 
 /**************************************************************************
@@ -1222,6 +1293,11 @@
 	mouse_activate(sp, FALSE);
 	break;
 #endif
+#ifdef USE_TERM_DRIVER
+    case M_TERM_DRIVER:
+	mouse_activate(sp, FALSE);
+	break;
+#endif
     case M_NONE:
 	break;
     }
@@ -1253,6 +1329,13 @@
 	mouse_activate(sp, TRUE);
 	break;
 #endif
+
+#ifdef USE_TERM_DRIVER
+    case M_TERM_DRIVER:
+	mouse_activate(sp, TRUE);
+	break;
+#endif
+
     case M_NONE:
 	break;
     }
@@ -1264,80 +1347,92 @@
  *
  **************************************************************************/
 
-static int
-_nc_getmouse(SCREEN *sp, MEVENT * aevent)
+NCURSES_EXPORT(int)
+NCURSES_SP_NAME(getmouse) (NCURSES_SP_DCLx MEVENT * aevent)
 {
-    T((T_CALLED("getmouse(%p)"), aevent));
+    int result = ERR;
+
+    T((T_CALLED("getmouse(%p,%p)"), (void *) SP_PARM, (void *) aevent));
 
-    if ((aevent != 0) && (sp != 0) && (sp->_mouse_type != M_NONE)) {
-	MEVENT *eventp = sp->_mouse_eventp;
+    if ((aevent != 0) && (SP_PARM != 0) && (SP_PARM->_mouse_type != M_NONE)) {
+	MEVENT *eventp = SP_PARM->_mouse_eventp;
 	/* compute the current-event pointer */
 	MEVENT *prev = PREV(eventp);
 
-	/* copy the event we find there */
-	*aevent = *prev;
-
-	TR(TRACE_IEVENT, ("getmouse: returning event %s from slot %ld",
-			  _nc_tracemouse(sp, prev),
-			  (long) IndexEV(sp, prev)));
-
-	prev->id = INVALID_EVENT;	/* so the queue slot becomes free */
-	returnCode(OK);
+	if (prev->id != INVALID_EVENT) {
+	    /* copy the event we find there */
+	    *aevent = *prev;
+
+	    TR(TRACE_IEVENT, ("getmouse: returning event %s from slot %ld",
+			      _nc_tracemouse(SP_PARM, prev),
+			      (long) IndexEV(SP_PARM, prev)));
+
+	    prev->id = INVALID_EVENT;	/* so the queue slot becomes free */
+	    SP_PARM->_mouse_eventp = PREV(prev);
+	    result = OK;
+	}
     }
-    returnCode(ERR);
+    returnCode(result);
 }
 
+#if NCURSES_SP_FUNCS
 /* grab a copy of the current mouse event */
 NCURSES_EXPORT(int)
 getmouse(MEVENT * aevent)
 {
-    return _nc_getmouse(SP, aevent);
+    return NCURSES_SP_NAME(getmouse) (CURRENT_SCREEN, aevent);
 }
+#endif
 
-static int
-_nc_ungetmouse(SCREEN *sp, MEVENT * aevent)
+NCURSES_EXPORT(int)
+NCURSES_SP_NAME(ungetmouse) (NCURSES_SP_DCLx MEVENT * aevent)
 {
     int result = ERR;
 
-    T((T_CALLED("ungetmouse(%p)"), aevent));
+    T((T_CALLED("ungetmouse(%p,%p)"), (void *) SP_PARM, (void *) aevent));
 
-    if (aevent != 0 && sp != 0) {
-	MEVENT *eventp = sp->_mouse_eventp;
+    if (aevent != 0 && SP_PARM != 0) {
+	MEVENT *eventp = SP_PARM->_mouse_eventp;
 
 	/* stick the given event in the next-free slot */
 	*eventp = *aevent;
 
 	/* bump the next-free pointer into the circular list */
-	sp->_mouse_eventp = NEXT(eventp);
+	SP_PARM->_mouse_eventp = NEXT(eventp);
 
 	/* push back the notification event on the keyboard queue */
-	result = _nc_ungetch(sp, KEY_MOUSE);
+	result = NCURSES_SP_NAME(ungetch) (NCURSES_SP_ARGx KEY_MOUSE);
     }
     returnCode(result);
 }
 
+#if NCURSES_SP_FUNCS
 /* enqueue a synthesized mouse event to be seen by the next wgetch() */
 NCURSES_EXPORT(int)
 ungetmouse(MEVENT * aevent)
 {
-    return _nc_ungetmouse(SP, aevent);
+    return NCURSES_SP_NAME(ungetmouse) (CURRENT_SCREEN, aevent);
 }
+#endif
 
 NCURSES_EXPORT(mmask_t)
-mousemask(mmask_t newmask, mmask_t * oldmask)
+NCURSES_SP_NAME(mousemask) (NCURSES_SP_DCLx mmask_t newmask, mmask_t * oldmask)
 /* set the mouse event mask */
 {
     mmask_t result = 0;
 
-    T((T_CALLED("mousemask(%#lx,%p)"), (unsigned long) newmask, oldmask));
+    T((T_CALLED("mousemask(%p,%#lx,%p)"),
+       (void *) SP_PARM,
+       (unsigned long) newmask,
+       (void *) oldmask));
 
-    if (SP != 0) {
+    if (SP_PARM != 0) {
 	if (oldmask)
-	    *oldmask = SP->_mouse_mask;
+	    *oldmask = SP_PARM->_mouse_mask;
 
-	if (newmask || SP->_mouse_initialized) {
-	    _nc_mouse_init(SP);
-	    if (SP->_mouse_type != M_NONE) {
+	if (newmask || SP_PARM->_mouse_initialized) {
+	    _nc_mouse_init(SP_PARM);
+	    if (SP_PARM->_mouse_type != M_NONE) {
 		result = newmask &
 		    (REPORT_MOUSE_POSITION
 		     | BUTTON_ALT
@@ -1349,22 +1444,30 @@
 		     | BUTTON_DOUBLE_CLICKED
 		     | BUTTON_TRIPLE_CLICKED);
 
-		mouse_activate(SP, (bool) (result != 0));
+		mouse_activate(SP_PARM, (bool) (result != 0));
 
-		SP->_mouse_mask = result;
+		SP_PARM->_mouse_mask = result;
 	    }
 	}
     }
-    returnBits(result);
+    returnMMask(result);
 }
 
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(mmask_t)
+mousemask(mmask_t newmask, mmask_t * oldmask)
+{
+    return NCURSES_SP_NAME(mousemask) (CURRENT_SCREEN, newmask, oldmask);
+}
+#endif
+
 NCURSES_EXPORT(bool)
 wenclose(const WINDOW *win, int y, int x)
 /* check to see if given window encloses given screen location */
 {
     bool result = FALSE;
 
-    T((T_CALLED("wenclose(%p,%d,%d)"), win, y, x));
+    T((T_CALLED("wenclose(%p,%d,%d)"), (const void *) win, y, x));
 
     if (win != 0) {
 	y -= win->_yoffset;
@@ -1377,17 +1480,17 @@
 }
 
 NCURSES_EXPORT(int)
-mouseinterval(int maxclick)
+NCURSES_SP_NAME(mouseinterval) (NCURSES_SP_DCLx int maxclick)
 /* set the maximum mouse interval within which to recognize a click */
 {
     int oldval;
 
-    T((T_CALLED("mouseinterval(%d)"), maxclick));
+    T((T_CALLED("mouseinterval(%p,%d)"), (void *) SP_PARM, maxclick));
 
-    if (SP != 0) {
-	oldval = SP->_maxclick;
+    if (SP_PARM != 0) {
+	oldval = SP_PARM->_maxclick;
 	if (maxclick >= 0)
-	    SP->_maxclick = maxclick;
+	    SP_PARM->_maxclick = maxclick;
     } else {
 	oldval = DEFAULT_MAXCLICK;
     }
@@ -1395,20 +1498,46 @@
     returnCode(oldval);
 }
 
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+mouseinterval(int maxclick)
+{
+    return NCURSES_SP_NAME(mouseinterval) (CURRENT_SCREEN, maxclick);
+}
+#endif
+
 /* This may be used by other routines to ask for the existence of mouse
    support */
-NCURSES_EXPORT(int)
-_nc_has_mouse(void)
+NCURSES_EXPORT(bool)
+_nc_has_mouse(SCREEN *sp)
+{
+    return (((0 == sp) || (sp->_mouse_type == M_NONE)) ? FALSE : TRUE);
+}
+
+NCURSES_EXPORT(bool)
+NCURSES_SP_NAME(has_mouse) (NCURSES_SP_DCL0)
 {
-    return (SP->_mouse_type == M_NONE ? 0 : 1);
+    return _nc_has_mouse(SP_PARM);
 }
 
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(bool)
+has_mouse(void)
+{
+    return _nc_has_mouse(CURRENT_SCREEN);
+}
+#endif
+
 NCURSES_EXPORT(bool)
 wmouse_trafo(const WINDOW *win, int *pY, int *pX, bool to_screen)
 {
     bool result = FALSE;
 
-    T((T_CALLED("wmouse_trafo(%p,%p,%p,%d)"), win, pY, pX, to_screen));
+    T((T_CALLED("wmouse_trafo(%p,%p,%p,%d)"),
+       (const void *) win,
+       (void *) pY,
+       (void *) pX,
+       to_screen));
 
     if (win && pY && pX) {
 	int y = *pY;
diff -Naur ncurses-5.7.orig/ncurses/base/lib_move.c ncurses-5.7/ncurses/base/lib_move.c
--- ncurses-5.7.orig/ncurses/base/lib_move.c	2004-12-04 16:50:07.000000000 -0500
+++ ncurses-5.7/ncurses/base/lib_move.c	2011-01-08 18:13:50.667157344 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2000,2004 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2004,2009 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -41,12 +41,12 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_move.c,v 1.12 2004/12/04 21:50:07 tom Exp $")
+MODULE_ID("$Id: lib_move.c,v 1.13 2009/10/24 22:34:07 tom Exp $")
 
 NCURSES_EXPORT(int)
 wmove(WINDOW *win, int y, int x)
 {
-    T((T_CALLED("wmove(%p,%d,%d)"), win, y, x));
+    T((T_CALLED("wmove(%p,%d,%d)"), (void *) win, y, x));
 
     if (LEGALYX(win, y, x)) {
 	win->_curx = (NCURSES_SIZE_T) x;
diff -Naur ncurses-5.7.orig/ncurses/base/lib_mvwin.c ncurses-5.7/ncurses/base/lib_mvwin.c
--- ncurses-5.7.orig/ncurses/base/lib_mvwin.c	2006-02-25 17:53:46.000000000 -0500
+++ ncurses-5.7/ncurses/base/lib_mvwin.c	2011-01-08 18:18:29.746780939 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2001,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            *
@@ -29,6 +29,8 @@
 /****************************************************************************
  *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995               *
  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
+ *     and: Thomas E. Dickey                        1996-on                 *
+ *     and: Juergen Pfeifer                                                 *
  ****************************************************************************/
 
 /*
@@ -40,12 +42,16 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_mvwin.c,v 1.14 2006/02/25 22:53:46 tom Exp $")
+MODULE_ID("$Id: lib_mvwin.c,v 1.18 2010/12/19 01:22:58 tom Exp $")
 
 NCURSES_EXPORT(int)
 mvwin(WINDOW *win, int by, int bx)
 {
-    T((T_CALLED("mvwin(%p,%d,%d)"), win, by, bx));
+#if NCURSES_SP_FUNCS
+    SCREEN *sp = _nc_screen_of(win);
+#endif
+
+    T((T_CALLED("mvwin(%p,%d,%d)"), (void *) win, by, bx));
 
     if (!win || (win->_flags & _ISPAD))
 	returnCode(ERR);
@@ -96,8 +102,8 @@
     }
 #endif
 
-    if (by + win->_maxy > screen_lines - 1
-	|| bx + win->_maxx > screen_columns - 1
+    if (by + win->_maxy > screen_lines(SP_PARM) - 1
+	|| bx + win->_maxx > screen_columns(SP_PARM) - 1
 	|| by < 0
 	|| bx < 0)
 	returnCode(ERR);
@@ -108,7 +114,7 @@
      * new location.  This ensures that if the caller has refreshed another
      * window at the same location, that this one will be displayed.
      */
-    win->_begy = by;
-    win->_begx = bx;
+    win->_begy = (NCURSES_SIZE_T) by;
+    win->_begx = (NCURSES_SIZE_T) bx;
     returnCode(touchwin(win));
 }
diff -Naur ncurses-5.7.orig/ncurses/base/lib_newterm.c ncurses-5.7/ncurses/base/lib_newterm.c
--- ncurses-5.7.orig/ncurses/base/lib_newterm.c	2008-08-16 17:20:48.000000000 -0400
+++ ncurses-5.7/ncurses/base/lib_newterm.c	2011-01-08 18:13:50.667157344 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2007,2008 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            *
@@ -30,6 +30,7 @@
  *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995               *
  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
  *     and: Thomas E. Dickey                        1996-on                 *
+ *     and: Juergen Pfeifer                         2009                    *
  ****************************************************************************/
 
 /*
@@ -45,10 +46,19 @@
 #define _POSIX_SOURCE
 #endif
 
-#include <term.h>		/* clear_screen, cup & friends, cur_term */
+#ifndef CUR
+#define CUR SP_TERMTYPE
+#endif
+
 #include <tic.h>
 
-MODULE_ID("$Id: lib_newterm.c,v 1.73 2008/08/16 21:20:48 Werner.Fink Exp $")
+MODULE_ID("$Id: lib_newterm.c,v 1.86 2010/05/20 23:25:18 tom Exp $")
+
+#ifdef USE_TERM_DRIVER
+#define NumLabels      InfoOf(SP_PARM).numlabels
+#else
+#define NumLabels      num_labels
+#endif
 
 #ifndef ONLCR			/* Allows compilation under the QNX 4.2 OS */
 #define ONLCR 0
@@ -63,27 +73,29 @@
  * is supposed to behave as if it calls newterm, we do it here.
  */
 static NCURSES_INLINE int
-_nc_initscr(void)
+_nc_initscr(NCURSES_SP_DCL0)
 {
     int result = ERR;
+    TERMINAL *term = TerminalOf(SP_PARM);
 
     /* for extended XPG4 conformance requires cbreak() at this point */
     /* (SVr4 curses does this anyway) */
-    if (cbreak() == OK) {
+    if (NCURSES_SP_NAME(cbreak) (NCURSES_SP_ARG) == OK) {
 	TTY buf;
 
-	buf = cur_term->Nttyb;
+	buf = term->Nttyb;
 #ifdef TERMIOS
-	buf.c_lflag &= ~(ECHO | ECHONL);
-	buf.c_iflag &= ~(ICRNL | INLCR | IGNCR);
-	buf.c_oflag &= ~(ONLCR);
+	buf.c_lflag &= (unsigned) ~(ECHO | ECHONL);
+	buf.c_iflag &= (unsigned) ~(ICRNL | INLCR | IGNCR);
+	buf.c_oflag &= (unsigned) ~(ONLCR);
 #elif HAVE_SGTTY_H
 	buf.sg_flags &= ~(ECHO | CRMOD);
 #else
 	memset(&buf, 0, sizeof(buf));
 #endif
-	if ((result = _nc_set_tty_mode(&buf)) == OK)
-	    cur_term->Nttyb = buf;
+	result = NCURSES_SP_NAME(_nc_set_tty_mode) (NCURSES_SP_ARGx &buf);
+	if (result == OK)
+	    term->Nttyb = buf;
     }
     return result;
 }
@@ -95,13 +107,30 @@
  * initialized.
  */
 NCURSES_EXPORT(void)
+NCURSES_SP_NAME(filter) (NCURSES_SP_DCL0)
+{
+    START_TRACE();
+    T((T_CALLED("filter(%p)"), (void *) SP_PARM));
+#if NCURSES_SP_FUNCS
+    if (IsPreScreen(SP_PARM)) {
+	SP_PARM->_filtered = TRUE;
+    }
+#else
+    _nc_prescreen.filter_mode = TRUE;
+#endif
+    returnVoid;
+}
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(void)
 filter(void)
 {
     START_TRACE();
-    T((T_CALLED("filter")));
+    T((T_CALLED("filter()")));
     _nc_prescreen.filter_mode = TRUE;
     returnVoid;
 }
+#endif
 
 #if NCURSES_EXT_FUNCS
 /*
@@ -109,62 +138,125 @@
  * requiring it to also be filtered.
  */
 NCURSES_EXPORT(void)
+NCURSES_SP_NAME(nofilter) (NCURSES_SP_DCL0)
+{
+    START_TRACE();
+    T((T_CALLED("nofilter(%p)"), (void *) SP_PARM));
+#if NCURSES_SP_FUNCS
+    if (IsPreScreen(SP_PARM)) {
+	SP_PARM->_filtered = FALSE;
+    }
+#else
+    _nc_prescreen.filter_mode = FALSE;
+#endif
+    returnVoid;
+}
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(void)
 nofilter(void)
 {
     START_TRACE();
-    T((T_CALLED("nofilter")));
+    T((T_CALLED("nofilter()")));
     _nc_prescreen.filter_mode = FALSE;
     returnVoid;
 }
 #endif
+#endif /* NCURSES_EXT_FUNCS */
 
 NCURSES_EXPORT(SCREEN *)
-newterm(NCURSES_CONST char *name, FILE *ofp, FILE *ifp)
+NCURSES_SP_NAME(newterm) (NCURSES_SP_DCLx
+			  NCURSES_CONST char *name,
+			  FILE *ofp,
+			  FILE *ifp)
 {
     int value;
     int errret;
-    SCREEN *current;
     SCREEN *result = 0;
+    SCREEN *current;
     TERMINAL *its_term;
+    FILE *_ofp = ofp ? ofp : stdout;
+    FILE *_ifp = ifp ? ifp : stdin;
+    int cols;
+    int slk_format;
+    int filter_mode;
+    TERMINAL *new_term = 0;
 
     START_TRACE();
-    T((T_CALLED("newterm(\"%s\",%p,%p)"), name, ofp, ifp));
+    T((T_CALLED("newterm(%p, \"%s\", %p,%p)"),
+       (void *) SP_PARM,
+       name,
+       (void *) ofp,
+       (void *) ifp));
+
+#if NCURSES_SP_FUNCS
+    assert(SP_PARM != 0);
+    if (SP_PARM == 0)
+	returnSP(SP_PARM);
+#endif
 
     _nc_init_pthreads();
     _nc_lock_global(curses);
 
-    current = SP;
-    its_term = (SP ? SP->_term : 0);
+    current = CURRENT_SCREEN;
+    its_term = (current ? current->_term : 0);
 
+    INIT_TERM_DRIVER();
     /* this loads the capability entry, then sets LINES and COLS */
-    if (setupterm(name, fileno(ofp), &errret) != ERR) {
-	int slk_format = _nc_globals.slk_format;
+    if (
+#if NCURSES_SP_FUNCS
+	   SP_PARM->_prescreen &&
+#endif
+	   TINFO_SETUP_TERM(&new_term, name,
+			    fileno(_ofp), &errret, FALSE) != ERR) {
+
+	_nc_set_screen(0);
+#ifdef USE_TERM_DRIVER
+	assert(new_term != 0);
+#endif
+
+#if NCURSES_SP_FUNCS
+	slk_format = SP_PARM->slk_format;
+	filter_mode = SP_PARM->_filtered;
+#else
+	slk_format = _nc_globals.slk_format;
+	filter_mode = _nc_prescreen.filter_mode;
+#endif
 
 	/*
 	 * This actually allocates the screen structure, and saves the original
 	 * terminal settings.
 	 */
-	_nc_set_screen(0);
-
-	/* allow user to set maximum escape delay from the environment */
-	if ((value = _nc_getenv_num("ESCDELAY")) >= 0) {
-	    set_escdelay(value);
-	}
-
-	if (_nc_setupscreen(LINES,
-			    COLS,
-			    ofp,
-			    _nc_prescreen.filter_mode,
-			    slk_format) == ERR) {
+	if (NCURSES_SP_NAME(_nc_setupscreen) (
+#if NCURSES_SP_FUNCS
+						 &SP_PARM,
+#endif
+						 *(ptrLines(SP_PARM)),
+						 *(ptrCols(SP_PARM)),
+						 _ofp,
+						 filter_mode,
+						 slk_format) == ERR) {
 	    _nc_set_screen(current);
 	    result = 0;
 	} else {
-	    assert(SP != 0);
+#ifdef USE_TERM_DRIVER
+	    TERMINAL_CONTROL_BLOCK *TCB;
+#elif !NCURSES_SP_FUNCS
+	    _nc_set_screen(CURRENT_SCREEN);
+#endif
+	    assert(SP_PARM != 0);
+	    cols = *(ptrCols(SP_PARM));
+#ifdef USE_TERM_DRIVER
+	    _nc_set_screen(SP_PARM);
+	    TCB = (TERMINAL_CONTROL_BLOCK *) new_term;
+	    TCB->csp = SP_PARM;
+#endif
 	    /*
 	     * In setupterm() we did a set_curterm(), but it was before we set
-	     * SP.  So the "current" screen's terminal pointer was overwritten
-	     * with a different terminal.  Later, in _nc_setupscreen(), we set
-	     * SP and the terminal pointer in the new screen.
+	     * CURRENT_SCREEN.  So the "current" screen's terminal pointer was
+	     * overwritten with a different terminal.  Later, in
+	     * _nc_setupscreen(), we set CURRENT_SCREEN and the terminal
+	     * pointer in the new screen.
 	     *
 	     * Restore the terminal-pointer for the pre-existing screen, if
 	     * any.
@@ -172,37 +264,53 @@
 	    if (current)
 		current->_term = its_term;
 
+#ifdef USE_TERM_DRIVER
+	    SP_PARM->_term = new_term;
+#else
+	    new_term = SP_PARM->_term;
+#endif
+
+	    /* allow user to set maximum escape delay from the environment */
+	    if ((value = _nc_getenv_num("ESCDELAY")) >= 0) {
+		NCURSES_SP_NAME(set_escdelay) (NCURSES_SP_ARGx value);
+	    }
+
 	    /* if the terminal type has real soft labels, set those up */
-	    if (slk_format && num_labels > 0 && SLK_STDFMT(slk_format))
-		_nc_slk_initialize(stdscr, COLS);
+	    if (slk_format && NumLabels > 0 && SLK_STDFMT(slk_format))
+		_nc_slk_initialize(StdScreen(SP_PARM), cols);
 
-	    SP->_ifd = fileno(ifp);
-	    typeahead(fileno(ifp));
+	    SP_PARM->_ifd = fileno(_ifp);
+	    NCURSES_SP_NAME(typeahead) (NCURSES_SP_ARGx fileno(_ifp));
 #ifdef TERMIOS
-	    SP->_use_meta = ((cur_term->Ottyb.c_cflag & CSIZE) == CS8 &&
-			     !(cur_term->Ottyb.c_iflag & ISTRIP));
+	    SP_PARM->_use_meta = ((new_term->Ottyb.c_cflag & CSIZE) == CS8 &&
+				  !(new_term->Ottyb.c_iflag & ISTRIP));
 #else
-	    SP->_use_meta = FALSE;
+	    SP_PARM->_use_meta = FALSE;
 #endif
-	    SP->_endwin = FALSE;
-
+	    SP_PARM->_endwin = FALSE;
+#ifndef USE_TERM_DRIVER
 	    /*
 	     * Check whether we can optimize scrolling under dumb terminals in
 	     * case we do not have any of these capabilities, scrolling
 	     * optimization will be useless.
 	     */
-	    SP->_scrolling = ((scroll_forward && scroll_reverse) ||
-			      ((parm_rindex ||
-				parm_insert_line ||
-				insert_line) &&
-			       (parm_index ||
-				parm_delete_line ||
-				delete_line)));
+	    SP_PARM->_scrolling = ((scroll_forward && scroll_reverse) ||
+				   ((parm_rindex ||
+				     parm_insert_line ||
+				     insert_line) &&
+				    (parm_index ||
+				     parm_delete_line ||
+				     delete_line)));
+#endif
 
-	    baudrate();		/* sets a field in the SP structure */
+	    NCURSES_SP_NAME(baudrate) (NCURSES_SP_ARG);		/* sets a field in the screen structure */
 
-	    SP->_keytry = 0;
+	    SP_PARM->_keytry = 0;
 
+	    /* compute movement costs so we can do better move optimization */
+#ifdef USE_TERM_DRIVER
+	    TCBOf(SP_PARM)->drv->scinit(SP_PARM);
+#else
 	    /*
 	     * Check for mismatched graphic-rendition capabilities.  Most SVr4
 	     * terminfo trees contain entries that have rmul or rmso equated to
@@ -213,23 +321,31 @@
 	     * shouldn't be looking at this detail.
 	     */
 #define SGR0_TEST(mode) (mode != 0) && (exit_attribute_mode == 0 || strcmp(mode, exit_attribute_mode))
-	    SP->_use_rmso = SGR0_TEST(exit_standout_mode);
-	    SP->_use_rmul = SGR0_TEST(exit_underline_mode);
+	    SP_PARM->_use_rmso = SGR0_TEST(exit_standout_mode);
+	    SP_PARM->_use_rmul = SGR0_TEST(exit_underline_mode);
 
 	    /* compute movement costs so we can do better move optimization */
 	    _nc_mvcur_init();
 
 	    /* initialize terminal to a sane state */
 	    _nc_screen_init();
+#endif
 
 	    /* Initialize the terminal line settings. */
-	    _nc_initscr();
+	    _nc_initscr(NCURSES_SP_ARG);
 
 	    _nc_signal_handler(TRUE);
-
-	    result = SP;
+	    result = SP_PARM;
 	}
     }
     _nc_unlock_global(curses);
     returnSP(result);
 }
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(SCREEN *)
+newterm(NCURSES_CONST char *name, FILE *ofp, FILE *ifp)
+{
+    return NCURSES_SP_NAME(newterm) (CURRENT_SCREEN_PRE, name, ofp, ifp);
+}
+#endif
diff -Naur ncurses-5.7.orig/ncurses/base/lib_newwin.c ncurses-5.7/ncurses/base/lib_newwin.c
--- ncurses-5.7.orig/ncurses/base/lib_newwin.c	2008-06-07 09:58:09.000000000 -0400
+++ ncurses-5.7/ncurses/base/lib_newwin.c	2011-01-08 18:13:50.667157344 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2007,2008 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            *
@@ -30,6 +30,7 @@
  *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995               *
  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
  *     and: Thomas E. Dickey                        1996-on                 *
+ *     and: Juergen Pfeifer                         2009                    *
  ****************************************************************************/
 
 /*
@@ -42,7 +43,7 @@
 #include <curses.priv.h>
 #include <stddef.h>
 
-MODULE_ID("$Id: lib_newwin.c,v 1.52 2008/06/07 13:58:09 tom Exp $")
+MODULE_ID("$Id: lib_newwin.c,v 1.66 2010/04/24 23:31:18 tom Exp $")
 
 #define window_is(name) ((sp)->_##name == win)
 
@@ -61,6 +62,17 @@
 {
     SCREEN *sp;
 
+#ifdef USE_SP_WINDOWLIST
+    if ((sp = _nc_screen_of(win)) != 0) {
+	if (window_is(curscr)) {
+	    remove_window(curscr);
+	} else if (window_is(stdscr)) {
+	    remove_window(stdscr);
+	} else if (window_is(newscr)) {
+	    remove_window(newscr);
+	}
+    }
+#else
     for (each_screen(sp)) {
 	if (window_is(curscr)) {
 	    remove_window(curscr);
@@ -73,6 +85,7 @@
 	    break;
 	}
     }
+#endif
 }
 
 NCURSES_EXPORT(int)
@@ -81,17 +94,20 @@
     WINDOWLIST *p, *q;
     int i;
     int result = ERR;
+#ifdef USE_SP_WINDOWLIST
+    SCREEN *sp = _nc_screen_of(win);	/* pretend this is parameter */
+#endif
 
-    T((T_CALLED("_nc_freewin(%p)"), win));
+    T((T_CALLED("_nc_freewin(%p)"), (void *) win));
 
     if (win != 0) {
-	if (_nc_try_global(curses) == 0) {
+	if (_nc_nonsp_try_global(curses) == 0) {
 	    q = 0;
-	    for (each_window(p)) {
+	    for (each_window(SP_PARM, p)) {
 		if (&(p->win) == win) {
 		    remove_window_from_screen(win);
 		    if (q == 0)
-			_nc_windows = p->next;
+			WindowList(SP_PARM) = p->next;
 		    else
 			q->next = p->next;
 
@@ -103,35 +119,39 @@
 		    free(p);
 
 		    result = OK;
-		    T(("...deleted win=%p", win));
+		    T(("...deleted win=%p", (void *) win));
 		    break;
 		}
 		q = p;
 	    }
-	    _nc_unlock_global(curses);
+	    _nc_nonsp_unlock_global(curses);
 	}
     }
     returnCode(result);
 }
 
 NCURSES_EXPORT(WINDOW *)
-newwin(int num_lines, int num_columns, int begy, int begx)
+NCURSES_SP_NAME(newwin) (NCURSES_SP_DCLx
+			 int num_lines, int num_columns, int begy, int begx)
 {
     WINDOW *win;
     NCURSES_CH_T *ptr;
     int i;
 
-    T((T_CALLED("newwin(%d,%d,%d,%d)"), num_lines, num_columns, begy, begx));
+    T((T_CALLED("newwin(%p, %d,%d,%d,%d)"), (void *) SP_PARM, num_lines, num_columns,
+       begy, begx));
 
     if (begy < 0 || begx < 0 || num_lines < 0 || num_columns < 0)
 	returnWin(0);
 
     if (num_lines == 0)
-	num_lines = SP->_lines_avail - begy;
+	num_lines = SP_PARM->_lines_avail - begy;
     if (num_columns == 0)
-	num_columns = screen_columns - begx;
+	num_columns = screen_columns(SP_PARM) - begx;
 
-    if ((win = _nc_makenew(num_lines, num_columns, begy, begx, 0)) == 0)
+    win = NCURSES_SP_NAME(_nc_makenew) (NCURSES_SP_ARGx
+					num_lines, num_columns, begy, begx, 0);
+    if (win == 0)
 	returnWin(0);
 
     for (i = 0; i < num_lines; i++) {
@@ -149,14 +169,30 @@
     returnWin(win);
 }
 
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(WINDOW *)
+newwin(int num_lines, int num_columns, int begy, int begx)
+{
+    WINDOW *win;
+    _nc_sp_lock_global(curses);
+    win = NCURSES_SP_NAME(newwin) (CURRENT_SCREEN,
+				   num_lines, num_columns, begy, begx);
+    _nc_sp_unlock_global(curses);
+    return (win);
+}
+#endif
+
 NCURSES_EXPORT(WINDOW *)
 derwin(WINDOW *orig, int num_lines, int num_columns, int begy, int begx)
 {
     WINDOW *win;
     int i;
     int flags = _SUBWIN;
+#if NCURSES_SP_FUNCS
+    SCREEN *sp = _nc_screen_of(orig);
+#endif
 
-    T((T_CALLED("derwin(%p,%d,%d,%d,%d)"), orig, num_lines, num_columns,
+    T((T_CALLED("derwin(%p,%d,%d,%d,%d)"), (void *) orig, num_lines, num_columns,
        begy, begx));
 
     /*
@@ -177,8 +213,10 @@
     if (orig->_flags & _ISPAD)
 	flags |= _ISPAD;
 
-    if ((win = _nc_makenew(num_lines, num_columns, orig->_begy + begy,
-			   orig->_begx + begx, flags)) == 0)
+    win = NCURSES_SP_NAME(_nc_makenew) (NCURSES_SP_ARGx num_lines, num_columns,
+					orig->_begy + begy,
+					orig->_begx + begx, flags);
+    if (win == 0)
 	returnWin(0);
 
     win->_pary = begy;
@@ -197,7 +235,7 @@
 NCURSES_EXPORT(WINDOW *)
 subwin(WINDOW *w, int l, int c, int y, int x)
 {
-    T((T_CALLED("subwin(%p, %d, %d, %d, %d)"), w, l, c, y, x));
+    T((T_CALLED("subwin(%p, %d, %d, %d, %d)"), (void *) w, l, c, y, x));
     T(("parent has begy = %ld, begx = %ld", (long) w->_begy, (long) w->_begx));
 
     returnWin(derwin(w, l, c, y - w->_begy, x - w->_begx));
@@ -206,21 +244,27 @@
 static bool
 dimension_limit(int value)
 {
-    NCURSES_SIZE_T test = value;
+    NCURSES_SIZE_T test = (NCURSES_SIZE_T) value;
     return (test == value && value > 0);
 }
 
 NCURSES_EXPORT(WINDOW *)
-_nc_makenew(int num_lines, int num_columns, int begy, int begx, int flags)
+NCURSES_SP_NAME(_nc_makenew) (NCURSES_SP_DCLx
+			      int num_lines,
+			      int num_columns,
+			      int begy,
+			      int begx,
+			      int flags)
 {
     int i;
     WINDOWLIST *wp;
     WINDOW *win;
-    bool is_pad = (flags & _ISPAD);
+    bool is_padwin = (flags & _ISPAD);
 
-    T((T_CALLED("_nc_makenew(%d,%d,%d,%d)"), num_lines, num_columns, begy, begx));
+    T((T_CALLED("_nc_makenew(%p,%d,%d,%d,%d)"),
+       (void *) SP_PARM, num_lines, num_columns, begy, begx));
 
-    if (SP == 0)
+    if (SP_PARM == 0)
 	returnWin(0);
 
     if (!dimension_limit(num_lines) || !dimension_limit(num_columns))
@@ -232,26 +276,28 @@
     win = &(wp->win);
 
     if ((win->_line = typeCalloc(struct ldat, ((unsigned) num_lines))) == 0) {
-	free(win);
+	free(wp);
 	returnWin(0);
     }
 
-    _nc_lock_global(curses);
+    _nc_nonsp_lock_global(curses);
 
     win->_curx = 0;
     win->_cury = 0;
-    win->_maxy = num_lines - 1;
-    win->_maxx = num_columns - 1;
-    win->_begy = begy;
-    win->_begx = begx;
-    win->_yoffset = SP->_topstolen;
+    win->_maxy = (NCURSES_SIZE_T) (num_lines - 1);
+    win->_maxx = (NCURSES_SIZE_T) (num_columns - 1);
+    win->_begy = (NCURSES_SIZE_T) begy;
+    win->_begx = (NCURSES_SIZE_T) begx;
+    win->_yoffset = SP_PARM->_topstolen;
 
-    win->_flags = flags;
+    win->_flags = (short) flags;
     WINDOW_ATTRS(win) = A_NORMAL;
     SetChar(win->_nc_bkgd, BLANK_TEXT, BLANK_ATTR);
 
-    win->_clear = is_pad ? FALSE : (num_lines == screen_lines
-				    && num_columns == screen_columns);
+    win->_clear = (is_padwin
+		   ? FALSE
+		   : (num_lines == screen_lines(SP_PARM)
+		      && num_columns == screen_columns(SP_PARM)));
     win->_idlok = FALSE;
     win->_idcok = TRUE;
     win->_scroll = FALSE;
@@ -265,7 +311,7 @@
     win->_parent = 0;
 
     win->_regtop = 0;
-    win->_regbottom = num_lines - 1;
+    win->_regbottom = (NCURSES_SIZE_T) (num_lines - 1);
 
     win->_pad._pad_y = -1;
     win->_pad._pad_x = -1;
@@ -295,28 +341,28 @@
 	 * So that's how we want ncurses to behave.
 	 */
 	win->_line[i].firstchar = 0;
-	win->_line[i].lastchar = num_columns - 1;
+	win->_line[i].lastchar = (NCURSES_SIZE_T) (num_columns - 1);
 
 	if_USE_SCROLL_HINTS(win->_line[i].oldindex = i);
     }
 
-    if (!is_pad && (begx + num_columns == screen_columns)) {
+    if (!is_padwin && (begx + num_columns == screen_columns(SP_PARM))) {
 	win->_flags |= _ENDLINE;
 
-	if (begx == 0 && num_lines == screen_lines && begy == 0)
+	if (begx == 0 && num_lines == screen_lines(SP_PARM) && begy == 0)
 	    win->_flags |= _FULLWIN;
 
-	if (begy + num_lines == screen_lines)
+	if (begy + num_lines == screen_lines(SP_PARM))
 	    win->_flags |= _SCROLLWIN;
     }
 
-    wp->next = _nc_windows;
-    wp->screen = SP;
-    _nc_windows = wp;
+    wp->next = WindowList(SP_PARM);
+    wp->screen = SP_PARM;
+    WindowList(SP_PARM) = wp;
 
-    T((T_CREATE("window %p"), win));
+    T((T_CREATE("window %p"), (void *) win));
 
-    _nc_unlock_global(curses);
+    _nc_nonsp_unlock_global(curses);
     returnWin(win);
 }
 
@@ -325,14 +371,22 @@
  * internally, and it is useful to allow those to be invoked without switching
  * SCREEN's, e.g., for multi-threaded applications.
  */
-NCURSES_EXPORT(SCREEN *)
-_nc_screen_of(WINDOW *win)
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(WINDOW *)
+_nc_curscr_of(SCREEN *sp)
 {
-    SCREEN *sp = 0;
+    return sp == 0 ? 0 : CurScreen(sp);
+}
 
-    if (win != 0) {
-	WINDOWLIST *wp = (WINDOWLIST *) win;
-	sp = wp->screen;
-    }
-    return (sp);
+NCURSES_EXPORT(WINDOW *)
+_nc_newscr_of(SCREEN *sp)
+{
+    return sp == 0 ? 0 : NewScreen(sp);
+}
+
+NCURSES_EXPORT(WINDOW *)
+_nc_stdscr_of(SCREEN *sp)
+{
+    return sp == 0 ? 0 : StdScreen(sp);
 }
+#endif
diff -Naur ncurses-5.7.orig/ncurses/base/lib_nl.c ncurses-5.7/ncurses/base/lib_nl.c
--- ncurses-5.7.orig/ncurses/base/lib_nl.c	2000-12-09 21:43:27.000000000 -0500
+++ ncurses-5.7/ncurses/base/lib_nl.c	2011-01-08 18:13:50.667157344 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -29,6 +29,8 @@
 /****************************************************************************
  *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995               *
  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
+ *     and: Thomas E. Dickey                        1996-on                 *
+ *     and: Juergen Pfeifer                         2009                    *
  ****************************************************************************/
 
 /*
@@ -42,38 +44,52 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_nl.c,v 1.8 2000/12/10 02:43:27 tom Exp $")
+MODULE_ID("$Id: lib_nl.c,v 1.12 2009/10/24 22:05:55 tom Exp $")
 
 #ifdef __EMX__
 #include <io.h>
 #endif
 
 NCURSES_EXPORT(int)
-nl(void)
+NCURSES_SP_NAME(nl) (NCURSES_SP_DCL0)
 {
-    T((T_CALLED("nl()")));
-
-    SP->_nl = TRUE;
-
+    T((T_CALLED("nl(%p)"), (void *) SP_PARM));
+    if (0 == SP_PARM)
+	returnCode(ERR);
+    SP_PARM->_nl = TRUE;
 #ifdef __EMX__
     _nc_flush();
-    _fsetmode(NC_OUTPUT, "t");
+    _fsetmode(NC_OUTPUT(SP_PARM), "t");
 #endif
-
     returnCode(OK);
 }
 
+#if NCURSES_SP_FUNCS
 NCURSES_EXPORT(int)
-nonl(void)
+nl(void)
 {
-    T((T_CALLED("nonl()")));
-
-    SP->_nl = FALSE;
+    return NCURSES_SP_NAME(nl) (CURRENT_SCREEN);
+}
+#endif
 
+NCURSES_EXPORT(int)
+NCURSES_SP_NAME(nonl) (NCURSES_SP_DCL0)
+{
+    T((T_CALLED("nonl(%p)"), (void *) SP_PARM));
+    if (0 == SP_PARM)
+	returnCode(ERR);
+    SP_PARM->_nl = FALSE;
 #ifdef __EMX__
     _nc_flush();
-    _fsetmode(NC_OUTPUT, "b");
+    _fsetmode(NC_OUTPUT(SP_PARM), "b");
 #endif
-
     returnCode(OK);
 }
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+nonl(void)
+{
+    return NCURSES_SP_NAME(nonl) (CURRENT_SCREEN);
+}
+#endif
diff -Naur ncurses-5.7.orig/ncurses/base/lib_overlay.c ncurses-5.7/ncurses/base/lib_overlay.c
--- ncurses-5.7.orig/ncurses/base/lib_overlay.c	2008-06-07 19:30:34.000000000 -0400
+++ ncurses-5.7/ncurses/base/lib_overlay.c	2011-01-08 18:13:50.667157344 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -40,7 +40,7 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_overlay.c,v 1.27 2008/06/07 23:30:34 tom Exp $")
+MODULE_ID("$Id: lib_overlay.c,v 1.29 2009/10/24 23:21:31 tom Exp $")
 
 static int
 overlap(const WINDOW *const src, WINDOW *const dst, int const flag)
@@ -52,7 +52,7 @@
     int dminrow, dmincol;
     int dmaxrow, dmaxcol;
 
-    T((T_CALLED("overlap(%p,%p,%d)"), src, dst, flag));
+    T((T_CALLED("overlap(%p,%p,%d)"), (const void *) src, (void *) dst, flag));
 
     if (src != 0 && dst != 0) {
 	_nc_lock_global(curses);
@@ -110,7 +110,7 @@
 NCURSES_EXPORT(int)
 overlay(const WINDOW *win1, WINDOW *win2)
 {
-    T((T_CALLED("overlay(%p,%p)"), win1, win2));
+    T((T_CALLED("overlay(%p,%p)"), (const void *) win1, (void *) win2));
     returnCode(overlap(win1, win2, TRUE));
 }
 
@@ -127,7 +127,7 @@
 NCURSES_EXPORT(int)
 overwrite(const WINDOW *win1, WINDOW *win2)
 {
-    T((T_CALLED("overwrite(%p,%p)"), win1, win2));
+    T((T_CALLED("overwrite(%p,%p)"), (const void *) win1, (void *) win2));
     returnCode(overlap(win1, win2, FALSE));
 }
 
@@ -145,7 +145,11 @@
     attr_t mask;
 
     T((T_CALLED("copywin(%p, %p, %d, %d, %d, %d, %d, %d, %d)"),
-       src, dst, sminrow, smincol, dminrow, dmincol, dmaxrow, dmaxcol, over));
+       (const void *) src,
+       (void *) dst,
+       sminrow, smincol,
+       dminrow, dmincol,
+       dmaxrow, dmaxcol, over));
 
     if (src && dst) {
 	_nc_lock_global(curses);
diff -Naur ncurses-5.7.orig/ncurses/base/lib_pad.c ncurses-5.7/ncurses/base/lib_pad.c
--- ncurses-5.7.orig/ncurses/base/lib_pad.c	2006-10-14 16:47:13.000000000 -0400
+++ ncurses-5.7/ncurses/base/lib_pad.c	2011-01-08 18:13:50.667157344 -0500
@@ -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            *
@@ -29,6 +29,8 @@
 /****************************************************************************
  *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995               *
  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
+ *     and: Thomas E. Dickey                        1996-on                 *
+ *     and: Juergen Pfeifer                         2009                    *
  ****************************************************************************/
 
 /*
@@ -40,21 +42,22 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_pad.c,v 1.41 2006/10/14 20:47:13 tom Exp $")
+MODULE_ID("$Id: lib_pad.c,v 1.46 2010/04/24 23:50:45 tom Exp $")
 
 NCURSES_EXPORT(WINDOW *)
-newpad(int l, int c)
+NCURSES_SP_NAME(newpad) (NCURSES_SP_DCLx int l, int c)
 {
     WINDOW *win;
     NCURSES_CH_T *ptr;
     int i;
 
-    T((T_CALLED("newpad(%d, %d)"), l, c));
+    T((T_CALLED("newpad(%p,%d, %d)"), (void *) SP_PARM, l, c));
 
     if (l <= 0 || c <= 0)
 	returnWin(0);
 
-    if ((win = _nc_makenew(l, c, 0, 0, _ISPAD)) == NULL)
+    win = NCURSES_SP_NAME(_nc_makenew) (NCURSES_SP_ARGx l, c, 0, 0, _ISPAD);
+    if (win == NULL)
 	returnWin(0);
 
     for (i = 0; i < l; i++) {
@@ -70,6 +73,14 @@
     returnWin(win);
 }
 
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(WINDOW *)
+newpad(int l, int c)
+{
+    return NCURSES_SP_NAME(newpad) (CURRENT_SCREEN, l, c);
+}
+#endif
+
 NCURSES_EXPORT(WINDOW *)
 subpad(WINDOW *orig, int l, int c, int begy, int begx)
 {
@@ -94,10 +105,14 @@
 	 int smaxrow,
 	 int smaxcol)
 {
+#if NCURSES_SP_FUNCS
+    SCREEN *sp = _nc_screen_of(win);
+#endif
+
     T((T_CALLED("prefresh()")));
     if (pnoutrefresh(win, pminrow, pmincol, sminrow, smincol, smaxrow,
 		     smaxcol) != ERR
-	&& doupdate() != ERR) {
+	&& NCURSES_SP_NAME(doupdate) (NCURSES_SP_ARG) != ERR) {
 	returnCode(OK);
     }
     returnCode(ERR);
@@ -112,10 +127,11 @@
 	     int smaxrow,
 	     int smaxcol)
 {
-    NCURSES_SIZE_T i, j;
-    NCURSES_SIZE_T m, n;
-    NCURSES_SIZE_T pmaxrow;
-    NCURSES_SIZE_T pmaxcol;
+    int i, j;
+    int m, n;
+    int pmaxrow;
+    int pmaxcol;
+    SCREEN *sp;
 
 #if USE_SCROLL_HINTS
     const int my_len = 2;	/* parameterize the threshold for hardscroll */
@@ -124,7 +140,7 @@
 #endif
 
     T((T_CALLED("pnoutrefresh(%p, %d, %d, %d, %d, %d, %d)"),
-       win, pminrow, pmincol, sminrow, smincol, smaxrow, smaxcol));
+       (void *) win, pminrow, pmincol, sminrow, smincol, smaxrow, smaxcol));
 
     if (win == 0)
 	returnCode(ERR);
@@ -132,6 +148,8 @@
     if (!(win->_flags & _ISPAD))
 	returnCode(ERR);
 
+    sp = _nc_screen_of(win);
+
     /* negative values are interpreted as zero */
     if (pminrow < 0)
 	pminrow = 0;
@@ -162,8 +180,8 @@
 	pmaxcol = pmincol + smaxcol - smincol;
     }
 
-    if (smaxrow >= screen_lines
-	|| smaxcol >= screen_columns
+    if (smaxrow >= screen_lines(sp)
+	|| smaxcol >= screen_columns(sp)
 	|| sminrow > smaxrow
 	|| smincol > smaxcol)
 	returnCode(ERR);
@@ -194,13 +212,13 @@
      * merely change the costs of various update cases.
      */
 #if USE_SCROLL_HINTS
-    wide = (smincol < my_len && smaxcol > (newscr->_maxx - my_len));
+    wide = (smincol < my_len && smaxcol > (NewScreen(sp)->_maxx - my_len));
 #endif
 
     for (i = pminrow, m = sminrow + win->_yoffset;
-	 i <= pmaxrow && m <= newscr->_maxy;
+	 i <= pmaxrow && m <= NewScreen(sp)->_maxy;
 	 i++, m++) {
-	register struct ldat *nline = &newscr->_line[m];
+	register struct ldat *nline = &NewScreen(sp)->_line[m];
 	register struct ldat *oline = &win->_line[i];
 	for (j = pmincol, n = smincol; j <= pmaxcol; j++, n++) {
 	    NCURSES_CH_T ch = oline->text[j];
@@ -229,9 +247,9 @@
 		|| nind > smaxrow) {
 		nind = _NEWINDEX;
 	    } else if (displaced) {
-		register struct ldat *pline = &curscr->_line[nind];
+		register struct ldat *pline = &CurScreen(sp)->_line[nind];
 		for (j = 0; j <= my_len; j++) {
-		    int k = newscr->_maxx - j;
+		    int k = NewScreen(sp)->_maxx - j;
 		    if (pline->text[j] != nline->text[j]
 			|| pline->text[k] != nline->text[k]) {
 			nind = _NEWINDEX;
@@ -261,12 +279,12 @@
 	win->_line[i].oldindex = _NEWINDEX;
 #endif
 
-    win->_begx = smincol;
-    win->_begy = sminrow;
+    win->_begx = (NCURSES_SIZE_T) smincol;
+    win->_begy = (NCURSES_SIZE_T) sminrow;
 
     if (win->_clear) {
 	win->_clear = FALSE;
-	newscr->_clear = TRUE;
+	NewScreen(sp)->_clear = TRUE;
     }
 
     /*
@@ -278,10 +296,12 @@
 	&& win->_curx >= pmincol
 	&& win->_cury <= pmaxrow
 	&& win->_curx <= pmaxcol) {
-	newscr->_cury = win->_cury - pminrow + win->_begy + win->_yoffset;
-	newscr->_curx = win->_curx - pmincol + win->_begx;
+	NewScreen(sp)->_cury = (NCURSES_SIZE_T) (win->_cury - pminrow
+						 + win->_begy + win->_yoffset);
+	NewScreen(sp)->_curx = (NCURSES_SIZE_T) (win->_curx - pmincol
+						 + win->_begx);
     }
-    newscr->_leaveok = win->_leaveok;
+    NewScreen(sp)->_leaveok = win->_leaveok;
     win->_flags &= ~_HASMOVED;
 
     /*
@@ -289,12 +309,12 @@
      * We will use this on subsequent calls to this function to derive
      * values to stuff into 'oldindex[]' -- for scrolling optimization.
      */
-    win->_pad._pad_y = pminrow;
-    win->_pad._pad_x = pmincol;
-    win->_pad._pad_top = sminrow;
-    win->_pad._pad_left = smincol;
-    win->_pad._pad_bottom = smaxrow;
-    win->_pad._pad_right = smaxcol;
+    win->_pad._pad_y = (NCURSES_SIZE_T) pminrow;
+    win->_pad._pad_x = (NCURSES_SIZE_T) pmincol;
+    win->_pad._pad_top = (NCURSES_SIZE_T) sminrow;
+    win->_pad._pad_left = (NCURSES_SIZE_T) smincol;
+    win->_pad._pad_bottom = (NCURSES_SIZE_T) smaxrow;
+    win->_pad._pad_right = (NCURSES_SIZE_T) smaxcol;
 
     returnCode(OK);
 }
@@ -302,7 +322,7 @@
 NCURSES_EXPORT(int)
 pechochar(WINDOW *pad, const chtype ch)
 {
-    T((T_CALLED("pechochar(%p, %s)"), pad, _tracechtype(ch)));
+    T((T_CALLED("pechochar(%p, %s)"), (void *) pad, _tracechtype(ch)));
 
     if (pad == 0)
 	returnCode(ERR);
diff -Naur ncurses-5.7.orig/ncurses/base/lib_printw.c ncurses-5.7/ncurses/base/lib_printw.c
--- ncurses-5.7.orig/ncurses/base/lib_printw.c	2006-12-17 14:21:39.000000000 -0500
+++ ncurses-5.7/ncurses/base/lib_printw.c	2011-01-08 18:13:50.667157344 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,2005 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2005,2009 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -39,7 +39,7 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_printw.c,v 1.18 2006/12/17 19:21:39 tom Exp $")
+MODULE_ID("$Id: lib_printw.c,v 1.20 2009/10/24 22:07:03 tom Exp $")
 
 NCURSES_EXPORT(int)
 printw(const char *fmt,...)
@@ -70,7 +70,7 @@
 #ifdef TRACE
     va_start(argp, fmt);
     T((T_CALLED("wprintw(%p,%s%s)"),
-       win, _nc_visbuf(fmt), _nc_varargs(fmt, argp)));
+       (void *) win, _nc_visbuf(fmt), _nc_varargs(fmt, argp)));
     va_end(argp);
 #endif
 
@@ -111,7 +111,7 @@
 #ifdef TRACE
     va_start(argp, fmt);
     T((T_CALLED("mvwprintw(%d,%d,%p,%s%s)"),
-       y, x, win, _nc_visbuf(fmt), _nc_varargs(fmt, argp)));
+       y, x, (void *) win, _nc_visbuf(fmt), _nc_varargs(fmt, argp)));
     va_end(argp);
 #endif
 
@@ -128,10 +128,14 @@
 {
     char *buf;
     int code = ERR;
+#if NCURSES_SP_FUNCS
+    SCREEN *sp = _nc_screen_of(win);
+#endif
 
-    T((T_CALLED("vwprintw(%p,%s,va_list)"), win, _nc_visbuf(fmt)));
+    T((T_CALLED("vwprintw(%p,%s,va_list)"), (void *) win, _nc_visbuf(fmt)));
 
-    if ((buf = _nc_printf_string(fmt, argp)) != 0) {
+    buf = NCURSES_SP_NAME(_nc_printf_string) (NCURSES_SP_ARGx fmt, argp);
+    if (buf != 0) {
 	code = waddstr(win, buf);
     }
     returnCode(code);
diff -Naur ncurses-5.7.orig/ncurses/base/lib_redrawln.c ncurses-5.7/ncurses/base/lib_redrawln.c
--- ncurses-5.7.orig/ncurses/base/lib_redrawln.c	2007-10-13 16:08:56.000000000 -0400
+++ ncurses-5.7/ncurses/base/lib_redrawln.c	2011-01-08 18:18:29.746780939 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2006,2007 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            *
@@ -39,7 +39,7 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_redrawln.c,v 1.12 2007/10/13 20:08:56 tom Exp $")
+MODULE_ID("$Id: lib_redrawln.c,v 1.17 2010/12/19 00:03:23 tom Exp $")
 
 NCURSES_EXPORT(int)
 wredrawln(WINDOW *win, int beg, int num)
@@ -47,37 +47,40 @@
     int i;
     int end;
     size_t len;
+    SCREEN *sp;
 
-    T((T_CALLED("wredrawln(%p,%d,%d)"), win, beg, num));
+    T((T_CALLED("wredrawln(%p,%d,%d)"), (void *) win, beg, num));
 
     if (win == 0)
 	returnCode(ERR);
 
+    sp = _nc_screen_of(win);
+
     if (beg < 0)
 	beg = 0;
 
     if (touchline(win, beg, num) == ERR)
 	returnCode(ERR);
 
-    if (touchline(curscr, beg + win->_begy, num) == ERR)
+    if (touchline(CurScreen(sp), beg + win->_begy, num) == ERR)
 	returnCode(ERR);
 
     end = beg + num;
-    if (end > curscr->_maxy + 1)
-	end = curscr->_maxy + 1;
+    if (end > CurScreen(sp)->_maxy + 1 - win->_begy)
+	end = CurScreen(sp)->_maxy + 1 - win->_begy;
     if (end > win->_maxy + 1)
 	end = win->_maxy + 1;
 
-    len = (win->_maxx + 1);
-    if (len > (size_t) (curscr->_maxx + 1))
-	len = (size_t) (curscr->_maxx + 1);
-    len *= sizeof(curscr->_line[0].text[0]);
+    len = (size_t) (win->_maxx + 1);
+    if (len > (size_t) (CurScreen(sp)->_maxx + 1 - win->_begx))
+	len = (size_t) (CurScreen(sp)->_maxx + 1 - win->_begx);
+    len *= sizeof(CurScreen(sp)->_line[0].text[0]);
 
     for (i = beg; i < end; i++) {
 	int crow = i + win->_begy;
 
-	memset(curscr->_line[crow].text + win->_begx, 0, len);
-	_nc_make_oldhash(crow);
+	memset(CurScreen(sp)->_line[crow].text + win->_begx, 0, len);
+	NCURSES_SP_NAME(_nc_make_oldhash) (NCURSES_SP_ARGx crow);
     }
 
     returnCode(OK);
diff -Naur ncurses-5.7.orig/ncurses/base/lib_refresh.c ncurses-5.7/ncurses/base/lib_refresh.c
--- ncurses-5.7.orig/ncurses/base/lib_refresh.c	2007-09-29 16:39:34.000000000 -0400
+++ ncurses-5.7/ncurses/base/lib_refresh.c	2011-01-08 18:18:29.746780939 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2006,2007 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            *
@@ -30,6 +30,7 @@
  *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995               *
  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
  *     and: Thomas E. Dickey                        1996-on                 *
+ *     and: Juergen Pfeifer                                                 *
  ****************************************************************************/
 
 /*
@@ -41,24 +42,27 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_refresh.c,v 1.41 2007/09/29 20:39:34 tom Exp $")
+MODULE_ID("$Id: lib_refresh.c,v 1.44 2010/12/19 01:22:58 tom Exp $")
 
 NCURSES_EXPORT(int)
 wrefresh(WINDOW *win)
 {
     int code;
+#if NCURSES_SP_FUNCS
+    SCREEN *SP_PARM = _nc_screen_of(win);
+#endif
 
-    T((T_CALLED("wrefresh(%p)"), win));
+    T((T_CALLED("wrefresh(%p)"), (void *) win));
 
     if (win == 0) {
 	code = ERR;
-    } else if (win == curscr) {
-	curscr->_clear = TRUE;
-	code = doupdate();
+    } else if (win == CurScreen(SP_PARM)) {
+	CurScreen(SP_PARM)->_clear = TRUE;
+	code = NCURSES_SP_NAME(doupdate) (NCURSES_SP_ARG);
     } else if ((code = wnoutrefresh(win)) == OK) {
 	if (win->_clear)
-	    newscr->_clear = TRUE;
-	code = doupdate();
+	    NewScreen(SP_PARM)->_clear = TRUE;
+	code = NCURSES_SP_NAME(doupdate) (NCURSES_SP_ARG);
 	/*
 	 * Reset the clearok() flag in case it was set for the special
 	 * case in hardscroll.c (if we don't reset it here, we'll get 2
@@ -73,16 +77,19 @@
 NCURSES_EXPORT(int)
 wnoutrefresh(WINDOW *win)
 {
-    NCURSES_SIZE_T limit_x;
-    NCURSES_SIZE_T src_row, src_col;
-    NCURSES_SIZE_T begx;
-    NCURSES_SIZE_T begy;
-    NCURSES_SIZE_T dst_row, dst_col;
+    int limit_x;
+    int src_row, src_col;
+    int begx;
+    int begy;
+    int dst_row, dst_col;
 #if USE_SCROLL_HINTS
     bool wide;
 #endif
+#if NCURSES_SP_FUNCS
+    SCREEN *SP_PARM = _nc_screen_of(win);
+#endif
 
-    T((T_CALLED("wnoutrefresh(%p)"), win));
+    T((T_CALLED("wnoutrefresh(%p)"), (void *) win));
 #ifdef TRACE
     if (USE_TRACEF(TRACE_UPDATE)) {
 	_tracedump("...win", win);
@@ -101,8 +108,8 @@
     begx = win->_begx;
     begy = win->_begy;
 
-    newscr->_nc_bkgd = win->_nc_bkgd;
-    WINDOW_ATTRS(newscr) = WINDOW_ATTRS(win);
+    NewScreen(SP_PARM)->_nc_bkgd = win->_nc_bkgd;
+    WINDOW_ATTRS(NewScreen(SP_PARM)) = WINDOW_ATTRS(win);
 
     /* merge in change information from all subwindows of this window */
     wsyncdown(win);
@@ -122,7 +129,7 @@
      * windows).  Note that changing this formula will not break any code,
      * merely change the costs of various update cases.
      */
-    wide = (begx <= 1 && win->_maxx >= (newscr->_maxx - 1));
+    wide = (begx <= 1 && win->_maxx >= (NewScreen(SP_PARM)->_maxx - 1));
 #endif
 
     win->_flags &= ~_HASMOVED;
@@ -137,14 +144,14 @@
     /* limit(dst_col) */
     limit_x = win->_maxx;
     /* limit(src_col) */
-    if (limit_x > newscr->_maxx - begx)
-	limit_x = newscr->_maxx - begx;
+    if (limit_x > NewScreen(SP_PARM)->_maxx - begx)
+	limit_x = NewScreen(SP_PARM)->_maxx - begx;
 
     for (src_row = 0, dst_row = begy + win->_yoffset;
-	 src_row <= win->_maxy && dst_row <= newscr->_maxy;
+	 src_row <= win->_maxy && dst_row <= NewScreen(SP_PARM)->_maxy;
 	 src_row++, dst_row++) {
-	register struct ldat *nline = &newscr->_line[dst_row];
-	register struct ldat *oline = &win->_line[src_row];
+	struct ldat *nline = &(NewScreen(SP_PARM)->_line[dst_row]);
+	struct ldat *oline = &win->_line[src_row];
 
 	if (oline->firstchar != _NOCHANGE) {
 	    int last_src = oline->lastchar;
@@ -156,7 +163,7 @@
 	    dst_col = src_col + begx;
 
 	    if_WIDEC({
-		register int j;
+		int j;
 
 		/*
 		 * Ensure that we will copy complete multi-column characters
@@ -197,7 +204,7 @@
 				       : win->_maxx);
 		int fix_left = dst_col;
 		int fix_right = last_dst;
-		register int j;
+		int j;
 
 		/*
 		 * Check for boundary cases where we may overwrite part of a
@@ -225,7 +232,8 @@
 		     * this character.  Find the end of the character.
 		     */
 		    ++j;
-		    while (j <= newscr->_maxx && isWidecExt(nline->text[j])) {
+		    while (j <= NewScreen(SP_PARM)->_maxx &&
+			   isWidecExt(nline->text[j])) {
 			fix_right = j++;
 		    }
 		}
@@ -269,18 +277,19 @@
 
     if (win->_clear) {
 	win->_clear = FALSE;
-	newscr->_clear = TRUE;
+	NewScreen(SP_PARM)->_clear = TRUE;
     }
 
     if (!win->_leaveok) {
-	newscr->_cury = win->_cury + win->_begy + win->_yoffset;
-	newscr->_curx = win->_curx + win->_begx;
+	NewScreen(SP_PARM)->_cury = (NCURSES_SIZE_T) (win->_cury +
+						      win->_begy + win->_yoffset);
+	NewScreen(SP_PARM)->_curx = (NCURSES_SIZE_T) (win->_curx + win->_begx);
     }
-    newscr->_leaveok = win->_leaveok;
+    NewScreen(SP_PARM)->_leaveok = win->_leaveok;
 
 #ifdef TRACE
     if (USE_TRACEF(TRACE_UPDATE)) {
-	_tracedump("newscr", newscr);
+	_tracedump("newscr", NewScreen(SP_PARM));
 	_nc_unlock_global(tracef);
     }
 #endif /* TRACE */
diff -Naur ncurses-5.7.orig/ncurses/base/lib_restart.c ncurses-5.7/ncurses/base/lib_restart.c
--- ncurses-5.7.orig/ncurses/base/lib_restart.c	2008-06-21 13:31:22.000000000 -0400
+++ ncurses-5.7/ncurses/base/lib_restart.c	2011-01-08 18:13:50.667157344 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -30,6 +30,7 @@
  *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995               *
  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
  *     and: Thomas E. Dickey                        1996-on                 *
+ *     and: Juergen Pfeifer                         2008                    *
  ****************************************************************************/
 
 /*
@@ -44,49 +45,62 @@
 #define _POSIX_SOURCE
 #endif
 
-#include <term.h>		/* lines, columns, cur_term */
-
-MODULE_ID("$Id: lib_restart.c,v 1.10 2008/06/21 17:31:22 tom Exp $")
+MODULE_ID("$Id: lib_restart.c,v 1.13 2009/10/24 22:47:43 tom Exp $")
 
 NCURSES_EXPORT(int)
-restartterm(NCURSES_CONST char *termp, int filenum, int *errret)
+NCURSES_SP_NAME(restartterm) (NCURSES_SP_DCLx
+			      NCURSES_CONST char *termp,
+			      int filenum,
+			      int *errret)
 {
     int result;
+#ifdef USE_TERM_DRIVER
+    TERMINAL *new_term;
+#endif
 
-    T((T_CALLED("restartterm(%s,%d,%p)"), termp, filenum, errret));
+    T((T_CALLED("restartterm(%p,%s,%d,%p)"),
+       (void *) SP_PARM,
+       termp,
+       filenum,
+       (void *) errret));
 
-    if (setupterm(termp, filenum, errret) != OK) {
+    if (TINFO_SETUP_TERM(&new_term, termp, filenum, errret, FALSE) != OK) {
 	result = ERR;
-    } else if (SP != 0) {
-	int saveecho = SP->_echo;
-	int savecbreak = SP->_cbreak;
-	int saveraw = SP->_raw;
-	int savenl = SP->_nl;
-
-	if (saveecho)
-	    echo();
-	else
-	    noecho();
+    } else if (SP_PARM != 0) {
+	int saveecho = SP_PARM->_echo;
+	int savecbreak = SP_PARM->_cbreak;
+	int saveraw = SP_PARM->_raw;
+	int savenl = SP_PARM->_nl;
+
+#ifdef USE_TERM_DRIVER
+	SP_PARM->_term = new_term;
+#endif
+	if (saveecho) {
+	    NCURSES_SP_NAME(echo) (NCURSES_SP_ARG);
+	} else {
+	    NCURSES_SP_NAME(noecho) (NCURSES_SP_ARG);
+	}
 
 	if (savecbreak) {
-	    cbreak();
-	    noraw();
+	    NCURSES_SP_NAME(cbreak) (NCURSES_SP_ARG);
+	    NCURSES_SP_NAME(noraw) (NCURSES_SP_ARG);
 	} else if (saveraw) {
-	    nocbreak();
-	    raw();
+	    NCURSES_SP_NAME(nocbreak) (NCURSES_SP_ARG);
+	    NCURSES_SP_NAME(raw) (NCURSES_SP_ARG);
 	} else {
-	    nocbreak();
-	    noraw();
+	    NCURSES_SP_NAME(nocbreak) (NCURSES_SP_ARG);
+	    NCURSES_SP_NAME(noraw) (NCURSES_SP_ARG);
+	}
+	if (savenl) {
+	    NCURSES_SP_NAME(nl) (NCURSES_SP_ARG);
+	} else {
+	    NCURSES_SP_NAME(nonl) (NCURSES_SP_ARG);
 	}
-	if (savenl)
-	    nl();
-	else
-	    nonl();
 
-	reset_prog_mode();
+	NCURSES_SP_NAME(reset_prog_mode) (NCURSES_SP_ARG);
 
 #if USE_SIZECHANGE
-	_nc_update_screensize(SP);
+	_nc_update_screensize(SP_PARM);
 #endif
 
 	result = OK;
@@ -95,3 +109,11 @@
     }
     returnCode(result);
 }
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+restartterm(NCURSES_CONST char *termp, int filenum, int *errret)
+{
+    return NCURSES_SP_NAME(restartterm) (CURRENT_SCREEN, termp, filenum, errret);
+}
+#endif
diff -Naur ncurses-5.7.orig/ncurses/base/lib_scanw.c ncurses-5.7/ncurses/base/lib_scanw.c
--- ncurses-5.7.orig/ncurses/base/lib_scanw.c	2001-06-30 19:39:41.000000000 -0400
+++ ncurses-5.7/ncurses/base/lib_scanw.c	2011-01-08 18:13:50.671157089 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998,2000,2001 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2001,2009 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -40,7 +40,7 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_scanw.c,v 1.11 2001/06/30 23:39:41 tom Exp $")
+MODULE_ID("$Id: lib_scanw.c,v 1.12 2009/10/24 22:35:14 tom Exp $")
 
 NCURSES_EXPORT(int)
 vwscanw(WINDOW *win, NCURSES_CONST char *fmt, va_list argp)
@@ -73,7 +73,7 @@
     int code;
     va_list ap;
 
-    T(("wscanw(%p,\"%s\",...) called", win, fmt));
+    T(("wscanw(%p,\"%s\",...) called", (void *) win, fmt));
 
     va_start(ap, fmt);
     code = vwscanw(win, fmt, ap);
diff -Naur ncurses-5.7.orig/ncurses/base/lib_screen.c ncurses-5.7/ncurses/base/lib_screen.c
--- ncurses-5.7.orig/ncurses/base/lib_screen.c	2008-08-16 15:05:37.000000000 -0400
+++ ncurses-5.7/ncurses/base/lib_screen.c	2011-01-08 18:13:50.671157089 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -30,35 +30,45 @@
  *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995               *
  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
  *     and: Thomas E. Dickey                        1996 on                 *
+ *     and: Juergen Pfeifer                         2009                    *
  ****************************************************************************/
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_screen.c,v 1.31 2008/08/16 19:05:37 tom Exp $")
+#ifndef CUR
+#define CUR SP_TERMTYPE
+#endif
+
+MODULE_ID("$Id: lib_screen.c,v 1.38 2009/10/24 22:08:55 tom Exp $")
 
 #define MAX_SIZE 0x3fff		/* 16k is big enough for a window or pad */
 
 NCURSES_EXPORT(WINDOW *)
-getwin(FILE *filep)
+NCURSES_SP_NAME(getwin) (NCURSES_SP_DCLx FILE *filep)
 {
     WINDOW tmp, *nwin;
     int n;
 
-    T((T_CALLED("getwin(%p)"), filep));
+    T((T_CALLED("getwin(%p)"), (void *) filep));
 
     clearerr(filep);
-    (void) fread(&tmp, sizeof(WINDOW), 1, filep);
-    if (ferror(filep)
+    if (fread(&tmp, 1, sizeof(WINDOW), filep) < sizeof(WINDOW)
+	|| ferror(filep)
 	|| tmp._maxy == 0
 	|| tmp._maxy > MAX_SIZE
 	|| tmp._maxx == 0
-	|| tmp._maxx > MAX_SIZE)
+	|| tmp._maxx > MAX_SIZE) {
 	returnWin(0);
+    }
 
     if (tmp._flags & _ISPAD) {
-	nwin = newpad(tmp._maxy + 1, tmp._maxx + 1);
+	nwin = NCURSES_SP_NAME(newpad) (NCURSES_SP_ARGx
+					tmp._maxy + 1,
+					tmp._maxx + 1);
     } else {
-	nwin = newwin(tmp._maxy + 1, tmp._maxx + 1, 0, 0);
+	nwin = NCURSES_SP_NAME(newwin) (NCURSES_SP_ARGx
+					tmp._maxy + 1,
+					tmp._maxx + 1, 0, 0);
     }
 
     /*
@@ -67,6 +77,8 @@
      * made sense is probably gone.
      */
     if (nwin != 0) {
+	size_t linesize = sizeof(NCURSES_CH_T) * (size_t) (tmp._maxx + 1);
+
 	nwin->_curx = tmp._curx;
 	nwin->_cury = tmp._cury;
 	nwin->_maxy = tmp._maxy;
@@ -98,11 +110,8 @@
 
 	for (n = 0; n <= nwin->_maxy; n++) {
 	    clearerr(filep);
-	    (void) fread(nwin->_line[n].text,
-			 sizeof(NCURSES_CH_T),
-			 (size_t) (nwin->_maxx + 1),
-			 filep);
-	    if (ferror(filep)) {
+	    if (fread(nwin->_line[n].text, 1, linesize, filep) < linesize
+		|| ferror(filep)) {
 		delwin(nwin);
 		returnWin(0);
 	    }
@@ -112,13 +121,21 @@
     returnWin(nwin);
 }
 
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(WINDOW *)
+getwin(FILE *filep)
+{
+    return NCURSES_SP_NAME(getwin) (CURRENT_SCREEN, filep);
+}
+#endif
+
 NCURSES_EXPORT(int)
 putwin(WINDOW *win, FILE *filep)
 {
     int code = ERR;
     int n;
 
-    T((T_CALLED("putwin(%p,%p)"), win, filep));
+    T((T_CALLED("putwin(%p,%p)"), (void *) win, (void *) filep));
 
     if (win != 0) {
 	size_t len = (size_t) (win->_maxx + 1);
@@ -141,26 +158,34 @@
 }
 
 NCURSES_EXPORT(int)
-scr_restore(const char *file)
+NCURSES_SP_NAME(scr_restore) (NCURSES_SP_DCLx const char *file)
 {
     FILE *fp = 0;
 
-    T((T_CALLED("scr_restore(%s)"), _nc_visbuf(file)));
+    T((T_CALLED("scr_restore(%p,%s)"), (void *) SP_PARM, _nc_visbuf(file)));
 
     if (_nc_access(file, R_OK) < 0
 	|| (fp = fopen(file, "rb")) == 0) {
 	returnCode(ERR);
     } else {
-	delwin(newscr);
-	SP->_newscr = getwin(fp);
+	delwin(NewScreen(SP_PARM));
+	NewScreen(SP_PARM) = getwin(fp);
 #if !USE_REENTRANT
-	newscr = SP->_newscr;
+	newscr = NewScreen(SP_PARM);
 #endif
 	(void) fclose(fp);
 	returnCode(OK);
     }
 }
 
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+scr_restore(const char *file)
+{
+    return NCURSES_SP_NAME(scr_restore) (CURRENT_SCREEN, file);
+}
+#endif
+
 NCURSES_EXPORT(int)
 scr_dump(const char *file)
 {
@@ -179,42 +204,63 @@
 }
 
 NCURSES_EXPORT(int)
-scr_init(const char *file)
+NCURSES_SP_NAME(scr_init) (NCURSES_SP_DCLx const char *file)
 {
     FILE *fp = 0;
+    int code = ERR;
 
-    T((T_CALLED("scr_init(%s)"), _nc_visbuf(file)));
-
-    if (exit_ca_mode && non_rev_rmcup)
-	returnCode(ERR);
+    T((T_CALLED("scr_init(%p,%s)"), (void *) SP_PARM, _nc_visbuf(file)));
 
-    if (_nc_access(file, R_OK) < 0
-	|| (fp = fopen(file, "rb")) == 0) {
-	returnCode(ERR);
-    } else {
-	delwin(curscr);
-	SP->_curscr = getwin(fp);
+    if (SP_PARM != 0 &&
+#ifdef USE_TERM_DRIVER
+	InfoOf(SP_PARM).caninit
+#else
+	!(exit_ca_mode && non_rev_rmcup)
+#endif
+	) {
+	if (_nc_access(file, R_OK) >= 0
+	    && (fp = fopen(file, "rb")) != 0) {
+	    delwin(CurScreen(SP_PARM));
+	    CurScreen(SP_PARM) = getwin(fp);
 #if !USE_REENTRANT
-	curscr = SP->_curscr;
+	    curscr = CurScreen(SP_PARM);
 #endif
-	(void) fclose(fp);
-	returnCode(OK);
+	    (void) fclose(fp);
+	    code = OK;
+	}
     }
+    returnCode(code);
 }
 
+#if NCURSES_SP_FUNCS
 NCURSES_EXPORT(int)
-scr_set(const char *file)
+scr_init(const char *file)
 {
-    T((T_CALLED("scr_set(%s)"), _nc_visbuf(file)));
+    return NCURSES_SP_NAME(scr_init) (CURRENT_SCREEN, file);
+}
+#endif
+
+NCURSES_EXPORT(int)
+NCURSES_SP_NAME(scr_set) (NCURSES_SP_DCLx const char *file)
+{
+    T((T_CALLED("scr_set(%p,%s)"), (void *) SP_PARM, _nc_visbuf(file)));
 
-    if (scr_init(file) == ERR) {
+    if (NCURSES_SP_NAME(scr_init) (NCURSES_SP_ARGx file) == ERR) {
 	returnCode(ERR);
     } else {
-	delwin(newscr);
-	SP->_newscr = dupwin(curscr);
+	delwin(NewScreen(SP_PARM));
+	NewScreen(SP_PARM) = dupwin(curscr);
 #if !USE_REENTRANT
-	newscr = SP->_newscr;
+	newscr = NewScreen(SP_PARM);
 #endif
 	returnCode(OK);
     }
 }
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+scr_set(const char *file)
+{
+    return NCURSES_SP_NAME(scr_set) (CURRENT_SCREEN, file);
+}
+#endif
diff -Naur ncurses-5.7.orig/ncurses/base/lib_scroll.c ncurses-5.7/ncurses/base/lib_scroll.c
--- ncurses-5.7.orig/ncurses/base/lib_scroll.c	2006-10-14 16:46:08.000000000 -0400
+++ ncurses-5.7/ncurses/base/lib_scroll.c	2011-01-08 18:18:29.746780939 -0500
@@ -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            *
@@ -43,7 +43,7 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_scroll.c,v 1.26 2006/10/14 20:46:08 tom Exp $")
+MODULE_ID("$Id: lib_scroll.c,v 1.28 2010/12/19 01:48:09 tom Exp $")
 
 NCURSES_EXPORT(void)
 _nc_scroll_window(WINDOW *win,
@@ -55,10 +55,10 @@
     int limit;
     int line;
     int j;
-    size_t to_copy = (size_t) (sizeof(NCURSES_CH_T) * (win->_maxx + 1));
+    size_t to_copy = (sizeof(NCURSES_CH_T) * (size_t) (win->_maxx + 1));
 
     TR(TRACE_MOVE, ("_nc_scroll_window(%p, %d, %ld, %ld)",
-		    win, n, (long) top, (long) bottom));
+		    (void *) win, n, (long) top, (long) bottom));
 
     if (top < 0
 	|| bottom < top
@@ -135,7 +135,7 @@
 NCURSES_EXPORT(int)
 wscrl(WINDOW *win, int n)
 {
-    T((T_CALLED("wscrl(%p,%d)"), win, n));
+    T((T_CALLED("wscrl(%p,%d)"), (void *) win, n));
 
     if (!win || !win->_scroll) {
 	TR(TRACE_MOVE, ("...scrollok is false"));
diff -Naur ncurses-5.7.orig/ncurses/base/lib_scrollok.c ncurses-5.7/ncurses/base/lib_scrollok.c
--- ncurses-5.7.orig/ncurses/base/lib_scrollok.c	2000-12-09 21:43:27.000000000 -0500
+++ ncurses-5.7/ncurses/base/lib_scrollok.c	2011-01-08 18:13:50.671157089 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998,2000 Free Software Foundation, Inc.                   *
+ * Copyright (c) 1998-2000,2009 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -40,12 +40,12 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_scrollok.c,v 1.4 2000/12/10 02:43:27 tom Exp $")
+MODULE_ID("$Id: lib_scrollok.c,v 1.5 2009/10/24 22:35:38 tom Exp $")
 
 NCURSES_EXPORT(int)
 scrollok(WINDOW *win, bool flag)
 {
-    T((T_CALLED("scrollok(%p,%d)"), win, flag));
+    T((T_CALLED("scrollok(%p,%d)"), (void *) win, flag));
 
     if (win) {
 	win->_scroll = flag;
diff -Naur ncurses-5.7.orig/ncurses/base/lib_scrreg.c ncurses-5.7/ncurses/base/lib_scrreg.c
--- ncurses-5.7.orig/ncurses/base/lib_scrreg.c	2000-12-09 21:43:27.000000000 -0500
+++ ncurses-5.7/ncurses/base/lib_scrreg.c	2011-01-08 18:13:50.671157089 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998,2000 Free Software Foundation, Inc.                   *
+ * Copyright (c) 1998-2000,2009 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -40,12 +40,12 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_scrreg.c,v 1.10 2000/12/10 02:43:27 tom Exp $")
+MODULE_ID("$Id: lib_scrreg.c,v 1.11 2009/10/24 22:35:28 tom Exp $")
 
 NCURSES_EXPORT(int)
 wsetscrreg(WINDOW *win, int top, int bottom)
 {
-    T((T_CALLED("wsetscrreg(%p,%d,%d)"), win, top, bottom));
+    T((T_CALLED("wsetscrreg(%p,%d,%d)"), (void *) win, top, bottom));
 
     if (win &&
 	top >= 0 && top <= win->_maxy &&
diff -Naur ncurses-5.7.orig/ncurses/base/lib_set_term.c ncurses-5.7/ncurses/base/lib_set_term.c
--- ncurses-5.7.orig/ncurses/base/lib_set_term.c	2008-08-04 14:11:12.000000000 -0400
+++ ncurses-5.7/ncurses/base/lib_set_term.c	2011-01-08 18:18:29.746780939 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2007,2008 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            *
@@ -30,6 +30,7 @@
  *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995               *
  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
  *     and: Thomas E. Dickey                        1996-on                 *
+ *     and: Juergen Pfeifer                         2009                    *
  ****************************************************************************/
 
 /*
@@ -40,11 +41,21 @@
 */
 
 #include <curses.priv.h>
-
-#include <term.h>		/* cur_term */
 #include <tic.h>
 
-MODULE_ID("$Id: lib_set_term.c,v 1.117 2008/08/04 18:11:12 tom Exp $")
+#ifndef CUR
+#define CUR SP_TERMTYPE
+#endif
+
+MODULE_ID("$Id: lib_set_term.c,v 1.138 2010/12/20 00:42:20 tom Exp $")
+
+#ifdef USE_TERM_DRIVER
+#define MaxColors      InfoOf(sp).maxcolors
+#define NumLabels      InfoOf(sp).numlabels
+#else
+#define MaxColors      max_colors
+#define NumLabels      num_labels
+#endif
 
 NCURSES_EXPORT(SCREEN *)
 set_term(SCREEN *screenp)
@@ -52,25 +63,25 @@
     SCREEN *oldSP;
     SCREEN *newSP;
 
-    T((T_CALLED("set_term(%p)"), screenp));
+    T((T_CALLED("set_term(%p)"), (void *) screenp));
 
     _nc_lock_global(curses);
 
-    oldSP = SP;
+    oldSP = CURRENT_SCREEN;
     _nc_set_screen(screenp);
-    newSP = SP;
+    newSP = screenp;
 
     if (newSP != 0) {
-	set_curterm(newSP->_term);
+	TINFO_SET_CURTERM(newSP, newSP->_term);
 #if !USE_REENTRANT
-	curscr = newSP->_curscr;
-	newscr = newSP->_newscr;
-	stdscr = newSP->_stdscr;
+	curscr = CurScreen(newSP);
+	newscr = NewScreen(newSP);
+	stdscr = StdScreen(newSP);
 	COLORS = newSP->_color_count;
 	COLOR_PAIRS = newSP->_pair_count;
 #endif
     } else {
-	set_curterm(0);
+	TINFO_SET_CURTERM(oldSP, 0);
 #if !USE_REENTRANT
 	curscr = 0;
 	newscr = 0;
@@ -82,7 +93,7 @@
 
     _nc_unlock_global(curses);
 
-    T((T_RETURN("%p"), oldSP));
+    T((T_RETURN("%p"), (void *) oldSP));
     return (oldSP);
 }
 
@@ -106,7 +117,7 @@
     for (each_screen(temp)) {
 	if (temp == sp) {
 	    if (last)
-		last = sp->_next_screen;
+		last->_next_screen = sp->_next_screen;
 	    else
 		_nc_screen_chain = sp->_next_screen;
 	    result = TRUE;
@@ -125,14 +136,27 @@
 {
     int i;
 
-    T((T_CALLED("delscreen(%p)"), sp));
+    T((T_CALLED("delscreen(%p)"), (void *) sp));
 
     _nc_lock_global(curses);
     if (delink_screen(sp)) {
+#ifdef USE_SP_RIPOFF
+	ripoff_t *rop;
+	if (safe_ripoff_sp && safe_ripoff_sp != safe_ripoff_stack) {
+	    for (rop = safe_ripoff_stack;
+		 rop != safe_ripoff_sp && (rop - safe_ripoff_stack) < N_RIPS;
+		 rop++) {
+		if (rop->win) {
+		    (void) delwin(rop->win);
+		    rop->win = 0;
+		}
+	    }
+	}
+#endif
 
-	(void) _nc_freewin(sp->_curscr);
-	(void) _nc_freewin(sp->_newscr);
-	(void) _nc_freewin(sp->_stdscr);
+	(void) _nc_freewin(CurScreen(sp));
+	(void) _nc_freewin(NewScreen(sp));
+	(void) _nc_freewin(StdScreen(sp));
 
 	if (sp->_slk != 0) {
 	    if (sp->_slk->ent != 0) {
@@ -176,7 +200,7 @@
 	    free(sp->_setbuf);
 	}
 
-	del_curterm(sp->_term);
+	NCURSES_SP_NAME(del_curterm) (NCURSES_SP_ARGx sp->_term);
 	free(sp);
 
 	/*
@@ -184,7 +208,7 @@
 	 * application might try to use (except cur_term, which may have
 	 * multiple references in different screens).
 	 */
-	if (sp == SP) {
+	if (sp == CURRENT_SCREEN) {
 #if !USE_REENTRANT
 	    curscr = 0;
 	    newscr = 0;
@@ -248,50 +272,98 @@
 }
 #endif
 
+#define ReturnScreenError() _nc_set_screen(0); \
+                            returnCode(ERR)
+
 /* OS-independent screen initializations */
 NCURSES_EXPORT(int)
-_nc_setupscreen(int slines GCC_UNUSED,
-		int scolumns GCC_UNUSED,
-		FILE *output,
-		bool filtered,
-		int slk_format)
+NCURSES_SP_NAME(_nc_setupscreen) (
+#if NCURSES_SP_FUNCS
+				     SCREEN **spp,
+#endif
+				     int slines,
+				     int scolumns,
+				     FILE *output,
+				     bool filtered,
+				     int slk_format)
 {
     char *env;
     int bottom_stolen = 0;
-    bool support_cookies = USE_XMC_SUPPORT;
     ripoff_t *rop;
+    SCREEN *sp;
+#ifndef USE_TERM_DRIVER
+    bool support_cookies = USE_XMC_SUPPORT;
+#endif
 
     T((T_CALLED("_nc_setupscreen(%d, %d, %p, %d, %d)"),
-       slines, scolumns, output, filtered, slk_format));
+       slines, scolumns, (void *) output, filtered, slk_format));
+
+    assert(CURRENT_SCREEN == 0);	/* has been reset in newterm() ! */
+
+#if NCURSES_SP_FUNCS
+    assert(spp != 0);
+    sp = *spp;
 
-    assert(SP == 0);		/* has been reset in newterm() ! */
+    if (!sp) {
+	sp = _nc_alloc_screen_sp();
+	*spp = sp;
+    }
+    if (!sp
+	|| ((sp->_acs_map = typeCalloc(chtype, ACS_LEN)) == 0)
+	|| ((sp->_screen_acs_map = typeCalloc(bool, ACS_LEN)) == 0)) {
+	ReturnScreenError();
+    }
+
+    T(("created SP %p", (void *) sp));
+    sp->_next_screen = _nc_screen_chain;
+    _nc_screen_chain = sp;
+
+    if ((sp->_current_attr = typeCalloc(NCURSES_CH_T, 1)) == 0) {
+	ReturnScreenError();
+    }
+#else
     if (!_nc_alloc_screen()
 	|| ((SP->_acs_map = typeCalloc(chtype, ACS_LEN)) == 0)
 	|| ((SP->_screen_acs_map = typeCalloc(bool, ACS_LEN)) == 0)) {
 	returnCode(ERR);
     }
 
-    T(("created SP %p", SP));
-    SP->_next_screen = _nc_screen_chain;
-    _nc_screen_chain = SP;
+    T(("created SP %p", (void *) SP));
+
+    sp = SP;			/* fixup so SET_LINES and SET_COLS works */
+    sp->_next_screen = _nc_screen_chain;
+    _nc_screen_chain = sp;
 
-    if ((SP->_current_attr = typeCalloc(NCURSES_CH_T, 1)) == 0)
+    if ((sp->_current_attr = typeCalloc(NCURSES_CH_T, 1)) == 0)
 	returnCode(ERR);
+#endif
 
     /*
      * We should always check the screensize, just in case.
      */
-    _nc_get_screensize(SP, &slines, &scolumns);
+    _nc_set_screen(sp);
+    sp->_term = cur_term;
+#ifdef USE_TERM_DRIVER
+    TCBOf(sp)->csp = sp;
+    _nc_get_screensize(sp, sp->_term, &slines, &scolumns);
+#else
+    _nc_get_screensize(sp, &slines, &scolumns);
+#endif
     SET_LINES(slines);
     SET_COLS(scolumns);
-    T((T_CREATE("screen %s %dx%d"), termname(), LINES, COLS));
 
-    SP->_filtered = filtered;
+    T((T_CREATE("screen %s %dx%d"),
+       NCURSES_SP_NAME(termname) (NCURSES_SP_ARG), slines, scolumns));
+
+    sp->_filtered = filtered;
 
     /* implement filter mode */
     if (filtered) {
 	slines = 1;
 	SET_LINES(slines);
+#ifdef USE_TERM_DRIVER
+	CallDriver(sp, setfilter);
+#else
 	clear_screen = 0;
 	cursor_down = parm_down_cursor = 0;
 	cursor_address = 0;
@@ -299,34 +371,25 @@
 	row_address = 0;
 
 	cursor_home = carriage_return;
-	T(("filter screensize %dx%d", LINES, COLS));
+#endif
+	T(("filter screensize %dx%d", slines, scolumns));
     }
 #ifdef __DJGPP__
     T(("setting output mode to binary"));
     fflush(output);
     setmode(output, O_BINARY);
 #endif
-    _nc_set_buffer(output, TRUE);
-    SP->_term = cur_term;
-    SP->_lines = slines;
-    SP->_lines_avail = slines;
-    SP->_columns = scolumns;
-    SP->_cursrow = -1;
-    SP->_curscol = -1;
-    SP->_nl = TRUE;
-    SP->_raw = FALSE;
-    SP->_cbreak = 0;
-    SP->_echo = TRUE;
-    SP->_fifohead = -1;
-    SP->_endwin = TRUE;
-    SP->_ofp = output;
-    SP->_cursor = -1;		/* cannot know real cursor shape */
-
-    SetNoPadding(SP);
+    NCURSES_SP_NAME(_nc_set_buffer) (NCURSES_SP_ARGx output, TRUE);
+    sp->_lines = (NCURSES_SIZE_T) slines;
+    sp->_lines_avail = (NCURSES_SIZE_T) slines;
+    sp->_columns = (NCURSES_SIZE_T) scolumns;
+    sp->_ofp = output;
+    SP_PRE_INIT(sp);
+    SetNoPadding(sp);
 
 #if NCURSES_EXT_FUNCS
-    SP->_default_color = FALSE;
-    SP->_has_sgr_39_49 = FALSE;
+    sp->_default_color = FALSE;
+    sp->_has_sgr_39_49 = FALSE;
 
     /*
      * Set our assumption of the terminal's default foreground and background
@@ -348,11 +411,11 @@
      * or black-on-white display under control of the application than not).
      */
 #ifdef USE_ASSUMED_COLOR
-    SP->_default_fg = COLOR_WHITE;
-    SP->_default_bg = COLOR_BLACK;
+    sp->_default_fg = COLOR_WHITE;
+    sp->_default_bg = COLOR_BLACK;
 #else
-    SP->_default_fg = C_MASK;
-    SP->_default_bg = C_MASK;
+    sp->_default_fg = C_MASK;
+    sp->_default_bg = C_MASK;
 #endif
 
     /*
@@ -364,14 +427,14 @@
 	char sep1, sep2;
 	int count = sscanf(env, "%d%c%d%c", &fg, &sep1, &bg, &sep2);
 	if (count >= 1) {
-	    SP->_default_fg = (fg >= 0 && fg < max_colors) ? fg : C_MASK;
+	    sp->_default_fg = ((fg >= 0 && fg < MaxColors) ? fg : C_MASK);
 	    if (count >= 3) {
-		SP->_default_bg = (bg >= 0 && bg < max_colors) ? bg : C_MASK;
+		sp->_default_bg = ((bg >= 0 && bg < MaxColors) ? bg : C_MASK);
 	    }
 	    TR(TRACE_CHARPUT | TRACE_MOVE,
 	       ("from environment assumed fg=%d, bg=%d",
-		SP->_default_fg,
-		SP->_default_bg));
+		sp->_default_fg,
+		sp->_default_bg));
 	}
     }
 #if USE_COLORFGBG
@@ -384,48 +447,51 @@
     if (getenv("COLORFGBG") != 0) {
 	char *p = getenv("COLORFGBG");
 	TR(TRACE_CHARPUT | TRACE_MOVE, ("decoding COLORFGBG %s", p));
-	p = extract_fgbg(p, &(SP->_default_fg));
-	p = extract_fgbg(p, &(SP->_default_bg));
+	p = extract_fgbg(p, &(sp->_default_fg));
+	p = extract_fgbg(p, &(sp->_default_bg));
 	if (*p)			/* assume rxvt was compiled with xpm support */
-	    p = extract_fgbg(p, &(SP->_default_bg));
+	    p = extract_fgbg(p, &(sp->_default_bg));
 	TR(TRACE_CHARPUT | TRACE_MOVE, ("decoded fg=%d, bg=%d",
-					SP->_default_fg, SP->_default_bg));
-	if (SP->_default_fg >= max_colors) {
+					sp->_default_fg, sp->_default_bg));
+	if (sp->_default_fg >= MaxColors) {
 	    if (set_a_foreground != ABSENT_STRING
 		&& !strcmp(set_a_foreground, "\033[3%p1%dm")) {
 		set_a_foreground = "\033[3%?%p1%{8}%>%t9%e%p1%d%;m";
 	    } else {
-		SP->_default_fg %= max_colors;
+		sp->_default_fg %= MaxColors;
 	    }
 	}
-	if (SP->_default_bg >= max_colors) {
+	if (sp->_default_bg >= MaxColors) {
 	    if (set_a_background != ABSENT_STRING
 		&& !strcmp(set_a_background, "\033[4%p1%dm")) {
 		set_a_background = "\033[4%?%p1%{8}%>%t9%e%p1%d%;m";
 	    } else {
-		SP->_default_bg %= max_colors;
+		sp->_default_bg %= MaxColors;
 	    }
 	}
     }
 #endif
 #endif /* NCURSES_EXT_FUNCS */
 
-    SP->_maxclick = DEFAULT_MAXCLICK;
-    SP->_mouse_event = no_mouse_event;
-    SP->_mouse_inline = no_mouse_inline;
-    SP->_mouse_parse = no_mouse_parse;
-    SP->_mouse_resume = no_mouse_resume;
-    SP->_mouse_wrap = no_mouse_wrap;
-    SP->_mouse_fd = -1;
+    sp->_maxclick = DEFAULT_MAXCLICK;
+    sp->_mouse_event = no_mouse_event;
+    sp->_mouse_inline = no_mouse_inline;
+    sp->_mouse_parse = no_mouse_parse;
+    sp->_mouse_resume = no_mouse_resume;
+    sp->_mouse_wrap = no_mouse_wrap;
+    sp->_mouse_fd = -1;
 
     /*
      * If we've no magic cookie support, we suppress attributes that xmc would
      * affect, i.e., the attributes that affect the rendition of a space.
      */
-    SP->_ok_attributes = termattrs();
-    if (has_colors()) {
-	SP->_ok_attributes |= A_COLOR;
+    sp->_ok_attributes = NCURSES_SP_NAME(termattrs) (NCURSES_SP_ARG);
+    if (NCURSES_SP_NAME(has_colors) (NCURSES_SP_ARG)) {
+	sp->_ok_attributes |= A_COLOR;
     }
+#ifdef USE_TERM_DRIVER
+    _nc_cookie_init(sp);
+#else
 #if USE_XMC_SUPPORT
     /*
      * If we have no magic-cookie support compiled-in, or if it is suppressed
@@ -444,7 +510,7 @@
 
     if (magic_cookie_glitch > 0) {	/* tvi, wyse */
 
-	SP->_xmc_triggers = SP->_ok_attributes & (
+	sp->_xmc_triggers = sp->_ok_attributes & (
 						     A_STANDOUT |
 						     A_UNDERLINE |
 						     A_REVERSE |
@@ -461,12 +527,12 @@
 	 * cookies.
 	 */
 	if (has_colors()) {
-	    SP->_xmc_triggers |= A_COLOR;
+	    sp->_xmc_triggers |= A_COLOR;
 	}
 #endif
-	SP->_xmc_suppress = SP->_xmc_triggers & (chtype) ~(A_BOLD);
+	sp->_xmc_suppress = sp->_xmc_triggers & (chtype) ~(A_BOLD);
 
-	T(("magic cookie attributes %s", _traceattr(SP->_xmc_suppress)));
+	T(("magic cookie attributes %s", _traceattr(sp->_xmc_suppress)));
 	/*
 	 * Supporting line-drawing may be possible.  But make the regular
 	 * video attributes work first.
@@ -506,7 +572,7 @@
 
     /* initialize normal acs before wide, since we use mapping in the latter */
 #if !USE_WIDEC_SUPPORT
-    if (_nc_unicode_locale() && _nc_locale_breaks_acs(cur_term)) {
+    if (_nc_unicode_locale() && _nc_locale_breaks_acs(sp->_term)) {
 	acs_chars = NULL;
 	ena_acs = NULL;
 	enter_alt_charset_mode = NULL;
@@ -514,134 +580,194 @@
 	set_attributes = NULL;
     }
 #endif
-    _nc_init_acs();
+#endif
+
+    NCURSES_SP_NAME(_nc_init_acs) (NCURSES_SP_ARG);
 #if USE_WIDEC_SUPPORT
     _nc_init_wacs();
 
-    SP->_screen_acs_fix = (_nc_unicode_locale()
-			   && _nc_locale_breaks_acs(cur_term));
+    sp->_screen_acs_fix = (_nc_unicode_locale()
+			   && _nc_locale_breaks_acs(sp->_term));
 #endif
     env = _nc_get_locale();
-    SP->_legacy_coding = ((env == 0)
+    sp->_legacy_coding = ((env == 0)
 			  || !strcmp(env, "C")
 			  || !strcmp(env, "POSIX"));
-    T(("legacy-coding %d", SP->_legacy_coding));
+    T(("legacy-coding %d", sp->_legacy_coding));
 
-    _nc_idcok = TRUE;
-    _nc_idlok = FALSE;
+    sp->_nc_sp_idcok = TRUE;
+    sp->_nc_sp_idlok = FALSE;
 
-    SP->oldhash = 0;
-    SP->newhash = 0;
+    sp->oldhash = 0;
+    sp->newhash = 0;
 
     T(("creating newscr"));
-    if ((SP->_newscr = newwin(slines, scolumns, 0, 0)) == 0)
-	returnCode(ERR);
-
+    NewScreen(sp) = NCURSES_SP_NAME(newwin) (NCURSES_SP_ARGx slines, scolumns,
+					     0, 0);
+    if (NewScreen(sp) == 0) {
+	ReturnScreenError();
+    }
     T(("creating curscr"));
-    if ((SP->_curscr = newwin(slines, scolumns, 0, 0)) == 0)
-	returnCode(ERR);
-
+    CurScreen(sp) = NCURSES_SP_NAME(newwin) (NCURSES_SP_ARGx slines, scolumns,
+					     0, 0);
+    if (CurScreen(sp) == 0) {
+	ReturnScreenError();
+    }
 #if !USE_REENTRANT
-    newscr = SP->_newscr;
-    curscr = SP->_curscr;
+    newscr = NewScreen(sp);
+    curscr = CurScreen(sp);
 #endif
 #if USE_SIZECHANGE
-    SP->_resize = resizeterm;
+    sp->_resize = NCURSES_SP_NAME(resizeterm);
 #endif
 
-    newscr->_clear = TRUE;
-    curscr->_clear = FALSE;
+    NewScreen(sp)->_clear = TRUE;
+    CurScreen(sp)->_clear = FALSE;
 
-    def_shell_mode();
-    def_prog_mode();
+    NCURSES_SP_NAME(def_shell_mode) (NCURSES_SP_ARG);
+    NCURSES_SP_NAME(def_prog_mode) (NCURSES_SP_ARG);
 
-    for (rop = ripoff_stack;
-	 rop != ripoff_sp && (rop - ripoff_stack) < N_RIPS;
-	 rop++) {
-
-	/* If we must simulate soft labels, grab off the line to be used.
-	   We assume that we must simulate, if it is none of the standard
-	   formats (4-4 or 3-2-3) for which there may be some hardware
-	   support. */
-	if (rop->hook == _nc_slk_initialize)
-	    if (!(num_labels <= 0 || !SLK_STDFMT(slk_format)))
-		continue;
-	if (rop->hook) {
-	    int count;
-	    WINDOW *w;
-
-	    count = (rop->line < 0) ? -rop->line : rop->line;
-	    T(("ripping off %i lines at %s", count,
-	       ((rop->line < 0)
-		? "bottom"
-		: "top")));
-
-	    w = newwin(count, scolumns,
-		       ((rop->line < 0)
-			? SP->_lines_avail - count
-			: 0),
-		       0);
-	    if (w) {
-		rop->win = w;
-		rop->hook(w, scolumns);
-	    } else {
-		returnCode(ERR);
+    if (safe_ripoff_sp && safe_ripoff_sp != safe_ripoff_stack) {
+	for (rop = safe_ripoff_stack;
+	     rop != safe_ripoff_sp && (rop - safe_ripoff_stack) < N_RIPS;
+	     rop++) {
+
+	    /* If we must simulate soft labels, grab off the line to be used.
+	       We assume that we must simulate, if it is none of the standard
+	       formats (4-4 or 3-2-3) for which there may be some hardware
+	       support. */
+	    if (rop->hook == _nc_slk_initialize) {
+		if (!(NumLabels <= 0 || !SLK_STDFMT(slk_format))) {
+		    continue;
+		}
+	    }
+	    if (rop->hook) {
+		int count;
+		WINDOW *w;
+
+		count = (rop->line < 0) ? -rop->line : rop->line;
+		T(("ripping off %i lines at %s", count,
+		   ((rop->line < 0)
+		    ? "bottom"
+		    : "top")));
+
+		w = NCURSES_SP_NAME(newwin) (NCURSES_SP_ARGx
+					     count, scolumns,
+					     ((rop->line < 0)
+					      ? sp->_lines_avail - count
+					      : 0),
+					     0);
+		if (w) {
+		    rop->win = w;
+		    rop->hook(w, scolumns);
+		} else {
+		    ReturnScreenError();
+		}
+		if (rop->line < 0) {
+		    bottom_stolen += count;
+		} else {
+		    sp->_topstolen = (NCURSES_SIZE_T) (sp->_topstolen + count);
+		}
+		sp->_lines_avail = (NCURSES_SIZE_T) (sp->_lines_avail - count);
 	    }
-	    if (rop->line < 0)
-		bottom_stolen += count;
-	    else
-		SP->_topstolen += count;
-	    SP->_lines_avail -= count;
 	}
+	/* reset the stack */
+	safe_ripoff_sp = safe_ripoff_stack;
     }
-    /* reset the stack */
-    ripoff_sp = ripoff_stack;
 
     T(("creating stdscr"));
-    assert((SP->_lines_avail + SP->_topstolen + bottom_stolen) == slines);
-    if ((SP->_stdscr = newwin(SP->_lines_avail, scolumns, 0, 0)) == 0)
-	returnCode(ERR);
-
-    SET_LINES(SP->_lines_avail);
+    assert((sp->_lines_avail + sp->_topstolen + bottom_stolen) == slines);
+    if ((StdScreen(sp) = NCURSES_SP_NAME(newwin) (NCURSES_SP_ARGx
+						  sp->_lines_avail,
+						  scolumns, 0, 0)) == 0) {
+	ReturnScreenError();
+    }
+    SET_LINES(sp->_lines_avail);
 #if !USE_REENTRANT
-    stdscr = SP->_stdscr;
+    stdscr = StdScreen(sp);
 #endif
-
+    sp->_prescreen = FALSE;
     returnCode(OK);
 }
 
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+_nc_setupscreen(int slines GCC_UNUSED,
+		int scolumns GCC_UNUSED,
+		FILE *output,
+		bool filtered,
+		int slk_format)
+{
+    SCREEN *sp = 0;
+    int rc = NCURSES_SP_NAME(_nc_setupscreen) (&sp,
+					       slines,
+					       scolumns,
+					       output,
+					       filtered,
+					       slk_format);
+    if (rc != OK)
+	_nc_set_screen(0);
+    return rc;
+}
+#endif
+
 /*
  * The internal implementation interprets line as the number of lines to rip
  * off from the top or bottom.
  */
 NCURSES_EXPORT(int)
-_nc_ripoffline(int line, int (*init) (WINDOW *, int))
+NCURSES_SP_NAME(_nc_ripoffline) (NCURSES_SP_DCLx
+				 int line,
+				 int (*init) (WINDOW *, int))
 {
-    T((T_CALLED("_nc_ripoffline(%d, %p)"), line, init));
+    int code = ERR;
 
-    if (line != 0) {
+    START_TRACE();
+    T((T_CALLED("ripoffline(%p,%d,%p)"), (void *) SP_PARM, line, init));
 
-	if (ripoff_sp == 0)
-	    ripoff_sp = ripoff_stack;
-	if (ripoff_sp >= ripoff_stack + N_RIPS)
-	    returnCode(ERR);
-
-	ripoff_sp->line = line;
-	ripoff_sp->hook = init;
-	ripoff_sp++;
+#if NCURSES_SP_FUNCS
+    if (SP_PARM != 0 && SP_PARM->_prescreen)
+#endif
+    {
+	if (line == 0) {
+	    code = OK;
+	} else {
+	    if (safe_ripoff_sp == 0)
+		safe_ripoff_sp = safe_ripoff_stack;
+	    if (safe_ripoff_sp < safe_ripoff_stack + N_RIPS) {
+		safe_ripoff_sp->line = line;
+		safe_ripoff_sp->hook = init;
+		(safe_ripoff_sp)++;
+		code = OK;
+	    }
+	}
     }
 
-    returnCode(OK);
+    returnCode(code);
 }
 
+#if NCURSES_SP_FUNCS
 NCURSES_EXPORT(int)
-ripoffline(int line, int (*init) (WINDOW *, int))
+_nc_ripoffline(int line, int (*init) (WINDOW *, int))
 {
-    START_TRACE();
-    T((T_CALLED("ripoffline(%d,%p)"), line, init));
+    return NCURSES_SP_NAME(_nc_ripoffline) (CURRENT_SCREEN_PRE, line, init);
+}
+#endif
 
-    if (line == 0)
-	returnCode(OK);
+NCURSES_EXPORT(int)
+NCURSES_SP_NAME(ripoffline) (NCURSES_SP_DCLx
+			     int line,
+			     int (*init) (WINDOW *, int))
+{
+    return NCURSES_SP_NAME(_nc_ripoffline) (NCURSES_SP_ARGx
+					    (line < 0) ? -1 : 1,
+					    init);
+}
 
-    returnCode(_nc_ripoffline((line < 0) ? -1 : 1, init));
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+ripoffline(int line, int (*init) (WINDOW *, int))
+{
+    return NCURSES_SP_NAME(ripoffline) (CURRENT_SCREEN_PRE, line, init);
 }
+#endif
diff -Naur ncurses-5.7.orig/ncurses/base/lib_slk.c ncurses-5.7/ncurses/base/lib_slk.c
--- ncurses-5.7.orig/ncurses/base/lib_slk.c	2008-09-27 10:07:33.000000000 -0400
+++ ncurses-5.7/ncurses/base/lib_slk.c	2011-01-08 18:18:29.746780939 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2005,2008 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            *
@@ -41,135 +41,183 @@
  */
 
 #include <curses.priv.h>
-
 #include <ctype.h>
-#include <term.h>		/* num_labels, label_*, plab_norm */
 
-MODULE_ID("$Id: lib_slk.c,v 1.35 2008/09/27 14:07:33 juergen Exp $")
+#ifndef CUR
+#define CUR SP_TERMTYPE
+#endif
+
+MODULE_ID("$Id: lib_slk.c,v 1.47 2010/12/25 22:58:58 tom Exp $")
+
+#ifdef USE_TERM_DRIVER
+#define NumLabels    InfoOf(SP_PARM).numlabels
+#define NoColorVideo InfoOf(SP_PARM).nocolorvideo
+#define LabelWidth   InfoOf(SP_PARM).labelwidth
+#define LabelHeight  InfoOf(SP_PARM).labelheight
+#else
+#define NumLabels    num_labels
+#define NoColorVideo no_color_video
+#define LabelWidth   label_width
+#define LabelHeight  label_height
+#endif
 
 /*
  * Free any memory related to soft labels, return an error.
  */
 static int
-slk_failed(void)
+slk_failed(NCURSES_SP_DCL0)
 {
-    if (SP->_slk) {
-	FreeIfNeeded(SP->_slk->ent);
-	free(SP->_slk);
-	SP->_slk = (SLK *) 0;
+    if ((0 != SP_PARM) && SP_PARM->_slk) {
+	FreeIfNeeded(SP_PARM->_slk->ent);
+	free(SP_PARM->_slk);
+	SP_PARM->_slk = (SLK *) 0;
     }
     return ERR;
 }
 
-/*
- * Initialize soft labels.
- * Called from newterm()
- */
 NCURSES_EXPORT(int)
-_nc_slk_initialize(WINDOW *stwin, int cols)
+_nc_format_slks(NCURSES_SP_DCLx int cols)
 {
-    int i, x;
-    int res = OK;
-    unsigned max_length;
+    int gap, i, x;
+    int max_length;
 
-    T((T_CALLED("_nc_slk_initialize()")));
+    if (!SP_PARM || !SP_PARM->_slk)
+	return ERR;
 
-    if (SP->_slk) {		/* we did this already, so simply return */
-	returnCode(OK);
-    } else if ((SP->_slk = typeCalloc(SLK, 1)) == 0)
-	returnCode(ERR);
-
-    SP->_slk->ent = NULL;
-
-    /*
-     * If we use colors, vidputs() will suppress video attributes that conflict
-     * with colors.  In that case, we're still guaranteed that "reverse" would
-     * work.
-     */
-    if ((no_color_video & 1) == 0)
-	SetAttr(SP->_slk->attr, A_STANDOUT);
-    else
-	SetAttr(SP->_slk->attr, A_REVERSE);
-
-    SP->_slk->maxlab = ((num_labels > 0)
-			? num_labels
-			: MAX_SKEY(_nc_globals.slk_format));
-    SP->_slk->maxlen = ((num_labels > 0)
-			? label_width * label_height
-			: MAX_SKEY_LEN(_nc_globals.slk_format));
-    SP->_slk->labcnt = ((SP->_slk->maxlab < MAX_SKEY(_nc_globals.slk_format))
-			? MAX_SKEY(_nc_globals.slk_format)
-			: SP->_slk->maxlab);
-
-    if (SP->_slk->maxlen <= 0
-	|| SP->_slk->labcnt <= 0
-	|| (SP->_slk->ent = typeCalloc(slk_ent,
-				       (unsigned) SP->_slk->labcnt)) == NULL)
-	returnCode(slk_failed());
-
-    max_length = SP->_slk->maxlen;
-    for (i = 0; i < SP->_slk->labcnt; i++) {
-	size_t used = max_length + 1;
-
-	if ((SP->_slk->ent[i].ent_text = (char *) _nc_doalloc(0, used)) == 0)
-	    returnCode(slk_failed());
-	memset(SP->_slk->ent[i].ent_text, 0, used);
-
-	if ((SP->_slk->ent[i].form_text = (char *) _nc_doalloc(0, used)) == 0)
-	    returnCode(slk_failed());
-	memset(SP->_slk->ent[i].form_text, 0, used);
-
-	memset(SP->_slk->ent[i].form_text, ' ', max_length);
-	SP->_slk->ent[i].visible = (char) (i < SP->_slk->maxlab);
-    }
-    if (_nc_globals.slk_format >= 3) {	/* PC style */
-	int gap = (cols - 3 * (3 + 4 * max_length)) / 2;
+    max_length = SP_PARM->_slk->maxlen;
+    if (SP_PARM->slk_format >= 3) {	/* PC style */
+	gap = (cols - 3 * (3 + 4 * max_length)) / 2;
 
 	if (gap < 1)
 	    gap = 1;
 
-	for (i = x = 0; i < SP->_slk->maxlab; i++) {
-	    SP->_slk->ent[i].ent_x = x;
+	for (i = x = 0; i < SP_PARM->_slk->maxlab; i++) {
+	    SP_PARM->_slk->ent[i].ent_x = x;
 	    x += max_length;
 	    x += (i == 3 || i == 7) ? gap : 1;
 	}
     } else {
-	if (_nc_globals.slk_format == 2) {	/* 4-4 */
-	    int gap = cols - (SP->_slk->maxlab * max_length) - 6;
+	if (SP_PARM->slk_format == 2) {		/* 4-4 */
+	    gap = cols - (int) (SP_PARM->_slk->maxlab * max_length) - 6;
 
 	    if (gap < 1)
 		gap = 1;
-	    for (i = x = 0; i < SP->_slk->maxlab; i++) {
-		SP->_slk->ent[i].ent_x = x;
+	    for (i = x = 0; i < SP_PARM->_slk->maxlab; i++) {
+		SP_PARM->_slk->ent[i].ent_x = x;
 		x += max_length;
 		x += (i == 3) ? gap : 1;
 	    }
 	} else {
-	    if (_nc_globals.slk_format == 1) {	/* 1 -> 3-2-3 */
-		int gap = (cols - (SP->_slk->maxlab * max_length) - 5)
-		/ 2;
+	    if (SP_PARM->slk_format == 1) {	/* 1 -> 3-2-3 */
+		gap = (cols - (SP_PARM->_slk->maxlab * max_length) - 5)
+		    / 2;
 
 		if (gap < 1)
 		    gap = 1;
-		for (i = x = 0; i < SP->_slk->maxlab; i++) {
-		    SP->_slk->ent[i].ent_x = x;
+		for (i = x = 0; i < SP_PARM->_slk->maxlab; i++) {
+		    SP_PARM->_slk->ent[i].ent_x = x;
 		    x += max_length;
 		    x += (i == 2 || i == 4) ? gap : 1;
 		}
-	    } else
-		returnCode(slk_failed());
+	    } else {
+		return slk_failed(NCURSES_SP_ARG);
+	    }
 	}
     }
-    SP->_slk->dirty = TRUE;
-    if ((SP->_slk->win = stwin) == NULL) {
-	returnCode(slk_failed());
+    SP_PARM->_slk->dirty = TRUE;
+
+    return OK;
+}
+
+/*
+ * Initialize soft labels.
+ * Called from newterm()
+ */
+NCURSES_EXPORT(int)
+_nc_slk_initialize(WINDOW *stwin, int cols)
+{
+    int i;
+    int res = OK;
+    int max_length;
+    SCREEN *sp;
+    int numlab;
+
+    T((T_CALLED("_nc_slk_initialize()")));
+
+    assert(stwin);
+
+    sp = _nc_screen_of(stwin);
+    if (0 == sp)
+	returnCode(ERR);
+
+    assert(TerminalOf(SP_PARM));
+
+    numlab = NumLabels;
+
+    if (SP_PARM->_slk) {	/* we did this already, so simply return */
+	returnCode(OK);
+    } else if ((SP_PARM->_slk = typeCalloc(SLK, 1)) == 0)
+	returnCode(ERR);
+
+    if (!SP_PARM->slk_format)
+	SP_PARM->slk_format = _nc_globals.slk_format;
+
+    /*
+     * If we use colors, vidputs() will suppress video attributes that conflict
+     * with colors.  In that case, we're still guaranteed that "reverse" would
+     * work.
+     */
+    if ((NoColorVideo & 1) == 0)
+	SetAttr(SP_PARM->_slk->attr, A_STANDOUT);
+    else
+	SetAttr(SP_PARM->_slk->attr, A_REVERSE);
+
+    SP_PARM->_slk->maxlab = (short) ((numlab > 0)
+				     ? numlab
+				     : MAX_SKEY(SP_PARM->slk_format));
+    SP_PARM->_slk->maxlen = (short) ((numlab > 0)
+				     ? LabelWidth * LabelHeight
+				     : MAX_SKEY_LEN(SP_PARM->slk_format));
+    SP_PARM->_slk->labcnt = (short) ((SP_PARM->_slk->maxlab < MAX_SKEY(SP_PARM->slk_format))
+				     ? MAX_SKEY(SP_PARM->slk_format)
+				     : SP_PARM->_slk->maxlab);
+
+    if (SP_PARM->_slk->maxlen <= 0
+	|| SP_PARM->_slk->labcnt <= 0
+	|| (SP_PARM->_slk->ent = typeCalloc(slk_ent,
+					    (size_t) SP_PARM->_slk->labcnt))
+	== NULL)
+	returnCode(slk_failed(NCURSES_SP_ARG));
+
+    max_length = SP_PARM->_slk->maxlen;
+    for (i = 0; i < SP_PARM->_slk->labcnt; i++) {
+	size_t used = (size_t) max_length + 1;
+
+	SP_PARM->_slk->ent[i].ent_text = (char *) _nc_doalloc(0, used);
+	if (SP_PARM->_slk->ent[i].ent_text == 0)
+	    returnCode(slk_failed(NCURSES_SP_ARG));
+	memset(SP_PARM->_slk->ent[i].ent_text, 0, used);
+
+	SP_PARM->_slk->ent[i].form_text = (char *) _nc_doalloc(0, used);
+	if (SP_PARM->_slk->ent[i].form_text == 0)
+	    returnCode(slk_failed(NCURSES_SP_ARG));
+
+	memset(SP_PARM->_slk->ent[i].form_text, ' ', used - 1);
+	SP_PARM->_slk->ent[i].form_text[used] = '\0';
+
+	SP_PARM->_slk->ent[i].visible = (char) (i < SP_PARM->_slk->maxlab);
+    }
+
+    res = _nc_format_slks(NCURSES_SP_ARGx cols);
+
+    if ((SP_PARM->_slk->win = stwin) == NULL) {
+	returnCode(slk_failed(NCURSES_SP_ARG));
     }
 
     /* We now reset the format so that the next newterm has again
      * per default no SLK keys and may call slk_init again to
      * define a new layout. (juergen 03-Mar-1999)
      */
-    SP->slk_format = _nc_globals.slk_format;
     _nc_globals.slk_format = 0;
     returnCode(res);
 }
@@ -178,14 +226,24 @@
  * Restore the soft labels on the screen.
  */
 NCURSES_EXPORT(int)
-slk_restore(void)
+NCURSES_SP_NAME(slk_restore) (NCURSES_SP_DCL0)
 {
-    T((T_CALLED("slk_restore()")));
+    T((T_CALLED("slk_restore(%p)"), (void *) SP_PARM));
+
+    if (0 == SP_PARM)
+	returnCode(ERR);
+    if (SP_PARM->_slk == NULL)
+	returnCode(ERR);
+    SP_PARM->_slk->hidden = FALSE;
+    SP_PARM->_slk->dirty = TRUE;
 
-    if (SP->_slk == NULL)
-	return (ERR);
-    SP->_slk->hidden = FALSE;
-    SP->_slk->dirty = TRUE;
+    returnCode(NCURSES_SP_NAME(slk_refresh) (NCURSES_SP_ARG));
+}
 
-    returnCode(slk_refresh());
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+slk_restore(void)
+{
+    return NCURSES_SP_NAME(slk_restore) (CURRENT_SCREEN);
 }
+#endif
diff -Naur ncurses-5.7.orig/ncurses/base/lib_slkatr_set.c ncurses-5.7/ncurses/base/lib_slkatr_set.c
--- ncurses-5.7.orig/ncurses/base/lib_slkatr_set.c	2005-01-28 16:11:53.000000000 -0500
+++ ncurses-5.7/ncurses/base/lib_slkatr_set.c	2011-01-08 18:13:50.671157089 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,2005 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2005,2009 Free 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:  Juergen Pfeifer, 1998                                          *
- *     and:  Thomas E. Dickey 2005                                          *
+ *     and:  Thomas E. Dickey 2005-on                                       *
  ****************************************************************************/
 
 /*
@@ -38,22 +38,42 @@
  */
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_slkatr_set.c,v 1.10 2005/01/28 21:11:53 tom Exp $")
+MODULE_ID("$Id: lib_slkatr_set.c,v 1.14 2009/10/24 22:47:03 tom Exp $")
 
 NCURSES_EXPORT(int)
-slk_attr_set(const attr_t attr, short color_pair_number, void *opts)
+NCURSES_SP_NAME(slk_attr_set) (NCURSES_SP_DCLx
+			       const attr_t attr,
+			       short color_pair_number,
+			       void *opts)
 {
-    T((T_CALLED("slk_attr_set(%s,%d)"), _traceattr(attr), color_pair_number));
+    int code = ERR;
+
+    T((T_CALLED("slk_attr_set(%p,%s,%d)"),
+       (void *) SP_PARM,
+       _traceattr(attr),
+       color_pair_number));
 
-    if (SP != 0 && SP->_slk != 0 && !opts &&
-	color_pair_number >= 0 && color_pair_number < COLOR_PAIRS) {
-	TR(TRACE_ATTRS, ("... current %s", _tracech_t(CHREF(SP->_slk->attr))));
-	SetAttr(SP->_slk->attr, attr);
+    if (SP_PARM != 0
+	&& SP_PARM->_slk != 0
+	&& !opts
+	&& color_pair_number >= 0
+	&& color_pair_number < SP_PARM->_pair_limit) {
+	TR(TRACE_ATTRS, ("... current %s", _tracech_t(CHREF(SP_PARM->_slk->attr))));
+	SetAttr(SP_PARM->_slk->attr, attr);
 	if (color_pair_number > 0) {
-	    SetPair(SP->_slk->attr, color_pair_number);
+	    SetPair(SP_PARM->_slk->attr, color_pair_number);
 	}
-	TR(TRACE_ATTRS, ("new attribute is %s", _tracech_t(CHREF(SP->_slk->attr))));
-	returnCode(OK);
-    } else
-	returnCode(ERR);
+	TR(TRACE_ATTRS, ("new attribute is %s", _tracech_t(CHREF(SP_PARM->_slk->attr))));
+	code = OK;
+    }
+    returnCode(code);
+}
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+slk_attr_set(const attr_t attr, short color_pair_number, void *opts)
+{
+    return NCURSES_SP_NAME(slk_attr_set) (CURRENT_SCREEN, attr,
+					  color_pair_number, opts);
 }
+#endif
diff -Naur ncurses-5.7.orig/ncurses/base/lib_slkatrof.c ncurses-5.7/ncurses/base/lib_slkatrof.c
--- ncurses-5.7.orig/ncurses/base/lib_slkatrof.c	2005-01-08 18:01:32.000000000 -0500
+++ ncurses-5.7/ncurses/base/lib_slkatrof.c	2011-01-08 18:13:50.671157089 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2005,2009 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -38,21 +38,29 @@
  */
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_slkatrof.c,v 1.8 2005/01/08 23:01:32 tom Exp $")
+MODULE_ID("$Id: lib_slkatrof.c,v 1.11 2009/10/24 22:12:21 tom Exp $")
 
 NCURSES_EXPORT(int)
-slk_attroff(const chtype attr)
+NCURSES_SP_NAME(slk_attroff) (NCURSES_SP_DCLx const chtype attr)
 {
-    T((T_CALLED("slk_attroff(%s)"), _traceattr(attr)));
+    T((T_CALLED("slk_attroff(%p,%s)"), (void *) SP_PARM, _traceattr(attr)));
 
-    if (SP != 0 && SP->_slk != 0) {
-	TR(TRACE_ATTRS, ("... current %s", _tracech_t(CHREF(SP->_slk->attr))));
-	RemAttr(SP->_slk->attr, attr);
+    if (SP_PARM != 0 && SP_PARM->_slk != 0) {
+	TR(TRACE_ATTRS, ("... current %s", _tracech_t(CHREF(SP_PARM->_slk->attr))));
+	RemAttr(SP_PARM->_slk->attr, attr);
 	if ((attr & A_COLOR) != 0) {
-	    SetPair(SP->_slk->attr, 0);
+	    SetPair(SP_PARM->_slk->attr, 0);
 	}
-	TR(TRACE_ATTRS, ("new attribute is %s", _tracech_t(CHREF(SP->_slk->attr))));
+	TR(TRACE_ATTRS, ("new attribute is %s", _tracech_t(CHREF(SP_PARM->_slk->attr))));
 	returnCode(OK);
     } else
 	returnCode(ERR);
 }
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+slk_attroff(const chtype attr)
+{
+    return NCURSES_SP_NAME(slk_attroff) (CURRENT_SCREEN, attr);
+}
+#endif
diff -Naur ncurses-5.7.orig/ncurses/base/lib_slkatron.c ncurses-5.7/ncurses/base/lib_slkatron.c
--- ncurses-5.7.orig/ncurses/base/lib_slkatron.c	2005-01-08 18:02:01.000000000 -0500
+++ ncurses-5.7/ncurses/base/lib_slkatron.c	2011-01-08 18:13:50.671157089 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2000,2005 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            *
@@ -38,21 +38,29 @@
  */
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_slkatron.c,v 1.8 2005/01/08 23:02:01 tom Exp $")
+MODULE_ID("$Id: lib_slkatron.c,v 1.12 2010/03/31 23:38:02 tom Exp $")
 
 NCURSES_EXPORT(int)
-slk_attron(const chtype attr)
+NCURSES_SP_NAME(slk_attron) (NCURSES_SP_DCLx const chtype attr)
 {
-    T((T_CALLED("slk_attron(%s)"), _traceattr(attr)));
+    T((T_CALLED("slk_attron(%p,%s)"), (void *) SP_PARM, _traceattr(attr)));
 
-    if (SP != 0 && SP->_slk != 0) {
-	TR(TRACE_ATTRS, ("... current %s", _tracech_t(CHREF(SP->_slk->attr))));
-	AddAttr(SP->_slk->attr, attr);
+    if (SP_PARM != 0 && SP_PARM->_slk != 0) {
+	TR(TRACE_ATTRS, ("... current %s", _tracech_t(CHREF(SP_PARM->_slk->attr))));
+	AddAttr(SP_PARM->_slk->attr, attr);
 	if ((attr & A_COLOR) != 0) {
-	    SetPair(SP->_slk->attr, PAIR_NUMBER(attr));
+	    SetPair(SP_PARM->_slk->attr, PairNumber(attr));
 	}
-	TR(TRACE_ATTRS, ("new attribute is %s", _tracech_t(CHREF(SP->_slk->attr))));
+	TR(TRACE_ATTRS, ("new attribute is %s", _tracech_t(CHREF(SP_PARM->_slk->attr))));
 	returnCode(OK);
     } else
 	returnCode(ERR);
 }
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+slk_attron(const chtype attr)
+{
+    return NCURSES_SP_NAME(slk_attron) (CURRENT_SCREEN, attr);
+}
+#endif
diff -Naur ncurses-5.7.orig/ncurses/base/lib_slkatrset.c ncurses-5.7/ncurses/base/lib_slkatrset.c
--- ncurses-5.7.orig/ncurses/base/lib_slkatrset.c	2005-01-08 16:46:47.000000000 -0500
+++ ncurses-5.7/ncurses/base/lib_slkatrset.c	2011-01-08 18:13:50.671157089 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2005,2009 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -38,16 +38,24 @@
  */
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_slkatrset.c,v 1.7 2005/01/08 21:46:47 tom Exp $")
+MODULE_ID("$Id: lib_slkatrset.c,v 1.10 2009/10/24 22:12:21 tom Exp $")
 
 NCURSES_EXPORT(int)
-slk_attrset(const chtype attr)
+NCURSES_SP_NAME(slk_attrset) (NCURSES_SP_DCLx const chtype attr)
 {
-    T((T_CALLED("slk_attrset(%s)"), _traceattr(attr)));
+    T((T_CALLED("slk_attrset(%p,%s)"), (void *) SP_PARM, _traceattr(attr)));
 
-    if (SP != 0 && SP->_slk != 0) {
-	SetAttr(SP->_slk->attr, attr);
+    if (SP_PARM != 0 && SP_PARM->_slk != 0) {
+	SetAttr(SP_PARM->_slk->attr, attr);
 	returnCode(OK);
     } else
 	returnCode(ERR);
 }
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+slk_attrset(const chtype attr)
+{
+    return NCURSES_SP_NAME(slk_attrset) (CURRENT_SCREEN, attr);
+}
+#endif
diff -Naur ncurses-5.7.orig/ncurses/base/lib_slkattr.c ncurses-5.7/ncurses/base/lib_slkattr.c
--- ncurses-5.7.orig/ncurses/base/lib_slkattr.c	2005-01-08 16:44:28.000000000 -0500
+++ ncurses-5.7/ncurses/base/lib_slkattr.c	2011-01-08 18:18:29.746780939 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998,2000 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            *
@@ -38,19 +38,27 @@
  */
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_slkattr.c,v 1.6 2005/01/08 21:44:28 tom Exp $")
+MODULE_ID("$Id: lib_slkattr.c,v 1.11 2010/12/20 01:41:25 tom Exp $")
 
 NCURSES_EXPORT(attr_t)
-slk_attr(void)
+NCURSES_SP_NAME(slk_attr) (NCURSES_SP_DCL0)
 {
-    T((T_CALLED("slk_attr()")));
+    T((T_CALLED("slk_attr(%p)"), (void *) SP_PARM));
 
-    if (SP != 0 && SP->_slk != 0) {
-	attr_t result = AttrOf(SP->_slk->attr) & ALL_BUT_COLOR;
-	int pair = GetPair(SP->_slk->attr);
+    if (SP_PARM != 0 && SP_PARM->_slk != 0) {
+	attr_t result = AttrOf(SP_PARM->_slk->attr) & ALL_BUT_COLOR;
+	int pair = GetPair(SP_PARM->_slk->attr);
 
-	result |= COLOR_PAIR(pair);
+	result |= (attr_t) ColorPair(pair);
 	returnAttr(result);
     } else
 	returnAttr(0);
 }
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(attr_t)
+slk_attr(void)
+{
+    return NCURSES_SP_NAME(slk_attr) (CURRENT_SCREEN);
+}
+#endif
diff -Naur ncurses-5.7.orig/ncurses/base/lib_slkclear.c ncurses-5.7/ncurses/base/lib_slkclear.c
--- ncurses-5.7.orig/ncurses/base/lib_slkclear.c	2007-12-29 12:51:47.000000000 -0500
+++ ncurses-5.7/ncurses/base/lib_slkclear.c	2011-01-08 18:13:50.671157089 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2006,2007 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2007,2009 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -40,27 +40,35 @@
  */
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_slkclear.c,v 1.10 2007/12/29 17:51:47 tom Exp $")
+MODULE_ID("$Id: lib_slkclear.c,v 1.14 2009/11/07 16:27:05 tom Exp $")
 
 NCURSES_EXPORT(int)
-slk_clear(void)
+NCURSES_SP_NAME(slk_clear) (NCURSES_SP_DCL0)
 {
     int rc = ERR;
 
-    T((T_CALLED("slk_clear()")));
+    T((T_CALLED("slk_clear(%p)"), (void *) SP_PARM));
 
-    if (SP != NULL && SP->_slk != NULL) {
-	SP->_slk->hidden = TRUE;
+    if (SP_PARM != 0 && SP_PARM->_slk != 0) {
+	SP_PARM->_slk->hidden = TRUE;
 	/* For simulated SLK's it looks much more natural to
 	   inherit those attributes from the standard screen */
-	SP->_slk->win->_nc_bkgd = stdscr->_nc_bkgd;
-	WINDOW_ATTRS(SP->_slk->win) = WINDOW_ATTRS(stdscr);
-	if (SP->_slk->win == stdscr) {
+	SP_PARM->_slk->win->_nc_bkgd = StdScreen(SP_PARM)->_nc_bkgd;
+	WINDOW_ATTRS(SP_PARM->_slk->win) = WINDOW_ATTRS(StdScreen(SP_PARM));
+	if (SP_PARM->_slk->win == StdScreen(SP_PARM)) {
 	    rc = OK;
 	} else {
-	    werase(SP->_slk->win);
-	    rc = wrefresh(SP->_slk->win);
+	    werase(SP_PARM->_slk->win);
+	    rc = wrefresh(SP_PARM->_slk->win);
 	}
     }
     returnCode(rc);
 }
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+slk_clear(void)
+{
+    return NCURSES_SP_NAME(slk_clear) (CURRENT_SCREEN);
+}
+#endif
diff -Naur ncurses-5.7.orig/ncurses/base/lib_slkcolor.c ncurses-5.7/ncurses/base/lib_slkcolor.c
--- ncurses-5.7.orig/ncurses/base/lib_slkcolor.c	2005-01-28 16:11:53.000000000 -0500
+++ ncurses-5.7/ncurses/base/lib_slkcolor.c	2011-01-08 18:13:50.671157089 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,2005 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2005,2009 Free 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,8 +27,8 @@
  ****************************************************************************/
 
 /****************************************************************************
- *  Author:  Juergen Pfeifer, 1998                                          *
- *     and:  Thomas E. Dickey 2005                                          *
+ *  Author:  Juergen Pfeifer, 1998,2009                                     *
+ *     and:  Thomas E. Dickey 2005-on                                       *
  ****************************************************************************/
 
 /*
@@ -38,19 +38,31 @@
  */
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_slkcolor.c,v 1.12 2005/01/28 21:11:53 tom Exp $")
+MODULE_ID("$Id: lib_slkcolor.c,v 1.16 2009/10/24 22:12:21 tom Exp $")
 
 NCURSES_EXPORT(int)
-slk_color(short color_pair_number)
+NCURSES_SP_NAME(slk_color) (NCURSES_SP_DCLx short color_pair_number)
 {
-    T((T_CALLED("slk_color(%d)"), color_pair_number));
+    int code = ERR;
+
+    T((T_CALLED("slk_color(%p,%d)"), (void *) SP_PARM, color_pair_number));
+
+    if (SP_PARM != 0
+	&& SP_PARM->_slk != 0
+	&& color_pair_number >= 0
+	&& color_pair_number < SP_PARM->_pair_limit) {
+	TR(TRACE_ATTRS, ("... current is %s", _tracech_t(CHREF(SP_PARM->_slk->attr))));
+	SetPair(SP_PARM->_slk->attr, color_pair_number);
+	TR(TRACE_ATTRS, ("new attribute is %s", _tracech_t(CHREF(SP_PARM->_slk->attr))));
+	code = OK;
+    }
+    returnCode(code);
+}
 
-    if (SP != 0 && SP->_slk != 0 &&
-	color_pair_number >= 0 && color_pair_number < COLOR_PAIRS) {
-	TR(TRACE_ATTRS, ("... current is %s", _tracech_t(CHREF(SP->_slk->attr))));
-	SetPair(SP->_slk->attr, color_pair_number);
-	TR(TRACE_ATTRS, ("new attribute is %s", _tracech_t(CHREF(SP->_slk->attr))));
-	returnCode(OK);
-    } else
-	returnCode(ERR);
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+slk_color(short color_pair_number)
+{
+    return NCURSES_SP_NAME(slk_color) (CURRENT_SCREEN, color_pair_number);
 }
+#endif
diff -Naur ncurses-5.7.orig/ncurses/base/lib_slkinit.c ncurses-5.7/ncurses/base/lib_slkinit.c
--- ncurses-5.7.orig/ncurses/base/lib_slkinit.c	2008-01-12 15:23:39.000000000 -0500
+++ ncurses-5.7/ncurses/base/lib_slkinit.c	2011-01-08 18:13:50.675157254 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -30,6 +30,7 @@
  *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995               *
  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
  *     and: Thomas E. Dickey                        1996-on                 *
+ *     and: Juergen Pfeifer                         2009                    *
  ****************************************************************************/
 
 /*
@@ -39,17 +40,41 @@
  */
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_slkinit.c,v 1.7 2008/01/12 20:23:39 tom Exp $")
+MODULE_ID("$Id: lib_slkinit.c,v 1.13 2009/10/31 00:10:46 tom Exp $")
+
+#ifdef USE_SP_RIPOFF
+#define SoftkeyFormat SP_PARM->slk_format
+#else
+#define SoftkeyFormat _nc_globals.slk_format
+#endif
 
 NCURSES_EXPORT(int)
-slk_init(int format)
+NCURSES_SP_NAME(slk_init) (NCURSES_SP_DCLx int format)
 {
     int code = ERR;
 
-    T((T_CALLED("slk_init(%d)"), format));
-    if (format >= 0 && format <= 3 && !_nc_globals.slk_format) {
-	_nc_globals.slk_format = 1 + format;
-	code = _nc_ripoffline(-SLK_LINES(_nc_globals.slk_format), _nc_slk_initialize);
+    START_TRACE();
+    T((T_CALLED("slk_init(%p,%d)"), (void *) SP_PARM, format));
+
+    if (format >= 0
+	&& format <= 3
+#ifdef USE_SP_RIPOFF
+	&& SP_PARM
+	&& SP_PARM->_prescreen
+#endif
+	&& !SoftkeyFormat) {
+	SoftkeyFormat = 1 + format;
+	code = NCURSES_SP_NAME(_nc_ripoffline) (NCURSES_SP_ARGx
+						-SLK_LINES(SoftkeyFormat),
+						_nc_slk_initialize);
     }
     returnCode(code);
 }
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+slk_init(int format)
+{
+    return NCURSES_SP_NAME(slk_init) (CURRENT_SCREEN_PRE, format);
+}
+#endif
diff -Naur ncurses-5.7.orig/ncurses/base/lib_slklab.c ncurses-5.7/ncurses/base/lib_slklab.c
--- ncurses-5.7.orig/ncurses/base/lib_slklab.c	2003-03-29 17:53:48.000000000 -0500
+++ ncurses-5.7/ncurses/base/lib_slklab.c	2011-01-08 18:13:50.679156948 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2000,2003 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -29,6 +29,8 @@
 /****************************************************************************
  *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995               *
  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
+ *     and:  Juergen Pfeifer,                       1998,2009               *
+ *     and:  Thomas E. Dickey                       1998-on                 *
  ****************************************************************************/
 
 /*
@@ -38,14 +40,22 @@
  */
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_slklab.c,v 1.7 2003/03/29 22:53:48 tom Exp $")
+MODULE_ID("$Id: lib_slklab.c,v 1.10 2009/10/24 22:12:21 tom Exp $")
 
 NCURSES_EXPORT(char *)
-slk_label(int n)
+NCURSES_SP_NAME(slk_label) (NCURSES_SP_DCLx int n)
 {
-    T((T_CALLED("slk_label(%d)"), n));
+    T((T_CALLED("slk_label(%p,%d)"), (void *) SP_PARM, n));
 
-    if (SP == NULL || SP->_slk == NULL || n < 1 || n > SP->_slk->labcnt)
+    if (SP_PARM == 0 || SP_PARM->_slk == 0 || n < 1 || n > SP_PARM->_slk->labcnt)
 	returnPtr(0);
-    returnPtr(SP->_slk->ent[n - 1].ent_text);
+    returnPtr(SP_PARM->_slk->ent[n - 1].ent_text);
+}
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(char *)
+slk_label(int n)
+{
+    return NCURSES_SP_NAME(slk_label) (CURRENT_SCREEN, n);
 }
+#endif
diff -Naur ncurses-5.7.orig/ncurses/base/lib_slkrefr.c ncurses-5.7/ncurses/base/lib_slkrefr.c
--- ncurses-5.7.orig/ncurses/base/lib_slkrefr.c	2008-09-27 10:07:53.000000000 -0400
+++ ncurses-5.7/ncurses/base/lib_slkrefr.c	2011-01-08 18:13:50.679156948 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2006,2008 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            *
@@ -38,9 +38,18 @@
  *	Write SLK window to the (virtual) screen.
  */
 #include <curses.priv.h>
-#include <term.h>		/* num_labels, label_*, plab_norm */
 
-MODULE_ID("$Id: lib_slkrefr.c,v 1.17 2008/09/27 14:07:53 juergen Exp $")
+#ifndef CUR
+#define CUR SP_TERMTYPE
+#endif
+
+MODULE_ID("$Id: lib_slkrefr.c,v 1.26 2010/05/01 19:17:28 tom Exp $")
+
+#ifdef USE_TERM_DRIVER
+#define NumLabels    InfoOf(SP_PARM).numlabels
+#else
+#define NumLabels    num_labels
+#endif
 
 /*
  * Paint the info line for the PC style SLK emulation.
@@ -53,7 +62,7 @@
     if (win && sp && (sp->slk_format == 4)) {
 	int i;
 
-	mvwhline(win, 0, 0, 0, getmaxx(win));
+	(void) mvwhline(win, 0, 0, 0, getmaxx(win));
 	wmove(win, 0, 0);
 
 	for (i = 0; i < sp->_slk->maxlab; i++) {
@@ -66,31 +75,47 @@
  * Write the soft labels to the soft-key window.
  */
 static void
-slk_intern_refresh(SLK * slk)
+slk_intern_refresh(SCREEN *sp)
 {
     int i;
-    int fmt = SP->slk_format;
+    int fmt;
+    SLK *slk;
+    int numlab;
+
+    if (sp == 0)
+	return;
+
+    slk = sp->_slk;
+    fmt = sp->slk_format;
+    numlab = NumLabels;
+
+    if (slk->hidden)
+	return;
 
     for (i = 0; i < slk->labcnt; i++) {
 	if (slk->dirty || slk->ent[i].dirty) {
 	    if (slk->ent[i].visible) {
-		if (num_labels > 0 && SLK_STDFMT(fmt)) {
+		if (numlab > 0 && SLK_STDFMT(fmt)) {
+#ifdef USE_TERM_DRIVER
+		    CallDriver_2(sp, hwlabel, i + 1, slk->ent[i].form_text);
+#else
 		    if (i < num_labels) {
 			TPUTS_TRACE("plab_norm");
 			putp(TPARM_2(plab_norm, i + 1, slk->ent[i].form_text));
 		    }
+#endif
 		} else {
 		    if (fmt == 4)
 			slk_paint_info(slk->win);
 		    wmove(slk->win, SLK_LINES(fmt) - 1, slk->ent[i].ent_x);
-		    if (SP->_slk) {
-			wattrset(slk->win, AttrOf(SP->_slk->attr));
+		    if (sp->_slk) {
+			(void) wattrset(slk->win, AttrOf(sp->_slk->attr));
 		    }
 		    waddstr(slk->win, slk->ent[i].form_text);
 		    /* if we simulate SLK's, it's looking much more
 		       natural to use the current ATTRIBUTE also
 		       for the label window */
-		    wattrset(slk->win, WINDOW_ATTRS(stdscr));
+		    (void) wattrset(slk->win, WINDOW_ATTRS(StdScreen(sp)));
 		}
 	    }
 	    slk->ent[i].dirty = FALSE;
@@ -98,7 +123,10 @@
     }
     slk->dirty = FALSE;
 
-    if (num_labels > 0) {
+    if (numlab > 0) {
+#ifdef USE_TERM_DRIVER
+	CallDriver_1(sp, hwlabelOnOff, slk->hidden ? FALSE : TRUE);
+#else
 	if (slk->hidden) {
 	    TPUTS_TRACE("label_off");
 	    putp(label_off);
@@ -106,6 +134,7 @@
 	    TPUTS_TRACE("label_on");
 	    putp(label_on);
 	}
+#endif
     }
 }
 
@@ -113,32 +142,48 @@
  * Refresh the soft labels.
  */
 NCURSES_EXPORT(int)
-slk_noutrefresh(void)
+NCURSES_SP_NAME(slk_noutrefresh) (NCURSES_SP_DCL0)
 {
-    T((T_CALLED("slk_noutrefresh()")));
+    T((T_CALLED("slk_noutrefresh(%p)"), (void *) SP_PARM));
 
-    if (SP == NULL || SP->_slk == NULL)
+    if (SP_PARM == 0 || SP_PARM->_slk == 0)
 	returnCode(ERR);
-    if (SP->_slk->hidden)
+    if (SP_PARM->_slk->hidden)
 	returnCode(OK);
-    slk_intern_refresh(SP->_slk);
+    slk_intern_refresh(SP_PARM);
+
+    returnCode(wnoutrefresh(SP_PARM->_slk->win));
+}
 
-    returnCode(wnoutrefresh(SP->_slk->win));
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+slk_noutrefresh(void)
+{
+    return NCURSES_SP_NAME(slk_noutrefresh) (CURRENT_SCREEN);
 }
+#endif
 
 /*
  * Refresh the soft labels.
  */
 NCURSES_EXPORT(int)
-slk_refresh(void)
+NCURSES_SP_NAME(slk_refresh) (NCURSES_SP_DCL0)
 {
-    T((T_CALLED("slk_refresh()")));
+    T((T_CALLED("slk_refresh(%p)"), (void *) SP_PARM));
 
-    if (SP == NULL || SP->_slk == NULL)
+    if (SP_PARM == 0 || SP_PARM->_slk == 0)
 	returnCode(ERR);
-    if (SP->_slk->hidden)
+    if (SP_PARM->_slk->hidden)
 	returnCode(OK);
-    slk_intern_refresh(SP->_slk);
+    slk_intern_refresh(SP_PARM);
+
+    returnCode(wrefresh(SP_PARM->_slk->win));
+}
 
-    returnCode(wrefresh(SP->_slk->win));
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+slk_refresh(void)
+{
+    return NCURSES_SP_NAME(slk_refresh) (CURRENT_SCREEN);
 }
+#endif
diff -Naur ncurses-5.7.orig/ncurses/base/lib_slkset.c ncurses-5.7/ncurses/base/lib_slkset.c
--- ncurses-5.7.orig/ncurses/base/lib_slkset.c	2007-10-13 16:08:46.000000000 -0400
+++ ncurses-5.7/ncurses/base/lib_slkset.c	2011-01-08 18:18:29.746780939 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2005,2007 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            *
@@ -44,10 +44,10 @@
 #endif
 #endif
 
-MODULE_ID("$Id: lib_slkset.c,v 1.17 2007/10/13 20:08:46 tom Exp $")
+MODULE_ID("$Id: lib_slkset.c,v 1.21 2010/12/25 23:43:58 tom Exp $")
 
 NCURSES_EXPORT(int)
-slk_set(int i, const char *astr, int format)
+NCURSES_SP_NAME(slk_set) (NCURSES_SP_DCLx int i, const char *astr, int format)
 {
     SLK *slk;
     int offset;
@@ -57,20 +57,20 @@
     const char *str = astr;
     const char *p;
 
-    T((T_CALLED("slk_set(%d, \"%s\", %d)"), i, str, format));
+    T((T_CALLED("slk_set(%p, %d, \"%s\", %d)"), (void *) SP_PARM, i, str, format));
 
-    if (SP == 0
-	|| (slk = SP->_slk) == 0
+    if (SP_PARM == 0
+	|| (slk = SP_PARM->_slk) == 0
 	|| i < 1
 	|| i > slk->labcnt
 	|| format < 0
 	|| format > 2)
 	returnCode(ERR);
-    if (str == NULL)
+    if (str == 0)
 	str = "";
     --i;			/* Adjust numbering of labels */
 
-    limit = MAX_SKEY_LEN(SP->slk_format);
+    limit = MAX_SKEY_LEN(SP_PARM->slk_format);
     while (isspace(UChar(*str)))
 	str++;			/* skip over leading spaces  */
     p = str;
@@ -94,12 +94,12 @@
 	numcols += wcwidth(wc);
 	p += need;
     }
-    numchrs = (p - str);
+    numchrs = (int) (p - str);
 #else
     while (isprint(UChar(*p)))
 	p++;			/* The first non-print stops */
 
-    numcols = (p - str);
+    numcols = (int) (p - str);
     if (numcols > limit)
 	numcols = limit;
     numchrs = numcols;
@@ -147,3 +147,11 @@
     slk->ent[i].dirty = TRUE;
     returnCode(OK);
 }
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+slk_set(int i, const char *astr, int format)
+{
+    return NCURSES_SP_NAME(slk_set) (CURRENT_SCREEN, i, astr, format);
+}
+#endif
diff -Naur ncurses-5.7.orig/ncurses/base/lib_slktouch.c ncurses-5.7/ncurses/base/lib_slktouch.c
--- ncurses-5.7.orig/ncurses/base/lib_slktouch.c	2000-12-09 21:43:27.000000000 -0500
+++ ncurses-5.7/ncurses/base/lib_slktouch.c	2011-01-08 18:13:50.679156948 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998,2000 Free Software Foundation, Inc.                   *
+ * Copyright (c) 1998-2000,2009 Free 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,8 +27,8 @@
  ****************************************************************************/
 
 /****************************************************************************
- *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995               *
- *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
+ *  Author: Juergen Pfeifer                         1997,2009               *
+ *     and: Thomas E. Dickey                        1996-on                 *
  ****************************************************************************/
 
 /*
@@ -38,16 +38,24 @@
  */
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_slktouch.c,v 1.5 2000/12/10 02:43:27 tom Exp $")
+MODULE_ID("$Id: lib_slktouch.c,v 1.8 2009/10/24 22:12:21 tom Exp $")
 
 NCURSES_EXPORT(int)
-slk_touch(void)
+NCURSES_SP_NAME(slk_touch) (NCURSES_SP_DCL0)
 {
-    T((T_CALLED("slk_touch()")));
+    T((T_CALLED("slk_touch(%p)"), (void *) SP_PARM));
 
-    if (SP == NULL || SP->_slk == NULL)
+    if (SP_PARM == 0 || SP_PARM->_slk == 0)
 	returnCode(ERR);
-    SP->_slk->dirty = TRUE;
+    SP_PARM->_slk->dirty = TRUE;
 
     returnCode(OK);
 }
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+slk_touch(void)
+{
+    return NCURSES_SP_NAME(slk_touch) (CURRENT_SCREEN);
+}
+#endif
diff -Naur ncurses-5.7.orig/ncurses/base/lib_touch.c ncurses-5.7/ncurses/base/lib_touch.c
--- ncurses-5.7.orig/ncurses/base/lib_touch.c	2000-12-09 21:43:27.000000000 -0500
+++ ncurses-5.7/ncurses/base/lib_touch.c	2011-01-08 18:18:29.746780939 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998,2000 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            *
@@ -43,12 +43,12 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_touch.c,v 1.9 2000/12/10 02:43:27 tom Exp $")
+MODULE_ID("$Id: lib_touch.c,v 1.11 2010/12/19 01:22:58 tom Exp $")
 
 NCURSES_EXPORT(bool)
 is_linetouched(WINDOW *win, int line)
 {
-    T((T_CALLED("is_linetouched(%p,%d)"), win, line));
+    T((T_CALLED("is_linetouched(%p,%d)"), (void *) win, line));
 
     /* XSI doesn't define any error */
     if (!win || (line > win->_maxy) || (line < 0))
@@ -62,7 +62,7 @@
 {
     int i;
 
-    T((T_CALLED("is_wintouched(%p)"), win));
+    T((T_CALLED("is_wintouched(%p)"), (void *) win));
 
     if (win)
 	for (i = 0; i <= win->_maxy; i++)
@@ -76,7 +76,7 @@
 {
     int i;
 
-    T((T_CALLED("wtouchln(%p,%d,%d,%d)"), win, y, n, changed));
+    T((T_CALLED("wtouchln(%p,%d,%d,%d)"), (void *) win, y, n, changed));
 
     if (!win || (n < 0) || (y < 0) || (y > win->_maxy))
 	returnCode(ERR);
@@ -85,7 +85,9 @@
 	if (i > win->_maxy)
 	    break;
 	win->_line[i].firstchar = changed ? 0 : _NOCHANGE;
-	win->_line[i].lastchar = changed ? win->_maxx : _NOCHANGE;
+	win->_line[i].lastchar = (NCURSES_SIZE_T) (changed
+						   ? win->_maxx
+						   : _NOCHANGE);
     }
     returnCode(OK);
 }
diff -Naur ncurses-5.7.orig/ncurses/base/lib_ungetch.c ncurses-5.7/ncurses/base/lib_ungetch.c
--- ncurses-5.7.orig/ncurses/base/lib_ungetch.c	2008-05-31 12:44:54.000000000 -0400
+++ ncurses-5.7/ncurses/base/lib_ungetch.c	2011-01-08 18:13:50.679156948 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -30,6 +30,7 @@
  *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995               *
  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
  *     and: Thomas E. Dickey                        1996-on                 *
+ *     and: Juergen Pfeifer                         2009                    *
  ****************************************************************************/
 
 /*
@@ -41,7 +42,7 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_ungetch.c,v 1.11 2008/05/31 16:44:54 tom Exp $")
+MODULE_ID("$Id: lib_ungetch.c,v 1.14 2009/10/24 22:12:21 tom Exp $")
 
 #include <fifo_defs.h>
 
@@ -57,10 +58,12 @@
 #endif /* TRACE */
 
 NCURSES_EXPORT(int)
-_nc_ungetch(SCREEN *sp, int ch)
+safe_ungetch(SCREEN *sp, int ch)
 {
     int rc = ERR;
 
+    T((T_CALLED("ungetch(%p,%s)"), (void *) sp, _nc_tracechar(sp, ch)));
+
     if (tail != -1) {
 	if (head == -1) {
 	    head = 0;
@@ -79,12 +82,11 @@
 #endif
 	rc = OK;
     }
-    return rc;
+    returnCode(rc);
 }
 
 NCURSES_EXPORT(int)
 ungetch(int ch)
 {
-    T((T_CALLED("ungetch(%s)"), _nc_tracechar(SP, ch)));
-    returnCode(_nc_ungetch(SP, ch));
+    return safe_ungetch(CURRENT_SCREEN, ch);
 }
diff -Naur ncurses-5.7.orig/ncurses/base/lib_vline.c ncurses-5.7/ncurses/base/lib_vline.c
--- ncurses-5.7.orig/ncurses/base/lib_vline.c	2006-03-11 16:52:19.000000000 -0500
+++ ncurses-5.7/ncurses/base/lib_vline.c	2011-01-08 18:18:29.746780939 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2001,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            *
@@ -40,16 +40,16 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_vline.c,v 1.10 2006/03/11 21:52:19 tom Exp $")
+MODULE_ID("$Id: lib_vline.c,v 1.12 2010/12/19 01:22:58 tom Exp $")
 
 NCURSES_EXPORT(int)
 wvline(WINDOW *win, chtype ch, int n)
 {
     int code = ERR;
-    NCURSES_SIZE_T row, col;
-    NCURSES_SIZE_T end;
+    int row, col;
+    int end;
 
-    T((T_CALLED("wvline(%p,%s,%d)"), win, _tracechtype(ch), n));
+    T((T_CALLED("wvline(%p,%s,%d)"), (void *) win, _tracechtype(ch), n));
 
     if (win) {
 	NCURSES_CH_T wch;
diff -Naur ncurses-5.7.orig/ncurses/base/lib_wattroff.c ncurses-5.7/ncurses/base/lib_wattroff.c
--- ncurses-5.7.orig/ncurses/base/lib_wattroff.c	2006-05-27 15:30:33.000000000 -0400
+++ ncurses-5.7/ncurses/base/lib_wattroff.c	2011-01-08 18:13:50.679156948 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2005,2006 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2006,2009 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -42,12 +42,12 @@
 #include <curses.priv.h>
 #include <ctype.h>
 
-MODULE_ID("$Id: lib_wattroff.c,v 1.9 2006/05/27 19:30:33 tom Exp $")
+MODULE_ID("$Id: lib_wattroff.c,v 1.10 2009/10/24 22:36:08 tom Exp $")
 
 NCURSES_EXPORT(int)
 wattr_off(WINDOW *win, attr_t at, void *opts GCC_UNUSED)
 {
-    T((T_CALLED("wattr_off(%p,%s)"), win, _traceattr(at)));
+    T((T_CALLED("wattr_off(%p,%s)"), (void *) win, _traceattr(at)));
     if (win) {
 	T(("... current %s (%d)",
 	   _traceattr(WINDOW_ATTRS(win)),
diff -Naur ncurses-5.7.orig/ncurses/base/lib_wattron.c ncurses-5.7/ncurses/base/lib_wattron.c
--- ncurses-5.7.orig/ncurses/base/lib_wattron.c	2006-05-27 15:30:46.000000000 -0400
+++ ncurses-5.7/ncurses/base/lib_wattron.c	2011-01-08 18:13:50.679156948 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2005,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            *
@@ -42,12 +42,12 @@
 #include <curses.priv.h>
 #include <ctype.h>
 
-MODULE_ID("$Id: lib_wattron.c,v 1.9 2006/05/27 19:30:46 tom Exp $")
+MODULE_ID("$Id: lib_wattron.c,v 1.11 2010/03/31 23:38:02 tom Exp $")
 
 NCURSES_EXPORT(int)
 wattr_on(WINDOW *win, attr_t at, void *opts GCC_UNUSED)
 {
-    T((T_CALLED("wattr_on(%p,%s)"), win, _traceattr(at)));
+    T((T_CALLED("wattr_on(%p,%s)"), (void *) win, _traceattr(at)));
     if (win != 0) {
 	T(("... current %s (%d)",
 	   _traceattr(WINDOW_ATTRS(win)),
@@ -55,7 +55,7 @@
 
 	if_EXT_COLORS({
 	    if (at & A_COLOR)
-		win->_color = PAIR_NUMBER(at);
+		win->_color = PairNumber(at);
 	});
 	toggle_attr_on(WINDOW_ATTRS(win), at);
 	returnCode(OK);
diff -Naur ncurses-5.7.orig/ncurses/base/lib_winch.c ncurses-5.7/ncurses/base/lib_winch.c
--- ncurses-5.7.orig/ncurses/base/lib_winch.c	2001-06-02 19:42:08.000000000 -0400
+++ ncurses-5.7/ncurses/base/lib_winch.c	2011-01-08 18:18:29.746780939 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998,2000,2001 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            *
@@ -39,16 +39,16 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_winch.c,v 1.5 2001/06/02 23:42:08 skimo Exp $")
+MODULE_ID("$Id: lib_winch.c,v 1.8 2010/12/19 01:22:58 tom Exp $")
 
 NCURSES_EXPORT(chtype)
 winch(WINDOW *win)
 {
-    T((T_CALLED("winch(%p)"), win));
+    T((T_CALLED("winch(%p)"), (void *) win));
     if (win != 0) {
-	returnChar(CharOf(win->_line[win->_cury].text[win->_curx]) |
-		   AttrOf(win->_line[win->_cury].text[win->_curx]));
+	returnChtype((chtype) CharOf(win->_line[win->_cury].text[win->_curx])
+		     | AttrOf(win->_line[win->_cury].text[win->_curx]));
     } else {
-	returnChar(0);
+	returnChtype(0);
     }
 }
diff -Naur ncurses-5.7.orig/ncurses/base/lib_window.c ncurses-5.7/ncurses/base/lib_window.c
--- ncurses-5.7.orig/ncurses/base/lib_window.c	2008-06-07 10:12:56.000000000 -0400
+++ ncurses-5.7/ncurses/base/lib_window.c	2011-01-08 18:18:29.750780851 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2007,2008 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            *
@@ -39,7 +39,7 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_window.c,v 1.25 2008/06/07 14:12:56 tom Exp $")
+MODULE_ID("$Id: lib_window.c,v 1.29 2010/12/19 01:47:22 tom Exp $")
 
 NCURSES_EXPORT(void)
 _nc_synchook(WINDOW *win)
@@ -57,32 +57,30 @@
 {
     WINDOW *orig;
     int i;
+    int rc = ERR;
 
-    T((T_CALLED("mvderwin(%p,%d,%d)"), win, y, x));
+    T((T_CALLED("mvderwin(%p,%d,%d)"), (void *) win, y, x));
 
-    if (win && (orig = win->_parent)) {
-	if (win->_parx == x && win->_pary == y)
-	    returnCode(OK);
-	if (x < 0 || y < 0)
-	    returnCode(ERR);
-	if ((x + getmaxx(win) > getmaxx(orig)) ||
-	    (y + getmaxy(win) > getmaxy(orig)))
-	    returnCode(ERR);
-    } else
-	returnCode(ERR);
-    wsyncup(win);
-    win->_parx = x;
-    win->_pary = y;
-    for (i = 0; i < getmaxy(win); i++)
-	win->_line[i].text = &(orig->_line[y++].text[x]);
-    returnCode(OK);
+    if (win != 0
+	&& (orig = win->_parent) != 0
+	&& (x >= 0 && y >= 0)
+	&& (x + getmaxx(win) <= getmaxx(orig))
+	&& (y + getmaxy(win) <= getmaxy(orig))) {
+	wsyncup(win);
+	win->_parx = x;
+	win->_pary = y;
+	for (i = 0; i < getmaxy(win); i++)
+	    win->_line[i].text = &(orig->_line[y++].text[x]);
+	rc = OK;
+    }
+    returnCode(rc);
 }
 
 NCURSES_EXPORT(int)
 syncok(WINDOW *win, bool bf)
 /* enable/disable automatic wsyncup() on each change to window */
 {
-    T((T_CALLED("syncok(%p,%d)"), win, bf));
+    T((T_CALLED("syncok(%p,%d)"), (void *) win, bf));
 
     if (win) {
 	win->_sync = bf;
@@ -98,7 +96,7 @@
 {
     WINDOW *wp;
 
-    T((T_CALLED("wsyncup(%p)"), win));
+    T((T_CALLED("wsyncup(%p)"), (void *) win));
     if (win && win->_parent) {
 	for (wp = win; wp->_parent; wp = wp->_parent) {
 	    int y;
@@ -128,7 +126,7 @@
 /* mark changed every cell in win that is changed in any of its ancestors */
 /* Rewritten by J. Pfeifer, 1-Apr-96 (don't even think that...)           */
 {
-    T((T_CALLED("wsyncdown(%p)"), win));
+    T((T_CALLED("wsyncdown(%p)"), (void *) win));
 
     if (win && win->_parent) {
 	WINDOW *pp = win->_parent;
@@ -167,7 +165,7 @@
 {
     WINDOW *wp;
 
-    T((T_CALLED("wcursyncup(%p)"), win));
+    T((T_CALLED("wcursyncup(%p)"), (void *) win));
     for (wp = win; wp && wp->_parent; wp = wp->_parent) {
 	wmove(wp->_parent, wp->_pary + wp->_cury, wp->_parx + wp->_curx);
     }
@@ -182,19 +180,23 @@
     size_t linesize;
     int i;
 
-    T((T_CALLED("dupwin(%p)"), win));
+    T((T_CALLED("dupwin(%p)"), (void *) win));
 
     if (win != 0) {
-
+#if NCURSES_SP_FUNCS
+	SCREEN *sp = _nc_screen_of(win);
+#endif
 	_nc_lock_global(curses);
 	if (win->_flags & _ISPAD) {
-	    nwin = newpad(win->_maxy + 1,
-			  win->_maxx + 1);
+	    nwin = NCURSES_SP_NAME(newpad) (NCURSES_SP_ARGx
+					    win->_maxy + 1,
+					    win->_maxx + 1);
 	} else {
-	    nwin = newwin(win->_maxy + 1,
-			  win->_maxx + 1,
-			  win->_begy,
-			  win->_begx);
+	    nwin = NCURSES_SP_NAME(newwin) (NCURSES_SP_ARGx
+					    win->_maxy + 1,
+					    win->_maxx + 1,
+					    win->_begy,
+					    win->_begx);
 	}
 
 	if (nwin != 0) {
@@ -237,7 +239,7 @@
 	    if (win->_flags & _ISPAD)
 		nwin->_pad = win->_pad;
 
-	    linesize = (win->_maxx + 1) * sizeof(NCURSES_CH_T);
+	    linesize = (unsigned) (win->_maxx + 1) * sizeof(NCURSES_CH_T);
 	    for (i = 0; i <= nwin->_maxy; i++) {
 		memcpy(nwin->_line[i].text, win->_line[i].text, linesize);
 		nwin->_line[i].firstchar = win->_line[i].firstchar;
diff -Naur ncurses-5.7.orig/ncurses/base/nc_panel.c ncurses-5.7/ncurses/base/nc_panel.c
--- ncurses-5.7.orig/ncurses/base/nc_panel.c	2000-12-09 21:43:28.000000000 -0500
+++ ncurses-5.7/ncurses/base/nc_panel.c	2011-01-08 18:13:50.691157119 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998,2000 Free Software Foundation, Inc.                   *
+ * Copyright (c) 1998-2000,2009 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -32,10 +32,22 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: nc_panel.c,v 1.4 2000/12/10 02:43:28 tom Exp $")
+MODULE_ID("$Id: nc_panel.c,v 1.5 2009/04/11 21:05:10 tom Exp $")
 
 NCURSES_EXPORT(struct panelhook *)
+NCURSES_SP_NAME(_nc_panelhook) (NCURSES_SP_DCL0)
+{
+    return (SP_PARM
+	    ? &(SP_PARM->_panelHook)
+	    : (CURRENT_SCREEN
+	       ? &(CURRENT_SCREEN->_panelHook)
+	       : 0));
+}
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(struct panelhook *)
 _nc_panelhook(void)
 {
-    return (SP ? &(SP->_panelHook) : NULL);
+    return NCURSES_SP_NAME(_nc_panelhook) (CURRENT_SCREEN);
 }
+#endif
diff -Naur ncurses-5.7.orig/ncurses/base/resizeterm.c ncurses-5.7/ncurses/base/resizeterm.c
--- ncurses-5.7.orig/ncurses/base/resizeterm.c	2008-06-07 09:58:40.000000000 -0400
+++ ncurses-5.7/ncurses/base/resizeterm.c	2011-01-08 18:13:50.691157119 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2008,2009 Free 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,6 +28,7 @@
 
 /****************************************************************************
  *  Author: Thomas E. Dickey                                                *
+ *     and: Juergen Pfeifer                                                 *
  ****************************************************************************/
 
 /*
@@ -39,11 +40,12 @@
  */
 
 #include <curses.priv.h>
-#include <term.h>
 
-MODULE_ID("$Id: resizeterm.c,v 1.34 2008/06/07 13:58:40 tom Exp $")
+#ifndef CUR
+#define CUR SP_TERMTYPE
+#endif
 
-#define stolen_lines (screen_lines - SP->_lines_avail)
+MODULE_ID("$Id: resizeterm.c,v 1.42 2009/10/24 20:38:43 tom Exp $")
 
 /*
  * If we're trying to be reentrant, do not want any local statics.
@@ -64,18 +66,23 @@
 static void
 show_window_sizes(const char *name)
 {
+    SCREEN *sp;
     WINDOWLIST *wp;
 
     _nc_lock_global(curses);
-    _tracef("%s resizing: %2d x %2d (%2d x %2d)", name, LINES, COLS,
-	    screen_lines, screen_columns);
-    for (each_window(wp)) {
-	_tracef("  window %p is %2ld x %2ld at %2ld,%2ld",
-		&(wp->win),
-		(long) wp->win._maxy + 1,
-		(long) wp->win._maxx + 1,
-		(long) wp->win._begy,
-		(long) wp->win._begx);
+    for (each_screen(sp)) {
+	_tracef("%s resizing: %p: %2d x %2d (%2d x %2d)", name, (void *) sp,
+		*(ptrLines(sp)),
+		*(ptrCols(sp)),
+		screen_lines(sp), screen_columns(sp));
+	for (each_window(sp, wp)) {
+	    _tracef("  window %p is %2ld x %2ld at %2ld,%2ld",
+		    (void *) &(wp->win),
+		    (long) wp->win._maxy + 1,
+		    (long) wp->win._maxx + 1,
+		    (long) wp->win._begy,
+		    (long) wp->win._begx);
+	}
     }
     _nc_unlock_global(curses);
 }
@@ -86,15 +93,23 @@
  * structure's size.
  */
 NCURSES_EXPORT(bool)
-is_term_resized(int ToLines, int ToCols)
+NCURSES_SP_NAME(is_term_resized) (NCURSES_SP_DCLx int ToLines, int ToCols)
 {
-    T((T_CALLED("is_term_resized(%d, %d)"), ToLines, ToCols));
+    T((T_CALLED("is_term_resized(%p, %d, %d)"), (void *) SP_PARM, ToLines, ToCols));
     returnCode(ToLines > 0
 	       && ToCols > 0
-	       && (ToLines != screen_lines
-		   || ToCols != screen_columns));
+	       && (ToLines != screen_lines(SP_PARM)
+		   || ToCols != screen_columns(SP_PARM)));
 }
 
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(bool)
+is_term_resized(int ToLines, int ToCols)
+{
+    return NCURSES_SP_NAME(is_term_resized) (CURRENT_SCREEN, ToLines, ToCols);
+}
+#endif
+
 /*
  */
 static ripoff_t *
@@ -104,6 +119,9 @@
     ripoff_t *rop;
 
     if (win != 0) {
+#ifdef USE_SP_RIPOFF
+	SCREEN *sp = _nc_screen_of(win);
+#endif
 	for (each_ripoff(rop)) {
 	    if (rop->win == win && rop->line != 0) {
 		result = rop;
@@ -125,6 +143,9 @@
     ripoff_t *rop;
 
     if (win != 0) {
+#ifdef USE_SP_RIPOFF
+	SCREEN *sp = _nc_screen_of(win);
+#endif
 	for (each_ripoff(rop)) {
 	    if (rop->line < 0) {
 		result -= rop->line;
@@ -146,9 +167,12 @@
     int depth = 0;
 
     if (cmp != 0) {
+#ifdef USE_SP_WINDOWLIST
+	SCREEN *sp = _nc_screen_of(cmp);
+#endif
 	WINDOWLIST *wp;
 
-	for (each_window(wp)) {
+	for (each_window(sp, wp)) {
 	    WINDOW *tst = &(wp->win);
 	    if (tst->_parent == cmp) {
 		depth = 1 + child_depth(tst);
@@ -184,13 +208,13 @@
 adjust_window(WINDOW *win, int ToLines, int ToCols, int stolen EXTRA_DCLS)
 {
     int result;
-    int bottom = CurLines + SP->_topstolen - stolen;
+    int bottom = CurLines + _nc_screen_of(win)->_topstolen - stolen;
     int myLines = win->_maxy + 1;
     int myCols = win->_maxx + 1;
     ripoff_t *rop = ripped_window(win);
 
     T((T_CALLED("adjust_window(%p,%d,%d)%s depth %d/%d currently %ldx%ld at %ld,%ld"),
-       win, ToLines, ToCols,
+       (void *) win, ToLines, ToCols,
        (rop != 0) ? " (rip)" : "",
        parent_depth(win),
        child_depth(win),
@@ -202,13 +226,19 @@
 	 * If it is a ripped-off window at the bottom of the screen, simply
 	 * move it to the same relative position.
 	 */
-	win->_begy = ToLines - ripped_bottom(win) - 0 - win->_yoffset;
+	win->_begy = (NCURSES_SIZE_T) (ToLines - ripped_bottom(win) - 0 - win->_yoffset);
+	if (rop->hook == _nc_slk_initialize)
+	    _nc_format_slks(
+#if NCURSES_SP_FUNCS
+			       _nc_screen_of(win),
+#endif
+			       ToCols);
     } else if (win->_begy >= bottom) {
 	/*
 	 * If it is below the bottom of the new screen, move up by the same
 	 * amount that the screen shrank.
 	 */
-	win->_begy += (ToLines - CurLines);
+	win->_begy = (NCURSES_SIZE_T) (win->_begy + (ToLines - CurLines));
     } else {
 	if (myLines == (CurLines - stolen)
 	    && ToLines != CurLines) {
@@ -239,19 +269,19 @@
  * children, decrease those to fit, then decrease the containing window, etc.
  */
 static int
-decrease_size(int ToLines, int ToCols, int stolen EXTRA_DCLS)
+decrease_size(NCURSES_SP_DCLx int ToLines, int ToCols, int stolen EXTRA_DCLS)
 {
     bool found;
     int depth = 0;
     WINDOWLIST *wp;
 
-    T((T_CALLED("decrease_size(%d, %d)"), ToLines, ToCols));
+    T((T_CALLED("decrease_size(%p, %d, %d)"), (void *) SP_PARM, ToLines, ToCols));
 
     do {
 	found = FALSE;
 	TR(TRACE_UPDATE, ("decreasing size of windows to %dx%d, depth=%d",
 			  ToLines, ToCols, depth));
-	for (each_window(wp)) {
+	for (each_window(SP_PARM, wp)) {
 	    WINDOW *win = &(wp->win);
 
 	    if (!(win->_flags & _ISPAD)) {
@@ -273,19 +303,19 @@
  * parent, increase those to fit, then increase the contained window, etc.
  */
 static int
-increase_size(int ToLines, int ToCols, int stolen EXTRA_DCLS)
+increase_size(NCURSES_SP_DCLx int ToLines, int ToCols, int stolen EXTRA_DCLS)
 {
     bool found;
     int depth = 0;
     WINDOWLIST *wp;
 
-    T((T_CALLED("increase_size(%d, %d)"), ToLines, ToCols));
+    T((T_CALLED("increase_size(%p, %d, %d)"), (void *) SP_PARM, ToLines, ToCols));
 
     do {
 	found = FALSE;
 	TR(TRACE_UPDATE, ("increasing size of windows to %dx%d, depth=%d",
 			  ToLines, ToCols, depth));
-	for (each_window(wp)) {
+	for (each_window(SP_PARM, wp)) {
 	    WINDOW *win = &(wp->win);
 
 	    if (!(win->_flags & _ISPAD)) {
@@ -307,25 +337,26 @@
  * such as ungetch().
  */
 NCURSES_EXPORT(int)
-resize_term(int ToLines, int ToCols)
+NCURSES_SP_NAME(resize_term) (NCURSES_SP_DCLx int ToLines, int ToCols)
 {
     int result = OK EXTRA_ARGS;
     int was_stolen;
 
-    T((T_CALLED("resize_term(%d,%d) old(%d,%d)"),
-       ToLines, ToCols,
-       screen_lines, screen_columns));
+    T((T_CALLED("resize_term(%p,%d,%d) old(%d,%d)"),
+       (void *) SP_PARM, ToLines, ToCols,
+       (SP_PARM == 0) ? -1 : screen_lines(SP_PARM),
+       (SP_PARM == 0) ? -1 : screen_columns(SP_PARM)));
 
-    if (SP == 0) {
+    if (SP_PARM == 0) {
 	returnCode(ERR);
     }
 
-    _nc_lock_global(curses);
+    _nc_nonsp_lock_global(curses);
 
-    was_stolen = (screen_lines - SP->_lines_avail);
-    if (is_term_resized(ToLines, ToCols)) {
-	int myLines = CurLines = screen_lines;
-	int myCols = CurCols = screen_columns;
+    was_stolen = (screen_lines(SP_PARM) - SP_PARM->_lines_avail);
+    if (NCURSES_SP_NAME(is_term_resized) (NCURSES_SP_ARGx ToLines, ToCols)) {
+	int myLines = CurLines = screen_lines(SP_PARM);
+	int myCols = CurCols = screen_columns(SP_PARM);
 
 #ifdef TRACE
 	if (USE_TRACEF(TRACE_UPDATE)) {
@@ -333,33 +364,42 @@
 	    _nc_unlock_global(tracef);
 	}
 #endif
-	if (ToLines > screen_lines) {
-	    increase_size(myLines = ToLines, myCols, was_stolen EXTRA_ARGS);
+	if (ToLines > screen_lines(SP_PARM)) {
+	    increase_size(NCURSES_SP_ARGx
+			  myLines = ToLines, myCols, was_stolen EXTRA_ARGS);
 	    CurLines = myLines;
 	    CurCols = myCols;
 	}
 
-	if (ToCols > screen_columns) {
-	    increase_size(myLines, myCols = ToCols, was_stolen EXTRA_ARGS);
+	if (ToCols > screen_columns(SP_PARM)) {
+	    increase_size(NCURSES_SP_ARGx
+			  myLines, myCols = ToCols, was_stolen EXTRA_ARGS);
 	    CurLines = myLines;
 	    CurCols = myCols;
 	}
 
 	if (ToLines < myLines ||
 	    ToCols < myCols) {
-	    decrease_size(ToLines, ToCols, was_stolen EXTRA_ARGS);
+	    decrease_size(NCURSES_SP_ARGx ToLines, ToCols, was_stolen EXTRA_ARGS);
 	}
 
-	screen_lines = lines = ToLines;
-	screen_columns = columns = ToCols;
+	screen_lines(SP_PARM) = (NCURSES_SIZE_T) ToLines;
+	screen_columns(SP_PARM) = (NCURSES_SIZE_T) ToCols;
 
-	SP->_lines_avail = lines - was_stolen;
+#ifdef USE_TERM_DRIVER
+	CallDriver_2(SP_PARM, setsize, ToLines, ToCols);
+#else
+	lines = (NCURSES_SIZE_T) ToLines;
+	columns = (NCURSES_SIZE_T) ToCols;
+#endif
 
-	if (SP->oldhash) {
-	    FreeAndNull(SP->oldhash);
+	SP_PARM->_lines_avail = (NCURSES_SIZE_T) (ToLines - was_stolen);
+
+	if (SP_PARM->oldhash) {
+	    FreeAndNull(SP_PARM->oldhash);
 	}
-	if (SP->newhash) {
-	    FreeAndNull(SP->newhash);
+	if (SP_PARM->newhash) {
+	    FreeAndNull(SP_PARM->newhash);
 	}
 #ifdef TRACE
 	if (USE_TRACEF(TRACE_UPDATE)) {
@@ -378,11 +418,23 @@
     SET_LINES(ToLines - was_stolen);
     SET_COLS(ToCols);
 
-    _nc_unlock_global(curses);
+    _nc_nonsp_unlock_global(curses);
 
     returnCode(result);
 }
 
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+resize_term(int ToLines, int ToCols)
+{
+    int res = ERR;
+    _nc_sp_lock_global(curses);
+    res = NCURSES_SP_NAME(resize_term) (CURRENT_SCREEN, ToLines, ToCols);
+    _nc_sp_unlock_global(curses);
+    return (res);
+}
+#endif
+
 /*
  * This function reallocates NCURSES window structures.  It is invoked in
  * response to a SIGWINCH interrupt.  Other user-defined windows may also need
@@ -392,34 +444,35 @@
  * invoked directly from the signal handler.
  */
 NCURSES_EXPORT(int)
-resizeterm(int ToLines, int ToCols)
+NCURSES_SP_NAME(resizeterm) (NCURSES_SP_DCLx int ToLines, int ToCols)
 {
     int result = ERR;
 
-    T((T_CALLED("resizeterm(%d,%d) old(%d,%d)"),
-       ToLines, ToCols,
-       screen_lines, screen_columns));
+    T((T_CALLED("resizeterm(%p, %d,%d) old(%d,%d)"),
+       (void *) SP_PARM, ToLines, ToCols,
+       (SP_PARM == 0) ? -1 : screen_lines(SP_PARM),
+       screen_columns(SP_PARM)));
 
-    if (SP != 0) {
+    if (SP_PARM != 0) {
 	result = OK;
-	SP->_sig_winch = FALSE;
+	SP_PARM->_sig_winch = FALSE;
 
-	if (is_term_resized(ToLines, ToCols)) {
+	if (NCURSES_SP_NAME(is_term_resized) (NCURSES_SP_ARGx ToLines, ToCols)) {
 #if USE_SIGWINCH
 	    ripoff_t *rop;
-	    bool slk_visible = (SP != 0
-				&& SP->_slk != 0
-				&& !(SP->_slk->hidden));
+	    bool slk_visible = (SP_PARM != 0
+				&& SP_PARM->_slk != 0
+				&& !(SP_PARM->_slk->hidden));
 
 	    if (slk_visible) {
 		slk_clear();
 	    }
 #endif
-	    result = resize_term(ToLines, ToCols);
+	    result = NCURSES_SP_NAME(resize_term) (NCURSES_SP_ARGx ToLines, ToCols);
 
 #if USE_SIGWINCH
-	    _nc_ungetch(SP, KEY_RESIZE);	/* so application can know this */
-	    clearok(curscr, TRUE);	/* screen contents are unknown */
+	    safe_ungetch(SP_PARM, KEY_RESIZE);	/* so application can know this */
+	    clearok(CurScreen(SP_PARM), TRUE);	/* screen contents are unknown */
 
 	    /* ripped-off lines are a special case: if we did not lengthen
 	     * them, we haven't moved them either.  repaint them, too.
@@ -429,7 +482,7 @@
 	     * not know which are really on top.
 	     */
 	    for (each_ripoff(rop)) {
-		if (rop->win != stdscr
+		if (rop->win != StdScreen(SP_PARM)
 		    && rop->win != 0
 		    && rop->line < 0) {
 
@@ -442,10 +495,9 @@
 
 	    /* soft-keys are a special case: we _know_ how to repaint them */
 	    if (slk_visible) {
-		slk_restore();
-		slk_touch();
-
-		slk_refresh();
+		NCURSES_SP_NAME(slk_restore) (NCURSES_SP_ARG);
+		NCURSES_SP_NAME(slk_touch) (NCURSES_SP_ARG);
+		NCURSES_SP_NAME(slk_refresh) (NCURSES_SP_ARG);
 	    }
 #endif
 	}
@@ -453,3 +505,11 @@
 
     returnCode(result);
 }
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+resizeterm(int ToLines, int ToCols)
+{
+    return NCURSES_SP_NAME(resizeterm) (CURRENT_SCREEN, ToLines, ToCols);
+}
+#endif
diff -Naur ncurses-5.7.orig/ncurses/base/safe_sprintf.c ncurses-5.7/ncurses/base/safe_sprintf.c
--- ncurses-5.7.orig/ncurses/base/safe_sprintf.c	2007-04-21 18:28:06.000000000 -0400
+++ ncurses-5.7/ncurses/base/safe_sprintf.c	2011-01-08 18:13:50.691157119 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,2007 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            *
@@ -33,7 +33,7 @@
 #include <curses.priv.h>
 #include <ctype.h>
 
-MODULE_ID("$Id: safe_sprintf.c,v 1.20 2007/04/21 22:28:06 tom Exp $")
+MODULE_ID("$Id: safe_sprintf.c,v 1.24 2010/06/05 22:22:27 tom Exp $")
 
 #if USE_SAFE_SPRINTF
 
@@ -111,7 +111,7 @@
 		    }
 		    sprintf(fmt_arg, "%d", ival);
 		    fmt_len += strlen(fmt_arg);
-		    if ((format = realloc(format, fmt_len)) == 0) {
+		    if ((format = _nc_doalloc(format, fmt_len)) == 0) {
 			return -1;
 		    }
 		    strcpy(&format[--f], fmt_arg);
@@ -214,13 +214,20 @@
  * Wrapper for vsprintf that allocates a buffer big enough to hold the result.
  */
 NCURSES_EXPORT(char *)
-_nc_printf_string(const char *fmt, va_list ap)
+NCURSES_SP_NAME(_nc_printf_string) (NCURSES_SP_DCLx
+				    const char *fmt,
+				    va_list ap)
 {
     char *result = 0;
 
     if (fmt != 0) {
 #if USE_SAFE_SPRINTF
-	int len = _nc_printf_length(fmt, ap);
+	va_list ap2;
+	int len;
+
+	begin_va_copy(ap2, ap);
+	len = _nc_printf_length(fmt, ap2);
+	end_va_copy(ap2);
 
 	if ((int) my_length < len + 1) {
 	    my_length = 2 * (len + 1);
@@ -237,12 +244,12 @@
 #define MyCols _nc_globals.safeprint_cols
 #define MyRows _nc_globals.safeprint_rows
 
-	if (screen_lines > MyRows || screen_columns > MyCols) {
-	    if (screen_lines > MyRows)
-		MyRows = screen_lines;
-	    if (screen_columns > MyCols)
-		MyCols = screen_columns;
-	    my_length = (MyRows * (MyCols + 1)) + 1;
+	if (screen_lines(SP_PARM) > MyRows || screen_columns(SP_PARM) > MyCols) {
+	    if (screen_lines(SP_PARM) > MyRows)
+		MyRows = screen_lines(SP_PARM);
+	    if (screen_columns(SP_PARM) > MyCols)
+		MyCols = screen_columns(SP_PARM);
+	    my_length = (size_t) (MyRows * (MyCols + 1)) + 1;
 	    my_buffer = typeRealloc(char, my_length, my_buffer);
 	}
 
@@ -262,3 +269,11 @@
     }
     return result;
 }
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(char *)
+_nc_printf_string(const char *fmt, va_list ap)
+{
+    return NCURSES_SP_NAME(_nc_printf_string) (CURRENT_SCREEN, fmt, ap);
+}
+#endif
diff -Naur ncurses-5.7.orig/ncurses/base/tries.c ncurses-5.7/ncurses/base/tries.c
--- ncurses-5.7.orig/ncurses/base/tries.c	2008-08-16 15:22:55.000000000 -0400
+++ ncurses-5.7/ncurses/base/tries.c	2011-01-08 18:18:29.131406702 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2007,2008 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            *
@@ -39,7 +39,7 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: tries.c,v 1.27 2008/08/16 19:22:55 tom Exp $")
+MODULE_ID("$Id: tries.c,v 1.30 2010/08/28 21:08:23 tom Exp $")
 
 /*
  * Expand a keycode into the string that it corresponds to, returning null if
@@ -72,7 +72,9 @@
 	    *((unsigned char *) (result + len)) = 128;
 #ifdef TRACE
 	if (len == 0 && USE_TRACEF(TRACE_MAXIMUM)) {
-	    _tracef("expand_key %s %s", _nc_tracechar(SP, code), _nc_visbuf(result));
+	    _tracef("expand_key %s %s",
+		    _nc_tracechar(CURRENT_SCREEN, (int) code),
+		    _nc_visbuf(result));
 	    _nc_unlock_global(tracef);
 	}
 #endif
@@ -87,7 +89,7 @@
 NCURSES_EXPORT(int)
 _nc_remove_key(TRIES ** tree, unsigned code)
 {
-    T((T_CALLED("_nc_remove_key(%p,%d)"), tree, code));
+    T((T_CALLED("_nc_remove_key(%p,%d)"), (void *) tree, code));
 
     if (code == 0)
 	returnCode(FALSE);
@@ -119,7 +121,7 @@
 NCURSES_EXPORT(int)
 _nc_remove_string(TRIES ** tree, const char *string)
 {
-    T((T_CALLED("_nc_remove_string(%p,%s)"), tree, _nc_visbuf(string)));
+    T((T_CALLED("_nc_remove_string(%p,%s)"), (void *) tree, _nc_visbuf(string)));
 
     if (string == 0 || *string == 0)
 	returnCode(FALSE);
diff -Naur ncurses-5.7.orig/ncurses/base/use_window.c ncurses-5.7/ncurses/base/use_window.c
--- ncurses-5.7.orig/ncurses/base/use_window.c	2008-06-07 10:13:46.000000000 -0400
+++ ncurses-5.7/ncurses/base/use_window.c	2011-01-08 18:13:50.691157119 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2007,2008 Free Software Foundation, Inc.                   *
+ * Copyright (c) 2007-2008,2009 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -32,14 +32,14 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: use_window.c,v 1.8 2008/06/07 14:13:46 tom Exp $")
+MODULE_ID("$Id: use_window.c,v 1.9 2009/10/24 22:40:24 tom Exp $")
 
 NCURSES_EXPORT(int)
 use_window(WINDOW *win, NCURSES_WINDOW_CB func, void *data)
 {
     int code = OK;
 
-    T((T_CALLED("use_window(%p,%p,%p)"), win, func, data));
+    T((T_CALLED("use_window(%p,%p,%p)"), (void *) win, func, data));
     _nc_lock_global(curses);
     code = func(win, data);
     _nc_unlock_global(curses);
diff -Naur ncurses-5.7.orig/ncurses/base/wresize.c ncurses-5.7/ncurses/base/wresize.c
--- ncurses-5.7.orig/ncurses/base/wresize.c	2008-06-07 09:59:01.000000000 -0400
+++ ncurses-5.7/ncurses/base/wresize.c	2011-01-08 18:13:50.691157119 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2007,2008 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            *
@@ -27,12 +27,13 @@
  ****************************************************************************/
 
 /****************************************************************************
- *  Author: Thomas E. Dickey 1996-2002                                      *
+ *  Author: Thomas E. Dickey 1996-on                                        *
+ *     and: Juergen Pfeifer                                                 *
  ****************************************************************************/
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: wresize.c,v 1.29 2008/06/07 13:59:01 tom Exp $")
+MODULE_ID("$Id: wresize.c,v 1.34 2010/06/05 22:36:26 tom Exp $")
 
 static int
 cleanup_lines(struct ldat *data, int length)
@@ -53,10 +54,13 @@
     WINDOWLIST *wp;
     struct ldat *pline = cmp->_line;
     int row;
+#ifdef USE_SP_WINDOWLIST
+    SCREEN *sp = _nc_screen_of(cmp);
+#endif
 
     _nc_lock_global(curses);
 
-    for (each_window(wp)) {
+    for (each_window(SP_PARM, wp)) {
 	WINDOW *tst = &(wp->win);
 
 	if (tst->_parent == cmp) {
@@ -67,9 +71,9 @@
 		tst->_parx = cmp->_maxx;
 
 	    if (tst->_maxy + tst->_pary > cmp->_maxy)
-		tst->_maxy = cmp->_maxy - tst->_pary;
+		tst->_maxy = (NCURSES_SIZE_T) (cmp->_maxy - tst->_pary);
 	    if (tst->_maxx + tst->_parx > cmp->_maxx)
-		tst->_maxx = cmp->_maxx - tst->_parx;
+		tst->_maxx = (NCURSES_SIZE_T) (cmp->_maxx - tst->_parx);
 
 	    for (row = 0; row <= tst->_maxy; ++row) {
 		tst->_line[row].text = &pline[tst->_pary + row].text[tst->_parx];
@@ -93,7 +97,7 @@
     struct ldat *new_lines = 0;
 
 #ifdef TRACE
-    T((T_CALLED("wresize(%p,%d,%d)"), win, ToLines, ToCols));
+    T((T_CALLED("wresize(%p,%d,%d)"), (void *) win, ToLines, ToCols));
     if (win) {
 	TR(TRACE_UPDATE, ("...beg (%ld, %ld), max(%ld,%ld), reg(%ld,%ld)",
 			  (long) win->_begy, (long) win->_begx,
@@ -153,7 +157,8 @@
 	if (!(win->_flags & _SUBWIN)) {
 	    if (row <= size_y) {
 		if (ToCols != size_x) {
-		    if ((s = typeMalloc(NCURSES_CH_T, ToCols + 1)) == 0)
+		    s = typeMalloc(NCURSES_CH_T, (unsigned) ToCols + 1);
+		    if (s == 0)
 			returnCode(cleanup_lines(new_lines, row));
 		    for (col = 0; col <= ToCols; ++col) {
 			s[col] = (col <= size_x
@@ -164,12 +169,14 @@
 		    s = win->_line[row].text;
 		}
 	    } else {
-		if ((s = typeMalloc(NCURSES_CH_T, ToCols + 1)) == 0)
+		s = typeMalloc(NCURSES_CH_T, (unsigned) ToCols + 1);
+		if (s == 0)
 		    returnCode(cleanup_lines(new_lines, row));
 		for (col = 0; col <= ToCols; ++col)
 		    s[col] = win->_nc_bkgd;
 	    }
 	} else {
+	    assert(pline != 0);
 	    s = &pline[win->_pary + row].text[win->_parx];
 	}
 
@@ -181,11 +188,11 @@
 	if ((ToCols != size_x) || (row > size_y)) {
 	    if (end >= begin) {	/* growing */
 		if (new_lines[row].firstchar < begin)
-		    new_lines[row].firstchar = begin;
+		    new_lines[row].firstchar = (NCURSES_SIZE_T) begin;
 	    } else {		/* shrinking */
 		new_lines[row].firstchar = 0;
 	    }
-	    new_lines[row].lastchar = ToCols;
+	    new_lines[row].lastchar = (NCURSES_SIZE_T) ToCols;
 	}
 	new_lines[row].text = s;
     }
@@ -212,8 +219,8 @@
      * Finally, adjust the parameters showing screen size and cursor
      * position:
      */
-    win->_maxx = ToCols;
-    win->_maxy = ToLines;
+    win->_maxx = (NCURSES_SIZE_T) ToCols;
+    win->_maxy = (NCURSES_SIZE_T) ToLines;
 
     if (win->_regtop > win->_maxy)
 	win->_regtop = win->_maxy;
diff -Naur ncurses-5.7.orig/ncurses/build.priv.h ncurses-5.7/ncurses/build.priv.h
--- ncurses-5.7.orig/ncurses/build.priv.h	1969-12-31 19:00:00.000000000 -0500
+++ ncurses-5.7/ncurses/build.priv.h	2011-01-08 18:13:50.691157119 -0500
@@ -0,0 +1,108 @@
+/****************************************************************************
+ * 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.                                                           *
+ ****************************************************************************/
+
+/****************************************************************************
+ *  Author: Thomas E. Dickey                        2010                    *
+ ****************************************************************************/
+
+
+/*
+ * $Id: build.priv.h,v 1.6 2010/05/22 20:30:35 tom Exp $
+ *
+ *	build.priv.h
+ *
+ *	This is a reduced version of curses.priv.h, for build-time utilties.
+ *	Because it has fewer dependencies, this simplifies cross-compiling.
+ *
+ */
+
+#ifndef CURSES_PRIV_H
+#define CURSES_PRIV_H 1
+
+#include <ncurses_dll.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <ncurses_cfg.h>
+
+#if USE_RCS_IDS
+#define MODULE_ID(id) static const char Ident[] = id;
+#else
+#define MODULE_ID(id) /*nothing*/
+#endif
+
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+
+#include <assert.h>
+#include <stdio.h>
+
+#include <errno.h>
+
+#include <curses.h>	/* we'll use -Ipath directive to get the right one! */
+
+/* usually in <unistd.h> */
+#ifndef EXIT_SUCCESS
+#define EXIT_SUCCESS 0
+#endif
+
+#ifndef EXIT_FAILURE
+#define EXIT_FAILURE 1
+#endif
+
+#define FreeAndNull(p)   free(p); p = 0
+#define UChar(c)         ((unsigned char)(c))
+#define SIZEOF(v)        (sizeof(v) / sizeof(v[0]))
+
+#include <nc_alloc.h>
+
+/* declare these, to avoid needing term.h */
+#if BROKEN_LINKER || USE_REENTRANT
+#define NCURSES_ARRAY(name) \
+	NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, name)
+
+NCURSES_ARRAY(boolnames);
+NCURSES_ARRAY(boolfnames);
+NCURSES_ARRAY(numnames);
+NCURSES_ARRAY(numfnames);
+NCURSES_ARRAY(strnames);
+NCURSES_ARRAY(strfnames);
+#endif
+
+#if NO_LEAKS
+NCURSES_EXPORT(void) _nc_names_leaks(void);
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* CURSES_PRIV_H */
diff -Naur ncurses-5.7.orig/ncurses/curses.priv.h ncurses-5.7/ncurses/curses.priv.h
--- ncurses-5.7.orig/ncurses/curses.priv.h	2008-10-04 17:37:45.000000000 -0400
+++ ncurses-5.7/ncurses/curses.priv.h	2011-01-08 18:18:29.818781794 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2007,2008 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            *
@@ -30,11 +30,11 @@
  *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995               *
  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
  *     and: Thomas E. Dickey                        1996-on                 *
+ *     and: Juergen Pfeifer                                                 *
  ****************************************************************************/
 
-
 /*
- * $Id: curses.priv.h,v 1.394 2008/10/04 21:37:45 tom Exp $
+ * $Id: curses.priv.h,v 1.472 2011/01/01 23:01:40 tom Exp $
  *
  *	curses.priv.h
  *
@@ -45,6 +45,7 @@
 
 #ifndef CURSES_PRIV_H
 #define CURSES_PRIV_H 1
+/* *INDENT-OFF* */
 
 #include <ncurses_dll.h>
 
@@ -60,6 +61,7 @@
 #define MODULE_ID(id) /*nothing*/
 #endif
 
+#include <stddef.h>		/* for offsetof */
 #include <stdlib.h>
 #include <string.h>
 #include <sys/types.h>
@@ -97,8 +99,6 @@
 extern int errno;
 #endif
 
-#include <nc_panel.h>
-
 /* Some systems have a broken 'select()', but workable 'poll()'.  Use that */
 #if HAVE_WORKING_POLL
 #define USE_FUNC_POLL 1
@@ -178,6 +178,20 @@
 #endif
 
 /*
+ * If we have va_copy(), use it for assigning va_list's.
+ */
+#if defined(HAVE___VA_COPY)
+#define begin_va_copy(dst,src)	__va_copy(dst, src)
+#define end_va_copy(dst)	va_end(dst)
+#elif defined(va_copy) || defined(HAVE_VA_COPY)
+#define begin_va_copy(dst,src)	va_copy(dst, src)
+#define end_va_copy(dst)	va_end(dst)
+#else
+#define begin_va_copy(dst,src) (dst) = (src)
+#define end_va_copy(dst)	/* nothing */
+#endif
+
+/*
  * Scroll hints are useless when hashmap is used
  */
 #if !USE_SCROLL_HINTS
@@ -195,6 +209,15 @@
 #endif
 
 /*
+ * Options for terminal drivers, etc...
+ */
+#ifdef USE_TERM_DRIVER
+#define USE_SP_RIPOFF     1
+#define USE_SP_TERMTYPE   1
+#define USE_SP_WINDOWLIST 1
+#endif
+
+/*
  * Note:  ht/cbt expansion flakes out randomly under Linux 1.1.47, but only
  * when we're throwing control codes at the screen at high volume.  To see
  * this, re-enable USE_HARD_TABS and run worm for a while.  Other systems
@@ -247,6 +270,7 @@
 #define _nc_bkgd    _bkgrnd
 #else
 #undef _XOPEN_SOURCE_EXTENDED
+#undef _XPG5
 #define _nc_bkgd    _bkgd
 #define wgetbkgrnd(win, wch)	*wch = win->_bkgd
 #define wbkgrnd	    wbkgd
@@ -257,39 +281,127 @@
 #define NCURSES_OPAQUE 0
 
 #include <curses.h>	/* we'll use -Ipath directive to get the right one! */
+
+/*
+ * If curses.h did not expose the SCREEN-functions, then we do not need the
+ * parameter in the corresponding unextended functions.
+ */
+
+#define USE_SP_FUNC_SUPPORT     NCURSES_SP_FUNCS
+#define USE_EXT_SP_FUNC_SUPPORT (NCURSES_SP_FUNCS && NCURSES_EXT_FUNCS)
+
+#if NCURSES_SP_FUNCS
+#define SP_PARM         sp	/* use parameter */
+#define NCURSES_SP_ARG          SP_PARM
+#define NCURSES_SP_DCL  SCREEN *NCURSES_SP_ARG
+#define NCURSES_SP_DCL0 NCURSES_SP_DCL
+#define NCURSES_SP_ARGx         NCURSES_SP_ARG,
+#define NCURSES_SP_DCLx SCREEN *NCURSES_SP_ARGx
+#else
+#define SP_PARM         SP	/* use global variable */
+#define NCURSES_SP_ARG
+#define NCURSES_SP_DCL
+#define NCURSES_SP_DCL0 void
+#define NCURSES_SP_ARGx
+#define NCURSES_SP_DCLx
+#endif
+
+#include <nc_panel.h>
+
+#define IsPreScreen(sp)      (((sp) != 0) && sp->_prescreen)
+#define HasTerminal(sp)      (((sp) != 0) && (0 != ((sp)->_term)))
+#define IsValidScreen(sp)    (HasTerminal(sp) && !IsPreScreen(sp))
+
+#if BROKEN_LINKER || USE_REENTRANT
+#define CurTerm              _nc_prescreen._cur_term
+#else
+#define CurTerm              cur_term
+#endif
+
+#if NCURSES_SP_FUNCS
+#define TerminalOf(sp)       ((sp) ? ((sp)->_term ? (sp)->_term : CurTerm) : CurTerm)
+#else
+#define TerminalOf(sp)       CurTerm
+#endif
+
 #include <term.h>
+
+/*
+ * Reduce dependency on cur_term global by using terminfo data from SCREEN's
+ * pointer to this data.
+ */
+#ifdef USE_SP_TERMTYPE
+#undef CUR
+#endif
+
+#define SP_TERMTYPE TerminalOf(sp)->type.
+
 #include <term_entry.h>
+
 #include <nc_tparm.h>
 
-#if NCURSES_EXT_COLORS && USE_WIDEC_SUPPORT
+/*
+ * Use these macros internally, to make tracing less verbose.  But leave the
+ * option for compiling the tracing into the library.
+ */
+#if 1
+#define ColorPair(n)		NCURSES_BITS(n, 0)
+#define PairNumber(a)		(NCURSES_CAST(int,(((unsigned long)(a) & A_COLOR) >> NCURSES_ATTR_SHIFT)))
+#else
+#define ColorPair(pair)		COLOR_PAIR(pair)
+#define PairNumber(attr)	PAIR_NUMBER(attr)
+#endif
+
+#define unColor(n)		unColor2(AttrOf(n))
+#define unColor2(a)		((a) & ALL_BUT_COLOR)
+
+/*
+ * Extended-colors stores the color pair in a separate struct-member than the
+ * attributes.  But for compatibility, we handle most cases where a program
+ * written for non-extended colors stores the color in the attributes by
+ * checking for a color pair in both places.
+ */
+#if NCURSES_EXT_COLORS
 #define if_EXT_COLORS(stmt)	stmt
-#define NetPair(value,p)	(value).ext_color = (p), \
-				AttrOf(value) &= ALL_BUT_COLOR, \
-				AttrOf(value) |= (A_COLOR & COLOR_PAIR((p > 255) ? 255 : p))
-#define SetPair(value,p)	(value).ext_color = (p)
-#define GetPair(value)		(value).ext_color
-#define unColor(n)		(AttrOf(n) & ALL_BUT_COLOR)
-#define GET_WINDOW_PAIR(w)	(w)->_color
+#define SetPair(value,p)	SetPair2((value).ext_color, AttrOf(value), p)
+#define SetPair2(c,a,p)		c = (p), \
+				a = (unColor2(a) | (A_COLOR & ColorPair(oldColor(c))))
+#define GetPair(value)		GetPair2((value).ext_color, AttrOf(value))
+#define GetPair2(c,a)		((c) ? (c) : PairNumber(a))
+#define oldColor(p)		(((p) > 255) ? 255 : (p))
+#define GET_WINDOW_PAIR(w)	GetPair2((w)->_color, (w)->_attrs)
 #define SET_WINDOW_PAIR(w,p)	(w)->_color = (p)
 #define SameAttrOf(a,b)		(AttrOf(a) == AttrOf(b) && GetPair(a) == GetPair(b))
-#define VIDATTR(attr, pair)	vid_attr(attr, pair, 0)
+
+#if NCURSES_SP_FUNCS
+#define VIDATTR(sp,attr,pair)	NCURSES_SP_NAME(vid_attr)(sp, attr, pair, 0)
 #else
+#define VIDATTR(sp,attr,pair)	vid_attr(attr, pair, 0)
+#endif
+
+#else /* !NCURSES_EXT_COLORS */
+
 #define if_EXT_COLORS(stmt)	/* nothing */
 #define SetPair(value,p)	RemAttr(value, A_COLOR), \
-				SetAttr(value, AttrOf(value) | (A_COLOR & COLOR_PAIR(p)))
-#define GetPair(value)		PAIR_NUMBER(AttrOf(value))
-#define unColor(n)		(AttrOf(n) & ALL_BUT_COLOR)
-#define GET_WINDOW_PAIR(w)	PAIR_NUMBER(WINDOW_ATTRS(w))
+				SetAttr(value, AttrOf(value) | (A_COLOR & (attr_t) ColorPair(p)))
+#define GetPair(value)		PairNumber(AttrOf(value))
+#define GET_WINDOW_PAIR(w)	PairNumber(WINDOW_ATTRS(w))
 #define SET_WINDOW_PAIR(w,p)	WINDOW_ATTRS(w) &= ALL_BUT_COLOR, \
-				WINDOW_ATTRS(w) |= (A_COLOR & COLOR_PAIR(p))
+				WINDOW_ATTRS(w) |= (A_COLOR & (attr_t) ColorPair(p))
 #define SameAttrOf(a,b)		(AttrOf(a) == AttrOf(b))
-#define VIDATTR(attr, pair)	vidattr(attr)
+
+#if NCURSES_SP_FUNCS
+#define VIDATTR(sp,attr,pair)	NCURSES_SP_NAME(vidattr)(sp, attr)
+#else
+#define VIDATTR(sp,attr,pair)	vidattr(attr)
 #endif
 
+#endif /* NCURSES_EXT_COLORS */
+
 #if NCURSES_NO_PADDING
 #define GetNoPadding(sp)	((sp) ? (sp)->_no_padding : _nc_prescreen._no_padding)
 #define SetNoPadding(sp)	_nc_set_no_padding(sp)
-extern NCURSES_EXPORT(void) _nc_set_no_padding(SCREEN *);
+extern NCURSES_EXPORT(void)     _nc_set_no_padding(SCREEN *);
 #else
 #define GetNoPadding(sp)	FALSE
 #define SetNoPadding(sp)	/*nothing*/
@@ -301,18 +413,37 @@
 #define GET_SCREEN_PAIR(s)	GetPair(SCREEN_ATTRS(s))
 #define SET_SCREEN_PAIR(s,p)	SetPair(SCREEN_ATTRS(s), p)
 
+#if USE_REENTRANT || NCURSES_SP_FUNCS
+NCURSES_EXPORT(int *)        _nc_ptr_Lines (SCREEN *);
+NCURSES_EXPORT(int *)        _nc_ptr_Cols (SCREEN *);
+NCURSES_EXPORT(int *)        _nc_ptr_Tabsize (SCREEN *);
+NCURSES_EXPORT(int *)        _nc_ptr_Escdelay (SCREEN *);
+#endif
+
 #if USE_REENTRANT
-NCURSES_EXPORT(int *) _nc_ptr_Lines (void);
-NCURSES_EXPORT(int *) _nc_ptr_Cols (void);
-#define ptrLines() (SP ? &(SP->_LINES) : &(_nc_prescreen._LINES))
-#define ptrCols()  (SP ? &(SP->_COLS)  : &(_nc_prescreen._COLS))
-#define SET_LINES(value) *_nc_ptr_Lines() = value
-#define SET_COLS(value)  *_nc_ptr_Cols() = value
-#else
-#define ptrLines() &LINES
-#define ptrCols()  &COLS
-#define SET_LINES(value) LINES = value
-#define SET_COLS(value)  COLS = value
+
+#define ptrLines(sp)         (sp ? &(sp->_LINES) : &(_nc_prescreen._LINES))
+#define ptrCols(sp)          (sp ? &(sp->_COLS) : &(_nc_prescreen._COLS))
+#define ptrTabsize(sp)       (sp ? &(sp->_TABSIZE) : &(_nc_prescreen._TABSIZE))
+#define ptrEscdelay(sp)      (sp ? &(sp->_ESCDELAY) : &(_nc_prescreen._ESCDELAY))
+
+#define SET_LINES(value)     *_nc_ptr_Lines(SP_PARM) = value
+#define SET_COLS(value)      *_nc_ptr_Cols(SP_PARM) = value
+#define SET_TABSIZE(value)   *_nc_ptr_Tabsize(SP_PARM) = value
+#define SET_ESCDELAY(value)  *_nc_ptr_Escdelay(SP_PARM) = value
+
+#else
+
+#define ptrLines(sp)         &LINES
+#define ptrCols(sp)          &COLS
+#define ptrTabsize(sp)       &TABSIZE
+#define ptrEscdelay(sp)      &ESCDELAY
+
+#define SET_LINES(value)     LINES = value
+#define SET_COLS(value)      COLS = value
+#define SET_TABSIZE(value)   TABSIZE = value
+#define SET_ESCDELAY(value)  ESCDELAY = value
+
 #endif
 
 #define TR_MUTEX(data) _tracef("%s@%d: me:%08lX COUNT:%2u/%2d/%6d/%2d/%s%9u: " #data, \
@@ -326,6 +457,19 @@
 	    data.__data.__nusers)
 #define TR_GLOBAL_MUTEX(name) TR_MUTEX(_nc_globals.mutex_##name)
 
+#if USE_WEAK_SYMBOLS
+#if defined(__GNUC__)
+#  if defined __USE_ISOC99
+#    define _cat_pragma(exp)	_Pragma(#exp)
+#    define _weak_pragma(exp)	_cat_pragma(weak name)
+#  else
+#    define _weak_pragma(exp)
+#  endif
+#  define _declare(name)	__extension__ extern __typeof__(name) name
+#  define weak_symbol(name)	_weak_pragma(name) _declare(name) __attribute__((weak))
+#endif
+#endif
+
 #ifdef USE_PTHREADS
 
 #if USE_REENTRANT
@@ -343,19 +487,6 @@
 #error POSIX threads requires --enable-reentrant option
 #endif
 
-#if USE_WEAK_SYMBOLS
-#if defined(__GNUC__)
-#  if defined __USE_ISOC99
-#    define _cat_pragma(exp)	_Pragma(#exp)
-#    define _weak_pragma(exp)	_cat_pragma(weak name)
-#  else
-#    define _weak_pragma(exp)
-#  endif
-#  define _declare(name)	__extension__ extern __typeof__(name) name
-#  define weak_symbol(name)	_weak_pragma(name) _declare(name) __attribute__((weak))
-#endif
-#endif
-
 #ifdef USE_PTHREADS
 #  if USE_WEAK_SYMBOLS
 weak_symbol(pthread_sigmask);
@@ -380,6 +511,19 @@
 
 #else /* !USE_PTHREADS */
 
+#if USE_PTHREADS_EINTR
+#  if USE_WEAK_SYMBOLS
+#include <pthread.h>
+weak_symbol(pthread_sigmask);
+weak_symbol(pthread_kill);
+weak_symbol(pthread_self);
+weak_symbol(pthread_equal);
+extern NCURSES_EXPORT(int) _nc_sigprocmask(int, const sigset_t *, sigset_t *);
+#    undef  sigprocmask
+#    define sigprocmask _nc_sigprocmask
+#  endif
+#endif /* USE_PTHREADS_EINTR */
+
 #define _nc_init_pthreads()	/* nothing */
 #define _nc_mutex_init(obj)	/* nothing */
 
@@ -389,6 +533,36 @@
 
 #endif /* USE_PTHREADS */
 
+/*
+ * When using sp-funcs, locks are targeted to SCREEN-level granularity.
+ * So the locking is done in the non-sp-func (which calls the sp-func) rather
+ * than in the sp-func itself.
+ *
+ * Use the _nc_nonsp_XXX functions in the function using "NCURSES_SP_NAME()".
+ * Use the _nc_sp_XXX functions in the function using "#if NCURSES_SP_FUNCS".
+ */
+#if NCURSES_SP_FUNCS
+
+#define _nc_nonsp_lock_global(name)	/* nothing */
+#define _nc_nonsp_try_global(name)    0
+#define _nc_nonsp_unlock_global(name)	/* nothing */
+
+#define _nc_sp_lock_global(name)	_nc_lock_global(name)
+#define _nc_sp_try_global(name)         _nc_try_global(name)
+#define _nc_sp_unlock_global(name)	_nc_unlock_global(name)
+
+#else
+
+#define _nc_nonsp_lock_global(name)	_nc_lock_global(name)
+#define _nc_nonsp_try_global(name)      _nc_try_global(name)
+#define _nc_nonsp_unlock_global(name)	_nc_unlock_global(name)
+
+#define _nc_sp_lock_global(name)	/* nothing */
+#define _nc_sp_try_global(name)    0
+#define _nc_sp_unlock_global(name)	/* nothing */
+
+#endif
+
 #if HAVE_GETTIMEOFDAY
 # define PRECISE_GETTIME 1
 # define TimeType struct timeval
@@ -403,12 +577,14 @@
 typedef unsigned colorpair_t;	/* type big enough to store PAIR_OF() */
 #define C_SHIFT 9		/* we need more bits than there are colors */
 #define C_MASK			((1 << C_SHIFT) - 1)
-#define PAIR_OF(fg, bg)		((((fg) & C_MASK) << C_SHIFT) | ((bg) & C_MASK))
+#define PAIR_OF(fg, bg)		(colorpair_t) ((((fg) & C_MASK) << C_SHIFT) | ((bg) & C_MASK))
+#define FORE_OF(c)		(((c) >> C_SHIFT) & C_MASK)
+#define BACK_OF(c)		((c) & C_MASK)
 #define isDefaultColor(c)	((c) >= COLOR_DEFAULT || (c) < 0)
 
 #define COLOR_DEFAULT		C_MASK
 
-#if defined(USE_TERMLIB) && !defined(NEED_NCURSES_CH_T)
+#if defined(USE_BUILD_CC) || (defined(USE_TERMLIB) && !defined(NEED_NCURSES_CH_T))
 
 #undef NCURSES_CH_T		/* this is not a termlib feature */
 #define NCURSES_CH_T void	/* ...but we need a pointer in SCREEN */
@@ -434,6 +610,9 @@
 #if USE_SYSMOUSE
 	,M_SYSMOUSE		/* FreeBSD sysmouse on console */
 #endif
+#ifdef USE_TERM_DRIVER
+	,M_TERM_DRIVER		/* Win32 console, etc */
+#endif
 } MouseType;
 
 /*
@@ -452,7 +631,7 @@
 
 struct _SLK;
 
-#ifndef USE_TERMLIB
+#if !(defined(USE_TERMLIB) || defined(USE_BUILD_CC))
 
 typedef struct
 {
@@ -464,13 +643,13 @@
 } slk_ent;
 
 typedef struct _SLK {
-	char dirty;		/* all labels have changed */
-	char hidden;		/* soft labels are hidden */
-	WINDOW *win;
+	bool    dirty;		/* all labels have changed */
+	bool    hidden;		/* soft labels are hidden */
+	WINDOW  *win;
 	slk_ent *ent;
-	short  maxlab;		/* number of available labels */
-	short  labcnt;		/* number of allocated labels */
-	short  maxlen;		/* length of labels */
+	short   maxlab;		/* number of available labels */
+	short   labcnt;		/* number of allocated labels */
+	short   maxlen;		/* length of labels */
 	NCURSES_CH_T attr;	/* soft label attribute */
 } SLK;
 
@@ -493,10 +672,10 @@
 typedef int (*TYPE_Gpm_Close) (void);
 typedef int (*TYPE_Gpm_GetEvent) (Gpm_Event *);
 
-#define my_gpm_fd       SP->_mouse_gpm_fd
-#define my_Gpm_Open     SP->_mouse_Gpm_Open
-#define my_Gpm_Close    SP->_mouse_Gpm_Close
-#define my_Gpm_GetEvent SP->_mouse_Gpm_GetEvent
+#define my_gpm_fd       SP_PARM->_mouse_gpm_fd
+#define my_Gpm_Open     SP_PARM->_mouse_Gpm_Open
+#define my_Gpm_Close    SP_PARM->_mouse_Gpm_Close
+#define my_Gpm_GetEvent SP_PARM->_mouse_Gpm_GetEvent
 #else
 /* link statically to GPM */
 #define my_gpm_fd       &gpm_fd
@@ -563,8 +742,10 @@
  */
 #if MIXEDCASE_FILENAMES
 #define LEAF_FMT "%c"
+#define LEAF_LEN 1
 #else
 #define LEAF_FMT "%02x"
+#define LEAF_LEN 2
 #endif
 
 /*
@@ -577,6 +758,13 @@
 #define TRACEMSE_MAX	(80 + (5 * 10) + (32 * 15))
 #define TRACEMSE_FMT	"id %2d  at (%2d, %2d, %2d) state %4lx = {" /* } */
 
+#ifdef USE_TERM_DRIVER
+struct DriverTCB; /* Terminal Control Block forward declaration */
+#define INIT_TERM_DRIVER()	_nc_globals.term_driver = _nc_get_driver
+#else
+#define INIT_TERM_DRIVER()	/* nothing */
+#endif
+
 /*
  * Global data which is not specific to a screen.
  */
@@ -609,8 +797,10 @@
 	int		tgetent_index;
 	long		tgetent_sequence;
 
+#ifndef USE_SP_WINDOWLIST
 	WINDOWLIST	*_nc_windowlist;
-#define _nc_windows	_nc_globals._nc_windowlist
+#define WindowList(sp)	_nc_globals._nc_windowlist
+#endif
 
 #if USE_HOME_TERMINFO
 	char		*home_terminfo;
@@ -621,6 +811,10 @@
 	int		safeprint_rows;
 #endif
 
+#ifdef USE_TERM_DRIVER
+	int		(*term_driver)(struct DriverTCB*, const char*, int*);
+#endif
+
 #ifdef TRACE
 	bool		init_trace;
 	char		trace_fname[PATH_MAX];
@@ -644,7 +838,9 @@
 	char		traceatr_color_buf[2][80];
 	int		traceatr_color_sel;
 	int		traceatr_color_last;
-
+#if !defined(USE_PTHREADS) && USE_REENTRANT
+	int		nested_tracef;
+#endif
 #endif	/* TRACE */
 
 #ifdef USE_PTHREADS
@@ -655,6 +851,9 @@
 	int		use_pthreads;
 #define _nc_use_pthreads	_nc_globals.use_pthreads
 #endif
+#if USE_PTHREADS_EINTR
+	pthread_t	read_thread;		/* The reading thread */
+#endif
 } NCURSES_GLOBALS;
 
 extern NCURSES_EXPORT_VAR(NCURSES_GLOBALS) _nc_globals;
@@ -669,17 +868,22 @@
 	bool		use_env;
 	bool		filter_mode;
 	attr_t		previous_attr;
+#ifndef USE_SP_RIPOFF
 	ripoff_t	rippedoff[N_RIPS];
 	ripoff_t	*rsp;
+#endif
 	TPARM_STATE	tparm_state;
 	TTY		*saved_tty;	/* savetty/resetty information	    */
 #if NCURSES_NO_PADDING
 	bool		_no_padding;	/* flag to set if padding disabled  */
 #endif
+	NCURSES_SP_OUTC	_outch;		/* output handler if not putc */
 #if BROKEN_LINKER || USE_REENTRANT
 	chtype		*real_acs_map;
 	int		_LINES;
 	int		_COLS;
+	int		_TABSIZE;
+	int		_ESCDELAY;
 	TERMINAL	*_cur_term;
 #ifdef TRACE
 	long		_outchars;
@@ -688,8 +892,16 @@
 #endif
 } NCURSES_PRESCREEN;
 
-#define ripoff_sp	_nc_prescreen.rsp
-#define ripoff_stack	_nc_prescreen.rippedoff
+/*
+ * Use screen-specific ripoff data (for softkeys) rather than global.
+ */
+#ifdef USE_SP_RIPOFF
+#define safe_ripoff_sp     (sp)->rsp
+#define safe_ripoff_stack  (sp)->rippedoff
+#else
+#define safe_ripoff_sp	   _nc_prescreen.rsp
+#define safe_ripoff_stack  _nc_prescreen.rippedoff
+#endif
 
 extern NCURSES_EXPORT_VAR(NCURSES_PRESCREEN) _nc_prescreen;
 
@@ -703,6 +915,8 @@
 	char		*_setbuf;	/* buffered I/O for output	    */
 	bool		_filtered;	/* filter() was called		    */
 	bool		_buffered;	/* setvbuf uses _setbuf data	    */
+	bool		_prescreen;	/* is in prescreen phase	    */
+	bool		_use_env;	/* LINES & COLS from environment?   */
 	int		_checkfd;	/* filedesc for typeahead check	    */
 	TERMINAL	*_term;		/* terminal type information	    */
 	TTY		_saved_tty;	/* savetty/resetty information	    */
@@ -716,6 +930,10 @@
 	WINDOW		*_newscr;	/* virtual screen to be updated to  */
 	WINDOW		*_stdscr;	/* screen's full-window context	    */
 
+#define CurScreen(sp)  (sp)->_curscr
+#define NewScreen(sp)  (sp)->_newscr
+#define StdScreen(sp)  (sp)->_stdscr
+
 	TRIES		*_keytry;	/* "Try" for use with keypad mode   */
 	TRIES		*_key_ok;	/* Disabled keys via keyok(,FALSE)  */
 	bool		_tried;		/* keypad mode was initialized	    */
@@ -794,11 +1012,13 @@
 	int		_color_count;	/* count of colors in palette	     */
 	colorpair_t	*_color_pairs;	/* screen's color pair list	     */
 	int		_pair_count;	/* count of color pairs		     */
+	int		_pair_limit;	/* actual limit of color-pairs       */
 #if NCURSES_EXT_FUNCS
 	bool		_default_color; /* use default colors		     */
 	bool		_has_sgr_39_49; /* has ECMA default color support    */
 	int		_default_fg;	/* assumed default foreground	     */
 	int		_default_bg;	/* assumed default background	     */
+	int		_default_pairs;	/* count pairs using default color   */
 #endif
 	chtype		_ok_attributes; /* valid attributes for terminal     */
 	chtype		_xmc_suppress;	/* attributes to suppress if xmc     */
@@ -820,8 +1040,6 @@
 	 */
 	bool		_nc_sp_idlok;
 	bool		_nc_sp_idcok;
-#define _nc_idlok SP->_nc_sp_idlok
-#define _nc_idcok SP->_nc_sp_idcok
 
 	/*
 	 * These are the data that support the mouse interface.
@@ -871,11 +1089,18 @@
 	int		_sysmouse_new_buttons;
 #endif
 
+#ifdef USE_TERM_DRIVER
+	MEVENT		_drv_mouse_fifo[FIFO_SIZE];
+	int		_drv_mouse_head;
+	int		_drv_mouse_tail;
+	int		_drv_mouse_old_buttons;
+	int		_drv_mouse_new_buttons;
+#endif
 	/*
 	 * This supports automatic resizing
 	 */
 #if USE_SIZECHANGE
-	int		(*_resize)(int,int);
+	int		(*_resize)(NCURSES_SP_DCLx int y, int x);
 #endif
 
 	/*
@@ -895,7 +1120,7 @@
 	int		_oldnum_size;
 
 	bool		_cleanup;	/* cleanup after int/quit signal */
-	int		(*_outch)(int); /* output handler if not putc */
+	NCURSES_SP_OUTC	_outch;		/* output handler if not putc */
 
 	int		_legacy_coding;	/* see use_legacy_coding() */
 
@@ -915,6 +1140,15 @@
 	char		tracechr_buf[40];
 	char		tracemse_buf[TRACEMSE_MAX];
 #endif
+#ifdef USE_SP_WINDOWLIST
+	WINDOWLIST*	_windowlist;
+#define WindowList(sp)  (sp)->_windowlist
+#endif
+	NCURSES_OUTC	jump;
+
+	ripoff_t	rippedoff[N_RIPS];
+	ripoff_t	*rsp;
+
 	/*
 	 * ncurses/ncursesw are the same up to this point.
 	 */
@@ -930,10 +1164,10 @@
 extern NCURSES_EXPORT_VAR(SIG_ATOMIC_T) _nc_have_sigwinch;
 
 	WINDOWLIST {
-	WINDOW	win;		/* first, so WINDOW_EXT() works */
 	WINDOWLIST *next;
 	SCREEN *screen;		/* screen containing the window */
-#ifdef _XOPEN_SOURCE_EXTENDED
+	WINDOW	win;		/* WINDOW_EXT() needs to account for offset */
+#ifdef NCURSES_WIDECHAR
 	char addch_work[(MB_LEN_MAX * 9) + 1];
 	unsigned addch_used;	/* number of bytes in addch_work[] */
 	int addch_x;		/* x-position for addch_work[] */
@@ -941,7 +1175,21 @@
 #endif
 };
 
-#define WINDOW_EXT(win,field) (((WINDOWLIST *)(win))->field)
+#define WINDOW_EXT(w,m) (((WINDOWLIST *)((void *)((char *)(w) - offsetof(WINDOWLIST, win))))->m)
+
+#define SP_PRE_INIT(sp)                         \
+    sp->_cursrow = -1;                          \
+    sp->_curscol = -1;                          \
+    sp->_nl = TRUE;                             \
+    sp->_raw = FALSE;                           \
+    sp->_cbreak = 0;                            \
+    sp->_echo = TRUE;                           \
+    sp->_fifohead = -1;                         \
+    sp->_endwin = TRUE;                         \
+    sp->_cursor = -1;                           \
+    WindowList(sp) = 0;                         \
+    sp->_outch = NCURSES_SP_NAME(_nc_outch);    \
+    sp->jump = 0                                \
 
 /* usually in <limits.h> */
 #ifndef UCHAR_MAX
@@ -1017,6 +1265,7 @@
 #define RESET_OUTCHARS() COUNT_OUTCHARS(-_nc_outchars)
 
 #define UChar(c)	((unsigned char)(c))
+#define UShort(c)	((unsigned short)(c))
 #define ChCharOf(c)	((c) & (chtype)A_CHARTEXT)
 #define ChAttrOf(c)	((c) & (chtype)A_ATTRIBUTES)
 
@@ -1061,9 +1310,9 @@
 #define SetChar(ch,c,a) do {							    \
 			    NCURSES_CH_T *_cp = &ch;				    \
 			    memset(_cp, 0, sizeof(ch));				    \
-			    _cp->chars[0] = (c);					    \
+			    _cp->chars[0] = (wchar_t) (c);			    \
 			    _cp->attr = (a);					    \
-			    if_EXT_COLORS(SetPair(ch, PAIR_NUMBER(a)));		    \
+			    if_EXT_COLORS(SetPair(ch, PairNumber(a)));		    \
 			} while (0)
 #define CHREF(wch)	(&wch)
 #define CHDEREF(wch)	(*wch)
@@ -1082,14 +1331,14 @@
 				PUTC_ch = (ch).chars[PUTC_i];			    \
 				if (PUTC_ch == L'\0')				    \
 				    break;					    \
-				PUTC_n = wcrtomb(PUTC_buf,			    \
-						 (ch).chars[PUTC_i], &PUT_st);	    \
+				PUTC_n = (int) wcrtomb(PUTC_buf,		    \
+						       (ch).chars[PUTC_i], &PUT_st); \
 				if (PUTC_n <= 0) {				    \
 				    if (PUTC_ch && is8bits(PUTC_ch) && PUTC_i == 0) \
 					putc(PUTC_ch,b);			    \
 				    break;					    \
 				}						    \
-				fwrite(PUTC_buf, (unsigned) PUTC_n, 1, b);	    \
+				IGNORE_RC(fwrite(PUTC_buf, (unsigned) PUTC_n, 1, b)); \
 			    }							    \
 			    COUNT_OUTCHARS(PUTC_i);				    \
 			} } } while (0)
@@ -1105,14 +1354,14 @@
 	 * zero.  Otherwise we can use those bits to tell if a cell is the
 	 * first or extension part of a wide character.
 	 */
-#define WidecExt(ch)	(AttrOf(ch) & A_CHARTEXT)
+#define WidecExt(ch)	(int) (AttrOf(ch) & A_CHARTEXT)
 #define isWidecBase(ch)	(WidecExt(ch) == 1)
 #define isWidecExt(ch)	(WidecExt(ch) > 1 && WidecExt(ch) < 32)
 #define SetWidecExt(dst, ext)	AttrOf(dst) &= ~A_CHARTEXT,		\
-				AttrOf(dst) |= (ext + 1)
+				AttrOf(dst) |= (attr_t) (ext + 1)
 
 #define if_WIDEC(code)  code
-#define Charable(ch)	((SP != 0 && SP->_legacy_coding)		\
+#define Charable(ch)	((SP_PARM != 0 && SP_PARM->_legacy_coding)	\
 			 || (AttrOf(ch) & A_ALTCHARSET)			\
 			 || (!isWidecExt(ch) &&				\
 			     (ch).chars[1] == L'\0' &&			\
@@ -1162,25 +1411,25 @@
 
 #define CHANGED_CELL(line,col) \
 	if (line->firstchar == _NOCHANGE) \
-		line->firstchar = line->lastchar = col; \
+		line->firstchar = line->lastchar = (NCURSES_SIZE_T) col; \
 	else if ((col) < line->firstchar) \
-		line->firstchar = col; \
+		line->firstchar = (NCURSES_SIZE_T) col; \
 	else if ((col) > line->lastchar) \
-		line->lastchar = col
+		line->lastchar = (NCURSES_SIZE_T) col
 
 #define CHANGED_RANGE(line,start,end) \
 	if (line->firstchar == _NOCHANGE \
 	 || line->firstchar > (start)) \
-		line->firstchar = start; \
+		line->firstchar = (NCURSES_SIZE_T) start; \
 	if (line->lastchar == _NOCHANGE \
 	 || line->lastchar < (end)) \
-		line->lastchar = end
+		line->lastchar = (NCURSES_SIZE_T) end
 
 #define CHANGED_TO_EOL(line,start,end) \
 	if (line->firstchar == _NOCHANGE \
 	 || line->firstchar > (start)) \
-		line->firstchar = start; \
-	line->lastchar = end
+		line->firstchar = (NCURSES_SIZE_T) start; \
+	line->lastchar = (NCURSES_SIZE_T) end
 
 #define SIZEOF(v) (sizeof(v)/sizeof(v[0]))
 
@@ -1214,8 +1463,8 @@
  * Standardize/simplify common loops
  */
 #define each_screen(p) p = _nc_screen_chain; p != 0; p = (p)->_next_screen
-#define each_window(p) p = _nc_windows; p != 0; p = (p)->next
-#define each_ripoff(p) p = ripoff_stack; (p - ripoff_stack) < N_RIPS; ++p
+#define each_window(sp,p) p = WindowList(sp); p != 0; p = (p)->next
+#define each_ripoff(p) p = safe_ripoff_stack; (p - safe_ripoff_stack) < N_RIPS; ++p
 
 /*
  * Prefixes for call/return points of library function traces.  We use these to
@@ -1256,15 +1505,22 @@
 
 #define TR(n, a)	if (USE_TRACEF(n)) _nc_locked_tracef a
 #define T(a)		TR(TRACE_CALLS, a)
-#define TRACE_RETURN(value,type) return _nc_retrace_##type(value)
+#define TRACE_RETURN(value,type)     return _nc_retrace_##type(value)
+#define TRACE_RETURN2(value,dst,src) return _nc_retrace_##dst##_##src(value)
+#define TRACE_RETURN_SP(value,type)  return _nc_retrace_##type(SP_PARM, value)
+
+#define NonNull(s)	((s) != 0 ? s : "<null>")
 
 #define returnAttr(code)	TRACE_RETURN(code,attr_t)
 #define returnBits(code)	TRACE_RETURN(code,unsigned)
 #define returnBool(code)	TRACE_RETURN(code,bool)
 #define returnCPtr(code)	TRACE_RETURN(code,cptr)
 #define returnCVoidPtr(code)	TRACE_RETURN(code,cvoid_ptr)
-#define returnChar(code)	TRACE_RETURN(code,chtype)
+#define returnChar(code)	TRACE_RETURN(code,char)
+#define returnChtype(code)	TRACE_RETURN(code,chtype)
 #define returnCode(code)	TRACE_RETURN(code,int)
+#define returnIntAttr(code)	TRACE_RETURN2(code,int,attr_t)
+#define returnMMask(code)	TRACE_RETURN_SP(code,mmask_t)
 #define returnPtr(code)		TRACE_RETURN(code,ptr)
 #define returnSP(code)		TRACE_RETURN(code,sp)
 #define returnVoid		T((T_RETURN(""))); return
@@ -1282,7 +1538,10 @@
 extern NCURSES_EXPORT(chtype)           _nc_retrace_chtype (chtype);
 extern NCURSES_EXPORT(const char *)     _nc_altcharset_name(attr_t, chtype);
 extern NCURSES_EXPORT(const char *)     _nc_retrace_cptr (const char *);
+extern NCURSES_EXPORT(char)             _nc_retrace_char (char);
 extern NCURSES_EXPORT(int)              _nc_retrace_int (int);
+extern NCURSES_EXPORT(int)              _nc_retrace_int_attr_t (attr_t);
+extern NCURSES_EXPORT(mmask_t)          _nc_retrace_mmask_t (SCREEN *, mmask_t);
 extern NCURSES_EXPORT(unsigned)         _nc_retrace_unsigned (unsigned);
 extern NCURSES_EXPORT(void *)           _nc_retrace_void_ptr (void *);
 extern NCURSES_EXPORT(void)             _nc_fifo_dump (SCREEN *);
@@ -1322,8 +1581,11 @@
 #define returnBool(code)	return code
 #define returnCPtr(code)	return code
 #define returnCVoidPtr(code)	return code
-#define returnChar(code)	return code
+#define returnChar(code)	return ((char) code)
+#define returnChtype(code)	return code
 #define returnCode(code)	return code
+#define returnIntAttr(code)	return code
+#define returnMMask(code)	return code
 #define returnPtr(code)		return code
 #define returnSP(code)		return code
 #define returnVoid		return
@@ -1333,6 +1595,15 @@
 #endif /* TRACE/!TRACE */
 
 /*
+ * Workaround for defective implementation of gcc attribute warn_unused_result
+ */
+#if defined(__GNUC__) && defined(_FORTIFY_SOURCE)
+#define IGNORE_RC(func) errno = (int) func
+#else
+#define IGNORE_RC(func) (void) func
+#endif /* gcc workarounds */
+
+/*
  * Return-codes for tgetent() and friends.
  */
 #define TGETENT_YES  1		/* entry is found */
@@ -1348,57 +1619,58 @@
 
 #define ALL_BUT_COLOR ((chtype)~(A_COLOR))
 #define NONBLANK_ATTR (A_NORMAL|A_BOLD|A_DIM|A_BLINK)
-#define XMC_CHANGES(c) ((c) & SP->_xmc_suppress)
+#define XMC_CHANGES(c) ((c) & SP_PARM->_xmc_suppress)
 
 #define toggle_attr_on(S,at) {\
-   if (PAIR_NUMBER(at) > 0) {\
-      (S) = ((S) & ALL_BUT_COLOR) | (at);\
+   if (PairNumber(at) > 0) {\
+      (S) = ((S) & ALL_BUT_COLOR) | (attr_t) (at);\
    } else {\
-      (S) |= (at);\
+      (S) |= (attr_t) (at);\
    }\
    TR(TRACE_ATTRS, ("new attribute is %s", _traceattr((S))));}
 
 
 #define toggle_attr_off(S,at) {\
-   if (PAIR_NUMBER(at) > 0) {\
+   if (PairNumber(at) > 0) {\
       (S) &= ~(at|A_COLOR);\
    } else {\
       (S) &= ~(at);\
    }\
    TR(TRACE_ATTRS, ("new attribute is %s", _traceattr((S))));}
 
-#define DelCharCost(count) \
+#define DelCharCost(sp,count) \
 		((parm_dch != 0) \
-		? SP->_dch_cost \
+		? sp->_dch_cost \
 		: ((delete_character != 0) \
-			? (SP->_dch1_cost * count) \
+			? (sp->_dch1_cost * count) \
 			: INFINITY))
 
-#define InsCharCost(count) \
+#define InsCharCost(sp,count) \
 		((parm_ich != 0) \
-		? SP->_ich_cost \
+		? sp->_ich_cost \
 		: ((enter_insert_mode && exit_insert_mode) \
-		  ? SP->_smir_cost + SP->_rmir_cost + (SP->_ip_cost * count) \
+		  ? sp->_smir_cost + sp->_rmir_cost + (sp->_ip_cost * count) \
 		  : ((insert_character != 0) \
-		    ? ((SP->_ich1_cost + SP->_ip_cost) * count) \
+		    ? ((sp->_ich1_cost + sp->_ip_cost) * count) \
 		    : INFINITY)))
 
 #if USE_XMC_SUPPORT
-#define UpdateAttrs(c)	if (!SameAttrOf(SCREEN_ATTRS(SP), c)) { \
-				attr_t chg = AttrOf(SCREEN_ATTRS(SP)); \
-				VIDATTR(AttrOf(c), GetPair(c)); \
+#define UpdateAttrs(sp,c) if (!SameAttrOf(SCREEN_ATTRS(sp), c)) { \
+				attr_t chg = AttrOf(SCREEN_ATTRS(sp)); \
+				VIDATTR(sp, AttrOf(c), GetPair(c)); \
 				if (magic_cookie_glitch > 0 \
-				 && XMC_CHANGES((chg ^ AttrOf(SCREEN_ATTRS(SP))))) { \
+				 && XMC_CHANGES((chg ^ AttrOf(SCREEN_ATTRS(sp))))) { \
 					T(("%s @%d before glitch %d,%d", \
 						__FILE__, __LINE__, \
-						SP->_cursrow, \
-						SP->_curscol)); \
-					_nc_do_xmc_glitch(chg); \
+						sp->_cursrow, \
+						sp->_curscol)); \
+					NCURSES_SP_NAME(_nc_do_xmc_glitch)(NCURSES_SP_ARGx chg); \
 				} \
 			}
 #else
-#define UpdateAttrs(c)	if (!SameAttrOf(SCREEN_ATTRS(SP), c)) \
-				VIDATTR(AttrOf(c), GetPair(c));
+#define UpdateAttrs(sp,c) if (!SameAttrOf(SCREEN_ATTRS(sp), c)) { \
+				    VIDATTR(sp, AttrOf(c), GetPair(c)); \
+			}
 #endif
 
 /*
@@ -1408,10 +1680,12 @@
 #define EVENTLIST_0th(param) param
 #define EVENTLIST_1st(param) param
 #define EVENTLIST_2nd(param) , param
+#define TWAIT_MASK (TW_ANY | TW_EVENT)
 #else
 #define EVENTLIST_0th(param) void
 #define EVENTLIST_1st(param) /* nothing */
 #define EVENTLIST_2nd(param) /* nothing */
+#define TWAIT_MASK TW_ANY
 #endif
 
 #if NCURSES_EXPANDED && NCURSES_EXT_FUNCS
@@ -1425,16 +1699,28 @@
 extern NCURSES_EXPORT(void) _nc_toggle_attr_off (attr_t *, attr_t);
 
 #undef  DelCharCost
-#define DelCharCost(count) _nc_DelCharCost(count)
-extern NCURSES_EXPORT(int) _nc_DelCharCost (int);
+#define DelCharCost(sp, count) NCURSES_SP_NAME(_nc_DelCharCost)(NCURSES_SP_ARGx count)
 
 #undef  InsCharCost
-#define InsCharCost(count) _nc_InsCharCost(count)
-extern NCURSES_EXPORT(int) _nc_InsCharCost (int);
+#define InsCharCost(sp, count) NCURSES_SP_NAME(_nc_InsCharCost)(NCURSES_SP_ARGx count)
+
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_DelCharCost) (NCURSES_SP_DCLx int _c);
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_InsCharCost) (NCURSES_SP_DCLx int _c);
 
 #undef  UpdateAttrs
-#define UpdateAttrs(c) _nc_UpdateAttrs(c)
-extern NCURSES_EXPORT(void) _nc_UpdateAttrs (NCURSES_CH_T);
+#define UpdateAttrs(sp,c) NCURSES_SP_NAME(_nc_UpdateAttrs)(NCURSES_SP_ARGx CHREF(c))
+
+#if defined(NEED_NCURSES_CH_T)
+extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_UpdateAttrs) (NCURSES_SP_DCLx CARG_CH_T _c);
+#else
+extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_UpdateAttrs) (NCURSES_SP_DCLx chtype c);
+#endif
+
+#if NCURSES_SP_FUNCS
+extern NCURSES_EXPORT(int) _nc_DelCharCost (int);
+extern NCURSES_EXPORT(int) _nc_InsCharCost (int);
+extern NCURSES_EXPORT(void) _nc_UpdateAttrs (CARG_CH_T);
+#endif /* NCURSES_SP_FUNCS */
 
 #else
 
@@ -1483,8 +1769,8 @@
 #endif
 
 /* lib_acs.c */
-extern NCURSES_EXPORT(void) _nc_init_acs (void);	/* corresponds to traditional 'init_acs()' */
-extern NCURSES_EXPORT(int) _nc_msec_cost (const char *const, int);  /* used by 'tack' program */
+extern NCURSES_EXPORT(void) _nc_init_acs (void); /* corresponds to traditional 'init_acs()' */
+extern NCURSES_EXPORT(int)  _nc_msec_cost (const char *const, int);  /* used by 'tack' program */
 
 /* lib_addch.c */
 #if USE_WIDEC_SUPPORT
@@ -1492,7 +1778,7 @@
 #endif
 
 /* lib_addstr.c */
-#if USE_WIDEC_SUPPORT && !defined(USE_TERMLIB)
+#if USE_WIDEC_SUPPORT && !(defined(USE_TERMLIB) || defined(USE_BUILD_CC))
 extern NCURSES_EXPORT(int) _nc_wchstrlen(const cchar_t *);
 #endif
 
@@ -1500,10 +1786,10 @@
 extern NCURSES_EXPORT(bool) _nc_reset_colors(void);
 
 /* lib_getch.c */
-extern NCURSES_EXPORT(int) _nc_wgetch(WINDOW *, unsigned long *, int EVENTLIST_2nd(_nc_eventlist *));
+extern NCURSES_EXPORT(int) _nc_wgetch(WINDOW *, int *, int EVENTLIST_2nd(_nc_eventlist *));
 
 /* lib_insch.c */
-extern NCURSES_EXPORT(int) _nc_insert_ch(WINDOW *, chtype);
+extern NCURSES_EXPORT(int) _nc_insert_ch(SCREEN *, WINDOW *, chtype);
 
 /* lib_mvcur.c */
 #define INFINITY	1000000	/* cost: too high to use */
@@ -1519,7 +1805,7 @@
 extern NCURSES_EXPORT(void) _nc_screen_wrap (void);
 
 /* lib_mouse.c */
-extern NCURSES_EXPORT(int) _nc_has_mouse (void);
+extern NCURSES_EXPORT(bool) _nc_has_mouse (SCREEN *);
 
 /* lib_mvcur.c */
 #define INFINITY	1000000	/* cost: too high to use */
@@ -1527,10 +1813,13 @@
 
 /* lib_setup.c */
 extern NCURSES_EXPORT(char *) _nc_get_locale(void);
-extern NCURSES_EXPORT(int) _nc_unicode_locale(void);
-extern NCURSES_EXPORT(int) _nc_locale_breaks_acs(TERMINAL *);
-extern NCURSES_EXPORT(int) _nc_setupterm(NCURSES_CONST char *, int, int *, bool);
-extern NCURSES_EXPORT(void) _nc_get_screensize(SCREEN *, int *, int *);
+extern NCURSES_EXPORT(int)    _nc_unicode_locale(void);
+extern NCURSES_EXPORT(int)    _nc_locale_breaks_acs(TERMINAL *);
+extern NCURSES_EXPORT(int)    _nc_setupterm(NCURSES_CONST char *, int, int *, bool);
+extern NCURSES_EXPORT(void)   _nc_tinfo_cmdch(TERMINAL *, char);
+
+/* lib_set_term.c */
+extern NCURSES_EXPORT(int)    _nc_ripoffline(int, int(*)(WINDOW*, int));
 
 /* lib_tstp.c */
 #if USE_SIGWINCH
@@ -1539,9 +1828,6 @@
 #define _nc_handle_sigwinch(a) /* nothing */
 #endif
 
-/* lib_ungetch.c */
-extern NCURSES_EXPORT(int) _nc_ungetch (SCREEN *, int);
-
 /* lib_wacs.c */
 #if USE_WIDEC_SUPPORT
 extern NCURSES_EXPORT(void) _nc_init_wacs(void);
@@ -1577,9 +1863,8 @@
 
 /* elsewhere ... */
 extern NCURSES_EXPORT(ENTRY *) _nc_delink_entry (ENTRY *, TERMTYPE *);
-extern NCURSES_EXPORT(NCURSES_CONST char *) _nc_keyname (SCREEN *, int);
-extern NCURSES_EXPORT(NCURSES_CONST char *) _nc_unctrl (SCREEN *, chtype);
 extern NCURSES_EXPORT(SCREEN *) _nc_screen_of (WINDOW *);
+extern NCURSES_EXPORT(TERMINAL*) _nc_get_cur_term (void);
 extern NCURSES_EXPORT(WINDOW *) _nc_makenew (int, int, int, int, int);
 extern NCURSES_EXPORT(char *) _nc_trace_buf (int, size_t);
 extern NCURSES_EXPORT(char *) _nc_trace_bufcat (int, const char *);
@@ -1592,12 +1877,15 @@
 extern NCURSES_EXPORT(int) _nc_keypad (SCREEN *, bool);
 extern NCURSES_EXPORT(int) _nc_ospeed (int);
 extern NCURSES_EXPORT(int) _nc_outch (int);
+extern NCURSES_EXPORT(int) _nc_putp(const char *, const char *);
+extern NCURSES_EXPORT(int) _nc_putp_flush(const char *, const char *);
 extern NCURSES_EXPORT(int) _nc_read_termcap_entry (const char *const, TERMTYPE *const);
 extern NCURSES_EXPORT(int) _nc_setupscreen (int, int, FILE *, bool, int);
+extern NCURSES_EXPORT(int) _nc_setup_tinfo(const char *, TERMTYPE *);
 extern NCURSES_EXPORT(int) _nc_timed_wait (SCREEN *, int, int, int * EVENTLIST_2nd(_nc_eventlist *));
-extern NCURSES_EXPORT(void) _nc_do_color (short, short, bool, int (*)(int));
+extern NCURSES_EXPORT(void) _nc_do_color (short, short, bool, NCURSES_OUTC);
 extern NCURSES_EXPORT(void) _nc_flush (void);
-extern NCURSES_EXPORT(void) _nc_free_and_exit (int);
+extern NCURSES_EXPORT(void) _nc_free_and_exit (int) GCC_NORETURN;
 extern NCURSES_EXPORT(void) _nc_free_entry (ENTRY *, TERMTYPE *);
 extern NCURSES_EXPORT(void) _nc_freeall (void);
 extern NCURSES_EXPORT(void) _nc_hash_map (void);
@@ -1622,13 +1910,17 @@
 extern NCURSES_EXPORT(void) _nc_tgetent_leaks(void);
 #endif
 
-#ifndef USE_TERMLIB
+#if !(defined(USE_TERMLIB) || defined(USE_BUILD_CC))
 extern NCURSES_EXPORT(NCURSES_CH_T) _nc_render (WINDOW *, NCURSES_CH_T);
 extern NCURSES_EXPORT(int) _nc_waddch_nosync (WINDOW *, const NCURSES_CH_T);
 extern NCURSES_EXPORT(void) _nc_scroll_window (WINDOW *, int const, NCURSES_SIZE_T const, NCURSES_SIZE_T const, NCURSES_CH_T);
 #endif
 
-#if USE_WIDEC_SUPPORT && !defined(USE_TERMLIB)
+#if USE_WIDEC_SUPPORT
+extern NCURSES_EXPORT(int) _nc_insert_wch(WINDOW *, const cchar_t *);
+#endif
+
+#if USE_WIDEC_SUPPORT && !(defined(USE_TERMLIB) || defined(USE_BUILD_CC))
 extern NCURSES_EXPORT(size_t) _nc_wcrtomb (char *, wchar_t, mbstate_t *);
 #endif
 
@@ -1650,6 +1942,26 @@
 #endif
 
 /*
+ * Wide-character macros to hide some platform-differences.
+ */
+#if USE_WIDEC_SUPPORT
+#if HAVE_MBTOWC && HAVE_MBLEN
+#define reset_mbytes(state) IGNORE_RC(mblen(NULL, 0)), IGNORE_RC(mbtowc(NULL, NULL, 0))
+#define count_mbytes(buffer,length,state) mblen(buffer,length)
+#define check_mbytes(wch,buffer,length,state) \
+	(int) mbtowc(&wch, buffer, length)
+#define state_unused
+#elif HAVE_MBRTOWC && HAVE_MBRLEN
+#define reset_mbytes(state) init_mb(state)
+#define count_mbytes(buffer,length,state) mbrlen(buffer,length,&state)
+#define check_mbytes(wch,buffer,length,state) \
+	(int) mbrtowc(&wch, buffer, length, &state)
+#else
+make an error
+#endif
+#endif
+
+/*
  * Not everyone has vsscanf(), but we'd like to use it for scanw().
  */
 #if !HAVE_VSSCANF
@@ -1661,24 +1973,34 @@
 
 #define USE_SETBUF_0 0
 
-#define NC_BUFFERED(flag) _nc_set_buffer(SP->_ofp, flag)
+#define NC_BUFFERED(sp,flag) NCURSES_SP_NAME(_nc_set_buffer)(NCURSES_SP_ARGx sp->_ofp, flag)
 
-#define NC_OUTPUT ((SP != 0) ? SP->_ofp : stdout)
+#define NC_OUTPUT(sp) ((sp != 0) ? sp->_ofp : stdout)
 
 /*
  * On systems with a broken linker, define 'SP' as a function to force the
  * linker to pull in the data-only module with 'SP'.
  */
+#define _nc_alloc_screen_sp() typeCalloc(SCREEN, 1)
+
 #if BROKEN_LINKER
 #define SP _nc_screen()
 extern NCURSES_EXPORT(SCREEN *) _nc_screen (void);
-extern NCURSES_EXPORT(int) _nc_alloc_screen (void);
-extern NCURSES_EXPORT(void) _nc_set_screen (SCREEN *);
+extern NCURSES_EXPORT(int)      _nc_alloc_screen (void);
+extern NCURSES_EXPORT(void)     _nc_set_screen (SCREEN *);
+#define CURRENT_SCREEN          _nc_screen()
 #else
 /* current screen is private data; avoid possible linking conflicts too */
 extern NCURSES_EXPORT_VAR(SCREEN *) SP;
-#define _nc_alloc_screen() ((SP = typeCalloc(SCREEN, 1)) != 0)
-#define _nc_set_screen(sp) SP = sp
+#define CURRENT_SCREEN SP
+#define _nc_alloc_screen()      ((SP = _nc_alloc_screen_sp()) != 0)
+#define _nc_set_screen(sp)      SP = sp
+#endif
+
+#if NCURSES_SP_FUNCS
+#define CURRENT_SCREEN_PRE      (IsPreScreen(CURRENT_SCREEN) ? CURRENT_SCREEN : new_prescr())
+#else
+#define CURRENT_SCREEN_PRE      CURRENT_SCREEN
 #endif
 
 /*
@@ -1686,10 +2008,11 @@
  * if the application is running multiple screens under X, it's quite possible
  * they could all have type xterm but have different sizes!  So...
  */
-#define screen_lines	SP->_lines
-#define screen_columns	SP->_columns
+#define screen_lines(sp)        (sp)->_lines
+#define screen_columns(sp)      (sp)->_columns
 
 extern NCURSES_EXPORT(int) _nc_slk_initialize (WINDOW *, int);
+extern NCURSES_EXPORT(int) _nc_format_slks (NCURSES_SP_DCLx int _c);
 
 /*
  * Some constants related to SLK's
@@ -1707,16 +2030,282 @@
 #define MAX_SKEY(fmt)     (SLK_STDFMT(fmt)? MAX_SKEY_OLD : MAX_SKEY_PC)
 #define MAX_SKEY_LEN(fmt) (SLK_STDFMT(fmt)? MAX_SKEY_LEN_OLD : MAX_SKEY_LEN_PC)
 
-extern NCURSES_EXPORT(int) _nc_ripoffline (int line, int (*init)(WINDOW *,int));
-
 /*
  * Common error messages
  */
 #define MSG_NO_MEMORY "Out of memory"
 #define MSG_NO_INPUTS "Premature EOF"
 
+extern NCURSES_EXPORT(int) _nc_set_tty_mode(TTY *);
+extern NCURSES_EXPORT(int) _nc_get_tty_mode(TTY *);
+
+/* timed_wait flag definitions */
+#define TW_NONE    0
+#define TW_INPUT   1
+#define TW_MOUSE   2
+#define TW_ANY     (TW_INPUT | TW_MOUSE)
+#define TW_EVENT   4
+
+#define SetSafeOutcWrapper(outc)	    \
+    SCREEN* sp = CURRENT_SCREEN;            \
+    if (sp==0) {                            \
+	struct screen dummy;		    \
+	sp = &dummy;                        \
+	memset(sp,0,sizeof(struct screen)); \
+	sp->_outch = _nc_outc_wrapper;      \
+    }\
+    sp->jump = outc
+
+#ifdef USE_TERM_DRIVER
+typedef void* TERM_HANDLE;
+
+typedef struct _termInfo
+{
+    bool caninit;
+
+    bool hascolor;
+    bool initcolor;
+    bool canchange;
+
+    int  tabsize;
+
+    int  maxcolors;
+    int  maxpairs;
+    int  nocolorvideo;
+
+    int  numbuttons;
+    int  numlabels;
+    int  labelwidth;
+    int  labelheight;
+
+    const color_t* defaultPalette;
+} TerminalInfo;
+
+typedef struct term_driver {
+    bool   isTerminfo;
+    bool   (*CanHandle)(struct DriverTCB*,const char*,int*);
+    void   (*init)(struct DriverTCB*);
+    void   (*release)(struct DriverTCB*);
+    int    (*size)(struct DriverTCB*, int* Line, int *Cols);
+    int    (*sgmode)(struct DriverTCB*, bool setFlag, TTY*);
+    chtype (*conattr)(struct DriverTCB*);
+    int    (*hwcur)(struct DriverTCB*, int yold, int xold, int y, int x);
+    int    (*mode)(struct DriverTCB*, bool progFlag, bool defFlag);
+    bool   (*rescol)(struct DriverTCB*);
+    bool   (*rescolors)(struct DriverTCB*);
+    void   (*color)(struct DriverTCB*,bool fore, int color, int(*)(SCREEN*,int));
+    int    (*doBeepOrFlash)(struct DriverTCB*, bool);
+    void   (*initpair)(struct DriverTCB*,short,short,short);
+    void   (*initcolor)(struct DriverTCB*,short,short,short,short);
+    void   (*docolor)(struct DriverTCB*,short,short,bool,int(*)(SCREEN*,int));
+    void   (*initmouse)(struct DriverTCB*);
+    int    (*testmouse)(struct DriverTCB*,int);
+    void   (*setfilter)(struct DriverTCB*);
+    void   (*hwlabel)(struct DriverTCB*,int,char*);
+    void   (*hwlabelOnOff)(struct DriverTCB*,bool);
+    int    (*update)(struct DriverTCB*);
+    int    (*defaultcolors)(struct DriverTCB*,int,int);
+    int    (*print)(struct DriverTCB*,char*,int);
+    int    (*getsize)(struct DriverTCB*,int*,int*);
+    int    (*setsize)(struct DriverTCB*,int,int);
+    void   (*initacs)(struct DriverTCB*,chtype*,chtype*);
+    void   (*scinit)(SCREEN *);
+    void   (*scexit)(SCREEN *);
+    int    (*twait)(struct DriverTCB*,int,int,int* EVENTLIST_2nd(_nc_eventlist*));
+    int    (*read)(struct DriverTCB*,int*);
+    int    (*nap)(struct DriverTCB*,int);
+    int    (*kpad)(struct DriverTCB*, bool);
+    int    (*kyOk)(struct DriverTCB*, int, bool);
+    bool   (*kyExist)(struct DriverTCB*, int);
+} TERM_DRIVER;
+
+typedef struct DriverTCB
+{
+    TERMINAL      term;   /* needs to be the first Element !!! */
+    TERM_HANDLE   inp;    /* The input handle of the Terminal */
+    TERM_HANDLE   out;    /* The output handle of the Terminal in shell mode */
+    TERM_HANDLE   hdl;    /* The output handle of the Terminal in prog  mode */
+    TERM_DRIVER*  drv;    /* The driver for that Terminal */
+    SCREEN*       csp;    /* The screen that owns that Terminal */
+    TerminalInfo  info;   /* Driver independent core capabilities of the Terminal */
+    void*         prop;   /* Driver dependent property storage to be used by the Driver */
+    long          magic;
+} TERMINAL_CONTROL_BLOCK;
+
+#define NCDRV_MAGIC(id) (0x47110000 | (id&0xffff))
+#define NCDRV_TINFO      0x01
+#define NCDRV_WINCONSOLE 0x02
+
+#define TCBOf(sp)    ((TERMINAL_CONTROL_BLOCK*)(TerminalOf(sp)))
+#define InfoOf(sp)   TCBOf(sp)->info
+#define CallDriver(sp,method)                        TCBOf(sp)->drv->method(TCBOf(sp))
+#define CallDriver_1(sp,method,arg1)                 TCBOf(sp)->drv->method(TCBOf(sp),arg1)
+#define CallDriver_2(sp,method,arg1,arg2)            TCBOf(sp)->drv->method(TCBOf(sp),arg1,arg2)
+#define CallDriver_3(sp,method,arg1,arg2,arg3)       TCBOf(sp)->drv->method(TCBOf(sp),arg1,arg2,arg3)
+#define CallDriver_4(sp,method,arg1,arg2,arg3,arg4)  TCBOf(sp)->drv->method(TCBOf(sp),arg1,arg2,arg3,arg4)
+
+extern NCURSES_EXPORT_VAR(const color_t*) _nc_cga_palette;
+extern NCURSES_EXPORT_VAR(const color_t*) _nc_hls_palette;
+
+extern NCURSES_EXPORT(int)      _nc_get_driver(TERMINAL_CONTROL_BLOCK*, const char*, int*);
+extern NCURSES_EXPORT(void)     _nc_get_screensize_ex(SCREEN *, TERMINAL *, int *, int *);
+#endif /* USE_TERM_DRIVER */
+
+/*
+ * Entrypoints which are actually provided in the terminal driver, which would
+ * be an sp-name otherwise.
+ */
+#ifdef USE_TERM_DRIVER
+#define TINFO_HAS_KEY           _nc_tinfo_has_key
+#define TINFO_DOUPDATE          _nc_tinfo_doupdate
+#define TINFO_MVCUR             _nc_tinfo_mvcur
+extern NCURSES_EXPORT(int)      TINFO_HAS_KEY(SCREEN*, int);
+extern NCURSES_EXPORT(int)      TINFO_DOUPDATE(SCREEN *);
+extern NCURSES_EXPORT(int)      TINFO_MVCUR(SCREEN*, int, int, int, int);
+#else
+#define TINFO_HAS_KEY           NCURSES_SP_NAME(has_key)
+#define TINFO_DOUPDATE          NCURSES_SP_NAME(doupdate)
+#define TINFO_MVCUR             NCURSES_SP_NAME(mvcur)
+#endif
+
+/*
+ * Entrypoints using an extra parameter with the terminal driver.
+ */
+#ifdef USE_TERM_DRIVER
+extern NCURSES_EXPORT(void)   _nc_get_screensize(SCREEN *, TERMINAL *, int *, int *);
+extern NCURSES_EXPORT(int)    _nc_setupterm_ex(TERMINAL **, NCURSES_CONST char *, int , int *, bool);
+#define TINFO_GET_SIZE(sp, tp, lp, cp) \
+	_nc_get_screensize(sp, tp, lp, cp)
+#define TINFO_SET_CURTERM(sp, tp) \
+	NCURSES_SP_NAME(set_curterm)(sp, tp)
+#define TINFO_SETUP_TERM(tpp, name, fd, err, reuse) \
+	_nc_setupterm_ex(tpp, name, fd, err, reuse)
+#else /* !USE_TERM_DRIVER */
+extern NCURSES_EXPORT(void)   _nc_get_screensize(SCREEN *, int *, int *);
+#define TINFO_GET_SIZE(sp, tp, lp, cp) \
+	_nc_get_screensize(sp, lp, cp)
+#define TINFO_SET_CURTERM(sp, tp) \
+	set_curterm(tp)
+#define TINFO_SETUP_TERM(tpp, name, fd, err, reuse) \
+	_nc_setupterm(name, fd, err, reuse)
+#endif /* !USE_TERM_DRIVER */
+
+#ifdef USE_TERM_DRIVER
+#ifdef __MINGW32__
+#include <nc_mingw.h>
+extern NCURSES_EXPORT_VAR(TERM_DRIVER) _nc_WIN_DRIVER;
+#endif
+extern NCURSES_EXPORT_VAR(TERM_DRIVER) _nc_TINFO_DRIVER;
+#endif
+
+#ifdef USE_TERM_DRIVER
+#define IsTermInfo(sp)       (TCBOf(sp) && ((TCBOf(sp)->drv->isTerminfo)))
+#else
+#define IsTermInfo(sp)       TRUE
+#endif
+
+#define HasTInfoTerminal(sp) ((0 != TerminalOf(sp)) && IsTermInfo(sp))
+#define IsValidTIScreen(sp)  (HasTInfoTerminal(sp))
+
+/*
+ * Exported entrypoints beyond the published API
+ */
+#if NCURSES_SP_FUNCS
+extern NCURSES_EXPORT(WINDOW *) _nc_curscr_of(SCREEN*);
+extern NCURSES_EXPORT(WINDOW *) _nc_newscr_of(SCREEN*);
+extern NCURSES_EXPORT(WINDOW *) _nc_stdscr_of(SCREEN*);
+extern NCURSES_EXPORT(int)      _nc_outc_wrapper(SCREEN*,int);
+
+#if USE_REENTRANT
+extern NCURSES_EXPORT(int)       NCURSES_SP_NAME(_nc_TABSIZE)(SCREEN*);
+extern NCURSES_EXPORT(char *)    NCURSES_SP_NAME(longname)(SCREEN*);
+#endif
+
+#if NCURSES_EXT_FUNCS
+extern NCURSES_EXPORT(int)      NCURSES_SP_NAME(_nc_set_tabsize)(SCREEN*, int);
+#endif
+
+/*
+ * We put the safe versions of various calls here as they are not published
+ * part of the API up to now
+ */
+extern NCURSES_EXPORT(TERMINAL*) NCURSES_SP_NAME(_nc_get_cur_term) (SCREEN *sp);
+extern NCURSES_EXPORT(WINDOW *) NCURSES_SP_NAME(_nc_makenew) (SCREEN*, int, int, int, int, int);
+extern NCURSES_EXPORT(bool)     NCURSES_SP_NAME(_nc_reset_colors)(SCREEN*);
+extern NCURSES_EXPORT(char *)   NCURSES_SP_NAME(_nc_printf_string)(SCREEN*, const char *, va_list);
+extern NCURSES_EXPORT(chtype)   NCURSES_SP_NAME(_nc_acs_char)(SCREEN*,int);
+extern NCURSES_EXPORT(int)      NCURSES_SP_NAME(_nc_curs_set)(SCREEN*,int);
+extern NCURSES_EXPORT(int)      NCURSES_SP_NAME(_nc_get_tty_mode)(SCREEN*,TTY*);
+extern NCURSES_EXPORT(int)      NCURSES_SP_NAME(_nc_mcprint)(SCREEN*,char*, int);
+extern NCURSES_EXPORT(int)      NCURSES_SP_NAME(_nc_msec_cost)(SCREEN*, const char *, int);
+extern NCURSES_EXPORT(int)      NCURSES_SP_NAME(_nc_outch)(SCREEN*, int);
+extern NCURSES_EXPORT(int)      NCURSES_SP_NAME(_nc_putp)(SCREEN*, const char *, const char*);
+extern NCURSES_EXPORT(int)      NCURSES_SP_NAME(_nc_putp_flush)(SCREEN*, const char *, const char *);
+extern NCURSES_EXPORT(int)      NCURSES_SP_NAME(_nc_resetty)(SCREEN*);
+extern NCURSES_EXPORT(int)      NCURSES_SP_NAME(_nc_resize_term)(SCREEN*,int,int);
+extern NCURSES_EXPORT(int)      NCURSES_SP_NAME(_nc_ripoffline)(SCREEN*, int, int (*)(WINDOW *,int));
+extern NCURSES_EXPORT(int)      NCURSES_SP_NAME(_nc_savetty)(SCREEN*);
+extern NCURSES_EXPORT(int)      NCURSES_SP_NAME(_nc_scr_init)(SCREEN*,const char*);
+extern NCURSES_EXPORT(int)      NCURSES_SP_NAME(_nc_scr_restore)(SCREEN*, const char*);
+extern NCURSES_EXPORT(int)      NCURSES_SP_NAME(_nc_scrolln)(SCREEN*, int, int, int, int);
+extern NCURSES_EXPORT(int)      NCURSES_SP_NAME(_nc_set_tty_mode)(SCREEN*, TTY*);
+extern NCURSES_EXPORT(int)      NCURSES_SP_NAME(_nc_setupscreen)(SCREEN**, int, int, FILE *, bool, int);
+extern NCURSES_EXPORT(int)      NCURSES_SP_NAME(_nc_tgetent)(SCREEN*,char*,const char *);
+extern NCURSES_EXPORT(int)      NCURSES_SP_NAME(_nc_tigetnum)(SCREEN*,NCURSES_CONST char*);
+extern NCURSES_EXPORT(int)      NCURSES_SP_NAME(_nc_vid_attr)(SCREEN *, attr_t, short, void *);
+extern NCURSES_EXPORT(int)      NCURSES_SP_NAME(_nc_vidputs)(SCREEN*,chtype,int(*) (SCREEN*, int));
+extern NCURSES_EXPORT(void)     NCURSES_SP_NAME(_nc_do_color)(SCREEN*, short, short, bool, NCURSES_SP_OUTC);
+extern NCURSES_EXPORT(void)     NCURSES_SP_NAME(_nc_do_xmc_glitch)(SCREEN*, attr_t);
+extern NCURSES_EXPORT(void)     NCURSES_SP_NAME(_nc_flush)(SCREEN*);
+extern NCURSES_EXPORT(void)     NCURSES_SP_NAME(_nc_free_and_exit)(SCREEN*, int) GCC_NORETURN;
+extern NCURSES_EXPORT(void)     NCURSES_SP_NAME(_nc_freeall)(SCREEN*);
+extern NCURSES_EXPORT(void)     NCURSES_SP_NAME(_nc_hash_map)(SCREEN*);
+extern NCURSES_EXPORT(void)     NCURSES_SP_NAME(_nc_init_acs)(SCREEN*);
+extern NCURSES_EXPORT(void)     NCURSES_SP_NAME(_nc_make_oldhash)(SCREEN*, int i);
+extern NCURSES_EXPORT(void)     NCURSES_SP_NAME(_nc_mvcur_init)(SCREEN*);
+extern NCURSES_EXPORT(void)     NCURSES_SP_NAME(_nc_mvcur_resume)(SCREEN*);
+extern NCURSES_EXPORT(void)     NCURSES_SP_NAME(_nc_mvcur_wrap)(SCREEN*);
+extern NCURSES_EXPORT(void)     NCURSES_SP_NAME(_nc_screen_init)(SCREEN*);
+extern NCURSES_EXPORT(void)     NCURSES_SP_NAME(_nc_screen_resume)(SCREEN*);
+extern NCURSES_EXPORT(void)     NCURSES_SP_NAME(_nc_screen_wrap)(SCREEN*);
+extern NCURSES_EXPORT(void)     NCURSES_SP_NAME(_nc_scroll_oldhash)(SCREEN*, int n, int top, int bot);
+extern NCURSES_EXPORT(void)     NCURSES_SP_NAME(_nc_scroll_optimize)(SCREEN*);
+extern NCURSES_EXPORT(void)     NCURSES_SP_NAME(_nc_set_buffer)(SCREEN*, FILE *, bool);
+
+extern NCURSES_EXPORT(void)     _nc_cookie_init(SCREEN *sp);
+
+#if defined(TRACE) || defined(SCROLLDEBUG) || defined(HASHDEBUG)
+extern NCURSES_EXPORT(void)     NCURSES_SP_NAME(_nc_linedump)(SCREEN*);
+#endif
+
+#if USE_WIDEC_SUPPORT
+extern NCURSES_EXPORT(wchar_t *) NCURSES_SP_NAME(_nc_wunctrl)(SCREEN*, cchar_t *);
+#endif
+
+#endif /* NCURSES_SP_FUNCS */
+
+#if NCURSES_SP_FUNCS
+
+#define safe_keyname NCURSES_SP_NAME(keyname)
+#define safe_unctrl  NCURSES_SP_NAME(unctrl)
+#define safe_ungetch NCURSES_SP_NAME(ungetch)
+
+#else
+
+#define safe_keyname _nc_keyname
+#define safe_unctrl  _nc_unctrl
+#define safe_ungetch _nc_ungetch
+
+extern NCURSES_EXPORT(NCURSES_CONST char *) _nc_keyname (SCREEN *, int);
+extern NCURSES_EXPORT(int) _nc_ungetch (SCREEN *, int);
+extern NCURSES_EXPORT(NCURSES_CONST char *) _nc_unctrl (SCREEN *, chtype);
+
+#endif
+
 #ifdef __cplusplus
 }
 #endif
 
+/* *INDENT-ON* */
+
 #endif /* CURSES_PRIV_H */
diff -Naur ncurses-5.7.orig/ncurses/llib-lncurses ncurses-5.7/ncurses/llib-lncurses
--- ncurses-5.7.orig/ncurses/llib-lncurses	2008-10-11 16:57:29.000000000 -0400
+++ ncurses-5.7/ncurses/llib-lncurses	2011-01-08 18:13:50.699157070 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2007,2008 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            *
@@ -27,7 +27,7 @@
  ****************************************************************************/
 
 /****************************************************************************
- *  Author: Thomas E. Dickey 1996-2008                                      *
+ *  Author: Thomas E. Dickey 1996-2009,2010                                 *
  ****************************************************************************/
 /* LINTLIBRARY */
 
@@ -38,27 +38,54 @@
 #undef _nc_oldnums
 int	*_nc_oldnums;
 
+#undef _nc_scroll_optimize_sp
+void	_nc_scroll_optimize_sp(
+		SCREEN	*sp)
+		{ /* void */ }
+
 #undef _nc_scroll_optimize
 void	_nc_scroll_optimize(void)
 		{ /* void */ }
 
+#undef _nc_linedump_sp
+void	_nc_linedump_sp(
+		SCREEN	*sp)
+		{ /* void */ }
+
 #undef _nc_linedump
 void	_nc_linedump(void)
 		{ /* void */ }
 
 /* ./tty/hashmap.c */
 
-#include <term.h>
+#undef _nc_hash_map_sp
+void	_nc_hash_map_sp(
+		SCREEN	*sp)
+		{ /* void */ }
 
 #undef _nc_hash_map
 void	_nc_hash_map(void)
 		{ /* void */ }
 
+#undef _nc_make_oldhash_sp
+void	_nc_make_oldhash_sp(
+		SCREEN	*sp, 
+		int	i)
+		{ /* void */ }
+
 #undef _nc_make_oldhash
 void	_nc_make_oldhash(
 		int	i)
 		{ /* void */ }
 
+#undef _nc_scroll_oldhash_sp
+void	_nc_scroll_oldhash_sp(
+		SCREEN	*sp, 
+		int	n, 
+		int	top, 
+		int	bot)
+		{ /* void */ }
+
 #undef _nc_scroll_oldhash
 void	_nc_scroll_oldhash(
 		int	n, 
@@ -112,6 +139,11 @@
 
 /* ./base/lib_beep.c */
 
+#undef beep_sp
+int	beep_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef beep
 int	beep(void)
 		{ return(*(int *)0); }
@@ -194,14 +226,32 @@
 #undef COLORS
 int	COLORS;
 
+#undef _nc_reset_colors_sp
+NCURSES_BOOL _nc_reset_colors_sp(
+		SCREEN	*sp)
+		{ return(*(NCURSES_BOOL *)0); }
+
 #undef _nc_reset_colors
 NCURSES_BOOL _nc_reset_colors(void)
 		{ return(*(NCURSES_BOOL *)0); }
 
+#undef start_color_sp
+int	start_color_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef start_color
 int	start_color(void)
 		{ return(*(int *)0); }
 
+#undef init_pair_sp
+int	init_pair_sp(
+		SCREEN	*sp, 
+		short	pair, 
+		short	f, 
+		short	b)
+		{ return(*(int *)0); }
+
 #undef init_pair
 int	init_pair(
 		short	pair, 
@@ -209,6 +259,15 @@
 		short	b)
 		{ return(*(int *)0); }
 
+#undef init_color_sp
+int	init_color_sp(
+		SCREEN	*sp, 
+		short	color, 
+		short	r, 
+		short	g, 
+		short	b)
+		{ return(*(int *)0); }
+
 #undef init_color
 int	init_color(
 		short	color, 
@@ -217,14 +276,33 @@
 		short	b)
 		{ return(*(int *)0); }
 
+#undef can_change_color_sp
+NCURSES_BOOL can_change_color_sp(
+		SCREEN	*sp)
+		{ return(*(NCURSES_BOOL *)0); }
+
 #undef can_change_color
 NCURSES_BOOL can_change_color(void)
 		{ return(*(NCURSES_BOOL *)0); }
 
+#undef has_colors_sp
+NCURSES_BOOL has_colors_sp(
+		SCREEN	*sp)
+		{ return(*(NCURSES_BOOL *)0); }
+
 #undef has_colors
 NCURSES_BOOL has_colors(void)
 		{ return(*(NCURSES_BOOL *)0); }
 
+#undef color_content_sp
+int	color_content_sp(
+		SCREEN	*sp, 
+		short	color, 
+		short	*r, 
+		short	*g, 
+		short	*b)
+		{ return(*(int *)0); }
+
 #undef color_content
 int	color_content(
 		short	color, 
@@ -233,6 +311,14 @@
 		short	*b)
 		{ return(*(int *)0); }
 
+#undef pair_content_sp
+int	pair_content_sp(
+		SCREEN	*sp, 
+		short	pair, 
+		short	*f, 
+		short	*b)
+		{ return(*(int *)0); }
+
 #undef pair_content
 int	pair_content(
 		short	pair, 
@@ -240,13 +326,21 @@
 		short	*b)
 		{ return(*(int *)0); }
 
+#undef _nc_do_color_sp
+void	_nc_do_color_sp(
+		SCREEN	*sp, 
+		short	old_pair, 
+		short	pair, 
+		NCURSES_BOOL reverse, 
+		NCURSES_OUTC_sp outc)
+		{ /* void */ }
+
 #undef _nc_do_color
 void	_nc_do_color(
 		short	old_pair, 
 		short	pair, 
 		NCURSES_BOOL reverse, 
-		int	(*outc)(
-		int	p1))
+		NCURSES_OUTC outc)
 		{ /* void */ }
 
 /* ./base/lib_colorset.c */
@@ -274,16 +368,31 @@
 
 /* ./base/lib_echo.c */
 
+#undef echo_sp
+int	echo_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef echo
 int	echo(void)
 		{ return(*(int *)0); }
 
+#undef noecho_sp
+int	noecho_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef noecho
 int	noecho(void)
 		{ return(*(int *)0); }
 
 /* ./base/lib_endwin.c */
 
+#undef endwin_sp
+int	endwin_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef endwin
 int	endwin(void)
 		{ return(*(int *)0); }
@@ -297,6 +406,11 @@
 
 /* ./base/lib_flash.c */
 
+#undef flash_sp
+int	flash_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef flash
 int	flash(void)
 		{ return(*(int *)0); }
@@ -1107,11 +1221,21 @@
 		const WINDOW *z)
 		{ return(*(NCURSES_BOOL *)0); }
 
+#undef is_pad
+NCURSES_BOOL is_pad(
+		const WINDOW *z)
+		{ return(*(NCURSES_BOOL *)0); }
+
 #undef is_scrollok
 NCURSES_BOOL is_scrollok(
 		const WINDOW *z)
 		{ return(*(NCURSES_BOOL *)0); }
 
+#undef is_subwin
+NCURSES_BOOL is_subwin(
+		const WINDOW *z)
+		{ return(*(NCURSES_BOOL *)0); }
+
 #undef is_syncok
 NCURSES_BOOL is_syncok(
 		const WINDOW *z)
@@ -1138,11 +1262,26 @@
 #undef ESCDELAY
 int	ESCDELAY;
 
+#undef set_escdelay_sp
+int	set_escdelay_sp(
+		SCREEN	*sp, 
+		int	value)
+		{ return(*(int *)0); }
+
 #undef set_escdelay
 int	set_escdelay(
 		int	value)
 		{ return(*(int *)0); }
 
+#undef get_escdelay_sp
+int	get_escdelay_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
+#undef get_escdelay
+int	get_escdelay(void)
+		{ return(*(int *)0); }
+
 #undef _nc_wgetch
 int	_nc_wgetch(
 		WINDOW	*win, 
@@ -1200,6 +1339,7 @@
 
 #undef _nc_insert_ch
 int	_nc_insert_ch(
+		SCREEN	*sp, 
 		WINDOW	*win, 
 		chtype	ch)
 		{ return(*(int *)0); }
@@ -1238,6 +1378,11 @@
 
 /* ./base/lib_isendwin.c */
 
+#undef isendwin_sp
+NCURSES_BOOL isendwin_sp(
+		SCREEN	*sp)
+		{ return(*(NCURSES_BOOL *)0); }
+
 #undef isendwin
 NCURSES_BOOL isendwin(void)
 		{ return(*(NCURSES_BOOL *)0); }
@@ -1252,16 +1397,35 @@
 
 /* ./base/lib_mouse.c */
 
+#undef getmouse_sp
+int	getmouse_sp(
+		SCREEN	*sp, 
+		MEVENT	*aevent)
+		{ return(*(int *)0); }
+
 #undef getmouse
 int	getmouse(
 		MEVENT	*aevent)
 		{ return(*(int *)0); }
 
+#undef ungetmouse_sp
+int	ungetmouse_sp(
+		SCREEN	*sp, 
+		MEVENT	*aevent)
+		{ return(*(int *)0); }
+
 #undef ungetmouse
 int	ungetmouse(
 		MEVENT	*aevent)
 		{ return(*(int *)0); }
 
+#undef mousemask_sp
+mmask_t	mousemask_sp(
+		SCREEN	*sp, 
+		mmask_t	newmask, 
+		mmask_t	*oldmask)
+		{ return(*(mmask_t *)0); }
+
 #undef mousemask
 mmask_t	mousemask(
 		mmask_t	newmask, 
@@ -1275,14 +1439,30 @@
 		int	x)
 		{ return(*(NCURSES_BOOL *)0); }
 
+#undef mouseinterval_sp
+int	mouseinterval_sp(
+		SCREEN	*sp, 
+		int	maxclick)
+		{ return(*(int *)0); }
+
 #undef mouseinterval
 int	mouseinterval(
 		int	maxclick)
 		{ return(*(int *)0); }
 
 #undef _nc_has_mouse
-int	_nc_has_mouse(void)
-		{ return(*(int *)0); }
+NCURSES_BOOL _nc_has_mouse(
+		SCREEN	*sp)
+		{ return(*(NCURSES_BOOL *)0); }
+
+#undef has_mouse_sp
+NCURSES_BOOL has_mouse_sp(
+		SCREEN	*sp)
+		{ return(*(NCURSES_BOOL *)0); }
+
+#undef has_mouse
+NCURSES_BOOL has_mouse(void)
+		{ return(*(NCURSES_BOOL *)0); }
 
 #undef wmouse_trafo
 NCURSES_BOOL wmouse_trafo(
@@ -1303,24 +1483,55 @@
 
 /* ./tty/lib_mvcur.c */
 
+#undef _nc_msec_cost_sp
+int	_nc_msec_cost_sp(
+		SCREEN	*sp, 
+		const char *const cap, 
+		int	affcnt)
+		{ return(*(int *)0); }
+
 #undef _nc_msec_cost
 int	_nc_msec_cost(
 		const char *const cap, 
 		int	affcnt)
 		{ return(*(int *)0); }
 
+#undef _nc_mvcur_resume_sp
+void	_nc_mvcur_resume_sp(
+		SCREEN	*sp)
+		{ /* void */ }
+
 #undef _nc_mvcur_resume
 void	_nc_mvcur_resume(void)
 		{ /* void */ }
 
+#undef _nc_mvcur_init_sp
+void	_nc_mvcur_init_sp(
+		SCREEN	*sp)
+		{ /* void */ }
+
 #undef _nc_mvcur_init
 void	_nc_mvcur_init(void)
 		{ /* void */ }
 
+#undef _nc_mvcur_wrap_sp
+void	_nc_mvcur_wrap_sp(
+		SCREEN	*sp)
+		{ /* void */ }
+
 #undef _nc_mvcur_wrap
 void	_nc_mvcur_wrap(void)
 		{ /* void */ }
 
+#undef mvcur_sp
+int	mvcur_sp(
+		SCREEN	*sp, 
+		int	yold, 
+		int	xold, 
+		int	ynew, 
+		int	xnew)
+		{ return(*(int *)0); }
+
 #undef mvcur
 int	mvcur(
 		int	yold, 
@@ -1343,14 +1554,32 @@
 
 /* ./base/lib_newterm.c */
 
+#undef filter_sp
+void	filter_sp(
+		SCREEN	*sp)
+		{ /* void */ }
+
 #undef filter
 void	filter(void)
 		{ /* void */ }
 
+#undef nofilter_sp
+void	nofilter_sp(
+		SCREEN	*sp)
+		{ /* void */ }
+
 #undef nofilter
 void	nofilter(void)
 		{ /* void */ }
 
+#undef newterm_sp
+SCREEN	*newterm_sp(
+		SCREEN	*sp, 
+		char	*name, 
+		FILE	*ofp, 
+		FILE	*ifp)
+		{ return(*(SCREEN **)0); }
+
 #undef newterm
 SCREEN	*newterm(
 		char	*name, 
@@ -1365,6 +1594,15 @@
 		WINDOW	*win)
 		{ return(*(int *)0); }
 
+#undef newwin_sp
+WINDOW	*newwin_sp(
+		SCREEN	*sp, 
+		int	num_lines, 
+		int	num_columns, 
+		int	begy, 
+		int	begx)
+		{ return(*(WINDOW **)0); }
+
 #undef newwin
 WINDOW	*newwin(
 		int	num_lines, 
@@ -1391,8 +1629,9 @@
 		int	x)
 		{ return(*(WINDOW **)0); }
 
-#undef _nc_makenew
-WINDOW	*_nc_makenew(
+#undef _nc_makenew_sp
+WINDOW	*_nc_makenew_sp(
+		SCREEN	*sp, 
 		int	num_lines, 
 		int	num_columns, 
 		int	begy, 
@@ -1400,17 +1639,37 @@
 		int	flags)
 		{ return(*(WINDOW **)0); }
 
-#undef _nc_screen_of
-SCREEN	*_nc_screen_of(
-		WINDOW	*win)
-		{ return(*(SCREEN **)0); }
+#undef _nc_curscr_of
+WINDOW	*_nc_curscr_of(
+		SCREEN	*sp)
+		{ return(*(WINDOW **)0); }
+
+#undef _nc_newscr_of
+WINDOW	*_nc_newscr_of(
+		SCREEN	*sp)
+		{ return(*(WINDOW **)0); }
+
+#undef _nc_stdscr_of
+WINDOW	*_nc_stdscr_of(
+		SCREEN	*sp)
+		{ return(*(WINDOW **)0); }
 
 /* ./base/lib_nl.c */
 
+#undef nl_sp
+int	nl_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef nl
 int	nl(void)
 		{ return(*(int *)0); }
 
+#undef nonl_sp
+int	nonl_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef nonl
 int	nonl(void)
 		{ return(*(int *)0); }
@@ -1444,6 +1703,13 @@
 
 /* ./base/lib_pad.c */
 
+#undef newpad_sp
+WINDOW	*newpad_sp(
+		SCREEN	*sp, 
+		int	l, 
+		int	c)
+		{ return(*(WINDOW **)0); }
+
 #undef newpad
 WINDOW	*newpad(
 		int	l, 
@@ -1549,6 +1815,14 @@
 
 /* ./base/lib_restart.c */
 
+#undef restartterm_sp
+int	restartterm_sp(
+		SCREEN	*sp, 
+		char	*termp, 
+		int	filenum, 
+		int	*errret)
+		{ return(*(int *)0); }
+
 #undef restartterm
 int	restartterm(
 		char	*termp, 
@@ -1597,6 +1871,12 @@
 
 /* ./base/lib_screen.c */
 
+#undef getwin_sp
+WINDOW	*getwin_sp(
+		SCREEN	*sp, 
+		FILE	*filep)
+		{ return(*(WINDOW **)0); }
+
 #undef getwin
 WINDOW	*getwin(
 		FILE	*filep)
@@ -1608,6 +1888,12 @@
 		FILE	*filep)
 		{ return(*(int *)0); }
 
+#undef scr_restore_sp
+int	scr_restore_sp(
+		SCREEN	*sp, 
+		const char *file)
+		{ return(*(int *)0); }
+
 #undef scr_restore
 int	scr_restore(
 		const char *file)
@@ -1618,11 +1904,23 @@
 		const char *file)
 		{ return(*(int *)0); }
 
+#undef scr_init_sp
+int	scr_init_sp(
+		SCREEN	*sp, 
+		const char *file)
+		{ return(*(int *)0); }
+
 #undef scr_init
 int	scr_init(
 		const char *file)
 		{ return(*(int *)0); }
 
+#undef scr_set_sp
+int	scr_set_sp(
+		SCREEN	*sp, 
+		const char *file)
+		{ return(*(int *)0); }
+
 #undef scr_set
 int	scr_set(
 		const char *file)
@@ -1674,6 +1972,16 @@
 		SCREEN	*sp)
 		{ /* void */ }
 
+#undef _nc_setupscreen_sp
+int	_nc_setupscreen_sp(
+		SCREEN	**spp, 
+		int	slines, 
+		int	scolumns, 
+		FILE	*output, 
+		NCURSES_BOOL filtered, 
+		int	slk_format)
+		{ return(*(int *)0); }
+
 #undef _nc_setupscreen
 int	_nc_setupscreen(
 		int	slines, 
@@ -1683,6 +1991,15 @@
 		int	slk_format)
 		{ return(*(int *)0); }
 
+#undef _nc_ripoffline_sp
+int	_nc_ripoffline_sp(
+		SCREEN	*sp, 
+		int	line, 
+		int	(*init)(
+		WINDOW	*p1, 
+		int	p2))
+		{ return(*(int *)0); }
+
 #undef _nc_ripoffline
 int	_nc_ripoffline(
 		int	line, 
@@ -1691,6 +2008,15 @@
 		int	p2))
 		{ return(*(int *)0); }
 
+#undef ripoffline_sp
+int	ripoffline_sp(
+		SCREEN	*sp, 
+		int	line, 
+		int	(*init)(
+		WINDOW	*p1, 
+		int	p2))
+		{ return(*(int *)0); }
+
 #undef ripoffline
 int	ripoffline(
 		int	line, 
@@ -1701,18 +2027,37 @@
 
 /* ./base/lib_slk.c */
 
+#undef _nc_format_slks
+int	_nc_format_slks(
+		SCREEN	*sp, 
+		int	cols)
+		{ return(*(int *)0); }
+
 #undef _nc_slk_initialize
 int	_nc_slk_initialize(
 		WINDOW	*stwin, 
 		int	cols)
 		{ return(*(int *)0); }
 
+#undef slk_restore_sp
+int	slk_restore_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef slk_restore
 int	slk_restore(void)
 		{ return(*(int *)0); }
 
 /* ./base/lib_slkatr_set.c */
 
+#undef slk_attr_set_sp
+int	slk_attr_set_sp(
+		SCREEN	*sp, 
+		const attr_t attr, 
+		short	color_pair_number, 
+		void	*opts)
+		{ return(*(int *)0); }
+
 #undef slk_attr_set
 int	slk_attr_set(
 		const attr_t attr, 
@@ -1722,6 +2067,12 @@
 
 /* ./base/lib_slkatrof.c */
 
+#undef slk_attroff_sp
+int	slk_attroff_sp(
+		SCREEN	*sp, 
+		const chtype attr)
+		{ return(*(int *)0); }
+
 #undef slk_attroff
 int	slk_attroff(
 		const chtype attr)
@@ -1729,6 +2080,12 @@
 
 /* ./base/lib_slkatron.c */
 
+#undef slk_attron_sp
+int	slk_attron_sp(
+		SCREEN	*sp, 
+		const chtype attr)
+		{ return(*(int *)0); }
+
 #undef slk_attron
 int	slk_attron(
 		const chtype attr)
@@ -1736,6 +2093,12 @@
 
 /* ./base/lib_slkatrset.c */
 
+#undef slk_attrset_sp
+int	slk_attrset_sp(
+		SCREEN	*sp, 
+		const chtype attr)
+		{ return(*(int *)0); }
+
 #undef slk_attrset
 int	slk_attrset(
 		const chtype attr)
@@ -1743,18 +2106,34 @@
 
 /* ./base/lib_slkattr.c */
 
+#undef slk_attr_sp
+attr_t	slk_attr_sp(
+		SCREEN	*sp)
+		{ return(*(attr_t *)0); }
+
 #undef slk_attr
 attr_t	slk_attr(void)
 		{ return(*(attr_t *)0); }
 
 /* ./base/lib_slkclear.c */
 
+#undef slk_clear_sp
+int	slk_clear_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef slk_clear
 int	slk_clear(void)
 		{ return(*(int *)0); }
 
 /* ./base/lib_slkcolor.c */
 
+#undef slk_color_sp
+int	slk_color_sp(
+		SCREEN	*sp, 
+		short	color_pair_number)
+		{ return(*(int *)0); }
+
 #undef slk_color
 int	slk_color(
 		short	color_pair_number)
@@ -1762,6 +2141,12 @@
 
 /* ./base/lib_slkinit.c */
 
+#undef slk_init_sp
+int	slk_init_sp(
+		SCREEN	*sp, 
+		int	format)
+		{ return(*(int *)0); }
+
 #undef slk_init
 int	slk_init(
 		int	format)
@@ -1769,6 +2154,12 @@
 
 /* ./base/lib_slklab.c */
 
+#undef slk_label_sp
+char	*slk_label_sp(
+		SCREEN	*sp, 
+		int	n)
+		{ return(*(char **)0); }
+
 #undef slk_label
 char	*slk_label(
 		int	n)
@@ -1776,16 +2167,34 @@
 
 /* ./base/lib_slkrefr.c */
 
+#undef slk_noutrefresh_sp
+int	slk_noutrefresh_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef slk_noutrefresh
 int	slk_noutrefresh(void)
 		{ return(*(int *)0); }
 
+#undef slk_refresh_sp
+int	slk_refresh_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef slk_refresh
 int	slk_refresh(void)
 		{ return(*(int *)0); }
 
 /* ./base/lib_slkset.c */
 
+#undef slk_set_sp
+int	slk_set_sp(
+		SCREEN	*sp, 
+		int	i, 
+		const char *astr, 
+		int	format)
+		{ return(*(int *)0); }
+
 #undef slk_set
 int	slk_set(
 		int	i, 
@@ -1795,6 +2204,11 @@
 
 /* ./base/lib_slktouch.c */
 
+#undef slk_touch_sp
+int	slk_touch_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef slk_touch
 int	slk_touch(void)
 		{ return(*(int *)0); }
@@ -1857,8 +2271,8 @@
 		SCREEN	*sp)
 		{ /* void */ }
 
-#undef _nc_ungetch
-int	_nc_ungetch(
+#undef ungetch_sp
+int	ungetch_sp(
 		SCREEN	*sp, 
 		int	ch)
 		{ return(*(int *)0); }
@@ -1870,11 +2284,23 @@
 
 /* ./tty/lib_vidattr.c */
 
+#undef vidputs_sp
+int	vidputs_sp(
+		SCREEN	*sp, 
+		chtype	newmode, 
+		NCURSES_OUTC_sp outc)
+		{ return(*(int *)0); }
+
 #undef vidputs
 int	vidputs(
 		chtype	newmode, 
-		int	(*outc)(
-		int	p1))
+		NCURSES_OUTC outc)
+		{ return(*(int *)0); }
+
+#undef vidattr_sp
+int	vidattr_sp(
+		SCREEN	*sp, 
+		chtype	newmode)
 		{ return(*(int *)0); }
 
 #undef vidattr
@@ -1882,6 +2308,11 @@
 		chtype	newmode)
 		{ return(*(int *)0); }
 
+#undef termattrs_sp
+chtype	termattrs_sp(
+		SCREEN	*sp)
+		{ return(*(chtype *)0); }
+
 #undef termattrs
 chtype	termattrs(void)
 		{ return(*(chtype *)0); }
@@ -1962,12 +2393,24 @@
 
 /* ./base/nc_panel.c */
 
+#undef _nc_panelhook_sp
+struct panelhook *_nc_panelhook_sp(
+		SCREEN	*sp)
+		{ return(*(struct panelhook **)0); }
+
 #undef _nc_panelhook
 struct panelhook *_nc_panelhook(void)
 		{ return(*(struct panelhook **)0); }
 
 /* ./base/safe_sprintf.c */
 
+#undef _nc_printf_string_sp
+char	*_nc_printf_string_sp(
+		SCREEN	*sp, 
+		const char *fmt, 
+		va_list	ap)
+		{ return(*(char **)0); }
+
 #undef _nc_printf_string
 char	*_nc_printf_string(
 		const char *fmt, 
@@ -1979,10 +2422,24 @@
 #include <sys/time.h>
 #include <sys/times.h>
 
+#undef doupdate_sp
+int	doupdate_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef doupdate
 int	doupdate(void)
 		{ return(*(int *)0); }
 
+#undef _nc_scrolln_sp
+int	_nc_scrolln_sp(
+		SCREEN	*sp, 
+		int	n, 
+		int	top, 
+		int	bot, 
+		int	maxy)
+		{ return(*(int *)0); }
+
 #undef _nc_scrolln
 int	_nc_scrolln(
 		int	n, 
@@ -1991,18 +2448,39 @@
 		int	maxy)
 		{ return(*(int *)0); }
 
+#undef _nc_screen_resume_sp
+void	_nc_screen_resume_sp(
+		SCREEN	*sp)
+		{ /* void */ }
+
 #undef _nc_screen_resume
 void	_nc_screen_resume(void)
 		{ /* void */ }
 
+#undef _nc_screen_init_sp
+void	_nc_screen_init_sp(
+		SCREEN	*sp)
+		{ /* void */ }
+
 #undef _nc_screen_init
 void	_nc_screen_init(void)
 		{ /* void */ }
 
+#undef _nc_screen_wrap_sp
+void	_nc_screen_wrap_sp(
+		SCREEN	*sp)
+		{ /* void */ }
+
 #undef _nc_screen_wrap
 void	_nc_screen_wrap(void)
 		{ /* void */ }
 
+#undef _nc_do_xmc_glitch_sp
+void	_nc_do_xmc_glitch_sp(
+		SCREEN	*sp, 
+		attr_t	previous)
+		{ /* void */ }
+
 #undef _nc_do_xmc_glitch
 void	_nc_do_xmc_glitch(
 		attr_t	previous)
@@ -2040,6 +2518,12 @@
 void	_nc_freeall(void)
 		{ /* void */ }
 
+#undef _nc_free_and_exit_sp
+void	_nc_free_and_exit_sp(
+		SCREEN	*sp, 
+		int	code)
+		{ /* void */ }
+
 #undef _nc_free_and_exit
 void	_nc_free_and_exit(
 		int	code)
@@ -2047,6 +2531,8 @@
 
 /* ./expanded.c */
 
+#include <term.h>
+
 #undef _nc_toggle_attr_on
 void	_nc_toggle_attr_on(
 		attr_t	*S, 
@@ -2059,6 +2545,24 @@
 		attr_t	at)
 		{ /* void */ }
 
+#undef _nc_DelCharCost_sp
+int	_nc_DelCharCost_sp(
+		SCREEN	*sp, 
+		int	count)
+		{ return(*(int *)0); }
+
+#undef _nc_InsCharCost_sp
+int	_nc_InsCharCost_sp(
+		SCREEN	*sp, 
+		int	count)
+		{ return(*(int *)0); }
+
+#undef _nc_UpdateAttrs_sp
+void	_nc_UpdateAttrs_sp(
+		SCREEN	*sp, 
+		chtype	c)
+		{ /* void */ }
+
 #undef _nc_DelCharCost
 int	_nc_DelCharCost(
 		int	count)
@@ -2076,6 +2580,12 @@
 
 /* ./base/legacy_coding.c */
 
+#undef use_legacy_coding_sp
+int	use_legacy_coding_sp(
+		SCREEN	*sp, 
+		int	level)
+		{ return(*(int *)0); }
+
 #undef use_legacy_coding
 int	use_legacy_coding(
 		int	level)
@@ -2083,10 +2593,22 @@
 
 /* ./base/lib_dft_fgbg.c */
 
+#undef use_default_colors_sp
+int	use_default_colors_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef use_default_colors
 int	use_default_colors(void)
 		{ return(*(int *)0); }
 
+#undef assume_default_colors_sp
+int	assume_default_colors_sp(
+		SCREEN	*sp, 
+		int	fg, 
+		int	bg)
+		{ return(*(int *)0); }
+
 #undef assume_default_colors
 int	assume_default_colors(
 		int	fg, 
@@ -2095,6 +2617,13 @@
 
 /* ./tinfo/lib_print.c */
 
+#undef mcprint_sp
+int	mcprint_sp(
+		SCREEN	*sp, 
+		char	*data, 
+		int	len)
+		{ return(*(int *)0); }
+
 #undef mcprint
 int	mcprint(
 		char	*data, 
@@ -2103,18 +2632,39 @@
 
 /* ./base/resizeterm.c */
 
+#undef is_term_resized_sp
+NCURSES_BOOL is_term_resized_sp(
+		SCREEN	*sp, 
+		int	ToLines, 
+		int	ToCols)
+		{ return(*(NCURSES_BOOL *)0); }
+
 #undef is_term_resized
 NCURSES_BOOL is_term_resized(
 		int	ToLines, 
 		int	ToCols)
 		{ return(*(NCURSES_BOOL *)0); }
 
+#undef resize_term_sp
+int	resize_term_sp(
+		SCREEN	*sp, 
+		int	ToLines, 
+		int	ToCols)
+		{ return(*(int *)0); }
+
 #undef resize_term
 int	resize_term(
 		int	ToLines, 
 		int	ToCols)
 		{ return(*(int *)0); }
 
+#undef resizeterm_sp
+int	resizeterm_sp(
+		SCREEN	*sp, 
+		int	ToLines, 
+		int	ToCols)
+		{ return(*(int *)0); }
+
 #undef resizeterm
 int	resizeterm(
 		int	ToLines, 
@@ -2232,7 +2782,32 @@
 #undef strcodes
 char	*const strcodes[] = {0};
 
+/* ./comp_captab.c */
+
+#include <hashsize.h>
+
+#undef _nc_get_table
+const struct name_table_entry *_nc_get_table(
+		NCURSES_BOOL termcap)
+		{ return(*(const struct name_table_entry **)0); }
+
+#undef _nc_get_hash_table
+const HashValue *_nc_get_hash_table(
+		NCURSES_BOOL termcap)
+		{ return(*(const HashValue **)0); }
+
+#undef _nc_get_alias_table
+const struct alias *_nc_get_alias_table(
+		NCURSES_BOOL termcap)
+		{ return(*(const struct alias **)0); }
+
+#undef _nc_get_hash_info
+const HashData *_nc_get_hash_info(
+		NCURSES_BOOL termcap)
+		{ return(*(const HashData **)0); }
+
 /* ./tinfo/comp_error.c */
+
 #undef _nc_suppress_warnings
 NCURSES_BOOL _nc_suppress_warnings;
 #undef _nc_curr_line
@@ -2277,6 +2852,21 @@
 		...)
 		{ /* void */ }
 
+/* ./tinfo/comp_hash.c */
+
+#undef _nc_find_entry
+struct name_table_entry const *_nc_find_entry(
+		const char *string, 
+		const HashValue *hash_table)
+		{ return(*(struct name_table_entry const **)0); }
+
+#undef _nc_find_type_entry
+struct name_table_entry const *_nc_find_type_entry(
+		const char *string, 
+		int	type, 
+		NCURSES_BOOL termcap)
+		{ return(*(struct name_table_entry const **)0); }
+
 /* ./tinfo/db_iterator.c */
 
 #undef _nc_tic_dir
@@ -2397,6 +2987,11 @@
 #undef acs_map
 chtype	acs_map[128];
 
+#undef _nc_init_acs_sp
+void	_nc_init_acs_sp(
+		SCREEN	*sp)
+		{ /* void */ }
+
 #undef _nc_init_acs
 void	_nc_init_acs(void)
 		{ /* void */ }
@@ -2420,6 +3015,11 @@
 		int	BaudRate)
 		{ return(*(int *)0); }
 
+#undef baudrate_sp
+int	baudrate_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef baudrate
 int	baudrate(void)
 		{ return(*(int *)0); }
@@ -2429,11 +3029,23 @@
 #undef cur_term
 TERMINAL *cur_term;
 
+#undef set_curterm_sp
+TERMINAL *set_curterm_sp(
+		SCREEN	*sp, 
+		TERMINAL *termp)
+		{ return(*(TERMINAL **)0); }
+
 #undef set_curterm
 TERMINAL *set_curterm(
 		TERMINAL *termp)
 		{ return(*(TERMINAL **)0); }
 
+#undef del_curterm_sp
+int	del_curterm_sp(
+		SCREEN	*sp, 
+		TERMINAL *termp)
+		{ return(*(int *)0); }
+
 #undef del_curterm
 int	del_curterm(
 		TERMINAL *termp)
@@ -2456,26 +3068,56 @@
 #undef _nc_prescreen
 NCURSES_PRESCREEN _nc_prescreen;
 
+#undef _nc_screen_of
+SCREEN	*_nc_screen_of(
+		WINDOW	*win)
+		{ return(*(SCREEN **)0); }
+
 /* ./tinfo/lib_has_cap.c */
 
+#undef has_ic_sp
+NCURSES_BOOL has_ic_sp(
+		SCREEN	*sp)
+		{ return(*(NCURSES_BOOL *)0); }
+
 #undef has_ic
 NCURSES_BOOL has_ic(void)
 		{ return(*(NCURSES_BOOL *)0); }
 
+#undef has_il_sp
+NCURSES_BOOL has_il_sp(
+		SCREEN	*sp)
+		{ return(*(NCURSES_BOOL *)0); }
+
 #undef has_il
 NCURSES_BOOL has_il(void)
 		{ return(*(NCURSES_BOOL *)0); }
 
 /* ./tinfo/lib_kernel.c */
 
+#undef erasechar_sp
+char	erasechar_sp(
+		SCREEN	*sp)
+		{ return(*(char *)0); }
+
 #undef erasechar
 char	erasechar(void)
 		{ return(*(char *)0); }
 
+#undef killchar_sp
+char	killchar_sp(
+		SCREEN	*sp)
+		{ return(*(char *)0); }
+
 #undef killchar
 char	killchar(void)
 		{ return(*(char *)0); }
 
+#undef flushinp_sp
+int	flushinp_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef flushinp
 int	flushinp(void)
 		{ return(*(int *)0); }
@@ -2484,8 +3126,8 @@
 
 struct kn { short offset; int code; };
 
-#undef _nc_keyname
-char	*_nc_keyname(
+#undef keyname_sp
+char	*keyname_sp(
 		SCREEN	*sp, 
 		int	c)
 		{ return(*(char **)0); }
@@ -2505,6 +3147,12 @@
 
 #include <time.h>
 
+#undef napms_sp
+int	napms_sp(
+		SCREEN	*sp, 
+		int	ms)
+		{ return(*(int *)0); }
+
 #undef napms
 int	napms(
 		int	ms)
@@ -2524,6 +3172,12 @@
 		NCURSES_BOOL flag)
 		{ /* void */ }
 
+#undef halfdelay_sp
+int	halfdelay_sp(
+		SCREEN	*sp, 
+		int	t)
+		{ return(*(int *)0); }
+
 #undef halfdelay
 int	halfdelay(
 		int	t)
@@ -2559,21 +3213,46 @@
 		NCURSES_BOOL flag)
 		{ return(*(int *)0); }
 
+#undef curs_set_sp
+int	curs_set_sp(
+		SCREEN	*sp, 
+		int	vis)
+		{ return(*(int *)0); }
+
 #undef curs_set
 int	curs_set(
 		int	vis)
 		{ return(*(int *)0); }
 
+#undef typeahead_sp
+int	typeahead_sp(
+		SCREEN	*sp, 
+		int	fd)
+		{ return(*(int *)0); }
+
 #undef typeahead
 int	typeahead(
 		int	fd)
 		{ return(*(int *)0); }
 
+#undef has_key_sp
+int	has_key_sp(
+		SCREEN	*sp, 
+		int	keycode)
+		{ return(*(int *)0); }
+
 #undef has_key
 int	has_key(
 		int	keycode)
 		{ return(*(int *)0); }
 
+#undef _nc_putp_flush_sp
+int	_nc_putp_flush_sp(
+		SCREEN	*sp, 
+		const char *name, 
+		const char *value)
+		{ return(*(int *)0); }
+
 #undef _nc_keypad
 int	_nc_keypad(
 		SCREEN	*sp, 
@@ -2582,30 +3261,67 @@
 
 /* ./tinfo/lib_raw.c */
 
+#undef raw_sp
+int	raw_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef raw
 int	raw(void)
 		{ return(*(int *)0); }
 
+#undef cbreak_sp
+int	cbreak_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef cbreak
 int	cbreak(void)
 		{ return(*(int *)0); }
 
+#undef qiflush_sp
+void	qiflush_sp(
+		SCREEN	*sp)
+		{ /* void */ }
+
 #undef qiflush
 void	qiflush(void)
 		{ /* void */ }
 
+#undef noraw_sp
+int	noraw_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef noraw
 int	noraw(void)
 		{ return(*(int *)0); }
 
+#undef nocbreak_sp
+int	nocbreak_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef nocbreak
 int	nocbreak(void)
 		{ return(*(int *)0); }
 
+#undef noqiflush_sp
+void	noqiflush_sp(
+		SCREEN	*sp)
+		{ /* void */ }
+
 #undef noqiflush
 void	noqiflush(void)
 		{ /* void */ }
 
+#undef intrflush_sp
+int	intrflush_sp(
+		SCREEN	*sp, 
+		WINDOW	*win, 
+		NCURSES_BOOL flag)
+		{ return(*(int *)0); }
+
 #undef intrflush
 int	intrflush(
 		WINDOW	*win, 
@@ -2627,6 +3343,12 @@
 #undef TABSIZE
 int	TABSIZE;
 
+#undef set_tabsize_sp
+int	set_tabsize_sp(
+		SCREEN	*sp, 
+		int	value)
+		{ return(*(int *)0); }
+
 #undef set_tabsize
 int	set_tabsize(
 		int	value)
@@ -2637,6 +3359,12 @@
 		SCREEN	*sp)
 		{ return(*(int *)0); }
 
+#undef use_env_sp
+void	use_env_sp(
+		SCREEN	*sp, 
+		NCURSES_BOOL f)
+		{ /* void */ }
+
 #undef use_env
 void	use_env(
 		NCURSES_BOOL f)
@@ -2654,6 +3382,12 @@
 		SCREEN	*sp)
 		{ /* void */ }
 
+#undef _nc_tinfo_cmdch
+void	_nc_tinfo_cmdch(
+		TERMINAL *termp, 
+		char	proto)
+		{ /* void */ }
+
 #undef _nc_get_locale
 char	*_nc_get_locale(void)
 		{ return(*(char **)0); }
@@ -2675,6 +3409,10 @@
 		NCURSES_BOOL reuse)
 		{ return(*(int *)0); }
 
+#undef new_prescr
+SCREEN	*new_prescr(void)
+		{ return(*(SCREEN **)0); }
+
 #undef setupterm
 int	setupterm(
 		char	*tname, 
@@ -2689,8 +3427,9 @@
 #undef BC
 char	*BC;
 
-#undef tgetent
-int	tgetent(
+#undef tgetent_sp
+int	tgetent_sp(
+		SCREEN	*sp, 
 		char	*bufp, 
 		const char *name)
 		{ return(*(int *)0); }
@@ -2701,16 +3440,41 @@
 
 #endif
 
+#undef tgetent
+int	tgetent(
+		char	*bufp, 
+		const char *name)
+		{ return(*(int *)0); }
+
+#undef tgetflag_sp
+int	tgetflag_sp(
+		SCREEN	*sp, 
+		char	*id)
+		{ return(*(int *)0); }
+
 #undef tgetflag
 int	tgetflag(
 		char	*id)
 		{ return(*(int *)0); }
 
+#undef tgetnum_sp
+int	tgetnum_sp(
+		SCREEN	*sp, 
+		char	*id)
+		{ return(*(int *)0); }
+
 #undef tgetnum
 int	tgetnum(
 		char	*id)
 		{ return(*(int *)0); }
 
+#undef tgetstr_sp
+char	*tgetstr_sp(
+		SCREEN	*sp, 
+		char	*id, 
+		char	**area)
+		{ return(*(char **)0); }
+
 #undef tgetstr
 char	*tgetstr(
 		char	*id, 
@@ -2719,6 +3483,11 @@
 
 /* ./tinfo/lib_termname.c */
 
+#undef termname_sp
+char	*termname_sp(
+		SCREEN	*sp)
+		{ return(*(char **)0); }
+
 #undef termname
 char	*termname(void)
 		{ return(*(char **)0); }
@@ -2734,16 +3503,34 @@
 
 /* ./tinfo/lib_ti.c */
 
+#undef tigetflag_sp
+int	tigetflag_sp(
+		SCREEN	*sp, 
+		char	*str)
+		{ return(*(int *)0); }
+
 #undef tigetflag
 int	tigetflag(
 		char	*str)
 		{ return(*(int *)0); }
 
+#undef tigetnum_sp
+int	tigetnum_sp(
+		SCREEN	*sp, 
+		char	*str)
+		{ return(*(int *)0); }
+
 #undef tigetnum
 int	tigetnum(
 		char	*str)
 		{ return(*(int *)0); }
 
+#undef tigetstr_sp
+char	*tigetstr_sp(
+		SCREEN	*sp, 
+		char	*str)
+		{ return(*(char **)0); }
+
 #undef tigetstr
 char	*tigetstr(
 		char	*str)
@@ -2767,6 +3554,12 @@
 		...)
 		{ return(*(char **)0); }
 
+#undef tiparm
+char	*tiparm(
+		const char *string, 
+		...)
+		{ return(*(char **)0); }
+
 /* ./tinfo/lib_tputs.c */
 
 #undef PC
@@ -2781,25 +3574,75 @@
 		SCREEN	*sp)
 		{ /* void */ }
 
+#undef delay_output_sp
+int	delay_output_sp(
+		SCREEN	*sp, 
+		int	ms)
+		{ return(*(int *)0); }
+
 #undef delay_output
 int	delay_output(
 		int	ms)
 		{ return(*(int *)0); }
 
+#undef _nc_flush_sp
+void	_nc_flush_sp(
+		SCREEN	*sp)
+		{ /* void */ }
+
 #undef _nc_flush
 void	_nc_flush(void)
 		{ /* void */ }
 
+#undef _nc_outch_sp
+int	_nc_outch_sp(
+		SCREEN	*sp, 
+		int	ch)
+		{ return(*(int *)0); }
+
 #undef _nc_outch
 int	_nc_outch(
 		int	ch)
 		{ return(*(int *)0); }
 
+#undef putp_sp
+int	putp_sp(
+		SCREEN	*sp, 
+		const char *string)
+		{ return(*(int *)0); }
+
+#undef _nc_putp_sp
+int	_nc_putp_sp(
+		SCREEN	*sp, 
+		const char *name, 
+		const char *string)
+		{ return(*(int *)0); }
+
 #undef putp
 int	putp(
 		const char *string)
 		{ return(*(int *)0); }
 
+#undef _nc_putp
+int	_nc_putp(
+		const char *name, 
+		const char *string)
+		{ return(*(int *)0); }
+
+#undef tputs_sp
+int	tputs_sp(
+		SCREEN	*sp, 
+		const char *string, 
+		int	affcnt, 
+		NCURSES_OUTC_sp outc)
+		{ return(*(int *)0); }
+
+#undef _nc_outc_wrapper
+int	_nc_outc_wrapper(
+		SCREEN	*sp, 
+		int	c)
+		{ return(*(int *)0); }
+
 #undef tputs
 int	tputs(
 		const char *string, 
@@ -2944,36 +3787,78 @@
 
 /* ./tinfo/lib_ttyflags.c */
 
+#undef _nc_get_tty_mode_sp
+int	_nc_get_tty_mode_sp(
+		SCREEN	*sp, 
+		struct termios *buf)
+		{ return(*(int *)0); }
+
 #undef _nc_get_tty_mode
 int	_nc_get_tty_mode(
 		struct termios *buf)
 		{ return(*(int *)0); }
 
+#undef _nc_set_tty_mode_sp
+int	_nc_set_tty_mode_sp(
+		SCREEN	*sp, 
+		struct termios *buf)
+		{ return(*(int *)0); }
+
 #undef _nc_set_tty_mode
 int	_nc_set_tty_mode(
 		struct termios *buf)
 		{ return(*(int *)0); }
 
+#undef def_shell_mode_sp
+int	def_shell_mode_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef def_shell_mode
 int	def_shell_mode(void)
 		{ return(*(int *)0); }
 
+#undef def_prog_mode_sp
+int	def_prog_mode_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef def_prog_mode
 int	def_prog_mode(void)
 		{ return(*(int *)0); }
 
+#undef reset_prog_mode_sp
+int	reset_prog_mode_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef reset_prog_mode
 int	reset_prog_mode(void)
 		{ return(*(int *)0); }
 
+#undef reset_shell_mode_sp
+int	reset_shell_mode_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef reset_shell_mode
 int	reset_shell_mode(void)
 		{ return(*(int *)0); }
 
+#undef savetty_sp
+int	savetty_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef savetty
 int	savetty(void)
 		{ return(*(int *)0); }
 
+#undef resetty_sp
+int	resetty_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef resetty
 int	resetty(void)
 		{ return(*(int *)0); }
@@ -3053,6 +3938,13 @@
 
 /* ./tinfo/setbuf.c */
 
+#undef _nc_set_buffer_sp
+void	_nc_set_buffer_sp(
+		SCREEN	*sp, 
+		FILE	*ofp, 
+		NCURSES_BOOL buffered)
+		{ /* void */ }
+
 #undef _nc_set_buffer
 void	_nc_set_buffer(
 		FILE	*ofp, 
@@ -3144,8 +4036,8 @@
 
 /* ./unctrl.c */
 
-#undef _nc_unctrl
-char	*_nc_unctrl(
+#undef unctrl_sp
+char	*unctrl_sp(
 		SCREEN	*sp, 
 		chtype	ch)
 		{ return(*(char **)0); }
@@ -3232,25 +4124,6 @@
 		int const parameterized)
 		{ return(*(char **)0); }
 
-/* ./comp_captab.c */
-
-#include <hashsize.h>
-
-#undef _nc_get_table
-const struct name_table_entry *_nc_get_table(
-		NCURSES_BOOL termcap)
-		{ return(*(const struct name_table_entry **)0); }
-
-#undef _nc_get_hash_table
-const short *_nc_get_hash_table(
-		NCURSES_BOOL termcap)
-		{ return(*(const short **)0); }
-
-#undef _nc_get_alias_table
-const struct alias *_nc_get_alias_table(
-		NCURSES_BOOL termcap)
-		{ return(*(const struct alias **)0); }
-
 /* ./tinfo/comp_expand.c */
 
 #undef _nc_tic_expand
@@ -3260,21 +4133,6 @@
 		int	numbers)
 		{ return(*(char **)0); }
 
-/* ./tinfo/comp_hash.c */
-
-#undef _nc_find_entry
-struct name_table_entry const *_nc_find_entry(
-		const char *string, 
-		const short *hash_table)
-		{ return(*(struct name_table_entry const **)0); }
-
-#undef _nc_find_type_entry
-struct name_table_entry const *_nc_find_type_entry(
-		const char *string, 
-		int	type, 
-		const struct name_table_entry *table)
-		{ return(*(struct name_table_entry const **)0); }
-
 /* ./tinfo/comp_parse.c */
 
 #undef _nc_check_termtype2
@@ -3394,6 +4252,13 @@
 
 /* ./base/define_key.c */
 
+#undef define_key_sp
+int	define_key_sp(
+		SCREEN	*sp, 
+		const char *str, 
+		int	keycode)
+		{ return(*(int *)0); }
+
 #undef define_key
 int	define_key(
 		const char *str, 
@@ -3408,6 +4273,12 @@
 
 /* ./base/key_defined.c */
 
+#undef key_defined_sp
+int	key_defined_sp(
+		SCREEN	*sp, 
+		const char *str)
+		{ return(*(int *)0); }
+
 #undef key_defined
 int	key_defined(
 		const char *str)
@@ -3415,6 +4286,13 @@
 
 /* ./base/keybound.c */
 
+#undef keybound_sp
+char	*keybound_sp(
+		SCREEN	*sp, 
+		int	code, 
+		int	count)
+		{ return(*(char **)0); }
+
 #undef keybound
 char	*keybound(
 		int	code, 
@@ -3423,6 +4301,13 @@
 
 /* ./base/keyok.c */
 
+#undef keyok_sp
+int	keyok_sp(
+		SCREEN	*sp, 
+		int	c, 
+		NCURSES_BOOL flag)
+		{ return(*(int *)0); }
+
 #undef keyok
 int	keyok(
 		int	c, 
diff -Naur ncurses-5.7.orig/ncurses/llib-lncursest ncurses-5.7/ncurses/llib-lncursest
--- ncurses-5.7.orig/ncurses/llib-lncursest	2008-10-11 17:13:13.000000000 -0400
+++ ncurses-5.7/ncurses/llib-lncursest	2011-01-08 18:13:50.703157559 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2008 Free Software Foundation, Inc.                        *
+ * Copyright (c) 2008-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            *
@@ -27,7 +27,7 @@
  ****************************************************************************/
 
 /****************************************************************************
- *  Author: Thomas E. Dickey 2008                                           *
+ *  Author: Thomas E. Dickey 2008-on                                        *
  ****************************************************************************/
 /* LINTLIBRARY */
 
@@ -38,27 +38,54 @@
 #undef _nc_oldnums
 int	*_nc_oldnums;
 
+#undef _nc_scroll_optimize_sp
+void	_nc_scroll_optimize_sp(
+		SCREEN	*sp)
+		{ /* void */ }
+
 #undef _nc_scroll_optimize
 void	_nc_scroll_optimize(void)
 		{ /* void */ }
 
+#undef _nc_linedump_sp
+void	_nc_linedump_sp(
+		SCREEN	*sp)
+		{ /* void */ }
+
 #undef _nc_linedump
 void	_nc_linedump(void)
 		{ /* void */ }
 
 /* ./tty/hashmap.c */
 
-#include <term.h>
+#undef _nc_hash_map_sp
+void	_nc_hash_map_sp(
+		SCREEN	*sp)
+		{ /* void */ }
 
 #undef _nc_hash_map
 void	_nc_hash_map(void)
 		{ /* void */ }
 
+#undef _nc_make_oldhash_sp
+void	_nc_make_oldhash_sp(
+		SCREEN	*sp, 
+		int	i)
+		{ /* void */ }
+
 #undef _nc_make_oldhash
 void	_nc_make_oldhash(
 		int	i)
 		{ /* void */ }
 
+#undef _nc_scroll_oldhash_sp
+void	_nc_scroll_oldhash_sp(
+		SCREEN	*sp, 
+		int	n, 
+		int	top, 
+		int	bot)
+		{ /* void */ }
+
 #undef _nc_scroll_oldhash
 void	_nc_scroll_oldhash(
 		int	n, 
@@ -112,6 +139,11 @@
 
 /* ./base/lib_beep.c */
 
+#undef beep_sp
+int	beep_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef beep
 int	beep(void)
 		{ return(*(int *)0); }
@@ -197,14 +229,32 @@
 int	_nc_COLORS(void)
 		{ return(*(int *)0); }
 
+#undef _nc_reset_colors_sp
+NCURSES_BOOL _nc_reset_colors_sp(
+		SCREEN	*sp)
+		{ return(*(NCURSES_BOOL *)0); }
+
 #undef _nc_reset_colors
 NCURSES_BOOL _nc_reset_colors(void)
 		{ return(*(NCURSES_BOOL *)0); }
 
+#undef start_color_sp
+int	start_color_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef start_color
 int	start_color(void)
 		{ return(*(int *)0); }
 
+#undef init_pair_sp
+int	init_pair_sp(
+		SCREEN	*sp, 
+		short	pair, 
+		short	f, 
+		short	b)
+		{ return(*(int *)0); }
+
 #undef init_pair
 int	init_pair(
 		short	pair, 
@@ -212,6 +262,15 @@
 		short	b)
 		{ return(*(int *)0); }
 
+#undef init_color_sp
+int	init_color_sp(
+		SCREEN	*sp, 
+		short	color, 
+		short	r, 
+		short	g, 
+		short	b)
+		{ return(*(int *)0); }
+
 #undef init_color
 int	init_color(
 		short	color, 
@@ -220,14 +279,33 @@
 		short	b)
 		{ return(*(int *)0); }
 
+#undef can_change_color_sp
+NCURSES_BOOL can_change_color_sp(
+		SCREEN	*sp)
+		{ return(*(NCURSES_BOOL *)0); }
+
 #undef can_change_color
 NCURSES_BOOL can_change_color(void)
 		{ return(*(NCURSES_BOOL *)0); }
 
+#undef has_colors_sp
+NCURSES_BOOL has_colors_sp(
+		SCREEN	*sp)
+		{ return(*(NCURSES_BOOL *)0); }
+
 #undef has_colors
 NCURSES_BOOL has_colors(void)
 		{ return(*(NCURSES_BOOL *)0); }
 
+#undef color_content_sp
+int	color_content_sp(
+		SCREEN	*sp, 
+		short	color, 
+		short	*r, 
+		short	*g, 
+		short	*b)
+		{ return(*(int *)0); }
+
 #undef color_content
 int	color_content(
 		short	color, 
@@ -236,6 +314,14 @@
 		short	*b)
 		{ return(*(int *)0); }
 
+#undef pair_content_sp
+int	pair_content_sp(
+		SCREEN	*sp, 
+		short	pair, 
+		short	*f, 
+		short	*b)
+		{ return(*(int *)0); }
+
 #undef pair_content
 int	pair_content(
 		short	pair, 
@@ -243,13 +329,21 @@
 		short	*b)
 		{ return(*(int *)0); }
 
+#undef _nc_do_color_sp
+void	_nc_do_color_sp(
+		SCREEN	*sp, 
+		short	old_pair, 
+		short	pair, 
+		NCURSES_BOOL reverse, 
+		NCURSES_OUTC_sp outc)
+		{ /* void */ }
+
 #undef _nc_do_color
 void	_nc_do_color(
 		short	old_pair, 
 		short	pair, 
 		NCURSES_BOOL reverse, 
-		int	(*outc)(
-		int	p1))
+		NCURSES_OUTC outc)
 		{ /* void */ }
 
 /* ./base/lib_colorset.c */
@@ -277,16 +371,31 @@
 
 /* ./base/lib_echo.c */
 
+#undef echo_sp
+int	echo_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef echo
 int	echo(void)
 		{ return(*(int *)0); }
 
+#undef noecho_sp
+int	noecho_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef noecho
 int	noecho(void)
 		{ return(*(int *)0); }
 
 /* ./base/lib_endwin.c */
 
+#undef endwin_sp
+int	endwin_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef endwin
 int	endwin(void)
 		{ return(*(int *)0); }
@@ -300,6 +409,11 @@
 
 /* ./base/lib_flash.c */
 
+#undef flash_sp
+int	flash_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef flash
 int	flash(void)
 		{ return(*(int *)0); }
@@ -1110,11 +1224,21 @@
 		const WINDOW *z)
 		{ return(*(NCURSES_BOOL *)0); }
 
+#undef is_pad
+NCURSES_BOOL is_pad(
+		const WINDOW *z)
+		{ return(*(NCURSES_BOOL *)0); }
+
 #undef is_scrollok
 NCURSES_BOOL is_scrollok(
 		const WINDOW *z)
 		{ return(*(NCURSES_BOOL *)0); }
 
+#undef is_subwin
+NCURSES_BOOL is_subwin(
+		const WINDOW *z)
+		{ return(*(NCURSES_BOOL *)0); }
+
 #undef is_syncok
 NCURSES_BOOL is_syncok(
 		const WINDOW *z)
@@ -1142,11 +1266,31 @@
 int	_nc_ESCDELAY(void)
 		{ return(*(int *)0); }
 
+#undef _nc_ptr_Escdelay
+int	*_nc_ptr_Escdelay(
+		SCREEN	*sp)
+		{ return(*(int **)0); }
+
+#undef set_escdelay_sp
+int	set_escdelay_sp(
+		SCREEN	*sp, 
+		int	value)
+		{ return(*(int *)0); }
+
 #undef set_escdelay
 int	set_escdelay(
 		int	value)
 		{ return(*(int *)0); }
 
+#undef get_escdelay_sp
+int	get_escdelay_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
+#undef get_escdelay
+int	get_escdelay(void)
+		{ return(*(int *)0); }
+
 #undef _nc_wgetch
 int	_nc_wgetch(
 		WINDOW	*win, 
@@ -1204,6 +1348,7 @@
 
 #undef _nc_insert_ch
 int	_nc_insert_ch(
+		SCREEN	*sp, 
 		WINDOW	*win, 
 		chtype	ch)
 		{ return(*(int *)0); }
@@ -1242,6 +1387,11 @@
 
 /* ./base/lib_isendwin.c */
 
+#undef isendwin_sp
+NCURSES_BOOL isendwin_sp(
+		SCREEN	*sp)
+		{ return(*(NCURSES_BOOL *)0); }
+
 #undef isendwin
 NCURSES_BOOL isendwin(void)
 		{ return(*(NCURSES_BOOL *)0); }
@@ -1256,16 +1406,35 @@
 
 /* ./base/lib_mouse.c */
 
+#undef getmouse_sp
+int	getmouse_sp(
+		SCREEN	*sp, 
+		MEVENT	*aevent)
+		{ return(*(int *)0); }
+
 #undef getmouse
 int	getmouse(
 		MEVENT	*aevent)
 		{ return(*(int *)0); }
 
+#undef ungetmouse_sp
+int	ungetmouse_sp(
+		SCREEN	*sp, 
+		MEVENT	*aevent)
+		{ return(*(int *)0); }
+
 #undef ungetmouse
 int	ungetmouse(
 		MEVENT	*aevent)
 		{ return(*(int *)0); }
 
+#undef mousemask_sp
+mmask_t	mousemask_sp(
+		SCREEN	*sp, 
+		mmask_t	newmask, 
+		mmask_t	*oldmask)
+		{ return(*(mmask_t *)0); }
+
 #undef mousemask
 mmask_t	mousemask(
 		mmask_t	newmask, 
@@ -1279,14 +1448,30 @@
 		int	x)
 		{ return(*(NCURSES_BOOL *)0); }
 
+#undef mouseinterval_sp
+int	mouseinterval_sp(
+		SCREEN	*sp, 
+		int	maxclick)
+		{ return(*(int *)0); }
+
 #undef mouseinterval
 int	mouseinterval(
 		int	maxclick)
 		{ return(*(int *)0); }
 
 #undef _nc_has_mouse
-int	_nc_has_mouse(void)
-		{ return(*(int *)0); }
+NCURSES_BOOL _nc_has_mouse(
+		SCREEN	*sp)
+		{ return(*(NCURSES_BOOL *)0); }
+
+#undef has_mouse_sp
+NCURSES_BOOL has_mouse_sp(
+		SCREEN	*sp)
+		{ return(*(NCURSES_BOOL *)0); }
+
+#undef has_mouse
+NCURSES_BOOL has_mouse(void)
+		{ return(*(NCURSES_BOOL *)0); }
 
 #undef wmouse_trafo
 NCURSES_BOOL wmouse_trafo(
@@ -1307,24 +1492,55 @@
 
 /* ./tty/lib_mvcur.c */
 
+#undef _nc_msec_cost_sp
+int	_nc_msec_cost_sp(
+		SCREEN	*sp, 
+		const char *const cap, 
+		int	affcnt)
+		{ return(*(int *)0); }
+
 #undef _nc_msec_cost
 int	_nc_msec_cost(
 		const char *const cap, 
 		int	affcnt)
 		{ return(*(int *)0); }
 
+#undef _nc_mvcur_resume_sp
+void	_nc_mvcur_resume_sp(
+		SCREEN	*sp)
+		{ /* void */ }
+
 #undef _nc_mvcur_resume
 void	_nc_mvcur_resume(void)
 		{ /* void */ }
 
+#undef _nc_mvcur_init_sp
+void	_nc_mvcur_init_sp(
+		SCREEN	*sp)
+		{ /* void */ }
+
 #undef _nc_mvcur_init
 void	_nc_mvcur_init(void)
 		{ /* void */ }
 
+#undef _nc_mvcur_wrap_sp
+void	_nc_mvcur_wrap_sp(
+		SCREEN	*sp)
+		{ /* void */ }
+
 #undef _nc_mvcur_wrap
 void	_nc_mvcur_wrap(void)
 		{ /* void */ }
 
+#undef mvcur_sp
+int	mvcur_sp(
+		SCREEN	*sp, 
+		int	yold, 
+		int	xold, 
+		int	ynew, 
+		int	xnew)
+		{ return(*(int *)0); }
+
 #undef mvcur
 int	mvcur(
 		int	yold, 
@@ -1347,14 +1563,32 @@
 
 /* ./base/lib_newterm.c */
 
+#undef filter_sp
+void	filter_sp(
+		SCREEN	*sp)
+		{ /* void */ }
+
 #undef filter
 void	filter(void)
 		{ /* void */ }
 
+#undef nofilter_sp
+void	nofilter_sp(
+		SCREEN	*sp)
+		{ /* void */ }
+
 #undef nofilter
 void	nofilter(void)
 		{ /* void */ }
 
+#undef newterm_sp
+SCREEN	*newterm_sp(
+		SCREEN	*sp, 
+		char	*name, 
+		FILE	*ofp, 
+		FILE	*ifp)
+		{ return(*(SCREEN **)0); }
+
 #undef newterm
 SCREEN	*newterm(
 		char	*name, 
@@ -1369,6 +1603,15 @@
 		WINDOW	*win)
 		{ return(*(int *)0); }
 
+#undef newwin_sp
+WINDOW	*newwin_sp(
+		SCREEN	*sp, 
+		int	num_lines, 
+		int	num_columns, 
+		int	begy, 
+		int	begx)
+		{ return(*(WINDOW **)0); }
+
 #undef newwin
 WINDOW	*newwin(
 		int	num_lines, 
@@ -1395,8 +1638,9 @@
 		int	x)
 		{ return(*(WINDOW **)0); }
 
-#undef _nc_makenew
-WINDOW	*_nc_makenew(
+#undef _nc_makenew_sp
+WINDOW	*_nc_makenew_sp(
+		SCREEN	*sp, 
 		int	num_lines, 
 		int	num_columns, 
 		int	begy, 
@@ -1404,17 +1648,37 @@
 		int	flags)
 		{ return(*(WINDOW **)0); }
 
-#undef _nc_screen_of
-SCREEN	*_nc_screen_of(
-		WINDOW	*win)
-		{ return(*(SCREEN **)0); }
+#undef _nc_curscr_of
+WINDOW	*_nc_curscr_of(
+		SCREEN	*sp)
+		{ return(*(WINDOW **)0); }
+
+#undef _nc_newscr_of
+WINDOW	*_nc_newscr_of(
+		SCREEN	*sp)
+		{ return(*(WINDOW **)0); }
+
+#undef _nc_stdscr_of
+WINDOW	*_nc_stdscr_of(
+		SCREEN	*sp)
+		{ return(*(WINDOW **)0); }
 
 /* ./base/lib_nl.c */
 
+#undef nl_sp
+int	nl_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef nl
 int	nl(void)
 		{ return(*(int *)0); }
 
+#undef nonl_sp
+int	nonl_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef nonl
 int	nonl(void)
 		{ return(*(int *)0); }
@@ -1448,6 +1712,13 @@
 
 /* ./base/lib_pad.c */
 
+#undef newpad_sp
+WINDOW	*newpad_sp(
+		SCREEN	*sp, 
+		int	l, 
+		int	c)
+		{ return(*(WINDOW **)0); }
+
 #undef newpad
 WINDOW	*newpad(
 		int	l, 
@@ -1553,6 +1824,14 @@
 
 /* ./base/lib_restart.c */
 
+#undef restartterm_sp
+int	restartterm_sp(
+		SCREEN	*sp, 
+		char	*termp, 
+		int	filenum, 
+		int	*errret)
+		{ return(*(int *)0); }
+
 #undef restartterm
 int	restartterm(
 		char	*termp, 
@@ -1601,6 +1880,12 @@
 
 /* ./base/lib_screen.c */
 
+#undef getwin_sp
+WINDOW	*getwin_sp(
+		SCREEN	*sp, 
+		FILE	*filep)
+		{ return(*(WINDOW **)0); }
+
 #undef getwin
 WINDOW	*getwin(
 		FILE	*filep)
@@ -1612,6 +1897,12 @@
 		FILE	*filep)
 		{ return(*(int *)0); }
 
+#undef scr_restore_sp
+int	scr_restore_sp(
+		SCREEN	*sp, 
+		const char *file)
+		{ return(*(int *)0); }
+
 #undef scr_restore
 int	scr_restore(
 		const char *file)
@@ -1622,11 +1913,23 @@
 		const char *file)
 		{ return(*(int *)0); }
 
+#undef scr_init_sp
+int	scr_init_sp(
+		SCREEN	*sp, 
+		const char *file)
+		{ return(*(int *)0); }
+
 #undef scr_init
 int	scr_init(
 		const char *file)
 		{ return(*(int *)0); }
 
+#undef scr_set_sp
+int	scr_set_sp(
+		SCREEN	*sp, 
+		const char *file)
+		{ return(*(int *)0); }
+
 #undef scr_set
 int	scr_set(
 		const char *file)
@@ -1678,6 +1981,16 @@
 		SCREEN	*sp)
 		{ /* void */ }
 
+#undef _nc_setupscreen_sp
+int	_nc_setupscreen_sp(
+		SCREEN	**spp, 
+		int	slines, 
+		int	scolumns, 
+		FILE	*output, 
+		NCURSES_BOOL filtered, 
+		int	slk_format)
+		{ return(*(int *)0); }
+
 #undef _nc_setupscreen
 int	_nc_setupscreen(
 		int	slines, 
@@ -1687,6 +2000,15 @@
 		int	slk_format)
 		{ return(*(int *)0); }
 
+#undef _nc_ripoffline_sp
+int	_nc_ripoffline_sp(
+		SCREEN	*sp, 
+		int	line, 
+		int	(*init)(
+		WINDOW	*p1, 
+		int	p2))
+		{ return(*(int *)0); }
+
 #undef _nc_ripoffline
 int	_nc_ripoffline(
 		int	line, 
@@ -1695,6 +2017,15 @@
 		int	p2))
 		{ return(*(int *)0); }
 
+#undef ripoffline_sp
+int	ripoffline_sp(
+		SCREEN	*sp, 
+		int	line, 
+		int	(*init)(
+		WINDOW	*p1, 
+		int	p2))
+		{ return(*(int *)0); }
+
 #undef ripoffline
 int	ripoffline(
 		int	line, 
@@ -1705,18 +2036,37 @@
 
 /* ./base/lib_slk.c */
 
+#undef _nc_format_slks
+int	_nc_format_slks(
+		SCREEN	*sp, 
+		int	cols)
+		{ return(*(int *)0); }
+
 #undef _nc_slk_initialize
 int	_nc_slk_initialize(
 		WINDOW	*stwin, 
 		int	cols)
 		{ return(*(int *)0); }
 
+#undef slk_restore_sp
+int	slk_restore_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef slk_restore
 int	slk_restore(void)
 		{ return(*(int *)0); }
 
 /* ./base/lib_slkatr_set.c */
 
+#undef slk_attr_set_sp
+int	slk_attr_set_sp(
+		SCREEN	*sp, 
+		const attr_t attr, 
+		short	color_pair_number, 
+		void	*opts)
+		{ return(*(int *)0); }
+
 #undef slk_attr_set
 int	slk_attr_set(
 		const attr_t attr, 
@@ -1726,6 +2076,12 @@
 
 /* ./base/lib_slkatrof.c */
 
+#undef slk_attroff_sp
+int	slk_attroff_sp(
+		SCREEN	*sp, 
+		const chtype attr)
+		{ return(*(int *)0); }
+
 #undef slk_attroff
 int	slk_attroff(
 		const chtype attr)
@@ -1733,6 +2089,12 @@
 
 /* ./base/lib_slkatron.c */
 
+#undef slk_attron_sp
+int	slk_attron_sp(
+		SCREEN	*sp, 
+		const chtype attr)
+		{ return(*(int *)0); }
+
 #undef slk_attron
 int	slk_attron(
 		const chtype attr)
@@ -1740,25 +2102,47 @@
 
 /* ./base/lib_slkatrset.c */
 
-#undef slk_attrset
+#undef slk_attrset_sp
+int	slk_attrset_sp(
+		SCREEN	*sp, 
+		const chtype attr)
+		{ return(*(int *)0); }
+
+#undef slk_attrset
 int	slk_attrset(
 		const chtype attr)
 		{ return(*(int *)0); }
 
 /* ./base/lib_slkattr.c */
 
+#undef slk_attr_sp
+attr_t	slk_attr_sp(
+		SCREEN	*sp)
+		{ return(*(attr_t *)0); }
+
 #undef slk_attr
 attr_t	slk_attr(void)
 		{ return(*(attr_t *)0); }
 
 /* ./base/lib_slkclear.c */
 
+#undef slk_clear_sp
+int	slk_clear_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef slk_clear
 int	slk_clear(void)
 		{ return(*(int *)0); }
 
 /* ./base/lib_slkcolor.c */
 
+#undef slk_color_sp
+int	slk_color_sp(
+		SCREEN	*sp, 
+		short	color_pair_number)
+		{ return(*(int *)0); }
+
 #undef slk_color
 int	slk_color(
 		short	color_pair_number)
@@ -1766,6 +2150,12 @@
 
 /* ./base/lib_slkinit.c */
 
+#undef slk_init_sp
+int	slk_init_sp(
+		SCREEN	*sp, 
+		int	format)
+		{ return(*(int *)0); }
+
 #undef slk_init
 int	slk_init(
 		int	format)
@@ -1773,6 +2163,12 @@
 
 /* ./base/lib_slklab.c */
 
+#undef slk_label_sp
+char	*slk_label_sp(
+		SCREEN	*sp, 
+		int	n)
+		{ return(*(char **)0); }
+
 #undef slk_label
 char	*slk_label(
 		int	n)
@@ -1780,16 +2176,34 @@
 
 /* ./base/lib_slkrefr.c */
 
+#undef slk_noutrefresh_sp
+int	slk_noutrefresh_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef slk_noutrefresh
 int	slk_noutrefresh(void)
 		{ return(*(int *)0); }
 
+#undef slk_refresh_sp
+int	slk_refresh_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef slk_refresh
 int	slk_refresh(void)
 		{ return(*(int *)0); }
 
 /* ./base/lib_slkset.c */
 
+#undef slk_set_sp
+int	slk_set_sp(
+		SCREEN	*sp, 
+		int	i, 
+		const char *astr, 
+		int	format)
+		{ return(*(int *)0); }
+
 #undef slk_set
 int	slk_set(
 		int	i, 
@@ -1799,6 +2213,11 @@
 
 /* ./base/lib_slktouch.c */
 
+#undef slk_touch_sp
+int	slk_touch_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef slk_touch
 int	slk_touch(void)
 		{ return(*(int *)0); }
@@ -1861,8 +2280,8 @@
 		SCREEN	*sp)
 		{ /* void */ }
 
-#undef _nc_ungetch
-int	_nc_ungetch(
+#undef ungetch_sp
+int	ungetch_sp(
 		SCREEN	*sp, 
 		int	ch)
 		{ return(*(int *)0); }
@@ -1874,11 +2293,23 @@
 
 /* ./tty/lib_vidattr.c */
 
+#undef vidputs_sp
+int	vidputs_sp(
+		SCREEN	*sp, 
+		chtype	newmode, 
+		NCURSES_OUTC_sp outc)
+		{ return(*(int *)0); }
+
 #undef vidputs
 int	vidputs(
 		chtype	newmode, 
-		int	(*outc)(
-		int	p1))
+		NCURSES_OUTC outc)
+		{ return(*(int *)0); }
+
+#undef vidattr_sp
+int	vidattr_sp(
+		SCREEN	*sp, 
+		chtype	newmode)
 		{ return(*(int *)0); }
 
 #undef vidattr
@@ -1886,6 +2317,11 @@
 		chtype	newmode)
 		{ return(*(int *)0); }
 
+#undef termattrs_sp
+chtype	termattrs_sp(
+		SCREEN	*sp)
+		{ return(*(chtype *)0); }
+
 #undef termattrs
 chtype	termattrs(void)
 		{ return(*(chtype *)0); }
@@ -1966,12 +2402,24 @@
 
 /* ./base/nc_panel.c */
 
+#undef _nc_panelhook_sp
+struct panelhook *_nc_panelhook_sp(
+		SCREEN	*sp)
+		{ return(*(struct panelhook **)0); }
+
 #undef _nc_panelhook
 struct panelhook *_nc_panelhook(void)
 		{ return(*(struct panelhook **)0); }
 
 /* ./base/safe_sprintf.c */
 
+#undef _nc_printf_string_sp
+char	*_nc_printf_string_sp(
+		SCREEN	*sp, 
+		const char *fmt, 
+		va_list	ap)
+		{ return(*(char **)0); }
+
 #undef _nc_printf_string
 char	*_nc_printf_string(
 		const char *fmt, 
@@ -1983,10 +2431,24 @@
 #include <sys/time.h>
 #include <sys/times.h>
 
+#undef doupdate_sp
+int	doupdate_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef doupdate
 int	doupdate(void)
 		{ return(*(int *)0); }
 
+#undef _nc_scrolln_sp
+int	_nc_scrolln_sp(
+		SCREEN	*sp, 
+		int	n, 
+		int	top, 
+		int	bot, 
+		int	maxy)
+		{ return(*(int *)0); }
+
 #undef _nc_scrolln
 int	_nc_scrolln(
 		int	n, 
@@ -1995,18 +2457,39 @@
 		int	maxy)
 		{ return(*(int *)0); }
 
+#undef _nc_screen_resume_sp
+void	_nc_screen_resume_sp(
+		SCREEN	*sp)
+		{ /* void */ }
+
 #undef _nc_screen_resume
 void	_nc_screen_resume(void)
 		{ /* void */ }
 
+#undef _nc_screen_init_sp
+void	_nc_screen_init_sp(
+		SCREEN	*sp)
+		{ /* void */ }
+
 #undef _nc_screen_init
 void	_nc_screen_init(void)
 		{ /* void */ }
 
+#undef _nc_screen_wrap_sp
+void	_nc_screen_wrap_sp(
+		SCREEN	*sp)
+		{ /* void */ }
+
 #undef _nc_screen_wrap
 void	_nc_screen_wrap(void)
 		{ /* void */ }
 
+#undef _nc_do_xmc_glitch_sp
+void	_nc_do_xmc_glitch_sp(
+		SCREEN	*sp, 
+		attr_t	previous)
+		{ /* void */ }
+
 #undef _nc_do_xmc_glitch
 void	_nc_do_xmc_glitch(
 		attr_t	previous)
@@ -2044,6 +2527,12 @@
 void	_nc_freeall(void)
 		{ /* void */ }
 
+#undef _nc_free_and_exit_sp
+void	_nc_free_and_exit_sp(
+		SCREEN	*sp, 
+		int	code)
+		{ /* void */ }
+
 #undef _nc_free_and_exit
 void	_nc_free_and_exit(
 		int	code)
@@ -2051,6 +2540,8 @@
 
 /* ./expanded.c */
 
+#include <term.h>
+
 #undef _nc_toggle_attr_on
 void	_nc_toggle_attr_on(
 		attr_t	*S, 
@@ -2063,6 +2554,24 @@
 		attr_t	at)
 		{ /* void */ }
 
+#undef _nc_DelCharCost_sp
+int	_nc_DelCharCost_sp(
+		SCREEN	*sp, 
+		int	count)
+		{ return(*(int *)0); }
+
+#undef _nc_InsCharCost_sp
+int	_nc_InsCharCost_sp(
+		SCREEN	*sp, 
+		int	count)
+		{ return(*(int *)0); }
+
+#undef _nc_UpdateAttrs_sp
+void	_nc_UpdateAttrs_sp(
+		SCREEN	*sp, 
+		chtype	c)
+		{ /* void */ }
+
 #undef _nc_DelCharCost
 int	_nc_DelCharCost(
 		int	count)
@@ -2080,6 +2589,12 @@
 
 /* ./base/legacy_coding.c */
 
+#undef use_legacy_coding_sp
+int	use_legacy_coding_sp(
+		SCREEN	*sp, 
+		int	level)
+		{ return(*(int *)0); }
+
 #undef use_legacy_coding
 int	use_legacy_coding(
 		int	level)
@@ -2087,10 +2602,22 @@
 
 /* ./base/lib_dft_fgbg.c */
 
+#undef use_default_colors_sp
+int	use_default_colors_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef use_default_colors
 int	use_default_colors(void)
 		{ return(*(int *)0); }
 
+#undef assume_default_colors_sp
+int	assume_default_colors_sp(
+		SCREEN	*sp, 
+		int	fg, 
+		int	bg)
+		{ return(*(int *)0); }
+
 #undef assume_default_colors
 int	assume_default_colors(
 		int	fg, 
@@ -2099,6 +2626,13 @@
 
 /* ./tinfo/lib_print.c */
 
+#undef mcprint_sp
+int	mcprint_sp(
+		SCREEN	*sp, 
+		char	*data, 
+		int	len)
+		{ return(*(int *)0); }
+
 #undef mcprint
 int	mcprint(
 		char	*data, 
@@ -2107,18 +2641,39 @@
 
 /* ./base/resizeterm.c */
 
+#undef is_term_resized_sp
+NCURSES_BOOL is_term_resized_sp(
+		SCREEN	*sp, 
+		int	ToLines, 
+		int	ToCols)
+		{ return(*(NCURSES_BOOL *)0); }
+
 #undef is_term_resized
 NCURSES_BOOL is_term_resized(
 		int	ToLines, 
 		int	ToCols)
 		{ return(*(NCURSES_BOOL *)0); }
 
+#undef resize_term_sp
+int	resize_term_sp(
+		SCREEN	*sp, 
+		int	ToLines, 
+		int	ToCols)
+		{ return(*(int *)0); }
+
 #undef resize_term
 int	resize_term(
 		int	ToLines, 
 		int	ToCols)
 		{ return(*(int *)0); }
 
+#undef resizeterm_sp
+int	resizeterm_sp(
+		SCREEN	*sp, 
+		int	ToLines, 
+		int	ToCols)
+		{ return(*(int *)0); }
+
 #undef resizeterm
 int	resizeterm(
 		int	ToLines, 
@@ -2241,6 +2796,30 @@
 char	*const *_nc_strcodes(void)
 		{ return(*(char **)0); }
 
+/* ./comp_captab.c */
+
+#include <hashsize.h>
+
+#undef _nc_get_table
+const struct name_table_entry *_nc_get_table(
+		NCURSES_BOOL termcap)
+		{ return(*(const struct name_table_entry **)0); }
+
+#undef _nc_get_hash_table
+const HashValue *_nc_get_hash_table(
+		NCURSES_BOOL termcap)
+		{ return(*(const HashValue **)0); }
+
+#undef _nc_get_alias_table
+const struct alias *_nc_get_alias_table(
+		NCURSES_BOOL termcap)
+		{ return(*(const struct alias **)0); }
+
+#undef _nc_get_hash_info
+const HashData *_nc_get_hash_info(
+		NCURSES_BOOL termcap)
+		{ return(*(const HashData **)0); }
+
 /* ./tinfo/comp_error.c */
 
 #undef _nc_suppress_warnings
@@ -2287,6 +2866,21 @@
 		...)
 		{ /* void */ }
 
+/* ./tinfo/comp_hash.c */
+
+#undef _nc_find_entry
+struct name_table_entry const *_nc_find_entry(
+		const char *string, 
+		const HashValue *hash_table)
+		{ return(*(struct name_table_entry const **)0); }
+
+#undef _nc_find_type_entry
+struct name_table_entry const *_nc_find_type_entry(
+		const char *string, 
+		int	type, 
+		NCURSES_BOOL termcap)
+		{ return(*(struct name_table_entry const **)0); }
+
 /* ./tinfo/db_iterator.c */
 
 #undef _nc_tic_dir
@@ -2408,6 +3002,11 @@
 chtype	*_nc_acs_map(void)
 		{ return(*(chtype **)0); }
 
+#undef _nc_init_acs_sp
+void	_nc_init_acs_sp(
+		SCREEN	*sp)
+		{ /* void */ }
+
 #undef _nc_init_acs
 void	_nc_init_acs(void)
 		{ /* void */ }
@@ -2431,21 +3030,47 @@
 		int	BaudRate)
 		{ return(*(int *)0); }
 
+#undef baudrate_sp
+int	baudrate_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef baudrate
 int	baudrate(void)
 		{ return(*(int *)0); }
 
 /* ./tinfo/lib_cur_term.c */
 
+#undef _nc_get_cur_term_sp
+TERMINAL *_nc_get_cur_term_sp(
+		SCREEN	*sp)
+		{ return(*(TERMINAL **)0); }
+
+#undef _nc_get_cur_term
+TERMINAL *_nc_get_cur_term(void)
+		{ return(*(TERMINAL **)0); }
+
 #undef _nc_cur_term
 TERMINAL *_nc_cur_term(void)
 		{ return(*(TERMINAL **)0); }
 
+#undef set_curterm_sp
+TERMINAL *set_curterm_sp(
+		SCREEN	*sp, 
+		TERMINAL *termp)
+		{ return(*(TERMINAL **)0); }
+
 #undef set_curterm
 TERMINAL *set_curterm(
 		TERMINAL *termp)
 		{ return(*(TERMINAL **)0); }
 
+#undef del_curterm_sp
+int	del_curterm_sp(
+		SCREEN	*sp, 
+		TERMINAL *termp)
+		{ return(*(int *)0); }
+
 #undef del_curterm
 int	del_curterm(
 		TERMINAL *termp)
@@ -2474,6 +3099,11 @@
 #undef _nc_prescreen
 NCURSES_PRESCREEN _nc_prescreen;
 
+#undef _nc_screen_of
+SCREEN	*_nc_screen_of(
+		WINDOW	*win)
+		{ return(*(SCREEN **)0); }
+
 #undef _nc_init_pthreads
 void	_nc_init_pthreads(void)
 		{ /* void */ }
@@ -2500,24 +3130,49 @@
 
 /* ./tinfo/lib_has_cap.c */
 
+#undef has_ic_sp
+NCURSES_BOOL has_ic_sp(
+		SCREEN	*sp)
+		{ return(*(NCURSES_BOOL *)0); }
+
 #undef has_ic
 NCURSES_BOOL has_ic(void)
 		{ return(*(NCURSES_BOOL *)0); }
 
+#undef has_il_sp
+NCURSES_BOOL has_il_sp(
+		SCREEN	*sp)
+		{ return(*(NCURSES_BOOL *)0); }
+
 #undef has_il
 NCURSES_BOOL has_il(void)
 		{ return(*(NCURSES_BOOL *)0); }
 
 /* ./tinfo/lib_kernel.c */
 
+#undef erasechar_sp
+char	erasechar_sp(
+		SCREEN	*sp)
+		{ return(*(char *)0); }
+
 #undef erasechar
 char	erasechar(void)
 		{ return(*(char *)0); }
 
+#undef killchar_sp
+char	killchar_sp(
+		SCREEN	*sp)
+		{ return(*(char *)0); }
+
 #undef killchar
 char	killchar(void)
 		{ return(*(char *)0); }
 
+#undef flushinp_sp
+int	flushinp_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef flushinp
 int	flushinp(void)
 		{ return(*(int *)0); }
@@ -2526,8 +3181,8 @@
 
 struct kn { short offset; int code; };
 
-#undef _nc_keyname
-char	*_nc_keyname(
+#undef keyname_sp
+char	*keyname_sp(
 		SCREEN	*sp, 
 		int	c)
 		{ return(*(char **)0); }
@@ -2539,12 +3194,23 @@
 
 /* ./tinfo/lib_longname.c */
 
+#undef longname_sp
+char	*longname_sp(
+		SCREEN	*sp)
+		{ return(*(char **)0); }
+
 #undef longname
 char	*longname(void)
 		{ return(*(char **)0); }
 
 /* ./tinfo/lib_napms.c */
 
+#undef napms_sp
+int	napms_sp(
+		SCREEN	*sp, 
+		int	ms)
+		{ return(*(int *)0); }
+
 #undef napms
 int	napms(
 		int	ms)
@@ -2564,6 +3230,12 @@
 		NCURSES_BOOL flag)
 		{ /* void */ }
 
+#undef halfdelay_sp
+int	halfdelay_sp(
+		SCREEN	*sp, 
+		int	t)
+		{ return(*(int *)0); }
+
 #undef halfdelay
 int	halfdelay(
 		int	t)
@@ -2599,21 +3271,46 @@
 		NCURSES_BOOL flag)
 		{ return(*(int *)0); }
 
+#undef curs_set_sp
+int	curs_set_sp(
+		SCREEN	*sp, 
+		int	vis)
+		{ return(*(int *)0); }
+
 #undef curs_set
 int	curs_set(
 		int	vis)
 		{ return(*(int *)0); }
 
+#undef typeahead_sp
+int	typeahead_sp(
+		SCREEN	*sp, 
+		int	fd)
+		{ return(*(int *)0); }
+
 #undef typeahead
 int	typeahead(
 		int	fd)
 		{ return(*(int *)0); }
 
+#undef has_key_sp
+int	has_key_sp(
+		SCREEN	*sp, 
+		int	keycode)
+		{ return(*(int *)0); }
+
 #undef has_key
 int	has_key(
 		int	keycode)
 		{ return(*(int *)0); }
 
+#undef _nc_putp_flush_sp
+int	_nc_putp_flush_sp(
+		SCREEN	*sp, 
+		const char *name, 
+		const char *value)
+		{ return(*(int *)0); }
+
 #undef _nc_keypad
 int	_nc_keypad(
 		SCREEN	*sp, 
@@ -2622,30 +3319,67 @@
 
 /* ./tinfo/lib_raw.c */
 
+#undef raw_sp
+int	raw_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef raw
 int	raw(void)
 		{ return(*(int *)0); }
 
+#undef cbreak_sp
+int	cbreak_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef cbreak
 int	cbreak(void)
 		{ return(*(int *)0); }
 
+#undef qiflush_sp
+void	qiflush_sp(
+		SCREEN	*sp)
+		{ /* void */ }
+
 #undef qiflush
 void	qiflush(void)
 		{ /* void */ }
 
+#undef noraw_sp
+int	noraw_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef noraw
 int	noraw(void)
 		{ return(*(int *)0); }
 
+#undef nocbreak_sp
+int	nocbreak_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef nocbreak
 int	nocbreak(void)
 		{ return(*(int *)0); }
 
+#undef noqiflush_sp
+void	noqiflush_sp(
+		SCREEN	*sp)
+		{ /* void */ }
+
 #undef noqiflush
 void	noqiflush(void)
 		{ /* void */ }
 
+#undef intrflush_sp
+int	intrflush_sp(
+		SCREEN	*sp, 
+		WINDOW	*win, 
+		NCURSES_BOOL flag)
+		{ return(*(int *)0); }
+
 #undef intrflush
 int	intrflush(
 		WINDOW	*win, 
@@ -2663,7 +3397,8 @@
 		{ return(*(char **)0); }
 
 #undef _nc_ptr_Lines
-int	*_nc_ptr_Lines(void)
+int	*_nc_ptr_Lines(
+		SCREEN	*sp)
 		{ return(*(int **)0); }
 
 #undef _nc_LINES
@@ -2671,17 +3406,29 @@
 		{ return(*(int *)0); }
 
 #undef _nc_ptr_Cols
-int	*_nc_ptr_Cols(void)
+int	*_nc_ptr_Cols(
+		SCREEN	*sp)
 		{ return(*(int **)0); }
 
 #undef _nc_COLS
 int	_nc_COLS(void)
 		{ return(*(int *)0); }
 
+#undef _nc_ptr_Tabsize
+int	*_nc_ptr_Tabsize(
+		SCREEN	*sp)
+		{ return(*(int **)0); }
+
 #undef _nc_TABSIZE
 int	_nc_TABSIZE(void)
 		{ return(*(int *)0); }
 
+#undef set_tabsize_sp
+int	set_tabsize_sp(
+		SCREEN	*sp, 
+		int	value)
+		{ return(*(int *)0); }
+
 #undef set_tabsize
 int	set_tabsize(
 		int	value)
@@ -2692,6 +3439,12 @@
 		SCREEN	*sp)
 		{ return(*(int *)0); }
 
+#undef use_env_sp
+void	use_env_sp(
+		SCREEN	*sp, 
+		NCURSES_BOOL f)
+		{ /* void */ }
+
 #undef use_env
 void	use_env(
 		NCURSES_BOOL f)
@@ -2709,6 +3462,12 @@
 		SCREEN	*sp)
 		{ /* void */ }
 
+#undef _nc_tinfo_cmdch
+void	_nc_tinfo_cmdch(
+		TERMINAL *termp, 
+		char	proto)
+		{ /* void */ }
+
 #undef _nc_get_locale
 char	*_nc_get_locale(void)
 		{ return(*(char **)0); }
@@ -2730,6 +3489,10 @@
 		NCURSES_BOOL reuse)
 		{ return(*(int *)0); }
 
+#undef new_prescr
+SCREEN	*new_prescr(void)
+		{ return(*(SCREEN **)0); }
+
 #undef setupterm
 int	setupterm(
 		char	*tname, 
@@ -2744,8 +3507,9 @@
 #undef BC
 char	*BC;
 
-#undef tgetent
-int	tgetent(
+#undef tgetent_sp
+int	tgetent_sp(
+		SCREEN	*sp, 
 		char	*bufp, 
 		const char *name)
 		{ return(*(int *)0); }
@@ -2756,16 +3520,41 @@
 
 #endif
 
+#undef tgetent
+int	tgetent(
+		char	*bufp, 
+		const char *name)
+		{ return(*(int *)0); }
+
+#undef tgetflag_sp
+int	tgetflag_sp(
+		SCREEN	*sp, 
+		char	*id)
+		{ return(*(int *)0); }
+
 #undef tgetflag
 int	tgetflag(
 		char	*id)
 		{ return(*(int *)0); }
 
+#undef tgetnum_sp
+int	tgetnum_sp(
+		SCREEN	*sp, 
+		char	*id)
+		{ return(*(int *)0); }
+
 #undef tgetnum
 int	tgetnum(
 		char	*id)
 		{ return(*(int *)0); }
 
+#undef tgetstr_sp
+char	*tgetstr_sp(
+		SCREEN	*sp, 
+		char	*id, 
+		char	**area)
+		{ return(*(char **)0); }
+
 #undef tgetstr
 char	*tgetstr(
 		char	*id, 
@@ -2774,6 +3563,11 @@
 
 /* ./tinfo/lib_termname.c */
 
+#undef termname_sp
+char	*termname_sp(
+		SCREEN	*sp)
+		{ return(*(char **)0); }
+
 #undef termname
 char	*termname(void)
 		{ return(*(char **)0); }
@@ -2789,16 +3583,34 @@
 
 /* ./tinfo/lib_ti.c */
 
+#undef tigetflag_sp
+int	tigetflag_sp(
+		SCREEN	*sp, 
+		char	*str)
+		{ return(*(int *)0); }
+
 #undef tigetflag
 int	tigetflag(
 		char	*str)
 		{ return(*(int *)0); }
 
+#undef tigetnum_sp
+int	tigetnum_sp(
+		SCREEN	*sp, 
+		char	*str)
+		{ return(*(int *)0); }
+
 #undef tigetnum
 int	tigetnum(
 		char	*str)
 		{ return(*(int *)0); }
 
+#undef tigetstr_sp
+char	*tigetstr_sp(
+		SCREEN	*sp, 
+		char	*str)
+		{ return(*(char **)0); }
+
 #undef tigetstr
 char	*tigetstr(
 		char	*str)
@@ -2822,6 +3634,12 @@
 		...)
 		{ return(*(char **)0); }
 
+#undef tiparm
+char	*tiparm(
+		const char *string, 
+		...)
+		{ return(*(char **)0); }
+
 /* ./tinfo/lib_tputs.c */
 
 #undef PC
@@ -2836,25 +3654,75 @@
 		SCREEN	*sp)
 		{ /* void */ }
 
+#undef delay_output_sp
+int	delay_output_sp(
+		SCREEN	*sp, 
+		int	ms)
+		{ return(*(int *)0); }
+
 #undef delay_output
 int	delay_output(
 		int	ms)
 		{ return(*(int *)0); }
 
+#undef _nc_flush_sp
+void	_nc_flush_sp(
+		SCREEN	*sp)
+		{ /* void */ }
+
 #undef _nc_flush
 void	_nc_flush(void)
 		{ /* void */ }
 
+#undef _nc_outch_sp
+int	_nc_outch_sp(
+		SCREEN	*sp, 
+		int	ch)
+		{ return(*(int *)0); }
+
 #undef _nc_outch
 int	_nc_outch(
 		int	ch)
 		{ return(*(int *)0); }
 
+#undef putp_sp
+int	putp_sp(
+		SCREEN	*sp, 
+		const char *string)
+		{ return(*(int *)0); }
+
+#undef _nc_putp_sp
+int	_nc_putp_sp(
+		SCREEN	*sp, 
+		const char *name, 
+		const char *string)
+		{ return(*(int *)0); }
+
 #undef putp
 int	putp(
 		const char *string)
 		{ return(*(int *)0); }
 
+#undef _nc_putp
+int	_nc_putp(
+		const char *name, 
+		const char *string)
+		{ return(*(int *)0); }
+
+#undef tputs_sp
+int	tputs_sp(
+		SCREEN	*sp, 
+		const char *string, 
+		int	affcnt, 
+		NCURSES_OUTC_sp outc)
+		{ return(*(int *)0); }
+
+#undef _nc_outc_wrapper
+int	_nc_outc_wrapper(
+		SCREEN	*sp, 
+		int	c)
+		{ return(*(int *)0); }
+
 #undef tputs
 int	tputs(
 		const char *string, 
@@ -3024,36 +3892,78 @@
 
 /* ./tinfo/lib_ttyflags.c */
 
+#undef _nc_get_tty_mode_sp
+int	_nc_get_tty_mode_sp(
+		SCREEN	*sp, 
+		struct termios *buf)
+		{ return(*(int *)0); }
+
 #undef _nc_get_tty_mode
 int	_nc_get_tty_mode(
 		struct termios *buf)
 		{ return(*(int *)0); }
 
+#undef _nc_set_tty_mode_sp
+int	_nc_set_tty_mode_sp(
+		SCREEN	*sp, 
+		struct termios *buf)
+		{ return(*(int *)0); }
+
 #undef _nc_set_tty_mode
 int	_nc_set_tty_mode(
 		struct termios *buf)
 		{ return(*(int *)0); }
 
+#undef def_shell_mode_sp
+int	def_shell_mode_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef def_shell_mode
 int	def_shell_mode(void)
 		{ return(*(int *)0); }
 
+#undef def_prog_mode_sp
+int	def_prog_mode_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef def_prog_mode
 int	def_prog_mode(void)
 		{ return(*(int *)0); }
 
+#undef reset_prog_mode_sp
+int	reset_prog_mode_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef reset_prog_mode
 int	reset_prog_mode(void)
 		{ return(*(int *)0); }
 
+#undef reset_shell_mode_sp
+int	reset_shell_mode_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef reset_shell_mode
 int	reset_shell_mode(void)
 		{ return(*(int *)0); }
 
+#undef savetty_sp
+int	savetty_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef savetty
 int	savetty(void)
 		{ return(*(int *)0); }
 
+#undef resetty_sp
+int	resetty_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef resetty
 int	resetty(void)
 		{ return(*(int *)0); }
@@ -3144,6 +4054,13 @@
 
 /* ./tinfo/setbuf.c */
 
+#undef _nc_set_buffer_sp
+void	_nc_set_buffer_sp(
+		SCREEN	*sp, 
+		FILE	*ofp, 
+		NCURSES_BOOL buffered)
+		{ /* void */ }
+
 #undef _nc_set_buffer
 void	_nc_set_buffer(
 		FILE	*ofp, 
@@ -3235,8 +4152,8 @@
 
 /* ./unctrl.c */
 
-#undef _nc_unctrl
-char	*_nc_unctrl(
+#undef unctrl_sp
+char	*unctrl_sp(
 		SCREEN	*sp, 
 		chtype	ch)
 		{ return(*(char **)0); }
@@ -3323,25 +4240,6 @@
 		int const parameterized)
 		{ return(*(char **)0); }
 
-/* ./comp_captab.c */
-
-#include <hashsize.h>
-
-#undef _nc_get_table
-const struct name_table_entry *_nc_get_table(
-		NCURSES_BOOL termcap)
-		{ return(*(const struct name_table_entry **)0); }
-
-#undef _nc_get_hash_table
-const short *_nc_get_hash_table(
-		NCURSES_BOOL termcap)
-		{ return(*(const short **)0); }
-
-#undef _nc_get_alias_table
-const struct alias *_nc_get_alias_table(
-		NCURSES_BOOL termcap)
-		{ return(*(const struct alias **)0); }
-
 /* ./tinfo/comp_expand.c */
 
 #undef _nc_tic_expand
@@ -3351,21 +4249,6 @@
 		int	numbers)
 		{ return(*(char **)0); }
 
-/* ./tinfo/comp_hash.c */
-
-#undef _nc_find_entry
-struct name_table_entry const *_nc_find_entry(
-		const char *string, 
-		const short *hash_table)
-		{ return(*(struct name_table_entry const **)0); }
-
-#undef _nc_find_type_entry
-struct name_table_entry const *_nc_find_type_entry(
-		const char *string, 
-		int	type, 
-		const struct name_table_entry *table)
-		{ return(*(struct name_table_entry const **)0); }
-
 /* ./tinfo/comp_parse.c */
 
 #undef _nc_check_termtype2
@@ -3485,6 +4368,13 @@
 
 /* ./base/define_key.c */
 
+#undef define_key_sp
+int	define_key_sp(
+		SCREEN	*sp, 
+		const char *str, 
+		int	keycode)
+		{ return(*(int *)0); }
+
 #undef define_key
 int	define_key(
 		const char *str, 
@@ -3499,6 +4389,12 @@
 
 /* ./base/key_defined.c */
 
+#undef key_defined_sp
+int	key_defined_sp(
+		SCREEN	*sp, 
+		const char *str)
+		{ return(*(int *)0); }
+
 #undef key_defined
 int	key_defined(
 		const char *str)
@@ -3506,6 +4402,13 @@
 
 /* ./base/keybound.c */
 
+#undef keybound_sp
+char	*keybound_sp(
+		SCREEN	*sp, 
+		int	code, 
+		int	count)
+		{ return(*(char **)0); }
+
 #undef keybound
 char	*keybound(
 		int	code, 
@@ -3514,6 +4417,13 @@
 
 /* ./base/keyok.c */
 
+#undef keyok_sp
+int	keyok_sp(
+		SCREEN	*sp, 
+		int	c, 
+		NCURSES_BOOL flag)
+		{ return(*(int *)0); }
+
 #undef keyok
 int	keyok(
 		int	c, 
diff -Naur ncurses-5.7.orig/ncurses/llib-lncursestw ncurses-5.7/ncurses/llib-lncursestw
--- ncurses-5.7.orig/ncurses/llib-lncursestw	1969-12-31 19:00:00.000000000 -0500
+++ ncurses-5.7/ncurses/llib-lncursestw	2011-01-08 18:13:50.707156964 -0500
@@ -0,0 +1,5255 @@
+/****************************************************************************
+ * Copyright (c) 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            *
+ * "Software"), to deal in the Software without restriction, including      *
+ * without limitation the rights to use, copy, modify, merge, publish,      *
+ * distribute, distribute with modifications, sublicense, and/or sell       *
+ * copies of the Software, and to permit persons to whom the Software is    *
+ * furnished to do so, subject to the following conditions:                 *
+ *                                                                          *
+ * The above copyright notice and this permission notice shall be included  *
+ * in all copies or substantial portions of the Software.                   *
+ *                                                                          *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
+ *                                                                          *
+ * Except as contained in this notice, the name(s) of the above copyright   *
+ * holders shall not be used in advertising or otherwise to promote the     *
+ * sale, use or other dealings in this Software without prior written       *
+ * authorization.                                                           *
+ ****************************************************************************/
+
+/****************************************************************************
+ *  Author: Thomas E. Dickey 2009,2010                                      *
+ ****************************************************************************/
+/* LINTLIBRARY */
+
+/* ./tty/hardscroll.c */
+
+#include <curses.priv.h>
+
+#undef _nc_oldnums
+int	*_nc_oldnums;
+
+#undef _nc_scroll_optimize_sp
+void	_nc_scroll_optimize_sp(
+		SCREEN	*sp)
+		{ /* void */ }
+
+#undef _nc_scroll_optimize
+void	_nc_scroll_optimize(void)
+		{ /* void */ }
+
+#undef _nc_linedump_sp
+void	_nc_linedump_sp(
+		SCREEN	*sp)
+		{ /* void */ }
+
+#undef _nc_linedump
+void	_nc_linedump(void)
+		{ /* void */ }
+
+/* ./tty/hashmap.c */
+
+#undef _nc_hash_map_sp
+void	_nc_hash_map_sp(
+		SCREEN	*sp)
+		{ /* void */ }
+
+#undef _nc_hash_map
+void	_nc_hash_map(void)
+		{ /* void */ }
+
+#undef _nc_make_oldhash_sp
+void	_nc_make_oldhash_sp(
+		SCREEN	*sp, 
+		int	i)
+		{ /* void */ }
+
+#undef _nc_make_oldhash
+void	_nc_make_oldhash(
+		int	i)
+		{ /* void */ }
+
+#undef _nc_scroll_oldhash_sp
+void	_nc_scroll_oldhash_sp(
+		SCREEN	*sp, 
+		int	n, 
+		int	top, 
+		int	bot)
+		{ /* void */ }
+
+#undef _nc_scroll_oldhash
+void	_nc_scroll_oldhash(
+		int	n, 
+		int	top, 
+		int	bot)
+		{ /* void */ }
+
+/* ./base/lib_addch.c */
+
+#include <ctype.h>
+
+#undef _nc_render
+cchar_t	_nc_render(
+		WINDOW	*win, 
+		cchar_t	ch)
+		{ return(*(cchar_t *)0); }
+
+#undef _nc_build_wch
+int	_nc_build_wch(
+		WINDOW	*win, 
+		cchar_t	*ch)
+		{ return(*(int *)0); }
+
+#undef _nc_waddch_nosync
+int	_nc_waddch_nosync(
+		WINDOW	*win, 
+		const cchar_t c)
+		{ return(*(int *)0); }
+
+#undef waddch
+int	waddch(
+		WINDOW	*win, 
+		const chtype ch)
+		{ return(*(int *)0); }
+
+#undef wechochar
+int	wechochar(
+		WINDOW	*win, 
+		const chtype ch)
+		{ return(*(int *)0); }
+
+/* ./base/lib_addstr.c */
+
+#undef waddnstr
+int	waddnstr(
+		WINDOW	*win, 
+		const char *astr, 
+		int	n)
+		{ return(*(int *)0); }
+
+#undef waddchnstr
+int	waddchnstr(
+		WINDOW	*win, 
+		const chtype *astr, 
+		int	n)
+		{ return(*(int *)0); }
+
+#undef _nc_wchstrlen
+int	_nc_wchstrlen(
+		const cchar_t *s)
+		{ return(*(int *)0); }
+
+#undef wadd_wchnstr
+int	wadd_wchnstr(
+		WINDOW	*win, 
+		const cchar_t *astr, 
+		int	n)
+		{ return(*(int *)0); }
+
+#undef waddnwstr
+int	waddnwstr(
+		WINDOW	*win, 
+		const wchar_t *str, 
+		int	n)
+		{ return(*(int *)0); }
+
+/* ./base/lib_beep.c */
+
+#undef beep_sp
+int	beep_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
+#undef beep
+int	beep(void)
+		{ return(*(int *)0); }
+
+/* ./base/lib_bkgd.c */
+
+#undef wbkgrndset
+void	wbkgrndset(
+		WINDOW	*win, 
+		const cchar_t *ch)
+		{ /* void */ }
+
+#undef wbkgdset
+void	wbkgdset(
+		WINDOW	*win, 
+		chtype	ch)
+		{ /* void */ }
+
+#undef wbkgrnd
+int	wbkgrnd(
+		WINDOW	*win, 
+		const cchar_t *ch)
+		{ return(*(int *)0); }
+
+#undef wbkgd
+int	wbkgd(
+		WINDOW	*win, 
+		chtype	ch)
+		{ return(*(int *)0); }
+
+/* ./base/lib_box.c */
+
+#undef wborder
+int	wborder(
+		WINDOW	*win, 
+		chtype	ls, 
+		chtype	rs, 
+		chtype	ts, 
+		chtype	bs, 
+		chtype	tl, 
+		chtype	tr, 
+		chtype	bl, 
+		chtype	br)
+		{ return(*(int *)0); }
+
+/* ./base/lib_chgat.c */
+
+#undef wchgat
+int	wchgat(
+		WINDOW	*win, 
+		int	n, 
+		attr_t	attr, 
+		short	color, 
+		const void *opts)
+		{ return(*(int *)0); }
+
+/* ./base/lib_clear.c */
+
+#undef wclear
+int	wclear(
+		WINDOW	*win)
+		{ return(*(int *)0); }
+
+/* ./base/lib_clearok.c */
+
+#undef clearok
+int	clearok(
+		WINDOW	*win, 
+		NCURSES_BOOL flag)
+		{ return(*(int *)0); }
+
+/* ./base/lib_clrbot.c */
+
+#undef wclrtobot
+int	wclrtobot(
+		WINDOW	*win)
+		{ return(*(int *)0); }
+
+/* ./base/lib_clreol.c */
+
+#undef wclrtoeol
+int	wclrtoeol(
+		WINDOW	*win)
+		{ return(*(int *)0); }
+
+/* ./base/lib_color.c */
+
+#include <tic.h>
+
+#undef _nc_COLOR_PAIRS
+int	_nc_COLOR_PAIRS(void)
+		{ return(*(int *)0); }
+
+#undef _nc_COLORS
+int	_nc_COLORS(void)
+		{ return(*(int *)0); }
+
+#undef _nc_reset_colors_sp
+NCURSES_BOOL _nc_reset_colors_sp(
+		SCREEN	*sp)
+		{ return(*(NCURSES_BOOL *)0); }
+
+#undef _nc_reset_colors
+NCURSES_BOOL _nc_reset_colors(void)
+		{ return(*(NCURSES_BOOL *)0); }
+
+#undef start_color_sp
+int	start_color_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
+#undef start_color
+int	start_color(void)
+		{ return(*(int *)0); }
+
+#undef init_pair_sp
+int	init_pair_sp(
+		SCREEN	*sp, 
+		short	pair, 
+		short	f, 
+		short	b)
+		{ return(*(int *)0); }
+
+#undef init_pair
+int	init_pair(
+		short	pair, 
+		short	f, 
+		short	b)
+		{ return(*(int *)0); }
+
+#undef init_color_sp
+int	init_color_sp(
+		SCREEN	*sp, 
+		short	color, 
+		short	r, 
+		short	g, 
+		short	b)
+		{ return(*(int *)0); }
+
+#undef init_color
+int	init_color(
+		short	color, 
+		short	r, 
+		short	g, 
+		short	b)
+		{ return(*(int *)0); }
+
+#undef can_change_color_sp
+NCURSES_BOOL can_change_color_sp(
+		SCREEN	*sp)
+		{ return(*(NCURSES_BOOL *)0); }
+
+#undef can_change_color
+NCURSES_BOOL can_change_color(void)
+		{ return(*(NCURSES_BOOL *)0); }
+
+#undef has_colors_sp
+NCURSES_BOOL has_colors_sp(
+		SCREEN	*sp)
+		{ return(*(NCURSES_BOOL *)0); }
+
+#undef has_colors
+NCURSES_BOOL has_colors(void)
+		{ return(*(NCURSES_BOOL *)0); }
+
+#undef color_content_sp
+int	color_content_sp(
+		SCREEN	*sp, 
+		short	color, 
+		short	*r, 
+		short	*g, 
+		short	*b)
+		{ return(*(int *)0); }
+
+#undef color_content
+int	color_content(
+		short	color, 
+		short	*r, 
+		short	*g, 
+		short	*b)
+		{ return(*(int *)0); }
+
+#undef pair_content_sp
+int	pair_content_sp(
+		SCREEN	*sp, 
+		short	pair, 
+		short	*f, 
+		short	*b)
+		{ return(*(int *)0); }
+
+#undef pair_content
+int	pair_content(
+		short	pair, 
+		short	*f, 
+		short	*b)
+		{ return(*(int *)0); }
+
+#undef _nc_do_color_sp
+void	_nc_do_color_sp(
+		SCREEN	*sp, 
+		short	old_pair, 
+		short	pair, 
+		NCURSES_BOOL reverse, 
+		NCURSES_OUTC_sp outc)
+		{ /* void */ }
+
+#undef _nc_do_color
+void	_nc_do_color(
+		short	old_pair, 
+		short	pair, 
+		NCURSES_BOOL reverse, 
+		NCURSES_OUTC outc)
+		{ /* void */ }
+
+/* ./base/lib_colorset.c */
+
+#undef wcolor_set
+int	wcolor_set(
+		WINDOW	*win, 
+		short	color_pair_number, 
+		void	*opts)
+		{ return(*(int *)0); }
+
+/* ./base/lib_delch.c */
+
+#undef wdelch
+int	wdelch(
+		WINDOW	*win)
+		{ return(*(int *)0); }
+
+/* ./base/lib_delwin.c */
+
+#undef delwin
+int	delwin(
+		WINDOW	*win)
+		{ return(*(int *)0); }
+
+/* ./base/lib_echo.c */
+
+#undef echo_sp
+int	echo_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
+#undef echo
+int	echo(void)
+		{ return(*(int *)0); }
+
+#undef noecho_sp
+int	noecho_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
+#undef noecho
+int	noecho(void)
+		{ return(*(int *)0); }
+
+/* ./base/lib_endwin.c */
+
+#undef endwin_sp
+int	endwin_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
+#undef endwin
+int	endwin(void)
+		{ return(*(int *)0); }
+
+/* ./base/lib_erase.c */
+
+#undef werase
+int	werase(
+		WINDOW	*win)
+		{ return(*(int *)0); }
+
+/* ./base/lib_flash.c */
+
+#undef flash_sp
+int	flash_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
+#undef flash
+int	flash(void)
+		{ return(*(int *)0); }
+
+/* ./lib_gen.c */
+
+#undef addch
+int	addch(
+		const chtype z)
+		{ return(*(int *)0); }
+
+#undef addchnstr
+int	addchnstr(
+		const chtype *a1, 
+		int	z)
+		{ return(*(int *)0); }
+
+#undef addchstr
+int	addchstr(
+		const chtype *z)
+		{ return(*(int *)0); }
+
+#undef addnstr
+int	addnstr(
+		const char *a1, 
+		int	z)
+		{ return(*(int *)0); }
+
+#undef addstr
+int	addstr(
+		const char *z)
+		{ return(*(int *)0); }
+
+#undef attroff
+int	attroff(
+		NCURSES_ATTR_T	z)
+		{ return(*(int *)0); }
+
+#undef attron
+int	attron(
+		NCURSES_ATTR_T	z)
+		{ return(*(int *)0); }
+
+#undef attrset
+int	attrset(
+		NCURSES_ATTR_T	z)
+		{ return(*(int *)0); }
+
+#undef attr_get
+int	attr_get(
+		attr_t	*a1, 
+		short	*a2, 
+		void	*z)
+		{ return(*(int *)0); }
+
+#undef attr_off
+int	attr_off(
+		attr_t	a1, 
+		void	*z)
+		{ return(*(int *)0); }
+
+#undef attr_on
+int	attr_on(
+		attr_t	a1, 
+		void	*z)
+		{ return(*(int *)0); }
+
+#undef attr_set
+int	attr_set(
+		attr_t	a1, 
+		short	a2, 
+		void	*z)
+		{ return(*(int *)0); }
+
+#undef bkgd
+int	bkgd(
+		chtype	z)
+		{ return(*(int *)0); }
+
+#undef bkgdset
+void	bkgdset(
+		chtype	z)
+		{ /* void */ }
+
+#undef border
+int	border(
+		chtype	a1, 
+		chtype	a2, 
+		chtype	a3, 
+		chtype	a4, 
+		chtype	a5, 
+		chtype	a6, 
+		chtype	a7, 
+		chtype	z)
+		{ return(*(int *)0); }
+
+#undef box
+int	box(
+		WINDOW	*a1, 
+		chtype	a2, 
+		chtype	z)
+		{ return(*(int *)0); }
+
+#undef chgat
+int	chgat(
+		int	a1, 
+		attr_t	a2, 
+		short	a3, 
+		const void *z)
+		{ return(*(int *)0); }
+
+#undef clear
+int	clear(void)
+		{ return(*(int *)0); }
+
+#undef clrtobot
+int	clrtobot(void)
+		{ return(*(int *)0); }
+
+#undef clrtoeol
+int	clrtoeol(void)
+		{ return(*(int *)0); }
+
+#undef color_set
+int	color_set(
+		short	a1, 
+		void	*z)
+		{ return(*(int *)0); }
+
+#undef COLOR_PAIR
+int	COLOR_PAIR(
+		int	z)
+		{ return(*(int *)0); }
+
+#undef delch
+int	delch(void)
+		{ return(*(int *)0); }
+
+#undef deleteln
+int	deleteln(void)
+		{ return(*(int *)0); }
+
+#undef echochar
+int	echochar(
+		const chtype z)
+		{ return(*(int *)0); }
+
+#undef erase
+int	erase(void)
+		{ return(*(int *)0); }
+
+#undef getbkgd
+chtype	getbkgd(
+		WINDOW	*z)
+		{ return(*(chtype *)0); }
+
+#undef getch
+int	getch(void)
+		{ return(*(int *)0); }
+
+#undef getnstr
+int	getnstr(
+		char	*a1, 
+		int	z)
+		{ return(*(int *)0); }
+
+#undef getstr
+int	getstr(
+		char	*z)
+		{ return(*(int *)0); }
+
+#undef hline
+int	hline(
+		chtype	a1, 
+		int	z)
+		{ return(*(int *)0); }
+
+#undef inch
+chtype	inch(void)
+		{ return(*(chtype *)0); }
+
+#undef inchnstr
+int	inchnstr(
+		chtype	*a1, 
+		int	z)
+		{ return(*(int *)0); }
+
+#undef inchstr
+int	inchstr(
+		chtype	*z)
+		{ return(*(int *)0); }
+
+#undef innstr
+int	innstr(
+		char	*a1, 
+		int	z)
+		{ return(*(int *)0); }
+
+#undef insch
+int	insch(
+		chtype	z)
+		{ return(*(int *)0); }
+
+#undef insdelln
+int	insdelln(
+		int	z)
+		{ return(*(int *)0); }
+
+#undef insertln
+int	insertln(void)
+		{ return(*(int *)0); }
+
+#undef insnstr
+int	insnstr(
+		const char *a1, 
+		int	z)
+		{ return(*(int *)0); }
+
+#undef insstr
+int	insstr(
+		const char *z)
+		{ return(*(int *)0); }
+
+#undef instr
+int	instr(
+		char	*z)
+		{ return(*(int *)0); }
+
+#undef move
+int	move(
+		int	a1, 
+		int	z)
+		{ return(*(int *)0); }
+
+#undef mvaddch
+int	mvaddch(
+		int	a1, 
+		int	a2, 
+		const chtype z)
+		{ return(*(int *)0); }
+
+#undef mvaddchnstr
+int	mvaddchnstr(
+		int	a1, 
+		int	a2, 
+		const chtype *a3, 
+		int	z)
+		{ return(*(int *)0); }
+
+#undef mvaddchstr
+int	mvaddchstr(
+		int	a1, 
+		int	a2, 
+		const chtype *z)
+		{ return(*(int *)0); }
+
+#undef mvaddnstr
+int	mvaddnstr(
+		int	a1, 
+		int	a2, 
+		const char *a3, 
+		int	z)
+		{ return(*(int *)0); }
+
+#undef mvaddstr
+int	mvaddstr(
+		int	a1, 
+		int	a2, 
+		const char *z)
+		{ return(*(int *)0); }
+
+#undef mvchgat
+int	mvchgat(
+		int	a1, 
+		int	a2, 
+		int	a3, 
+		attr_t	a4, 
+		short	a5, 
+		const void *z)
+		{ return(*(int *)0); }
+
+#undef mvdelch
+int	mvdelch(
+		int	a1, 
+		int	z)
+		{ return(*(int *)0); }
+
+#undef mvgetch
+int	mvgetch(
+		int	a1, 
+		int	z)
+		{ return(*(int *)0); }
+
+#undef mvgetnstr
+int	mvgetnstr(
+		int	a1, 
+		int	a2, 
+		char	*a3, 
+		int	z)
+		{ return(*(int *)0); }
+
+#undef mvgetstr
+int	mvgetstr(
+		int	a1, 
+		int	a2, 
+		char	*z)
+		{ return(*(int *)0); }
+
+#undef mvhline
+int	mvhline(
+		int	a1, 
+		int	a2, 
+		chtype	a3, 
+		int	z)
+		{ return(*(int *)0); }
+
+#undef mvinch
+chtype	mvinch(
+		int	a1, 
+		int	z)
+		{ return(*(chtype *)0); }
+
+#undef mvinchnstr
+int	mvinchnstr(
+		int	a1, 
+		int	a2, 
+		chtype	*a3, 
+		int	z)
+		{ return(*(int *)0); }
+
+#undef mvinchstr
+int	mvinchstr(
+		int	a1, 
+		int	a2, 
+		chtype	*z)
+		{ return(*(int *)0); }
+
+#undef mvinnstr
+int	mvinnstr(
+		int	a1, 
+		int	a2, 
+		char	*a3, 
+		int	z)
+		{ return(*(int *)0); }
+
+#undef mvinsch
+int	mvinsch(
+		int	a1, 
+		int	a2, 
+		chtype	z)
+		{ return(*(int *)0); }
+
+#undef mvinsnstr
+int	mvinsnstr(
+		int	a1, 
+		int	a2, 
+		const char *a3, 
+		int	z)
+		{ return(*(int *)0); }
+
+#undef mvinsstr
+int	mvinsstr(
+		int	a1, 
+		int	a2, 
+		const char *z)
+		{ return(*(int *)0); }
+
+#undef mvinstr
+int	mvinstr(
+		int	a1, 
+		int	a2, 
+		char	*z)
+		{ return(*(int *)0); }
+
+#undef mvvline
+int	mvvline(
+		int	a1, 
+		int	a2, 
+		chtype	a3, 
+		int	z)
+		{ return(*(int *)0); }
+
+#undef mvwaddch
+int	mvwaddch(
+		WINDOW	*a1, 
+		int	a2, 
+		int	a3, 
+		const chtype z)
+		{ return(*(int *)0); }
+
+#undef mvwaddchnstr
+int	mvwaddchnstr(
+		WINDOW	*a1, 
+		int	a2, 
+		int	a3, 
+		const chtype *a4, 
+		int	z)
+		{ return(*(int *)0); }
+
+#undef mvwaddchstr
+int	mvwaddchstr(
+		WINDOW	*a1, 
+		int	a2, 
+		int	a3, 
+		const chtype *z)
+		{ return(*(int *)0); }
+
+#undef mvwaddnstr
+int	mvwaddnstr(
+		WINDOW	*a1, 
+		int	a2, 
+		int	a3, 
+		const char *a4, 
+		int	z)
+		{ return(*(int *)0); }
+
+#undef mvwaddstr
+int	mvwaddstr(
+		WINDOW	*a1, 
+		int	a2, 
+		int	a3, 
+		const char *z)
+		{ return(*(int *)0); }
+
+#undef mvwchgat
+int	mvwchgat(
+		WINDOW	*a1, 
+		int	a2, 
+		int	a3, 
+		int	a4, 
+		attr_t	a5, 
+		short	a6, 
+		const void *z)
+		{ return(*(int *)0); }
+
+#undef mvwdelch
+int	mvwdelch(
+		WINDOW	*a1, 
+		int	a2, 
+		int	z)
+		{ return(*(int *)0); }
+
+#undef mvwgetch
+int	mvwgetch(
+		WINDOW	*a1, 
+		int	a2, 
+		int	z)
+		{ return(*(int *)0); }
+
+#undef mvwgetnstr
+int	mvwgetnstr(
+		WINDOW	*a1, 
+		int	a2, 
+		int	a3, 
+		char	*a4, 
+		int	z)
+		{ return(*(int *)0); }
+
+#undef mvwgetstr
+int	mvwgetstr(
+		WINDOW	*a1, 
+		int	a2, 
+		int	a3, 
+		char	*z)
+		{ return(*(int *)0); }
+
+#undef mvwhline
+int	mvwhline(
+		WINDOW	*a1, 
+		int	a2, 
+		int	a3, 
+		chtype	a4, 
+		int	z)
+		{ return(*(int *)0); }
+
+#undef mvwinch
+chtype	mvwinch(
+		WINDOW	*a1, 
+		int	a2, 
+		int	z)
+		{ return(*(chtype *)0); }
+
+#undef mvwinchnstr
+int	mvwinchnstr(
+		WINDOW	*a1, 
+		int	a2, 
+		int	a3, 
+		chtype	*a4, 
+		int	z)
+		{ return(*(int *)0); }
+
+#undef mvwinchstr
+int	mvwinchstr(
+		WINDOW	*a1, 
+		int	a2, 
+		int	a3, 
+		chtype	*z)
+		{ return(*(int *)0); }
+
+#undef mvwinnstr
+int	mvwinnstr(
+		WINDOW	*a1, 
+		int	a2, 
+		int	a3, 
+		char	*a4, 
+		int	z)
+		{ return(*(int *)0); }
+
+#undef mvwinsch
+int	mvwinsch(
+		WINDOW	*a1, 
+		int	a2, 
+		int	a3, 
+		chtype	z)
+		{ return(*(int *)0); }
+
+#undef mvwinsnstr
+int	mvwinsnstr(
+		WINDOW	*a1, 
+		int	a2, 
+		int	a3, 
+		const char *a4, 
+		int	z)
+		{ return(*(int *)0); }
+
+#undef mvwinsstr
+int	mvwinsstr(
+		WINDOW	*a1, 
+		int	a2, 
+		int	a3, 
+		const char *z)
+		{ return(*(int *)0); }
+
+#undef mvwinstr
+int	mvwinstr(
+		WINDOW	*a1, 
+		int	a2, 
+		int	a3, 
+		char	*z)
+		{ return(*(int *)0); }
+
+#undef mvwvline
+int	mvwvline(
+		WINDOW	*a1, 
+		int	a2, 
+		int	a3, 
+		chtype	a4, 
+		int	z)
+		{ return(*(int *)0); }
+
+#undef PAIR_NUMBER
+int	PAIR_NUMBER(
+		int	z)
+		{ return(*(int *)0); }
+
+#undef redrawwin
+int	redrawwin(
+		WINDOW	*z)
+		{ return(*(int *)0); }
+
+#undef refresh
+int	refresh(void)
+		{ return(*(int *)0); }
+
+#undef scrl
+int	scrl(
+		int	z)
+		{ return(*(int *)0); }
+
+#undef scroll
+int	scroll(
+		WINDOW	*z)
+		{ return(*(int *)0); }
+
+#undef setscrreg
+int	setscrreg(
+		int	a1, 
+		int	z)
+		{ return(*(int *)0); }
+
+#undef slk_attr_off
+int	slk_attr_off(
+		const attr_t a1, 
+		void	*z)
+		{ return(*(int *)0); }
+
+#undef slk_attr_on
+int	slk_attr_on(
+		attr_t	a1, 
+		void	*z)
+		{ return(*(int *)0); }
+
+#undef standout
+int	standout(void)
+		{ return(*(int *)0); }
+
+#undef standend
+int	standend(void)
+		{ return(*(int *)0); }
+
+#undef timeout
+void	timeout(
+		int	z)
+		{ /* void */ }
+
+#undef touchline
+int	touchline(
+		WINDOW	*a1, 
+		int	a2, 
+		int	z)
+		{ return(*(int *)0); }
+
+#undef touchwin
+int	touchwin(
+		WINDOW	*z)
+		{ return(*(int *)0); }
+
+#undef untouchwin
+int	untouchwin(
+		WINDOW	*z)
+		{ return(*(int *)0); }
+
+#undef vline
+int	vline(
+		chtype	a1, 
+		int	z)
+		{ return(*(int *)0); }
+
+#undef vw_printw
+int	vw_printw(
+		WINDOW	*a1, 
+		const char *a2, 
+		va_list	z)
+		{ return(*(int *)0); }
+
+#undef vw_scanw
+int	vw_scanw(
+		WINDOW	*a1, 
+		char	*a2, 
+		va_list	z)
+		{ return(*(int *)0); }
+
+#undef waddchstr
+int	waddchstr(
+		WINDOW	*a1, 
+		const chtype *z)
+		{ return(*(int *)0); }
+
+#undef waddstr
+int	waddstr(
+		WINDOW	*a1, 
+		const char *z)
+		{ return(*(int *)0); }
+
+#undef wattron
+int	wattron(
+		WINDOW	*a1, 
+		int	z)
+		{ return(*(int *)0); }
+
+#undef wattroff
+int	wattroff(
+		WINDOW	*a1, 
+		int	z)
+		{ return(*(int *)0); }
+
+#undef wattrset
+int	wattrset(
+		WINDOW	*a1, 
+		int	z)
+		{ return(*(int *)0); }
+
+#undef wattr_get
+int	wattr_get(
+		WINDOW	*a1, 
+		attr_t	*a2, 
+		short	*a3, 
+		void	*z)
+		{ return(*(int *)0); }
+
+#undef wattr_set
+int	wattr_set(
+		WINDOW	*a1, 
+		attr_t	a2, 
+		short	a3, 
+		void	*z)
+		{ return(*(int *)0); }
+
+#undef wdeleteln
+int	wdeleteln(
+		WINDOW	*z)
+		{ return(*(int *)0); }
+
+#undef wgetstr
+int	wgetstr(
+		WINDOW	*a1, 
+		char	*z)
+		{ return(*(int *)0); }
+
+#undef winchstr
+int	winchstr(
+		WINDOW	*a1, 
+		chtype	*z)
+		{ return(*(int *)0); }
+
+#undef winsertln
+int	winsertln(
+		WINDOW	*z)
+		{ return(*(int *)0); }
+
+#undef winsstr
+int	winsstr(
+		WINDOW	*a1, 
+		const char *z)
+		{ return(*(int *)0); }
+
+#undef winstr
+int	winstr(
+		WINDOW	*a1, 
+		char	*z)
+		{ return(*(int *)0); }
+
+#undef wstandout
+int	wstandout(
+		WINDOW	*z)
+		{ return(*(int *)0); }
+
+#undef wstandend
+int	wstandend(
+		WINDOW	*z)
+		{ return(*(int *)0); }
+
+#undef getattrs
+int	getattrs(
+		const WINDOW *z)
+		{ return(*(int *)0); }
+
+#undef getcurx
+int	getcurx(
+		const WINDOW *z)
+		{ return(*(int *)0); }
+
+#undef getcury
+int	getcury(
+		const WINDOW *z)
+		{ return(*(int *)0); }
+
+#undef getbegx
+int	getbegx(
+		const WINDOW *z)
+		{ return(*(int *)0); }
+
+#undef getbegy
+int	getbegy(
+		const WINDOW *z)
+		{ return(*(int *)0); }
+
+#undef getmaxx
+int	getmaxx(
+		const WINDOW *z)
+		{ return(*(int *)0); }
+
+#undef getmaxy
+int	getmaxy(
+		const WINDOW *z)
+		{ return(*(int *)0); }
+
+#undef getparx
+int	getparx(
+		const WINDOW *z)
+		{ return(*(int *)0); }
+
+#undef getpary
+int	getpary(
+		const WINDOW *z)
+		{ return(*(int *)0); }
+
+#undef wgetparent
+WINDOW	*wgetparent(
+		const WINDOW *z)
+		{ return(*(WINDOW **)0); }
+
+#undef is_cleared
+NCURSES_BOOL is_cleared(
+		const WINDOW *z)
+		{ return(*(NCURSES_BOOL *)0); }
+
+#undef is_idcok
+NCURSES_BOOL is_idcok(
+		const WINDOW *z)
+		{ return(*(NCURSES_BOOL *)0); }
+
+#undef is_idlok
+NCURSES_BOOL is_idlok(
+		const WINDOW *z)
+		{ return(*(NCURSES_BOOL *)0); }
+
+#undef is_immedok
+NCURSES_BOOL is_immedok(
+		const WINDOW *z)
+		{ return(*(NCURSES_BOOL *)0); }
+
+#undef is_keypad
+NCURSES_BOOL is_keypad(
+		const WINDOW *z)
+		{ return(*(NCURSES_BOOL *)0); }
+
+#undef is_leaveok
+NCURSES_BOOL is_leaveok(
+		const WINDOW *z)
+		{ return(*(NCURSES_BOOL *)0); }
+
+#undef is_nodelay
+NCURSES_BOOL is_nodelay(
+		const WINDOW *z)
+		{ return(*(NCURSES_BOOL *)0); }
+
+#undef is_notimeout
+NCURSES_BOOL is_notimeout(
+		const WINDOW *z)
+		{ return(*(NCURSES_BOOL *)0); }
+
+#undef is_pad
+NCURSES_BOOL is_pad(
+		const WINDOW *z)
+		{ return(*(NCURSES_BOOL *)0); }
+
+#undef is_scrollok
+NCURSES_BOOL is_scrollok(
+		const WINDOW *z)
+		{ return(*(NCURSES_BOOL *)0); }
+
+#undef is_subwin
+NCURSES_BOOL is_subwin(
+		const WINDOW *z)
+		{ return(*(NCURSES_BOOL *)0); }
+
+#undef is_syncok
+NCURSES_BOOL is_syncok(
+		const WINDOW *z)
+		{ return(*(NCURSES_BOOL *)0); }
+
+#undef wgetscrreg
+int	wgetscrreg(
+		const WINDOW *a1, 
+		int	*a2, 
+		int	*z)
+		{ return(*(int *)0); }
+
+#undef add_wch
+int	add_wch(
+		const cchar_t *z)
+		{ return(*(int *)0); }
+
+#undef add_wchnstr
+int	add_wchnstr(
+		const cchar_t *a1, 
+		int	z)
+		{ return(*(int *)0); }
+
+#undef add_wchstr
+int	add_wchstr(
+		const cchar_t *z)
+		{ return(*(int *)0); }
+
+#undef addnwstr
+int	addnwstr(
+		const wchar_t *a1, 
+		int	z)
+		{ return(*(int *)0); }
+
+#undef addwstr
+int	addwstr(
+		const wchar_t *z)
+		{ return(*(int *)0); }
+
+#undef bkgrnd
+int	bkgrnd(
+		const cchar_t *z)
+		{ return(*(int *)0); }
+
+#undef bkgrndset
+void	bkgrndset(
+		const cchar_t *z)
+		{ /* void */ }
+
+#undef border_set
+int	border_set(
+		const cchar_t *a1, 
+		const cchar_t *a2, 
+		const cchar_t *a3, 
+		const cchar_t *a4, 
+		const cchar_t *a5, 
+		const cchar_t *a6, 
+		const cchar_t *a7, 
+		const cchar_t *z)
+		{ return(*(int *)0); }
+
+#undef box_set
+int	box_set(
+		WINDOW	*a1, 
+		const cchar_t *a2, 
+		const cchar_t *z)
+		{ return(*(int *)0); }
+
+#undef echo_wchar
+int	echo_wchar(
+		const cchar_t *z)
+		{ return(*(int *)0); }
+
+#undef get_wch
+int	get_wch(
+		wint_t	*z)
+		{ return(*(int *)0); }
+
+#undef get_wstr
+int	get_wstr(
+		wint_t	*z)
+		{ return(*(int *)0); }
+
+#undef getbkgrnd
+int	getbkgrnd(
+		cchar_t	*z)
+		{ return(*(int *)0); }
+
+#undef getn_wstr
+int	getn_wstr(
+		wint_t	*a1, 
+		int	z)
+		{ return(*(int *)0); }
+
+#undef hline_set
+int	hline_set(
+		const cchar_t *a1, 
+		int	z)
+		{ return(*(int *)0); }
+
+#undef in_wch
+int	in_wch(
+		cchar_t	*z)
+		{ return(*(int *)0); }
+
+#undef in_wchnstr
+int	in_wchnstr(
+		cchar_t	*a1, 
+		int	z)
+		{ return(*(int *)0); }
+
+#undef in_wchstr
+int	in_wchstr(
+		cchar_t	*z)
+		{ return(*(int *)0); }
+
+#undef innwstr
+int	innwstr(
+		wchar_t	*a1, 
+		int	z)
+		{ return(*(int *)0); }
+
+#undef ins_nwstr
+int	ins_nwstr(
+		const wchar_t *a1, 
+		int	z)
+		{ return(*(int *)0); }
+
+#undef ins_wch
+int	ins_wch(
+		const cchar_t *z)
+		{ return(*(int *)0); }
+
+#undef ins_wstr
+int	ins_wstr(
+		const wchar_t *z)
+		{ return(*(int *)0); }
+
+#undef inwstr
+int	inwstr(
+		wchar_t	*z)
+		{ return(*(int *)0); }
+
+#undef mvadd_wch
+int	mvadd_wch(
+		int	a1, 
+		int	a2, 
+		const cchar_t *z)
+		{ return(*(int *)0); }
+
+#undef mvadd_wchnstr
+int	mvadd_wchnstr(
+		int	a1, 
+		int	a2, 
+		const cchar_t *a3, 
+		int	z)
+		{ return(*(int *)0); }
+
+#undef mvadd_wchstr
+int	mvadd_wchstr(
+		int	a1, 
+		int	a2, 
+		const cchar_t *z)
+		{ return(*(int *)0); }
+
+#undef mvaddnwstr
+int	mvaddnwstr(
+		int	a1, 
+		int	a2, 
+		const wchar_t *a3, 
+		int	z)
+		{ return(*(int *)0); }
+
+#undef mvaddwstr
+int	mvaddwstr(
+		int	a1, 
+		int	a2, 
+		const wchar_t *z)
+		{ return(*(int *)0); }
+
+#undef mvget_wch
+int	mvget_wch(
+		int	a1, 
+		int	a2, 
+		wint_t	*z)
+		{ return(*(int *)0); }
+
+#undef mvget_wstr
+int	mvget_wstr(
+		int	a1, 
+		int	a2, 
+		wint_t	*z)
+		{ return(*(int *)0); }
+
+#undef mvgetn_wstr
+int	mvgetn_wstr(
+		int	a1, 
+		int	a2, 
+		wint_t	*a3, 
+		int	z)
+		{ return(*(int *)0); }
+
+#undef mvhline_set
+int	mvhline_set(
+		int	a1, 
+		int	a2, 
+		const cchar_t *a3, 
+		int	z)
+		{ return(*(int *)0); }
+
+#undef mvin_wch
+int	mvin_wch(
+		int	a1, 
+		int	a2, 
+		cchar_t	*z)
+		{ return(*(int *)0); }
+
+#undef mvin_wchnstr
+int	mvin_wchnstr(
+		int	a1, 
+		int	a2, 
+		cchar_t	*a3, 
+		int	z)
+		{ return(*(int *)0); }
+
+#undef mvin_wchstr
+int	mvin_wchstr(
+		int	a1, 
+		int	a2, 
+		cchar_t	*z)
+		{ return(*(int *)0); }
+
+#undef mvinnwstr
+int	mvinnwstr(
+		int	a1, 
+		int	a2, 
+		wchar_t	*a3, 
+		int	z)
+		{ return(*(int *)0); }
+
+#undef mvins_nwstr
+int	mvins_nwstr(
+		int	a1, 
+		int	a2, 
+		const wchar_t *a3, 
+		int	z)
+		{ return(*(int *)0); }
+
+#undef mvins_wch
+int	mvins_wch(
+		int	a1, 
+		int	a2, 
+		const cchar_t *z)
+		{ return(*(int *)0); }
+
+#undef mvins_wstr
+int	mvins_wstr(
+		int	a1, 
+		int	a2, 
+		const wchar_t *z)
+		{ return(*(int *)0); }
+
+#undef mvinwstr
+int	mvinwstr(
+		int	a1, 
+		int	a2, 
+		wchar_t	*z)
+		{ return(*(int *)0); }
+
+#undef mvvline_set
+int	mvvline_set(
+		int	a1, 
+		int	a2, 
+		const cchar_t *a3, 
+		int	z)
+		{ return(*(int *)0); }
+
+#undef mvwadd_wch
+int	mvwadd_wch(
+		WINDOW	*a1, 
+		int	a2, 
+		int	a3, 
+		const cchar_t *z)
+		{ return(*(int *)0); }
+
+#undef mvwadd_wchnstr
+int	mvwadd_wchnstr(
+		WINDOW	*a1, 
+		int	a2, 
+		int	a3, 
+		const cchar_t *a4, 
+		int	z)
+		{ return(*(int *)0); }
+
+#undef mvwadd_wchstr
+int	mvwadd_wchstr(
+		WINDOW	*a1, 
+		int	a2, 
+		int	a3, 
+		const cchar_t *z)
+		{ return(*(int *)0); }
+
+#undef mvwaddnwstr
+int	mvwaddnwstr(
+		WINDOW	*a1, 
+		int	a2, 
+		int	a3, 
+		const wchar_t *a4, 
+		int	z)
+		{ return(*(int *)0); }
+
+#undef mvwaddwstr
+int	mvwaddwstr(
+		WINDOW	*a1, 
+		int	a2, 
+		int	a3, 
+		const wchar_t *z)
+		{ return(*(int *)0); }
+
+#undef mvwget_wch
+int	mvwget_wch(
+		WINDOW	*a1, 
+		int	a2, 
+		int	a3, 
+		wint_t	*z)
+		{ return(*(int *)0); }
+
+#undef mvwget_wstr
+int	mvwget_wstr(
+		WINDOW	*a1, 
+		int	a2, 
+		int	a3, 
+		wint_t	*z)
+		{ return(*(int *)0); }
+
+#undef mvwgetn_wstr
+int	mvwgetn_wstr(
+		WINDOW	*a1, 
+		int	a2, 
+		int	a3, 
+		wint_t	*a4, 
+		int	z)
+		{ return(*(int *)0); }
+
+#undef mvwhline_set
+int	mvwhline_set(
+		WINDOW	*a1, 
+		int	a2, 
+		int	a3, 
+		const cchar_t *a4, 
+		int	z)
+		{ return(*(int *)0); }
+
+#undef mvwin_wch
+int	mvwin_wch(
+		WINDOW	*a1, 
+		int	a2, 
+		int	a3, 
+		cchar_t	*z)
+		{ return(*(int *)0); }
+
+#undef mvwin_wchnstr
+int	mvwin_wchnstr(
+		WINDOW	*a1, 
+		int	a2, 
+		int	a3, 
+		cchar_t	*a4, 
+		int	z)
+		{ return(*(int *)0); }
+
+#undef mvwin_wchstr
+int	mvwin_wchstr(
+		WINDOW	*a1, 
+		int	a2, 
+		int	a3, 
+		cchar_t	*z)
+		{ return(*(int *)0); }
+
+#undef mvwinnwstr
+int	mvwinnwstr(
+		WINDOW	*a1, 
+		int	a2, 
+		int	a3, 
+		wchar_t	*a4, 
+		int	z)
+		{ return(*(int *)0); }
+
+#undef mvwins_nwstr
+int	mvwins_nwstr(
+		WINDOW	*a1, 
+		int	a2, 
+		int	a3, 
+		const wchar_t *a4, 
+		int	z)
+		{ return(*(int *)0); }
+
+#undef mvwins_wch
+int	mvwins_wch(
+		WINDOW	*a1, 
+		int	a2, 
+		int	a3, 
+		const cchar_t *z)
+		{ return(*(int *)0); }
+
+#undef mvwins_wstr
+int	mvwins_wstr(
+		WINDOW	*a1, 
+		int	a2, 
+		int	a3, 
+		const wchar_t *z)
+		{ return(*(int *)0); }
+
+#undef mvwinwstr
+int	mvwinwstr(
+		WINDOW	*a1, 
+		int	a2, 
+		int	a3, 
+		wchar_t	*z)
+		{ return(*(int *)0); }
+
+#undef mvwvline_set
+int	mvwvline_set(
+		WINDOW	*a1, 
+		int	a2, 
+		int	a3, 
+		const cchar_t *a4, 
+		int	z)
+		{ return(*(int *)0); }
+
+#undef vline_set
+int	vline_set(
+		const cchar_t *a1, 
+		int	z)
+		{ return(*(int *)0); }
+
+#undef wadd_wchstr
+int	wadd_wchstr(
+		WINDOW	*a1, 
+		const cchar_t *z)
+		{ return(*(int *)0); }
+
+#undef waddwstr
+int	waddwstr(
+		WINDOW	*a1, 
+		const wchar_t *z)
+		{ return(*(int *)0); }
+
+#undef wget_wstr
+int	wget_wstr(
+		WINDOW	*a1, 
+		wint_t	*z)
+		{ return(*(int *)0); }
+
+#undef wgetbkgrnd
+int	wgetbkgrnd(
+		WINDOW	*a1, 
+		cchar_t	*z)
+		{ return(*(int *)0); }
+
+#undef win_wchstr
+int	win_wchstr(
+		WINDOW	*a1, 
+		cchar_t	*z)
+		{ return(*(int *)0); }
+
+#undef wins_wstr
+int	wins_wstr(
+		WINDOW	*a1, 
+		const wchar_t *z)
+		{ return(*(int *)0); }
+
+#undef mouse_trafo
+NCURSES_BOOL mouse_trafo(
+		int	*a1, 
+		int	*a2, 
+		NCURSES_BOOL z)
+		{ return(*(NCURSES_BOOL *)0); }
+
+/* ./base/lib_getch.c */
+
+#include <fifo_defs.h>
+
+#undef _nc_ESCDELAY
+int	_nc_ESCDELAY(void)
+		{ return(*(int *)0); }
+
+#undef _nc_ptr_Escdelay
+int	*_nc_ptr_Escdelay(
+		SCREEN	*sp)
+		{ return(*(int **)0); }
+
+#undef set_escdelay_sp
+int	set_escdelay_sp(
+		SCREEN	*sp, 
+		int	value)
+		{ return(*(int *)0); }
+
+#undef set_escdelay
+int	set_escdelay(
+		int	value)
+		{ return(*(int *)0); }
+
+#undef get_escdelay_sp
+int	get_escdelay_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
+#undef get_escdelay
+int	get_escdelay(void)
+		{ return(*(int *)0); }
+
+#undef _nc_wgetch
+int	_nc_wgetch(
+		WINDOW	*win, 
+		unsigned long *result, 
+		int	use_meta)
+		{ return(*(int *)0); }
+
+#undef wgetch
+int	wgetch(
+		WINDOW	*win)
+		{ return(*(int *)0); }
+
+/* ./base/lib_getstr.c */
+
+#undef wgetnstr
+int	wgetnstr(
+		WINDOW	*win, 
+		char	*str, 
+		int	maxlen)
+		{ return(*(int *)0); }
+
+/* ./base/lib_hline.c */
+
+#undef whline
+int	whline(
+		WINDOW	*win, 
+		chtype	ch, 
+		int	n)
+		{ return(*(int *)0); }
+
+/* ./base/lib_immedok.c */
+
+#undef immedok
+void	immedok(
+		WINDOW	*win, 
+		NCURSES_BOOL flag)
+		{ /* void */ }
+
+/* ./base/lib_inchstr.c */
+
+#undef winchnstr
+int	winchnstr(
+		WINDOW	*win, 
+		chtype	*str, 
+		int	n)
+		{ return(*(int *)0); }
+
+/* ./base/lib_initscr.c */
+
+#undef initscr
+WINDOW	*initscr(void)
+		{ return(*(WINDOW **)0); }
+
+/* ./base/lib_insch.c */
+
+#undef _nc_insert_ch
+int	_nc_insert_ch(
+		SCREEN	*sp, 
+		WINDOW	*win, 
+		chtype	ch)
+		{ return(*(int *)0); }
+
+#undef winsch
+int	winsch(
+		WINDOW	*win, 
+		chtype	c)
+		{ return(*(int *)0); }
+
+/* ./base/lib_insdel.c */
+
+#undef winsdelln
+int	winsdelln(
+		WINDOW	*win, 
+		int	n)
+		{ return(*(int *)0); }
+
+/* ./base/lib_insnstr.c */
+
+#undef winsnstr
+int	winsnstr(
+		WINDOW	*win, 
+		const char *s, 
+		int	n)
+		{ return(*(int *)0); }
+
+/* ./base/lib_instr.c */
+
+#undef winnstr
+int	winnstr(
+		WINDOW	*win, 
+		char	*str, 
+		int	n)
+		{ return(*(int *)0); }
+
+/* ./base/lib_isendwin.c */
+
+#undef isendwin_sp
+NCURSES_BOOL isendwin_sp(
+		SCREEN	*sp)
+		{ return(*(NCURSES_BOOL *)0); }
+
+#undef isendwin
+NCURSES_BOOL isendwin(void)
+		{ return(*(NCURSES_BOOL *)0); }
+
+/* ./base/lib_leaveok.c */
+
+#undef leaveok
+int	leaveok(
+		WINDOW	*win, 
+		NCURSES_BOOL flag)
+		{ return(*(int *)0); }
+
+/* ./base/lib_mouse.c */
+
+#undef getmouse_sp
+int	getmouse_sp(
+		SCREEN	*sp, 
+		MEVENT	*aevent)
+		{ return(*(int *)0); }
+
+#undef getmouse
+int	getmouse(
+		MEVENT	*aevent)
+		{ return(*(int *)0); }
+
+#undef ungetmouse_sp
+int	ungetmouse_sp(
+		SCREEN	*sp, 
+		MEVENT	*aevent)
+		{ return(*(int *)0); }
+
+#undef ungetmouse
+int	ungetmouse(
+		MEVENT	*aevent)
+		{ return(*(int *)0); }
+
+#undef mousemask_sp
+mmask_t	mousemask_sp(
+		SCREEN	*sp, 
+		mmask_t	newmask, 
+		mmask_t	*oldmask)
+		{ return(*(mmask_t *)0); }
+
+#undef mousemask
+mmask_t	mousemask(
+		mmask_t	newmask, 
+		mmask_t	*oldmask)
+		{ return(*(mmask_t *)0); }
+
+#undef wenclose
+NCURSES_BOOL wenclose(
+		const WINDOW *win, 
+		int	y, 
+		int	x)
+		{ return(*(NCURSES_BOOL *)0); }
+
+#undef mouseinterval_sp
+int	mouseinterval_sp(
+		SCREEN	*sp, 
+		int	maxclick)
+		{ return(*(int *)0); }
+
+#undef mouseinterval
+int	mouseinterval(
+		int	maxclick)
+		{ return(*(int *)0); }
+
+#undef _nc_has_mouse
+NCURSES_BOOL _nc_has_mouse(
+		SCREEN	*sp)
+		{ return(*(NCURSES_BOOL *)0); }
+
+#undef has_mouse_sp
+NCURSES_BOOL has_mouse_sp(
+		SCREEN	*sp)
+		{ return(*(NCURSES_BOOL *)0); }
+
+#undef has_mouse
+NCURSES_BOOL has_mouse(void)
+		{ return(*(NCURSES_BOOL *)0); }
+
+#undef wmouse_trafo
+NCURSES_BOOL wmouse_trafo(
+		const WINDOW *win, 
+		int	*pY, 
+		int	*pX, 
+		NCURSES_BOOL to_screen)
+		{ return(*(NCURSES_BOOL *)0); }
+
+/* ./base/lib_move.c */
+
+#undef wmove
+int	wmove(
+		WINDOW	*win, 
+		int	y, 
+		int	x)
+		{ return(*(int *)0); }
+
+/* ./tty/lib_mvcur.c */
+
+#undef _nc_msec_cost_sp
+int	_nc_msec_cost_sp(
+		SCREEN	*sp, 
+		const char *const cap, 
+		int	affcnt)
+		{ return(*(int *)0); }
+
+#undef _nc_msec_cost
+int	_nc_msec_cost(
+		const char *const cap, 
+		int	affcnt)
+		{ return(*(int *)0); }
+
+#undef _nc_mvcur_resume_sp
+void	_nc_mvcur_resume_sp(
+		SCREEN	*sp)
+		{ /* void */ }
+
+#undef _nc_mvcur_resume
+void	_nc_mvcur_resume(void)
+		{ /* void */ }
+
+#undef _nc_mvcur_init_sp
+void	_nc_mvcur_init_sp(
+		SCREEN	*sp)
+		{ /* void */ }
+
+#undef _nc_mvcur_init
+void	_nc_mvcur_init(void)
+		{ /* void */ }
+
+#undef _nc_mvcur_wrap_sp
+void	_nc_mvcur_wrap_sp(
+		SCREEN	*sp)
+		{ /* void */ }
+
+#undef _nc_mvcur_wrap
+void	_nc_mvcur_wrap(void)
+		{ /* void */ }
+
+#undef mvcur_sp
+int	mvcur_sp(
+		SCREEN	*sp, 
+		int	yold, 
+		int	xold, 
+		int	ynew, 
+		int	xnew)
+		{ return(*(int *)0); }
+
+#undef mvcur
+int	mvcur(
+		int	yold, 
+		int	xold, 
+		int	ynew, 
+		int	xnew)
+		{ return(*(int *)0); }
+
+#undef _nc_optimize_enable
+int	_nc_optimize_enable;
+
+/* ./base/lib_mvwin.c */
+
+#undef mvwin
+int	mvwin(
+		WINDOW	*win, 
+		int	by, 
+		int	bx)
+		{ return(*(int *)0); }
+
+/* ./base/lib_newterm.c */
+
+#undef filter_sp
+void	filter_sp(
+		SCREEN	*sp)
+		{ /* void */ }
+
+#undef filter
+void	filter(void)
+		{ /* void */ }
+
+#undef nofilter_sp
+void	nofilter_sp(
+		SCREEN	*sp)
+		{ /* void */ }
+
+#undef nofilter
+void	nofilter(void)
+		{ /* void */ }
+
+#undef newterm_sp
+SCREEN	*newterm_sp(
+		SCREEN	*sp, 
+		char	*name, 
+		FILE	*ofp, 
+		FILE	*ifp)
+		{ return(*(SCREEN **)0); }
+
+#undef newterm
+SCREEN	*newterm(
+		char	*name, 
+		FILE	*ofp, 
+		FILE	*ifp)
+		{ return(*(SCREEN **)0); }
+
+/* ./base/lib_newwin.c */
+
+#undef _nc_freewin
+int	_nc_freewin(
+		WINDOW	*win)
+		{ return(*(int *)0); }
+
+#undef newwin_sp
+WINDOW	*newwin_sp(
+		SCREEN	*sp, 
+		int	num_lines, 
+		int	num_columns, 
+		int	begy, 
+		int	begx)
+		{ return(*(WINDOW **)0); }
+
+#undef newwin
+WINDOW	*newwin(
+		int	num_lines, 
+		int	num_columns, 
+		int	begy, 
+		int	begx)
+		{ return(*(WINDOW **)0); }
+
+#undef derwin
+WINDOW	*derwin(
+		WINDOW	*orig, 
+		int	num_lines, 
+		int	num_columns, 
+		int	begy, 
+		int	begx)
+		{ return(*(WINDOW **)0); }
+
+#undef subwin
+WINDOW	*subwin(
+		WINDOW	*w, 
+		int	l, 
+		int	c, 
+		int	y, 
+		int	x)
+		{ return(*(WINDOW **)0); }
+
+#undef _nc_makenew_sp
+WINDOW	*_nc_makenew_sp(
+		SCREEN	*sp, 
+		int	num_lines, 
+		int	num_columns, 
+		int	begy, 
+		int	begx, 
+		int	flags)
+		{ return(*(WINDOW **)0); }
+
+#undef _nc_curscr_of
+WINDOW	*_nc_curscr_of(
+		SCREEN	*sp)
+		{ return(*(WINDOW **)0); }
+
+#undef _nc_newscr_of
+WINDOW	*_nc_newscr_of(
+		SCREEN	*sp)
+		{ return(*(WINDOW **)0); }
+
+#undef _nc_stdscr_of
+WINDOW	*_nc_stdscr_of(
+		SCREEN	*sp)
+		{ return(*(WINDOW **)0); }
+
+/* ./base/lib_nl.c */
+
+#undef nl_sp
+int	nl_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
+#undef nl
+int	nl(void)
+		{ return(*(int *)0); }
+
+#undef nonl_sp
+int	nonl_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
+#undef nonl
+int	nonl(void)
+		{ return(*(int *)0); }
+
+/* ./base/lib_overlay.c */
+
+#undef overlay
+int	overlay(
+		const WINDOW *win1, 
+		WINDOW	*win2)
+		{ return(*(int *)0); }
+
+#undef overwrite
+int	overwrite(
+		const WINDOW *win1, 
+		WINDOW	*win2)
+		{ return(*(int *)0); }
+
+#undef copywin
+int	copywin(
+		const WINDOW *src, 
+		WINDOW	*dst, 
+		int	sminrow, 
+		int	smincol, 
+		int	dminrow, 
+		int	dmincol, 
+		int	dmaxrow, 
+		int	dmaxcol, 
+		int	over)
+		{ return(*(int *)0); }
+
+/* ./base/lib_pad.c */
+
+#undef newpad_sp
+WINDOW	*newpad_sp(
+		SCREEN	*sp, 
+		int	l, 
+		int	c)
+		{ return(*(WINDOW **)0); }
+
+#undef newpad
+WINDOW	*newpad(
+		int	l, 
+		int	c)
+		{ return(*(WINDOW **)0); }
+
+#undef subpad
+WINDOW	*subpad(
+		WINDOW	*orig, 
+		int	l, 
+		int	c, 
+		int	begy, 
+		int	begx)
+		{ return(*(WINDOW **)0); }
+
+#undef prefresh
+int	prefresh(
+		WINDOW	*win, 
+		int	pminrow, 
+		int	pmincol, 
+		int	sminrow, 
+		int	smincol, 
+		int	smaxrow, 
+		int	smaxcol)
+		{ return(*(int *)0); }
+
+#undef pnoutrefresh
+int	pnoutrefresh(
+		WINDOW	*win, 
+		int	pminrow, 
+		int	pmincol, 
+		int	sminrow, 
+		int	smincol, 
+		int	smaxrow, 
+		int	smaxcol)
+		{ return(*(int *)0); }
+
+#undef pechochar
+int	pechochar(
+		WINDOW	*pad, 
+		const chtype ch)
+		{ return(*(int *)0); }
+
+/* ./base/lib_printw.c */
+
+#undef printw
+int	printw(
+		const char *fmt, 
+		...)
+		{ return(*(int *)0); }
+
+#undef wprintw
+int	wprintw(
+		WINDOW	*win, 
+		const char *fmt, 
+		...)
+		{ return(*(int *)0); }
+
+#undef mvprintw
+int	mvprintw(
+		int	y, 
+		int	x, 
+		const char *fmt, 
+		...)
+		{ return(*(int *)0); }
+
+#undef mvwprintw
+int	mvwprintw(
+		WINDOW	*win, 
+		int	y, 
+		int	x, 
+		const char *fmt, 
+		...)
+		{ return(*(int *)0); }
+
+#undef vwprintw
+int	vwprintw(
+		WINDOW	*win, 
+		const char *fmt, 
+		va_list	argp)
+		{ return(*(int *)0); }
+
+/* ./base/lib_redrawln.c */
+
+#undef wredrawln
+int	wredrawln(
+		WINDOW	*win, 
+		int	beg, 
+		int	num)
+		{ return(*(int *)0); }
+
+/* ./base/lib_refresh.c */
+
+#undef wrefresh
+int	wrefresh(
+		WINDOW	*win)
+		{ return(*(int *)0); }
+
+#undef wnoutrefresh
+int	wnoutrefresh(
+		WINDOW	*win)
+		{ return(*(int *)0); }
+
+/* ./base/lib_restart.c */
+
+#undef restartterm_sp
+int	restartterm_sp(
+		SCREEN	*sp, 
+		char	*termp, 
+		int	filenum, 
+		int	*errret)
+		{ return(*(int *)0); }
+
+#undef restartterm
+int	restartterm(
+		char	*termp, 
+		int	filenum, 
+		int	*errret)
+		{ return(*(int *)0); }
+
+/* ./base/lib_scanw.c */
+
+#undef vwscanw
+int	vwscanw(
+		WINDOW	*win, 
+		char	*fmt, 
+		va_list	argp)
+		{ return(*(int *)0); }
+
+#undef scanw
+int	scanw(
+		char	*fmt, 
+		...)
+		{ return(*(int *)0); }
+
+#undef wscanw
+int	wscanw(
+		WINDOW	*win, 
+		char	*fmt, 
+		...)
+		{ return(*(int *)0); }
+
+#undef mvscanw
+int	mvscanw(
+		int	y, 
+		int	x, 
+		char	*fmt, 
+		...)
+		{ return(*(int *)0); }
+
+#undef mvwscanw
+int	mvwscanw(
+		WINDOW	*win, 
+		int	y, 
+		int	x, 
+		char	*fmt, 
+		...)
+		{ return(*(int *)0); }
+
+/* ./base/lib_screen.c */
+
+#undef getwin_sp
+WINDOW	*getwin_sp(
+		SCREEN	*sp, 
+		FILE	*filep)
+		{ return(*(WINDOW **)0); }
+
+#undef getwin
+WINDOW	*getwin(
+		FILE	*filep)
+		{ return(*(WINDOW **)0); }
+
+#undef putwin
+int	putwin(
+		WINDOW	*win, 
+		FILE	*filep)
+		{ return(*(int *)0); }
+
+#undef scr_restore_sp
+int	scr_restore_sp(
+		SCREEN	*sp, 
+		const char *file)
+		{ return(*(int *)0); }
+
+#undef scr_restore
+int	scr_restore(
+		const char *file)
+		{ return(*(int *)0); }
+
+#undef scr_dump
+int	scr_dump(
+		const char *file)
+		{ return(*(int *)0); }
+
+#undef scr_init_sp
+int	scr_init_sp(
+		SCREEN	*sp, 
+		const char *file)
+		{ return(*(int *)0); }
+
+#undef scr_init
+int	scr_init(
+		const char *file)
+		{ return(*(int *)0); }
+
+#undef scr_set_sp
+int	scr_set_sp(
+		SCREEN	*sp, 
+		const char *file)
+		{ return(*(int *)0); }
+
+#undef scr_set
+int	scr_set(
+		const char *file)
+		{ return(*(int *)0); }
+
+/* ./base/lib_scroll.c */
+
+#undef _nc_scroll_window
+void	_nc_scroll_window(
+		WINDOW	*win, 
+		int const n, 
+		int const top, 
+		int const bottom, 
+		cchar_t	blank)
+		{ /* void */ }
+
+#undef wscrl
+int	wscrl(
+		WINDOW	*win, 
+		int	n)
+		{ return(*(int *)0); }
+
+/* ./base/lib_scrollok.c */
+
+#undef scrollok
+int	scrollok(
+		WINDOW	*win, 
+		NCURSES_BOOL flag)
+		{ return(*(int *)0); }
+
+/* ./base/lib_scrreg.c */
+
+#undef wsetscrreg
+int	wsetscrreg(
+		WINDOW	*win, 
+		int	top, 
+		int	bottom)
+		{ return(*(int *)0); }
+
+/* ./base/lib_set_term.c */
+
+#undef set_term
+SCREEN	*set_term(
+		SCREEN	*screenp)
+		{ return(*(SCREEN **)0); }
+
+#undef delscreen
+void	delscreen(
+		SCREEN	*sp)
+		{ /* void */ }
+
+#undef _nc_setupscreen_sp
+int	_nc_setupscreen_sp(
+		SCREEN	**spp, 
+		int	slines, 
+		int	scolumns, 
+		FILE	*output, 
+		NCURSES_BOOL filtered, 
+		int	slk_format)
+		{ return(*(int *)0); }
+
+#undef _nc_setupscreen
+int	_nc_setupscreen(
+		int	slines, 
+		int	scolumns, 
+		FILE	*output, 
+		NCURSES_BOOL filtered, 
+		int	slk_format)
+		{ return(*(int *)0); }
+
+#undef _nc_ripoffline_sp
+int	_nc_ripoffline_sp(
+		SCREEN	*sp, 
+		int	line, 
+		int	(*init)(
+		WINDOW	*p1, 
+		int	p2))
+		{ return(*(int *)0); }
+
+#undef _nc_ripoffline
+int	_nc_ripoffline(
+		int	line, 
+		int	(*init)(
+		WINDOW	*p1, 
+		int	p2))
+		{ return(*(int *)0); }
+
+#undef ripoffline_sp
+int	ripoffline_sp(
+		SCREEN	*sp, 
+		int	line, 
+		int	(*init)(
+		WINDOW	*p1, 
+		int	p2))
+		{ return(*(int *)0); }
+
+#undef ripoffline
+int	ripoffline(
+		int	line, 
+		int	(*init)(
+		WINDOW	*p1, 
+		int	p2))
+		{ return(*(int *)0); }
+
+/* ./base/lib_slk.c */
+
+#undef _nc_format_slks
+int	_nc_format_slks(
+		SCREEN	*sp, 
+		int	cols)
+		{ return(*(int *)0); }
+
+#undef _nc_slk_initialize
+int	_nc_slk_initialize(
+		WINDOW	*stwin, 
+		int	cols)
+		{ return(*(int *)0); }
+
+#undef slk_restore_sp
+int	slk_restore_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
+#undef slk_restore
+int	slk_restore(void)
+		{ return(*(int *)0); }
+
+/* ./base/lib_slkatr_set.c */
+
+#undef slk_attr_set_sp
+int	slk_attr_set_sp(
+		SCREEN	*sp, 
+		const attr_t attr, 
+		short	color_pair_number, 
+		void	*opts)
+		{ return(*(int *)0); }
+
+#undef slk_attr_set
+int	slk_attr_set(
+		const attr_t attr, 
+		short	color_pair_number, 
+		void	*opts)
+		{ return(*(int *)0); }
+
+/* ./base/lib_slkatrof.c */
+
+#undef slk_attroff_sp
+int	slk_attroff_sp(
+		SCREEN	*sp, 
+		const chtype attr)
+		{ return(*(int *)0); }
+
+#undef slk_attroff
+int	slk_attroff(
+		const chtype attr)
+		{ return(*(int *)0); }
+
+/* ./base/lib_slkatron.c */
+
+#undef slk_attron_sp
+int	slk_attron_sp(
+		SCREEN	*sp, 
+		const chtype attr)
+		{ return(*(int *)0); }
+
+#undef slk_attron
+int	slk_attron(
+		const chtype attr)
+		{ return(*(int *)0); }
+
+/* ./base/lib_slkatrset.c */
+
+#undef slk_attrset_sp
+int	slk_attrset_sp(
+		SCREEN	*sp, 
+		const chtype attr)
+		{ return(*(int *)0); }
+
+#undef slk_attrset
+int	slk_attrset(
+		const chtype attr)
+		{ return(*(int *)0); }
+
+/* ./base/lib_slkattr.c */
+
+#undef slk_attr_sp
+attr_t	slk_attr_sp(
+		SCREEN	*sp)
+		{ return(*(attr_t *)0); }
+
+#undef slk_attr
+attr_t	slk_attr(void)
+		{ return(*(attr_t *)0); }
+
+/* ./base/lib_slkclear.c */
+
+#undef slk_clear_sp
+int	slk_clear_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
+#undef slk_clear
+int	slk_clear(void)
+		{ return(*(int *)0); }
+
+/* ./base/lib_slkcolor.c */
+
+#undef slk_color_sp
+int	slk_color_sp(
+		SCREEN	*sp, 
+		short	color_pair_number)
+		{ return(*(int *)0); }
+
+#undef slk_color
+int	slk_color(
+		short	color_pair_number)
+		{ return(*(int *)0); }
+
+/* ./base/lib_slkinit.c */
+
+#undef slk_init_sp
+int	slk_init_sp(
+		SCREEN	*sp, 
+		int	format)
+		{ return(*(int *)0); }
+
+#undef slk_init
+int	slk_init(
+		int	format)
+		{ return(*(int *)0); }
+
+/* ./base/lib_slklab.c */
+
+#undef slk_label_sp
+char	*slk_label_sp(
+		SCREEN	*sp, 
+		int	n)
+		{ return(*(char **)0); }
+
+#undef slk_label
+char	*slk_label(
+		int	n)
+		{ return(*(char **)0); }
+
+/* ./base/lib_slkrefr.c */
+
+#undef slk_noutrefresh_sp
+int	slk_noutrefresh_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
+#undef slk_noutrefresh
+int	slk_noutrefresh(void)
+		{ return(*(int *)0); }
+
+#undef slk_refresh_sp
+int	slk_refresh_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
+#undef slk_refresh
+int	slk_refresh(void)
+		{ return(*(int *)0); }
+
+/* ./base/lib_slkset.c */
+
+#include <wctype.h>
+
+#undef slk_set_sp
+int	slk_set_sp(
+		SCREEN	*sp, 
+		int	i, 
+		const char *astr, 
+		int	format)
+		{ return(*(int *)0); }
+
+#undef slk_set
+int	slk_set(
+		int	i, 
+		const char *astr, 
+		int	format)
+		{ return(*(int *)0); }
+
+/* ./base/lib_slktouch.c */
+
+#undef slk_touch_sp
+int	slk_touch_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
+#undef slk_touch
+int	slk_touch(void)
+		{ return(*(int *)0); }
+
+/* ./base/lib_touch.c */
+
+#undef is_linetouched
+NCURSES_BOOL is_linetouched(
+		WINDOW	*win, 
+		int	line)
+		{ return(*(NCURSES_BOOL *)0); }
+
+#undef is_wintouched
+NCURSES_BOOL is_wintouched(
+		WINDOW	*win)
+		{ return(*(NCURSES_BOOL *)0); }
+
+#undef wtouchln
+int	wtouchln(
+		WINDOW	*win, 
+		int	y, 
+		int	n, 
+		int	changed)
+		{ return(*(int *)0); }
+
+/* ./trace/lib_tracedmp.c */
+
+#undef _tracedump
+void	_tracedump(
+		const char *name, 
+		WINDOW	*win)
+		{ /* void */ }
+
+/* ./trace/lib_tracemse.c */
+
+#undef _nc_tracemouse
+char	*_nc_tracemouse(
+		SCREEN	*sp, 
+		MEVENT const *ep)
+		{ return(*(char **)0); }
+
+#undef _tracemouse
+char	*_tracemouse(
+		MEVENT const *ep)
+		{ return(*(char **)0); }
+
+/* ./tty/lib_tstp.c */
+
+#include <SigAction.h>
+
+#undef _nc_signal_handler
+void	_nc_signal_handler(
+		NCURSES_BOOL enable)
+		{ /* void */ }
+
+/* ./base/lib_ungetch.c */
+
+#undef _nc_fifo_dump
+void	_nc_fifo_dump(
+		SCREEN	*sp)
+		{ /* void */ }
+
+#undef ungetch_sp
+int	ungetch_sp(
+		SCREEN	*sp, 
+		int	ch)
+		{ return(*(int *)0); }
+
+#undef ungetch
+int	ungetch(
+		int	ch)
+		{ return(*(int *)0); }
+
+/* ./tty/lib_vidattr.c */
+
+#undef vidputs_sp
+int	vidputs_sp(
+		SCREEN	*sp, 
+		chtype	newmode, 
+		NCURSES_OUTC_sp outc)
+		{ return(*(int *)0); }
+
+#undef vidputs
+int	vidputs(
+		chtype	newmode, 
+		NCURSES_OUTC outc)
+		{ return(*(int *)0); }
+
+#undef vidattr_sp
+int	vidattr_sp(
+		SCREEN	*sp, 
+		chtype	newmode)
+		{ return(*(int *)0); }
+
+#undef vidattr
+int	vidattr(
+		chtype	newmode)
+		{ return(*(int *)0); }
+
+#undef termattrs_sp
+chtype	termattrs_sp(
+		SCREEN	*sp)
+		{ return(*(chtype *)0); }
+
+#undef termattrs
+chtype	termattrs(void)
+		{ return(*(chtype *)0); }
+
+/* ./base/lib_vline.c */
+
+#undef wvline
+int	wvline(
+		WINDOW	*win, 
+		chtype	ch, 
+		int	n)
+		{ return(*(int *)0); }
+
+/* ./base/lib_wattroff.c */
+
+#undef wattr_off
+int	wattr_off(
+		WINDOW	*win, 
+		attr_t	at, 
+		void	*opts)
+		{ return(*(int *)0); }
+
+/* ./base/lib_wattron.c */
+
+#undef wattr_on
+int	wattr_on(
+		WINDOW	*win, 
+		attr_t	at, 
+		void	*opts)
+		{ return(*(int *)0); }
+
+/* ./base/lib_winch.c */
+
+#undef winch
+chtype	winch(
+		WINDOW	*win)
+		{ return(*(chtype *)0); }
+
+/* ./base/lib_window.c */
+
+#undef _nc_synchook
+void	_nc_synchook(
+		WINDOW	*win)
+		{ /* void */ }
+
+#undef mvderwin
+int	mvderwin(
+		WINDOW	*win, 
+		int	y, 
+		int	x)
+		{ return(*(int *)0); }
+
+#undef syncok
+int	syncok(
+		WINDOW	*win, 
+		NCURSES_BOOL bf)
+		{ return(*(int *)0); }
+
+#undef wsyncup
+void	wsyncup(
+		WINDOW	*win)
+		{ /* void */ }
+
+#undef wsyncdown
+void	wsyncdown(
+		WINDOW	*win)
+		{ /* void */ }
+
+#undef wcursyncup
+void	wcursyncup(
+		WINDOW	*win)
+		{ /* void */ }
+
+#undef dupwin
+WINDOW	*dupwin(
+		WINDOW	*win)
+		{ return(*(WINDOW **)0); }
+
+/* ./base/nc_panel.c */
+
+#undef _nc_panelhook_sp
+struct panelhook *_nc_panelhook_sp(
+		SCREEN	*sp)
+		{ return(*(struct panelhook **)0); }
+
+#undef _nc_panelhook
+struct panelhook *_nc_panelhook(void)
+		{ return(*(struct panelhook **)0); }
+
+/* ./base/safe_sprintf.c */
+
+#undef _nc_printf_string_sp
+char	*_nc_printf_string_sp(
+		SCREEN	*sp, 
+		const char *fmt, 
+		va_list	ap)
+		{ return(*(char **)0); }
+
+#undef _nc_printf_string
+char	*_nc_printf_string(
+		const char *fmt, 
+		va_list	ap)
+		{ return(*(char **)0); }
+
+/* ./tty/tty_update.c */
+
+#include <sys/time.h>
+#include <sys/times.h>
+
+#undef doupdate_sp
+int	doupdate_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
+#undef doupdate
+int	doupdate(void)
+		{ return(*(int *)0); }
+
+#undef _nc_scrolln_sp
+int	_nc_scrolln_sp(
+		SCREEN	*sp, 
+		int	n, 
+		int	top, 
+		int	bot, 
+		int	maxy)
+		{ return(*(int *)0); }
+
+#undef _nc_scrolln
+int	_nc_scrolln(
+		int	n, 
+		int	top, 
+		int	bot, 
+		int	maxy)
+		{ return(*(int *)0); }
+
+#undef _nc_screen_resume_sp
+void	_nc_screen_resume_sp(
+		SCREEN	*sp)
+		{ /* void */ }
+
+#undef _nc_screen_resume
+void	_nc_screen_resume(void)
+		{ /* void */ }
+
+#undef _nc_screen_init_sp
+void	_nc_screen_init_sp(
+		SCREEN	*sp)
+		{ /* void */ }
+
+#undef _nc_screen_init
+void	_nc_screen_init(void)
+		{ /* void */ }
+
+#undef _nc_screen_wrap_sp
+void	_nc_screen_wrap_sp(
+		SCREEN	*sp)
+		{ /* void */ }
+
+#undef _nc_screen_wrap
+void	_nc_screen_wrap(void)
+		{ /* void */ }
+
+#undef _nc_do_xmc_glitch_sp
+void	_nc_do_xmc_glitch_sp(
+		SCREEN	*sp, 
+		attr_t	previous)
+		{ /* void */ }
+
+#undef _nc_do_xmc_glitch
+void	_nc_do_xmc_glitch(
+		attr_t	previous)
+		{ /* void */ }
+
+/* ./trace/varargs.c */
+
+typedef enum {
+    atUnknown = 0, atInteger, atFloat, atPoint, atString
+} ARGTYPE;
+
+#undef _nc_varargs
+char	*_nc_varargs(
+		const char *fmt, 
+		va_list	ap)
+		{ return(*(char **)0); }
+
+/* ./base/memmove.c */
+
+#undef _nc_memmove
+void	_nc_memmove(void)
+		{ /* void */ }
+
+/* ./base/vsscanf.c */
+
+#undef _nc_vsscanf
+void	_nc_vsscanf(void)
+		{ /* void */ }
+
+/* ./base/lib_freeall.c */
+
+#include <term_entry.h>
+
+#undef _nc_freeall
+void	_nc_freeall(void)
+		{ /* void */ }
+
+#undef _nc_free_and_exit_sp
+void	_nc_free_and_exit_sp(
+		SCREEN	*sp, 
+		int	code)
+		{ /* void */ }
+
+#undef _nc_free_and_exit
+void	_nc_free_and_exit(
+		int	code)
+		{ /* void */ }
+
+/* ./widechar/charable.c */
+
+#undef _nc_is_charable
+NCURSES_BOOL _nc_is_charable(
+		wchar_t	ch)
+		{ return(*(NCURSES_BOOL *)0); }
+
+#undef _nc_to_char
+int	_nc_to_char(
+		wint_t	ch)
+		{ return(*(int *)0); }
+
+#undef _nc_to_widechar
+wint_t	_nc_to_widechar(
+		int	ch)
+		{ return(*(wint_t *)0); }
+
+/* ./widechar/lib_add_wch.c */
+
+#undef wadd_wch
+int	wadd_wch(
+		WINDOW	*win, 
+		const cchar_t *wch)
+		{ return(*(int *)0); }
+
+#undef wecho_wchar
+int	wecho_wchar(
+		WINDOW	*win, 
+		const cchar_t *wch)
+		{ return(*(int *)0); }
+
+/* ./widechar/lib_box_set.c */
+
+#undef wborder_set
+int	wborder_set(
+		WINDOW	*win, 
+		const cchar_t *ls, 
+		const cchar_t *rs, 
+		const cchar_t *ts, 
+		const cchar_t *bs, 
+		const cchar_t *tl, 
+		const cchar_t *tr, 
+		const cchar_t *bl, 
+		const cchar_t *br)
+		{ return(*(int *)0); }
+
+/* ./widechar/lib_cchar.c */
+
+#undef setcchar
+int	setcchar(
+		cchar_t	*wcval, 
+		const wchar_t *wch, 
+		const attr_t attrs, 
+		short	color_pair, 
+		const void *opts)
+		{ return(*(int *)0); }
+
+#undef getcchar
+int	getcchar(
+		const cchar_t *wcval, 
+		wchar_t	*wch, 
+		attr_t	*attrs, 
+		short	*color_pair, 
+		void	*opts)
+		{ return(*(int *)0); }
+
+/* ./widechar/lib_erasewchar.c */
+
+#undef erasewchar
+int	erasewchar(
+		wchar_t	*wch)
+		{ return(*(int *)0); }
+
+#undef killwchar
+int	killwchar(
+		wchar_t	*wch)
+		{ return(*(int *)0); }
+
+/* ./widechar/lib_get_wch.c */
+
+#undef wget_wch
+int	wget_wch(
+		WINDOW	*win, 
+		wint_t	*result)
+		{ return(*(int *)0); }
+
+/* ./widechar/lib_get_wstr.c */
+
+#undef wgetn_wstr
+int	wgetn_wstr(
+		WINDOW	*win, 
+		wint_t	*str, 
+		int	maxlen)
+		{ return(*(int *)0); }
+
+/* ./widechar/lib_hline_set.c */
+
+#undef whline_set
+int	whline_set(
+		WINDOW	*win, 
+		const cchar_t *ch, 
+		int	n)
+		{ return(*(int *)0); }
+
+/* ./widechar/lib_in_wch.c */
+
+#undef win_wch
+int	win_wch(
+		WINDOW	*win, 
+		cchar_t	*wcval)
+		{ return(*(int *)0); }
+
+/* ./widechar/lib_in_wchnstr.c */
+
+#undef win_wchnstr
+int	win_wchnstr(
+		WINDOW	*win, 
+		cchar_t	*wchstr, 
+		int	n)
+		{ return(*(int *)0); }
+
+/* ./widechar/lib_ins_wch.c */
+
+#undef _nc_insert_wch
+int	_nc_insert_wch(
+		WINDOW	*win, 
+		const cchar_t *wch)
+		{ return(*(int *)0); }
+
+#undef wins_wch
+int	wins_wch(
+		WINDOW	*win, 
+		const cchar_t *wch)
+		{ return(*(int *)0); }
+
+#undef wins_nwstr
+int	wins_nwstr(
+		WINDOW	*win, 
+		const wchar_t *wstr, 
+		int	n)
+		{ return(*(int *)0); }
+
+/* ./widechar/lib_inwstr.c */
+
+#undef winnwstr
+int	winnwstr(
+		WINDOW	*win, 
+		wchar_t	*wstr, 
+		int	n)
+		{ return(*(int *)0); }
+
+#undef winwstr
+int	winwstr(
+		WINDOW	*win, 
+		wchar_t	*wstr)
+		{ return(*(int *)0); }
+
+/* ./widechar/lib_key_name.c */
+
+#undef key_name
+char	*key_name(
+		wchar_t	c)
+		{ return(*(char **)0); }
+
+/* ./widechar/lib_pecho_wchar.c */
+
+#undef pecho_wchar
+int	pecho_wchar(
+		WINDOW	*pad, 
+		const cchar_t *wch)
+		{ return(*(int *)0); }
+
+/* ./widechar/lib_slk_wset.c */
+
+#undef slk_wset
+int	slk_wset(
+		int	i, 
+		const wchar_t *astr, 
+		int	format)
+		{ return(*(int *)0); }
+
+/* ./widechar/lib_unget_wch.c */
+
+#undef _nc_wcrtomb
+size_t	_nc_wcrtomb(
+		char	*target, 
+		wchar_t	source, 
+		mbstate_t *state)
+		{ return(*(size_t *)0); }
+
+#undef unget_wch_sp
+int	unget_wch_sp(
+		SCREEN	*sp, 
+		const wchar_t wch)
+		{ return(*(int *)0); }
+
+#undef unget_wch
+int	unget_wch(
+		const wchar_t wch)
+		{ return(*(int *)0); }
+
+/* ./widechar/lib_vid_attr.c */
+
+#include <term.h>
+
+#undef vid_puts_sp
+int	vid_puts_sp(
+		SCREEN	*sp, 
+		attr_t	newmode, 
+		short	pair, 
+		void	*opts, 
+		NCURSES_OUTC_sp outc)
+		{ return(*(int *)0); }
+
+#undef vid_puts
+int	vid_puts(
+		attr_t	newmode, 
+		short	pair, 
+		void	*opts, 
+		NCURSES_OUTC outc)
+		{ return(*(int *)0); }
+
+#undef vid_attr_sp
+int	vid_attr_sp(
+		SCREEN	*sp, 
+		attr_t	newmode, 
+		short	pair, 
+		void	*opts)
+		{ return(*(int *)0); }
+
+#undef vid_attr
+int	vid_attr(
+		attr_t	newmode, 
+		short	pair, 
+		void	*opts)
+		{ return(*(int *)0); }
+
+#undef term_attrs_sp
+attr_t	term_attrs_sp(
+		SCREEN	*sp)
+		{ return(*(attr_t *)0); }
+
+#undef term_attrs
+attr_t	term_attrs(void)
+		{ return(*(attr_t *)0); }
+
+/* ./widechar/lib_vline_set.c */
+
+#undef wvline_set
+int	wvline_set(
+		WINDOW	*win, 
+		const cchar_t *ch, 
+		int	n)
+		{ return(*(int *)0); }
+
+/* ./widechar/lib_wacs.c */
+
+#undef _nc_wacs
+cchar_t	*_nc_wacs;
+
+#undef _nc_init_wacs
+void	_nc_init_wacs(void)
+		{ /* void */ }
+
+/* ./widechar/lib_wunctrl.c */
+
+#undef wunctrl_sp
+wchar_t	*wunctrl_sp(
+		SCREEN	*sp, 
+		cchar_t	*wc)
+		{ return(*(wchar_t **)0); }
+
+#undef wunctrl
+wchar_t	*wunctrl(
+		cchar_t	*wc)
+		{ return(*(wchar_t **)0); }
+
+/* ./expanded.c */
+
+#undef _nc_toggle_attr_on
+void	_nc_toggle_attr_on(
+		attr_t	*S, 
+		attr_t	at)
+		{ /* void */ }
+
+#undef _nc_toggle_attr_off
+void	_nc_toggle_attr_off(
+		attr_t	*S, 
+		attr_t	at)
+		{ /* void */ }
+
+#undef _nc_DelCharCost_sp
+int	_nc_DelCharCost_sp(
+		SCREEN	*sp, 
+		int	count)
+		{ return(*(int *)0); }
+
+#undef _nc_InsCharCost_sp
+int	_nc_InsCharCost_sp(
+		SCREEN	*sp, 
+		int	count)
+		{ return(*(int *)0); }
+
+#undef _nc_UpdateAttrs_sp
+void	_nc_UpdateAttrs_sp(
+		SCREEN	*sp, 
+		const cchar_t *c)
+		{ /* void */ }
+
+#undef _nc_DelCharCost
+int	_nc_DelCharCost(
+		int	count)
+		{ return(*(int *)0); }
+
+#undef _nc_InsCharCost
+int	_nc_InsCharCost(
+		int	count)
+		{ return(*(int *)0); }
+
+#undef _nc_UpdateAttrs
+void	_nc_UpdateAttrs(
+		const cchar_t *c)
+		{ /* void */ }
+
+/* ./base/legacy_coding.c */
+
+#undef use_legacy_coding_sp
+int	use_legacy_coding_sp(
+		SCREEN	*sp, 
+		int	level)
+		{ return(*(int *)0); }
+
+#undef use_legacy_coding
+int	use_legacy_coding(
+		int	level)
+		{ return(*(int *)0); }
+
+/* ./base/lib_dft_fgbg.c */
+
+#undef use_default_colors_sp
+int	use_default_colors_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
+#undef use_default_colors
+int	use_default_colors(void)
+		{ return(*(int *)0); }
+
+#undef assume_default_colors_sp
+int	assume_default_colors_sp(
+		SCREEN	*sp, 
+		int	fg, 
+		int	bg)
+		{ return(*(int *)0); }
+
+#undef assume_default_colors
+int	assume_default_colors(
+		int	fg, 
+		int	bg)
+		{ return(*(int *)0); }
+
+/* ./tinfo/lib_print.c */
+
+#undef mcprint_sp
+int	mcprint_sp(
+		SCREEN	*sp, 
+		char	*data, 
+		int	len)
+		{ return(*(int *)0); }
+
+#undef mcprint
+int	mcprint(
+		char	*data, 
+		int	len)
+		{ return(*(int *)0); }
+
+/* ./base/resizeterm.c */
+
+#undef is_term_resized_sp
+NCURSES_BOOL is_term_resized_sp(
+		SCREEN	*sp, 
+		int	ToLines, 
+		int	ToCols)
+		{ return(*(NCURSES_BOOL *)0); }
+
+#undef is_term_resized
+NCURSES_BOOL is_term_resized(
+		int	ToLines, 
+		int	ToCols)
+		{ return(*(NCURSES_BOOL *)0); }
+
+#undef resize_term_sp
+int	resize_term_sp(
+		SCREEN	*sp, 
+		int	ToLines, 
+		int	ToCols)
+		{ return(*(int *)0); }
+
+#undef resize_term
+int	resize_term(
+		int	ToLines, 
+		int	ToCols)
+		{ return(*(int *)0); }
+
+#undef resizeterm_sp
+int	resizeterm_sp(
+		SCREEN	*sp, 
+		int	ToLines, 
+		int	ToCols)
+		{ return(*(int *)0); }
+
+#undef resizeterm
+int	resizeterm(
+		int	ToLines, 
+		int	ToCols)
+		{ return(*(int *)0); }
+
+/* ./trace/trace_xnames.c */
+
+#undef _nc_trace_xnames
+void	_nc_trace_xnames(
+		TERMTYPE *tp)
+		{ /* void */ }
+
+/* ./tinfo/use_screen.c */
+
+#undef use_screen
+int	use_screen(
+		SCREEN	*screen, 
+		NCURSES_SCREEN_CB func, 
+		void	*data)
+		{ return(*(int *)0); }
+
+/* ./base/use_window.c */
+
+#undef use_window
+int	use_window(
+		WINDOW	*win, 
+		NCURSES_WINDOW_CB func, 
+		void	*data)
+		{ return(*(int *)0); }
+
+/* ./base/wresize.c */
+
+#undef wresize
+int	wresize(
+		WINDOW	*win, 
+		int	ToLines, 
+		int	ToCols)
+		{ return(*(int *)0); }
+
+/* ./tinfo/access.c */
+
+#include <sys/stat.h>
+#include <nc_alloc.h>
+
+#undef _nc_rootname
+char	*_nc_rootname(
+		char	*path)
+		{ return(*(char **)0); }
+
+#undef _nc_is_abs_path
+NCURSES_BOOL _nc_is_abs_path(
+		const char *path)
+		{ return(*(NCURSES_BOOL *)0); }
+
+#undef _nc_pathlast
+unsigned _nc_pathlast(
+		const char *path)
+		{ return(*(unsigned *)0); }
+
+#undef _nc_basename
+char	*_nc_basename(
+		char	*path)
+		{ return(*(char **)0); }
+
+#undef _nc_access
+int	_nc_access(
+		const char *path, 
+		int	mode)
+		{ return(*(int *)0); }
+
+#undef _nc_is_dir_path
+NCURSES_BOOL _nc_is_dir_path(
+		const char *path)
+		{ return(*(NCURSES_BOOL *)0); }
+
+#undef _nc_is_file_path
+NCURSES_BOOL _nc_is_file_path(
+		const char *path)
+		{ return(*(NCURSES_BOOL *)0); }
+
+#undef _nc_env_access
+int	_nc_env_access(void)
+		{ return(*(int *)0); }
+
+/* ./tinfo/add_tries.c */
+
+#undef _nc_add_to_try
+int	_nc_add_to_try(
+		TRIES	**tree, 
+		const char *str, 
+		unsigned code)
+		{ return(*(int *)0); }
+
+/* ./tinfo/alloc_ttype.c */
+
+#undef _nc_align_termtype
+void	_nc_align_termtype(
+		TERMTYPE *to, 
+		TERMTYPE *from)
+		{ /* void */ }
+
+#undef _nc_copy_termtype
+void	_nc_copy_termtype(
+		TERMTYPE *dst, 
+		TERMTYPE *src)
+		{ /* void */ }
+
+/* ./codes.c */
+
+#undef _nc_boolcodes
+char	*const *_nc_boolcodes(void)
+		{ return(*(char **)0); }
+
+#undef _nc_numcodes
+char	*const *_nc_numcodes(void)
+		{ return(*(char **)0); }
+
+#undef _nc_strcodes
+char	*const *_nc_strcodes(void)
+		{ return(*(char **)0); }
+
+/* ./comp_captab.c */
+
+#include <hashsize.h>
+
+#undef _nc_get_table
+const struct name_table_entry *_nc_get_table(
+		NCURSES_BOOL termcap)
+		{ return(*(const struct name_table_entry **)0); }
+
+#undef _nc_get_hash_table
+const HashValue *_nc_get_hash_table(
+		NCURSES_BOOL termcap)
+		{ return(*(const HashValue **)0); }
+
+#undef _nc_get_alias_table
+const struct alias *_nc_get_alias_table(
+		NCURSES_BOOL termcap)
+		{ return(*(const struct alias **)0); }
+
+#undef _nc_get_hash_info
+const HashData *_nc_get_hash_info(
+		NCURSES_BOOL termcap)
+		{ return(*(const HashData **)0); }
+
+/* ./tinfo/comp_error.c */
+
+#undef _nc_suppress_warnings
+NCURSES_BOOL _nc_suppress_warnings;
+#undef _nc_curr_line
+int	_nc_curr_line;
+#undef _nc_curr_col
+int	_nc_curr_col;
+
+#undef _nc_get_source
+const char *_nc_get_source(void)
+		{ return(*(const char **)0); }
+
+#undef _nc_set_source
+void	_nc_set_source(
+		const char *const name)
+		{ /* void */ }
+
+#undef _nc_set_type
+void	_nc_set_type(
+		const char *const name)
+		{ /* void */ }
+
+#undef _nc_get_type
+void	_nc_get_type(
+		char	*name)
+		{ /* void */ }
+
+#undef _nc_warning
+void	_nc_warning(
+		const char *const fmt, 
+		...)
+		{ /* void */ }
+
+#undef _nc_err_abort
+void	_nc_err_abort(
+		const char *const fmt, 
+		...)
+		{ /* void */ }
+
+#undef _nc_syserr_abort
+void	_nc_syserr_abort(
+		const char *const fmt, 
+		...)
+		{ /* void */ }
+
+/* ./tinfo/comp_hash.c */
+
+#undef _nc_find_entry
+struct name_table_entry const *_nc_find_entry(
+		const char *string, 
+		const HashValue *hash_table)
+		{ return(*(struct name_table_entry const **)0); }
+
+#undef _nc_find_type_entry
+struct name_table_entry const *_nc_find_type_entry(
+		const char *string, 
+		int	type, 
+		NCURSES_BOOL termcap)
+		{ return(*(struct name_table_entry const **)0); }
+
+/* ./tinfo/db_iterator.c */
+
+#undef _nc_tic_dir
+const char *_nc_tic_dir(
+		const char *path)
+		{ return(*(const char **)0); }
+
+#undef _nc_keep_tic_dir
+void	_nc_keep_tic_dir(
+		const char *path)
+		{ /* void */ }
+
+#undef _nc_last_db
+void	_nc_last_db(void)
+		{ /* void */ }
+
+#undef _nc_next_db
+const char *_nc_next_db(
+		DBDIRS	*state, 
+		int	*offset)
+		{ return(*(const char **)0); }
+
+#undef _nc_first_db
+void	_nc_first_db(
+		DBDIRS	*state, 
+		int	*offset)
+		{ /* void */ }
+
+/* ./tinfo/doalloc.c */
+
+#undef _nc_doalloc
+void	*_nc_doalloc(
+		void	*oldp, 
+		size_t	amount)
+		{ return(*(void **)0); }
+
+/* ./tinfo/entries.c */
+
+#undef _nc_head
+ENTRY	*_nc_head;
+#undef _nc_tail
+ENTRY	*_nc_tail;
+
+#undef _nc_free_entry
+void	_nc_free_entry(
+		ENTRY	*headp, 
+		TERMTYPE *tterm)
+		{ /* void */ }
+
+#undef _nc_free_entries
+void	_nc_free_entries(
+		ENTRY	*headp)
+		{ /* void */ }
+
+#undef _nc_delink_entry
+ENTRY	*_nc_delink_entry(
+		ENTRY	*headp, 
+		TERMTYPE *tterm)
+		{ return(*(ENTRY **)0); }
+
+#undef _nc_leaks_tinfo
+void	_nc_leaks_tinfo(void)
+		{ /* void */ }
+
+/* ./fallback.c */
+
+#undef _nc_fallback
+const TERMTYPE *_nc_fallback(
+		const char *name)
+		{ return(*(const TERMTYPE **)0); }
+
+/* ./tinfo/free_ttype.c */
+
+#undef _nc_free_termtype
+void	_nc_free_termtype(
+		TERMTYPE *ptr)
+		{ /* void */ }
+
+#undef _nc_user_definable
+NCURSES_BOOL _nc_user_definable;
+
+#undef use_extended_names
+int	use_extended_names(
+		NCURSES_BOOL flag)
+		{ return(*(int *)0); }
+
+/* ./tinfo/getenv_num.c */
+
+#undef _nc_getenv_num
+int	_nc_getenv_num(
+		const char *name)
+		{ return(*(int *)0); }
+
+/* ./tinfo/home_terminfo.c */
+
+#undef _nc_home_terminfo
+char	*_nc_home_terminfo(void)
+		{ return(*(char **)0); }
+
+/* ./tinfo/init_keytry.c */
+
+#if 0
+
+#include <init_keytry.h>
+
+#undef _nc_tinfo_fkeys
+const struct tinfo_fkeys _nc_tinfo_fkeys[] = {0};
+
+#endif
+
+#undef _nc_init_keytry
+void	_nc_init_keytry(
+		SCREEN	*sp)
+		{ /* void */ }
+
+/* ./tinfo/lib_acs.c */
+
+#undef _nc_acs_map
+chtype	*_nc_acs_map(void)
+		{ return(*(chtype **)0); }
+
+#undef _nc_init_acs_sp
+void	_nc_init_acs_sp(
+		SCREEN	*sp)
+		{ /* void */ }
+
+#undef _nc_init_acs
+void	_nc_init_acs(void)
+		{ /* void */ }
+
+/* ./tinfo/lib_baudrate.c */
+
+#include <termcap.h>
+
+struct speed {
+    int s; 
+    int sp; 
+};
+
+#undef _nc_baudrate
+int	_nc_baudrate(
+		int	OSpeed)
+		{ return(*(int *)0); }
+
+#undef _nc_ospeed
+int	_nc_ospeed(
+		int	BaudRate)
+		{ return(*(int *)0); }
+
+#undef baudrate_sp
+int	baudrate_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
+#undef baudrate
+int	baudrate(void)
+		{ return(*(int *)0); }
+
+/* ./tinfo/lib_cur_term.c */
+
+#undef _nc_get_cur_term_sp
+TERMINAL *_nc_get_cur_term_sp(
+		SCREEN	*sp)
+		{ return(*(TERMINAL **)0); }
+
+#undef _nc_get_cur_term
+TERMINAL *_nc_get_cur_term(void)
+		{ return(*(TERMINAL **)0); }
+
+#undef _nc_cur_term
+TERMINAL *_nc_cur_term(void)
+		{ return(*(TERMINAL **)0); }
+
+#undef set_curterm_sp
+TERMINAL *set_curterm_sp(
+		SCREEN	*sp, 
+		TERMINAL *termp)
+		{ return(*(TERMINAL **)0); }
+
+#undef set_curterm
+TERMINAL *set_curterm(
+		TERMINAL *termp)
+		{ return(*(TERMINAL **)0); }
+
+#undef del_curterm_sp
+int	del_curterm_sp(
+		SCREEN	*sp, 
+		TERMINAL *termp)
+		{ return(*(int *)0); }
+
+#undef del_curterm
+int	del_curterm(
+		TERMINAL *termp)
+		{ return(*(int *)0); }
+
+/* ./tinfo/lib_data.c */
+
+#undef _nc_stdscr
+WINDOW	*_nc_stdscr(void)
+		{ return(*(WINDOW **)0); }
+
+#undef _nc_curscr
+WINDOW	*_nc_curscr(void)
+		{ return(*(WINDOW **)0); }
+
+#undef _nc_newscr
+WINDOW	*_nc_newscr(void)
+		{ return(*(WINDOW **)0); }
+
+#undef _nc_screen_chain
+SCREEN	*_nc_screen_chain;
+#undef SP
+SCREEN	*SP;
+#undef _nc_globals
+NCURSES_GLOBALS _nc_globals;
+#undef _nc_prescreen
+NCURSES_PRESCREEN _nc_prescreen;
+
+#undef _nc_screen_of
+SCREEN	*_nc_screen_of(
+		WINDOW	*win)
+		{ return(*(SCREEN **)0); }
+
+#undef _nc_init_pthreads
+void	_nc_init_pthreads(void)
+		{ /* void */ }
+
+#undef _nc_mutex_init
+void	_nc_mutex_init(
+		pthread_mutex_t *obj)
+		{ /* void */ }
+
+#undef _nc_mutex_lock
+int	_nc_mutex_lock(
+		pthread_mutex_t *obj)
+		{ return(*(int *)0); }
+
+#undef _nc_mutex_trylock
+int	_nc_mutex_trylock(
+		pthread_mutex_t *obj)
+		{ return(*(int *)0); }
+
+#undef _nc_mutex_unlock
+int	_nc_mutex_unlock(
+		pthread_mutex_t *obj)
+		{ return(*(int *)0); }
+
+/* ./tinfo/lib_has_cap.c */
+
+#undef has_ic_sp
+NCURSES_BOOL has_ic_sp(
+		SCREEN	*sp)
+		{ return(*(NCURSES_BOOL *)0); }
+
+#undef has_ic
+NCURSES_BOOL has_ic(void)
+		{ return(*(NCURSES_BOOL *)0); }
+
+#undef has_il_sp
+NCURSES_BOOL has_il_sp(
+		SCREEN	*sp)
+		{ return(*(NCURSES_BOOL *)0); }
+
+#undef has_il
+NCURSES_BOOL has_il(void)
+		{ return(*(NCURSES_BOOL *)0); }
+
+/* ./tinfo/lib_kernel.c */
+
+#undef erasechar_sp
+char	erasechar_sp(
+		SCREEN	*sp)
+		{ return(*(char *)0); }
+
+#undef erasechar
+char	erasechar(void)
+		{ return(*(char *)0); }
+
+#undef killchar_sp
+char	killchar_sp(
+		SCREEN	*sp)
+		{ return(*(char *)0); }
+
+#undef killchar
+char	killchar(void)
+		{ return(*(char *)0); }
+
+#undef flushinp_sp
+int	flushinp_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
+#undef flushinp
+int	flushinp(void)
+		{ return(*(int *)0); }
+
+/* ./lib_keyname.c */
+
+struct kn { short offset; int code; };
+
+#undef keyname_sp
+char	*keyname_sp(
+		SCREEN	*sp, 
+		int	c)
+		{ return(*(char **)0); }
+
+#undef keyname
+char	*keyname(
+		int	c)
+		{ return(*(char **)0); }
+
+/* ./tinfo/lib_longname.c */
+
+#undef longname_sp
+char	*longname_sp(
+		SCREEN	*sp)
+		{ return(*(char **)0); }
+
+#undef longname
+char	*longname(void)
+		{ return(*(char **)0); }
+
+/* ./tinfo/lib_napms.c */
+
+#undef napms_sp
+int	napms_sp(
+		SCREEN	*sp, 
+		int	ms)
+		{ return(*(int *)0); }
+
+#undef napms
+int	napms(
+		int	ms)
+		{ return(*(int *)0); }
+
+/* ./tinfo/lib_options.c */
+
+#undef idlok
+int	idlok(
+		WINDOW	*win, 
+		NCURSES_BOOL flag)
+		{ return(*(int *)0); }
+
+#undef idcok
+void	idcok(
+		WINDOW	*win, 
+		NCURSES_BOOL flag)
+		{ /* void */ }
+
+#undef halfdelay_sp
+int	halfdelay_sp(
+		SCREEN	*sp, 
+		int	t)
+		{ return(*(int *)0); }
+
+#undef halfdelay
+int	halfdelay(
+		int	t)
+		{ return(*(int *)0); }
+
+#undef nodelay
+int	nodelay(
+		WINDOW	*win, 
+		NCURSES_BOOL flag)
+		{ return(*(int *)0); }
+
+#undef notimeout
+int	notimeout(
+		WINDOW	*win, 
+		NCURSES_BOOL f)
+		{ return(*(int *)0); }
+
+#undef wtimeout
+void	wtimeout(
+		WINDOW	*win, 
+		int	delay)
+		{ /* void */ }
+
+#undef keypad
+int	keypad(
+		WINDOW	*win, 
+		NCURSES_BOOL flag)
+		{ return(*(int *)0); }
+
+#undef meta
+int	meta(
+		WINDOW	*win, 
+		NCURSES_BOOL flag)
+		{ return(*(int *)0); }
+
+#undef curs_set_sp
+int	curs_set_sp(
+		SCREEN	*sp, 
+		int	vis)
+		{ return(*(int *)0); }
+
+#undef curs_set
+int	curs_set(
+		int	vis)
+		{ return(*(int *)0); }
+
+#undef typeahead_sp
+int	typeahead_sp(
+		SCREEN	*sp, 
+		int	fd)
+		{ return(*(int *)0); }
+
+#undef typeahead
+int	typeahead(
+		int	fd)
+		{ return(*(int *)0); }
+
+#undef has_key_sp
+int	has_key_sp(
+		SCREEN	*sp, 
+		int	keycode)
+		{ return(*(int *)0); }
+
+#undef has_key
+int	has_key(
+		int	keycode)
+		{ return(*(int *)0); }
+
+#undef _nc_putp_flush_sp
+int	_nc_putp_flush_sp(
+		SCREEN	*sp, 
+		const char *name, 
+		const char *value)
+		{ return(*(int *)0); }
+
+#undef _nc_keypad
+int	_nc_keypad(
+		SCREEN	*sp, 
+		NCURSES_BOOL flag)
+		{ return(*(int *)0); }
+
+/* ./tinfo/lib_raw.c */
+
+#undef raw_sp
+int	raw_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
+#undef raw
+int	raw(void)
+		{ return(*(int *)0); }
+
+#undef cbreak_sp
+int	cbreak_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
+#undef cbreak
+int	cbreak(void)
+		{ return(*(int *)0); }
+
+#undef qiflush_sp
+void	qiflush_sp(
+		SCREEN	*sp)
+		{ /* void */ }
+
+#undef qiflush
+void	qiflush(void)
+		{ /* void */ }
+
+#undef noraw_sp
+int	noraw_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
+#undef noraw
+int	noraw(void)
+		{ return(*(int *)0); }
+
+#undef nocbreak_sp
+int	nocbreak_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
+#undef nocbreak
+int	nocbreak(void)
+		{ return(*(int *)0); }
+
+#undef noqiflush_sp
+void	noqiflush_sp(
+		SCREEN	*sp)
+		{ /* void */ }
+
+#undef noqiflush
+void	noqiflush(void)
+		{ /* void */ }
+
+#undef intrflush_sp
+int	intrflush_sp(
+		SCREEN	*sp, 
+		WINDOW	*win, 
+		NCURSES_BOOL flag)
+		{ return(*(int *)0); }
+
+#undef intrflush
+int	intrflush(
+		WINDOW	*win, 
+		NCURSES_BOOL flag)
+		{ return(*(int *)0); }
+
+/* ./tinfo/lib_setup.c */
+
+#include <locale.h>
+#include <sys/ioctl.h>
+#include <langinfo.h>
+
+#undef _nc_ttytype
+char	*_nc_ttytype(void)
+		{ return(*(char **)0); }
+
+#undef _nc_ptr_Lines
+int	*_nc_ptr_Lines(
+		SCREEN	*sp)
+		{ return(*(int **)0); }
+
+#undef _nc_LINES
+int	_nc_LINES(void)
+		{ return(*(int *)0); }
+
+#undef _nc_ptr_Cols
+int	*_nc_ptr_Cols(
+		SCREEN	*sp)
+		{ return(*(int **)0); }
+
+#undef _nc_COLS
+int	_nc_COLS(void)
+		{ return(*(int *)0); }
+
+#undef _nc_ptr_Tabsize
+int	*_nc_ptr_Tabsize(
+		SCREEN	*sp)
+		{ return(*(int **)0); }
+
+#undef _nc_TABSIZE
+int	_nc_TABSIZE(void)
+		{ return(*(int *)0); }
+
+#undef set_tabsize_sp
+int	set_tabsize_sp(
+		SCREEN	*sp, 
+		int	value)
+		{ return(*(int *)0); }
+
+#undef set_tabsize
+int	set_tabsize(
+		int	value)
+		{ return(*(int *)0); }
+
+#undef _nc_handle_sigwinch
+int	_nc_handle_sigwinch(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
+#undef use_env_sp
+void	use_env_sp(
+		SCREEN	*sp, 
+		NCURSES_BOOL f)
+		{ /* void */ }
+
+#undef use_env
+void	use_env(
+		NCURSES_BOOL f)
+		{ /* void */ }
+
+#undef _nc_get_screensize
+void	_nc_get_screensize(
+		SCREEN	*sp, 
+		int	*linep, 
+		int	*colp)
+		{ /* void */ }
+
+#undef _nc_update_screensize
+void	_nc_update_screensize(
+		SCREEN	*sp)
+		{ /* void */ }
+
+#undef _nc_tinfo_cmdch
+void	_nc_tinfo_cmdch(
+		TERMINAL *termp, 
+		char	proto)
+		{ /* void */ }
+
+#undef _nc_get_locale
+char	*_nc_get_locale(void)
+		{ return(*(char **)0); }
+
+#undef _nc_unicode_locale
+int	_nc_unicode_locale(void)
+		{ return(*(int *)0); }
+
+#undef _nc_locale_breaks_acs
+int	_nc_locale_breaks_acs(
+		TERMINAL *termp)
+		{ return(*(int *)0); }
+
+#undef _nc_setupterm
+int	_nc_setupterm(
+		char	*tname, 
+		int	Filedes, 
+		int	*errret, 
+		NCURSES_BOOL reuse)
+		{ return(*(int *)0); }
+
+#undef new_prescr
+SCREEN	*new_prescr(void)
+		{ return(*(SCREEN **)0); }
+
+#undef setupterm
+int	setupterm(
+		char	*tname, 
+		int	Filedes, 
+		int	*errret)
+		{ return(*(int *)0); }
+
+/* ./tinfo/lib_termcap.c */
+
+#undef UP
+char	*UP;
+#undef BC
+char	*BC;
+
+#undef tgetent_sp
+int	tgetent_sp(
+		SCREEN	*sp, 
+		char	*bufp, 
+		const char *name)
+		{ return(*(int *)0); }
+
+#if 0
+
+#include <capdefaults.c>
+
+#endif
+
+#undef tgetent
+int	tgetent(
+		char	*bufp, 
+		const char *name)
+		{ return(*(int *)0); }
+
+#undef tgetflag_sp
+int	tgetflag_sp(
+		SCREEN	*sp, 
+		char	*id)
+		{ return(*(int *)0); }
+
+#undef tgetflag
+int	tgetflag(
+		char	*id)
+		{ return(*(int *)0); }
+
+#undef tgetnum_sp
+int	tgetnum_sp(
+		SCREEN	*sp, 
+		char	*id)
+		{ return(*(int *)0); }
+
+#undef tgetnum
+int	tgetnum(
+		char	*id)
+		{ return(*(int *)0); }
+
+#undef tgetstr_sp
+char	*tgetstr_sp(
+		SCREEN	*sp, 
+		char	*id, 
+		char	**area)
+		{ return(*(char **)0); }
+
+#undef tgetstr
+char	*tgetstr(
+		char	*id, 
+		char	**area)
+		{ return(*(char **)0); }
+
+/* ./tinfo/lib_termname.c */
+
+#undef termname_sp
+char	*termname_sp(
+		SCREEN	*sp)
+		{ return(*(char **)0); }
+
+#undef termname
+char	*termname(void)
+		{ return(*(char **)0); }
+
+/* ./tinfo/lib_tgoto.c */
+
+#undef tgoto
+char	*tgoto(
+		const char *string, 
+		int	x, 
+		int	y)
+		{ return(*(char **)0); }
+
+/* ./tinfo/lib_ti.c */
+
+#undef tigetflag_sp
+int	tigetflag_sp(
+		SCREEN	*sp, 
+		char	*str)
+		{ return(*(int *)0); }
+
+#undef tigetflag
+int	tigetflag(
+		char	*str)
+		{ return(*(int *)0); }
+
+#undef tigetnum_sp
+int	tigetnum_sp(
+		SCREEN	*sp, 
+		char	*str)
+		{ return(*(int *)0); }
+
+#undef tigetnum
+int	tigetnum(
+		char	*str)
+		{ return(*(int *)0); }
+
+#undef tigetstr_sp
+char	*tigetstr_sp(
+		SCREEN	*sp, 
+		char	*str)
+		{ return(*(char **)0); }
+
+#undef tigetstr
+char	*tigetstr(
+		char	*str)
+		{ return(*(char **)0); }
+
+/* ./tinfo/lib_tparm.c */
+
+#undef _nc_tparm_err
+int	_nc_tparm_err;
+
+#undef _nc_tparm_analyze
+int	_nc_tparm_analyze(
+		const char *string, 
+		char	*p_is_s[9], 
+		int	*popcount)
+		{ return(*(int *)0); }
+
+#undef tparm
+char	*tparm(
+		char	*string, 
+		...)
+		{ return(*(char **)0); }
+
+#undef tiparm
+char	*tiparm(
+		const char *string, 
+		...)
+		{ return(*(char **)0); }
+
+/* ./tinfo/lib_tputs.c */
+
+#undef PC
+char	PC;
+#undef ospeed
+NCURSES_OSPEED	ospeed;
+#undef _nc_nulls_sent
+int	_nc_nulls_sent;
+
+#undef _nc_set_no_padding
+void	_nc_set_no_padding(
+		SCREEN	*sp)
+		{ /* void */ }
+
+#undef delay_output_sp
+int	delay_output_sp(
+		SCREEN	*sp, 
+		int	ms)
+		{ return(*(int *)0); }
+
+#undef delay_output
+int	delay_output(
+		int	ms)
+		{ return(*(int *)0); }
+
+#undef _nc_flush_sp
+void	_nc_flush_sp(
+		SCREEN	*sp)
+		{ /* void */ }
+
+#undef _nc_flush
+void	_nc_flush(void)
+		{ /* void */ }
+
+#undef _nc_outch_sp
+int	_nc_outch_sp(
+		SCREEN	*sp, 
+		int	ch)
+		{ return(*(int *)0); }
+
+#undef _nc_outch
+int	_nc_outch(
+		int	ch)
+		{ return(*(int *)0); }
+
+#undef putp_sp
+int	putp_sp(
+		SCREEN	*sp, 
+		const char *string)
+		{ return(*(int *)0); }
+
+#undef _nc_putp_sp
+int	_nc_putp_sp(
+		SCREEN	*sp, 
+		const char *name, 
+		const char *string)
+		{ return(*(int *)0); }
+
+#undef putp
+int	putp(
+		const char *string)
+		{ return(*(int *)0); }
+
+#undef _nc_putp
+int	_nc_putp(
+		const char *name, 
+		const char *string)
+		{ return(*(int *)0); }
+
+#undef tputs_sp
+int	tputs_sp(
+		SCREEN	*sp, 
+		const char *string, 
+		int	affcnt, 
+		NCURSES_OUTC_sp outc)
+		{ return(*(int *)0); }
+
+#undef _nc_outc_wrapper
+int	_nc_outc_wrapper(
+		SCREEN	*sp, 
+		int	c)
+		{ return(*(int *)0); }
+
+#undef tputs
+int	tputs(
+		const char *string, 
+		int	affcnt, 
+		int	(*outc)(
+		int	p1))
+		{ return(*(int *)0); }
+
+/* ./trace/lib_trace.c */
+
+#undef _nc_tracing
+unsigned _nc_tracing;
+
+#undef _nc__nc_tputs_trace
+const char *_nc__nc_tputs_trace(void)
+		{ return(*(const char **)0); }
+
+#undef _nc__nc_outchars
+long	_nc__nc_outchars(void)
+		{ return(*(long *)0); }
+
+#undef _nc_set_tputs_trace
+void	_nc_set_tputs_trace(
+		const char *s)
+		{ /* void */ }
+
+#undef _nc_count_outchars
+void	_nc_count_outchars(
+		long	increment)
+		{ /* void */ }
+
+#undef trace
+void	trace(
+		const unsigned int tracelevel)
+		{ /* void */ }
+
+#undef _tracef
+void	_tracef(
+		const char *fmt, 
+		...)
+		{ /* void */ }
+
+#undef _nc_retrace_bool
+NCURSES_BOOL _nc_retrace_bool(
+		NCURSES_BOOL code)
+		{ return(*(NCURSES_BOOL *)0); }
+
+#undef _nc_retrace_int
+int	_nc_retrace_int(
+		int	code)
+		{ return(*(int *)0); }
+
+#undef _nc_retrace_unsigned
+unsigned _nc_retrace_unsigned(
+		unsigned code)
+		{ return(*(unsigned *)0); }
+
+#undef _nc_retrace_ptr
+char	*_nc_retrace_ptr(
+		char	*code)
+		{ return(*(char **)0); }
+
+#undef _nc_retrace_cptr
+const char *_nc_retrace_cptr(
+		const char *code)
+		{ return(*(const char **)0); }
+
+#undef _nc_retrace_cvoid_ptr
+void	*_nc_retrace_cvoid_ptr(
+		void	*code)
+		{ return(*(void **)0); }
+
+#undef _nc_retrace_void_ptr
+void	*_nc_retrace_void_ptr(
+		void	*code)
+		{ return(*(void **)0); }
+
+#undef _nc_retrace_sp
+SCREEN	*_nc_retrace_sp(
+		SCREEN	*code)
+		{ return(*(SCREEN **)0); }
+
+#undef _nc_retrace_win
+WINDOW	*_nc_retrace_win(
+		WINDOW	*code)
+		{ return(*(WINDOW **)0); }
+
+#undef _nc_use_tracef
+int	_nc_use_tracef(
+		unsigned mask)
+		{ return(*(int *)0); }
+
+#undef _nc_locked_tracef
+void	_nc_locked_tracef(
+		const char *fmt, 
+		...)
+		{ /* void */ }
+
+/* ./trace/lib_traceatr.c */
+
+#undef _traceattr2
+char	*_traceattr2(
+		int	bufnum, 
+		chtype	newmode)
+		{ return(*(char **)0); }
+
+#undef _traceattr
+char	*_traceattr(
+		attr_t	newmode)
+		{ return(*(char **)0); }
+
+#undef _nc_retrace_attr_t
+attr_t	_nc_retrace_attr_t(
+		attr_t	code)
+		{ return(*(attr_t *)0); }
+
+#undef _nc_altcharset_name
+const char *_nc_altcharset_name(
+		attr_t	attr, 
+		chtype	ch)
+		{ return(*(const char **)0); }
+
+#undef _tracechtype2
+char	*_tracechtype2(
+		int	bufnum, 
+		chtype	ch)
+		{ return(*(char **)0); }
+
+#undef _tracechtype
+char	*_tracechtype(
+		chtype	ch)
+		{ return(*(char **)0); }
+
+#undef _nc_retrace_chtype
+chtype	_nc_retrace_chtype(
+		chtype	code)
+		{ return(*(chtype *)0); }
+
+#undef _tracecchar_t2
+char	*_tracecchar_t2(
+		int	bufnum, 
+		const cchar_t *ch)
+		{ return(*(char **)0); }
+
+#undef _tracecchar_t
+char	*_tracecchar_t(
+		const cchar_t *ch)
+		{ return(*(char **)0); }
+
+/* ./trace/lib_tracebits.c */
+
+typedef struct {
+    unsigned int val;
+    const char *name;
+} BITNAMES;
+
+#undef _nc_trace_ttymode
+char	*_nc_trace_ttymode(
+		struct termios *tty)
+		{ return(*(char **)0); }
+
+#undef _nc_tracebits
+char	*_nc_tracebits(void)
+		{ return(*(char **)0); }
+
+/* ./trace/lib_tracechr.c */
+
+#undef _nc_tracechar
+char	*_nc_tracechar(
+		SCREEN	*sp, 
+		int	ch)
+		{ return(*(char **)0); }
+
+#undef _tracechar
+char	*_tracechar(
+		int	ch)
+		{ return(*(char **)0); }
+
+/* ./tinfo/lib_ttyflags.c */
+
+#undef _nc_get_tty_mode_sp
+int	_nc_get_tty_mode_sp(
+		SCREEN	*sp, 
+		struct termios *buf)
+		{ return(*(int *)0); }
+
+#undef _nc_get_tty_mode
+int	_nc_get_tty_mode(
+		struct termios *buf)
+		{ return(*(int *)0); }
+
+#undef _nc_set_tty_mode_sp
+int	_nc_set_tty_mode_sp(
+		SCREEN	*sp, 
+		struct termios *buf)
+		{ return(*(int *)0); }
+
+#undef _nc_set_tty_mode
+int	_nc_set_tty_mode(
+		struct termios *buf)
+		{ return(*(int *)0); }
+
+#undef def_shell_mode_sp
+int	def_shell_mode_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
+#undef def_shell_mode
+int	def_shell_mode(void)
+		{ return(*(int *)0); }
+
+#undef def_prog_mode_sp
+int	def_prog_mode_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
+#undef def_prog_mode
+int	def_prog_mode(void)
+		{ return(*(int *)0); }
+
+#undef reset_prog_mode_sp
+int	reset_prog_mode_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
+#undef reset_prog_mode
+int	reset_prog_mode(void)
+		{ return(*(int *)0); }
+
+#undef reset_shell_mode_sp
+int	reset_shell_mode_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
+#undef reset_shell_mode
+int	reset_shell_mode(void)
+		{ return(*(int *)0); }
+
+#undef savetty_sp
+int	savetty_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
+#undef savetty
+int	savetty(void)
+		{ return(*(int *)0); }
+
+#undef resetty_sp
+int	resetty_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
+#undef resetty
+int	resetty(void)
+		{ return(*(int *)0); }
+
+/* ./tty/lib_twait.c */
+
+#undef _nc_timed_wait
+int	_nc_timed_wait(
+		SCREEN	*sp, 
+		int	mode, 
+		int	milliseconds, 
+		int	*timeleft)
+		{ return(*(int *)0); }
+
+/* ./tinfo/name_match.c */
+
+#undef _nc_first_name
+char	*_nc_first_name(
+		const char *const sp)
+		{ return(*(char **)0); }
+
+#undef _nc_name_match
+int	_nc_name_match(
+		const char *const namelst, 
+		const char *const name, 
+		const char *const delim)
+		{ return(*(int *)0); }
+
+/* ./names.c */
+
+#undef _nc_boolnames
+char	*const *_nc_boolnames(void)
+		{ return(*(char **)0); }
+
+#undef _nc_boolfnames
+char	*const *_nc_boolfnames(void)
+		{ return(*(char **)0); }
+
+#undef _nc_numnames
+char	*const *_nc_numnames(void)
+		{ return(*(char **)0); }
+
+#undef _nc_numfnames
+char	*const *_nc_numfnames(void)
+		{ return(*(char **)0); }
+
+#undef _nc_strnames
+char	*const *_nc_strnames(void)
+		{ return(*(char **)0); }
+
+#undef _nc_strfnames
+char	*const *_nc_strfnames(void)
+		{ return(*(char **)0); }
+
+/* ./tinfo/read_entry.c */
+
+#include <hashed_db.h>
+
+#undef _nc_read_termtype
+int	_nc_read_termtype(
+		TERMTYPE *ptr, 
+		char	*buffer, 
+		int	limit)
+		{ return(*(int *)0); }
+
+#undef _nc_read_file_entry
+int	_nc_read_file_entry(
+		const char *const filename, 
+		TERMTYPE *ptr)
+		{ return(*(int *)0); }
+
+#undef _nc_read_entry
+int	_nc_read_entry(
+		const char *const name, 
+		char	*const filename, 
+		TERMTYPE *const tp)
+		{ return(*(int *)0); }
+
+/* ./tinfo/read_termcap.c */
+
+#include <sys/types.h>
+
+#undef _nc_read_termcap_entry
+int	_nc_read_termcap_entry(
+		const char *const tn, 
+		TERMTYPE *const tp)
+		{ return(*(int *)0); }
+
+/* ./tinfo/setbuf.c */
+
+#undef _nc_set_buffer_sp
+void	_nc_set_buffer_sp(
+		SCREEN	*sp, 
+		FILE	*ofp, 
+		NCURSES_BOOL buffered)
+		{ /* void */ }
+
+#undef _nc_set_buffer
+void	_nc_set_buffer(
+		FILE	*ofp, 
+		NCURSES_BOOL buffered)
+		{ /* void */ }
+
+/* ./tinfo/strings.c */
+
+#undef _nc_str_init
+string_desc *_nc_str_init(
+		string_desc *dst, 
+		char	*src, 
+		size_t	len)
+		{ return(*(string_desc **)0); }
+
+#undef _nc_str_null
+string_desc *_nc_str_null(
+		string_desc *dst, 
+		size_t	len)
+		{ return(*(string_desc **)0); }
+
+#undef _nc_str_copy
+string_desc *_nc_str_copy(
+		string_desc *dst, 
+		string_desc *src)
+		{ return(*(string_desc **)0); }
+
+#undef _nc_safe_strcat
+NCURSES_BOOL _nc_safe_strcat(
+		string_desc *dst, 
+		const char *src)
+		{ return(*(NCURSES_BOOL *)0); }
+
+#undef _nc_safe_strcpy
+NCURSES_BOOL _nc_safe_strcpy(
+		string_desc *dst, 
+		const char *src)
+		{ return(*(NCURSES_BOOL *)0); }
+
+/* ./trace/trace_buf.c */
+
+#undef _nc_trace_buf
+char	*_nc_trace_buf(
+		int	bufnum, 
+		size_t	want)
+		{ return(*(char **)0); }
+
+#undef _nc_trace_bufcat
+char	*_nc_trace_bufcat(
+		int	bufnum, 
+		const char *value)
+		{ return(*(char **)0); }
+
+/* ./trace/trace_tries.c */
+
+#undef _nc_trace_tries
+void	_nc_trace_tries(
+		TRIES	*tree)
+		{ /* void */ }
+
+/* ./base/tries.c */
+
+#undef _nc_expand_try
+char	*_nc_expand_try(
+		TRIES	*tree, 
+		unsigned code, 
+		int	*count, 
+		size_t	len)
+		{ return(*(char **)0); }
+
+#undef _nc_remove_key
+int	_nc_remove_key(
+		TRIES	**tree, 
+		unsigned code)
+		{ return(*(int *)0); }
+
+#undef _nc_remove_string
+int	_nc_remove_string(
+		TRIES	**tree, 
+		const char *string)
+		{ return(*(int *)0); }
+
+/* ./tinfo/trim_sgr0.c */
+
+#undef _nc_trim_sgr0
+char	*_nc_trim_sgr0(
+		TERMTYPE *tp)
+		{ return(*(char **)0); }
+
+/* ./unctrl.c */
+
+#undef unctrl_sp
+char	*unctrl_sp(
+		SCREEN	*sp, 
+		chtype	ch)
+		{ return(*(char **)0); }
+
+#undef unctrl
+char	*unctrl(
+		chtype	ch)
+		{ return(*(char **)0); }
+
+/* ./trace/visbuf.c */
+
+#undef _nc_visbuf2
+const char *_nc_visbuf2(
+		int	bufnum, 
+		const char *buf)
+		{ return(*(const char **)0); }
+
+#undef _nc_visbuf
+const char *_nc_visbuf(
+		const char *buf)
+		{ return(*(const char **)0); }
+
+#undef _nc_visbufn
+const char *_nc_visbufn(
+		const char *buf, 
+		int	len)
+		{ return(*(const char **)0); }
+
+#undef _nc_viswbuf2
+const char *_nc_viswbuf2(
+		int	bufnum, 
+		const wchar_t *buf)
+		{ return(*(const char **)0); }
+
+#undef _nc_viswbuf
+const char *_nc_viswbuf(
+		const wchar_t *buf)
+		{ return(*(const char **)0); }
+
+#undef _nc_viswbufn
+const char *_nc_viswbufn(
+		const wchar_t *buf, 
+		int	len)
+		{ return(*(const char **)0); }
+
+#undef _nc_viswibuf
+const char *_nc_viswibuf(
+		const wint_t *buf)
+		{ return(*(const char **)0); }
+
+#undef _nc_viscbuf2
+const char *_nc_viscbuf2(
+		int	bufnum, 
+		const cchar_t *buf, 
+		int	len)
+		{ return(*(const char **)0); }
+
+#undef _nc_viscbuf
+const char *_nc_viscbuf(
+		const cchar_t *buf, 
+		int	len)
+		{ return(*(const char **)0); }
+
+/* ./tinfo/alloc_entry.c */
+
+#undef _nc_init_entry
+void	_nc_init_entry(
+		TERMTYPE *const tp)
+		{ /* void */ }
+
+#undef _nc_copy_entry
+ENTRY	*_nc_copy_entry(
+		ENTRY	*oldp)
+		{ return(*(ENTRY **)0); }
+
+#undef _nc_save_str
+char	*_nc_save_str(
+		const char *const string)
+		{ return(*(char **)0); }
+
+#undef _nc_wrap_entry
+void	_nc_wrap_entry(
+		ENTRY	*const ep, 
+		NCURSES_BOOL copy_strings)
+		{ /* void */ }
+
+#undef _nc_merge_entry
+void	_nc_merge_entry(
+		TERMTYPE *const to, 
+		TERMTYPE *const from)
+		{ /* void */ }
+
+/* ./tinfo/captoinfo.c */
+
+#undef _nc_captoinfo
+char	*_nc_captoinfo(
+		const char *cap, 
+		const char *s, 
+		int const parameterized)
+		{ return(*(char **)0); }
+
+#undef _nc_infotocap
+char	*_nc_infotocap(
+		const char *cap, 
+		const char *str, 
+		int const parameterized)
+		{ return(*(char **)0); }
+
+/* ./tinfo/comp_expand.c */
+
+#undef _nc_tic_expand
+char	*_nc_tic_expand(
+		const char *srcp, 
+		NCURSES_BOOL tic_format, 
+		int	numbers)
+		{ return(*(char **)0); }
+
+/* ./tinfo/comp_parse.c */
+
+#undef _nc_check_termtype2
+void	(*_nc_check_termtype2)(
+		TERMTYPE *p1, 
+		NCURSES_BOOL p2);
+#undef _nc_check_termtype
+void	(*_nc_check_termtype)(
+		TERMTYPE *p1);
+
+#undef _nc_entry_match
+NCURSES_BOOL _nc_entry_match(
+		char	*n1, 
+		char	*n2)
+		{ return(*(NCURSES_BOOL *)0); }
+
+#undef _nc_read_entry_source
+void	_nc_read_entry_source(
+		FILE	*fp, 
+		char	*buf, 
+		int	literal, 
+		NCURSES_BOOL silent, 
+		NCURSES_BOOL (*hook)(
+		ENTRY	*p1))
+		{ /* void */ }
+
+#undef _nc_resolve_uses2
+int	_nc_resolve_uses2(
+		NCURSES_BOOL fullresolve, 
+		NCURSES_BOOL literal)
+		{ return(*(int *)0); }
+
+#undef _nc_resolve_uses
+int	_nc_resolve_uses(
+		NCURSES_BOOL fullresolve)
+		{ return(*(int *)0); }
+
+/* ./tinfo/comp_scan.c */
+
+#undef _nc_syntax
+int	_nc_syntax;
+#undef _nc_curr_file_pos
+long	_nc_curr_file_pos;
+#undef _nc_comment_start
+long	_nc_comment_start;
+#undef _nc_comment_end
+long	_nc_comment_end;
+#undef _nc_start_line
+long	_nc_start_line;
+#undef _nc_curr_token
+struct token _nc_curr_token;
+#undef _nc_disable_period
+NCURSES_BOOL _nc_disable_period;
+
+#undef _nc_reset_input
+void	_nc_reset_input(
+		FILE	*fp, 
+		char	*buf)
+		{ /* void */ }
+
+#undef _nc_get_token
+int	_nc_get_token(
+		NCURSES_BOOL silent)
+		{ return(*(int *)0); }
+
+#undef _nc_trans_string
+int	_nc_trans_string(
+		char	*ptr, 
+		char	*last)
+		{ return(*(int *)0); }
+
+#undef _nc_push_token
+void	_nc_push_token(
+		int	tokclass)
+		{ /* void */ }
+
+#undef _nc_panic_mode
+void	_nc_panic_mode(
+		char	ch)
+		{ /* void */ }
+
+/* ./tinfo/parse_entry.c */
+
+#undef _nc_parse_entry
+int	_nc_parse_entry(
+		struct entry *entryp, 
+		int	literal, 
+		NCURSES_BOOL silent)
+		{ return(*(int *)0); }
+
+#undef _nc_capcmp
+int	_nc_capcmp(
+		const char *s, 
+		const char *t)
+		{ return(*(int *)0); }
+
+typedef struct {
+    const char *from;
+    const char *to;
+} assoc;
+
+/* ./tinfo/write_entry.c */
+
+#undef _nc_set_writedir
+void	_nc_set_writedir(
+		char	*dir)
+		{ /* void */ }
+
+#undef _nc_write_entry
+void	_nc_write_entry(
+		TERMTYPE *const tp)
+		{ /* void */ }
+
+#undef _nc_tic_written
+int	_nc_tic_written(void)
+		{ return(*(int *)0); }
+
+/* ./base/define_key.c */
+
+#undef define_key_sp
+int	define_key_sp(
+		SCREEN	*sp, 
+		const char *str, 
+		int	keycode)
+		{ return(*(int *)0); }
+
+#undef define_key
+int	define_key(
+		const char *str, 
+		int	keycode)
+		{ return(*(int *)0); }
+
+/* ./tinfo/hashed_db.c */
+
+#undef _nc_hashed_db
+void	_nc_hashed_db(void)
+		{ /* void */ }
+
+/* ./base/key_defined.c */
+
+#undef key_defined_sp
+int	key_defined_sp(
+		SCREEN	*sp, 
+		const char *str)
+		{ return(*(int *)0); }
+
+#undef key_defined
+int	key_defined(
+		const char *str)
+		{ return(*(int *)0); }
+
+/* ./base/keybound.c */
+
+#undef keybound_sp
+char	*keybound_sp(
+		SCREEN	*sp, 
+		int	code, 
+		int	count)
+		{ return(*(char **)0); }
+
+#undef keybound
+char	*keybound(
+		int	code, 
+		int	count)
+		{ return(*(char **)0); }
+
+/* ./base/keyok.c */
+
+#undef keyok_sp
+int	keyok_sp(
+		SCREEN	*sp, 
+		int	c, 
+		NCURSES_BOOL flag)
+		{ return(*(int *)0); }
+
+#undef keyok
+int	keyok(
+		int	c, 
+		NCURSES_BOOL flag)
+		{ return(*(int *)0); }
+
+/* ./base/version.c */
+
+#undef curses_version
+const char *curses_version(void)
+		{ return(*(const char **)0); }
diff -Naur ncurses-5.7.orig/ncurses/llib-lncursesw ncurses-5.7/ncurses/llib-lncursesw
--- ncurses-5.7.orig/ncurses/llib-lncursesw	2008-10-11 17:03:02.000000000 -0400
+++ ncurses-5.7/ncurses/llib-lncursesw	2011-01-08 18:13:50.707156964 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2001-2007,2008 Free Software Foundation, Inc.              *
+ * Copyright (c) 2001-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            *
@@ -27,7 +27,7 @@
  ****************************************************************************/
 
 /****************************************************************************
- *  Author: Thomas E. Dickey 2001-2008                                      *
+ *  Author: Thomas E. Dickey 2001-2009,2010                                 *
  ****************************************************************************/
 /* LINTLIBRARY */
 
@@ -38,27 +38,54 @@
 #undef _nc_oldnums
 int	*_nc_oldnums;
 
+#undef _nc_scroll_optimize_sp
+void	_nc_scroll_optimize_sp(
+		SCREEN	*sp)
+		{ /* void */ }
+
 #undef _nc_scroll_optimize
 void	_nc_scroll_optimize(void)
 		{ /* void */ }
 
+#undef _nc_linedump_sp
+void	_nc_linedump_sp(
+		SCREEN	*sp)
+		{ /* void */ }
+
 #undef _nc_linedump
 void	_nc_linedump(void)
 		{ /* void */ }
 
 /* ./tty/hashmap.c */
 
-#include <term.h>
+#undef _nc_hash_map_sp
+void	_nc_hash_map_sp(
+		SCREEN	*sp)
+		{ /* void */ }
 
 #undef _nc_hash_map
 void	_nc_hash_map(void)
 		{ /* void */ }
 
+#undef _nc_make_oldhash_sp
+void	_nc_make_oldhash_sp(
+		SCREEN	*sp, 
+		int	i)
+		{ /* void */ }
+
 #undef _nc_make_oldhash
 void	_nc_make_oldhash(
 		int	i)
 		{ /* void */ }
 
+#undef _nc_scroll_oldhash_sp
+void	_nc_scroll_oldhash_sp(
+		SCREEN	*sp, 
+		int	n, 
+		int	top, 
+		int	bot)
+		{ /* void */ }
+
 #undef _nc_scroll_oldhash
 void	_nc_scroll_oldhash(
 		int	n, 
@@ -137,6 +164,11 @@
 
 /* ./base/lib_beep.c */
 
+#undef beep_sp
+int	beep_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef beep
 int	beep(void)
 		{ return(*(int *)0); }
@@ -231,14 +263,32 @@
 #undef COLORS
 int	COLORS;
 
+#undef _nc_reset_colors_sp
+NCURSES_BOOL _nc_reset_colors_sp(
+		SCREEN	*sp)
+		{ return(*(NCURSES_BOOL *)0); }
+
 #undef _nc_reset_colors
 NCURSES_BOOL _nc_reset_colors(void)
 		{ return(*(NCURSES_BOOL *)0); }
 
+#undef start_color_sp
+int	start_color_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef start_color
 int	start_color(void)
 		{ return(*(int *)0); }
 
+#undef init_pair_sp
+int	init_pair_sp(
+		SCREEN	*sp, 
+		short	pair, 
+		short	f, 
+		short	b)
+		{ return(*(int *)0); }
+
 #undef init_pair
 int	init_pair(
 		short	pair, 
@@ -246,6 +296,15 @@
 		short	b)
 		{ return(*(int *)0); }
 
+#undef init_color_sp
+int	init_color_sp(
+		SCREEN	*sp, 
+		short	color, 
+		short	r, 
+		short	g, 
+		short	b)
+		{ return(*(int *)0); }
+
 #undef init_color
 int	init_color(
 		short	color, 
@@ -254,14 +313,33 @@
 		short	b)
 		{ return(*(int *)0); }
 
+#undef can_change_color_sp
+NCURSES_BOOL can_change_color_sp(
+		SCREEN	*sp)
+		{ return(*(NCURSES_BOOL *)0); }
+
 #undef can_change_color
 NCURSES_BOOL can_change_color(void)
 		{ return(*(NCURSES_BOOL *)0); }
 
+#undef has_colors_sp
+NCURSES_BOOL has_colors_sp(
+		SCREEN	*sp)
+		{ return(*(NCURSES_BOOL *)0); }
+
 #undef has_colors
 NCURSES_BOOL has_colors(void)
 		{ return(*(NCURSES_BOOL *)0); }
 
+#undef color_content_sp
+int	color_content_sp(
+		SCREEN	*sp, 
+		short	color, 
+		short	*r, 
+		short	*g, 
+		short	*b)
+		{ return(*(int *)0); }
+
 #undef color_content
 int	color_content(
 		short	color, 
@@ -270,6 +348,14 @@
 		short	*b)
 		{ return(*(int *)0); }
 
+#undef pair_content_sp
+int	pair_content_sp(
+		SCREEN	*sp, 
+		short	pair, 
+		short	*f, 
+		short	*b)
+		{ return(*(int *)0); }
+
 #undef pair_content
 int	pair_content(
 		short	pair, 
@@ -277,13 +363,21 @@
 		short	*b)
 		{ return(*(int *)0); }
 
+#undef _nc_do_color_sp
+void	_nc_do_color_sp(
+		SCREEN	*sp, 
+		short	old_pair, 
+		short	pair, 
+		NCURSES_BOOL reverse, 
+		NCURSES_OUTC_sp outc)
+		{ /* void */ }
+
 #undef _nc_do_color
 void	_nc_do_color(
 		short	old_pair, 
 		short	pair, 
 		NCURSES_BOOL reverse, 
-		int	(*outc)(
-		int	p1))
+		NCURSES_OUTC outc)
 		{ /* void */ }
 
 /* ./base/lib_colorset.c */
@@ -311,16 +405,31 @@
 
 /* ./base/lib_echo.c */
 
+#undef echo_sp
+int	echo_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef echo
 int	echo(void)
 		{ return(*(int *)0); }
 
+#undef noecho_sp
+int	noecho_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef noecho
 int	noecho(void)
 		{ return(*(int *)0); }
 
 /* ./base/lib_endwin.c */
 
+#undef endwin_sp
+int	endwin_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef endwin
 int	endwin(void)
 		{ return(*(int *)0); }
@@ -334,6 +443,11 @@
 
 /* ./base/lib_flash.c */
 
+#undef flash_sp
+int	flash_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef flash
 int	flash(void)
 		{ return(*(int *)0); }
@@ -1156,11 +1270,21 @@
 		const WINDOW *z)
 		{ return(*(NCURSES_BOOL *)0); }
 
+#undef is_pad
+NCURSES_BOOL is_pad(
+		const WINDOW *z)
+		{ return(*(NCURSES_BOOL *)0); }
+
 #undef is_scrollok
 NCURSES_BOOL is_scrollok(
 		const WINDOW *z)
 		{ return(*(NCURSES_BOOL *)0); }
 
+#undef is_subwin
+NCURSES_BOOL is_subwin(
+		const WINDOW *z)
+		{ return(*(NCURSES_BOOL *)0); }
+
 #undef is_syncok
 NCURSES_BOOL is_syncok(
 		const WINDOW *z)
@@ -1646,11 +1770,26 @@
 #undef ESCDELAY
 int	ESCDELAY;
 
+#undef set_escdelay_sp
+int	set_escdelay_sp(
+		SCREEN	*sp, 
+		int	value)
+		{ return(*(int *)0); }
+
 #undef set_escdelay
 int	set_escdelay(
 		int	value)
 		{ return(*(int *)0); }
 
+#undef get_escdelay_sp
+int	get_escdelay_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
+#undef get_escdelay
+int	get_escdelay(void)
+		{ return(*(int *)0); }
+
 #undef _nc_wgetch
 int	_nc_wgetch(
 		WINDOW	*win, 
@@ -1708,6 +1847,7 @@
 
 #undef _nc_insert_ch
 int	_nc_insert_ch(
+		SCREEN	*sp, 
 		WINDOW	*win, 
 		chtype	ch)
 		{ return(*(int *)0); }
@@ -1746,6 +1886,11 @@
 
 /* ./base/lib_isendwin.c */
 
+#undef isendwin_sp
+NCURSES_BOOL isendwin_sp(
+		SCREEN	*sp)
+		{ return(*(NCURSES_BOOL *)0); }
+
 #undef isendwin
 NCURSES_BOOL isendwin(void)
 		{ return(*(NCURSES_BOOL *)0); }
@@ -1760,16 +1905,35 @@
 
 /* ./base/lib_mouse.c */
 
+#undef getmouse_sp
+int	getmouse_sp(
+		SCREEN	*sp, 
+		MEVENT	*aevent)
+		{ return(*(int *)0); }
+
 #undef getmouse
 int	getmouse(
 		MEVENT	*aevent)
 		{ return(*(int *)0); }
 
+#undef ungetmouse_sp
+int	ungetmouse_sp(
+		SCREEN	*sp, 
+		MEVENT	*aevent)
+		{ return(*(int *)0); }
+
 #undef ungetmouse
 int	ungetmouse(
 		MEVENT	*aevent)
 		{ return(*(int *)0); }
 
+#undef mousemask_sp
+mmask_t	mousemask_sp(
+		SCREEN	*sp, 
+		mmask_t	newmask, 
+		mmask_t	*oldmask)
+		{ return(*(mmask_t *)0); }
+
 #undef mousemask
 mmask_t	mousemask(
 		mmask_t	newmask, 
@@ -1783,14 +1947,30 @@
 		int	x)
 		{ return(*(NCURSES_BOOL *)0); }
 
+#undef mouseinterval_sp
+int	mouseinterval_sp(
+		SCREEN	*sp, 
+		int	maxclick)
+		{ return(*(int *)0); }
+
 #undef mouseinterval
 int	mouseinterval(
 		int	maxclick)
 		{ return(*(int *)0); }
 
 #undef _nc_has_mouse
-int	_nc_has_mouse(void)
-		{ return(*(int *)0); }
+NCURSES_BOOL _nc_has_mouse(
+		SCREEN	*sp)
+		{ return(*(NCURSES_BOOL *)0); }
+
+#undef has_mouse_sp
+NCURSES_BOOL has_mouse_sp(
+		SCREEN	*sp)
+		{ return(*(NCURSES_BOOL *)0); }
+
+#undef has_mouse
+NCURSES_BOOL has_mouse(void)
+		{ return(*(NCURSES_BOOL *)0); }
 
 #undef wmouse_trafo
 NCURSES_BOOL wmouse_trafo(
@@ -1811,24 +1991,55 @@
 
 /* ./tty/lib_mvcur.c */
 
+#undef _nc_msec_cost_sp
+int	_nc_msec_cost_sp(
+		SCREEN	*sp, 
+		const char *const cap, 
+		int	affcnt)
+		{ return(*(int *)0); }
+
 #undef _nc_msec_cost
 int	_nc_msec_cost(
 		const char *const cap, 
 		int	affcnt)
 		{ return(*(int *)0); }
 
+#undef _nc_mvcur_resume_sp
+void	_nc_mvcur_resume_sp(
+		SCREEN	*sp)
+		{ /* void */ }
+
 #undef _nc_mvcur_resume
 void	_nc_mvcur_resume(void)
 		{ /* void */ }
 
+#undef _nc_mvcur_init_sp
+void	_nc_mvcur_init_sp(
+		SCREEN	*sp)
+		{ /* void */ }
+
 #undef _nc_mvcur_init
 void	_nc_mvcur_init(void)
 		{ /* void */ }
 
+#undef _nc_mvcur_wrap_sp
+void	_nc_mvcur_wrap_sp(
+		SCREEN	*sp)
+		{ /* void */ }
+
 #undef _nc_mvcur_wrap
 void	_nc_mvcur_wrap(void)
 		{ /* void */ }
 
+#undef mvcur_sp
+int	mvcur_sp(
+		SCREEN	*sp, 
+		int	yold, 
+		int	xold, 
+		int	ynew, 
+		int	xnew)
+		{ return(*(int *)0); }
+
 #undef mvcur
 int	mvcur(
 		int	yold, 
@@ -1851,14 +2062,32 @@
 
 /* ./base/lib_newterm.c */
 
+#undef filter_sp
+void	filter_sp(
+		SCREEN	*sp)
+		{ /* void */ }
+
 #undef filter
 void	filter(void)
 		{ /* void */ }
 
+#undef nofilter_sp
+void	nofilter_sp(
+		SCREEN	*sp)
+		{ /* void */ }
+
 #undef nofilter
 void	nofilter(void)
 		{ /* void */ }
 
+#undef newterm_sp
+SCREEN	*newterm_sp(
+		SCREEN	*sp, 
+		char	*name, 
+		FILE	*ofp, 
+		FILE	*ifp)
+		{ return(*(SCREEN **)0); }
+
 #undef newterm
 SCREEN	*newterm(
 		char	*name, 
@@ -1873,6 +2102,15 @@
 		WINDOW	*win)
 		{ return(*(int *)0); }
 
+#undef newwin_sp
+WINDOW	*newwin_sp(
+		SCREEN	*sp, 
+		int	num_lines, 
+		int	num_columns, 
+		int	begy, 
+		int	begx)
+		{ return(*(WINDOW **)0); }
+
 #undef newwin
 WINDOW	*newwin(
 		int	num_lines, 
@@ -1899,8 +2137,9 @@
 		int	x)
 		{ return(*(WINDOW **)0); }
 
-#undef _nc_makenew
-WINDOW	*_nc_makenew(
+#undef _nc_makenew_sp
+WINDOW	*_nc_makenew_sp(
+		SCREEN	*sp, 
 		int	num_lines, 
 		int	num_columns, 
 		int	begy, 
@@ -1908,17 +2147,37 @@
 		int	flags)
 		{ return(*(WINDOW **)0); }
 
-#undef _nc_screen_of
-SCREEN	*_nc_screen_of(
-		WINDOW	*win)
-		{ return(*(SCREEN **)0); }
+#undef _nc_curscr_of
+WINDOW	*_nc_curscr_of(
+		SCREEN	*sp)
+		{ return(*(WINDOW **)0); }
+
+#undef _nc_newscr_of
+WINDOW	*_nc_newscr_of(
+		SCREEN	*sp)
+		{ return(*(WINDOW **)0); }
+
+#undef _nc_stdscr_of
+WINDOW	*_nc_stdscr_of(
+		SCREEN	*sp)
+		{ return(*(WINDOW **)0); }
 
 /* ./base/lib_nl.c */
 
+#undef nl_sp
+int	nl_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef nl
 int	nl(void)
 		{ return(*(int *)0); }
 
+#undef nonl_sp
+int	nonl_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef nonl
 int	nonl(void)
 		{ return(*(int *)0); }
@@ -1952,6 +2211,13 @@
 
 /* ./base/lib_pad.c */
 
+#undef newpad_sp
+WINDOW	*newpad_sp(
+		SCREEN	*sp, 
+		int	l, 
+		int	c)
+		{ return(*(WINDOW **)0); }
+
 #undef newpad
 WINDOW	*newpad(
 		int	l, 
@@ -2057,6 +2323,14 @@
 
 /* ./base/lib_restart.c */
 
+#undef restartterm_sp
+int	restartterm_sp(
+		SCREEN	*sp, 
+		char	*termp, 
+		int	filenum, 
+		int	*errret)
+		{ return(*(int *)0); }
+
 #undef restartterm
 int	restartterm(
 		char	*termp, 
@@ -2105,6 +2379,12 @@
 
 /* ./base/lib_screen.c */
 
+#undef getwin_sp
+WINDOW	*getwin_sp(
+		SCREEN	*sp, 
+		FILE	*filep)
+		{ return(*(WINDOW **)0); }
+
 #undef getwin
 WINDOW	*getwin(
 		FILE	*filep)
@@ -2116,6 +2396,12 @@
 		FILE	*filep)
 		{ return(*(int *)0); }
 
+#undef scr_restore_sp
+int	scr_restore_sp(
+		SCREEN	*sp, 
+		const char *file)
+		{ return(*(int *)0); }
+
 #undef scr_restore
 int	scr_restore(
 		const char *file)
@@ -2126,11 +2412,23 @@
 		const char *file)
 		{ return(*(int *)0); }
 
+#undef scr_init_sp
+int	scr_init_sp(
+		SCREEN	*sp, 
+		const char *file)
+		{ return(*(int *)0); }
+
 #undef scr_init
 int	scr_init(
 		const char *file)
 		{ return(*(int *)0); }
 
+#undef scr_set_sp
+int	scr_set_sp(
+		SCREEN	*sp, 
+		const char *file)
+		{ return(*(int *)0); }
+
 #undef scr_set
 int	scr_set(
 		const char *file)
@@ -2182,6 +2480,16 @@
 		SCREEN	*sp)
 		{ /* void */ }
 
+#undef _nc_setupscreen_sp
+int	_nc_setupscreen_sp(
+		SCREEN	**spp, 
+		int	slines, 
+		int	scolumns, 
+		FILE	*output, 
+		NCURSES_BOOL filtered, 
+		int	slk_format)
+		{ return(*(int *)0); }
+
 #undef _nc_setupscreen
 int	_nc_setupscreen(
 		int	slines, 
@@ -2191,6 +2499,15 @@
 		int	slk_format)
 		{ return(*(int *)0); }
 
+#undef _nc_ripoffline_sp
+int	_nc_ripoffline_sp(
+		SCREEN	*sp, 
+		int	line, 
+		int	(*init)(
+		WINDOW	*p1, 
+		int	p2))
+		{ return(*(int *)0); }
+
 #undef _nc_ripoffline
 int	_nc_ripoffline(
 		int	line, 
@@ -2199,6 +2516,15 @@
 		int	p2))
 		{ return(*(int *)0); }
 
+#undef ripoffline_sp
+int	ripoffline_sp(
+		SCREEN	*sp, 
+		int	line, 
+		int	(*init)(
+		WINDOW	*p1, 
+		int	p2))
+		{ return(*(int *)0); }
+
 #undef ripoffline
 int	ripoffline(
 		int	line, 
@@ -2209,18 +2535,37 @@
 
 /* ./base/lib_slk.c */
 
+#undef _nc_format_slks
+int	_nc_format_slks(
+		SCREEN	*sp, 
+		int	cols)
+		{ return(*(int *)0); }
+
 #undef _nc_slk_initialize
 int	_nc_slk_initialize(
 		WINDOW	*stwin, 
 		int	cols)
 		{ return(*(int *)0); }
 
+#undef slk_restore_sp
+int	slk_restore_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef slk_restore
 int	slk_restore(void)
 		{ return(*(int *)0); }
 
 /* ./base/lib_slkatr_set.c */
 
+#undef slk_attr_set_sp
+int	slk_attr_set_sp(
+		SCREEN	*sp, 
+		const attr_t attr, 
+		short	color_pair_number, 
+		void	*opts)
+		{ return(*(int *)0); }
+
 #undef slk_attr_set
 int	slk_attr_set(
 		const attr_t attr, 
@@ -2230,6 +2575,12 @@
 
 /* ./base/lib_slkatrof.c */
 
+#undef slk_attroff_sp
+int	slk_attroff_sp(
+		SCREEN	*sp, 
+		const chtype attr)
+		{ return(*(int *)0); }
+
 #undef slk_attroff
 int	slk_attroff(
 		const chtype attr)
@@ -2237,6 +2588,12 @@
 
 /* ./base/lib_slkatron.c */
 
+#undef slk_attron_sp
+int	slk_attron_sp(
+		SCREEN	*sp, 
+		const chtype attr)
+		{ return(*(int *)0); }
+
 #undef slk_attron
 int	slk_attron(
 		const chtype attr)
@@ -2244,6 +2601,12 @@
 
 /* ./base/lib_slkatrset.c */
 
+#undef slk_attrset_sp
+int	slk_attrset_sp(
+		SCREEN	*sp, 
+		const chtype attr)
+		{ return(*(int *)0); }
+
 #undef slk_attrset
 int	slk_attrset(
 		const chtype attr)
@@ -2251,18 +2614,34 @@
 
 /* ./base/lib_slkattr.c */
 
+#undef slk_attr_sp
+attr_t	slk_attr_sp(
+		SCREEN	*sp)
+		{ return(*(attr_t *)0); }
+
 #undef slk_attr
 attr_t	slk_attr(void)
 		{ return(*(attr_t *)0); }
 
 /* ./base/lib_slkclear.c */
 
+#undef slk_clear_sp
+int	slk_clear_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef slk_clear
 int	slk_clear(void)
 		{ return(*(int *)0); }
 
 /* ./base/lib_slkcolor.c */
 
+#undef slk_color_sp
+int	slk_color_sp(
+		SCREEN	*sp, 
+		short	color_pair_number)
+		{ return(*(int *)0); }
+
 #undef slk_color
 int	slk_color(
 		short	color_pair_number)
@@ -2270,6 +2649,12 @@
 
 /* ./base/lib_slkinit.c */
 
+#undef slk_init_sp
+int	slk_init_sp(
+		SCREEN	*sp, 
+		int	format)
+		{ return(*(int *)0); }
+
 #undef slk_init
 int	slk_init(
 		int	format)
@@ -2277,6 +2662,12 @@
 
 /* ./base/lib_slklab.c */
 
+#undef slk_label_sp
+char	*slk_label_sp(
+		SCREEN	*sp, 
+		int	n)
+		{ return(*(char **)0); }
+
 #undef slk_label
 char	*slk_label(
 		int	n)
@@ -2284,10 +2675,20 @@
 
 /* ./base/lib_slkrefr.c */
 
+#undef slk_noutrefresh_sp
+int	slk_noutrefresh_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef slk_noutrefresh
 int	slk_noutrefresh(void)
 		{ return(*(int *)0); }
 
+#undef slk_refresh_sp
+int	slk_refresh_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef slk_refresh
 int	slk_refresh(void)
 		{ return(*(int *)0); }
@@ -2296,6 +2697,14 @@
 
 #include <wctype.h>
 
+#undef slk_set_sp
+int	slk_set_sp(
+		SCREEN	*sp, 
+		int	i, 
+		const char *astr, 
+		int	format)
+		{ return(*(int *)0); }
+
 #undef slk_set
 int	slk_set(
 		int	i, 
@@ -2305,6 +2714,11 @@
 
 /* ./base/lib_slktouch.c */
 
+#undef slk_touch_sp
+int	slk_touch_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef slk_touch
 int	slk_touch(void)
 		{ return(*(int *)0); }
@@ -2367,8 +2781,8 @@
 		SCREEN	*sp)
 		{ /* void */ }
 
-#undef _nc_ungetch
-int	_nc_ungetch(
+#undef ungetch_sp
+int	ungetch_sp(
 		SCREEN	*sp, 
 		int	ch)
 		{ return(*(int *)0); }
@@ -2380,11 +2794,23 @@
 
 /* ./tty/lib_vidattr.c */
 
+#undef vidputs_sp
+int	vidputs_sp(
+		SCREEN	*sp, 
+		chtype	newmode, 
+		NCURSES_OUTC_sp outc)
+		{ return(*(int *)0); }
+
 #undef vidputs
 int	vidputs(
 		chtype	newmode, 
-		int	(*outc)(
-		int	p1))
+		NCURSES_OUTC outc)
+		{ return(*(int *)0); }
+
+#undef vidattr_sp
+int	vidattr_sp(
+		SCREEN	*sp, 
+		chtype	newmode)
 		{ return(*(int *)0); }
 
 #undef vidattr
@@ -2392,6 +2818,11 @@
 		chtype	newmode)
 		{ return(*(int *)0); }
 
+#undef termattrs_sp
+chtype	termattrs_sp(
+		SCREEN	*sp)
+		{ return(*(chtype *)0); }
+
 #undef termattrs
 chtype	termattrs(void)
 		{ return(*(chtype *)0); }
@@ -2472,12 +2903,24 @@
 
 /* ./base/nc_panel.c */
 
+#undef _nc_panelhook_sp
+struct panelhook *_nc_panelhook_sp(
+		SCREEN	*sp)
+		{ return(*(struct panelhook **)0); }
+
 #undef _nc_panelhook
 struct panelhook *_nc_panelhook(void)
 		{ return(*(struct panelhook **)0); }
 
 /* ./base/safe_sprintf.c */
 
+#undef _nc_printf_string_sp
+char	*_nc_printf_string_sp(
+		SCREEN	*sp, 
+		const char *fmt, 
+		va_list	ap)
+		{ return(*(char **)0); }
+
 #undef _nc_printf_string
 char	*_nc_printf_string(
 		const char *fmt, 
@@ -2489,10 +2932,24 @@
 #include <sys/time.h>
 #include <sys/times.h>
 
+#undef doupdate_sp
+int	doupdate_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef doupdate
 int	doupdate(void)
 		{ return(*(int *)0); }
 
+#undef _nc_scrolln_sp
+int	_nc_scrolln_sp(
+		SCREEN	*sp, 
+		int	n, 
+		int	top, 
+		int	bot, 
+		int	maxy)
+		{ return(*(int *)0); }
+
 #undef _nc_scrolln
 int	_nc_scrolln(
 		int	n, 
@@ -2501,18 +2958,39 @@
 		int	maxy)
 		{ return(*(int *)0); }
 
+#undef _nc_screen_resume_sp
+void	_nc_screen_resume_sp(
+		SCREEN	*sp)
+		{ /* void */ }
+
 #undef _nc_screen_resume
 void	_nc_screen_resume(void)
 		{ /* void */ }
 
+#undef _nc_screen_init_sp
+void	_nc_screen_init_sp(
+		SCREEN	*sp)
+		{ /* void */ }
+
 #undef _nc_screen_init
 void	_nc_screen_init(void)
 		{ /* void */ }
 
+#undef _nc_screen_wrap_sp
+void	_nc_screen_wrap_sp(
+		SCREEN	*sp)
+		{ /* void */ }
+
 #undef _nc_screen_wrap
 void	_nc_screen_wrap(void)
 		{ /* void */ }
 
+#undef _nc_do_xmc_glitch_sp
+void	_nc_do_xmc_glitch_sp(
+		SCREEN	*sp, 
+		attr_t	previous)
+		{ /* void */ }
+
 #undef _nc_do_xmc_glitch
 void	_nc_do_xmc_glitch(
 		attr_t	previous)
@@ -2550,6 +3028,12 @@
 void	_nc_freeall(void)
 		{ /* void */ }
 
+#undef _nc_free_and_exit_sp
+void	_nc_free_and_exit_sp(
+		SCREEN	*sp, 
+		int	code)
+		{ /* void */ }
+
 #undef _nc_free_and_exit
 void	_nc_free_and_exit(
 		int	code)
@@ -2678,6 +3162,12 @@
 
 /* ./widechar/lib_ins_wch.c */
 
+#undef _nc_insert_wch
+int	_nc_insert_wch(
+		WINDOW	*win, 
+		const cchar_t *wch)
+		{ return(*(int *)0); }
+
 #undef wins_wch
 int	wins_wch(
 		WINDOW	*win, 
@@ -2739,6 +3229,12 @@
 		mbstate_t *state)
 		{ return(*(size_t *)0); }
 
+#undef unget_wch_sp
+int	unget_wch_sp(
+		SCREEN	*sp, 
+		const wchar_t wch)
+		{ return(*(int *)0); }
+
 #undef unget_wch
 int	unget_wch(
 		const wchar_t wch)
@@ -2746,13 +3242,31 @@
 
 /* ./widechar/lib_vid_attr.c */
 
+#include <term.h>
+
+#undef vid_puts_sp
+int	vid_puts_sp(
+		SCREEN	*sp, 
+		attr_t	newmode, 
+		short	pair, 
+		void	*opts, 
+		NCURSES_OUTC_sp outc)
+		{ return(*(int *)0); }
+
 #undef vid_puts
 int	vid_puts(
 		attr_t	newmode, 
 		short	pair, 
 		void	*opts, 
-		int	(*outc)(
-		int	p1))
+		NCURSES_OUTC outc)
+		{ return(*(int *)0); }
+
+#undef vid_attr_sp
+int	vid_attr_sp(
+		SCREEN	*sp, 
+		attr_t	newmode, 
+		short	pair, 
+		void	*opts)
 		{ return(*(int *)0); }
 
 #undef vid_attr
@@ -2762,6 +3276,11 @@
 		void	*opts)
 		{ return(*(int *)0); }
 
+#undef term_attrs_sp
+attr_t	term_attrs_sp(
+		SCREEN	*sp)
+		{ return(*(attr_t *)0); }
+
 #undef term_attrs
 attr_t	term_attrs(void)
 		{ return(*(attr_t *)0); }
@@ -2786,6 +3305,12 @@
 
 /* ./widechar/lib_wunctrl.c */
 
+#undef wunctrl_sp
+wchar_t	*wunctrl_sp(
+		SCREEN	*sp, 
+		cchar_t	*wc)
+		{ return(*(wchar_t **)0); }
+
 #undef wunctrl
 wchar_t	*wunctrl(
 		cchar_t	*wc)
@@ -2805,6 +3330,24 @@
 		attr_t	at)
 		{ /* void */ }
 
+#undef _nc_DelCharCost_sp
+int	_nc_DelCharCost_sp(
+		SCREEN	*sp, 
+		int	count)
+		{ return(*(int *)0); }
+
+#undef _nc_InsCharCost_sp
+int	_nc_InsCharCost_sp(
+		SCREEN	*sp, 
+		int	count)
+		{ return(*(int *)0); }
+
+#undef _nc_UpdateAttrs_sp
+void	_nc_UpdateAttrs_sp(
+		SCREEN	*sp, 
+		const cchar_t *c)
+		{ /* void */ }
+
 #undef _nc_DelCharCost
 int	_nc_DelCharCost(
 		int	count)
@@ -2817,11 +3360,17 @@
 
 #undef _nc_UpdateAttrs
 void	_nc_UpdateAttrs(
-		cchar_t	c)
+		const cchar_t *c)
 		{ /* void */ }
 
 /* ./base/legacy_coding.c */
 
+#undef use_legacy_coding_sp
+int	use_legacy_coding_sp(
+		SCREEN	*sp, 
+		int	level)
+		{ return(*(int *)0); }
+
 #undef use_legacy_coding
 int	use_legacy_coding(
 		int	level)
@@ -2829,10 +3378,22 @@
 
 /* ./base/lib_dft_fgbg.c */
 
+#undef use_default_colors_sp
+int	use_default_colors_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef use_default_colors
 int	use_default_colors(void)
 		{ return(*(int *)0); }
 
+#undef assume_default_colors_sp
+int	assume_default_colors_sp(
+		SCREEN	*sp, 
+		int	fg, 
+		int	bg)
+		{ return(*(int *)0); }
+
 #undef assume_default_colors
 int	assume_default_colors(
 		int	fg, 
@@ -2841,6 +3402,13 @@
 
 /* ./tinfo/lib_print.c */
 
+#undef mcprint_sp
+int	mcprint_sp(
+		SCREEN	*sp, 
+		char	*data, 
+		int	len)
+		{ return(*(int *)0); }
+
 #undef mcprint
 int	mcprint(
 		char	*data, 
@@ -2849,18 +3417,39 @@
 
 /* ./base/resizeterm.c */
 
+#undef is_term_resized_sp
+NCURSES_BOOL is_term_resized_sp(
+		SCREEN	*sp, 
+		int	ToLines, 
+		int	ToCols)
+		{ return(*(NCURSES_BOOL *)0); }
+
 #undef is_term_resized
 NCURSES_BOOL is_term_resized(
 		int	ToLines, 
 		int	ToCols)
 		{ return(*(NCURSES_BOOL *)0); }
 
+#undef resize_term_sp
+int	resize_term_sp(
+		SCREEN	*sp, 
+		int	ToLines, 
+		int	ToCols)
+		{ return(*(int *)0); }
+
 #undef resize_term
 int	resize_term(
 		int	ToLines, 
 		int	ToCols)
 		{ return(*(int *)0); }
 
+#undef resizeterm_sp
+int	resizeterm_sp(
+		SCREEN	*sp, 
+		int	ToLines, 
+		int	ToCols)
+		{ return(*(int *)0); }
+
 #undef resizeterm
 int	resizeterm(
 		int	ToLines, 
@@ -2978,7 +3567,32 @@
 #undef strcodes
 char	*const strcodes[] = {0};
 
+/* ./comp_captab.c */
+
+#include <hashsize.h>
+
+#undef _nc_get_table
+const struct name_table_entry *_nc_get_table(
+		NCURSES_BOOL termcap)
+		{ return(*(const struct name_table_entry **)0); }
+
+#undef _nc_get_hash_table
+const HashValue *_nc_get_hash_table(
+		NCURSES_BOOL termcap)
+		{ return(*(const HashValue **)0); }
+
+#undef _nc_get_alias_table
+const struct alias *_nc_get_alias_table(
+		NCURSES_BOOL termcap)
+		{ return(*(const struct alias **)0); }
+
+#undef _nc_get_hash_info
+const HashData *_nc_get_hash_info(
+		NCURSES_BOOL termcap)
+		{ return(*(const HashData **)0); }
+
 /* ./tinfo/comp_error.c */
+
 #undef _nc_suppress_warnings
 NCURSES_BOOL _nc_suppress_warnings;
 #undef _nc_curr_line
@@ -3023,6 +3637,21 @@
 		...)
 		{ /* void */ }
 
+/* ./tinfo/comp_hash.c */
+
+#undef _nc_find_entry
+struct name_table_entry const *_nc_find_entry(
+		const char *string, 
+		const HashValue *hash_table)
+		{ return(*(struct name_table_entry const **)0); }
+
+#undef _nc_find_type_entry
+struct name_table_entry const *_nc_find_type_entry(
+		const char *string, 
+		int	type, 
+		NCURSES_BOOL termcap)
+		{ return(*(struct name_table_entry const **)0); }
+
 /* ./tinfo/db_iterator.c */
 
 #undef _nc_tic_dir
@@ -3143,6 +3772,11 @@
 #undef acs_map
 chtype	acs_map[128];
 
+#undef _nc_init_acs_sp
+void	_nc_init_acs_sp(
+		SCREEN	*sp)
+		{ /* void */ }
+
 #undef _nc_init_acs
 void	_nc_init_acs(void)
 		{ /* void */ }
@@ -3166,6 +3800,11 @@
 		int	BaudRate)
 		{ return(*(int *)0); }
 
+#undef baudrate_sp
+int	baudrate_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef baudrate
 int	baudrate(void)
 		{ return(*(int *)0); }
@@ -3175,11 +3814,23 @@
 #undef cur_term
 TERMINAL *cur_term;
 
+#undef set_curterm_sp
+TERMINAL *set_curterm_sp(
+		SCREEN	*sp, 
+		TERMINAL *termp)
+		{ return(*(TERMINAL **)0); }
+
 #undef set_curterm
 TERMINAL *set_curterm(
 		TERMINAL *termp)
 		{ return(*(TERMINAL **)0); }
 
+#undef del_curterm_sp
+int	del_curterm_sp(
+		SCREEN	*sp, 
+		TERMINAL *termp)
+		{ return(*(int *)0); }
+
 #undef del_curterm
 int	del_curterm(
 		TERMINAL *termp)
@@ -3202,26 +3853,56 @@
 #undef _nc_prescreen
 NCURSES_PRESCREEN _nc_prescreen;
 
+#undef _nc_screen_of
+SCREEN	*_nc_screen_of(
+		WINDOW	*win)
+		{ return(*(SCREEN **)0); }
+
 /* ./tinfo/lib_has_cap.c */
 
+#undef has_ic_sp
+NCURSES_BOOL has_ic_sp(
+		SCREEN	*sp)
+		{ return(*(NCURSES_BOOL *)0); }
+
 #undef has_ic
 NCURSES_BOOL has_ic(void)
 		{ return(*(NCURSES_BOOL *)0); }
 
+#undef has_il_sp
+NCURSES_BOOL has_il_sp(
+		SCREEN	*sp)
+		{ return(*(NCURSES_BOOL *)0); }
+
 #undef has_il
 NCURSES_BOOL has_il(void)
 		{ return(*(NCURSES_BOOL *)0); }
 
 /* ./tinfo/lib_kernel.c */
 
+#undef erasechar_sp
+char	erasechar_sp(
+		SCREEN	*sp)
+		{ return(*(char *)0); }
+
 #undef erasechar
 char	erasechar(void)
 		{ return(*(char *)0); }
 
+#undef killchar_sp
+char	killchar_sp(
+		SCREEN	*sp)
+		{ return(*(char *)0); }
+
 #undef killchar
 char	killchar(void)
 		{ return(*(char *)0); }
 
+#undef flushinp_sp
+int	flushinp_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef flushinp
 int	flushinp(void)
 		{ return(*(int *)0); }
@@ -3230,8 +3911,8 @@
 
 struct kn { short offset; int code; };
 
-#undef _nc_keyname
-char	*_nc_keyname(
+#undef keyname_sp
+char	*keyname_sp(
 		SCREEN	*sp, 
 		int	c)
 		{ return(*(char **)0); }
@@ -3251,6 +3932,12 @@
 
 #include <time.h>
 
+#undef napms_sp
+int	napms_sp(
+		SCREEN	*sp, 
+		int	ms)
+		{ return(*(int *)0); }
+
 #undef napms
 int	napms(
 		int	ms)
@@ -3270,6 +3957,12 @@
 		NCURSES_BOOL flag)
 		{ /* void */ }
 
+#undef halfdelay_sp
+int	halfdelay_sp(
+		SCREEN	*sp, 
+		int	t)
+		{ return(*(int *)0); }
+
 #undef halfdelay
 int	halfdelay(
 		int	t)
@@ -3305,21 +3998,46 @@
 		NCURSES_BOOL flag)
 		{ return(*(int *)0); }
 
+#undef curs_set_sp
+int	curs_set_sp(
+		SCREEN	*sp, 
+		int	vis)
+		{ return(*(int *)0); }
+
 #undef curs_set
 int	curs_set(
 		int	vis)
 		{ return(*(int *)0); }
 
+#undef typeahead_sp
+int	typeahead_sp(
+		SCREEN	*sp, 
+		int	fd)
+		{ return(*(int *)0); }
+
 #undef typeahead
 int	typeahead(
 		int	fd)
 		{ return(*(int *)0); }
 
+#undef has_key_sp
+int	has_key_sp(
+		SCREEN	*sp, 
+		int	keycode)
+		{ return(*(int *)0); }
+
 #undef has_key
 int	has_key(
 		int	keycode)
 		{ return(*(int *)0); }
 
+#undef _nc_putp_flush_sp
+int	_nc_putp_flush_sp(
+		SCREEN	*sp, 
+		const char *name, 
+		const char *value)
+		{ return(*(int *)0); }
+
 #undef _nc_keypad
 int	_nc_keypad(
 		SCREEN	*sp, 
@@ -3328,30 +4046,67 @@
 
 /* ./tinfo/lib_raw.c */
 
+#undef raw_sp
+int	raw_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef raw
 int	raw(void)
 		{ return(*(int *)0); }
 
+#undef cbreak_sp
+int	cbreak_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef cbreak
 int	cbreak(void)
 		{ return(*(int *)0); }
 
+#undef qiflush_sp
+void	qiflush_sp(
+		SCREEN	*sp)
+		{ /* void */ }
+
 #undef qiflush
 void	qiflush(void)
 		{ /* void */ }
 
+#undef noraw_sp
+int	noraw_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef noraw
 int	noraw(void)
 		{ return(*(int *)0); }
 
+#undef nocbreak_sp
+int	nocbreak_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef nocbreak
 int	nocbreak(void)
 		{ return(*(int *)0); }
 
+#undef noqiflush_sp
+void	noqiflush_sp(
+		SCREEN	*sp)
+		{ /* void */ }
+
 #undef noqiflush
 void	noqiflush(void)
 		{ /* void */ }
 
+#undef intrflush_sp
+int	intrflush_sp(
+		SCREEN	*sp, 
+		WINDOW	*win, 
+		NCURSES_BOOL flag)
+		{ return(*(int *)0); }
+
 #undef intrflush
 int	intrflush(
 		WINDOW	*win, 
@@ -3373,6 +4128,12 @@
 #undef TABSIZE
 int	TABSIZE;
 
+#undef set_tabsize_sp
+int	set_tabsize_sp(
+		SCREEN	*sp, 
+		int	value)
+		{ return(*(int *)0); }
+
 #undef set_tabsize
 int	set_tabsize(
 		int	value)
@@ -3383,6 +4144,12 @@
 		SCREEN	*sp)
 		{ return(*(int *)0); }
 
+#undef use_env_sp
+void	use_env_sp(
+		SCREEN	*sp, 
+		NCURSES_BOOL f)
+		{ /* void */ }
+
 #undef use_env
 void	use_env(
 		NCURSES_BOOL f)
@@ -3400,6 +4167,12 @@
 		SCREEN	*sp)
 		{ /* void */ }
 
+#undef _nc_tinfo_cmdch
+void	_nc_tinfo_cmdch(
+		TERMINAL *termp, 
+		char	proto)
+		{ /* void */ }
+
 #undef _nc_get_locale
 char	*_nc_get_locale(void)
 		{ return(*(char **)0); }
@@ -3421,6 +4194,10 @@
 		NCURSES_BOOL reuse)
 		{ return(*(int *)0); }
 
+#undef new_prescr
+SCREEN	*new_prescr(void)
+		{ return(*(SCREEN **)0); }
+
 #undef setupterm
 int	setupterm(
 		char	*tname, 
@@ -3435,8 +4212,9 @@
 #undef BC
 char	*BC;
 
-#undef tgetent
-int	tgetent(
+#undef tgetent_sp
+int	tgetent_sp(
+		SCREEN	*sp, 
 		char	*bufp, 
 		const char *name)
 		{ return(*(int *)0); }
@@ -3447,16 +4225,41 @@
 
 #endif
 
+#undef tgetent
+int	tgetent(
+		char	*bufp, 
+		const char *name)
+		{ return(*(int *)0); }
+
+#undef tgetflag_sp
+int	tgetflag_sp(
+		SCREEN	*sp, 
+		char	*id)
+		{ return(*(int *)0); }
+
 #undef tgetflag
 int	tgetflag(
 		char	*id)
 		{ return(*(int *)0); }
 
+#undef tgetnum_sp
+int	tgetnum_sp(
+		SCREEN	*sp, 
+		char	*id)
+		{ return(*(int *)0); }
+
 #undef tgetnum
 int	tgetnum(
 		char	*id)
 		{ return(*(int *)0); }
 
+#undef tgetstr_sp
+char	*tgetstr_sp(
+		SCREEN	*sp, 
+		char	*id, 
+		char	**area)
+		{ return(*(char **)0); }
+
 #undef tgetstr
 char	*tgetstr(
 		char	*id, 
@@ -3465,6 +4268,11 @@
 
 /* ./tinfo/lib_termname.c */
 
+#undef termname_sp
+char	*termname_sp(
+		SCREEN	*sp)
+		{ return(*(char **)0); }
+
 #undef termname
 char	*termname(void)
 		{ return(*(char **)0); }
@@ -3480,16 +4288,34 @@
 
 /* ./tinfo/lib_ti.c */
 
+#undef tigetflag_sp
+int	tigetflag_sp(
+		SCREEN	*sp, 
+		char	*str)
+		{ return(*(int *)0); }
+
 #undef tigetflag
 int	tigetflag(
 		char	*str)
 		{ return(*(int *)0); }
 
+#undef tigetnum_sp
+int	tigetnum_sp(
+		SCREEN	*sp, 
+		char	*str)
+		{ return(*(int *)0); }
+
 #undef tigetnum
 int	tigetnum(
 		char	*str)
 		{ return(*(int *)0); }
 
+#undef tigetstr_sp
+char	*tigetstr_sp(
+		SCREEN	*sp, 
+		char	*str)
+		{ return(*(char **)0); }
+
 #undef tigetstr
 char	*tigetstr(
 		char	*str)
@@ -3513,6 +4339,12 @@
 		...)
 		{ return(*(char **)0); }
 
+#undef tiparm
+char	*tiparm(
+		const char *string, 
+		...)
+		{ return(*(char **)0); }
+
 /* ./tinfo/lib_tputs.c */
 
 #undef PC
@@ -3527,25 +4359,75 @@
 		SCREEN	*sp)
 		{ /* void */ }
 
+#undef delay_output_sp
+int	delay_output_sp(
+		SCREEN	*sp, 
+		int	ms)
+		{ return(*(int *)0); }
+
 #undef delay_output
 int	delay_output(
 		int	ms)
 		{ return(*(int *)0); }
 
+#undef _nc_flush_sp
+void	_nc_flush_sp(
+		SCREEN	*sp)
+		{ /* void */ }
+
 #undef _nc_flush
 void	_nc_flush(void)
 		{ /* void */ }
 
+#undef _nc_outch_sp
+int	_nc_outch_sp(
+		SCREEN	*sp, 
+		int	ch)
+		{ return(*(int *)0); }
+
 #undef _nc_outch
 int	_nc_outch(
 		int	ch)
 		{ return(*(int *)0); }
 
+#undef putp_sp
+int	putp_sp(
+		SCREEN	*sp, 
+		const char *string)
+		{ return(*(int *)0); }
+
+#undef _nc_putp_sp
+int	_nc_putp_sp(
+		SCREEN	*sp, 
+		const char *name, 
+		const char *string)
+		{ return(*(int *)0); }
+
 #undef putp
 int	putp(
 		const char *string)
 		{ return(*(int *)0); }
 
+#undef _nc_putp
+int	_nc_putp(
+		const char *name, 
+		const char *string)
+		{ return(*(int *)0); }
+
+#undef tputs_sp
+int	tputs_sp(
+		SCREEN	*sp, 
+		const char *string, 
+		int	affcnt, 
+		NCURSES_OUTC_sp outc)
+		{ return(*(int *)0); }
+
+#undef _nc_outc_wrapper
+int	_nc_outc_wrapper(
+		SCREEN	*sp, 
+		int	c)
+		{ return(*(int *)0); }
+
 #undef tputs
 int	tputs(
 		const char *string, 
@@ -3701,36 +4583,78 @@
 
 /* ./tinfo/lib_ttyflags.c */
 
+#undef _nc_get_tty_mode_sp
+int	_nc_get_tty_mode_sp(
+		SCREEN	*sp, 
+		struct termios *buf)
+		{ return(*(int *)0); }
+
 #undef _nc_get_tty_mode
 int	_nc_get_tty_mode(
 		struct termios *buf)
 		{ return(*(int *)0); }
 
+#undef _nc_set_tty_mode_sp
+int	_nc_set_tty_mode_sp(
+		SCREEN	*sp, 
+		struct termios *buf)
+		{ return(*(int *)0); }
+
 #undef _nc_set_tty_mode
 int	_nc_set_tty_mode(
 		struct termios *buf)
 		{ return(*(int *)0); }
 
+#undef def_shell_mode_sp
+int	def_shell_mode_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef def_shell_mode
 int	def_shell_mode(void)
 		{ return(*(int *)0); }
 
+#undef def_prog_mode_sp
+int	def_prog_mode_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef def_prog_mode
 int	def_prog_mode(void)
 		{ return(*(int *)0); }
 
+#undef reset_prog_mode_sp
+int	reset_prog_mode_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef reset_prog_mode
 int	reset_prog_mode(void)
 		{ return(*(int *)0); }
 
+#undef reset_shell_mode_sp
+int	reset_shell_mode_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef reset_shell_mode
 int	reset_shell_mode(void)
 		{ return(*(int *)0); }
 
+#undef savetty_sp
+int	savetty_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef savetty
 int	savetty(void)
 		{ return(*(int *)0); }
 
+#undef resetty_sp
+int	resetty_sp(
+		SCREEN	*sp)
+		{ return(*(int *)0); }
+
 #undef resetty
 int	resetty(void)
 		{ return(*(int *)0); }
@@ -3810,6 +4734,13 @@
 
 /* ./tinfo/setbuf.c */
 
+#undef _nc_set_buffer_sp
+void	_nc_set_buffer_sp(
+		SCREEN	*sp, 
+		FILE	*ofp, 
+		NCURSES_BOOL buffered)
+		{ /* void */ }
+
 #undef _nc_set_buffer
 void	_nc_set_buffer(
 		FILE	*ofp, 
@@ -3901,8 +4832,8 @@
 
 /* ./unctrl.c */
 
-#undef _nc_unctrl
-char	*_nc_unctrl(
+#undef unctrl_sp
+char	*unctrl_sp(
 		SCREEN	*sp, 
 		chtype	ch)
 		{ return(*(char **)0); }
@@ -4011,25 +4942,6 @@
 		int const parameterized)
 		{ return(*(char **)0); }
 
-/* ./comp_captab.c */
-
-#include <hashsize.h>
-
-#undef _nc_get_table
-const struct name_table_entry *_nc_get_table(
-		NCURSES_BOOL termcap)
-		{ return(*(const struct name_table_entry **)0); }
-
-#undef _nc_get_hash_table
-const short *_nc_get_hash_table(
-		NCURSES_BOOL termcap)
-		{ return(*(const short **)0); }
-
-#undef _nc_get_alias_table
-const struct alias *_nc_get_alias_table(
-		NCURSES_BOOL termcap)
-		{ return(*(const struct alias **)0); }
-
 /* ./tinfo/comp_expand.c */
 
 #undef _nc_tic_expand
@@ -4039,21 +4951,6 @@
 		int	numbers)
 		{ return(*(char **)0); }
 
-/* ./tinfo/comp_hash.c */
-
-#undef _nc_find_entry
-struct name_table_entry const *_nc_find_entry(
-		const char *string, 
-		const short *hash_table)
-		{ return(*(struct name_table_entry const **)0); }
-
-#undef _nc_find_type_entry
-struct name_table_entry const *_nc_find_type_entry(
-		const char *string, 
-		int	type, 
-		const struct name_table_entry *table)
-		{ return(*(struct name_table_entry const **)0); }
-
 /* ./tinfo/comp_parse.c */
 
 #undef _nc_check_termtype2
@@ -4173,6 +5070,13 @@
 
 /* ./base/define_key.c */
 
+#undef define_key_sp
+int	define_key_sp(
+		SCREEN	*sp, 
+		const char *str, 
+		int	keycode)
+		{ return(*(int *)0); }
+
 #undef define_key
 int	define_key(
 		const char *str, 
@@ -4187,6 +5091,12 @@
 
 /* ./base/key_defined.c */
 
+#undef key_defined_sp
+int	key_defined_sp(
+		SCREEN	*sp, 
+		const char *str)
+		{ return(*(int *)0); }
+
 #undef key_defined
 int	key_defined(
 		const char *str)
@@ -4194,6 +5104,13 @@
 
 /* ./base/keybound.c */
 
+#undef keybound_sp
+char	*keybound_sp(
+		SCREEN	*sp, 
+		int	code, 
+		int	count)
+		{ return(*(char **)0); }
+
 #undef keybound
 char	*keybound(
 		int	code, 
@@ -4202,6 +5119,13 @@
 
 /* ./base/keyok.c */
 
+#undef keyok_sp
+int	keyok_sp(
+		SCREEN	*sp, 
+		int	c, 
+		NCURSES_BOOL flag)
+		{ return(*(int *)0); }
+
 #undef keyok
 int	keyok(
 		int	c, 
diff -Naur ncurses-5.7.orig/ncurses/modules ncurses-5.7/ncurses/modules
--- ncurses-5.7.orig/ncurses/modules	2007-09-08 18:03:34.000000000 -0400
+++ ncurses-5.7/ncurses/modules	2011-01-08 18:18:29.079036539 -0500
@@ -1,6 +1,6 @@
-# $Id: modules,v 1.112 2007/09/08 22:03:34 tom Exp $
+# $Id: modules,v 1.117 2010/08/07 18:41:02 tom Exp $
 ##############################################################################
-# Copyright (c) 1998-2006,2007 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 "Software"), #
@@ -32,201 +32,213 @@
 
 @ base
 # Library objects
-hardscroll	lib		$(serial)
-hashmap		lib		$(serial)	../include/term.h
-lib_addch	lib		$(base)
-lib_addstr	lib		$(base)
-lib_beep	lib		$(base)		../include/term.h
-lib_bkgd	lib		$(base)
-lib_box 	lib		$(base)
-lib_chgat	lib		$(base)
-lib_clear	lib		$(base)
-lib_clearok	lib		$(base)
-lib_clrbot	lib		$(base)
-lib_clreol	lib		$(base)
-lib_color	lib		$(base)		../include/term.h
-lib_colorset	lib		$(base)
-lib_delch	lib		$(base)
-lib_delwin	lib		$(base)
-lib_echo	lib		$(base)
-lib_endwin	lib		$(base)		../include/term.h
-lib_erase	lib		$(base)
-lib_flash	lib		$(base)		../include/term.h
-lib_gen 	lib		.		../include/curses.h
-lib_getch	lib		$(base)
-lib_getstr	lib		$(base)		../include/term.h
-lib_hline	lib		$(base)
-lib_immedok	lib		$(base)
-lib_inchstr	lib		$(base)
-lib_initscr	lib		$(base)		$(INCDIR)/tic.h
-lib_insch	lib		$(base)
-lib_insdel	lib		$(base)
-lib_insnstr	lib		$(base)
-lib_instr	lib		$(base)
-lib_isendwin	lib		$(base)
-lib_leaveok	lib		$(base)
-lib_mouse	lib		$(base)		../include/term.h
-lib_move	lib		$(base)
-lib_mvcur	lib		$(serial)	../include/term.h $(INCDIR)/tic.h
-lib_mvwin	lib		$(base)
-lib_newterm	lib		$(base)		../include/term.h
-lib_newwin	lib		$(base)
-lib_nl		lib		$(base)
-lib_overlay	lib		$(base)
-lib_pad 	lib		$(base)
-lib_printw	lib		$(base)
-lib_redrawln	lib		$(base)
-lib_refresh	lib		$(base)
-lib_restart	lib		$(base)		../include/term.h
-lib_scanw	lib		$(base)
-lib_screen	lib		$(base)		../include/term.h
-lib_scroll	lib		$(base)
-lib_scrollok	lib		$(base)
-lib_scrreg	lib		$(base)
-lib_set_term	lib		$(base)		../include/term.h
-lib_slk 	lib		$(base)		../include/term.h
-lib_slkatr_set	lib		$(base)
-lib_slkatrof 	lib		$(base)
-lib_slkatron 	lib		$(base)
-lib_slkatrset 	lib		$(base)
-lib_slkattr 	lib		$(base)
-lib_slkclear 	lib		$(base)
-lib_slkcolor 	lib		$(base)
-lib_slkinit 	lib		$(base)
-lib_slklab	lib		$(base)
-lib_slkrefr	lib		$(base)		../include/term.h
-lib_slkset	lib		$(base)
-lib_slktouch	lib		$(base)
-lib_touch	lib		$(base)
-lib_tracedmp	lib		$(trace)
-lib_tracemse	lib		$(trace)
-lib_tstp	lib		$(serial)	$(srcdir)/SigAction.h
-lib_ungetch	lib		$(base)
-lib_vidattr	lib		$(serial)	../include/term.h
-lib_vline	lib		$(base)
-lib_wattroff	lib		$(base)
-lib_wattron	lib		$(base)
-lib_winch	lib		$(base)
-lib_window	lib		$(base)
-link_test 	lib		.		../include/curses.h
-nc_panel	lib		$(base)
-safe_sprintf	lib		$(base)
-tty_update	lib		$(serial)	../include/term.h
-varargs		lib		$(trace)
+hardscroll	lib		$(serial)	$(HEADER_DEPS)
+hashmap		lib		$(serial)	$(HEADER_DEPS)
+lib_addch	lib		$(base)		$(HEADER_DEPS)
+lib_addstr	lib		$(base)		$(HEADER_DEPS)
+lib_beep	lib		$(base)		$(HEADER_DEPS)
+lib_bkgd	lib		$(base)		$(HEADER_DEPS)
+lib_box 	lib		$(base)		$(HEADER_DEPS)
+lib_chgat	lib		$(base)		$(HEADER_DEPS)
+lib_clear	lib		$(base)		$(HEADER_DEPS)
+lib_clearok	lib		$(base)		$(HEADER_DEPS)
+lib_clrbot	lib		$(base)		$(HEADER_DEPS)
+lib_clreol	lib		$(base)		$(HEADER_DEPS)
+lib_color	lib		$(base)		$(HEADER_DEPS)	$(INCDIR)/tic.h
+lib_colorset	lib		$(base)		$(HEADER_DEPS)
+lib_delch	lib		$(base)		$(HEADER_DEPS)
+lib_delwin	lib		$(base)		$(HEADER_DEPS)
+lib_echo	lib		$(base)		$(HEADER_DEPS)
+lib_endwin	lib		$(base)		$(HEADER_DEPS)
+lib_erase	lib		$(base)		$(HEADER_DEPS)
+lib_flash	lib		$(base)		$(HEADER_DEPS)
+lib_gen 	lib		.		$(HEADER_DEPS)
+lib_getch	lib		$(base)		$(HEADER_DEPS)	$(srcdir)/fifo_defs.h
+lib_getstr	lib		$(base)		$(HEADER_DEPS)
+lib_hline	lib		$(base)		$(HEADER_DEPS)
+lib_immedok	lib		$(base)		$(HEADER_DEPS)
+lib_inchstr	lib		$(base)		$(HEADER_DEPS)
+lib_initscr	lib		$(base)		$(HEADER_DEPS)
+lib_insch	lib		$(base)		$(HEADER_DEPS)
+lib_insdel	lib		$(base)		$(HEADER_DEPS)
+lib_insnstr	lib		$(base)		$(HEADER_DEPS)
+lib_instr	lib		$(base)		$(HEADER_DEPS)
+lib_isendwin	lib		$(base)		$(HEADER_DEPS)
+lib_leaveok	lib		$(base)		$(HEADER_DEPS)
+lib_mouse	lib		$(base)		$(HEADER_DEPS)	$(INCDIR)/tic.h
+lib_move	lib		$(base)		$(HEADER_DEPS)
+lib_mvcur	lib		$(serial)	$(HEADER_DEPS)	$(INCDIR)/tic.h $(srcdir)/../progs/dump_entry.h
+lib_mvwin	lib		$(base)		$(HEADER_DEPS)
+lib_newterm	lib		$(base)		$(HEADER_DEPS)	$(INCDIR)/tic.h
+lib_newwin	lib		$(base)		$(HEADER_DEPS)
+lib_nl		lib		$(base)		$(HEADER_DEPS)
+lib_overlay	lib		$(base)		$(HEADER_DEPS)
+lib_pad 	lib		$(base)		$(HEADER_DEPS)
+lib_printw	lib		$(base)		$(HEADER_DEPS)
+lib_redrawln	lib		$(base)		$(HEADER_DEPS)
+lib_refresh	lib		$(base)		$(HEADER_DEPS)
+lib_restart	lib		$(base)		$(HEADER_DEPS)
+lib_scanw	lib		$(base)		$(HEADER_DEPS)
+lib_screen	lib		$(base)		$(HEADER_DEPS)
+lib_scroll	lib		$(base)		$(HEADER_DEPS)
+lib_scrollok	lib		$(base)		$(HEADER_DEPS)
+lib_scrreg	lib		$(base)		$(HEADER_DEPS)
+lib_set_term	lib		$(base)		$(HEADER_DEPS)	$(INCDIR)/tic.h
+lib_slk 	lib		$(base)		$(HEADER_DEPS)
+lib_slkatr_set	lib		$(base)		$(HEADER_DEPS)
+lib_slkatrof 	lib		$(base)		$(HEADER_DEPS)
+lib_slkatron 	lib		$(base)		$(HEADER_DEPS)
+lib_slkatrset 	lib		$(base)		$(HEADER_DEPS)
+lib_slkattr 	lib		$(base)		$(HEADER_DEPS)
+lib_slkclear 	lib		$(base)		$(HEADER_DEPS)
+lib_slkcolor 	lib		$(base)		$(HEADER_DEPS)
+lib_slkinit 	lib		$(base)		$(HEADER_DEPS)
+lib_slklab	lib		$(base)		$(HEADER_DEPS)
+lib_slkrefr	lib		$(base)		$(HEADER_DEPS)
+lib_slkset	lib		$(base)		$(HEADER_DEPS)
+lib_slktouch	lib		$(base)		$(HEADER_DEPS)
+lib_touch	lib		$(base)		$(HEADER_DEPS)
+lib_tracedmp	lib		$(trace)	$(HEADER_DEPS)
+lib_tracemse	lib		$(trace)	$(HEADER_DEPS)
+lib_tstp	lib		$(serial)	$(HEADER_DEPS)	$(srcdir)/SigAction.h
+lib_ungetch	lib		$(base)		$(HEADER_DEPS)	$(srcdir)/fifo_defs.h
+lib_vidattr	lib		$(serial)	$(HEADER_DEPS)
+lib_vline	lib		$(base)		$(HEADER_DEPS)
+lib_wattroff	lib		$(base)		$(HEADER_DEPS)
+lib_wattron	lib		$(base)		$(HEADER_DEPS)
+lib_winch	lib		$(base)		$(HEADER_DEPS)
+lib_window	lib		$(base)		$(HEADER_DEPS)
+link_test 	lib		.		$(HEADER_DEPS)
+nc_panel	lib		$(base)		$(HEADER_DEPS)
+safe_sprintf	lib		$(base)		$(HEADER_DEPS)
+tty_update	lib		$(serial)	$(HEADER_DEPS)
+varargs		lib		$(trace)	$(HEADER_DEPS)
 
 # Modules for porting
-memmove		lib		$(base)
-vsscanf 	lib		$(base)
+memmove		lib		$(base)		$(HEADER_DEPS)
+vsscanf 	lib		$(base)		$(HEADER_DEPS)
 
 # actually an extension, but with its own configure option (--disable-leaks)
-lib_freeall	lib		$(base)
+lib_freeall	lib		$(base)		$(HEADER_DEPS)	$(INCDIR)/tic.h
 
 # XSI extensions to the base library (wide-character)
 @ widechar
-charable	lib		$(wide)
-lib_add_wch	lib		$(wide)
-lib_box_set	lib		$(wide)
-lib_cchar	lib		$(wide)
-lib_erasewchar	lib		$(wide)
-lib_get_wch	lib		$(wide)
-lib_get_wstr	lib		$(wide)
-lib_hline_set	lib		$(wide)
-lib_in_wch	lib		$(wide)
-lib_in_wchnstr	lib		$(wide)
-lib_ins_wch	lib		$(wide)
-lib_inwstr	lib		$(wide)
-lib_key_name	lib		$(wide)
-lib_pecho_wchar	lib		$(wide)
-lib_slk_wset	lib		$(wide)
-lib_unget_wch	lib		$(wide)
-lib_vid_attr	lib		$(wide)		../include/term.h
-lib_vline_set	lib		$(wide)
-lib_wacs	lib		$(wide)
-lib_wunctrl	lib		$(wide)
+charable	lib		$(wide)		$(HEADER_DEPS)
+lib_add_wch	lib		$(wide)		$(HEADER_DEPS)
+lib_box_set	lib		$(wide)		$(HEADER_DEPS)
+lib_cchar	lib		$(wide)		$(HEADER_DEPS)
+lib_erasewchar	lib		$(wide)		$(HEADER_DEPS)
+lib_get_wch	lib		$(wide)		$(HEADER_DEPS)
+lib_get_wstr	lib		$(wide)		$(HEADER_DEPS)
+lib_hline_set	lib		$(wide)		$(HEADER_DEPS)
+lib_in_wch	lib		$(wide)		$(HEADER_DEPS)
+lib_in_wchnstr	lib		$(wide)		$(HEADER_DEPS)
+lib_ins_wch	lib		$(wide)		$(HEADER_DEPS)
+lib_inwstr	lib		$(wide)		$(HEADER_DEPS)
+lib_key_name	lib		$(wide)		$(HEADER_DEPS)
+lib_pecho_wchar	lib		$(wide)		$(HEADER_DEPS)
+lib_slk_wset	lib		$(wide)		$(HEADER_DEPS)
+lib_unget_wch	lib		$(wide)		$(HEADER_DEPS)
+lib_vid_attr	lib		$(wide)		$(HEADER_DEPS)
+lib_vline_set	lib		$(wide)		$(HEADER_DEPS)
+lib_wacs	lib		$(wide)		$(HEADER_DEPS)
+lib_wunctrl	lib		$(wide)		$(HEADER_DEPS)
 
 # Extensions to the base library
 @ ext_funcs
-expanded	lib		.
-legacy_coding	lib		$(base)		../include/term.h
-lib_dft_fgbg	lib		$(base)		../include/term.h
-lib_print	lib		$(tinfo)	../include/term.h
-resizeterm	lib		$(base)		../include/term.h
-trace_xnames	lib		$(trace)	../include/term.h $(INCDIR)/term_entry.h
-use_screen	lib		$(tinfo)
-use_window	lib		$(base)
-wresize		lib		$(base)		../include/term.h
+expanded	lib		.		$(HEADER_DEPS)
+legacy_coding	lib		$(base)		$(HEADER_DEPS)
+lib_dft_fgbg	lib		$(base)		$(HEADER_DEPS)
+lib_print	lib		$(tinfo)	$(HEADER_DEPS)
+resizeterm	lib		$(base)		$(HEADER_DEPS)
+trace_xnames	lib		$(trace)	$(HEADER_DEPS)
+use_screen	lib		$(tinfo)	$(HEADER_DEPS)
+use_window	lib		$(base)		$(HEADER_DEPS)
+wresize		lib		$(base)		$(HEADER_DEPS)
 
 # Support for termcap (and tic, etc.), which can be a separate library
 @ termlib
-access		lib		$(tinfo)
-add_tries	lib		$(tinfo)
-alloc_ttype	lib		$(tinfo)	../include/term.h $(INCDIR)/term_entry.h $(INCDIR)/tic.h
-codes		lib		.
-comp_error	lib		$(tinfo)	$(INCDIR)/tic.h
-db_iterator	lib		$(tinfo)	$(INCDIR)/tic.h
-doalloc		lib		$(tinfo)
-entries		lib		$(tinfo)	../include/term.h $(INCDIR)/tic.h
-fallback	lib		.		../include/term.h $(INCDIR)/tic.h
-free_ttype	lib		$(tinfo)	../include/term.h $(INCDIR)/term_entry.h $(INCDIR)/tic.h
-getenv_num	lib		$(tinfo)
-home_terminfo	lib		$(tinfo)
-init_keytry	lib		$(tinfo)	../include/term.h $(INCDIR)/tic.h init_keytry.h
-lib_acs 	lib		$(tinfo)	../include/term.h
-lib_baudrate	lib		$(tinfo)	../include/term.h
-lib_cur_term	lib		$(tinfo)	../include/term.h $(INCDIR)/term_entry.h
-lib_data	lib		$(tinfo)
-lib_has_cap	lib		$(tinfo)	../include/term.h
-lib_kernel	lib		$(tinfo)	../include/term.h
-lib_keyname	lib		.		../include/term.h
-lib_longname	lib		$(tinfo)
-lib_napms	lib		$(tinfo)
-lib_options	lib		$(tinfo)	../include/term.h
-lib_raw 	lib		$(tinfo)	../include/term.h
-lib_setup	lib		$(tinfo)	../include/term.h $(INCDIR)/term_entry.h
-lib_termcap	lib		$(tinfo)	../include/term.h $(INCDIR)/term_entry.h $(INCDIR)/tic.h $(INCDIR)/capdefaults.c
-lib_termname	lib		$(tinfo)	$(INCDIR)/tic.h
-lib_tgoto	lib		$(tinfo)	../include/term.h $(INCDIR)/tic.h
-lib_ti		lib		$(tinfo)	../include/term.h $(INCDIR)/term_entry.h $(INCDIR)/tic.h
-lib_tparm	lib		$(tinfo)	../include/term.h $(INCDIR)/tic.h
-lib_tputs	lib		$(tinfo)	../include/term.h $(INCDIR)/tic.h
-lib_trace	lib		$(trace)	$(INCDIR)/tic.h
-lib_traceatr	lib		$(trace)	../include/term.h
-lib_tracebits	lib		$(trace)	../include/term.h
-lib_tracechr	lib		$(trace)
-lib_ttyflags	lib		$(tinfo)	../include/term.h
-lib_twait	lib		$(serial)
-name_match	lib		$(tinfo)	../include/term.h $(INCDIR)/tic.h
-names		lib		.
-read_entry	lib		$(tinfo)	../include/term.h $(INCDIR)/term_entry.h $(INCDIR)/tic.h
-read_termcap	lib		$(tinfo)	../include/term.h $(INCDIR)/term_entry.h $(INCDIR)/tic.h
-setbuf		lib		$(tinfo)
-strings		lib		$(tinfo)
-trace_buf	lib		$(trace)
-trace_tries	lib		$(trace)
-tries		lib		$(base)
-trim_sgr0	lib		$(tinfo)	../include/term.h $(INCDIR)/term_entry.h $(INCDIR)/tic.h
-unctrl		lib		.
-visbuf		lib		$(trace)	$(INCDIR)/tic.h
+access		lib		$(tinfo)	$(HEADER_DEPS)	$(INCDIR)/tic.h
+add_tries	lib		$(tinfo)	$(HEADER_DEPS)
+alloc_ttype	lib		$(tinfo)	$(HEADER_DEPS)	$(INCDIR)/tic.h
+codes		lib		.		$(HEADER_DEPS)
+comp_captab	lib		.		$(HEADER_DEPS)	$(INCDIR)/tic.h ../include/hashsize.h
+comp_error	lib		$(tinfo)	$(HEADER_DEPS)	$(INCDIR)/tic.h
+comp_hash	lib		$(tinfo)	$(HEADER_DEPS)	$(INCDIR)/tic.h ../include/hashsize.h
+db_iterator	lib		$(tinfo)	$(HEADER_DEPS)	$(INCDIR)/tic.h
+doalloc		lib		$(tinfo)	$(HEADER_DEPS)
+entries		lib		$(tinfo)	$(HEADER_DEPS)	$(INCDIR)/tic.h
+fallback	lib		.		$(HEADER_DEPS)
+free_ttype	lib		$(tinfo)	$(HEADER_DEPS)	$(INCDIR)/tic.h
+getenv_num	lib		$(tinfo)	$(HEADER_DEPS)
+home_terminfo	lib		$(tinfo)	$(HEADER_DEPS)	$(INCDIR)/tic.h
+init_keytry	lib		$(tinfo)	$(HEADER_DEPS)	$(INCDIR)/tic.h init_keytry.h
+lib_acs 	lib		$(tinfo)	$(HEADER_DEPS)
+lib_baudrate	lib		$(tinfo)	$(HEADER_DEPS)	../include/termcap.h
+lib_cur_term	lib		$(tinfo)	$(HEADER_DEPS)	../include/termcap.h
+lib_data	lib		$(tinfo)	$(HEADER_DEPS)
+lib_has_cap	lib		$(tinfo)	$(HEADER_DEPS)
+lib_kernel	lib		$(tinfo)	$(HEADER_DEPS)
+lib_keyname	lib		.		$(HEADER_DEPS)	$(INCDIR)/tic.h
+lib_longname	lib		$(tinfo)	$(HEADER_DEPS)
+lib_napms	lib		$(tinfo)	$(HEADER_DEPS)
+lib_options	lib		$(tinfo)	$(HEADER_DEPS)
+lib_raw 	lib		$(tinfo)	$(HEADER_DEPS)
+lib_setup	lib		$(tinfo)	$(HEADER_DEPS)	$(INCDIR)/tic.h
+lib_termcap	lib		$(tinfo)	$(HEADER_DEPS)	$(INCDIR)/tic.h ../include/termcap.h $(INCDIR)/capdefaults.c
+lib_termname	lib		$(tinfo)	$(HEADER_DEPS)
+lib_tgoto	lib		$(tinfo)	$(HEADER_DEPS)	../include/termcap.h
+lib_ti		lib		$(tinfo)	$(HEADER_DEPS)	$(INCDIR)/tic.h
+lib_tparm	lib		$(tinfo)	$(HEADER_DEPS)	$(INCDIR)/tic.h
+lib_tputs	lib		$(tinfo)	$(HEADER_DEPS)	$(INCDIR)/tic.h ../include/termcap.h
+lib_trace	lib		$(trace)	$(HEADER_DEPS)	$(INCDIR)/tic.h
+lib_traceatr	lib		$(trace)	$(HEADER_DEPS)
+lib_tracebits	lib		$(trace)	$(HEADER_DEPS)
+lib_tracechr	lib		$(trace)	$(HEADER_DEPS)
+lib_ttyflags	lib		$(tinfo)	$(HEADER_DEPS)
+lib_twait	lib		$(serial)	$(HEADER_DEPS)
+name_match	lib		$(tinfo)	$(HEADER_DEPS)	$(INCDIR)/tic.h
+names		lib		.		$(HEADER_DEPS)
+read_entry	lib		$(tinfo)	$(HEADER_DEPS)	$(INCDIR)/tic.h $(INCDIR)/hashed_db.h
+read_termcap	lib		$(tinfo)	$(HEADER_DEPS)	$(INCDIR)/tic.h
+setbuf		lib		$(tinfo)	$(HEADER_DEPS)
+strings		lib		$(tinfo)	$(HEADER_DEPS)
+trace_buf	lib		$(trace)	$(HEADER_DEPS)
+trace_tries	lib		$(trace)	$(HEADER_DEPS)
+tries		lib		$(base)		$(HEADER_DEPS)
+trim_sgr0	lib		$(tinfo)	$(HEADER_DEPS)	$(INCDIR)/tic.h
+unctrl		lib		.		$(HEADER_DEPS)
+visbuf		lib		$(trace)	$(HEADER_DEPS)	$(INCDIR)/tic.h
 
 # Modules used only for tic, other programs using internal interfaces
 @ ticlib
-alloc_entry	lib		$(tinfo)	../include/term.h $(INCDIR)/term_entry.h $(INCDIR)/tic.h
-captoinfo	lib		$(tinfo)	$(INCDIR)/tic.h
-comp_captab	lib		.		$(INCDIR)/tic.h ../include/term.h ../include/hashsize.h
-comp_expand	lib		$(tinfo)	$(INCDIR)/tic.h
-comp_hash	lib		$(tinfo)	../include/term.h $(INCDIR)/tic.h ../include/hashsize.h
-comp_parse	lib		$(tinfo)	../include/term.h $(INCDIR)/term_entry.h $(INCDIR)/tic.h
-comp_scan	lib		$(tinfo)	$(INCDIR)/tic.h
-parse_entry	lib		$(tinfo)	../include/term.h $(INCDIR)/term_entry.h $(INCDIR)/tic.h ../include/parametrized.h $(INCDIR)/capdefaults.c
-write_entry	lib		$(tinfo)	../include/term.h $(INCDIR)/term_entry.h $(INCDIR)/tic.h
+alloc_entry	lib		$(tinfo)	$(HEADER_DEPS)	$(INCDIR)/tic.h
+captoinfo	lib		$(tinfo)	$(HEADER_DEPS)	$(INCDIR)/tic.h
+comp_expand	lib		$(tinfo)	$(HEADER_DEPS)	$(INCDIR)/tic.h
+comp_parse	lib		$(tinfo)	$(HEADER_DEPS)	$(INCDIR)/tic.h
+comp_scan	lib		$(tinfo)	$(HEADER_DEPS)	$(INCDIR)/tic.h
+parse_entry	lib		$(tinfo)	$(HEADER_DEPS)	$(INCDIR)/tic.h ../include/parametrized.h
+write_entry	lib		$(tinfo)	$(HEADER_DEPS)	$(INCDIR)/tic.h $(INCDIR)/hashed_db.h
 
 # Extensions to the termlib library
 @ ext_tinfo
-define_key	lib		$(base)
-hashed_db	lib		$(tinfo)
-key_defined	lib		$(base)
-keybound	lib		$(base)
-keyok		lib		$(base)
-version		lib		$(base)
+define_key	lib		$(base)		$(HEADER_DEPS)
+hashed_db	lib		$(tinfo)	$(HEADER_DEPS)	$(INCDIR)/tic.h $(INCDIR)/hashed_db.h
+key_defined	lib		$(base)		$(HEADER_DEPS)
+keybound	lib		$(base)		$(HEADER_DEPS)
+keyok		lib		$(base)		$(HEADER_DEPS)
+version		lib		$(base)		$(HEADER_DEPS)
+
+# Porting
+@ port_drivers
+lib_driver      lib             $(base)		$(HEADER_DEPS)
+
+@ port_win32con
+gettimeofday	lib		$(win32con)	$(HEADER_DEPS)
+wcwidth		lib             $(win32con)	$(HEADER_DEPS)
+win_driver	lib             $(win32con)	$(HEADER_DEPS)
+
+@ port_tinfo
+tinfo_driver	lib		$(tinfo)	$(HEADER_DEPS)	$(INCDIR)/tic.h
 
 # vile:makemode
diff -Naur ncurses-5.7.orig/ncurses/tinfo/MKcaptab.sh ncurses-5.7/ncurses/tinfo/MKcaptab.sh
--- ncurses-5.7.orig/ncurses/tinfo/MKcaptab.sh	2007-08-12 09:13:51.000000000 -0400
+++ ncurses-5.7/ncurses/tinfo/MKcaptab.sh	2011-01-08 18:18:29.750780851 -0500
@@ -1,6 +1,6 @@
 #!/bin/sh
 ##############################################################################
-# Copyright (c) 2007 Free Software Foundation, Inc.                          #
+# Copyright (c) 2007-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 "Software"), #
@@ -26,12 +26,19 @@
 # use or other dealings in this Software without prior written               #
 # authorization.                                                             #
 ##############################################################################
-# $Id: MKcaptab.sh,v 1.8 2007/08/12 13:13:51 tom Exp $
+# $Id: MKcaptab.sh,v 1.13 2010/12/25 23:43:58 tom Exp $
 AWK=${1-awk}
 OPT1=${2-0}
 OPT2=${3-tinfo/MKcaptab.awk}
 DATA=${4-../include/Caps}
 
+cat <<EOF
+/*
+ * generated by $0
+ */
+
+EOF
+
 cat <<'EOF'
 /*
  *	comp_captab.c -- The names of the capabilities indexed via a hash
@@ -48,7 +55,7 @@
 ./make_hash 1 info $OPT1 <$DATA
 ./make_hash 3 cap  $OPT1 <$DATA
 
-$AWK -f $OPT2 bigstrings=$OPT1 tablename=capalias <$DATA 
+$AWK -f $OPT2 bigstrings=$OPT1 tablename=capalias <$DATA
 
 $AWK -f $OPT2 bigstrings=$OPT1 tablename=infoalias <$DATA
 
@@ -58,7 +65,7 @@
 static void
 next_string(const char *strings, unsigned *offset)
 {
-	*offset += strlen(strings + *offset) + 1;
+    *offset += (unsigned) strlen(strings + *offset) + 1;
 }
 
 static const struct name_table_entry *
@@ -66,21 +73,21 @@
 		const name_table_data *source,
 		const char *strings)
 {
-	if (*actual == 0) {
-		*actual = typeCalloc(struct name_table_entry, CAPTABSIZE);
-		if (*actual != 0) {
-			unsigned n;
-			unsigned len = 0;
-			for (n = 0; n < CAPTABSIZE; ++n) {
-				(*actual)[n].nte_name = strings + len;
-				(*actual)[n].nte_type = source[n].nte_type;
-				(*actual)[n].nte_index = source[n].nte_index;
-				(*actual)[n].nte_link = source[n].nte_link;
-				next_string(strings, &len);
-			}
-		}
+    if (*actual == 0) {
+	*actual = typeCalloc(struct name_table_entry, CAPTABSIZE);
+	if (*actual != 0) {
+	    unsigned n;
+	    unsigned len = 0;
+	    for (n = 0; n < CAPTABSIZE; ++n) {
+		(*actual)[n].nte_name = strings + len;
+		(*actual)[n].nte_type = source[n].nte_type;
+		(*actual)[n].nte_index = source[n].nte_index;
+		(*actual)[n].nte_link = source[n].nte_link;
+		next_string(strings, &len);
+	    }
 	}
-	return *actual;
+    }
+    return *actual;
 }
 
 #define add_alias(field) \\
@@ -94,18 +101,18 @@
 		const char *strings,
 		unsigned tablesize)
 {
-	if (*actual == 0) {
-		*actual = typeCalloc(struct alias, tablesize + 1);
-		if (*actual != 0) {
-			unsigned n;
-			for (n = 0; n < tablesize; ++n) {
-				add_alias(from);
-				add_alias(to);
-				add_alias(source);
-			}
-		}
+    if (*actual == 0) {
+	*actual = typeCalloc(struct alias, tablesize + 1);
+	if (*actual != 0) {
+	    unsigned n;
+	    for (n = 0; n < tablesize; ++n) {
+		add_alias(from);
+		add_alias(to);
+		add_alias(source);
+	    }
 	}
-	return *actual;
+    }
+    return *actual;
 }
 
 #define build_names(root) _nc_build_names(&_nc_##root##_table, \\
@@ -122,27 +129,82 @@
 
 NCURSES_EXPORT(const struct name_table_entry *) _nc_get_table (bool termcap)
 {
-	return termcap ? build_names(cap) : build_names(info) ;
+    return termcap ? build_names(cap) : build_names(info) ;
 }
 
-NCURSES_EXPORT(const short *) _nc_get_hash_table (bool termcap)
+/* entrypoint used by tack (do not alter) */
+NCURSES_EXPORT(const HashValue *) _nc_get_hash_table (bool termcap)
 {
-	return termcap ? _nc_cap_hash_table: _nc_info_hash_table ;
+    return termcap ? _nc_cap_hash_table: _nc_info_hash_table ;
 }
 
 NCURSES_EXPORT(const struct alias *) _nc_get_alias_table (bool termcap)
 {
-	return termcap ? build_alias(cap) : build_alias(info) ;
+    return termcap ? build_alias(cap) : build_alias(info) ;
+}
+
+static HashValue
+info_hash(const char *string)
+{
+    long sum = 0;
+
+    DEBUG(9, ("hashing %s", string));
+    while (*string) {
+	sum += (long) (*string + (*(string + 1) << 8));
+	string++;
+    }
+
+    DEBUG(9, ("sum is %ld", sum));
+    return (HashValue) (sum % HASHTABSIZE);
+}
+
+#define TCAP_LEN 2		/* only 1- or 2-character names are used */
+
+static HashValue
+tcap_hash(const char *string)
+{
+    char temp[TCAP_LEN + 1];
+    int limit = 0;
+
+    while (*string) {
+	temp[limit++] = *string++;
+	if (limit >= TCAP_LEN)
+	    break;
+    }
+    temp[limit] = '\0';
+    return info_hash(temp);
+}
+
+static int
+compare_tcap_names(const char *a, const char *b)
+{
+    return !strncmp(a, b, TCAP_LEN);
+}
+
+static int
+compare_info_names(const char *a, const char *b)
+{
+    return !strcmp(a, b);
+}
+
+static const HashData hash_data[2] = {
+    { HASHTABSIZE, _nc_info_hash_table, info_hash, compare_info_names },
+    { HASHTABSIZE, _nc_cap_hash_table, tcap_hash, compare_tcap_names }
+};
+
+NCURSES_EXPORT(const HashData *) _nc_get_hash_info (bool termcap)
+{
+    return &hash_data[(termcap != FALSE)];
 }
 
 #if NO_LEAKS
 NCURSES_EXPORT(void) _nc_comp_captab_leaks(void)
 {
 #if $OPT1
-	FreeIfNeeded(_nc_cap_table);
-	FreeIfNeeded(_nc_info_table);
-	FreeIfNeeded(_nc_capalias_table);
-	FreeIfNeeded(_nc_infoalias_table);
+    FreeIfNeeded(_nc_cap_table);
+    FreeIfNeeded(_nc_info_table);
+    FreeIfNeeded(_nc_capalias_table);
+    FreeIfNeeded(_nc_infoalias_table);
 #endif
 }
 #endif /* NO_LEAKS */
diff -Naur ncurses-5.7.orig/ncurses/tinfo/MKcodes.awk ncurses-5.7/ncurses/tinfo/MKcodes.awk
--- ncurses-5.7.orig/ncurses/tinfo/MKcodes.awk	2008-06-28 19:13:25.000000000 -0400
+++ ncurses-5.7/ncurses/tinfo/MKcodes.awk	2011-01-08 18:13:50.711157251 -0500
@@ -1,5 +1,5 @@
 ##############################################################################
-# Copyright (c) 1998-2007,2008 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 "Software"), #
@@ -25,7 +25,7 @@
 # use or other dealings in this Software without prior written               #
 # authorization.                                                             #
 ##############################################################################
-# $Id: MKcodes.awk,v 1.5 2008/06/28 23:13:25 tom Exp $
+# $Id: MKcodes.awk,v 1.9 2010/01/23 17:57:43 tom Exp $
 function large_item(value) {
 	result = sprintf("%d,", offset);
 	offset = offset + length(value) + 1;
@@ -101,8 +101,6 @@
 		print  ""
 		print  "#if BROKEN_LINKER || USE_REENTRANT"
 		print  ""
-		print  "#include <term.h>"
-		print  ""
 		if (bigstrings) {
 			printf "static const char _nc_code_blob[] = \n"
 			printf "%s;\n", bigstr;
@@ -117,28 +115,39 @@
 			print  "		if ((*value = typeCalloc(NCURSES_CONST char *, size + 1)) != 0) {"
 			print  "			unsigned n;"
 			print  "			for (n = 0; n < size; ++n) {"
-			print  "				(*value)[n] = _nc_code_blob + offsets[n];"
+			print  "				(*value)[n] = (NCURSES_CONST char *) _nc_code_blob + offsets[n];"
 			print  "			}"
 			print  "		}"
 			print  "	}"
 			print  "	return *value;"
 			print  "}"
 			print  ""
-			print  "#define FIX(it) NCURSES_IMPEXP IT * NCURSES_API _nc_##it(void) { return alloc_array(&ptr_##it, _nc_offset_##it, SIZEOF(_nc_offset_##it)); }"
+			print  "#define FIX(it) NCURSES_IMPEXP IT * NCURSES_API NCURSES_PUBLIC_VAR(it)(void) { return alloc_array(&ptr_##it, _nc_offset_##it, SIZEOF(_nc_offset_##it)); }"
 		} else {
 			print  "#define DCL(it) static IT data##it[]"
 			print  ""
 			print_strings("boolcodes", small_boolcodes);
 			print_strings("numcodes", small_numcodes);
 			print_strings("strcodes", small_strcodes);
-			print  "#define FIX(it) NCURSES_IMPEXP IT * NCURSES_API _nc_##it(void) { return data##it; }"
+			print  "#define FIX(it) NCURSES_IMPEXP IT * NCURSES_API NCURSES_PUBLIC_VAR(it)(void) { return data##it; }"
 		}
 		print  ""
+		print  "/* remove public definition which conflicts with FIX() */"
+		print  "#undef boolcodes"
+		print  "#undef numcodes"
+		print  "#undef strcodes"
+		print  ""
+		print  "/* add local definition */"
 		print  "FIX(boolcodes)"
 		print  "FIX(numcodes)"
 		print  "FIX(strcodes)"
 		print  ""
+		print  "/* restore the public definition */"
+		print  ""
 		print  "#define FREE_FIX(it) if (ptr_##it) { FreeAndNull(ptr_##it); }"
+		print  "#define boolcodes  NCURSES_PUBLIC_VAR(boolcodes())"
+		print  "#define numcodes   NCURSES_PUBLIC_VAR(numcodes())"
+		print  "#define strcodes   NCURSES_PUBLIC_VAR(strcodes())"
 		print  ""
 		print  "#if NO_LEAKS"
 		print  "NCURSES_EXPORT(void)"
diff -Naur ncurses-5.7.orig/ncurses/tinfo/MKfallback.sh ncurses-5.7/ncurses/tinfo/MKfallback.sh
--- ncurses-5.7.orig/ncurses/tinfo/MKfallback.sh	2006-07-15 12:54:20.000000000 -0400
+++ ncurses-5.7/ncurses/tinfo/MKfallback.sh	2011-01-08 18:18:29.079036539 -0500
@@ -1,6 +1,6 @@
 #!/bin/sh
 ##############################################################################
-# Copyright (c) 1998-2001,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 "Software"), #
@@ -26,7 +26,7 @@
 # use or other dealings in this Software without prior written               #
 # authorization.                                                             #
 ##############################################################################
-# $Id: MKfallback.sh,v 1.13 2006/07/15 16:54:20 tom Exp $
+# $Id: MKfallback.sh,v 1.15 2010/08/07 20:32:34 tom Exp $
 #
 # MKfallback.sh -- create fallback table for entry reads
 #
@@ -42,6 +42,17 @@
 terminfo_src=$1
 shift
 
+tic_path=$1
+shift
+
+case $tic_path in #(vi
+/*)
+	tic_head=`echo "$tic_path" | sed -e 's,/[^/]*$,,'`
+	PATH=$tic_head:$PATH
+	export PATH
+	;;
+esac
+
 if test $# != 0 ; then
 	tmp_info=tmp_info
 	echo creating temporary terminfo directory... >&2
@@ -52,7 +63,7 @@
 	TERMINFO_DIRS=$TERMINFO:$terminfo_dir
 	export TERMINFO_DIRS
 
-	tic -x $terminfo_src >&2
+	$tic_path -x $terminfo_src >&2
 else
 	tmp_info=
 fi
@@ -63,7 +74,6 @@
  */
 
 #include <curses.priv.h>
-#include <term.h>
 
 EOF
 
diff -Naur ncurses-5.7.orig/ncurses/tinfo/MKnames.awk ncurses-5.7/ncurses/tinfo/MKnames.awk
--- ncurses-5.7.orig/ncurses/tinfo/MKnames.awk	2008-10-11 17:07:56.000000000 -0400
+++ ncurses-5.7/ncurses/tinfo/MKnames.awk	2011-01-08 18:13:50.711157251 -0500
@@ -1,5 +1,5 @@
 ##############################################################################
-# Copyright (c) 2007,2008 Free Software Foundation, Inc.                     #
+# Copyright (c) 2007-2008,2009 Free 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: MKnames.awk,v 1.20 2008/10/11 21:07:56 tom Exp $
+# $Id: MKnames.awk,v 1.22 2009/03/21 21:03:39 tom Exp $
 function large_item(value) {
 	result = sprintf("%d,", offset);
 	offset = offset + length(value) + 1;
@@ -107,8 +107,6 @@
 		print  ""
 		print  "#if BROKEN_LINKER || USE_REENTRANT"
 		print  ""
-		print  "#include <term.h>"
-		print  ""
 		if (bigstrings) {
 			printf "static const char _nc_name_blob[] = \n"
 			printf "%s;\n", bigstr;
@@ -133,7 +131,7 @@
 			print  "	return *value;"
 			print  "}"
 			print  ""
-			print  "#define FIX(it) NCURSES_IMPEXP IT * NCURSES_API _nc_##it(void) { return alloc_array(&ptr_##it, _nc_offset_##it, SIZEOF(_nc_offset_##it)); }"
+			print  "#define FIX(it) NCURSES_IMPEXP IT * NCURSES_API NCURSES_PUBLIC_VAR(it)(void) { return alloc_array(&ptr_##it, _nc_offset_##it, SIZEOF(_nc_offset_##it)); }"
 		} else {
 			print  "#define DCL(it) static IT data##it[]"
 			print  ""
@@ -143,9 +141,18 @@
 			print_strings("numfnames", small_numfnames);
 			print_strings("strnames", small_strnames);
 			print_strings("strfnames", small_strfnames);
-			print  "#define FIX(it) NCURSES_IMPEXP IT * NCURSES_API _nc_##it(void) { return data##it; }"
+			print  "#define FIX(it) NCURSES_IMPEXP IT * NCURSES_API NCURSES_PUBLIC_VAR(it)(void) { return data##it; }"
 		}
 		print  ""
+		print  "/* remove public definition which conflicts with FIX() */"
+		print  "#undef boolnames"
+		print  "#undef boolfnames"
+		print  "#undef numnames"
+		print  "#undef numfnames"
+		print  "#undef strnames"
+		print  "#undef strfnames"
+		print  ""
+		print  "/* add local definition */"
 		print  "FIX(boolnames)"
 		print  "FIX(boolfnames)"
 		print  "FIX(numnames)"
@@ -153,6 +160,13 @@
 		print  "FIX(strnames)"
 		print  "FIX(strfnames)"
 		print  ""
+		print  "/* restore the public definition */"
+		print  "#define boolnames  NCURSES_PUBLIC_VAR(boolnames())"
+		print  "#define boolfnames NCURSES_PUBLIC_VAR(boolfnames())"
+		print  "#define numnames   NCURSES_PUBLIC_VAR(numnames())"
+		print  "#define numfnames  NCURSES_PUBLIC_VAR(numfnames())"
+		print  "#define strnames   NCURSES_PUBLIC_VAR(strnames())"
+		print  "#define strfnames  NCURSES_PUBLIC_VAR(strfnames())"
 		print  ""
 		print  "#define FREE_FIX(it) if (ptr_##it) { FreeAndNull(ptr_##it); }"
 		print  ""
diff -Naur ncurses-5.7.orig/ncurses/tinfo/access.c ncurses-5.7/ncurses/tinfo/access.c
--- ncurses-5.7.orig/ncurses/tinfo/access.c	2007-11-17 19:57:53.000000000 -0500
+++ ncurses-5.7/ncurses/tinfo/access.c	2011-01-08 18:13:50.711157251 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2006,2007 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            *
@@ -36,9 +36,8 @@
 #include <sys/stat.h>
 
 #include <tic.h>
-#include <nc_alloc.h>
 
-MODULE_ID("$Id: access.c,v 1.14 2007/11/18 00:57:53 tom Exp $")
+MODULE_ID("$Id: access.c,v 1.16 2010/01/23 17:57:43 tom Exp $")
 
 #define LOWERCASE(c) ((isalpha(UChar(c)) && isupper(UChar(c))) ? tolower(UChar(c)) : (c))
 
@@ -97,7 +96,7 @@
 	test = path;
     else
 	test++;
-    return (test - path);
+    return (unsigned) (test - path);
 }
 
 NCURSES_EXPORT(char *)
diff -Naur ncurses-5.7.orig/ncurses/tinfo/add_tries.c ncurses-5.7/ncurses/tinfo/add_tries.c
--- ncurses-5.7.orig/ncurses/tinfo/add_tries.c	2006-12-30 18:15:26.000000000 -0500
+++ ncurses-5.7/ncurses/tinfo/add_tries.c	2011-01-08 18:18:29.750780851 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2005,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            *
@@ -39,7 +39,7 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: add_tries.c,v 1.8 2006/12/30 23:15:26 tom Exp $")
+MODULE_ID("$Id: add_tries.c,v 1.10 2010/12/19 01:31:14 tom Exp $")
 
 #define SET_TRY(dst,src) if ((dst->ch = *src++) == 128) dst->ch = '\0'
 #define CMP_TRY(a,b) ((a)? (a == b) : (b == 128))
@@ -50,7 +50,8 @@
     TRIES *ptr, *savedptr;
     unsigned const char *txt = (unsigned const char *) str;
 
-    T((T_CALLED("_nc_add_to_try(%p, %s, %u)"), *tree, _nc_visbuf(str), code));
+    T((T_CALLED("_nc_add_to_try(%p, %s, %u)"),
+       (void *) *tree, _nc_visbuf(str), code));
     if (txt == 0 || *txt == '\0' || code == 0)
 	returnCode(ERR);
 
@@ -66,7 +67,7 @@
 
 	    if (CMP_TRY(ptr->ch, cmp)) {
 		if (*(++txt) == '\0') {
-		    ptr->value = code;
+		    ptr->value = (unsigned short) code;
 		    returnCode(OK);
 		}
 		if (ptr->child != 0)
@@ -115,6 +116,6 @@
 	ptr->value = 0;
     }
 
-    ptr->value = code;
+    ptr->value = (unsigned short) code;
     returnCode(OK);
 }
diff -Naur ncurses-5.7.orig/ncurses/tinfo/alloc_entry.c ncurses-5.7/ncurses/tinfo/alloc_entry.c
--- ncurses-5.7.orig/ncurses/tinfo/alloc_entry.c	2008-08-16 12:25:31.000000000 -0400
+++ ncurses-5.7/ncurses/tinfo/alloc_entry.c	2011-01-08 18:18:29.750780851 -0500
@@ -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            *
@@ -46,9 +46,8 @@
 #include <curses.priv.h>
 
 #include <tic.h>
-#include <term_entry.h>
 
-MODULE_ID("$Id: alloc_entry.c,v 1.48 2008/08/16 16:25:31 tom Exp $")
+MODULE_ID("$Id: alloc_entry.c,v 1.51 2010/12/25 23:06:01 tom Exp $")
 
 #define ABSENT_OFFSET    -1
 #define CANCELLED_OFFSET -2
@@ -65,8 +64,10 @@
     unsigned i;
 
 #if NO_LEAKS
-    if (tp == 0 && stringbuf != 0) {
-	FreeAndNull(stringbuf);
+    if (tp == 0) {
+	if (stringbuf != 0) {
+	    FreeAndNull(stringbuf);
+	}
 	return;
     }
 #endif
@@ -181,7 +182,7 @@
 	    } else if (tp->Strings[i] == CANCELLED_STRING) {
 		offsets[i] = CANCELLED_OFFSET;
 	    } else {
-		offsets[i] = tp->Strings[i] - stringbuf;
+		offsets[i] = (int) (tp->Strings[i] - stringbuf);
 	    }
 	}
     }
@@ -190,7 +191,7 @@
 	if (ep->uses[i].name == 0)
 	    useoffsets[i] = ABSENT_OFFSET;
 	else
-	    useoffsets[i] = ep->uses[i].name - stringbuf;
+	    useoffsets[i] = (int) (ep->uses[i].name - stringbuf);
     }
 
     if ((tp->str_table = typeMalloc(char, next_free)) == (char *) 0)
@@ -214,10 +215,10 @@
     if (!copy_strings) {
 	if ((n = (unsigned) NUM_EXT_NAMES(tp)) != 0) {
 	    if (n < SIZEOF(offsets)) {
-		unsigned length = 0;
+		size_t length = 0;
 		for (i = 0; i < n; i++) {
 		    length += strlen(tp->ext_Names[i]) + 1;
-		    offsets[i] = tp->ext_Names[i] - stringbuf;
+		    offsets[i] = (int) (tp->ext_Names[i] - stringbuf);
 		}
 		if ((tp->ext_str_table = typeMalloc(char, length)) == 0)
 		      _nc_err_abort(MSG_NO_MEMORY);
diff -Naur ncurses-5.7.orig/ncurses/tinfo/alloc_ttype.c ncurses-5.7/ncurses/tinfo/alloc_ttype.c
--- ncurses-5.7.orig/ncurses/tinfo/alloc_ttype.c	2008-10-12 12:12:00.000000000 -0400
+++ ncurses-5.7/ncurses/tinfo/alloc_ttype.c	2011-01-08 18:18:29.750780851 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1999-2006,2008 Free Software Foundation, Inc.              *
+ * Copyright (c) 1999-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            *
@@ -41,9 +41,8 @@
 #include <curses.priv.h>
 
 #include <tic.h>
-#include <term_entry.h>
 
-MODULE_ID("$Id: alloc_ttype.c,v 1.17 2008/10/12 16:12:00 tom Exp $")
+MODULE_ID("$Id: alloc_ttype.c,v 1.22 2010/12/19 00:24:09 tom Exp $")
 
 #if NCURSES_XNAMES
 /*
@@ -91,6 +90,9 @@
     return FALSE;
 }
 
+#define EXTEND_NUM(num, ext) \
+	to->num = (unsigned short) (to->num + (ext - to->ext))
+
 static void
 realign_data(TERMTYPE *to, char **ext_Names,
 	     int ext_Booleans,
@@ -101,7 +103,7 @@
     int limit = (to->ext_Booleans + to->ext_Numbers + to->ext_Strings);
 
     if (to->ext_Booleans != ext_Booleans) {
-	to->num_Booleans += (ext_Booleans - to->ext_Booleans);
+	EXTEND_NUM(num_Booleans, ext_Booleans);
 	to->Booleans = typeRealloc(NCURSES_SBOOL, to->num_Booleans, to->Booleans);
 	for (n = to->ext_Booleans - 1,
 	     m = ext_Booleans - 1,
@@ -112,10 +114,10 @@
 		to->Booleans[base + m] = FALSE;
 	    }
 	}
-	to->ext_Booleans = ext_Booleans;
+	to->ext_Booleans = UShort(ext_Booleans);
     }
     if (to->ext_Numbers != ext_Numbers) {
-	to->num_Numbers += (ext_Numbers - to->ext_Numbers);
+	EXTEND_NUM(num_Numbers, ext_Numbers);
 	to->Numbers = typeRealloc(short, to->num_Numbers, to->Numbers);
 	for (n = to->ext_Numbers - 1,
 	     m = ext_Numbers - 1,
@@ -126,10 +128,10 @@
 		to->Numbers[base + m] = ABSENT_NUMERIC;
 	    }
 	}
-	to->ext_Numbers = ext_Numbers;
+	to->ext_Numbers = UShort(ext_Numbers);
     }
     if (to->ext_Strings != ext_Strings) {
-	to->num_Strings += (ext_Strings - to->ext_Strings);
+	EXTEND_NUM(num_Strings, ext_Strings);
 	to->Strings = typeRealloc(char *, to->num_Strings, to->Strings);
 	for (n = to->ext_Strings - 1,
 	     m = ext_Strings - 1,
@@ -140,17 +142,17 @@
 		to->Strings[base + m] = ABSENT_STRING;
 	    }
 	}
-	to->ext_Strings = ext_Strings;
+	to->ext_Strings = UShort(ext_Strings);
     }
 }
 
 /*
  * Returns the first index in ext_Names[] for the given token-type
  */
-static int
+static unsigned
 _nc_first_ext_name(TERMTYPE *tp, int token_type)
 {
-    int first;
+    unsigned first;
 
     switch (token_type) {
     case BOOLEAN:
@@ -160,7 +162,7 @@
 	first = tp->ext_Booleans;
 	break;
     case STRING:
-	first = tp->ext_Booleans + tp->ext_Numbers;
+	first = (unsigned) (tp->ext_Booleans + tp->ext_Numbers);
 	break;
     default:
 	first = 0;
@@ -172,17 +174,17 @@
 /*
  * Returns the last index in ext_Names[] for the given token-type
  */
-static int
+static unsigned
 _nc_last_ext_name(TERMTYPE *tp, int token_type)
 {
-    int last;
+    unsigned last;
 
     switch (token_type) {
     case BOOLEAN:
 	last = tp->ext_Booleans;
 	break;
     case NUMBER:
-	last = tp->ext_Booleans + tp->ext_Numbers;
+	last = (unsigned) (tp->ext_Booleans + tp->ext_Numbers);
 	break;
     default:
     case STRING:
@@ -204,7 +206,7 @@
 
     for (j = first; j < last; j++) {
 	if (!strcmp(name, tp->ext_Names[j])) {
-	    return j;
+	    return (int) j;
 	}
     }
     return -1;
@@ -244,7 +246,7 @@
     int first, last;
 
     if ((first = _nc_find_ext_name(tp, name, token_type)) >= 0) {
-	last = NUM_EXT_NAMES(tp) - 1;
+	last = (int) NUM_EXT_NAMES(tp) - 1;
 	for (j = first; j < last; j++) {
 	    tp->ext_Names[j] = tp->ext_Names[j + 1];
 	}
@@ -254,22 +256,22 @@
 	    last = tp->num_Booleans - 1;
 	    for (j = first; j < last; j++)
 		tp->Booleans[j] = tp->Booleans[j + 1];
-	    tp->ext_Booleans -= 1;
-	    tp->num_Booleans -= 1;
+	    tp->ext_Booleans--;
+	    tp->num_Booleans--;
 	    break;
 	case NUMBER:
 	    last = tp->num_Numbers - 1;
 	    for (j = first; j < last; j++)
 		tp->Numbers[j] = tp->Numbers[j + 1];
-	    tp->ext_Numbers -= 1;
-	    tp->num_Numbers -= 1;
+	    tp->ext_Numbers--;
+	    tp->num_Numbers--;
 	    break;
 	case STRING:
 	    last = tp->num_Strings - 1;
 	    for (j = first; j < last; j++)
 		tp->Strings[j] = tp->Strings[j + 1];
-	    tp->ext_Strings -= 1;
-	    tp->num_Strings -= 1;
+	    tp->ext_Strings--;
+	    tp->num_Strings--;
 	    break;
 	}
 	return TRUE;
@@ -303,32 +305,32 @@
     for (k = total - 1; k > j; k--)
 	tp->ext_Names[k] = tp->ext_Names[k - 1];
     tp->ext_Names[j] = name;
-    j = _nc_ext_data_index(tp, (int) j, token_type);
+    j = (unsigned) _nc_ext_data_index(tp, (int) j, token_type);
 
     switch (token_type) {
     case BOOLEAN:
-	tp->ext_Booleans += 1;
-	tp->num_Booleans += 1;
+	tp->ext_Booleans++;
+	tp->num_Booleans++;
 	tp->Booleans = typeRealloc(NCURSES_SBOOL, tp->num_Booleans, tp->Booleans);
-	for (k = tp->num_Booleans - 1; k > j; k--)
+	for (k = (unsigned) (tp->num_Booleans - 1); k > j; k--)
 	    tp->Booleans[k] = tp->Booleans[k - 1];
 	break;
     case NUMBER:
-	tp->ext_Numbers += 1;
-	tp->num_Numbers += 1;
+	tp->ext_Numbers++;
+	tp->num_Numbers++;
 	tp->Numbers = typeRealloc(short, tp->num_Numbers, tp->Numbers);
-	for (k = tp->num_Numbers - 1; k > j; k--)
+	for (k = (unsigned) (tp->num_Numbers - 1); k > j; k--)
 	    tp->Numbers[k] = tp->Numbers[k - 1];
 	break;
     case STRING:
-	tp->ext_Strings += 1;
-	tp->num_Strings += 1;
+	tp->ext_Strings++;
+	tp->num_Strings++;
 	tp->Strings = typeRealloc(char *, tp->num_Strings, tp->Strings);
-	for (k = tp->num_Strings - 1; k > j; k--)
+	for (k = (unsigned) (tp->num_Strings - 1); k > j; k--)
 	    tp->Strings[k] = tp->Strings[k - 1];
 	break;
     }
-    return j;
+    return (int) j;
 }
 
 /*
@@ -345,10 +347,10 @@
 
     for (j = first; j < last;) {
 	char *name = to->ext_Names[j];
-	unsigned j_str = to->num_Strings - first - to->ext_Strings;
+	int j_str = to->num_Strings - first - to->ext_Strings;
 
 	if (to->Strings[j + j_str] == CANCELLED_STRING) {
-	    if ((k = _nc_find_ext_name(from, to->ext_Names[j], BOOLEAN)) >= 0) {
+	    if (_nc_find_ext_name(from, to->ext_Names[j], BOOLEAN) >= 0) {
 		if (_nc_del_ext_name(to, name, STRING)
 		    || _nc_del_ext_name(to, name, NUMBER)) {
 		    k = _nc_ins_ext_name(to, name, BOOLEAN);
@@ -356,8 +358,7 @@
 		} else {
 		    j++;
 		}
-	    } else if ((k = _nc_find_ext_name(from, to->ext_Names[j],
-					      NUMBER)) >= 0) {
+	    } else if (_nc_find_ext_name(from, to->ext_Names[j], NUMBER) >= 0) {
 		if (_nc_del_ext_name(to, name, STRING)
 		    || _nc_del_ext_name(to, name, BOOLEAN)) {
 		    k = _nc_ins_ext_name(to, name, NUMBER);
@@ -365,8 +366,7 @@
 		} else {
 		    j++;
 		}
-	    } else if ((k = _nc_find_ext_name(from, to->ext_Names[j],
-					      STRING)) >= 0) {
+	    } else if (_nc_find_ext_name(from, to->ext_Names[j], STRING) >= 0) {
 		if (_nc_del_ext_name(to, name, NUMBER)
 		    || _nc_del_ext_name(to, name, BOOLEAN)) {
 		    k = _nc_ins_ext_name(to, name, STRING);
@@ -386,8 +386,8 @@
 NCURSES_EXPORT(void)
 _nc_align_termtype(TERMTYPE *to, TERMTYPE *from)
 {
-    int na = NUM_EXT_NAMES(to);
-    int nb = NUM_EXT_NAMES(from);
+    int na = (int) NUM_EXT_NAMES(to);
+    int nb = (int) NUM_EXT_NAMES(from);
     int n;
     bool same;
     char **ext_Names;
@@ -417,7 +417,7 @@
 	 * into it, updating to's counts for booleans, etc.  Fortunately we do
 	 * this only for the terminfo compiler (tic) and comparer (infocmp).
 	 */
-	ext_Names = typeMalloc(char *, na + nb);
+	ext_Names = typeMalloc(char *, (size_t)(na + nb));
 
 	if (to->ext_Strings && (from->ext_Booleans + from->ext_Numbers))
 	    adjust_cancels(to, from);
@@ -461,8 +461,8 @@
 	if (nb != (ext_Booleans + ext_Numbers + ext_Strings)) {
 	    nb = (ext_Booleans + ext_Numbers + ext_Strings);
 	    realign_data(from, ext_Names, ext_Booleans, ext_Numbers, ext_Strings);
-	    from->ext_Names = typeRealloc(char *, nb, from->ext_Names);
-	    memcpy(from->ext_Names, ext_Names, sizeof(char *) * nb);
+	    from->ext_Names = typeRealloc(char *, (size_t) nb, from->ext_Names);
+	    memcpy(from->ext_Names, ext_Names, sizeof(char *) * (size_t) nb);
 	    DEBUG(2, ("realigned %d extended names for '%s' (from)",
 		      NUM_EXT_NAMES(from), from->term_names));
 	}
diff -Naur ncurses-5.7.orig/ncurses/tinfo/captoinfo.c ncurses-5.7/ncurses/tinfo/captoinfo.c
--- ncurses-5.7.orig/ncurses/tinfo/captoinfo.c	2008-08-16 15:24:51.000000000 -0400
+++ ncurses-5.7/ncurses/tinfo/captoinfo.c	2011-01-08 18:18:29.666656621 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2006,2008 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            *
@@ -93,7 +93,7 @@
 #include <ctype.h>
 #include <tic.h>
 
-MODULE_ID("$Id: captoinfo.c,v 1.52 2008/08/16 19:24:51 tom Exp $")
+MODULE_ID("$Id: captoinfo.c,v 1.58 2010/12/04 20:08:19 tom Exp $")
 
 #define MAX_PUSHED	16	/* max # args we can push onto the stack */
 
@@ -125,10 +125,10 @@
 static char *
 save_string(char *d, const char *const s)
 {
-    size_t have = (d - my_string);
+    size_t have = (size_t) (d - my_string);
     size_t need = have + strlen(s) + 2;
     if (need > my_length) {
-	my_string = (char *) realloc(my_string, my_length = (need + need));
+	my_string = (char *) _nc_doalloc(my_string, my_length = (need + need));
 	if (my_string == 0)
 	    _nc_err_abort(MSG_NO_MEMORY);
 	d = my_string + have;
@@ -196,7 +196,7 @@
 	case '3':
 	    len = 1;
 	    while (isdigit(UChar(*sp))) {
-		c = 8 * c + (*sp++ - '0');
+		c = (unsigned char) (8 * c + (*sp++ - '0'));
 		len++;
 	    }
 	    break;
@@ -207,7 +207,7 @@
 	}
 	break;
     case '^':
-	c = (*++sp & 0x1f);
+	c = (unsigned char) (*++sp & 0x1f);
 	len = 2;
 	break;
     default:
@@ -643,6 +643,7 @@
     int seenone = 0, seentwo = 0, saw_m = 0, saw_n = 0;
     const char *padding;
     const char *trimmed = 0;
+    int in0, in1, in2;
     char ch1 = 0, ch2 = 0;
     char *bufptr = init_string();
     int len;
@@ -666,8 +667,27 @@
 	int c1, c2;
 	char *cp = 0;
 
-	if (str[0] == '\\' && (str[1] == '^' || str[1] == ',')) {
-	    bufptr = save_char(bufptr, *++str);
+	if (str[0] == '^') {
+	    if (str[1] == '\0' || (str + 1) == trimmed) {
+		bufptr = save_string(bufptr, "\\136");
+		++str;
+	    } else {
+		bufptr = save_char(bufptr, *str++);
+		bufptr = save_char(bufptr, *str);
+	    }
+	} else if (str[0] == '\\') {
+	    if (str[1] == '\0' || (str + 1) == trimmed) {
+		bufptr = save_string(bufptr, "\\134");
+		++str;
+	    } else if (str[1] == '^') {
+		bufptr = save_string(bufptr, "\\136");
+		++str;
+	    } else if (str[1] == ',') {
+		bufptr = save_char(bufptr, *++str);
+	    } else {
+		bufptr = save_char(bufptr, *str++);
+		bufptr = save_char(bufptr, *str);
+	    }
 	} else if (str[0] == '$' && str[1] == '<') {	/* discard padding */
 	    str += 2;
 	    while (isdigit(UChar(*str))
@@ -677,6 +697,19 @@
 		   || *str == '>')
 		str++;
 	    --str;
+	} else if (sscanf(str,
+			  "[%%?%%p1%%{8}%%<%%t%d%%p1%%d%%e%%p1%%{16}%%<%%t%d%%p1%%{8}%%-%%d%%e%d;5;%%p1%%d%%;m",
+			  &in0, &in1, &in2) == 3
+		   && ((in0 == 4 && in1 == 10 && in2 == 48)
+		       || (in0 == 3 && in1 == 9 && in2 == 38))) {
+	    /* dumb-down an optimized case from xterm-256color for termcap */
+	    str = strstr(str, ";m");
+	    ++str;
+	    if (in2 == 48) {
+		bufptr = save_string(bufptr, "[48;5;%dm");
+	    } else {
+		bufptr = save_string(bufptr, "[38;5;%dm");
+	    }
 	} else if (str[0] == '%' && str[1] == '%') {	/* escaped '%' */
 	    bufptr = save_string(bufptr, "%%");
 	    ++str;
diff -Naur ncurses-5.7.orig/ncurses/tinfo/comp_expand.c ncurses-5.7/ncurses/tinfo/comp_expand.c
--- ncurses-5.7.orig/ncurses/tinfo/comp_expand.c	2008-08-16 15:29:42.000000000 -0400
+++ ncurses-5.7/ncurses/tinfo/comp_expand.c	2011-01-08 18:13:50.711157251 -0500
@@ -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            *
@@ -35,7 +35,7 @@
 #include <ctype.h>
 #include <tic.h>
 
-MODULE_ID("$Id: comp_expand.c,v 1.20 2008/08/16 19:29:42 tom Exp $")
+MODULE_ID("$Id: comp_expand.c,v 1.21 2010/01/16 17:11:23 tom Exp $")
 
 static int
 trailing_spaces(const char *src)
@@ -91,7 +91,7 @@
 		    && REALPRINT(str + 1)
 		    && str[2] == S_QUOTE) {
 		    sprintf(buffer + bufp, "{%d}", str[1]);
-		    bufp += strlen(buffer + bufp);
+		    bufp += (int) strlen(buffer + bufp);
 		    str += 2;
 		} else {
 		    buffer[bufp++] = *str;
diff -Naur ncurses-5.7.orig/ncurses/tinfo/comp_hash.c ncurses-5.7/ncurses/tinfo/comp_hash.c
--- ncurses-5.7.orig/ncurses/tinfo/comp_hash.c	2008-08-16 13:06:53.000000000 -0400
+++ ncurses-5.7/ncurses/tinfo/comp_hash.c	2011-01-08 18:13:50.711157251 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -44,110 +44,36 @@
 #include <tic.h>
 #include <hashsize.h>
 
-#ifdef MAIN_PROGRAM
-#include <ctype.h>
-#undef  DEBUG
-#define DEBUG(level, params)	/*nothing */
-#endif
-
-MODULE_ID("$Id: comp_hash.c,v 1.36 2008/08/16 17:06:53 tom Exp $")
-
-static int hash_function(const char *);
-
-/*
- *	_nc_make_hash_table()
- *
- *	Takes the entries in table[] and hashes them into hash_table[]
- *	by name.  There are CAPTABSIZE entries in table[] and HASHTABSIZE
- *	slots in hash_table[].
- *
- */
-
-#ifdef MAIN_PROGRAM
-
-#undef MODULE_ID
-#define MODULE_ID(id)		/*nothing */
-#include <tinfo/doalloc.c>
-
-static void
-_nc_make_hash_table(struct name_table_entry *table,
-		    short *hash_table)
-{
-    short i;
-    int hashvalue;
-    int collisions = 0;
-
-    for (i = 0; i < HASHTABSIZE; i++) {
-	hash_table[i] = -1;
-    }
-    for (i = 0; i < CAPTABSIZE; i++) {
-	hashvalue = hash_function(table[i].nte_name);
-
-	if (hash_table[hashvalue] >= 0)
-	    collisions++;
-
-	if (hash_table[hashvalue] != 0)
-	    table[i].nte_link = hash_table[hashvalue];
-	hash_table[hashvalue] = i;
-    }
-
-    DEBUG(4, ("Hash table complete: %d collisions out of %d entries",
-	      collisions, CAPTABSIZE));
-}
-#endif
+MODULE_ID("$Id: comp_hash.c,v 1.48 2009/08/08 17:36:21 tom Exp $")
 
 /*
- *	int hash_function(string)
- *
- *	Computes the hashing function on the given string.
- *
- *	The current hash function is the sum of each consectutive pair
- *	of characters, taken as two-byte integers, mod HASHTABSIZE.
- *
+ * Finds the entry for the given string in the hash table if present.
+ * Returns a pointer to the entry in the table or 0 if not found.
  */
-
-static int
-hash_function(const char *string)
-{
-    long sum = 0;
-
-    DEBUG(9, ("hashing %s", string));
-    while (*string) {
-	sum += (long) (*string + (*(string + 1) << 8));
-	string++;
-    }
-
-    DEBUG(9, ("sum is %ld", sum));
-    return (int) (sum % HASHTABSIZE);
-}
-
-/*
- *	struct name_table_entry *
- *	find_entry(string)
- *
- *	Finds the entry for the given string in the hash table if present.
- *	Returns a pointer to the entry in the table or 0 if not found.
- *
- */
-
-#ifndef MAIN_PROGRAM
+/* entrypoint used by tack (do not alter) */
 NCURSES_EXPORT(struct name_table_entry const *)
 _nc_find_entry(const char *string,
-	       const short *hash_table)
+	       const HashValue * hash_table)
 {
+    bool termcap = (hash_table != _nc_get_hash_table(FALSE));
+    const HashData *data = _nc_get_hash_info(termcap);
     int hashvalue;
     struct name_table_entry const *ptr = 0;
     struct name_table_entry const *real_table;
 
-    hashvalue = hash_function(string);
+    hashvalue = data->hash_of(string);
+
+    if (data->table_data[hashvalue] >= 0) {
 
-    if (hash_table[hashvalue] >= 0) {
-	real_table = _nc_get_table(hash_table != _nc_get_hash_table(FALSE));
-	ptr = real_table + hash_table[hashvalue];
-	while (strcmp(ptr->nte_name, string) != 0) {
-	    if (ptr->nte_link < 0)
-		return 0;
-	    ptr = real_table + (ptr->nte_link + hash_table[HASHTABSIZE]);
+	real_table = _nc_get_table(termcap);
+	ptr = real_table + data->table_data[hashvalue];
+	while (!data->compare_names(ptr->nte_name, string)) {
+	    if (ptr->nte_link < 0) {
+		ptr = 0;
+		break;
+	    }
+	    ptr = real_table + (ptr->nte_link
+				+ data->table_data[data->table_size]);
 	}
     }
 
@@ -155,216 +81,34 @@
 }
 
 /*
- *	struct name_table_entry *
- *	find_type_entry(string, type, table)
+ * Finds the entry for the given name with the given type in the given table if
+ * present (as distinct from _nc_find_entry, which finds the last entry
+ * regardless of type).
  *
- *	Finds the first entry for the given name with the given type in the
- *	given table if present (as distinct from find_entry, which finds the
- *	the last entry regardless of type).  You can use this if you detect
- *	a name clash.  It's slower, though.  Returns a pointer to the entry
- *	in the table or 0 if not found.
+ * Returns a pointer to the entry in the table or 0 if not found.
  */
-
 NCURSES_EXPORT(struct name_table_entry const *)
 _nc_find_type_entry(const char *string,
 		    int type,
-		    const struct name_table_entry *table)
+		    bool termcap)
 {
-    struct name_table_entry const *ptr;
-
-    for (ptr = table; ptr < table + CAPTABSIZE; ptr++) {
-	if (ptr->nte_type == type && strcmp(string, ptr->nte_name) == 0)
-	    return (ptr);
-    }
-
-    return ((struct name_table_entry *) NULL);
-}
-#endif
-
-#ifdef MAIN_PROGRAM
-/*
- * This filter reads from standard input a list of tab-delimited columns,
- * (e.g., from Caps.filtered) computes the hash-value of a specified column and
- * writes the hashed tables to standard output.
- *
- * By compiling the hash table at build time, we're able to make the entire
- * set of terminfo and termcap tables readonly (and also provide some runtime
- * performance enhancement).
- */
-
-#define MAX_COLUMNS BUFSIZ	/* this _has_ to be worst-case */
-
-static char **
-parse_columns(char *buffer)
-{
-    static char **list;
-
-    int col = 0;
-
-    if (list == 0 && (list = typeCalloc(char *, MAX_COLUMNS)) == 0)
-	  return (0);
-
-    if (*buffer != '#') {
-	while (*buffer != '\0') {
-	    char *s;
-	    for (s = buffer; (*s != '\0') && !isspace(UChar(*s)); s++)
-		/*EMPTY */ ;
-	    if (s != buffer) {
-		char mark = *s;
-		*s = '\0';
-		if ((s - buffer) > 1
-		    && (*buffer == '"')
-		    && (s[-1] == '"')) {	/* strip the quotes */
-		    assert(s > buffer + 1);
-		    s[-1] = '\0';
-		    buffer++;
-		}
-		list[col] = buffer;
-		col++;
-		if (mark == '\0')
-		    break;
-		while (*++s && isspace(UChar(*s)))
-		    /*EMPTY */ ;
-		buffer = s;
-	    } else
+    struct name_table_entry const *ptr = NULL;
+    const HashData *data = _nc_get_hash_info(termcap);
+    int hashvalue = data->hash_of(string);
+
+    if (data->table_data[hashvalue] >= 0) {
+	const struct name_table_entry *const table = _nc_get_table(termcap);
+
+	ptr = table + data->table_data[hashvalue];
+	while (ptr->nte_type != type
+	       || !data->compare_names(ptr->nte_name, string)) {
+	    if (ptr->nte_link < 0) {
+		ptr = 0;
 		break;
-	}
-    }
-    return col ? list : 0;
-}
-
-int
-main(int argc, char **argv)
-{
-    struct name_table_entry *name_table = typeCalloc(struct
-						     name_table_entry, CAPTABSIZE);
-    short *hash_table = typeCalloc(short, HASHTABSIZE);
-    const char *root_name = "";
-    int column = 0;
-    int bigstring = 0;
-    int n;
-    char buffer[BUFSIZ];
-
-    static const char *typenames[] =
-    {"BOOLEAN", "NUMBER", "STRING"};
-
-    short BoolCount = 0;
-    short NumCount = 0;
-    short StrCount = 0;
-
-    /* The first argument is the column-number (starting with 0).
-     * The second is the root name of the tables to generate.
-     */
-    if (argc <= 3
-	|| (column = atoi(argv[1])) <= 0
-	|| (column >= MAX_COLUMNS)
-	|| *(root_name = argv[2]) == 0
-	|| (bigstring = atoi(argv[3])) < 0
-	|| name_table == 0
-	|| hash_table == 0) {
-	fprintf(stderr, "usage: make_hash column root_name bigstring\n");
-	exit(EXIT_FAILURE);
-    }
-
-    /*
-     * Read the table into our arrays.
-     */
-    for (n = 0; (n < CAPTABSIZE) && fgets(buffer, BUFSIZ, stdin);) {
-	char **list, *nlp = strchr(buffer, '\n');
-	if (nlp)
-	    *nlp = '\0';
-	list = parse_columns(buffer);
-	if (list == 0)		/* blank or comment */
-	    continue;
-	name_table[n].nte_link = -1;	/* end-of-hash */
-	name_table[n].nte_name = strdup(list[column]);
-	if (!strcmp(list[2], "bool")) {
-	    name_table[n].nte_type = BOOLEAN;
-	    name_table[n].nte_index = BoolCount++;
-	} else if (!strcmp(list[2], "num")) {
-	    name_table[n].nte_type = NUMBER;
-	    name_table[n].nte_index = NumCount++;
-	} else if (!strcmp(list[2], "str")) {
-	    name_table[n].nte_type = STRING;
-	    name_table[n].nte_index = StrCount++;
-	} else {
-	    fprintf(stderr, "Unknown type: %s\n", list[2]);
-	    exit(EXIT_FAILURE);
-	}
-	n++;
-    }
-    _nc_make_hash_table(name_table, hash_table);
-
-    /*
-     * Write the compiled tables to standard output
-     */
-    if (bigstring) {
-	int len = 0;
-	int nxt;
-
-	printf("static const char %s_names_text[] = \\\n", root_name);
-	for (n = 0; n < CAPTABSIZE; n++) {
-	    nxt = (int) strlen(name_table[n].nte_name) + 5;
-	    if (nxt + len > 72) {
-		printf("\\\n");
-		len = 0;
 	    }
-	    printf("\"%s\\0\" ", name_table[n].nte_name);
-	    len += nxt;
-	}
-	printf(";\n\n");
-
-	len = 0;
-	printf("static name_table_data const %s_names_data[] =\n",
-	       root_name);
-	printf("{\n");
-	for (n = 0; n < CAPTABSIZE; n++) {
-	    printf("\t{ %15d,\t%10s,\t%3d, %3d }%c\n",
-		   len,
-		   typenames[name_table[n].nte_type],
-		   name_table[n].nte_index,
-		   name_table[n].nte_link,
-		   n < CAPTABSIZE - 1 ? ',' : ' ');
-	    len += (int) strlen(name_table[n].nte_name) + 1;
+	    ptr = table + (ptr->nte_link + data->table_data[data->table_size]);
 	}
-	printf("};\n\n");
-	printf("static struct name_table_entry *_nc_%s_table = 0;\n\n", root_name);
-    } else {
-
-	printf("static struct name_table_entry %s _nc_%s_table[] =\n",
-	       bigstring ? "" : "const",
-	       root_name);
-	printf("{\n");
-	for (n = 0; n < CAPTABSIZE; n++) {
-	    sprintf(buffer, "\"%s\"",
-		    name_table[n].nte_name);
-	    printf("\t{ %15s,\t%10s,\t%3d, %3d }%c\n",
-		   buffer,
-		   typenames[name_table[n].nte_type],
-		   name_table[n].nte_index,
-		   name_table[n].nte_link,
-		   n < CAPTABSIZE - 1 ? ',' : ' ');
-	}
-	printf("};\n\n");
-    }
-
-    printf("static const short _nc_%s_hash_table[%d] =\n",
-	   root_name,
-	   HASHTABSIZE + 1);
-    printf("{\n");
-    for (n = 0; n < HASHTABSIZE; n++) {
-	printf("\t%3d,\n", hash_table[n]);
     }
-    printf("\t0\t/* base-of-table */\n");
-    printf("};\n\n");
-
-    printf("#if (BOOLCOUNT!=%d)||(NUMCOUNT!=%d)||(STRCOUNT!=%d)\n",
-	   BoolCount, NumCount, StrCount);
-    printf("#error\t--> term.h and comp_captab.c disagree about the <--\n");
-    printf("#error\t--> numbers of booleans, numbers and/or strings <--\n");
-    printf("#endif\n\n");
 
-    free(hash_table);
-    return EXIT_SUCCESS;
+    return ptr;
 }
-#endif
diff -Naur ncurses-5.7.orig/ncurses/tinfo/comp_parse.c ncurses-5.7/ncurses/tinfo/comp_parse.c
--- ncurses-5.7.orig/ncurses/tinfo/comp_parse.c	2008-08-16 17:58:16.000000000 -0400
+++ ncurses-5.7/ncurses/tinfo/comp_parse.c	2011-01-08 18:18:29.750780851 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2007,2008 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            *
@@ -51,9 +51,8 @@
 #include <ctype.h>
 
 #include <tic.h>
-#include <term_entry.h>
 
-MODULE_ID("$Id: comp_parse.c,v 1.69 2008/08/16 21:58:16 tom Exp $")
+MODULE_ID("$Id: comp_parse.c,v 1.73 2010/12/25 23:06:37 tom Exp $")
 
 static void sanity_check2(TERMTYPE *, bool);
 NCURSES_IMPEXP void NCURSES_API(*_nc_check_termtype2) (TERMTYPE *, bool) = sanity_check2;
@@ -92,16 +91,18 @@
     }
     return src;
 }
+#define ForceBar(dst, src) ((strchr(src, '|') == 0) ? force_bar(dst, src) : src)
 
 NCURSES_EXPORT(bool)
 _nc_entry_match(char *n1, char *n2)
 /* do any of the aliases in a pair of terminal names match? */
 {
     char *pstart, *qstart, *pend, *qend;
-    char nc1[MAX_NAME_SIZE + 2], nc2[MAX_NAME_SIZE + 2];
+    char nc1[MAX_NAME_SIZE + 2];
+    char nc2[MAX_NAME_SIZE + 2];
 
-    n1 = force_bar(nc1, n1);
-    n2 = force_bar(nc2, n2);
+    n1 = ForceBar(nc1, n1);
+    n2 = ForceBar(nc2, n2);
 
     for (pstart = n1; (pend = strchr(pstart, '|')); pstart = pend + 1)
 	for (qstart = n2; (qend = strchr(qstart, '|')); qstart = qend + 1)
@@ -273,7 +274,7 @@
 		unresolved++;
 		total_unresolved++;
 
-		_nc_curr_line = lookline;
+		_nc_curr_line = (int) lookline;
 		_nc_warning("resolution of use=%s failed", lookfor);
 		qp->uses[i].link = 0;
 	    }
@@ -375,7 +376,7 @@
 	if (_nc_check_termtype != 0) {
 	    _nc_curr_col = -1;
 	    for_entry_list(qp) {
-		_nc_curr_line = qp->startline;
+		_nc_curr_line = (int) qp->startline;
 		_nc_set_type(_nc_first_name(qp->tterm.term_names));
 		_nc_check_termtype2(&qp->tterm, literal);
 	    }
@@ -473,7 +474,6 @@
 {
     _nc_alloc_entry_leaks();
     _nc_captoinfo_leaks();
-    _nc_comp_captab_leaks();
     _nc_comp_scan_leaks();
 #if BROKEN_LINKER || USE_REENTRANT
     _nc_names_leaks();
diff -Naur ncurses-5.7.orig/ncurses/tinfo/comp_scan.c ncurses-5.7/ncurses/tinfo/comp_scan.c
--- ncurses-5.7.orig/ncurses/tinfo/comp_scan.c	2008-08-16 15:22:55.000000000 -0400
+++ ncurses-5.7/ncurses/tinfo/comp_scan.c	2011-01-08 18:18:29.750780851 -0500
@@ -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            *
@@ -48,10 +48,9 @@
 #include <curses.priv.h>
 
 #include <ctype.h>
-#include <term_entry.h>
 #include <tic.h>
 
-MODULE_ID("$Id: comp_scan.c,v 1.83 2008/08/16 19:22:55 tom Exp $")
+MODULE_ID("$Id: comp_scan.c,v 1.89 2010/12/25 23:06:37 tom Exp $")
 
 /*
  * Maximum length of string capability we'll accept before raising an error.
@@ -61,19 +60,13 @@
 
 #define iswhite(ch)	(ch == ' '  ||  ch == '\t')
 
-NCURSES_EXPORT_VAR(int)
-_nc_syntax = 0;			/* termcap or terminfo? */
-NCURSES_EXPORT_VAR(long)
-_nc_curr_file_pos = 0;		/* file offset of current line */
-NCURSES_EXPORT_VAR(long)
-_nc_comment_start = 0;		/* start of comment range before name */
-NCURSES_EXPORT_VAR(long)
-_nc_comment_end = 0;		/* end of comment range before name */
-NCURSES_EXPORT_VAR(long)
-_nc_start_line = 0;		/* start line of current entry */
+NCURSES_EXPORT_VAR (int) _nc_syntax = 0;         /* termcap or terminfo? */
+NCURSES_EXPORT_VAR (long) _nc_curr_file_pos = 0; /* file offset of current line */
+NCURSES_EXPORT_VAR (long) _nc_comment_start = 0; /* start of comment range before name */
+NCURSES_EXPORT_VAR (long) _nc_comment_end = 0;   /* end of comment range before name */
+NCURSES_EXPORT_VAR (long) _nc_start_line = 0;    /* start line of current entry */
 
-NCURSES_EXPORT_VAR(struct token)
-_nc_curr_token =
+NCURSES_EXPORT_VAR (struct token) _nc_curr_token =
 {
     0, 0, 0
 };
@@ -91,8 +84,7 @@
 static char *pushname;
 
 #if NCURSES_EXT_FUNCS
-NCURSES_EXPORT_VAR(bool)
-_nc_disable_period = FALSE;	/* used by tic -a option */
+NCURSES_EXPORT_VAR (bool) _nc_disable_period = FALSE; /* used by tic -a option */
 #endif
 
 /*****************************************************************************
@@ -211,6 +203,10 @@
 		if (fgets(result + used, (int) (allocated - used), yyin) != 0) {
 		    bufstart = result;
 		    if (used == 0) {
+			if (_nc_curr_line == 0
+			    && IS_TIC_MAGIC(result)) {
+			    _nc_err_abort("This is a compiled terminal description, not a source");
+			}
 			_nc_curr_line++;
 			_nc_curr_col = 0;
 		    }
@@ -431,7 +427,7 @@
 	    && !strchr(terminfo_punct, (char) ch)) {
 	    if (!silent)
 		_nc_warning("Illegal character (expected alphanumeric or %s) - '%s'",
-			    terminfo_punct, unctrl((chtype) ch));
+			    terminfo_punct, unctrl(UChar(ch)));
 	    _nc_panic_mode(separator);
 	    goto start_token;
 	}
@@ -487,7 +483,6 @@
 		if (OkToAdd()) {
 		    AddCh(ch);
 		} else {
-		    ch = EOF;
 		    break;
 		}
 	    }
@@ -596,7 +591,7 @@
 	    case '@':
 		if ((ch = next_char()) != separator && !silent)
 		    _nc_warning("Missing separator after `%s', have %s",
-				tok_buf, unctrl((chtype) ch));
+				tok_buf, unctrl(UChar(ch)));
 		_nc_curr_token.tk_name = tok_buf;
 		type = CANCEL;
 		break;
@@ -617,7 +612,7 @@
 			_nc_warning("Missing separator");
 		}
 		_nc_curr_token.tk_name = tok_buf;
-		_nc_curr_token.tk_valnumber = number;
+		_nc_curr_token.tk_valnumber = (int) number;
 		type = NUMBER;
 		break;
 
@@ -637,7 +632,7 @@
 		/* just to get rid of the compiler warning */
 		type = UNDEF;
 		if (!silent)
-		    _nc_warning("Illegal character - '%s'", unctrl((chtype) ch));
+		    _nc_warning("Illegal character - '%s'", unctrl(UChar(ch)));
 	    }
 	}			/* end else (first_column == FALSE) */
     }				/* end else (ch != EOF) */
@@ -730,48 +725,47 @@
     int count = 0;
     int number = 0;
     int i, c;
-    chtype ch, last_ch = '\0';
+    int last_ch = '\0';
     bool ignored = FALSE;
     bool long_warning = FALSE;
 
-    while ((ch = c = next_char()) != (chtype) separator && c != EOF) {
+    while ((c = next_char()) != separator && c != EOF) {
 	if (ptr >= (last - 1)) {
 	    if (c != EOF) {
 		while ((c = next_char()) != separator && c != EOF) {
 		    ;
 		}
-		ch = c;
 	    }
 	    break;
 	}
 	if ((_nc_syntax == SYN_TERMCAP) && c == '\n')
 	    break;
-	if (ch == '^' && last_ch != '%') {
-	    ch = c = next_char();
+	if (c == '^' && last_ch != '%') {
+	    c = next_char();
 	    if (c == EOF)
 		_nc_err_abort(MSG_NO_INPUTS);
 
-	    if (!(is7bits(ch) && isprint(ch))) {
-		_nc_warning("Illegal ^ character - '%s'", unctrl(ch));
+	    if (!(is7bits(c) && isprint(c))) {
+		_nc_warning("Illegal ^ character - '%s'", unctrl(UChar(c)));
 	    }
-	    if (ch == '?') {
+	    if (c == '?') {
 		*(ptr++) = '\177';
 		if (_nc_tracing)
 		    _nc_warning("Allow ^? as synonym for \\177");
 	    } else {
-		if ((ch &= 037) == 0)
-		    ch = 128;
-		*(ptr++) = (char) (ch);
+		if ((c &= 037) == 0)
+		    c = 128;
+		*(ptr++) = (char) (c);
 	    }
-	} else if (ch == '\\') {
-	    ch = c = next_char();
+	} else if (c == '\\') {
+	    c = next_char();
 	    if (c == EOF)
 		_nc_err_abort(MSG_NO_INPUTS);
 
-	    if (ch >= '0' && ch <= '7') {
-		number = ch - '0';
+	    if (c >= '0' && c <= '7') {
+		number = c - '0';
 		for (i = 0; i < 2; i++) {
-		    ch = c = next_char();
+		    c = next_char();
 		    if (c == EOF)
 			_nc_err_abort(MSG_NO_INPUTS);
 
@@ -848,31 +842,31 @@
 
 		default:
 		    _nc_warning("Illegal character '%s' in \\ sequence",
-				unctrl(ch));
+				unctrl(UChar(c)));
 		    /* FALLTHRU */
 		case '|':
-		    *(ptr++) = (char) ch;
-		}		/* endswitch (ch) */
-	    }			/* endelse (ch < '0' ||  ch > '7') */
+		    *(ptr++) = (char) c;
+		}		/* endswitch (c) */
+	    }			/* endelse (c < '0' ||  c > '7') */
 	}
-	/* end else if (ch == '\\') */
-	else if (ch == '\n' && (_nc_syntax == SYN_TERMINFO)) {
+	/* end else if (c == '\\') */
+	else if (c == '\n' && (_nc_syntax == SYN_TERMINFO)) {
 	    /*
 	     * Newlines embedded in a terminfo string are ignored, provided
 	     * that the next line begins with whitespace.
 	     */
 	    ignored = TRUE;
 	} else {
-	    *(ptr++) = (char) ch;
+	    *(ptr++) = (char) c;
 	}
 
 	if (!ignored) {
 	    if (_nc_curr_col <= 1) {
-		push_back((char) ch);
-		ch = '\n';
+		push_back((char) c);
+		c = '\n';
 		break;
 	    }
-	    last_ch = ch;
+	    last_ch = c;
 	    count++;
 	}
 	ignored = FALSE;
@@ -885,7 +879,7 @@
 
     *ptr = '\0';
 
-    return (ch);
+    return (c);
 }
 
 /*
diff -Naur ncurses-5.7.orig/ncurses/tinfo/db_iterator.c ncurses-5.7/ncurses/tinfo/db_iterator.c
--- ncurses-5.7.orig/ncurses/tinfo/db_iterator.c	2007-04-21 20:00:26.000000000 -0400
+++ ncurses-5.7/ncurses/tinfo/db_iterator.c	2011-01-08 18:18:29.750780851 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2006,2007 Free Software Foundation, Inc.                   *
+ * Copyright (c) 2006-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            *
@@ -38,7 +38,7 @@
 
 #include <tic.h>
 
-MODULE_ID("$Id: db_iterator.c,v 1.6 2007/04/22 00:00:26 tom Exp $")
+MODULE_ID("$Id: db_iterator.c,v 1.9 2010/12/25 23:00:25 tom Exp $")
 
 #define HaveTicDirectory _nc_globals.have_tic_directory
 #define KeepTicDirectory _nc_globals.keep_tic_directory
@@ -104,7 +104,7 @@
     if (source != 0) {
 	FreeIfNeeded(ThisDbList);
 	ThisDbList = strdup(source);
-	ThisDbSize = strlen(source);
+	ThisDbSize = (int) strlen(source);
     }
 
     if (ThisDbList != 0 && ThisDbSize && *offset < ThisDbSize) {
@@ -118,11 +118,10 @@
 	 * again, using the data at the offset.
 	 */
 	if (marker == 0) {
-	    *offset += strlen(result) + 1;
-	    marker = result + *offset;
+	    *offset += (int) strlen(result);
 	} else {
 	    *marker++ = 0;
-	    *offset = marker - ThisDbList;
+	    *offset = (int) (marker - ThisDbList);
 	}
 	if (*result == 0 && result != (ThisDbList + ThisDbSize))
 	    result = system_db;
diff -Naur ncurses-5.7.orig/ncurses/tinfo/entries.c ncurses-5.7/ncurses/tinfo/entries.c
--- ncurses-5.7.orig/ncurses/tinfo/entries.c	2008-09-27 09:11:10.000000000 -0400
+++ ncurses-5.7/ncurses/tinfo/entries.c	2011-01-08 18:13:50.715157222 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2006-2007,2008 Free Software Foundation, Inc.              *
+ * Copyright (c) 2006-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,6 +28,7 @@
 
 /****************************************************************************
  *  Author: Thomas E. Dickey                                                *
+ *     and: Juergen Pfeifer                                                 *
  ****************************************************************************/
 
 #include <curses.priv.h>
@@ -35,9 +36,8 @@
 #include <ctype.h>
 
 #include <tic.h>
-#include <term_entry.h>
 
-MODULE_ID("$Id: entries.c,v 1.8 2008/09/27 13:11:10 tom Exp $")
+MODULE_ID("$Id: entries.c,v 1.17 2010/01/23 17:57:43 tom Exp $")
 
 /****************************************************************************
  *
@@ -119,6 +119,12 @@
 #if NO_LEAKS
     _nc_free_tparm();
     _nc_tgetent_leaks();
+
+    if (TerminalOf(CURRENT_SCREEN) != 0) {
+	del_curterm(TerminalOf(CURRENT_SCREEN));
+    }
+
+    _nc_comp_captab_leaks();
     _nc_free_entries(_nc_head);
     _nc_get_type(0);
     _nc_first_name(0);
@@ -131,6 +137,12 @@
 
     if ((s = _nc_home_terminfo()) != 0)
 	free(s);
+
+#ifdef TRACE
+    trace(0);
+    _nc_trace_buf(-1, 0);
+#endif
+
 #endif /* NO_LEAKS */
     returnVoid;
 }
diff -Naur ncurses-5.7.orig/ncurses/tinfo/free_ttype.c ncurses-5.7/ncurses/tinfo/free_ttype.c
--- ncurses-5.7.orig/ncurses/tinfo/free_ttype.c	2006-06-25 06:46:02.000000000 -0400
+++ ncurses-5.7/ncurses/tinfo/free_ttype.c	2011-01-08 18:13:50.715157222 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1999-2005,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            *
@@ -41,9 +41,8 @@
 #include <curses.priv.h>
 
 #include <tic.h>
-#include <term_entry.h>
 
-MODULE_ID("$Id: free_ttype.c,v 1.13 2006/06/25 10:46:02 tom Exp $")
+MODULE_ID("$Id: free_ttype.c,v 1.14 2010/01/23 17:57:43 tom Exp $")
 
 NCURSES_EXPORT(void)
 _nc_free_termtype(TERMTYPE *ptr)
diff -Naur ncurses-5.7.orig/ncurses/tinfo/hashed_db.c ncurses-5.7/ncurses/tinfo/hashed_db.c
--- ncurses-5.7.orig/ncurses/tinfo/hashed_db.c	2006-08-19 15:48:38.000000000 -0400
+++ ncurses-5.7/ncurses/tinfo/hashed_db.c	2011-01-08 18:13:50.715157222 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2006 Free Software Foundation, Inc.                        *
+ * Copyright (c) 2006,2008 Free Software Foundation, Inc.                   *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -27,7 +27,7 @@
  ****************************************************************************/
 
 /****************************************************************************
- *  Author: Thomas E. Dickey                        2006                    *
+ *  Author: Thomas E. Dickey                        2006-on                 *
  ****************************************************************************/
 
 #include <curses.priv.h>
@@ -36,7 +36,7 @@
 
 #if USE_HASHED_DB
 
-MODULE_ID("$Id: hashed_db.c,v 1.13 2006/08/19 19:48:38 tom Exp $")
+MODULE_ID("$Id: hashed_db.c,v 1.14 2008/12/13 20:59:02 tom Exp $")
 
 #if HASHED_DB_API >= 2
 static DBC *cursor;
@@ -49,27 +49,30 @@
 _nc_db_open(const char *path, bool modify)
 {
     DB *result = 0;
+    int code;
 
 #if HASHED_DB_API >= 4
     db_create(&result, NULL, 0);
-    result->open(result,
-		 NULL,
-		 path,
-		 NULL,
-		 DB_HASH,
-		 modify ? DB_CREATE : DB_RDONLY,
-		 0644);
+    if ((code = result->open(result,
+			     NULL,
+			     path,
+			     NULL,
+			     DB_HASH,
+			     modify ? DB_CREATE : DB_RDONLY,
+			     0644)) != 0) {
+	result = 0;
+    }
 #elif HASHED_DB_API >= 3
     db_create(&result, NULL, 0);
-    result->open(result,
-		 path,
-		 NULL,
-		 DB_HASH,
-		 modify ? DB_CREATE : DB_RDONLY,
-		 0644);
+    if ((code = result->open(result,
+			     path,
+			     NULL,
+			     DB_HASH,
+			     modify ? DB_CREATE : DB_RDONLY,
+			     0644)) != 0) {
+	result = 0;
+    }
 #elif HASHED_DB_API >= 2
-    int code;
-
     if ((code = db_open(path,
 			DB_HASH,
 			modify ? DB_CREATE : DB_RDONLY,
@@ -77,21 +80,22 @@
 			(DB_ENV *) 0,
 			(DB_INFO *) 0,
 			&result)) != 0) {
-	T(("cannot open %s: %s", path, strerror(code)));
 	result = 0;
-    } else {
-	T(("opened %s", path));
     }
 #else
-    result = dbopen(path,
-		    modify ? (O_CREAT | O_RDWR) : O_RDONLY,
-		    0644,
-		    DB_HASH,
-		    NULL);
+    if ((result = dbopen(path,
+			 modify ? (O_CREAT | O_RDWR) : O_RDONLY,
+			 0644,
+			 DB_HASH,
+			 NULL)) == 0) {
+	code = errno;
+    }
+#endif
     if (result != 0) {
 	T(("opened %s", path));
+    } else {
+	T(("cannot open %s: %s", path, strerror(code)));
     }
-#endif
     return result;
 }
 
diff -Naur ncurses-5.7.orig/ncurses/tinfo/home_terminfo.c ncurses-5.7/ncurses/tinfo/home_terminfo.c
--- ncurses-5.7.orig/ncurses/tinfo/home_terminfo.c	2008-08-03 19:43:11.000000000 -0400
+++ ncurses-5.7/ncurses/tinfo/home_terminfo.c	2011-01-08 18:18:29.750780851 -0500
@@ -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            *
@@ -37,7 +37,7 @@
 #include <curses.priv.h>
 #include <tic.h>
 
-MODULE_ID("$Id: home_terminfo.c,v 1.11 2008/08/03 23:43:11 tom Exp $")
+MODULE_ID("$Id: home_terminfo.c,v 1.12 2010/12/25 23:43:58 tom Exp $")
 
 /* ncurses extension...fall back on user's private directory */
 
@@ -53,7 +53,7 @@
     if (use_terminfo_vars()) {
 	if (MyBuffer == 0) {
 	    if ((home = getenv("HOME")) != 0) {
-		unsigned want = (strlen(home) + sizeof(PRIVATE_INFO));
+		size_t want = (strlen(home) + sizeof(PRIVATE_INFO));
 		MyBuffer = typeMalloc(char, want);
 		if (MyBuffer == 0)
 		    _nc_err_abort(MSG_NO_MEMORY);
diff -Naur ncurses-5.7.orig/ncurses/tinfo/init_keytry.c ncurses-5.7/ncurses/tinfo/init_keytry.c
--- ncurses-5.7.orig/ncurses/tinfo/init_keytry.c	2008-05-24 17:44:51.000000000 -0400
+++ ncurses-5.7/ncurses/tinfo/init_keytry.c	2011-01-08 18:13:50.715157222 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1999-2006,2008 Free Software Foundation, Inc.              *
+ * Copyright (c) 1999-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            *
@@ -27,16 +27,9 @@
  ****************************************************************************/
 
 #include <curses.priv.h>
-
-#include <term.h>
-/* keypad_xmit, keypad_local, meta_on, meta_off */
-/* cursor_visible,cursor_normal,cursor_invisible */
-
 #include <tic.h>		/* struct tinfo_fkeys */
 
-#include <term_entry.h>
-
-MODULE_ID("$Id: init_keytry.c,v 1.12 2008/05/24 21:44:51 tom Exp $")
+MODULE_ID("$Id: init_keytry.c,v 1.17 2010/04/24 22:29:56 tom Exp $")
 
 /*
 **      _nc_init_keytry()
@@ -50,7 +43,7 @@
  * than cur_term.
  */
 #undef CUR
-#define CUR (sp->_term)->type.
+#define CUR SP_TERMTYPE
 
 #if	BROKEN_LINKER
 #undef	_nc_tinfo_fkeys
@@ -73,7 +66,7 @@
 NCURSES_EXPORT(void)
 _nc_init_keytry(SCREEN *sp)
 {
-    size_t n;
+    unsigned n;
 
     /* The sp->_keytry value is initialized in newterm(), where the sp
      * structure is created, because we can not tell where keypad() or
@@ -97,12 +90,13 @@
 	{
 	    TERMTYPE *tp = &(sp->_term->type);
 	    for (n = STRCOUNT; n < NUM_STRINGS(tp); ++n) {
-		const char *name = ExtStrname(tp, n, strnames);
+		const char *name = ExtStrname(tp, (int) n, strnames);
 		char *value = tp->Strings[n];
 		if (name != 0
 		    && *name == 'k'
 		    && value != 0
-		    && key_defined(value) == 0) {
+		    && NCURSES_SP_NAME(key_defined) (NCURSES_SP_ARGx
+						     value) == 0) {
 		    (void) _nc_add_to_try(&(sp->_keytry),
 					  value,
 					  n - STRCOUNT + KEY_MAX);
diff -Naur ncurses-5.7.orig/ncurses/tinfo/lib_acs.c ncurses-5.7/ncurses/tinfo/lib_acs.c
--- ncurses-5.7.orig/ncurses/tinfo/lib_acs.c	2008-08-16 15:22:55.000000000 -0400
+++ ncurses-5.7/ncurses/tinfo/lib_acs.c	2011-01-08 18:18:29.750780851 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2007,2008 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            *
@@ -30,17 +30,21 @@
  *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995               *
  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
  *     and: Thomas E. Dickey                        1996-on                 *
+ *     and: Juergen Pfeifer                         2008                    *
  ****************************************************************************/
 
 #include <curses.priv.h>
-#include <term.h>		/* ena_acs, acs_chars */
 
-MODULE_ID("$Id: lib_acs.c,v 1.36 2008/08/16 19:22:55 tom Exp $")
+#ifndef CUR
+#define CUR SP_TERMTYPE
+#endif
+
+MODULE_ID("$Id: lib_acs.c,v 1.43 2010/12/25 23:00:45 tom Exp $")
 
 #if BROKEN_LINKER || USE_REENTRANT
 #define MyBuffer _nc_prescreen.real_acs_map
-NCURSES_EXPORT_VAR(chtype *)
-_nc_acs_map(void)
+NCURSES_EXPORT(chtype *)
+NCURSES_PUBLIC_VAR(acs_map) (void)
 {
     if (MyBuffer == 0)
 	MyBuffer = typeCalloc(chtype, ACS_LEN);
@@ -48,17 +52,35 @@
 }
 #undef MyBuffer
 #else
-NCURSES_EXPORT_VAR(chtype) acs_map[ACS_LEN] =
+NCURSES_EXPORT_VAR (chtype) acs_map[ACS_LEN] =
 {
     0
 };
 #endif
 
+#ifdef USE_TERM_DRIVER
+NCURSES_EXPORT(chtype)
+NCURSES_SP_NAME(_nc_acs_char) (NCURSES_SP_DCLx int c)
+{
+    chtype *map;
+    if (c < 0 || c >= ACS_LEN)
+	return (chtype) 0;
+    map = (SP_PARM != 0) ? SP_PARM->_acs_map :
+#if BROKEN_LINKER || USE_REENTRANT
+	_nc_prescreen.real_acs_map
+#else
+	acs_map
+#endif
+	;
+    return map[c];
+}
+#endif /* USE_TERM_DRIVER */
+
 NCURSES_EXPORT(void)
-_nc_init_acs(void)
+NCURSES_SP_NAME(_nc_init_acs) (NCURSES_SP_DCL0)
 {
     chtype *fake_map = acs_map;
-    chtype *real_map = SP != 0 ? SP->_acs_map : fake_map;
+    chtype *real_map = SP_PARM != 0 ? SP_PARM->_acs_map : fake_map;
     int j;
 
     T(("initializing ACS map"));
@@ -71,9 +93,9 @@
     if (real_map != fake_map) {
 	for (j = 1; j < ACS_LEN; ++j) {
 	    real_map[j] = 0;
-	    fake_map[j] = A_ALTCHARSET | j;
-	    if (SP)
-		SP->_screen_acs_map[j] = FALSE;
+	    fake_map[j] = A_ALTCHARSET | (chtype) j;
+	    if (SP_PARM)
+		SP_PARM->_screen_acs_map[j] = FALSE;
 	}
     } else {
 	for (j = 1; j < ACS_LEN; ++j) {
@@ -118,7 +140,34 @@
     real_map['{'] = '*';	/* should be greek pi */
     real_map['|'] = '!';	/* should be not-equal */
     real_map['}'] = 'f';	/* should be pound-sterling symbol */
+    /* thick-line-drawing */
+    real_map['L'] = '+';	/* upper left corner */
+    real_map['M'] = '+';	/* lower left corner */
+    real_map['K'] = '+';	/* upper right corner */
+    real_map['J'] = '+';	/* lower right corner */
+    real_map['T'] = '+';	/* tee pointing left */
+    real_map['U'] = '+';	/* tee pointing right */
+    real_map['V'] = '+';	/* tee pointing up */
+    real_map['W'] = '+';	/* tee pointing down */
+    real_map['Q'] = '-';	/* horizontal line */
+    real_map['X'] = '|';	/* vertical line */
+    real_map['N'] = '+';	/* large plus or crossover */
+    /* double-line-drawing */
+    real_map['C'] = '+';	/* upper left corner */
+    real_map['D'] = '+';	/* lower left corner */
+    real_map['B'] = '+';	/* upper right corner */
+    real_map['A'] = '+';	/* lower right corner */
+    real_map['G'] = '+';	/* tee pointing left */
+    real_map['F'] = '+';	/* tee pointing right */
+    real_map['H'] = '+';	/* tee pointing up */
+    real_map['I'] = '+';	/* tee pointing down */
+    real_map['R'] = '-';	/* horizontal line */
+    real_map['Y'] = '|';	/* vertical line */
+    real_map['E'] = '+';	/* large plus or crossover */
 
+#ifdef USE_TERM_DRIVER
+    CallDriver_2(SP_PARM, initacs, real_map, fake_map);
+#else
     if (ena_acs != NULL) {
 	TPUTS_TRACE("ena_acs");
 	putp(ena_acs);
@@ -140,7 +189,7 @@
 	size_t i;
 	for (i = 1; i < ACS_LEN; ++i) {
 	    if (real_map[i] == 0) {
-		real_map[i] = i;
+		real_map[i] = (chtype) i;
 		if (real_map != fake_map) {
 		    if (SP != 0)
 			SP->_screen_acs_map[i] = TRUE;
@@ -191,4 +240,13 @@
 	_nc_unlock_global(tracef);
     }
 #endif /* TRACE */
+#endif
+}
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(void)
+_nc_init_acs(void)
+{
+    NCURSES_SP_NAME(_nc_init_acs) (CURRENT_SCREEN);
 }
+#endif
diff -Naur ncurses-5.7.orig/ncurses/tinfo/lib_baudrate.c ncurses-5.7/ncurses/tinfo/lib_baudrate.c
--- ncurses-5.7.orig/ncurses/tinfo/lib_baudrate.c	2008-06-28 11:19:24.000000000 -0400
+++ ncurses-5.7/ncurses/tinfo/lib_baudrate.c	2011-01-08 18:18:29.750780851 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2007,2008 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            *
@@ -38,7 +38,6 @@
  */
 
 #include <curses.priv.h>
-#include <term.h>		/* cur_term, pad_char */
 #include <termcap.h>		/* ospeed */
 #if defined(__FreeBSD__)
 #include <sys/param.h>
@@ -80,7 +79,7 @@
 #undef USE_OLD_TTY
 #endif /* USE_OLD_TTY */
 
-MODULE_ID("$Id: lib_baudrate.c,v 1.27 2008/06/28 15:19:24 tom Exp $")
+MODULE_ID("$Id: lib_baudrate.c,v 1.31 2010/12/19 01:50:50 tom Exp $")
 
 /*
  *	int
@@ -195,11 +194,11 @@
 }
 
 NCURSES_EXPORT(int)
-baudrate(void)
+NCURSES_SP_NAME(baudrate) (NCURSES_SP_DCL0)
 {
     int result;
 
-    T((T_CALLED("baudrate()")));
+    T((T_CALLED("baudrate(%p)"), (void *) SP_PARM));
 
     /*
      * In debugging, allow the environment symbol to override when we're
@@ -207,32 +206,41 @@
      * that take into account costs that depend on baudrate.
      */
 #ifdef TRACE
-    if (!isatty(fileno(SP ? SP->_ofp : stdout))
+    if (IsValidTIScreen(SP_PARM)
+	&& !isatty(fileno(SP_PARM ? SP_PARM->_ofp : stdout))
 	&& getenv("BAUDRATE") != 0) {
 	int ret;
 	if ((ret = _nc_getenv_num("BAUDRATE")) <= 0)
 	    ret = 9600;
-	ospeed = _nc_ospeed(ret);
+	ospeed = (NCURSES_OSPEED) _nc_ospeed(ret);
 	returnCode(ret);
     }
 #endif
 
-    if (cur_term != 0) {
+    if (IsValidTIScreen(SP_PARM)) {
 #ifdef USE_OLD_TTY
-	result = cfgetospeed(&cur_term->Nttyb);
+	result = cfgetospeed(&(TerminalOf(SP_PARM)->Nttyb));
 	ospeed = _nc_ospeed(result);
 #else /* !USE_OLD_TTY */
 #ifdef TERMIOS
-	ospeed = cfgetospeed(&cur_term->Nttyb);
+	ospeed = (NCURSES_OSPEED) cfgetospeed(&(TerminalOf(SP_PARM)->Nttyb));
 #else
-	ospeed = cur_term->Nttyb.sg_ospeed;
+	ospeed = (NCURSES_OSPEED) TerminalOf(SP_PARM)->Nttyb.sg_ospeed;
 #endif
 	result = _nc_baudrate(ospeed);
 #endif
-	cur_term->_baudrate = result;
+	TerminalOf(SP_PARM)->_baudrate = result;
     } else {
 	result = ERR;
     }
 
     returnCode(result);
 }
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+baudrate(void)
+{
+    return NCURSES_SP_NAME(baudrate) (CURRENT_SCREEN);
+}
+#endif
diff -Naur ncurses-5.7.orig/ncurses/tinfo/lib_cur_term.c ncurses-5.7/ncurses/tinfo/lib_cur_term.c
--- ncurses-5.7.orig/ncurses/tinfo/lib_cur_term.c	2008-08-16 15:22:55.000000000 -0400
+++ ncurses-5.7/ncurses/tinfo/lib_cur_term.c	2011-01-08 18:18:29.750780851 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,2008 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            *
@@ -37,69 +37,141 @@
  */
 
 #include <curses.priv.h>
-#include <term_entry.h>		/* TTY, cur_term */
 #include <termcap.h>		/* ospeed */
 
-MODULE_ID("$Id: lib_cur_term.c,v 1.18 2008/08/16 19:22:55 tom Exp $")
+MODULE_ID("$Id: lib_cur_term.c,v 1.30 2010/12/19 01:38:45 tom Exp $")
 
 #undef CUR
 #define CUR termp->type.
 
-#if BROKEN_LINKER || USE_REENTRANT
+#if BROKEN_LINKER && !USE_REENTRANT
+NCURSES_EXPORT_VAR(TERMINAL *) cur_term = 0;
+#elif BROKEN_LINKER || USE_REENTRANT
+
+NCURSES_EXPORT(TERMINAL *)
+NCURSES_SP_NAME(_nc_get_cur_term) (NCURSES_SP_DCL0)
+{
+    return ((0 != TerminalOf(SP_PARM)) ? TerminalOf(SP_PARM) : CurTerm);
+}
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(TERMINAL *)
+_nc_get_cur_term(void)
+{
+    return NCURSES_SP_NAME(_nc_get_cur_term) (CURRENT_SCREEN);
+}
+#endif
+
 NCURSES_EXPORT(TERMINAL *)
 NCURSES_PUBLIC_VAR(cur_term) (void)
 {
-    return (SP != 0 && SP->_term != 0) ? SP->_term : _nc_prescreen._cur_term;
+#if NCURSES_SP_FUNCS
+    return NCURSES_SP_NAME(_nc_get_cur_term) (CURRENT_SCREEN);
+#else
+    return NCURSES_SP_NAME(_nc_get_cur_term) (NCURSES_SP_ARG);
+#endif
 }
+
 #else
 NCURSES_EXPORT_VAR(TERMINAL *) cur_term = 0;
 #endif
 
 NCURSES_EXPORT(TERMINAL *)
-set_curterm(TERMINAL * termp)
+NCURSES_SP_NAME(set_curterm) (NCURSES_SP_DCLx TERMINAL * termp)
 {
     TERMINAL *oldterm;
 
-    T((T_CALLED("set_curterm(%p)"), termp));
+    T((T_CALLED("set_curterm(%p)"), (void *) termp));
 
     _nc_lock_global(curses);
     oldterm = cur_term;
-    if (SP)
-	SP->_term = termp;
-#if BROKEN_LINKER || USE_REENTRANT
-    _nc_prescreen._cur_term = termp;
-#else
+    if (SP_PARM)
+	SP_PARM->_term = termp;
+#if BROKEN_LINKER && !USE_REENTRANT
     cur_term = termp;
+#else
+    CurTerm = termp;
 #endif
     if (termp != 0) {
-	ospeed = _nc_ospeed(termp->_baudrate);
+#ifdef USE_TERM_DRIVER
+	TERMINAL_CONTROL_BLOCK *TCB = (TERMINAL_CONTROL_BLOCK *) termp;
+	ospeed = (NCURSES_OSPEED) _nc_ospeed(termp->_baudrate);
+	if (TCB->drv->isTerminfo && termp->type.Strings) {
+	    PC = (char) ((pad_char != NULL) ? pad_char[0] : 0);
+	}
+	TCB->csp = SP_PARM;
+#else
+	ospeed = (NCURSES_OSPEED) _nc_ospeed(termp->_baudrate);
 	if (termp->type.Strings) {
 	    PC = (char) ((pad_char != NULL) ? pad_char[0] : 0);
 	}
+#endif
     }
     _nc_unlock_global(curses);
 
-    T((T_RETURN("%p"), oldterm));
+    T((T_RETURN("%p"), (void *) oldterm));
     return (oldterm);
 }
 
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(TERMINAL *)
+set_curterm(TERMINAL * termp)
+{
+    return NCURSES_SP_NAME(set_curterm) (CURRENT_SCREEN, termp);
+}
+#endif
+
 NCURSES_EXPORT(int)
-del_curterm(TERMINAL * termp)
+NCURSES_SP_NAME(del_curterm) (NCURSES_SP_DCLx TERMINAL * termp)
 {
     int rc = ERR;
 
-    T((T_CALLED("del_curterm(%p)"), termp));
+    T((T_CALLED("del_curterm(%p, %p)"), (void *) SP_PARM, (void *) termp));
 
-    _nc_lock_global(curses);
     if (termp != 0) {
+#ifdef USE_TERM_DRIVER
+	TERMINAL_CONTROL_BLOCK *TCB = (TERMINAL_CONTROL_BLOCK *) termp;
+#endif
+	TERMINAL *cur = (
+#if BROKEN_LINKER && !USE_REENTRANT
+			    cur_term
+#elif BROKEN_LINKER || USE_REENTRANT
+			    NCURSES_SP_NAME(_nc_get_cur_term) (NCURSES_SP_ARG)
+#else
+			    cur_term
+#endif
+	);
+
 	_nc_free_termtype(&(termp->type));
+	if (termp == cur)
+	    NCURSES_SP_NAME(set_curterm) (NCURSES_SP_ARGx 0);
+
 	FreeIfNeeded(termp->_termname);
+#if USE_HOME_TERMINFO
+	if (_nc_globals.home_terminfo != 0)
+	    FreeAndNull(_nc_globals.home_terminfo);
+#endif
+#ifdef USE_TERM_DRIVER
+	if (TCB->drv)
+	    TCB->drv->release(TCB);
+#endif
 	free(termp);
-	if (termp == cur_term)
-	    set_curterm(0);
+
 	rc = OK;
     }
+    returnCode(rc);
+}
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+del_curterm(TERMINAL * termp)
+{
+    int rc = ERR;
+
+    _nc_lock_global(curses);
+    rc = NCURSES_SP_NAME(del_curterm) (CURRENT_SCREEN, termp);
     _nc_unlock_global(curses);
 
-    returnCode(rc);
+    return (rc);
 }
+#endif
diff -Naur ncurses-5.7.orig/ncurses/tinfo/lib_data.c ncurses-5.7/ncurses/tinfo/lib_data.c
--- ncurses-5.7.orig/ncurses/tinfo/lib_data.c	2008-08-23 18:16:15.000000000 -0400
+++ ncurses-5.7/ncurses/tinfo/lib_data.c	2011-01-08 18:13:50.719157124 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2007,2008 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            *
@@ -30,6 +30,7 @@
  *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995               *
  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
  *     and: Thomas E. Dickey                        1996-on                 *
+ *     and: Juergen Pfeifer                                                 *
  ****************************************************************************/
 
 /*
@@ -41,7 +42,7 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_data.c,v 1.52 2008/08/23 22:16:15 tom Exp $")
+MODULE_ID("$Id: lib_data.c,v 1.61 2010/05/15 22:06:56 tom Exp $")
 
 /*
  * OS/2's native linker complains if we don't initialize public data when
@@ -51,17 +52,17 @@
 NCURSES_EXPORT(WINDOW *)
 NCURSES_PUBLIC_VAR(stdscr) (void)
 {
-    return SP ? SP->_stdscr : 0;
+    return CURRENT_SCREEN ? StdScreen(CURRENT_SCREEN) : 0;
 }
 NCURSES_EXPORT(WINDOW *)
 NCURSES_PUBLIC_VAR(curscr) (void)
 {
-    return SP ? SP->_curscr : 0;
+    return CURRENT_SCREEN ? CurScreen(CURRENT_SCREEN) : 0;
 }
 NCURSES_EXPORT(WINDOW *)
 NCURSES_PUBLIC_VAR(newscr) (void)
 {
-    return SP ? SP->_newscr : 0;
+    return CURRENT_SCREEN ? NewScreen(CURRENT_SCREEN) : 0;
 }
 #else
 NCURSES_EXPORT_VAR(WINDOW *) stdscr = 0;
@@ -93,7 +94,7 @@
 NCURSES_EXPORT(int)
 _nc_alloc_screen(void)
 {
-    return ((my_screen = typeCalloc(SCREEN, 1)) != 0);
+    return ((my_screen = _nc_alloc_screen_sp()) != 0);
 }
 
 NCURSES_EXPORT(void)
@@ -103,6 +104,7 @@
 }
 
 #else
+
 NCURSES_EXPORT_VAR(SCREEN *) SP = NULL; /* Some linkers require initialized data... */
 #endif
 /* *INDENT-OFF* */
@@ -140,7 +142,9 @@
     0,				/* tgetent_index */
     0,				/* tgetent_sequence */
 
+#ifndef USE_SP_WINDOWLIST
     0,				/* _nc_windowlist */
+#endif
 
 #if USE_HOME_TERMINFO
     NULL,			/* home_terminfo */
@@ -151,6 +155,10 @@
     0,				/* safeprint_rows */
 #endif
 
+#ifdef USE_TERM_DRIVER
+    0,				/* term_driver */
+#endif
+
 #ifdef TRACE
     FALSE,			/* init_trace */
     CHARS_0s,			/* trace_fname */
@@ -174,7 +182,9 @@
     { CHARS_0s, CHARS_0s },	/* traceatr_color_buf */
     0,				/* traceatr_color_sel */
     -1,				/* traceatr_color_last */
-
+#if !defined(USE_PTHREADS) && USE_REENTRANT
+    0,				/* nested_tracef */
+#endif
 #endif /* TRACE */
 #ifdef USE_PTHREADS
     PTHREAD_MUTEX_INITIALIZER,	/* mutex_curses */
@@ -183,6 +193,9 @@
     0,				/* nested_tracef */
     0,				/* use_pthreads */
 #endif
+#if USE_PTHREADS_EINTR
+    0,				/* read_thread */
+#endif
 };
 
 #define STACK_FRAME_0	{ { 0 }, 0 }
@@ -196,8 +209,10 @@
     TRUE,			/* use_env */
     FALSE,			/* filter_mode */
     A_NORMAL,			/* previous_attr */
+#ifndef USE_SP_RIPOFF
     RIPOFF_0s,			/* ripoff */
     NULL,			/* rsp */
+#endif
     {				/* tparm_state */
 #ifdef TRACE
 	NULL,			/* tname */
@@ -221,10 +236,13 @@
 #if NCURSES_NO_PADDING
     FALSE,			/* flag to set if padding disabled  */
 #endif
+    0,				/* _outch */
 #if BROKEN_LINKER || USE_REENTRANT
     NULL,			/* real_acs_map */
     0,				/* LINES */
     0,				/* COLS */
+    8,				/* TABSIZE */
+    1000,			/* ESCDELAY */
     0,				/* cur_term */
 #ifdef TRACE
     0L,				/* _outchars */
@@ -234,6 +252,22 @@
 };
 /* *INDENT-ON* */
 
+/*
+ * wgetch() and other functions with a WINDOW* parameter may use a SCREEN*
+ * internally, and it is useful to allow those to be invoked without switching
+ * SCREEN's, e.g., for multi-threaded applications.
+ */
+NCURSES_EXPORT(SCREEN *)
+_nc_screen_of(WINDOW *win)
+{
+    SCREEN *sp = 0;
+
+    if (win != 0) {
+	sp = WINDOW_EXT(win, screen);
+    }
+    return (sp);
+}
+
 /******************************************************************************/
 #ifdef USE_PTHREADS
 static void
@@ -314,7 +348,9 @@
 	return 0;
     return pthread_mutex_unlock(obj);
 }
+#endif /* USE_PTHREADS */
 
+#if defined(USE_PTHREADS) || USE_PTHREADS_EINTR
 #if USE_WEAK_SYMBOLS
 /*
  * NB: sigprocmask(2) is global but pthread_sigmask(3p)
diff -Naur ncurses-5.7.orig/ncurses/tinfo/lib_has_cap.c ncurses-5.7/ncurses/tinfo/lib_has_cap.c
--- ncurses-5.7.orig/ncurses/tinfo/lib_has_cap.c	2003-10-25 15:43:55.000000000 -0400
+++ ncurses-5.7/ncurses/tinfo/lib_has_cap.c	2011-01-08 18:13:50.719157124 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2000,2003 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -30,6 +30,7 @@
  *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995               *
  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
  *     and: Thomas E. Dickey                        1996-2003               *
+ *     and: Juergen Pfeifer                         2009                    *
  ****************************************************************************/
 
 /*
@@ -41,25 +42,53 @@
 
 #include <curses.priv.h>
 
-#include <term.h>
+#ifndef CUR
+#define CUR SP_TERMTYPE
+#endif
 
-MODULE_ID("$Id: lib_has_cap.c,v 1.4 2003/10/25 19:43:55 tom Exp $")
+MODULE_ID("$Id: lib_has_cap.c,v 1.9 2009/10/24 22:15:47 tom Exp $")
 
 NCURSES_EXPORT(bool)
+NCURSES_SP_NAME(has_ic) (NCURSES_SP_DCL0)
+{
+    bool code = FALSE;
+
+    T((T_CALLED("has_ic(%p)"), (void *) SP_PARM));
+
+    if (IsValidTIScreen(SP_PARM) && IsTermInfo(SP_PARM)) {
+	code = ((insert_character || parm_ich
+		 || (enter_insert_mode && exit_insert_mode))
+		&& (delete_character || parm_dch)) ? TRUE : FALSE;
+    }
+
+    returnCode(code);
+}
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(bool)
 has_ic(void)
 {
-    T((T_CALLED("has_ic()")));
-    returnCode(cur_term &&
-	       (insert_character || parm_ich
-		|| (enter_insert_mode && exit_insert_mode))
-	       && (delete_character || parm_dch));
+    return NCURSES_SP_NAME(has_ic) (CURRENT_SCREEN);
+}
+#endif
+
+NCURSES_EXPORT(bool)
+NCURSES_SP_NAME(has_il) (NCURSES_SP_DCL0)
+{
+    bool code = FALSE;
+    T((T_CALLED("has_il(%p)"), (void *) SP_PARM));
+    if (IsValidTIScreen(SP_PARM) && IsTermInfo(SP_PARM)) {
+	code = ((insert_line || parm_insert_line)
+		&& (delete_line || parm_delete_line)) ? TRUE : FALSE;
+    }
+
+    returnCode(code);
 }
 
+#if NCURSES_SP_FUNCS
 NCURSES_EXPORT(bool)
 has_il(void)
 {
-    T((T_CALLED("has_il()")));
-    returnCode(cur_term
-	       && (insert_line || parm_insert_line)
-	       && (delete_line || parm_delete_line));
+    return NCURSES_SP_NAME(has_il) (CURRENT_SCREEN);
 }
+#endif
diff -Naur ncurses-5.7.orig/ncurses/tinfo/lib_kernel.c ncurses-5.7/ncurses/tinfo/lib_kernel.c
--- ncurses-5.7.orig/ncurses/tinfo/lib_kernel.c	2004-05-08 13:11:21.000000000 -0400
+++ ncurses-5.7/ncurses/tinfo/lib_kernel.c	2011-01-08 18:18:29.750780851 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,2004 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            *
@@ -29,7 +29,8 @@
 /****************************************************************************
  *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995               *
  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
- *     and: Thomas E. Dickey 2002                                           *
+ *     and: Thomas E. Dickey                        2002                    *
+ *     and: Juergen Pfeifer                         2009                    *
  ****************************************************************************/
 
 /*
@@ -46,9 +47,8 @@
  */
 
 #include <curses.priv.h>
-#include <term.h>		/* cur_term */
 
-MODULE_ID("$Id: lib_kernel.c,v 1.24 2004/05/08 17:11:21 tom Exp $")
+MODULE_ID("$Id: lib_kernel.c,v 1.31 2010/12/19 01:21:19 tom Exp $")
 
 static int
 _nc_vdisable(void)
@@ -59,7 +59,7 @@
 #endif
 #if defined(_PC_VDISABLE)
     if (value == -1) {
-	value = fpathconf(0, _PC_VDISABLE);
+	value = (int) fpathconf(0, _PC_VDISABLE);
 	if (value == -1) {
 	    value = 0377;
 	}
@@ -79,22 +79,32 @@
  */
 
 NCURSES_EXPORT(char)
-erasechar(void)
+NCURSES_SP_NAME(erasechar) (NCURSES_SP_DCL0)
 {
     int result = ERR;
-    T((T_CALLED("erasechar()")));
+    TERMINAL *termp = TerminalOf(SP_PARM);
+
+    T((T_CALLED("erasechar(%p)"), (void *) SP_PARM));
 
-    if (cur_term != 0) {
+    if (termp != 0) {
 #ifdef TERMIOS
-	result = cur_term->Ottyb.c_cc[VERASE];
+	result = termp->Ottyb.c_cc[VERASE];
 	if (result == _nc_vdisable())
 	    result = ERR;
 #else
-	result = cur_term->Ottyb.sg_erase;
+	result = termp->Ottyb.sg_erase;
 #endif
     }
-    returnCode(result);
+    returnChar((char) result);
+}
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(char)
+erasechar(void)
+{
+    return NCURSES_SP_NAME(erasechar) (CURRENT_SCREEN);
 }
+#endif
 
 /*
  *	killchar()
@@ -104,22 +114,32 @@
  */
 
 NCURSES_EXPORT(char)
-killchar(void)
+NCURSES_SP_NAME(killchar) (NCURSES_SP_DCL0)
 {
     int result = ERR;
-    T((T_CALLED("killchar()")));
+    TERMINAL *termp = TerminalOf(SP_PARM);
 
-    if (cur_term != 0) {
+    T((T_CALLED("killchar(%p)"), (void *) SP_PARM));
+
+    if (termp != 0) {
 #ifdef TERMIOS
-	result = cur_term->Ottyb.c_cc[VKILL];
+	result = termp->Ottyb.c_cc[VKILL];
 	if (result == _nc_vdisable())
 	    result = ERR;
 #else
-	result = cur_term->Ottyb.sg_kill;
+	result = termp->Ottyb.sg_kill;
 #endif
     }
-    returnCode(result);
+    returnChar((char) result);
+}
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(char)
+killchar(void)
+{
+    return NCURSES_SP_NAME(killchar) (CURRENT_SCREEN);
 }
+#endif
 
 /*
  *	flushinp()
@@ -129,26 +149,36 @@
  */
 
 NCURSES_EXPORT(int)
-flushinp(void)
+NCURSES_SP_NAME(flushinp) (NCURSES_SP_DCL0)
 {
-    T((T_CALLED("flushinp()")));
+    TERMINAL *termp = TerminalOf(SP_PARM);
+
+    T((T_CALLED("flushinp(%p)"), (void *) SP_PARM));
 
-    if (cur_term != 0) {
+    if (termp != 0) {
 #ifdef TERMIOS
-	tcflush(cur_term->Filedes, TCIFLUSH);
+	tcflush(termp->Filedes, TCIFLUSH);
 #else
 	errno = 0;
 	do {
-	    ioctl(cur_term->Filedes, TIOCFLUSH, 0);
+	    ioctl(termp->Filedes, TIOCFLUSH, 0);
 	} while
 	    (errno == EINTR);
 #endif
-	if (SP) {
-	    SP->_fifohead = -1;
-	    SP->_fifotail = 0;
-	    SP->_fifopeek = 0;
+	if (SP_PARM) {
+	    SP_PARM->_fifohead = -1;
+	    SP_PARM->_fifotail = 0;
+	    SP_PARM->_fifopeek = 0;
 	}
 	returnCode(OK);
     }
     returnCode(ERR);
 }
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+flushinp(void)
+{
+    return NCURSES_SP_NAME(flushinp) (CURRENT_SCREEN);
+}
+#endif
diff -Naur ncurses-5.7.orig/ncurses/tinfo/lib_longname.c ncurses-5.7/ncurses/tinfo/lib_longname.c
--- ncurses-5.7.orig/ncurses/tinfo/lib_longname.c	2000-12-09 21:55:07.000000000 -0500
+++ ncurses-5.7/ncurses/tinfo/lib_longname.c	2011-01-08 18:18:29.750780851 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998,2000 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            *
@@ -29,6 +29,8 @@
 /****************************************************************************
  *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995               *
  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
+ *     and: Thomas E. Dickey                        1996-on                 *
+ *     and: Juergen Pfeifer                         2009                    *
  ****************************************************************************/
 
 /*
@@ -40,8 +42,38 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_longname.c,v 1.9 2000/12/10 02:55:07 tom Exp $")
+MODULE_ID("$Id: lib_longname.c,v 1.12 2010/12/20 00:31:26 tom Exp $")
 
+#if USE_REENTRANT
+NCURSES_EXPORT(char *)
+NCURSES_SP_NAME(longname) (NCURSES_SP_DCL0)
+{
+    static char empty[] =
+    {'\0'};
+    char *ptr;
+
+    T((T_CALLED("longname(%p)"), (void *) SP_PARM));
+
+    if (SP_PARM) {
+	for (ptr = SP_PARM->_ttytype + strlen(SP_PARM->_ttytype);
+	     ptr > SP_PARM->_ttytype;
+	     ptr--)
+	    if (*ptr == '|')
+		returnPtr(ptr + 1);
+	returnPtr(SP_PARM->_ttytype);
+    }
+    return empty;
+}
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(char *)
+longname(void)
+{
+    return NCURSES_SP_NAME(longname) (CURRENT_SCREEN);
+}
+#endif
+
+#else
 NCURSES_EXPORT(char *)
 longname(void)
 {
@@ -49,9 +81,11 @@
 
     T((T_CALLED("longname()")));
 
-    for (ptr = ttytype + strlen(ttytype); ptr > ttytype; ptr--)
+    for (ptr = ttytype + strlen(ttytype);
+	 ptr > ttytype;
+	 ptr--)
 	if (*ptr == '|')
 	    returnPtr(ptr + 1);
-
     returnPtr(ttytype);
 }
+#endif
diff -Naur ncurses-5.7.orig/ncurses/tinfo/lib_napms.c ncurses-5.7/ncurses/tinfo/lib_napms.c
--- ncurses-5.7.orig/ncurses/tinfo/lib_napms.c	2008-05-03 17:34:13.000000000 -0400
+++ ncurses-5.7/ncurses/tinfo/lib_napms.c	2011-01-08 18:13:50.719157124 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2005,2008 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -29,6 +29,8 @@
 /****************************************************************************
  *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995               *
  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
+ *     and: Thomas E. Dickey                        1996-on                 *
+ *     and: Juergen Pfeifer                         2009                    *
  ****************************************************************************/
 
 /*
@@ -49,13 +51,17 @@
 #endif
 #endif
 
-MODULE_ID("$Id: lib_napms.c,v 1.17 2008/05/03 21:34:13 tom Exp $")
+MODULE_ID("$Id: lib_napms.c,v 1.20 2009/11/07 20:37:30 tom Exp $")
 
 NCURSES_EXPORT(int)
-napms(int ms)
+NCURSES_SP_NAME(napms) (NCURSES_SP_DCLx int ms)
 {
+    (void) SP_PARM;
     T((T_CALLED("napms(%d)"), ms));
 
+#ifdef USE_TERM_DRIVER
+    CallDriver_1(SP_PARM, nap, ms);
+#else /* !USE_TERM_DRIVER */
 #if HAVE_NANOSLEEP
     {
 	struct timespec request, remaining;
@@ -69,6 +75,15 @@
 #else
     _nc_timed_wait(0, 0, ms, (int *) 0 EVENTLIST_2nd(0));
 #endif
+#endif /* !USE_TERM_DRIVER */
 
     returnCode(OK);
 }
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+napms(int ms)
+{
+    return NCURSES_SP_NAME(napms) (CURRENT_SCREEN, ms);
+}
+#endif
diff -Naur ncurses-5.7.orig/ncurses/tinfo/lib_options.c ncurses-5.7/ncurses/tinfo/lib_options.c
--- ncurses-5.7.orig/ncurses/tinfo/lib_options.c	2008-08-16 17:20:48.000000000 -0400
+++ ncurses-5.7/ncurses/tinfo/lib_options.c	2011-01-08 18:13:50.719157124 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2006,2008 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -30,6 +30,7 @@
  *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995               *
  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
  *     and: Thomas E. Dickey                        1996-on                 *
+ *     and: Juergen Pfeifer                         2009                    *
  ****************************************************************************/
 
 /*
@@ -41,53 +42,67 @@
 
 #include <curses.priv.h>
 
-#include <term.h>
-
-MODULE_ID("$Id: lib_options.c,v 1.58 2008/08/16 21:20:48 Werner.Fink Exp $")
+#ifndef CUR
+#define CUR SP_TERMTYPE
+#endif
 
-static int _nc_curs_set(SCREEN *, int);
-static int _nc_meta(SCREEN *, bool);
+MODULE_ID("$Id: lib_options.c,v 1.71 2009/10/24 21:56:15 tom Exp $")
 
 NCURSES_EXPORT(int)
 idlok(WINDOW *win, bool flag)
 {
-    T((T_CALLED("idlok(%p,%d)"), win, flag));
+    int res = ERR;
+    T((T_CALLED("idlok(%p,%d)"), (void *) win, flag));
 
     if (win) {
-	_nc_idlok = win->_idlok = (flag && (has_il() || change_scroll_region));
-	returnCode(OK);
-    } else
-	returnCode(ERR);
+	SCREEN *sp = _nc_screen_of(win);
+	if (sp && IsTermInfo(sp)) {
+	    sp->_nc_sp_idlok =
+		win->_idlok = (flag && (NCURSES_SP_NAME(has_il) (NCURSES_SP_ARG)
+					|| change_scroll_region));
+	    res = OK;
+	}
+    }
+    returnCode(res);
 }
 
 NCURSES_EXPORT(void)
 idcok(WINDOW *win, bool flag)
 {
-    T((T_CALLED("idcok(%p,%d)"), win, flag));
-
-    if (win)
-	_nc_idcok = win->_idcok = (flag && has_ic());
+    T((T_CALLED("idcok(%p,%d)"), (void *) win, flag));
 
+    if (win) {
+	SCREEN *sp = _nc_screen_of(win);
+	sp->_nc_sp_idcok = win->_idcok = (flag && NCURSES_SP_NAME(has_ic) (NCURSES_SP_ARG));
+    }
     returnVoid;
 }
 
 NCURSES_EXPORT(int)
-halfdelay(int t)
+NCURSES_SP_NAME(halfdelay) (NCURSES_SP_DCLx int t)
 {
-    T((T_CALLED("halfdelay(%d)"), t));
+    T((T_CALLED("halfdelay(%p,%d)"), (void *) SP_PARM, t));
 
-    if (t < 1 || t > 255 || SP == 0)
+    if (t < 1 || t > 255 || !IsValidTIScreen(SP_PARM))
 	returnCode(ERR);
 
-    cbreak();
-    SP->_cbreak = t + 1;
+    NCURSES_SP_NAME(cbreak) (NCURSES_SP_ARG);
+    SP_PARM->_cbreak = t + 1;
     returnCode(OK);
 }
 
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+halfdelay(int t)
+{
+    return NCURSES_SP_NAME(halfdelay) (CURRENT_SCREEN, t);
+}
+#endif
+
 NCURSES_EXPORT(int)
 nodelay(WINDOW *win, bool flag)
 {
-    T((T_CALLED("nodelay(%p,%d)"), win, flag));
+    T((T_CALLED("nodelay(%p,%d)"), (void *) win, flag));
 
     if (win) {
 	if (flag == TRUE)
@@ -102,7 +117,7 @@
 NCURSES_EXPORT(int)
 notimeout(WINDOW *win, bool f)
 {
-    T((T_CALLED("notimeout(%p,%d)"), win, f));
+    T((T_CALLED("notimeout(%p,%d)"), (void *) win, f));
 
     if (win) {
 	win->_notimeout = f;
@@ -114,7 +129,7 @@
 NCURSES_EXPORT(void)
 wtimeout(WINDOW *win, int delay)
 {
-    T((T_CALLED("wtimeout(%p,%d)"), win, delay));
+    T((T_CALLED("wtimeout(%p,%d)"), (void *) win, delay));
 
     if (win) {
 	win->_delay = delay;
@@ -125,11 +140,11 @@
 NCURSES_EXPORT(int)
 keypad(WINDOW *win, bool flag)
 {
-    T((T_CALLED("keypad(%p,%d)"), win, flag));
+    T((T_CALLED("keypad(%p,%d)"), (void *) win, flag));
 
     if (win) {
 	win->_use_keypad = flag;
-	returnCode(_nc_keypad(SP, flag));
+	returnCode(_nc_keypad(_nc_screen_of(win), flag));
     } else
 	returnCode(ERR);
 }
@@ -137,38 +152,106 @@
 NCURSES_EXPORT(int)
 meta(WINDOW *win GCC_UNUSED, bool flag)
 {
-    int result;
+    int result = ERR;
+    SCREEN *sp = (win == 0) ? CURRENT_SCREEN : _nc_screen_of(win);
+
+    /* Ok, we stay relaxed and don't signal an error if win is NULL */
+    T((T_CALLED("meta(%p,%d)"), (void *) win, flag));
 
     /* Ok, we stay relaxed and don't signal an error if win is NULL */
-    T((T_CALLED("meta(%p,%d)"), win, flag));
-    result = _nc_meta(SP, flag);
+
+    if (sp != 0) {
+	sp->_use_meta = flag;
+#ifdef USE_TERM_DRIVER
+	if (IsTermInfo(sp)) {
+	    if (flag) {
+		NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "meta_on", meta_on);
+	    } else {
+		NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "meta_off", meta_off);
+	    }
+	}
+#else
+	if (flag) {
+	    NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "meta_on", meta_on);
+	} else {
+	    NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "meta_off", meta_off);
+	}
+#endif
+	result = OK;
+    }
     returnCode(result);
 }
 
 /* curs_set() moved here to narrow the kernel interface */
 
 NCURSES_EXPORT(int)
-curs_set(int vis)
+NCURSES_SP_NAME(curs_set) (NCURSES_SP_DCLx int vis)
 {
-    int result;
+    int code = ERR;
+    T((T_CALLED("curs_set(%p,%d)"), (void *) SP_PARM, vis));
 
-    T((T_CALLED("curs_set(%d)"), vis));
-    result = _nc_curs_set(SP, vis);
-    returnCode(result);
+    if (SP_PARM != 0 && vis >= 0 && vis <= 2) {
+	int cursor = SP_PARM->_cursor;
+	bool bBuiltIn = !IsTermInfo(SP_PARM);
+	if (vis == cursor) {
+	    code = cursor;
+	} else {
+	    if (!bBuiltIn) {
+		switch (vis) {
+		case 2:
+		    code = NCURSES_SP_NAME(_nc_putp_flush) (NCURSES_SP_ARGx
+							    "cursor_visible",
+							    cursor_visible);
+		    break;
+		case 1:
+		    code = NCURSES_SP_NAME(_nc_putp_flush) (NCURSES_SP_ARGx
+							    "cursor_normal",
+							    cursor_normal);
+		    break;
+		case 0:
+		    code = NCURSES_SP_NAME(_nc_putp_flush) (NCURSES_SP_ARGx
+							    "cursor_invisible",
+							    cursor_invisible);
+		    break;
+		}
+	    } else
+		code = ERR;
+	    if (code != ERR)
+		code = (cursor == -1 ? 1 : cursor);
+	    SP_PARM->_cursor = vis;
+	}
+    }
+    returnCode(code);
 }
 
+#if NCURSES_SP_FUNCS
 NCURSES_EXPORT(int)
-typeahead(int fd)
+curs_set(int vis)
 {
-    T((T_CALLED("typeahead(%d)"), fd));
-    if (SP != 0) {
-	SP->_checkfd = fd;
+    return (NCURSES_SP_NAME(curs_set) (CURRENT_SCREEN, vis));
+}
+#endif
+
+NCURSES_EXPORT(int)
+NCURSES_SP_NAME(typeahead) (NCURSES_SP_DCLx int fd)
+{
+    T((T_CALLED("typeahead(%p, %d)"), (void *) SP_PARM, fd));
+    if (IsValidTIScreen(SP_PARM)) {
+	SP_PARM->_checkfd = fd;
 	returnCode(OK);
     } else {
 	returnCode(ERR);
     }
 }
 
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+typeahead(int fd)
+{
+    return NCURSES_SP_NAME(typeahead) (CURRENT_SCREEN, fd);
+}
+#endif
+
 /*
 **      has_key()
 **
@@ -189,42 +272,49 @@
 		|| has_key_internal(keycode, tp->sibling));
 }
 
+#ifdef USE_TERM_DRIVER
+NCURSES_EXPORT(int)
+TINFO_HAS_KEY(SCREEN *sp, int keycode)
+{
+    return IsValidTIScreen(sp) ?
+	has_key_internal(keycode, sp->_keytry) : 0;
+}
+#else
+NCURSES_EXPORT(int)
+NCURSES_SP_NAME(has_key) (NCURSES_SP_DCLx int keycode)
+{
+    T((T_CALLED("has_key(%p,%d)"), (void *) SP_PARM, keycode));
+    returnCode(SP != 0 ? has_key_internal(keycode, SP_PARM->_keytry) : FALSE);
+}
+
+#if NCURSES_SP_FUNCS
 NCURSES_EXPORT(int)
 has_key(int keycode)
 {
-    T((T_CALLED("has_key(%d)"), keycode));
-    returnCode(SP != 0 ? has_key_internal(keycode, SP->_keytry) : FALSE);
+    return NCURSES_SP_NAME(has_key) (CURRENT_SCREEN, keycode);
 }
+#endif
+#endif
 #endif /* NCURSES_EXT_FUNCS */
 
-/*
- * Internal entrypoints use SCREEN* parameter to obtain capabilities rather
- * than cur_term.
- */
-#undef CUR
-#define CUR (sp->_term)->type.
-
-static int
-_nc_putp(const char *name GCC_UNUSED, const char *value)
+NCURSES_EXPORT(int)
+NCURSES_SP_NAME(_nc_putp_flush) (NCURSES_SP_DCLx
+				 const char *name, const char *value)
 {
-    int rc = ERR;
-
-    if (value) {
-	TPUTS_TRACE(name);
-	rc = putp(value);
+    int rc = NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx name, value);
+    if (rc != ERR) {
+	_nc_flush();
     }
     return rc;
 }
 
-static int
+#if 0 && NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
 _nc_putp_flush(const char *name, const char *value)
 {
-    int rc = _nc_putp(name, value);
-    if (rc != ERR) {
-	_nc_flush();
-    }
-    return rc;
+    return NCURSES_SP_NAME(_nc_putp_flush) (CURRENT_SCREEN, name, value);
 }
+#endif
 
 /* Turn the keypad on/off
  *
@@ -245,12 +335,12 @@
 	 * has wgetch() reading in more than one thread.  putp() and below
 	 * may use SP explicitly.
 	 */
-	if (_nc_use_pthreads && sp != SP) {
+	if (_nc_use_pthreads && sp != CURRENT_SCREEN) {
 	    SCREEN *save_sp;
 
 	    /* cannot use use_screen(), since that is not in tinfo library */
 	    _nc_lock_global(curses);
-	    save_sp = SP;
+	    save_sp = CURRENT_SCREEN;
 	    _nc_set_screen(sp);
 	    rc = _nc_keypad(sp, flag);
 	    _nc_set_screen(save_sp);
@@ -258,10 +348,19 @@
 	} else
 #endif
 	{
+#ifdef USE_TERM_DRIVER
+	    rc = CallDriver_1(sp, kpad, flag);
+	    if (rc == OK)
+		sp->_keypad_on = flag;
+#else
 	    if (flag) {
-		(void) _nc_putp_flush("keypad_xmit", keypad_xmit);
+		(void) NCURSES_SP_NAME(_nc_putp_flush) (NCURSES_SP_ARGx
+							"keypad_xmit",
+							keypad_xmit);
 	    } else if (!flag && keypad_local) {
-		(void) _nc_putp_flush("keypad_local", keypad_local);
+		(void) NCURSES_SP_NAME(_nc_putp_flush) (NCURSES_SP_ARGx
+							"keypad_local",
+							keypad_local);
 	    }
 
 	    if (flag && !sp->_tried) {
@@ -270,58 +369,8 @@
 	    }
 	    sp->_keypad_on = flag;
 	    rc = OK;
+#endif
 	}
     }
     return (rc);
 }
-
-static int
-_nc_curs_set(SCREEN *sp, int vis)
-{
-    int result = ERR;
-
-    T((T_CALLED("curs_set(%d)"), vis));
-    if (sp != 0 && vis >= 0 && vis <= 2) {
-	int cursor = sp->_cursor;
-
-	if (vis == cursor) {
-	    result = cursor;
-	} else {
-	    switch (vis) {
-	    case 2:
-		result = _nc_putp_flush("cursor_visible", cursor_visible);
-		break;
-	    case 1:
-		result = _nc_putp_flush("cursor_normal", cursor_normal);
-		break;
-	    case 0:
-		result = _nc_putp_flush("cursor_invisible", cursor_invisible);
-		break;
-	    }
-	    if (result != ERR)
-		result = (cursor == -1 ? 1 : cursor);
-	    sp->_cursor = vis;
-	}
-    }
-    returnCode(result);
-}
-
-static int
-_nc_meta(SCREEN *sp, bool flag)
-{
-    int result = ERR;
-
-    /* Ok, we stay relaxed and don't signal an error if win is NULL */
-
-    if (SP != 0) {
-	SP->_use_meta = flag;
-
-	if (flag) {
-	    _nc_putp("meta_on", meta_on);
-	} else {
-	    _nc_putp("meta_off", meta_off);
-	}
-	result = OK;
-    }
-    return result;
-}
diff -Naur ncurses-5.7.orig/ncurses/tinfo/lib_print.c ncurses-5.7/ncurses/tinfo/lib_print.c
--- ncurses-5.7.orig/ncurses/tinfo/lib_print.c	2006-11-25 19:26:34.000000000 -0500
+++ ncurses-5.7/ncurses/tinfo/lib_print.c	2011-01-08 18:13:50.719157124 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2002,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            *
@@ -29,23 +29,31 @@
 /****************************************************************************
  *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995               *
  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
+ *     and: Thomas E. Dickey                        1996-on                 *
+ *     and: Juergen Pfeifer                                                 *
  ****************************************************************************/
 
 #include <curses.priv.h>
 
-#include <term.h>
+#ifndef CUR
+#define CUR SP_TERMTYPE
+#endif
 
-MODULE_ID("$Id: lib_print.c,v 1.16 2006/11/26 00:26:34 tom Exp $")
+MODULE_ID("$Id: lib_print.c,v 1.20 2010/06/05 22:18:35 tom Exp $")
 
 NCURSES_EXPORT(int)
-mcprint(char *data, int len)
+NCURSES_SP_NAME(mcprint) (NCURSES_SP_DCLx char *data, int len)
 /* ship binary character data to the printer via mc4/mc5/mc5p */
 {
+    int result;
     char *mybuf, *switchon;
-    size_t onsize, offsize, res;
+    size_t onsize, offsize;
+    size_t need;
 
     errno = 0;
-    if (!cur_term || (!prtr_non && (!prtr_on || !prtr_off))) {
+    if (!HasTInfoTerminal(SP_PARM)
+	|| len <= 0
+	|| (!prtr_non && (!prtr_on || !prtr_off))) {
 	errno = ENODEV;
 	return (ERR);
     }
@@ -60,8 +68,10 @@
 	offsize = strlen(prtr_off);
     }
 
+    need = onsize + (size_t) len + offsize;
+
     if (switchon == 0
-	|| (mybuf = typeMalloc(char, onsize + len + offsize + 1)) == 0) {
+	|| (mybuf = typeMalloc(char, need + 1)) == 0) {
 	errno = ENOMEM;
 	return (ERR);
     }
@@ -78,15 +88,24 @@
      * data has actually been shipped to the terminal.  If the write(2)
      * operation is truly atomic we're protected from this.
      */
-    res = write(cur_term->Filedes, mybuf, onsize + len + offsize);
+    result = (int) write(TerminalOf(SP_PARM)->Filedes, mybuf, need);
 
     /*
      * By giving up our scheduler slot here we increase the odds that the
      * kernel will ship the contiguous clist items from the last write
      * immediately.
      */
+#ifndef __MINGW32__
     (void) sleep(0);
-
+#endif
     free(mybuf);
-    return (res);
+    return (result);
+}
+
+#if NCURSES_SP_FUNCS && !defined(USE_TERM_DRIVER)
+NCURSES_EXPORT(int)
+mcprint(char *data, int len)
+{
+    return NCURSES_SP_NAME(mcprint) (CURRENT_SCREEN, data, len);
 }
+#endif
diff -Naur ncurses-5.7.orig/ncurses/tinfo/lib_raw.c ncurses-5.7/ncurses/tinfo/lib_raw.c
--- ncurses-5.7.orig/ncurses/tinfo/lib_raw.c	2007-09-29 17:50:22.000000000 -0400
+++ ncurses-5.7/ncurses/tinfo/lib_raw.c	2011-01-08 18:13:50.723157094 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2002,2007 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            *
@@ -29,7 +29,8 @@
 /****************************************************************************
  *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995               *
  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
- *     and: Thomas E. Dickey 1998 on                                        *
+ *     and: Thomas E. Dickey                        1998-on                 *
+ *     and: Juergen Pfeifer                         2009                    *
  ****************************************************************************/
 
 /*
@@ -47,9 +48,8 @@
  */
 
 #include <curses.priv.h>
-#include <term.h>		/* cur_term */
 
-MODULE_ID("$Id: lib_raw.c,v 1.14 2007/09/29 21:50:22 tom Exp $")
+MODULE_ID("$Id: lib_raw.c,v 1.19 2010/04/24 23:49:12 tom Exp $")
 
 #if SVR4_TERMIO && !defined(_POSIX_SOURCE)
 #define _POSIX_SOURCE
@@ -61,7 +61,7 @@
 
 #ifdef __EMX__
 #include <io.h>
-#define _nc_setmode(mode) setmode(SP->_ifd, mode)
+#define _nc_setmode(mode) setmode(SP_PARM->_ifd, mode)
 #else
 #define _nc_setmode(mode)	/* nothing */
 #endif
@@ -77,188 +77,235 @@
 #endif /* TRACE */
 
 NCURSES_EXPORT(int)
-raw(void)
+NCURSES_SP_NAME(raw) (NCURSES_SP_DCL0)
 {
     int result = ERR;
+    TERMINAL *termp;
 
-    T((T_CALLED("raw()")));
-
-    if (SP != 0 && cur_term != 0) {
+    T((T_CALLED("raw(%p)"), (void *) SP_PARM));
+    if ((termp = TerminalOf(SP_PARM)) != 0) {
 	TTY buf;
 
 	BEFORE("raw");
 	_nc_setmode(O_BINARY);
 
-	buf = cur_term->Nttyb;
+	buf = termp->Nttyb;
 #ifdef TERMIOS
-	buf.c_lflag &= ~(ICANON | ISIG | IEXTEN);
-	buf.c_iflag &= ~(COOKED_INPUT);
+	buf.c_lflag &= (unsigned) ~(ICANON | ISIG | IEXTEN);
+	buf.c_iflag &= (unsigned) ~(COOKED_INPUT);
 	buf.c_cc[VMIN] = 1;
 	buf.c_cc[VTIME] = 0;
 #else
 	buf.sg_flags |= RAW;
 #endif
-	if ((result = _nc_set_tty_mode(&buf)) == OK) {
-	    SP->_raw = TRUE;
-	    SP->_cbreak = 1;
-	    cur_term->Nttyb = buf;
+	result = NCURSES_SP_NAME(_nc_set_tty_mode) (NCURSES_SP_ARGx &buf);
+	if (result == OK) {
+	    SP_PARM->_raw = TRUE;
+	    SP_PARM->_cbreak = 1;
+	    termp->Nttyb = buf;
 	}
 	AFTER("raw");
     }
     returnCode(result);
 }
 
+#if NCURSES_SP_FUNCS
 NCURSES_EXPORT(int)
-cbreak(void)
+raw(void)
 {
-    int result = ERR;
+    return NCURSES_SP_NAME(raw) (CURRENT_SCREEN);
+}
+#endif
 
-    T((T_CALLED("cbreak()")));
+NCURSES_EXPORT(int)
+NCURSES_SP_NAME(cbreak) (NCURSES_SP_DCL0)
+{
+    int result = ERR;
+    TERMINAL *termp;
 
-    if (SP != 0 && cur_term != 0) {
+    T((T_CALLED("cbreak(%p)"), (void *) SP_PARM));
+    if ((termp = TerminalOf(SP_PARM)) != 0) {
 	TTY buf;
 
 	BEFORE("cbreak");
 	_nc_setmode(O_BINARY);
 
-	buf = cur_term->Nttyb;
+	buf = termp->Nttyb;
 #ifdef TERMIOS
-	buf.c_lflag &= ~ICANON;
-	buf.c_iflag &= ~ICRNL;
+	buf.c_lflag &= (unsigned) ~ICANON;
+	buf.c_iflag &= (unsigned) ~ICRNL;
 	buf.c_lflag |= ISIG;
 	buf.c_cc[VMIN] = 1;
 	buf.c_cc[VTIME] = 0;
 #else
 	buf.sg_flags |= CBREAK;
 #endif
-	if ((result = _nc_set_tty_mode(&buf)) == OK) {
-	    SP->_cbreak = 1;
-	    cur_term->Nttyb = buf;
+	result = NCURSES_SP_NAME(_nc_set_tty_mode) (NCURSES_SP_ARGx &buf);
+	if (result == OK) {
+	    SP_PARM->_cbreak = 1;
+	    termp->Nttyb = buf;
 	}
 	AFTER("cbreak");
     }
     returnCode(result);
 }
 
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+cbreak(void)
+{
+    return NCURSES_SP_NAME(cbreak) (CURRENT_SCREEN);
+}
+#endif
+
 /*
  * Note:
  * this implementation may be wrong.  See the comment under intrflush().
  */
 NCURSES_EXPORT(void)
-qiflush(void)
+NCURSES_SP_NAME(qiflush) (NCURSES_SP_DCL0)
 {
     int result = ERR;
+    TERMINAL *termp;
 
-    T((T_CALLED("qiflush()")));
-
-    if (cur_term != 0) {
+    T((T_CALLED("qiflush(%p)"), (void *) SP_PARM));
+    if ((termp = TerminalOf(SP_PARM)) != 0) {
 	TTY buf;
 
 	BEFORE("qiflush");
-	buf = cur_term->Nttyb;
+	buf = termp->Nttyb;
 #ifdef TERMIOS
-	buf.c_lflag &= ~(NOFLSH);
-	result = _nc_set_tty_mode(&buf);
+	buf.c_lflag &= (unsigned) ~(NOFLSH);
+	result = NCURSES_SP_NAME(_nc_set_tty_mode) (NCURSES_SP_ARGx &buf);
 #else
 	/* FIXME */
 #endif
 	if (result == OK)
-	    cur_term->Nttyb = buf;
+	    termp->Nttyb = buf;
 	AFTER("qiflush");
     }
     returnVoid;
 }
 
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(void)
+qiflush(void)
+{
+    NCURSES_SP_NAME(qiflush) (CURRENT_SCREEN);
+}
+#endif
+
 NCURSES_EXPORT(int)
-noraw(void)
+NCURSES_SP_NAME(noraw) (NCURSES_SP_DCL0)
 {
     int result = ERR;
+    TERMINAL *termp;
 
-    T((T_CALLED("noraw()")));
-
-    if (SP != 0 && cur_term != 0) {
+    T((T_CALLED("noraw(%p)"), (void *) SP_PARM));
+    if ((termp = TerminalOf(SP_PARM)) != 0) {
 	TTY buf;
 
 	BEFORE("noraw");
 	_nc_setmode(O_TEXT);
 
-	buf = cur_term->Nttyb;
+	buf = termp->Nttyb;
 #ifdef TERMIOS
 	buf.c_lflag |= ISIG | ICANON |
-	    (cur_term->Ottyb.c_lflag & IEXTEN);
+	    (termp->Ottyb.c_lflag & IEXTEN);
 	buf.c_iflag |= COOKED_INPUT;
 #else
 	buf.sg_flags &= ~(RAW | CBREAK);
 #endif
-	if ((result = _nc_set_tty_mode(&buf)) == OK) {
-	    SP->_raw = FALSE;
-	    SP->_cbreak = 0;
-	    cur_term->Nttyb = buf;
+	result = NCURSES_SP_NAME(_nc_set_tty_mode) (NCURSES_SP_ARGx &buf);
+	if (result == OK) {
+	    SP_PARM->_raw = FALSE;
+	    SP_PARM->_cbreak = 0;
+	    termp->Nttyb = buf;
 	}
 	AFTER("noraw");
     }
     returnCode(result);
 }
 
+#if NCURSES_SP_FUNCS
 NCURSES_EXPORT(int)
-nocbreak(void)
+noraw(void)
 {
-    int result = ERR;
+    return NCURSES_SP_NAME(noraw) (CURRENT_SCREEN);
+}
+#endif
 
-    T((T_CALLED("nocbreak()")));
+NCURSES_EXPORT(int)
+NCURSES_SP_NAME(nocbreak) (NCURSES_SP_DCL0)
+{
+    int result = ERR;
+    TERMINAL *termp;
 
-    if (SP != 0 && cur_term != 0) {
+    T((T_CALLED("nocbreak(%p)"), (void *) SP_PARM));
+    if ((termp = TerminalOf(SP_PARM)) != 0) {
 	TTY buf;
 
 	BEFORE("nocbreak");
 	_nc_setmode(O_TEXT);
 
-	buf = cur_term->Nttyb;
+	buf = termp->Nttyb;
 #ifdef TERMIOS
 	buf.c_lflag |= ICANON;
 	buf.c_iflag |= ICRNL;
 #else
 	buf.sg_flags &= ~CBREAK;
 #endif
-	if ((result = _nc_set_tty_mode(&buf)) == OK) {
-	    SP->_cbreak = 0;
-	    cur_term->Nttyb = buf;
+	result = NCURSES_SP_NAME(_nc_set_tty_mode) (NCURSES_SP_ARGx &buf);
+	if (result == OK) {
+	    SP_PARM->_cbreak = 0;
+	    termp->Nttyb = buf;
 	}
 	AFTER("nocbreak");
     }
     returnCode(result);
 }
 
-/*
- * Note:
- * this implementation may be wrong.  See the comment under intrflush().
- */
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+nocbreak(void)
+{
+    return NCURSES_SP_NAME(nocbreak) (CURRENT_SCREEN);
+}
+#endif
+
 NCURSES_EXPORT(void)
-noqiflush(void)
+NCURSES_SP_NAME(noqiflush) (NCURSES_SP_DCL0)
 {
     int result = ERR;
+    TERMINAL *termp;
 
-    T((T_CALLED("noqiflush()")));
-
-    if (cur_term != 0) {
+    T((T_CALLED("noqiflush(%p)"), (void *) SP_PARM));
+    if ((termp = TerminalOf(SP_PARM)) != 0) {
 	TTY buf;
 
 	BEFORE("noqiflush");
-	buf = cur_term->Nttyb;
+	buf = termp->Nttyb;
 #ifdef TERMIOS
 	buf.c_lflag |= NOFLSH;
-	result = _nc_set_tty_mode(&buf);
+	result = NCURSES_SP_NAME(_nc_set_tty_mode) (NCURSES_SP_ARGx &buf);
 #else
 	/* FIXME */
 #endif
-	if (result == OK) {
-	    cur_term->Nttyb = buf;
-	}
+	if (result == OK)
+	    termp->Nttyb = buf;
 	AFTER("noqiflush");
     }
     returnVoid;
 }
 
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(void)
+noqiflush(void)
+{
+    NCURSES_SP_NAME(noqiflush) (CURRENT_SCREEN);
+}
+#endif
+
 /*
  * This call does the same thing as the qiflush()/noqiflush() pair.  We know
  * for certain that SVr3 intrflush() tweaks the NOFLSH bit; on the other hand,
@@ -267,30 +314,41 @@
  * curs_inopts(3x) is too exact to be coincidence.
  */
 NCURSES_EXPORT(int)
-intrflush(WINDOW *win GCC_UNUSED, bool flag)
+NCURSES_SP_NAME(intrflush) (NCURSES_SP_DCLx WINDOW *win GCC_UNUSED, bool flag)
 {
     int result = ERR;
+    TERMINAL *termp;
 
-    T((T_CALLED("intrflush(%d)"), flag));
+    T((T_CALLED("intrflush(%p,%d)"), (void *) SP_PARM, flag));
+    if (SP_PARM == 0)
+	returnCode(ERR);
 
-    if (cur_term != 0) {
+    if ((termp = TerminalOf(SP_PARM)) != 0) {
 	TTY buf;
 
 	BEFORE("intrflush");
-	buf = cur_term->Nttyb;
+	buf = termp->Nttyb;
 #ifdef TERMIOS
 	if (flag)
-	    buf.c_lflag &= ~(NOFLSH);
+	    buf.c_lflag &= (unsigned) ~(NOFLSH);
 	else
 	    buf.c_lflag |= (NOFLSH);
-	result = _nc_set_tty_mode(&buf);
+	result = NCURSES_SP_NAME(_nc_set_tty_mode) (NCURSES_SP_ARGx &buf);
 #else
 	/* FIXME */
 #endif
 	if (result == OK) {
-	    cur_term->Nttyb = buf;
+	    termp->Nttyb = buf;
 	}
 	AFTER("intrflush");
     }
     returnCode(result);
 }
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+intrflush(WINDOW *win GCC_UNUSED, bool flag)
+{
+    return NCURSES_SP_NAME(intrflush) (CURRENT_SCREEN, win, flag);
+}
+#endif
diff -Naur ncurses-5.7.orig/ncurses/tinfo/lib_setup.c ncurses-5.7/ncurses/tinfo/lib_setup.c
--- ncurses-5.7.orig/ncurses/tinfo/lib_setup.c	2008-08-03 18:42:33.000000000 -0400
+++ ncurses-5.7/ncurses/tinfo/lib_setup.c	2011-01-08 18:18:29.750780851 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2007,2008 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            *
@@ -30,6 +30,7 @@
  *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995               *
  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
  *     and: Thomas E. Dickey                        1996-on                 *
+ *     and: Juergen Pfeifer                         2009                    *
  ****************************************************************************/
 
 /*
@@ -41,7 +42,6 @@
 
 #include <curses.priv.h>
 #include <tic.h>		/* for MAX_NAME_SIZE */
-#include <term_entry.h>
 
 #if SVR4_TERMIO && !defined(_POSIX_SOURCE)
 #define _POSIX_SOURCE
@@ -51,9 +51,7 @@
 #include <locale.h>
 #endif
 
-#include <term.h>		/* lines, columns, cur_term */
-
-MODULE_ID("$Id: lib_setup.c,v 1.111 2008/08/03 22:42:33 tom Exp $")
+MODULE_ID("$Id: lib_setup.c,v 1.132 2010/12/20 00:26:35 tom Exp $")
 
 /****************************************************************************
  *
@@ -109,61 +107,96 @@
  * Wrap global variables in this module.
  */
 #if USE_REENTRANT
+
 NCURSES_EXPORT(char *)
 NCURSES_PUBLIC_VAR(ttytype) (void)
 {
     static char empty[] = "";
-    return cur_term ? cur_term->type.term_names : empty;
+    char *result = empty;
+
+#if NCURSES_SP_FUNCS
+    if (CURRENT_SCREEN) {
+	TERMINAL *termp = TerminalOf(CURRENT_SCREEN);
+	if (termp != 0) {
+	    result = termp->type.term_names;
+	}
+    }
+#else
+    if (cur_term != 0) {
+	result = cur_term->type.term_names;
+    }
+#endif
+    return result;
 }
+
 NCURSES_EXPORT(int *)
-_nc_ptr_Lines(void)
+_nc_ptr_Lines(SCREEN *sp)
 {
-    return ptrLines();
+    return ptrLines(sp);
 }
+
 NCURSES_EXPORT(int)
 NCURSES_PUBLIC_VAR(LINES) (void)
 {
-    return *_nc_ptr_Lines();
+    return *_nc_ptr_Lines(CURRENT_SCREEN);
 }
+
 NCURSES_EXPORT(int *)
-_nc_ptr_Cols(void)
+_nc_ptr_Cols(SCREEN *sp)
 {
-    return ptrCols();
+    return ptrCols(sp);
 }
+
 NCURSES_EXPORT(int)
 NCURSES_PUBLIC_VAR(COLS) (void)
 {
-    return *_nc_ptr_Cols();
+    return *_nc_ptr_Cols(CURRENT_SCREEN);
 }
+
+NCURSES_EXPORT(int *)
+_nc_ptr_Tabsize(SCREEN *sp)
+{
+    return ptrTabsize(sp);
+}
+
 NCURSES_EXPORT(int)
 NCURSES_PUBLIC_VAR(TABSIZE) (void)
 {
-    return SP ? SP->_TABSIZE : 8;
+    return *_nc_ptr_Tabsize(CURRENT_SCREEN);
 }
 #else
 NCURSES_EXPORT_VAR(char) ttytype[NAMESIZE] = "";
 NCURSES_EXPORT_VAR(int) LINES = 0;
 NCURSES_EXPORT_VAR(int) COLS = 0;
-NCURSES_EXPORT_VAR(int) TABSIZE = 0;
+NCURSES_EXPORT_VAR(int) TABSIZE = 8;
 #endif
 
 #if NCURSES_EXT_FUNCS
 NCURSES_EXPORT(int)
-set_tabsize(int value)
+NCURSES_SP_NAME(set_tabsize) (NCURSES_SP_DCLx int value)
 {
     int code = OK;
 #if USE_REENTRANT
-    if (SP) {
-	SP->_TABSIZE = value;
+    if (SP_PARM) {
+	SP_PARM->_TABSIZE = value;
     } else {
 	code = ERR;
     }
 #else
+    (void) SP_PARM;
     TABSIZE = value;
 #endif
     return code;
 }
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+set_tabsize(int value)
+{
+    return NCURSES_SP_NAME(set_tabsize) (CURRENT_SCREEN, value);
+}
 #endif
+#endif /* NCURSES_EXT_FUNCS */
 
 #if USE_SIGWINCH
 /*
@@ -188,42 +221,71 @@
 #endif
 
 NCURSES_EXPORT(void)
+NCURSES_SP_NAME(use_env) (NCURSES_SP_DCLx bool f)
+{
+    T((T_CALLED("use_env(%p,%d)"), (void *) SP_PARM, (int) f));
+#if NCURSES_SP_FUNCS
+    if (IsPreScreen(SP_PARM)) {
+	SP_PARM->_use_env = f;
+    }
+#else
+    _nc_prescreen.use_env = f;
+#endif
+    returnVoid;
+}
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(void)
 use_env(bool f)
 {
-    T((T_CALLED("use_env()")));
+    T((T_CALLED("use_env(%d)"), (int) f));
     _nc_prescreen.use_env = f;
     returnVoid;
 }
+#endif
 
 NCURSES_EXPORT(void)
-_nc_get_screensize(SCREEN *sp, int *linep, int *colp)
+_nc_get_screensize(SCREEN *sp,
+#ifdef USE_TERM_DRIVER
+		   TERMINAL * termp,
+#endif
+		   int *linep, int *colp)
 /* Obtain lines/columns values from the environment and/or terminfo entry */
 {
+#ifdef USE_TERM_DRIVER
+    TERMINAL_CONTROL_BLOCK *TCB;
+    int my_tabsize;
+
+    assert(termp != 0 && linep != 0 && colp != 0);
+    TCB = (TERMINAL_CONTROL_BLOCK *) termp;
+
+    my_tabsize = TCB->info.tabsize;
+    TCB->drv->size(TCB, linep, colp);
+
+#if USE_REENTRANT
+    if (sp != 0) {
+	sp->_TABSIZE = my_tabsize;
+    }
+#else
+    (void) sp;
+    TABSIZE = my_tabsize;
+#endif
+    T(("TABSIZE = %d", my_tabsize));
+#else /* !USE_TERM_DRIVER */
     TERMINAL *termp = cur_term;
     int my_tabsize;
 
     /* figure out the size of the screen */
     T(("screen size: terminfo lines = %d columns = %d", lines, columns));
 
-    if (!_nc_prescreen.use_env) {
-	*linep = (int) lines;
-	*colp = (int) columns;
-    } else {			/* usually want to query LINES and COLUMNS from environment */
-	int value;
-
-	*linep = *colp = 0;
+    *linep = (int) lines;
+    *colp = (int) columns;
 
-	/* first, look for environment variables */
-	if ((value = _nc_getenv_num("LINES")) > 0) {
-	    *linep = value;
-	}
-	if ((value = _nc_getenv_num("COLUMNS")) > 0) {
-	    *colp = value;
-	}
-	T(("screen size: environment LINES = %d COLUMNS = %d", *linep, *colp));
+    if (_nc_prescreen.use_env) {
+	int value;
 
 #ifdef __EMX__
-	if (*linep <= 0 || *colp <= 0) {
+	{
 	    int screendata[2];
 	    _scrsize(screendata);
 	    *colp = screendata[0];
@@ -233,33 +295,41 @@
 	}
 #endif
 #if HAVE_SIZECHANGE
-	/* if that didn't work, maybe we can try asking the OS */
-	if (*linep <= 0 || *colp <= 0) {
-	    if (isatty(cur_term->Filedes)) {
-		STRUCT_WINSIZE size;
-
-		errno = 0;
-		do {
-		    if (ioctl(cur_term->Filedes, IOCTL_WINSIZE, &size) < 0
-			&& errno != EINTR)
-			goto failure;
-		} while
-		    (errno == EINTR);
-
-		/*
-		 * Solaris lets users override either dimension with an
-		 * environment variable.
-		 */
-		if (*linep <= 0)
-		    *linep = (sp != 0 && sp->_filtered) ? 1 : WINSIZE_ROWS(size);
-		if (*colp <= 0)
+	/* try asking the OS */
+	if (isatty(cur_term->Filedes)) {
+	    STRUCT_WINSIZE size;
+
+	    errno = 0;
+	    do {
+		if (ioctl(cur_term->Filedes, IOCTL_WINSIZE, &size) >= 0) {
+		    *linep = ((sp != 0 && sp->_filtered)
+			      ? 1
+			      : WINSIZE_ROWS(size));
 		    *colp = WINSIZE_COLS(size);
-	    }
-	    /* FALLTHRU */
-	  failure:;
+		    T(("SYS screen size: environment LINES = %d COLUMNS = %d",
+		       *linep, *colp));
+		    break;
+		}
+	    } while
+		(errno == EINTR);
 	}
 #endif /* HAVE_SIZECHANGE */
 
+	/*
+	 * Finally, look for environment variables.
+	 *
+	 * Solaris lets users override either dimension with an environment
+	 * variable.
+	 */
+	if ((value = _nc_getenv_num("LINES")) > 0) {
+	    *linep = value;
+	    T(("screen size: environment LINES = %d", *linep));
+	}
+	if ((value = _nc_getenv_num("COLUMNS")) > 0) {
+	    *colp = value;
+	    T(("screen size: environment COLUMNS = %d", *colp));
+	}
+
 	/* if we can't get dynamic info about the size, use static */
 	if (*linep <= 0) {
 	    *linep = (int) lines;
@@ -298,19 +368,31 @@
     TABSIZE = my_tabsize;
 #endif
     T(("TABSIZE = %d", TABSIZE));
+#endif /* USE_TERM_DRIVER */
 }
 
 #if USE_SIZECHANGE
 NCURSES_EXPORT(void)
 _nc_update_screensize(SCREEN *sp)
 {
+    int new_lines;
+    int new_cols;
+
+#ifdef USE_TERM_DRIVER
+    int old_lines;
+    int old_cols;
+
+    assert(sp != 0);
+
+    CallDriver_2(sp, getsize, &old_lines, &old_cols);
+
+#else
     TERMINAL *termp = cur_term;
     int old_lines = lines;
-    int new_lines;
     int old_cols = columns;
-    int new_cols;
+#endif
 
-    _nc_get_screensize(sp, &new_lines, &new_cols);
+    TINFO_GET_SIZE(sp, sp->_term, &new_lines, &new_cols);
 
     /*
      * See is_term_resized() and resizeterm().
@@ -320,7 +402,7 @@
     if (sp != 0
 	&& sp->_resize != 0) {
 	if ((new_lines != old_lines) || (new_cols != old_cols))
-	    sp->_resize(new_lines, new_cols);
+	    sp->_resize(NCURSES_SP_ARGx new_lines, new_cols);
 	sp->_sig_winch = FALSE;
     }
 }
@@ -353,8 +435,8 @@
  * Return 1 if entry found, 0 if not found, -1 if database not accessible,
  * just like tgetent().
  */
-static int
-grab_entry(const char *const tn, TERMTYPE *const tp)
+int
+_nc_setup_tinfo(const char *const tn, TERMTYPE *const tp)
 {
     char filename[PATH_MAX];
     int status = _nc_read_entry(tn, filename, tp);
@@ -381,28 +463,27 @@
 #endif
 
 /*
-**	do_prototype()
-**
 **	Take the real command character out of the CC environment variable
 **	and substitute it in for the prototype given in 'command_character'.
 */
-static void
-do_prototype(TERMINAL * termp)
+void
+_nc_tinfo_cmdch(TERMINAL * termp, char proto)
 {
     unsigned i;
     char CC;
-    char proto;
     char *tmp;
 
-    if ((tmp = getenv("CC")) != 0) {
-	if ((CC = *tmp) != 0) {
-	    proto = *command_character;
-
-	    for_each_string(i, &(termp->type)) {
-		for (tmp = termp->type.Strings[i]; *tmp; tmp++) {
-		    if (*tmp == proto)
-			*tmp = CC;
-		}
+    /*
+     * Only use the character if the string is a single character,
+     * since it is fairly common for developers to set the C compiler
+     * name as an environment variable - using the same symbol.
+     */
+    if ((tmp = getenv("CC")) != 0 && strlen(tmp) == 1) {
+	CC = *tmp;
+	for_each_string(i, &(termp->type)) {
+	    for (tmp = termp->type.Strings[i]; *tmp; tmp++) {
+		if (*tmp == proto)
+		    *tmp = CC;
 	    }
 	}
     }
@@ -486,18 +567,37 @@
     return 0;
 }
 
-/*
- * This entrypoint is called from tgetent() to allow a special case of reusing
- * the same TERMINAL data (see comment).
- */
 NCURSES_EXPORT(int)
-_nc_setupterm(NCURSES_CONST char *tname, int Filedes, int *errret, bool reuse)
+TINFO_SETUP_TERM(TERMINAL ** tp,
+		 NCURSES_CONST char *tname,
+		 int Filedes,
+		 int *errret,
+		 bool reuse)
 {
-    TERMINAL *termp;
+#ifdef USE_TERM_DRIVER
+    TERMINAL_CONTROL_BLOCK *TCB = 0;
+#else
     int status;
+#endif
+    TERMINAL *termp;
+    SCREEN *sp = 0;
+    int code = ERR;
 
     START_TRACE();
-    T((T_CALLED("setupterm(%s,%d,%p)"), _nc_visbuf(tname), Filedes, errret));
+
+#ifdef USE_TERM_DRIVER
+    T((T_CALLED("_nc_setupterm_ex(%p,%s,%d,%p)"),
+       (void *) tp, _nc_visbuf(tname), Filedes, (void *) errret));
+
+    if (tp == 0) {
+	ret_error0(TGETENT_ERR,
+		   "Invalid parameter, internal error.\n");
+    } else
+	termp = *tp;
+#else
+    termp = cur_term;
+    T((T_CALLED("setupterm(%s,%d,%p)"), _nc_visbuf(tname), Filedes, (void *) errret));
+#endif
 
     if (tname == 0) {
 	tname = getenv("TERM");
@@ -538,22 +638,37 @@
      * properly with this feature).
      */
     if (reuse
-	&& (termp = cur_term) != 0
+	&& (termp != 0)
 	&& termp->Filedes == Filedes
 	&& termp->_termname != 0
 	&& !strcmp(termp->_termname, tname)
 	&& _nc_name_match(termp->type.term_names, tname, "|")) {
 	T(("reusing existing terminal information and mode-settings"));
+	code = OK;
     } else {
-
+#ifdef USE_TERM_DRIVER
+	termp = (TERMINAL *) typeCalloc(TERMINAL_CONTROL_BLOCK, 1);
+#else
 	termp = typeCalloc(TERMINAL, 1);
-
+#endif
 	if (termp == 0) {
 	    ret_error0(TGETENT_ERR,
 		       "Not enough memory to create terminal structure.\n");
 	}
+#ifdef USE_TERM_DRIVER
+	INIT_TERM_DRIVER();
+	TCB = (TERMINAL_CONTROL_BLOCK *) termp;
+	code = _nc_globals.term_driver(TCB, tname, errret);
+	if (code == OK) {
+	    termp->Filedes = (short) Filedes;
+	    termp->_termname = strdup(tname);
+	} else {
+	    ret_error0(TGETENT_ERR,
+		       "Could not find any driver to handle this terminal.\n");
+	}
+#else
 #if USE_DATABASE || USE_TERMCAP
-	status = grab_entry(tname, &termp->type);
+	status = _nc_setup_tinfo(tname, &termp->type);
 #else
 	status = TGETENT_NO;
 #endif
@@ -581,13 +696,13 @@
 	ttytype[NAMESIZE - 1] = '\0';
 #endif
 
-	termp->Filedes = Filedes;
+	termp->Filedes = (short) Filedes;
 	termp->_termname = strdup(tname);
 
 	set_curterm(termp);
 
-	if (command_character && getenv("CC"))
-	    do_prototype(termp);
+	if (command_character)
+	    _nc_tinfo_cmdch(termp, *command_character);
 
 	/*
 	 * If an application calls setupterm() rather than initscr() or
@@ -599,25 +714,95 @@
 	    def_prog_mode();
 	    baudrate();
 	}
+	code = OK;
+#endif
     }
 
+#ifdef USE_TERM_DRIVER
+    *tp = termp;
+    NCURSES_SP_NAME(set_curterm) (sp, termp);
+    TCB->drv->init(TCB);
+#else
+    sp = SP;
+#endif
+
     /*
      * We should always check the screensize, just in case.
      */
-    _nc_get_screensize(SP, ptrLines(), ptrCols());
+    TINFO_GET_SIZE(sp, termp, ptrLines(sp), ptrCols(sp));
 
     if (errret)
 	*errret = TGETENT_YES;
 
+#ifndef USE_TERM_DRIVER
     if (generic_type) {
 	ret_error(TGETENT_NO, "'%s': I need something more specific.\n", tname);
     }
     if (hard_copy) {
 	ret_error(TGETENT_YES, "'%s': I can't handle hardcopy terminals.\n", tname);
     }
-    returnCode(OK);
+#endif
+    returnCode(code);
 }
 
+#if NCURSES_SP_FUNCS
+/*
+ * In case of handling multiple screens, we need to have a screen before
+ * initialization in setupscreen takes place.  This is to extend the substitute
+ * for some of the stuff in _nc_prescreen, especially for slk and ripoff
+ * handling which should be done per screen.
+ */
+NCURSES_EXPORT(SCREEN *)
+new_prescr(void)
+{
+    static SCREEN *sp;
+
+    START_TRACE();
+    T((T_CALLED("new_prescr()")));
+
+    if (sp == 0) {
+	sp = _nc_alloc_screen_sp();
+	if (sp != 0) {
+	    sp->rsp = sp->rippedoff;
+	    sp->_filtered = _nc_prescreen.filter_mode;
+	    sp->_use_env = _nc_prescreen.use_env;
+#if NCURSES_NO_PADDING
+	    sp->_no_padding = _nc_prescreen._no_padding;
+#endif
+	    sp->slk_format = 0;
+	    sp->_slk = 0;
+	    sp->_prescreen = TRUE;
+	    SP_PRE_INIT(sp);
+#if USE_REENTRANT
+	    sp->_TABSIZE = _nc_prescreen._TABSIZE;
+	    sp->_ESCDELAY = _nc_prescreen._ESCDELAY;
+#endif
+	}
+    }
+    returnSP(sp);
+}
+#endif
+
+#ifdef USE_TERM_DRIVER
+/*
+ * This entrypoint is called from tgetent() to allow a special case of reusing
+ * the same TERMINAL data (see comment).
+ */
+NCURSES_EXPORT(int)
+_nc_setupterm(NCURSES_CONST char *tname,
+	      int Filedes,
+	      int *errret,
+	      bool reuse)
+{
+    int res;
+    TERMINAL *termp;
+    res = TINFO_SETUP_TERM(&termp, tname, Filedes, errret, reuse);
+    if (ERR != res)
+	NCURSES_SP_NAME(set_curterm) (CURRENT_SCREEN_PRE, termp);
+    return res;
+}
+#endif
+
 /*
  *	setupterm(termname, Filedes, errret)
  *
diff -Naur ncurses-5.7.orig/ncurses/tinfo/lib_termcap.c ncurses-5.7/ncurses/tinfo/lib_termcap.c
--- ncurses-5.7.orig/ncurses/tinfo/lib_termcap.c	2008-08-16 15:22:55.000000000 -0400
+++ ncurses-5.7/ncurses/tinfo/lib_termcap.c	2011-01-08 18:18:29.750780851 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2007,2008 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            *
@@ -30,6 +30,7 @@
  *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995               *
  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
  *     and: Thomas E. Dickey                        1996-on                 *
+ *     and: Juergen Pfeifer                                                 *
  *                                                                          *
  * some of the code in here was contributed by:                             *
  * Magnus Bengtsson, d6mbeng@dtek.chalmers.se (Nov'93)                      *
@@ -43,9 +44,11 @@
 #include <tic.h>
 #include <ctype.h>
 
-#include <term_entry.h>
+#ifndef CUR
+#define CUR SP_TERMTYPE
+#endif
 
-MODULE_ID("$Id: lib_termcap.c,v 1.63 2008/08/16 19:22:55 tom Exp $")
+MODULE_ID("$Id: lib_termcap.c,v 1.73 2010/12/25 19:27:12 tom Exp $")
 
 NCURSES_EXPORT_VAR(char *) UP = 0;
 NCURSES_EXPORT_VAR(char *) BC = 0;
@@ -76,16 +79,26 @@
  ***************************************************************************/
 
 NCURSES_EXPORT(int)
-tgetent(char *bufp, const char *name)
+NCURSES_SP_NAME(tgetent) (NCURSES_SP_DCLx char *bufp, const char *name)
 {
-    int errcode;
+    int rc = ERR;
     int n;
     bool found_cache = FALSE;
+#ifdef USE_TERM_DRIVER
+    TERMINAL *termp = 0;
+#endif
 
     START_TRACE();
     T((T_CALLED("tgetent()")));
 
-    _nc_setupterm((NCURSES_CONST char *) name, STDOUT_FILENO, &errcode, TRUE);
+    TINFO_SETUP_TERM(&termp, (NCURSES_CONST char *) name,
+		     STDOUT_FILENO, &rc, TRUE);
+
+#ifdef USE_TERM_DRIVER
+    if (termp == 0 ||
+	!((TERMINAL_CONTROL_BLOCK *) termp)->drv->isTerminfo)
+	return (rc);
+#endif
 
     /*
      * In general we cannot tell if the fixed sgr0 is still used by the
@@ -109,9 +122,9 @@
 	    /*
 	     * Also free the terminfo data that we loaded (much bigger leak).
 	     */
-	    if (LAST_TRM != 0 && LAST_TRM != cur_term) {
+	    if (LAST_TRM != 0 && LAST_TRM != TerminalOf(SP_PARM)) {
 		TERMINAL *trm = LAST_TRM;
-		del_curterm(LAST_TRM);
+		NCURSES_SP_NAME(del_curterm) (NCURSES_SP_ARGx LAST_TRM);
 		for (CacheInx = 0; CacheInx < TGETENT_MAX; ++CacheInx)
 		    if (LAST_TRM == trm)
 			LAST_TRM = 0;
@@ -131,7 +144,7 @@
 	}
 	CacheInx = best;
     }
-    LAST_TRM = cur_term;
+    LAST_TRM = TerminalOf(SP_PARM);
     LAST_SEQ = ++CacheSeq;
 
     PC = 0;
@@ -139,7 +152,7 @@
     BC = 0;
     FIX_SGR0 = 0;		/* don't free it - application may still use */
 
-    if (errcode == 1) {
+    if (rc == 1) {
 
 	if (cursor_left)
 	    if ((backspaces_with_bs = (char) !strcmp(cursor_left, "\b")) == 0)
@@ -153,7 +166,7 @@
 	if (backspace_if_not_bs != NULL)
 	    BC = backspace_if_not_bs;
 
-	if ((FIX_SGR0 = _nc_trim_sgr0(&(cur_term->type))) != 0) {
+	if ((FIX_SGR0 = _nc_trim_sgr0(&(TerminalOf(SP_PARM)->type))) != 0) {
 	    if (!strcmp(FIX_SGR0, exit_attribute_mode)) {
 		if (FIX_SGR0 != exit_attribute_mode) {
 		    free(FIX_SGR0);
@@ -164,8 +177,8 @@
 	LAST_BUF = bufp;
 	LAST_USE = TRUE;
 
-	SetNoPadding(SP);
-	(void) baudrate();	/* sets ospeed as a side-effect */
+	SetNoPadding(SP_PARM);
+	(void) NCURSES_SP_NAME(baudrate) (NCURSES_SP_ARG);	/* sets ospeed as a side-effect */
 
 /* LINT_PREPRO
 #if 0*/
@@ -174,8 +187,27 @@
 #endif*/
 
     }
-    returnCode(errcode);
+    returnCode(rc);
+}
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+tgetent(char *bufp, const char *name)
+{
+    return NCURSES_SP_NAME(tgetent) (CURRENT_SCREEN, bufp, name);
+}
+#endif
+
+#if 0
+static bool
+same_tcname(const char *a, const char *b)
+{
+    fprintf(stderr, "compare(%s,%s)\n", a, b);
+    return !strncmp(a, b, 2);
 }
+#else
+#define same_tcname(a,b) !strncmp(a,b,2)
+#endif
 
 /***************************************************************************
  *
@@ -187,23 +219,47 @@
  ***************************************************************************/
 
 NCURSES_EXPORT(int)
-tgetflag(NCURSES_CONST char *id)
+NCURSES_SP_NAME(tgetflag) (NCURSES_SP_DCLx NCURSES_CONST char *id)
 {
-    unsigned i;
+    int result = 0;		/* Solaris returns zero for missing flag */
+    int i, j;
 
-    T((T_CALLED("tgetflag(%s)"), id));
-    if (cur_term != 0) {
-	TERMTYPE *tp = &(cur_term->type);
-	for_each_boolean(i, tp) {
-	    const char *capname = ExtBoolname(tp, i, boolcodes);
-	    if (!strncmp(id, capname, 2)) {
-		/* setupterm forces invalid booleans to false */
-		returnCode(tp->Booleans[i]);
+    T((T_CALLED("tgetflag(%p, %s)"), (void *) SP_PARM, id));
+    if (HasTInfoTerminal(SP_PARM)) {
+	TERMTYPE *tp = &(TerminalOf(SP_PARM)->type);
+	struct name_table_entry const *entry_ptr;
+
+	entry_ptr = _nc_find_type_entry(id, BOOLEAN, TRUE);
+	if (entry_ptr != 0) {
+	    j = entry_ptr->nte_index;
+	}
+#if NCURSES_XNAMES
+	else {
+	    j = -1;
+	    for_each_ext_boolean(i, tp) {
+		const char *capname = ExtBoolname(tp, i, boolcodes);
+		if (same_tcname(id, capname)) {
+		    j = i;
+		    break;
+		}
 	    }
 	}
+#endif
+	if (j >= 0) {
+	    /* note: setupterm forces invalid booleans to false */
+	    result = tp->Booleans[j];
+	}
     }
-    returnCode(0);		/* Solaris does this */
+    returnCode(result);
+}
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+tgetflag(NCURSES_CONST char *id)
+{
+    return NCURSES_SP_NAME(tgetflag) (CURRENT_SCREEN, id);
 }
+#endif
 
 /***************************************************************************
  *
@@ -215,24 +271,47 @@
  ***************************************************************************/
 
 NCURSES_EXPORT(int)
-tgetnum(NCURSES_CONST char *id)
+NCURSES_SP_NAME(tgetnum) (NCURSES_SP_DCLx NCURSES_CONST char *id)
 {
-    unsigned i;
+    int result = ABSENT_NUMERIC;
+    int i, j;
 
-    T((T_CALLED("tgetnum(%s)"), id));
-    if (cur_term != 0) {
-	TERMTYPE *tp = &(cur_term->type);
-	for_each_number(i, tp) {
-	    const char *capname = ExtNumname(tp, i, numcodes);
-	    if (!strncmp(id, capname, 2)) {
-		if (!VALID_NUMERIC(tp->Numbers[i]))
-		    returnCode(ABSENT_NUMERIC);
-		returnCode(tp->Numbers[i]);
+    T((T_CALLED("tgetnum(%p, %s)"), (void *) SP_PARM, id));
+    if (HasTInfoTerminal(SP_PARM)) {
+	TERMTYPE *tp = &(TerminalOf(SP_PARM)->type);
+	struct name_table_entry const *entry_ptr;
+
+	entry_ptr = _nc_find_type_entry(id, NUMBER, TRUE);
+	if (entry_ptr != 0) {
+	    j = entry_ptr->nte_index;
+	}
+#if NCURSES_XNAMES
+	else {
+	    j = -1;
+	    for_each_ext_number(i, tp) {
+		const char *capname = ExtNumname(tp, i, numcodes);
+		if (same_tcname(id, capname)) {
+		    j = i;
+		    break;
+		}
 	    }
 	}
+#endif
+	if (j >= 0) {
+	    if (VALID_NUMERIC(tp->Numbers[j]))
+		result = tp->Numbers[j];
+	}
     }
-    returnCode(ABSENT_NUMERIC);
+    returnCode(result);
+}
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+tgetnum(NCURSES_CONST char *id)
+{
+    return NCURSES_SP_NAME(tgetnum) (CURRENT_SCREEN, id);
 }
+#endif
 
 /***************************************************************************
  *
@@ -244,40 +323,62 @@
  ***************************************************************************/
 
 NCURSES_EXPORT(char *)
-tgetstr(NCURSES_CONST char *id, char **area)
+NCURSES_SP_NAME(tgetstr) (NCURSES_SP_DCLx NCURSES_CONST char *id, char **area)
 {
-    unsigned i;
     char *result = NULL;
+    int i, j;
 
-    T((T_CALLED("tgetstr(%s,%p)"), id, area));
-    if (cur_term != 0) {
-	TERMTYPE *tp = &(cur_term->type);
-	for_each_string(i, tp) {
-	    const char *capname = ExtStrname(tp, i, strcodes);
-	    if (!strncmp(id, capname, 2)) {
-		result = tp->Strings[i];
-		TR(TRACE_DATABASE, ("found match : %s", _nc_visbuf(result)));
-		/* setupterm forces canceled strings to null */
-		if (VALID_STRING(result)) {
-		    if (result == exit_attribute_mode
-			&& FIX_SGR0 != 0) {
-			result = FIX_SGR0;
-			TR(TRACE_DATABASE, ("altered to : %s", _nc_visbuf(result)));
-		    }
-		    if (area != 0
-			&& *area != 0) {
-			(void) strcpy(*area, result);
-			result = *area;
-			*area += strlen(*area) + 1;
-		    }
+    T((T_CALLED("tgetstr(%s,%p)"), id, (void *) area));
+    if (HasTInfoTerminal(SP_PARM)) {
+	TERMTYPE *tp = &(TerminalOf(SP_PARM)->type);
+	struct name_table_entry const *entry_ptr;
+
+	entry_ptr = _nc_find_type_entry(id, STRING, TRUE);
+	if (entry_ptr != 0) {
+	    j = entry_ptr->nte_index;
+	}
+#if NCURSES_XNAMES
+	else {
+	    j = -1;
+	    for_each_ext_string(i, tp) {
+		const char *capname = ExtStrname(tp, i, strcodes);
+		if (same_tcname(id, capname)) {
+		    j = i;
+		    break;
+		}
+	    }
+	}
+#endif
+	if (j >= 0) {
+	    result = tp->Strings[j];
+	    TR(TRACE_DATABASE, ("found match : %s", _nc_visbuf(result)));
+	    /* setupterm forces canceled strings to null */
+	    if (VALID_STRING(result)) {
+		if (result == exit_attribute_mode
+		    && FIX_SGR0 != 0) {
+		    result = FIX_SGR0;
+		    TR(TRACE_DATABASE, ("altered to : %s", _nc_visbuf(result)));
+		}
+		if (area != 0
+		    && *area != 0) {
+		    (void) strcpy(*area, result);
+		    result = *area;
+		    *area += strlen(*area) + 1;
 		}
-		break;
 	    }
 	}
     }
     returnPtr(result);
 }
 
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(char *)
+tgetstr(NCURSES_CONST char *id, char **area)
+{
+    return NCURSES_SP_NAME(tgetstr) (CURRENT_SCREEN, id, area);
+}
+#endif
+
 #if NO_LEAKS
 NCURSES_EXPORT(void)
 _nc_tgetent_leaks(void)
diff -Naur ncurses-5.7.orig/ncurses/tinfo/lib_termname.c ncurses-5.7/ncurses/tinfo/lib_termname.c
--- ncurses-5.7.orig/ncurses/tinfo/lib_termname.c	2003-12-27 13:23:01.000000000 -0500
+++ ncurses-5.7/ncurses/tinfo/lib_termname.c	2011-01-08 18:13:50.727157241 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2001,2003 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -28,17 +28,31 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_termname.c,v 1.8 2003/12/27 18:23:01 tom Exp $")
+MODULE_ID("$Id: lib_termname.c,v 1.12 2009/10/24 21:56:58 tom Exp $")
 
 NCURSES_EXPORT(char *)
-termname(void)
+NCURSES_SP_NAME(termname) (NCURSES_SP_DCL0)
 {
     char *name = 0;
 
-    T((T_CALLED("termname()")));
+    T((T_CALLED("termname(%p)"), (void *) SP_PARM));
 
+#if NCURSES_SP_FUNCS
+    if (TerminalOf(SP_PARM) != 0) {
+	name = TerminalOf(SP_PARM)->_termname;
+    }
+#else
     if (cur_term != 0)
 	name = cur_term->_termname;
+#endif
 
     returnPtr(name);
 }
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(char *)
+termname(void)
+{
+    return NCURSES_SP_NAME(termname) (CURRENT_SCREEN);
+}
+#endif
diff -Naur ncurses-5.7.orig/ncurses/tinfo/lib_ti.c ncurses-5.7/ncurses/tinfo/lib_ti.c
--- ncurses-5.7.orig/ncurses/tinfo/lib_ti.c	2003-05-24 17:10:28.000000000 -0400
+++ ncurses-5.7/ncurses/tinfo/lib_ti.c	2011-01-08 18:13:50.727157241 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2000,2003 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            *
@@ -29,75 +29,159 @@
 /****************************************************************************
  *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995               *
  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
+ *     and: Thomas E. Dickey                        1996-on                 *
  ****************************************************************************/
 
 #include <curses.priv.h>
 
-#include <term_entry.h>
 #include <tic.h>
 
-MODULE_ID("$Id: lib_ti.c,v 1.23 2003/05/24 21:10:28 tom Exp $")
+MODULE_ID("$Id: lib_ti.c,v 1.29 2010/01/23 17:57:43 tom Exp $")
+
+#if 0
+static bool
+same_name(const char *a, const char *b)
+{
+    fprintf(stderr, "compare(%s,%s)\n", a, b);
+    return !strcmp(a, b);
+}
+#else
+#define same_name(a,b) !strcmp(a,b)
+#endif
 
 NCURSES_EXPORT(int)
-tigetflag(NCURSES_CONST char *str)
+NCURSES_SP_NAME(tigetflag) (NCURSES_SP_DCLx NCURSES_CONST char *str)
 {
-    unsigned i;
+    int result = ABSENT_BOOLEAN;
+    int i, j;
 
-    T((T_CALLED("tigetflag(%s)"), str));
+    T((T_CALLED("tigetflag(%p, %s)"), (void *) SP_PARM, str));
 
-    if (cur_term != 0) {
-	TERMTYPE *tp = &(cur_term->type);
-	for_each_boolean(i, tp) {
-	    const char *capname = ExtBoolname(tp, i, boolnames);
-	    if (!strcmp(str, capname)) {
-		/* setupterm forces invalid booleans to false */
-		returnCode(tp->Booleans[i]);
+    if (HasTInfoTerminal(SP_PARM)) {
+	TERMTYPE *tp = &(TerminalOf(SP_PARM)->type);
+	struct name_table_entry const *entry_ptr;
+
+	entry_ptr = _nc_find_type_entry(str, BOOLEAN, FALSE);
+	if (entry_ptr != 0) {
+	    j = entry_ptr->nte_index;
+	}
+#if NCURSES_XNAMES
+	else {
+	    j = -1;
+	    for_each_ext_boolean(i, tp) {
+		const char *capname = ExtBoolname(tp, i, boolnames);
+		if (same_name(str, capname)) {
+		    j = i;
+		    break;
+		}
 	    }
 	}
+#endif
+	if (j >= 0) {
+	    /* note: setupterm forces invalid booleans to false */
+	    result = tp->Booleans[j];
+	}
     }
 
-    returnCode(ABSENT_BOOLEAN);
+    returnCode(result);
 }
 
+#if NCURSES_SP_FUNCS
 NCURSES_EXPORT(int)
-tigetnum(NCURSES_CONST char *str)
+tigetflag(NCURSES_CONST char *str)
 {
-    unsigned i;
+    return NCURSES_SP_NAME(tigetflag) (CURRENT_SCREEN, str);
+}
+#endif
 
-    T((T_CALLED("tigetnum(%s)"), str));
+NCURSES_EXPORT(int)
+NCURSES_SP_NAME(tigetnum) (NCURSES_SP_DCLx NCURSES_CONST char *str)
+{
+    int i, j;
+    int result = CANCELLED_NUMERIC;	/* Solaris returns a -1 on error */
 
-    if (cur_term != 0) {
-	TERMTYPE *tp = &(cur_term->type);
-	for_each_number(i, tp) {
-	    const char *capname = ExtNumname(tp, i, numnames);
-	    if (!strcmp(str, capname)) {
-		if (!VALID_NUMERIC(tp->Numbers[i]))
-		    returnCode(ABSENT_NUMERIC);
-		returnCode(tp->Numbers[i]);
+    T((T_CALLED("tigetnum(%p, %s)"), (void *) SP_PARM, str));
+
+    if (HasTInfoTerminal(SP_PARM)) {
+	TERMTYPE *tp = &(TerminalOf(SP_PARM)->type);
+	struct name_table_entry const *entry_ptr;
+
+	entry_ptr = _nc_find_type_entry(str, NUMBER, FALSE);
+	if (entry_ptr != 0) {
+	    j = entry_ptr->nte_index;
+	}
+#if NCURSES_XNAMES
+	else {
+	    j = -1;
+	    for_each_ext_number(i, tp) {
+		const char *capname = ExtNumname(tp, i, numnames);
+		if (same_name(str, capname)) {
+		    j = i;
+		    break;
+		}
 	    }
 	}
+#endif
+	if (j >= 0) {
+	    if (VALID_NUMERIC(tp->Numbers[j]))
+		result = tp->Numbers[j];
+	    else
+		result = ABSENT_NUMERIC;
+	}
     }
 
-    returnCode(CANCELLED_NUMERIC);	/* Solaris returns a -1 instead */
+    returnCode(result);
 }
 
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+tigetnum(NCURSES_CONST char *str)
+{
+    return NCURSES_SP_NAME(tigetnum) (CURRENT_SCREEN, str);
+}
+#endif
+
 NCURSES_EXPORT(char *)
-tigetstr(NCURSES_CONST char *str)
+NCURSES_SP_NAME(tigetstr) (NCURSES_SP_DCLx NCURSES_CONST char *str)
 {
-    unsigned i;
+    char *result = CANCELLED_STRING;
+    int i, j;
 
-    T((T_CALLED("tigetstr(%s)"), str));
+    T((T_CALLED("tigetstr(%p, %s)"), (void *) SP_PARM, str));
 
-    if (cur_term != 0) {
-	TERMTYPE *tp = &(cur_term->type);
-	for_each_string(i, tp) {
-	    const char *capname = ExtStrname(tp, i, strnames);
-	    if (!strcmp(str, capname)) {
-		/* setupterm forces cancelled strings to null */
-		returnPtr(tp->Strings[i]);
+    if (HasTInfoTerminal(SP_PARM)) {
+	TERMTYPE *tp = &(TerminalOf(SP_PARM)->type);
+	struct name_table_entry const *entry_ptr;
+
+	entry_ptr = _nc_find_type_entry(str, STRING, FALSE);
+	if (entry_ptr != 0) {
+	    j = entry_ptr->nte_index;
+	}
+#if NCURSES_XNAMES
+	else {
+	    j = -1;
+	    for_each_ext_string(i, tp) {
+		const char *capname = ExtStrname(tp, i, strnames);
+		if (same_name(str, capname)) {
+		    j = i;
+		    break;
+		}
 	    }
 	}
+#endif
+	if (j >= 0) {
+	    /* note: setupterm forces cancelled strings to null */
+	    result = tp->Strings[j];
+	}
     }
 
-    returnPtr(CANCELLED_STRING);
+    returnPtr(result);
+}
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(char *)
+tigetstr(NCURSES_CONST char *str)
+{
+    return NCURSES_SP_NAME(tigetstr) (CURRENT_SCREEN, str);
 }
+#endif
diff -Naur ncurses-5.7.orig/ncurses/tinfo/lib_tparm.c ncurses-5.7/ncurses/tinfo/lib_tparm.c
--- ncurses-5.7.orig/ncurses/tinfo/lib_tparm.c	2008-08-16 15:22:55.000000000 -0400
+++ ncurses-5.7/ncurses/tinfo/lib_tparm.c	2011-01-08 18:18:29.750780851 -0500
@@ -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            *
@@ -40,10 +40,9 @@
 #include <curses.priv.h>
 
 #include <ctype.h>
-#include <term.h>
 #include <tic.h>
 
-MODULE_ID("$Id: lib_tparm.c,v 1.76 2008/08/16 19:22:55 tom Exp $")
+MODULE_ID("$Id: lib_tparm.c,v 1.80 2010/12/25 23:01:29 tom Exp $")
 
 /*
  *	char *
@@ -140,7 +139,7 @@
 {
     size_t s_len = strlen(s);
     if (len > (int) s_len)
-	s_len = len;
+	s_len = (size_t) len;
 
     get_space(s_len + 1);
 
@@ -451,7 +450,7 @@
 }
 
 static NCURSES_INLINE char *
-tparam_internal(const char *string, va_list ap)
+tparam_internal(bool use_TPARM_ARG, const char *string, va_list ap)
 {
     char *p_is_s[NUM_PARM];
     TPARM_ARG param[NUM_PARM];
@@ -489,8 +488,10 @@
 	 */
 	if (p_is_s[i] != 0) {
 	    p_is_s[i] = va_arg(ap, char *);
-	} else {
+	} else if (use_TPARM_ARG) {
 	    param[i] = va_arg(ap, TPARM_ARG);
+	} else {
+	    param[i] = (TPARM_ARG) va_arg(ap, int);
 	}
     }
 
@@ -508,7 +509,7 @@
 	    if (p_is_s[i])
 		spush(p_is_s[i]);
 	    else
-		npush(param[i]);
+		npush((int) param[i]);
 	}
     }
 #ifdef TRACE
@@ -517,7 +518,7 @@
 	    if (p_is_s[i] != 0)
 		save_text(", %s", _nc_visbuf(p_is_s[i]), 0);
 	    else
-		save_number(", %d", param[i], 0);
+		save_number(", %d", (int) param[i], 0);
 	}
 	_tracef(T_CALLED("%s(%s%s)"), TPS(tname), _nc_visbuf(cp), TPS(out_buff));
 	TPS(out_used) = 0;
@@ -564,7 +565,7 @@
 		    if (p_is_s[i])
 			spush(p_is_s[i]);
 		    else
-			npush(param[i]);
+			npush((int) param[i]);
 		}
 		break;
 
@@ -772,7 +773,7 @@
 #ifdef TRACE
     TPS(tname) = "tparm";
 #endif /* TRACE */
-    result = tparam_internal(string, ap);
+    result = tparam_internal(TRUE, string, ap);
     va_end(ap);
     return result;
 }
@@ -793,3 +794,19 @@
     return tparm_varargs(string, a1, a2, a3, a4, a5, a6, a7, a8, a9);
 }
 #endif /* NCURSES_TPARM_VARARGS */
+
+NCURSES_EXPORT(char *)
+tiparm(const char *string,...)
+{
+    va_list ap;
+    char *result;
+
+    _nc_tparm_err = 0;
+    va_start(ap, string);
+#ifdef TRACE
+    TPS(tname) = "tiparm";
+#endif /* TRACE */
+    result = tparam_internal(FALSE, string, ap);
+    va_end(ap);
+    return result;
+}
diff -Naur ncurses-5.7.orig/ncurses/tinfo/lib_tputs.c ncurses-5.7/ncurses/tinfo/lib_tputs.c
--- ncurses-5.7.orig/ncurses/tinfo/lib_tputs.c	2008-06-28 09:12:15.000000000 -0400
+++ ncurses-5.7/ncurses/tinfo/lib_tputs.c	2011-01-08 18:18:29.754781633 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2007,2008 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            *
@@ -30,6 +30,7 @@
  *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995               *
  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
  *     and: Thomas E. Dickey                        1996-on                 *
+ *     and: Juergen Pfeifer                         2009                    *
  ****************************************************************************/
 
 /*
@@ -41,12 +42,16 @@
  */
 
 #include <curses.priv.h>
+
+#ifndef CUR
+#define CUR SP_TERMTYPE
+#endif
+
 #include <ctype.h>
-#include <term.h>		/* padding_baud_rate, xon_xoff */
 #include <termcap.h>		/* ospeed */
 #include <tic.h>
 
-MODULE_ID("$Id: lib_tputs.c,v 1.66 2008/06/28 13:12:15 tom Exp $")
+MODULE_ID("$Id: lib_tputs.c,v 1.81 2010/12/20 00:42:50 tom Exp $")
 
 NCURSES_EXPORT_VAR(char) PC = 0;              /* used by termcap library */
 NCURSES_EXPORT_VAR(NCURSES_OSPEED) ospeed = 0;        /* used by termcap library */
@@ -69,63 +74,136 @@
 }
 #endif
 
-static int (*my_outch) (int c) = _nc_outch;
+#if NCURSES_SP_FUNCS
+#define SetOutCh(func) if (SP_PARM) SP_PARM->_outch = func; else _nc_prescreen._outch = func
+#define GetOutCh()     (SP_PARM ? SP_PARM->_outch : _nc_prescreen._outch)
+#else
+#define SetOutCh(func) static_outch = func
+#define GetOutCh()     static_outch
+static NCURSES_SP_OUTC static_outch = NCURSES_SP_NAME(_nc_outch);
+#endif
 
 NCURSES_EXPORT(int)
-delay_output(int ms)
+NCURSES_SP_NAME(delay_output) (NCURSES_SP_DCLx int ms)
 {
-    T((T_CALLED("delay_output(%d)"), ms));
+    T((T_CALLED("delay_output(%p,%d)"), (void *) SP_PARM, ms));
+
+    if (!HasTInfoTerminal(SP_PARM))
+	returnCode(ERR);
 
     if (no_pad_char) {
-	_nc_flush();
+	NCURSES_SP_NAME(_nc_flush) (NCURSES_SP_ARG);
 	napms(ms);
     } else {
+	NCURSES_SP_OUTC my_outch = GetOutCh();
 	register int nullcount;
 
 	nullcount = (ms * _nc_baudrate(ospeed)) / (BAUDBYTE * 1000);
 	for (_nc_nulls_sent += nullcount; nullcount > 0; nullcount--)
-	    my_outch(PC);
-	if (my_outch == _nc_outch)
-	    _nc_flush();
+	    my_outch(NCURSES_SP_ARGx PC);
+	if (my_outch == NCURSES_SP_NAME(_nc_outch))
+	    NCURSES_SP_NAME(_nc_flush) (NCURSES_SP_ARG);
     }
 
     returnCode(OK);
 }
 
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+delay_output(int ms)
+{
+    return NCURSES_SP_NAME(delay_output) (CURRENT_SCREEN, ms);
+}
+#endif
+
+NCURSES_EXPORT(void)
+NCURSES_SP_NAME(_nc_flush) (NCURSES_SP_DCL0)
+{
+    (void) fflush(NC_OUTPUT(SP_PARM));
+}
+
+#if NCURSES_SP_FUNCS
 NCURSES_EXPORT(void)
 _nc_flush(void)
 {
-    (void) fflush(NC_OUTPUT);
+    NCURSES_SP_NAME(_nc_flush) (CURRENT_SCREEN);
 }
+#endif
 
 NCURSES_EXPORT(int)
-_nc_outch(int ch)
+NCURSES_SP_NAME(_nc_outch) (NCURSES_SP_DCLx int ch)
 {
+    int rc = OK;
+
     COUNT_OUTCHARS(1);
 
-    if (SP != 0
-	&& SP->_cleanup) {
-	char tmp = ch;
+    if (HasTInfoTerminal(SP_PARM)
+	&& SP_PARM != 0
+	&& SP_PARM->_cleanup) {
+	char tmp = (char) ch;
 	/*
 	 * POSIX says write() is safe in a signal handler, but the
 	 * buffered I/O is not.
 	 */
-	write(fileno(NC_OUTPUT), &tmp, 1);
+	if (write(fileno(NC_OUTPUT(SP_PARM)), &tmp, 1) == -1)
+	    rc = ERR;
     } else {
-	putc(ch, NC_OUTPUT);
+	if (putc(ch, NC_OUTPUT(SP_PARM)) == EOF)
+	    rc = ERR;
     }
-    return OK;
+    return rc;
+}
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+_nc_outch(int ch)
+{
+    return NCURSES_SP_NAME(_nc_outch) (CURRENT_SCREEN, ch);
 }
+#endif
 
 NCURSES_EXPORT(int)
+NCURSES_SP_NAME(putp) (NCURSES_SP_DCLx const char *string)
+{
+    return NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx
+				   string, 1, NCURSES_SP_NAME(_nc_outch));
+}
+
+NCURSES_EXPORT(int)
+NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_DCLx
+			   const char *name GCC_UNUSED,
+			   const char *string)
+{
+    int rc = ERR;
+
+    if (string != 0) {
+	TPUTS_TRACE(name);
+	rc = NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx string);
+    }
+    return rc;
+}
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
 putp(const char *string)
 {
-    return tputs(string, 1, _nc_outch);
+    return NCURSES_SP_NAME(putp) (CURRENT_SCREEN, string);
 }
 
 NCURSES_EXPORT(int)
-tputs(const char *string, int affcnt, int (*outc) (int))
+_nc_putp(const char *name, const char *string)
 {
+    return NCURSES_SP_NAME(_nc_putp) (CURRENT_SCREEN, name, string);
+}
+#endif
+
+NCURSES_EXPORT(int)
+NCURSES_SP_NAME(tputs) (NCURSES_SP_DCLx
+			const char *string,
+			int affcnt,
+			NCURSES_SP_OUTC outc)
+{
+    NCURSES_SP_OUTC my_outch = GetOutCh();
     bool always_delay;
     bool normal_delay;
     int number;
@@ -137,7 +215,7 @@
     char addrbuf[32];
 
     if (USE_TRACEF(TRACE_TPUTS)) {
-	if (outc == _nc_outch)
+	if (outc == NCURSES_SP_NAME(_nc_outch))
 	    (void) strcpy(addrbuf, "_nc_outch");
 	else
 	    (void) sprintf(addrbuf, "%p", outc);
@@ -152,10 +230,19 @@
     }
 #endif /* TRACE */
 
+    if (SP_PARM != 0 && !HasTInfoTerminal(SP_PARM))
+	return ERR;
+
     if (!VALID_STRING(string))
 	return ERR;
 
-    if (cur_term == 0) {
+    if (
+#if NCURSES_SP_FUNCS
+	   (SP_PARM != 0 && SP_PARM->_term == 0)
+#else
+	   cur_term == 0
+#endif
+	) {
 	always_delay = FALSE;
 	normal_delay = TRUE;
     } else {
@@ -164,7 +251,7 @@
 	    !xon_xoff
 	    && padding_baud_rate
 #if NCURSES_NO_PADDING
-	    && !GetNoPadding(SP)
+	    && !GetNoPadding(SP_PARM)
 #endif
 	    && (_nc_baudrate(ospeed) >= padding_baud_rate);
     }
@@ -198,24 +285,24 @@
     }
 #endif /* BSD_TPUTS */
 
-    my_outch = outc;		/* redirect delay_output() */
+    SetOutCh(outc);		/* redirect delay_output() */
     while (*string) {
 	if (*string != '$')
-	    (*outc) (*string);
+	    (*outc) (NCURSES_SP_ARGx *string);
 	else {
 	    string++;
 	    if (*string != '<') {
-		(*outc) ('$');
+		(*outc) (NCURSES_SP_ARGx '$');
 		if (*string)
-		    (*outc) (*string);
+		    (*outc) (NCURSES_SP_ARGx *string);
 	    } else {
 		bool mandatory;
 
 		string++;
 		if ((!isdigit(UChar(*string)) && *string != '.')
 		    || !strchr(string, '>')) {
-		    (*outc) ('$');
-		    (*outc) ('<');
+		    (*outc) (NCURSES_SP_ARGx '$');
+		    (*outc) (NCURSES_SP_ARGx '<');
 		    continue;
 		}
 
@@ -250,7 +337,7 @@
 		    && (always_delay
 			|| normal_delay
 			|| mandatory))
-		    delay_output(number / 10);
+		    NCURSES_SP_NAME(delay_output) (NCURSES_SP_ARGx number / 10);
 
 	    }			/* endelse (*string == '<') */
 	}			/* endelse (*string == '$') */
@@ -270,6 +357,25 @@
 	delay_output(trailpad / 10);
 #endif /* BSD_TPUTS */
 
-    my_outch = _nc_outch;
+    SetOutCh(my_outch);
     return OK;
 }
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+_nc_outc_wrapper(SCREEN *sp, int c)
+{
+    if (0 == sp) {
+	return (ERR);
+    } else {
+	return sp->jump(c);
+    }
+}
+
+NCURSES_EXPORT(int)
+tputs(const char *string, int affcnt, int (*outc) (int))
+{
+    SetSafeOutcWrapper(outc);
+    return NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx string, affcnt, _nc_outc_wrapper);
+}
+#endif
diff -Naur ncurses-5.7.orig/ncurses/tinfo/lib_ttyflags.c ncurses-5.7/ncurses/tinfo/lib_ttyflags.c
--- ncurses-5.7.orig/ncurses/tinfo/lib_ttyflags.c	2008-08-03 18:10:44.000000000 -0400
+++ ncurses-5.7/ncurses/tinfo/lib_ttyflags.c	2011-01-08 18:18:29.754781633 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2007,2008 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            *
@@ -36,159 +36,246 @@
  */
 
 #include <curses.priv.h>
-#include <term.h>		/* cur_term */
 
-MODULE_ID("$Id: lib_ttyflags.c,v 1.18 2008/08/03 22:10:44 tom Exp $")
+#ifndef CUR
+#define CUR SP_TERMTYPE
+#endif
+
+MODULE_ID("$Id: lib_ttyflags.c,v 1.27 2010/12/25 23:43:58 tom Exp $")
 
 NCURSES_EXPORT(int)
-_nc_get_tty_mode(TTY * buf)
+NCURSES_SP_NAME(_nc_get_tty_mode) (NCURSES_SP_DCLx TTY * buf)
 {
     int result = OK;
 
-    if (buf == 0) {
+    if (buf == 0 || SP_PARM == 0) {
 	result = ERR;
     } else {
-	if (cur_term == 0) {
+	TERMINAL *termp = TerminalOf(SP_PARM);
+
+	if (0 == termp) {
 	    result = ERR;
 	} else {
+#ifdef USE_TERM_DRIVER
+	    result = CallDriver_2(SP_PARM, sgmode, FALSE, buf);
+#else
 	    for (;;) {
-		if (GET_TTY(cur_term->Filedes, buf) != 0) {
+		if (GET_TTY(termp->Filedes, buf) != 0) {
 		    if (errno == EINTR)
 			continue;
 		    result = ERR;
 		}
 		break;
 	    }
+#endif
 	}
 
 	if (result == ERR)
 	    memset(buf, 0, sizeof(*buf));
 
 	TR(TRACE_BITS, ("_nc_get_tty_mode(%d): %s",
-			cur_term ? cur_term->Filedes : -1,
+			termp ? termp->Filedes : -1,
 			_nc_trace_ttymode(buf)));
     }
     return (result);
 }
 
+#if NCURSES_SP_FUNCS
 NCURSES_EXPORT(int)
-_nc_set_tty_mode(TTY * buf)
+_nc_get_tty_mode(TTY * buf)
+{
+    return NCURSES_SP_NAME(_nc_get_tty_mode) (CURRENT_SCREEN, buf);
+}
+#endif
+
+NCURSES_EXPORT(int)
+NCURSES_SP_NAME(_nc_set_tty_mode) (NCURSES_SP_DCLx TTY * buf)
 {
     int result = OK;
 
-    if (buf == 0) {
+    if (buf == 0 || SP_PARM == 0) {
 	result = ERR;
     } else {
-	if (cur_term == 0) {
+	TERMINAL *termp = TerminalOf(SP_PARM);
+
+	if (0 == termp) {
 	    result = ERR;
 	} else {
+#ifdef USE_TERM_DRIVER
+	    result = CallDriver_2(SP_PARM, sgmode, TRUE, buf);
+#else
 	    for (;;) {
-		if (SET_TTY(cur_term->Filedes, buf) != 0) {
+		if (SET_TTY(termp->Filedes, buf) != 0) {
 		    if (errno == EINTR)
 			continue;
-		    if ((errno == ENOTTY) && (SP != 0))
-			SP->_notty = TRUE;
+		    if ((errno == ENOTTY) && (SP_PARM != 0))
+			SP_PARM->_notty = TRUE;
 		    result = ERR;
 		}
 		break;
 	    }
+#endif
 	}
 	TR(TRACE_BITS, ("_nc_set_tty_mode(%d): %s",
-			cur_term ? cur_term->Filedes : -1,
+			termp ? termp->Filedes : -1,
 			_nc_trace_ttymode(buf)));
     }
     return (result);
 }
 
+#if NCURSES_SP_FUNCS
 NCURSES_EXPORT(int)
-def_shell_mode(void)
+_nc_set_tty_mode(TTY * buf)
+{
+    return NCURSES_SP_NAME(_nc_set_tty_mode) (CURRENT_SCREEN, buf);
+}
+#endif
+
+NCURSES_EXPORT(int)
+NCURSES_SP_NAME(def_shell_mode) (NCURSES_SP_DCL0)
 {
     int rc = ERR;
+    TERMINAL *termp = TerminalOf(SP_PARM);
 
-    T((T_CALLED("def_shell_mode()")));
+    T((T_CALLED("def_shell_mode(%p)"), (void *) SP_PARM));
 
-    if (cur_term != 0) {
+    if (termp != 0) {
+#ifdef USE_TERM_DRIVER
+	rc = CallDriver_2(SP_PARM, mode, FALSE, TRUE);
+#else
 	/*
 	 * If XTABS was on, remove the tab and backtab capabilities.
 	 */
-	if (_nc_get_tty_mode(&cur_term->Ottyb) == OK) {
+	if (_nc_get_tty_mode(&termp->Ottyb) == OK) {
 #ifdef TERMIOS
-	    if (cur_term->Ottyb.c_oflag & OFLAGS_TABS)
+	    if (termp->Ottyb.c_oflag & OFLAGS_TABS)
 		tab = back_tab = NULL;
 #else
-	    if (cur_term->Ottyb.sg_flags & XTABS)
+	    if (termp->Ottyb.sg_flags & XTABS)
 		tab = back_tab = NULL;
 #endif
 	    rc = OK;
 	}
+#endif
     }
     returnCode(rc);
 }
 
+#if NCURSES_SP_FUNCS
 NCURSES_EXPORT(int)
-def_prog_mode(void)
+def_shell_mode(void)
+{
+    return NCURSES_SP_NAME(def_shell_mode) (CURRENT_SCREEN);
+}
+#endif
+
+NCURSES_EXPORT(int)
+NCURSES_SP_NAME(def_prog_mode) (NCURSES_SP_DCL0)
 {
     int rc = ERR;
+    TERMINAL *termp = TerminalOf(SP_PARM);
 
-    T((T_CALLED("def_prog_mode()")));
+    T((T_CALLED("def_prog_mode(%p)"), (void *) SP_PARM));
 
-    if (cur_term != 0) {
+    if (termp != 0) {
+#ifdef USE_TERM_DRIVER
+	rc = CallDriver_2(SP_PARM, mode, TRUE, TRUE);
+#else
 	/*
 	 * Turn off the XTABS bit in the tty structure if it was on.
 	 */
-	if (_nc_get_tty_mode(&cur_term->Nttyb) == OK) {
+	if (_nc_get_tty_mode(&termp->Nttyb) == OK) {
 #ifdef TERMIOS
-	    cur_term->Nttyb.c_oflag &= ~OFLAGS_TABS;
+	    termp->Nttyb.c_oflag &= (unsigned) (~OFLAGS_TABS);
 #else
-	    cur_term->Nttyb.sg_flags &= ~XTABS;
+	    termp->Nttyb.sg_flags &= (unsigned) (~XTABS);
 #endif
 	    rc = OK;
 	}
+#endif
     }
     returnCode(rc);
 }
 
+#if NCURSES_SP_FUNCS
 NCURSES_EXPORT(int)
-reset_prog_mode(void)
+def_prog_mode(void)
 {
-    T((T_CALLED("reset_prog_mode()")));
+    return NCURSES_SP_NAME(def_prog_mode) (CURRENT_SCREEN);
+}
+#endif
 
-    if (cur_term != 0) {
-	if (_nc_set_tty_mode(&cur_term->Nttyb) == OK) {
-	    if (SP) {
-		if (SP->_keypad_on)
-		    _nc_keypad(SP, TRUE);
-		NC_BUFFERED(TRUE);
+NCURSES_EXPORT(int)
+NCURSES_SP_NAME(reset_prog_mode) (NCURSES_SP_DCL0)
+{
+    int rc = ERR;
+    TERMINAL *termp = TerminalOf(SP_PARM);
+
+    T((T_CALLED("reset_prog_mode(%p)"), (void *) SP_PARM));
+
+    if (termp != 0) {
+#ifdef USE_TERM_DRIVER
+	rc = CallDriver_2(SP_PARM, mode, TRUE, FALSE);
+#else
+	if (_nc_set_tty_mode(&termp->Nttyb) == OK) {
+	    if (SP_PARM) {
+		if (SP_PARM->_keypad_on)
+		    _nc_keypad(SP_PARM, TRUE);
+		NC_BUFFERED(SP_PARM, TRUE);
 	    }
-	    returnCode(OK);
+	    rc = OK;
 	}
+#endif
     }
-    returnCode(ERR);
+    returnCode(rc);
 }
 
+#if NCURSES_SP_FUNCS
 NCURSES_EXPORT(int)
-reset_shell_mode(void)
+reset_prog_mode(void)
 {
-    T((T_CALLED("reset_shell_mode()")));
+    return NCURSES_SP_NAME(reset_prog_mode) (CURRENT_SCREEN);
+}
+#endif
 
-    if (cur_term != 0) {
-	if (SP) {
-	    _nc_keypad(SP, FALSE);
+NCURSES_EXPORT(int)
+NCURSES_SP_NAME(reset_shell_mode) (NCURSES_SP_DCL0)
+{
+    int rc = ERR;
+    TERMINAL *termp = TerminalOf(SP_PARM);
+
+    T((T_CALLED("reset_shell_mode(%p)"), (void *) SP_PARM));
+
+    if (termp != 0) {
+#ifdef USE_TERM_DRIVER
+	rc = CallDriver_2(SP_PARM, mode, FALSE, FALSE);
+#else
+	if (SP_PARM) {
+	    _nc_keypad(SP_PARM, FALSE);
 	    _nc_flush();
-	    NC_BUFFERED(FALSE);
+	    NC_BUFFERED(SP_PARM, FALSE);
 	}
-	returnCode(_nc_set_tty_mode(&cur_term->Ottyb));
+	rc = _nc_set_tty_mode(&termp->Ottyb);
+#endif
     }
-    returnCode(ERR);
+    returnCode(rc);
 }
 
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+reset_shell_mode(void)
+{
+    return NCURSES_SP_NAME(reset_shell_mode) (CURRENT_SCREEN);
+}
+#endif
+
 static TTY *
-saved_tty(void)
+saved_tty(NCURSES_SP_DCL0)
 {
     TTY *result = 0;
 
-    if (SP != 0) {
-	result = &(SP->_saved_tty);
+    if (SP_PARM != 0) {
+	result = (TTY *) & (SP_PARM->_saved_tty);
     } else {
 	if (_nc_prescreen.saved_tty == 0) {
 	    _nc_prescreen.saved_tty = typeCalloc(TTY, 1);
@@ -204,17 +291,31 @@
 */
 
 NCURSES_EXPORT(int)
+NCURSES_SP_NAME(savetty) (NCURSES_SP_DCL0)
+{
+    T((T_CALLED("savetty(%p)"), (void *) SP_PARM));
+    returnCode(NCURSES_SP_NAME(_nc_get_tty_mode) (NCURSES_SP_ARGx saved_tty(NCURSES_SP_ARG)));
+}
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
 savetty(void)
 {
-    T((T_CALLED("savetty()")));
+    return NCURSES_SP_NAME(savetty) (CURRENT_SCREEN);
+}
+#endif
 
-    returnCode(_nc_get_tty_mode(saved_tty()));
+NCURSES_EXPORT(int)
+NCURSES_SP_NAME(resetty) (NCURSES_SP_DCL0)
+{
+    T((T_CALLED("resetty(%p)"), (void *) SP_PARM));
+    returnCode(NCURSES_SP_NAME(_nc_set_tty_mode) (NCURSES_SP_ARGx saved_tty(NCURSES_SP_ARG)));
 }
 
+#if NCURSES_SP_FUNCS
 NCURSES_EXPORT(int)
 resetty(void)
 {
-    T((T_CALLED("resetty()")));
-
-    returnCode(_nc_set_tty_mode(saved_tty()));
+    return NCURSES_SP_NAME(resetty) (CURRENT_SCREEN);
 }
+#endif
diff -Naur ncurses-5.7.orig/ncurses/tinfo/make_hash.c ncurses-5.7/ncurses/tinfo/make_hash.c
--- ncurses-5.7.orig/ncurses/tinfo/make_hash.c	1969-12-31 19:00:00.000000000 -0500
+++ ncurses-5.7/ncurses/tinfo/make_hash.c	2011-01-08 18:13:50.731156938 -0500
@@ -0,0 +1,294 @@
+/****************************************************************************
+ * 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            *
+ * "Software"), to deal in the Software without restriction, including      *
+ * without limitation the rights to use, copy, modify, merge, publish,      *
+ * distribute, distribute with modifications, sublicense, and/or sell       *
+ * copies of the Software, and to permit persons to whom the Software is    *
+ * furnished to do so, subject to the following conditions:                 *
+ *                                                                          *
+ * The above copyright notice and this permission notice shall be included  *
+ * in all copies or substantial portions of the Software.                   *
+ *                                                                          *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
+ *                                                                          *
+ * Except as contained in this notice, the name(s) of the above copyright   *
+ * holders shall not be used in advertising or otherwise to promote the     *
+ * sale, use or other dealings in this Software without prior written       *
+ * authorization.                                                           *
+ ****************************************************************************/
+
+/****************************************************************************
+ *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995               *
+ *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
+ *     and: Thomas E. Dickey                        1996-on                 *
+ ****************************************************************************/
+
+/*
+ *	make_hash.c --- build-time program for constructing comp_captab.c
+ *
+ */
+
+#include <build.priv.h>
+
+#include <tic.h>
+#include <hashsize.h>
+
+#include <ctype.h>
+
+MODULE_ID("$Id: make_hash.c,v 1.3 2010/05/22 18:02:50 tom Exp $")
+
+/*
+ *	_nc_make_hash_table()
+ *
+ *	Takes the entries in table[] and hashes them into hash_table[]
+ *	by name.  There are CAPTABSIZE entries in table[] and HASHTABSIZE
+ *	slots in hash_table[].
+ *
+ */
+
+#undef MODULE_ID
+#define MODULE_ID(id)		/*nothing */
+#include <tinfo/doalloc.c>
+
+/*
+ *	int hash_function(string)
+ *
+ *	Computes the hashing function on the given string.
+ *
+ *	The current hash function is the sum of each consectutive pair
+ *	of characters, taken as two-byte integers, mod HASHTABSIZE.
+ *
+ */
+
+static int
+hash_function(const char *string)
+{
+    long sum = 0;
+
+    while (*string) {
+	sum += (long) (*string + (*(string + 1) << 8));
+	string++;
+    }
+
+    return (int) (sum % HASHTABSIZE);
+}
+
+static void
+_nc_make_hash_table(struct name_table_entry *table,
+		    HashValue * hash_table)
+{
+    short i;
+    int hashvalue;
+    int collisions = 0;
+
+    for (i = 0; i < HASHTABSIZE; i++) {
+	hash_table[i] = -1;
+    }
+    for (i = 0; i < CAPTABSIZE; i++) {
+	hashvalue = hash_function(table[i].nte_name);
+
+	if (hash_table[hashvalue] >= 0)
+	    collisions++;
+
+	if (hash_table[hashvalue] != 0)
+	    table[i].nte_link = hash_table[hashvalue];
+	hash_table[hashvalue] = i;
+    }
+
+    printf("/* %d collisions out of %d entries */\n", collisions, CAPTABSIZE);
+}
+
+/*
+ * This filter reads from standard input a list of tab-delimited columns,
+ * (e.g., from Caps.filtered) computes the hash-value of a specified column and
+ * writes the hashed tables to standard output.
+ *
+ * By compiling the hash table at build time, we're able to make the entire
+ * set of terminfo and termcap tables readonly (and also provide some runtime
+ * performance enhancement).
+ */
+
+#define MAX_COLUMNS BUFSIZ	/* this _has_ to be worst-case */
+
+static char **
+parse_columns(char *buffer)
+{
+    static char **list;
+
+    int col = 0;
+
+    if (list == 0 && (list = typeCalloc(char *, MAX_COLUMNS)) == 0)
+	  return (0);
+
+    if (*buffer != '#') {
+	while (*buffer != '\0') {
+	    char *s;
+	    for (s = buffer; (*s != '\0') && !isspace(UChar(*s)); s++)
+		/*EMPTY */ ;
+	    if (s != buffer) {
+		char mark = *s;
+		*s = '\0';
+		if ((s - buffer) > 1
+		    && (*buffer == '"')
+		    && (s[-1] == '"')) {	/* strip the quotes */
+		    assert(s > buffer + 1);
+		    s[-1] = '\0';
+		    buffer++;
+		}
+		list[col] = buffer;
+		col++;
+		if (mark == '\0')
+		    break;
+		while (*++s && isspace(UChar(*s)))
+		    /*EMPTY */ ;
+		buffer = s;
+	    } else
+		break;
+	}
+    }
+    return col ? list : 0;
+}
+
+int
+main(int argc, char **argv)
+{
+    struct name_table_entry *name_table = typeCalloc(struct
+						     name_table_entry, CAPTABSIZE);
+    HashValue *hash_table = typeCalloc(HashValue, HASHTABSIZE);
+    const char *root_name = "";
+    int column = 0;
+    int bigstring = 0;
+    int n;
+    char buffer[BUFSIZ];
+
+    static const char *typenames[] =
+    {"BOOLEAN", "NUMBER", "STRING"};
+
+    short BoolCount = 0;
+    short NumCount = 0;
+    short StrCount = 0;
+
+    /* The first argument is the column-number (starting with 0).
+     * The second is the root name of the tables to generate.
+     */
+    if (argc <= 3
+	|| (column = atoi(argv[1])) <= 0
+	|| (column >= MAX_COLUMNS)
+	|| *(root_name = argv[2]) == 0
+	|| (bigstring = atoi(argv[3])) < 0
+	|| name_table == 0
+	|| hash_table == 0) {
+	fprintf(stderr, "usage: make_hash column root_name bigstring\n");
+	exit(EXIT_FAILURE);
+    }
+
+    /*
+     * Read the table into our arrays.
+     */
+    for (n = 0; (n < CAPTABSIZE) && fgets(buffer, BUFSIZ, stdin);) {
+	char **list, *nlp = strchr(buffer, '\n');
+	if (nlp)
+	    *nlp = '\0';
+	list = parse_columns(buffer);
+	if (list == 0)		/* blank or comment */
+	    continue;
+	name_table[n].nte_link = -1;	/* end-of-hash */
+	name_table[n].nte_name = strdup(list[column]);
+	if (!strcmp(list[2], "bool")) {
+	    name_table[n].nte_type = BOOLEAN;
+	    name_table[n].nte_index = BoolCount++;
+	} else if (!strcmp(list[2], "num")) {
+	    name_table[n].nte_type = NUMBER;
+	    name_table[n].nte_index = NumCount++;
+	} else if (!strcmp(list[2], "str")) {
+	    name_table[n].nte_type = STRING;
+	    name_table[n].nte_index = StrCount++;
+	} else {
+	    fprintf(stderr, "Unknown type: %s\n", list[2]);
+	    exit(EXIT_FAILURE);
+	}
+	n++;
+    }
+    _nc_make_hash_table(name_table, hash_table);
+
+    /*
+     * Write the compiled tables to standard output
+     */
+    if (bigstring) {
+	int len = 0;
+	int nxt;
+
+	printf("static const char %s_names_text[] = \\\n", root_name);
+	for (n = 0; n < CAPTABSIZE; n++) {
+	    nxt = (int) strlen(name_table[n].nte_name) + 5;
+	    if (nxt + len > 72) {
+		printf("\\\n");
+		len = 0;
+	    }
+	    printf("\"%s\\0\" ", name_table[n].nte_name);
+	    len += nxt;
+	}
+	printf(";\n\n");
+
+	len = 0;
+	printf("static name_table_data const %s_names_data[] =\n",
+	       root_name);
+	printf("{\n");
+	for (n = 0; n < CAPTABSIZE; n++) {
+	    printf("\t{ %15d,\t%10s,\t%3d, %3d }%c\n",
+		   len,
+		   typenames[name_table[n].nte_type],
+		   name_table[n].nte_index,
+		   name_table[n].nte_link,
+		   n < CAPTABSIZE - 1 ? ',' : ' ');
+	    len += (int) strlen(name_table[n].nte_name) + 1;
+	}
+	printf("};\n\n");
+	printf("static struct name_table_entry *_nc_%s_table = 0;\n\n", root_name);
+    } else {
+
+	printf("static struct name_table_entry %s _nc_%s_table[] =\n",
+	       bigstring ? "" : "const",
+	       root_name);
+	printf("{\n");
+	for (n = 0; n < CAPTABSIZE; n++) {
+	    sprintf(buffer, "\"%s\"",
+		    name_table[n].nte_name);
+	    printf("\t{ %15s,\t%10s,\t%3d, %3d }%c\n",
+		   buffer,
+		   typenames[name_table[n].nte_type],
+		   name_table[n].nte_index,
+		   name_table[n].nte_link,
+		   n < CAPTABSIZE - 1 ? ',' : ' ');
+	}
+	printf("};\n\n");
+    }
+
+    printf("static const HashValue _nc_%s_hash_table[%d] =\n",
+	   root_name,
+	   HASHTABSIZE + 1);
+    printf("{\n");
+    for (n = 0; n < HASHTABSIZE; n++) {
+	printf("\t%3d,\n", hash_table[n]);
+    }
+    printf("\t0\t/* base-of-table */\n");
+    printf("};\n\n");
+
+    printf("#if (BOOLCOUNT!=%d)||(NUMCOUNT!=%d)||(STRCOUNT!=%d)\n",
+	   BoolCount, NumCount, StrCount);
+    printf("#error\t--> term.h and comp_captab.c disagree about the <--\n");
+    printf("#error\t--> numbers of booleans, numbers and/or strings <--\n");
+    printf("#endif\n\n");
+
+    free(hash_table);
+    return EXIT_SUCCESS;
+}
diff -Naur ncurses-5.7.orig/ncurses/tinfo/make_keys.c ncurses-5.7/ncurses/tinfo/make_keys.c
--- ncurses-5.7.orig/ncurses/tinfo/make_keys.c	2008-08-03 17:57:22.000000000 -0400
+++ ncurses-5.7/ncurses/tinfo/make_keys.c	2011-01-08 18:13:50.731156938 -0500
@@ -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            *
@@ -37,18 +37,18 @@
  */
 
 #define USE_TERMLIB 1
-#include <curses.priv.h>
+#include <build.priv.h>
 
-MODULE_ID("$Id: make_keys.c,v 1.14 2008/08/03 21:57:22 tom Exp $")
+MODULE_ID("$Id: make_keys.c,v 1.19 2010/06/05 22:08:00 tom Exp $")
 
 #include <names.c>
 
-#define UNKNOWN (SIZEOF(strnames) + SIZEOF(strfnames))
+#define UNKNOWN (unsigned) (SIZEOF(strnames) + SIZEOF(strfnames))
 
-static size_t
+static unsigned
 lookup(const char *name)
 {
-    size_t n;
+    unsigned n;
     bool found = FALSE;
     for (n = 0; strnames[n] != 0; n++) {
 	if (!strcmp(name, strnames[n])) {
@@ -73,7 +73,7 @@
     char buffer[BUFSIZ];
     char from[256];
     char to[256];
-    int maxlen = 16;
+    unsigned maxlen = 16;
     int scanned;
 
     while (fgets(buffer, sizeof(buffer), ifp) != 0) {
@@ -85,14 +85,14 @@
 
 	scanned = sscanf(buffer, "%255s %255s", to, from);
 	if (scanned == 2) {
-	    int code = lookup(from);
+	    unsigned code = lookup(from);
 	    if (code == UNKNOWN)
 		continue;
-	    if ((int) strlen(from) > maxlen)
-		maxlen = strlen(from);
-	    fprintf(ofp, "\t{ %4d, %-*.*s },\t/* %s */\n",
+	    if (strlen(from) > maxlen)
+		maxlen = (unsigned) strlen(from);
+	    fprintf(ofp, "\t{ %4u, %-*.*s },\t/* %s */\n",
 		    code,
-		    maxlen, maxlen,
+		    (int) maxlen, (int) maxlen,
 		    to,
 		    from);
 	}
diff -Naur ncurses-5.7.orig/ncurses/tinfo/name_match.c ncurses-5.7/ncurses/tinfo/name_match.c
--- ncurses-5.7.orig/ncurses/tinfo/name_match.c	2008-08-03 15:49:33.000000000 -0400
+++ ncurses-5.7/ncurses/tinfo/name_match.c	2011-01-08 18:13:50.735157022 -0500
@@ -31,10 +31,9 @@
  ****************************************************************************/
 
 #include <curses.priv.h>
-#include <term.h>
 #include <tic.h>
 
-MODULE_ID("$Id: name_match.c,v 1.17 2008/08/03 19:49:33 tom Exp $")
+MODULE_ID("$Id: name_match.c,v 1.18 2008/11/16 00:19:59 juergen Exp $")
 
 /*
  *	_nc_first_name(char *names)
diff -Naur ncurses-5.7.orig/ncurses/tinfo/parse_entry.c ncurses-5.7/ncurses/tinfo/parse_entry.c
--- ncurses-5.7.orig/ncurses/tinfo/parse_entry.c	2008-08-16 17:52:03.000000000 -0400
+++ ncurses-5.7/ncurses/tinfo/parse_entry.c	2011-01-08 18:13:50.735157022 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2007,2008 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            *
@@ -46,9 +46,8 @@
 
 #include <ctype.h>
 #include <tic.h>
-#include <term_entry.h>
 
-MODULE_ID("$Id: parse_entry.c,v 1.69 2008/08/16 21:52:03 tom Exp $")
+MODULE_ID("$Id: parse_entry.c,v 1.75 2010/05/01 19:35:09 tom Exp $")
 
 #ifdef LINT
 static short const parametrized[] =
@@ -84,13 +83,13 @@
     case NUMBER:
 	first = tp->ext_Booleans;
 	last = tp->ext_Numbers + first;
-	offset = tp->ext_Booleans + tp->ext_Numbers;
+	offset = (unsigned) (tp->ext_Booleans + tp->ext_Numbers);
 	tindex = tp->num_Numbers;
 	break;
     case STRING:
-	first = tp->ext_Booleans + tp->ext_Numbers;
+	first = (unsigned) (tp->ext_Booleans + tp->ext_Numbers);
 	last = tp->ext_Strings + first;
-	offset = tp->ext_Booleans + tp->ext_Numbers + tp->ext_Strings;
+	offset = (unsigned) (tp->ext_Booleans + tp->ext_Numbers + tp->ext_Strings);
 	tindex = tp->num_Strings;
 	break;
     case CANCEL:
@@ -137,27 +136,31 @@
 	    break;
 	}
     }
+
+#define for_each_value(max) \
+	for (last = (unsigned) (max - 1); last > tindex; last--)
+
     if (!found) {
 	switch (token_type) {
 	case BOOLEAN:
-	    tp->ext_Booleans += 1;
-	    tp->num_Booleans += 1;
+	    tp->ext_Booleans++;
+	    tp->num_Booleans++;
 	    tp->Booleans = typeRealloc(NCURSES_SBOOL, tp->num_Booleans, tp->Booleans);
-	    for (last = tp->num_Booleans - 1; last > tindex; last--)
+	    for_each_value(tp->num_Booleans)
 		tp->Booleans[last] = tp->Booleans[last - 1];
 	    break;
 	case NUMBER:
-	    tp->ext_Numbers += 1;
-	    tp->num_Numbers += 1;
+	    tp->ext_Numbers++;
+	    tp->num_Numbers++;
 	    tp->Numbers = typeRealloc(short, tp->num_Numbers, tp->Numbers);
-	    for (last = tp->num_Numbers - 1; last > tindex; last--)
+	    for_each_value(tp->num_Numbers)
 		tp->Numbers[last] = tp->Numbers[last - 1];
 	    break;
 	case STRING:
-	    tp->ext_Strings += 1;
-	    tp->num_Strings += 1;
+	    tp->ext_Strings++;
+	    tp->num_Strings++;
 	    tp->Strings = typeRealloc(char *, tp->num_Strings, tp->Strings);
-	    for (last = tp->num_Strings - 1; last > tindex; last--)
+	    for_each_value(tp->num_Strings)
 		tp->Strings[last] = tp->Strings[last - 1];
 	    break;
 	}
@@ -170,7 +173,7 @@
 
     temp.nte_name = tp->ext_Names[offset];
     temp.nte_type = token_type;
-    temp.nte_index = tindex;
+    temp.nte_index = (short) tindex;
     temp.nte_link = -1;
 
     return &temp;
@@ -379,16 +382,14 @@
 		    && !strcmp("ma", _nc_curr_token.tk_name)) {
 		    /* tell max_attributes from arrow_key_map */
 		    entry_ptr = _nc_find_type_entry("ma", NUMBER,
-						    _nc_get_table(_nc_syntax
-								  != 0));
+						    _nc_syntax != 0);
 		    assert(entry_ptr != 0);
 
 		} else if (token_type == STRING
 			   && !strcmp("MT", _nc_curr_token.tk_name)) {
 		    /* map terminfo's string MT to MT */
 		    entry_ptr = _nc_find_type_entry("MT", STRING,
-						    _nc_get_table(_nc_syntax
-								  != 0));
+						    _nc_syntax != 0);
 		    assert(entry_ptr != 0);
 
 		} else if (token_type == BOOLEAN
@@ -444,7 +445,7 @@
 
 	    case NUMBER:
 		entryp->tterm.Numbers[entry_ptr->nte_index] =
-		    _nc_curr_token.tk_valnumber;
+		    (short) _nc_curr_token.tk_valnumber;
 		break;
 
 	    case STRING:
@@ -510,9 +511,9 @@
 _nc_capcmp(const char *s, const char *t)
 /* compare two string capabilities, stripping out padding */
 {
-    if (!s && !t)
+    if (!VALID_STRING(s) && !VALID_STRING(t))
 	return (0);
-    else if (!s || !t)
+    else if (!VALID_STRING(s) || !VALID_STRING(t))
 	return (1);
 
     for (;;) {
@@ -667,7 +668,7 @@
 	    else if (PRESENT(backspace_if_not_bs))
 		cursor_left = backspace_if_not_bs;
 	}
-	/* vi doesn't use "do", but it does seems to use nl (or '\n') instead */
+	/* vi doesn't use "do", but it does seem to use nl (or '\n') instead */
 	if (WANTED(cursor_down)) {
 	    if (PRESENT(linefeed_if_not_lf))
 		cursor_down = linefeed_if_not_lf;
@@ -772,7 +773,7 @@
      * isn't from mytinfo...
      */
     if (PRESENT(other_non_function_keys)) {
-	char *base = other_non_function_keys;
+	char *base;
 	char *bp, *cp, *dp;
 	struct name_table_entry const *from_ptr;
 	struct name_table_entry const *to_ptr;
@@ -788,7 +789,7 @@
 	for (base = other_non_function_keys;
 	     (cp = strchr(base, ',')) != 0;
 	     base = cp + 1) {
-	    size_t len = cp - base;
+	    size_t len = (unsigned) (cp - base);
 
 	    for (ap = ko_xlate; ap->from; ap++) {
 		if (len == strlen(ap->from)
@@ -840,7 +841,7 @@
 		} else
 		    *dp++ = *bp;
 	    }
-	    *dp++ = '\0';
+	    *dp = '\0';
 
 	    tp->Strings[to_ptr->nte_index] = _nc_save_str(buf2);
 	}
diff -Naur ncurses-5.7.orig/ncurses/tinfo/read_entry.c ncurses-5.7/ncurses/tinfo/read_entry.c
--- ncurses-5.7.orig/ncurses/tinfo/read_entry.c	2008-08-03 15:33:04.000000000 -0400
+++ ncurses-5.7/ncurses/tinfo/read_entry.c	2011-01-08 18:13:50.735157022 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2007,2008 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            *
@@ -40,9 +40,8 @@
 #include <hashed_db.h>
 
 #include <tic.h>
-#include <term_entry.h>
 
-MODULE_ID("$Id: read_entry.c,v 1.102 2008/08/03 19:33:04 tom Exp $")
+MODULE_ID("$Id: read_entry.c,v 1.107 2010/04/24 23:47:42 tom Exp $")
 
 #define TYPE_CALLOC(type,elts) typeCalloc(type, (unsigned)(elts))
 
@@ -57,7 +56,7 @@
 	else if (IS_NEG2(buf + 2 * i))
 	    Numbers[i] = CANCELLED_NUMERIC;
 	else
-	    Numbers[i] = LOW_MSB(buf + 2 * i);
+	    Numbers[i] = (short) LOW_MSB(buf + 2 * i);
 	TR(TRACE_DATABASE, ("get Numbers[%d]=%d", i, Numbers[i]));
     }
 }
@@ -99,9 +98,9 @@
 
     if (have > 0) {
 	if ((int) want > have)
-	    want = have;
+	    want = (unsigned) have;
 	memcpy(dst, src + *offset, want);
-	*offset += want;
+	*offset += (int) want;
     } else {
 	want = 0;
     }
@@ -155,7 +154,7 @@
 	return (TGETENT_NO);
     }
 
-    want = str_size + name_size + 1;
+    want = (unsigned) (str_size + name_size + 1);
     if (str_size) {
 	/* try to allocate space for the string table */
 	if (str_count * 2 >= (int) sizeof(buf)
@@ -173,14 +172,14 @@
     want = min(MAX_NAME_SIZE, (unsigned) name_size);
     ptr->str_table = string_table;
     ptr->term_names = string_table;
-    if ((have = Read(ptr->term_names, want)) != want) {
+    if ((have = (unsigned) Read(ptr->term_names, want)) != want) {
 	memset(ptr->term_names + have, 0, want - have);
     }
     ptr->term_names[want] = '\0';
     string_table += (want + 1);
 
     if (have > MAX_NAME_SIZE)
-	offset = (have - MAX_NAME_SIZE);
+	offset = (int) (have - MAX_NAME_SIZE);
 
     /* grab the booleans */
     if ((ptr->Booleans = TYPE_CALLOC(NCURSES_SBOOL,
@@ -234,7 +233,7 @@
 	int ext_str_count = LOW_MSB(buf + 4);
 	int ext_str_size = LOW_MSB(buf + 6);
 	int ext_str_limit = LOW_MSB(buf + 8);
-	unsigned need = (ext_bool_count + ext_num_count + ext_str_count);
+	unsigned need = (unsigned) (ext_bool_count + ext_num_count + ext_str_count);
 	int base = 0;
 
 	if (need >= sizeof(buf)
@@ -247,9 +246,9 @@
 	    || ext_str_limit < 0)
 	    return (TGETENT_NO);
 
-	ptr->num_Booleans = BOOLCOUNT + ext_bool_count;
-	ptr->num_Numbers = NUMCOUNT + ext_num_count;
-	ptr->num_Strings = STRCOUNT + ext_str_count;
+	ptr->num_Booleans = UShort(BOOLCOUNT + ext_bool_count);
+	ptr->num_Numbers = UShort(NUMCOUNT + ext_num_count);
+	ptr->num_Strings = UShort(STRCOUNT + ext_str_count);
 
 	ptr->Booleans = typeRealloc(NCURSES_SBOOL, ptr->num_Booleans, ptr->Booleans);
 	ptr->Numbers = typeRealloc(short, ptr->num_Numbers, ptr->Numbers);
@@ -261,7 +260,7 @@
 
 	TR(TRACE_DATABASE, ("READ %d extended-booleans @%d",
 			    ext_bool_count, offset));
-	if ((ptr->ext_Booleans = ext_bool_count) != 0) {
+	if ((ptr->ext_Booleans = UShort(ext_bool_count)) != 0) {
 	    if (Read(ptr->Booleans + BOOLCOUNT, (unsigned)
 		     ext_bool_count) != ext_bool_count)
 		return (TGETENT_NO);
@@ -270,7 +269,7 @@
 
 	TR(TRACE_DATABASE, ("READ %d extended-numbers @%d",
 			    ext_num_count, offset));
-	if ((ptr->ext_Numbers = ext_num_count) != 0) {
+	if ((ptr->ext_Numbers = UShort(ext_num_count)) != 0) {
 	    if (!read_shorts(buf, ext_num_count))
 		return (TGETENT_NO);
 	    TR(TRACE_DATABASE, ("Before converting extended-numbers"));
@@ -279,21 +278,22 @@
 
 	TR(TRACE_DATABASE, ("READ extended-offsets @%d", offset));
 	if ((ext_str_count || need)
-	    && !read_shorts(buf, ext_str_count + need))
+	    && !read_shorts(buf, ext_str_count + (int) need))
 	    return (TGETENT_NO);
 
 	TR(TRACE_DATABASE, ("READ %d bytes of extended-strings @%d",
 			    ext_str_limit, offset));
 
 	if (ext_str_limit) {
-	    if ((ptr->ext_str_table = typeMalloc(char, ext_str_limit)) == 0)
-		  return (TGETENT_NO);
+	    ptr->ext_str_table = typeMalloc(char, (size_t) ext_str_limit);
+	    if (ptr->ext_str_table == 0)
+		return (TGETENT_NO);
 	    if (Read(ptr->ext_str_table, (unsigned) ext_str_limit) != ext_str_limit)
 		return (TGETENT_NO);
 	    TR(TRACE_DATABASE, ("first extended-string is %s", _nc_visbuf(ptr->ext_str_table)));
 	}
 
-	if ((ptr->ext_Strings = ext_str_count) != 0) {
+	if ((ptr->ext_Strings = UShort(ext_str_count)) != 0) {
 	    TR(TRACE_DATABASE,
 	       ("Before computing extended-string capabilities str_count=%d, ext_str_count=%d",
 		str_count, ext_str_count));
@@ -305,7 +305,7 @@
 				    _nc_visbuf(ptr->Strings[i + str_count])));
 		ptr->Strings[i + STRCOUNT] = ptr->Strings[i + str_count];
 		if (VALID_STRING(ptr->Strings[i + STRCOUNT]))
-		    base += (strlen(ptr->Strings[i + STRCOUNT]) + 1);
+		    base += (int) (strlen(ptr->Strings[i + STRCOUNT]) + 1);
 		TR(TRACE_DATABASE, ("... to    [%d] %s",
 				    i + STRCOUNT,
 				    _nc_visbuf(ptr->Strings[i + STRCOUNT])));
@@ -314,7 +314,7 @@
 
 	if (need) {
 	    if (ext_str_count >= (MAX_ENTRY_SIZE * 2))
-		  return (TGETENT_NO);
+		return (TGETENT_NO);
 	    if ((ptr->ext_Names = TYPE_CALLOC(char *, need)) == 0)
 		  return (TGETENT_NO);
 	    TR(TRACE_DATABASE,
@@ -373,7 +373,7 @@
 	T(("cannot open terminfo %s (errno=%d)", filename, errno));
 	code = TGETENT_NO;
     } else {
-	if ((limit = read(fd, buffer, sizeof(buffer))) > 0) {
+	if ((limit = (int) read(fd, buffer, sizeof(buffer))) > 0) {
 
 	    T(("read terminfo %s", filename));
 	    if ((code = _nc_read_termtype(ptr, buffer, limit)) == TGETENT_NO) {
@@ -404,26 +404,22 @@
     /*
      * If we are looking in a directory, assume the entry is a file under that,
      * according to the normal rules.
-     *
-     * FIXME - add caseless-filename fixup.
      */
-    if (_nc_is_dir_path(path)) {
-	unsigned need = 4 + strlen(path) + strlen(name);
+    unsigned need = (unsigned) (LEAF_LEN + 3 + strlen(path) + strlen(name));
+    if (need <= limit)
+	(void) sprintf(filename, "%s/" LEAF_FMT "/%s", path, *name, name);
 
-	if (need <= limit) {
-	    (void) sprintf(filename, "%s/" LEAF_FMT "/%s", path, *name, name);
-	    result = _nc_read_file_entry(filename, tp);
-	}
-    }
+    if (_nc_is_dir_path(path))
+	result = _nc_read_file_entry(filename, tp);
 #if USE_HASHED_DB
     else {
 	static const char suffix[] = DBM_SUFFIX;
 	DB *capdbp;
 	unsigned lens = sizeof(suffix) - 1;
 	unsigned size = strlen(path);
-	unsigned need = lens + size;
+	unsigned test = lens + size;
 
-	if (need <= limit) {
+	if (test < limit) {
 	    if (size >= lens
 		&& !strcmp(path + size - lens, suffix))
 		(void) strcpy(filename, path);
@@ -515,6 +511,7 @@
 {
     int code = TGETENT_NO;
 
+    sprintf(filename, "%.*s", PATH_MAX - 1, name);
     if (strlen(name) == 0
 	|| strcmp(name, ".") == 0
 	|| strcmp(name, "..") == 0
diff -Naur ncurses-5.7.orig/ncurses/tinfo/read_termcap.c ncurses-5.7/ncurses/tinfo/read_termcap.c
--- ncurses-5.7.orig/ncurses/tinfo/read_termcap.c	2006-07-29 08:06:51.000000000 -0400
+++ ncurses-5.7/ncurses/tinfo/read_termcap.c	2011-01-08 18:13:50.735157022 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2005,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            *
@@ -56,9 +56,8 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <tic.h>
-#include <term_entry.h>
 
-MODULE_ID("$Id: read_termcap.c,v 1.71 2006/07/29 12:06:51 tom Exp $")
+MODULE_ID("$Id: read_termcap.c,v 1.74 2010/01/23 17:57:43 tom Exp $")
 
 #if !PURE_TERMINFO
 
@@ -79,6 +78,15 @@
     return result;
 }
 
+/*
+ * Note:
+ * getcap(), cgetent(), etc., are BSD functions.  A copy of those was added to
+ * this file in November 1995, derived from the BSD4.4 Lite sources.
+ *
+ * The initial adaptation uses 518 lines from that source.
+ * The current source (in 2009) uses 183 lines of BSD4.4 Lite (441 ignoring
+ * whitespace).
+ */
 #if USE_GETCAP
 
 #if HAVE_BSD_CGETENT
@@ -107,11 +115,7 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgment:
- *	This product includes software developed by the University of
- *	California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
  *    may be used to endorse or promote products derived from this software
  *    without specific prior written permission.
  *
diff -Naur ncurses-5.7.orig/ncurses/tinfo/setbuf.c ncurses-5.7/ncurses/tinfo/setbuf.c
--- ncurses-5.7.orig/ncurses/tinfo/setbuf.c	2007-05-12 15:04:02.000000000 -0400
+++ ncurses-5.7/ncurses/tinfo/setbuf.c	2011-01-08 18:18:29.135406677 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,2007 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            *
@@ -29,6 +29,8 @@
 /****************************************************************************
  *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995               *
  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
+ *     and: Thomas E. Dickey                        1996-on                 *
+ *     and: Juergen Pfeifer                         2008                    *
  ****************************************************************************/
 
 /*
@@ -40,7 +42,7 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: setbuf.c,v 1.13 2007/05/12 19:04:02 tom Exp $")
+MODULE_ID("$Id: setbuf.c,v 1.16 2010/08/28 21:08:31 tom Exp $")
 
 /*
  * If the output file descriptor is connected to a tty (the typical case) it
@@ -98,11 +100,20 @@
  * buffer.  So we disable this by default (there may yet be a workaround).
  */
 NCURSES_EXPORT(void)
-_nc_set_buffer(FILE *ofp, bool buffered)
+NCURSES_SP_NAME(_nc_set_buffer) (NCURSES_SP_DCLx FILE *ofp, bool buffered)
 {
+    int Cols;
+    int Lines;
+
+    if (0 == SP_PARM)
+	return;
+
+    Cols = *(ptrCols(SP_PARM));
+    Lines = *(ptrLines(SP_PARM));
+
     /* optional optimization hack -- do before any output to ofp */
 #if HAVE_SETVBUF || HAVE_SETBUFFER
-    if (SP->_buffered != buffered) {
+    if (SP_PARM->_buffered != buffered) {
 	unsigned buf_len;
 	char *buf_ptr;
 
@@ -114,11 +125,11 @@
 	setmode(ofp, O_BINARY);
 #endif
 	if (buffered != 0) {
-	    buf_len = min(LINES * (COLS + 6), 2800);
-	    if ((buf_ptr = SP->_setbuf) == 0) {
+	    buf_len = (unsigned) min(Lines * (Cols + 6), 2800);
+	    if ((buf_ptr = SP_PARM->_setbuf) == 0) {
 		if ((buf_ptr = typeMalloc(char, buf_len)) == NULL)
 		      return;
-		SP->_setbuf = buf_ptr;
+		SP_PARM->_setbuf = buf_ptr;
 		/* Don't try to free this! */
 	    }
 #if !USE_SETBUF_0
@@ -144,7 +155,15 @@
 	(void) setbuffer(ofp, buf_ptr, (int) buf_len);
 #endif
 
-	SP->_buffered = buffered;
+	SP_PARM->_buffered = buffered;
     }
 #endif /* HAVE_SETVBUF || HAVE_SETBUFFER */
 }
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(void)
+_nc_set_buffer(FILE *ofp, bool buffered)
+{
+    NCURSES_SP_NAME(_nc_set_buffer) (CURRENT_SCREEN, ofp, buffered);
+}
+#endif
diff -Naur ncurses-5.7.orig/ncurses/tinfo/tinfo_driver.c ncurses-5.7/ncurses/tinfo/tinfo_driver.c
--- ncurses-5.7.orig/ncurses/tinfo/tinfo_driver.c	1969-12-31 19:00:00.000000000 -0500
+++ ncurses-5.7/ncurses/tinfo/tinfo_driver.c	2011-01-08 18:18:29.754781633 -0500
@@ -0,0 +1,1337 @@
+/****************************************************************************
+ * Copyright (c) 2008-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            *
+ * "Software"), to deal in the Software without restriction, including      *
+ * without limitation the rights to use, copy, modify, merge, publish,      *
+ * distribute, distribute with modifications, sublicense, and/or sell       *
+ * copies of the Software, and to permit persons to whom the Software is    *
+ * furnished to do so, subject to the following conditions:                 *
+ *                                                                          *
+ * The above copyright notice and this permission notice shall be included  *
+ * in all copies or substantial portions of the Software.                   *
+ *                                                                          *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
+ *                                                                          *
+ * Except as contained in this notice, the name(s) of the above copyright   *
+ * holders shall not be used in advertising or otherwise to promote the     *
+ * sale, use or other dealings in this Software without prior written       *
+ * authorization.                                                           *
+ ****************************************************************************/
+
+/****************************************************************************
+ *  Author: Juergen Pfeifer                                                 *
+ *                                                                          *
+ ****************************************************************************/
+
+#include <curses.priv.h>
+#define CUR ((TERMINAL*)TCB)->type.
+#include <tic.h>
+
+#if HAVE_NANOSLEEP
+#include <time.h>
+#if HAVE_SYS_TIME_H
+#include <sys/time.h>		/* needed for MacOS X DP3 */
+#endif
+#endif
+
+#if HAVE_SIZECHANGE
+# if !defined(sun) || !TERMIOS
+#  if HAVE_SYS_IOCTL_H
+#   include <sys/ioctl.h>
+#  endif
+# endif
+#endif
+
+MODULE_ID("$Id: tinfo_driver.c,v 1.13 2010/12/20 01:47:09 tom Exp $")
+
+/*
+ * SCO defines TIOCGSIZE and the corresponding struct.  Other systems (SunOS,
+ * Solaris, IRIX) define TIOCGWINSZ and struct winsize.
+ */
+#ifdef TIOCGSIZE
+# define IOCTL_WINSIZE TIOCGSIZE
+# define STRUCT_WINSIZE struct ttysize
+# define WINSIZE_ROWS(n) (int)n.ts_lines
+# define WINSIZE_COLS(n) (int)n.ts_cols
+#else
+# ifdef TIOCGWINSZ
+#  define IOCTL_WINSIZE TIOCGWINSZ
+#  define STRUCT_WINSIZE struct winsize
+#  define WINSIZE_ROWS(n) (int)n.ws_row
+#  define WINSIZE_COLS(n) (int)n.ws_col
+# endif
+#endif
+
+/*
+ * These should be screen structure members.  They need to be globals for
+ * historical reasons.  So we assign them in start_color() and also in
+ * set_term()'s screen-switching logic.
+ */
+#if USE_REENTRANT
+NCURSES_EXPORT(int)
+NCURSES_PUBLIC_VAR(COLOR_PAIRS) (void)
+{
+    return CURRENT_SCREEN ? CURRENT_SCREEN->_pair_count : -1;
+}
+NCURSES_EXPORT(int)
+NCURSES_PUBLIC_VAR(COLORS) (void)
+{
+    return CURRENT_SCREEN ? CURRENT_SCREEN->_color_count : -1;
+}
+#else
+NCURSES_EXPORT_VAR(int) COLOR_PAIRS = 0;
+NCURSES_EXPORT_VAR(int) COLORS = 0;
+#endif
+
+#define TCBMAGIC NCDRV_MAGIC(NCDRV_TINFO)
+#define AssertTCB() assert(TCB!=0 && TCB->magic==TCBMAGIC)
+#define SetSP() assert(TCB->csp!=0); sp = TCB->csp
+
+/*
+ * This routine needs to do all the work to make curscr look
+ * like newscr.
+ */
+static int
+drv_doupdate(TERMINAL_CONTROL_BLOCK * TCB)
+{
+    AssertTCB();
+    return TINFO_DOUPDATE(TCB->csp);
+}
+
+#define ret_error(code, fmt, arg)	if (errret) {\
+					    *errret = code;\
+					    return(FALSE); \
+					} else {\
+					    fprintf(stderr, fmt, arg);\
+					    exit(EXIT_FAILURE);\
+					}
+
+#define ret_error0(code, msg)		if (errret) {\
+					    *errret = code;\
+					    return(FALSE);\
+					} else {\
+					    fprintf(stderr, msg);\
+					    exit(EXIT_FAILURE);\
+					}
+
+static bool
+drv_CanHandle(TERMINAL_CONTROL_BLOCK * TCB, const char *tname, int *errret)
+{
+    bool result = FALSE;
+    int status;
+    TERMINAL *termp;
+    SCREEN *sp;
+
+    assert(TCB != 0 && tname != 0);
+    termp = (TERMINAL *) TCB;
+    sp = TCB->csp;
+    TCB->magic = TCBMAGIC;
+
+#if (USE_DATABASE || USE_TERMCAP)
+    status = _nc_setup_tinfo(tname, &termp->type);
+#else
+    status = TGETENT_NO;
+#endif
+
+    /* try fallback list if entry on disk */
+    if (status != TGETENT_YES) {
+	const TERMTYPE *fallback = _nc_fallback(tname);
+
+	if (fallback) {
+	    termp->type = *fallback;
+	    status = TGETENT_YES;
+	}
+    }
+
+    if (status != TGETENT_YES) {
+	NCURSES_SP_NAME(del_curterm) (NCURSES_SP_ARGx termp);
+	if (status == TGETENT_ERR) {
+	    ret_error0(status, "terminals database is inaccessible\n");
+	} else if (status == TGETENT_NO) {
+	    ret_error(status, "'%s': unknown terminal type.\n", tname);
+	}
+    }
+    result = TRUE;
+#if !USE_REENTRANT
+    strncpy(ttytype, termp->type.term_names, NAMESIZE - 1);
+    ttytype[NAMESIZE - 1] = '\0';
+#endif
+
+    if (command_character)
+	_nc_tinfo_cmdch(termp, *command_character);
+
+    if (generic_type) {
+	ret_error(TGETENT_NO, "'%s': I need something more specific.\n", tname);
+    }
+    if (hard_copy) {
+	ret_error(TGETENT_YES, "'%s': I can't handle hardcopy terminals.\n", tname);
+    }
+
+    return result;
+}
+
+static int
+drv_dobeepflash(TERMINAL_CONTROL_BLOCK * TCB, bool beepFlag)
+{
+    SCREEN *sp;
+    int res = ERR;
+
+    AssertTCB();
+    SetSP();
+
+    /* FIXME: should make sure that we are not in altchar mode */
+    if (beepFlag) {
+	if (bell) {
+	    res = NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "bell", bell);
+	    NCURSES_SP_NAME(_nc_flush) (sp);
+	} else if (flash_screen) {
+	    res = NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx
+					     "flash_screen",
+					     flash_screen);
+	    NCURSES_SP_NAME(_nc_flush) (sp);
+	}
+    } else {
+	if (flash_screen) {
+	    res = NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx
+					     "flash_screen",
+					     flash_screen);
+	    NCURSES_SP_NAME(_nc_flush) (sp);
+	} else if (bell) {
+	    res = NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "bell", bell);
+	    NCURSES_SP_NAME(_nc_flush) (sp);
+	}
+    }
+    return res;
+}
+
+/*
+ * SVr4 curses is known to interchange color codes (1,4) and (3,6), possibly
+ * to maintain compatibility with a pre-ANSI scheme.  The same scheme is
+ * also used in the FreeBSD syscons.
+ */
+static int
+toggled_colors(int c)
+{
+    if (c < 16) {
+	static const int table[] =
+	{0, 4, 2, 6, 1, 5, 3, 7,
+	 8, 12, 10, 14, 9, 13, 11, 15};
+	c = table[c];
+    }
+    return c;
+}
+
+static int
+drv_print(TERMINAL_CONTROL_BLOCK * TCB, char *data, int len)
+{
+    SCREEN *sp;
+
+    AssertTCB();
+    SetSP();
+#if NCURSES_EXT_FUNCS
+    return NCURSES_SP_NAME(mcprint) (TCB->csp, data, len);
+#else
+    return ERR;
+#endif
+}
+
+static int
+drv_defaultcolors(TERMINAL_CONTROL_BLOCK * TCB, int fg, int bg)
+{
+    SCREEN *sp;
+    int code = ERR;
+
+    AssertTCB();
+    SetSP();
+
+    if (sp != 0 && orig_pair && orig_colors && (initialize_pair != 0)) {
+#if NCURSES_EXT_FUNCS
+	sp->_default_color = isDefaultColor(fg) || isDefaultColor(bg);
+	sp->_has_sgr_39_49 = (NCURSES_SP_NAME(tigetflag) (NCURSES_SP_ARGx
+							  "AX")
+			      == TRUE);
+	sp->_default_fg = isDefaultColor(fg) ? COLOR_DEFAULT : (fg & C_MASK);
+	sp->_default_bg = isDefaultColor(bg) ? COLOR_DEFAULT : (bg & C_MASK);
+	if (sp->_color_pairs != 0) {
+	    bool save = sp->_default_color;
+	    sp->_default_color = TRUE;
+	    NCURSES_SP_NAME(init_pair) (NCURSES_SP_ARGx
+					0,
+					(short)fg,
+					(short)bg);
+	    sp->_default_color = save;
+	}
+#endif
+	code = OK;
+    }
+    return (code);
+}
+
+static void
+drv_setcolor(TERMINAL_CONTROL_BLOCK * TCB,
+	     bool fore,
+	     int color,
+	     NCURSES_SP_OUTC outc)
+{
+    SCREEN *sp;
+
+    AssertTCB();
+    SetSP();
+
+    if (fore) {
+	if (set_a_foreground) {
+	    TPUTS_TRACE("set_a_foreground");
+	    NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx
+				    TPARM_1(set_a_foreground, color), 1, outc);
+	} else {
+	    TPUTS_TRACE("set_foreground");
+	    NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx
+				    TPARM_1(set_foreground,
+					    toggled_colors(color)), 1, outc);
+	}
+    } else {
+	if (set_a_background) {
+	    TPUTS_TRACE("set_a_background");
+	    NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx
+				    TPARM_1(set_a_background, color), 1, outc);
+	} else {
+	    TPUTS_TRACE("set_background");
+	    NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx
+				    TPARM_1(set_background,
+					    toggled_colors(color)), 1, outc);
+	}
+    }
+}
+
+static bool
+drv_rescol(TERMINAL_CONTROL_BLOCK * TCB)
+{
+    bool result = FALSE;
+    SCREEN *sp;
+
+    AssertTCB();
+    SetSP();
+
+    if (orig_pair != 0) {
+	NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "orig_pair", orig_pair);
+	result = TRUE;
+    }
+    return result;
+}
+
+static bool
+drv_rescolors(TERMINAL_CONTROL_BLOCK * TCB)
+{
+    int result = FALSE;
+    SCREEN *sp;
+
+    AssertTCB();
+    SetSP();
+
+    if (orig_colors != 0) {
+	NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "orig_colors", orig_colors);
+	result = TRUE;
+    }
+    return result;
+}
+
+static int
+drv_size(TERMINAL_CONTROL_BLOCK * TCB, int *linep, int *colp)
+{
+    SCREEN *sp;
+    bool useEnv = TRUE;
+
+    AssertTCB();
+    sp = TCB->csp;		/* can be null here */
+
+    if (sp) {
+	useEnv = sp->_use_env;
+    } else
+	useEnv = _nc_prescreen.use_env;
+
+    /* figure out the size of the screen */
+    T(("screen size: terminfo lines = %d columns = %d", lines, columns));
+
+    *linep = (int) lines;
+    *colp = (int) columns;
+
+    if (useEnv) {
+	int value;
+
+#ifdef __EMX__
+	{
+	    int screendata[2];
+	    _scrsize(screendata);
+	    *colp = screendata[0];
+	    *linep = screendata[1];
+	    T(("EMX screen size: environment LINES = %d COLUMNS = %d",
+	       *linep, *colp));
+	}
+#endif
+#if HAVE_SIZECHANGE
+	/* try asking the OS */
+	{
+	    TERMINAL *termp = (TERMINAL *) TCB;
+	    if (isatty(termp->Filedes)) {
+		STRUCT_WINSIZE size;
+
+		errno = 0;
+		do {
+		    if (ioctl(termp->Filedes, IOCTL_WINSIZE, &size) >= 0) {
+			*linep = ((sp != 0 && sp->_filtered)
+				  ? 1
+				  : WINSIZE_ROWS(size));
+			*colp = WINSIZE_COLS(size);
+			T(("SYS screen size: environment LINES = %d COLUMNS = %d",
+			   *linep, *colp));
+			break;
+		    }
+		} while
+		    (errno == EINTR);
+	    }
+	}
+#endif /* HAVE_SIZECHANGE */
+
+	/*
+	 * Finally, look for environment variables.
+	 *
+	 * Solaris lets users override either dimension with an environment
+	 * variable.
+	 */
+	if ((value = _nc_getenv_num("LINES")) > 0) {
+	    *linep = value;
+	    T(("screen size: environment LINES = %d", *linep));
+	}
+	if ((value = _nc_getenv_num("COLUMNS")) > 0) {
+	    *colp = value;
+	    T(("screen size: environment COLUMNS = %d", *colp));
+	}
+
+	/* if we can't get dynamic info about the size, use static */
+	if (*linep <= 0) {
+	    *linep = (int) lines;
+	}
+	if (*colp <= 0) {
+	    *colp = (int) columns;
+	}
+
+	/* the ultimate fallback, assume fixed 24x80 size */
+	if (*linep <= 0) {
+	    *linep = 24;
+	}
+	if (*colp <= 0) {
+	    *colp = 80;
+	}
+
+	/*
+	 * Put the derived values back in the screen-size caps, so
+	 * tigetnum() and tgetnum() will do the right thing.
+	 */
+	lines = (short) (*linep);
+	columns = (short) (*colp);
+    }
+
+    T(("screen size is %dx%d", *linep, *colp));
+    return OK;
+}
+
+static int
+drv_getsize(TERMINAL_CONTROL_BLOCK * TCB, int *l, int *c)
+{
+    AssertTCB();
+    assert(l != 0 && c != 0);
+    *l = lines;
+    *c = columns;
+    return OK;
+}
+
+static int
+drv_setsize(TERMINAL_CONTROL_BLOCK * TCB, int l, int c)
+{
+    AssertTCB();
+    lines = (short) l;
+    columns = (short) c;
+    return OK;
+}
+
+static int
+drv_sgmode(TERMINAL_CONTROL_BLOCK * TCB, bool setFlag, TTY * buf)
+{
+    SCREEN *sp = TCB->csp;
+    TERMINAL *_term = (TERMINAL *) TCB;
+    int result = OK;
+
+    AssertTCB();
+    if (setFlag) {
+	for (;;) {
+	    if (SET_TTY(_term->Filedes, buf) != 0) {
+		if (errno == EINTR)
+		    continue;
+		if (errno == ENOTTY) {
+		    if (sp)
+			sp->_notty = TRUE;
+		}
+		result = ERR;
+	    }
+	    break;
+	}
+    } else {
+	for (;;) {
+	    if (GET_TTY(_term->Filedes, buf) != 0) {
+		if (errno == EINTR)
+		    continue;
+		result = ERR;
+	    }
+	    break;
+	}
+    }
+    return result;
+}
+
+static int
+drv_mode(TERMINAL_CONTROL_BLOCK * TCB, bool progFlag, bool defFlag)
+{
+    SCREEN *sp;
+    TERMINAL *_term = (TERMINAL *) TCB;
+    int code = ERR;
+
+    AssertTCB();
+    sp = TCB->csp;
+
+    if (progFlag)		/* prog mode */
+    {
+	if (defFlag) {
+	    /* def_prog_mode */
+	    /*
+	     * Turn off the XTABS bit in the tty structure if it was on.
+	     */
+	    if ((drv_sgmode(TCB, FALSE, &(_term->Nttyb)) == OK)) {
+#ifdef TERMIOS
+		_term->Nttyb.c_oflag &= (unsigned) ~OFLAGS_TABS;
+#else
+		_term->Nttyb.sg_flags &= (unsigned) ~XTABS;
+#endif
+		code = OK;
+	    }
+	} else {
+	    /* reset_prog_mode */
+	    if (drv_sgmode(TCB, TRUE, &(_term->Nttyb)) == OK) {
+		if (sp) {
+		    if (sp->_keypad_on)
+			_nc_keypad(sp, TRUE);
+		    NC_BUFFERED(sp, TRUE);
+		}
+		code = OK;
+	    }
+	}
+    } else {			/* shell mode */
+	if (defFlag) {
+	    /* def_shell_mode */
+	    /*
+	     * If XTABS was on, remove the tab and backtab capabilities.
+	     */
+	    if (drv_sgmode(TCB, FALSE, &(_term->Ottyb)) == OK) {
+#ifdef TERMIOS
+		if (_term->Ottyb.c_oflag & OFLAGS_TABS)
+		    tab = back_tab = NULL;
+#else
+		if (_term->Ottyb.sg_flags & XTABS)
+		    tab = back_tab = NULL;
+#endif
+		code = OK;
+	    }
+	} else {
+	    /* reset_shell_mode */
+	    if (sp) {
+		_nc_keypad(sp, FALSE);
+		NCURSES_SP_NAME(_nc_flush) (sp);
+		NC_BUFFERED(sp, FALSE);
+	    }
+	    code = drv_sgmode(TCB, TRUE, &(_term->Ottyb));
+	}
+    }
+    return (code);
+}
+
+static void
+drv_wrap(SCREEN *sp)
+{
+    if (sp) {
+	sp->_mouse_wrap(sp);
+	NCURSES_SP_NAME(_nc_screen_wrap) (sp);
+	NCURSES_SP_NAME(_nc_mvcur_wrap) (sp);	/* wrap up cursor addressing */
+    }
+}
+
+static void
+drv_release(TERMINAL_CONTROL_BLOCK * TCB GCC_UNUSED)
+{
+}
+
+#  define SGR0_TEST(mode) (mode != 0) && (exit_attribute_mode == 0 || strcmp(mode, exit_attribute_mode))
+
+static void
+drv_screen_init(SCREEN *sp)
+{
+    TERMINAL_CONTROL_BLOCK *TCB = TCBOf(sp);
+
+    AssertTCB();
+
+    /*
+     * Check for mismatched graphic-rendition capabilities.  Most SVr4
+     * terminfo trees contain entries that have rmul or rmso equated to
+     * sgr0 (Solaris curses copes with those entries).  We do this only
+     * for curses, since many termcap applications assume that
+     * smso/rmso and smul/rmul are paired, and will not function
+     * properly if we remove rmso or rmul.  Curses applications
+     * shouldn't be looking at this detail.
+     */
+    sp->_use_rmso = SGR0_TEST(exit_standout_mode);
+    sp->_use_rmul = SGR0_TEST(exit_underline_mode);
+
+    /*
+     * Check whether we can optimize scrolling under dumb terminals in
+     * case we do not have any of these capabilities, scrolling
+     * optimization will be useless.
+     */
+    sp->_scrolling = ((scroll_forward && scroll_reverse) ||
+		      ((parm_rindex ||
+			parm_insert_line ||
+			insert_line) &&
+		       (parm_index ||
+			parm_delete_line ||
+			delete_line)));
+
+    NCURSES_SP_NAME(baudrate) (sp);
+
+    NCURSES_SP_NAME(_nc_mvcur_init) (sp);
+    /* initialize terminal to a sane state */
+    NCURSES_SP_NAME(_nc_screen_init) (sp);
+}
+
+static void
+drv_init(TERMINAL_CONTROL_BLOCK * TCB)
+{
+    SCREEN *sp;
+    TERMINAL *trm;
+
+    AssertTCB();
+
+    trm = (TERMINAL *) TCB;
+    sp = TCB->csp;
+
+    TCB->info.initcolor = initialize_color;
+    TCB->info.canchange = can_change;
+    TCB->info.hascolor = ((VALID_NUMERIC(max_colors) && VALID_NUMERIC(max_pairs)
+			   && (((set_foreground != NULL)
+				&& (set_background != NULL))
+			       || ((set_a_foreground != NULL)
+				   && (set_a_background != NULL))
+			       || set_color_pair)) ? TRUE : FALSE);
+
+    TCB->info.caninit = !(exit_ca_mode && non_rev_rmcup);
+
+    TCB->info.maxpairs = VALID_NUMERIC(max_pairs) ? max_pairs : 0;
+    TCB->info.maxcolors = VALID_NUMERIC(max_colors) ? max_colors : 0;
+    TCB->info.numlabels = VALID_NUMERIC(num_labels) ? num_labels : 0;
+    TCB->info.labelwidth = VALID_NUMERIC(label_width) ? label_width : 0;
+    TCB->info.labelheight = VALID_NUMERIC(label_height) ? label_height : 0;
+    TCB->info.nocolorvideo = VALID_NUMERIC(no_color_video) ? no_color_video
+	: 0;
+    TCB->info.tabsize = VALID_NUMERIC(init_tabs) ? (int) init_tabs : 8;
+
+    TCB->info.defaultPalette = hue_lightness_saturation ? _nc_hls_palette : _nc_cga_palette;
+
+    /*
+     * If an application calls setupterm() rather than initscr() or
+     * newterm(), we will not have the def_prog_mode() call in
+     * _nc_setupscreen().  Do it now anyway, so we can initialize the
+     * baudrate.
+     */
+    if (isatty(trm->Filedes)) {
+	TCB->drv->mode(TCB, TRUE, TRUE);
+    }
+}
+
+#define MAX_PALETTE	8
+#define InPalette(n)	((n) >= 0 && (n) < MAX_PALETTE)
+
+static void
+drv_initpair(TERMINAL_CONTROL_BLOCK * TCB, short pair, short f, short b)
+{
+    SCREEN *sp;
+
+    AssertTCB();
+    SetSP();
+
+    if ((initialize_pair != NULL) && InPalette(f) && InPalette(b)) {
+	const color_t *tp = InfoOf(sp).defaultPalette;
+
+	TR(TRACE_ATTRS,
+	   ("initializing pair: pair = %d, fg=(%d,%d,%d), bg=(%d,%d,%d)",
+	    pair,
+	    tp[f].red, tp[f].green, tp[f].blue,
+	    tp[b].red, tp[b].green, tp[b].blue));
+
+	NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx
+				   "initialize_pair",
+				   TPARM_7(initialize_pair,
+					   pair,
+					   tp[f].red, tp[f].green, tp[f].blue,
+					   tp[b].red, tp[b].green, tp[b].blue));
+    }
+}
+
+static int
+default_fg(SCREEN *sp)
+{
+#if NCURSES_EXT_FUNCS
+    return (sp != 0) ? sp->_default_fg : COLOR_WHITE;
+#else
+    return COLOR_WHITE;
+#endif
+}
+
+static int
+default_bg(SCREEN *sp)
+{
+#if NCURSES_EXT_FUNCS
+    return sp != 0 ? sp->_default_bg : COLOR_BLACK;
+#else
+    return COLOR_BLACK;
+#endif
+}
+
+static void
+drv_initcolor(TERMINAL_CONTROL_BLOCK * TCB,
+	      short color, short r, short g, short b)
+{
+    SCREEN *sp = TCB->csp;
+
+    AssertTCB();
+    if (initialize_color != NULL) {
+	NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx
+				   "initialize_color",
+				   TPARM_4(initialize_color, color, r, g, b));
+    }
+}
+
+static void
+drv_do_color(TERMINAL_CONTROL_BLOCK * TCB,
+	     short old_pair,
+	     short pair,
+	     bool reverse,
+	     NCURSES_SP_OUTC outc)
+{
+    SCREEN *sp = TCB->csp;
+    NCURSES_COLOR_T fg = COLOR_DEFAULT;
+    NCURSES_COLOR_T bg = COLOR_DEFAULT;
+    NCURSES_COLOR_T old_fg, old_bg;
+
+    AssertTCB();
+    if (sp == 0)
+	return;
+
+    if (pair < 0 || pair >= COLOR_PAIRS) {
+	return;
+    } else if (pair != 0) {
+	if (set_color_pair) {
+	    TPUTS_TRACE("set_color_pair");
+	    NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx
+				    TPARM_1(set_color_pair, pair), 1, outc);
+	    return;
+	} else if (sp != 0) {
+	    NCURSES_SP_NAME(pair_content) (NCURSES_SP_ARGx
+					   (short) pair,
+					   &fg,
+					   &bg);
+	}
+    }
+
+    if (old_pair >= 0
+	&& sp != 0
+	&& NCURSES_SP_NAME(pair_content) (NCURSES_SP_ARGx
+					  old_pair,
+					  &old_fg,
+					  &old_bg) !=ERR) {
+	if ((isDefaultColor(fg) && !isDefaultColor(old_fg))
+	    || (isDefaultColor(bg) && !isDefaultColor(old_bg))) {
+#if NCURSES_EXT_FUNCS
+	    /*
+	     * A minor optimization - but extension.  If "AX" is specified in
+	     * the terminal description, treat it as screen's indicator of ECMA
+	     * SGR 39 and SGR 49, and assume the two sequences are independent.
+	     */
+	    if (sp->_has_sgr_39_49
+		&& isDefaultColor(old_bg)
+		&& !isDefaultColor(old_fg)) {
+		NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx "\033[39m", 1, outc);
+	    } else if (sp->_has_sgr_39_49
+		       && isDefaultColor(old_fg)
+		       && !isDefaultColor(old_bg)) {
+		NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx "\033[49m", 1, outc);
+	    } else
+#endif
+		drv_rescol(TCB);
+	}
+    } else {
+	drv_rescol(TCB);
+	if (old_pair < 0)
+	    return;
+    }
+
+#if NCURSES_EXT_FUNCS
+    if (isDefaultColor(fg))
+	fg = (NCURSES_COLOR_T) default_fg(sp);
+    if (isDefaultColor(bg))
+	bg = (NCURSES_COLOR_T) default_bg(sp);
+#endif
+
+    if (reverse) {
+	NCURSES_COLOR_T xx = fg;
+	fg = bg;
+	bg = xx;
+    }
+
+    TR(TRACE_ATTRS, ("setting colors: pair = %d, fg = %d, bg = %d", pair,
+		     fg, bg));
+
+    if (!isDefaultColor(fg)) {
+	drv_setcolor(TCB, TRUE, fg, outc);
+    }
+    if (!isDefaultColor(bg)) {
+	drv_setcolor(TCB, FALSE, bg, outc);
+    }
+}
+
+#define xterm_kmous "\033[M"
+static void
+init_xterm_mouse(SCREEN *sp)
+{
+    sp->_mouse_type = M_XTERM;
+    sp->_mouse_xtermcap = NCURSES_SP_NAME(tigetstr) (NCURSES_SP_ARGx "XM");
+    if (!VALID_STRING(sp->_mouse_xtermcap))
+	sp->_mouse_xtermcap = "\033[?1000%?%p1%{1}%=%th%el%;";
+}
+
+static void
+drv_initmouse(TERMINAL_CONTROL_BLOCK * TCB)
+{
+    SCREEN *sp;
+
+    AssertTCB();
+    SetSP();
+
+    /* we know how to recognize mouse events under "xterm" */
+    if (sp != 0) {
+	if (key_mouse != 0) {
+	    if (!strcmp(key_mouse, xterm_kmous)
+		|| strstr(TerminalOf(sp)->type.term_names, "xterm") != 0) {
+		init_xterm_mouse(sp);
+	    }
+	} else if (strstr(TerminalOf(sp)->type.term_names, "xterm") != 0) {
+	    if (_nc_add_to_try(&(sp->_keytry), xterm_kmous, KEY_MOUSE) == OK)
+		init_xterm_mouse(sp);
+	}
+    }
+}
+
+static int
+drv_testmouse(TERMINAL_CONTROL_BLOCK * TCB, int delay)
+{
+    int rc = 0;
+    SCREEN *sp;
+
+    AssertTCB();
+    SetSP();
+
+#if USE_SYSMOUSE
+    if ((sp->_mouse_type == M_SYSMOUSE)
+	&& (sp->_sysmouse_head < sp->_sysmouse_tail)) {
+	rc = TW_MOUSE;
+    } else
+#endif
+    {
+	rc = TCBOf(sp)->drv->twait(TCBOf(sp),
+				   TWAIT_MASK,
+				   delay,
+				   (int *) 0
+				   EVENTLIST_2nd(evl));
+#if USE_SYSMOUSE
+	if ((sp->_mouse_type == M_SYSMOUSE)
+	    && (sp->_sysmouse_head < sp->_sysmouse_tail)
+	    && (rc == 0)
+	    && (errno == EINTR)) {
+	    rc |= TW_MOUSE;
+	}
+#endif
+    }
+    return rc;
+}
+
+static int
+drv_mvcur(TERMINAL_CONTROL_BLOCK * TCB, int yold, int xold, int ynew, int xnew)
+{
+    SCREEN *sp = TCB->csp;
+    AssertTCB();
+    return TINFO_MVCUR(sp, yold, xold, ynew, xnew);
+}
+
+static void
+drv_hwlabel(TERMINAL_CONTROL_BLOCK * TCB, int labnum, char *text)
+{
+    SCREEN *sp = TCB->csp;
+
+    AssertTCB();
+    if (labnum > 0 && labnum <= num_labels) {
+	NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx
+				   "plab_norm",
+				   TPARM_2(plab_norm, labnum, text));
+    }
+}
+
+static void
+drv_hwlabelOnOff(TERMINAL_CONTROL_BLOCK * TCB, bool OnFlag)
+{
+    SCREEN *sp = TCB->csp;
+
+    AssertTCB();
+    if (OnFlag) {
+	NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "label_on", label_on);
+    } else {
+	NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "label_off", label_off);
+    }
+}
+
+static chtype
+drv_conattr(TERMINAL_CONTROL_BLOCK * TCB)
+{
+    SCREEN *sp = TCB->csp;
+    chtype attrs = A_NORMAL;
+
+    AssertTCB();
+    if (enter_alt_charset_mode)
+	attrs |= A_ALTCHARSET;
+
+    if (enter_blink_mode)
+	attrs |= A_BLINK;
+
+    if (enter_bold_mode)
+	attrs |= A_BOLD;
+
+    if (enter_dim_mode)
+	attrs |= A_DIM;
+
+    if (enter_reverse_mode)
+	attrs |= A_REVERSE;
+
+    if (enter_standout_mode)
+	attrs |= A_STANDOUT;
+
+    if (enter_protected_mode)
+	attrs |= A_PROTECT;
+
+    if (enter_secure_mode)
+	attrs |= A_INVIS;
+
+    if (enter_underline_mode)
+	attrs |= A_UNDERLINE;
+
+    if (sp && sp->_coloron)
+	attrs |= A_COLOR;
+
+    return (attrs);
+}
+
+static void
+drv_setfilter(TERMINAL_CONTROL_BLOCK * TCB)
+{
+    AssertTCB();
+
+    clear_screen = 0;
+    cursor_down = parm_down_cursor = 0;
+    cursor_address = 0;
+    cursor_up = parm_up_cursor = 0;
+    row_address = 0;
+    cursor_home = carriage_return;
+}
+
+static void
+drv_initacs(TERMINAL_CONTROL_BLOCK * TCB, chtype *real_map, chtype *fake_map)
+{
+    SCREEN *sp = TCB->csp;
+
+    AssertTCB();
+    assert(sp != 0);
+    if (ena_acs != NULL) {
+	NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "ena_acs", ena_acs);
+    }
+#if NCURSES_EXT_FUNCS
+    /*
+     * Linux console "supports" the "PC ROM" character set by the coincidence
+     * that smpch/rmpch and smacs/rmacs have the same values.  ncurses has
+     * no codepage support (see SCO Merge for an example).  Outside of the
+     * values defined in acsc, there are no definitions for the "PC ROM"
+     * character set (assumed by some applications to be codepage 437), but we
+     * allow those applications to use those codepoints.
+     *
+     * test/blue.c uses this feature.
+     */
+#define PCH_KLUDGE(a,b) (a != 0 && b != 0 && !strcmp(a,b))
+    if (PCH_KLUDGE(enter_pc_charset_mode, enter_alt_charset_mode) &&
+	PCH_KLUDGE(exit_pc_charset_mode, exit_alt_charset_mode)) {
+	size_t i;
+	for (i = 1; i < ACS_LEN; ++i) {
+	    if (real_map[i] == 0) {
+		real_map[i] = i;
+		if (real_map != fake_map) {
+		    if (sp != 0)
+			sp->_screen_acs_map[i] = TRUE;
+		}
+	    }
+	}
+    }
+#endif
+
+    if (acs_chars != NULL) {
+	size_t i = 0;
+	size_t length = strlen(acs_chars);
+
+	while (i + 1 < length) {
+	    if (acs_chars[i] != 0 && UChar(acs_chars[i]) < ACS_LEN) {
+		real_map[UChar(acs_chars[i])] = UChar(acs_chars[i + 1]) | A_ALTCHARSET;
+		if (sp != 0)
+		    sp->_screen_acs_map[UChar(acs_chars[i])] = TRUE;
+	    }
+	    i += 2;
+	}
+    }
+#ifdef TRACE
+    /* Show the equivalent mapping, noting if it does not match the
+     * given attribute, whether by re-ordering or duplication.
+     */
+    if (USE_TRACEF(TRACE_CALLS)) {
+	size_t n, m;
+	char show[ACS_LEN * 2 + 1];
+	for (n = 1, m = 0; n < ACS_LEN; n++) {
+	    if (real_map[n] != 0) {
+		show[m++] = (char) n;
+		show[m++] = (char) ChCharOf(real_map[n]);
+	    }
+	}
+	show[m] = 0;
+	if (acs_chars == NULL || strcmp(acs_chars, show))
+	    _tracef("%s acs_chars %s",
+		    (acs_chars == NULL) ? "NULL" : "READ",
+		    _nc_visbuf(acs_chars));
+	_tracef("%s acs_chars %s",
+		(acs_chars == NULL)
+		? "NULL"
+		: (strcmp(acs_chars, show)
+		   ? "DIFF"
+		   : "SAME"),
+		_nc_visbuf(show));
+
+	_nc_unlock_global(tracef);
+    }
+#endif /* TRACE */
+}
+
+#define ENSURE_TINFO(sp) (TCBOf(sp)->drv->isTerminfo)
+
+NCURSES_EXPORT(void)
+_nc_cookie_init(SCREEN *sp)
+{
+    bool support_cookies = USE_XMC_SUPPORT;
+    TERMINAL_CONTROL_BLOCK *TCB = (TERMINAL_CONTROL_BLOCK *) (sp->_term);
+
+    if (sp == 0 || !ENSURE_TINFO(sp))
+	return;
+
+#if USE_XMC_SUPPORT
+    /*
+     * If we have no magic-cookie support compiled-in, or if it is suppressed
+     * in the environment, reset the support-flag.
+     */
+    if (magic_cookie_glitch >= 0) {
+	if (getenv("NCURSES_NO_MAGIC_COOKIE") != 0) {
+	    support_cookies = FALSE;
+	}
+    }
+#endif
+
+    if (!support_cookies && magic_cookie_glitch >= 0) {
+	T(("will disable attributes to work w/o magic cookies"));
+    }
+
+    if (magic_cookie_glitch > 0) {	/* tvi, wyse */
+
+	sp->_xmc_triggers = sp->_ok_attributes & (
+						     A_STANDOUT |
+						     A_UNDERLINE |
+						     A_REVERSE |
+						     A_BLINK |
+						     A_DIM |
+						     A_BOLD |
+						     A_INVIS |
+						     A_PROTECT
+	    );
+#if 0
+	/*
+	 * We "should" treat colors as an attribute.  The wyse350 (and its
+	 * clones) appear to be the only ones that have both colors and magic
+	 * cookies.
+	 */
+	if (has_colors()) {
+	    sp->_xmc_triggers |= A_COLOR;
+	}
+#endif
+	sp->_xmc_suppress = sp->_xmc_triggers & (chtype) ~(A_BOLD);
+
+	T(("magic cookie attributes %s", _traceattr(sp->_xmc_suppress)));
+	/*
+	 * Supporting line-drawing may be possible.  But make the regular
+	 * video attributes work first.
+	 */
+	acs_chars = ABSENT_STRING;
+	ena_acs = ABSENT_STRING;
+	enter_alt_charset_mode = ABSENT_STRING;
+	exit_alt_charset_mode = ABSENT_STRING;
+#if USE_XMC_SUPPORT
+	/*
+	 * To keep the cookie support simple, suppress all of the optimization
+	 * hooks except for clear_screen and the cursor addressing.
+	 */
+	if (support_cookies) {
+	    clr_eol = ABSENT_STRING;
+	    clr_eos = ABSENT_STRING;
+	    set_attributes = ABSENT_STRING;
+	}
+#endif
+    } else if (magic_cookie_glitch == 0) {	/* hpterm */
+    }
+
+    /*
+     * If magic cookies are not supported, cancel the strings that set
+     * video attributes.
+     */
+    if (!support_cookies && magic_cookie_glitch >= 0) {
+	magic_cookie_glitch = ABSENT_NUMERIC;
+	set_attributes = ABSENT_STRING;
+	enter_blink_mode = ABSENT_STRING;
+	enter_bold_mode = ABSENT_STRING;
+	enter_dim_mode = ABSENT_STRING;
+	enter_reverse_mode = ABSENT_STRING;
+	enter_standout_mode = ABSENT_STRING;
+	enter_underline_mode = ABSENT_STRING;
+    }
+
+    /* initialize normal acs before wide, since we use mapping in the latter */
+#if !USE_WIDEC_SUPPORT
+    if (_nc_unicode_locale() && _nc_locale_breaks_acs(sp->_term)) {
+	acs_chars = NULL;
+	ena_acs = NULL;
+	enter_alt_charset_mode = NULL;
+	exit_alt_charset_mode = NULL;
+	set_attributes = NULL;
+    }
+#endif
+}
+
+static int
+drv_twait(TERMINAL_CONTROL_BLOCK * TCB,
+	  int mode,
+	  int milliseconds,
+	  int *timeleft
+	  EVENTLIST_2nd(_nc_eventlist * evl))
+{
+    SCREEN *sp;
+
+    AssertTCB();
+    SetSP();
+
+    return _nc_timed_wait(sp, mode, milliseconds, timeleft EVENTLIST_2nd(evl));
+}
+
+static int
+drv_read(TERMINAL_CONTROL_BLOCK * TCB, int *buf)
+{
+    SCREEN *sp;
+    unsigned char c2 = 0;
+    int n;
+
+    AssertTCB();
+    assert(buf);
+    SetSP();
+
+# if USE_PTHREADS_EINTR
+    if ((pthread_self) && (pthread_kill) && (pthread_equal))
+	_nc_globals.read_thread = pthread_self();
+# endif
+    n = read(sp->_ifd, &c2, 1);
+#if USE_PTHREADS_EINTR
+    _nc_globals.read_thread = 0;
+#endif
+    *buf = (int) c2;
+    return n;
+}
+
+static int
+drv_nap(TERMINAL_CONTROL_BLOCK * TCB GCC_UNUSED, int ms)
+{
+#if HAVE_NANOSLEEP
+    {
+	struct timespec request, remaining;
+	request.tv_sec = ms / 1000;
+	request.tv_nsec = (ms % 1000) * 1000000;
+	while (nanosleep(&request, &remaining) == -1
+	       && errno == EINTR) {
+	    request = remaining;
+	}
+    }
+#else
+    _nc_timed_wait(0, 0, ms, (int *) 0 EVENTLIST_2nd(0));
+#endif
+    return OK;
+}
+
+static int
+__nc_putp(SCREEN *sp, const char *name GCC_UNUSED, const char *value)
+{
+    int rc = ERR;
+
+    if (value) {
+	rc = NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx name, value);
+    }
+    return rc;
+}
+
+static int
+__nc_putp_flush(SCREEN *sp, const char *name, const char *value)
+{
+    int rc = __nc_putp(sp, name, value);
+    if (rc != ERR) {
+	NCURSES_SP_NAME(_nc_flush) (sp);
+    }
+    return rc;
+}
+
+static int
+drv_kpad(TERMINAL_CONTROL_BLOCK * TCB, bool flag)
+{
+    int ret = ERR;
+    SCREEN *sp;
+
+    AssertTCB();
+
+    sp = TCB->csp;
+
+    if (sp) {
+	if (flag) {
+	    (void) __nc_putp_flush(sp, "keypad_xmit", keypad_xmit);
+	} else if (!flag && keypad_local) {
+	    (void) __nc_putp_flush(sp, "keypad_local", keypad_local);
+	}
+	if (flag && !sp->_tried) {
+	    _nc_init_keytry(sp);
+	    sp->_tried = TRUE;
+	}
+	ret = OK;
+    }
+
+    return ret;
+}
+
+static int
+drv_keyok(TERMINAL_CONTROL_BLOCK * TCB, int c, bool flag)
+{
+    SCREEN *sp;
+    int code = ERR;
+    int count = 0;
+    char *s;
+
+    AssertTCB();
+    SetSP();
+
+    if (c >= 0) {
+	unsigned ch = (unsigned) c;
+	if (flag) {
+	    while ((s = _nc_expand_try(sp->_key_ok, ch, &count, 0)) != 0
+		   && _nc_remove_key(&(sp->_key_ok), ch)) {
+		code = _nc_add_to_try(&(sp->_keytry), s, ch);
+		free(s);
+		count = 0;
+		if (code != OK)
+		    break;
+	    }
+	} else {
+	    while ((s = _nc_expand_try(sp->_keytry, ch, &count, 0)) != 0
+		   && _nc_remove_key(&(sp->_keytry), ch)) {
+		code = _nc_add_to_try(&(sp->_key_ok), s, ch);
+		free(s);
+		count = 0;
+		if (code != OK)
+		    break;
+	    }
+	}
+    }
+    return (code);
+}
+
+static bool
+drv_kyExist(TERMINAL_CONTROL_BLOCK * TCB, int key)
+{
+    bool res = FALSE;
+
+    AssertTCB();
+    if (TCB->csp)
+	res = TINFO_HAS_KEY(TCB->csp, key) == 0 ? FALSE : TRUE;
+
+    return res;
+}
+
+NCURSES_EXPORT_VAR (TERM_DRIVER) _nc_TINFO_DRIVER = {
+    TRUE,
+	drv_CanHandle,		/* CanHandle */
+	drv_init,		/* init */
+	drv_release,		/* release */
+	drv_size,		/* size */
+	drv_sgmode,		/* sgmode */
+	drv_conattr,		/* conattr */
+	drv_mvcur,		/* hwcur */
+	drv_mode,		/* mode */
+	drv_rescol,		/* rescol */
+	drv_rescolors,		/* rescolors */
+	drv_setcolor,		/* color */
+	drv_dobeepflash,	/* doBeepOrFlash */
+	drv_initpair,		/* initpair */
+	drv_initcolor,		/* initcolor */
+	drv_do_color,		/* docolor */
+	drv_initmouse,		/* initmouse */
+	drv_testmouse,		/* testmouse */
+	drv_setfilter,		/* setfilter */
+	drv_hwlabel,		/* hwlabel */
+	drv_hwlabelOnOff,	/* hwlabelOnOff */
+	drv_doupdate,		/* update */
+	drv_defaultcolors,	/* defaultcolors */
+	drv_print,		/* print */
+	drv_getsize,		/* getsize */
+	drv_setsize,		/* setsize */
+	drv_initacs,		/* initacs */
+	drv_screen_init,	/* scinit */
+	drv_wrap,		/* scexit */
+	drv_twait,		/* twait  */
+	drv_read,		/* read */
+	drv_nap,		/* nap */
+	drv_kpad,		/* kpad */
+	drv_keyok,		/* kyOk */
+	drv_kyExist		/* kyExist */
+};
diff -Naur ncurses-5.7.orig/ncurses/tinfo/trim_sgr0.c ncurses-5.7/ncurses/tinfo/trim_sgr0.c
--- ncurses-5.7.orig/ncurses/tinfo/trim_sgr0.c	2007-04-07 13:14:11.000000000 -0400
+++ ncurses-5.7/ncurses/tinfo/trim_sgr0.c	2011-01-08 18:18:29.754781633 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2005-2006,2007 Free Software Foundation, Inc.              *
+ * Copyright (c) 2005-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            *
@@ -35,9 +35,8 @@
 #include <ctype.h>
 
 #include <tic.h>
-#include <term_entry.h>
 
-MODULE_ID("$Id: trim_sgr0.c,v 1.8 2007/04/07 17:14:11 tom Exp $")
+MODULE_ID("$Id: trim_sgr0.c,v 1.12 2010/12/25 23:03:57 tom Exp $")
 
 #undef CUR
 #define CUR tp->
@@ -100,8 +99,8 @@
 {
     if (PRESENT(s)) {
 	if (PRESENT(attr)) {
-	    unsigned len_s = strlen(s);
-	    unsigned len_a = strlen(attr);
+	    size_t len_s = strlen(s);
+	    size_t len_a = strlen(attr);
 
 	    if (len_s > len_a && !strncmp(attr, s, len_a)) {
 		unsigned n;
@@ -124,8 +123,8 @@
     bool result = FALSE;
     int csi_a = is_csi(a);
     int csi_b = is_csi(b);
-    unsigned len_a;
-    unsigned len_b;
+    size_t len_a;
+    size_t len_b;
 
     TR(TRACE_DATABASE, ("similar_sgr:\n\t%s\n\t%s",
 			_nc_visbuf2(1, a),
@@ -170,13 +169,13 @@
  * Returns the number of chars from 'full' that we matched.  If any mismatch
  * occurs, return zero.
  */
-static int
+static unsigned
 compare_part(const char *part, const char *full)
 {
     const char *next_part;
     const char *next_full;
-    int used_full = 0;
-    int used_delay = 0;
+    unsigned used_full = 0;
+    unsigned used_delay = 0;
 
     while (*part != 0) {
 	if (*part != *full) {
@@ -199,7 +198,7 @@
 	    next_part = skip_delay(part);
 	    next_full = skip_delay(full);
 	    if (next_part != part && next_full != full) {
-		used_delay += (next_full - full);
+		used_delay += (unsigned) (next_full - full);
 		full = next_full;
 		part = next_part;
 		continue;
@@ -261,10 +260,11 @@
 		k = strlen(exit_alt_charset_mode);
 		if (j > k) {
 		    for (i = 0; i <= (j - k); ++i) {
-			int k2 = compare_part(exit_alt_charset_mode, off + i);
+			unsigned k2 = compare_part(exit_alt_charset_mode,
+						   off + i);
 			if (k2 != 0) {
 			    found = TRUE;
-			    chop_out(off, i, i + k2);
+			    chop_out(off, (unsigned) i, (unsigned) (i + k2));
 			    break;
 			}
 		    }
@@ -274,18 +274,18 @@
 	     * SGR 10 would reset to normal font.
 	     */
 	    if (!found) {
-		if ((i = is_csi(off)) != 0
+		if ((i = (size_t) is_csi(off)) != 0
 		    && off[strlen(off) - 1] == 'm') {
 		    TR(TRACE_DATABASE, ("looking for SGR 10 in %s",
 					_nc_visbuf(off)));
 		    tmp = skip_zero(off + i);
 		    if (tmp[0] == '1'
 			&& skip_zero(tmp + 1) != tmp + 1) {
-			i = tmp - off;
+			i = (size_t) (tmp - off);
 			if (off[i - 1] == ';')
 			    i--;
-			j = skip_zero(tmp + 1) - off;
-			i = chop_out(off, i, j);
+			j = (size_t) (skip_zero(tmp + 1) - off);
+			(void) chop_out(off, (unsigned) i, (unsigned) j);
 			found = TRUE;
 		    }
 		}
@@ -293,10 +293,10 @@
 	    if (!found
 		&& (tmp = strstr(end, off)) != 0
 		&& strcmp(end, off) != 0) {
-		i = tmp - end;
+		i = (size_t) (tmp - end);
 		j = strlen(off);
 		tmp = strdup(end);
-		chop_out(tmp, i, j);
+		chop_out(tmp, (unsigned) i, (unsigned) j);
 		free(off);
 		result = tmp;
 	    }
diff -Naur ncurses-5.7.orig/ncurses/tinfo/use_screen.c ncurses-5.7/ncurses/tinfo/use_screen.c
--- ncurses-5.7.orig/ncurses/tinfo/use_screen.c	2008-06-07 15:16:56.000000000 -0400
+++ ncurses-5.7/ncurses/tinfo/use_screen.c	2011-01-08 18:13:50.735157022 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2007,2008 Free Software Foundation, Inc.                   *
+ * Copyright (c) 2007-2008,2009 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -32,7 +32,7 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: use_screen.c,v 1.6 2008/06/07 19:16:56 tom Exp $")
+MODULE_ID("$Id: use_screen.c,v 1.8 2009/10/24 22:40:20 tom Exp $")
 
 NCURSES_EXPORT(int)
 use_screen(SCREEN *screen, NCURSES_SCREEN_CB func, void *data)
@@ -40,14 +40,14 @@
     SCREEN *save_SP;
     int code = OK;
 
-    T((T_CALLED("use_screen(%p,%p,%p)"), screen, func, data));
+    T((T_CALLED("use_screen(%p,%p,%p)"), (void *) screen, func, (void *) data));
 
     /*
      * FIXME - add a flag so a given thread can check if _it_ has already
      * recurred through this point, return an error if so.
      */
     _nc_lock_global(curses);
-    save_SP = SP;
+    save_SP = CURRENT_SCREEN;
     set_term(screen);
 
     code = func(screen, data);
diff -Naur ncurses-5.7.orig/ncurses/tinfo/write_entry.c ncurses-5.7/ncurses/tinfo/write_entry.c
--- ncurses-5.7.orig/ncurses/tinfo/write_entry.c	2008-08-03 15:24:00.000000000 -0400
+++ ncurses-5.7/ncurses/tinfo/write_entry.c	2011-01-08 18:18:29.754781633 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2007,2008 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            *
@@ -42,7 +42,6 @@
 #include <sys/stat.h>
 
 #include <tic.h>
-#include <term_entry.h>
 
 #ifndef S_ISDIR
 #define S_ISDIR(mode) ((mode & S_IFMT) == S_IFDIR)
@@ -54,7 +53,7 @@
 #define TRACE_OUT(p)		/*nothing */
 #endif
 
-MODULE_ID("$Id: write_entry.c,v 1.72 2008/08/03 19:24:00 tom Exp $")
+MODULE_ID("$Id: write_entry.c,v 1.78 2010/12/25 23:23:08 tom Exp $")
 
 static int total_written;
 
@@ -137,10 +136,12 @@
 	if (_nc_is_dir_path(dst)) {
 	    rc = -1;
 	} else {
+	    static const char suffix[] = DBM_SUFFIX;
 	    unsigned have = strlen(dst);
-	    if (have > 3 && strcmp(dst + have - 3, DBM_SUFFIX)) {
-		if (have + 3 <= limit)
-		    strcat(dst, DBM_SUFFIX);
+	    unsigned need = strlen(suffix);
+	    if (have > need && strcmp(dst + have - need, suffix)) {
+		if (have + need <= limit)
+		    strcat(dst, suffix);
 		else
 		    rc = -1;
 	    }
@@ -171,7 +172,11 @@
 	struct stat statbuf;
 
 	if ((rc = stat(path, &statbuf)) < 0) {
-	    rc = mkdir(path, 0777);
+	    rc = mkdir(path
+#if !defined(__MINGW32__)
+		       ,0777
+#endif
+		);
 	} else if (_nc_access(path, R_OK | W_OK | X_OK) < 0) {
 	    rc = -1;		/* permission denied */
 	} else if (!(S_ISDIR(statbuf.st_mode))) {
@@ -338,6 +343,7 @@
 
 	    while (*other_names != '\0') {
 		ptr = other_names++;
+		assert(ptr < buffer + sizeof(buffer) - 1);
 		while (*other_names != '|' && *other_names != '\0')
 		    other_names++;
 
@@ -357,7 +363,7 @@
 	start_time = 0;
     }
 
-    if (strlen(first_name) >= sizeof(filename) - 3)
+    if (strlen(first_name) >= sizeof(filename) - (2 + LEAF_LEN))
 	_nc_warning("terminal name too long.");
 
     sprintf(filename, LEAF_FMT "/%s", first_name[0], first_name);
@@ -385,14 +391,13 @@
     }
     while (*other_names != '\0') {
 	ptr = other_names++;
-	assert(ptr < buffer + sizeof(buffer) - 1);
 	while (*other_names != '|' && *other_names != '\0')
 	    other_names++;
 
 	if (*other_names != '\0')
 	    *(other_names++) = '\0';
 
-	if (strlen(ptr) > sizeof(linkname) - 3) {
+	if (strlen(ptr) > sizeof(linkname) - (2 + LEAF_LEN)) {
 	    _nc_warning("terminal alias %s too long.", ptr);
 	    continue;
 	}
@@ -414,8 +419,12 @@
 	{
 	    int code;
 #if USE_SYMLINKS
-	    strcpy(symlinkname, "../");
-	    strncat(symlinkname, filename, sizeof(symlinkname) - 4);
+	    if (first_name[0] == linkname[0])
+		strncpy(symlinkname, first_name, sizeof(symlinkname) - 1);
+	    else {
+		strcpy(symlinkname, "../");
+		strncat(symlinkname, filename, sizeof(symlinkname) - 4);
+	    }
 	    symlinkname[sizeof(symlinkname) - 1] = '\0';
 #endif /* USE_SYMLINKS */
 #if HAVE_REMOVE
@@ -460,26 +469,26 @@
 #endif /* USE_HASHED_DB */
 }
 
-static unsigned
+static size_t
 fake_write(char *dst,
 	   unsigned *offset,
-	   unsigned limit,
+	   size_t limit,
 	   char *src,
-	   unsigned want,
-	   unsigned size)
+	   size_t want,
+	   size_t size)
 {
-    int have = (limit - *offset);
+    size_t have = (limit - *offset);
 
     want *= size;
     if (have > 0) {
-	if ((int) want > have)
+	if (want > have)
 	    want = have;
 	memcpy(dst + *offset, src, want);
-	*offset += want;
+	*offset += (unsigned) want;
     } else {
 	want = 0;
     }
-    return (int) (want / size);
+    return (want / size);
 }
 
 #define Write(buf, size, count) fake_write(buffer, offset, limit, (char *) buf, count, size)
@@ -487,15 +496,16 @@
 #undef LITTLE_ENDIAN		/* BSD/OS defines this as a feature macro */
 #define HI(x)			((x) / 256)
 #define LO(x)			((x) % 256)
-#define LITTLE_ENDIAN(p, x)	(p)[0] = LO(x), (p)[1] = HI(x)
+#define LITTLE_ENDIAN(p, x)	(p)[0] = (unsigned char)LO(x),  \
+                                (p)[1] = (unsigned char)HI(x)
 
 #define WRITE_STRING(str) (Write(str, sizeof(char), strlen(str) + 1) == strlen(str) + 1)
 
 static int
-compute_offsets(char **Strings, unsigned strmax, short *offsets)
+compute_offsets(char **Strings, size_t strmax, short *offsets)
 {
-    size_t nextfree = 0;
-    unsigned i;
+    int nextfree = 0;
+    size_t i;
 
     for (i = 0; i < strmax; i++) {
 	if (Strings[i] == ABSENT_STRING) {
@@ -503,8 +513,8 @@
 	} else if (Strings[i] == CANCELLED_STRING) {
 	    offsets[i] = -2;
 	} else {
-	    offsets[i] = nextfree;
-	    nextfree += strlen(Strings[i]) + 1;
+	    offsets[i] = (short) nextfree;
+	    nextfree += (int) strlen(Strings[i]) + 1;
 	    TRACE_OUT(("put Strings[%d]=%s(%d)", (int) i,
 		       _nc_visbuf(Strings[i]), (int) nextfree));
 	}
@@ -513,9 +523,9 @@
 }
 
 static void
-convert_shorts(unsigned char *buf, short *Numbers, unsigned count)
+convert_shorts(unsigned char *buf, short *Numbers, size_t count)
 {
-    unsigned i;
+    size_t i;
     for (i = 0; i < count; i++) {
 	if (Numbers[i] == ABSENT_NUMERIC) {	/* HI/LO won't work */
 	    buf[2 * i] = buf[2 * i + 1] = 0377;
@@ -524,7 +534,7 @@
 	    buf[2 * i + 1] = 0377;
 	} else {
 	    LITTLE_ENDIAN(buf + 2 * i, Numbers[i]);
-	    TRACE_OUT(("put Numbers[%d]=%d", i, Numbers[i]));
+	    TRACE_OUT(("put Numbers[%u]=%d", (unsigned) i, Numbers[i]));
 	}
     }
 }
@@ -536,8 +546,8 @@
 static unsigned
 extended_Booleans(TERMTYPE *tp)
 {
-    unsigned short result = 0;
-    unsigned short i;
+    unsigned result = 0;
+    unsigned i;
 
     for (i = 0; i < tp->ext_Booleans; ++i) {
 	if (tp->Booleans[BOOLCOUNT + i] == TRUE)
@@ -549,8 +559,8 @@
 static unsigned
 extended_Numbers(TERMTYPE *tp)
 {
-    unsigned short result = 0;
-    unsigned short i;
+    unsigned result = 0;
+    unsigned i;
 
     for (i = 0; i < tp->ext_Numbers; ++i) {
 	if (tp->Numbers[NUMCOUNT + i] != ABSENT_NUMERIC)
@@ -567,7 +577,7 @@
 
     for (i = 0; i < tp->ext_Strings; ++i) {
 	if (tp->Strings[STRCOUNT + i] != ABSENT_STRING)
-	    result = (i + 1);
+	    result = (unsigned short) (i + 1);
     }
     return result;
 }
@@ -597,7 +607,7 @@
     size_t namelen, boolmax, nummax, strmax;
     char zero = '\0';
     size_t i;
-    short nextfree;
+    int nextfree;
     short offsets[MAX_ENTRY_SIZE / 2];
     unsigned char buf[MAX_ENTRY_SIZE];
     unsigned last_bool = BOOLWRITE;
@@ -690,7 +700,7 @@
 
 #if NCURSES_XNAMES
     if (extended_object(tp)) {
-	unsigned extcnt = NUM_EXT_NAMES(tp);
+	unsigned extcnt = (unsigned) NUM_EXT_NAMES(tp);
 
 	if (even_boundary(nextfree))
 	    return (ERR);
diff -Naur ncurses-5.7.orig/ncurses/trace/lib_trace.c ncurses-5.7/ncurses/trace/lib_trace.c
--- ncurses-5.7.orig/ncurses/trace/lib_trace.c	2008-08-23 14:04:29.000000000 -0400
+++ ncurses-5.7/ncurses/trace/lib_trace.c	2011-01-08 18:18:29.754781633 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2007,2008 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            *
@@ -30,6 +30,7 @@
  *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995               *
  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
  *     and: Thomas E. Dickey                        1996-on                 *
+ *     and: Juergen Pfeifer                                                 *
  ****************************************************************************/
 
 /*
@@ -46,7 +47,7 @@
 
 #include <ctype.h>
 
-MODULE_ID("$Id: lib_trace.c,v 1.71 2008/08/23 18:04:29 tom Exp $")
+MODULE_ID("$Id: lib_trace.c,v 1.76 2010/12/19 01:21:19 tom Exp $")
 
 NCURSES_EXPORT_VAR(unsigned) _nc_tracing = 0; /* always define this */
 
@@ -56,26 +57,26 @@
 NCURSES_EXPORT(const char *)
 NCURSES_PUBLIC_VAR(_nc_tputs_trace) (void)
 {
-    return SP ? SP->_tputs_trace : _nc_prescreen._tputs_trace;
+    return CURRENT_SCREEN ? CURRENT_SCREEN->_tputs_trace : _nc_prescreen._tputs_trace;
 }
 NCURSES_EXPORT(long)
 NCURSES_PUBLIC_VAR(_nc_outchars) (void)
 {
-    return SP ? SP->_outchars : _nc_prescreen._outchars;
+    return CURRENT_SCREEN ? CURRENT_SCREEN->_outchars : _nc_prescreen._outchars;
 }
 NCURSES_EXPORT(void)
 _nc_set_tputs_trace(const char *s)
 {
-    if (SP)
-	SP->_tputs_trace = s;
+    if (CURRENT_SCREEN)
+	CURRENT_SCREEN->_tputs_trace = s;
     else
 	_nc_prescreen._tputs_trace = s;
 }
 NCURSES_EXPORT(void)
 _nc_count_outchars(long increment)
 {
-    if (SP)
-	SP->_outchars += increment;
+    if (CURRENT_SCREEN)
+	CURRENT_SCREEN->_outchars += increment;
     else
 	_nc_prescreen._outchars += increment;
 }
@@ -95,7 +96,7 @@
 	const char *mode = _nc_globals.init_trace ? "ab" : "wb";
 
 	if (TracePath[0] == '\0') {
-	    int size = sizeof(TracePath) - 12;
+	    size_t size = sizeof(TracePath) - 12;
 	    if (getcwd(TracePath, size) == 0) {
 		perror("curses: Can't get working directory");
 		exit(EXIT_FAILURE);
@@ -121,7 +122,7 @@
 	 */
 #if HAVE_SETVBUF		/* ANSI */
 	(void) setvbuf(TraceFP, (char *) 0, _IOLBF, 0);
-#elif HAVE_SETBUF		/* POSIX */
+#elif HAVE_SETBUF /* POSIX */
 	(void) setbuffer(TraceFP, (char *) 0);
 #endif
 	_tracef("TRACING NCURSES version %s.%d (tracelevel=%#x)",
@@ -183,8 +184,12 @@
 # if USE_WEAK_SYMBOLS
 	if ((pthread_self))
 # endif
+#ifdef __MINGW32__
+	    fprintf(TraceFP, "%#lx:", (long) (void *) pthread_self().p);
+#else
 	    fprintf(TraceFP, "%#lx:", (long) (void *) pthread_self());
 #endif
+#endif
 	if (before || after) {
 	    int n;
 	    for (n = 1; n < TraceLevel; n++)
@@ -219,6 +224,14 @@
     return code;
 }
 
+/* Trace 'char' return-values */
+NCURSES_EXPORT(char)
+_nc_retrace_char(char code)
+{
+    T((T_RETURN("%c"), code));
+    return code;
+}
+
 /* Trace 'int' return-values */
 NCURSES_EXPORT(int)
 _nc_retrace_int(int code)
@@ -271,7 +284,7 @@
 NCURSES_EXPORT(SCREEN *)
 _nc_retrace_sp(SCREEN *code)
 {
-    T((T_RETURN("%p"), code));
+    T((T_RETURN("%p"), (void *) code));
     return code;
 }
 
@@ -279,7 +292,7 @@
 NCURSES_EXPORT(WINDOW *)
 _nc_retrace_win(WINDOW *code)
 {
-    T((T_RETURN("%p"), code));
+    T((T_RETURN("%p"), (void *) code));
     return code;
 }
 
diff -Naur ncurses-5.7.orig/ncurses/trace/lib_traceatr.c ncurses-5.7/ncurses/trace/lib_traceatr.c
--- ncurses-5.7.orig/ncurses/trace/lib_traceatr.c	2008-08-03 12:24:53.000000000 -0400
+++ ncurses-5.7/ncurses/trace/lib_traceatr.c	2011-01-08 18:18:29.818781794 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2007,2008 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            *
@@ -30,6 +30,7 @@
  *  Author: Thomas Dickey                           1996-on                 *
  *     and: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995               *
  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
+ *     and: Juergen Pfeifer                                                 *
  ****************************************************************************/
 
 /*
@@ -37,9 +38,12 @@
  */
 
 #include <curses.priv.h>
-#include <term.h>		/* acs_chars */
 
-MODULE_ID("$Id: lib_traceatr.c,v 1.63 2008/08/03 16:24:53 tom Exp $")
+#ifndef CUR
+#define CUR SP_TERMTYPE
+#endif
+
+MODULE_ID("$Id: lib_traceatr.c,v 1.73 2011/01/01 22:01:11 tom Exp $")
 
 #define COLOR_OF(c) ((c < 0) ? "default" : (c > 7 ? color_of(c) : colors[c].name))
 
@@ -128,11 +132,11 @@
 	for (n = 0; n < SIZEOF(names); n++) {
 	    if ((newmode & names[n].val) != 0) {
 		if (result[1] != '\0')
-		    result = _nc_trace_bufcat(bufnum, "|");
+		    (void) _nc_trace_bufcat(bufnum, "|");
 		result = _nc_trace_bufcat(bufnum, names[n].name);
 
 		if (names[n].val == A_COLOR) {
-		    short pairnum = PAIR_NUMBER(newmode);
+		    short pairnum = (short) PairNumber(newmode);
 #ifdef USE_TERMLIB
 		    /* pair_content lives in libncurses */
 		    (void) sprintf(temp, "{%d}", pairnum);
@@ -172,6 +176,14 @@
 }
 
 /* Trace 'int' return-values */
+NCURSES_EXPORT(int)
+_nc_retrace_int_attr_t(attr_t code)
+{
+    T((T_RETURN("%s"), _traceattr(code)));
+    return (int) code;
+}
+
+/* Trace 'attr_t' return-values */
 NCURSES_EXPORT(attr_t)
 _nc_retrace_attr_t(attr_t code)
 {
@@ -186,6 +198,9 @@
 	unsigned int val;
 	const char *name;
     } ALT_NAMES;
+#if NCURSES_SP_FUNCS
+    SCREEN *sp = CURRENT_SCREEN;
+#endif
     static const ALT_NAMES names[] =
     {
 	{'l', "ACS_ULCORNER"},	/* upper left corner */
@@ -225,23 +240,26 @@
 
     const char *result = 0;
 
+#if NCURSES_SP_FUNCS
+    (void) sp;
+#endif
     if ((attr & A_ALTCHARSET) && (acs_chars != 0)) {
 	char *cp;
 	char *found = 0;
-	const ALT_NAMES *sp;
+	const ALT_NAMES *strp;
 
 	for (cp = acs_chars; cp[0] && cp[1]; cp += 2) {
-	    if (ChCharOf(cp[1]) == ChCharOf(ch)) {
+	    if (ChCharOf(UChar(cp[1])) == ChCharOf(ch)) {
 		found = cp;
 		/* don't exit from loop - there may be redefinitions */
 	    }
 	}
 
 	if (found != 0) {
-	    ch = ChCharOf(*found);
-	    for (sp = names; sp->val; sp++)
-		if (sp->val == ch) {
-		    result = sp->name;
+	    ch = ChCharOf(UChar(*found));
+	    for (strp = names; strp->val; strp++)
+		if (strp->val == ch) {
+		    result = strp->name;
 		    break;
 		}
 	}
@@ -260,7 +278,9 @@
 	if ((found = _nc_altcharset_name(ChAttrOf(ch), ch)) != 0) {
 	    (void) _nc_trace_bufcat(bufnum, found);
 	} else
-	    (void) _nc_trace_bufcat(bufnum, _nc_tracechar(SP, (int) ChCharOf(ch)));
+	    (void) _nc_trace_bufcat(bufnum,
+				    _nc_tracechar(CURRENT_SCREEN,
+						  (int) ChCharOf(ch)));
 
 	if (ChAttrOf(ch) != A_NORMAL) {
 	    (void) _nc_trace_bufcat(bufnum, " | ");
@@ -313,14 +333,17 @@
 		(void) _nc_trace_bufcat(bufnum, "{ ");
 		for (PUTC_i = 0; PUTC_i < CCHARW_MAX; ++PUTC_i) {
 		    PUTC_ch = ch->chars[PUTC_i];
-		    if (PUTC_ch == L'\0')
+		    if (PUTC_ch == L'\0') {
+			if (PUTC_i == 0)
+			    (void) _nc_trace_bufcat(bufnum, "\\000");
 			break;
-		    PUTC_n = wcrtomb(PUTC_buf, ch->chars[PUTC_i], &PUT_st);
+		    }
+		    PUTC_n = (int) wcrtomb(PUTC_buf, ch->chars[PUTC_i], &PUT_st);
 		    if (PUTC_n <= 0) {
 			if (PUTC_ch != L'\0') {
 			    /* it could not be a multibyte sequence */
 			    (void) _nc_trace_bufcat(bufnum,
-						    _nc_tracechar(SP,
+						    _nc_tracechar(CURRENT_SCREEN,
 								  UChar(ch->chars[PUTC_i])));
 			}
 			break;
@@ -329,7 +352,7 @@
 			if (n)
 			    (void) _nc_trace_bufcat(bufnum, ", ");
 			(void) _nc_trace_bufcat(bufnum,
-						_nc_tracechar(SP,
+						_nc_tracechar(CURRENT_SCREEN,
 							      UChar(PUTC_buf[n])));
 		    }
 		}
diff -Naur ncurses-5.7.orig/ncurses/trace/lib_tracebits.c ncurses-5.7/ncurses/trace/lib_tracebits.c
--- ncurses-5.7.orig/ncurses/trace/lib_tracebits.c	2008-08-03 12:09:26.000000000 -0400
+++ ncurses-5.7/ncurses/trace/lib_tracebits.c	2011-01-08 18:13:50.739156788 -0500
@@ -33,9 +33,8 @@
  ****************************************************************************/
 
 #include <curses.priv.h>
-#include <term.h>		/* cur_term */
 
-MODULE_ID("$Id: lib_tracebits.c,v 1.17 2008/08/03 16:09:26 tom Exp $")
+MODULE_ID("$Id: lib_tracebits.c,v 1.18 2008/11/16 00:19:59 juergen Exp $")
 
 #if SVR4_TERMIO && !defined(_POSIX_SOURCE)
 #define _POSIX_SOURCE
diff -Naur ncurses-5.7.orig/ncurses/trace/lib_tracechr.c ncurses-5.7/ncurses/trace/lib_tracechr.c
--- ncurses-5.7.orig/ncurses/trace/lib_tracechr.c	2008-08-03 11:39:29.000000000 -0400
+++ ncurses-5.7/ncurses/trace/lib_tracechr.c	2011-01-08 18:13:50.739156788 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -39,7 +39,7 @@
 
 #include <ctype.h>
 
-MODULE_ID("$Id: lib_tracechr.c,v 1.19 2008/08/03 15:39:29 tom Exp $")
+MODULE_ID("$Id: lib_tracechr.c,v 1.20 2009/04/18 22:48:29 tom Exp $")
 
 #ifdef TRACE
 
@@ -52,7 +52,7 @@
 		      : _nc_globals.tracechr_buf);
 
     if (ch > KEY_MIN || ch < 0) {
-	name = _nc_keyname(sp, ch);
+	name = safe_keyname(SP_PARM, ch);
 	if (name == 0 || *name == '\0')
 	    name = "NULL";
 	(void) sprintf(MyBuffer, "'%.30s' = %#03o", name, ch);
@@ -64,7 +64,7 @@
 	 */
 	(void) sprintf(MyBuffer, "%#03o", ch);
     } else {
-	name = _nc_unctrl(sp, (chtype) ch);
+	name = safe_unctrl(SP_PARM, (chtype) ch);
 	if (name == 0 || *name == 0)
 	    name = "null";	/* shouldn't happen */
 	(void) sprintf(MyBuffer, "'%.30s' = %#03o", name, ch);
@@ -75,7 +75,7 @@
 NCURSES_EXPORT(char *)
 _tracechar(int ch)
 {
-    return _nc_tracechar(SP, ch);
+    return _nc_tracechar(CURRENT_SCREEN, ch);
 }
 #else
 EMPTY_MODULE(_nc_lib_tracechr)
diff -Naur ncurses-5.7.orig/ncurses/trace/lib_tracedmp.c ncurses-5.7/ncurses/trace/lib_tracedmp.c
--- ncurses-5.7.orig/ncurses/trace/lib_tracedmp.c	2008-08-16 15:30:56.000000000 -0400
+++ ncurses-5.7/ncurses/trace/lib_tracedmp.c	2011-01-08 18:13:50.739156788 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -39,7 +39,7 @@
 #include <curses.priv.h>
 #include <ctype.h>
 
-MODULE_ID("$Id: lib_tracedmp.c,v 1.31 2008/08/16 19:30:56 tom Exp $")
+MODULE_ID("$Id: lib_tracedmp.c,v 1.32 2009/04/18 21:01:38 tom Exp $")
 
 #ifdef TRACE
 
@@ -68,7 +68,7 @@
     if (width < win->_maxx)
 	++width;
     if (++width + 1 > (int) my_length) {
-	my_length = 2 * (width + 1);
+	my_length = (unsigned) (2 * (width + 1));
 	my_buffer = typeRealloc(char, my_length, my_buffer);
     }
 
@@ -82,7 +82,7 @@
 	 * we map those to '.' and '?' respectively.
 	 */
 	for (j = 0; j < width; ++j) {
-	    chtype test = CharOf(win->_line[n].text[j]);
+	    chtype test = (chtype) CharOf(win->_line[n].text[j]);
 	    ep[j] = (char) ((UChar(test) == test
 #if USE_WIDEC_SUPPORT
 			     && (win->_line[n].text[j].chars[1] == 0)
@@ -111,7 +111,7 @@
 	    if (multicolumn) {
 		ep = my_buffer;
 		for (j = 0; j < width; ++j) {
-		    int test = WidecExt(win->_line[n].text[j]);
+		    chtype test = WidecExt(win->_line[n].text[j]);
 		    if (test) {
 			ep[j] = (char) (test + '0');
 		    } else {
@@ -153,7 +153,7 @@
 
 	for (i = 0; i < 4; ++i) {
 	    const char *hex = " 123456789ABCDEF";
-	    attr_t mask = (0xf << ((i + 4) * 4));
+	    attr_t mask = (attr_t) (0xf << ((i + 4) * 4));
 
 	    haveattrs = FALSE;
 	    for (j = 0; j < width; ++j)
diff -Naur ncurses-5.7.orig/ncurses/trace/lib_tracemse.c ncurses-5.7/ncurses/trace/lib_tracemse.c
--- ncurses-5.7.orig/ncurses/trace/lib_tracemse.c	2008-08-03 11:39:29.000000000 -0400
+++ ncurses-5.7/ncurses/trace/lib_tracemse.c	2011-01-08 18:18:29.818781794 -0500
@@ -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            *
@@ -38,23 +38,16 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_tracemse.c,v 1.15 2008/08/03 15:39:29 tom Exp $")
+MODULE_ID("$Id: lib_tracemse.c,v 1.17 2011/01/01 22:31:53 tom Exp $")
 
 #ifdef TRACE
 
 #define my_buffer sp->tracemse_buf
 
-NCURSES_EXPORT(char *)
-_nc_tracemouse(SCREEN *sp, MEVENT const *ep)
+static char *
+_trace_mmask_t(SCREEN *sp, mmask_t code)
 {
-    (void) sprintf(my_buffer, TRACEMSE_FMT,
-		   ep->id,
-		   ep->x,
-		   ep->y,
-		   ep->z,
-		   (unsigned long) ep->bstate);
-
-#define SHOW(m, s) if ((ep->bstate & m) == m) strcat(strcat(my_buffer, s), ", ")
+#define SHOW(m, s) if ((code & m) == m) strcat(strcat(my_buffer, s), ", ")
 
     SHOW(BUTTON1_RELEASED, "release-1");
     SHOW(BUTTON1_PRESSED, "press-1");
@@ -110,14 +103,37 @@
 
     if (my_buffer[strlen(my_buffer) - 1] == ' ')
 	my_buffer[strlen(my_buffer) - 2] = '\0';
+
+    return (my_buffer);
+}
+
+NCURSES_EXPORT(char *)
+_nc_tracemouse(SCREEN *sp, MEVENT const *ep)
+{
+    (void) sprintf(my_buffer, TRACEMSE_FMT,
+		   ep->id,
+		   ep->x,
+		   ep->y,
+		   ep->z,
+		   (unsigned long) ep->bstate);
+
+    (void) _trace_mmask_t(sp, ep->bstate);
     (void) strcat(my_buffer, "}");
     return (my_buffer);
 }
 
+NCURSES_EXPORT(mmask_t)
+_nc_retrace_mmask_t(SCREEN *sp, mmask_t code)
+{
+    *my_buffer = '\0';
+    T((T_RETURN("{%s}"), _trace_mmask_t(sp, code)));
+    return code;
+}
+
 NCURSES_EXPORT(char *)
 _tracemouse(MEVENT const *ep)
 {
-    return _nc_tracemouse(SP, ep);
+    return _nc_tracemouse(CURRENT_SCREEN, ep);
 }
 
 #else /* !TRACE */
diff -Naur ncurses-5.7.orig/ncurses/trace/trace_buf.c ncurses-5.7/ncurses/trace/trace_buf.c
--- ncurses-5.7.orig/ncurses/trace/trace_buf.c	2008-08-03 11:13:56.000000000 -0400
+++ ncurses-5.7/ncurses/trace/trace_buf.c	2011-01-08 18:18:29.135406677 -0500
@@ -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            *
@@ -35,7 +35,7 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: trace_buf.c,v 1.14 2008/08/03 15:13:56 tom Exp $")
+MODULE_ID("$Id: trace_buf.c,v 1.15 2010/08/28 21:08:42 tom Exp $")
 
 #define MyList _nc_globals.tracebuf_ptr
 #define MySize _nc_globals.tracebuf_used
@@ -47,7 +47,7 @@
 
     if (bufnum >= 0) {
 	if ((size_t) (bufnum + 1) > MySize) {
-	    size_t need = (bufnum + 1) * 2;
+	    size_t need = (size_t) (bufnum + 1) * 2;
 	    if ((MyList = typeRealloc(TRACEBUF, need, MyList)) != 0) {
 		while (need > MySize)
 		    MyList[MySize++].text = 0;
diff -Naur ncurses-5.7.orig/ncurses/trace/trace_tries.c ncurses-5.7/ncurses/trace/trace_tries.c
--- ncurses-5.7.orig/ncurses/trace/trace_tries.c	2008-08-03 11:43:30.000000000 -0400
+++ ncurses-5.7/ncurses/trace/trace_tries.c	2011-01-08 18:13:50.739156788 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1999-2007,2008 Free Software Foundation, Inc.              *
+ * Copyright (c) 1999-2008,2009 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -35,7 +35,7 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: trace_tries.c,v 1.13 2008/08/03 15:43:30 tom Exp $")
+MODULE_ID("$Id: trace_tries.c,v 1.15 2009/10/24 22:15:47 tom Exp $")
 
 #ifdef TRACE
 #define my_buffer _nc_globals.tracetry_buf
@@ -46,7 +46,7 @@
 {
     if (level > my_length) {
 	my_length = (level + 1) * 4;
-	my_buffer = (unsigned char *) realloc(my_buffer, my_length);
+	my_buffer = (unsigned char *) _nc_doalloc(my_buffer, my_length);
     }
 
     while (tree != 0) {
@@ -67,9 +67,9 @@
 _nc_trace_tries(TRIES * tree)
 {
     my_buffer = typeMalloc(unsigned char, my_length = 80);
-    _tracef("BEGIN tries %p", tree);
+    _tracef("BEGIN tries %p", (void *) tree);
     recur_tries(tree, 0);
-    _tracef(". . . tries %p", tree);
+    _tracef(". . . tries %p", (void *) tree);
     free(my_buffer);
 }
 
diff -Naur ncurses-5.7.orig/ncurses/trace/trace_xnames.c ncurses-5.7/ncurses/trace/trace_xnames.c
--- ncurses-5.7.orig/ncurses/trace/trace_xnames.c	2000-12-09 22:02:45.000000000 -0500
+++ ncurses-5.7/ncurses/trace/trace_xnames.c	2011-01-08 18:13:50.739156788 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1999,2000 Free Software Foundation, Inc.                   *
+ * Copyright (c) 1999-2000,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            *
@@ -34,12 +34,11 @@
  */
 
 #include <curses.priv.h>
-#include <term_entry.h>
 
-MODULE_ID("$Id: trace_xnames.c,v 1.5 2000/12/10 03:02:45 tom Exp $")
+MODULE_ID("$Id: trace_xnames.c,v 1.6 2010/01/23 17:59:27 tom Exp $")
 
 NCURSES_EXPORT(void)
-_nc_trace_xnames(TERMTYPE * tp GCC_UNUSED)
+_nc_trace_xnames(TERMTYPE *tp GCC_UNUSED)
 {
 #ifdef TRACE
 #if NCURSES_XNAMES
diff -Naur ncurses-5.7.orig/ncurses/trace/varargs.c ncurses-5.7/ncurses/trace/varargs.c
--- ncurses-5.7.orig/ncurses/trace/varargs.c	2008-08-03 11:42:49.000000000 -0400
+++ ncurses-5.7/ncurses/trace/varargs.c	2011-01-08 18:13:50.739156788 -0500
@@ -34,7 +34,7 @@
 
 #include <ctype.h>
 
-MODULE_ID("$Id: varargs.c,v 1.7 2008/08/03 15:42:49 tom Exp $")
+MODULE_ID("$Id: varargs.c,v 1.8 2008/11/16 00:19:59 juergen Exp $")
 
 #ifdef TRACE
 
@@ -44,7 +44,7 @@
     atUnknown = 0, atInteger, atFloat, atPoint, atString
 } ARGTYPE;
 
-#define VA_INT(type) ival = va_arg(ap, type)
+#define VA_INT(type) ival = (int) va_arg(ap, type)
 #define VA_FLT(type) fval = va_arg(ap, type)
 #define VA_PTR(type) pval = (char *)va_arg(ap, type)
 #define VA_STR(type) sval = va_arg(ap, type)
diff -Naur ncurses-5.7.orig/ncurses/trace/visbuf.c ncurses-5.7/ncurses/trace/visbuf.c
--- ncurses-5.7.orig/ncurses/trace/visbuf.c	2008-08-04 19:07:39.000000000 -0400
+++ ncurses-5.7/ncurses/trace/visbuf.c	2011-01-08 18:13:50.739156788 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2001-2007,2008 Free Software Foundation, Inc.              *
+ * Copyright (c) 2001-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            *
@@ -42,7 +42,9 @@
 #include <tic.h>
 #include <ctype.h>
 
-MODULE_ID("$Id: visbuf.c,v 1.32 2008/08/04 23:07:39 tom Exp $")
+MODULE_ID("$Id: visbuf.c,v 1.37 2010/05/29 18:51:41 tom Exp $")
+
+#define NUM_VISBUFS 4
 
 #define NormalLen(len) (size_t) (((size_t)(len) + 1) * 4)
 #define WideLen(len)   (size_t) (((size_t)(len) + 1) * 4 * MB_CUR_MAX)
@@ -92,7 +94,7 @@
 static const char *
 _nc_visbuf2n(int bufnum, const char *buf, int len)
 {
-    const char *vbuf;
+    const char *vbuf = 0;
     char *tp;
     int c;
 
@@ -108,9 +110,16 @@
     vbuf = tp = _nc_trace_buf(bufnum, NormalLen(len));
 #else
     {
-	static char *mybuf[4];
-	mybuf[bufnum] = typeRealloc(char, NormalLen(len), mybuf[bufnum]);
-	vbuf = tp = mybuf[bufnum];
+	static char *mybuf[NUM_VISBUFS];
+	if (bufnum < 0) {
+	    for (c = 0; c < NUM_VISBUFS; ++c) {
+		FreeAndNull(mybuf[c]);
+	    }
+	    tp = 0;
+	} else {
+	    mybuf[bufnum] = typeRealloc(char, NormalLen(len), mybuf[bufnum]);
+	    vbuf = tp = mybuf[bufnum];
+	}
     }
 #endif
     if (tp != 0) {
@@ -119,7 +128,7 @@
 	    tp = _nc_vischar(tp, UChar(c));
 	}
 	*tp++ = D_QUOTE;
-	*tp++ = '\0';
+	*tp = '\0';
     } else {
 	vbuf = ("(_nc_visbuf2n failed)");
     }
@@ -177,7 +186,7 @@
     vbuf = tp = _nc_trace_buf(bufnum, WideLen(len));
 #else
     {
-	static char *mybuf[2];
+	static char *mybuf[NUM_VISBUFS];
 	mybuf[bufnum] = typeRealloc(char, WideLen(len), mybuf[bufnum]);
 	vbuf = tp = mybuf[bufnum];
     }
@@ -196,7 +205,7 @@
 	    }
 	}
 	*tp++ = D_QUOTE;
-	*tp++ = '\0';
+	*tp = '\0';
     } else {
 	vbuf = ("(_nc_viswbuf2n failed)");
     }
@@ -229,7 +238,9 @@
     static unsigned mylen;
     unsigned n;
 
-    for (n = 0; buf[n] != 0; ++n) ;
+    for (n = 0; buf[n] != 0; ++n) {
+	;			/* empty */
+    }
     if (mylen < ++n) {
 	mylen = n + 80;
 	if (mybuf != 0)
@@ -237,8 +248,10 @@
 	else
 	    mybuf = typeMalloc(wchar_t, mylen);
     }
-    for (n = 0; buf[n] != 0; ++n)
+    for (n = 0; buf[n] != 0; ++n) {
 	mybuf[n] = (wchar_t) buf[n];
+    }
+    mybuf[n] = L'\0';
 
     return _nc_viswbuf2(0, mybuf);
 }
@@ -274,12 +287,12 @@
 		}
 	    }
 
-	    result = _nc_trace_bufcat(bufnum, l_brace);
-	    result = _nc_trace_bufcat(bufnum, d_quote);
+	    (void) _nc_trace_bufcat(bufnum, l_brace);
+	    (void) _nc_trace_bufcat(bufnum, d_quote);
 	    for (j = first; j <= last; ++j) {
 		found = _nc_altcharset_name(attr, (chtype) CharOf(buf[j]));
 		if (found != 0) {
-		    result = _nc_trace_bufcat(bufnum, found);
+		    (void) _nc_trace_bufcat(bufnum, found);
 		    attr &= ~A_ALTCHARSET;
 		} else
 #if USE_WIDEC_SUPPORT
@@ -291,15 +304,19 @@
 			int k;
 
 			PUTC_ch = buf[j].chars[PUTC_i];
-			if (PUTC_ch == L'\0')
+			if (PUTC_ch == L'\0') {
+			    if (PUTC_i == 0)
+				(void) _nc_trace_bufcat(bufnum, "\\000");
 			    break;
-			PUTC_n = (int) wcrtomb(PUTC_buf, buf[j].chars[PUTC_i], &PUT_st);
+			}
+			PUTC_n = (int) wcrtomb(PUTC_buf,
+					       buf[j].chars[PUTC_i], &PUT_st);
 			if (PUTC_n <= 0)
 			    break;
 			for (k = 0; k < PUTC_n; k++) {
 			    char temp[80];
 			    _nc_vischar(temp, UChar(PUTC_buf[k]));
-			    result = _nc_trace_bufcat(bufnum, temp);
+			    (void) _nc_trace_bufcat(bufnum, temp);
 			}
 		    }
 		}
@@ -311,10 +328,10 @@
 		}
 #endif /* USE_WIDEC_SUPPORT */
 	    }
-	    result = _nc_trace_bufcat(bufnum, d_quote);
+	    (void) _nc_trace_bufcat(bufnum, d_quote);
 	    if (attr != A_NORMAL) {
-		result = _nc_trace_bufcat(bufnum, " | ");
-		result = _nc_trace_bufcat(bufnum, _traceattr2(bufnum + 20, attr));
+		(void) _nc_trace_bufcat(bufnum, " | ");
+		(void) _nc_trace_bufcat(bufnum, _traceattr2(bufnum + 20, attr));
 	    }
 	    result = _nc_trace_bufcat(bufnum, r_brace);
 	    first = last + 1;
diff -Naur ncurses-5.7.orig/ncurses/tty/MKexpanded.sh ncurses-5.7/ncurses/tty/MKexpanded.sh
--- ncurses-5.7.orig/ncurses/tty/MKexpanded.sh	2005-01-01 20:06:40.000000000 -0500
+++ ncurses-5.7/ncurses/tty/MKexpanded.sh	2011-01-08 18:13:50.739156788 -0500
@@ -1,6 +1,6 @@
 #! /bin/sh
 ##############################################################################
-# Copyright (c) 1998-2000,2005 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 "Software"), #
@@ -27,9 +27,9 @@
 # authorization.                                                             #
 ##############################################################################
 #
-# Author: Thomas E. Dickey <dickey@clark.net> 1997
+# Author: Thomas E. Dickey, 1997-on
 #
-# $Id: MKexpanded.sh,v 1.11 2005/01/02 01:06:40 tom Exp $
+# $Id: MKexpanded.sh,v 1.17 2010/01/23 17:57:43 tom Exp $
 #
 # Script to generate 'expanded.c', a dummy source that contains functions
 # corresponding to complex macros used in this library.  By making functions,
@@ -52,8 +52,13 @@
 
 cat <<EOF
 /* generated by MKexpanded.sh */
+#define NEED_NCURSES_CH_T 1
 #include <curses.priv.h>
-#include <term.h>
+
+#ifndef CUR
+#define CUR SP_TERMTYPE
+#endif
+
 #if NCURSES_EXPANDED
 EOF
 
@@ -68,29 +73,59 @@
 #undef FALSE
 /* this is a marker */
 IGNORE
-NCURSES_EXPORT(void) _nc_toggle_attr_on (attr_t *S, attr_t at)
+NCURSES_EXPORT(void)
+_nc_toggle_attr_on (attr_t *S, attr_t at)
 {
 	toggle_attr_on(*S,at);
 }
-NCURSES_EXPORT(void) _nc_toggle_attr_off (attr_t *S, attr_t at) 
+
+NCURSES_EXPORT(void)
+_nc_toggle_attr_off (attr_t *S, attr_t at) 
 {
 	toggle_attr_off(*S,at);
 }
-NCURSES_EXPORT(int) _nc_DelCharCost (int count)
+
+NCURSES_EXPORT(int)
+NCURSES_SP_NAME(_nc_DelCharCost) (NCURSES_SP_DCLx int count)
+{
+	return DelCharCost(SP_PARM, count);
+}
+
+NCURSES_EXPORT(int)
+NCURSES_SP_NAME(_nc_InsCharCost) (NCURSES_SP_DCLx int count)
 {
-	return DelCharCost(count);
+	return InsCharCost(SP_PARM, count);
 }
-NCURSES_EXPORT(int) _nc_InsCharCost (int count)
+
+NCURSES_EXPORT(void)
+NCURSES_SP_NAME(_nc_UpdateAttrs) (NCURSES_SP_DCLx CARG_CH_T c)
 {
-	return InsCharCost(count);
+	UpdateAttrs(SP_PARM, CHDEREF(c));
 }
-NCURSES_EXPORT(void) _nc_UpdateAttrs (NCURSES_CH_T c)
+
+@if_NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+_nc_DelCharCost (int count)
+{
+	return NCURSES_SP_NAME(_nc_DelCharCost) (CURRENT_SCREEN, count);
+}
+
+NCURSES_EXPORT(int)
+_nc_InsCharCost (int count)
+{
+	return NCURSES_SP_NAME(_nc_InsCharCost)(CURRENT_SCREEN, count);
+}
+
+NCURSES_EXPORT(void)
+_nc_UpdateAttrs (CARG_CH_T c)
 {
-	UpdateAttrs(c);
+	NCURSES_SP_NAME(_nc_UpdateAttrs)(CURRENT_SCREEN,c);
 }
+@endif
 EOF
 
-$preprocessor $TMP 2>/dev/null | sed -e '1,/^IGNORE$/d'
+$preprocessor $TMP 2>/dev/null | \
+	sed -e '1,/^IGNORE$/d' -e 's/^@/#/' -e 's/^#if_/#if /'
 
 cat <<EOF
 #else /* ! NCURSES_EXPANDED */
diff -Naur ncurses-5.7.orig/ncurses/tty/hardscroll.c ncurses-5.7/ncurses/tty/hardscroll.c
--- ncurses-5.7.orig/ncurses/tty/hardscroll.c	2008-08-03 19:49:30.000000000 -0400
+++ ncurses-5.7/ncurses/tty/hardscroll.c	2011-01-08 18:13:50.739156788 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2007,2008 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            *
@@ -147,90 +147,98 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: hardscroll.c,v 1.42 2008/08/03 23:49:30 tom Exp $")
+MODULE_ID("$Id: hardscroll.c,v 1.47 2010/04/24 23:46:47 tom Exp $")
 
 #if defined(SCROLLDEBUG) || defined(HASHDEBUG)
 
 # undef screen_lines
-# define screen_lines MAXLINES
-NCURSES_EXPORT_VAR(int)
-oldnums[MAXLINES];
-# define OLDNUM(n)	oldnums[n]
+# define screen_lines(sp) MAXLINES
+NCURSES_EXPORT_VAR (int)
+  oldnums[MAXLINES];
+# define OLDNUM(sp,n)	oldnums[n]
 # define _tracef	printf
 # undef TR
 # define TR(n, a)	if (_nc_tracing & (n)) { _tracef a ; putchar('\n'); }
 
-extern NCURSES_EXPORT_VAR(unsigned) _nc_tracing;
+extern				NCURSES_EXPORT_VAR(unsigned) _nc_tracing;
 
 #else /* no debug */
 
 /* OLDNUM(n) indicates which line will be shifted to the position n.
    if OLDNUM(n) == _NEWINDEX, then the line n in new, not shifted from
    somewhere. */
-NCURSES_EXPORT_VAR(int *)
-_nc_oldnums = 0;		/* obsolete: keep for ABI compat */
+NCURSES_EXPORT_VAR (int *)
+  _nc_oldnums = 0;		/* obsolete: keep for ABI compat */
 
 # if USE_HASHMAP
-#  define oldnums       SP->_oldnum_list
-#  define OLDNUM(n)	oldnums[n]
+#  define oldnums(sp)   (sp)->_oldnum_list
+#  define OLDNUM(sp,n)	oldnums(sp)[n]
 # else				/* !USE_HASHMAP */
-#  define OLDNUM(n)	newscr->_line[n].oldindex
+#  define OLDNUM(sp,n)	NewScreen(sp)->_line[n].oldindex
 # endif				/* !USE_HASHMAP */
 
-#define OLDNUM_SIZE     SP->_oldnum_size
+#define OLDNUM_SIZE(sp) (sp)->_oldnum_size
 
 #endif /* defined(SCROLLDEBUG) || defined(HASHDEBUG) */
 
 NCURSES_EXPORT(void)
-_nc_scroll_optimize(void)
+NCURSES_SP_NAME(_nc_scroll_optimize) (NCURSES_SP_DCL0)
 /* scroll optimization to transform curscr to newscr */
 {
     int i;
     int start, end, shift;
 
-    TR(TRACE_ICALLS, (T_CALLED("_nc_scroll_optimize")));
+    TR(TRACE_ICALLS, (T_CALLED("_nc_scroll_optimize(%p)"), (void *) SP_PARM));
 
 #if !defined(SCROLLDEBUG) && !defined(HASHDEBUG)
 #if USE_HASHMAP
     /* get enough storage */
-    if (OLDNUM_SIZE < screen_lines) {
-	int *new_oldnums = typeRealloc(int, screen_lines, oldnums);
+    if (OLDNUM_SIZE(SP_PARM) < screen_lines(SP_PARM)) {
+	int *new_oldnums = typeRealloc(int,
+				       (size_t) screen_lines(SP_PARM),
+				       oldnums(SP_PARM));
 	if (!new_oldnums)
 	    return;
-	oldnums = new_oldnums;
-	OLDNUM_SIZE = screen_lines;
+	oldnums(SP_PARM) = new_oldnums;
+	OLDNUM_SIZE(SP_PARM) = screen_lines(SP_PARM);
     }
     /* calculate the indices */
-    _nc_hash_map();
+    NCURSES_SP_NAME(_nc_hash_map) (NCURSES_SP_ARG);
 #endif
 #endif /* !defined(SCROLLDEBUG) && !defined(HASHDEBUG) */
 
 #ifdef TRACE
     if (USE_TRACEF(TRACE_UPDATE | TRACE_MOVE)) {
-	_nc_linedump();
+	NCURSES_SP_NAME(_nc_linedump) (NCURSES_SP_ARG);
 	_nc_unlock_global(tracef);
     }
 #endif /* TRACE */
 
     /* pass 1 - from top to bottom scrolling up */
-    for (i = 0; i < screen_lines;) {
-	while (i < screen_lines && (OLDNUM(i) == _NEWINDEX || OLDNUM(i) <= i))
+    for (i = 0; i < screen_lines(SP_PARM);) {
+	while (i < screen_lines(SP_PARM)
+	       && (OLDNUM(SP_PARM, i) == _NEWINDEX || OLDNUM(SP_PARM, i) <= i))
 	    i++;
-	if (i >= screen_lines)
+	if (i >= screen_lines(SP_PARM))
 	    break;
 
-	shift = OLDNUM(i) - i;	/* shift > 0 */
+	shift = OLDNUM(SP_PARM, i) - i;		/* shift > 0 */
 	start = i;
 
 	i++;
-	while (i < screen_lines && OLDNUM(i) != _NEWINDEX && OLDNUM(i) - i
-	       == shift)
+	while (i < screen_lines(SP_PARM)
+	       && OLDNUM(SP_PARM, i) != _NEWINDEX
+	       && OLDNUM(SP_PARM, i) - i == shift)
 	    i++;
 	end = i - 1 + shift;
 
 	TR(TRACE_UPDATE | TRACE_MOVE, ("scroll [%d, %d] by %d", start, end, shift));
 #if !defined(SCROLLDEBUG) && !defined(HASHDEBUG)
-	if (_nc_scrolln(shift, start, end, screen_lines - 1) == ERR) {
+	if (NCURSES_SP_NAME(_nc_scrolln) (NCURSES_SP_ARGx
+					  shift,
+					  start,
+					  end,
+					  screen_lines(SP_PARM) - 1) == ERR) {
 	    TR(TRACE_UPDATE | TRACE_MOVE, ("unable to scroll"));
 	    continue;
 	}
@@ -238,23 +246,33 @@
     }
 
     /* pass 2 - from bottom to top scrolling down */
-    for (i = screen_lines - 1; i >= 0;) {
-	while (i >= 0 && (OLDNUM(i) == _NEWINDEX || OLDNUM(i) >= i))
+    for (i = screen_lines(SP_PARM) - 1; i >= 0;) {
+	while (i >= 0
+	       && (OLDNUM(SP_PARM, i) == _NEWINDEX
+		   || OLDNUM(SP_PARM, i) >= i)) {
 	    i--;
+	}
 	if (i < 0)
 	    break;
 
-	shift = OLDNUM(i) - i;	/* shift < 0 */
+	shift = OLDNUM(SP_PARM, i) - i;		/* shift < 0 */
 	end = i;
 
 	i--;
-	while (i >= 0 && OLDNUM(i) != _NEWINDEX && OLDNUM(i) - i == shift)
+	while (i >= 0
+	       && OLDNUM(SP_PARM, i) != _NEWINDEX
+	       && OLDNUM(SP_PARM, i) - i == shift) {
 	    i--;
+	}
 	start = i + 1 - (-shift);
 
 	TR(TRACE_UPDATE | TRACE_MOVE, ("scroll [%d, %d] by %d", start, end, shift));
 #if !defined(SCROLLDEBUG) && !defined(HASHDEBUG)
-	if (_nc_scrolln(shift, start, end, screen_lines - 1) == ERR) {
+	if (NCURSES_SP_NAME(_nc_scrolln) (NCURSES_SP_ARGx
+					  shift,
+					  start,
+					  end,
+					  screen_lines(SP_PARM) - 1) == ERR) {
 	    TR(TRACE_UPDATE | TRACE_MOVE, ("unable to scroll"));
 	    continue;
 	}
@@ -263,24 +281,41 @@
     TR(TRACE_ICALLS, (T_RETURN("")));
 }
 
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(void)
+_nc_scroll_optimize(void)
+{
+    NCURSES_SP_NAME(_nc_scroll_optimize) (CURRENT_SCREEN);
+}
+#endif
+
 #if defined(TRACE) || defined(SCROLLDEBUG) || defined(HASHDEBUG)
 NCURSES_EXPORT(void)
-_nc_linedump(void)
+NCURSES_SP_NAME(_nc_linedump) (NCURSES_SP_DCL0)
 /* dump the state of the real and virtual oldnum fields */
 {
     int n;
     char *buf = 0;
-    size_t want = (screen_lines + 1) * 4;
+    size_t want = ((size_t) screen_lines(SP_PARM) + 1) * 4;
 
     if ((buf = typeMalloc(char, want)) != 0) {
 
-	(void) strcpy(buf, "virt");
-	for (n = 0; n < screen_lines; n++)
-	    (void) sprintf(buf + strlen(buf), " %02d", OLDNUM(n));
-	TR(TRACE_UPDATE | TRACE_MOVE, (buf));
+	*buf = '\0';
+	for (n = 0; n < screen_lines(SP_PARM); n++)
+	    (void) sprintf(buf + strlen(buf), " %02d", OLDNUM(SP_PARM, n));
+	TR(TRACE_UPDATE | TRACE_MOVE, ("virt %s", buf));
 	free(buf);
     }
 }
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(void)
+_nc_linedump(void)
+{
+    NCURSES_SP_NAME(_nc_linedump) (CURRENT_SCREEN);
+}
+#endif
+
 #endif /* defined(TRACE) || defined(SCROLLDEBUG) */
 
 #ifdef SCROLLDEBUG
diff -Naur ncurses-5.7.orig/ncurses/tty/hashmap.c ncurses-5.7/ncurses/tty/hashmap.c
--- ncurses-5.7.orig/ncurses/tty/hashmap.c	2007-10-13 14:47:25.000000000 -0400
+++ ncurses-5.7/ncurses/tty/hashmap.c	2011-01-08 18:13:50.743157311 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2006,2007 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            *
@@ -68,9 +68,12 @@
 *****************************************************************************/
 
 #include <curses.priv.h>
-#include <term.h>		/* for back_color_erase */
 
-MODULE_ID("$Id: hashmap.c,v 1.56 2007/10/13 18:47:25 Miroslav.Lichvar Exp $")
+#ifndef CUR
+#define CUR SP_TERMTYPE
+#endif
+
+MODULE_ID("$Id: hashmap.c,v 1.62 2010/04/24 23:46:07 tom Exp $")
 
 #ifdef HASHDEBUG
 
@@ -83,25 +86,25 @@
 int oldnums[MAXLINES], reallines[MAXLINES];
 static NCURSES_CH_T oldtext[MAXLINES][TEXTWIDTH];
 static NCURSES_CH_T newtext[MAXLINES][TEXTWIDTH];
-# define OLDNUM(n)	oldnums[n]
-# define OLDTEXT(n)	oldtext[n]
-# define NEWTEXT(m)	newtext[m]
-# define PENDING(n)     1
+# define OLDNUM(sp,n)	oldnums[n]
+# define OLDTEXT(sp,n)	oldtext[n]
+# define NEWTEXT(sp,m)	newtext[m]
+# define PENDING(sp,n)  1
 
 #else /* !HASHDEBUG */
 
-# define OLDNUM(n)	SP->_oldnum_list[n]
-# define OLDTEXT(n)	curscr->_line[n].text
-# define NEWTEXT(m)	newscr->_line[m].text
-# define TEXTWIDTH	(curscr->_maxx+1)
-# define PENDING(n)     (newscr->_line[n].firstchar != _NOCHANGE)
+# define OLDNUM(sp,n)	(sp)->_oldnum_list[n]
+# define OLDTEXT(sp,n)	CurScreen(sp)->_line[n].text
+# define NEWTEXT(sp,m)	NewScreen(sp)->_line[m].text
+# define TEXTWIDTH(sp)	(CurScreen(sp)->_maxx + 1)
+# define PENDING(sp,n)  (NewScreen(sp)->_line[n].firstchar != _NOCHANGE)
 
 #endif /* !HASHDEBUG */
 
-#define oldhash		(SP->oldhash)
-#define newhash		(SP->newhash)
-#define hashtab		(SP->hashtab)
-#define lines_alloc	(SP->hashtab_len)
+#define oldhash(sp)	((sp)->oldhash)
+#define newhash(sp)	((sp)->newhash)
+#define hashtab(sp)	((sp)->hashtab)
+#define lines_alloc(sp)	((sp)->hashtab_len)
 
 #if USE_WIDEC_SUPPORT
 #define HASH_VAL(ch) (ch.chars[0])
@@ -112,26 +115,26 @@
 static const NCURSES_CH_T blankchar = NewChar(BLANK_TEXT);
 
 static NCURSES_INLINE unsigned long
-hash(NCURSES_CH_T * text)
+hash(SCREEN *sp, NCURSES_CH_T * text)
 {
     int i;
     NCURSES_CH_T ch;
     unsigned long result = 0;
-    for (i = TEXTWIDTH; i > 0; i--) {
+    for (i = TEXTWIDTH(sp); i > 0; i--) {
 	ch = *text++;
-	result += (result << 5) + HASH_VAL(ch);
+	result += (result << 5) + (unsigned long) HASH_VAL(ch);
     }
     return result;
 }
 
 /* approximate update cost */
 static int
-update_cost(NCURSES_CH_T * from, NCURSES_CH_T * to)
+update_cost(SCREEN *sp, NCURSES_CH_T * from, NCURSES_CH_T * to)
 {
     int cost = 0;
     int i;
 
-    for (i = TEXTWIDTH; i > 0; i--, from++, to++)
+    for (i = TEXTWIDTH(sp); i > 0; i--, from++, to++)
 	if (!(CharEq(*from, *to)))
 	    cost++;
 
@@ -139,7 +142,7 @@
 }
 
 static int
-update_cost_from_blank(NCURSES_CH_T * to)
+update_cost_from_blank(SCREEN *sp, NCURSES_CH_T * to)
 {
     int cost = 0;
     int i;
@@ -148,7 +151,7 @@
     if (back_color_erase)
 	SetPair(blank, GetPair(stdscr->_nc_bkgd));
 
-    for (i = TEXTWIDTH; i > 0; i--, to++)
+    for (i = TEXTWIDTH(sp); i > 0; i--, to++)
 	if (!(CharEq(blank, *to)))
 	    cost++;
 
@@ -160,14 +163,14 @@
  * effective. 'blank' indicates whether the line 'to' would become blank.
  */
 static NCURSES_INLINE bool
-cost_effective(const int from, const int to, const bool blank)
+cost_effective(SCREEN *sp, const int from, const int to, const bool blank)
 {
     int new_from;
 
     if (from == to)
 	return FALSE;
 
-    new_from = OLDNUM(from);
+    new_from = OLDNUM(sp, from);
     if (new_from == _NEWINDEX)
 	new_from = from;
 
@@ -175,16 +178,17 @@
      * On the left side of >= is the cost before moving;
      * on the right side -- cost after moving.
      */
-    return (((blank ? update_cost_from_blank(NEWTEXT(to))
-	      : update_cost(OLDTEXT(to), NEWTEXT(to)))
-	     + update_cost(OLDTEXT(new_from), NEWTEXT(from)))
-	    >= ((new_from == from ? update_cost_from_blank(NEWTEXT(from))
-		 : update_cost(OLDTEXT(new_from), NEWTEXT(from)))
-		+ update_cost(OLDTEXT(from), NEWTEXT(to)))) ? TRUE : FALSE;
+    return (((blank ? update_cost_from_blank(sp, NEWTEXT(sp, to))
+	      : update_cost(sp, OLDTEXT(sp, to), NEWTEXT(sp, to)))
+	     + update_cost(sp, OLDTEXT(sp, new_from), NEWTEXT(sp, from)))
+	    >= ((new_from == from ? update_cost_from_blank(sp, NEWTEXT(sp, from))
+		 : update_cost(sp, OLDTEXT(sp, new_from), NEWTEXT(sp, from)))
+		+ update_cost(sp, OLDTEXT(sp, from), NEWTEXT(sp, to))))
+	? TRUE : FALSE;
 }
 
 static void
-grow_hunks(void)
+grow_hunks(SCREEN *sp)
 {
     int start, end, shift;
     int back_limit, forward_limit;	/* limits for cells to fill */
@@ -200,35 +204,36 @@
     back_ref_limit = 0;
 
     i = 0;
-    while (i < screen_lines && OLDNUM(i) == _NEWINDEX)
+    while (i < screen_lines(sp) && OLDNUM(sp, i) == _NEWINDEX)
 	i++;
-    for (; i < screen_lines; i = next_hunk) {
+    for (; i < screen_lines(sp); i = next_hunk) {
 	start = i;
-	shift = OLDNUM(i) - i;
+	shift = OLDNUM(sp, i) - i;
 
 	/* get forward limit */
 	i = start + 1;
-	while (i < screen_lines && OLDNUM(i) != _NEWINDEX && OLDNUM(i) - i
-	       == shift)
+	while (i < screen_lines(sp)
+	       && OLDNUM(sp, i) != _NEWINDEX
+	       && OLDNUM(sp, i) - i == shift)
 	    i++;
 	end = i;
-	while (i < screen_lines && OLDNUM(i) == _NEWINDEX)
+	while (i < screen_lines(sp) && OLDNUM(sp, i) == _NEWINDEX)
 	    i++;
 	next_hunk = i;
 	forward_limit = i;
-	if (i >= screen_lines || OLDNUM(i) >= i)
+	if (i >= screen_lines(sp) || OLDNUM(sp, i) >= i)
 	    forward_ref_limit = i;
 	else
-	    forward_ref_limit = OLDNUM(i);
+	    forward_ref_limit = OLDNUM(sp, i);
 
 	i = start - 1;
 	/* grow back */
 	if (shift < 0)
 	    back_limit = back_ref_limit + (-shift);
 	while (i >= back_limit) {
-	    if (newhash[i] == oldhash[i + shift]
-		|| cost_effective(i + shift, i, shift < 0)) {
-		OLDNUM(i) = i + shift;
+	    if (newhash(sp)[i] == oldhash(sp)[i + shift]
+		|| cost_effective(sp, i + shift, i, shift < 0)) {
+		OLDNUM(sp, i) = i + shift;
 		TR(TRACE_UPDATE | TRACE_MOVE,
 		   ("connected new line %d to old line %d (backward continuation)",
 		    i, i + shift));
@@ -246,9 +251,9 @@
 	if (shift > 0)
 	    forward_limit = forward_ref_limit - shift;
 	while (i < forward_limit) {
-	    if (newhash[i] == oldhash[i + shift]
-		|| cost_effective(i + shift, i, shift > 0)) {
-		OLDNUM(i) = i + shift;
+	    if (newhash(sp)[i] == oldhash(sp)[i + shift]
+		|| cost_effective(sp, i + shift, i, shift > 0)) {
+		OLDNUM(sp, i) = i + shift;
 		TR(TRACE_UPDATE | TRACE_MOVE,
 		   ("connected new line %d to old line %d (forward continuation)",
 		    i, i + shift));
@@ -268,51 +273,54 @@
 }
 
 NCURSES_EXPORT(void)
-_nc_hash_map(void)
+NCURSES_SP_NAME(_nc_hash_map) (NCURSES_SP_DCL0)
 {
-    HASHMAP *sp;
+    HASHMAP *hsp;
     register int i;
     int start, shift, size;
 
-    if (screen_lines > lines_alloc) {
-	if (hashtab)
-	    free(hashtab);
-	hashtab = typeMalloc(HASHMAP, (screen_lines + 1) * 2);
-	if (!hashtab) {
-	    if (oldhash) {
-		FreeAndNull(oldhash);
+    if (screen_lines(SP_PARM) > lines_alloc(SP_PARM)) {
+	if (hashtab(SP_PARM))
+	    free(hashtab(SP_PARM));
+	hashtab(SP_PARM) = typeMalloc(HASHMAP,
+				      ((size_t) screen_lines(SP_PARM) + 1) * 2);
+	if (!hashtab(SP_PARM)) {
+	    if (oldhash(SP_PARM)) {
+		FreeAndNull(oldhash(SP_PARM));
 	    }
-	    lines_alloc = 0;
+	    lines_alloc(SP_PARM) = 0;
 	    return;
 	}
-	lines_alloc = screen_lines;
+	lines_alloc(SP_PARM) = screen_lines(SP_PARM);
     }
 
-    if (oldhash && newhash) {
+    if (oldhash(SP_PARM) && newhash(SP_PARM)) {
 	/* re-hash only changed lines */
-	for (i = 0; i < screen_lines; i++) {
-	    if (PENDING(i))
-		newhash[i] = hash(NEWTEXT(i));
+	for (i = 0; i < screen_lines(SP_PARM); i++) {
+	    if (PENDING(SP_PARM, i))
+		newhash(SP_PARM)[i] = hash(SP_PARM, NEWTEXT(SP_PARM, i));
 	}
     } else {
 	/* re-hash all */
-	if (oldhash == 0)
-	    oldhash = typeCalloc(unsigned long, (unsigned) screen_lines);
-	if (newhash == 0)
-	    newhash = typeCalloc(unsigned long, (unsigned) screen_lines);
-	if (!oldhash || !newhash)
+	if (oldhash(SP_PARM) == 0)
+	    oldhash(SP_PARM) = typeCalloc(unsigned long,
+					    (size_t) screen_lines(SP_PARM));
+	if (newhash(SP_PARM) == 0)
+	    newhash(SP_PARM) = typeCalloc(unsigned long,
+					    (size_t) screen_lines(SP_PARM));
+	if (!oldhash(SP_PARM) || !newhash(SP_PARM))
 	    return;		/* malloc failure */
-	for (i = 0; i < screen_lines; i++) {
-	    newhash[i] = hash(NEWTEXT(i));
-	    oldhash[i] = hash(OLDTEXT(i));
+	for (i = 0; i < screen_lines(SP_PARM); i++) {
+	    newhash(SP_PARM)[i] = hash(SP_PARM, NEWTEXT(SP_PARM, i));
+	    oldhash(SP_PARM)[i] = hash(SP_PARM, OLDTEXT(SP_PARM, i));
 	}
     }
 
 #ifdef HASH_VERIFY
-    for (i = 0; i < screen_lines; i++) {
-	if (newhash[i] != hash(NEWTEXT(i)))
+    for (i = 0; i < screen_lines(SP_PARM); i++) {
+	if (newhash(SP_PARM)[i] != hash(SP_PARM, NEWTEXT(SP_PARM, i)))
 	    fprintf(stderr, "error in newhash[%d]\n", i);
-	if (oldhash[i] != hash(OLDTEXT(i)))
+	if (oldhash(SP_PARM)[i] != hash(SP_PARM, OLDTEXT(SP_PARM, i)))
 	    fprintf(stderr, "error in oldhash[%d]\n", i);
     }
 #endif
@@ -320,28 +328,30 @@
     /*
      * Set up and count line-hash values.
      */
-    memset(hashtab, '\0', sizeof(*hashtab) * (screen_lines + 1) * 2);
-    for (i = 0; i < screen_lines; i++) {
-	unsigned long hashval = oldhash[i];
+    memset(hashtab(SP_PARM), '\0',
+	   sizeof(*(hashtab(SP_PARM)))
+	   * ((size_t) screen_lines(SP_PARM) + 1) * 2);
+    for (i = 0; i < screen_lines(SP_PARM); i++) {
+	unsigned long hashval = oldhash(SP_PARM)[i];
 
-	for (sp = hashtab; sp->hashval; sp++)
-	    if (sp->hashval == hashval)
+	for (hsp = hashtab(SP_PARM); hsp->hashval; hsp++)
+	    if (hsp->hashval == hashval)
 		break;
-	sp->hashval = hashval;	/* in case this is a new entry */
-	sp->oldcount++;
-	sp->oldindex = i;
+	hsp->hashval = hashval;	/* in case this is a new entry */
+	hsp->oldcount++;
+	hsp->oldindex = i;
     }
-    for (i = 0; i < screen_lines; i++) {
-	unsigned long hashval = newhash[i];
+    for (i = 0; i < screen_lines(SP_PARM); i++) {
+	unsigned long hashval = newhash(SP_PARM)[i];
 
-	for (sp = hashtab; sp->hashval; sp++)
-	    if (sp->hashval == hashval)
+	for (hsp = hashtab(SP_PARM); hsp->hashval; hsp++)
+	    if (hsp->hashval == hashval)
 		break;
-	sp->hashval = hashval;	/* in case this is a new entry */
-	sp->newcount++;
-	sp->newindex = i;
+	hsp->hashval = hashval;	/* in case this is a new entry */
+	hsp->newcount++;
+	hsp->newindex = i;
 
-	OLDNUM(i) = _NEWINDEX;	/* initialize old indices array */
+	OLDNUM(SP_PARM, i) = _NEWINDEX;		/* initialize old indices array */
     }
 
     /*
@@ -351,16 +361,16 @@
      * extending hunks by cost_effective. Otherwise, it does not
      * have any side effects.
      */
-    for (sp = hashtab; sp->hashval; sp++)
-	if (sp->oldcount == 1 && sp->newcount == 1
-	    && sp->oldindex != sp->newindex) {
+    for (hsp = hashtab(SP_PARM); hsp->hashval; hsp++)
+	if (hsp->oldcount == 1 && hsp->newcount == 1
+	    && hsp->oldindex != hsp->newindex) {
 	    TR(TRACE_UPDATE | TRACE_MOVE,
 	       ("new line %d is hash-identical to old line %d (unique)",
-		sp->newindex, sp->oldindex));
-	    OLDNUM(sp->newindex) = sp->oldindex;
+		hsp->newindex, hsp->oldindex));
+	    OLDNUM(SP_PARM, hsp->newindex) = hsp->oldindex;
 	}
 
-    grow_hunks();
+    grow_hunks(SP_PARM);
 
     /*
      * Eliminate bad or impossible shifts -- this includes removing
@@ -368,58 +378,83 @@
      * those which are to be moved too far, they are likely to destroy
      * more than carry.
      */
-    for (i = 0; i < screen_lines;) {
-	while (i < screen_lines && OLDNUM(i) == _NEWINDEX)
+    for (i = 0; i < screen_lines(SP_PARM);) {
+	while (i < screen_lines(SP_PARM) && OLDNUM(SP_PARM, i) == _NEWINDEX)
 	    i++;
-	if (i >= screen_lines)
+	if (i >= screen_lines(SP_PARM))
 	    break;
 	start = i;
-	shift = OLDNUM(i) - i;
+	shift = OLDNUM(SP_PARM, i) - i;
 	i++;
-	while (i < screen_lines && OLDNUM(i) != _NEWINDEX && OLDNUM(i) - i
-	       == shift)
+	while (i < screen_lines(SP_PARM)
+	       && OLDNUM(SP_PARM, i) != _NEWINDEX
+	       && OLDNUM(SP_PARM, i) - i == shift)
 	    i++;
 	size = i - start;
 	if (size < 3 || size + min(size / 8, 2) < abs(shift)) {
 	    while (start < i) {
-		OLDNUM(start) = _NEWINDEX;
+		OLDNUM(SP_PARM, start) = _NEWINDEX;
 		start++;
 	    }
 	}
     }
 
     /* After clearing invalid hunks, try grow the rest. */
-    grow_hunks();
+    grow_hunks(SP_PARM);
 }
 
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(void)
+_nc_hash_map(void)
+{
+    NCURSES_SP_NAME(_nc_hash_map) (CURRENT_SCREEN);
+}
+#endif
+
+NCURSES_EXPORT(void)
+NCURSES_SP_NAME(_nc_make_oldhash) (NCURSES_SP_DCLx int i)
+{
+    if (oldhash(SP_PARM))
+	oldhash(SP_PARM)[i] = hash(SP_PARM, OLDTEXT(SP_PARM, i));
+}
+
+#if NCURSES_SP_FUNCS
 NCURSES_EXPORT(void)
 _nc_make_oldhash(int i)
 {
-    if (oldhash)
-	oldhash[i] = hash(OLDTEXT(i));
+    NCURSES_SP_NAME(_nc_make_oldhash) (CURRENT_SCREEN, i);
 }
+#endif
 
 NCURSES_EXPORT(void)
-_nc_scroll_oldhash(int n, int top, int bot)
+NCURSES_SP_NAME(_nc_scroll_oldhash) (NCURSES_SP_DCLx int n, int top, int bot)
 {
     size_t size;
     int i;
 
-    if (!oldhash)
+    if (!oldhash(SP_PARM))
 	return;
 
-    size = sizeof(*oldhash) * (bot - top + 1 - abs(n));
+    size = sizeof(*(oldhash(SP_PARM))) * (size_t) (bot - top + 1 - abs(n));
     if (n > 0) {
-	memmove(oldhash + top, oldhash + top + n, size);
+	memmove(oldhash(SP_PARM) + top, oldhash(SP_PARM) + top + n, size);
 	for (i = bot; i > bot - n; i--)
-	    oldhash[i] = hash(OLDTEXT(i));
+	    oldhash(SP_PARM)[i] = hash(SP_PARM, OLDTEXT(SP_PARM, i));
     } else {
-	memmove(oldhash + top - n, oldhash + top, size);
+	memmove(oldhash(SP_PARM) + top - n, oldhash(SP_PARM) + top, size);
 	for (i = top; i < top - n; i++)
-	    oldhash[i] = hash(OLDTEXT(i));
+	    oldhash(SP_PARM)[i] = hash(SP_PARM, OLDTEXT(SP_PARM, i));
     }
 }
 
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(void)
+_nc_scroll_oldhash(int n, int top, int bot)
+{
+    NCURSES_SP_NAME(_nc_scroll_oldhash) (CURRENT_SCREEN, n, top, bot);
+}
+#endif
+
 #ifdef HASHDEBUG
 static void
 usage(void)
diff -Naur ncurses-5.7.orig/ncurses/tty/lib_mvcur.c ncurses-5.7/ncurses/tty/lib_mvcur.c
--- ncurses-5.7.orig/ncurses/tty/lib_mvcur.c	2008-08-16 15:30:58.000000000 -0400
+++ ncurses-5.7/ncurses/tty/lib_mvcur.c	2011-01-08 18:18:29.754781633 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2007,2008 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            *
@@ -30,6 +30,7 @@
  *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995               *
  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
  *     and: Thomas E. Dickey                        1996-on                 *
+ *     and: Juergen Pfeifer                         2009                    *
  ****************************************************************************/
 
 /*
@@ -109,8 +110,8 @@
  * LONG_DIST and (b) further inward from the right or left edge than LONG_DIST,
  * we'll consider nonlocal.
  */
-#define NOT_LOCAL(fy, fx, ty, tx)	((tx > LONG_DIST) \
- 		 && (tx < screen_columns - 1 - LONG_DIST) \
+#define NOT_LOCAL(sp, fy, fx, ty, tx)	((tx > LONG_DIST) \
+		 && (tx < screen_columns(sp) - 1 - LONG_DIST) \
 		 && (abs(ty-fy) + abs(tx-fx) > LONG_DIST))
 
 /****************************************************************************
@@ -152,13 +153,21 @@
  */
 
 #include <curses.priv.h>
-#include <term.h>
 #include <ctype.h>
 
-MODULE_ID("$Id: lib_mvcur.c,v 1.113 2008/08/16 19:30:58 tom Exp $")
+#ifndef CUR
+#define CUR SP_TERMTYPE
+#endif
+
+MODULE_ID("$Id: lib_mvcur.c,v 1.124 2010/12/19 01:22:58 tom Exp $")
+
+#define WANT_CHAR(sp, y, x) NewScreen(sp)->_line[y].text[x]	/* desired state */
 
-#define WANT_CHAR(y, x)	SP->_newscr->_line[y].text[x]	/* desired state */
-#define BAUDRATE	cur_term->_baudrate	/* bits per second */
+#if NCURSES_SP_FUNCS
+#define BAUDRATE(sp)	sp->_term->_baudrate	/* bits per second */
+#else
+#define BAUDRATE(sp)	cur_term->_baudrate	/* bits per second */
+#endif
 
 #if defined(MAIN) || defined(NCURSES_TEST)
 #include <sys/time.h>
@@ -169,7 +178,7 @@
 
 #define OPT_SIZE 512
 
-static int normalized_cost(const char *const cap, int affcnt);
+static int normalized_cost(NCURSES_SP_DCLx const char *const cap, int affcnt);
 
 /****************************************************************************
  *
@@ -179,34 +188,34 @@
 
 #ifdef TRACE
 static int
-trace_cost_of(const char *capname, const char *cap, int affcnt)
+trace_cost_of(NCURSES_SP_DCLx const char *capname, const char *cap, int affcnt)
 {
-    int result = _nc_msec_cost(cap, affcnt);
+    int result = NCURSES_SP_NAME(_nc_msec_cost) (NCURSES_SP_ARGx cap, affcnt);
     TR(TRACE_CHARPUT | TRACE_MOVE,
        ("CostOf %s %d %s", capname, result, _nc_visbuf(cap)));
     return result;
 }
-#define CostOf(cap,affcnt) trace_cost_of(#cap,cap,affcnt);
+#define CostOf(cap,affcnt) trace_cost_of(NCURSES_SP_ARGx #cap, cap, affcnt)
 
 static int
-trace_normalized_cost(const char *capname, const char *cap, int affcnt)
+trace_normalized_cost(NCURSES_SP_DCLx const char *capname, const char *cap, int affcnt)
 {
-    int result = normalized_cost(cap, affcnt);
+    int result = normalized_cost(NCURSES_SP_ARGx cap, affcnt);
     TR(TRACE_CHARPUT | TRACE_MOVE,
        ("NormalizedCost %s %d %s", capname, result, _nc_visbuf(cap)));
     return result;
 }
-#define NormalizedCost(cap,affcnt) trace_normalized_cost(#cap,cap,affcnt);
+#define NormalizedCost(cap,affcnt) trace_normalized_cost(NCURSES_SP_ARGx #cap, cap, affcnt)
 
 #else
 
-#define CostOf(cap,affcnt) _nc_msec_cost(cap,affcnt);
-#define NormalizedCost(cap,affcnt) normalized_cost(cap,affcnt);
+#define CostOf(cap,affcnt) NCURSES_SP_NAME(_nc_msec_cost)(NCURSES_SP_ARGx cap, affcnt)
+#define NormalizedCost(cap,affcnt) normalized_cost(NCURSES_SP_ARGx cap, affcnt)
 
 #endif
 
 NCURSES_EXPORT(int)
-_nc_msec_cost(const char *const cap, int affcnt)
+NCURSES_SP_NAME(_nc_msec_cost) (NCURSES_SP_DCLx const char *const cap, int affcnt)
 /* compute the cost of a given operation */
 {
     if (cap == 0)
@@ -222,53 +231,67 @@
 
 		for (cp += 2; *cp != '>'; cp++) {
 		    if (isdigit(UChar(*cp)))
-			number = number * 10 + (*cp - '0');
+			number = number * 10 + (float) (*cp - '0');
 		    else if (*cp == '*')
-			number *= affcnt;
+			number *= (float) affcnt;
 		    else if (*cp == '.' && (*++cp != '>') && isdigit(UChar(*cp)))
-			number += (*cp - '0') / 10.0;
+			number += (float) ((*cp - '0') / 10.0);
 		}
 
 #if NCURSES_NO_PADDING
-		if (!GetNoPadding(SP))
+		if (!GetNoPadding(SP_PARM))
 #endif
 		    cum_cost += number * 10;
 	    } else
-		cum_cost += SP->_char_padding;
+		cum_cost += (float) SP_PARM->_char_padding;
 	}
 
 	return ((int) cum_cost);
     }
 }
 
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+_nc_msec_cost(const char *const cap, int affcnt)
+{
+    return NCURSES_SP_NAME(_nc_msec_cost) (CURRENT_SCREEN, cap, affcnt);
+}
+#endif
+
 static int
-normalized_cost(const char *const cap, int affcnt)
+normalized_cost(NCURSES_SP_DCLx const char *const cap, int affcnt)
 /* compute the effective character-count for an operation (round up) */
 {
-    int cost = _nc_msec_cost(cap, affcnt);
+    int cost = NCURSES_SP_NAME(_nc_msec_cost) (NCURSES_SP_ARGx cap, affcnt);
     if (cost != INFINITY)
-	cost = (cost + SP->_char_padding - 1) / SP->_char_padding;
+	cost = (cost + SP_PARM->_char_padding - 1) / SP_PARM->_char_padding;
     return cost;
 }
 
 static void
-reset_scroll_region(void)
+reset_scroll_region(NCURSES_SP_DCL0)
 /* Set the scroll-region to a known state (the default) */
 {
     if (change_scroll_region) {
-	TPUTS_TRACE("change_scroll_region");
-	putp(TPARM_2(change_scroll_region, 0, screen_lines - 1));
+	NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx
+				   "change_scroll_region",
+				   TPARM_2(change_scroll_region,
+					   0, screen_lines(SP_PARM) - 1));
     }
 }
 
 NCURSES_EXPORT(void)
-_nc_mvcur_resume(void)
+NCURSES_SP_NAME(_nc_mvcur_resume) (NCURSES_SP_DCL0)
 /* what to do at initialization time and after each shellout */
 {
+    if (SP_PARM && !IsTermInfo(SP_PARM))
+	return;
+
     /* initialize screen for cursor access */
     if (enter_ca_mode) {
-	TPUTS_TRACE("enter_ca_mode");
-	putp(enter_ca_mode);
+	NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx
+				   "enter_ca_mode",
+				   enter_ca_mode);
     }
 
     /*
@@ -280,53 +303,63 @@
      * they know the screen size.  This is useful when you're running
      * a vt100 emulation through xterm.
      */
-    reset_scroll_region();
-    SP->_cursrow = SP->_curscol = -1;
+    reset_scroll_region(NCURSES_SP_ARG);
+    SP_PARM->_cursrow = SP_PARM->_curscol = -1;
 
     /* restore cursor shape */
-    if (SP->_cursor != -1) {
-	int cursor = SP->_cursor;
-	SP->_cursor = -1;
-	curs_set(cursor);
+    if (SP_PARM->_cursor != -1) {
+	int cursor = SP_PARM->_cursor;
+	SP_PARM->_cursor = -1;
+	NCURSES_SP_NAME(curs_set) (NCURSES_SP_ARGx cursor);
     }
 }
 
+#if NCURSES_SP_FUNCS
 NCURSES_EXPORT(void)
-_nc_mvcur_init(void)
+_nc_mvcur_resume(void)
+{
+    NCURSES_SP_NAME(_nc_mvcur_resume) (CURRENT_SCREEN);
+}
+#endif
+
+NCURSES_EXPORT(void)
+NCURSES_SP_NAME(_nc_mvcur_init) (NCURSES_SP_DCL0)
 /* initialize the cost structure */
 {
-    if (isatty(fileno(SP->_ofp)))
-	SP->_char_padding = ((BAUDBYTE * 1000 * 10)
-			     / (BAUDRATE > 0 ? BAUDRATE : 9600));
+    if (SP_PARM->_ofp && isatty(fileno(SP_PARM->_ofp)))
+	SP_PARM->_char_padding = ((BAUDBYTE * 1000 * 10)
+				  / (BAUDRATE(SP_PARM) > 0
+				     ? BAUDRATE(SP_PARM)
+				     : 9600));
     else
-	SP->_char_padding = 1;	/* must be nonzero */
-    if (SP->_char_padding <= 0)
-	SP->_char_padding = 1;	/* must be nonzero */
-    TR(TRACE_CHARPUT | TRACE_MOVE, ("char_padding %d msecs", SP->_char_padding));
+	SP_PARM->_char_padding = 1;	/* must be nonzero */
+    if (SP_PARM->_char_padding <= 0)
+	SP_PARM->_char_padding = 1;	/* must be nonzero */
+    TR(TRACE_CHARPUT | TRACE_MOVE, ("char_padding %d msecs", SP_PARM->_char_padding));
 
     /* non-parameterized local-motion strings */
-    SP->_cr_cost = CostOf(carriage_return, 0);
-    SP->_home_cost = CostOf(cursor_home, 0);
-    SP->_ll_cost = CostOf(cursor_to_ll, 0);
+    SP_PARM->_cr_cost = CostOf(carriage_return, 0);
+    SP_PARM->_home_cost = CostOf(cursor_home, 0);
+    SP_PARM->_ll_cost = CostOf(cursor_to_ll, 0);
 #if USE_HARD_TABS
     if (getenv("NCURSES_NO_HARD_TABS") == 0) {
-	SP->_ht_cost = CostOf(tab, 0);
-	SP->_cbt_cost = CostOf(back_tab, 0);
+	SP_PARM->_ht_cost = CostOf(tab, 0);
+	SP_PARM->_cbt_cost = CostOf(back_tab, 0);
     } else {
-	SP->_ht_cost = INFINITY;
-	SP->_cbt_cost = INFINITY;
+	SP_PARM->_ht_cost = INFINITY;
+	SP_PARM->_cbt_cost = INFINITY;
     }
 #endif /* USE_HARD_TABS */
-    SP->_cub1_cost = CostOf(cursor_left, 0);
-    SP->_cuf1_cost = CostOf(cursor_right, 0);
-    SP->_cud1_cost = CostOf(cursor_down, 0);
-    SP->_cuu1_cost = CostOf(cursor_up, 0);
-
-    SP->_smir_cost = CostOf(enter_insert_mode, 0);
-    SP->_rmir_cost = CostOf(exit_insert_mode, 0);
-    SP->_ip_cost = 0;
+    SP_PARM->_cub1_cost = CostOf(cursor_left, 0);
+    SP_PARM->_cuf1_cost = CostOf(cursor_right, 0);
+    SP_PARM->_cud1_cost = CostOf(cursor_down, 0);
+    SP_PARM->_cuu1_cost = CostOf(cursor_up, 0);
+
+    SP_PARM->_smir_cost = CostOf(enter_insert_mode, 0);
+    SP_PARM->_rmir_cost = CostOf(exit_insert_mode, 0);
+    SP_PARM->_ip_cost = 0;
     if (insert_padding) {
-	SP->_ip_cost = CostOf(insert_padding, 0);
+	SP_PARM->_ip_cost = CostOf(insert_padding, 0);
     }
 
     /*
@@ -335,7 +368,7 @@
      * can treat it like absolute screen addressing.  This seems to be true
      * for all cursor_mem_address terminal types in the terminfo database.
      */
-    SP->_address_cursor = cursor_address ? cursor_address : cursor_mem_address;
+    SP_PARM->_address_cursor = cursor_address ? cursor_address : cursor_mem_address;
 
     /*
      * Parametrized local-motion strings.  This static cost computation
@@ -361,40 +394,43 @@
      * All these averages depend on the assumption that all parameter values
      * are equally probable.
      */
-    SP->_cup_cost = CostOf(TPARM_2(SP->_address_cursor, 23, 23), 1);
-    SP->_cub_cost = CostOf(TPARM_1(parm_left_cursor, 23), 1);
-    SP->_cuf_cost = CostOf(TPARM_1(parm_right_cursor, 23), 1);
-    SP->_cud_cost = CostOf(TPARM_1(parm_down_cursor, 23), 1);
-    SP->_cuu_cost = CostOf(TPARM_1(parm_up_cursor, 23), 1);
-    SP->_hpa_cost = CostOf(TPARM_1(column_address, 23), 1);
-    SP->_vpa_cost = CostOf(TPARM_1(row_address, 23), 1);
+    SP_PARM->_cup_cost = CostOf(TPARM_2(SP_PARM->_address_cursor, 23, 23), 1);
+    SP_PARM->_cub_cost = CostOf(TPARM_1(parm_left_cursor, 23), 1);
+    SP_PARM->_cuf_cost = CostOf(TPARM_1(parm_right_cursor, 23), 1);
+    SP_PARM->_cud_cost = CostOf(TPARM_1(parm_down_cursor, 23), 1);
+    SP_PARM->_cuu_cost = CostOf(TPARM_1(parm_up_cursor, 23), 1);
+    SP_PARM->_hpa_cost = CostOf(TPARM_1(column_address, 23), 1);
+    SP_PARM->_vpa_cost = CostOf(TPARM_1(row_address, 23), 1);
 
     /* non-parameterized screen-update strings */
-    SP->_ed_cost = NormalizedCost(clr_eos, 1);
-    SP->_el_cost = NormalizedCost(clr_eol, 1);
-    SP->_el1_cost = NormalizedCost(clr_bol, 1);
-    SP->_dch1_cost = NormalizedCost(delete_character, 1);
-    SP->_ich1_cost = NormalizedCost(insert_character, 1);
+    SP_PARM->_ed_cost = NormalizedCost(clr_eos, 1);
+    SP_PARM->_el_cost = NormalizedCost(clr_eol, 1);
+    SP_PARM->_el1_cost = NormalizedCost(clr_bol, 1);
+    SP_PARM->_dch1_cost = NormalizedCost(delete_character, 1);
+    SP_PARM->_ich1_cost = NormalizedCost(insert_character, 1);
 
     /*
      * If this is a bce-terminal, we want to bias the choice so we use clr_eol
      * rather than spaces at the end of a line.
      */
     if (back_color_erase)
-	SP->_el_cost = 0;
+	SP_PARM->_el_cost = 0;
 
     /* parameterized screen-update strings */
-    SP->_dch_cost = NormalizedCost(TPARM_1(parm_dch, 23), 1);
-    SP->_ich_cost = NormalizedCost(TPARM_1(parm_ich, 23), 1);
-    SP->_ech_cost = NormalizedCost(TPARM_1(erase_chars, 23), 1);
-    SP->_rep_cost = NormalizedCost(TPARM_2(repeat_char, ' ', 23), 1);
-
-    SP->_cup_ch_cost = NormalizedCost(TPARM_2(SP->_address_cursor, 23, 23), 1);
-    SP->_hpa_ch_cost = NormalizedCost(TPARM_1(column_address, 23), 1);
-    SP->_cuf_ch_cost = NormalizedCost(TPARM_1(parm_right_cursor, 23), 1);
-    SP->_inline_cost = min(SP->_cup_ch_cost,
-			   min(SP->_hpa_ch_cost,
-			       SP->_cuf_ch_cost));
+    SP_PARM->_dch_cost = NormalizedCost(TPARM_1(parm_dch, 23), 1);
+    SP_PARM->_ich_cost = NormalizedCost(TPARM_1(parm_ich, 23), 1);
+    SP_PARM->_ech_cost = NormalizedCost(TPARM_1(erase_chars, 23), 1);
+    SP_PARM->_rep_cost = NormalizedCost(TPARM_2(repeat_char, ' ', 23), 1);
+
+    SP_PARM->_cup_ch_cost = NormalizedCost(
+					      TPARM_2(SP_PARM->_address_cursor,
+						      23, 23),
+					      1);
+    SP_PARM->_hpa_ch_cost = NormalizedCost(TPARM_1(column_address, 23), 1);
+    SP_PARM->_cuf_ch_cost = NormalizedCost(TPARM_1(parm_right_cursor, 23), 1);
+    SP_PARM->_inline_cost = min(SP_PARM->_cup_ch_cost,
+				min(SP_PARM->_hpa_ch_cost,
+				    SP_PARM->_cuf_ch_cost));
 
     /*
      * If save_cursor is used within enter_ca_mode, we should not use it for
@@ -411,30 +447,42 @@
     }
 
     /*
-     * A different, possibly better way to arrange this would be to set
-     * SP->_endwin = TRUE at window initialization time and let this be
+     * A different, possibly better way to arrange this would be to set the
+     * SCREEN's _endwin to TRUE at window initialization time and let this be
      * called by doupdate's return-from-shellout code.
      */
-    _nc_mvcur_resume();
+    NCURSES_SP_NAME(_nc_mvcur_resume) (NCURSES_SP_ARG);
 }
 
+#if NCURSES_SP_FUNCS
 NCURSES_EXPORT(void)
-_nc_mvcur_wrap(void)
+_nc_mvcur_init(void)
+{
+    NCURSES_SP_NAME(_nc_mvcur_init) (CURRENT_SCREEN);
+}
+#endif
+
+NCURSES_EXPORT(void)
+NCURSES_SP_NAME(_nc_mvcur_wrap) (NCURSES_SP_DCL0)
 /* wrap up cursor-addressing mode */
 {
     /* leave cursor at screen bottom */
-    mvcur(-1, -1, screen_lines - 1, 0);
+    TINFO_MVCUR(NCURSES_SP_ARGx -1, -1, screen_lines(SP_PARM) - 1, 0);
+
+    if (SP_PARM && !IsTermInfo(SP_PARM))
+	return;
 
     /* set cursor to normal mode */
-    if (SP->_cursor != -1) {
-	int cursor = SP->_cursor;
-	curs_set(1);
-	SP->_cursor = cursor;
+    if (SP_PARM->_cursor != -1) {
+	int cursor = SP_PARM->_cursor;
+	NCURSES_SP_NAME(curs_set) (NCURSES_SP_ARGx 1);
+	SP_PARM->_cursor = cursor;
     }
 
     if (exit_ca_mode) {
-	TPUTS_TRACE("exit_ca_mode");
-	putp(exit_ca_mode);
+	NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx
+				   "exit_ca_mode",
+				   exit_ca_mode);
     }
     /*
      * Reset terminal's tab counter.  There's a long-time bug that
@@ -444,9 +492,17 @@
      * escape sequences that reset things as column positions.
      * Utter a \r to reset this invisibly.
      */
-    _nc_outch('\r');
+    NCURSES_SP_NAME(_nc_outch) (NCURSES_SP_ARGx '\r');
 }
 
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(void)
+_nc_mvcur_wrap(void)
+{
+    NCURSES_SP_NAME(_nc_mvcur_wrap) (CURRENT_SCREEN);
+}
+#endif
+
 /****************************************************************************
  *
  * Optimized cursor movement
@@ -459,7 +515,7 @@
 static NCURSES_INLINE int
 repeated_append(string_desc * target, int total, int num, int repeat, const char *src)
 {
-    size_t need = repeat * strlen(src);
+    size_t need = (size_t) repeat * strlen(src);
 
     if (need < target->s_size) {
 	while (repeat-- > 0) {
@@ -486,8 +542,13 @@
 #define LASTTAB(fr)	((fr > 0) ? ((fr - 1) / init_tabs) * init_tabs : -1)
 
 static int
-relative_move(string_desc * target, int from_y, int from_x, int to_y, int
-	      to_x, bool ovw)
+relative_move(NCURSES_SP_DCLx
+	      string_desc * target,
+	      int from_y,
+	      int from_x,
+	      int to_y,
+	      int to_x,
+	      bool ovw)
 /* move via local motions (cuu/cuu1/cud/cud1/cub1/cub/cuf1/cuf/vpa/hpa) */
 {
     string_desc save;
@@ -500,38 +561,38 @@
 
 	if (row_address != 0
 	    && _nc_safe_strcat(target, TPARM_1(row_address, to_y))) {
-	    vcost = SP->_vpa_cost;
+	    vcost = SP_PARM->_vpa_cost;
 	}
 
 	if (to_y > from_y) {
 	    n = (to_y - from_y);
 
 	    if (parm_down_cursor
-		&& SP->_cud_cost < vcost
+		&& SP_PARM->_cud_cost < vcost
 		&& _nc_safe_strcat(_nc_str_copy(target, &save),
 				   TPARM_1(parm_down_cursor, n))) {
-		vcost = SP->_cud_cost;
+		vcost = SP_PARM->_cud_cost;
 	    }
 
 	    if (cursor_down
-		&& (*cursor_down != '\n' || SP->_nl)
-		&& (n * SP->_cud1_cost < vcost)) {
+		&& (*cursor_down != '\n' || SP_PARM->_nl)
+		&& (n * SP_PARM->_cud1_cost < vcost)) {
 		vcost = repeated_append(_nc_str_copy(target, &save), 0,
-					SP->_cud1_cost, n, cursor_down);
+					SP_PARM->_cud1_cost, n, cursor_down);
 	    }
 	} else {		/* (to_y < from_y) */
 	    n = (from_y - to_y);
 
 	    if (parm_up_cursor
-		&& SP->_cuu_cost < vcost
+		&& SP_PARM->_cuu_cost < vcost
 		&& _nc_safe_strcat(_nc_str_copy(target, &save),
 				   TPARM_1(parm_up_cursor, n))) {
-		vcost = SP->_cuu_cost;
+		vcost = SP_PARM->_cuu_cost;
 	    }
 
-	    if (cursor_up && (n * SP->_cuu1_cost < vcost)) {
+	    if (cursor_up && (n * SP_PARM->_cuu1_cost < vcost)) {
 		vcost = repeated_append(_nc_str_copy(target, &save), 0,
-					SP->_cuu1_cost, n, cursor_up);
+					SP_PARM->_cuu1_cost, n, cursor_up);
 	    }
 	}
 
@@ -550,17 +611,17 @@
 	if (column_address
 	    && _nc_safe_strcat(_nc_str_copy(target, &save),
 			       TPARM_1(column_address, to_x))) {
-	    hcost = SP->_hpa_cost;
+	    hcost = SP_PARM->_hpa_cost;
 	}
 
 	if (to_x > from_x) {
 	    n = to_x - from_x;
 
 	    if (parm_right_cursor
-		&& SP->_cuf_cost < hcost
+		&& SP_PARM->_cuf_cost < hcost
 		&& _nc_safe_strcat(_nc_str_copy(target, &save),
 				   TPARM_1(parm_right_cursor, n))) {
-		hcost = SP->_cuf_cost;
+		hcost = SP_PARM->_cuf_cost;
 	    }
 
 	    if (cursor_right) {
@@ -575,7 +636,7 @@
 
 		    for (fr = from_x; (nxt = NEXTTAB(fr)) <= to_x; fr = nxt) {
 			lhcost = repeated_append(&check, lhcost,
-						 SP->_ht_cost, 1, tab);
+						 SP_PARM->_ht_cost, 1, tab);
 			if (lhcost == INFINITY)
 			    break;
 		    }
@@ -599,7 +660,7 @@
 		    && n < (int) check.s_size
 		    && vcost == 0
 		    && str[0] == '\0') {
-		    int wanted = CharOf(WANT_CHAR(to_y, from_x));
+		    int wanted = CharOf(WANT_CHAR(SP_PARM, to_y, from_x));
 		    if (is8bits(wanted) && isdigit(wanted))
 			ovw = FALSE;
 		}
@@ -616,8 +677,8 @@
 		    int i;
 
 		    for (i = 0; i < n; i++) {
-			NCURSES_CH_T ch = WANT_CHAR(to_y, from_x + i);
-			if (!SameAttrOf(ch, SCREEN_ATTRS(SP))
+			NCURSES_CH_T ch = WANT_CHAR(SP_PARM, to_y, from_x + i);
+			if (!SameAttrOf(ch, SCREEN_ATTRS(SP_PARM))
 #if USE_WIDEC_SUPPORT
 			    || !Charable(ch)
 #endif
@@ -631,13 +692,13 @@
 		    int i;
 
 		    for (i = 0; i < n; i++)
-			*check.s_tail++ = (char) CharOf(WANT_CHAR(to_y,
+			*check.s_tail++ = (char) CharOf(WANT_CHAR(SP_PARM, to_y,
 								  from_x + i));
 		    *check.s_tail = '\0';
-		    check.s_size -= n;
-		    lhcost += n * SP->_char_padding;
+		    check.s_size -= (size_t) n;
+		    lhcost += n * SP_PARM->_char_padding;
 		} else {
-		    lhcost = repeated_append(&check, lhcost, SP->_cuf1_cost,
+		    lhcost = repeated_append(&check, lhcost, SP_PARM->_cuf1_cost,
 					     n, cursor_right);
 		}
 
@@ -650,10 +711,10 @@
 	    n = from_x - to_x;
 
 	    if (parm_left_cursor
-		&& SP->_cub_cost < hcost
+		&& SP_PARM->_cub_cost < hcost
 		&& _nc_safe_strcat(_nc_str_copy(target, &save),
 				   TPARM_1(parm_left_cursor, n))) {
-		hcost = SP->_cub_cost;
+		hcost = SP_PARM->_cub_cost;
 	    }
 
 	    if (cursor_left) {
@@ -667,7 +728,8 @@
 
 		    for (fr = from_x; (nxt = LASTTAB(fr)) >= to_x; fr = nxt) {
 			lhcost = repeated_append(&check, lhcost,
-						 SP->_cbt_cost, 1, back_tab);
+						 SP_PARM->_cbt_cost,
+						 1, back_tab);
 			if (lhcost == INFINITY)
 			    break;
 		    }
@@ -676,7 +738,9 @@
 		}
 #endif /* USE_HARD_TABS */
 
-		lhcost = repeated_append(&check, lhcost, SP->_cub1_cost, n, cursor_left);
+		lhcost = repeated_append(&check, lhcost,
+					 SP_PARM->_cub1_cost,
+					 n, cursor_left);
 
 		if (lhcost < hcost
 		    && _nc_safe_strcat(_nc_str_copy(target, &save), str)) {
@@ -705,7 +769,7 @@
  */
 
 static NCURSES_INLINE int
-onscreen_mvcur(int yold, int xold, int ynew, int xnew, bool ovw)
+onscreen_mvcur(NCURSES_SP_DCLx int yold, int xold, int ynew, int xnew, bool ovw)
 /* onscreen move from (yold, xold) to (ynew, xnew) */
 {
     string_desc result;
@@ -723,9 +787,9 @@
 #define InitResult _nc_str_init(&result, buffer, sizeof(buffer))
 
     /* tactic #0: use direct cursor addressing */
-    if (_nc_safe_strcpy(InitResult, TPARM_2(SP->_address_cursor, ynew, xnew))) {
+    if (_nc_safe_strcpy(InitResult, TPARM_2(SP_PARM->_address_cursor, ynew, xnew))) {
 	tactic = 0;
-	usecost = SP->_cup_cost;
+	usecost = SP_PARM->_cup_cost;
 
 #if defined(TRACE) || defined(NCURSES_TEST)
 	if (!(_nc_optimize_enable & OPTIMIZE_MVCUR))
@@ -740,7 +804,7 @@
 	 * (like, say, local-movement \n getting mapped to some obscure
 	 * character because A_ALTCHARSET is on).
 	 */
-	if (yold == -1 || xold == -1 || NOT_LOCAL(yold, xold, ynew, xnew)) {
+	if (yold == -1 || xold == -1 || NOT_LOCAL(SP_PARM, yold, xold, ynew, xnew)) {
 #if defined(MAIN) || defined(NCURSES_TEST)
 	    if (!profiling) {
 		(void) fputs("nonlocal\n", stderr);
@@ -754,8 +818,10 @@
 #ifndef NO_OPTIMIZE
     /* tactic #1: use local movement */
     if (yold != -1 && xold != -1
-	&& ((newcost = relative_move(NullResult, yold, xold, ynew, xnew,
-				     ovw)) != INFINITY)
+	&& ((newcost = relative_move(NCURSES_SP_ARGx
+				     NullResult,
+				     yold, xold,
+				     ynew, xnew, ovw)) != INFINITY)
 	&& newcost < usecost) {
 	tactic = 1;
 	usecost = newcost;
@@ -763,42 +829,51 @@
 
     /* tactic #2: use carriage-return + local movement */
     if (yold != -1 && carriage_return
-	&& ((newcost = relative_move(NullResult, yold, 0, ynew, xnew, ovw))
-	    != INFINITY)
-	&& SP->_cr_cost + newcost < usecost) {
+	&& ((newcost = relative_move(NCURSES_SP_ARGx
+				     NullResult,
+				     yold, 0,
+				     ynew, xnew, ovw)) != INFINITY)
+	&& SP_PARM->_cr_cost + newcost < usecost) {
 	tactic = 2;
-	usecost = SP->_cr_cost + newcost;
+	usecost = SP_PARM->_cr_cost + newcost;
     }
 
     /* tactic #3: use home-cursor + local movement */
     if (cursor_home
-	&& ((newcost = relative_move(NullResult, 0, 0, ynew, xnew, ovw)) != INFINITY)
-	&& SP->_home_cost + newcost < usecost) {
+	&& ((newcost = relative_move(NCURSES_SP_ARGx
+				     NullResult,
+				     0, 0,
+				     ynew, xnew, ovw)) != INFINITY)
+	&& SP_PARM->_home_cost + newcost < usecost) {
 	tactic = 3;
-	usecost = SP->_home_cost + newcost;
+	usecost = SP_PARM->_home_cost + newcost;
     }
 
     /* tactic #4: use home-down + local movement */
     if (cursor_to_ll
-	&& ((newcost = relative_move(NullResult, screen_lines - 1, 0, ynew,
-				     xnew, ovw)) != INFINITY)
-	&& SP->_ll_cost + newcost < usecost) {
+	&& ((newcost = relative_move(NCURSES_SP_ARGx
+				     NullResult,
+				     screen_lines(SP_PARM) - 1, 0,
+				     ynew, xnew, ovw)) != INFINITY)
+	&& SP_PARM->_ll_cost + newcost < usecost) {
 	tactic = 4;
-	usecost = SP->_ll_cost + newcost;
+	usecost = SP_PARM->_ll_cost + newcost;
     }
 
     /*
      * tactic #5: use left margin for wrap to right-hand side,
      * unless strange wrap behavior indicated by xenl might hose us.
      */
-    t5_cr_cost = (xold > 0 ? SP->_cr_cost : 0);
+    t5_cr_cost = (xold > 0 ? SP_PARM->_cr_cost : 0);
     if (auto_left_margin && !eat_newline_glitch
 	&& yold > 0 && cursor_left
-	&& ((newcost = relative_move(NullResult, yold - 1, screen_columns -
-				     1, ynew, xnew, ovw)) != INFINITY)
-	&& t5_cr_cost + SP->_cub1_cost + newcost < usecost) {
+	&& ((newcost = relative_move(NCURSES_SP_ARGx
+				     NullResult,
+				     yold - 1, screen_columns(SP_PARM) - 1,
+				     ynew, xnew, ovw)) != INFINITY)
+	&& t5_cr_cost + SP_PARM->_cub1_cost + newcost < usecost) {
 	tactic = 5;
-	usecost = t5_cr_cost + SP->_cub1_cost + newcost;
+	usecost = t5_cr_cost + SP_PARM->_cub1_cost + newcost;
     }
 
     /*
@@ -808,26 +883,39 @@
 	InitResult;
     switch (tactic) {
     case 1:
-	(void) relative_move(&result, yold, xold, ynew, xnew, ovw);
+	(void) relative_move(NCURSES_SP_ARGx
+			     &result,
+			     yold, xold,
+			     ynew, xnew, ovw);
 	break;
     case 2:
 	(void) _nc_safe_strcpy(&result, carriage_return);
-	(void) relative_move(&result, yold, 0, ynew, xnew, ovw);
+	(void) relative_move(NCURSES_SP_ARGx
+			     &result,
+			     yold, 0,
+			     ynew, xnew, ovw);
 	break;
     case 3:
 	(void) _nc_safe_strcpy(&result, cursor_home);
-	(void) relative_move(&result, 0, 0, ynew, xnew, ovw);
+	(void) relative_move(NCURSES_SP_ARGx
+			     &result, 0, 0,
+			     ynew, xnew, ovw);
 	break;
     case 4:
 	(void) _nc_safe_strcpy(&result, cursor_to_ll);
-	(void) relative_move(&result, screen_lines - 1, 0, ynew, xnew, ovw);
+	(void) relative_move(NCURSES_SP_ARGx
+			     &result,
+			     screen_lines(SP_PARM) - 1, 0,
+			     ynew, xnew, ovw);
 	break;
     case 5:
 	if (xold > 0)
 	    (void) _nc_safe_strcat(&result, carriage_return);
 	(void) _nc_safe_strcat(&result, cursor_left);
-	(void) relative_move(&result, yold - 1, screen_columns - 1, ynew,
-			     xnew, ovw);
+	(void) relative_move(NCURSES_SP_ARGx
+			     &result,
+			     yold - 1, screen_columns(SP_PARM) - 1,
+			     ynew, xnew, ovw);
 	break;
     }
 #endif /* !NO_OPTIMIZE */
@@ -845,25 +933,26 @@
 
     if (usecost != INFINITY) {
 	TPUTS_TRACE("mvcur");
-	tputs(buffer, 1, _nc_outch);
-	SP->_cursrow = ynew;
-	SP->_curscol = xnew;
+	NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx
+				buffer, 1, NCURSES_SP_NAME(_nc_outch));
+	SP_PARM->_cursrow = ynew;
+	SP_PARM->_curscol = xnew;
 	return (OK);
     } else
 	return (ERR);
 }
 
 NCURSES_EXPORT(int)
-mvcur(int yold, int xold, int ynew, int xnew)
+TINFO_MVCUR(NCURSES_SP_DCLx int yold, int xold, int ynew, int xnew)
 /* optimized cursor move from (yold, xold) to (ynew, xnew) */
 {
     NCURSES_CH_T oldattr;
     int code;
 
-    TR(TRACE_CALLS | TRACE_MOVE, (T_CALLED("mvcur(%d,%d,%d,%d)"),
-				  yold, xold, ynew, xnew));
+    TR(TRACE_CALLS | TRACE_MOVE, (T_CALLED("_nc_tinfo_mvcur(%p,%d,%d,%d,%d)"),
+				  (void *) SP_PARM, yold, xold, ynew, xnew));
 
-    if (SP == 0) {
+    if (SP_PARM == 0) {
 	code = ERR;
     } else if (yold == ynew && xold == xnew) {
 	code = OK;
@@ -874,9 +963,9 @@
 	 * column position implied by wraparound or the lack thereof and
 	 * rolling up the screen to get ynew on the screen.
 	 */
-	if (xnew >= screen_columns) {
-	    ynew += xnew / screen_columns;
-	    xnew %= screen_columns;
+	if (xnew >= screen_columns(SP_PARM)) {
+	    ynew += xnew / screen_columns(SP_PARM);
+	    xnew %= screen_columns(SP_PARM);
 	}
 
 	/*
@@ -884,38 +973,40 @@
 	 * character set -- these have a strong tendency to screw up the CR &
 	 * LF used for local character motions!
 	 */
-	oldattr = SCREEN_ATTRS(SP);
+	oldattr = SCREEN_ATTRS(SP_PARM);
 	if ((AttrOf(oldattr) & A_ALTCHARSET)
 	    || (AttrOf(oldattr) && !move_standout_mode)) {
 	    TR(TRACE_CHARPUT, ("turning off (%#lx) %s before move",
 			       (unsigned long) AttrOf(oldattr),
 			       _traceattr(AttrOf(oldattr))));
-	    (void) VIDATTR(A_NORMAL, 0);
+	    (void) VIDATTR(SP_PARM, A_NORMAL, 0);
 	}
 
-	if (xold >= screen_columns) {
+	if (xold >= screen_columns(SP_PARM)) {
 	    int l;
 
-	    if (SP->_nl) {
-		l = (xold + 1) / screen_columns;
+	    if (SP_PARM->_nl) {
+		l = (xold + 1) / screen_columns(SP_PARM);
 		yold += l;
-		if (yold >= screen_lines)
-		    l -= (yold - screen_lines - 1);
+		if (yold >= screen_lines(SP_PARM))
+		    l -= (yold - screen_lines(SP_PARM) - 1);
 
 		if (l > 0) {
 		    if (carriage_return) {
-			TPUTS_TRACE("carriage_return");
-			putp(carriage_return);
+			NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx
+						   "carriage_return",
+						   carriage_return);
 		    } else
-			_nc_outch('\r');
+			NCURSES_SP_NAME(_nc_outch) (NCURSES_SP_ARGx '\r');
 		    xold = 0;
 
 		    while (l > 0) {
 			if (newline) {
-			    TPUTS_TRACE("newline");
-			    putp(newline);
+			    NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx
+						       "newline",
+						       newline);
 			} else
-			    _nc_outch('\n');
+			    NCURSES_SP_NAME(_nc_outch) (NCURSES_SP_ARGx '\n');
 			l--;
 		    }
 		}
@@ -929,27 +1020,35 @@
 	    }
 	}
 
-	if (yold > screen_lines - 1)
-	    yold = screen_lines - 1;
-	if (ynew > screen_lines - 1)
-	    ynew = screen_lines - 1;
+	if (yold > screen_lines(SP_PARM) - 1)
+	    yold = screen_lines(SP_PARM) - 1;
+	if (ynew > screen_lines(SP_PARM) - 1)
+	    ynew = screen_lines(SP_PARM) - 1;
 
 	/* destination location is on screen now */
-	code = onscreen_mvcur(yold, xold, ynew, xnew, TRUE);
+	code = onscreen_mvcur(NCURSES_SP_ARGx yold, xold, ynew, xnew, TRUE);
 
 	/*
 	 * Restore attributes if we disabled them before moving.
 	 */
-	if (!SameAttrOf(oldattr, SCREEN_ATTRS(SP))) {
+	if (!SameAttrOf(oldattr, SCREEN_ATTRS(SP_PARM))) {
 	    TR(TRACE_CHARPUT, ("turning on (%#lx) %s after move",
 			       (unsigned long) AttrOf(oldattr),
 			       _traceattr(AttrOf(oldattr))));
-	    (void) VIDATTR(AttrOf(oldattr), GetPair(oldattr));
+	    (void) VIDATTR(SP_PARM, AttrOf(oldattr), GetPair(oldattr));
 	}
     }
     returnCode(code);
 }
 
+#if NCURSES_SP_FUNCS && !defined(USE_TERM_DRIVER)
+NCURSES_EXPORT(int)
+mvcur(int yold, int xold, int ynew, int xnew)
+{
+    return NCURSES_SP_NAME(mvcur) (CURRENT_SCREEN, yold, xold, ynew, xnew);
+}
+#endif
+
 #if defined(TRACE) || defined(NCURSES_TEST)
 NCURSES_EXPORT_VAR(int) _nc_optimize_enable = OPTIMIZE_ALL;
 #endif
@@ -1212,25 +1311,25 @@
 			   speeds[i], overhead, totalest);
 	    }
 	} else if (buf[0] == 'c') {
-	    (void) printf("char padding: %d\n", SP->_char_padding);
-	    (void) printf("cr cost: %d\n", SP->_cr_cost);
-	    (void) printf("cup cost: %d\n", SP->_cup_cost);
-	    (void) printf("home cost: %d\n", SP->_home_cost);
-	    (void) printf("ll cost: %d\n", SP->_ll_cost);
+	    (void) printf("char padding: %d\n", CURRENT_SCREEN->_char_padding);
+	    (void) printf("cr cost: %d\n", CURRENT_SCREEN->_cr_cost);
+	    (void) printf("cup cost: %d\n", CURRENT_SCREEN->_cup_cost);
+	    (void) printf("home cost: %d\n", CURRENT_SCREEN->_home_cost);
+	    (void) printf("ll cost: %d\n", CURRENT_SCREEN->_ll_cost);
 #if USE_HARD_TABS
-	    (void) printf("ht cost: %d\n", SP->_ht_cost);
-	    (void) printf("cbt cost: %d\n", SP->_cbt_cost);
+	    (void) printf("ht cost: %d\n", CURRENT_SCREEN->_ht_cost);
+	    (void) printf("cbt cost: %d\n", CURRENT_SCREEN->_cbt_cost);
 #endif /* USE_HARD_TABS */
-	    (void) printf("cub1 cost: %d\n", SP->_cub1_cost);
-	    (void) printf("cuf1 cost: %d\n", SP->_cuf1_cost);
-	    (void) printf("cud1 cost: %d\n", SP->_cud1_cost);
-	    (void) printf("cuu1 cost: %d\n", SP->_cuu1_cost);
-	    (void) printf("cub cost: %d\n", SP->_cub_cost);
-	    (void) printf("cuf cost: %d\n", SP->_cuf_cost);
-	    (void) printf("cud cost: %d\n", SP->_cud_cost);
-	    (void) printf("cuu cost: %d\n", SP->_cuu_cost);
-	    (void) printf("hpa cost: %d\n", SP->_hpa_cost);
-	    (void) printf("vpa cost: %d\n", SP->_vpa_cost);
+	    (void) printf("cub1 cost: %d\n", CURRENT_SCREEN->_cub1_cost);
+	    (void) printf("cuf1 cost: %d\n", CURRENT_SCREEN->_cuf1_cost);
+	    (void) printf("cud1 cost: %d\n", CURRENT_SCREEN->_cud1_cost);
+	    (void) printf("cuu1 cost: %d\n", CURRENT_SCREEN->_cuu1_cost);
+	    (void) printf("cub cost: %d\n", CURRENT_SCREEN->_cub_cost);
+	    (void) printf("cuf cost: %d\n", CURRENT_SCREEN->_cuf_cost);
+	    (void) printf("cud cost: %d\n", CURRENT_SCREEN->_cud_cost);
+	    (void) printf("cuu cost: %d\n", CURRENT_SCREEN->_cuu_cost);
+	    (void) printf("hpa cost: %d\n", CURRENT_SCREEN->_hpa_cost);
+	    (void) printf("vpa cost: %d\n", CURRENT_SCREEN->_vpa_cost);
 	} else if (buf[0] == 'x' || buf[0] == 'q')
 	    break;
 	else
diff -Naur ncurses-5.7.orig/ncurses/tty/lib_tstp.c ncurses-5.7/ncurses/tty/lib_tstp.c
--- ncurses-5.7.orig/ncurses/tty/lib_tstp.c	2008-05-03 12:24:56.000000000 -0400
+++ ncurses-5.7/ncurses/tty/lib_tstp.c	2011-01-08 18:13:50.743157311 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2007,2008 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            *
@@ -46,7 +46,7 @@
 #define _POSIX_SOURCE
 #endif
 
-MODULE_ID("$Id: lib_tstp.c,v 1.37 2008/05/03 16:24:56 tom Exp $")
+MODULE_ID("$Id: lib_tstp.c,v 1.41 2010/05/15 21:31:12 tom Exp $")
 
 #if defined(SIGTSTP) && (HAVE_SIGACTION || HAVE_SIGVEC)
 #define USE_SIGTSTP 1
@@ -59,16 +59,20 @@
 signal_name(int sig)
 {
     switch (sig) {
+#ifdef SIGALRM
     case SIGALRM:
 	return "SIGALRM";
+#endif
 #ifdef SIGCONT
     case SIGCONT:
 	return "SIGCONT";
 #endif
     case SIGINT:
 	return "SIGINT";
+#ifdef SIGQUIT
     case SIGQUIT:
 	return "SIGQUIT";
+#endif
     case SIGTERM:
 	return "SIGTERM";
 #ifdef SIGTSTP
@@ -136,6 +140,7 @@
 static void
 tstp(int dummy GCC_UNUSED)
 {
+    SCREEN *sp = CURRENT_SCREEN;
     sigset_t mask, omask;
     sigaction_t act, oact;
 
@@ -154,11 +159,11 @@
      * parent was stopped before us, and we would likely pick up the
      * settings already modified by the shell.
      */
-    if (SP != 0 && !SP->_endwin)	/* don't do this if we're not in curses */
+    if (sp != 0 && !sp->_endwin)	/* don't do this if we're not in curses */
 #if HAVE_TCGETPGRP
 	if (tcgetpgrp(STDIN_FILENO) == getpgrp())
 #endif
-	    def_prog_mode();
+	    NCURSES_SP_NAME(def_prog_mode) (NCURSES_SP_ARG);
 
     /*
      * Block window change and timer signals.  The latter
@@ -166,7 +171,9 @@
      * to repaint the screen.
      */
     (void) sigemptyset(&mask);
+#ifdef SIGALRM
     (void) sigaddset(&mask, SIGALRM);
+#endif
 #if USE_SIGWINCH
     (void) sigaddset(&mask, SIGWINCH);
 #endif
@@ -185,7 +192,7 @@
      * End window mode, which also resets the terminal state to the
      * original (pre-curses) modes.
      */
-    endwin();
+    NCURSES_SP_NAME(endwin) (NCURSES_SP_ARG);
 
     /* Unblock SIGTSTP. */
     (void) sigemptyset(&mask);
@@ -212,19 +219,19 @@
 
     T(("SIGCONT received"));
     sigaction(SIGTSTP, &oact, NULL);
-    flushinp();
+    NCURSES_SP_NAME(flushinp) (NCURSES_SP_ARG);
 
     /*
      * If the user modified the tty state while suspended, he wants
      * those changes to stick.  So save the new "default" terminal state.
      */
-    def_shell_mode();
+    NCURSES_SP_NAME(def_shell_mode) (NCURSES_SP_ARG);
 
     /*
      * This relies on the fact that doupdate() will restore the
      * program-mode tty state, and issue enter_ca_mode if need be.
      */
-    doupdate();
+    NCURSES_SP_NAME(doupdate) (NCURSES_SP_ARG);
 
     /* Reset the signals. */
     (void) sigprocmask(SIG_SETMASK, &omask, NULL);
@@ -234,6 +241,8 @@
 static void
 cleanup(int sig)
 {
+    SCREEN *sp = CURRENT_SCREEN;
+
     /*
      * Actually, doing any sort of I/O from within an signal handler is
      * "unsafe".  But we'll _try_ to clean up the screen and terminal
@@ -241,7 +250,10 @@
      */
     if (!_nc_globals.cleanup_nested++
 	&& (sig == SIGINT
-	    || sig == SIGQUIT)) {
+#ifdef SIGQUIT
+	    || sig == SIGQUIT
+#endif
+	)) {
 #if HAVE_SIGACTION || HAVE_SIGVEC
 	sigaction_t act;
 	sigemptyset(&act.sa_mask);
@@ -257,12 +269,12 @@
 		if (scan->_ofp != 0
 		    && isatty(fileno(scan->_ofp))) {
 		    scan->_cleanup = TRUE;
-		    scan->_outch = _nc_outch;
+		    scan->_outch = NCURSES_SP_NAME(_nc_outch);
 		}
 		set_term(scan);
-		endwin();
-		if (SP)
-		    SP->_endwin = FALSE;	/* in case we have an atexit! */
+		NCURSES_SP_NAME(endwin) (NCURSES_SP_ARG);
+		if (sp)
+		    sp->_endwin = FALSE;	/* in case we have an atexit! */
 	    }
 	}
     }
@@ -274,6 +286,13 @@
 sigwinch(int sig GCC_UNUSED)
 {
     _nc_globals.have_sigwinch = 1;
+# if USE_PTHREADS_EINTR
+    if (_nc_globals.read_thread) {
+	if (!pthread_equal(pthread_self(), _nc_globals.read_thread))
+	    pthread_kill(_nc_globals.read_thread, SIGWINCH);
+	_nc_globals.read_thread = 0;
+    }
+# endif
 }
 #endif /* USE_SIGWINCH */
 
diff -Naur ncurses-5.7.orig/ncurses/tty/lib_twait.c ncurses-5.7/ncurses/tty/lib_twait.c
--- ncurses-5.7.orig/ncurses/tty/lib_twait.c	2008-08-30 16:08:19.000000000 -0400
+++ ncurses-5.7/ncurses/tty/lib_twait.c	2011-01-08 18:18:29.754781633 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2007,2008 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            *
@@ -65,10 +65,12 @@
 #  include <sys/select.h>
 # endif
 #endif
-
+#ifdef __MINGW32__
+#  include <sys/time.h>
+#endif
 #undef CUR
 
-MODULE_ID("$Id: lib_twait.c,v 1.59 2008/08/30 20:08:19 tom Exp $")
+MODULE_ID("$Id: lib_twait.c,v 1.61 2010/12/25 23:43:58 tom Exp $")
 
 static long
 _nc_gettime(TimeType * t0, bool first)
@@ -124,15 +126,27 @@
 }
 #endif /* NCURSES_WGETCH_EVENTS */
 
+#if (USE_FUNC_POLL || HAVE_SELECT)
+#  define MAYBE_UNUSED
+#else
+#  define MAYBE_UNUSED GCC_UNUSED
+#endif
+
+#if (USE_FUNC_POLL || HAVE_SELECT)
+#  define MAYBE_UNUSED
+#else
+#  define MAYBE_UNUSED GCC_UNUSED
+#endif
+
 /*
  * Wait a specified number of milliseconds, returning nonzero if the timer
  * didn't expire before there is activity on the specified file descriptors.
  * The file-descriptors are specified by the mode:
- *	0 - none (absolute time)
- *	1 - ncurses' normal input-descriptor
- *	2 - mouse descriptor, if any
- *	3 - either input or mouse.
- *
+ *	TW_NONE    0 - none (absolute time)
+ *	TW_INPUT   1 - ncurses' normal input-descriptor
+ *	TW_MOUSE   2 - mouse descriptor, if any
+ *	TW_ANY     3 - either input or mouse.
+ *      TW_EVENT   4 -
  * Experimental:  if NCURSES_WGETCH_EVENTS is defined, (mode & 4) determines
  * whether to pay attention to evl argument.  If set, the smallest of
  * millisecond and of timeout of evl is taken.
@@ -143,16 +157,18 @@
  * descriptors.
  */
 NCURSES_EXPORT(int)
-_nc_timed_wait(SCREEN *sp,
-	       int mode,
+_nc_timed_wait(SCREEN *sp MAYBE_UNUSED,
+	       int mode MAYBE_UNUSED,
 	       int milliseconds,
 	       int *timeleft
 	       EVENTLIST_2nd(_nc_eventlist * evl))
 {
-    int fd;
     int count;
-    int result = 0;
+    int result = TW_NONE;
     TimeType t0;
+#if (USE_FUNC_POLL || HAVE_SELECT)
+    int fd;
+#endif
 
 #ifdef NCURSES_WGETCH_EVENTS
     int timeout_is_event = 0;
@@ -174,7 +190,7 @@
 		      milliseconds, mode));
 
 #ifdef NCURSES_WGETCH_EVENTS
-    if (mode & 4) {
+    if (mode & TW_EVENT) {
 	int event_delay = _nc_eventlist_timeout(evl);
 
 	if (event_delay >= 0
@@ -193,7 +209,7 @@
     count = 0;
 
 #ifdef NCURSES_WGETCH_EVENTS
-    if ((mode & 4) && evl)
+    if ((mode & TW_EVENT) && evl)
 	evl->result_flags = 0;
 #endif
 
@@ -201,23 +217,23 @@
     memset(fd_list, 0, sizeof(fd_list));
 
 #ifdef NCURSES_WGETCH_EVENTS
-    if ((mode & 4) && evl)
+    if ((mode & TW_EVENT) && evl)
 	fds = typeMalloc(struct pollfd, MIN_FDS + evl->count);
 #endif
 
-    if (mode & 1) {
+    if (mode & TW_INPUT) {
 	fds[count].fd = sp->_ifd;
 	fds[count].events = POLLIN;
 	count++;
     }
-    if ((mode & 2)
+    if ((mode & TW_MOUSE)
 	&& (fd = sp->_mouse_fd) >= 0) {
 	fds[count].fd = fd;
 	fds[count].events = POLLIN;
 	count++;
     }
 #ifdef NCURSES_WGETCH_EVENTS
-    if ((mode & 4) && evl) {
+    if ((mode & TW_EVENT) && evl) {
 	for (n = 0; n < evl->count; ++n) {
 	    _nc_event *ev = evl->events[n];
 
@@ -234,7 +250,7 @@
     result = poll(fds, (unsigned) count, milliseconds);
 
 #ifdef NCURSES_WGETCH_EVENTS
-    if ((mode & 4) && evl) {
+    if ((mode & TW_EVENT) && evl) {
 	int c;
 
 	if (!result)
@@ -276,8 +292,8 @@
      *
      * FIXME: this assumes mode&1 if milliseconds < 0 (see lib_getch.c).
      */
-    result = 0;
-    if (mode & 1) {
+    result = TW_NONE;
+    if (mode & TW_INPUT) {
 	int step = (milliseconds < 0) ? 0 : 5000;
 	bigtime_t d;
 	bigtime_t useconds = milliseconds * 1000;
@@ -313,17 +329,17 @@
      */
     FD_ZERO(&set);
 
-    if (mode & 1) {
+    if (mode & TW_INPUT) {
 	FD_SET(sp->_ifd, &set);
 	count = sp->_ifd + 1;
     }
-    if ((mode & 2)
+    if ((mode & TW_MOUSE)
 	&& (fd = sp->_mouse_fd) >= 0) {
 	FD_SET(fd, &set);
 	count = max(fd, count) + 1;
     }
 #ifdef NCURSES_WGETCH_EVENTS
-    if ((mode & 4) && evl) {
+    if ((mode & TW_EVENT) && evl) {
 	for (n = 0; n < evl->count; ++n) {
 	    _nc_event *ev = evl->events[n];
 
@@ -346,7 +362,7 @@
     }
 
 #ifdef NCURSES_WGETCH_EVENTS
-    if ((mode & 4) && evl) {
+    if ((mode & TW_EVENT) && evl) {
 	evl->result_flags = 0;
 	for (n = 0; n < evl->count; ++n) {
 	    _nc_event *ev = evl->events[n];
@@ -370,7 +386,7 @@
     returntime = _nc_gettime(&t0, FALSE);
 
     if (milliseconds >= 0)
-	milliseconds -= (returntime - starttime);
+	milliseconds -= (int) (returntime - starttime);
 
 #ifdef NCURSES_WGETCH_EVENTS
     if (evl) {
@@ -428,22 +444,22 @@
 		}
 	    }
 #elif defined(__BEOS__)
-	    result = 1;		/* redundant, but simple */
+	    result = TW_INPUT;	/* redundant, but simple */
 #elif HAVE_SELECT
-	    if ((mode & 2)
+	    if ((mode & TW_MOUSE)
 		&& (fd = sp->_mouse_fd) >= 0
 		&& FD_ISSET(fd, &set))
-		result |= 2;
-	    if ((mode & 1)
+		result |= TW_MOUSE;
+	    if ((mode & TW_INPUT)
 		&& FD_ISSET(sp->_ifd, &set))
-		result |= 1;
+		result |= TW_INPUT;
 #endif
 	} else
 	    result = 0;
     }
 #ifdef NCURSES_WGETCH_EVENTS
-    if ((mode & 4) && evl && evl->result_flags)
-	result |= 4;
+    if ((mode & TW_EVENT) && evl && evl->result_flags)
+	result |= TW_EVENT;
 #endif
 
     return (result);
diff -Naur ncurses-5.7.orig/ncurses/tty/lib_vidattr.c ncurses-5.7/ncurses/tty/lib_vidattr.c
--- ncurses-5.7.orig/ncurses/tty/lib_vidattr.c	2007-06-30 17:58:04.000000000 -0400
+++ ncurses-5.7/ncurses/tty/lib_vidattr.c	2011-01-08 18:13:50.743157311 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2006,2007 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            *
@@ -29,7 +29,8 @@
 /****************************************************************************
  *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995               *
  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
- *     and: Thomas E. Dickey                        1996 on                 *
+ *     and: Thomas E. Dickey                        1996-on                 *
+ *     and: Juergen Pfeifer                         2009                    *
  ****************************************************************************/
 
 /*
@@ -63,11 +64,16 @@
  */
 
 #include <curses.priv.h>
-#include <term.h>
 
-MODULE_ID("$Id: lib_vidattr.c,v 1.49 2007/06/30 21:58:04 tom Exp $")
+#ifndef CUR
+#define CUR SP_TERMTYPE
+#endif
+
+MODULE_ID("$Id: lib_vidattr.c,v 1.61 2010/06/05 22:22:04 tom Exp $")
 
-#define doPut(mode) TPUTS_TRACE(#mode); tputs(mode, 1, outc)
+#define doPut(mode) \
+	TPUTS_TRACE(#mode); \
+	NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx mode, 1, outc)
 
 #define TurnOn(mask,mode) \
 	if ((turn_on & mask) && mode) { doPut(mode); }
@@ -78,40 +84,49 @@
 	/* if there is no current screen, assume we *can* do color */
 #define SetColorsIf(why,old_attr) \
 	if (can_color && (why)) { \
-		int old_pair = PAIR_NUMBER(old_attr); \
+		int old_pair = PairNumber(old_attr); \
 		TR(TRACE_ATTRS, ("old pair = %d -- new pair = %d", old_pair, pair)); \
 		if ((pair != old_pair) \
 		 || (fix_pair0 && (pair == 0)) \
 		 || (reverse ^ ((old_attr & A_REVERSE) != 0))) { \
-			_nc_do_color(old_pair, pair, reverse, outc); \
+		     NCURSES_SP_NAME(_nc_do_color)(NCURSES_SP_ARGx \
+				     (short) old_pair, \
+				     (short) pair, \
+				     reverse, outc); \
 		} \
 	}
 
 #define PreviousAttr _nc_prescreen.previous_attr
 
 NCURSES_EXPORT(int)
-vidputs(chtype newmode, int (*outc) (int))
+NCURSES_SP_NAME(vidputs) (NCURSES_SP_DCLx
+			  chtype newmode,
+			  NCURSES_SP_OUTC outc)
 {
     attr_t turn_on, turn_off;
     int pair;
     bool reverse = FALSE;
-    bool can_color = (SP == 0 || SP->_coloron);
+    bool can_color = (SP_PARM == 0 || SP_PARM->_coloron);
 #if NCURSES_EXT_FUNCS
-    bool fix_pair0 = (SP != 0 && SP->_coloron && !SP->_default_color);
+    bool fix_pair0 = (SP_PARM != 0 && SP_PARM->_coloron && !SP_PARM->_default_color);
 #else
 #define fix_pair0 FALSE
 #endif
 
     newmode &= A_ATTRIBUTES;
-    T((T_CALLED("vidputs(%s)"), _traceattr(newmode)));
+
+    T((T_CALLED("vidputs(%p,%s)"), (void *) SP_PARM, _traceattr(newmode)));
+
+    if (!IsTermInfo(SP_PARM))
+	returnCode(ERR);
 
     /* this allows us to go on whether or not newterm() has been called */
-    if (SP)
-	PreviousAttr = AttrOf(SCREEN_ATTRS(SP));
+    if (SP_PARM)
+	PreviousAttr = AttrOf(SCREEN_ATTRS(SP_PARM));
 
     TR(TRACE_ATTRS, ("previous attribute was %s", _traceattr(PreviousAttr)));
 
-    if ((SP != 0)
+    if ((SP_PARM != 0)
 	&& (magic_cookie_glitch > 0)) {
 #if USE_XMC_SUPPORT
 	static const chtype table[] =
@@ -135,7 +150,7 @@
 	 * the terminfo max_attributes value.
 	 */
 	for (n = 0; n < SIZEOF(table); ++n) {
-	    if ((table[n] & SP->_ok_attributes) == 0) {
+	    if ((table[n] & SP_PARM->_ok_attributes) == 0) {
 		newmode &= ~table[n];
 	    } else if ((table[n] & newmode) != 0) {
 		if (used++ >= limit) {
@@ -148,7 +163,7 @@
 	    }
 	}
 #else
-	newmode &= ~(SP->_xmc_suppress);
+	newmode &= ~(SP_PARM->_xmc_suppress);
 #endif
 	TR(TRACE_ATTRS, ("suppressed attribute is %s", _traceattr(newmode)));
     }
@@ -172,7 +187,7 @@
 	 * A_ALTCHARSET (256) down 2 to line up.  We use the NCURSES_BITS
 	 * macro so this will work properly for the wide-character layout.
 	 */
-	unsigned value = no_color_video;
+	unsigned value = (unsigned) no_color_video;
 	attr_t mask = NCURSES_BITS((value & 63)
 				   | ((value & 192) << 1)
 				   | ((value & 256) >> 2), 8);
@@ -188,7 +203,7 @@
     if (newmode == PreviousAttr)
 	returnCode(OK);
 
-    pair = PAIR_NUMBER(newmode);
+    pair = PairNumber(newmode);
 
     if (reverse) {
 	newmode &= ~A_REVERSE;
@@ -208,10 +223,10 @@
 	    if (exit_attribute_mode) {
 		doPut(exit_attribute_mode);
 	    } else {
-		if (!SP || SP->_use_rmul) {
+		if (!SP_PARM || SP_PARM->_use_rmul) {
 		    TurnOff(A_UNDERLINE, exit_underline_mode);
 		}
-		if (!SP || SP->_use_rmso) {
+		if (!SP_PARM || SP_PARM->_use_rmso) {
 		    TurnOff(A_STANDOUT, exit_standout_mode);
 		}
 	    }
@@ -222,16 +237,18 @@
     } else if (set_attributes) {
 	if (turn_on || turn_off) {
 	    TPUTS_TRACE("set_attributes");
-	    tputs(tparm(set_attributes,
-			(newmode & A_STANDOUT) != 0,
-			(newmode & A_UNDERLINE) != 0,
-			(newmode & A_REVERSE) != 0,
-			(newmode & A_BLINK) != 0,
-			(newmode & A_DIM) != 0,
-			(newmode & A_BOLD) != 0,
-			(newmode & A_INVIS) != 0,
-			(newmode & A_PROTECT) != 0,
-			(newmode & A_ALTCHARSET) != 0), 1, outc);
+	    NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx
+				    tparm(set_attributes,
+					  (newmode & A_STANDOUT) != 0,
+					  (newmode & A_UNDERLINE) != 0,
+					  (newmode & A_REVERSE) != 0,
+					  (newmode & A_BLINK) != 0,
+					  (newmode & A_DIM) != 0,
+					  (newmode & A_BOLD) != 0,
+					  (newmode & A_INVIS) != 0,
+					  (newmode & A_PROTECT) != 0,
+					  (newmode & A_ALTCHARSET) != 0),
+				    1, outc);
 	    PreviousAttr &= ALL_BUT_COLOR;
 	}
 	SetColorsIf((pair != 0) || fix_pair0, PreviousAttr);
@@ -241,11 +258,11 @@
 
 	TurnOff(A_ALTCHARSET, exit_alt_charset_mode);
 
-	if (!SP || SP->_use_rmul) {
+	if (!SP_PARM || SP_PARM->_use_rmul) {
 	    TurnOff(A_UNDERLINE, exit_underline_mode);
 	}
 
-	if (!SP || SP->_use_rmso) {
+	if (!SP_PARM || SP_PARM->_use_rmso) {
 	    TurnOff(A_STANDOUT, exit_standout_mode);
 	}
 
@@ -282,28 +299,53 @@
     if (reverse)
 	newmode |= A_REVERSE;
 
-    if (SP)
-	SetAttr(SCREEN_ATTRS(SP), newmode);
+    if (SP_PARM)
+	SetAttr(SCREEN_ATTRS(SP_PARM), newmode);
     else
 	PreviousAttr = newmode;
 
     returnCode(OK);
 }
 
+#if NCURSES_SP_FUNCS
 NCURSES_EXPORT(int)
-vidattr(chtype newmode)
+vidputs(chtype newmode, NCURSES_OUTC outc)
 {
-    T((T_CALLED("vidattr(%s)"), _traceattr(newmode)));
+    SetSafeOutcWrapper(outc);
+    return NCURSES_SP_NAME(vidputs) (CURRENT_SCREEN,
+				     newmode,
+				     _nc_outc_wrapper);
+}
+#endif
 
-    returnCode(vidputs(newmode, _nc_outch));
+NCURSES_EXPORT(int)
+NCURSES_SP_NAME(vidattr) (NCURSES_SP_DCLx chtype newmode)
+{
+    T((T_CALLED("vidattr(%p,%s)"), (void *) SP_PARM, _traceattr(newmode)));
+    returnCode(NCURSES_SP_NAME(vidputs) (NCURSES_SP_ARGx
+					 newmode,
+					 NCURSES_SP_NAME(_nc_outch)));
 }
 
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+vidattr(chtype newmode)
+{
+    return NCURSES_SP_NAME(vidattr) (CURRENT_SCREEN, newmode);
+}
+#endif
+
 NCURSES_EXPORT(chtype)
-termattrs(void)
+NCURSES_SP_NAME(termattrs) (NCURSES_SP_DCL0)
 {
     chtype attrs = A_NORMAL;
 
-    T((T_CALLED("termattrs()")));
+    T((T_CALLED("termattrs(%p)"), (void *) SP_PARM));
+#ifdef USE_TERM_DRIVER
+    if (HasTerminal(SP_PARM))
+	attrs = CallDriver(SP_PARM, conattr);
+#else
+
     if (enter_alt_charset_mode)
 	attrs |= A_ALTCHARSET;
 
@@ -331,8 +373,17 @@
     if (enter_underline_mode)
 	attrs |= A_UNDERLINE;
 
-    if (SP->_coloron)
+    if (SP_PARM->_coloron)
 	attrs |= A_COLOR;
 
-    returnChar(attrs);
+#endif
+    returnChtype(attrs);
+}
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(chtype)
+termattrs(void)
+{
+    return NCURSES_SP_NAME(termattrs) (CURRENT_SCREEN);
 }
+#endif
diff -Naur ncurses-5.7.orig/ncurses/tty/tty_update.c ncurses-5.7/ncurses/tty/tty_update.c
--- ncurses-5.7.orig/ncurses/tty/tty_update.c	2008-08-30 16:08:19.000000000 -0400
+++ ncurses-5.7/ncurses/tty/tty_update.c	2011-01-08 18:18:29.754781633 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2007,2008 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            *
@@ -30,6 +30,7 @@
  *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995               *
  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
  *     and: Thomas E. Dickey                        1996-on                 *
+ *     and: Juergen Pfeifer                         2009                    *
  ****************************************************************************/
 
 /*-----------------------------------------------------------------
@@ -38,12 +39,16 @@
  *
  * 	The routine doupdate() and its dependents.
  * 	All physical output is concentrated here (except _nc_outch()
-  *	in lib_tputs.c).
+ *	in lib_tputs.c).
  *
  *-----------------------------------------------------------------*/
 
 #include <curses.priv.h>
 
+#ifndef CUR
+#define CUR SP_TERMTYPE
+#endif
+
 #if defined __HAIKU__ && defined __BEOS__
 #undef __BEOS__
 #endif
@@ -76,9 +81,8 @@
 #endif
 
 #include <ctype.h>
-#include <term.h>
 
-MODULE_ID("$Id: tty_update.c,v 1.246 2008/08/30 20:08:19 tom Exp $")
+MODULE_ID("$Id: tty_update.c,v 1.264 2010/12/19 01:21:02 tom Exp $")
 
 /*
  * This define controls the line-breakout optimization.  Every once in a
@@ -91,7 +95,7 @@
  */
 #define CHECK_INTERVAL	5
 
-#define FILL_BCE() (SP->_coloron && !SP->_default_color && !back_color_erase)
+#define FILL_BCE(sp) (sp->_coloron && !sp->_default_color && !back_color_erase)
 
 static const NCURSES_CH_T blankchar = NewChar(BLANK_TEXT);
 static NCURSES_CH_T normal = NewChar(BLANK_TEXT);
@@ -103,13 +107,23 @@
  */
 /* #define POSITION_DEBUG */
 
-static NCURSES_INLINE NCURSES_CH_T ClrBlank(WINDOW *win);
+static NCURSES_INLINE NCURSES_CH_T ClrBlank(NCURSES_SP_DCLx WINDOW *win);
+
+#if NCURSES_SP_FUNCS
+static int ClrBottom(SCREEN *, int total);
+static void ClearScreen(SCREEN *, NCURSES_CH_T blank);
+static void ClrUpdate(SCREEN *);
+static void DelChar(SCREEN *, int count);
+static void InsStr(SCREEN *, NCURSES_CH_T * line, int count);
+static void TransformLine(SCREEN *, int const lineno);
+#else
 static int ClrBottom(int total);
 static void ClearScreen(NCURSES_CH_T blank);
 static void ClrUpdate(void);
 static void DelChar(int count);
 static void InsStr(NCURSES_CH_T * line, int count);
 static void TransformLine(int const lineno);
+#endif
 
 #ifdef POSITION_DEBUG
 /****************************************************************************
@@ -119,7 +133,7 @@
  ****************************************************************************/
 
 static void
-position_check(int expected_y, int expected_x, char *legend)
+position_check(NCURSES_SP_DCLx int expected_y, int expected_x, char *legend)
 /* check to see if the real cursor position matches the virtual */
 {
     char buf[20];
@@ -129,10 +143,10 @@
     if (!_nc_tracing || (expected_y < 0 && expected_x < 0))
 	return;
 
-    _nc_flush();
+    NCURSES_SP_NAME(_nc_flush) (NCURSES_SP_ARG);
     memset(buf, '\0', sizeof(buf));
-    putp("\033[6n");		/* only works on ANSI-compatibles */
-    _nc_flush();
+    NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx "\033[6n");	/* only works on ANSI-compatibles */
+    NCURSES_SP_NAME(_nc_flush) (NCURSES_SP_ARG);
     *(s = buf) = 0;
     do {
 	int ask = sizeof(buf) - 1 - (s - buf);
@@ -152,8 +166,12 @@
 	if (expected_y < 0)
 	    expected_y = y - 1;
 	if (y - 1 != expected_y || x - 1 != expected_x) {
-	    beep();
-	    tputs(tparm("\033[%d;%dH", expected_y + 1, expected_x + 1), 1, _nc_outch);
+	    NCURSES_SP_NAME(beep) (NCURSES_SP_ARG);
+	    NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx
+				    tparm("\033[%d;%dH",
+					  expected_y + 1,
+					  expected_x + 1),
+				    1, NCURSES_SP_NAME(_nc_outch));
 	    _tracef("position seen (%d, %d) doesn't match expected one (%d, %d) in %s",
 		    y - 1, x - 1, expected_y, expected_x, legend);
 	} else {
@@ -162,7 +180,7 @@
     }
 }
 #else
-#define position_check(expected_y, expected_x, legend)	/* nothing */
+#define position_check(sp, expected_y, expected_x, legend)	/* nothing */
 #endif /* POSITION_DEBUG */
 
 /****************************************************************************
@@ -172,19 +190,22 @@
  ****************************************************************************/
 
 static NCURSES_INLINE void
-GoTo(int const row, int const col)
+GoTo(NCURSES_SP_DCLx int const row, int const col)
 {
-    TR(TRACE_MOVE, ("GoTo(%d, %d) from (%d, %d)",
-		    row, col, SP->_cursrow, SP->_curscol));
+    TR(TRACE_MOVE, ("GoTo(%p, %d, %d) from (%d, %d)",
+		    (void *) SP_PARM, row, col, SP_PARM->_cursrow, SP_PARM->_curscol));
 
-    position_check(SP->_cursrow, SP->_curscol, "GoTo");
+    position_check(SP_PARM, SP_PARM->_cursrow, SP_PARM->_curscol, "GoTo");
 
-    mvcur(SP->_cursrow, SP->_curscol, row, col);
-    position_check(SP->_cursrow, SP->_curscol, "GoTo2");
+    TINFO_MVCUR(NCURSES_SP_ARGx
+		SP_PARM->_cursrow,
+		SP_PARM->_curscol,
+		row, col);
+    position_check(SP_PARM, SP_PARM->_cursrow, SP_PARM->_curscol, "GoTo2");
 }
 
 static NCURSES_INLINE void
-PutAttrChar(CARG_CH_T ch)
+PutAttrChar(NCURSES_SP_DCLx CARG_CH_T ch)
 {
     int chlen = 1;
     NCURSES_CH_T my_ch;
@@ -194,7 +215,7 @@
 
     TR(TRACE_CHARPUT, ("PutAttrChar(%s) at (%d, %d)",
 		       _tracech_t(ch),
-		       SP->_cursrow, SP->_curscol));
+		       SP_PARM->_cursrow, SP_PARM->_curscol));
 #if USE_WIDEC_SUPPORT
     /*
      * If this is not a valid character, there is nothing more to do.
@@ -224,12 +245,12 @@
 	 */
 	if (is8bits(CharOf(CHDEREF(ch)))
 	    && (isprint(CharOf(CHDEREF(ch)))
-		|| (SP->_legacy_coding > 0 && CharOf(CHDEREF(ch)) >= 160)
-		|| (SP->_legacy_coding > 1 && CharOf(CHDEREF(ch)) >= 128)
+		|| (SP_PARM->_legacy_coding > 0 && CharOf(CHDEREF(ch)) >= 160)
+		|| (SP_PARM->_legacy_coding > 1 && CharOf(CHDEREF(ch)) >= 128)
 		|| (AttrOf(attr) & A_ALTCHARSET
 		    && ((CharOfD(ch) < ACS_LEN
-			 && SP->_acs_map != 0
-			 && SP->_acs_map[CharOfD(ch)] != 0)
+			 && SP_PARM->_acs_map != 0
+			 && SP_PARM->_acs_map[CharOfD(ch)] != 0)
 			|| (CharOfD(ch) >= 128))))) {
 	    ;
 	} else {
@@ -241,7 +262,7 @@
 #endif
 
     if ((AttrOf(attr) & A_ALTCHARSET)
-	&& SP->_acs_map != 0
+	&& SP_PARM->_acs_map != 0
 	&& CharOfD(ch) < ACS_LEN) {
 	my_ch = CHDEREF(ch);	/* work around const param */
 #if USE_WIDEC_SUPPORT
@@ -251,8 +272,8 @@
 	 * character, and uses the wide-character mapping when we expect the
 	 * normal one to be broken (by mis-design ;-).
 	 */
-	if (SP->_screen_acs_fix
-	    && SP->_screen_acs_map[CharOf(my_ch)]) {
+	if (SP_PARM->_screen_acs_fix
+	    && SP_PARM->_screen_acs_map[CharOf(my_ch)]) {
 	    RemAttr(attr, A_ALTCHARSET);
 	    my_ch = _nc_wacs[CharOf(my_ch)];
 	}
@@ -265,9 +286,9 @@
 	 */
 	if (AttrOf(attr) & A_ALTCHARSET) {
 	    int j = CharOfD(ch);
-	    chtype temp = UChar(SP->_acs_map[j]);
+	    chtype temp = UChar(SP_PARM->_acs_map[j]);
 
-	    if (!(SP->_screen_acs_map[j])) {
+	    if (!(SP_PARM->_screen_acs_map[j])) {
 		RemAttr(attr, A_ALTCHARSET);
 		if (temp == 0)
 		    temp = ' ';
@@ -282,28 +303,28 @@
 	ch = CHREF(tilde);
     }
 
-    UpdateAttrs(attr);
+    UpdateAttrs(SP_PARM, attr);
 #if !USE_WIDEC_SUPPORT
     /* FIXME - we do this special case for signal handling, should see how to
      * make it work for wide characters.
      */
-    if (SP->_outch != 0) {
-	SP->_outch(UChar(ch));
+    if (SP_PARM->_outch != 0) {
+	SP_PARM->_outch(NCURSES_SP_ARGx UChar(ch));
     } else
 #endif
     {
-	PUTC(CHDEREF(ch), SP->_ofp);	/* macro's fastest... */
+	PUTC(CHDEREF(ch), SP_PARM->_ofp);	/* macro's fastest... */
 	COUNT_OUTCHARS(1);
     }
-    SP->_curscol += chlen;
+    SP_PARM->_curscol += chlen;
     if (char_padding) {
 	TPUTS_TRACE("char_padding");
-	putp(char_padding);
+	NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx char_padding);
     }
 }
 
 static bool
-check_pending(void)
+check_pending(NCURSES_SP_DCL0)
 /* check for pending input */
 {
     bool have_pending = FALSE;
@@ -313,13 +334,13 @@
      * have the refreshing slow down drastically (or stop) if there's an
      * unread character available.
      */
-    if (SP->_fifohold != 0)
+    if (SP_PARM->_fifohold != 0)
 	return FALSE;
 
-    if (SP->_checkfd >= 0) {
+    if (SP_PARM->_checkfd >= 0) {
 #if USE_FUNC_POLL
 	struct pollfd fds[1];
-	fds[0].fd = SP->_checkfd;
+	fds[0].fd = SP_PARM->_checkfd;
 	fds[0].events = POLLIN;
 	if (poll(fds, 1, 0) > 0) {
 	    have_pending = TRUE;
@@ -347,43 +368,52 @@
 	    ktimeout.tv_usec = 0;
 
 	FD_ZERO(&fdset);
-	FD_SET(SP->_checkfd, &fdset);
-	if (select(SP->_checkfd + 1, &fdset, NULL, NULL, &ktimeout) != 0) {
+	FD_SET(SP_PARM->_checkfd, &fdset);
+	if (select(SP_PARM->_checkfd + 1, &fdset, NULL, NULL, &ktimeout) != 0) {
 	    have_pending = TRUE;
 	}
 #endif
     }
     if (have_pending) {
-	SP->_fifohold = 5;
-	_nc_flush();
+	SP_PARM->_fifohold = 5;
+	NCURSES_SP_NAME(_nc_flush) (NCURSES_SP_ARG);
     }
     return FALSE;
 }
 
 /* put char at lower right corner */
 static void
-PutCharLR(const ARG_CH_T ch)
+PutCharLR(NCURSES_SP_DCLx const ARG_CH_T ch)
 {
     if (!auto_right_margin) {
 	/* we can put the char directly */
-	PutAttrChar(ch);
+	PutAttrChar(NCURSES_SP_ARGx ch);
     } else if (enter_am_mode && exit_am_mode) {
 	/* we can suppress automargin */
 	TPUTS_TRACE("exit_am_mode");
-	putp(exit_am_mode);
+	NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx exit_am_mode);
 
-	PutAttrChar(ch);
-	SP->_curscol--;
-	position_check(SP->_cursrow, SP->_curscol, "exit_am_mode");
+	PutAttrChar(NCURSES_SP_ARGx ch);
+	SP_PARM->_curscol--;
+	position_check(SP_PARM,
+		       SP_PARM->_cursrow,
+		       SP_PARM->_curscol,
+		       "exit_am_mode");
 
 	TPUTS_TRACE("enter_am_mode");
-	putp(enter_am_mode);
+	NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx enter_am_mode);
     } else if ((enter_insert_mode && exit_insert_mode)
 	       || insert_character || parm_ich) {
-	GoTo(screen_lines - 1, screen_columns - 2);
-	PutAttrChar(ch);
-	GoTo(screen_lines - 1, screen_columns - 2);
-	InsStr(newscr->_line[screen_lines - 1].text + screen_columns - 2, 1);
+	GoTo(NCURSES_SP_ARGx
+	     screen_lines(SP_PARM) - 1,
+	     screen_columns(SP_PARM) - 2);
+	PutAttrChar(NCURSES_SP_ARGx ch);
+	GoTo(NCURSES_SP_ARGx
+	     screen_lines(SP_PARM) - 1,
+	     screen_columns(SP_PARM) - 2);
+	InsStr(NCURSES_SP_ARGx
+	       NewScreen(SP_PARM)->_line[screen_lines(SP_PARM) - 1].text +
+	       screen_columns(SP_PARM) - 2, 1);
     }
 }
 
@@ -391,7 +421,7 @@
  * Wrap the cursor position, i.e., advance to the beginning of the next line.
  */
 static void
-wrap_cursor(void)
+wrap_cursor(NCURSES_SP_DCL0)
 {
     if (eat_newline_glitch) {
 	/*
@@ -407,40 +437,45 @@
 	 * it's safe to just tell the code that the cursor is in hyperspace and
 	 * let the next mvcur() call straighten things out.
 	 */
-	SP->_curscol = -1;
-	SP->_cursrow = -1;
+	SP_PARM->_curscol = -1;
+	SP_PARM->_cursrow = -1;
     } else if (auto_right_margin) {
-	SP->_curscol = 0;
-	SP->_cursrow++;
+	SP_PARM->_curscol = 0;
+	SP_PARM->_cursrow++;
 	/*
 	 * We've actually moved - but may have to work around problems with
 	 * video attributes not working.
 	 */
-	if (!move_standout_mode && AttrOf(SCREEN_ATTRS(SP))) {
+	if (!move_standout_mode && AttrOf(SCREEN_ATTRS(SP_PARM))) {
 	    TR(TRACE_CHARPUT, ("turning off (%#lx) %s before wrapping",
-			       (unsigned long) AttrOf(SCREEN_ATTRS(SP)),
-			       _traceattr(AttrOf(SCREEN_ATTRS(SP)))));
-	    (void) VIDATTR(A_NORMAL, 0);
+			       (unsigned long) AttrOf(SCREEN_ATTRS(SP_PARM)),
+			       _traceattr(AttrOf(SCREEN_ATTRS(SP_PARM)))));
+	    (void) VIDATTR(SP_PARM, A_NORMAL, 0);
 	}
     } else {
-	SP->_curscol--;
+	SP_PARM->_curscol--;
     }
-    position_check(SP->_cursrow, SP->_curscol, "wrap_cursor");
+    position_check(SP_PARM,
+		   SP_PARM->_cursrow,
+		   SP_PARM->_curscol,
+		   "wrap_cursor");
 }
 
 static NCURSES_INLINE void
-PutChar(const ARG_CH_T ch)
+PutChar(NCURSES_SP_DCLx const ARG_CH_T ch)
 /* insert character, handling automargin stuff */
 {
-    if (SP->_cursrow == screen_lines - 1 && SP->_curscol == screen_columns - 1)
-	PutCharLR(ch);
-    else
-	PutAttrChar(ch);
+    if (SP_PARM->_cursrow == screen_lines(SP_PARM) - 1 &&
+	SP_PARM->_curscol == screen_columns(SP_PARM) - 1) {
+	PutCharLR(NCURSES_SP_ARGx ch);
+    } else {
+	PutAttrChar(NCURSES_SP_ARGx ch);
+    }
 
-    if (SP->_curscol >= screen_columns)
-	wrap_cursor();
+    if (SP_PARM->_curscol >= screen_columns(SP_PARM))
+	wrap_cursor(NCURSES_SP_ARG);
 
-    position_check(SP->_cursrow, SP->_curscol, "PutChar");
+    position_check(SP_PARM, SP_PARM->_cursrow, SP_PARM->_curscol, "PutChar");
 }
 
 /*
@@ -450,19 +485,21 @@
  * or can be output by clearing (A_COLOR in case of bce-terminal) are excluded.
  */
 static NCURSES_INLINE bool
-can_clear_with(ARG_CH_T ch)
+can_clear_with(NCURSES_SP_DCLx ARG_CH_T ch)
 {
-    if (!back_color_erase && SP->_coloron) {
+    if (!back_color_erase && SP_PARM->_coloron) {
 #if NCURSES_EXT_FUNCS
 	int pair;
 
-	if (!SP->_default_color)
+	if (!SP_PARM->_default_color)
 	    return FALSE;
-	if (SP->_default_fg != C_MASK || SP->_default_bg != C_MASK)
+	if (SP_PARM->_default_fg != C_MASK || SP_PARM->_default_bg != C_MASK)
 	    return FALSE;
 	if ((pair = GetPair(CHDEREF(ch))) != 0) {
 	    short fg, bg;
-	    pair_content(pair, &fg, &bg);
+	    NCURSES_SP_NAME(pair_content) (NCURSES_SP_ARGx
+					   (short) pair,
+					   &fg, &bg);
 	    if (fg != C_MASK || bg != C_MASK)
 		return FALSE;
 	}
@@ -488,7 +525,7 @@
  * This code is optimized using ech and rep.
  */
 static int
-EmitRange(const NCURSES_CH_T * ntext, int num)
+EmitRange(NCURSES_SP_DCLx const NCURSES_CH_T * ntext, int num)
 {
     int i;
 
@@ -500,13 +537,13 @@
 	    NCURSES_CH_T ntext0;
 
 	    while (num > 1 && !CharEq(ntext[0], ntext[1])) {
-		PutChar(CHREF(ntext[0]));
+		PutChar(NCURSES_SP_ARGx CHREF(ntext[0]));
 		ntext++;
 		num--;
 	    }
 	    ntext0 = ntext[0];
 	    if (num == 1) {
-		PutChar(CHREF(ntext0));
+		PutChar(NCURSES_SP_ARGx CHREF(ntext0));
 		return 0;
 	    }
 	    runcount = 2;
@@ -523,10 +560,11 @@
 	     * which it would be marginally advantageous.
 	     */
 	    if (erase_chars
-		&& runcount > SP->_ech_cost + SP->_cup_ch_cost
-		&& can_clear_with(CHREF(ntext0))) {
-		UpdateAttrs(ntext0);
-		putp(TPARM_1(erase_chars, runcount));
+		&& runcount > SP_PARM->_ech_cost + SP_PARM->_cup_ch_cost
+		&& can_clear_with(NCURSES_SP_ARGx CHREF(ntext0))) {
+		UpdateAttrs(SP_PARM, ntext0);
+		NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx
+				       TPARM_1(erase_chars, runcount));
 
 		/*
 		 * If this is the last part of the given interval,
@@ -534,27 +572,34 @@
 		 * last update on the line.
 		 */
 		if (runcount < num) {
-		    GoTo(SP->_cursrow, SP->_curscol + runcount);
+		    GoTo(NCURSES_SP_ARGx
+			 SP_PARM->_cursrow,
+			 SP_PARM->_curscol + runcount);
 		} else {
 		    return 1;	/* cursor stays in the middle */
 		}
-	    } else if (repeat_char && runcount > SP->_rep_cost) {
-		bool wrap_possible = (SP->_curscol + runcount >= screen_columns);
+	    } else if (repeat_char && runcount > SP_PARM->_rep_cost) {
+		bool wrap_possible = (SP_PARM->_curscol + runcount >=
+				      screen_columns(SP_PARM));
 		int rep_count = runcount;
 
 		if (wrap_possible)
 		    rep_count--;
 
-		UpdateAttrs(ntext0);
-		tputs(TPARM_2(repeat_char, CharOf(ntext0), rep_count),
-		      rep_count, _nc_outch);
-		SP->_curscol += rep_count;
+		UpdateAttrs(SP_PARM, ntext0);
+		NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx
+					TPARM_2(repeat_char,
+						CharOf(ntext0),
+						rep_count),
+					rep_count,
+					NCURSES_SP_NAME(_nc_outch));
+		SP_PARM->_curscol += rep_count;
 
 		if (wrap_possible)
-		    PutChar(CHREF(ntext0));
+		    PutChar(NCURSES_SP_ARGx CHREF(ntext0));
 	    } else {
 		for (i = 0; i < runcount; i++)
-		    PutChar(CHREF(ntext[i]));
+		    PutChar(NCURSES_SP_ARGx CHREF(ntext[i]));
 	    }
 	    ntext += runcount;
 	    num -= runcount;
@@ -563,7 +608,7 @@
     }
 
     for (i = 0; i < num; i++)
-	PutChar(CHREF(ntext[i]));
+	PutChar(NCURSES_SP_ARGx CHREF(ntext[i]));
     return 0;
 }
 
@@ -576,39 +621,43 @@
  * Returns: same as EmitRange
  */
 static int
-PutRange(const NCURSES_CH_T * otext,
+PutRange(NCURSES_SP_DCLx
+	 const NCURSES_CH_T * otext,
 	 const NCURSES_CH_T * ntext,
 	 int row,
 	 int first, int last)
 {
     int i, j, same;
 
-    TR(TRACE_CHARPUT, ("PutRange(%p, %p, %d, %d, %d)",
-		       otext, ntext, row, first, last));
+    TR(TRACE_CHARPUT, ("PutRange(%p, %p, %p, %d, %d, %d)",
+		       (void *) SP_PARM,
+		       (const void *) otext,
+		       (const void *) ntext,
+		       row, first, last));
 
     if (otext != ntext
-	&& (last - first + 1) > SP->_inline_cost) {
+	&& (last - first + 1) > SP_PARM->_inline_cost) {
 	for (j = first, same = 0; j <= last; j++) {
 	    if (!same && isWidecExt(otext[j]))
 		continue;
 	    if (CharEq(otext[j], ntext[j])) {
 		same++;
 	    } else {
-		if (same > SP->_inline_cost) {
-		    EmitRange(ntext + first, j - same - first);
-		    GoTo(row, first = j);
+		if (same > SP_PARM->_inline_cost) {
+		    EmitRange(NCURSES_SP_ARGx ntext + first, j - same - first);
+		    GoTo(NCURSES_SP_ARGx row, first = j);
 		}
 		same = 0;
 	    }
 	}
-	i = EmitRange(ntext + first, j - same - first);
+	i = EmitRange(NCURSES_SP_ARGx ntext + first, j - same - first);
 	/*
 	 * Always return 1 for the next GoTo() after a PutRange() if we found
 	 * identical characters at end of interval
 	 */
 	return (same == 0 ? i : 1);
     }
-    return EmitRange(ntext + first, last - first + 1);
+    return EmitRange(NCURSES_SP_ARGx ntext + first, last - first + 1);
 }
 
 /* leave unbracketed here so 'indent' works */
@@ -618,7 +667,7 @@
 		if_USE_SCROLL_HINTS(win->_line[row].oldindex = row)
 
 NCURSES_EXPORT(int)
-doupdate(void)
+TINFO_DOUPDATE(NCURSES_SP_DCL0)
 {
     int i;
     int nonempty;
@@ -626,30 +675,49 @@
     struct tms before, after;
 #endif /* USE_TRACE_TIMES */
 
-    T((T_CALLED("doupdate()")));
+    T((T_CALLED("_nc_tinfo:doupdate(%p)"), (void *) SP_PARM));
+
+#if !USE_REENTRANT
+    /*
+     * It is "legal" but unlikely that an application could assign a new
+     * value to one of the standard windows.  Check for that possibility
+     * and try to recover.
+     *
+     * We do not allow applications to assign new values in the reentrant
+     * model.
+     */
+#define SyncScreens(internal,exported) \
+	if (internal == 0) internal = exported; \
+	if (internal != exported) exported = internal
+
+    SyncScreens(CurScreen(SP_PARM), curscr);
+    SyncScreens(NewScreen(SP_PARM), newscr);
+    SyncScreens(StdScreen(SP_PARM), stdscr);
+#endif
 
-    if (curscr == 0
-	|| newscr == 0)
+    if (CurScreen(SP_PARM) == 0
+	|| NewScreen(SP_PARM) == 0
+	|| StdScreen(SP_PARM) == 0)
 	returnCode(ERR);
 
 #ifdef TRACE
     if (USE_TRACEF(TRACE_UPDATE)) {
-	if (curscr->_clear)
+	if (CurScreen(SP_PARM)->_clear)
 	    _tracef("curscr is clear");
 	else
-	    _tracedump("curscr", curscr);
-	_tracedump("newscr", newscr);
+	    _tracedump("curscr", CurScreen(SP_PARM));
+	_tracedump("newscr", NewScreen(SP_PARM));
 	_nc_unlock_global(tracef);
     }
 #endif /* TRACE */
 
     _nc_signal_handler(FALSE);
 
-    if (SP->_fifohold)
-	SP->_fifohold--;
+    if (SP_PARM->_fifohold)
+	SP_PARM->_fifohold--;
 
 #if USE_SIZECHANGE
-    if (SP->_endwin || _nc_handle_sigwinch(SP)) {
+    if (SP_PARM->_endwin || _nc_handle_sigwinch(SP_PARM)) {
 	/*
 	 * This is a transparent extension:  XSI does not address it,
 	 * and applications need not know that ncurses can do it.
@@ -658,20 +726,20 @@
 	 * (this can happen in an xterm, for example), and resize the
 	 * ncurses data structures accordingly.
 	 */
-	_nc_update_screensize(SP);
+	_nc_update_screensize(SP_PARM);
     }
 #endif
 
-    if (SP->_endwin) {
+    if (SP_PARM->_endwin) {
 
 	T(("coming back from shell mode"));
-	reset_prog_mode();
+	NCURSES_SP_NAME(reset_prog_mode) (NCURSES_SP_ARG);
 
-	_nc_mvcur_resume();
-	_nc_screen_resume();
-	SP->_mouse_resume(SP);
+	NCURSES_SP_NAME(_nc_mvcur_resume) (NCURSES_SP_ARG);
+	NCURSES_SP_NAME(_nc_screen_resume) (NCURSES_SP_ARG);
+	SP_PARM->_mouse_resume(SP_PARM);
 
-	SP->_endwin = FALSE;
+	SP_PARM->_endwin = FALSE;
     }
 #if USE_TRACE_TIMES
     /* zero the metering machinery */
@@ -695,11 +763,11 @@
 	int j, k;
 	attr_t rattr = A_NORMAL;
 
-	for (i = 0; i < screen_lines; i++) {
-	    for (j = 0; j < screen_columns; j++) {
+	for (i = 0; i < screen_lines(SP_PARM); i++) {
+	    for (j = 0; j < screen_columns(SP_PARM); j++) {
 		bool failed = FALSE;
-		NCURSES_CH_T *thisline = newscr->_line[i].text;
-		attr_t thisattr = AttrOf(thisline[j]) & SP->_xmc_triggers;
+		NCURSES_CH_T *thisline = NewScreen(SP_PARM)->_line[i].text;
+		attr_t thisattr = AttrOf(thisline[j]) & SP_PARM->_xmc_triggers;
 		attr_t turnon = thisattr & ~rattr;
 
 		/* is an attribute turned on here? */
@@ -717,8 +785,8 @@
 		 * there's enough room to set the attribute before the first
 		 * non-blank in the run.
 		 */
-#define SAFE(a)	(!((a) & SP->_xmc_triggers))
-		if (ISBLANK(thisline[j]) && SAFE(turnon)) {
+#define SAFE(scr,a)	(!((a) & (scr)->_xmc_triggers))
+		if (ISBLANK(thisline[j]) && SAFE(SP_PARM, turnon)) {
 		    RemAttr(thisline[j], turnon);
 		    continue;
 		}
@@ -727,14 +795,14 @@
 		for (k = 1; k <= magic_cookie_glitch; k++) {
 		    if (j - k < 0
 			|| !ISBLANK(thisline[j - k])
-			|| !SAFE(AttrOf(thisline[j - k]))) {
+			|| !SAFE(SP_PARM, AttrOf(thisline[j - k]))) {
 			failed = TRUE;
 			TR(TRACE_ATTRS, ("No room at start in %d,%d%s%s",
 					 i, j - k,
 					 (ISBLANK(thisline[j - k])
 					  ? ""
 					  : ":nonblank"),
-					 (SAFE(AttrOf(thisline[j - k]))
+					 (SAFE(SP_PARM, AttrOf(thisline[j - k]))
 					  ? ""
 					  : ":unsafe")));
 			break;
@@ -745,10 +813,11 @@
 		    int m, n = j;
 
 		    /* find end of span, if it's onscreen */
-		    for (m = i; m < screen_lines; m++) {
-			for (; n < screen_columns; n++) {
-			    attr_t testattr = AttrOf(newscr->_line[m].text[n]);
-			    if ((testattr & SP->_xmc_triggers) == rattr) {
+		    for (m = i; m < screen_lines(SP_PARM); m++) {
+			for (; n < screen_columns(SP_PARM); n++) {
+			    attr_t testattr =
+			    AttrOf(NewScreen(SP_PARM)->_line[m].text[n]);
+			    if ((testattr & SP_PARM->_xmc_triggers) == rattr) {
 				end_onscreen = TRUE;
 				TR(TRACE_ATTRS,
 				   ("Range attributed with %s ends at (%d, %d)",
@@ -764,7 +833,8 @@
 		  foundit:;
 
 		    if (end_onscreen) {
-			NCURSES_CH_T *lastline = newscr->_line[m].text;
+			NCURSES_CH_T *lastline =
+			NewScreen(SP_PARM)->_line[m].text;
 
 			/*
 			 * If there are safely-attributed blanks at the end of
@@ -773,15 +843,15 @@
 			 */
 			while (n >= 0
 			       && ISBLANK(lastline[n])
-			       && SAFE(AttrOf(lastline[n]))) {
+			       && SAFE(SP_PARM, AttrOf(lastline[n]))) {
 			    RemAttr(lastline[n--], turnon);
 			}
 
 			/* check that there's enough room at end of span */
 			for (k = 1; k <= magic_cookie_glitch; k++) {
-			    if (n + k >= screen_columns
+			    if (n + k >= screen_columns(SP_PARM)
 				|| !ISBLANK(lastline[n + k])
-				|| !SAFE(AttrOf(lastline[n + k]))) {
+				|| !SAFE(SP_PARM, AttrOf(lastline[n + k]))) {
 				failed = TRUE;
 				TR(TRACE_ATTRS,
 				   ("No room at end in %d,%d%s%s",
@@ -789,7 +859,7 @@
 				    (ISBLANK(lastline[n + k])
 				     ? ""
 				     : ":nonblank"),
-				    (SAFE(AttrOf(lastline[n + k]))
+				    (SAFE(SP_PARM, AttrOf(lastline[n + k]))
 				     ? ""
 				     : ":unsafe")));
 				break;
@@ -806,12 +876,12 @@
 			_traceattr(turnon), i, j));
 
 		    /* turn off new attributes over span */
-		    for (p = i; p < screen_lines; p++) {
-			for (; q < screen_columns; q++) {
+		    for (p = i; p < screen_lines(SP_PARM); p++) {
+			for (; q < screen_columns(SP_PARM); q++) {
 			    attr_t testattr = AttrOf(newscr->_line[p].text[q]);
-			    if ((testattr & SP->_xmc_triggers) == rattr)
+			    if ((testattr & SP_PARM->_xmc_triggers) == rattr)
 				goto foundend;
-			    RemAttr(newscr->_line[p].text[q], turnon);
+			    RemAttr(NewScreen(SP_PARM)->_line[p].text[q], turnon);
 			}
 			q = 0;
 		    }
@@ -837,7 +907,7 @@
 	/* show altered highlights after magic-cookie check */
 	if (USE_TRACEF(TRACE_UPDATE)) {
 	    _tracef("After magic-cookie check...");
-	    _tracedump("newscr", newscr);
+	    _tracedump("newscr", NewScreen(SP_PARM));
 	    _nc_unlock_global(tracef);
 	}
 #endif /* TRACE */
@@ -845,23 +915,23 @@
 #endif /* USE_XMC_SUPPORT */
 
     nonempty = 0;
-    if (curscr->_clear || newscr->_clear) {	/* force refresh ? */
-	ClrUpdate();
-	curscr->_clear = FALSE;	/* reset flag */
-	newscr->_clear = FALSE;	/* reset flag */
+    if (CurScreen(SP_PARM)->_clear || NewScreen(SP_PARM)->_clear) {	/* force refresh ? */
+	ClrUpdate(NCURSES_SP_ARG);
+	CurScreen(SP_PARM)->_clear = FALSE;	/* reset flag */
+	NewScreen(SP_PARM)->_clear = FALSE;	/* reset flag */
     } else {
 	int changedlines = CHECK_INTERVAL;
 
-	if (check_pending())
+	if (check_pending(NCURSES_SP_ARG))
 	    goto cleanup;
 
-	nonempty = min(screen_lines, newscr->_maxy + 1);
+	nonempty = min(screen_lines(SP_PARM), NewScreen(SP_PARM)->_maxy + 1);
 
-	if (SP->_scrolling) {
-	    _nc_scroll_optimize();
+	if (SP_PARM->_scrolling) {
+	    NCURSES_SP_NAME(_nc_scroll_optimize) (NCURSES_SP_ARG);
 	}
 
-	nonempty = ClrBottom(nonempty);
+	nonempty = ClrBottom(NCURSES_SP_ARGx nonempty);
 
 	TR(TRACE_UPDATE, ("Transforming lines, nonempty %d", nonempty));
 	for (i = 0; i < nonempty; i++) {
@@ -869,7 +939,7 @@
 	     * Here is our line-breakout optimization.
 	     */
 	    if (changedlines == CHECK_INTERVAL) {
-		if (check_pending())
+		if (check_pending(NCURSES_SP_ARG))
 		    goto cleanup;
 		changedlines = 0;
 	    }
@@ -880,35 +950,35 @@
 	     * is normally set by _nc_scroll_window in the
 	     * vertical-movement optimization code,
 	     */
-	    if (newscr->_line[i].firstchar != _NOCHANGE
-		|| curscr->_line[i].firstchar != _NOCHANGE) {
-		TransformLine(i);
+	    if (NewScreen(SP_PARM)->_line[i].firstchar != _NOCHANGE
+		|| CurScreen(SP_PARM)->_line[i].firstchar != _NOCHANGE) {
+		TransformLine(NCURSES_SP_ARGx i);
 		changedlines++;
 	    }
 
 	    /* mark line changed successfully */
-	    if (i <= newscr->_maxy) {
-		MARK_NOCHANGE(newscr, i);
+	    if (i <= NewScreen(SP_PARM)->_maxy) {
+		MARK_NOCHANGE(NewScreen(SP_PARM), i);
 	    }
-	    if (i <= curscr->_maxy) {
-		MARK_NOCHANGE(curscr, i);
+	    if (i <= CurScreen(SP_PARM)->_maxy) {
+		MARK_NOCHANGE(CurScreen(SP_PARM), i);
 	    }
 	}
     }
 
     /* put everything back in sync */
-    for (i = nonempty; i <= newscr->_maxy; i++) {
-	MARK_NOCHANGE(newscr, i);
+    for (i = nonempty; i <= NewScreen(SP_PARM)->_maxy; i++) {
+	MARK_NOCHANGE(NewScreen(SP_PARM), i);
     }
-    for (i = nonempty; i <= curscr->_maxy; i++) {
-	MARK_NOCHANGE(curscr, i);
+    for (i = nonempty; i <= CurScreen(SP_PARM)->_maxy; i++) {
+	MARK_NOCHANGE(CurScreen(SP_PARM), i);
     }
 
-    if (!newscr->_leaveok) {
-	curscr->_curx = newscr->_curx;
-	curscr->_cury = newscr->_cury;
+    if (!NewScreen(SP_PARM)->_leaveok) {
+	CurScreen(SP_PARM)->_curx = NewScreen(SP_PARM)->_curx;
+	CurScreen(SP_PARM)->_cury = NewScreen(SP_PARM)->_cury;
 
-	GoTo(curscr->_cury, curscr->_curx);
+	GoTo(NCURSES_SP_ARGx CurScreen(SP_PARM)->_cury, CurScreen(SP_PARM)->_curx);
     }
 
   cleanup:
@@ -921,10 +991,10 @@
 #if USE_XMC_SUPPORT
     if (magic_cookie_glitch != 0)
 #endif
-	UpdateAttrs(normal);
+	UpdateAttrs(SP_PARM, normal);
 
-    _nc_flush();
-    WINDOW_ATTRS(curscr) = WINDOW_ATTRS(newscr);
+    NCURSES_SP_NAME(_nc_flush) (NCURSES_SP_ARG);
+    WINDOW_ATTRS(CurScreen(SP_PARM)) = WINDOW_ATTRS(NewScreen(SP_PARM));
 
 #if USE_TRACE_TIMES
     (void) times(&after);
@@ -940,6 +1010,14 @@
     returnCode(OK);
 }
 
+#if NCURSES_SP_FUNCS && !defined(USE_TERM_DRIVER)
+NCURSES_EXPORT(int)
+doupdate(void)
+{
+    return TINFO_DOUPDATE(CURRENT_SCREEN);
+}
+#endif
+
 /*
  *	ClrBlank(win)
  *
@@ -951,14 +1029,14 @@
  *	in the wbkgd() call.  Assume 'stdscr' for this case.
  */
 #define BCE_ATTRS (A_NORMAL|A_COLOR)
-#define BCE_BKGD(win) (((win) == curscr ? stdscr : (win))->_nc_bkgd)
+#define BCE_BKGD(sp,win) (((win) == CurScreen(sp) ? StdScreen(sp) : (win))->_nc_bkgd)
 
 static NCURSES_INLINE NCURSES_CH_T
-ClrBlank(WINDOW *win)
+ClrBlank(NCURSES_SP_DCLx WINDOW *win)
 {
     NCURSES_CH_T blank = blankchar;
     if (back_color_erase)
-	AddAttr(blank, (AttrOf(BCE_BKGD(win)) & BCE_ATTRS));
+	AddAttr(blank, (AttrOf(BCE_BKGD(SP_PARM, win)) & BCE_ATTRS));
     return blank;
 }
 
@@ -970,23 +1048,24 @@
 */
 
 static void
-ClrUpdate(void)
+ClrUpdate(NCURSES_SP_DCL0)
 {
-    int i;
-    NCURSES_CH_T blank = ClrBlank(stdscr);
-    int nonempty = min(screen_lines, newscr->_maxy + 1);
-
     TR(TRACE_UPDATE, (T_CALLED("ClrUpdate")));
+    if (0 != SP_PARM) {
+	int i;
+	NCURSES_CH_T blank = ClrBlank(NCURSES_SP_ARGx StdScreen(SP_PARM));
+	int nonempty = min(screen_lines(SP_PARM),
+			   NewScreen(SP_PARM)->_maxy + 1);
 
-    ClearScreen(blank);
-
-    TR(TRACE_UPDATE, ("updating screen from scratch"));
+	ClearScreen(NCURSES_SP_ARGx blank);
 
-    nonempty = ClrBottom(nonempty);
+	TR(TRACE_UPDATE, ("updating screen from scratch"));
 
-    for (i = 0; i < nonempty; i++)
-	TransformLine(i);
+	nonempty = ClrBottom(NCURSES_SP_ARGx nonempty);
 
+	for (i = 0; i < nonempty; i++)
+	    TransformLine(NCURSES_SP_ARGx i);
+    }
     TR(TRACE_UPDATE, (T_RETURN("")));
 }
 
@@ -997,35 +1076,36 @@
 */
 
 static void
-ClrToEOL(NCURSES_CH_T blank, bool needclear)
+ClrToEOL(NCURSES_SP_DCLx NCURSES_CH_T blank, bool needclear)
 {
     int j;
 
-    if (curscr != 0
-	&& SP->_cursrow >= 0) {
-	for (j = SP->_curscol; j < screen_columns; j++) {
-	    if (j >= 0) {
-		NCURSES_CH_T *cp = &(curscr->_line[SP->_cursrow].text[j]);
-
-		if (!CharEq(*cp, blank)) {
-		    *cp = blank;
-		    needclear = TRUE;
+    if (SP_PARM != 0) {
+	if (CurScreen(SP_PARM) != 0
+	    && SP_PARM->_cursrow >= 0) {
+	    for (j = SP_PARM->_curscol; j < screen_columns(SP_PARM); j++) {
+		if (j >= 0) {
+		    NCURSES_CH_T *cp =
+		    &(CurScreen(SP_PARM)->_line[SP_PARM->_cursrow].text[j]);
+
+		    if (!CharEq(*cp, blank)) {
+			*cp = blank;
+			needclear = TRUE;
+		    }
 		}
 	    }
 	}
-    } else {
-	needclear = TRUE;
     }
 
-    if (needclear) {
-	UpdateAttrs(blank);
+    if (needclear && (SP_PARM != 0)) {
+	UpdateAttrs(SP_PARM, blank);
 	TPUTS_TRACE("clr_eol");
-	if (clr_eol && SP->_el_cost <= (screen_columns - SP->_curscol)) {
-	    putp(clr_eol);
+	if (clr_eol && SP_PARM->_el_cost <= (screen_columns(SP_PARM) - SP_PARM->_curscol)) {
+	    NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx clr_eol);
 	} else {
-	    int count = (screen_columns - SP->_curscol);
+	    int count = (screen_columns(SP_PARM) - SP_PARM->_curscol);
 	    while (count-- > 0)
-		PutChar(CHREF(blank));
+		PutChar(NCURSES_SP_ARGx CHREF(blank));
 	}
     }
 }
@@ -1037,23 +1117,29 @@
 */
 
 static void
-ClrToEOS(NCURSES_CH_T blank)
+ClrToEOS(NCURSES_SP_DCLx NCURSES_CH_T blank)
 {
     int row, col;
 
-    row = SP->_cursrow;
-    col = SP->_curscol;
-
-    UpdateAttrs(blank);
-    TPUTS_TRACE("clr_eos");
-    tputs(clr_eos, screen_lines - row, _nc_outch);
+    if (0 == SP_PARM)
+	return;
 
-    while (col < screen_columns)
-	curscr->_line[row].text[col++] = blank;
+    row = SP_PARM->_cursrow;
+    col = SP_PARM->_curscol;
 
-    for (row++; row < screen_lines; row++) {
-	for (col = 0; col < screen_columns; col++)
-	    curscr->_line[row].text[col] = blank;
+    UpdateAttrs(SP_PARM, blank);
+    TPUTS_TRACE("clr_eos");
+    NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx
+			    clr_eos,
+			    screen_lines(SP_PARM) - row,
+			    NCURSES_SP_NAME(_nc_outch));
+
+    while (col < screen_columns(SP_PARM))
+	CurScreen(SP_PARM)->_line[row].text[col++] = blank;
+
+    for (row++; row < screen_lines(SP_PARM); row++) {
+	for (col = 0; col < screen_columns(SP_PARM); col++)
+	    CurScreen(SP_PARM)->_line[row].text[col] = blank;
     }
 }
 
@@ -1065,26 +1151,26 @@
  *	screen, checking if each is blank, and one or more are changed.
  */
 static int
-ClrBottom(int total)
+ClrBottom(NCURSES_SP_DCLx int total)
 {
     int row;
     int col;
     int top = total;
-    int last = min(screen_columns, newscr->_maxx + 1);
-    NCURSES_CH_T blank = newscr->_line[total - 1].text[last - 1];
+    int last = min(screen_columns(SP_PARM), NewScreen(SP_PARM)->_maxx + 1);
+    NCURSES_CH_T blank = NewScreen(SP_PARM)->_line[total - 1].text[last - 1];
     bool ok;
 
-    if (clr_eos && can_clear_with(CHREF(blank))) {
+    if (clr_eos && can_clear_with(NCURSES_SP_ARGx CHREF(blank))) {
 
 	for (row = total - 1; row >= 0; row--) {
 	    for (col = 0, ok = TRUE; ok && col < last; col++) {
-		ok = (CharEq(newscr->_line[row].text[col], blank));
+		ok = (CharEq(NewScreen(SP_PARM)->_line[row].text[col], blank));
 	    }
 	    if (!ok)
 		break;
 
 	    for (col = 0; ok && col < last; col++) {
-		ok = (CharEq(curscr->_line[row].text[col], blank));
+		ok = (CharEq(CurScreen(SP_PARM)->_line[row].text[col], blank));
 	    }
 	    if (!ok)
 		top = row;
@@ -1092,11 +1178,11 @@
 
 	/* don't use clr_eos for just one line if clr_eol available */
 	if (top < total) {
-	    GoTo(top, 0);
-	    ClrToEOS(blank);
-	    if (SP->oldhash && SP->newhash) {
-		for (row = top; row < screen_lines; row++)
-		    SP->oldhash[row] = SP->newhash[row];
+	    GoTo(NCURSES_SP_ARGx top, 0);
+	    ClrToEOS(NCURSES_SP_ARGx blank);
+	    if (SP_PARM->oldhash && SP_PARM->newhash) {
+		for (row = top; row < screen_lines(SP_PARM); row++)
+		    SP_PARM->oldhash[row] = SP_PARM->newhash[row];
 	    }
 	}
     }
@@ -1105,22 +1191,22 @@
 
 #if USE_XMC_SUPPORT
 #if USE_WIDEC_SUPPORT
-#define check_xmc_transition(a, b) \
-    ((((a)->attr ^ (b)->attr) & ~((a)->attr) & SP->_xmc_triggers) != 0)
-#define xmc_turn_on(a,b) check_xmc_transition(&(a), &(b))
+#define check_xmc_transition(sp, a, b)					\
+    ((((a)->attr ^ (b)->attr) & ~((a)->attr) & (sp)->_xmc_triggers) != 0)
+#define xmc_turn_on(sp,a,b) check_xmc_transition(sp,&(a), &(b))
 #else
-#define xmc_turn_on(a,b) ((((a)^(b)) & ~(a) & SP->_xmc_triggers) != 0)
+#define xmc_turn_on(sp,a,b) ((((a)^(b)) & ~(a) & (sp)->_xmc_triggers) != 0)
 #endif
 
-#define xmc_new(r,c) newscr->_line[r].text[c]
-#define xmc_turn_off(a,b) xmc_turn_on(b,a)
+#define xmc_new(sp,r,c) NewScreen(sp)->_line[r].text[c]
+#define xmc_turn_off(sp,a,b) xmc_turn_on(sp,b,a)
 #endif /* USE_XMC_SUPPORT */
 
 /*
 **	TransformLine(lineno)
 **
 **	Transform the given line in curscr to the one in newscr, using
-**	Insert/Delete Character if _nc_idcok && has_ic().
+**	Insert/Delete Character if idcok && has_ic().
 **
 **		firstChar = position of first different character in line
 **		oLastChar = position of last different character in old line
@@ -1135,19 +1221,19 @@
 */
 
 static void
-TransformLine(int const lineno)
+TransformLine(NCURSES_SP_DCLx int const lineno)
 {
     int firstChar, oLastChar, nLastChar;
-    NCURSES_CH_T *newLine = newscr->_line[lineno].text;
-    NCURSES_CH_T *oldLine = curscr->_line[lineno].text;
+    NCURSES_CH_T *newLine = NewScreen(SP_PARM)->_line[lineno].text;
+    NCURSES_CH_T *oldLine = CurScreen(SP_PARM)->_line[lineno].text;
     int n;
     bool attrchanged = FALSE;
 
-    TR(TRACE_UPDATE, (T_CALLED("TransformLine(%d)"), lineno));
+    TR(TRACE_UPDATE, (T_CALLED("TransformLine(%p, %d)"), (void *) SP_PARM, lineno));
 
     /* copy new hash value to old one */
-    if (SP->oldhash && SP->newhash)
-	SP->oldhash[lineno] = SP->newhash[lineno];
+    if (SP_PARM->oldhash && SP_PARM->newhash)
+	SP_PARM->oldhash[lineno] = SP_PARM->newhash[lineno];
 
     /*
      * If we have colors, there is the possibility of having two color pairs
@@ -1155,19 +1241,20 @@
      * for this case, and update the old line with the new line's colors when
      * they are equivalent.
      */
-    if (SP->_coloron) {
+    if (SP_PARM->_coloron) {
 	int oldPair;
 	int newPair;
 
-	for (n = 0; n < screen_columns; n++) {
+	for (n = 0; n < screen_columns(SP_PARM); n++) {
 	    if (!CharEq(newLine[n], oldLine[n])) {
 		oldPair = GetPair(oldLine[n]);
 		newPair = GetPair(newLine[n]);
 		if (oldPair != newPair
 		    && unColor(oldLine[n]) == unColor(newLine[n])) {
-		    if (oldPair < COLOR_PAIRS
-			&& newPair < COLOR_PAIRS
-			&& SP->_color_pairs[oldPair] == SP->_color_pairs[newPair]) {
+		    if (oldPair < SP_PARM->_pair_limit
+			&& newPair < SP_PARM->_pair_limit
+			&& (SP_PARM->_color_pairs[oldPair] ==
+			    SP_PARM->_color_pairs[newPair])) {
 			SetPair(oldLine[n], GetPair(newLine[n]));
 		    }
 		}
@@ -1177,7 +1264,7 @@
 
     if (ceol_standout_glitch && clr_eol) {
 	firstChar = 0;
-	while (firstChar < screen_columns) {
+	while (firstChar < screen_columns(SP_PARM)) {
 	    if (!SameAttrOf(newLine[firstChar], oldLine[firstChar])) {
 		attrchanged = TRUE;
 		break;
@@ -1189,9 +1276,13 @@
     firstChar = 0;
 
     if (attrchanged) {		/* we may have to disregard the whole line */
-	GoTo(lineno, firstChar);
-	ClrToEOL(ClrBlank(curscr), FALSE);
-	PutRange(oldLine, newLine, lineno, 0, (screen_columns - 1));
+	GoTo(NCURSES_SP_ARGx lineno, firstChar);
+	ClrToEOL(NCURSES_SP_ARGx
+		 ClrBlank(NCURSES_SP_ARGx
+			  CurScreen(SP_PARM)), FALSE);
+	PutRange(NCURSES_SP_ARGx
+		 oldLine, newLine, lineno, 0,
+		 screen_columns(SP_PARM) - 1);
 #if USE_XMC_SUPPORT
 
 	/*
@@ -1206,8 +1297,8 @@
 	 * following operation.
 	 */
     } else if (magic_cookie_glitch > 0) {
-	GoTo(lineno, firstChar);
-	for (n = 0; n < screen_columns; n++) {
+	GoTo(NCURSES_SP_ARGx lineno, firstChar);
+	for (n = 0; n < screen_columns(SP_PARM); n++) {
 	    int m = n + magic_cookie_glitch;
 
 	    /* check for turn-on:
@@ -1216,26 +1307,30 @@
 	     */
 	    if (ISBLANK(newLine[n])
 		&& ((n > 0
-		     && xmc_turn_on(newLine[n - 1], newLine[n]))
+		     && xmc_turn_on(SP_PARM, newLine[n - 1], newLine[n]))
 		    || (n == 0
 			&& lineno > 0
-			&& xmc_turn_on(xmc_new(lineno - 1, screen_columns - 1),
+			&& xmc_turn_on(SP_PARM,
+				       xmc_new(SP_PARM, lineno - 1,
+					       screen_columns(SP_PARM) - 1),
 				       newLine[n])))) {
 		n = m;
 	    }
 
-	    PutChar(CHREF(newLine[n]));
+	    PutChar(NCURSES_SP_ARGx CHREF(newLine[n]));
 
 	    /* check for turn-off:
 	     * If we are writing an attributed non-blank, where the
 	     * next cell is blank, and not attributed.
 	     */
 	    if (!ISBLANK(newLine[n])
-		&& ((n + 1 < screen_columns
-		     && xmc_turn_off(newLine[n], newLine[n + 1]))
-		    || (n + 1 >= screen_columns
-			&& lineno + 1 < screen_lines
-			&& xmc_turn_off(newLine[n], xmc_new(lineno + 1, 0))))) {
+		&& ((n + 1 < screen_columns(SP_PARM)
+		     && xmc_turn_off(SP_PARM, newLine[n], newLine[n + 1]))
+		    || (n + 1 >= screen_columns(SP_PARM)
+			&& lineno + 1 < screen_lines(SP_PARM)
+			&& xmc_turn_off(SP_PARM,
+					newLine[n],
+					xmc_new(SP_PARM, lineno + 1, 0))))) {
 		n = m;
 	    }
 
@@ -1246,38 +1341,42 @@
 
 	/* it may be cheap to clear leading whitespace with clr_bol */
 	blank = newLine[0];
-	if (clr_bol && can_clear_with(CHREF(blank))) {
+	if (clr_bol && can_clear_with(NCURSES_SP_ARGx CHREF(blank))) {
 	    int oFirstChar, nFirstChar;
 
-	    for (oFirstChar = 0; oFirstChar < screen_columns; oFirstChar++)
+	    for (oFirstChar = 0;
+		 oFirstChar < screen_columns(SP_PARM);
+		 oFirstChar++)
 		if (!CharEq(oldLine[oFirstChar], blank))
 		    break;
-	    for (nFirstChar = 0; nFirstChar < screen_columns; nFirstChar++)
+	    for (nFirstChar = 0;
+		 nFirstChar < screen_columns(SP_PARM);
+		 nFirstChar++)
 		if (!CharEq(newLine[nFirstChar], blank))
 		    break;
 
 	    if (nFirstChar == oFirstChar) {
 		firstChar = nFirstChar;
 		/* find the first differing character */
-		while (firstChar < screen_columns
+		while (firstChar < screen_columns(SP_PARM)
 		       && CharEq(newLine[firstChar], oldLine[firstChar]))
 		    firstChar++;
 	    } else if (oFirstChar > nFirstChar) {
 		firstChar = nFirstChar;
 	    } else {		/* oFirstChar < nFirstChar */
 		firstChar = oFirstChar;
-		if (SP->_el1_cost < nFirstChar - oFirstChar) {
-		    if (nFirstChar >= screen_columns
-			&& SP->_el_cost <= SP->_el1_cost) {
-			GoTo(lineno, 0);
-			UpdateAttrs(blank);
+		if (SP_PARM->_el1_cost < nFirstChar - oFirstChar) {
+		    if (nFirstChar >= screen_columns(SP_PARM)
+			&& SP_PARM->_el_cost <= SP_PARM->_el1_cost) {
+			GoTo(NCURSES_SP_ARGx lineno, 0);
+			UpdateAttrs(SP_PARM, blank);
 			TPUTS_TRACE("clr_eol");
-			putp(clr_eol);
+			NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx clr_eol);
 		    } else {
-			GoTo(lineno, nFirstChar - 1);
-			UpdateAttrs(blank);
+			GoTo(NCURSES_SP_ARGx lineno, nFirstChar - 1);
+			UpdateAttrs(SP_PARM, blank);
 			TPUTS_TRACE("clr_bol");
-			putp(clr_bol);
+			NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx clr_bol);
 		    }
 
 		    while (firstChar < nFirstChar)
@@ -1286,64 +1385,81 @@
 	    }
 	} else {
 	    /* find the first differing character */
-	    while (firstChar < screen_columns
+	    while (firstChar < screen_columns(SP_PARM)
 		   && CharEq(newLine[firstChar], oldLine[firstChar]))
 		firstChar++;
 	}
 	/* if there wasn't one, we're done */
-	if (firstChar >= screen_columns) {
+	if (firstChar >= screen_columns(SP_PARM)) {
 	    TR(TRACE_UPDATE, (T_RETURN("")));
 	    return;
 	}
 
-	blank = newLine[screen_columns - 1];
+	blank = newLine[screen_columns(SP_PARM) - 1];
 
-	if (!can_clear_with(CHREF(blank))) {
+	if (!can_clear_with(NCURSES_SP_ARGx CHREF(blank))) {
 	    /* find the last differing character */
-	    nLastChar = screen_columns - 1;
+	    nLastChar = screen_columns(SP_PARM) - 1;
 
 	    while (nLastChar > firstChar
 		   && CharEq(newLine[nLastChar], oldLine[nLastChar]))
 		nLastChar--;
 
 	    if (nLastChar >= firstChar) {
-		GoTo(lineno, firstChar);
-		PutRange(oldLine, newLine, lineno, firstChar, nLastChar);
+		GoTo(NCURSES_SP_ARGx lineno, firstChar);
+		PutRange(NCURSES_SP_ARGx
+			 oldLine,
+			 newLine,
+			 lineno,
+			 firstChar,
+			 nLastChar);
 		memcpy(oldLine + firstChar,
 		       newLine + firstChar,
-		       (nLastChar - firstChar + 1) * sizeof(NCURSES_CH_T));
+		       (unsigned) (nLastChar - firstChar + 1) * sizeof(NCURSES_CH_T));
 	    }
 	    TR(TRACE_UPDATE, (T_RETURN("")));
 	    return;
 	}
 
 	/* find last non-blank character on old line */
-	oLastChar = screen_columns - 1;
+	oLastChar = screen_columns(SP_PARM) - 1;
 	while (oLastChar > firstChar && CharEq(oldLine[oLastChar], blank))
 	    oLastChar--;
 
 	/* find last non-blank character on new line */
-	nLastChar = screen_columns - 1;
+	nLastChar = screen_columns(SP_PARM) - 1;
 	while (nLastChar > firstChar && CharEq(newLine[nLastChar], blank))
 	    nLastChar--;
 
 	if ((nLastChar == firstChar)
-	    && (SP->_el_cost < (oLastChar - nLastChar))) {
-	    GoTo(lineno, firstChar);
+	    && (SP_PARM->_el_cost < (oLastChar - nLastChar))) {
+	    GoTo(NCURSES_SP_ARGx lineno, firstChar);
 	    if (!CharEq(newLine[firstChar], blank))
-		PutChar(CHREF(newLine[firstChar]));
-	    ClrToEOL(blank, FALSE);
+		PutChar(NCURSES_SP_ARGx CHREF(newLine[firstChar]));
+	    ClrToEOL(NCURSES_SP_ARGx blank, FALSE);
 	} else if ((nLastChar != oLastChar)
 		   && (!CharEq(newLine[nLastChar], oldLine[oLastChar])
-		       || !(_nc_idcok && has_ic()))) {
-	    GoTo(lineno, firstChar);
-	    if ((oLastChar - nLastChar) > SP->_el_cost) {
-		if (PutRange(oldLine, newLine, lineno, firstChar, nLastChar))
-		    GoTo(lineno, nLastChar + 1);
-		ClrToEOL(blank, FALSE);
+		       || !(SP_PARM->_nc_sp_idcok
+			    && NCURSES_SP_NAME(has_ic) (NCURSES_SP_ARG)))) {
+	    GoTo(NCURSES_SP_ARGx lineno, firstChar);
+	    if ((oLastChar - nLastChar) > SP_PARM->_el_cost) {
+		if (PutRange(NCURSES_SP_ARGx
+			     oldLine,
+			     newLine,
+			     lineno,
+			     firstChar,
+			     nLastChar)) {
+		    GoTo(NCURSES_SP_ARGx lineno, nLastChar + 1);
+		}
+		ClrToEOL(NCURSES_SP_ARGx blank, FALSE);
 	    } else {
 		n = max(nLastChar, oLastChar);
-		PutRange(oldLine, newLine, lineno, firstChar, n);
+		PutRange(NCURSES_SP_ARGx
+			 oldLine,
+			 newLine,
+			 lineno,
+			 firstChar,
+			 n);
 	    }
 	} else {
 	    int nLastNonblank = nLastChar;
@@ -1364,8 +1480,13 @@
 
 	    n = min(oLastChar, nLastChar);
 	    if (n >= firstChar) {
-		GoTo(lineno, firstChar);
-		PutRange(oldLine, newLine, lineno, firstChar, n);
+		GoTo(NCURSES_SP_ARGx lineno, firstChar);
+		PutRange(NCURSES_SP_ARGx
+			 oldLine,
+			 newLine,
+			 lineno,
+			 firstChar,
+			 n);
 	    }
 
 	    if (oLastChar < nLastChar) {
@@ -1376,21 +1497,26 @@
 		    --oLastChar;
 		}
 #endif
-		GoTo(lineno, n + 1);
+		GoTo(NCURSES_SP_ARGx lineno, n + 1);
 		if ((nLastChar < nLastNonblank)
-		    || InsCharCost(nLastChar - oLastChar) > (m - n)) {
-		    PutRange(oldLine, newLine, lineno, n + 1, m);
+		    || InsCharCost(SP_PARM, nLastChar - oLastChar) > (m - n)) {
+		    PutRange(NCURSES_SP_ARGx
+			     oldLine,
+			     newLine,
+			     lineno,
+			     n + 1,
+			     m);
 		} else {
-		    InsStr(&newLine[n + 1], nLastChar - oLastChar);
+		    InsStr(NCURSES_SP_ARGx &newLine[n + 1], nLastChar - oLastChar);
 		}
 	    } else if (oLastChar > nLastChar) {
-		GoTo(lineno, n + 1);
-		if (DelCharCost(oLastChar - nLastChar)
-		    > SP->_el_cost + nLastNonblank - (n + 1)) {
-		    if (PutRange(oldLine, newLine, lineno,
+		GoTo(NCURSES_SP_ARGx lineno, n + 1);
+		if (DelCharCost(SP_PARM, oLastChar - nLastChar)
+		    > SP_PARM->_el_cost + nLastNonblank - (n + 1)) {
+		    if (PutRange(NCURSES_SP_ARGx oldLine, newLine, lineno,
 				 n + 1, nLastNonblank))
-			GoTo(lineno, nLastNonblank + 1);
-		    ClrToEOL(blank, FALSE);
+			  GoTo(NCURSES_SP_ARGx lineno, nLastNonblank + 1);
+		    ClrToEOL(NCURSES_SP_ARGx blank, FALSE);
 		} else {
 		    /*
 		     * The delete-char sequence will
@@ -1400,18 +1526,18 @@
 		     * setting the video attributes from
 		     * the last character on the row.
 		     */
-		    UpdateAttrs(blank);
-		    DelChar(oLastChar - nLastChar);
+		    UpdateAttrs(SP_PARM, blank);
+		    DelChar(NCURSES_SP_ARGx oLastChar - nLastChar);
 		}
 	    }
 	}
     }
 
     /* update the code's internal representation */
-    if (screen_columns > firstChar)
+    if (screen_columns(SP_PARM) > firstChar)
 	memcpy(oldLine + firstChar,
 	       newLine + firstChar,
-	       (screen_columns - firstChar) * sizeof(NCURSES_CH_T));
+	       (unsigned) (screen_columns(SP_PARM) - firstChar) * sizeof(NCURSES_CH_T));
     TR(TRACE_UPDATE, (T_RETURN("")));
     return;
 }
@@ -1424,7 +1550,7 @@
 */
 
 static void
-ClearScreen(NCURSES_CH_T blank)
+ClearScreen(NCURSES_SP_DCLx NCURSES_CH_T blank)
 {
     int i, j;
     bool fast_clear = (clear_screen || clr_eos || clr_eol);
@@ -1432,9 +1558,13 @@
     TR(TRACE_UPDATE, ("ClearScreen() called"));
 
 #if NCURSES_EXT_FUNCS
-    if (SP->_coloron
-	&& !SP->_default_color) {
-	_nc_do_color(GET_SCREEN_PAIR(SP), 0, FALSE, _nc_outch);
+    if (SP_PARM->_coloron
+	&& !SP_PARM->_default_color) {
+	NCURSES_SP_NAME(_nc_do_color) (NCURSES_SP_ARGx
+				       (short) GET_SCREEN_PAIR(SP_PARM),
+				       0,
+				       FALSE,
+				       NCURSES_SP_NAME(_nc_outch));
 	if (!back_color_erase) {
 	    fast_clear = FALSE;
 	}
@@ -1443,42 +1573,46 @@
 
     if (fast_clear) {
 	if (clear_screen) {
-	    UpdateAttrs(blank);
+	    UpdateAttrs(SP_PARM, blank);
 	    TPUTS_TRACE("clear_screen");
-	    putp(clear_screen);
-	    SP->_cursrow = SP->_curscol = 0;
-	    position_check(SP->_cursrow, SP->_curscol, "ClearScreen");
+	    NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx clear_screen);
+	    SP_PARM->_cursrow = SP_PARM->_curscol = 0;
+	    position_check(SP_PARM,
+			   SP_PARM->_cursrow,
+			   SP_PARM->_curscol,
+			   "ClearScreen");
 	} else if (clr_eos) {
-	    SP->_cursrow = SP->_curscol = -1;
-	    GoTo(0, 0);
-
-	    UpdateAttrs(blank);
+	    SP_PARM->_cursrow = SP_PARM->_curscol = -1;
+	    GoTo(NCURSES_SP_ARGx 0, 0);
+	    UpdateAttrs(SP_PARM, blank);
 	    TPUTS_TRACE("clr_eos");
-	    tputs(clr_eos, screen_lines, _nc_outch);
+	    NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx
+				    clr_eos,
+				    screen_lines(SP_PARM),
+				    NCURSES_SP_NAME(_nc_outch));
 	} else if (clr_eol) {
-	    SP->_cursrow = SP->_curscol = -1;
-
-	    UpdateAttrs(blank);
-	    for (i = 0; i < screen_lines; i++) {
-		GoTo(i, 0);
+	    SP_PARM->_cursrow = SP_PARM->_curscol = -1;
+	    UpdateAttrs(SP_PARM, blank);
+	    for (i = 0; i < screen_lines(SP_PARM); i++) {
+		GoTo(NCURSES_SP_ARGx i, 0);
 		TPUTS_TRACE("clr_eol");
-		putp(clr_eol);
+		NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx clr_eol);
 	    }
-	    GoTo(0, 0);
+	    GoTo(NCURSES_SP_ARGx 0, 0);
 	}
     } else {
-	UpdateAttrs(blank);
-	for (i = 0; i < screen_lines; i++) {
-	    GoTo(i, 0);
-	    for (j = 0; j < screen_columns; j++)
-		PutChar(CHREF(blank));
-	}
-	GoTo(0, 0);
+	UpdateAttrs(SP_PARM, blank);
+	for (i = 0; i < screen_lines(SP_PARM); i++) {
+	    GoTo(NCURSES_SP_ARGx i, 0);
+	    for (j = 0; j < screen_columns(SP_PARM); j++)
+		PutChar(NCURSES_SP_ARGx CHREF(blank));
+	}
+	GoTo(NCURSES_SP_ARGx 0, 0);
     }
 
-    for (i = 0; i < screen_lines; i++) {
-	for (j = 0; j < screen_columns; j++)
-	    curscr->_line[i].text[j] = blank;
+    for (i = 0; i < screen_lines(SP_PARM); i++) {
+	for (j = 0; j < screen_columns(SP_PARM); j++)
+	    CurScreen(SP_PARM)->_line[i].text[j] = blank;
     }
 
     TR(TRACE_UPDATE, ("screen cleared"));
@@ -1492,49 +1626,54 @@
 */
 
 static void
-InsStr(NCURSES_CH_T * line, int count)
+InsStr(NCURSES_SP_DCLx NCURSES_CH_T * line, int count)
 {
-    TR(TRACE_UPDATE, ("InsStr(%p,%d) called", line, count));
+    TR(TRACE_UPDATE, ("InsStr(%p, %p,%d) called",
+		      (void *) SP_PARM,
+		      (void *) line, count));
 
     /* Prefer parm_ich as it has the smallest cost - no need to shift
      * the whole line on each character. */
     /* The order must match that of InsCharCost. */
     if (parm_ich) {
 	TPUTS_TRACE("parm_ich");
-	tputs(TPARM_1(parm_ich, count), count, _nc_outch);
+	NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx
+				TPARM_1(parm_ich, count),
+				count,
+				NCURSES_SP_NAME(_nc_outch));
 	while (count) {
-	    PutAttrChar(CHREF(*line));
+	    PutAttrChar(NCURSES_SP_ARGx CHREF(*line));
 	    line++;
 	    count--;
 	}
     } else if (enter_insert_mode && exit_insert_mode) {
 	TPUTS_TRACE("enter_insert_mode");
-	putp(enter_insert_mode);
+	NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx enter_insert_mode);
 	while (count) {
-	    PutAttrChar(CHREF(*line));
+	    PutAttrChar(NCURSES_SP_ARGx CHREF(*line));
 	    if (insert_padding) {
 		TPUTS_TRACE("insert_padding");
-		putp(insert_padding);
+		NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx insert_padding);
 	    }
 	    line++;
 	    count--;
 	}
 	TPUTS_TRACE("exit_insert_mode");
-	putp(exit_insert_mode);
+	NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx exit_insert_mode);
     } else {
 	while (count) {
 	    TPUTS_TRACE("insert_character");
-	    putp(insert_character);
-	    PutAttrChar(CHREF(*line));
+	    NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx insert_character);
+	    PutAttrChar(NCURSES_SP_ARGx CHREF(*line));
 	    if (insert_padding) {
 		TPUTS_TRACE("insert_padding");
-		putp(insert_padding);
+		NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx insert_padding);
 	    }
 	    line++;
 	    count--;
 	}
     }
-    position_check(SP->_cursrow, SP->_curscol, "InsStr");
+    position_check(SP_PARM, SP_PARM->_cursrow, SP_PARM->_curscol, "InsStr");
 }
 
 /*
@@ -1545,22 +1684,25 @@
 */
 
 static void
-DelChar(int count)
+DelChar(NCURSES_SP_DCLx int count)
 {
     int n;
 
-    TR(TRACE_UPDATE, ("DelChar(%d) called, position = (%ld,%ld)",
-		      count,
-		      (long) newscr->_cury,
-		      (long) newscr->_curx));
+    TR(TRACE_UPDATE, ("DelChar(%p, %d) called, position = (%ld,%ld)",
+		      (void *) SP_PARM, count,
+		      (long) NewScreen(SP_PARM)->_cury,
+		      (long) NewScreen(SP_PARM)->_curx));
 
     if (parm_dch) {
 	TPUTS_TRACE("parm_dch");
-	tputs(TPARM_1(parm_dch, count), count, _nc_outch);
+	NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx
+				TPARM_1(parm_dch, count),
+				count,
+				NCURSES_SP_NAME(_nc_outch));
     } else {
 	for (n = 0; n < count; n++) {
 	    TPUTS_TRACE("delete_character");
-	    putp(delete_character);
+	    NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx delete_character);
 	}
     }
 }
@@ -1599,54 +1741,66 @@
 
 /* Try to scroll up assuming given csr (miny, maxy). Returns ERR on failure */
 static int
-scroll_csr_forward(int n, int top, int bot, int miny, int maxy, NCURSES_CH_T blank)
+scroll_csr_forward(NCURSES_SP_DCLx
+		   int n,
+		   int top,
+		   int bot,
+		   int miny,
+		   int maxy,
+		   NCURSES_CH_T blank)
 {
     int i;
 
     if (n == 1 && scroll_forward && top == miny && bot == maxy) {
-	GoTo(bot, 0);
-	UpdateAttrs(blank);
+	GoTo(NCURSES_SP_ARGx bot, 0);
+	UpdateAttrs(SP_PARM, blank);
 	TPUTS_TRACE("scroll_forward");
-	putp(scroll_forward);
+	NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx scroll_forward);
     } else if (n == 1 && delete_line && bot == maxy) {
-	GoTo(top, 0);
-	UpdateAttrs(blank);
+	GoTo(NCURSES_SP_ARGx top, 0);
+	UpdateAttrs(SP_PARM, blank);
 	TPUTS_TRACE("delete_line");
-	putp(delete_line);
+	NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx delete_line);
     } else if (parm_index && top == miny && bot == maxy) {
-	GoTo(bot, 0);
-	UpdateAttrs(blank);
+	GoTo(NCURSES_SP_ARGx bot, 0);
+	UpdateAttrs(SP_PARM, blank);
 	TPUTS_TRACE("parm_index");
-	tputs(TPARM_2(parm_index, n, 0), n, _nc_outch);
+	NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx
+				TPARM_2(parm_index, n, 0),
+				n,
+				NCURSES_SP_NAME(_nc_outch));
     } else if (parm_delete_line && bot == maxy) {
-	GoTo(top, 0);
-	UpdateAttrs(blank);
+	GoTo(NCURSES_SP_ARGx top, 0);
+	UpdateAttrs(SP_PARM, blank);
 	TPUTS_TRACE("parm_delete_line");
-	tputs(TPARM_2(parm_delete_line, n, 0), n, _nc_outch);
+	NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx
+				TPARM_2(parm_delete_line, n, 0),
+				n,
+				NCURSES_SP_NAME(_nc_outch));
     } else if (scroll_forward && top == miny && bot == maxy) {
-	GoTo(bot, 0);
-	UpdateAttrs(blank);
+	GoTo(NCURSES_SP_ARGx bot, 0);
+	UpdateAttrs(SP_PARM, blank);
 	for (i = 0; i < n; i++) {
 	    TPUTS_TRACE("scroll_forward");
-	    putp(scroll_forward);
+	    NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx scroll_forward);
 	}
     } else if (delete_line && bot == maxy) {
-	GoTo(top, 0);
-	UpdateAttrs(blank);
+	GoTo(NCURSES_SP_ARGx top, 0);
+	UpdateAttrs(SP_PARM, blank);
 	for (i = 0; i < n; i++) {
 	    TPUTS_TRACE("delete_line");
-	    putp(delete_line);
+	    NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx delete_line);
 	}
     } else
 	return ERR;
 
 #if NCURSES_EXT_FUNCS
-    if (FILL_BCE()) {
+    if (FILL_BCE(SP_PARM)) {
 	int j;
 	for (i = 0; i < n; i++) {
-	    GoTo(bot - i, 0);
-	    for (j = 0; j < screen_columns; j++)
-		PutChar(CHREF(blank));
+	    GoTo(NCURSES_SP_ARGx bot - i, 0);
+	    for (j = 0; j < screen_columns(SP_PARM); j++)
+		PutChar(NCURSES_SP_ARGx CHREF(blank));
 	}
     }
 #endif
@@ -1656,55 +1810,66 @@
 /* Try to scroll down assuming given csr (miny, maxy). Returns ERR on failure */
 /* n > 0 */
 static int
-scroll_csr_backward(int n, int top, int bot, int miny, int maxy,
+scroll_csr_backward(NCURSES_SP_DCLx
+		    int n,
+		    int top,
+		    int bot,
+		    int miny,
+		    int maxy,
 		    NCURSES_CH_T blank)
 {
     int i;
 
     if (n == 1 && scroll_reverse && top == miny && bot == maxy) {
-	GoTo(top, 0);
-	UpdateAttrs(blank);
+	GoTo(NCURSES_SP_ARGx top, 0);
+	UpdateAttrs(SP_PARM, blank);
 	TPUTS_TRACE("scroll_reverse");
-	putp(scroll_reverse);
+	NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx scroll_reverse);
     } else if (n == 1 && insert_line && bot == maxy) {
-	GoTo(top, 0);
-	UpdateAttrs(blank);
+	GoTo(NCURSES_SP_ARGx top, 0);
+	UpdateAttrs(SP_PARM, blank);
 	TPUTS_TRACE("insert_line");
-	putp(insert_line);
+	NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx insert_line);
     } else if (parm_rindex && top == miny && bot == maxy) {
-	GoTo(top, 0);
-	UpdateAttrs(blank);
+	GoTo(NCURSES_SP_ARGx top, 0);
+	UpdateAttrs(SP_PARM, blank);
 	TPUTS_TRACE("parm_rindex");
-	tputs(TPARM_2(parm_rindex, n, 0), n, _nc_outch);
+	NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx
+				TPARM_2(parm_rindex, n, 0),
+				n,
+				NCURSES_SP_NAME(_nc_outch));
     } else if (parm_insert_line && bot == maxy) {
-	GoTo(top, 0);
-	UpdateAttrs(blank);
+	GoTo(NCURSES_SP_ARGx top, 0);
+	UpdateAttrs(SP_PARM, blank);
 	TPUTS_TRACE("parm_insert_line");
-	tputs(TPARM_2(parm_insert_line, n, 0), n, _nc_outch);
+	NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx
+				TPARM_2(parm_insert_line, n, 0),
+				n,
+				NCURSES_SP_NAME(_nc_outch));
     } else if (scroll_reverse && top == miny && bot == maxy) {
-	GoTo(top, 0);
-	UpdateAttrs(blank);
+	GoTo(NCURSES_SP_ARGx top, 0);
+	UpdateAttrs(SP_PARM, blank);
 	for (i = 0; i < n; i++) {
 	    TPUTS_TRACE("scroll_reverse");
-	    putp(scroll_reverse);
+	    NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx scroll_reverse);
 	}
     } else if (insert_line && bot == maxy) {
-	GoTo(top, 0);
-	UpdateAttrs(blank);
+	GoTo(NCURSES_SP_ARGx top, 0);
+	UpdateAttrs(SP_PARM, blank);
 	for (i = 0; i < n; i++) {
 	    TPUTS_TRACE("insert_line");
-	    putp(insert_line);
+	    NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx insert_line);
 	}
     } else
 	return ERR;
 
 #if NCURSES_EXT_FUNCS
-    if (FILL_BCE()) {
+    if (FILL_BCE(SP_PARM)) {
 	int j;
 	for (i = 0; i < n; i++) {
-	    GoTo(top + i, 0);
-	    for (j = 0; j < screen_columns; j++)
-		PutChar(CHREF(blank));
+	    GoTo(NCURSES_SP_ARGx top + i, 0);
+	    for (j = 0; j < screen_columns(SP_PARM); j++)
+		PutChar(NCURSES_SP_ARGx CHREF(blank));
 	}
     }
 #endif
@@ -1714,40 +1879,46 @@
 /* scroll by using delete_line at del and insert_line at ins */
 /* n > 0 */
 static int
-scroll_idl(int n, int del, int ins, NCURSES_CH_T blank)
+scroll_idl(NCURSES_SP_DCLx int n, int del, int ins, NCURSES_CH_T blank)
 {
     int i;
 
     if (!((parm_delete_line || delete_line) && (parm_insert_line || insert_line)))
 	return ERR;
 
-    GoTo(del, 0);
-    UpdateAttrs(blank);
+    GoTo(NCURSES_SP_ARGx del, 0);
+    UpdateAttrs(SP_PARM, blank);
     if (n == 1 && delete_line) {
 	TPUTS_TRACE("delete_line");
-	putp(delete_line);
+	NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx delete_line);
     } else if (parm_delete_line) {
 	TPUTS_TRACE("parm_delete_line");
-	tputs(TPARM_2(parm_delete_line, n, 0), n, _nc_outch);
+	NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx
+				TPARM_2(parm_delete_line, n, 0),
+				n,
+				NCURSES_SP_NAME(_nc_outch));
     } else {			/* if (delete_line) */
 	for (i = 0; i < n; i++) {
 	    TPUTS_TRACE("delete_line");
-	    putp(delete_line);
+	    NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx delete_line);
 	}
     }
 
-    GoTo(ins, 0);
-    UpdateAttrs(blank);
+    GoTo(NCURSES_SP_ARGx ins, 0);
+    UpdateAttrs(SP_PARM, blank);
     if (n == 1 && insert_line) {
 	TPUTS_TRACE("insert_line");
-	putp(insert_line);
+	NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx insert_line);
     } else if (parm_insert_line) {
 	TPUTS_TRACE("parm_insert_line");
-	tputs(TPARM_2(parm_insert_line, n, 0), n, _nc_outch);
+	NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx
+				TPARM_2(parm_insert_line, n, 0),
+				n,
+				NCURSES_SP_NAME(_nc_outch));
     } else {			/* if (insert_line) */
 	for (i = 0; i < n; i++) {
 	    TPUTS_TRACE("insert_line");
-	    putp(insert_line);
+	    NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx insert_line);
 	}
     }
 
@@ -1763,15 +1934,25 @@
  * save/restore cursor capabilities if the terminal has them.
  */
 NCURSES_EXPORT(int)
-_nc_scrolln(int n, int top, int bot, int maxy)
+NCURSES_SP_NAME(_nc_scrolln) (NCURSES_SP_DCLx
+			      int n,
+			      int top,
+			      int bot,
+			      int maxy)
 /* scroll region from top to bot by n lines */
 {
-    NCURSES_CH_T blank = ClrBlank(stdscr);
+    NCURSES_CH_T blank;
     int i;
     bool cursor_saved = FALSE;
     int res;
 
-    TR(TRACE_MOVE, ("mvcur_scrolln(%d, %d, %d, %d)", n, top, bot, maxy));
+    TR(TRACE_MOVE, ("_nc_scrolln(%p, %d, %d, %d, %d)",
+		    (void *) SP_PARM, n, top, bot, maxy));
+
+    if (!IsValidScreen(SP_PARM))
+	return (ERR);
+
+    blank = ClrBlank(NCURSES_SP_ARGx StdScreen(SP_PARM));
 
 #if USE_XMC_SUPPORT
     /*
@@ -1787,34 +1968,36 @@
 	 * Explicitly clear if stuff pushed off top of region might
 	 * be saved by the terminal.
 	 */
-	res = scroll_csr_forward(n, top, bot, 0, maxy, blank);
+	res = scroll_csr_forward(NCURSES_SP_ARGx n, top, bot, 0, maxy, blank);
 
 	if (res == ERR && change_scroll_region) {
 	    if ((((n == 1 && scroll_forward) || parm_index)
-		 && (SP->_cursrow == bot || SP->_cursrow == bot - 1))
+		 && (SP_PARM->_cursrow == bot || SP_PARM->_cursrow == bot - 1))
 		&& save_cursor && restore_cursor) {
 		cursor_saved = TRUE;
 		TPUTS_TRACE("save_cursor");
-		putp(save_cursor);
+		NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx save_cursor);
 	    }
 	    TPUTS_TRACE("change_scroll_region");
-	    putp(TPARM_2(change_scroll_region, top, bot));
+	    NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx
+				   TPARM_2(change_scroll_region, top, bot));
 	    if (cursor_saved) {
 		TPUTS_TRACE("restore_cursor");
-		putp(restore_cursor);
+		NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx restore_cursor);
 	    } else {
-		SP->_cursrow = SP->_curscol = -1;
+		SP_PARM->_cursrow = SP_PARM->_curscol = -1;
 	    }
 
-	    res = scroll_csr_forward(n, top, bot, top, bot, blank);
+	    res = scroll_csr_forward(NCURSES_SP_ARGx n, top, bot, top, bot, blank);
 
 	    TPUTS_TRACE("change_scroll_region");
-	    putp(TPARM_2(change_scroll_region, 0, maxy));
-	    SP->_cursrow = SP->_curscol = -1;
+	    NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx
+				   TPARM_2(change_scroll_region, 0, maxy));
+	    SP_PARM->_cursrow = SP_PARM->_curscol = -1;
 	}
 
-	if (res == ERR && _nc_idlok)
-	    res = scroll_idl(n, top, bot - n + 1, blank);
+	if (res == ERR && SP_PARM->_nc_sp_idlok)
+	    res = scroll_idl(NCURSES_SP_ARGx n, top, bot - n + 1, blank);
 
 	/*
 	 * Clear the newly shifted-in text.
@@ -1823,44 +2006,49 @@
 	    && (non_dest_scroll_region || (memory_below && bot == maxy))) {
 	    static const NCURSES_CH_T blank2 = NewChar(BLANK_TEXT);
 	    if (bot == maxy && clr_eos) {
-		GoTo(bot - n + 1, 0);
-		ClrToEOS(blank2);
+		GoTo(NCURSES_SP_ARGx bot - n + 1, 0);
+		ClrToEOS(NCURSES_SP_ARGx blank2);
 	    } else {
 		for (i = 0; i < n; i++) {
-		    GoTo(bot - i, 0);
-		    ClrToEOL(blank2, FALSE);
+		    GoTo(NCURSES_SP_ARGx bot - i, 0);
+		    ClrToEOL(NCURSES_SP_ARGx blank2, FALSE);
 		}
 	    }
 	}
 
     } else {			/* (n < 0) - scroll down (backward) */
-	res = scroll_csr_backward(-n, top, bot, 0, maxy, blank);
+	res = scroll_csr_backward(NCURSES_SP_ARGx -n, top, bot, 0, maxy, blank);
 
 	if (res == ERR && change_scroll_region) {
-	    if (top != 0 && (SP->_cursrow == top || SP->_cursrow == top - 1)
+	    if (top != 0
+		&& (SP_PARM->_cursrow == top ||
+		    SP_PARM->_cursrow == top - 1)
 		&& save_cursor && restore_cursor) {
 		cursor_saved = TRUE;
 		TPUTS_TRACE("save_cursor");
-		putp(save_cursor);
+		NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx save_cursor);
 	    }
 	    TPUTS_TRACE("change_scroll_region");
-	    putp(TPARM_2(change_scroll_region, top, bot));
+	    NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx
+				   TPARM_2(change_scroll_region, top, bot));
 	    if (cursor_saved) {
 		TPUTS_TRACE("restore_cursor");
-		putp(restore_cursor);
+		NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx restore_cursor);
 	    } else {
-		SP->_cursrow = SP->_curscol = -1;
+		SP_PARM->_cursrow = SP_PARM->_curscol = -1;
 	    }
 
-	    res = scroll_csr_backward(-n, top, bot, top, bot, blank);
+	    res = scroll_csr_backward(NCURSES_SP_ARGx
+				      -n, top, bot, top, bot, blank);
 
 	    TPUTS_TRACE("change_scroll_region");
-	    putp(TPARM_2(change_scroll_region, 0, maxy));
-	    SP->_cursrow = SP->_curscol = -1;
+	    NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx
+				   TPARM_2(change_scroll_region, 0, maxy));
+	    SP_PARM->_cursrow = SP_PARM->_curscol = -1;
 	}
 
-	if (res == ERR && _nc_idlok)
-	    res = scroll_idl(-n, bot + n + 1, top, blank);
+	if (res == ERR && SP_PARM->_nc_sp_idlok)
+	    res = scroll_idl(NCURSES_SP_ARGx -n, bot + n + 1, top, blank);
 
 	/*
 	 * Clear the newly shifted-in text.
@@ -1869,8 +2057,8 @@
 	    && (non_dest_scroll_region || (memory_above && top == 0))) {
 	    static const NCURSES_CH_T blank2 = NewChar(BLANK_TEXT);
 	    for (i = 0; i < -n; i++) {
-		GoTo(i + top, 0);
-		ClrToEOL(blank2, FALSE);
+		GoTo(NCURSES_SP_ARGx i + top, 0);
+		ClrToEOL(NCURSES_SP_ARGx blank2, FALSE);
 	    }
 	}
     }
@@ -1878,99 +2066,163 @@
     if (res == ERR)
 	return (ERR);
 
-    _nc_scroll_window(curscr, n, top, bot, blank);
+    _nc_scroll_window(CurScreen(SP_PARM), n,
+		      (NCURSES_SIZE_T) top,
+		      (NCURSES_SIZE_T) bot,
+		      blank);
 
     /* shift hash values too - they can be reused */
-    _nc_scroll_oldhash(n, top, bot);
+    NCURSES_SP_NAME(_nc_scroll_oldhash) (NCURSES_SP_ARGx n, top, bot);
 
     return (OK);
 }
 
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+_nc_scrolln(int n, int top, int bot, int maxy)
+{
+    return NCURSES_SP_NAME(_nc_scrolln) (CURRENT_SCREEN, n, top, bot, maxy);
+}
+#endif
+
 NCURSES_EXPORT(void)
-_nc_screen_resume(void)
+NCURSES_SP_NAME(_nc_screen_resume) (NCURSES_SP_DCL0)
 {
+    assert(SP_PARM);
+
     /* make sure terminal is in a sane known state */
-    SetAttr(SCREEN_ATTRS(SP), A_NORMAL);
-    newscr->_clear = TRUE;
+    SetAttr(SCREEN_ATTRS(SP_PARM), A_NORMAL);
+    NewScreen(SP_PARM)->_clear = TRUE;
 
     /* reset color pairs and definitions */
-    if (SP->_coloron || SP->_color_defs)
-	_nc_reset_colors();
+    if (SP_PARM->_coloron || SP_PARM->_color_defs)
+	NCURSES_SP_NAME(_nc_reset_colors) (NCURSES_SP_ARG);
 
     /* restore user-defined colors, if any */
-    if (SP->_color_defs < 0) {
+    if (SP_PARM->_color_defs < 0) {
 	int n;
-	SP->_color_defs = -(SP->_color_defs);
-	for (n = 0; n < SP->_color_defs; ++n) {
-	    if (SP->_color_table[n].init) {
-		init_color(n,
-			   SP->_color_table[n].r,
-			   SP->_color_table[n].g,
-			   SP->_color_table[n].b);
+	SP_PARM->_color_defs = -(SP_PARM->_color_defs);
+	for (n = 0; n < SP_PARM->_color_defs; ++n) {
+	    if (SP_PARM->_color_table[n].init) {
+		NCURSES_SP_NAME(init_color) (NCURSES_SP_ARGx
+					     (short) n,
+					     SP_PARM->_color_table[n].r,
+					     SP_PARM->_color_table[n].g,
+					     SP_PARM->_color_table[n].b);
 	    }
 	}
     }
 
     if (exit_attribute_mode)
-	putp(exit_attribute_mode);
+	NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx exit_attribute_mode);
     else {
 	/* turn off attributes */
 	if (exit_alt_charset_mode)
-	    putp(exit_alt_charset_mode);
+	    NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx exit_alt_charset_mode);
 	if (exit_standout_mode)
-	    putp(exit_standout_mode);
+	    NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx exit_standout_mode);
 	if (exit_underline_mode)
-	    putp(exit_underline_mode);
+	    NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx exit_underline_mode);
     }
     if (exit_insert_mode)
-	putp(exit_insert_mode);
+	NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx exit_insert_mode);
     if (enter_am_mode && exit_am_mode)
-	putp(auto_right_margin ? enter_am_mode : exit_am_mode);
+	NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx
+			       (auto_right_margin
+				? enter_am_mode
+				: exit_am_mode));
+}
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(void)
+_nc_screen_resume(void)
+{
+    NCURSES_SP_NAME(_nc_screen_resume) (CURRENT_SCREEN);
 }
+#endif
 
 NCURSES_EXPORT(void)
+NCURSES_SP_NAME(_nc_screen_init) (NCURSES_SP_DCL0)
+{
+    NCURSES_SP_NAME(_nc_screen_resume) (NCURSES_SP_ARG);
+}
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(void)
 _nc_screen_init(void)
 {
-    _nc_screen_resume();
+    NCURSES_SP_NAME(_nc_screen_init) (CURRENT_SCREEN);
 }
+#endif
 
 /* wrap up screen handling */
 NCURSES_EXPORT(void)
-_nc_screen_wrap(void)
+NCURSES_SP_NAME(_nc_screen_wrap) (NCURSES_SP_DCL0)
 {
-    UpdateAttrs(normal);
+    if (SP_PARM == 0)
+	return;
+
+    UpdateAttrs(SP_PARM, normal);
 #if NCURSES_EXT_FUNCS
-    if (SP->_coloron
-	&& !SP->_default_color) {
+    if (SP_PARM->_coloron
+	&& !SP_PARM->_default_color) {
 	static const NCURSES_CH_T blank = NewChar(BLANK_TEXT);
-	SP->_default_color = TRUE;
-	_nc_do_color(-1, 0, FALSE, _nc_outch);
-	SP->_default_color = FALSE;
+	SP_PARM->_default_color = TRUE;
+	NCURSES_SP_NAME(_nc_do_color) (NCURSES_SP_ARGx
+				       -1,
+				       0,
+				       FALSE,
+				       NCURSES_SP_NAME(_nc_outch));
+	SP_PARM->_default_color = FALSE;
 
-	mvcur(SP->_cursrow, SP->_curscol, screen_lines - 1, 0);
+	TINFO_MVCUR(NCURSES_SP_ARGx
+		    SP_PARM->_cursrow,
+		    SP_PARM->_curscol,
+		    screen_lines(SP_PARM) - 1,
+		    0);
 
-	ClrToEOL(blank, TRUE);
+	ClrToEOL(NCURSES_SP_ARGx blank, TRUE);
     }
 #endif
-    if (SP->_color_defs) {
-	_nc_reset_colors();
+    if (SP_PARM->_color_defs) {
+	NCURSES_SP_NAME(_nc_reset_colors) (NCURSES_SP_ARG);
     }
 }
 
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(void)
+_nc_screen_wrap(void)
+{
+    NCURSES_SP_NAME(_nc_screen_wrap) (CURRENT_SCREEN);
+}
+#endif
+
 #if USE_XMC_SUPPORT
 NCURSES_EXPORT(void)
-_nc_do_xmc_glitch(attr_t previous)
+NCURSES_SP_NAME(_nc_do_xmc_glitch) (NCURSES_SP_DCLx attr_t previous)
 {
-    attr_t chg = XMC_CHANGES(previous ^ AttrOf(SCREEN_ATTRS(SP)));
+    if (SP_PARM != 0) {
+	attr_t chg = XMC_CHANGES(previous ^ AttrOf(SCREEN_ATTRS(SP_PARM)));
 
-    while (chg != 0) {
-	if (chg & 1) {
-	    SP->_curscol += magic_cookie_glitch;
-	    if (SP->_curscol >= SP->_columns)
-		wrap_cursor();
-	    TR(TRACE_UPDATE, ("bumped to %d,%d after cookie", SP->_cursrow, SP->_curscol));
+	while (chg != 0) {
+	    if (chg & 1) {
+		SP_PARM->_curscol += magic_cookie_glitch;
+		if (SP_PARM->_curscol >= SP_PARM->_columns)
+		    wrap_cursor(NCURSES_SP_ARG);
+		TR(TRACE_UPDATE, ("bumped to %d,%d after cookie",
+				  SP_PARM->_cursrow, SP_PARM->_curscol));
+	    }
+	    chg >>= 1;
 	}
-	chg >>= 1;
     }
 }
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(void)
+_nc_do_xmc_glitch(attr_t previous)
+{
+    NCURSES_SP_NAME(_nc_do_xmc_glitch) (CURRENT_SCREEN, previous);
+}
+#endif
+
 #endif /* USE_XMC_SUPPORT */
diff -Naur ncurses-5.7.orig/ncurses/wcwidth.h ncurses-5.7/ncurses/wcwidth.h
--- ncurses-5.7.orig/ncurses/wcwidth.h	1969-12-31 19:00:00.000000000 -0500
+++ ncurses-5.7/ncurses/wcwidth.h	2011-01-08 18:18:29.079036539 -0500
@@ -0,0 +1,309 @@
+/*
+ * This is an implementation of wcwidth() and wcswidth() (defined in
+ * IEEE Std 1002.1-2001) for Unicode.
+ *
+ * http://www.opengroup.org/onlinepubs/007904975/functions/wcwidth.html
+ * http://www.opengroup.org/onlinepubs/007904975/functions/wcswidth.html
+ *
+ * In fixed-width output devices, Latin characters all occupy a single
+ * "cell" position of equal width, whereas ideographic CJK characters
+ * occupy two such cells. Interoperability between terminal-line
+ * applications and (teletype-style) character terminals using the
+ * UTF-8 encoding requires agreement on which character should advance
+ * the cursor by how many cell positions. No established formal
+ * standards exist at present on which Unicode character shall occupy
+ * how many cell positions on character terminals. These routines are
+ * a first attempt of defining such behavior based on simple rules
+ * applied to data provided by the Unicode Consortium.
+ *
+ * For some graphical characters, the Unicode standard explicitly
+ * defines a character-cell width via the definition of the East Asian
+ * FullWidth (F), Wide (W), Half-width (H), and Narrow (Na) classes.
+ * In all these cases, there is no ambiguity about which width a
+ * terminal shall use. For characters in the East Asian Ambiguous (A)
+ * class, the width choice depends purely on a preference of backward
+ * compatibility with either historic CJK or Western practice.
+ * Choosing single-width for these characters is easy to justify as
+ * the appropriate long-term solution, as the CJK practice of
+ * displaying these characters as double-width comes from historic
+ * implementation simplicity (8-bit encoded characters were displayed
+ * single-width and 16-bit ones double-width, even for Greek,
+ * Cyrillic, etc.) and not any typographic considerations.
+ *
+ * Much less clear is the choice of width for the Not East Asian
+ * (Neutral) class. Existing practice does not dictate a width for any
+ * of these characters. It would nevertheless make sense
+ * typographically to allocate two character cells to characters such
+ * as for instance EM SPACE or VOLUME INTEGRAL, which cannot be
+ * represented adequately with a single-width glyph. The following
+ * routines at present merely assign a single-cell width to all
+ * neutral characters, in the interest of simplicity. This is not
+ * entirely satisfactory and should be reconsidered before
+ * establishing a formal standard in this area. At the moment, the
+ * decision which Not East Asian (Neutral) characters should be
+ * represented by double-width glyphs cannot yet be answered by
+ * applying a simple rule from the Unicode database content. Setting
+ * up a proper standard for the behavior of UTF-8 character terminals
+ * will require a careful analysis not only of each Unicode character,
+ * but also of each presentation form, something the author of these
+ * routines has avoided to do so far.
+ *
+ * http://www.unicode.org/unicode/reports/tr11/
+ *
+ * Markus Kuhn -- 2007-05-26 (Unicode 5.0)
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * for any purpose and without fee is hereby granted. The author
+ * disclaims all warranties with regard to this software.
+ *
+ * Latest version: http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c
+ */
+
+#include <wchar.h>
+
+struct interval {
+  int first;
+  int last;
+};
+
+/* auxiliary function for binary search in interval table */
+static int bisearch(wchar_t ucs, const struct interval *table, int max) {
+  int min = 0;
+  int mid;
+
+  if (ucs < table[0].first || ucs > table[max].last)
+    return 0;
+  while (max >= min) {
+    mid = (min + max) / 2;
+    if (ucs > table[mid].last)
+      min = mid + 1;
+    else if (ucs < table[mid].first)
+      max = mid - 1;
+    else
+      return 1;
+  }
+
+  return 0;
+}
+
+
+/* The following two functions define the column width of an ISO 10646
+ * character as follows:
+ *
+ *    - The null character (U+0000) has a column width of 0.
+ *
+ *    - Other C0/C1 control characters and DEL will lead to a return
+ *      value of -1.
+ *
+ *    - Non-spacing and enclosing combining characters (general
+ *      category code Mn or Me in the Unicode database) have a
+ *      column width of 0.
+ *
+ *    - SOFT HYPHEN (U+00AD) has a column width of 1.
+ *
+ *    - Other format characters (general category code Cf in the Unicode
+ *      database) and ZERO WIDTH SPACE (U+200B) have a column width of 0.
+ *
+ *    - Hangul Jamo medial vowels and final consonants (U+1160-U+11FF)
+ *      have a column width of 0.
+ *
+ *    - Spacing characters in the East Asian Wide (W) or East Asian
+ *      Full-width (F) category as defined in Unicode Technical
+ *      Report #11 have a column width of 2.
+ *
+ *    - All remaining characters (including all printable
+ *      ISO 8859-1 and WGL4 characters, Unicode control characters,
+ *      etc.) have a column width of 1.
+ *
+ * This implementation assumes that wchar_t characters are encoded
+ * in ISO 10646.
+ */
+
+int mk_wcwidth(wchar_t ucs)
+{
+  /* sorted list of non-overlapping intervals of non-spacing characters */
+  /* generated by "uniset +cat=Me +cat=Mn +cat=Cf -00AD +1160-11FF +200B c" */
+  static const struct interval combining[] = {
+    { 0x0300, 0x036F }, { 0x0483, 0x0486 }, { 0x0488, 0x0489 },
+    { 0x0591, 0x05BD }, { 0x05BF, 0x05BF }, { 0x05C1, 0x05C2 },
+    { 0x05C4, 0x05C5 }, { 0x05C7, 0x05C7 }, { 0x0600, 0x0603 },
+    { 0x0610, 0x0615 }, { 0x064B, 0x065E }, { 0x0670, 0x0670 },
+    { 0x06D6, 0x06E4 }, { 0x06E7, 0x06E8 }, { 0x06EA, 0x06ED },
+    { 0x070F, 0x070F }, { 0x0711, 0x0711 }, { 0x0730, 0x074A },
+    { 0x07A6, 0x07B0 }, { 0x07EB, 0x07F3 }, { 0x0901, 0x0902 },
+    { 0x093C, 0x093C }, { 0x0941, 0x0948 }, { 0x094D, 0x094D },
+    { 0x0951, 0x0954 }, { 0x0962, 0x0963 }, { 0x0981, 0x0981 },
+    { 0x09BC, 0x09BC }, { 0x09C1, 0x09C4 }, { 0x09CD, 0x09CD },
+    { 0x09E2, 0x09E3 }, { 0x0A01, 0x0A02 }, { 0x0A3C, 0x0A3C },
+    { 0x0A41, 0x0A42 }, { 0x0A47, 0x0A48 }, { 0x0A4B, 0x0A4D },
+    { 0x0A70, 0x0A71 }, { 0x0A81, 0x0A82 }, { 0x0ABC, 0x0ABC },
+    { 0x0AC1, 0x0AC5 }, { 0x0AC7, 0x0AC8 }, { 0x0ACD, 0x0ACD },
+    { 0x0AE2, 0x0AE3 }, { 0x0B01, 0x0B01 }, { 0x0B3C, 0x0B3C },
+    { 0x0B3F, 0x0B3F }, { 0x0B41, 0x0B43 }, { 0x0B4D, 0x0B4D },
+    { 0x0B56, 0x0B56 }, { 0x0B82, 0x0B82 }, { 0x0BC0, 0x0BC0 },
+    { 0x0BCD, 0x0BCD }, { 0x0C3E, 0x0C40 }, { 0x0C46, 0x0C48 },
+    { 0x0C4A, 0x0C4D }, { 0x0C55, 0x0C56 }, { 0x0CBC, 0x0CBC },
+    { 0x0CBF, 0x0CBF }, { 0x0CC6, 0x0CC6 }, { 0x0CCC, 0x0CCD },
+    { 0x0CE2, 0x0CE3 }, { 0x0D41, 0x0D43 }, { 0x0D4D, 0x0D4D },
+    { 0x0DCA, 0x0DCA }, { 0x0DD2, 0x0DD4 }, { 0x0DD6, 0x0DD6 },
+    { 0x0E31, 0x0E31 }, { 0x0E34, 0x0E3A }, { 0x0E47, 0x0E4E },
+    { 0x0EB1, 0x0EB1 }, { 0x0EB4, 0x0EB9 }, { 0x0EBB, 0x0EBC },
+    { 0x0EC8, 0x0ECD }, { 0x0F18, 0x0F19 }, { 0x0F35, 0x0F35 },
+    { 0x0F37, 0x0F37 }, { 0x0F39, 0x0F39 }, { 0x0F71, 0x0F7E },
+    { 0x0F80, 0x0F84 }, { 0x0F86, 0x0F87 }, { 0x0F90, 0x0F97 },
+    { 0x0F99, 0x0FBC }, { 0x0FC6, 0x0FC6 }, { 0x102D, 0x1030 },
+    { 0x1032, 0x1032 }, { 0x1036, 0x1037 }, { 0x1039, 0x1039 },
+    { 0x1058, 0x1059 }, { 0x1160, 0x11FF }, { 0x135F, 0x135F },
+    { 0x1712, 0x1714 }, { 0x1732, 0x1734 }, { 0x1752, 0x1753 },
+    { 0x1772, 0x1773 }, { 0x17B4, 0x17B5 }, { 0x17B7, 0x17BD },
+    { 0x17C6, 0x17C6 }, { 0x17C9, 0x17D3 }, { 0x17DD, 0x17DD },
+    { 0x180B, 0x180D }, { 0x18A9, 0x18A9 }, { 0x1920, 0x1922 },
+    { 0x1927, 0x1928 }, { 0x1932, 0x1932 }, { 0x1939, 0x193B },
+    { 0x1A17, 0x1A18 }, { 0x1B00, 0x1B03 }, { 0x1B34, 0x1B34 },
+    { 0x1B36, 0x1B3A }, { 0x1B3C, 0x1B3C }, { 0x1B42, 0x1B42 },
+    { 0x1B6B, 0x1B73 }, { 0x1DC0, 0x1DCA }, { 0x1DFE, 0x1DFF },
+    { 0x200B, 0x200F }, { 0x202A, 0x202E }, { 0x2060, 0x2063 },
+    { 0x206A, 0x206F }, { 0x20D0, 0x20EF }, { 0x302A, 0x302F },
+    { 0x3099, 0x309A }, { 0xA806, 0xA806 }, { 0xA80B, 0xA80B },
+    { 0xA825, 0xA826 }, { 0xFB1E, 0xFB1E }, { 0xFE00, 0xFE0F },
+    { 0xFE20, 0xFE23 }, { 0xFEFF, 0xFEFF }, { 0xFFF9, 0xFFFB },
+    { 0x10A01, 0x10A03 }, { 0x10A05, 0x10A06 }, { 0x10A0C, 0x10A0F },
+    { 0x10A38, 0x10A3A }, { 0x10A3F, 0x10A3F }, { 0x1D167, 0x1D169 },
+    { 0x1D173, 0x1D182 }, { 0x1D185, 0x1D18B }, { 0x1D1AA, 0x1D1AD },
+    { 0x1D242, 0x1D244 }, { 0xE0001, 0xE0001 }, { 0xE0020, 0xE007F },
+    { 0xE0100, 0xE01EF }
+  };
+
+  /* test for 8-bit control characters */
+  if (ucs == 0)
+    return 0;
+  if (ucs < 32 || (ucs >= 0x7f && ucs < 0xa0))
+    return -1;
+
+  /* binary search in table of non-spacing characters */
+  if (bisearch(ucs, combining,
+	       sizeof(combining) / sizeof(struct interval) - 1))
+    return 0;
+
+  /* if we arrive here, ucs is not a combining or C0/C1 control character */
+
+  return 1 + 
+    (ucs >= 0x1100 &&
+     (ucs <= 0x115f ||                    /* Hangul Jamo init. consonants */
+      ucs == 0x2329 || ucs == 0x232a ||
+      (ucs >= 0x2e80 && ucs <= 0xa4cf &&
+       ucs != 0x303f) ||                  /* CJK ... Yi */
+      (ucs >= 0xac00 && ucs <= 0xd7a3) || /* Hangul Syllables */
+      (ucs >= 0xf900 && ucs <= 0xfaff) || /* CJK Compatibility Ideographs */
+      (ucs >= 0xfe10 && ucs <= 0xfe19) || /* Vertical forms */
+      (ucs >= 0xfe30 && ucs <= 0xfe6f) || /* CJK Compatibility Forms */
+      (ucs >= 0xff00 && ucs <= 0xff60) || /* Fullwidth Forms */
+      (ucs >= 0xffe0 && ucs <= 0xffe6) ||
+      (ucs >= 0x20000 && ucs <= 0x2fffd) ||
+      (ucs >= 0x30000 && ucs <= 0x3fffd)));
+}
+
+
+int mk_wcswidth(const wchar_t *pwcs, size_t n)
+{
+  int w, width = 0;
+
+  for (;*pwcs && n-- > 0; pwcs++)
+    if ((w = mk_wcwidth(*pwcs)) < 0)
+      return -1;
+    else
+      width += w;
+
+  return width;
+}
+
+
+/*
+ * The following functions are the same as mk_wcwidth() and
+ * mk_wcswidth(), except that spacing characters in the East Asian
+ * Ambiguous (A) category as defined in Unicode Technical Report #11
+ * have a column width of 2. This variant might be useful for users of
+ * CJK legacy encodings who want to migrate to UCS without changing
+ * the traditional terminal character-width behaviour. It is not
+ * otherwise recommended for general use.
+ */
+int mk_wcwidth_cjk(wchar_t ucs)
+{
+  /* sorted list of non-overlapping intervals of East Asian Ambiguous
+   * characters, generated by "uniset +WIDTH-A -cat=Me -cat=Mn -cat=Cf c" */
+  static const struct interval ambiguous[] = {
+    { 0x00A1, 0x00A1 }, { 0x00A4, 0x00A4 }, { 0x00A7, 0x00A8 },
+    { 0x00AA, 0x00AA }, { 0x00AE, 0x00AE }, { 0x00B0, 0x00B4 },
+    { 0x00B6, 0x00BA }, { 0x00BC, 0x00BF }, { 0x00C6, 0x00C6 },
+    { 0x00D0, 0x00D0 }, { 0x00D7, 0x00D8 }, { 0x00DE, 0x00E1 },
+    { 0x00E6, 0x00E6 }, { 0x00E8, 0x00EA }, { 0x00EC, 0x00ED },
+    { 0x00F0, 0x00F0 }, { 0x00F2, 0x00F3 }, { 0x00F7, 0x00FA },
+    { 0x00FC, 0x00FC }, { 0x00FE, 0x00FE }, { 0x0101, 0x0101 },
+    { 0x0111, 0x0111 }, { 0x0113, 0x0113 }, { 0x011B, 0x011B },
+    { 0x0126, 0x0127 }, { 0x012B, 0x012B }, { 0x0131, 0x0133 },
+    { 0x0138, 0x0138 }, { 0x013F, 0x0142 }, { 0x0144, 0x0144 },
+    { 0x0148, 0x014B }, { 0x014D, 0x014D }, { 0x0152, 0x0153 },
+    { 0x0166, 0x0167 }, { 0x016B, 0x016B }, { 0x01CE, 0x01CE },
+    { 0x01D0, 0x01D0 }, { 0x01D2, 0x01D2 }, { 0x01D4, 0x01D4 },
+    { 0x01D6, 0x01D6 }, { 0x01D8, 0x01D8 }, { 0x01DA, 0x01DA },
+    { 0x01DC, 0x01DC }, { 0x0251, 0x0251 }, { 0x0261, 0x0261 },
+    { 0x02C4, 0x02C4 }, { 0x02C7, 0x02C7 }, { 0x02C9, 0x02CB },
+    { 0x02CD, 0x02CD }, { 0x02D0, 0x02D0 }, { 0x02D8, 0x02DB },
+    { 0x02DD, 0x02DD }, { 0x02DF, 0x02DF }, { 0x0391, 0x03A1 },
+    { 0x03A3, 0x03A9 }, { 0x03B1, 0x03C1 }, { 0x03C3, 0x03C9 },
+    { 0x0401, 0x0401 }, { 0x0410, 0x044F }, { 0x0451, 0x0451 },
+    { 0x2010, 0x2010 }, { 0x2013, 0x2016 }, { 0x2018, 0x2019 },
+    { 0x201C, 0x201D }, { 0x2020, 0x2022 }, { 0x2024, 0x2027 },
+    { 0x2030, 0x2030 }, { 0x2032, 0x2033 }, { 0x2035, 0x2035 },
+    { 0x203B, 0x203B }, { 0x203E, 0x203E }, { 0x2074, 0x2074 },
+    { 0x207F, 0x207F }, { 0x2081, 0x2084 }, { 0x20AC, 0x20AC },
+    { 0x2103, 0x2103 }, { 0x2105, 0x2105 }, { 0x2109, 0x2109 },
+    { 0x2113, 0x2113 }, { 0x2116, 0x2116 }, { 0x2121, 0x2122 },
+    { 0x2126, 0x2126 }, { 0x212B, 0x212B }, { 0x2153, 0x2154 },
+    { 0x215B, 0x215E }, { 0x2160, 0x216B }, { 0x2170, 0x2179 },
+    { 0x2190, 0x2199 }, { 0x21B8, 0x21B9 }, { 0x21D2, 0x21D2 },
+    { 0x21D4, 0x21D4 }, { 0x21E7, 0x21E7 }, { 0x2200, 0x2200 },
+    { 0x2202, 0x2203 }, { 0x2207, 0x2208 }, { 0x220B, 0x220B },
+    { 0x220F, 0x220F }, { 0x2211, 0x2211 }, { 0x2215, 0x2215 },
+    { 0x221A, 0x221A }, { 0x221D, 0x2220 }, { 0x2223, 0x2223 },
+    { 0x2225, 0x2225 }, { 0x2227, 0x222C }, { 0x222E, 0x222E },
+    { 0x2234, 0x2237 }, { 0x223C, 0x223D }, { 0x2248, 0x2248 },
+    { 0x224C, 0x224C }, { 0x2252, 0x2252 }, { 0x2260, 0x2261 },
+    { 0x2264, 0x2267 }, { 0x226A, 0x226B }, { 0x226E, 0x226F },
+    { 0x2282, 0x2283 }, { 0x2286, 0x2287 }, { 0x2295, 0x2295 },
+    { 0x2299, 0x2299 }, { 0x22A5, 0x22A5 }, { 0x22BF, 0x22BF },
+    { 0x2312, 0x2312 }, { 0x2460, 0x24E9 }, { 0x24EB, 0x254B },
+    { 0x2550, 0x2573 }, { 0x2580, 0x258F }, { 0x2592, 0x2595 },
+    { 0x25A0, 0x25A1 }, { 0x25A3, 0x25A9 }, { 0x25B2, 0x25B3 },
+    { 0x25B6, 0x25B7 }, { 0x25BC, 0x25BD }, { 0x25C0, 0x25C1 },
+    { 0x25C6, 0x25C8 }, { 0x25CB, 0x25CB }, { 0x25CE, 0x25D1 },
+    { 0x25E2, 0x25E5 }, { 0x25EF, 0x25EF }, { 0x2605, 0x2606 },
+    { 0x2609, 0x2609 }, { 0x260E, 0x260F }, { 0x2614, 0x2615 },
+    { 0x261C, 0x261C }, { 0x261E, 0x261E }, { 0x2640, 0x2640 },
+    { 0x2642, 0x2642 }, { 0x2660, 0x2661 }, { 0x2663, 0x2665 },
+    { 0x2667, 0x266A }, { 0x266C, 0x266D }, { 0x266F, 0x266F },
+    { 0x273D, 0x273D }, { 0x2776, 0x277F }, { 0xE000, 0xF8FF },
+    { 0xFFFD, 0xFFFD }, { 0xF0000, 0xFFFFD }, { 0x100000, 0x10FFFD }
+  };
+
+  /* binary search in table of non-spacing characters */
+  if (bisearch(ucs, ambiguous,
+	       sizeof(ambiguous) / sizeof(struct interval) - 1))
+    return 2;
+
+  return mk_wcwidth(ucs);
+}
+
+
+int mk_wcswidth_cjk(const wchar_t *pwcs, size_t n)
+{
+  int w, width = 0;
+
+  for (;*pwcs && n-- > 0; pwcs++)
+    if ((w = mk_wcwidth_cjk(*pwcs)) < 0)
+      return -1;
+    else
+      width += w;
+
+  return width;
+}
diff -Naur ncurses-5.7.orig/ncurses/widechar/lib_add_wch.c ncurses-5.7/ncurses/widechar/lib_add_wch.c
--- ncurses-5.7.orig/ncurses/widechar/lib_add_wch.c	2006-12-02 16:19:17.000000000 -0500
+++ ncurses-5.7/ncurses/widechar/lib_add_wch.c	2011-01-08 18:18:29.754781633 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2004,2006 Free Software Foundation, Inc.                   *
+ * Copyright (c) 2004-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            *
@@ -35,41 +35,389 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_add_wch.c,v 1.6 2006/12/02 21:19:17 tom Exp $")
+#if HAVE_WCTYPE_H
+#include <wctype.h>
+#endif
 
-NCURSES_EXPORT(int)
-wadd_wch(WINDOW *win, const cchar_t *wch)
+MODULE_ID("$Id: lib_add_wch.c,v 1.11 2010/12/19 01:32:55 tom Exp $")
+
+/* clone/adapt lib_addch.c */
+static const cchar_t blankchar = NewChar(BLANK_TEXT);
+
+/*
+ * Ugly microtweaking alert.  Everything from here to end of module is
+ * likely to be speed-critical -- profiling data sure says it is!
+ * Most of the important screen-painting functions are shells around
+ * wadd_wch().  So we make every effort to reduce function-call overhead
+ * by inlining stuff, even at the cost of making wrapped copies for
+ * export.  Also we supply some internal versions that don't call the
+ * window sync hook, for use by string-put functions.
+ */
+
+/* Return bit mask for clearing color pair number if given ch has color */
+#define COLOR_MASK(ch) (~(attr_t)((ch) & A_COLOR ? A_COLOR : 0))
+
+static NCURSES_INLINE cchar_t
+render_char(WINDOW *win, cchar_t ch)
+/* compute a rendition of the given char correct for the current context */
 {
-    PUTC_DATA;
-    int n;
-    int code = ERR;
+    attr_t a = WINDOW_ATTRS(win);
+    int pair = GetPair(ch);
+
+    if (ISBLANK(ch)
+	&& AttrOf(ch) == A_NORMAL
+	&& pair == 0) {
+	/* color/pair in attrs has precedence over bkgrnd */
+	ch = win->_nc_bkgd;
+	SetAttr(ch, a | AttrOf(win->_nc_bkgd));
+	if ((pair = GET_WINDOW_PAIR(win)) == 0)
+	    pair = GetPair(win->_nc_bkgd);
+	SetPair(ch, pair);
+    } else {
+	/* color in attrs has precedence over bkgrnd */
+	a |= AttrOf(win->_nc_bkgd) & COLOR_MASK(a);
+	/* color in ch has precedence */
+	if (pair == 0) {
+	    if ((pair = GET_WINDOW_PAIR(win)) == 0)
+		pair = GetPair(win->_nc_bkgd);
+	}
+	AddAttr(ch, (a & COLOR_MASK(AttrOf(ch))));
+	SetPair(ch, pair);
+    }
+
+    TR(TRACE_VIRTPUT,
+       ("render_char bkg %s (%d), attrs %s (%d) -> ch %s (%d)",
+	_tracech_t2(1, CHREF(win->_nc_bkgd)),
+	GetPair(win->_nc_bkgd),
+	_traceattr(WINDOW_ATTRS(win)),
+	GET_WINDOW_PAIR(win),
+	_tracech_t2(3, CHREF(ch)),
+	GetPair(ch)));
+
+    return (ch);
+}
+
+/* check if position is legal; if not, return error */
+#ifndef NDEBUG			/* treat this like an assertion */
+#define CHECK_POSITION(win, x, y) \
+	if (y > win->_maxy \
+	 || x > win->_maxx \
+	 || y < 0 \
+	 || x < 0) { \
+		TR(TRACE_VIRTPUT, ("Alert! Win=%p _curx = %d, _cury = %d " \
+				   "(_maxx = %d, _maxy = %d)", win, x, y, \
+				   win->_maxx, win->_maxy)); \
+		return(ERR); \
+	}
+#else
+#define CHECK_POSITION(win, x, y)	/* nothing */
+#endif
+
+static bool
+newline_forces_scroll(WINDOW *win, NCURSES_SIZE_T * ypos)
+{
+    bool result = FALSE;
+
+    if (*ypos >= win->_regtop && *ypos == win->_regbottom) {
+	*ypos = win->_regbottom;
+	result = TRUE;
+    } else {
+	*ypos = (NCURSES_SIZE_T) (*ypos + 1);
+    }
+    return result;
+}
 
-    TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_CALLED("wadd_wch(%p, %s)"), win,
-				      _tracech_t(wch)));
+/*
+ * The _WRAPPED flag is useful only for telling an application that we've just
+ * wrapped the cursor.  We don't do anything with this flag except set it when
+ * wrapping, and clear it whenever we move the cursor.  If we try to wrap at
+ * the lower-right corner of a window, we cannot move the cursor (since that
+ * wouldn't be legal).  So we return an error (which is what SVr4 does). 
+ * Unlike SVr4, we can successfully add a character to the lower-right corner
+ * (Solaris 2.6 does this also, however).
+ */
+static int
+wrap_to_next_line(WINDOW *win)
+{
+    win->_flags |= _WRAPPED;
+    if (newline_forces_scroll(win, &(win->_cury))) {
+	win->_curx = win->_maxx;
+	if (!win->_scroll)
+	    return (ERR);
+	scroll(win);
+    }
+    win->_curx = 0;
+    return (OK);
+}
 
-    if (win != 0) {
-	PUTC_INIT;
-	for (PUTC_i = 0; PUTC_i < CCHARW_MAX; ++PUTC_i) {
-	    attr_t attrs = (wch->attr & A_ATTRIBUTES);
-
-	    if ((PUTC_ch = wch->chars[PUTC_i]) == L'\0')
-		break;
-	    if ((PUTC_n = wcrtomb(PUTC_buf, PUTC_ch, &PUT_st)) <= 0) {
-		code = ERR;
-		if (is8bits(PUTC_ch))
-		    code = waddch(win, UChar(PUTC_ch) | attrs);
-		break;
+static int wadd_wch_literal(WINDOW *, cchar_t);
+/*
+ * Fill the given number of cells with blanks using the current background
+ * rendition.  This saves/restores the current x-position.
+ */
+static void
+fill_cells(WINDOW *win, int count)
+{
+    cchar_t blank = blankchar;
+    int save_x = win->_curx;
+    int save_y = win->_cury;
+
+    while (count-- > 0) {
+	if (wadd_wch_literal(win, blank) == ERR)
+	    break;
+    }
+    win->_curx = (NCURSES_SIZE_T) save_x;
+    win->_cury = (NCURSES_SIZE_T) save_y;
+}
+
+static int
+wadd_wch_literal(WINDOW *win, cchar_t ch)
+{
+    int x;
+    int y;
+    struct ldat *line;
+
+    x = win->_curx;
+    y = win->_cury;
+
+    CHECK_POSITION(win, x, y);
+
+    ch = render_char(win, ch);
+
+    line = win->_line + y;
+
+    CHANGED_CELL(line, x);
+
+    /*
+     * Non-spacing characters are added to the current cell.
+     *
+     * Spacing characters that are wider than one column require some display
+     * adjustments.
+     */
+    {
+	int len = wcwidth(CharOf(ch));
+	int i;
+	int j;
+	wchar_t *chars;
+
+	if (len == 0) {		/* non-spacing */
+	    if ((x > 0 && y >= 0)
+		|| (win->_maxx >= 0 && win->_cury >= 1)) {
+		if (x > 0 && y >= 0)
+		    chars = (win->_line[y].text[x - 1].chars);
+		else
+		    chars = (win->_line[y - 1].text[win->_maxx].chars);
+		for (i = 0; i < CCHARW_MAX; ++i) {
+		    if (chars[i] == 0) {
+			TR(TRACE_VIRTPUT,
+			   ("added non-spacing %d: %x",
+			    x, (int) CharOf(ch)));
+			chars[i] = CharOf(ch);
+			break;
+		    }
+		}
 	    }
-	    for (n = 0; n < PUTC_n; n++) {
-		if ((code = waddch(win, UChar(PUTC_buf[n]) | attrs)) == ERR) {
+	    goto testwrapping;
+	} else if (len > 1) {	/* multi-column characters */
+	    /*
+	     * Check if the character will fit on the current line.  If it does
+	     * not fit, fill in the remainder of the line with blanks.  and
+	     * move to the next line.
+	     */
+	    if (len > win->_maxx + 1) {
+		TR(TRACE_VIRTPUT, ("character will not fit"));
+		return ERR;
+	    } else if (x + len > win->_maxx + 1) {
+		int count = win->_maxx + 1 - x;
+		TR(TRACE_VIRTPUT, ("fill %d remaining cells", count));
+		fill_cells(win, count);
+		if (wrap_to_next_line(win) == ERR)
+		    return ERR;
+		x = win->_curx;
+		y = win->_cury;
+		line = win->_line + y;
+	    }
+	    /*
+	     * Check for cells which are orphaned by adding this character, set
+	     * those to blanks.
+	     *
+	     * FIXME: this actually could fill j-i cells, more complicated to
+	     * setup though.
+	     */
+	    for (i = 0; i < len; ++i) {
+		if (isWidecBase(win->_line[y].text[x + i])) {
+		    break;
+		} else if (isWidecExt(win->_line[y].text[x + i])) {
+		    for (j = i; x + j <= win->_maxx; ++j) {
+			if (!isWidecExt(win->_line[y].text[x + j])) {
+			    TR(TRACE_VIRTPUT, ("fill %d orphan cells", j));
+			    fill_cells(win, j);
+			    break;
+			}
+		    }
 		    break;
 		}
 	    }
-	    if (code == ERR)
-		break;
+	    /*
+	     * Finally, add the cells for this character.
+	     */
+	    for (i = 0; i < len; ++i) {
+		cchar_t value = ch;
+		SetWidecExt(value, i);
+		TR(TRACE_VIRTPUT, ("multicolumn %d:%d (%d,%d)",
+				   i + 1, len,
+				   win->_begy + y, win->_begx + x));
+		line->text[x] = value;
+		CHANGED_CELL(line, x);
+		++x;
+	    }
+	    goto testwrapping;
 	}
     }
 
+    /*
+     * Single-column characters.
+     */
+    line->text[x++] = ch;
+    /*
+     * This label is used only for wide-characters.
+     */
+  testwrapping:
+
+    TR(TRACE_VIRTPUT, ("cell (%ld, %ld..%d) = %s",
+		       (long) win->_cury, (long) win->_curx, x - 1,
+		       _tracech_t(CHREF(ch))));
+
+    if (x > win->_maxx) {
+	return wrap_to_next_line(win);
+    }
+    win->_curx = (NCURSES_SIZE_T) x;
+    return OK;
+}
+
+static NCURSES_INLINE int
+wadd_wch_nosync(WINDOW *win, cchar_t ch)
+/* the workhorse function -- add a character to the given window */
+{
+    NCURSES_SIZE_T x, y;
+    wchar_t *s;
+    int tabsize = 8;
+#if USE_REENTRANT
+    SCREEN *sp = _nc_screen_of(win);
+#endif
+
+    /*
+     * If we are using the alternate character set, forget about locale.
+     * Otherwise, if the locale * claims the code is printable, treat it that
+     * way.
+     */
+    if ((AttrOf(ch) & A_ALTCHARSET)
+	|| iswprint((wint_t) CharOf(ch)))
+	return wadd_wch_literal(win, ch);
+
+    /*
+     * Handle carriage control and other codes that are not printable, or are
+     * known to expand to more than one character according to unctrl().
+     */
+    x = win->_curx;
+    y = win->_cury;
+
+    switch (CharOf(ch)) {
+    case '\t':
+#if USE_REENTRANT
+	tabsize = *ptrTabsize(sp);
+#else
+	tabsize = TABSIZE;
+#endif
+	x = (NCURSES_SIZE_T) (x + (tabsize - (x % tabsize)));
+	/*
+	 * Space-fill the tab on the bottom line so that we'll get the
+	 * "correct" cursor position.
+	 */
+	if ((!win->_scroll && (y == win->_regbottom))
+	    || (x <= win->_maxx)) {
+	    cchar_t blank = blankchar;
+	    AddAttr(blank, AttrOf(ch));
+	    while (win->_curx < x) {
+		if (wadd_wch_literal(win, blank) == ERR)
+		    return (ERR);
+	    }
+	    break;
+	} else {
+	    wclrtoeol(win);
+	    win->_flags |= _WRAPPED;
+	    if (newline_forces_scroll(win, &y)) {
+		x = win->_maxx;
+		if (win->_scroll) {
+		    scroll(win);
+		    x = 0;
+		}
+	    } else {
+		x = 0;
+	    }
+	}
+	break;
+    case '\n':
+	wclrtoeol(win);
+	if (newline_forces_scroll(win, &y)) {
+	    if (win->_scroll)
+		scroll(win);
+	    else
+		return (ERR);
+	}
+	/* FALLTHRU */
+    case '\r':
+	x = 0;
+	win->_flags &= ~_WRAPPED;
+	break;
+    case '\b':
+	if (x == 0)
+	    return (OK);
+	x--;
+	win->_flags &= ~_WRAPPED;
+	break;
+    default:
+	if ((s = wunctrl(&ch)) != 0) {
+	    while (*s) {
+		cchar_t sch;
+		SetChar(sch, *s++, AttrOf(ch));
+		if_EXT_COLORS(SetPair(sch, GetPair(ch)));
+		if (wadd_wch_literal(win, sch) == ERR)
+		    return ERR;
+	    }
+	    return OK;
+	}
+	return ERR;
+    }
+
+    win->_curx = x;
+    win->_cury = y;
+
+    return OK;
+}
+
+/*
+ * The versions below call _nc_synchook().  We wanted to avoid this in the
+ * version exported for string puts; they'll call _nc_synchook once at end
+ * of run.
+ */
+
+/* These are actual entry points */
+
+NCURSES_EXPORT(int)
+wadd_wch(WINDOW *win, const cchar_t *wch)
+{
+    int code = ERR;
+
+    TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_CALLED("wadd_wch(%p, %s)"),
+				      (void *) win,
+				      _tracecchar_t(wch)));
+
+    if (win && (wadd_wch_nosync(win, *wch) != ERR)) {
+	_nc_synchook(win);
+	code = OK;
+    }
+
     TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_RETURN("%d"), code));
     return (code);
 }
@@ -77,37 +425,19 @@
 NCURSES_EXPORT(int)
 wecho_wchar(WINDOW *win, const cchar_t *wch)
 {
-    PUTC_DATA;
-    int n;
     int code = ERR;
 
-    TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_CALLED("wecho_wchar(%p, %s)"), win,
-				      _tracech_t(wch)));
-
-    if (win != 0) {
-	PUTC_INIT;
-	for (PUTC_i = 0; PUTC_i < CCHARW_MAX; ++PUTC_i) {
-	    attr_t attrs = (wch->attr & A_ATTRIBUTES);
-
-	    if ((PUTC_ch = wch->chars[PUTC_i]) == L'\0')
-		break;
-	    if ((PUTC_n = wcrtomb(PUTC_buf, PUTC_ch, &PUT_st)) <= 0) {
-		code = ERR;
-		if (is8bits(PUTC_ch))
-		    code = waddch(win, UChar(PUTC_ch) | attrs);
-		break;
-	    }
-	    for (n = 0; n < PUTC_n; n++) {
-		if ((code = waddch(win, UChar(PUTC_buf[n]) | attrs)) == ERR) {
-		    break;
-		}
-	    }
-	    if (code == ERR)
-		break;
-	}
-	wrefresh(win);
+    TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_CALLED("wechochar(%p, %s)"),
+				      (void *) win,
+				      _tracecchar_t(wch)));
+
+    if (win && (wadd_wch_nosync(win, *wch) != ERR)) {
+	bool save_immed = win->_immed;
+	win->_immed = TRUE;
+	_nc_synchook(win);
+	win->_immed = save_immed;
+	code = OK;
     }
-
     TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_RETURN("%d"), code));
     return (code);
 }
diff -Naur ncurses-5.7.orig/ncurses/widechar/lib_box_set.c ncurses-5.7/ncurses/widechar/lib_box_set.c
--- ncurses-5.7.orig/ncurses/widechar/lib_box_set.c	2003-12-06 13:02:13.000000000 -0500
+++ ncurses-5.7/ncurses/widechar/lib_box_set.c	2011-01-08 18:13:50.747157289 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2002 Free Software Foundation, Inc.                        *
+ * Copyright (c) 2002-2003,2009 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -39,7 +39,7 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_box_set.c,v 1.4 2003/12/06 18:02:13 tom Exp $")
+MODULE_ID("$Id: lib_box_set.c,v 1.5 2009/10/24 22:36:56 tom Exp $")
 
 NCURSES_EXPORT(int)
 wborder_set(WINDOW *win,
@@ -53,7 +53,7 @@
     NCURSES_CH_T wls, wrs, wts, wbs, wtl, wtr, wbl, wbr;
 
     T((T_CALLED("wborder(%p,%s,%s,%s,%s,%s,%s,%s,%s)"),
-       win,
+       (void *) win,
        _tracech_t2(1, ls),
        _tracech_t2(2, rs),
        _tracech_t2(3, ts),
diff -Naur ncurses-5.7.orig/ncurses/widechar/lib_cchar.c ncurses-5.7/ncurses/widechar/lib_cchar.c
--- ncurses-5.7.orig/ncurses/widechar/lib_cchar.c	2007-05-12 15:03:06.000000000 -0400
+++ ncurses-5.7/ncurses/widechar/lib_cchar.c	2011-01-08 18:18:29.754781633 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2001-2005,2007 Free Software Foundation, Inc.              *
+ * Copyright (c) 2001-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            *
@@ -35,7 +35,7 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_cchar.c,v 1.12 2007/05/12 19:03:06 tom Exp $")
+MODULE_ID("$Id: lib_cchar.c,v 1.20 2010/12/25 23:46:26 tom Exp $")
 
 /* 
  * The SuSv2 description leaves some room for interpretation.  We'll assume wch
@@ -50,15 +50,15 @@
 	 short color_pair,
 	 const void *opts)
 {
-    int i;
-    int len;
+    unsigned i;
+    unsigned len;
     int code = OK;
 
     TR(TRACE_CCALLS, (T_CALLED("setcchar(%p,%s,%lu,%d,%p)"),
-		      wcval, _nc_viswbuf(wch),
+		      (void *) wcval, _nc_viswbuf(wch),
 		      (unsigned long) attrs, color_pair, opts));
 
-    len = wcslen(wch);
+    len = (unsigned) wcslen(wch);
     if (opts != NULL
 	|| (len > 1 && wcwidth(wch[0]) < 0)) {
 	code = ERR;
@@ -80,7 +80,7 @@
 	memset(wcval, 0, sizeof(*wcval));
 
 	if (len != 0) {
-	    SetAttr(*wcval, attrs | COLOR_PAIR(color_pair));
+	    SetAttr(*wcval, attrs | (attr_t) ColorPair(color_pair));
 	    SetPair(CHDEREF(wcval), color_pair);
 	    memcpy(&wcval->chars, wch, len * sizeof(wchar_t));
 	    TR(TRACE_CCALLS, ("copy %d wchars, first is %s", len,
@@ -104,20 +104,28 @@
     int code = ERR;
 
     TR(TRACE_CCALLS, (T_CALLED("getcchar(%p,%p,%p,%p,%p)"),
-		      wcval, wch, attrs, color_pair, opts));
+		      (const void *) wcval,
+		      (void *) wch,
+		      (void *) attrs,
+		      (void *) color_pair,
+		      opts));
 
     if (opts == NULL) {
-	len = (wp = wmemchr(wcval->chars, L'\0', CCHARW_MAX))
-	    ? wp - wcval->chars
-	    : CCHARW_MAX;
+	len = ((wp = wmemchr(wcval->chars, L'\0', CCHARW_MAX))
+	       ? (int) (wp - wcval->chars)
+	       : CCHARW_MAX);
 
 	if (wch == NULL) {
-	    code = len;
+	    /*
+	     * If the value is a null, set the length to 1.
+	     * If the value is not a null, return the length plus 1 for null.
+	     */
+	    code = (len < CCHARW_MAX) ? (len + 1) : CCHARW_MAX;
 	} else if (attrs == 0 || color_pair == 0) {
 	    code = ERR;
 	} else if (len >= 0) {
 	    *attrs = AttrOf(*wcval) & A_ATTRIBUTES;
-	    *color_pair = GetPair(*wcval);
+	    *color_pair = (short) GetPair(*wcval);
 	    wmemcpy(wch, wcval->chars, (unsigned) len);
 	    wch[len] = L'\0';
 	    code = OK;
diff -Naur ncurses-5.7.orig/ncurses/widechar/lib_erasewchar.c ncurses-5.7/ncurses/widechar/lib_erasewchar.c
--- ncurses-5.7.orig/ncurses/widechar/lib_erasewchar.c	2002-05-11 16:38:06.000000000 -0400
+++ ncurses-5.7/ncurses/widechar/lib_erasewchar.c	2011-01-08 18:13:50.747157289 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2002 Free Software Foundation, Inc.                        *
+ * Copyright (c) 2002,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            *
@@ -32,7 +32,7 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_erasewchar.c,v 1.1 2002/05/11 20:38:06 tom Exp $")
+MODULE_ID("$Id: lib_erasewchar.c,v 1.2 2010/07/24 11:35:12 tom Exp $")
 
 /*
  *	erasewchar()
@@ -42,7 +42,7 @@
  */
 
 NCURSES_EXPORT(int)
-erasewchar(wchar_t * wch)
+erasewchar(wchar_t *wch)
 {
     int value;
     int result = ERR;
@@ -63,7 +63,7 @@
  */
 
 NCURSES_EXPORT(int)
-killwchar(wchar_t * wch)
+killwchar(wchar_t *wch)
 {
     int value;
     int result = ERR;
diff -Naur ncurses-5.7.orig/ncurses/widechar/lib_get_wch.c ncurses-5.7/ncurses/widechar/lib_get_wch.c
--- ncurses-5.7.orig/ncurses/widechar/lib_get_wch.c	2008-08-16 15:22:55.000000000 -0400
+++ ncurses-5.7/ncurses/widechar/lib_get_wch.c	2011-01-08 18:18:29.135406677 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2002-2007,2008 Free Software Foundation, Inc.              *
+ * Copyright (c) 2002-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            *
@@ -40,22 +40,7 @@
 #include <curses.priv.h>
 #include <ctype.h>
 
-MODULE_ID("$Id: lib_get_wch.c,v 1.17 2008/08/16 19:22:55 tom Exp $")
-
-#if HAVE_MBTOWC && HAVE_MBLEN
-#define reset_mbytes(state) mblen(NULL, 0), mbtowc(NULL, NULL, 0)
-#define count_mbytes(buffer,length,state) mblen(buffer,length)
-#define check_mbytes(wch,buffer,length,state) \
-	(int) mbtowc(&wch, buffer, length)
-#define state_unused
-#elif HAVE_MBRTOWC && HAVE_MBRLEN
-#define reset_mbytes(state) init_mb(state)
-#define count_mbytes(buffer,length,state) mbrlen(buffer,length,&state)
-#define check_mbytes(wch,buffer,length,state) \
-	(int) mbrtowc(&wch, buffer, length, &state)
-#else
-make an error
-#endif
+MODULE_ID("$Id: lib_get_wch.c,v 1.22 2010/08/28 21:00:35 tom Exp $")
 
 NCURSES_EXPORT(int)
 wget_wch(WINDOW *win, wint_t *result)
@@ -65,13 +50,13 @@
     char buffer[(MB_LEN_MAX * 9) + 1];	/* allow some redundant shifts */
     int status;
     size_t count = 0;
-    unsigned long value;
+    int value = 0;
     wchar_t wch;
 #ifndef state_unused
     mbstate_t state;
 #endif
 
-    T((T_CALLED("wget_wch(%p)"), win));
+    T((T_CALLED("wget_wch(%p)"), (void *) win));
 
     /*
      * We can get a stream of single-byte characters and KEY_xxx codes from
@@ -95,12 +80,12 @@
 		 * whether the improvement would be worth the effort.
 		 */
 		if (count != 0) {
-		    _nc_ungetch(sp, (int) value);
+		    safe_ungetch(SP_PARM, value);
 		    code = ERR;
 		}
 		break;
 	    } else if (count + 1 >= sizeof(buffer)) {
-		_nc_ungetch(sp, (int) value);
+		safe_ungetch(SP_PARM, value);
 		code = ERR;
 		break;
 	    } else {
@@ -111,7 +96,7 @@
 		    reset_mbytes(state);
 		    if (check_mbytes(wch, buffer, count, state) != status) {
 			code = ERR;	/* the two calls should match */
-			_nc_ungetch(sp, (int) value);
+			safe_ungetch(SP_PARM, value);
 		    }
 		    value = wch;
 		    break;
@@ -121,8 +106,8 @@
     } else {
 	code = ERR;
     }
-    *result = value;
+    *result = (wint_t) value;
     _nc_unlock_global(curses);
-    T(("result %#lo", value));
+    T(("result %#o", value));
     returnCode(code);
 }
diff -Naur ncurses-5.7.orig/ncurses/widechar/lib_get_wstr.c ncurses-5.7/ncurses/widechar/lib_get_wstr.c
--- ncurses-5.7.orig/ncurses/widechar/lib_get_wstr.c	2008-08-16 15:25:33.000000000 -0400
+++ ncurses-5.7/ncurses/widechar/lib_get_wstr.c	2011-01-08 18:13:50.747157289 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2002-2004,2008 Free Software Foundation, Inc.              *
+ * Copyright (c) 2002-2008,2009 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -38,9 +38,8 @@
 */
 
 #include <curses.priv.h>
-#include <term.h>
 
-MODULE_ID("$Id: lib_get_wstr.c,v 1.10 2008/08/16 19:25:33 tom Exp $")
+MODULE_ID("$Id: lib_get_wstr.c,v 1.12 2009/10/24 22:38:11 tom Exp $")
 
 static int
 wadd_wint(WINDOW *win, wint_t *src)
@@ -96,7 +95,7 @@
     wint_t ch;
     int y, x, code;
 
-    T((T_CALLED("wgetn_wstr(%p,%p, %d)"), win, str, maxlen));
+    T((T_CALLED("wgetn_wstr(%p,%p, %d)"), (void *) win, (void *) str, maxlen));
 
     if (!win)
 	returnCode(ERR);
diff -Naur ncurses-5.7.orig/ncurses/widechar/lib_hline_set.c ncurses-5.7/ncurses/widechar/lib_hline_set.c
--- ncurses-5.7.orig/ncurses/widechar/lib_hline_set.c	2002-03-23 16:35:34.000000000 -0500
+++ ncurses-5.7/ncurses/widechar/lib_hline_set.c	2011-01-08 18:18:29.758781839 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2002 Free Software Foundation, Inc.                        *
+ * Copyright (c) 2002-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            *
@@ -39,16 +39,16 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_hline_set.c,v 1.2 2002/03/23 21:35:34 tom Exp $")
+MODULE_ID("$Id: lib_hline_set.c,v 1.4 2010/12/19 01:45:03 tom Exp $")
 
 NCURSES_EXPORT(int)
-whline_set(WINDOW *win, const cchar_t * ch, int n)
+whline_set(WINDOW *win, const cchar_t *ch, int n)
 {
     int code = ERR;
-    NCURSES_SIZE_T start;
-    NCURSES_SIZE_T end;
+    int start;
+    int end;
 
-    T((T_CALLED("whline_set(%p,%s,%d)"), win, _tracecchar_t(ch), n));
+    T((T_CALLED("whline_set(%p,%s,%d)"), (void *) win, _tracecchar_t(ch), n));
 
     if (win) {
 	struct ldat *line = &(win->_line[win->_cury]);
diff -Naur ncurses-5.7.orig/ncurses/widechar/lib_in_wch.c ncurses-5.7/ncurses/widechar/lib_in_wch.c
--- ncurses-5.7.orig/ncurses/widechar/lib_in_wch.c	2006-09-03 11:41:22.000000000 -0400
+++ ncurses-5.7/ncurses/widechar/lib_in_wch.c	2011-01-08 18:13:50.747157289 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2002-2004,2006 Free Software Foundation, Inc.              *
+ * Copyright (c) 2002-2006,2009 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -39,7 +39,7 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_in_wch.c,v 1.4 2006/09/03 15:41:22 tom Exp $")
+MODULE_ID("$Id: lib_in_wch.c,v 1.5 2009/10/24 22:37:55 tom Exp $")
 
 NCURSES_EXPORT(int)
 win_wch(WINDOW *win, cchar_t *wcval)
@@ -47,7 +47,7 @@
     int row, col;
     int code = OK;
 
-    TR(TRACE_CCALLS, (T_CALLED("win_wch(%p,%p)"), win, wcval));
+    TR(TRACE_CCALLS, (T_CALLED("win_wch(%p,%p)"), (void *) win, (void *) wcval));
     if (win != 0
 	&& wcval != 0) {
 	getyx(win, row, col);
diff -Naur ncurses-5.7.orig/ncurses/widechar/lib_in_wchnstr.c ncurses-5.7/ncurses/widechar/lib_in_wchnstr.c
--- ncurses-5.7.orig/ncurses/widechar/lib_in_wchnstr.c	2007-02-10 20:00:00.000000000 -0500
+++ ncurses-5.7/ncurses/widechar/lib_in_wchnstr.c	2011-01-08 18:13:50.747157289 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2002-2004-2007 Free Software Foundation, Inc.              *
+ * Copyright (c) 2002-2007,2009 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -39,14 +39,14 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_in_wchnstr.c,v 1.7 2007/02/11 01:00:00 tom Exp $")
+MODULE_ID("$Id: lib_in_wchnstr.c,v 1.8 2009/10/24 22:37:48 tom Exp $")
 
 NCURSES_EXPORT(int)
 win_wchnstr(WINDOW *win, cchar_t *wchstr, int n)
 {
     int code = OK;
 
-    T((T_CALLED("win_wchnstr(%p,%p,%d)"), win, wchstr, n));
+    T((T_CALLED("win_wchnstr(%p,%p,%d)"), (void *) win, (void *) wchstr, n));
     if (win != 0
 	&& wchstr != 0) {
 	NCURSES_CH_T *src;
diff -Naur ncurses-5.7.orig/ncurses/widechar/lib_ins_wch.c ncurses-5.7/ncurses/widechar/lib_ins_wch.c
--- ncurses-5.7.orig/ncurses/widechar/lib_ins_wch.c	2005-12-03 15:24:19.000000000 -0500
+++ ncurses-5.7/ncurses/widechar/lib_ins_wch.c	2011-01-08 18:18:29.758781839 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2002-2003,2005 Free Software Foundation, Inc.              *
+ * Copyright (c) 2002-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            *
@@ -39,39 +39,44 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_ins_wch.c,v 1.8 2005/12/03 20:24:19 tom Exp $")
+MODULE_ID("$Id: lib_ins_wch.c,v 1.16 2010/12/19 01:34:04 tom Exp $")
 
 /*
  * Insert the given character, updating the current location to simplify
  * inserting a string.
  */
-static int
+NCURSES_EXPORT(int)
 _nc_insert_wch(WINDOW *win, const cchar_t *wch)
 {
     int cells = wcwidth(CharOf(CHDEREF(wch)));
     int cell;
+    int code = OK;
 
-    if (cells <= 0)
-	cells = 1;
+    if (cells < 0) {
+	code = winsch(win, (chtype) CharOf(CHDEREF(wch)));
+    } else {
+	if (cells == 0)
+	    cells = 1;
+
+	if (win->_curx <= win->_maxx) {
+	    struct ldat *line = &(win->_line[win->_cury]);
+	    NCURSES_CH_T *end = &(line->text[win->_curx]);
+	    NCURSES_CH_T *temp1 = &(line->text[win->_maxx]);
+	    NCURSES_CH_T *temp2 = temp1 - cells;
+
+	    CHANGED_TO_EOL(line, win->_curx, win->_maxx);
+	    while (temp1 > end)
+		*temp1-- = *temp2--;
+
+	    *temp1 = _nc_render(win, *wch);
+	    for (cell = 1; cell < cells; ++cell) {
+		SetWidecExt(temp1[cell], cell);
+	    }
 
-    if (win->_curx <= win->_maxx) {
-	struct ldat *line = &(win->_line[win->_cury]);
-	NCURSES_CH_T *end = &(line->text[win->_curx]);
-	NCURSES_CH_T *temp1 = &(line->text[win->_maxx]);
-	NCURSES_CH_T *temp2 = temp1 - cells;
-
-	CHANGED_TO_EOL(line, win->_curx, win->_maxx);
-	while (temp1 > end)
-	    *temp1-- = *temp2--;
-
-	*temp1 = _nc_render(win, *wch);
-	for (cell = 1; cell < cells; ++cell) {
-	    SetWidecExt(temp1[cell], cell);
+	    win->_curx++;
 	}
-
-	win->_curx++;
     }
-    return OK;
+    return code;
 }
 
 NCURSES_EXPORT(int)
@@ -81,7 +86,7 @@
     NCURSES_SIZE_T ox;
     int code = ERR;
 
-    T((T_CALLED("wins_wch(%p, %s)"), win, _tracecchar_t(wch)));
+    T((T_CALLED("wins_wch(%p, %s)"), (void *) win, _tracecchar_t(wch)));
 
     if (win != 0) {
 	oy = win->_cury;
@@ -104,20 +109,23 @@
     NCURSES_SIZE_T ox;
     const wchar_t *cp;
 
-    T((T_CALLED("wins_nwstr(%p,%s,%d)"), win, _nc_viswbufn(wstr, n), n));
+    T((T_CALLED("wins_nwstr(%p,%s,%d)"),
+       (void *) win, _nc_viswbufn(wstr, n), n));
 
     if (win != 0
 	&& wstr != 0) {
 	if (n < 1)
-	    n = wcslen(wstr);
+	    n = (int) wcslen(wstr);
 	code = OK;
 	if (n > 0) {
+	    SCREEN *sp = _nc_screen_of(win);
+
 	    oy = win->_cury;
 	    ox = win->_curx;
 	    for (cp = wstr; *cp && ((cp - wstr) < n); cp++) {
 		int len = wcwidth(*cp);
 
-		if (len != 1 || !is8bits(*cp)) {
+		if ((len >= 0 && len != 1) || !is7bits(*cp)) {
 		    cchar_t tmp_cchar;
 		    wchar_t tmp_wchar = *cp;
 		    memset(&tmp_cchar, 0, sizeof(tmp_cchar));
@@ -129,7 +137,7 @@
 		    code = _nc_insert_wch(win, &tmp_cchar);
 		} else {
 		    /* tabs, other ASCII stuff */
-		    code = _nc_insert_ch(win, (chtype) (*cp));
+		    code = _nc_insert_ch(sp, win, (chtype) (*cp));
 		}
 		if (code != OK)
 		    break;
diff -Naur ncurses-5.7.orig/ncurses/widechar/lib_inwstr.c ncurses-5.7/ncurses/widechar/lib_inwstr.c
--- ncurses-5.7.orig/ncurses/widechar/lib_inwstr.c	2004-10-23 16:41:28.000000000 -0400
+++ ncurses-5.7/ncurses/widechar/lib_inwstr.c	2011-01-08 18:13:50.751157371 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2002,2004 Free Software Foundation, Inc.                   *
+ * Copyright (c) 2002-2004,2009 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -39,7 +39,7 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_inwstr.c,v 1.4 2004/10/23 20:41:28 tom Exp $")
+MODULE_ID("$Id: lib_inwstr.c,v 1.5 2009/10/24 22:37:29 tom Exp $")
 
 NCURSES_EXPORT(int)
 winnwstr(WINDOW *win, wchar_t *wstr, int n)
@@ -50,7 +50,7 @@
     cchar_t *text;
     wchar_t wch;
 
-    T((T_CALLED("winnwstr(%p,%p,%d)"), win, wstr, n));
+    T((T_CALLED("winnwstr(%p,%p,%d)"), (void *) win, (void *) wstr, n));
     if (wstr != 0) {
 	if (win) {
 	    getyx(win, row, col);
@@ -93,7 +93,7 @@
 winwstr(WINDOW *win, wchar_t *wstr)
 {
     int result = OK;
-    T((T_CALLED("winwstr(%p,%p)"), win, wstr));
+    T((T_CALLED("winwstr(%p,%p)"), (void *) win, (void *) wstr));
     if (winnwstr(win, wstr, CCHARW_MAX * (win->_maxx - win->_curx + 1)) == ERR)
 	result = ERR;
     returnCode(result);
diff -Naur ncurses-5.7.orig/ncurses/widechar/lib_pecho_wchar.c ncurses-5.7/ncurses/widechar/lib_pecho_wchar.c
--- ncurses-5.7.orig/ncurses/widechar/lib_pecho_wchar.c	2004-01-03 16:42:01.000000000 -0500
+++ ncurses-5.7/ncurses/widechar/lib_pecho_wchar.c	2011-01-08 18:13:50.751157371 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2004 Free Software Foundation, Inc.                        *
+ * Copyright (c) 2004,2009 Free Software Foundation, Inc.                   *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -32,12 +32,12 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_pecho_wchar.c,v 1.1 2004/01/03 21:42:01 tom Exp $")
+MODULE_ID("$Id: lib_pecho_wchar.c,v 1.2 2009/10/24 22:43:32 tom Exp $")
 
 NCURSES_EXPORT(int)
-pecho_wchar(WINDOW *pad, const cchar_t * wch)
+pecho_wchar(WINDOW *pad, const cchar_t *wch)
 {
-    T((T_CALLED("pecho_wchar(%p, %s)"), pad, _tracech_t(wch)));
+    T((T_CALLED("pecho_wchar(%p, %s)"), (void *) pad, _tracech_t(wch)));
 
     if (pad == 0)
 	returnCode(ERR);
diff -Naur ncurses-5.7.orig/ncurses/widechar/lib_unget_wch.c ncurses-5.7/ncurses/widechar/lib_unget_wch.c
--- ncurses-5.7.orig/ncurses/widechar/lib_unget_wch.c	2008-06-07 10:50:37.000000000 -0400
+++ ncurses-5.7/ncurses/widechar/lib_unget_wch.c	2011-01-08 18:13:50.751157371 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2002-2007,2008 Free Software Foundation, Inc.              *
+ * Copyright (c) 2002-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            *
@@ -39,7 +39,7 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_unget_wch.c,v 1.10 2008/06/07 14:50:37 tom Exp $")
+MODULE_ID("$Id: lib_unget_wch.c,v 1.14 2010/07/24 11:35:21 tom Exp $")
 
 /*
  * Wrapper for wcrtomb() which obtains the length needed for the given
@@ -55,24 +55,24 @@
 	const wchar_t *tempp = temp;
 	temp[0] = source;
 	temp[1] = 0;
-	result = wcsrtombs(NULL, &tempp, 0, state);
+	result = (int) wcsrtombs(NULL, &tempp, 0, state);
     } else {
-	result = wcrtomb(target, source, state);
+	result = (int) wcrtomb(target, source, state);
     }
     if (!isEILSEQ(result) && (result == 0))
 	result = 1;
-    return result;
+    return (size_t) result;
 }
 
 NCURSES_EXPORT(int)
-unget_wch(const wchar_t wch)
+NCURSES_SP_NAME(unget_wch) (NCURSES_SP_DCLx const wchar_t wch)
 {
     int result = OK;
     mbstate_t state;
     size_t length;
     int n;
 
-    T((T_CALLED("unget_wch(%#lx)"), (unsigned long) wch));
+    T((T_CALLED("unget_wch(%p, %#lx)"), (void *) SP_PARM, (unsigned long) wch));
 
     init_mb(state);
     length = _nc_wcrtomb(0, wch, &state);
@@ -83,10 +83,12 @@
 
 	if ((string = (char *) malloc(length)) != 0) {
 	    init_mb(state);
-	    wcrtomb(string, wch, &state);
+	    /* ignore the result, since we already validated the character */
+	    IGNORE_RC((int) wcrtomb(string, wch, &state));
 
 	    for (n = (int) (length - 1); n >= 0; --n) {
-		if (_nc_ungetch(SP, string[n]) != OK) {
+		if (NCURSES_SP_NAME(ungetch) (NCURSES_SP_ARGx
+					      UChar(string[n])) !=OK) {
 		    result = ERR;
 		    break;
 		}
@@ -101,3 +103,11 @@
 
     returnCode(result);
 }
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+unget_wch(const wchar_t wch)
+{
+    return NCURSES_SP_NAME(unget_wch) (CURRENT_SCREEN, wch);
+}
+#endif
diff -Naur ncurses-5.7.orig/ncurses/widechar/lib_vid_attr.c ncurses-5.7/ncurses/widechar/lib_vid_attr.c
--- ncurses-5.7.orig/ncurses/widechar/lib_vid_attr.c	2007-06-30 18:03:02.000000000 -0400
+++ ncurses-5.7/ncurses/widechar/lib_vid_attr.c	2011-01-08 18:18:29.770800767 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2002-2006,2007 Free Software Foundation, Inc.              *
+ * Copyright (c) 2002-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            *
@@ -31,11 +31,14 @@
  ****************************************************************************/
 
 #include <curses.priv.h>
-#include <term.h>
 
-MODULE_ID("$Id: lib_vid_attr.c,v 1.5 2007/06/30 22:03:02 tom Exp $")
+#ifndef CUR
+#define CUR SP_TERMTYPE
+#endif
+
+MODULE_ID("$Id: lib_vid_attr.c,v 1.14 2010/12/19 01:44:24 tom Exp $")
 
-#define doPut(mode) TPUTS_TRACE(#mode); tputs(mode, 1, outc)
+#define doPut(mode) TPUTS_TRACE(#mode); NCURSES_SP_NAME(tputs)(NCURSES_SP_ARGx mode, 1, outc)
 
 #define TurnOn(mask,mode) \
 	if ((turn_on & mask) && mode) { doPut(mode); }
@@ -50,14 +53,22 @@
 		if ((pair != old_pair) \
 		 || (fix_pair0 && (pair == 0)) \
 		 || (reverse ^ ((old_attr & A_REVERSE) != 0))) { \
-			_nc_do_color(old_pair, pair, reverse, outc); \
+		    NCURSES_SP_NAME(_nc_do_color) (NCURSES_SP_ARGx \
+						   old_pair, pair, \
+						   reverse, outc); \
 		} \
 	}
 
-#define set_color(mode, pair) mode &= ALL_BUT_COLOR; mode |= COLOR_PAIR(pair)
+#define set_color(mode, pair) \
+	mode &= ALL_BUT_COLOR; \
+	mode |= (attr_t) ColorPair(pair)
 
 NCURSES_EXPORT(int)
-vid_puts(attr_t newmode, short pair, void *opts GCC_UNUSED, int (*outc) (int))
+NCURSES_SP_NAME(vid_puts) (NCURSES_SP_DCLx
+			   attr_t newmode,
+			   short pair,
+			   void *opts GCC_UNUSED,
+			   NCURSES_SP_OUTC outc)
 {
 #if NCURSES_EXT_COLORS
     static attr_t previous_attr = A_NORMAL;
@@ -65,9 +76,9 @@
 
     attr_t turn_on, turn_off;
     bool reverse = FALSE;
-    bool can_color = (SP == 0 || SP->_coloron);
+    bool can_color = (SP_PARM == 0 || SP_PARM->_coloron);
 #if NCURSES_EXT_FUNCS
-    bool fix_pair0 = (SP != 0 && SP->_coloron && !SP->_default_color);
+    bool fix_pair0 = (SP_PARM != 0 && SP_PARM->_coloron && !SP_PARM->_default_color);
 #else
 #define fix_pair0 FALSE
 #endif
@@ -76,18 +87,18 @@
     T((T_CALLED("vid_puts(%s,%d)"), _traceattr(newmode), pair));
 
     /* this allows us to go on whether or not newterm() has been called */
-    if (SP) {
-	previous_attr = AttrOf(SCREEN_ATTRS(SP));
-	previous_pair = GetPair(SCREEN_ATTRS(SP));
+    if (SP_PARM) {
+	previous_attr = AttrOf(SCREEN_ATTRS(SP_PARM));
+	previous_pair = GetPair(SCREEN_ATTRS(SP_PARM));
     }
 
     TR(TRACE_ATTRS, ("previous attribute was %s, %d",
 		     _traceattr(previous_attr), previous_pair));
 
 #if !USE_XMC_SUPPORT
-    if ((SP != 0)
+    if ((SP_PARM != 0)
 	&& (magic_cookie_glitch > 0))
-	newmode &= ~(SP->_xmc_suppress);
+	newmode &= ~(SP_PARM->_xmc_suppress);
 #endif
 
     /*
@@ -144,10 +155,10 @@
 	    if (exit_attribute_mode) {
 		doPut(exit_attribute_mode);
 	    } else {
-		if (!SP || SP->_use_rmul) {
+		if (!SP_PARM || SP_PARM->_use_rmul) {
 		    TurnOff(A_UNDERLINE, exit_underline_mode);
 		}
-		if (!SP || SP->_use_rmso) {
+		if (!SP_PARM || SP_PARM->_use_rmso) {
 		    TurnOff(A_STANDOUT, exit_standout_mode);
 		}
 	    }
@@ -159,16 +170,18 @@
     } else if (set_attributes) {
 	if (turn_on || turn_off) {
 	    TPUTS_TRACE("set_attributes");
-	    tputs(TPARM_9(set_attributes,
-			  (newmode & A_STANDOUT) != 0,
-			  (newmode & A_UNDERLINE) != 0,
-			  (newmode & A_REVERSE) != 0,
-			  (newmode & A_BLINK) != 0,
-			  (newmode & A_DIM) != 0,
-			  (newmode & A_BOLD) != 0,
-			  (newmode & A_INVIS) != 0,
-			  (newmode & A_PROTECT) != 0,
-			  (newmode & A_ALTCHARSET) != 0), 1, outc);
+	    NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx
+				    TPARM_9(set_attributes,
+					    (newmode & A_STANDOUT) != 0,
+					    (newmode & A_UNDERLINE) != 0,
+					    (newmode & A_REVERSE) != 0,
+					    (newmode & A_BLINK) != 0,
+					    (newmode & A_DIM) != 0,
+					    (newmode & A_BOLD) != 0,
+					    (newmode & A_INVIS) != 0,
+					    (newmode & A_PROTECT) != 0,
+					    (newmode & A_ALTCHARSET) != 0),
+				    1, outc);
 	    previous_attr &= ALL_BUT_COLOR;
 	    previous_pair = 0;
 	}
@@ -179,11 +192,11 @@
 
 	TurnOff(A_ALTCHARSET, exit_alt_charset_mode);
 
-	if (!SP || SP->_use_rmul) {
+	if (!SP_PARM || SP_PARM->_use_rmul) {
 	    TurnOff(A_UNDERLINE, exit_underline_mode);
 	}
 
-	if (!SP || SP->_use_rmso) {
+	if (!SP_PARM || SP_PARM->_use_rmso) {
 	    TurnOff(A_STANDOUT, exit_standout_mode);
 	}
 
@@ -221,9 +234,9 @@
     if (reverse)
 	newmode |= A_REVERSE;
 
-    if (SP) {
-	SetAttr(SCREEN_ATTRS(SP), newmode);
-	SetPair(SCREEN_ATTRS(SP), pair);
+    if (SP_PARM) {
+	SetAttr(SCREEN_ATTRS(SP_PARM), newmode);
+	SetPair(SCREEN_ATTRS(SP_PARM), pair);
     } else {
 	previous_attr = newmode;
 	previous_pair = pair;
@@ -233,29 +246,60 @@
 #else
     T((T_CALLED("vid_puts(%s,%d)"), _traceattr(newmode), pair));
     set_color(newmode, pair);
-    returnCode(vidputs(newmode, outc));
+    returnCode(NCURSES_SP_NAME(vidputs) (NCURSES_SP_ARGx newmode, outc));
 #endif
 }
 
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+vid_puts(attr_t newmode,
+	 short pair,
+	 void *opts GCC_UNUSED,
+	 NCURSES_OUTC outc)
+{
+    SetSafeOutcWrapper(outc);
+    return NCURSES_SP_NAME(vid_puts) (CURRENT_SCREEN,
+				      newmode,
+				      pair,
+				      opts,
+				      _nc_outc_wrapper);
+}
+#endif
+
 #undef vid_attr
 NCURSES_EXPORT(int)
-vid_attr(attr_t newmode, short pair, void *opts)
+NCURSES_SP_NAME(vid_attr) (NCURSES_SP_DCLx
+			   attr_t newmode,
+			   short pair,
+			   void *opts)
 {
     T((T_CALLED("vid_attr(%s,%d)"), _traceattr(newmode), pair));
-    returnCode(vid_puts(newmode, pair, opts, _nc_outch));
+    returnCode(NCURSES_SP_NAME(vid_puts) (NCURSES_SP_ARGx
+					  newmode,
+					  pair,
+					  opts,
+					  NCURSES_SP_NAME(_nc_outch)));
 }
 
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+vid_attr(attr_t newmode, short pair, void *opts)
+{
+    return NCURSES_SP_NAME(vid_attr) (CURRENT_SCREEN, newmode, pair, opts);
+}
+#endif
+
 /*
  * This implementation uses the same mask values for A_xxx and WA_xxx, so
  * we can use termattrs() for part of the logic.
  */
 NCURSES_EXPORT(attr_t)
-term_attrs(void)
+NCURSES_SP_NAME(term_attrs) (NCURSES_SP_DCL0)
 {
     attr_t attrs;
 
     T((T_CALLED("term_attrs()")));
-    attrs = termattrs();
+    attrs = SP_PARM ? NCURSES_SP_NAME(termattrs) (NCURSES_SP_ARG) : 0;
 
     /* these are only supported for wide-character mode */
     if (enter_horizontal_hl_mode)
@@ -273,3 +317,11 @@
 
     returnAttr(attrs);
 }
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(attr_t)
+term_attrs(void)
+{
+    return NCURSES_SP_NAME(term_attrs) (CURRENT_SCREEN);
+}
+#endif
diff -Naur ncurses-5.7.orig/ncurses/widechar/lib_vline_set.c ncurses-5.7/ncurses/widechar/lib_vline_set.c
--- ncurses-5.7.orig/ncurses/widechar/lib_vline_set.c	2002-03-23 16:36:01.000000000 -0500
+++ ncurses-5.7/ncurses/widechar/lib_vline_set.c	2011-01-08 18:18:29.770800767 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2002 Free Software Foundation, Inc.                        *
+ * Copyright (c) 2002-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            *
@@ -39,16 +39,16 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_vline_set.c,v 1.2 2002/03/23 21:36:01 tom Exp $")
+MODULE_ID("$Id: lib_vline_set.c,v 1.4 2010/12/19 01:50:50 tom Exp $")
 
 NCURSES_EXPORT(int)
-wvline_set(WINDOW *win, const cchar_t * ch, int n)
+wvline_set(WINDOW *win, const cchar_t *ch, int n)
 {
     int code = ERR;
-    NCURSES_SIZE_T row, col;
-    NCURSES_SIZE_T end;
+    int row, col;
+    int end;
 
-    T((T_CALLED("wvline(%p,%s,%d)"), win, _tracecchar_t(ch), n));
+    T((T_CALLED("wvline(%p,%s,%d)"), (void *) win, _tracecchar_t(ch), n));
 
     if (win) {
 	NCURSES_CH_T wch;
diff -Naur ncurses-5.7.orig/ncurses/widechar/lib_wacs.c ncurses-5.7/ncurses/widechar/lib_wacs.c
--- ncurses-5.7.orig/ncurses/widechar/lib_wacs.c	2006-12-17 10:16:17.000000000 -0500
+++ ncurses-5.7/ncurses/widechar/lib_wacs.c	2011-01-08 18:18:29.774782290 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2002,2006 Free Software Foundation, Inc.                   *
+ * Copyright (c) 2002-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            *
@@ -31,9 +31,8 @@
  ****************************************************************************/
 
 #include <curses.priv.h>
-#include <term.h>
 
-MODULE_ID("$Id: lib_wacs.c,v 1.7 2006/12/17 15:16:17 tom Exp $")
+MODULE_ID("$Id: lib_wacs.c,v 1.10 2010/12/19 01:43:19 tom Exp $")
 
 NCURSES_EXPORT_VAR(cchar_t) * _nc_wacs = 0;
 
@@ -42,7 +41,7 @@
 {
     /* *INDENT-OFF* */
     static const struct {
-	int	map;
+	unsigned map;
 	int	value[2];
     } table[] = {
 	/* VT100 symbols */
@@ -80,6 +79,30 @@
 	{ '{',	{ '*',	0x03c0 }},	/* greek pi */
 	{ '|',	{ '!',	0x2260 }},	/* not-equal */
 	{ '}',	{ 'f',	0x00a3 }},	/* pound-sterling symbol */
+	/* thick-line-drawing */
+	{ 'L',	{ '+',	0x250f }},	/* upper left corner */
+	{ 'M',	{ '+',	0x2517 }},	/* lower left corner */
+	{ 'K',	{ '+',	0x2513 }},	/* upper right corner */
+	{ 'J',	{ '+',	0x251b }},	/* lower right corner */
+	{ 'T',	{ '+',	0x2523 }},	/* tee pointing left */
+	{ 'U',	{ '+',	0x252b }},	/* tee pointing right */
+	{ 'V',	{ '+',	0x253b }},	/* tee pointing up */
+	{ 'W',	{ '+',	0x2533 }},	/* tee pointing down */
+	{ 'Q',	{ '-',	0x2501 }},	/* horizontal line */
+	{ 'X',	{ '|',	0x2503 }},	/* vertical line */
+	{ 'N',	{ '+',	0x254b }},	/* large plus or crossover */
+	/* double-line-drawing */
+	{ 'C',	{ '+',	0x2554 }},	/* upper left corner */
+	{ 'D',	{ '+',	0x255a }},	/* lower left corner */
+	{ 'B',	{ '+',	0x2557 }},	/* upper right corner */
+	{ 'A',	{ '+',	0x255d }},	/* lower right corner */
+	{ 'G',	{ '+',	0x2563 }},	/* tee pointing left */
+	{ 'F',	{ '+',	0x2560 }},	/* tee pointing right */
+	{ 'H',	{ '+',	0x2569 }},	/* tee pointing up */
+	{ 'I',	{ '+',	0x2566 }},	/* tee pointing down */
+	{ 'R',	{ '-',	0x2550 }},	/* horizontal line */
+	{ 'Y',	{ '|',	0x2551 }},	/* vertical line */
+	{ 'E',	{ '+',	0x256c }},	/* large plus or crossover */
     };
     /* *INDENT-ON* */
 
diff -Naur ncurses-5.7.orig/ncurses/widechar/lib_wunctrl.c ncurses-5.7/ncurses/widechar/lib_wunctrl.c
--- ncurses-5.7.orig/ncurses/widechar/lib_wunctrl.c	2007-06-12 16:22:32.000000000 -0400
+++ ncurses-5.7/ncurses/widechar/lib_wunctrl.c	2011-01-08 18:18:29.774782290 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2001-2005,2007 Free Software Foundation, Inc.              *
+ * Copyright (c) 2001-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            *
@@ -35,21 +35,31 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_wunctrl.c,v 1.12 2007/06/12 20:22:32 tom Exp $")
+MODULE_ID("$Id: lib_wunctrl.c,v 1.14 2010/12/19 01:42:15 tom Exp $")
 
 NCURSES_EXPORT(wchar_t *)
-wunctrl(cchar_t *wc)
+NCURSES_SP_NAME(wunctrl) (NCURSES_SP_DCLx cchar_t *wc)
 {
-    static wchar_t str[CCHARW_MAX + 1], *sp;
+    static wchar_t str[CCHARW_MAX + 1], *wsp;
 
     if (Charable(*wc)) {
-	const char *p = unctrl((unsigned) _nc_to_char((wint_t) CharOf(*wc)));
+	const char *p =
+	NCURSES_SP_NAME(unctrl) (NCURSES_SP_ARGx
+				 (unsigned) _nc_to_char((wint_t)CharOf(*wc)));
 
-	for (sp = str; *p; ++p) {
-	    *sp++ = _nc_to_widechar(*p);
+	for (wsp = str; *p; ++p) {
+	    *wsp++ = (wchar_t) _nc_to_widechar(*p);
 	}
-	*sp = 0;
+	*wsp = 0;
 	return str;
     } else
 	return wc->chars;
 }
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(wchar_t *)
+wunctrl(cchar_t *wc)
+{
+    return NCURSES_SP_NAME(wunctrl) (CURRENT_SCREEN, wc);
+}
+#endif
diff -Naur ncurses-5.7.orig/ncurses/win32con/gettimeofday.c ncurses-5.7/ncurses/win32con/gettimeofday.c
--- ncurses-5.7.orig/ncurses/win32con/gettimeofday.c	1969-12-31 19:00:00.000000000 -0500
+++ ncurses-5.7/ncurses/win32con/gettimeofday.c	2011-01-08 18:13:50.751157371 -0500
@@ -0,0 +1,51 @@
+/****************************************************************************
+ * 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            *
+ * "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.                                                           *
+ ****************************************************************************/
+
+#define WINVER 0x0501
+
+#include <curses.priv.h>
+
+#include <windows.h>
+
+MODULE_ID("$Id: gettimeofday.c,v 1.2 2010/01/16 15:18:51 tom Exp $")
+
+#define JAN1970 116444736000000000LL	/* the value for 01/01/1970 00:00 */
+
+int
+gettimeofday(struct timeval *tv, void *tz GCC_UNUSED)
+{
+    union {
+	FILETIME ft;
+	long long since1601;	/* time since 1 Jan 1601 in 100ns units */
+    } data;
+
+    GetSystemTimeAsFileTime(&data.ft);
+    tv->tv_usec = (long) ((data.since1601 / 10LL) % 1000000LL);
+    tv->tv_sec = (long) ((data.since1601 - JAN1970) / 10000000LL);
+    return (0);
+}
diff -Naur ncurses-5.7.orig/ncurses/win32con/wcwidth.c ncurses-5.7/ncurses/win32con/wcwidth.c
--- ncurses-5.7.orig/ncurses/win32con/wcwidth.c	1969-12-31 19:00:00.000000000 -0500
+++ ncurses-5.7/ncurses/win32con/wcwidth.c	2011-01-08 18:18:29.079036539 -0500
@@ -0,0 +1,50 @@
+/****************************************************************************
+ * 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.                                                           *
+ ****************************************************************************/
+#include <curses.priv.h>
+
+MODULE_ID("$Id: wcwidth.c,v 1.2 2010/08/07 20:52:43 tom Exp $")
+
+#if USE_WIDEC_SUPPORT
+#define mk_wcwidth(ucs)          _nc_wcwidth(ucs)
+#define mk_wcswidth(pwcs, n)     _nc_wcswidth(pwcs, n)
+#define mk_wcwidth_cjk(ucs)      _nc_wcwidth_cjk(ucs)
+#define mk_wcswidth_cjk(pwcs, n) _nc_wcswidth_cjk(pwcs, n)
+
+extern int mk_wcwidth(wchar_t);
+extern int mk_wcswidth(const wchar_t *, size_t);
+extern int mk_wcwidth_cjk(wchar_t);
+extern int mk_wcswidth_cjk(const wchar_t *, size_t);
+
+#include <wcwidth.h>
+#else
+void _nc_empty_wcwidth(void);
+void
+_nc_empty_wcwidth(void)
+{
+}
+#endif
diff -Naur ncurses-5.7.orig/ncurses/win32con/win_driver.c ncurses-5.7/ncurses/win32con/win_driver.c
--- ncurses-5.7.orig/ncurses/win32con/win_driver.c	1969-12-31 19:00:00.000000000 -0500
+++ ncurses-5.7/ncurses/win32con/win_driver.c	2011-01-08 18:18:29.774782290 -0500
@@ -0,0 +1,1241 @@
+/****************************************************************************
+ * 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            *
+ * "Software"), to deal in the Software without restriction, including      *
+ * without limitation the rights to use, copy, modify, merge, publish,      *
+ * distribute, distribute with modifications, sublicense, and/or sell       *
+ * copies of the Software, and to permit persons to whom the Software is    *
+ * furnished to do so, subject to the following conditions:                 *
+ *                                                                          *
+ * The above copyright notice and this permission notice shall be included  *
+ * in all copies or substantial portions of the Software.                   *
+ *                                                                          *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
+ *                                                                          *
+ * Except as contained in this notice, the name(s) of the above copyright   *
+ * holders shall not be used in advertising or otherwise to promote the     *
+ * sale, use or other dealings in this Software without prior written       *
+ * authorization.                                                           *
+ ****************************************************************************/
+
+/****************************************************************************
+ *  Author: Juergen Pfeifer                                                 *
+ *                                                                          *
+ ****************************************************************************/
+
+/*
+ * TODO - GetMousePos(POINT * result) from ntconio.c
+ * TODO - implement nodelay
+ */
+
+#include <curses.priv.h>
+#define CUR my_term.type.
+
+MODULE_ID("$Id: win_driver.c,v 1.10 2010/12/25 19:28:21 tom Exp $")
+
+#define WINMAGIC NCDRV_MAGIC(NCDRV_WINCONSOLE)
+
+#define AssertTCB() assert(TCB!=0 && TCB->magic==WINMAGIC)
+#define SetSP() assert(TCB->csp!=0); sp = TCB->csp
+
+#define GenMap(vKey,key) MAKELONG(key, vKey)
+
+static const LONG keylist[] =
+{
+    GenMap(VK_PRIOR, KEY_PPAGE),
+    GenMap(VK_NEXT, KEY_NPAGE),
+    GenMap(VK_END, KEY_END),
+    GenMap(VK_HOME, KEY_HOME),
+    GenMap(VK_LEFT, KEY_LEFT),
+    GenMap(VK_UP, KEY_UP),
+    GenMap(VK_RIGHT, KEY_RIGHT),
+    GenMap(VK_DOWN, KEY_DOWN),
+    GenMap(VK_DELETE, KEY_DC),
+    GenMap(VK_INSERT, KEY_IC)
+};
+#define N_INI ((int)(sizeof(keylist)/sizeof(keylist[0])))
+#define FKEYS 24
+#define MAPSIZE (FKEYS + N_INI)
+#define NUMPAIRS 64
+
+typedef struct props {
+    CONSOLE_SCREEN_BUFFER_INFO SBI;
+    bool progMode;
+    DWORD map[MAPSIZE];
+    DWORD rmap[MAPSIZE];
+    WORD pairs[NUMPAIRS];
+} Properties;
+
+#define PropOf(TCB) ((Properties*)TCB->prop)
+
+int
+_nc_mingw_ioctl(int fd GCC_UNUSED,
+		long int request GCC_UNUSED,
+		struct termios *arg GCC_UNUSED)
+{
+    return 0;
+    endwin();
+    fprintf(stderr, "TERMINFO currently not supported on Windows.\n");
+    exit(1);
+}
+
+static WORD
+MapColor(bool fore, int color)
+{
+    static const int _cmap[] =
+    {0, 4, 2, 6, 1, 5, 3, 7};
+    int a;
+    if (color < 0 || color > 7)
+	a = fore ? 7 : 0;
+    else
+	a = _cmap[color];
+    if (!fore)
+	a = a << 4;
+    return (WORD) a;
+}
+
+static WORD
+MapAttr(TERMINAL_CONTROL_BLOCK * TCB, WORD res, chtype ch)
+{
+    if (ch & A_COLOR) {
+	int p;
+	SCREEN *sp;
+
+	AssertTCB();
+	SetSP();
+	p = PairNumber(ch);
+	if (p > 0 && p < NUMPAIRS && TCB != 0 && sp != 0) {
+	    WORD a;
+	    a = PropOf(TCB)->pairs[p];
+	    res = (res & 0xff00) | a;
+	}
+    }
+
+    if (ch & A_REVERSE)
+	res = ((res & 0xff00) | (((res & 0x07) << 4) | ((res & 0x70) >> 4)));
+
+    if (ch & A_STANDOUT)
+	res = ((res & 0xff00) | (((res & 0x07) << 4) | ((res & 0x70) >> 4))
+	       | BACKGROUND_INTENSITY);
+
+    if (ch & A_BOLD)
+	res |= FOREGROUND_INTENSITY;
+
+    if (ch & A_DIM)
+	res |= BACKGROUND_INTENSITY;
+
+    return res;
+}
+
+static BOOL
+con_write(TERMINAL_CONTROL_BLOCK * TCB, int y, int x, chtype *str, int n)
+{
+    CHAR_INFO ci[n];
+    COORD loc, siz;
+    SMALL_RECT rec;
+    int i;
+    chtype ch;
+    SCREEN *sp;
+
+    AssertTCB();
+
+    if (TCB == 0 || InvalidConsoleHandle(TCB->hdl))
+	return FALSE;
+
+    SetSP();
+
+    for (i = 0; i < n; i++) {
+	ch = str[i];
+	ci[i].Char.AsciiChar = ChCharOf(ch);
+	ci[i].Attributes = MapAttr(TCB,
+				   PropOf(TCB)->SBI.wAttributes,
+				   ChAttrOf(ch));
+	if (ChAttrOf(ch) & A_ALTCHARSET) {
+	    if (sp->_acs_map)
+		ci[i].Char.AsciiChar =
+		    ChCharOf(NCURSES_SP_NAME(_nc_acs_char) (sp, ChCharOf(ch)));
+	}
+    }
+
+    loc.X = (short) 0;
+    loc.Y = (short) 0;
+    siz.X = (short) n;
+    siz.Y = 1;
+
+    rec.Left = (short) x;
+    rec.Top = (short) y;
+    rec.Right = (short) (x + n - 1);
+    rec.Bottom = rec.Top;
+
+    return WriteConsoleOutput(TCB->hdl, ci, siz, loc, &rec);
+}
+
+#define MARK_NOCHANGE(win,row) \
+		win->_line[row].firstchar = _NOCHANGE; \
+		win->_line[row].lastchar  = _NOCHANGE
+
+static int
+drv_doupdate(TERMINAL_CONTROL_BLOCK * TCB)
+{
+    int y, nonempty, n, x0, x1, Width, Height;
+    SCREEN *sp;
+
+    AssertTCB();
+    SetSP();
+
+    Width = screen_columns(sp);
+    Height = screen_lines(sp);
+    nonempty = min(Height, NewScreen(sp)->_maxy + 1);
+
+    if ((CurScreen(sp)->_clear || NewScreen(sp)->_clear)) {
+	int x;
+	chtype empty[Width];
+
+	for (x = 0; x < Width; x++)
+	    empty[x] = ' ';
+
+	for (y = 0; y < nonempty; y++) {
+	    con_write(TCB, y, 0, empty, Width);
+	    memcpy(empty,
+		   CurScreen(sp)->_line[y].text,
+		   Width * sizeof(chtype));
+	}
+	CurScreen(sp)->_clear = FALSE;
+	NewScreen(sp)->_clear = FALSE;
+	touchwin(NewScreen(sp));
+    }
+
+    for (y = 0; y < nonempty; y++) {
+	x0 = NewScreen(sp)->_line[y].firstchar;
+	if (x0 != _NOCHANGE) {
+	    x1 = NewScreen(sp)->_line[y].lastchar;
+	    n = x1 - x0 + 1;
+	    if (n > 0) {
+		memcpy(CurScreen(sp)->_line[y].text + x0,
+		       NewScreen(sp)->_line[y].text + x0,
+		       n * sizeof(chtype));
+		con_write(TCB,
+			  y,
+			  x0,
+			  ((chtype *) CurScreen(sp)->_line[y].text) + x0, n);
+
+		/* mark line changed successfully */
+		if (y <= NewScreen(sp)->_maxy) {
+		    MARK_NOCHANGE(NewScreen(sp), y);
+		}
+		if (y <= CurScreen(sp)->_maxy) {
+		    MARK_NOCHANGE(CurScreen(sp), y);
+		}
+	    }
+	}
+    }
+
+    /* put everything back in sync */
+    for (y = nonempty; y <= NewScreen(sp)->_maxy; y++) {
+	MARK_NOCHANGE(NewScreen(sp), y);
+    }
+    for (y = nonempty; y <= CurScreen(sp)->_maxy; y++) {
+	MARK_NOCHANGE(CurScreen(sp), y);
+    }
+
+    if (!NewScreen(sp)->_leaveok) {
+	CurScreen(sp)->_curx = NewScreen(sp)->_curx;
+	CurScreen(sp)->_cury = NewScreen(sp)->_cury;
+
+	TCB->drv->hwcur(TCB, 0, 0, CurScreen(sp)->_cury, CurScreen(sp)->_curx);
+    }
+    SetConsoleActiveScreenBuffer(TCB->hdl);
+    return OK;
+}
+
+static bool
+drv_CanHandle(TERMINAL_CONTROL_BLOCK * TCB,
+	      const char *tname,
+	      int *errret GCC_UNUSED)
+{
+    bool code = FALSE;
+
+    T((T_CALLED("win32con::drv_CanHandle(%p)"), TCB));
+
+    assert(TCB != 0);
+    assert(tname != 0);
+
+    TCB->magic = WINMAGIC;
+    if (*tname == 0 || *tname == 0) {
+	code = TRUE;
+    } else {
+	TERMINAL my_term;
+	int status;
+
+	code = FALSE;
+#if (USE_DATABASE || USE_TERMCAP)
+	status = _nc_setup_tinfo(tname, &my_term.type);
+#else
+	status = TGETENT_NO;
+#endif
+	if (status != TGETENT_YES) {
+	    const TERMTYPE *fallback = _nc_fallback(tname);
+
+	    if (fallback) {
+		my_term.type = *fallback;
+		status = TGETENT_YES;
+	    } else if (!strcmp(tname, "unknown")) {
+		code = TRUE;
+	    }
+	}
+	if (status == TGETENT_YES) {
+	    if (generic_type || hard_copy)
+		code = TRUE;
+	}
+    }
+
+    if (code) {
+	if ((TCB->term.type.Booleans) == 0) {
+	    _nc_init_entry(&(TCB->term.type));
+	}
+    }
+
+    returnBool(code);
+}
+
+static int
+drv_dobeepflash(TERMINAL_CONTROL_BLOCK * TCB,
+		bool beepFlag GCC_UNUSED)
+{
+    SCREEN *sp;
+    int res = ERR;
+
+    AssertTCB();
+    SetSP();
+
+    return res;
+}
+
+static int
+drv_print(TERMINAL_CONTROL_BLOCK * TCB,
+	  char *data GCC_UNUSED,
+	  int len GCC_UNUSED)
+{
+    SCREEN *sp;
+
+    AssertTCB();
+    SetSP();
+
+    return ERR;
+}
+
+static int
+drv_defaultcolors(TERMINAL_CONTROL_BLOCK * TCB,
+		  int fg GCC_UNUSED,
+		  int bg GCC_UNUSED)
+{
+    SCREEN *sp;
+    int code = ERR;
+
+    AssertTCB();
+    SetSP();
+
+    return (code);
+}
+
+static void
+drv_setcolor(TERMINAL_CONTROL_BLOCK * TCB,
+	     bool fore,
+	     int color,
+	     int (*outc) (SCREEN *, int) GCC_UNUSED)
+{
+    AssertTCB();
+
+    if (TCB && !InvalidConsoleHandle(TCB->hdl)) {
+	WORD a = MapColor(fore, color);
+	a = ((PropOf(TCB)->SBI.wAttributes) & (fore ? 0xfff8 : 0xff8f)) | a;
+	SetConsoleTextAttribute(TCB->hdl, a);
+	GetConsoleScreenBufferInfo(TCB->hdl, &(PropOf(TCB)->SBI));
+    }
+}
+
+static bool
+drv_rescol(TERMINAL_CONTROL_BLOCK * TCB)
+{
+    bool res = FALSE;
+
+    AssertTCB();
+    if (TCB && !InvalidConsoleHandle(TCB->hdl)) {
+	WORD a = FOREGROUND_BLUE | FOREGROUND_RED | FOREGROUND_GREEN;
+	SetConsoleTextAttribute(TCB->hdl, a);
+	GetConsoleScreenBufferInfo(TCB->hdl, &(PropOf(TCB)->SBI));
+	res = TRUE;
+    }
+    return res;
+}
+
+static bool
+drv_rescolors(TERMINAL_CONTROL_BLOCK * TCB)
+{
+    int result = FALSE;
+    SCREEN *sp;
+
+    AssertTCB();
+    SetSP();
+
+    return result;
+}
+
+static int
+drv_size(TERMINAL_CONTROL_BLOCK * TCB, int *Lines, int *Cols)
+{
+    AssertTCB();
+
+    if (TCB == NULL || Lines == NULL || Cols == NULL || InvalidConsoleHandle(TCB->hdl))
+	return ERR;
+
+    *Lines = (int) (PropOf(TCB)->SBI.dwSize.Y);
+    *Cols = (int) (PropOf(TCB)->SBI.dwSize.X);
+    return OK;
+}
+
+static int
+drv_setsize(TERMINAL_CONTROL_BLOCK * TCB GCC_UNUSED,
+	    int l GCC_UNUSED,
+	    int c GCC_UNUSED)
+{
+    AssertTCB();
+    return ERR;
+}
+
+static int
+drv_sgmode(TERMINAL_CONTROL_BLOCK * TCB, bool setFlag, TTY * buf)
+{
+    DWORD dwFlag = 0;
+    tcflag_t iflag;
+    tcflag_t lflag;
+
+    AssertTCB();
+
+    if (TCB == 0 || buf == NULL)
+	return ERR;
+
+    if (setFlag) {
+	iflag = buf->c_iflag;
+	lflag = buf->c_lflag;
+
+	GetConsoleMode(TCB->inp, &dwFlag);
+
+	if (lflag & ICANON)
+	    dwFlag |= ENABLE_LINE_INPUT;
+	else
+	    dwFlag &= ~ENABLE_LINE_INPUT;
+
+	if (lflag & ECHO)
+	    dwFlag |= ENABLE_ECHO_INPUT;
+	else
+	    dwFlag &= ~ENABLE_ECHO_INPUT;
+
+	if (iflag & BRKINT)
+	    dwFlag |= ENABLE_PROCESSED_INPUT;
+	else
+	    dwFlag &= ~ENABLE_PROCESSED_INPUT;
+
+	dwFlag |= ENABLE_MOUSE_INPUT;
+
+	buf->c_iflag = iflag;
+	buf->c_lflag = lflag;
+	SetConsoleMode(TCB->inp, dwFlag);
+	TCB->term.Nttyb = *buf;
+    } else {
+	iflag = TCB->term.Nttyb.c_iflag;
+	lflag = TCB->term.Nttyb.c_lflag;
+	GetConsoleMode(TCB->inp, &dwFlag);
+
+	if (dwFlag & ENABLE_LINE_INPUT)
+	    lflag |= ICANON;
+	else
+	    lflag &= ~ICANON;
+
+	if (dwFlag & ENABLE_ECHO_INPUT)
+	    lflag |= ECHO;
+	else
+	    lflag &= ~ECHO;
+
+	if (dwFlag & ENABLE_PROCESSED_INPUT)
+	    iflag |= BRKINT;
+	else
+	    iflag &= ~BRKINT;
+
+	TCB->term.Nttyb.c_iflag = iflag;
+	TCB->term.Nttyb.c_lflag = lflag;
+
+	*buf = TCB->term.Nttyb;
+    }
+    return OK;
+}
+
+static int
+drv_mode(TERMINAL_CONTROL_BLOCK * TCB, bool progFlag, bool defFlag)
+{
+    SCREEN *sp;
+    TERMINAL *_term = (TERMINAL *) TCB;
+    int code = ERR;
+
+    AssertTCB();
+    sp = TCB->csp;
+
+    PropOf(TCB)->progMode = progFlag;
+    SetConsoleActiveScreenBuffer(progFlag ? TCB->hdl : TCB->out);
+
+    if (progFlag) /* prog mode */  {
+	if (defFlag) {
+	    if ((drv_sgmode(TCB, FALSE, &(_term->Nttyb)) == OK)) {
+		_term->Nttyb.c_oflag &= ~OFLAGS_TABS;
+		code = OK;
+	    }
+	} else {
+	    /* reset_prog_mode */
+	    if (drv_sgmode(TCB, TRUE, &(_term->Nttyb)) == OK) {
+		if (sp) {
+		    if (sp->_keypad_on)
+			_nc_keypad(sp, TRUE);
+		    NC_BUFFERED(sp, TRUE);
+		}
+		code = OK;
+	    }
+	}
+    } else {			/* shell mode */
+	if (defFlag) {
+	    /* def_shell_mode */
+	    if (drv_sgmode(TCB, FALSE, &(_term->Ottyb)) == OK) {
+		code = OK;
+	    }
+	} else {
+	    /* reset_shell_mode */
+	    if (sp) {
+		_nc_keypad(sp, FALSE);
+		NCURSES_SP_NAME(_nc_flush) (sp);
+		NC_BUFFERED(sp, FALSE);
+	    }
+	    code = drv_sgmode(TCB, TRUE, &(_term->Ottyb));
+	}
+    }
+
+    return (code);
+}
+
+static void
+drv_screen_init(SCREEN *sp GCC_UNUSED)
+{
+}
+
+static void
+drv_wrap(SCREEN *sp GCC_UNUSED)
+{
+}
+
+static int
+rkeycompare(const void *el1, const void *el2)
+{
+    WORD key1 = (LOWORD((*((const LONG *) el1)))) & 0x7fff;
+    WORD key2 = (LOWORD((*((const LONG *) el2)))) & 0x7fff;
+
+    return ((key1 < key2) ? -1 : ((key1 == key2) ? 0 : 1));
+}
+
+static int
+keycompare(const void *el1, const void *el2)
+{
+    WORD key1 = HIWORD((*((const LONG *) el1)));
+    WORD key2 = HIWORD((*((const LONG *) el2)));
+
+    return ((key1 < key2) ? -1 : ((key1 == key2) ? 0 : 1));
+}
+
+static int
+MapKey(TERMINAL_CONTROL_BLOCK * TCB, WORD vKey)
+{
+    WORD nKey = 0;
+    void *res;
+    LONG key = GenMap(vKey, 0);
+    int code = -1;
+
+    AssertTCB();
+
+    res = bsearch(&key,
+		  PropOf(TCB)->map,
+		  (size_t) (N_INI + FKEYS),
+		  sizeof(keylist[0]),
+		  keycompare);
+    if (res) {
+	key = *((LONG *) res);
+	nKey = LOWORD(key);
+	code = (int) (nKey & 0x7fff);
+	if (nKey & 0x8000)
+	    code = -code;
+    }
+    return code;
+}
+
+static void
+drv_release(TERMINAL_CONTROL_BLOCK * TCB)
+{
+    T((T_CALLED("win32con::drv_release(%p)"), TCB));
+
+    AssertTCB();
+    if (TCB->prop)
+	free(TCB->prop);
+
+    returnVoid;
+}
+
+static void
+drv_init(TERMINAL_CONTROL_BLOCK * TCB)
+{
+    DWORD num_buttons;
+
+    T((T_CALLED("win32con::drv_init(%p)"), TCB));
+
+    AssertTCB();
+
+    if (TCB) {
+	BOOL b = AllocConsole();
+	WORD a;
+	int i;
+
+	if (!b)
+	    b = AttachConsole(ATTACH_PARENT_PROCESS);
+
+	TCB->inp = GetStdHandle(STD_INPUT_HANDLE);
+	TCB->out = GetStdHandle(STD_OUTPUT_HANDLE);
+
+	if (getenv("NCGDB"))
+	    TCB->hdl = TCB->out;
+	else
+	    TCB->hdl = CreateConsoleScreenBuffer(GENERIC_READ | GENERIC_WRITE,
+						 0,
+						 NULL,
+						 CONSOLE_TEXTMODE_BUFFER,
+						 NULL);
+
+	if (!InvalidConsoleHandle(TCB->hdl)) {
+	    TCB->prop = typeCalloc(Properties, 1);
+	    GetConsoleScreenBufferInfo(TCB->hdl, &(PropOf(TCB)->SBI));
+	}
+
+	TCB->info.initcolor = TRUE;
+	TCB->info.canchange = FALSE;
+	TCB->info.hascolor = TRUE;
+	TCB->info.caninit = TRUE;
+
+	TCB->info.maxpairs = NUMPAIRS;
+	TCB->info.maxcolors = 8;
+	TCB->info.numlabels = 0;
+	TCB->info.labelwidth = 0;
+	TCB->info.labelheight = 0;
+	TCB->info.nocolorvideo = 1;
+	TCB->info.tabsize = 8;
+
+	if (GetNumberOfConsoleMouseButtons(&num_buttons)) {
+	    T(("mouse has %ld buttons", num_buttons));
+	    TCB->info.numbuttons = num_buttons;
+	} else {
+	    TCB->info.numbuttons = 1;
+	}
+
+	TCB->info.defaultPalette = _nc_cga_palette;
+
+	for (i = 0; i < (N_INI + FKEYS); i++) {
+	    if (i < N_INI)
+		PropOf(TCB)->rmap[i] = PropOf(TCB)->map[i] = keylist[i];
+	    else
+		PropOf(TCB)->rmap[i] = PropOf(TCB)->map[i] =
+		    GenMap((VK_F1 + (i - N_INI)), (KEY_F(1) + (i - N_INI)));
+	}
+	qsort(PropOf(TCB)->map,
+	      (size_t) (MAPSIZE),
+	      sizeof(keylist[0]),
+	      keycompare);
+	qsort(PropOf(TCB)->rmap,
+	      (size_t) (MAPSIZE),
+	      sizeof(keylist[0]),
+	      rkeycompare);
+
+	a = MapColor(true, COLOR_WHITE) | MapColor(false, COLOR_BLACK);
+	for (i = 0; i < NUMPAIRS; i++)
+	    PropOf(TCB)->pairs[i] = a;
+    }
+    returnVoid;
+}
+
+static void
+drv_initpair(TERMINAL_CONTROL_BLOCK * TCB,
+	     short pair,
+	     short f,
+	     short b)
+{
+    SCREEN *sp;
+
+    AssertTCB();
+    SetSP();
+
+    if ((pair > 0) && (pair < NUMPAIRS) && (f >= 0) && (f < 8)
+	&& (b >= 0) && (b < 8)) {
+	PropOf(TCB)->pairs[pair] = MapColor(true, f) | MapColor(false, b);
+    }
+}
+
+static void
+drv_initcolor(TERMINAL_CONTROL_BLOCK * TCB,
+	      short color GCC_UNUSED,
+	      short r GCC_UNUSED,
+	      short g GCC_UNUSED,
+	      short b GCC_UNUSED)
+{
+    SCREEN *sp;
+
+    AssertTCB();
+    SetSP();
+}
+
+static void
+drv_do_color(TERMINAL_CONTROL_BLOCK * TCB,
+	     short old_pair GCC_UNUSED,
+	     short pair GCC_UNUSED,
+	     bool reverse GCC_UNUSED,
+	     int (*outc) (SCREEN *, int) GCC_UNUSED
+)
+{
+    SCREEN *sp;
+
+    AssertTCB();
+    SetSP();
+}
+
+static void
+drv_initmouse(TERMINAL_CONTROL_BLOCK * TCB)
+{
+    SCREEN *sp;
+
+    AssertTCB();
+    SetSP();
+
+    sp->_mouse_type = M_TERM_DRIVER;
+}
+
+static int
+drv_testmouse(TERMINAL_CONTROL_BLOCK * TCB, int delay)
+{
+    int rc = 0;
+    SCREEN *sp;
+
+    AssertTCB();
+    SetSP();
+
+    if (sp->_drv_mouse_head < sp->_drv_mouse_tail) {
+	rc = TW_MOUSE;
+    } else {
+	rc = TCBOf(sp)->drv->twait(TCBOf(sp),
+				   TWAIT_MASK,
+				   delay,
+				   (int *) 0
+				   EVENTLIST_2nd(evl));
+    }
+
+    return rc;
+}
+
+static int
+drv_mvcur(TERMINAL_CONTROL_BLOCK * TCB,
+	  int yold GCC_UNUSED, int xold GCC_UNUSED,
+	  int y, int x)
+{
+    int ret = ERR;
+    if (TCB && !InvalidConsoleHandle(TCB->hdl)) {
+	COORD loc;
+	loc.X = (short) x;
+	loc.Y = (short) y;
+	SetConsoleCursorPosition(TCB->hdl, loc);
+	ret = OK;
+    }
+    return ret;
+}
+
+static void
+drv_hwlabel(TERMINAL_CONTROL_BLOCK * TCB,
+	    int labnum GCC_UNUSED,
+	    char *text GCC_UNUSED)
+{
+    SCREEN *sp;
+
+    AssertTCB();
+    SetSP();
+}
+
+static void
+drv_hwlabelOnOff(TERMINAL_CONTROL_BLOCK * TCB,
+		 bool OnFlag GCC_UNUSED)
+{
+    SCREEN *sp;
+
+    AssertTCB();
+    SetSP();
+}
+
+static chtype
+drv_conattr(TERMINAL_CONTROL_BLOCK * TCB GCC_UNUSED)
+{
+    chtype res = A_NORMAL;
+    res |= (A_BOLD | A_DIM | A_REVERSE | A_STANDOUT | A_COLOR);
+    return res;
+}
+
+static void
+drv_setfilter(TERMINAL_CONTROL_BLOCK * TCB)
+{
+    SCREEN *sp;
+
+    AssertTCB();
+    SetSP();
+}
+
+static void
+drv_initacs(TERMINAL_CONTROL_BLOCK * TCB,
+	    chtype *real_map GCC_UNUSED,
+	    chtype *fake_map GCC_UNUSED)
+{
+#define DATA(a,b) { a, b }
+    static struct {
+	int acs_code;
+	int use_code;
+    } table[] = {
+	DATA('a', 0xb1),	/* ACS_CKBOARD  */
+	    DATA('f', 0xf8),	/* ACS_DEGREE   */
+	    DATA('g', 0xf1),	/* ACS_PLMINUS  */
+	    DATA('j', 0xd9),	/* ACS_LRCORNER */
+	    DATA('l', 0xda),	/* ACS_ULCORNER */
+	    DATA('k', 0xbf),	/* ACS_URCORNER */
+	    DATA('m', 0xc0),	/* ACS_LLCORNER */
+	    DATA('n', 0xc5),	/* ACS_PLUS     */
+	    DATA('q', 0xc4),	/* ACS_HLINE    */
+	    DATA('t', 0xc3),	/* ACS_LTEE     */
+	    DATA('u', 0xb4),	/* ACS_RTEE     */
+	    DATA('v', 0xc1),	/* ACS_BTEE     */
+	    DATA('w', 0xc2),	/* ACS_TTEE     */
+	    DATA('x', 0xb3),	/* ACS_VLINE    */
+	    DATA('y', 0xf3),	/* ACS_LEQUAL   */
+	    DATA('z', 0xf2),	/* ACS_GEQUAL   */
+	    DATA('0', 0xdb),	/* ACS_BLOCK    */
+	    DATA('{', 0xe3),	/* ACS_PI       */
+	    DATA('}', 0x9c),	/* ACS_STERLING */
+	    DATA(',', 0xae),	/* ACS_LARROW   */
+	    DATA('+', 0xaf),	/* ACS_RARROW   */
+	    DATA('~', 0xf9),	/* ACS_BULLET   */
+    };
+#undef DATA
+    unsigned n;
+
+    SCREEN *sp;
+    AssertTCB();
+    SetSP();
+
+    for (n = 0; n < SIZEOF(table); ++n) {
+	real_map[table[n].acs_code] = table[n].use_code | A_ALTCHARSET;
+	if (sp != 0)
+	    sp->_screen_acs_map[table[n].acs_code] = TRUE;
+    }
+}
+
+static ULONGLONG
+tdiff(FILETIME fstart, FILETIME fend)
+{
+    ULARGE_INTEGER ustart;
+    ULARGE_INTEGER uend;
+    ULONGLONG diff;
+
+    ustart.LowPart = fstart.dwLowDateTime;
+    ustart.HighPart = fstart.dwHighDateTime;
+    uend.LowPart = fend.dwLowDateTime;
+    uend.HighPart = fend.dwHighDateTime;
+
+    diff = (uend.QuadPart - ustart.QuadPart) / 10000;
+    return diff;
+}
+
+static int
+Adjust(int milliseconds, int diff)
+{
+    if (milliseconds == INFINITY)
+	return milliseconds;
+    milliseconds -= diff;
+    if (milliseconds < 0)
+	milliseconds = 0;
+    return milliseconds;
+}
+
+#define BUTTON_MASK (FROM_LEFT_1ST_BUTTON_PRESSED | \
+		     FROM_LEFT_2ND_BUTTON_PRESSED | \
+		     FROM_LEFT_3RD_BUTTON_PRESSED | \
+		     FROM_LEFT_4TH_BUTTON_PRESSED | \
+		     RIGHTMOST_BUTTON_PRESSED)
+
+static int
+decode_mouse(TERMINAL_CONTROL_BLOCK * TCB, int mask)
+{
+    SCREEN *sp;
+    int result = 0;
+
+    AssertTCB();
+    SetSP();
+
+    if (mask & FROM_LEFT_1ST_BUTTON_PRESSED)
+	result |= BUTTON1_PRESSED;
+    if (mask & FROM_LEFT_2ND_BUTTON_PRESSED)
+	result |= BUTTON2_PRESSED;
+    if (mask & FROM_LEFT_3RD_BUTTON_PRESSED)
+	result |= BUTTON3_PRESSED;
+    if (mask & FROM_LEFT_4TH_BUTTON_PRESSED)
+	result |= BUTTON4_PRESSED;
+
+    if (mask & RIGHTMOST_BUTTON_PRESSED) {
+	switch (TCB->info.numbuttons) {
+	case 1:
+	    result |= BUTTON1_PRESSED;
+	    break;
+	case 2:
+	    result |= BUTTON2_PRESSED;
+	    break;
+	case 3:
+	    result |= BUTTON3_PRESSED;
+	    break;
+	case 4:
+	    result |= BUTTON4_PRESSED;
+	    break;
+	}
+    }
+
+    return result;
+}
+
+static int
+drv_twait(TERMINAL_CONTROL_BLOCK * TCB,
+	  int mode,
+	  int milliseconds,
+	  int *timeleft
+	  EVENTLIST_2nd(_nc_eventlist * evl))
+{
+    SCREEN *sp;
+    INPUT_RECORD inp_rec;
+    BOOL b;
+    DWORD nRead = 0, rc = -1;
+    int code = 0;
+    FILETIME fstart;
+    FILETIME fend;
+    int diff;
+    bool isImmed = (milliseconds == 0);
+
+#define CONSUME() ReadConsoleInput(TCB->inp,&inp_rec,1,&nRead)
+
+    AssertTCB();
+    SetSP();
+
+    TR(TRACE_IEVENT, ("start twait: %d milliseconds, mode: %d",
+		      milliseconds, mode));
+
+    if (milliseconds < 0)
+	milliseconds = INFINITY;
+
+    memset(&inp_rec, 0, sizeof(inp_rec));
+
+    while (true) {
+	GetSystemTimeAsFileTime(&fstart);
+	rc = WaitForSingleObject(TCB->inp, milliseconds);
+	GetSystemTimeAsFileTime(&fend);
+	diff = (int) tdiff(fstart, fend);
+	milliseconds = Adjust(milliseconds, diff);
+
+	if (!isImmed && milliseconds == 0)
+	    break;
+
+	if (rc == WAIT_OBJECT_0) {
+	    if (mode) {
+		b = GetNumberOfConsoleInputEvents(TCB->inp, &nRead);
+		if (b && nRead > 0) {
+		    b = PeekConsoleInput(TCB->inp, &inp_rec, 1, &nRead);
+		    if (b && nRead > 0) {
+			switch (inp_rec.EventType) {
+			case KEY_EVENT:
+			    if (mode & TW_INPUT) {
+				WORD vk = inp_rec.Event.KeyEvent.wVirtualKeyCode;
+				char ch = inp_rec.Event.KeyEvent.uChar.AsciiChar;
+
+				if (inp_rec.Event.KeyEvent.bKeyDown) {
+				    if (0 == ch) {
+					int nKey = MapKey(TCB, vk);
+					if ((nKey < 0) || FALSE == sp->_keypad_on) {
+					    CONSUME();
+					    continue;
+					}
+				    }
+				    code = TW_INPUT;
+				    goto end;
+				} else {
+				    CONSUME();
+				}
+			    }
+			    continue;
+			case MOUSE_EVENT:
+			    if (decode_mouse(TCB,
+					     (inp_rec.Event.MouseEvent.dwButtonState
+					      & BUTTON_MASK)) == 0) {
+				CONSUME();
+			    } else if (mode & TW_MOUSE) {
+				code = TW_MOUSE;
+				goto end;
+			    }
+			    continue;
+			default:
+			    SetConsoleActiveScreenBuffer(!PropOf(TCB)->progMode ?
+							 TCB->hdl : TCB->out);
+			    continue;
+			}
+		    }
+		}
+	    }
+	    continue;
+	} else {
+	    if (rc != WAIT_TIMEOUT) {
+		code = -1;
+		break;
+	    } else {
+		code = 0;
+		break;
+	    }
+	}
+    }
+  end:
+
+    TR(TRACE_IEVENT, ("end twait: returned %d (%d), remaining time %d msec",
+		      code, errno, milliseconds));
+
+    if (timeleft)
+	*timeleft = milliseconds;
+
+    return code;
+}
+
+static bool
+handle_mouse(TERMINAL_CONTROL_BLOCK * TCB, MOUSE_EVENT_RECORD mer)
+{
+    SCREEN *sp;
+    MEVENT work;
+    bool result = FALSE;
+
+    AssertTCB();
+    SetSP();
+
+    sp->_drv_mouse_old_buttons = sp->_drv_mouse_new_buttons;
+    sp->_drv_mouse_new_buttons = mer.dwButtonState & BUTTON_MASK;
+
+    /*
+     * We're only interested if the button is pressed or released.
+     * FIXME: implement continuous event-tracking.
+     */
+    if (sp->_drv_mouse_new_buttons != sp->_drv_mouse_old_buttons) {
+
+	memset(&work, 0, sizeof(work));
+
+	if (sp->_drv_mouse_new_buttons) {
+
+	    work.bstate |= decode_mouse(TCB, sp->_drv_mouse_new_buttons);
+
+	} else {
+
+	    /* cf: BUTTON_PRESSED, BUTTON_RELEASED */
+	    work.bstate |= (decode_mouse(TCB, sp->_drv_mouse_old_buttons) >> 1);
+
+	    result = TRUE;
+	}
+
+	work.x = mer.dwMousePosition.X;
+	work.y = mer.dwMousePosition.Y;
+
+	sp->_drv_mouse_fifo[sp->_drv_mouse_tail] = work;
+	sp->_drv_mouse_tail += 1;
+    }
+
+    return result;
+}
+
+static int
+drv_read(TERMINAL_CONTROL_BLOCK * TCB, int *buf)
+{
+    SCREEN *sp;
+    int n = 1;
+    INPUT_RECORD inp_rec;
+    BOOL b;
+    DWORD nRead;
+    WORD vk;
+    WORD sc;
+
+    AssertTCB();
+    assert(buf);
+    SetSP();
+
+    memset(&inp_rec, 0, sizeof(inp_rec));
+
+    T((T_CALLED("win32con::drv_read(%p)"), TCB));
+    while ((b = ReadConsoleInput(TCB->inp, &inp_rec, 1, &nRead))) {
+	if (b && nRead > 0) {
+	    if (inp_rec.EventType == KEY_EVENT) {
+		if (!inp_rec.Event.KeyEvent.bKeyDown)
+		    continue;
+		*buf = (int) inp_rec.Event.KeyEvent.uChar.AsciiChar;
+		vk = inp_rec.Event.KeyEvent.wVirtualKeyCode;
+		sc = inp_rec.Event.KeyEvent.wVirtualScanCode;
+		if (*buf == 0) {
+		    if (sp->_keypad_on) {
+			*buf = MapKey(TCB, vk);
+			if (0 > (*buf))
+			    continue;
+			else
+			    break;
+		    } else
+			continue;
+		} else {	/* *buf != 0 */
+		    break;
+		}
+	    } else if (inp_rec.EventType == MOUSE_EVENT) {
+		if (handle_mouse(TCB, inp_rec.Event.MouseEvent)) {
+		    *buf = KEY_MOUSE;
+		    break;
+		}
+	    }
+	    continue;
+	}
+    }
+    returnCode(n);
+}
+
+static int
+drv_nap(TERMINAL_CONTROL_BLOCK * TCB GCC_UNUSED, int ms)
+{
+    Sleep(ms);
+    return OK;
+}
+
+static bool
+drv_kyExist(TERMINAL_CONTROL_BLOCK * TCB, int keycode)
+{
+    SCREEN *sp;
+    WORD nKey;
+    void *res;
+    bool found = FALSE;
+    LONG key = GenMap(0, (WORD) keycode);
+
+    AssertTCB();
+    SetSP();
+
+    AssertTCB();
+
+    res = bsearch(&key,
+		  PropOf(TCB)->rmap,
+		  (size_t) (N_INI + FKEYS),
+		  sizeof(keylist[0]),
+		  rkeycompare);
+    if (res) {
+	key = *((LONG *) res);
+	nKey = LOWORD(key);
+	if (!(nKey & 0x8000))
+	    found = TRUE;
+    }
+    return found;
+}
+
+static int
+drv_kpad(TERMINAL_CONTROL_BLOCK * TCB, bool flag GCC_UNUSED)
+{
+    SCREEN *sp;
+    int code = ERR;
+
+    AssertTCB();
+    sp = TCB->csp;
+
+    if (sp) {
+	code = OK;
+    }
+    return code;
+}
+
+static int
+drv_keyok(TERMINAL_CONTROL_BLOCK * TCB, int keycode, bool flag)
+{
+    int code = ERR;
+    SCREEN *sp;
+    WORD nKey;
+    WORD vKey;
+    void *res;
+    LONG key = GenMap(0, (WORD) keycode);
+
+    AssertTCB();
+    SetSP();
+
+    if (sp) {
+	res = bsearch(&key,
+		      PropOf(TCB)->rmap,
+		      (size_t) (N_INI + FKEYS),
+		      sizeof(keylist[0]),
+		      rkeycompare);
+	if (res) {
+	    key = *((LONG *) res);
+	    vKey = HIWORD(key);
+	    nKey = (LOWORD(key)) & 0x7fff;
+	    if (!flag)
+		nKey |= 0x8000;
+	    *(LONG *) res = GenMap(vKey, nKey);
+	}
+    }
+    return code;
+}
+
+NCURSES_EXPORT_VAR (TERM_DRIVER) _nc_WIN_DRIVER = {
+    FALSE,
+	drv_CanHandle,		/* CanHandle */
+	drv_init,		/* init */
+	drv_release,		/* release */
+	drv_size,		/* size */
+	drv_sgmode,		/* sgmode */
+	drv_conattr,		/* conattr */
+	drv_mvcur,		/* hwcur */
+	drv_mode,		/* mode */
+	drv_rescol,		/* rescol */
+	drv_rescolors,		/* rescolors */
+	drv_setcolor,		/* color */
+	drv_dobeepflash,	/* DoBeepFlash */
+	drv_initpair,		/* initpair */
+	drv_initcolor,		/* initcolor */
+	drv_do_color,		/* docolor */
+	drv_initmouse,		/* initmouse */
+	drv_testmouse,		/* testmouse */
+	drv_setfilter,		/* setfilter */
+	drv_hwlabel,		/* hwlabel */
+	drv_hwlabelOnOff,	/* hwlabelOnOff */
+	drv_doupdate,		/* update */
+	drv_defaultcolors,	/* defaultcolors */
+	drv_print,		/* print */
+	drv_size,		/* getsize */
+	drv_setsize,		/* setsize */
+	drv_initacs,		/* initacs */
+	drv_screen_init,	/* scinit */
+	drv_wrap,		/* scexit */
+	drv_twait,		/* twait */
+	drv_read,		/* read */
+	drv_nap,		/* nap */
+	drv_kpad,		/* kpad */
+	drv_keyok,		/* kyOk */
+	drv_kyExist		/* kyExist */
+};
diff -Naur ncurses-5.7.orig/panel/Makefile.in ncurses-5.7/panel/Makefile.in
--- ncurses-5.7.orig/panel/Makefile.in	2007-04-28 10:56:11.000000000 -0400
+++ ncurses-5.7/panel/Makefile.in	2011-01-08 18:18:29.574661327 -0500
@@ -1,6 +1,6 @@
-# $Id: Makefile.in,v 1.52 2007/04/28 14:56:11 tom Exp $
+# $Id: Makefile.in,v 1.58 2010/11/27 21:45:27 tom Exp $
 ##############################################################################
-# Copyright (c) 1998-2006,2007 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 "Software"), #
@@ -43,6 +43,7 @@
 .SUFFIXES:
 
 SHELL		= /bin/sh
+VPATH		= @srcdir@
 THIS		= Makefile
 
 x		= @EXEEXT@
@@ -64,6 +65,7 @@
 LIBTOOL_LINK	= @LIB_LINK@
 LIBTOOL_INSTALL	= @LIB_INSTALL@
 LIBTOOL_UNINSTALL = @LIB_UNINSTALL@
+LT_UNDEF	= @LT_UNDEF@
 
 INSTALL		= @INSTALL@
 INSTALL_LIB	= @INSTALL@ @INSTALL_LIB@
@@ -71,11 +73,14 @@
 INSTALL_DATA	= @INSTALL_DATA@
 
 AR		= @AR@
-AR_OPTS		= @AR_OPTS@
+ARFLAGS		= @ARFLAGS@
 AWK		= @AWK@
 LD		= @LD@
 LN_S		= @LN_S@
 
+CTAGS		= @CTAGS@
+ETAGS		= @ETAGS@
+
 CC		= @CC@
 CPP		= @CPP@
 CFLAGS		= @CFLAGS@
@@ -125,7 +130,7 @@
 
 $(DESTDIR)$(bindir) \
 $(DESTDIR)$(libdir) :
-	sh $(srcdir)/../mkdirs.sh $@
+	mkdir -p $@
 
 # make a copy to simplify include-paths while still keeping panel's include
 # file in this directory.
@@ -133,15 +138,15 @@
 	-rm -f $@
 	cp $(srcdir)/panel.h $@
 
-PANEL_PRIV_H = \
+HEADER_DEPS = \
 	$(srcdir)/panel.priv.h \
 	$(srcdir)/panel.h
 
 tags:
-	ctags *.[ch]
+	$(CTAGS) *.[ch]
 
 @MAKE_UPPER_TAGS@TAGS:
-@MAKE_UPPER_TAGS@	etags *.[ch]
+@MAKE_UPPER_TAGS@	$(ETAGS) *.[ch]
 
 mostlyclean ::
 	-rm -f core tags TAGS *~ *.bak *.i *.ln *.atac trace
diff -Naur ncurses-5.7.orig/panel/llib-lpanel ncurses-5.7/panel/llib-lpanel
--- ncurses-5.7.orig/panel/llib-lpanel	2005-03-05 14:54:50.000000000 -0500
+++ ncurses-5.7/panel/llib-lpanel	2011-01-08 18:13:50.751157371 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2002,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            *
@@ -27,13 +27,13 @@
  ****************************************************************************/
 
 /****************************************************************************
- *  Author: Thomas E. Dickey        1997,2002,2005                          *
+ *  Author: Thomas E. Dickey        1997,2005,2010                          *
  ****************************************************************************/
 /* LINTLIBRARY */
 
 /* ./panel.c */
 
-#include "panel.priv.h"
+#include <panel.priv.h>
 
 #undef _nc_retrace_panel
 PANEL	*_nc_retrace_panel(
@@ -77,6 +77,11 @@
 
 /* ./p_above.c */
 
+#undef ground_panel
+PANEL	*ground_panel(
+		SCREEN	*sp)
+		{ return(*(PANEL **)0); }
+
 #undef panel_above
 PANEL	*panel_above(
 		const PANEL *pan)
@@ -84,6 +89,11 @@
 
 /* ./p_below.c */
 
+#undef ceiling_panel
+PANEL	*ceiling_panel(
+		SCREEN	*sp)
+		{ return(*(PANEL **)0); }
+
 #undef panel_below
 PANEL	*panel_below(
 		const PANEL *pan)
@@ -157,6 +167,11 @@
 
 /* ./p_update.c */
 
+#undef update_panels_sp
+void	update_panels_sp(
+		SCREEN	*sp)
+		{ /* void */ }
+
 #undef update_panels
 void	update_panels(void)
 		{ /* void */ }
diff -Naur ncurses-5.7.orig/panel/llib-lpanelt ncurses-5.7/panel/llib-lpanelt
--- ncurses-5.7.orig/panel/llib-lpanelt	1969-12-31 19:00:00.000000000 -0500
+++ ncurses-5.7/panel/llib-lpanelt	2011-01-08 18:13:50.751157371 -0500
@@ -0,0 +1,197 @@
+/****************************************************************************
+ * 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.                                                           *
+ ****************************************************************************/
+
+/****************************************************************************
+ *  Author: Thomas E. Dickey        2010                                    *
+ ****************************************************************************/
+/* LINTLIBRARY */
+
+/* ./panel.c */
+
+#include <panel.priv.h>
+
+#undef _nc_retrace_panel
+PANEL	*_nc_retrace_panel(
+		PANEL	*pan)
+		{ return(*(PANEL **)0); }
+
+#undef _nc_my_visbuf
+const char *_nc_my_visbuf(
+		const void *ptr)
+		{ return(*(const char **)0); }
+
+#undef _nc_dPanel
+void	_nc_dPanel(
+		const char *text, 
+		const PANEL *pan)
+		{ /* void */ }
+
+#undef _nc_dStack
+void	_nc_dStack(
+		const char *fmt, 
+		int	num, 
+		const PANEL *pan)
+		{ /* void */ }
+
+#undef _nc_Wnoutrefresh
+void	_nc_Wnoutrefresh(
+		const PANEL *pan)
+		{ /* void */ }
+
+#undef _nc_Touchpan
+void	_nc_Touchpan(
+		const PANEL *pan)
+		{ /* void */ }
+
+#undef _nc_Touchline
+void	_nc_Touchline(
+		const PANEL *pan, 
+		int	start, 
+		int	count)
+		{ /* void */ }
+
+/* ./p_above.c */
+
+#undef ground_panel
+PANEL	*ground_panel(
+		SCREEN	*sp)
+		{ return(*(PANEL **)0); }
+
+#undef panel_above
+PANEL	*panel_above(
+		const PANEL *pan)
+		{ return(*(PANEL **)0); }
+
+/* ./p_below.c */
+
+#undef ceiling_panel
+PANEL	*ceiling_panel(
+		SCREEN	*sp)
+		{ return(*(PANEL **)0); }
+
+#undef panel_below
+PANEL	*panel_below(
+		const PANEL *pan)
+		{ return(*(PANEL **)0); }
+
+/* ./p_bottom.c */
+
+#undef bottom_panel
+int	bottom_panel(
+		PANEL	*pan)
+		{ return(*(int *)0); }
+
+/* ./p_delete.c */
+
+#undef del_panel
+int	del_panel(
+		PANEL	*pan)
+		{ return(*(int *)0); }
+
+/* ./p_hide.c */
+
+#undef hide_panel
+int	hide_panel(
+		 PANEL	*pan)
+		{ return(*(int *)0); }
+
+/* ./p_hidden.c */
+
+#undef panel_hidden
+int	panel_hidden(
+		const PANEL *pan)
+		{ return(*(int *)0); }
+
+/* ./p_move.c */
+
+#undef move_panel
+int	move_panel(
+		PANEL	*pan, 
+		int	starty, 
+		int	startx)
+		{ return(*(int *)0); }
+
+/* ./p_new.c */
+
+#undef new_panel
+PANEL	*new_panel(
+		WINDOW	*win)
+		{ return(*(PANEL **)0); }
+
+/* ./p_replace.c */
+
+#undef replace_panel
+int	replace_panel(
+		PANEL	*pan, 
+		WINDOW	*win)
+		{ return(*(int *)0); }
+
+/* ./p_show.c */
+
+#undef show_panel
+int	show_panel(
+		PANEL	*pan)
+		{ return(*(int *)0); }
+
+/* ./p_top.c */
+
+#undef top_panel
+int	top_panel(
+		PANEL	*pan)
+		{ return(*(int *)0); }
+
+/* ./p_update.c */
+
+#undef update_panels_sp
+void	update_panels_sp(
+		SCREEN	*sp)
+		{ /* void */ }
+
+#undef update_panels
+void	update_panels(void)
+		{ /* void */ }
+
+/* ./p_user.c */
+
+#undef set_panel_userptr
+int	set_panel_userptr(
+		PANEL	*pan, 
+		void	*uptr)
+		{ return(*(int *)0); }
+
+#undef panel_userptr
+void	*panel_userptr(
+		const PANEL *pan)
+		{ return(*(void **)0); }
+
+/* ./p_win.c */
+
+#undef panel_window
+WINDOW	*panel_window(
+		const PANEL *pan)
+		{ return(*(WINDOW **)0); }
diff -Naur ncurses-5.7.orig/panel/llib-lpaneltw ncurses-5.7/panel/llib-lpaneltw
--- ncurses-5.7.orig/panel/llib-lpaneltw	1969-12-31 19:00:00.000000000 -0500
+++ ncurses-5.7/panel/llib-lpaneltw	2011-01-08 18:13:50.751157371 -0500
@@ -0,0 +1,197 @@
+/****************************************************************************
+ * 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.                                                           *
+ ****************************************************************************/
+
+/****************************************************************************
+ *  Author: Thomas E. Dickey                    2010                        *
+ ****************************************************************************/
+/* LINTLIBRARY */
+
+/* ./panel.c */
+
+#include <panel.priv.h>
+
+#undef _nc_retrace_panel
+PANEL	*_nc_retrace_panel(
+		PANEL	*pan)
+		{ return(*(PANEL **)0); }
+
+#undef _nc_my_visbuf
+const char *_nc_my_visbuf(
+		const void *ptr)
+		{ return(*(const char **)0); }
+
+#undef _nc_dPanel
+void	_nc_dPanel(
+		const char *text, 
+		const PANEL *pan)
+		{ /* void */ }
+
+#undef _nc_dStack
+void	_nc_dStack(
+		const char *fmt, 
+		int	num, 
+		const PANEL *pan)
+		{ /* void */ }
+
+#undef _nc_Wnoutrefresh
+void	_nc_Wnoutrefresh(
+		const PANEL *pan)
+		{ /* void */ }
+
+#undef _nc_Touchpan
+void	_nc_Touchpan(
+		const PANEL *pan)
+		{ /* void */ }
+
+#undef _nc_Touchline
+void	_nc_Touchline(
+		const PANEL *pan, 
+		int	start, 
+		int	count)
+		{ /* void */ }
+
+/* ./p_above.c */
+
+#undef ground_panel
+PANEL	*ground_panel(
+		SCREEN	*sp)
+		{ return(*(PANEL **)0); }
+
+#undef panel_above
+PANEL	*panel_above(
+		const PANEL *pan)
+		{ return(*(PANEL **)0); }
+
+/* ./p_below.c */
+
+#undef ceiling_panel
+PANEL	*ceiling_panel(
+		SCREEN	*sp)
+		{ return(*(PANEL **)0); }
+
+#undef panel_below
+PANEL	*panel_below(
+		const PANEL *pan)
+		{ return(*(PANEL **)0); }
+
+/* ./p_bottom.c */
+
+#undef bottom_panel
+int	bottom_panel(
+		PANEL	*pan)
+		{ return(*(int *)0); }
+
+/* ./p_delete.c */
+
+#undef del_panel
+int	del_panel(
+		PANEL	*pan)
+		{ return(*(int *)0); }
+
+/* ./p_hide.c */
+
+#undef hide_panel
+int	hide_panel(
+		 PANEL	*pan)
+		{ return(*(int *)0); }
+
+/* ./p_hidden.c */
+
+#undef panel_hidden
+int	panel_hidden(
+		const PANEL *pan)
+		{ return(*(int *)0); }
+
+/* ./p_move.c */
+
+#undef move_panel
+int	move_panel(
+		PANEL	*pan, 
+		int	starty, 
+		int	startx)
+		{ return(*(int *)0); }
+
+/* ./p_new.c */
+
+#undef new_panel
+PANEL	*new_panel(
+		WINDOW	*win)
+		{ return(*(PANEL **)0); }
+
+/* ./p_replace.c */
+
+#undef replace_panel
+int	replace_panel(
+		PANEL	*pan, 
+		WINDOW	*win)
+		{ return(*(int *)0); }
+
+/* ./p_show.c */
+
+#undef show_panel
+int	show_panel(
+		PANEL	*pan)
+		{ return(*(int *)0); }
+
+/* ./p_top.c */
+
+#undef top_panel
+int	top_panel(
+		PANEL	*pan)
+		{ return(*(int *)0); }
+
+/* ./p_update.c */
+
+#undef update_panels_sp
+void	update_panels_sp(
+		SCREEN	*sp)
+		{ /* void */ }
+
+#undef update_panels
+void	update_panels(void)
+		{ /* void */ }
+
+/* ./p_user.c */
+
+#undef set_panel_userptr
+int	set_panel_userptr(
+		PANEL	*pan, 
+		void	*uptr)
+		{ return(*(int *)0); }
+
+#undef panel_userptr
+void	*panel_userptr(
+		const PANEL *pan)
+		{ return(*(void **)0); }
+
+/* ./p_win.c */
+
+#undef panel_window
+WINDOW	*panel_window(
+		const PANEL *pan)
+		{ return(*(WINDOW **)0); }
diff -Naur ncurses-5.7.orig/panel/llib-lpanelw ncurses-5.7/panel/llib-lpanelw
--- ncurses-5.7.orig/panel/llib-lpanelw	2005-03-05 14:36:10.000000000 -0500
+++ ncurses-5.7/panel/llib-lpanelw	2011-01-08 18:13:50.755157082 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2002,2005 Free Software Foundation, Inc.                   *
+ * Copyright (c) 2002-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            *
@@ -27,13 +27,13 @@
  ****************************************************************************/
 
 /****************************************************************************
- *  Author: Thomas E. Dickey                    2002,2005                   *
+ *  Author: Thomas E. Dickey                    2002-2005,2010              *
  ****************************************************************************/
 /* LINTLIBRARY */
 
 /* ./panel.c */
 
-#include "panel.priv.h"
+#include <panel.priv.h>
 
 #undef _nc_retrace_panel
 PANEL	*_nc_retrace_panel(
@@ -77,6 +77,11 @@
 
 /* ./p_above.c */
 
+#undef ground_panel
+PANEL	*ground_panel(
+		SCREEN	*sp)
+		{ return(*(PANEL **)0); }
+
 #undef panel_above
 PANEL	*panel_above(
 		const PANEL *pan)
@@ -84,6 +89,11 @@
 
 /* ./p_below.c */
 
+#undef ceiling_panel
+PANEL	*ceiling_panel(
+		SCREEN	*sp)
+		{ return(*(PANEL **)0); }
+
 #undef panel_below
 PANEL	*panel_below(
 		const PANEL *pan)
@@ -157,6 +167,11 @@
 
 /* ./p_update.c */
 
+#undef update_panels_sp
+void	update_panels_sp(
+		SCREEN	*sp)
+		{ /* void */ }
+
 #undef update_panels
 void	update_panels(void)
 		{ /* void */ }
diff -Naur ncurses-5.7.orig/panel/modules ncurses-5.7/panel/modules
--- ncurses-5.7.orig/panel/modules	2006-12-23 19:53:17.000000000 -0500
+++ ncurses-5.7/panel/modules	2011-01-08 18:13:50.755157082 -0500
@@ -1,6 +1,6 @@
-# $Id: modules,v 1.9 2006/12/24 00:53:17 tom Exp $
+# $Id: modules,v 1.10 2010/01/23 16:31:16 tom Exp $
 ##############################################################################
-# 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 "Software"), #
@@ -32,20 +32,20 @@
 
 @ base
 # Library objects
-panel		lib		$(srcdir)	$(PANEL_PRIV_H)
-p_above		lib		$(srcdir)	$(PANEL_PRIV_H)
-p_below		lib		$(srcdir)	$(PANEL_PRIV_H)
-p_bottom	lib		$(srcdir)	$(PANEL_PRIV_H)
-p_delete	lib		$(srcdir)	$(PANEL_PRIV_H)
-p_hide		lib		$(srcdir)	$(PANEL_PRIV_H)
-p_hidden	lib		$(srcdir)	$(PANEL_PRIV_H)
-p_move		lib		$(srcdir)	$(PANEL_PRIV_H)
-p_new		lib		$(srcdir)	$(PANEL_PRIV_H)
-p_replace	lib		$(srcdir)	$(PANEL_PRIV_H)
-p_show		lib		$(srcdir)	$(PANEL_PRIV_H)
-p_top		lib		$(srcdir)	$(PANEL_PRIV_H)
-p_update	lib		$(srcdir)	$(PANEL_PRIV_H)
-p_user		lib		$(srcdir)	$(PANEL_PRIV_H)
-p_win		lib		$(srcdir)	$(PANEL_PRIV_H)
+panel		lib		$(srcdir)	$(HEADER_DEPS)
+p_above		lib		$(srcdir)	$(HEADER_DEPS)
+p_below		lib		$(srcdir)	$(HEADER_DEPS)
+p_bottom	lib		$(srcdir)	$(HEADER_DEPS)
+p_delete	lib		$(srcdir)	$(HEADER_DEPS)
+p_hide		lib		$(srcdir)	$(HEADER_DEPS)
+p_hidden	lib		$(srcdir)	$(HEADER_DEPS)
+p_move		lib		$(srcdir)	$(HEADER_DEPS)
+p_new		lib		$(srcdir)	$(HEADER_DEPS)
+p_replace	lib		$(srcdir)	$(HEADER_DEPS)
+p_show		lib		$(srcdir)	$(HEADER_DEPS)
+p_top		lib		$(srcdir)	$(HEADER_DEPS)
+p_update	lib		$(srcdir)	$(HEADER_DEPS)
+p_user		lib		$(srcdir)	$(HEADER_DEPS)
+p_win		lib		$(srcdir)	$(HEADER_DEPS)
 
 # vile:makemode
diff -Naur ncurses-5.7.orig/panel/p_above.c ncurses-5.7/panel/p_above.c
--- ncurses-5.7.orig/panel/p_above.c	2005-02-19 11:44:57.000000000 -0500
+++ ncurses-5.7/panel/p_above.c	2011-01-08 18:13:50.755157082 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2000,2005 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            *
@@ -29,24 +29,56 @@
 /****************************************************************************
  *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1995                    *
  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
+ *     and: Juergen Pfeifer                         1997-1999,2008          *
  ****************************************************************************/
 
 /* p_above.c
  */
 #include "panel.priv.h"
 
-MODULE_ID("$Id: p_above.c,v 1.6 2005/02/19 16:44:57 tom Exp $")
+MODULE_ID("$Id: p_above.c,v 1.8 2010/01/23 21:22:15 tom Exp $")
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(PANEL *)
+ground_panel(SCREEN * sp)
+{
+  T((T_CALLED("ground_panel(%p)"), sp));
+  if (sp)
+    {
+      struct panelhook *ph = NCURSES_SP_NAME(_nc_panelhook) (sp);
+
+      if (_nc_bottom_panel)	/* this is the pseudo panel */
+	returnPanel(_nc_bottom_panel->above);
+      else
+	returnPanel(0);
+    }
+  else
+    {
+      if (0 == CURRENT_SCREEN)
+	returnPanel(0);
+      else
+	returnPanel(ground_panel(CURRENT_SCREEN));
+    }
+}
+#endif
 
 NCURSES_EXPORT(PANEL *)
 panel_above(const PANEL * pan)
 {
-  T((T_CALLED("panel_above(%p)"), pan));
-  if (!pan)
+  PANEL *result;
+
+  T((T_CALLED("panel_above(%p)"), (const void *)pan));
+  if (pan)
+    result = pan->above;
+  else
     {
+#if NCURSES_SP_FUNCS
+      result = ground_panel(CURRENT_SCREEN);
+#else
       /* if top and bottom are equal, we have no or only the pseudo panel;
          if not, we return the panel above the pseudo panel */
-      returnPanel(EMPTY_STACK()? (PANEL *) 0 : _nc_bottom_panel->above);
+      result = EMPTY_STACK()? (PANEL *) 0 : _nc_bottom_panel->above;
+#endif
     }
-  else
-    returnPanel(pan->above);
+  returnPanel(result);
 }
diff -Naur ncurses-5.7.orig/panel/p_below.c ncurses-5.7/panel/p_below.c
--- ncurses-5.7.orig/panel/p_below.c	2005-02-19 11:45:10.000000000 -0500
+++ ncurses-5.7/panel/p_below.c	2011-01-08 18:13:50.755157082 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2000,2005 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            *
@@ -29,26 +29,57 @@
 /****************************************************************************
  *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1995                    *
  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
+ *     and: Juergen Pfeifer                         1997-1999,2008          *
  ****************************************************************************/
 
 /* p_below.c
  */
 #include "panel.priv.h"
 
-MODULE_ID("$Id: p_below.c,v 1.6 2005/02/19 16:45:10 tom Exp $")
+MODULE_ID("$Id: p_below.c,v 1.8 2010/01/23 21:22:15 tom Exp $")
 
+#if NCURSES_SP_FUNCS
 NCURSES_EXPORT(PANEL *)
-panel_below(const PANEL * pan)
+ceiling_panel(SCREEN * sp)
 {
-  T((T_CALLED("panel_below(%p)"), pan));
-  if (!pan)
+  T((T_CALLED("ceiling_panel(%p)"), sp));
+  if (sp)
     {
+      struct panelhook *ph = NCURSES_SP_NAME(_nc_panelhook) (sp);
+
       /* if top and bottom are equal, we have no or only the pseudo panel */
       returnPanel(EMPTY_STACK()? (PANEL *) 0 : _nc_top_panel);
     }
   else
     {
+      if (0 == CURRENT_SCREEN)
+	returnPanel(0);
+      else
+	returnPanel(ceiling_panel(CURRENT_SCREEN));
+    }
+}
+#endif
+
+NCURSES_EXPORT(PANEL *)
+panel_below(const PANEL * pan)
+{
+  PANEL *result;
+
+  T((T_CALLED("panel_below(%p)"), (const void *)pan));
+  if (pan)
+    {
+      GetHook(pan);
       /* we must not return the pseudo panel */
-      returnPanel(Is_Pseudo(pan->below) ? (PANEL *) 0 : pan->below);
+      result = Is_Pseudo(pan->below) ? (PANEL *) 0 : pan->below;
+    }
+  else
+    {
+#if NCURSES_SP_FUNCS
+      result = ceiling_panel(CURRENT_SCREEN);
+#else
+      /* if top and bottom are equal, we have no or only the pseudo panel */
+      result = EMPTY_STACK()? (PANEL *) 0 : _nc_top_panel;
+#endif
     }
+  returnPanel(result);
 }
diff -Naur ncurses-5.7.orig/panel/p_bottom.c ncurses-5.7/panel/p_bottom.c
--- ncurses-5.7.orig/panel/p_bottom.c	2005-02-19 11:38:16.000000000 -0500
+++ ncurses-5.7/panel/p_bottom.c	2011-01-08 18:13:50.755157082 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2000,2005 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            *
@@ -29,6 +29,7 @@
 /****************************************************************************
  *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1995                    *
  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
+ *     and: Juergen Pfeifer                         1997-1999,2008          *
  ****************************************************************************/
 
 /* p_bottom.c
@@ -36,16 +37,17 @@
  */
 #include "panel.priv.h"
 
-MODULE_ID("$Id: p_bottom.c,v 1.11 2005/02/19 16:38:16 tom Exp $")
+MODULE_ID("$Id: p_bottom.c,v 1.13 2010/01/23 21:22:16 tom Exp $")
 
 NCURSES_EXPORT(int)
 bottom_panel(PANEL * pan)
 {
   int err = OK;
 
-  T((T_CALLED("bottom_panel(%p)"), pan));
+  T((T_CALLED("bottom_panel(%p)"), (void *)pan));
   if (pan)
     {
+      GetHook(pan);
       if (!Is_Bottom(pan))
 	{
 
diff -Naur ncurses-5.7.orig/panel/p_delete.c ncurses-5.7/panel/p_delete.c
--- ncurses-5.7.orig/panel/p_delete.c	2005-02-19 11:38:45.000000000 -0500
+++ ncurses-5.7/panel/p_delete.c	2011-01-08 18:13:50.755157082 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2000,2005 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            *
@@ -29,6 +29,7 @@
 /****************************************************************************
  *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1995                    *
  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
+ *     and: Juergen Pfeifer                         1999,2008               *
  ****************************************************************************/
 
 /* p_delete.c
@@ -36,19 +37,22 @@
  */
 #include "panel.priv.h"
 
-MODULE_ID("$Id: p_delete.c,v 1.8 2005/02/19 16:38:45 tom Exp $")
+MODULE_ID("$Id: p_delete.c,v 1.10 2010/01/23 21:22:16 tom Exp $")
 
 NCURSES_EXPORT(int)
 del_panel(PANEL * pan)
 {
   int err = OK;
 
-  T((T_CALLED("del_panel(%p)"), pan));
+  T((T_CALLED("del_panel(%p)"), (void *)pan));
   if (pan)
     {
       dBug(("--> del_panel %s", USER_PTR(pan->user)));
-      HIDE_PANEL(pan, err, OK);
-      free((void *)pan);
+      {
+	GetHook(pan);
+	HIDE_PANEL(pan, err, OK);
+	free((void *)pan);
+      }
     }
   else
     err = ERR;
diff -Naur ncurses-5.7.orig/panel/p_hidden.c ncurses-5.7/panel/p_hidden.c
--- ncurses-5.7.orig/panel/p_hidden.c	2005-02-19 11:39:17.000000000 -0500
+++ ncurses-5.7/panel/p_hidden.c	2011-01-08 18:13:50.755157082 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2000,2005 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            *
@@ -29,6 +29,7 @@
 /****************************************************************************
  *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1995                    *
  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
+ *     and: Juergen Pfeifer                         1997-1999,2008          *
  ****************************************************************************/
 
 /* p_hidden.c
@@ -36,13 +37,18 @@
  */
 #include "panel.priv.h"
 
-MODULE_ID("$Id: p_hidden.c,v 1.7 2005/02/19 16:39:17 tom Exp $")
+MODULE_ID("$Id: p_hidden.c,v 1.9 2010/01/23 21:22:15 tom Exp $")
 
 NCURSES_EXPORT(int)
 panel_hidden(const PANEL * pan)
 {
-  T((T_CALLED("panel_hidden(%p)"), pan));
-  if (!pan)
-    returnCode(ERR);
-  returnCode(IS_LINKED(pan) ? FALSE : TRUE);
+  int rc = ERR;
+
+  T((T_CALLED("panel_hidden(%p)"), (const void *)pan));
+  if (pan)
+    {
+      GetHook(pan);
+      rc = (IS_LINKED(pan) ? FALSE : TRUE);
+    }
+  returnCode(rc);
 }
diff -Naur ncurses-5.7.orig/panel/p_hide.c ncurses-5.7/panel/p_hide.c
--- ncurses-5.7.orig/panel/p_hide.c	2005-02-19 11:39:41.000000000 -0500
+++ ncurses-5.7/panel/p_hide.c	2011-01-08 18:13:50.755157082 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2000,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            *
@@ -36,23 +36,27 @@
  */
 #include "panel.priv.h"
 
-MODULE_ID("$Id: p_hide.c,v 1.9 2005/02/19 16:39:41 tom Exp $")
+MODULE_ID("$Id: p_hide.c,v 1.11 2010/01/23 21:22:16 tom Exp $")
 
 NCURSES_EXPORT(int)
 hide_panel(register PANEL * pan)
 {
-  int err = OK;
+  int err = ERR;
 
-  T((T_CALLED("hide_panel(%p)"), pan));
-  if (!pan)
-    returnCode(ERR);
+  T((T_CALLED("hide_panel(%p)"), (void *)pan));
 
-  dBug(("--> hide_panel %s", USER_PTR(pan->user)));
-  dStack("<u%d>", 1, pan);
+  if (pan)
+    {
+      GetHook(pan);
 
-  HIDE_PANEL(pan, err, ERR);
+      dBug(("--> hide_panel %s", USER_PTR(pan->user)));
+      dStack("<u%d>", 1, pan);
 
-  dStack("<u%d>", 9, pan);
+      HIDE_PANEL(pan, err, ERR);
 
+      err = OK;
+
+      dStack("<u%d>", 9, pan);
+    }
   returnCode(err);
 }
diff -Naur ncurses-5.7.orig/panel/p_move.c ncurses-5.7/panel/p_move.c
--- ncurses-5.7.orig/panel/p_move.c	2005-02-19 11:46:49.000000000 -0500
+++ ncurses-5.7/panel/p_move.c	2011-01-08 18:13:50.755157082 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2000,2005 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            *
@@ -29,6 +29,7 @@
 /****************************************************************************
  *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1995                    *
  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
+ *     and: Juergen Pfeifer                         1997-1999,2009          *
  ****************************************************************************/
 
 /* p_move.c
@@ -36,21 +37,24 @@
  */
 #include "panel.priv.h"
 
-MODULE_ID("$Id: p_move.c,v 1.9 2005/02/19 16:46:49 tom Exp $")
+MODULE_ID("$Id: p_move.c,v 1.11 2010/01/23 21:22:15 tom Exp $")
 
 NCURSES_EXPORT(int)
 move_panel(PANEL * pan, int starty, int startx)
 {
-  T((T_CALLED("move_panel(%p,%d,%d)"), pan, starty, startx));
+  int rc = ERR;
 
-  if (!pan)
-    returnCode(ERR);
+  T((T_CALLED("move_panel(%p,%d,%d)"), (void *)pan, starty, startx));
 
-  if (IS_LINKED(pan))
+  if (pan)
     {
-      Touchpan(pan);
-      PANEL_UPDATE(pan, (PANEL *) 0);
+      GetHook(pan);
+      if (IS_LINKED(pan))
+	{
+	  Touchpan(pan);
+	  PANEL_UPDATE(pan, (PANEL *) 0);
+	}
+      rc = mvwin(pan->win, starty, startx);
     }
-
-  returnCode(mvwin(pan->win, starty, startx));
+  returnCode(rc);
 }
diff -Naur ncurses-5.7.orig/panel/p_new.c ncurses-5.7/panel/p_new.c
--- ncurses-5.7.orig/panel/p_new.c	2008-08-04 14:25:48.000000000 -0400
+++ ncurses-5.7/panel/p_new.c	2011-01-08 18:13:50.755157082 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2005,2008 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            *
@@ -38,7 +38,7 @@
  */
 #include "panel.priv.h"
 
-MODULE_ID("$Id: p_new.c,v 1.10 2008/08/04 18:25:48 tom Exp $")
+MODULE_ID("$Id: p_new.c,v 1.16 2010/01/23 21:22:16 tom Exp $")
 
 #ifdef TRACE
 static char *stdscr_id;
@@ -50,20 +50,27 @@
   Establish the pseudo panel for stdscr if necessary.
 --------------------------------------------------------------------------*/
 static PANEL *
-root_panel(void)
+root_panel(NCURSES_SP_DCL0)
 {
+#if NCURSES_SP_FUNCS
+  struct panelhook *ph = NCURSES_SP_NAME(_nc_panelhook) (sp);
+
+#elif NO_LEAKS
+  struct panelhook *ph = _nc_panelhook();
+#endif
+
   if (_nc_stdscr_pseudo_panel == (PANEL *) 0)
     {
 
-      assert(stdscr && !_nc_bottom_panel && !_nc_top_panel);
+      assert(SP_PARM && SP_PARM->_stdscr && !_nc_bottom_panel && !_nc_top_panel);
 #if NO_LEAKS
-      _nc_panelhook()->destroy = del_panel;
+      ph->destroy = del_panel;
 #endif
-      _nc_stdscr_pseudo_panel = (PANEL *) malloc(sizeof(PANEL));
+      _nc_stdscr_pseudo_panel = typeMalloc(PANEL, 1);
       if (_nc_stdscr_pseudo_panel != 0)
 	{
 	  PANEL *pan = _nc_stdscr_pseudo_panel;
-	  WINDOW *win = stdscr;
+	  WINDOW *win = SP_PARM->_stdscr;
 
 	  pan->win = win;
 	  pan->below = (PANEL *) 0;
@@ -86,16 +93,18 @@
 {
   PANEL *pan = (PANEL *) 0;
 
-  T((T_CALLED("new_panel(%p)"), win));
+  GetWindowHook(win);
+
+  T((T_CALLED("new_panel(%p)"), (void *)win));
 
   if (!win)
     returnPanel(pan);
 
   if (!_nc_stdscr_pseudo_panel)
-    (void)root_panel();
+    (void)root_panel(NCURSES_SP_ARG);
   assert(_nc_stdscr_pseudo_panel);
 
-  if (!(win->_flags & _ISPAD) && (pan = (PANEL *) malloc(sizeof(PANEL))))
+  if (!(win->_flags & _ISPAD) && (pan = typeMalloc(PANEL, 1)))
     {
       pan->win = win;
       pan->above = (PANEL *) 0;
diff -Naur ncurses-5.7.orig/panel/p_replace.c ncurses-5.7/panel/p_replace.c
--- ncurses-5.7.orig/panel/p_replace.c	2005-02-19 11:41:31.000000000 -0500
+++ ncurses-5.7/panel/p_replace.c	2011-01-08 18:13:50.755157082 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2000,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            *
@@ -36,23 +36,25 @@
  */
 #include "panel.priv.h"
 
-MODULE_ID("$Id: p_replace.c,v 1.9 2005/02/19 16:41:31 tom Exp $")
+MODULE_ID("$Id: p_replace.c,v 1.11 2010/01/23 21:22:16 tom Exp $")
 
 NCURSES_EXPORT(int)
 replace_panel(PANEL * pan, WINDOW *win)
 {
-  T((T_CALLED("replace_panel(%p,%p)"), pan, win));
+  int rc = ERR;
 
-  if (!pan)
-    returnCode(ERR);
+  T((T_CALLED("replace_panel(%p,%p)"), (void *)pan, (void *)win));
 
-  if (IS_LINKED(pan))
+  if (pan)
     {
-      Touchpan(pan);
-      PANEL_UPDATE(pan, (PANEL *) 0);
+      GetHook(pan);
+      if (IS_LINKED(pan))
+	{
+	  Touchpan(pan);
+	  PANEL_UPDATE(pan, (PANEL *) 0);
+	}
+      pan->win = win;
+      rc = OK;
     }
-
-  pan->win = win;
-
-  returnCode(OK);
+  returnCode(rc);
 }
diff -Naur ncurses-5.7.orig/panel/p_show.c ncurses-5.7/panel/p_show.c
--- ncurses-5.7.orig/panel/p_show.c	2005-02-19 11:42:02.000000000 -0500
+++ ncurses-5.7/panel/p_show.c	2011-01-08 18:13:50.755157082 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2000,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            *
@@ -36,34 +36,37 @@
  */
 #include "panel.priv.h"
 
-MODULE_ID("$Id: p_show.c,v 1.11 2005/02/19 16:42:02 tom Exp $")
+MODULE_ID("$Id: p_show.c,v 1.13 2010/01/23 21:22:16 tom Exp $")
 
 NCURSES_EXPORT(int)
 show_panel(PANEL * pan)
 {
-  int err = OK;
+  int err = ERR;
 
-  T((T_CALLED("show_panel(%p)"), pan));
+  T((T_CALLED("show_panel(%p)"), (void *)pan));
 
-  if (!pan)
-    returnCode(ERR);
+  if (pan)
+    {
+      GetHook(pan);
 
-  if (Is_Top(pan))
-    returnCode(OK);
+      if (Is_Top(pan))
+	returnCode(OK);
 
-  dBug(("--> show_panel %s", USER_PTR(pan->user)));
+      dBug(("--> show_panel %s", USER_PTR(pan->user)));
 
-  HIDE_PANEL(pan, err, OK);
+      HIDE_PANEL(pan, err, OK);
 
-  dStack("<lt%d>", 1, pan);
-  assert(_nc_bottom_panel == _nc_stdscr_pseudo_panel);
+      dStack("<lt%d>", 1, pan);
+      assert(_nc_bottom_panel == _nc_stdscr_pseudo_panel);
 
-  _nc_top_panel->above = pan;
-  pan->below = _nc_top_panel;
-  pan->above = (PANEL *) 0;
-  _nc_top_panel = pan;
+      _nc_top_panel->above = pan;
+      pan->below = _nc_top_panel;
+      pan->above = (PANEL *) 0;
+      _nc_top_panel = pan;
 
-  dStack("<lt%d>", 9, pan);
+      err = OK;
 
-  returnCode(OK);
+      dStack("<lt%d>", 9, pan);
+    }
+  returnCode(err);
 }
diff -Naur ncurses-5.7.orig/panel/p_top.c ncurses-5.7/panel/p_top.c
--- ncurses-5.7.orig/panel/p_top.c	2005-02-19 11:42:23.000000000 -0500
+++ ncurses-5.7/panel/p_top.c	2011-01-08 18:13:50.755157082 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2000,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            *
@@ -36,11 +36,11 @@
  */
 #include "panel.priv.h"
 
-MODULE_ID("$Id: p_top.c,v 1.5 2005/02/19 16:42:23 tom Exp $")
+MODULE_ID("$Id: p_top.c,v 1.6 2010/01/23 21:22:16 tom Exp $")
 
 NCURSES_EXPORT(int)
 top_panel(PANEL * pan)
 {
-  T((T_CALLED("top_panel(%p)"), pan));
+  T((T_CALLED("top_panel(%p)"), (void *)pan));
   returnCode(show_panel(pan));
 }
diff -Naur ncurses-5.7.orig/panel/p_update.c ncurses-5.7/panel/p_update.c
--- ncurses-5.7.orig/panel/p_update.c	2005-02-19 11:49:47.000000000 -0500
+++ ncurses-5.7/panel/p_update.c	2011-01-08 18:13:50.755157082 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2000,2005 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            *
@@ -29,6 +29,7 @@
 /****************************************************************************
  *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1995                    *
  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
+ *     and: Juergen Pfeifer                         1997-1999,2008          *
  ****************************************************************************/
 
 /* p_update.c
@@ -36,28 +37,42 @@
  */
 #include "panel.priv.h"
 
-MODULE_ID("$Id: p_update.c,v 1.9 2005/02/19 16:49:47 tom Exp $")
+MODULE_ID("$Id: p_update.c,v 1.11 2010/01/23 21:22:16 tom Exp $")
 
 NCURSES_EXPORT(void)
-update_panels(void)
+NCURSES_SP_NAME(update_panels) (NCURSES_SP_DCL0)
 {
   PANEL *pan;
 
-  T((T_CALLED("update_panels()")));
+  T((T_CALLED("update_panels(%p)"), (void *)SP_PARM));
   dBug(("--> update_panels"));
-  pan = _nc_bottom_panel;
-  while (pan && pan->above)
-    {
-      PANEL_UPDATE(pan, pan->above);
-      pan = pan->above;
-    }
 
-  pan = _nc_bottom_panel;
-  while (pan)
+  if (SP_PARM)
     {
-      Wnoutrefresh(pan);
-      pan = pan->above;
+      GetScreenHook(SP_PARM);
+
+      pan = _nc_bottom_panel;
+      while (pan && pan->above)
+	{
+	  PANEL_UPDATE(pan, pan->above);
+	  pan = pan->above;
+	}
+
+      pan = _nc_bottom_panel;
+      while (pan)
+	{
+	  Wnoutrefresh(pan);
+	  pan = pan->above;
+	}
     }
 
   returnVoid;
 }
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(void)
+update_panels(void)
+{
+  NCURSES_SP_NAME(update_panels) (CURRENT_SCREEN);
+}
+#endif
diff -Naur ncurses-5.7.orig/panel/p_user.c ncurses-5.7/panel/p_user.c
--- ncurses-5.7.orig/panel/p_user.c	2005-02-19 11:52:44.000000000 -0500
+++ ncurses-5.7/panel/p_user.c	2011-01-08 18:13:50.755157082 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2000,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            *
@@ -36,12 +36,12 @@
  */
 #include "panel.priv.h"
 
-MODULE_ID("$Id: p_user.c,v 1.6 2005/02/19 16:52:44 tom Exp $")
+MODULE_ID("$Id: p_user.c,v 1.8 2010/01/23 23:18:35 tom Exp $")
 
 NCURSES_EXPORT(int)
 set_panel_userptr(PANEL * pan, NCURSES_CONST void *uptr)
 {
-  T((T_CALLED("set_panel_userptr(%p,%p)"), pan, uptr));
+  T((T_CALLED("set_panel_userptr(%p,%p)"), (void *)pan, (NCURSES_CONST void *)uptr));
   if (!pan)
     returnCode(ERR);
   pan->user = uptr;
@@ -51,6 +51,6 @@
 NCURSES_EXPORT(NCURSES_CONST void *)
 panel_userptr(const PANEL * pan)
 {
-  T((T_CALLED("panel_userptr(%p)"), pan));
+  T((T_CALLED("panel_userptr(%p)"), (const void *)pan));
   returnCVoidPtr(pan ? pan->user : (NCURSES_CONST void *)0);
 }
diff -Naur ncurses-5.7.orig/panel/p_win.c ncurses-5.7/panel/p_win.c
--- ncurses-5.7.orig/panel/p_win.c	2005-02-19 11:44:16.000000000 -0500
+++ ncurses-5.7/panel/p_win.c	2011-01-08 18:13:50.755157082 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2000,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            *
@@ -36,11 +36,11 @@
  */
 #include "panel.priv.h"
 
-MODULE_ID("$Id: p_win.c,v 1.5 2005/02/19 16:44:16 tom Exp $")
+MODULE_ID("$Id: p_win.c,v 1.6 2010/01/23 21:22:15 tom Exp $")
 
 NCURSES_EXPORT(WINDOW *)
 panel_window(const PANEL * pan)
 {
-  T((T_CALLED("panel_window(%p)"), pan));
+  T((T_CALLED("panel_window(%p)"), (const void *)pan));
   returnWin(pan ? pan->win : (WINDOW *)0);
 }
diff -Naur ncurses-5.7.orig/panel/panel.c ncurses-5.7/panel/panel.c
--- ncurses-5.7.orig/panel/panel.c	2005-02-19 13:04:31.000000000 -0500
+++ ncurses-5.7/panel/panel.c	2011-01-08 18:13:50.755157082 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2004,2005 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            *
@@ -29,12 +29,14 @@
 /****************************************************************************
  *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1995                    *
  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
+ *     and: Juergen Pfeifer                         1996-1999,2008          *
+ *     and: Thomas E. Dickey                                                *
  ****************************************************************************/
 
 /* panel.c -- implementation of panels library, some core routines */
 #include "panel.priv.h"
 
-MODULE_ID("$Id: panel.c,v 1.23 2005/02/19 18:04:31 tom Exp $")
+MODULE_ID("$Id: panel.c,v 1.25 2010/01/23 21:22:16 tom Exp $")
 
 /*+-------------------------------------------------------------------------
 	_nc_retrace_panel (pan)
@@ -43,7 +45,7 @@
 NCURSES_EXPORT(PANEL *)
 _nc_retrace_panel(PANEL * pan)
 {
-  T((T_RETURN("%p"), pan));
+  T((T_RETURN("%p"), (void *)pan));
   return pan;
 }
 #endif
@@ -91,6 +93,8 @@
 {
   char s80[80];
 
+  GetPanelHook(pan);
+
   sprintf(s80, fmt, num, pan);
   _tracef("%s b=%s t=%s", s80,
 	  (_nc_bottom_panel) ? USER_PTR(_nc_bottom_panel->user) : "--",
diff -Naur ncurses-5.7.orig/panel/panel.h ncurses-5.7/panel/panel.h
--- ncurses-5.7.orig/panel/panel.h	2006-05-27 15:49:40.000000000 -0400
+++ ncurses-5.7/panel/panel.h	2011-01-08 18:13:50.755157082 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2001,2006 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2006,2009 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -29,9 +29,10 @@
 /****************************************************************************
  *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1995                    *
  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
+ *     and: Juergen Pfeifer                         1996-1999,2008          *
  ****************************************************************************/
 
-/* $Id: panel.h,v 1.10 2006/05/27 19:49:40 tom Exp $ */
+/* $Id: panel.h,v 1.11 2009/04/11 19:50:40 tom Exp $ */
 
 /* panel.h -- interface file for panels library */
 
@@ -68,6 +69,13 @@
 extern NCURSES_EXPORT(int)     replace_panel (PANEL *,WINDOW *);
 extern NCURSES_EXPORT(int)     panel_hidden (const PANEL *);
 
+#if NCURSES_SP_FUNCS
+extern NCURSES_EXPORT(PANEL *) ground_panel(SCREEN *);
+extern NCURSES_EXPORT(PANEL *) ceiling_panel(SCREEN *);
+
+extern NCURSES_EXPORT(void)    NCURSES_SP_NAME(update_panels) (SCREEN*);
+#endif
+
 #if	defined(__cplusplus)
 }
 #endif
diff -Naur ncurses-5.7.orig/panel/panel.priv.h ncurses-5.7/panel/panel.priv.h
--- ncurses-5.7.orig/panel/panel.priv.h	2008-09-27 18:36:11.000000000 -0400
+++ ncurses-5.7/panel/panel.priv.h	2011-01-08 18:13:50.755157082 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2005,2008 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2008,2009 Free 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: panel.priv.h,v 1.22 2008/09/27 22:36:11 tom Exp $ */
+/* $Id: panel.priv.h,v 1.23 2009/04/11 20:33:55 tom Exp $ */
 
 #ifndef NCURSES_PANEL_PRIV_H
 #define NCURSES_PANEL_PRIV_H 1
@@ -39,9 +39,11 @@
 #include <string.h>
 #include <assert.h>
 
-#include "curses.priv.h"
+struct screen;              /* forward declaration */
+
+#include "curses.priv.h"    /* includes nc_panel.h */
 #include "panel.h"
-#include <nc_panel.h>
+
 
 #if USE_RCS_IDS
 #  define MODULE_ID(id) static const char Ident[] = id;
@@ -83,14 +85,38 @@
 #  define Touchline(pan,start,count) touchline((pan)->win,start,count)
 #endif
 
+#if NCURSES_SP_FUNCS
+#define GetScreenHook(sp) \
+			struct panelhook* ph = NCURSES_SP_NAME(_nc_panelhook)(sp)
+#define GetPanelHook(pan) \
+			GetScreenHook(_nc_screen_of((pan)->win))
+#define GetWindowHook(win) \
+			SCREEN* sp = _nc_screen_of(win); \
+			GetScreenHook(sp)
+#define GetHook(pan)	SCREEN* sp = _nc_screen_of(pan->win); \
+			GetScreenHook(sp)
+
+#define _nc_stdscr_pseudo_panel ((ph)->stdscr_pseudo_panel)
+#define _nc_top_panel           ((ph)->top_panel)
+#define _nc_bottom_panel        ((ph)->bottom_panel)
+
+#else	/* !NCURSES_SP_FUNCS */
+
+#define GetScreenHook(sp) /* nothing */
+#define GetPanelHook(pan) /* nothing */
+#define GetWindowHook(win) /* nothing */
+#define GetHook(pan) /* nothing */
+
 #define _nc_stdscr_pseudo_panel _nc_panelhook()->stdscr_pseudo_panel
-#define _nc_top_panel _nc_panelhook()->top_panel
-#define _nc_bottom_panel _nc_panelhook()->bottom_panel
+#define _nc_top_panel           _nc_panelhook()->top_panel
+#define _nc_bottom_panel        _nc_panelhook()->bottom_panel
 
-#define EMPTY_STACK() (_nc_top_panel==_nc_bottom_panel)
-#define Is_Bottom(p)  (((p)!=(PANEL*)0) && !EMPTY_STACK() && (_nc_bottom_panel->above==(p)))
-#define Is_Top(p) (((p)!=(PANEL*)0) && !EMPTY_STACK() && (_nc_top_panel==(p)))
-#define Is_Pseudo(p) ((p) && ((p)==_nc_bottom_panel))
+#endif	/* NCURSES_SP_FUNCS */
+
+#define EMPTY_STACK() (_nc_top_panel == _nc_bottom_panel)
+#define Is_Bottom(p)  (((p) != (PANEL*)0) && !EMPTY_STACK() && (_nc_bottom_panel->above == (p)))
+#define Is_Top(p)     (((p) != (PANEL*)0) && !EMPTY_STACK() && (_nc_top_panel == (p)))
+#define Is_Pseudo(p)  (((p) != (PANEL*)0) && ((p) == _nc_bottom_panel))
 
 /*+-------------------------------------------------------------------------
 	IS_LINKED(pan) - check to see if panel is in the stack
@@ -122,7 +148,7 @@
    ix2 = (PENDX(pan1)   < PENDX(pan2))   ? PENDX(pan1)   : PENDX(pan2);\
    iy1 = (PSTARTY(pan1) < PSTARTY(pan2)) ? PSTARTY(pan2) : PSTARTY(pan1);\
    iy2 = (PENDY(pan1)   < PENDY(pan2))   ? PENDY(pan1)   : PENDY(pan2);\
-   assert((ix1<=ix2) && (iy1<=iy2));\
+   assert((ix1<=ix2) && (iy1<=iy2))
 
 
 /*+-------------------------------------------------------------------------
@@ -136,12 +162,12 @@
 {  PANEL* pan2 = ((panstart) ? (panstart) : _nc_bottom_panel);\
    while(pan2) {\
       if ((pan2 != pan) && PANELS_OVERLAPPED(pan,pan2)) {\
-        int y,ix1,ix2,iy1,iy2;\
-        COMPUTE_INTERSECTION(pan,pan2,ix1,ix2,iy1,iy2);\
+        int y, ix1, ix2, iy1, iy2;\
+        COMPUTE_INTERSECTION(pan, pan2, ix1, ix2, iy1, iy2);\
 	for(y = iy1; y <= iy2; y++) {\
 	  if (is_linetouched(pan->win,y - PSTARTY(pan))) {\
             struct ldat* line = &(pan2->win->_line[y - PSTARTY(pan2)]);\
-            CHANGED_RANGE(line,ix1-PSTARTX(pan2),ix2-PSTARTX(pan2));\
+            CHANGED_RANGE(line, ix1 - PSTARTX(pan2), ix2 - PSTARTX(pan2));\
           }\
 	}\
       }\
@@ -180,4 +206,9 @@
       err = err_if_unlinked;\
   }
 
+#if NCURSES_SP_FUNCS
+/* These may become later renamed and part of panel.h and the public API */
+extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_update_panels)(SCREEN*);
+#endif
+
 #endif /* NCURSES_PANEL_PRIV_H */
diff -Naur ncurses-5.7.orig/progs/Makefile.in ncurses-5.7/progs/Makefile.in
--- ncurses-5.7.orig/progs/Makefile.in	2008-09-07 09:58:55.000000000 -0400
+++ ncurses-5.7/progs/Makefile.in	2011-01-08 18:18:29.574661327 -0500
@@ -1,6 +1,6 @@
-# $Id: Makefile.in,v 1.79 2008/09/07 13:58:55 tom Exp $
+# $Id: Makefile.in,v 1.85 2010/11/27 21:45:27 tom Exp $
 ##############################################################################
-# Copyright (c) 1998-2006,2007 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 "Software"), #
@@ -43,6 +43,7 @@
 .SUFFIXES:
 
 SHELL		= /bin/sh
+VPATH		= @srcdir@
 THIS		= Makefile
 
 CF_MFLAGS 	= @cf_cv_makeflags@
@@ -76,6 +77,9 @@
 AWK		= @AWK@
 LN_S		= @LN_S@
 
+CTAGS		= @CTAGS@
+ETAGS		= @ETAGS@
+
 CC		= @CC@
 CPP		= @CPP@
 CFLAGS		= @CFLAGS@
@@ -124,7 +128,7 @@
 	transform.h
 
 # tic relies on direct access to the terminfo database
-GET_PROGS = infocmp$x clear$x tput$x tset$x toe$x
+GET_PROGS = infocmp$x clear$x tabs$x tput$x tset$x toe$x
 PUT_PROGS = @MAKE_TERMINFO@ tic$x
 PROGS = $(PUT_PROGS) $(GET_PROGS)
 
@@ -159,6 +163,7 @@
 actual_infotocap = `echo infotocap$x| $(TRANSFORM)`
 actual_init      = `echo init$x|      $(TRANSFORM)`
 actual_reset     = `echo reset$x|     $(TRANSFORM)`
+actual_tabs      = `echo tabs$x|      $(TRANSFORM)`
 actual_tic       = `echo tic$x|       $(TRANSFORM)`
 actual_toe       = `echo toe$x|       $(TRANSFORM)`
 actual_tput      = `echo tput$x|      $(TRANSFORM)`
@@ -171,10 +176,16 @@
 define_reset     = `echo reset|       $(TRANSFORM)`
 
 transform.h :
-	echo "#define PROG_CAPTOINFO \"$(define_captoinfo)\"" >$@
-	echo "#define PROG_INFOTOCAP \"$(define_infotocap)\"" >>$@
-	echo "#define PROG_RESET     \"$(define_reset)\""     >>$@
-	echo "#define PROG_INIT      \"$(define_init)\""      >>$@
+	echo "#ifndef __TRANSFORM_H"					>$@
+	echo "#define __TRANSFORM_H 1"					>>$@
+	echo "#include <progs.priv.h>"					>>$@
+	echo "extern bool same_program(const char *, const char *);"	>>$@
+	-sh -c 'if test -n "$x" ; then echo "#define SUFFIX_IGNORED \"$x\"">>$@; fi'
+	echo "#define PROG_CAPTOINFO \"$(define_captoinfo)\""		>>$@
+	echo "#define PROG_INFOTOCAP \"$(define_infotocap)\""		>>$@
+	echo "#define PROG_RESET     \"$(define_reset)\""		>>$@
+	echo "#define PROG_INIT      \"$(define_init)\""		>>$@
+	echo "#endif /* __TRANSFORM_H */"				>>$@
 
 install.progs: $(AUTO_SRC) $(PROGS) $(DESTDIR)$(bindir)
 @MAKE_TERMINFO@	$(LIBTOOL_INSTALL) $(INSTALL_PROG) tic$x     $(DESTDIR)$(bindir)/$(actual_tic)
@@ -187,6 +198,7 @@
 @MAKE_TERMINFO@	(cd $(DESTDIR)$(bindir) && $(LN_S) $(actual_tic) $(actual_captoinfo))
 	$(LIBTOOL_INSTALL) $(INSTALL_PROG) infocmp$x $(DESTDIR)$(bindir)/$(actual_infocmp)
 	$(LIBTOOL_INSTALL) $(INSTALL_PROG) clear$x   $(DESTDIR)$(bindir)/$(actual_clear)
+	$(LIBTOOL_INSTALL) $(INSTALL_PROG) tabs$x    $(DESTDIR)$(bindir)/$(actual_tabs)
 	$(LIBTOOL_INSTALL) $(INSTALL_PROG) tput$x    $(DESTDIR)$(bindir)/$(actual_tput)
 	$(LIBTOOL_INSTALL) $(INSTALL_PROG) tset$x    $(DESTDIR)$(bindir)/$(actual_tset)
 	@echo "linking $(actual_reset) to $(actual_tset)"
@@ -200,12 +212,13 @@
 @MAKE_TERMINFO@	-@rm -f $(DESTDIR)$(bindir)/$(actual_infotocap)
 	-@$(LIBTOOL_CLEAN) rm -f $(DESTDIR)$(bindir)/$(actual_infocmp)
 	-@$(LIBTOOL_CLEAN) rm -f $(DESTDIR)$(bindir)/$(actual_clear)
+	-@$(LIBTOOL_CLEAN) rm -f $(DESTDIR)$(bindir)/$(actual_tabs)
 	-@$(LIBTOOL_CLEAN) rm -f $(DESTDIR)$(bindir)/$(actual_tput)
 	-@$(LIBTOOL_CLEAN) rm -f $(DESTDIR)$(bindir)/$(actual_tset)
 	-@rm -f $(DESTDIR)$(bindir)/$(actual_reset)
 
 $(DESTDIR)$(bindir) :
-	sh $(srcdir)/../mkdirs.sh $@
+	mkdir -p $@
 
 #
 # Utilities normally built by make all start here
@@ -213,7 +226,8 @@
 
 DEPS_TIC = \
 	$(MODEL)/tic$o \
-	$(MODEL)/dump_entry$o
+	$(MODEL)/dump_entry$o \
+	$(MODEL)/transform$o
 
 tic$x: $(DEPS_TIC) $(DEPS_CURSES) transform.h
 	@ECHO_LINK@ $(LINK) $(DEPS_TIC) $(LDFLAGS_TIC) -o $@
@@ -230,8 +244,15 @@
 clear$x: $(DEPS_CLEAR) $(DEPS_CURSES)
 	@ECHO_LINK@ $(LINK) $(DEPS_CLEAR) $(LDFLAGS_TINFO) -o $@
 
+DEPS_TABS = \
+	$(MODEL)/tabs$o
+
+tabs$x: $(DEPS_TABS) $(DEPS_TABS)
+	@ECHO_LINK@ $(LINK) $(DEPS_TABS) $(LDFLAGS_TINFO) -o $@
+
 DEPS_TPUT = \
-	$(MODEL)/tput$o
+	$(MODEL)/tput$o \
+	$(MODEL)/transform$o
 
 tput$x: $(DEPS_TPUT) $(DEPS_CURSES) transform.h
 	@ECHO_LINK@ $(LINK) $(DEPS_TPUT) $(LDFLAGS_TINFO) -o $@
@@ -244,7 +265,8 @@
 	@ECHO_LINK@ $(LINK) $(DEPS_INFOCMP) $(LDFLAGS_TIC) -o $@
 
 DEPS_TSET = \
-	$(MODEL)/tset$o
+	$(MODEL)/tset$o \
+	$(MODEL)/transform$o
 
 tset$x: $(DEPS_TSET) $(DEPS_CURSES) transform.h
 	@ECHO_LINK@ $(LINK) $(DEPS_TSET) $(LDFLAGS_TINFO) -o $@
@@ -257,10 +279,10 @@
 #
 
 tags:
-	ctags *.[ch]
+	$(CTAGS) *.[ch]
 
 @MAKE_UPPER_TAGS@TAGS:
-@MAKE_UPPER_TAGS@	etags *.[ch]
+@MAKE_UPPER_TAGS@	$(ETAGS) *.[ch]
 
 mostlyclean ::
 	-rm -f core tags TAGS *~ *.bak *.i *.ln *.atac trace
@@ -289,6 +311,7 @@
 @MAKE_TERMINFO@	$(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/toe.c     $(srcdir)/dump_entry.c $(LINT_LIBS)
 	$(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/clear.c                          $(LINT_LIBS)
 	$(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/infocmp.c $(srcdir)/dump_entry.c $(LINT_LIBS)
+	$(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/tabs.c                           $(LINT_LIBS)
 	$(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/tput.c                           $(LINT_LIBS)
 	$(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/tset.c    $(srcdir)/dump_entry.c $(LINT_LIBS)
 
diff -Naur ncurses-5.7.orig/progs/dump_entry.c ncurses-5.7/progs/dump_entry.c
--- ncurses-5.7.orig/progs/dump_entry.c	2008-08-04 08:36:12.000000000 -0400
+++ ncurses-5.7/progs/dump_entry.c	2011-01-08 18:13:50.759156955 -0500
@@ -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            *
@@ -39,7 +39,7 @@
 #include "termsort.c"		/* this C file is generated */
 #include <parametrized.h>	/* so is this */
 
-MODULE_ID("$Id: dump_entry.c,v 1.88 2008/08/04 12:36:12 tom Exp $")
+MODULE_ID("$Id: dump_entry.c,v 1.89 2010/05/01 22:04:08 tom Exp $")
 
 #define INDENT			8
 #define DISCARD(string) string = ABSENT_STRING
@@ -1040,7 +1040,7 @@
 
     save_sgr = set_attributes;
 
-    if (((len = FMT_ENTRY()) > critlen)
+    if ((FMT_ENTRY() > critlen)
 	&& limited) {
 
 	save_tterm = *tterm;
@@ -1049,7 +1049,7 @@
 		     critlen);
 	    suppress_untranslatable = TRUE;
 	}
-	if ((len = FMT_ENTRY()) > critlen) {
+	if (FMT_ENTRY() > critlen) {
 	    /*
 	     * We pick on sgr because it's a nice long string capability that
 	     * is really just an optimization hack.  Another good candidate is
@@ -1075,7 +1075,7 @@
 				 critlen);
 		    }
 		    changed = TRUE;
-		    if ((len = FMT_ENTRY()) <= critlen)
+		    if (FMT_ENTRY() <= critlen)
 			break;
 		}
 	    }
@@ -1086,7 +1086,7 @@
 			 critlen);
 		changed = TRUE;
 	    }
-	    if (!changed || ((len = FMT_ENTRY()) > critlen)) {
+	    if (!changed || (FMT_ENTRY() > critlen)) {
 		if (purged_acs(tterm)) {
 		    acs_chars = ABSENT_STRING;
 		    SHOW_WHY("# (acsc removed to fit entry within %d bytes)\n",
@@ -1094,7 +1094,7 @@
 		    changed = TRUE;
 		}
 	    }
-	    if (!changed || ((len = FMT_ENTRY()) > critlen)) {
+	    if (!changed || (FMT_ENTRY() > critlen)) {
 		int oldversion = tversion;
 
 		tversion = V_BSD;
@@ -1130,7 +1130,7 @@
     } else if (!version_filter(STRING, STR_IDX(acs_chars))) {
 	save_tterm = *tterm;
 	if (purged_acs(tterm)) {
-	    len = FMT_ENTRY();
+	    (void) FMT_ENTRY();
 	}
 	*tterm = save_tterm;
     }
diff -Naur ncurses-5.7.orig/progs/infocmp.c ncurses-5.7/progs/infocmp.c
--- ncurses-5.7.orig/progs/infocmp.c	2008-08-16 18:04:56.000000000 -0400
+++ ncurses-5.7/progs/infocmp.c	2011-01-08 18:13:50.759156955 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2007,2008 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            *
@@ -42,7 +42,7 @@
 
 #include <dump_entry.h>
 
-MODULE_ID("$Id: infocmp.c,v 1.103 2008/08/16 22:04:56 tom Exp $")
+MODULE_ID("$Id: infocmp.c,v 1.105 2010/05/01 22:04:08 tom Exp $")
 
 #define L_CURL "{"
 #define R_CURL "}"
@@ -894,8 +894,6 @@
 
     (void) printf("The following entries are equivalent:\n");
     for (qp = heads[0]; qp; qp = qp->next) {
-	rp = qp->crosslinks[0];
-
 	if (qp->ncrosslinks == 1) {
 	    rp = qp->crosslinks[0];
 
@@ -1255,6 +1253,15 @@
  *
  ***************************************************************************/
 
+#if NO_LEAKS
+#define MAIN_LEAKS() \
+    free(myargv); \
+    free(tfile); \
+    free(tname)
+#else
+#define MAIN_LEAKS()		/* nothing */
+#endif
+
 int
 main(int argc, char *argv[])
 {
@@ -1514,6 +1521,7 @@
 #else
 		(void) fprintf(stderr, "%s: terminfo files not supported\n",
 			       _nc_progname);
+		MAIN_LEAKS();
 		ExitProgram(EXIT_FAILURE);
 #endif
 	    } else {
@@ -1526,7 +1534,6 @@
 		status = _nc_read_entry(tname[termcount],
 					tfile[termcount],
 					&entries[termcount].tterm);
-		directory = TERMINFO;	/* for error message */
 	    }
 
 	    if (status <= 0) {
@@ -1534,6 +1541,7 @@
 			       "%s: couldn't open terminfo file %s.\n",
 			       _nc_progname,
 			       tfile[termcount]);
+		MAIN_LEAKS();
 		ExitProgram(EXIT_FAILURE);
 	    }
 	    repair_acsc(&entries[termcount].tterm);
@@ -1642,11 +1650,7 @@
     else
 	file_comparison(argc - optind, argv + optind);
 
-#if NO_LEAKS
-    free(myargv);
-    free(tfile);
-    free(tname);
-#endif
+    MAIN_LEAKS();
     ExitProgram(EXIT_SUCCESS);
 }
 
diff -Naur ncurses-5.7.orig/progs/modules ncurses-5.7/progs/modules
--- ncurses-5.7.orig/progs/modules	2006-12-23 19:53:21.000000000 -0500
+++ ncurses-5.7/progs/modules	2011-01-08 18:13:50.759156955 -0500
@@ -1,7 +1,7 @@
-# $Id: modules,v 1.13 2006/12/24 00:53:21 tom Exp $
+# $Id: modules,v 1.17 2010/01/23 17:47:23 tom Exp $
 # Program modules (some are in ncurses lib!)
 ##############################################################################
-# Copyright (c) 1998-2005,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 "Software"), #
@@ -34,10 +34,12 @@
 @ base
 clear		progs		$(srcdir)	$(HEADER_DEPS)
 tic		progs		$(srcdir)	$(HEADER_DEPS) transform.h $(srcdir)/dump_entry.h
-toe		progs		$(srcdir)	$(HEADER_DEPS)             $(srcdir)/dump_entry.h
+toe		progs		$(srcdir)	$(HEADER_DEPS)             $(INCDIR)/hashed_db.h
 dump_entry	progs		$(srcdir)	$(HEADER_DEPS)             $(srcdir)/dump_entry.h ../include/parametrized.h $(INCDIR)/capdefaults.c termsort.c
 infocmp		progs		$(srcdir)	$(HEADER_DEPS)             $(srcdir)/dump_entry.h
-tput		progs		$(srcdir)	$(HEADER_DEPS) transform.h termsort.c
+tabs		progs		$(srcdir)	$(HEADER_DEPS)
+tput		progs		$(srcdir)	$(HEADER_DEPS) transform.h $(srcdir)/dump_entry.h termsort.c
 tset		progs		$(srcdir)	$(HEADER_DEPS) transform.h $(srcdir)/dump_entry.h ../include/termcap.h
+transform	progs		$(srcdir)	$(HEADER_DEPS) transform.h
 
 # vile:makemode
diff -Naur ncurses-5.7.orig/progs/tabs.c ncurses-5.7/progs/tabs.c
--- ncurses-5.7.orig/progs/tabs.c	1969-12-31 19:00:00.000000000 -0500
+++ ncurses-5.7/progs/tabs.c	2011-01-08 18:18:29.430658518 -0500
@@ -0,0 +1,510 @@
+/****************************************************************************
+ * Copyright (c) 2008-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            *
+ * "Software"), to deal in the Software without restriction, including      *
+ * without limitation the rights to use, copy, modify, merge, publish,      *
+ * distribute, distribute with modifications, sublicense, and/or sell       *
+ * copies of the Software, and to permit persons to whom the Software is    *
+ * furnished to do so, subject to the following conditions:                 *
+ *                                                                          *
+ * The above copyright notice and this permission notice shall be included  *
+ * in all copies or substantial portions of the Software.                   *
+ *                                                                          *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
+ *                                                                          *
+ * Except as contained in this notice, the name(s) of the above copyright   *
+ * holders shall not be used in advertising or otherwise to promote the     *
+ * sale, use or other dealings in this Software without prior written       *
+ * authorization.                                                           *
+ ****************************************************************************/
+
+/****************************************************************************
+ *  Author: Thomas E. Dickey                        2008                    *
+ ****************************************************************************/
+
+/*
+ * tabs.c --  set terminal hard-tabstops
+ */
+
+#define USE_LIBTINFO
+#include <progs.priv.h>
+
+MODULE_ID("$Id: tabs.c,v 1.19 2010/10/23 22:26:01 tom Exp $")
+
+static void usage(void) GCC_NORETURN;
+
+static int max_cols;
+
+static int
+putch(int c)
+{
+    return putchar(c);
+}
+
+static void
+do_tabs(int *tab_list)
+{
+    int last = 1;
+    int stop;
+
+    putchar('\r');
+    while ((stop = *tab_list++) > 0) {
+	if (last < stop) {
+	    while (last++ < stop) {
+		if (last > max_cols)
+		    break;
+		putchar(' ');
+	    }
+	}
+	if (stop <= max_cols) {
+	    tputs(tparm(set_tab, stop), 1, putch);
+	    last = stop;
+	} else {
+	    break;
+	}
+    }
+    putchar('\n');
+}
+
+static int *
+decode_tabs(const char *tab_list)
+{
+    int *result = typeCalloc(int, strlen(tab_list) + (unsigned) max_cols);
+    int n = 0;
+    int value = 0;
+    int prior = 0;
+    int ch;
+
+    if (result != 0) {
+	while ((ch = *tab_list++) != '\0') {
+	    if (isdigit(UChar(ch))) {
+		value *= 10;
+		value += (ch - '0');
+	    } else if (ch == ',') {
+		result[n] = value + prior;
+		if (n > 0 && result[n] <= result[n - 1]) {
+		    fprintf(stderr,
+			    "tab-stops are not in increasing order: %d %d\n",
+			    value, result[n - 1]);
+		    free(result);
+		    result = 0;
+		    break;
+		}
+		++n;
+		value = 0;
+		prior = 0;
+	    } else if (ch == '+') {
+		if (n)
+		    prior = result[n - 1];
+	    }
+	}
+    }
+
+    if (result != 0) {
+	/*
+	 * If there is only one value, then it is an option such as "-8".
+	 */
+	if ((n == 0) && (value > 0)) {
+	    int step = value;
+	    while (n < max_cols - 1) {
+		result[n++] = value;
+		value += step;
+	    }
+	}
+
+	/*
+	 * Add the last value, if any.
+	 */
+	result[n++] = value + prior;
+	result[n] = 0;
+    }
+    return result;
+}
+
+static void
+print_ruler(int *tab_list)
+{
+    int last = 0;
+    int stop;
+    int n;
+
+    /* first print a readable ruler */
+    for (n = 0; n < max_cols; n += 10) {
+	int ch = 1 + (n / 10);
+	char buffer[20];
+	sprintf(buffer, "----+----%c",
+		((ch < 10)
+		 ? (ch + '0')
+		 : (ch + 'A' - 10)));
+	printf("%.*s", ((max_cols - n) > 10) ? 10 : (max_cols - n), buffer);
+    }
+    putchar('\n');
+
+    /* now, print '*' for each stop */
+    for (n = 0, last = 0; (tab_list[n] > 0) && (last < max_cols); ++n) {
+	stop = tab_list[n];
+	while (++last < stop) {
+	    if (last <= max_cols) {
+		putchar('-');
+	    } else {
+		break;
+	    }
+	}
+	if (last <= max_cols) {
+	    putchar('*');
+	    last = stop;
+	} else {
+	    break;
+	}
+    }
+    while (++last <= max_cols)
+	putchar('-');
+    putchar('\n');
+}
+
+/*
+ * Write an '*' on each tabstop, to demonstrate whether it lines up with the
+ * ruler.
+ */
+static void
+write_tabs(int *tab_list)
+{
+    int stop;
+
+    while ((stop = *tab_list++) > 0 && stop <= max_cols) {
+	fputs((stop == 1) ? "*" : "\t*", stdout);
+    };
+    /* also show a tab _past_ the stops */
+    if (stop < max_cols)
+	fputs("\t+", stdout);
+    putchar('\n');
+}
+
+/*
+ * Trim leading/trailing blanks, as well as blanks after a comma.
+ * Convert embedded blanks to commas.
+ */
+static char *
+trimmed_tab_list(const char *source)
+{
+    char *result = strdup(source);
+    int ch, j, k, last;
+
+    if (result != 0) {
+	for (j = k = last = 0; result[j] != 0; ++j) {
+	    ch = UChar(result[j]);
+	    if (isspace(ch)) {
+		if (last == '\0') {
+		    continue;
+		} else if (isdigit(last) || last == ',') {
+		    ch = ',';
+		}
+	    } else if (ch == ',') {
+		;
+	    } else {
+		if (last == ',')
+		    result[k++] = (char) last;
+		result[k++] = (char) ch;
+	    }
+	    last = ch;
+	}
+	result[k] = '\0';
+    }
+    return result;
+}
+
+static bool
+comma_is_needed(const char *source)
+{
+    bool result = FALSE;
+
+    if (source != 0) {
+	unsigned len = strlen(source);
+	if (len != 0)
+	    result = (source[len - 1] != ',');
+    } else {
+	result = FALSE;
+    }
+    return result;
+}
+
+/*
+ * Add a command-line parameter to the tab-list.  It can be blank- or comma-
+ * separated (or a mixture).  For simplicity, empty tabs are ignored, e.g.,
+ *	tabs 1,,6,11
+ *	tabs 1,6,11
+ * are treated the same.
+ */
+static const char *
+add_to_tab_list(char **append, const char *value)
+{
+    char *result = *append;
+    char *copied = trimmed_tab_list(value);
+
+    if (copied != 0 && *copied != '\0') {
+	const char *comma = ",";
+	unsigned need = 1 + strlen(copied);
+
+	if (*copied == ',')
+	    comma = "";
+	else if (!comma_is_needed(*append))
+	    comma = "";
+
+	need += strlen(comma);
+	if (*append != 0)
+	    need += strlen(*append);
+
+	result = malloc(need);
+	if (result != 0) {
+	    *result = '\0';
+	    if (*append != 0) {
+		strcpy(result, *append);
+		free(*append);
+	    }
+	    strcat(result, comma);
+	    strcat(result, copied);
+	}
+
+	*append = result;
+    }
+    return result;
+}
+
+/*
+ * Check for illegal characters in the tab-list.
+ */
+static bool
+legal_tab_list(const char *program, const char *tab_list)
+{
+    bool result = TRUE;
+
+    if (tab_list != 0 && *tab_list != '\0') {
+	if (comma_is_needed(tab_list)) {
+	    int n, ch;
+	    for (n = 0; tab_list[n] != '\0'; ++n) {
+		ch = UChar(tab_list[n]);
+		if (!(isdigit(ch) || ch == ',' || ch == '+')) {
+		    fprintf(stderr,
+			    "%s: unexpected character found '%c'\n",
+			    program, ch);
+		    result = FALSE;
+		    break;
+		}
+	    }
+	} else {
+	    fprintf(stderr, "%s: trailing comma found '%s'\n", program, tab_list);
+	    result = FALSE;
+	}
+    } else {
+	fprintf(stderr, "%s: no tab-list given\n", program);
+	result = FALSE;
+    }
+    return result;
+}
+
+static void
+usage(void)
+{
+    static const char *msg[] =
+    {
+	"Usage: tabs [options] [tabstop-list]"
+	,""
+	,"Options:"
+	,"  -0       reset tabs"
+	,"  -8       set tabs to standard interval"
+	,"  -a       Assembler, IBM S/370, first format"
+	,"  -a2      Assembler, IBM S/370, second format"
+	,"  -c       COBOL, normal format"
+	,"  -c2      COBOL compact format"
+	,"  -c3      COBOL compact format extended"
+	,"  -d       debug (show ruler with expected/actual tab positions)"
+	,"  -f       FORTRAN"
+	,"  -n       no-op (do not modify terminal settings)"
+	,"  -p       PL/I"
+	,"  -s       SNOBOL"
+	,"  -u       UNIVAC 1100 Assembler"
+	,"  -T name  use terminal type 'name'"
+	,""
+	,"A tabstop-list is an ordered list of column numbers, e.g., 1,11,21"
+	,"or 1,+10,+10 which is the same."
+    };
+    unsigned n;
+
+    fflush(stdout);
+    for (n = 0; n < SIZEOF(msg); ++n) {
+	fprintf(stderr, "%s\n", msg[n]);
+    }
+    ExitProgram(EXIT_FAILURE);
+}
+
+int
+main(int argc, char *argv[])
+{
+    int rc = EXIT_FAILURE;
+    bool debug = FALSE;
+    bool no_op = FALSE;
+    int n, ch;
+    NCURSES_CONST char *term_name = 0;
+    const char *mar_list = 0;	/* ignored */
+    char *append = 0;
+    const char *tab_list = 0;
+
+    if ((term_name = getenv("TERM")) == 0)
+	term_name = "ansi+tabs";
+
+    /* cannot use getopt, since some options are two-character */
+    for (n = 1; n < argc; ++n) {
+	char *option = argv[n];
+	switch (option[0]) {
+	case '-':
+	    while ((ch = *++option) != '\0') {
+		switch (ch) {
+		case 'a':
+		    switch (*option) {
+		    case '\0':
+			tab_list = "1,10,16,36,72";
+			/* Assembler, IBM S/370, first format */
+			break;
+		    case '2':
+			tab_list = "1,10,16,40,72";
+			/* Assembler, IBM S/370, second format */
+			break;
+		    default:
+			usage();
+		    }
+		    break;
+		case 'c':
+		    switch (*option) {
+		    case '\0':
+			tab_list = "1,8,12,16,20,55";
+			/* COBOL, normal format */
+			break;
+		    case '2':
+			tab_list = "1,6,10,14,49";
+			/* COBOL compact format */
+			break;
+		    case '3':
+			tab_list = "1,6,10,14,18,22,26,30,34,38,42,46,50,54,58,62,67";
+			/* COBOL compact format extended */
+			break;
+		    default:
+			usage();
+		    }
+		    break;
+		case 'd':	/* ncurses extension */
+		    debug = TRUE;
+		    break;
+		case 'f':
+		    tab_list = "1,7,11,15,19,23";
+		    /* FORTRAN */
+		    break;
+		case 'n':	/* ncurses extension */
+		    no_op = TRUE;
+		    break;
+		case 'p':
+		    tab_list = "1,5,9,13,17,21,25,29,33,37,41,45,49,53,57,61";
+		    /* PL/I */
+		    break;
+		case 's':
+		    tab_list = "1,10,55";
+		    /* SNOBOL */
+		    break;
+		case 'u':
+		    tab_list = "1,12,20,44";
+		    /* UNIVAC 1100 Assembler */
+		    break;
+		case 'T':
+		    ++n;
+		    if (*++option != '\0') {
+			term_name = option;
+		    } else {
+			term_name = argv[n++];
+		    }
+		    option += ((int) strlen(option)) - 1;
+		    continue;
+		default:
+		    if (isdigit(UChar(*option))) {
+			tab_list = option;
+			++n;
+		    } else {
+			usage();
+		    }
+		    option += ((int) strlen(option)) - 1;
+		    break;
+		}
+	    }
+	    break;
+	case '+':
+	    while ((ch = *++option) != '\0') {
+		switch (ch) {
+		case 'm':
+		    mar_list = option;
+		    break;
+		default:
+		    /* special case of relative stops separated by spaces? */
+		    if (option == argv[n] + 1) {
+			tab_list = add_to_tab_list(&append, argv[n]);
+		    }
+		    break;
+		}
+	    }
+	    break;
+	default:
+	    if (append != 0) {
+		if (tab_list != (const char *) append) {
+		    /* one of the predefined options was used */
+		    free(append);
+		    append = 0;
+		}
+	    }
+	    tab_list = add_to_tab_list(&append, option);
+	    break;
+	}
+    }
+
+    setupterm(term_name, STDOUT_FILENO, (int *) 0);
+
+    max_cols = (columns > 0) ? columns : 80;
+
+    if (!VALID_STRING(clear_all_tabs)) {
+	fprintf(stderr,
+		"%s: terminal type '%s' cannot reset tabs\n",
+		argv[0], term_name);
+    } else if (!VALID_STRING(set_tab)) {
+	fprintf(stderr,
+		"%s: terminal type '%s' cannot set tabs\n",
+		argv[0], term_name);
+    } else if (legal_tab_list(argv[0], tab_list)) {
+	int *list = decode_tabs(tab_list);
+
+	if (!no_op)
+	    tputs(clear_all_tabs, 1, putch);
+
+	if (list != 0) {
+	    if (!no_op)
+		do_tabs(list);
+	    if (debug) {
+		fflush(stderr);
+		printf("tabs %s\n", tab_list);
+		print_ruler(list);
+		write_tabs(list);
+	    }
+	    free(list);
+	} else if (debug) {
+	    fflush(stderr);
+	    printf("tabs %s\n", tab_list);
+	}
+	rc = EXIT_SUCCESS;
+    }
+    if (append != 0)
+	free(append);
+    ExitProgram(rc);
+}
diff -Naur ncurses-5.7.orig/progs/tic.c ncurses-5.7/progs/tic.c
--- ncurses-5.7.orig/progs/tic.c	2008-09-13 12:59:24.000000000 -0400
+++ ncurses-5.7/progs/tic.c	2011-01-08 18:18:29.370658252 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2007,2008 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            *
@@ -44,7 +44,7 @@
 #include <dump_entry.h>
 #include <transform.h>
 
-MODULE_ID("$Id: tic.c,v 1.137 2008/09/13 16:59:24 tom Exp $")
+MODULE_ID("$Id: tic.c,v 1.146 2010/10/02 22:45:40 tom Exp $")
 
 const char *_nc_progname = "tic";
 
@@ -342,8 +342,15 @@
     while (isspace(UChar(*src)))
 	src++;
     if (*src != '\0') {
-	char *dst = strcpy((char *) malloc(strlen(src) + 1), src);
-	size_t len = strlen(dst);
+	char *dst;
+	size_t len;
+
+	if ((dst = strdup(src)) == NULL)
+	    failed("strdup");
+
+	assert(dst != 0);
+
+	len = strlen(dst);
 	while (--len != 0 && isspace(UChar(dst[len])))
 	    dst[len] = '\0';
 	return dst;
@@ -495,11 +502,11 @@
 
     _nc_progname = _nc_rootname(argv[0]);
 
-    if ((infodump = (strcmp(_nc_progname, PROG_CAPTOINFO) == 0)) != FALSE) {
+    if ((infodump = same_program(_nc_progname, PROG_CAPTOINFO)) != FALSE) {
 	outform = F_TERMINFO;
 	sortmode = S_TERMINFO;
     }
-    if ((capdump = (strcmp(_nc_progname, PROG_INFOTOCAP) == 0)) != FALSE) {
+    if ((capdump = same_program(_nc_progname, PROG_INFOTOCAP)) != FALSE) {
 	outform = F_TERMCAP;
 	sortmode = S_TERMCAP;
     }
@@ -757,6 +764,7 @@
 			    put_translate(fgetc(tmp_fp));
 		    }
 
+		    repair_acsc(&qp->tterm);
 		    dump_entry(&qp->tterm, suppress_untranslatable,
 			       limited, numbers, NULL);
 		    for (j = 0; j < (int) qp->nuses; j++)
@@ -923,6 +931,156 @@
     return result;
 }
 
+/*
+ * list[] is down, up, left, right
+ * "left" may be ^H rather than \E[D
+ * "down" may be ^J rather than \E[B
+ * But up/right are generally consistently escape sequences for ANSI terminals.
+ */
+static void
+check_ansi_cursor(char *list[4])
+{
+    int j, k;
+    int want;
+    size_t prefix = 0;
+    size_t suffix;
+    bool skip[4];
+    bool repeated = FALSE;
+
+    for (j = 0; j < 4; ++j) {
+	skip[j] = FALSE;
+	for (k = 0; k < j; ++k) {
+	    if (j != k
+		&& !strcmp(list[j], list[k])) {
+		char *value = _nc_tic_expand(list[k], TRUE, 0);
+		_nc_warning("repeated cursor control %s\n", value);
+		repeated = TRUE;
+	    }
+	}
+    }
+    if (!repeated) {
+	char *up = list[1];
+
+	if (UChar(up[0]) == '\033') {
+	    if (up[1] == '[') {
+		prefix = 2;
+	    } else {
+		prefix = 1;
+	    }
+	} else if (UChar(up[0]) == UChar('\233')) {
+	    prefix = 1;
+	}
+	if (prefix) {
+	    suffix = prefix;
+	    while (up[suffix] && isdigit(UChar(up[suffix])))
+		++suffix;
+	}
+	if (prefix && up[suffix] == 'A') {
+	    skip[1] = TRUE;
+	    if (!strcmp(list[0], "\n"))
+		skip[0] = TRUE;
+	    if (!strcmp(list[2], "\b"))
+		skip[2] = TRUE;
+
+	    for (j = 0; j < 4; ++j) {
+		if (skip[j] || strlen(list[j]) == 1)
+		    continue;
+		if (memcmp(list[j], up, prefix)) {
+		    char *value = _nc_tic_expand(list[j], TRUE, 0);
+		    _nc_warning("inconsistent prefix for %s\n", value);
+		    continue;
+		}
+		if (strlen(list[j]) < suffix) {
+		    char *value = _nc_tic_expand(list[j], TRUE, 0);
+		    _nc_warning("inconsistent length for %s, expected %d\n",
+				value, (int) suffix + 1);
+		    continue;
+		}
+		want = "BADC"[j];
+		if (list[j][suffix] != want) {
+		    char *value = _nc_tic_expand(list[j], TRUE, 0);
+		    _nc_warning("inconsistent suffix for %s, expected %c, have %c\n",
+				value, want, list[j][suffix]);
+		}
+	    }
+	}
+    }
+}
+
+#define EXPECTED(name) if (!PRESENT(name)) _nc_warning("expected " #name)
+
+static void
+check_cursor(TERMTYPE *tp)
+{
+    int count;
+    char *list[4];
+
+    /* if we have a parameterized form, then the non-parameterized is easy */
+    ANDMISSING(parm_down_cursor, cursor_down);
+    ANDMISSING(parm_up_cursor, cursor_up);
+    ANDMISSING(parm_left_cursor, cursor_left);
+    ANDMISSING(parm_right_cursor, cursor_right);
+
+    /* Given any of a set of cursor movement, the whole set should be present. 
+     * Technically this is not true (we could use cursor_address to fill in
+     * unsupported controls), but it is likely.
+     */
+    count = 0;
+    if (PRESENT(parm_down_cursor)) {
+	list[count++] = parm_down_cursor;
+    }
+    if (PRESENT(parm_up_cursor)) {
+	list[count++] = parm_up_cursor;
+    }
+    if (PRESENT(parm_left_cursor)) {
+	list[count++] = parm_left_cursor;
+    }
+    if (PRESENT(parm_right_cursor)) {
+	list[count++] = parm_right_cursor;
+    }
+    if (count == 4) {
+	check_ansi_cursor(list);
+    } else if (count != 0) {
+	EXPECTED(parm_down_cursor);
+	EXPECTED(parm_up_cursor);
+	EXPECTED(parm_left_cursor);
+	EXPECTED(parm_right_cursor);
+    }
+
+    count = 0;
+    if (PRESENT(cursor_down)) {
+	list[count++] = cursor_down;
+    }
+    if (PRESENT(cursor_up)) {
+	list[count++] = cursor_up;
+    }
+    if (PRESENT(cursor_left)) {
+	list[count++] = cursor_left;
+    }
+    if (PRESENT(cursor_right)) {
+	list[count++] = cursor_right;
+    }
+    if (count == 4) {
+	check_ansi_cursor(list);
+    } else if (count != 0) {
+	count = 0;
+	if (PRESENT(cursor_down) && strcmp(cursor_down, "\n"))
+	    ++count;
+	if (PRESENT(cursor_left) && strcmp(cursor_left, "\b"))
+	    ++count;
+	if (PRESENT(cursor_up) && strlen(cursor_up) > 1)
+	    ++count;
+	if (PRESENT(cursor_right) && strlen(cursor_right) > 1)
+	    ++count;
+	if (count) {
+	    EXPECTED(cursor_down);
+	    EXPECTED(cursor_up);
+	    EXPECTED(cursor_left);
+	    EXPECTED(cursor_right);
+	}
+    }
+}
+
 #define MAX_KP 5
 /*
  * Do a quick sanity-check for vt100-style keypads to see if the 5-key keypad
@@ -1032,6 +1190,32 @@
     }
 }
 
+static void
+check_printer(TERMTYPE *tp)
+{
+    PAIRED(enter_doublewide_mode, exit_doublewide_mode);
+    PAIRED(enter_italics_mode, exit_italics_mode);
+    PAIRED(enter_leftward_mode, exit_leftward_mode);
+    PAIRED(enter_micro_mode, exit_micro_mode);
+    PAIRED(enter_shadow_mode, exit_shadow_mode);
+    PAIRED(enter_subscript_mode, exit_subscript_mode);
+    PAIRED(enter_superscript_mode, exit_superscript_mode);
+    PAIRED(enter_upward_mode, exit_upward_mode);
+
+    ANDMISSING(start_char_set_def, stop_char_set_def);
+
+    /* if we have a parameterized form, then the non-parameterized is easy */
+    ANDMISSING(set_bottom_margin_parm, set_bottom_margin);
+    ANDMISSING(set_left_margin_parm, set_left_margin);
+    ANDMISSING(set_right_margin_parm, set_right_margin);
+    ANDMISSING(set_top_margin_parm, set_top_margin);
+
+    ANDMISSING(parm_down_micro, micro_down);
+    ANDMISSING(parm_left_micro, micro_left);
+    ANDMISSING(parm_right_micro, micro_right);
+    ANDMISSING(parm_up_micro, micro_up);
+}
+
 /*
  * Returns the expected number of parameters for the given capability.
  */
@@ -1268,6 +1452,8 @@
 	    } else if (delaying) {
 		a = skip_delay(a);
 		b = skip_delay(b);
+	    } else if ((*b == '0' || (*b == ';')) && *a == 'm') {
+		b++;
 	    } else {
 		a++;
 	    }
@@ -1411,7 +1597,9 @@
 
     check_acs(tp);
     check_colors(tp);
+    check_cursor(tp);
     check_keypad(tp);
+    check_printer(tp);
 
     /*
      * These may be mismatched because the terminal description relies on
@@ -1432,6 +1620,11 @@
     ANDMISSING(change_scroll_region, save_cursor);
     ANDMISSING(change_scroll_region, restore_cursor);
 
+    /*
+     * If we can clear tabs, we should be able to initialize them.
+     */
+    ANDMISSING(clear_all_tabs, set_tab);
+
     if (PRESENT(set_attributes)) {
 	char *zero = 0;
 
diff -Naur ncurses-5.7.orig/progs/toe.c ncurses-5.7/progs/toe.c
--- ncurses-5.7.orig/progs/toe.c	2008-08-16 17:53:25.000000000 -0400
+++ ncurses-5.7/progs/toe.c	2011-01-08 18:13:50.759156955 -0500
@@ -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            *
@@ -44,7 +44,7 @@
 #include <hashed_db.h>
 #endif
 
-MODULE_ID("$Id: toe.c,v 1.51 2008/08/16 21:53:25 tom Exp $")
+MODULE_ID("$Id: toe.c,v 1.52 2010/05/01 22:04:08 tom Exp $")
 
 #define isDotname(name) (!strcmp(name, ".") || !strcmp(name, ".."))
 
@@ -61,6 +61,13 @@
 }
 #endif
 
+static void
+failed(const char *msg)
+{
+    perror(msg);
+    ExitProgram(EXIT_FAILURE);
+}
+
 #if USE_HASHED_DB
 static bool
 make_db_name(char *dst, const char *src, unsigned limit)
@@ -184,10 +191,10 @@
 		DIRENT *entry;
 
 		cwd_buf = typeRealloc(char, cwd_len, cwd_buf);
-		if (cwd_buf == 0) {
-		    perror("realloc cwd_buf");
-		    continue;
-		}
+		if (cwd_buf == 0)
+		    failed("realloc cwd_buf");
+
+		assert(cwd_buf != 0);
 
 		strncpy(name_1, subdir->d_name, len)[len] = '\0';
 		if (isDotname(name_1))
@@ -480,6 +487,10 @@
 	    }
 	    if (!pass) {
 		eargv = typeCalloc(char *, count + 1);
+		if (eargv == 0)
+		    failed("realloc eargv");
+
+		assert(eargv != 0);
 	    } else {
 		code = typelist((int) count, eargv, header, deschook);
 		while (count-- > 0)
diff -Naur ncurses-5.7.orig/progs/tput.c ncurses-5.7/progs/tput.c
--- ncurses-5.7.orig/progs/tput.c	2008-07-13 07:05:12.000000000 -0400
+++ ncurses-5.7/progs/tput.c	2011-01-08 18:13:50.759156955 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2007,2008 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            *
@@ -47,7 +47,7 @@
 #endif
 #include <transform.h>
 
-MODULE_ID("$Id: tput.c,v 1.42 2008/07/13 11:05:12 tom Exp $")
+MODULE_ID("$Id: tput.c,v 1.46 2010/01/09 16:53:24 tom Exp $")
 
 #define PUTS(s)		fputs(s, stdout)
 #define PUTCHAR(c)	putchar(c)
@@ -86,8 +86,8 @@
 static void
 check_aliases(const char *name)
 {
-    is_init = (strcmp(name, PROG_INIT) == 0);
-    is_reset = (strcmp(name, PROG_RESET) == 0);
+    is_init = same_program(name, PROG_INIT);
+    is_reset = same_program(name, PROG_RESET);
 }
 
 /*
@@ -153,6 +153,9 @@
     int i, j, c;
     int status;
     FILE *f;
+#if !PURE_TERMINFO
+    bool termcap = FALSE;
+#endif
 
     if ((name = argv[0]) == 0)
 	name = "";
@@ -265,35 +268,40 @@
 	return 0;
     }
 #if !PURE_TERMINFO
-    {
-	const struct name_table_entry *np;
-
-	if ((np = _nc_find_entry(name, _nc_get_hash_table(1))) != 0)
-	    switch (np->nte_type) {
-	    case BOOLEAN:
-		if (bool_from_termcap[np->nte_index])
-		    name = boolnames[np->nte_index];
-		break;
-
-	    case NUMBER:
-		if (num_from_termcap[np->nte_index])
-		    name = numnames[np->nte_index];
-		break;
-
-	    case STRING:
-		if (str_from_termcap[np->nte_index])
-		    name = strnames[np->nte_index];
-		break;
-	    }
-    }
+  retry:
 #endif
-
     if ((status = tigetflag(name)) != -1) {
 	return exit_code(BOOLEAN, status);
     } else if ((status = tigetnum(name)) != CANCELLED_NUMERIC) {
 	(void) printf("%d\n", status);
 	return exit_code(NUMBER, 0);
     } else if ((s = tigetstr(name)) == CANCELLED_STRING) {
+#if !PURE_TERMINFO
+	if (!termcap) {
+	    const struct name_table_entry *np;
+
+	    termcap = TRUE;
+	    if ((np = _nc_find_entry(name, _nc_get_hash_table(termcap))) != 0) {
+		switch (np->nte_type) {
+		case BOOLEAN:
+		    if (bool_from_termcap[np->nte_index])
+			name = boolnames[np->nte_index];
+		    break;
+
+		case NUMBER:
+		    if (num_from_termcap[np->nte_index])
+			name = numnames[np->nte_index];
+		    break;
+
+		case STRING:
+		    if (str_from_termcap[np->nte_index])
+			name = strnames[np->nte_index];
+		    break;
+		}
+		goto retry;
+	    }
+	}
+#endif
 	quit(4, "unknown terminfo capability '%s'", name);
     } else if (s != ABSENT_STRING) {
 	if (argc > 1) {
diff -Naur ncurses-5.7.orig/progs/transform.c ncurses-5.7/progs/transform.c
--- ncurses-5.7.orig/progs/transform.c	1969-12-31 19:00:00.000000000 -0500
+++ ncurses-5.7/progs/transform.c	2011-01-08 18:18:29.174655709 -0500
@@ -0,0 +1,79 @@
+/****************************************************************************
+ * Copyright (c) 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            *
+ * "Software"), to deal in the Software without restriction, including      *
+ * without limitation the rights to use, copy, modify, merge, publish,      *
+ * distribute, distribute with modifications, sublicense, and/or sell       *
+ * copies of the Software, and to permit persons to whom the Software is    *
+ * furnished to do so, subject to the following conditions:                 *
+ *                                                                          *
+ * The above copyright notice and this permission notice shall be included  *
+ * in all copies or substantial portions of the Software.                   *
+ *                                                                          *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
+ *                                                                          *
+ * Except as contained in this notice, the name(s) of the above copyright   *
+ * holders shall not be used in advertising or otherwise to promote the     *
+ * sale, use or other dealings in this Software without prior written       *
+ * authorization.                                                           *
+ ****************************************************************************/
+
+/****************************************************************************
+ *  Author: Thomas E. Dickey                                                *
+ ****************************************************************************/
+#include <progs.priv.h>
+#include <string.h>
+
+#include <transform.h>
+
+MODULE_ID("$Id: transform.c,v 1.2 2010/09/04 21:16:17 tom Exp $")
+
+#ifdef SUFFIX_IGNORED
+static void
+trim_suffix(const char *a, unsigned *len)
+{
+    const char ignore[] = SUFFIX_IGNORED;
+
+    if (sizeof(ignore) != 0) {
+	bool trim = FALSE;
+	unsigned need = (sizeof(ignore) - 1);
+
+	if (*len > need) {
+	    unsigned first = *len - need;
+	    unsigned n;
+	    trim = TRUE;
+	    for (n = first; n < *len; ++n) {
+		if (tolower(UChar(a[n])) != tolower(UChar(ignore[n - first]))) {
+		    trim = FALSE;
+		    break;
+		}
+	    }
+	    if (trim) {
+		*len -= need;
+	    }
+	}
+    }
+}
+#else
+#define trim_suffix(a, len)	/* nothing */
+#endif
+
+bool
+same_program(const char *a, const char *b)
+{
+    unsigned len_a = strlen(a);
+    unsigned len_b = strlen(b);
+
+    trim_suffix(a, &len_a);
+    trim_suffix(b, &len_b);
+
+    return (len_a == len_b) && (strncmp(a, b, len_a) == 0);
+}
diff -Naur ncurses-5.7.orig/progs/tset.c ncurses-5.7/progs/tset.c
--- ncurses-5.7.orig/progs/tset.c	2008-10-11 15:26:19.000000000 -0400
+++ ncurses-5.7/progs/tset.c	2011-01-08 18:13:50.759156955 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2007,2008 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            *
@@ -33,6 +33,22 @@
  ****************************************************************************/
 
 /*
+ * Notes:
+ * The initial adaptation from 4.4BSD Lite sources in September 1995 used 686
+ * lines from that version, and made changes/additions for 150 lines.  There
+ * was no reformatting, so with/without ignoring whitespace, the amount of
+ * change is the same.
+ *
+ * Comparing with current (2009) source, excluding this comment:
+ * a) 209 lines match identically to the 4.4BSD Lite sources, with 771 lines
+ *    changed/added.
+ * a) Ignoring whitespace, the current version still uses 516 lines from the
+ *    4.4BSD Lite sources, with 402 lines changed/added.
+ *
+ * Raymond's original comment on this follows...
+ */
+
+/*
  * tset.c - terminal initialization utility
  *
  * This code was mostly swiped from 4.4BSD tset, with some obsolescent
@@ -52,11 +68,7 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *	This product includes software developed by the University of
- *	California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
  *    may be used to endorse or promote products derived from this software
  *    without specific prior written permission.
  *
@@ -107,7 +119,7 @@
 #include <dump_entry.h>
 #include <transform.h>
 
-MODULE_ID("$Id: tset.c,v 1.76 2008/10/11 19:26:19 tom Exp $")
+MODULE_ID("$Id: tset.c,v 1.82 2010/05/01 21:42:46 tom Exp $")
 
 /*
  * SCO defines TIOCGSIZE and the corresponding struct.  Other systems (SunOS,
@@ -129,7 +141,9 @@
 # endif
 #endif
 
+#ifndef environ
 extern char **environ;
+#endif
 
 #undef CTRL
 #define CTRL(x)	((x) & 0x1f)
@@ -385,9 +399,13 @@
     char *base = 0;
 
     copy = strdup(arg);
-    mapp = (MAP *) malloc(sizeof(MAP));
+    mapp = typeMalloc(MAP, 1);
     if (copy == 0 || mapp == 0)
 	failed("malloc");
+
+    assert(copy != 0);
+    assert(mapp != 0);
+
     mapp->next = 0;
     if (maplist == 0)
 	cur = maplist = mapp;
@@ -1247,12 +1265,12 @@
     ospeed = (NCURSES_OSPEED) mode.sg_ospeed;
 #endif
 
-    if (!strcmp(_nc_progname, PROG_RESET)) {
+    if (same_program(_nc_progname, PROG_RESET)) {
 	isreset = TRUE;
 	reset_mode();
     }
 
-    ttype = get_termcap_entry(*argv);
+    (void) get_termcap_entry(*argv);
 
     if (!noset) {
 	tcolumns = columns;
diff -Naur ncurses-5.7.orig/test/Makefile.in ncurses-5.7/test/Makefile.in
--- ncurses-5.7.orig/test/Makefile.in	2008-09-07 09:58:29.000000000 -0400
+++ ncurses-5.7/test/Makefile.in	2011-01-08 18:18:29.606656897 -0500
@@ -1,6 +1,6 @@
-# $Id: Makefile.in,v 1.102 2008/09/07 13:58:29 tom Exp $
+# $Id: Makefile.in,v 1.108 2010/11/28 16:39:40 tom Exp $
 ##############################################################################
-# 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 "Software"), #
@@ -35,6 +35,7 @@
 .SUFFIXES:
 
 SHELL		= /bin/sh
+VPATH		= @srcdir@
 
 @SET_MAKE@
 
@@ -46,19 +47,32 @@
 srcdir		= @srcdir@
 prefix		= @prefix@
 exec_prefix	= @exec_prefix@
+bindir		= @bindir@
 libdir		= @libdir@
 includedir	= @includedir@
 
+BINDIR		= $(DESTDIR)$(bindir)
+LIBDIR		= $(DESTDIR)$(libdir)
+INCLUDEDIR	= $(DESTDIR)$(includedir)
+
 LIBTOOL		= @LIBTOOL@
 LIBTOOL_CLEAN	= @LIB_CLEAN@
 LIBTOOL_COMPILE	= @LIB_COMPILE@
 LIBTOOL_LINK	= @LIB_LINK@
 
+INSTALL		= @INSTALL@
+INSTALL_PROG	= @INSTALL_PROGRAM@
+transform	= @program_transform_name@
+TRANSFORM	= sed 's/$x$$//'|sed '$(transform)'|sed 's/$$/$x/'
+
+CTAGS		= @CTAGS@
+ETAGS		= @ETAGS@
+
 CC		= @CC@
 CPP		= @CPP@
 
 CFLAGS		= @CFLAGS@ @EXTRA_CFLAGS@
-CPPFLAGS	=  -I../test -I$(srcdir) -DHAVE_CONFIG_H @CPPFLAGS@
+CPPFLAGS	= -I. -I$(srcdir) -I../test -DHAVE_CONFIG_H @CPPFLAGS@
 
 CCFLAGS		= $(CPPFLAGS) $(CFLAGS)
 
diff -Naur ncurses-5.7.orig/test/README ncurses-5.7/test/README
--- ncurses-5.7.orig/test/README	2008-10-18 17:02:45.000000000 -0400
+++ ncurses-5.7/test/README	2011-01-08 18:18:29.250657520 -0500
@@ -25,7 +25,7 @@
 -- sale, use or other dealings in this Software without prior written        --
 -- authorization.                                                            --
 -------------------------------------------------------------------------------
--- $Id: README,v 1.38 2008/10/18 21:02:45 tom Exp $
+-- $Id: README,v 1.43 2010/09/18 15:11:39 tom Exp $
 -------------------------------------------------------------------------------
 
 The programs in this directory are designed to test your newest toy :-)
@@ -87,7 +87,7 @@
 field_status			test: demo_forms
 field_term			-
 field_type			test: demo_forms
-field_userptr			test: edit_field ncurses
+field_userptr			test: demo_forms edit_field ncurses
 form_driver			test: cardfile demo_forms edit_field ncurses
 form_fields			test: cardfile demo_forms
 form_init			-
@@ -110,6 +110,7 @@
 new_field			test: cardfile demo_forms ncurses
 new_fieldtype			test: ncurses
 new_form			test: cardfile demo_forms ncurses
+new_form_sp			-
 new_page			test: demo_forms
 pos_form_cursor			-
 post_form			test: cardfile demo_forms ncurses
@@ -179,6 +180,7 @@
 menu_win			test: demo_menus ncurses
 new_item			test: demo_menus ncurses
 new_menu			test: demo_menus ncurses
+new_menu_sp			-
 pos_menu_cursor			lib: menu
 post_menu			test: demo_menus ncurses
 scale_menu			test: demo_menus ncurses
@@ -211,109 +213,139 @@
 ----------
 BC				-
 COLORS				test: echochar ncurses savescreen xmas
-COLOR_PAIR			test: background blue bs cardfile demo_forms demo_menus demo_panels echochar filter firework gdc hanoi ins_wide inserts knight ncurses newdemo rain savescreen tclock testaddch testcurs view worm xmas
+COLOR_PAIR			test: background blue bs cardfile clip_printw demo_forms demo_menus demo_panels echochar filter firework gdc hanoi ins_wide insdelln inserts knight ncurses newdemo rain savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr testaddch testcurs view worm xmas
 COLOR_PAIRS			test: echochar ncurses newdemo savescreen
-COLS				test: cardfile demo_altkeys demo_defkey demo_forms demo_keyok demo_menus demo_panels ditto echochar edit_field firework foldkeys hashtest inch_wide inchs ins_wide inserts lrtest movewindow ncurses newdemo rain savescreen tclock test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs view worm
+COLS				test: cardfile demo_altkeys demo_defkey demo_forms demo_keyok demo_menus demo_panels ditto echochar edit_field firework foldkeys hashtest inch_wide inchs ins_wide inserts lrtest movewindow ncurses newdemo rain savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs view worm
 ESCDELAY			test: test_opaque
-LINES				test: cardfile demo_defkey demo_keyok demo_menus demo_panels ditto echochar edit_field firework hanoi hashtest inch_wide inchs ins_wide inserts lrtest movewindow ncurses newdemo rain savescreen tclock test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs view worm xmas
+LINES				test: cardfile demo_defkey demo_keyok demo_menus demo_panels ditto echochar edit_field firework hanoi hashtest inch_wide inchs ins_wide inserts lrtest movewindow ncurses newdemo rain savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs view worm xmas
 PAIR_NUMBER			test: ncurses
 PC				lib: ncurses
-SP				lib: ncurses
+SP				lib: form
 TABSIZE				test: test_opaque
 UP				-
-acs_map				test: gdc ins_wide inserts knight movewindow ncurses newdemo testcurs
-add_wch				test: demo_panels ncurses
-add_wchnstr			-
-add_wchstr			test: view
-addch				test: blue bs echochar hashtest ncurses savescreen test_opaque testaddch view worm
-addchnstr			-
-addchstr			-
-addnstr				-
-addnwstr			test: ncurses
-addstr				test: blue bs cardfile gdc hanoi lrtest ncurses savescreen
-addwstr				test: ncurses
+acs_map				test: gdc ins_wide inserts knight movewindow ncurses newdemo test_add_wchstr test_addchstr test_addstr test_addwstr testcurs
+add_wch				test: demo_panels ncurses test_add_wchstr test_addwstr
+add_wchnstr			test: test_add_wchstr
+add_wchstr			test: test_add_wchstr view
+addch				test: blue bs echochar hashtest ncurses savescreen test_add_wchstr test_addchstr test_addstr test_addwstr test_opaque testaddch view worm
+addchnstr			test: test_addchstr
+addchstr			test: test_addchstr
+addnstr				test: test_addstr
+addnwstr			test: ncurses test_addwstr
+addstr				test: blue bs cardfile gdc hanoi lrtest ncurses savescreen test_addstr
+addwstr				test: ncurses test_addwstr
 assume_default_colors		test: ncurses
+assume_default_colors_sp	-
 attr_get			test: ncurses
 attr_off			test: ncurses
 attr_on				test: ncurses
 attr_set			test: ncurses
 attroff				test: echochar filter gdc ncurses tclock
 attron				test: bs echochar filter gdc ncurses
-attrset				test: bs firework gdc hanoi ncurses rain tclock testaddch testcurs
+attrset				test: bs firework gdc hanoi insdelln ncurses rain tclock testaddch testcurs
 baudrate			lib: ncurses
-beep				test: blue bs cardfile chgat demo_forms demo_menus demo_panels edit_field hanoi inch_wide inchs ins_wide inserts knight movewindow ncurses savescreen tclock test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs view xmas
+baudrate_sp			lib: ncurses
+beep				test: blue bs cardfile chgat clip_printw demo_forms demo_menus demo_panels edit_field hanoi inch_wide inchs ins_wide insdelln inserts knight movewindow ncurses savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs view xmas
+beep_sp				lib: ncurses
 bkgd				test: background cardfile demo_forms ncurses savescreen tclock view
 bkgdset				test: background ncurses testaddch
 bkgrnd				test: ncurses
 bkgrndset			test: ncurses
-boolcodes			test: test_arrays progs: dump_entry
-boolfnames			test: test_arrays progs: dump_entry
-boolnames			test: test_arrays progs: dump_entry infocmp
+boolcodes			test: demo_termcap test_arrays progs: dump_entry
+boolfnames			test: demo_terminfo test_arrays progs: dump_entry
+boolnames			test: demo_terminfo test_arrays progs: dump_entry infocmp
 border				-
 border_set			-
-box				test: cardfile chgat demo_forms demo_menus demo_panels ditto edit_field inch_wide inchs ins_wide inserts lrtest ncurses newdemo redraw test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs
+box				test: cardfile chgat clip_printw demo_forms demo_menus demo_panels ditto edit_field inch_wide inchs ins_wide insdelln inserts lrtest ncurses newdemo redraw test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs
 box_set				test: ncurses
 can_change_color		test: ncurses
-cbreak				test: background blue bs cardfile chgat color_set demo_altkeys demo_defkey demo_forms demo_keyok demo_menus demo_panels ditto filter firework foldkeys gdc hanoi hashtest inch_wide inchs ins_wide inserts knight lrtest movewindow ncurses newdemo savescreen tclock test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs view worm xmas
+can_change_color_sp		-
+cbreak				test: background blue bs cardfile chgat clip_printw color_set demo_altkeys demo_defkey demo_forms demo_keyok demo_menus demo_panels ditto filter firework foldkeys gdc hanoi hashtest inch_wide inchs ins_wide insdelln inserts knight lrtest movewindow ncurses newdemo savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs view worm xmas
+cbreak_sp			lib: ncurses
 chgat				test: chgat
 clear				test: blue bs gdc ncurses testcurs xmas
 clearok				test: bs knight
 clrtobot			test: demo_menus ncurses
 clrtoeol			test: blue bs demo_altkeys demo_menus foldkeys hanoi hashtest movewindow ncurses view
 color_content			test: ncurses
+color_content_sp		-
 color_set			test: color_set ncurses
 copywin				test: ncurses testcurs
-cur_term			test: dots dots_mvcur lrtest progs: clear tput tset
+cur_term			test: demo_terminfo dots dots_mvcur lrtest progs: clear tabs tput tset
 curs_set			test: echochar firework gdc hanoi lrtest ncurses newdemo rain savescreen tclock testcurs worm xmas
+curs_set_sp			lib: ncurses
 curscr				test: demo_panels edit_field knight lrtest ncurses savescreen tclock view
 curses_version			test: ncurses progs: infocmp tic toe tput tset
 def_prog_mode			test: bs ncurses
-def_shell_mode			lib: ncurses
+def_prog_mode_sp		lib: ncurses
+def_shell_mode			-
+def_shell_mode_sp		lib: ncurses
 define_key			test: demo_altkeys demo_defkey foldkeys
+define_key_sp			-
 del_curterm			lib: ncurses
+del_curterm_sp			lib: ncurses
 delay_output			test: newdemo
+delay_output_sp			-
 delch				-
-deleteln			-
+deleteln			test: insdelln
 delscreen			test: ditto dots_mvcur
-delwin				test: cardfile chgat demo_forms demo_panels edit_field inch_wide inchs ins_wide inserts movewindow ncurses newdemo redraw test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs
-derwin				test: cardfile chgat demo_forms demo_menus ditto inch_wide inchs ins_wide inserts movewindow ncurses test_get_wstr test_getstr test_instr test_inwstr test_opaque
-doupdate			test: cardfile demo_menus demo_panels ditto edit_field ins_wide inserts knight movewindow ncurses redraw savescreen test_get_wstr test_getstr
+delwin				test: cardfile chgat clip_printw demo_forms demo_panels edit_field inch_wide inchs ins_wide insdelln inserts movewindow ncurses newdemo redraw test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs
+derwin				test: cardfile chgat clip_printw demo_forms demo_menus ditto inch_wide inchs ins_wide insdelln inserts movewindow ncurses test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque
+doupdate			test: cardfile demo_menus demo_panels ditto edit_field ins_wide inserts knight movewindow ncurses redraw savescreen test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr
+doupdate_sp			lib: ncurses
 dupwin				test: edit_field
 echo				test: bs hanoi ncurses test_get_wstr test_getstr testcurs testscanw
+echo_sp				lib: ncurses
 echo_wchar			test: ncurses
 echochar			test: echochar ncurses
-endwin				test: background blue bs cardfile chgat color_set demo_altkeys demo_defkey demo_forms demo_keyok demo_menus demo_panels ditto dots_mvcur echochar filter firework firstlast foldkeys gdc hanoi hashtest inch_wide inchs ins_wide inserts key_names keynames knight lrtest movewindow ncurses newdemo rain redraw savescreen tclock test_get_wstr test_getstr test_instr test_inwstr test_opaque testaddch testcurs testscanw view worm xmas
+endwin				test: background blue bs cardfile chgat clip_printw color_set demo_altkeys demo_defkey demo_forms demo_keyok demo_menus demo_panels ditto dots_mvcur echochar filter firework firstlast foldkeys gdc hanoi hashtest inch_wide inchs ins_wide insdelln inserts key_names keynames knight lrtest movewindow ncurses newdemo rain redraw savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testaddch testcurs testscanw view worm xmas
+endwin_sp			lib: ncurses
 erase				test: cardfile demo_menus filter firework firstlast hanoi lrtest ncurses tclock test_opaque testcurs
 erasechar			lib: ncurses
+erasechar_sp			lib: ncurses
 erasewchar			-
 filter				test: filter
+filter_sp			-
 flash				test: cardfile lrtest ncurses tclock testcurs
+flash_sp			-
 flushinp			test: ncurses newdemo testcurs
+flushinp_sp			lib: ncurses
+get_escdelay			-
+get_escdelay_sp			-
 get_wch				-
 get_wstr			test: test_get_wstr
 getattrs			-
-getbegx				test: chgat demo_menus demo_panels movewindow ncurses newdemo redraw testcurs
-getbegy				test: chgat demo_menus demo_panels movewindow ncurses newdemo redraw testcurs
+getbegx				test: chgat clip_printw demo_menus demo_panels insdelln movewindow ncurses newdemo redraw testcurs
+getbegy				test: chgat clip_printw demo_menus demo_panels insdelln movewindow ncurses newdemo redraw testcurs
 getbkgd				test: ncurses
 getbkgrnd			test: ncurses
 getcchar			test: ncurses view
-getch				test: background blue bs chgat color_set demo_altkeys filter firework firstlast foldkeys hanoi hashtest lrtest savescreen tclock test_opaque testaddch testcurs view xmas
-getcurx				test: bs chgat demo_altkeys demo_defkey demo_panels foldkeys movewindow ncurses redraw savescreen test_get_wstr test_getstr test_opaque testcurs
-getcury				test: bs chgat demo_altkeys demo_defkey demo_panels edit_field foldkeys movewindow ncurses redraw savescreen test_opaque testcurs
-getmaxx				test: chgat demo_panels inch_wide inchs movewindow ncurses newdemo redraw test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs
-getmaxy				test: chgat demo_forms demo_panels inch_wide inchs movewindow ncurses newdemo redraw test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs
+getch				test: background blue bs chgat color_set demo_altkeys filter firework firstlast foldkeys hanoi hashtest insdelln lrtest savescreen tclock test_opaque testaddch testcurs view xmas
+getcurx				test: bs chgat clip_printw demo_altkeys demo_defkey demo_panels firstlast foldkeys insdelln movewindow ncurses redraw savescreen test_get_wstr test_getstr test_opaque testcurs
+getcury				test: bs chgat clip_printw demo_altkeys demo_defkey demo_panels edit_field firstlast foldkeys insdelln movewindow ncurses redraw savescreen test_opaque testcurs
+getmaxx				test: chgat clip_printw demo_panels inch_wide inchs insdelln movewindow ncurses newdemo redraw test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs
+getmaxy				test: chgat clip_printw demo_forms demo_panels inch_wide inchs insdelln movewindow ncurses newdemo redraw test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs
 getmouse			test: bs knight movewindow ncurses
+getmouse_sp			-
 getn_wstr			test: test_get_wstr
 getnstr				test: filter ncurses test_getstr
 getparx				test: movewindow
 getpary				test: movewindow
 getstr				test: test_getstr
 getwin				test: ncurses
+getwin_sp			-
 halfdelay			test: view
-has_colors			test: background bs cardfile chgat color_set demo_forms demo_menus demo_panels echochar filter firework gdc hanoi ins_wide inserts knight ncurses newdemo rain savescreen tclock testcurs view worm xmas
+halfdelay_sp			-
+has_colors			test: background bs cardfile chgat clip_printw color_set demo_forms demo_menus demo_panels echochar filter firework gdc hanoi ins_wide insdelln inserts knight ncurses newdemo rain savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr testcurs view worm xmas
+has_colors_sp			lib: ncurses
 has_ic				test: lrtest
-has_il				lib: ncurses
-has_key				lib: ncurses
+has_ic_sp			lib: ncurses
+has_il				-
+has_il_sp			lib: ncurses
+has_key				-
+has_key_sp			lib: ncurses
+has_mouse			-
+has_mouse_sp			-
 hline				test: gdc ncurses
 hline_set			-
 idcok				test: test_opaque
@@ -326,20 +358,23 @@
 inchnstr			test: inchs
 inchstr				test: inchs
 init_color			test: ncurses
-init_pair			test: background blue bs cardfile chgat color_set demo_forms demo_menus demo_panels echochar filter firework gdc hanoi ins_wide inserts knight ncurses newdemo rain savescreen tclock testaddch testcurs view worm xmas
-initscr				test: background blue bs cardfile chgat color_set demo_defkey demo_forms demo_keyok demo_menus demo_panels echochar firework firstlast gdc hanoi hashtest inch_wide inchs ins_wide inserts knight lrtest movewindow ncurses newdemo rain redraw savescreen tclock test_get_wstr test_getstr test_instr test_inwstr test_opaque testaddch testcurs testscanw view worm xmas
+init_color_sp			lib: ncurses
+init_pair			test: background blue bs cardfile chgat clip_printw color_set demo_forms demo_menus demo_panels echochar filter firework gdc hanoi ins_wide insdelln inserts knight ncurses newdemo rain savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr testaddch testcurs view worm xmas
+init_pair_sp			-
+initscr				test: background blue bs cardfile chgat clip_printw color_set demo_defkey demo_forms demo_keyok demo_menus demo_panels echochar filter firework firstlast gdc hanoi hashtest inch_wide inchs ins_wide insdelln inserts knight lrtest movewindow ncurses newdemo rain redraw savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testaddch testcurs testscanw view worm xmas
 innstr				test: test_instr
 innwstr				test: test_inwstr
 ins_nwstr			test: ins_wide
 ins_wch				test: ins_wide
 ins_wstr			test: ins_wide
 insch				test: ins_wide inserts
-insdelln			-
-insertln			-
+insdelln			test: insdelln
+insertln			test: insdelln
 insnstr				test: inserts
 insstr				test: inserts
 instr				test: test_instr
 intrflush			test: demo_forms movewindow
+intrflush_sp			-
 inwstr				test: test_inwstr
 is_cleared			test: test_opaque
 is_idcok			test: test_opaque
@@ -350,39 +385,52 @@
 is_linetouched			lib: form
 is_nodelay			test: test_opaque
 is_notimeout			test: test_opaque
+is_pad				-
 is_scrollok			test: test_opaque
+is_subwin			-
 is_syncok			test: test_opaque
 is_term_resized			-
+is_term_resized_sp		-
 is_wintouched			lib: ncurses
 isendwin			-
+isendwin_sp			-
 key_defined			test: demo_defkey foldkeys
+key_defined_sp			lib: ncurses
 key_name			test: key_names ncurses
 keybound			test: demo_altkeys demo_defkey
+keybound_sp			lib: ncurses
 keyname				test: demo_altkeys demo_defkey demo_keyok demo_menus edit_field foldkeys keynames movewindow ncurses redraw testcurs view progs: tic
+keyname_sp			lib: ncurses
 keyok				test: demo_keyok foldkeys
-keypad				test: bs cardfile chgat demo_altkeys demo_defkey demo_forms demo_keyok demo_menus demo_panels ditto edit_field filter firework foldkeys hashtest inch_wide inchs ins_wide inserts key_names keynames knight lrtest movewindow ncurses redraw savescreen tclock test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs testscanw view
+keyok_sp			lib: ncurses
+keypad				test: bs cardfile chgat clip_printw demo_altkeys demo_defkey demo_forms demo_keyok demo_menus demo_panels ditto edit_field filter firework foldkeys hashtest inch_wide inchs ins_wide insdelln inserts key_names keynames knight lrtest movewindow ncurses redraw savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs testscanw view
 killchar			lib: ncurses
+killchar_sp			lib: ncurses
 killwchar			-
 leaveok				test: hanoi test_opaque
 longname			test: testcurs progs: tput
 mcprint				-
+mcprint_sp			-
 meta				test: key_names keynames ncurses
 mouse_trafo			-
 mouseinterval			-
+mouseinterval_sp		-
 mousemask			test: bs demo_forms demo_menus knight movewindow ncurses
-move				test: blue bs cardfile chgat demo_altkeys demo_menus echochar foldkeys gdc hanoi hashtest inch_wide inchs ins_wide inserts knight lrtest movewindow ncurses savescreen test_get_wstr test_getstr test_instr test_inwstr test_opaque testscanw view xmas
-mvadd_wch			test: ncurses
-mvadd_wchnstr			-
-mvadd_wchstr			-
-mvaddch				test: bs gdc hanoi lrtest ncurses rain tclock xmas
-mvaddchnstr			test: gdc
-mvaddchstr			-
-mvaddnstr			-
-mvaddnwstr			-
-mvaddstr			test: bs demo_forms gdc hanoi knight ncurses rain tclock testcurs xmas
-mvaddwstr			-
+mousemask_sp			-
+move				test: blue bs cardfile chgat demo_altkeys demo_menus echochar foldkeys gdc hanoi hashtest inch_wide inchs ins_wide inserts knight lrtest movewindow ncurses savescreen test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testscanw view xmas
+mvadd_wch			test: ncurses test_add_wchstr test_addwstr
+mvadd_wchnstr			test: test_add_wchstr
+mvadd_wchstr			test: test_add_wchstr
+mvaddch				test: bs gdc hanoi lrtest ncurses rain tclock test_add_wchstr test_addchstr test_addstr test_addwstr xmas
+mvaddchnstr			test: gdc test_addchstr
+mvaddchstr			test: test_addchstr
+mvaddnstr			test: test_addstr
+mvaddnwstr			test: test_addwstr
+mvaddstr			test: bs demo_forms gdc hanoi knight ncurses rain tclock test_addstr testcurs xmas
+mvaddwstr			test: test_addwstr
 mvchgat				test: chgat
 mvcur				test: dots_mvcur redraw
+mvcur_sp			lib: ncurses
 mvdelch				-
 mvderwin			test: movewindow
 mvget_wch			-
@@ -413,16 +461,16 @@
 mvscanw				-
 mvvline				test: ncurses
 mvvline_set			test: ncurses
-mvwadd_wch			-
-mvwadd_wchnstr			lib: form
-mvwadd_wchstr			test: inch_wide
-mvwaddch			test: movewindow newdemo testcurs xmas
-mvwaddchnstr			-
-mvwaddchstr			test: inchs
-mvwaddnstr			test: newdemo testcurs
-mvwaddnwstr			-
-mvwaddstr			test: ditto firstlast ins_wide inserts knight ncurses newdemo test_instr testcurs xmas
-mvwaddwstr			test: test_inwstr
+mvwadd_wch			test: test_add_wchstr test_addwstr
+mvwadd_wchnstr			test: test_add_wchstr
+mvwadd_wchstr			test: inch_wide test_add_wchstr
+mvwaddch			test: movewindow newdemo test_add_wchstr test_addchstr test_addstr test_addwstr testcurs xmas
+mvwaddchnstr			test: test_addchstr
+mvwaddchstr			test: inchs test_addchstr
+mvwaddnstr			test: newdemo test_addstr testcurs
+mvwaddnwstr			test: test_addwstr
+mvwaddstr			test: ditto firstlast ins_wide inserts knight ncurses newdemo test_addstr test_addwstr test_instr testcurs xmas
+mvwaddwstr			test: test_addwstr test_inwstr
 mvwchgat			test: chgat
 mvwdelch			test: ncurses
 mvwget_wch			-
@@ -450,171 +498,240 @@
 mvwinsstr			test: inserts testcurs
 mvwinstr			test: test_instr
 mvwinwstr			test: test_inwstr
-mvwprintw			test: chgat demo_panels inch_wide inchs ncurses test_instr test_inwstr testcurs
+mvwprintw			test: chgat clip_printw demo_panels inch_wide inchs insdelln ncurses test_instr test_inwstr testcurs
 mvwscanw			test: testcurs
-mvwvline			test: ins_wide inserts movewindow
+mvwvline			test: ins_wide inserts movewindow test_add_wchstr test_addchstr test_addstr test_addwstr
 mvwvline_set			-
 napms				test: demo_panels ditto dots dots_mvcur echochar firework gdc hanoi lrtest ncurses railroad rain tclock test_opaque testcurs view worm xmas progs: tset
+napms_sp			-
+new_prescr			lib: ncurses
 newpad				test: edit_field ncurses testcurs
+newpad_sp			lib: ncurses
 newscr				lib: ncurses
 newterm				test: demo_altkeys ditto dots_mvcur filter foldkeys gdc key_names keynames
-newwin				test: cardfile chgat demo_defkey demo_forms demo_keyok demo_menus demo_panels ditto edit_field firstlast inch_wide inchs ins_wide inserts knight movewindow ncurses newdemo redraw test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs xmas
+newterm_sp			-
+newwin				test: cardfile chgat clip_printw demo_defkey demo_forms demo_keyok demo_menus demo_panels ditto edit_field firstlast inch_wide inchs ins_wide insdelln inserts knight movewindow ncurses newdemo redraw test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs xmas
+newwin_sp			lib: ncurses
 nl				test: demo_forms ncurses rain testcurs
+nl_sp				lib: ncurses
 nocbreak			test: testcurs
+nocbreak_sp			lib: ncurses
 nodelay				test: ditto firework gdc lrtest ncurses newdemo rain tclock test_opaque view worm xmas
-noecho				test: background bs cardfile chgat color_set demo_altkeys demo_defkey demo_forms demo_keyok demo_menus demo_panels ditto firework firstlast foldkeys gdc hanoi hashtest inch_wide inchs ins_wide inserts knight lrtest movewindow ncurses rain redraw savescreen tclock test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs view worm xmas
+noecho				test: background bs cardfile chgat clip_printw color_set demo_altkeys demo_defkey demo_forms demo_keyok demo_menus demo_panels ditto firework firstlast foldkeys gdc hanoi hashtest inch_wide inchs ins_wide insdelln inserts knight lrtest movewindow ncurses rain redraw savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs view worm xmas
+noecho_sp			lib: ncurses
 nofilter			-
+nofilter_sp			-
 nonl				test: bs demo_forms hashtest movewindow ncurses view worm xmas
+nonl_sp				lib: ncurses
 noqiflush			-
+noqiflush_sp			-
 noraw				test: demo_forms demo_menus ncurses testcurs
+noraw_sp			lib: ncurses
 notimeout			test: test_opaque
-numcodes			test: test_arrays progs: dump_entry
-numfnames			test: test_arrays progs: dump_entry
-numnames			test: test_arrays progs: dump_entry infocmp
+numcodes			test: demo_termcap test_arrays progs: dump_entry
+numfnames			test: demo_terminfo test_arrays progs: dump_entry
+numnames			test: demo_terminfo test_arrays progs: dump_entry infocmp
 ospeed				progs: tset
 overlay				test: ncurses testcurs xmas
 overwrite			test: ncurses savescreen
 pair_content			test: background color_set
+pair_content_sp			lib: ncurses
 pecho_wchar			-
 pechochar			-
 pnoutrefresh			test: edit_field ncurses
 prefresh			test: testcurs
 printw				test: background blue bs color_set demo_altkeys demo_defkey demo_keyok demo_menus filter foldkeys ncurses savescreen testcurs testscanw view
 putp				progs: tput
+putp_sp				lib: ncurses
 putwin				test: ncurses
 qiflush				-
+qiflush_sp			-
 raw				test: demo_forms ncurses redraw testcurs
+raw_sp				lib: ncurses
 redrawwin			test: redraw
 refresh				test: blue bs demo_defkey demo_forms demo_keyok demo_menus demo_panels echochar filter firstlast gdc hanoi hashtest lrtest movewindow ncurses savescreen tclock testcurs view xmas
 reset_prog_mode			test: filter ncurses
+reset_prog_mode_sp		lib: ncurses
 reset_shell_mode		test: bs filter savescreen
+reset_shell_mode_sp		lib: ncurses
 resetty				-
+resetty_sp			-
 resize_term			test: view
-resizeterm			lib: ncurses
+resize_term_sp			-
+resizeterm			-
+resizeterm_sp			lib: ncurses
 restartterm			-
+restartterm_sp			-
 ripoffline			test: demo_menus ncurses
+ripoffline_sp			-
 savetty				-
+savetty_sp			-
 scanw				test: testcurs testscanw
 scr_dump			test: savescreen
 scr_init			test: savescreen
+scr_init_sp			-
 scr_restore			test: savescreen
+scr_restore_sp			-
 scr_set				test: savescreen
+scr_set_sp			-
 scrl				test: view
 scroll				test: testcurs
-scrollok			test: demo_altkeys demo_defkey demo_keyok demo_panels ditto foldkeys hashtest knight ncurses redraw test_opaque testcurs testscanw view
+scrollok			test: clip_printw demo_altkeys demo_defkey demo_keyok demo_panels ditto foldkeys hashtest knight ncurses redraw test_opaque testcurs testscanw view
 set_curterm			lib: ncurses
+set_curterm_sp			-
 set_escdelay			test: test_opaque
+set_escdelay_sp			lib: ncurses
 set_tabsize			test: test_opaque
+set_tabsize_sp			-
 set_term			lib: ncurses
-setcchar			test: demo_panels ins_wide ncurses view
+setcchar			test: demo_panels ins_wide ncurses test_add_wchstr test_addwstr view
 setscrreg			test: view
-setupterm			test: dots progs: clear tput tset
+setupterm			test: demo_termcap demo_terminfo dots progs: clear tabs tput tset
 slk_attr			-
 slk_attr_off			-
 slk_attr_on			-
-slk_attr_set			-
+slk_attr_set			test: ncurses
+slk_attr_set_sp			-
+slk_attr_sp			-
 slk_attroff			lib: ncurses
+slk_attroff_sp			-
 slk_attron			lib: ncurses
-slk_attrset			-
+slk_attron_sp			-
+slk_attrset			test: ncurses
+slk_attrset_sp			-
 slk_clear			test: ncurses
+slk_clear_sp			-
 slk_color			test: ncurses
+slk_color_sp			-
 slk_init			test: ncurses
+slk_init_sp			-
 slk_label			test: ncurses
-slk_noutrefresh			-
+slk_label_sp			-
+slk_noutrefresh			test: ncurses
+slk_noutrefresh_sp		-
 slk_refresh			test: ncurses
+slk_refresh_sp			lib: ncurses
 slk_restore			test: ncurses
+slk_restore_sp			lib: ncurses
 slk_set				test: ncurses
-slk_touch			lib: ncurses
+slk_set_sp			-
+slk_touch			test: ncurses
+slk_touch_sp			lib: ncurses
 slk_wset			test: ncurses
 standend			test: blue gdc ncurses
 standout			test: blue ncurses
-start_color			test: background blue bs cardfile chgat color_set demo_forms demo_menus demo_panels echochar filter firework gdc hanoi ins_wide inserts knight ncurses newdemo rain savescreen tclock testaddch testcurs view worm xmas
-stdscr				test: bs chgat demo_altkeys demo_forms demo_menus demo_panels ditto filter firework foldkeys gdc hanoi hashtest inch_wide inchs ins_wide inserts key_names keynames knight lrtest movewindow ncurses rain redraw savescreen tclock test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs testscanw view worm xmas
-strcodes			test: test_arrays progs: dump_entry
-strfnames			test: test_arrays progs: dump_entry
-strnames			test: foldkeys test_arrays progs: dump_entry infocmp tic
+start_color			test: background blue bs cardfile chgat clip_printw color_set demo_forms demo_menus demo_panels echochar filter firework gdc hanoi ins_wide insdelln inserts knight ncurses newdemo rain savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr testaddch testcurs view worm xmas
+start_color_sp			-
+stdscr				test: bs chgat clip_printw demo_altkeys demo_forms demo_menus demo_panels ditto filter firework foldkeys gdc hanoi hashtest inch_wide inchs ins_wide insdelln inserts key_names keynames knight lrtest movewindow ncurses rain redraw savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs testscanw view worm xmas
+strcodes			test: demo_termcap test_arrays progs: dump_entry
+strfnames			test: demo_terminfo test_arrays progs: dump_entry
+strnames			test: demo_terminfo foldkeys test_arrays progs: dump_entry infocmp tic
 subpad				test: testcurs
 subwin				test: movewindow ncurses newdemo testcurs
 syncok				test: test_opaque
 term_attrs			test: ncurses
+term_attrs_sp			-
 termattrs			test: ncurses testcurs
+termattrs_sp			lib: ncurses
 termname			test: testcurs
+termname_sp			lib: ncurses
 tgetent				test: demo_termcap railroad
+tgetent_sp			-
 tgetflag			test: demo_termcap
+tgetflag_sp			-
 tgetnum				test: demo_termcap railroad
+tgetnum_sp			-
 tgetstr				test: demo_termcap railroad
+tgetstr_sp			-
 tgoto				test: railroad
-tigetflag			progs: tput
-tigetnum			test: ncurses progs: tput
-tigetstr			test: blue demo_defkey foldkeys testcurs progs: tput
+tigetflag			test: demo_terminfo progs: tput
+tigetflag_sp			-
+tigetnum			test: demo_terminfo ncurses progs: tput
+tigetnum_sp			-
+tigetstr			test: blue demo_defkey demo_terminfo foldkeys testcurs progs: tput
+tigetstr_sp			-
 timeout				test: rain savescreen
-touchline			test: chgat
-touchwin			test: chgat demo_menus edit_field filter firstlast inch_wide inchs ins_wide inserts movewindow ncurses redraw test_get_wstr test_getstr test_instr test_inwstr test_opaque xmas
-tparm				test: dots dots_mvcur progs: tic tput
-tputs				test: dots dots_mvcur railroad progs: clear tset
+tiparm				-
+touchline			test: chgat clip_printw insdelln
+touchwin			test: chgat clip_printw demo_menus edit_field filter firstlast inch_wide inchs ins_wide insdelln inserts movewindow ncurses redraw test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque xmas
+tparm				test: dots dots_mvcur progs: tabs tic tput
+tputs				test: dots dots_mvcur railroad progs: clear tabs tset
+tputs_sp			lib: ncurses
 trace				test: demo_menus hanoi hashtest lrtest ncurses testcurs view worm
 ttytype				lib: ncurses
 typeahead			test: testcurs
+typeahead_sp			lib: ncurses
 unctrl				test: ncurses redraw testcurs
+unctrl_sp			lib: ncurses
 unget_wch			-
+unget_wch_sp			-
 ungetch				test: bs knight
+ungetch_sp			lib: ncurses
 ungetmouse			-
+ungetmouse_sp			-
 untouchwin			lib: form
 use_default_colors		test: filter firework gdc hanoi knight ncurses rain tclock worm xmas
+use_default_colors_sp		-
 use_env				progs: tput
-use_extended_names		progs: infocmp tic
+use_env_sp			-
+use_extended_names		test: demo_terminfo progs: infocmp tic
 use_legacy_coding		-
+use_legacy_coding_sp		-
 use_screen			test: ditto
 use_window			test: rain worm
 vid_attr			-
+vid_attr_sp			-
 vid_puts			-
-vidattr				lib: ncurses
-vidputs				lib: ncurses
+vid_puts_sp			-
+vidattr				-
+vidattr_sp			lib: ncurses
+vidputs				-
+vidputs_sp			lib: ncurses
 vline				test: gdc ncurses
 vline_set			-
-vw_printw			-
+vw_printw			test: clip_printw
 vw_scanw			-
 vwprintw			test: movewindow
 vwscanw				lib: ncurses
-wadd_wch			test: inch_wide
-wadd_wchnstr			lib: form
-wadd_wchstr			-
-waddch				test: demo_forms demo_panels ditto firstlast inch_wide inchs knight ncurses test_get_wstr test_getstr test_instr test_inwstr test_opaque worm
-waddchnstr			lib: ncurses
-waddchstr			-
-waddnstr			lib: menu
-waddnwstr			test: ncurses
-waddstr				test: chgat demo_forms demo_panels edit_field firstlast ins_wide knight ncurses redraw testcurs
-waddwstr			test: ins_wide test_get_wstr
+wadd_wch			test: inch_wide test_add_wchstr test_addwstr
+wadd_wchnstr			test: test_add_wchstr
+wadd_wchstr			test: test_add_wchstr
+waddch				test: demo_forms demo_panels ditto firstlast inch_wide inchs knight ncurses test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque worm
+waddchnstr			test: test_addchstr
+waddchstr			test: test_addchstr
+waddnstr			test: test_addstr
+waddnwstr			test: ncurses test_addwstr
+waddstr				test: chgat clip_printw demo_forms demo_panels edit_field firstlast ins_wide insdelln knight ncurses redraw test_add_wchstr test_addstr test_addwstr testcurs
+waddwstr			test: ins_wide test_add_wchstr test_addwstr test_get_wstr
 wattr_get			-
 wattr_off			lib: ncurses
 wattr_on			lib: ncurses
 wattr_set			-
 wattroff			test: demo_forms ncurses testcurs xmas
 wattron				test: testcurs xmas
-wattrset			test: demo_forms ncurses newdemo test_get_wstr test_getstr testcurs xmas
+wattrset			test: clip_printw demo_forms insdelln ncurses newdemo test_get_wstr test_getstr testcurs xmas
 wbkgd				test: cardfile demo_forms demo_menus ncurses newdemo testcurs
-wbkgdset			test: demo_panels ins_wide inserts ncurses
+wbkgdset			test: demo_panels ins_wide inserts ncurses test_add_wchstr test_addchstr test_addstr test_addwstr
 wbkgrnd				lib: ncurses
 wbkgrndset			lib: ncurses
-wborder				lib: ncurses
-wborder_set			lib: ncurses
+wborder				test: ncurses
+wborder_set			test: ncurses
 wchgat				test: chgat test_get_wstr test_getstr view
 wclear				test: ncurses test_opaque testcurs
 wclrtobot			test: firstlast inch_wide inchs ncurses test_instr test_inwstr testcurs
-wclrtoeol			test: chgat demo_defkey demo_keyok demo_panels firstlast inch_wide inchs ins_wide inserts knight ncurses test_instr test_inwstr testcurs
+wclrtoeol			test: chgat clip_printw demo_defkey demo_keyok demo_panels firstlast inch_wide inchs ins_wide insdelln inserts knight ncurses test_add_wchstr test_addchstr test_addstr test_addwstr test_instr test_inwstr testcurs
 wcolor_set			lib: ncurses
 wcursyncup			lib: form
 wdelch				test: ncurses testcurs
-wdeleteln			test: testcurs
+wdeleteln			test: insdelln testcurs
 wecho_wchar			lib: ncurses
 wechochar			lib: ncurses
-wenclose			lib: form
+wenclose			test: ncurses
 werase				test: cardfile demo_forms demo_menus demo_panels edit_field firstlast knight ncurses newdemo test_get_wstr test_getstr test_opaque testcurs xmas
-wget_wch			test: ins_wide ncurses
+wget_wch			test: ins_wide ncurses test_add_wchstr test_addwstr
 wget_wstr			test: test_get_wstr
 wgetbkgrnd			lib: ncurses
-wgetch				test: cardfile chgat demo_defkey demo_keyok demo_menus demo_panels ditto edit_field gdc inserts knight movewindow ncurses newdemo rain redraw test_opaque testcurs worm
+wgetch				test: cardfile chgat clip_printw demo_defkey demo_keyok demo_menus demo_panels ditto edit_field gdc insdelln inserts knight movewindow ncurses newdemo rain redraw test_addchstr test_addstr test_opaque testcurs worm
 wgetn_wstr			test: ncurses test_get_wstr
 wgetnstr			test: ncurses test_getstr
 wgetparent			test: test_opaque
@@ -634,36 +751,39 @@
 wins_wch			test: ins_wide
 wins_wstr			test: ins_wide
 winsch				test: ins_wide inserts testcurs
-winsdelln			lib: ncurses
-winsertln			test: testcurs
+winsdelln			test: insdelln
+winsertln			test: insdelln testcurs
 winsnstr			test: inserts
 winsstr				test: inserts
 winstr				test: test_instr
 winwstr				test: test_inwstr
-wmouse_trafo			lib: form
-wmove				test: chgat demo_altkeys demo_defkey demo_keyok demo_menus demo_panels firstlast foldkeys inch_wide inchs ins_wide inserts knight movewindow ncurses newdemo redraw test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs worm
-wnoutrefresh			test: demo_menus ditto edit_field inch_wide inchs ins_wide inserts knight movewindow ncurses redraw test_get_wstr test_getstr test_instr test_inwstr test_opaque
-wprintw				test: chgat demo_defkey demo_forms demo_keyok demo_menus demo_panels edit_field inch_wide inchs ins_wide inserts knight movewindow ncurses test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs
+wmouse_trafo			test: ncurses
+wmove				test: chgat clip_printw demo_altkeys demo_defkey demo_keyok demo_menus demo_panels firstlast foldkeys inch_wide inchs ins_wide insdelln inserts knight movewindow ncurses newdemo redraw test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs worm
+wnoutrefresh			test: demo_menus ditto edit_field inch_wide inchs ins_wide inserts knight movewindow ncurses redraw test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque
+wprintw				test: chgat clip_printw demo_defkey demo_forms demo_keyok demo_menus demo_panels edit_field inch_wide inchs ins_wide insdelln inserts knight movewindow ncurses test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs
 wredrawln			test: redraw
-wrefresh			test: chgat demo_forms demo_keyok demo_menus demo_panels edit_field firstlast knight lrtest movewindow ncurses newdemo redraw savescreen tclock testcurs view worm xmas
+wrefresh			test: chgat clip_printw demo_forms demo_keyok demo_menus demo_panels edit_field firstlast ins_wide insdelln inserts knight lrtest movewindow ncurses newdemo redraw savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr testcurs view worm xmas
 wresize				test: cardfile ncurses
 wscanw				test: testcurs
 wscrl				test: ncurses testcurs
 wsetscrreg			test: ncurses testcurs
-wstandend			test: test_opaque xmas
-wstandout			test: test_opaque xmas
+wstandend			test: ncurses test_opaque xmas
+wstandout			test: ncurses test_opaque xmas
 wsyncdown			test: movewindow
 wsyncup				lib: form
 wtimeout			test: ncurses
 wtouchln			lib: ncurses
 wunctrl				lib: ncurses
+wunctrl_sp			-
 wvline				test: testcurs
 wvline_set			lib: ncurses
 
 libpanel:
 --------
 bottom_panel			test: demo_panels ncurses
+ceiling_panel			-
 del_panel			test: demo_panels ncurses
+ground_panel			-
 hide_panel			test: demo_panels ncurses
 move_panel			test: demo_panels ncurses
 new_panel			test: cardfile demo_panels ncurses
@@ -677,3 +797,4 @@
 show_panel			test: demo_panels ncurses
 top_panel			test: cardfile demo_panels ncurses
 update_panels			test: cardfile demo_panels ncurses
+update_panels_sp		-
diff -Naur ncurses-5.7.orig/test/aclocal.m4 ncurses-5.7/test/aclocal.m4
--- ncurses-5.7.orig/test/aclocal.m4	2008-02-09 13:22:17.000000000 -0500
+++ ncurses-5.7/test/aclocal.m4	2011-01-08 18:18:29.538657256 -0500
@@ -1,5 +1,5 @@
 dnl***************************************************************************
-dnl Copyright (c) 2003-2007,2008 Free Software Foundation, Inc.              *
+dnl Copyright (c) 2003-2009,2010 Free Software Foundation, Inc.              *
 dnl                                                                          *
 dnl Permission is hereby granted, free of charge, to any person obtaining a  *
 dnl copy of this software and associated documentation files (the            *
@@ -26,7 +26,7 @@
 dnl authorization.                                                           *
 dnl***************************************************************************
 dnl
-dnl $Id: aclocal.m4,v 1.22 2008/02/09 18:22:17 tom Exp $
+dnl $Id: aclocal.m4,v 1.45 2010/11/20 22:07:06 tom Exp $
 dnl
 dnl Author: Thomas E. Dickey
 dnl
@@ -40,7 +40,7 @@
 dnl
 dnl ---------------------------------------------------------------------------
 dnl ---------------------------------------------------------------------------
-dnl CF_ADD_CFLAGS version: 7 updated: 2004/04/25 17:48:30
+dnl CF_ADD_CFLAGS version: 10 updated: 2010/05/26 05:38:42
 dnl -------------
 dnl Copy non-preprocessor flags to $CFLAGS, preprocessor flags to $CPPFLAGS
 dnl The second parameter if given makes this macro verbose.
@@ -66,8 +66,8 @@
 			cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[[^=]]*='\''\"[[^"]]*//'`
 
 			test "${cf_add_cflags}" != "${cf_tst_cflags}" \
-			&& test -z "${cf_tst_cflags}" \
-			&& cf_fix_cppflags=yes
+				&& test -z "${cf_tst_cflags}" \
+				&& cf_fix_cppflags=yes
 
 			if test $cf_fix_cppflags = yes ; then
 				cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
@@ -82,6 +82,12 @@
 		*$cf_add_cflags) #(vi
 			;;
 		*) #(vi
+			case $cf_add_cflags in #(vi
+			-D*)
+				cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
+				CF_REMOVE_DEFINE(CPPFLAGS,$CPPFLAGS,$cf_tst_cppflags)
+				;;
+			esac
 			cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
 			;;
 		esac
@@ -97,24 +103,24 @@
 	cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[[^"]]*"'\''//'`
 
 	test "${cf_add_cflags}" != "${cf_tst_cflags}" \
-	&& test -z "${cf_tst_cflags}" \
-	&& cf_fix_cppflags=no
+		&& test -z "${cf_tst_cflags}" \
+		&& cf_fix_cppflags=no
 	;;
 esac
 done
 
 if test -n "$cf_new_cflags" ; then
-	ifelse($2,,,[CF_VERBOSE(add to \$CFLAGS $cf_new_cflags)])
+	ifelse([$2],,,[CF_VERBOSE(add to \$CFLAGS $cf_new_cflags)])
 	CFLAGS="$CFLAGS $cf_new_cflags"
 fi
 
 if test -n "$cf_new_cppflags" ; then
-	ifelse($2,,,[CF_VERBOSE(add to \$CPPFLAGS $cf_new_cppflags)])
-	CPPFLAGS="$cf_new_cppflags $CPPFLAGS"
+	ifelse([$2],,,[CF_VERBOSE(add to \$CPPFLAGS $cf_new_cppflags)])
+	CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
 fi
 
 if test -n "$cf_new_extra_cppflags" ; then
-	ifelse($2,,,[CF_VERBOSE(add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags)])
+	ifelse([$2],,,[CF_VERBOSE(add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags)])
 	EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
 fi
 
@@ -122,7 +128,7 @@
 
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_ADD_INCDIR version: 9 updated: 2008/02/09 13:15:34
+dnl CF_ADD_INCDIR version: 13 updated: 2010/05/26 16:44:57
 dnl -------------
 dnl Add an include-directory to $CPPFLAGS.  Don't add /usr/include, since it's
 dnl redundant.  We don't normally need to add -I/usr/local/include for gcc,
@@ -149,7 +155,7 @@
 		fi
 
 		if test "$cf_have_incdir" = no ; then
-          if test "$cf_add_incdir" = /usr/local/include ; then
+		  if test "$cf_add_incdir" = /usr/local/include ; then
 			if test "$GCC" = yes
 			then
 			  cf_save_CPPFLAGS=$CPPFLAGS
@@ -165,11 +171,11 @@
 
 		if test "$cf_have_incdir" = no ; then
 		  CF_VERBOSE(adding $cf_add_incdir to include-path)
-		  ifelse($2,,CPPFLAGS,$2)="-I$cf_add_incdir $ifelse($2,,CPPFLAGS,[$]$2)"
+		  ifelse([$2],,CPPFLAGS,[$2])="$ifelse([$2],,CPPFLAGS,[$2]) -I$cf_add_incdir"
 
-          cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
-          test "$cf_top_incdir" = "$cf_add_incdir" && break
-          cf_add_incdir="$cf_top_incdir"
+		  cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
+		  test "$cf_top_incdir" = "$cf_add_incdir" && break
+		  cf_add_incdir="$cf_top_incdir"
 		else
 		  break
 		fi
@@ -179,7 +185,15 @@
 fi
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_ADD_LIBDIR version: 6 updated: 2008/02/09 13:15:34
+dnl CF_ADD_LIB version: 2 updated: 2010/06/02 05:03:05
+dnl ----------
+dnl Add a library, used to enforce consistency.
+dnl
+dnl $1 = library to add, without the "-l"
+dnl $2 = variable to update (default $LIBS)
+AC_DEFUN([CF_ADD_LIB],[CF_ADD_LIBS(-l$1,ifelse($2,,LIBS,[$2]))])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_ADD_LIBDIR version: 9 updated: 2010/05/26 16:44:57
 dnl -------------
 dnl	Adds to the library-path
 dnl
@@ -208,14 +222,35 @@
       fi
       if test "$cf_have_libdir" = no ; then
         CF_VERBOSE(adding $cf_add_libdir to library-path)
-        ifelse($2,,LDFLAGS,$2)="-L$cf_add_libdir $ifelse($2,,LDFLAGS,[$]$2)"
+        ifelse([$2],,LDFLAGS,[$2])="-L$cf_add_libdir $ifelse([$2],,LDFLAGS,[$2])"
       fi
     fi
   done
 fi
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_ADD_SUBDIR_PATH version: 2 updated: 2007/07/29 10:12:59
+dnl CF_ADD_LIBS version: 1 updated: 2010/06/02 05:03:05
+dnl -----------
+dnl Add one or more libraries, used to enforce consistency.
+dnl
+dnl $1 = libraries to add, with the "-l", etc.
+dnl $2 = variable to update (default $LIBS)
+AC_DEFUN([CF_ADD_LIBS],[ifelse($2,,LIBS,[$2])="$1 [$]ifelse($2,,LIBS,[$2])"])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_ADD_LIB_AFTER version: 2 updated: 2010/11/08 20:33:46
+dnl ----------------
+dnl Add a given library after another, e.g., following the one it satisfies a
+dnl dependency for.
+dnl
+dnl $1 = the first library
+dnl $2 = its dependency
+AC_DEFUN([CF_ADD_LIB_AFTER],[
+CF_VERBOSE(...before $LIBS)
+LIBS=`echo "$LIBS" | sed -e "s/[[ 	]][[ 	]]*/ /g" -e "s,$1 ,$1 $2 ," -e 's/  / /g'`
+CF_VERBOSE(...after  $LIBS)
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_ADD_SUBDIR_PATH version: 3 updated: 2010/07/03 20:58:12
 dnl ------------------
 dnl Append to a search-list for a nonstandard header/lib-file
 dnl	$1 = the variable to return as result
@@ -227,7 +262,7 @@
 [
 test "$4" != "$5" && \
 test -d "$4" && \
-ifelse([$5],NONE,,[(test $5 = NONE || test -d $5) &&]) {
+ifelse([$5],NONE,,[(test $5 = NONE || test "$4" != "$5") &&]) {
 	test -n "$verbose" && echo "	... testing for $3-directories under $4"
 	test -d $4/$3 &&          $1="[$]$1 $4/$3"
 	test -d $4/$3/$2 &&       $1="[$]$1 $4/$3/$2"
@@ -237,13 +272,13 @@
 }
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_ANSI_CC_CHECK version: 9 updated: 2001/12/30 17:53:34
+dnl CF_ANSI_CC_CHECK version: 10 updated: 2010/10/23 15:52:32
 dnl ----------------
 dnl This is adapted from the macros 'fp_PROG_CC_STDC' and 'fp_C_PROTOTYPES'
 dnl in the sharutils 4.2 distribution.
 AC_DEFUN([CF_ANSI_CC_CHECK],
 [
-AC_CACHE_CHECK(for ${CC-cc} option to accept ANSI C, cf_cv_ansi_cc,[
+AC_CACHE_CHECK(for ${CC:-cc} option to accept ANSI C, cf_cv_ansi_cc,[
 cf_cv_ansi_cc=no
 cf_save_CFLAGS="$CFLAGS"
 cf_save_CPPFLAGS="$CPPFLAGS"
@@ -289,7 +324,7 @@
 fi
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_ANSI_CC_REQD version: 3 updated: 1997/09/06 13:40:44
+dnl CF_ANSI_CC_REQD version: 4 updated: 2008/03/23 14:48:54
 dnl ---------------
 dnl For programs that must use an ANSI compiler, obtain compiler options that
 dnl will make it recognize prototypes.  We'll do preprocessor checks in other
@@ -298,7 +333,7 @@
 AC_DEFUN([CF_ANSI_CC_REQD],
 [AC_REQUIRE([CF_ANSI_CC_CHECK])
 if test "$cf_cv_ansi_cc" = "no"; then
-	AC_ERROR(
+	AC_MSG_ERROR(
 [Your compiler does not appear to recognize prototypes.
 You have the following choices:
 	a. adjust your compiler options
@@ -319,7 +354,7 @@
 AC_DEFUN([CF_ARG_ENABLE],
 [CF_ARG_OPTION($1,[$2],[$3],[$4],no)])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_ARG_OPTION version: 3 updated: 1997/10/18 14:42:41
+dnl CF_ARG_OPTION version: 4 updated: 2010/05/26 05:38:42
 dnl -------------
 dnl Restricted form of AC_ARG_ENABLE that ensures user doesn't give bogus
 dnl values.
@@ -331,18 +366,18 @@
 dnl $4 = action if perform if option is default
 dnl $5 = default option value (either 'yes' or 'no')
 AC_DEFUN([CF_ARG_OPTION],
-[AC_ARG_ENABLE($1,[$2],[test "$enableval" != ifelse($5,no,yes,no) && enableval=ifelse($5,no,no,yes)
+[AC_ARG_ENABLE([$1],[$2],[test "$enableval" != ifelse([$5],no,yes,no) && enableval=ifelse([$5],no,no,yes)
   if test "$enableval" != "$5" ; then
-ifelse($3,,[    :]dnl
-,[    $3]) ifelse($4,,,[
+ifelse([$3],,[    :]dnl
+,[    $3]) ifelse([$4],,,[
   else
     $4])
-  fi],[enableval=$5 ifelse($4,,,[
+  fi],[enableval=$5 ifelse([$4],,,[
   $4
 ])dnl
   ])])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_CHECK_CACHE version: 10 updated: 2004/05/23 13:03:31
+dnl CF_CHECK_CACHE version: 11 updated: 2008/03/23 14:45:59
 dnl --------------
 dnl Check if we're accidentally using a cache from a different machine.
 dnl Derive the system name, as a check for reusing the autoconf cache.
@@ -373,7 +408,7 @@
 
 if test ".$system_name" != ".$cf_cv_system_name" ; then
 	AC_MSG_RESULT(Cached system name ($system_name) does not agree with actual ($cf_cv_system_name))
-	AC_ERROR("Please remove config.cache and try again.")
+	AC_MSG_ERROR("Please remove config.cache and try again.")
 fi
 ])dnl
 dnl ---------------------------------------------------------------------------
@@ -399,17 +434,18 @@
 fi
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_CURSES_ACS_MAP version: 3 updated: 2003/05/17 22:19:02
+dnl CF_CURSES_ACS_MAP version: 6 updated: 2010/10/23 15:54:49
 dnl -----------------
 dnl Check for likely values of acs_map[]:
 AC_DEFUN([CF_CURSES_ACS_MAP],
 [
+AC_REQUIRE([CF_NCURSES_WRAP_PREFIX])dnl
 AC_CACHE_CHECK(for alternate character set array, cf_cv_curses_acs_map,[
 cf_cv_curses_acs_map=unknown
-for name in acs_map _acs_map __acs_map _nc_acs_map
+for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
 do
 AC_TRY_LINK([
-#include <${cf_cv_ncurses_header-curses.h}>
+#include <${cf_cv_ncurses_header:-curses.h}>
 ],[
 $name['k'] = ACS_PLUS
 ],[cf_cv_curses_acs_map=$name; break])
@@ -419,17 +455,48 @@
 test "$cf_cv_curses_acs_map" != unknown && AC_DEFINE_UNQUOTED(CURSES_ACS_ARRAY,$cf_cv_curses_acs_map)
 ])
 dnl ---------------------------------------------------------------------------
-dnl CF_CURSES_CHECK_TYPE version: 2 updated: 2003/03/01 23:40:33
+dnl CF_CURSES_CHECK_DATA version: 3 updated: 2010/10/23 15:54:49
+dnl --------------------
+dnl Check if curses.h defines the given data/variable.
+dnl Use this after CF_NCURSES_CONFIG or CF_CURSES_CONFIG.
+AC_DEFUN([CF_CURSES_CHECK_DATA],
+[
+AC_MSG_CHECKING(for data $1 declaration in ${cf_cv_ncurses_header:-curses.h})
+AC_TRY_COMPILE(CF__CURSES_HEAD,[
+void *foo = &($1)
+],cf_result=yes,cf_result=no)
+AC_MSG_RESULT($cf_result)
+if test $cf_result = yes ; then
+	CF_UPPER(cf_result,have_curses_data_$1)
+	AC_DEFINE_UNQUOTED($cf_result)
+else
+	AC_MSG_CHECKING(for data $1 in library)
+	AC_TRY_LINK(CF__CURSES_HEAD
+[extern char $1;],[
+	do {
+		void *foo = &($1);
+		${cf_cv_main_return:-return}(foo == 0);
+	} while (0)
+],[cf_result=yes],[cf_result=no])
+	AC_MSG_RESULT($cf_result)
+	if test $cf_result = yes ; then
+		CF_UPPER(cf_result,decl_curses_data_$1)
+		AC_DEFINE_UNQUOTED($cf_result)
+	fi
+fi
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_CURSES_CHECK_TYPE version: 3 updated: 2010/10/23 15:54:49
 dnl --------------------
 dnl Check if curses.h defines the given type
 AC_DEFUN([CF_CURSES_CHECK_TYPE],
 [
-AC_MSG_CHECKING(for type $1 in ${cf_cv_ncurses_header-curses.h})
+AC_MSG_CHECKING(for type $1 in ${cf_cv_ncurses_header:-curses.h})
 AC_TRY_COMPILE([
 #ifndef _XOPEN_SOURCE_EXTENDED
 #define _XOPEN_SOURCE_EXTENDED
 #endif
-#include <${cf_cv_ncurses_header-curses.h}>],[
+#include <${cf_cv_ncurses_header:-curses.h}>],[
 $1 foo
 ],cf_result=yes,cf_result=no)
 AC_MSG_RESULT($cf_result)
@@ -441,7 +508,19 @@
 fi
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_CURSES_CPPFLAGS version: 9 updated: 2006/02/04 19:44:43
+dnl CF_CURSES_CONFIG version: 2 updated: 2006/10/29 11:06:27
+dnl ----------------
+dnl Tie together the configure-script macros for curses.  It may be ncurses,
+dnl but unless asked, we do not make a special search for ncurses.  However,
+dnl still check for the ncurses version number, for use in other macros.
+AC_DEFUN([CF_CURSES_CONFIG],
+[
+CF_CURSES_CPPFLAGS
+CF_NCURSES_VERSION
+CF_CURSES_LIBS
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_CURSES_CPPFLAGS version: 10 updated: 2009/01/06 19:34:11
 dnl ------------------
 dnl Look for the curses headers.
 AC_DEFUN([CF_CURSES_CPPFLAGS],[
@@ -460,13 +539,13 @@
 	;;
 esac
 ])
-test "$cf_cv_curses_incdir" != no && CPPFLAGS="$cf_cv_curses_incdir $CPPFLAGS"
+test "$cf_cv_curses_incdir" != no && CPPFLAGS="$CPPFLAGS $cf_cv_curses_incdir"
 
 CF_CURSES_HEADER
 CF_TERM_HEADER
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_CURSES_FUNCS version: 13 updated: 2007/04/28 09:15:55
+dnl CF_CURSES_FUNCS version: 15 updated: 2010/10/23 15:52:32
 dnl ---------------
 dnl Curses-functions are a little complicated, since a lot of them are macros.
 AC_DEFUN([CF_CURSES_FUNCS],
@@ -482,28 +561,11 @@
 	AC_CACHE_VAL(cf_cv_func_$cf_func,[
 		eval cf_result='$ac_cv_func_'$cf_func
 		if test ".$cf_result" != ".no"; then
-			AC_TRY_LINK([
-#ifdef HAVE_XCURSES
-#include <xcurses.h>
-char * XCursesProgramName = "test";
-#else
-#include <${cf_cv_ncurses_header-curses.h}>
-#if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
-#include <ncursesw/term.h>
-#else
-#if defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
-#include <ncurses/term.h>
-#else
-#ifdef HAVE_TERM_H
-#include <term.h>
-#endif
-#endif
-#endif
-#endif],
+			AC_TRY_LINK(CF__CURSES_HEAD,
 			[
 #ifndef ${cf_func}
 long foo = (long)(&${cf_func});
-${cf_cv_main_return-return}(foo == 0);
+${cf_cv_main_return:-return}(foo == 0);
 #endif
 			],
 			[cf_result=yes],
@@ -520,20 +582,20 @@
 done
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_CURSES_HEADER version: 1 updated: 2005/12/31 13:28:25
+dnl CF_CURSES_HEADER version: 2 updated: 2010/04/28 06:02:16
 dnl ----------------
 dnl Find a "curses" header file, e.g,. "curses.h", or one of the more common
 dnl variations of ncurses' installs.
 dnl
-dnl See also CF_NCURSES_HEADER, which sets the same cache variable.
+dnl $1 = ncurses when looking for ncurses, or is empty
 AC_DEFUN([CF_CURSES_HEADER],[
 AC_CACHE_CHECK(if we have identified curses headers,cf_cv_ncurses_header,[
 cf_cv_ncurses_header=none
-for cf_header in \
+for cf_header in ifelse($1,,,[ \
+    $1/curses.h \
+	$1/ncurses.h]) \
 	curses.h \
-	ncurses.h \
-	ncurses/curses.h \
-	ncurses/ncurses.h
+	ncurses.h ifelse($1,,[ncurses/curses.h ncurses/ncurses.h])
 do
 AC_TRY_COMPILE([#include <${cf_header}>],
 	[initscr(); tgoto("?", 0,0)],
@@ -549,7 +611,7 @@
 AC_CHECK_HEADERS($cf_cv_ncurses_header)
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_CURSES_LIBS version: 26 updated: 2007/07/29 10:32:40
+dnl CF_CURSES_LIBS version: 31 updated: 2010/10/23 15:54:49
 dnl --------------
 dnl Look for the curses libraries.  Older curses implementations may require
 dnl termcap/termlib to be linked as well.  Call CF_CURSES_CPPFLAGS first.
@@ -557,7 +619,7 @@
 
 AC_REQUIRE([CF_CURSES_CPPFLAGS])dnl
 AC_MSG_CHECKING(if we have identified curses libraries)
-AC_TRY_LINK([#include <${cf_cv_ncurses_header-curses.h}>],
+AC_TRY_LINK([#include <${cf_cv_ncurses_header:-curses.h}>],
     [initscr(); tgoto("?", 0,0)],
     cf_result=yes,
     cf_result=no)
@@ -566,17 +628,17 @@
 if test "$cf_result" = no ; then
 case $host_os in #(vi
 freebsd*) #(vi
-    AC_CHECK_LIB(mytinfo,tgoto,[LIBS="-lmytinfo $LIBS"])
+    AC_CHECK_LIB(mytinfo,tgoto,[CF_ADD_LIBS(-lmytinfo)])
     ;;
 hpux10.*) #(vi
     AC_CHECK_LIB(cur_colr,initscr,[
-        LIBS="-lcur_colr $LIBS"
+        CF_ADD_LIBS(-lcur_colr)
         ac_cv_func_initscr=yes
         ],[
     AC_CHECK_LIB(Hcurses,initscr,[
         # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
-        LIBS="-lHcurses $LIBS"
-        CPPFLAGS="-D__HP_CURSES -D_HP_CURSES $CPPFLAGS"
+        CF_ADD_LIBS(-lHcurses)
+        CPPFLAGS="$CPPFLAGS -D__HP_CURSES -D_HP_CURSES"
         ac_cv_func_initscr=yes
         ])])
     ;;
@@ -586,7 +648,7 @@
 sunos3*|sunos4*)
     if test -d /usr/5lib ; then
       CF_ADD_LIBDIR(/usr/5lib)
-      LIBS="$LIBS -lcurses -ltermcap"
+      CF_ADD_LIBS(-lcurses -ltermcap)
     fi
     ac_cv_func_initscr=yes
     ;;
@@ -597,7 +659,7 @@
     cf_term_lib=""
     cf_curs_lib=""
 
-    if test ".${cf_cv_ncurses_version-no}" != .no
+    if test ".${cf_cv_ncurses_version:-no}" != .no
     then
         cf_check_list="ncurses curses cursesX"
     else
@@ -615,31 +677,31 @@
 
     # Check for library containing initscr
     test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
-    for cf_curs_lib in $cf_check_list xcurses jcurses unknown
+ 	for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
     do
         AC_CHECK_LIB($cf_curs_lib,initscr,[break])
     done
-    test $cf_curs_lib = unknown && AC_ERROR(no curses library found)
+    test $cf_curs_lib = unknown && AC_MSG_ERROR(no curses library found)
 
     LIBS="-l$cf_curs_lib $cf_save_LIBS"
     if test "$cf_term_lib" = unknown ; then
         AC_MSG_CHECKING(if we can link with $cf_curs_lib library)
-        AC_TRY_LINK([#include <${cf_cv_ncurses_header-curses.h}>],
+        AC_TRY_LINK([#include <${cf_cv_ncurses_header:-curses.h}>],
             [initscr()],
             [cf_result=yes],
             [cf_result=no])
         AC_MSG_RESULT($cf_result)
-        test $cf_result = no && AC_ERROR(Cannot link curses library)
+        test $cf_result = no && AC_MSG_ERROR(Cannot link curses library)
     elif test "$cf_curs_lib" = "$cf_term_lib" ; then
         :
     elif test "$cf_term_lib" != predefined ; then
         AC_MSG_CHECKING(if we need both $cf_curs_lib and $cf_term_lib libraries)
-        AC_TRY_LINK([#include <${cf_cv_ncurses_header-curses.h}>],
+        AC_TRY_LINK([#include <${cf_cv_ncurses_header:-curses.h}>],
             [initscr(); tgoto((char *)0, 0, 0);],
             [cf_result=no],
             [
             LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
-            AC_TRY_LINK([#include <${cf_cv_ncurses_header-curses.h}>],
+            AC_TRY_LINK([#include <${cf_cv_ncurses_header:-curses.h}>],
                 [initscr()],
                 [cf_result=yes],
                 [cf_result=error])
@@ -651,7 +713,7 @@
 
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_CURSES_TERM_H version: 6 updated: 2003/11/06 19:59:57
+dnl CF_CURSES_TERM_H version: 8 updated: 2010/10/23 15:54:49
 dnl ----------------
 dnl SVr4 curses should have term.h as well (where it puts the definitions of
 dnl the low-level interface).  This may not be true in old/broken implementations,
@@ -659,30 +721,52 @@
 dnl running with Solaris 2.5.1).
 AC_DEFUN([CF_CURSES_TERM_H],
 [
+AC_REQUIRE([CF_CURSES_CPPFLAGS])dnl
+
 AC_CACHE_CHECK(for term.h, cf_cv_term_header,[
 
-AC_REQUIRE([CF_CURSES_CPPFLAGS])dnl
 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
 # for <term.h> if we do not find the variant.
 for cf_header in \
-	`echo ${cf_cv_ncurses_header-curses.h} | sed -e 's%/.*%/%'`term.h \
+	`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%/.*%/%'`term.h \
 	term.h
 do
 	AC_TRY_COMPILE([
-#include <${cf_cv_ncurses_header-curses.h}>
+#include <${cf_cv_ncurses_header:-curses.h}>
 #include <${cf_header}>],
 	[WINDOW *x],
 	[cf_cv_term_header=$cf_header
 	 break],
 	[cf_cv_term_header=no])
 done
+
+case $cf_cv_term_header in #(vi
+no)
+	# If curses is ncurses, some packagers still mess it up by trying to make
+	# us use GNU termcap.  This handles the most common case.
+	for cf_header in ncurses/term.h ncursesw/term.h
+	do
+		AC_TRY_COMPILE([
+#include <${cf_cv_ncurses_header:-curses.h}>
+#ifdef NCURSES_VERSION
+#include <${cf_header}>
+#else
+make an error
+#endif],
+			[WINDOW *x],
+			[cf_cv_term_header=$cf_header
+			 break],
+			[cf_cv_term_header=no])
+	done
+	;;
+esac
 ])
 
 case $cf_cv_term_header in #(vi
 term.h) #(vi
 	AC_DEFINE(HAVE_TERM_H)
 	;;
-ncurses/term.h)
+ncurses/term.h) #(vi
 	AC_DEFINE(HAVE_NCURSES_TERM_H)
 	;;
 ncursesw/term.h)
@@ -691,7 +775,7 @@
 esac
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_CURSES_WACS_MAP version: 3 updated: 2003/05/17 22:19:02
+dnl CF_CURSES_WACS_MAP version: 4 updated: 2010/10/23 15:54:49
 dnl ------------------
 dnl Check for likely values of wacs_map[]:
 AC_DEFUN([CF_CURSES_WACS_MAP],
@@ -704,7 +788,7 @@
 #ifndef _XOPEN_SOURCE_EXTENDED
 #define _XOPEN_SOURCE_EXTENDED
 #endif
-#include <${cf_cv_ncurses_header-curses.h}>],
+#include <${cf_cv_ncurses_header:-curses.h}>],
 	[$name['k'] = *WACS_PLUS],
 	[cf_cv_curses_wacs_map=$name
 	 break])
@@ -716,7 +800,7 @@
 dnl "dirname" is not portable, so we fake it with a shell script.
 AC_DEFUN([CF_DIRNAME],[$1=`echo $2 | sed -e 's%/[[^/]]*$%%'`])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_DISABLE_ECHO version: 10 updated: 2003/04/17 22:27:11
+dnl CF_DISABLE_ECHO version: 11 updated: 2009/12/13 13:16:57
 dnl ---------------
 dnl You can always use "make -n" to see the actual options, but it's hard to
 dnl pick out/analyze warning messages when the compile-line is long.
@@ -735,14 +819,14 @@
 	[
     ECHO_LT='--silent'
     ECHO_LD='@echo linking [$]@;'
-    RULE_CC='	@echo compiling [$]<'
-    SHOW_CC='	@echo compiling [$]@'
+    RULE_CC='@echo compiling [$]<'
+    SHOW_CC='@echo compiling [$]@'
     ECHO_CC='@'
 ],[
     ECHO_LT=''
     ECHO_LD=''
-    RULE_CC='# compiling'
-    SHOW_CC='# compiling'
+    RULE_CC=''
+    SHOW_CC=''
     ECHO_CC=''
 ])
 AC_MSG_RESULT($enableval)
@@ -753,7 +837,30 @@
 AC_SUBST(ECHO_CC)
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_ENABLE_WARNINGS version: 3 updated: 2003/05/24 14:24:29
+dnl CF_DISABLE_LEAKS version: 6 updated: 2010/07/23 04:14:32
+dnl ----------------
+dnl Combine no-leak checks with the libraries or tools that are used for the
+dnl checks.
+AC_DEFUN([CF_DISABLE_LEAKS],[
+
+AC_REQUIRE([CF_WITH_DMALLOC])
+AC_REQUIRE([CF_WITH_DBMALLOC])
+AC_REQUIRE([CF_WITH_VALGRIND])
+
+AC_MSG_CHECKING(if you want to perform memory-leak testing)
+AC_ARG_ENABLE(leaks,
+	[  --disable-leaks         test: free permanent memory, analyze leaks],
+	[if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi],
+	: ${with_no_leaks:=no})
+AC_MSG_RESULT($with_no_leaks)
+
+if test "$with_no_leaks" = yes ; then
+	AC_DEFINE(NO_LEAKS)
+	AC_DEFINE(YY_NO_LEAKS)
+fi
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_ENABLE_WARNINGS version: 4 updated: 2009/07/26 17:53:03
 dnl ------------------
 dnl Configure-option to enable gcc warnings
 AC_DEFUN([CF_ENABLE_WARNINGS],[
@@ -767,12 +874,13 @@
 AC_MSG_RESULT($with_warnings)
 if test "$with_warnings" = "yes"
 then
+	CF_GCC_ATTRIBUTES
 	CF_GCC_WARNINGS
 fi
 fi
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_FIND_LIBRARY version: 8 updated: 2004/11/23 20:14:58
+dnl CF_FIND_LIBRARY version: 9 updated: 2008/03/23 14:48:54
 dnl ---------------
 dnl Look for a non-standard library, given parameters for AC_TRY_LINK.  We
 dnl prefer a standard location, and use -L options only if we do not find the
@@ -817,12 +925,142 @@
 eval 'cf_found_library=[$]cf_cv_have_lib_'$1
 ifelse($6,,[
 if test $cf_found_library = no ; then
-	AC_ERROR(Cannot link $1 library)
+	AC_MSG_ERROR(Cannot link $1 library)
 fi
 ])
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_FUNC_CURSES_VERSION version: 4 updated: 2007/04/28 09:15:55
+dnl CF_FIND_LINKAGE version: 19 updated: 2010/05/29 16:31:02
+dnl ---------------
+dnl Find a library (specifically the linkage used in the code fragment),
+dnl searching for it if it is not already in the library path.
+dnl See also CF_ADD_SEARCHPATH.
+dnl
+dnl Parameters (4-on are optional):
+dnl     $1 = headers for library entrypoint
+dnl     $2 = code fragment for library entrypoint
+dnl     $3 = the library name without the "-l" option or ".so" suffix.
+dnl     $4 = action to perform if successful (default: update CPPFLAGS, etc)
+dnl     $5 = action to perform if not successful
+dnl     $6 = module name, if not the same as the library name
+dnl     $7 = extra libraries
+dnl
+dnl Sets these variables:
+dnl     $cf_cv_find_linkage_$3 - yes/no according to whether linkage is found
+dnl     $cf_cv_header_path_$3 - include-directory if needed
+dnl     $cf_cv_library_path_$3 - library-directory if needed
+dnl     $cf_cv_library_file_$3 - library-file if needed, e.g., -l$3
+AC_DEFUN([CF_FIND_LINKAGE],[
+
+# If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
+# will be set on completion of the AC_TRY_LINK below.
+cf_cv_header_path_$3=
+cf_cv_library_path_$3=
+
+CF_MSG_LOG([Starting [FIND_LINKAGE]($3,$6)])
+
+cf_save_LIBS="$LIBS"
+
+AC_TRY_LINK([$1],[$2],[
+	cf_cv_find_linkage_$3=yes
+	cf_cv_header_path_$3=/usr/include
+	cf_cv_library_path_$3=/usr/lib
+],[
+
+LIBS="-l$3 $7 $cf_save_LIBS"
+
+AC_TRY_LINK([$1],[$2],[
+	cf_cv_find_linkage_$3=yes
+	cf_cv_header_path_$3=/usr/include
+	cf_cv_library_path_$3=/usr/lib
+	cf_cv_library_file_$3="-l$3"
+],[
+	cf_cv_find_linkage_$3=no
+	LIBS="$cf_save_LIBS"
+
+    CF_VERBOSE(find linkage for $3 library)
+    CF_MSG_LOG([Searching for headers in [FIND_LINKAGE]($3,$6)])
+
+    cf_save_CPPFLAGS="$CPPFLAGS"
+    cf_test_CPPFLAGS="$CPPFLAGS"
+
+    CF_HEADER_PATH(cf_search,ifelse([$6],,[$3],[$6]))
+    for cf_cv_header_path_$3 in $cf_search
+    do
+      if test -d $cf_cv_header_path_$3 ; then
+        CF_VERBOSE(... testing $cf_cv_header_path_$3)
+        CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_$3"
+        AC_TRY_COMPILE([$1],[$2],[
+            CF_VERBOSE(... found $3 headers in $cf_cv_header_path_$3)
+            cf_cv_find_linkage_$3=maybe
+            cf_test_CPPFLAGS="$CPPFLAGS"
+            break],[
+            CPPFLAGS="$cf_save_CPPFLAGS"
+            ])
+      fi
+    done
+
+    if test "$cf_cv_find_linkage_$3" = maybe ; then
+
+      CF_MSG_LOG([Searching for $3 library in [FIND_LINKAGE]($3,$6)])
+
+      cf_save_LIBS="$LIBS"
+      cf_save_LDFLAGS="$LDFLAGS"
+
+      ifelse([$6],,,[
+        CPPFLAGS="$cf_test_CPPFLAGS"
+        LIBS="-l$3 $7 $cf_save_LIBS"
+        AC_TRY_LINK([$1],[$2],[
+            CF_VERBOSE(... found $3 library in system)
+            cf_cv_find_linkage_$3=yes])
+            CPPFLAGS="$cf_save_CPPFLAGS"
+            LIBS="$cf_save_LIBS"
+            ])
+
+      if test "$cf_cv_find_linkage_$3" != yes ; then
+        CF_LIBRARY_PATH(cf_search,$3)
+        for cf_cv_library_path_$3 in $cf_search
+        do
+          if test -d $cf_cv_library_path_$3 ; then
+            CF_VERBOSE(... testing $cf_cv_library_path_$3)
+            CPPFLAGS="$cf_test_CPPFLAGS"
+            LIBS="-l$3 $7 $cf_save_LIBS"
+            LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_$3"
+            AC_TRY_LINK([$1],[$2],[
+                CF_VERBOSE(... found $3 library in $cf_cv_library_path_$3)
+                cf_cv_find_linkage_$3=yes
+                cf_cv_library_file_$3="-l$3"
+                break],[
+                CPPFLAGS="$cf_save_CPPFLAGS"
+                LIBS="$cf_save_LIBS"
+                LDFLAGS="$cf_save_LDFLAGS"
+                ])
+          fi
+        done
+        CPPFLAGS="$cf_save_CPPFLAGS"
+        LDFLAGS="$cf_save_LDFLAGS"
+      fi
+
+    else
+      cf_cv_find_linkage_$3=no
+    fi
+    ],$7)
+])
+
+LIBS="$cf_save_LIBS"
+
+if test "$cf_cv_find_linkage_$3" = yes ; then
+ifelse([$4],,[
+	CF_ADD_INCDIR($cf_cv_header_path_$3)
+	CF_ADD_LIBDIR($cf_cv_library_path_$3)
+	CF_ADD_LIB($3)
+],[$4])
+else
+ifelse([$5],,AC_MSG_WARN(Cannot find $3 library),[$5])
+fi
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_FUNC_CURSES_VERSION version: 5 updated: 2010/10/23 15:54:49
 dnl ----------------------
 dnl Solaris has a data item 'curses_version', which confuses AC_CHECK_FUNCS.
 dnl It's a character string "SVR4", not documented.
@@ -830,12 +1068,12 @@
 [
 AC_CACHE_CHECK(for function curses_version, cf_cv_func_curses_version,[
 AC_TRY_RUN([
-#include <${cf_cv_ncurses_header-curses.h}>
+#include <${cf_cv_ncurses_header:-curses.h}>
 int main()
 {
 	char temp[1024];
 	sprintf(temp, "%s\n", curses_version());
-	${cf_cv_main_return-return}(0);
+	${cf_cv_main_return:-return}(0);
 }]
 ,[cf_cv_func_curses_version=yes]
 ,[cf_cv_func_curses_version=no]
@@ -844,7 +1082,7 @@
 test "$cf_cv_func_curses_version" = yes && AC_DEFINE(HAVE_CURSES_VERSION)
 ])
 dnl ---------------------------------------------------------------------------
-dnl CF_GCC_ATTRIBUTES version: 11 updated: 2007/07/29 09:55:12
+dnl CF_GCC_ATTRIBUTES version: 14 updated: 2010/10/23 15:52:32
 dnl -----------------
 dnl Test for availability of useful gcc __attribute__ directives to quiet
 dnl compiler warnings.  Though useful, not all are supported -- and contrary
@@ -871,7 +1109,7 @@
 then
 	AC_CHECKING([for $CC __attribute__ directives])
 cat > conftest.$ac_ext <<EOF
-#line __oline__ "${as_me-configure}"
+#line __oline__ "${as_me:-configure}"
 #include "confdefs.h"
 #include "conftest.h"
 #include "conftest.i"
@@ -890,26 +1128,61 @@
 extern void foo(void) GCC_NORETURN;
 int main(int argc GCC_UNUSED, char *argv[[]] GCC_UNUSED) { return 0; }
 EOF
+	cf_printf_attribute=no
+	cf_scanf_attribute=no
 	for cf_attribute in scanf printf unused noreturn
 	do
 		CF_UPPER(cf_ATTRIBUTE,$cf_attribute)
 		cf_directive="__attribute__(($cf_attribute))"
 		echo "checking for $CC $cf_directive" 1>&AC_FD_CC
-		case $cf_attribute in
-		scanf|printf)
-		cat >conftest.h <<EOF
+
+		case $cf_attribute in #(vi
+		printf) #(vi
+			cf_printf_attribute=yes
+			cat >conftest.h <<EOF
+#define GCC_$cf_ATTRIBUTE 1
+EOF
+			;;
+		scanf) #(vi
+			cf_scanf_attribute=yes
+			cat >conftest.h <<EOF
 #define GCC_$cf_ATTRIBUTE 1
 EOF
 			;;
-		*)
-		cat >conftest.h <<EOF
+		*) #(vi
+			cat >conftest.h <<EOF
 #define GCC_$cf_ATTRIBUTE $cf_directive
 EOF
 			;;
 		esac
+
 		if AC_TRY_EVAL(ac_compile); then
 			test -n "$verbose" && AC_MSG_RESULT(... $cf_attribute)
 			cat conftest.h >>confdefs.h
+			case $cf_attribute in #(vi
+			printf) #(vi
+				if test "$cf_printf_attribute" = no ; then
+					cat >>confdefs.h <<EOF
+#define GCC_PRINTFLIKE(fmt,var) /* nothing */
+EOF
+				else
+					cat >>confdefs.h <<EOF
+#define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
+EOF
+				fi
+				;;
+			scanf) #(vi
+				if test "$cf_scanf_attribute" = no ; then
+					cat >>confdefs.h <<EOF
+#define GCC_SCANFLIKE(fmt,var) /* nothing */
+EOF
+				else
+					cat >>confdefs.h <<EOF
+#define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
+EOF
+				fi
+				;;
+			esac
 		fi
 	done
 else
@@ -919,7 +1192,7 @@
 fi
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_GCC_VERSION version: 4 updated: 2005/08/27 09:53:42
+dnl CF_GCC_VERSION version: 5 updated: 2010/04/24 11:02:31
 dnl --------------
 dnl Find version of gcc
 AC_DEFUN([CF_GCC_VERSION],[
@@ -927,13 +1200,13 @@
 GCC_VERSION=none
 if test "$GCC" = yes ; then
 	AC_MSG_CHECKING(version of $CC)
-	GCC_VERSION="`${CC} --version| sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[[^0-9.]]*//' -e 's/[[^0-9.]].*//'`"
+	GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[[^0-9.]]*//' -e 's/[[^0-9.]].*//'`"
 	test -z "$GCC_VERSION" && GCC_VERSION=unknown
 	AC_MSG_RESULT($GCC_VERSION)
 fi
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_GCC_WARNINGS version: 22 updated: 2007/07/29 09:55:12
+dnl CF_GCC_WARNINGS version: 27 updated: 2010/10/23 15:52:32
 dnl ---------------
 dnl Check if the compiler supports useful warning options.  There's a few that
 dnl we don't use, simply because they're too noisy:
@@ -958,7 +1231,7 @@
 CF_INTEL_COMPILER(GCC,INTEL_COMPILER,CFLAGS)
 
 cat > conftest.$ac_ext <<EOF
-#line __oline__ "${as_me-configure}"
+#line __oline__ "${as_me:-configure}"
 int main(int argc, char *argv[[]]) { return (argv[[argc-1]] == 0) ; }
 EOF
 
@@ -966,7 +1239,6 @@
 then
 # The "-wdXXX" options suppress warnings:
 # remark #1419: external declaration in primary source file
-# remark #1682: implicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
 # remark #193: zero used for undefined preprocessing identifier
@@ -974,19 +1246,18 @@
 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
 # remark #869: parameter "tw" was never referenced
 # remark #981: operands are evaluated in unspecified order
-# warning #269: invalid format string conversion
+# warning #279: controlling expression is constant
 
 	AC_CHECKING([for $CC warning options])
 	cf_save_CFLAGS="$CFLAGS"
 	EXTRA_CFLAGS="-Wall"
 	for cf_opt in \
 		wd1419 \
-		wd1682 \
 		wd1683 \
 		wd1684 \
 		wd193 \
-		wd279 \
 		wd593 \
+		wd279 \
 		wd810 \
 		wd869 \
 		wd981
@@ -1003,10 +1274,10 @@
 then
 	AC_CHECKING([for $CC warning options])
 	cf_save_CFLAGS="$CFLAGS"
-	EXTRA_CFLAGS="-W -Wall"
+	EXTRA_CFLAGS=
 	cf_warn_CONST=""
 	test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
-	for cf_opt in \
+	for cf_opt in W Wall \
 		Wbad-function-cast \
 		Wcast-align \
 		Wcast-qual \
@@ -1028,7 +1299,7 @@
 				;;
 			Winline) #(vi
 				case $GCC_VERSION in
-				3.3*)
+				[[34]].*)
 					CF_VERBOSE(feature is broken in gcc $GCC_VERSION)
 					continue;;
 				esac
@@ -1039,7 +1310,7 @@
 	done
 	CFLAGS="$cf_save_CFLAGS"
 fi
-rm -f conftest*
+rm -rf conftest*
 
 AC_SUBST(EXTRA_CFLAGS)
 ])dnl
@@ -1074,11 +1345,35 @@
 test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_HEADER_PATH version: 8 updated: 2002/11/10 14:46:59
+dnl CF_HEADER_PATH version: 12 updated: 2010/05/05 05:22:40
 dnl --------------
-dnl Construct a search-list for a nonstandard header-file
+dnl Construct a search-list of directories for a nonstandard header-file
+dnl
+dnl Parameters
+dnl	$1 = the variable to return as result
+dnl	$2 = the package name
 AC_DEFUN([CF_HEADER_PATH],
-[CF_SUBDIR_PATH($1,$2,include)
+[
+$1=
+
+# collect the current set of include-directories from compiler flags
+cf_header_path_list=""
+if test -n "${CFLAGS}${CPPFLAGS}" ; then
+	for cf_header_path in $CPPFLAGS $CFLAGS
+	do
+		case $cf_header_path in #(vi
+		-I*)
+			cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
+			CF_ADD_SUBDIR_PATH($1,$2,include,$cf_header_path,NONE)
+			cf_header_path_list="$cf_header_path_list [$]$1"
+			;;
+		esac
+	done
+fi
+
+# add the variations for the package we are looking for
+CF_SUBDIR_PATH($1,$2,include)
+
 test "$includedir" != NONE && \
 test "$includedir" != "/usr/include" && \
 test -d "$includedir" && {
@@ -1093,6 +1388,7 @@
 	test -d $oldincludedir/$2 && $1="[$]$1 $oldincludedir/$2"
 }
 
+$1="[$]$1 $cf_header_path_list"
 ])dnl
 dnl ---------------------------------------------------------------------------
 dnl CF_INHERIT_SCRIPT version: 2 updated: 2003/03/01 23:50:42
@@ -1103,7 +1399,7 @@
 test -f $1 || ( test -f ../$1 && cp ../$1 ./ )
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_INTEL_COMPILER version: 3 updated: 2005/08/06 18:37:29
+dnl CF_INTEL_COMPILER version: 4 updated: 2010/05/26 05:38:42
 dnl -----------------
 dnl Check if the given compiler is really the Intel compiler for Linux.  It
 dnl tries to imitate gcc, but does not return an error when it finds a mismatch
@@ -1117,41 +1413,186 @@
 dnl $2 = INTEL_COMPILER (default) or INTEL_CPLUSPLUS
 dnl $3 = CFLAGS (default) or CXXFLAGS
 AC_DEFUN([CF_INTEL_COMPILER],[
-ifelse($2,,INTEL_COMPILER,[$2])=no
+ifelse([$2],,INTEL_COMPILER,[$2])=no
 
-if test "$ifelse($1,,[$1],GCC)" = yes ; then
+if test "$ifelse([$1],,[$1],GCC)" = yes ; then
 	case $host_os in
 	linux*|gnu*)
-		AC_MSG_CHECKING(if this is really Intel ifelse($1,GXX,C++,C) compiler)
-		cf_save_CFLAGS="$ifelse($3,,CFLAGS,[$3])"
-		ifelse($3,,CFLAGS,[$3])="$ifelse($3,,CFLAGS,[$3]) -no-gcc"
+		AC_MSG_CHECKING(if this is really Intel ifelse([$1],GXX,C++,C) compiler)
+		cf_save_CFLAGS="$ifelse([$3],,CFLAGS,[$3])"
+		ifelse([$3],,CFLAGS,[$3])="$ifelse([$3],,CFLAGS,[$3]) -no-gcc"
 		AC_TRY_COMPILE([],[
 #ifdef __INTEL_COMPILER
 #else
 make an error
 #endif
-],[ifelse($2,,INTEL_COMPILER,[$2])=yes
+],[ifelse([$2],,INTEL_COMPILER,[$2])=yes
 cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc"
 ],[])
-		ifelse($3,,CFLAGS,[$3])="$cf_save_CFLAGS"
-		AC_MSG_RESULT($ifelse($2,,INTEL_COMPILER,[$2]))
+		ifelse([$3],,CFLAGS,[$3])="$cf_save_CFLAGS"
+		AC_MSG_RESULT($ifelse([$2],,INTEL_COMPILER,[$2]))
 		;;
 	esac
 fi
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_LIBRARY_PATH version: 7 updated: 2002/11/10 14:46:59
+dnl CF_LIBRARY_PATH version: 9 updated: 2010/03/28 12:52:50
 dnl ---------------
-dnl Construct a search-list for a nonstandard library-file
+dnl Construct a search-list of directories for a nonstandard library-file
+dnl
+dnl Parameters
+dnl	$1 = the variable to return as result
+dnl	$2 = the package name
 AC_DEFUN([CF_LIBRARY_PATH],
-[CF_SUBDIR_PATH($1,$2,lib)])dnl
+[
+$1=
+cf_library_path_list=""
+if test -n "${LDFLAGS}${LIBS}" ; then
+	for cf_library_path in $LDFLAGS $LIBS
+	do
+		case $cf_library_path in #(vi
+		-L*)
+			cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
+			CF_ADD_SUBDIR_PATH($1,$2,lib,$cf_library_path,NONE)
+			cf_library_path_list="$cf_library_path_list [$]$1"
+			;;
+		esac
+	done
+fi
+
+CF_SUBDIR_PATH($1,$2,lib)
+
+$1="$cf_library_path_list [$]$1"
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_MAKE_TAGS version: 6 updated: 2010/10/23 15:52:32
+dnl ------------
+dnl Generate tags/TAGS targets for makefiles.  Do not generate TAGS if we have
+dnl a monocase filesystem.
+AC_DEFUN([CF_MAKE_TAGS],[
+AC_REQUIRE([CF_MIXEDCASE_FILENAMES])
+
+AC_CHECK_PROGS(CTAGS, exctags ctags)
+AC_CHECK_PROGS(ETAGS, exetags etags)
+
+AC_CHECK_PROG(MAKE_LOWER_TAGS, ${CTAGS:-ctags}, yes, no)
+
+if test "$cf_cv_mixedcase" = yes ; then
+	AC_CHECK_PROG(MAKE_UPPER_TAGS, ${ETAGS:-etags}, yes, no)
+else
+	MAKE_UPPER_TAGS=no
+fi
+
+if test "$MAKE_UPPER_TAGS" = yes ; then
+	MAKE_UPPER_TAGS=
+else
+	MAKE_UPPER_TAGS="#"
+fi
+
+if test "$MAKE_LOWER_TAGS" = yes ; then
+	MAKE_LOWER_TAGS=
+else
+	MAKE_LOWER_TAGS="#"
+fi
+
+AC_SUBST(CTAGS)
+AC_SUBST(ETAGS)
+
+AC_SUBST(MAKE_UPPER_TAGS)
+AC_SUBST(MAKE_LOWER_TAGS)
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_MATH_LIB version: 8 updated: 2010/05/29 16:31:02
+dnl -----------
+dnl Checks for libraries.  At least one UNIX system, Apple Macintosh
+dnl Rhapsody 5.5, does not have -lm.  We cannot use the simpler
+dnl AC_CHECK_LIB(m,sin), because that fails for C++.
+AC_DEFUN([CF_MATH_LIB],
+[
+AC_CACHE_CHECK(if -lm needed for math functions,
+	cf_cv_need_libm,[
+	AC_TRY_LINK([
+	#include <stdio.h>
+	#include <math.h>
+	],
+	[double x = rand(); printf("result = %g\n", ]ifelse([$2],,sin(x),$2)[)],
+	[cf_cv_need_libm=no],
+	[cf_cv_need_libm=yes])])
+if test "$cf_cv_need_libm" = yes
+then
+ifelse($1,,[
+	CF_ADD_LIB(m)
+],[$1=-lm])
+fi
+])
+dnl ---------------------------------------------------------------------------
+dnl CF_MIN_GETCCHAR version: 3 updated: 2010/10/23 15:54:49
+dnl ---------------
+dnl CF_MIN_GETCCHAR
+dnl Check whether getcchar's return value counts the trailing null in a wchar_t
+dnl string, or not.  X/Open says it does, but Tru64 and Solaris do not do this.
+AC_DEFUN([CF_MIN_GETCCHAR],[
+AC_CACHE_CHECK(if getcchar counts trailing null,cf_cv_min_getcchar,[
+AC_TRY_RUN([
+#include <stdlib.h>
+#include <stdarg.h>
+#include <${cf_cv_ncurses_header:-curses.h}>
+
+int main()
+{
+	wchar_t data[2];
+	cchar_t temp[2];
+	int count;
+	data[0] = L'\0';
+    setcchar(temp, data, 0, 0, (void *)0);
+	count = getcchar(temp, (wchar_t *)0, (attr_t *)0, (short *)0, (void *)0);
+	${cf_cv_main_return:-return}(count != 0);
+}],
+	[cf_cv_min_getcchar=no],
+	[cf_cv_min_getcchar=yes],
+	[cf_cv_min_getcchar=yes])
+])
+if test "$cf_cv_min_getcchar" = yes ; then
+	AC_DEFINE(MIN_GETCCHAR,1)
+fi
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_MIXEDCASE_FILENAMES version: 3 updated: 2003/09/20 17:07:55
+dnl ----------------------
+dnl Check if the file-system supports mixed-case filenames.  If we're able to
+dnl create a lowercase name and see it as uppercase, it doesn't support that.
+AC_DEFUN([CF_MIXEDCASE_FILENAMES],
+[
+AC_CACHE_CHECK(if filesystem supports mixed-case filenames,cf_cv_mixedcase,[
+if test "$cross_compiling" = yes ; then
+	case $target_alias in #(vi
+	*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-mingw32*|*-uwin*) #(vi
+		cf_cv_mixedcase=no
+		;;
+	*)
+		cf_cv_mixedcase=yes
+		;;
+	esac
+else
+	rm -f conftest CONFTEST
+	echo test >conftest
+	if test -f CONFTEST ; then
+		cf_cv_mixedcase=no
+	else
+		cf_cv_mixedcase=yes
+	fi
+	rm -f conftest CONFTEST
+fi
+])
+test "$cf_cv_mixedcase" = yes && AC_DEFINE(MIXEDCASE_FILENAMES)
+])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_MSG_LOG version: 4 updated: 2007/07/29 09:55:12
+dnl CF_MSG_LOG version: 5 updated: 2010/10/23 15:52:32
 dnl ----------
 dnl Write a debug message to config.log, along with the line number in the
 dnl configure script.
 AC_DEFUN([CF_MSG_LOG],[
-echo "${as_me-configure}:__oline__: testing $* ..." 1>&AC_FD_CC
+echo "${as_me:-configure}:__oline__: testing $* ..." 1>&AC_FD_CC
 ])dnl
 dnl ---------------------------------------------------------------------------
 dnl CF_NCURSES_CC_CHECK version: 4 updated: 2007/07/29 10:39:05
@@ -1187,7 +1628,47 @@
 	,[$1=no])
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_NCURSES_CPPFLAGS version: 19 updated: 2007/07/29 13:35:20
+dnl CF_NCURSES_CONFIG version: 8 updated: 2010/07/08 05:17:30
+dnl -----------------
+dnl Tie together the configure-script macros for ncurses.
+dnl Prefer the "-config" script from ncurses 6.x, to simplify analysis.
+dnl Allow that to be overridden using the $NCURSES_CONFIG environment variable.
+dnl
+dnl $1 is the root library name (default: "ncurses")
+AC_DEFUN([CF_NCURSES_CONFIG],
+[
+cf_ncuconfig_root=ifelse($1,,ncurses,$1)
+
+echo "Looking for ${cf_ncuconfig_root}-config"
+AC_PATH_PROGS(NCURSES_CONFIG,${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config,none)
+
+if test "$NCURSES_CONFIG" != none ; then
+
+CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
+CF_ADD_LIBS(`$NCURSES_CONFIG --libs`)
+
+# even with config script, some packages use no-override for curses.h
+CF_CURSES_HEADER(ifelse($1,,ncurses,$1))
+
+dnl like CF_NCURSES_CPPFLAGS
+AC_DEFINE(NCURSES)
+
+dnl like CF_NCURSES_LIBS
+CF_UPPER(cf_nculib_ROOT,HAVE_LIB$cf_ncuconfig_root)
+AC_DEFINE_UNQUOTED($cf_nculib_ROOT)
+
+dnl like CF_NCURSES_VERSION
+cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
+
+else
+
+CF_NCURSES_CPPFLAGS(ifelse($1,,ncurses,$1))
+CF_NCURSES_LIBS(ifelse($1,,ncurses,$1))
+
+fi
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_NCURSES_CPPFLAGS version: 20 updated: 2010/11/20 17:02:38
 dnl -------------------
 dnl Look for the SVr4 curses clone 'ncurses' in the standard places, adjusting
 dnl the CPPFLAGS variable so we can include its header.
@@ -1216,7 +1697,7 @@
 
 test -n "$cf_cv_curses_dir" && \
 test "$cf_cv_curses_dir" != "no" && { \
-  CF_ADD_INCDIR($cf_cv_curses_dir/include $cf_cv_curses_dir/include/$cf_ncuhdr_root)
+  CF_ADD_INCDIR($cf_cv_curses_dir/include/$cf_ncuhdr_root)
 }
 
 AC_CACHE_CHECK(for $cf_ncuhdr_root header in include-path, cf_cv_ncurses_h,[
@@ -1238,7 +1719,42 @@
 CF_NCURSES_VERSION
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_NCURSES_HEADER version: 1 updated: 2005/12/31 13:28:37
+dnl CF_NCURSES_EXT_FUNCS version: 3 updated: 2010/11/13 19:43:23
+dnl --------------------
+dnl Since 2007/11/17, ncurses has defined NCURSES_EXT_FUNCS; earlier versions
+dnl may provide these functions.  Define the symbol if it is not defined, and
+dnl if it is valid.
+AC_DEFUN([CF_NCURSES_EXT_FUNCS],
+[
+AC_CACHE_CHECK(for ncurses extended functions,cf_cv_ncurses_ext_funcs,[
+AC_TRY_COMPILE([
+#include <${cf_cv_ncurses_header:-curses.h}>],
+[
+int x = NCURSES_EXT_FUNCS
+],[cf_cv_ncurses_ext_funcs=defined],[
+AC_TRY_LINK([
+#include <${cf_cv_ncurses_header:-curses.h}>],
+[
+	(void) assume_default_colors (0, 0);
+	(void) curses_version ();
+	(void) define_key (0, 0);
+	(void) is_term_resized (0, 0);
+	(void) key_defined (0);
+	(void) keybound (0, 0);
+	(void) keyok (0, 0);
+	(void) resize_term (0, 0);
+	(void) resizeterm (0, 0);
+	(void) use_default_colors ();
+	(void) use_extended_names (0);
+	(void) wresize (0, 0, 0);],
+	[cf_cv_ncurses_ext_funcs=yes],
+	[cf_cv_ncurses_ext_funcs=no])
+])
+])
+test "$cf_cv_ncurses_ext_funcs" = yes && AC_DEFINE(NCURSES_EXT_FUNCS)
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_NCURSES_HEADER version: 2 updated: 2008/03/23 14:48:54
 dnl -----------------
 dnl Find a "curses" header file, e.g,. "curses.h", or one of the more common
 dnl variations of ncurses' installs.
@@ -1273,7 +1789,7 @@
 		CPPFLAGS="$cf_save2_CPPFLAGS"
 		test "$cf_cv_ncurses_h2" != no && break
 	done
-	test "$cf_cv_ncurses_h2" = no && AC_ERROR(not found)
+	test "$cf_cv_ncurses_h2" = no && AC_MSG_ERROR(not found)
 	])
 
 	CF_DIRNAME(cf_1st_incdir,$cf_cv_ncurses_h2)
@@ -1304,7 +1820,7 @@
 
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_NCURSES_LIBS version: 13 updated: 2007/07/29 10:29:20
+dnl CF_NCURSES_LIBS version: 16 updated: 2010/11/20 17:02:38
 dnl ---------------
 dnl Look for the ncurses library.  This is a little complicated on Linux,
 dnl because it may be linked with the gpm (general purpose mouse) library.
@@ -1340,15 +1856,14 @@
 	;;
 esac
 
-LIBS="$cf_ncurses_LIBS $LIBS"
+CF_ADD_LIBS($cf_ncurses_LIBS)
 
 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
 then
-	CF_ADD_LIBDIR($cf_cv_curses_dir/lib)
-	LIBS="-l$cf_nculib_root $LIBS"
+	CF_ADD_LIBS(-l$cf_nculib_root)
 else
 	CF_FIND_LIBRARY($cf_nculib_root,$cf_nculib_root,
-		[#include <${cf_cv_ncurses_header-curses.h}>],
+		[#include <${cf_cv_ncurses_header:-curses.h}>],
 		[initscr()],
 		initscr)
 fi
@@ -1362,7 +1877,7 @@
 			LIBS="$q"
 		fi
 	done
-	AC_TRY_LINK([#include <${cf_cv_ncurses_header-curses.h}>],
+	AC_TRY_LINK([#include <${cf_cv_ncurses_header:-curses.h}>],
 		[initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);],
 		[AC_MSG_RESULT(yes)],
 		[AC_MSG_RESULT(no)
@@ -1373,7 +1888,7 @@
 AC_DEFINE_UNQUOTED($cf_nculib_ROOT)
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_NCURSES_VERSION version: 12 updated: 2007/04/28 09:15:55
+dnl CF_NCURSES_VERSION version: 13 updated: 2010/10/23 15:54:49
 dnl ------------------
 dnl Check for the version of ncurses, to aid in reporting bugs, etc.
 dnl Call CF_CURSES_CPPFLAGS first, or CF_NCURSES_CPPFLAGS.  We don't use
@@ -1386,7 +1901,7 @@
 	cf_tempfile=out$$
 	rm -f $cf_tempfile
 	AC_TRY_RUN([
-#include <${cf_cv_ncurses_header-curses.h}>
+#include <${cf_cv_ncurses_header:-curses.h}>
 #include <stdio.h>
 int main()
 {
@@ -1404,14 +1919,14 @@
 	make an error
 # endif
 #endif
-	${cf_cv_main_return-return}(0);
+	${cf_cv_main_return:-return}(0);
 }],[
 	cf_cv_ncurses_version=`cat $cf_tempfile`],,[
 
 	# This will not work if the preprocessor splits the line after the
 	# Autoconf token.  The 'unproto' program does that.
 	cat > conftest.$ac_ext <<EOF
-#include <${cf_cv_ncurses_header-curses.h}>
+#include <${cf_cv_ncurses_header:-curses.h}>
 #undef Autoconf
 #ifdef NCURSES_VERSION
 Autoconf NCURSES_VERSION
@@ -1435,7 +1950,52 @@
 test "$cf_cv_ncurses_version" = no || AC_DEFINE(NCURSES)
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_PATH_SYNTAX version: 11 updated: 2006/09/02 08:55:46
+dnl CF_NCURSES_WRAP_PREFIX version: 1 updated: 2009/03/28 16:08:10
+dnl ----------------------
+dnl Check for ncurses "wrap-prefix" used for public variables which have been
+dnl wrapped with a function to help with concurrency control.
+AC_DEFUN([CF_NCURSES_WRAP_PREFIX],
+[
+AC_MSG_CHECKING(for ncurses wrap-prefix)
+AC_ARG_WITH(ncurses-wrap-prefix,
+	[  --with-ncurses-wrap-prefix naming-prefix for ncurses wrapped-variables],
+	[NCURSES_WRAP_PREFIX=$withval],
+	[NCURSES_WRAP_PREFIX=_nc_])
+AC_MSG_RESULT($NCURSES_WRAP_PREFIX)
+
+AC_SUBST(NCURSES_WRAP_PREFIX)
+])
+dnl ---------------------------------------------------------------------------
+dnl CF_NO_LEAKS_OPTION version: 4 updated: 2006/12/16 14:24:05
+dnl ------------------
+dnl see CF_WITH_NO_LEAKS
+AC_DEFUN([CF_NO_LEAKS_OPTION],[
+AC_MSG_CHECKING(if you want to use $1 for testing)
+AC_ARG_WITH($1,
+	[$2],
+	[AC_DEFINE($3)ifelse([$4],,[
+	 $4
+])
+	: ${with_cflags:=-g}
+	: ${with_no_leaks:=yes}
+	 with_$1=yes],
+	[with_$1=])
+AC_MSG_RESULT(${with_$1:-no})
+
+case .$with_cflags in #(vi
+.*-g*)
+	case .$CFLAGS in #(vi
+	.*-g*) #(vi
+		;;
+	*)
+		CF_ADD_CFLAGS([-g])
+		;;
+	esac
+	;;
+esac
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_PATH_SYNTAX version: 13 updated: 2010/05/26 05:38:42
 dnl --------------
 dnl Check the argument to see that it looks like a pathname.  Rewrite it if it
 dnl begins with one of the prefix/exec_prefix variables, and then again if the
@@ -1467,12 +2027,12 @@
   $1=`echo [$]$1 | sed -e s%NONE%$cf_path_syntax%`
   ;;
 *)
-  ifelse($2,,[AC_ERROR([expected a pathname, not \"[$]$1\"])],$2)
+  ifelse([$2],,[AC_MSG_ERROR([expected a pathname, not \"[$]$1\"])],$2)
   ;;
 esac
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_PDCURSES_X11 version: 7 updated: 2006/11/12 17:31:59
+dnl CF_PDCURSES_X11 version: 10 updated: 2010/06/20 09:24:28
 dnl ---------------
 dnl Configure for PDCurses' X11 library
 AC_DEFUN([CF_PDCURSES_X11],[
@@ -1482,8 +2042,8 @@
 
 if test "$XCURSES_CONFIG" != none ; then
 
-CPPFLAGS="`$XCURSES_CONFIG --cflags` $CPPFLAGS"
-LIBS="`$XCURSES_CONFIG --libs` $LIBS"
+CPPFLAGS="$CPPFLAGS `$XCURSES_CONFIG --cflags`"
+CF_ADD_LIBS(`$XCURSES_CONFIG --libs`)
 
 cf_cv_lib_XCurses=yes
 
@@ -1492,10 +2052,10 @@
 LDFLAGS="$LDFLAGS $X_LIBS"
 CF_CHECK_CFLAGS($X_CFLAGS)
 AC_CHECK_LIB(X11,XOpenDisplay,
-	[LIBS="-lX11 $LIBS"],,
+	[CF_ADD_LIBS(-lX11)],,
 	[$X_PRE_LIBS $LIBS $X_EXTRA_LIBS])
 AC_CACHE_CHECK(for XCurses library,cf_cv_lib_XCurses,[
-LIBS="-lXCurses $LIBS"
+CF_ADD_LIBS(-lXCurses)
 AC_TRY_LINK([
 #include <xcurses.h>
 char *XCursesProgramName = "test";
@@ -1511,11 +2071,43 @@
 	AC_DEFINE(XCURSES)
 	AC_DEFINE(HAVE_XCURSES)
 else
-	AC_ERROR(Cannot link with XCurses)
+	AC_MSG_ERROR(Cannot link with XCurses)
 fi
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_POSIX_C_SOURCE version: 6 updated: 2005/07/14 20:25:10
+dnl CF_PKG_CONFIG version: 3 updated: 2009/01/25 10:55:09
+dnl -------------
+dnl Check for the package-config program, unless disabled by command-line.
+AC_DEFUN([CF_PKG_CONFIG],
+[
+AC_MSG_CHECKING(if you want to use pkg-config)
+AC_ARG_WITH(pkg-config,
+	[  --with-pkg-config{=path} enable/disable use of pkg-config],
+	[cf_pkg_config=$withval],
+	[cf_pkg_config=yes])
+AC_MSG_RESULT($cf_pkg_config)
+
+case $cf_pkg_config in #(vi
+no) #(vi
+	PKG_CONFIG=none
+	;;
+yes) #(vi
+	AC_PATH_PROG(PKG_CONFIG, pkg-config, none)
+	;;
+*)
+	PKG_CONFIG=$withval
+	;;
+esac
+
+test -z "$PKG_CONFIG" && PKG_CONFIG=none
+if test "$PKG_CONFIG" != none ; then
+	CF_PATH_SYNTAX(PKG_CONFIG)
+fi
+
+AC_SUBST(PKG_CONFIG)
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_POSIX_C_SOURCE version: 8 updated: 2010/05/26 05:38:42
 dnl -----------------
 dnl Define _POSIX_C_SOURCE to the given level, and _POSIX_SOURCE if needed.
 dnl
@@ -1531,7 +2123,7 @@
 dnl	$1 is the nominal value for _POSIX_C_SOURCE
 AC_DEFUN([CF_POSIX_C_SOURCE],
 [
-cf_POSIX_C_SOURCE=ifelse($1,,199506L,$1)
+cf_POSIX_C_SOURCE=ifelse([$1],,199506L,[$1])
 
 cf_save_CFLAGS="$CFLAGS"
 cf_save_CPPFLAGS="$CPPFLAGS"
@@ -1583,12 +2175,7 @@
 if test "$cf_cv_posix_c_source" != no ; then
 	CFLAGS="$cf_trim_CFLAGS"
 	CPPFLAGS="$cf_trim_CPPFLAGS"
-	if test "$cf_cv_cc_u_d_options" = yes ; then
-		cf_temp_posix_c_source=`echo "$cf_cv_posix_c_source" | \
-				sed -e 's/-D/-U/g' -e 's/=[[^ 	]]*//g'`
-		CPPFLAGS="$CPPFLAGS $cf_temp_posix_c_source"
-	fi
-	CPPFLAGS="$CPPFLAGS $cf_cv_posix_c_source"
+	CF_ADD_CFLAGS($cf_cv_posix_c_source)
 fi
 
 ])dnl
@@ -1642,7 +2229,33 @@
 ])
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_REMOVE_DEFINE version: 2 updated: 2005/07/09 16:12:18
+dnl CF_PROG_INSTALL version: 5 updated: 2002/12/21 22:46:07
+dnl ---------------
+dnl Force $INSTALL to be an absolute-path.  Otherwise, edit_man.sh and the
+dnl misc/tabset install won't work properly.  Usually this happens only when
+dnl using the fallback mkinstalldirs script
+AC_DEFUN([CF_PROG_INSTALL],
+[AC_PROG_INSTALL
+case $INSTALL in
+/*)
+  ;;
+*)
+  CF_DIRNAME(cf_dir,$INSTALL)
+  test -z "$cf_dir" && cf_dir=.
+  INSTALL=`cd $cf_dir && pwd`/`echo $INSTALL | sed -e 's%^.*/%%'`
+  ;;
+esac
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_PROG_LINT version: 2 updated: 2009/08/12 04:43:14
+dnl ------------
+AC_DEFUN([CF_PROG_LINT],
+[
+AC_CHECK_PROGS(LINT, tdlint lint alint splint lclint)
+AC_SUBST(LINT_OPTS)
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_REMOVE_DEFINE version: 3 updated: 2010/01/09 11:05:50
 dnl ----------------
 dnl Remove all -U and -D options that refer to the given symbol from a list
 dnl of C compiler options.  This works around the problem that not all
@@ -1654,10 +2267,9 @@
 dnl $3 = symbol to remove
 define([CF_REMOVE_DEFINE],
 [
-# remove $3 symbol from $2
 $1=`echo "$2" | \
-	sed	-e 's/-[[UD]]$3\(=[[^ 	]]*\)\?[[ 	]]/ /g' \
-		-e 's/-[[UD]]$3\(=[[^ 	]]*\)\?[$]//g'`
+	sed	-e 's/-[[UD]]'"$3"'\(=[[^ 	]]*\)\?[[ 	]]/ /g' \
+		-e 's/-[[UD]]'"$3"'\(=[[^ 	]]*\)\?[$]//g'`
 ])dnl
 dnl ---------------------------------------------------------------------------
 dnl CF_SIG_ATOMIC_T version: 2 updated: 2005/09/18 17:27:12
@@ -1695,14 +2307,15 @@
 test "$cf_cv_sig_atomic_t" != no && AC_DEFINE_UNQUOTED(SIG_ATOMIC_T, $cf_cv_sig_atomic_t)
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_SUBDIR_PATH version: 5 updated: 2007/07/29 09:55:12
+dnl CF_SUBDIR_PATH version: 6 updated: 2010/04/21 06:20:50
 dnl --------------
 dnl Construct a search-list for a nonstandard header/lib-file
 dnl	$1 = the variable to return as result
 dnl	$2 = the package name
 dnl	$3 = the subdirectory, e.g., bin, include or lib
 AC_DEFUN([CF_SUBDIR_PATH],
-[$1=""
+[
+$1=
 
 CF_ADD_SUBDIR_PATH($1,$2,$3,/usr,$prefix)
 CF_ADD_SUBDIR_PATH($1,$2,$3,$prefix,NONE)
@@ -1734,7 +2347,7 @@
 test "$cf_cv_sys_time_select" = yes && AC_DEFINE(HAVE_SYS_TIME_SELECT)
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_TERM_HEADER version: 1 updated: 2005/12/31 13:26:39
+dnl CF_TERM_HEADER version: 2 updated: 2010/10/23 15:54:49
 dnl --------------
 dnl Look for term.h, which is part of X/Open curses.  It defines the interface
 dnl to terminfo database.  Usually it is in the same include-path as curses.h,
@@ -1753,7 +2366,7 @@
 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
 do
 AC_TRY_COMPILE([#include <stdio.h>
-#include <${cf_cv_ncurses_header-curses.h}>
+#include <${cf_cv_ncurses_header:-curses.h}>
 #include <$cf_test>
 ],[int x = auto_left_margin],[
 	cf_cv_term_header="$cf_test"],[
@@ -1781,6 +2394,31 @@
 esac
 ])dnl
 dnl ---------------------------------------------------------------------------
+dnl CF_TRY_PKG_CONFIG version: 4 updated: 2010/06/14 17:42:30
+dnl -----------------
+dnl This is a simple wrapper to use for pkg-config, for libraries which may be
+dnl available in that form.
+dnl
+dnl $1 = package name
+dnl $2 = extra logic to use, if any, after updating CFLAGS and LIBS
+dnl $3 = logic to use if pkg-config does not have the package
+AC_DEFUN([CF_TRY_PKG_CONFIG],[
+AC_REQUIRE([CF_PKG_CONFIG])
+
+if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists $1; then
+	CF_VERBOSE(found package $1)
+	cf_pkgconfig_incs="`$PKG_CONFIG --cflags $1 2>/dev/null`"
+	cf_pkgconfig_libs="`$PKG_CONFIG --libs   $1 2>/dev/null`"
+	CF_VERBOSE(package $1 CFLAGS: $cf_pkgconfig_incs)
+	CF_VERBOSE(package $1 LIBS: $cf_pkgconfig_libs)
+	CF_ADD_CFLAGS($cf_pkgconfig_incs)
+	CF_ADD_LIBS($cf_pkgconfig_libs)
+	ifelse([$2],,:,[$2])
+else
+	ifelse([$3],,:,[$3])
+fi
+])
+dnl ---------------------------------------------------------------------------
 dnl CF_UPPER version: 5 updated: 2001/01/29 23:40:59
 dnl --------
 dnl Make an uppercase version of a variable
@@ -1790,7 +2428,7 @@
 $1=`echo "$2" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_UTF8_LIB version: 4 updated: 2003/03/01 18:36:42
+dnl CF_UTF8_LIB version: 7 updated: 2010/06/20 09:24:28
 dnl -----------
 dnl Check for multibyte support, and if not found, utf8 compatibility library
 AC_DEFUN([CF_UTF8_LIB],
@@ -1800,19 +2438,19 @@
 	AC_TRY_LINK([
 #include <stdlib.h>],[putwc(0,0);],
 	[cf_cv_utf8_lib=yes],
-	[LIBS="-lutf8 $LIBS"
-	 AC_TRY_LINK([
-#include <libutf8.h>],[putwc(0,0);],
+	[CF_FIND_LINKAGE([
+#include <libutf8.h>],[putwc(0,0);],utf8,
 		[cf_cv_utf8_lib=add-on],
 		[cf_cv_utf8_lib=no])
-	LIBS="$cf_save_LIBS"
 ])])
 
 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
 # ncurses/ncursesw:
 if test "$cf_cv_utf8_lib" = "add-on" ; then
 	AC_DEFINE(HAVE_LIBUTF8_H)
-	LIBS="-lutf8 $LIBS"
+	CF_ADD_INCDIR($cf_cv_header_path_utf8)
+	CF_ADD_LIBDIR($cf_cv_library_path_utf8)
+	CF_ADD_LIBS($cf_cv_library_file_utf8)
 fi
 ])dnl
 dnl ---------------------------------------------------------------------------
@@ -1824,19 +2462,119 @@
 CF_MSG_LOG([$1])
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_WITH_CURSES_DIR version: 2 updated: 2002/11/10 14:46:59
+dnl CF_WCHAR_TYPE version: 3 updated: 2010/05/26 16:44:57
+dnl -------------
+dnl Check if type wide-character type $1 is declared, and if so, which header
+dnl file is needed.  The second parameter is used to set a shell variable when
+dnl the type is not found.  The first parameter sets a shell variable for the
+dnl opposite sense.
+AC_DEFUN([CF_WCHAR_TYPE],
+[
+# This is needed on Tru64 5.0 to declare $1
+AC_CACHE_CHECK(if we must include wchar.h to declare $1,cf_cv_$1,[
+AC_TRY_COMPILE([
+#include <stdlib.h>
+#include <stdarg.h>
+#include <stdio.h>
+#ifdef HAVE_LIBUTF8_H
+#include <libutf8.h>
+#endif],
+	[$1 state],
+	[cf_cv_$1=no],
+	[AC_TRY_COMPILE([
+#include <stdlib.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <wchar.h>
+#ifdef HAVE_LIBUTF8_H
+#include <libutf8.h>
+#endif],
+	[$1 value],
+	[cf_cv_$1=yes],
+	[cf_cv_$1=unknown])])])
+
+if test "$cf_cv_$1" = yes ; then
+	AC_DEFINE(NEED_WCHAR_H)
+	NEED_WCHAR_H=1
+fi
+
+ifelse([$2],,,[
+# if we do not find $1 in either place, use substitution to provide a fallback.
+if test "$cf_cv_$1" = unknown ; then
+	$2=1
+fi
+])
+ifelse($3,,,[
+# if we find $1 in either place, use substitution to provide a fallback.
+if test "$cf_cv_$1" != unknown ; then
+	$3=1
+fi
+])
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_WITH_CURSES_DIR version: 3 updated: 2010/11/20 17:02:38
 dnl ------------------
 dnl Wrapper for AC_ARG_WITH to specify directory under which to look for curses
 dnl libraries.
 AC_DEFUN([CF_WITH_CURSES_DIR],[
+
+AC_MSG_CHECKING(for specific curses-directory)
 AC_ARG_WITH(curses-dir,
 	[  --with-curses-dir=DIR   directory in which (n)curses is installed],
-	[CF_PATH_SYNTAX(withval)
-	 cf_cv_curses_dir=$withval],
+	[cf_cv_curses_dir=$withval],
 	[cf_cv_curses_dir=no])
+AC_MSG_RESULT($cf_cv_curses_dir)
+
+if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
+then
+	CF_PATH_SYNTAX(withval)
+	if test -d "$cf_cv_curses_dir"
+	then
+		CF_ADD_INCDIR($cf_cv_curses_dir/include)
+		CF_ADD_LIBDIR($cf_cv_curses_dir/lib)
+	fi
+fi
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_WITH_DBMALLOC version: 7 updated: 2010/06/21 17:26:47
+dnl ----------------
+dnl Configure-option for dbmalloc.  The optional parameter is used to override
+dnl the updating of $LIBS, e.g., to avoid conflict with subsequent tests.
+AC_DEFUN([CF_WITH_DBMALLOC],[
+CF_NO_LEAKS_OPTION(dbmalloc,
+	[  --with-dbmalloc         test: use Conor Cahill's dbmalloc library],
+	[USE_DBMALLOC])
+
+if test "$with_dbmalloc" = yes ; then
+	AC_CHECK_HEADER(dbmalloc.h,
+		[AC_CHECK_LIB(dbmalloc,[debug_malloc]ifelse([$1],,[],[,$1]))])
+fi
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_WITH_DMALLOC version: 7 updated: 2010/06/21 17:26:47
+dnl ---------------
+dnl Configure-option for dmalloc.  The optional parameter is used to override
+dnl the updating of $LIBS, e.g., to avoid conflict with subsequent tests.
+AC_DEFUN([CF_WITH_DMALLOC],[
+CF_NO_LEAKS_OPTION(dmalloc,
+	[  --with-dmalloc          test: use Gray Watson's dmalloc library],
+	[USE_DMALLOC])
+
+if test "$with_dmalloc" = yes ; then
+	AC_CHECK_HEADER(dmalloc.h,
+		[AC_CHECK_LIB(dmalloc,[dmalloc_debug]ifelse([$1],,[],[,$1]))])
+fi
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_WITH_VALGRIND version: 1 updated: 2006/12/14 18:00:21
+dnl ----------------
+AC_DEFUN([CF_WITH_VALGRIND],[
+CF_NO_LEAKS_OPTION(valgrind,
+	[  --with-valgrind         test: use valgrind],
+	[USE_VALGRIND])
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_XOPEN_CURSES version: 8 updated: 2003/11/07 19:47:46
+dnl CF_XOPEN_CURSES version: 10 updated: 2010/10/23 15:54:49
 dnl ---------------
 dnl Test if we should define X/Open source for curses, needed on Digital Unix
 dnl 4.x, to see the extended functions, but breaks on IRIX 6.x.
@@ -1849,7 +2587,12 @@
 AC_CACHE_CHECK(if we must define _XOPEN_SOURCE_EXTENDED,cf_cv_need_xopen_extension,[
 AC_TRY_LINK([
 #include <stdlib.h>
-#include <${cf_cv_ncurses_header-curses.h}>],[
+#include <${cf_cv_ncurses_header:-curses.h}>],[
+#if defined(NCURSES_VERSION_PATCH)
+if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
+	make an error
+#endif
+#endif
 	long x = winnstr(stdscr, "", 0);
 	int x1, y1;
 	getbegyx(stdscr, y1, x1)],
@@ -1857,7 +2600,11 @@
 	[AC_TRY_LINK([
 #define _XOPEN_SOURCE_EXTENDED
 #include <stdlib.h>
-#include <${cf_cv_ncurses_header-curses.h}>],[
+#include <${cf_cv_ncurses_header:-curses.h}>],[
+#ifdef NCURSES_VERSION
+	cchar_t check;
+	int check2 = curs_set((int)sizeof(check));
+#endif
 	long x = winnstr(stdscr, "", 0);
 	int x1, y1;
 	getbegyx(stdscr, y1, x1)],
@@ -1866,7 +2613,7 @@
 test $cf_cv_need_xopen_extension = yes && CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_XOPEN_SOURCE version: 25 updated: 2007/01/29 18:36:38
+dnl CF_XOPEN_SOURCE version: 34 updated: 2010/05/26 05:38:42
 dnl ---------------
 dnl Try to get _XOPEN_SOURCE defined properly that we can use POSIX functions,
 dnl or adapt to the vendor's definitions to get equivalent functionality,
@@ -1877,30 +2624,38 @@
 dnl	$2 is the nominal value for _POSIX_C_SOURCE
 AC_DEFUN([CF_XOPEN_SOURCE],[
 
-AC_REQUIRE([CF_PROG_CC_U_D])
-
-cf_XOPEN_SOURCE=ifelse($1,,500,$1)
-cf_POSIX_C_SOURCE=ifelse($2,,199506L,$2)
+cf_XOPEN_SOURCE=ifelse([$1],,500,[$1])
+cf_POSIX_C_SOURCE=ifelse([$2],,199506L,[$2])
+cf_xopen_source=
 
 case $host_os in #(vi
-aix[[45]]*) #(vi
-	CPPFLAGS="$CPPFLAGS -D_ALL_SOURCE"
+aix[[456]]*) #(vi
+	cf_xopen_source="-D_ALL_SOURCE"
 	;;
-freebsd*) #(vi
+darwin[[0-8]].*) #(vi
+	cf_xopen_source="-D_APPLE_C_SOURCE"
+	;;
+darwin*) #(vi
+	cf_xopen_source="-D_DARWIN_C_SOURCE"
+	;;
+freebsd*|dragonfly*) #(vi
 	# 5.x headers associate
 	#	_XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
 	#	_XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
 	cf_POSIX_C_SOURCE=200112L
 	cf_XOPEN_SOURCE=600
-	CPPFLAGS="$CPPFLAGS -D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
+	cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
+	;;
+hpux11*) #(vi
+	cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
 	;;
 hpux*) #(vi
-	CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE"
+	cf_xopen_source="-D_HPUX_SOURCE"
 	;;
 irix[[56]].*) #(vi
-	CPPFLAGS="$CPPFLAGS -D_SGI_SOURCE"
+	cf_xopen_source="-D_SGI_SOURCE"
 	;;
-linux*|gnu*|k*bsd*-gnu) #(vi
+linux*|gnu*|mint*|k*bsd*-gnu) #(vi
 	CF_GNU_SOURCE
 	;;
 mirbsd*) #(vi
@@ -1913,16 +2668,19 @@
 	# setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
 	;;
 osf[[45]]*) #(vi
-	CPPFLAGS="$CPPFLAGS -D_OSF_SOURCE"
+	cf_xopen_source="-D_OSF_SOURCE"
 	;;
 nto-qnx*) #(vi
-	CPPFLAGS="$CPPFLAGS -D_QNX_SOURCE"
+	cf_xopen_source="-D_QNX_SOURCE"
 	;;
 sco*) #(vi
 	# setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
 	;;
-solaris*) #(vi
-	CPPFLAGS="$CPPFLAGS -D__EXTENSIONS__"
+solaris2.1[[0-9]]) #(vi
+	cf_xopen_source="-D__EXTENSIONS__ -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
+	;;
+solaris2.[[1-9]]) #(vi
+	cf_xopen_source="-D__EXTENSIONS__"
 	;;
 *)
 	AC_CACHE_CHECK(if we should define _XOPEN_SOURCE,cf_cv_xopen_source,[
@@ -1945,23 +2703,26 @@
 	if test "$cf_cv_xopen_source" != no ; then
 		CF_REMOVE_DEFINE(CFLAGS,$CFLAGS,_XOPEN_SOURCE)
 		CF_REMOVE_DEFINE(CPPFLAGS,$CPPFLAGS,_XOPEN_SOURCE)
-		test "$cf_cv_cc_u_d_options" = yes && \
-			CPPFLAGS="$CPPFLAGS -U_XOPEN_SOURCE"
-		CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_cv_xopen_source"
+		cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
+		CF_ADD_CFLAGS($cf_temp_xopen_source)
 	fi
 	CF_POSIX_C_SOURCE($cf_POSIX_C_SOURCE)
 	;;
 esac
+
+if test -n "$cf_xopen_source" ; then
+	CF_ADD_CFLAGS($cf_xopen_source)
+fi
 ])
 dnl ---------------------------------------------------------------------------
-dnl CF_X_ATHENA version: 12 updated: 2004/06/15 21:14:41
+dnl CF_X_ATHENA version: 20 updated: 2010/11/09 05:18:02
 dnl -----------
 dnl Check for Xaw (Athena) libraries
 dnl
 dnl Sets $cf_x_athena according to the flavor of Xaw which is used.
 AC_DEFUN([CF_X_ATHENA],
-[AC_REQUIRE([CF_X_TOOLKIT])
-cf_x_athena=${cf_x_athena-Xaw}
+[
+cf_x_athena=${cf_x_athena:-Xaw}
 
 AC_MSG_CHECKING(if you want to link with Xaw 3d library)
 withval=
@@ -1996,23 +2757,63 @@
 	AC_MSG_RESULT(no)
 fi
 
-AC_CHECK_LIB(Xext,XextCreateExtension,
-	[LIBS="-lXext $LIBS"])
-
 cf_x_athena_lib=""
 
-CF_X_ATHENA_CPPFLAGS($cf_x_athena)
-CF_X_ATHENA_LIBS($cf_x_athena)
+if test "$PKG_CONFIG" != none ; then
+	cf_athena_list=
+	test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
+	for cf_athena_pkg in \
+		$cf_athena_list \
+		${cf_x_athena} \
+		${cf_x_athena}-devel \
+		lib${cf_x_athena} \
+		lib${cf_x_athena}-devel
+	do
+		CF_TRY_PKG_CONFIG($cf_athena_pkg,[
+			cf_x_athena_lib="$cf_pkgconfig_libs"
+			CF_UPPER(cf_x_athena_LIBS,HAVE_LIB_$cf_x_athena)
+			AC_DEFINE_UNQUOTED($cf_x_athena_LIBS)
+
+AC_CACHE_CHECK(for usable $cf_x_athena/Xmu package,cf_cv_xaw_compat,[
+AC_TRY_LINK([
+#include <X11/Xmu/CharSet.h>
+],[
+int check = XmuCompareISOLatin1("big", "small")
+],[cf_cv_xaw_compat=yes],[cf_cv_xaw_compat=no])])
+
+			if test "$cf_cv_xaw_compat" = no
+			then
+				# workaround for broken ".pc" files...
+				case "$cf_x_athena_lib" in #(vi
+				*-lXmu*) #(vi
+					;;
+				*)
+					CF_VERBOSE(work around broken package)
+					CF_TRY_PKG_CONFIG(xmu,,[CF_ADD_LIB_AFTER(-lXt,-lXmu)])
+					;;
+				esac
+			fi
+
+			break])
+	done
+fi
+
+if test -z "$cf_x_athena_lib" ; then
+	CF_X_EXT
+	CF_X_TOOLKIT
+	CF_X_ATHENA_CPPFLAGS($cf_x_athena)
+	CF_X_ATHENA_LIBS($cf_x_athena)
+fi
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_X_ATHENA_CPPFLAGS version: 2 updated: 2002/10/09 20:00:37
+dnl CF_X_ATHENA_CPPFLAGS version: 5 updated: 2010/05/26 17:35:30
 dnl --------------------
 dnl Normally invoked by CF_X_ATHENA, with $1 set to the appropriate flavor of
 dnl the Athena widgets, e.g., Xaw, Xaw3d, neXtaw.
 AC_DEFUN([CF_X_ATHENA_CPPFLAGS],
 [
-cf_x_athena_root=ifelse($1,,Xaw,$1)
-cf_x_athena_include=""
+cf_x_athena_root=ifelse([$1],,Xaw,[$1])
+cf_x_athena_inc=""
 
 for cf_path in default \
 	/usr/contrib/X11R6 \
@@ -2020,11 +2821,11 @@
 	/usr/lib/X11R5 \
 	/usr/local
 do
-	if test -z "$cf_x_athena_include" ; then
+	if test -z "$cf_x_athena_inc" ; then
 		cf_save="$CPPFLAGS"
 		cf_test=X11/$cf_x_athena_root/SimpleMenu.h
 		if test $cf_path != default ; then
-			CPPFLAGS="-I$cf_path/include $cf_save"
+			CPPFLAGS="$cf_save -I$cf_path/include"
 			AC_MSG_CHECKING(for $cf_test in $cf_path)
 		else
 			AC_MSG_CHECKING(for $cf_test)
@@ -2036,7 +2837,7 @@
 			[cf_result=no])
 		AC_MSG_RESULT($cf_result)
 		if test "$cf_result" = yes ; then
-			cf_x_athena_include=$cf_path
+			cf_x_athena_inc=$cf_path
 			break
 		else
 			CPPFLAGS="$cf_save"
@@ -2044,21 +2845,21 @@
 	fi
 done
 
-if test -z "$cf_x_athena_include" ; then
+if test -z "$cf_x_athena_inc" ; then
 	AC_MSG_WARN(
 [Unable to successfully find Athena header files with test program])
-elif test "$cf_x_athena_include" != default ; then
-	CPPFLAGS="$CPPFLAGS -I$cf_x_athena_include"
+elif test "$cf_x_athena_inc" != default ; then
+	CPPFLAGS="$CPPFLAGS -I$cf_x_athena_inc"
 fi
 ])
 dnl ---------------------------------------------------------------------------
-dnl CF_X_ATHENA_LIBS version: 6 updated: 2006/11/30 17:57:11
+dnl CF_X_ATHENA_LIBS version: 9 updated: 2010/06/02 05:03:05
 dnl ----------------
 dnl Normally invoked by CF_X_ATHENA, with $1 set to the appropriate flavor of
 dnl the Athena widgets, e.g., Xaw, Xaw3d, neXtaw.
 AC_DEFUN([CF_X_ATHENA_LIBS],
 [AC_REQUIRE([CF_X_TOOLKIT])
-cf_x_athena_root=ifelse($1,,Xaw,$1)
+cf_x_athena_root=ifelse([$1],,Xaw,[$1])
 cf_x_athena_lib=""
 
 for cf_path in default \
@@ -2076,10 +2877,10 @@
 			cf_save="$LIBS"
 			cf_test=XawSimpleMenuAddGlobalActions
 			if test $cf_path != default ; then
-				LIBS="-L$cf_path/lib $cf_lib $LIBS"
+				CF_ADD_LIBS(-L$cf_path/lib $cf_lib)
 				AC_MSG_CHECKING(for $cf_lib in $cf_path)
 			else
-				LIBS="$cf_lib $LIBS"
+				CF_ADD_LIBS($cf_lib)
 				AC_MSG_CHECKING(for $cf_test in $cf_lib)
 			fi
 			AC_TRY_LINK([],[$cf_test()],
@@ -2096,7 +2897,7 @@
 done
 
 if test -z "$cf_x_athena_lib" ; then
-	AC_ERROR(
+	AC_MSG_ERROR(
 [Unable to successfully link Athena library (-l$cf_x_athena_root) with test program])
 fi
 
@@ -2104,7 +2905,15 @@
 AC_DEFINE_UNQUOTED($cf_x_athena_LIBS)
 ])
 dnl ---------------------------------------------------------------------------
-dnl CF_X_TOOLKIT version: 11 updated: 2006/11/29 19:05:14
+dnl CF_X_EXT version: 3 updated: 2010/06/02 05:03:05
+dnl --------
+AC_DEFUN([CF_X_EXT],[
+CF_TRY_PKG_CONFIG(Xext,,[
+	AC_CHECK_LIB(Xext,XextCreateExtension,
+		[CF_ADD_LIB(Xext)])])
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_X_TOOLKIT version: 20 updated: 2010/11/19 05:43:04
 dnl ------------
 dnl Check for X Toolkit libraries
 dnl
@@ -2113,29 +2922,101 @@
 AC_REQUIRE([AC_PATH_XTRA])
 AC_REQUIRE([CF_CHECK_CACHE])
 
-# SYSTEM_NAME=`echo "$cf_cv_system_name"|tr ' ' -`
-
 cf_have_X_LIBS=no
 
-LDFLAGS="$X_LIBS $LDFLAGS"
-CF_CHECK_CFLAGS($X_CFLAGS)
+CF_TRY_PKG_CONFIG(xt,[
 
-AC_CHECK_FUNC(XOpenDisplay,,[
-AC_CHECK_LIB(X11,XOpenDisplay,
-	[LIBS="-lX11 $LIBS"],,
-	[$X_PRE_LIBS $LIBS $X_EXTRA_LIBS])])
+	case "x$LIBS" in #(vi
+	*-lX11*) #(vi
+		;;
+	*)
+# we have an "xt" package, but it may omit Xt's dependency on X11
+AC_CACHE_CHECK(for usable X dependency,cf_cv_xt_x11_compat,[
+AC_TRY_LINK([
+#include <X11/Xlib.h>
+],[
+	int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
+	int rc2 = XClearWindow((Display*) 0, (Window) 0);
+	int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0);
+	int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0);
+],[cf_cv_xt_x11_compat=yes],[cf_cv_xt_x11_compat=no])])
+		if test "$cf_cv_xt_x11_compat" = no
+		then
+			CF_VERBOSE(work around broken X11 dependency)
+			# 2010/11/19 - good enough until a working Xt on Xcb is delivered.
+			CF_TRY_PKG_CONFIG(x11,,[CF_ADD_LIB_AFTER(-lXt,-lX11)])
+		fi
+		;;
+	esac
+
+AC_CACHE_CHECK(for usable X Toolkit package,cf_cv_xt_ice_compat,[
+AC_TRY_LINK([
+#include <X11/Shell.h>
+],[int num = IceConnectionNumber(0)
+],[cf_cv_xt_ice_compat=yes],[cf_cv_xt_ice_compat=no])])
+
+	if test "$cf_cv_xt_ice_compat" = no
+	then
+		# workaround for broken ".pc" files used for X Toolkit.
+		case "x$X_PRE_LIBS" in #(vi
+		*-lICE*)
+			case "x$LIBS" in #(vi
+			*-lICE*) #(vi
+				;;
+			*)
+				CF_VERBOSE(work around broken ICE dependency)
+				CF_TRY_PKG_CONFIG(ice,
+					[CF_TRY_PKG_CONFIG(sm)],
+					[CF_ADD_LIB_AFTER(-lXt,$X_PRE_LIBS)])
+				;;
+			esac
+			;;
+		esac
+	fi
+
+	cf_have_X_LIBS=yes
+],[
+
+	LDFLAGS="$X_LIBS $LDFLAGS"
+	CF_CHECK_CFLAGS($X_CFLAGS)
 
-AC_CHECK_FUNC(XtAppInitialize,,[
-AC_CHECK_LIB(Xt, XtAppInitialize,
-	[AC_DEFINE(HAVE_LIBXT)
-	 cf_have_X_LIBS=Xt
-	 LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS"],,
-	[$X_PRE_LIBS $LIBS $X_EXTRA_LIBS])])
+	AC_CHECK_FUNC(XOpenDisplay,,[
+	AC_CHECK_LIB(X11,XOpenDisplay,
+		[CF_ADD_LIB(X11)],,
+		[$X_PRE_LIBS $LIBS $X_EXTRA_LIBS])])
+
+	AC_CHECK_FUNC(XtAppInitialize,,[
+	AC_CHECK_LIB(Xt, XtAppInitialize,
+		[AC_DEFINE(HAVE_LIBXT)
+		 cf_have_X_LIBS=Xt
+		 LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS"],,
+		[$X_PRE_LIBS $LIBS $X_EXTRA_LIBS])])
+])
 
 if test $cf_have_X_LIBS = no ; then
-	AC_WARN(
+	AC_MSG_WARN(
 [Unable to successfully link X Toolkit library (-lXt) with
 test program.  You will have to check and add the proper libraries by hand
 to makefile.])
 fi
 ])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF__CURSES_HEAD version: 2 updated: 2010/10/23 15:54:49
+dnl ---------------
+dnl Define a reusable chunk which includes <curses.h> and <term.h> when they
+dnl are both available.
+define([CF__CURSES_HEAD],[
+#ifdef HAVE_XCURSES
+#include <xcurses.h>
+char * XCursesProgramName = "test";
+#else
+#include <${cf_cv_ncurses_header:-curses.h}>
+#if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
+#include <ncursesw/term.h>
+#elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
+#include <ncurses/term.h>
+#elif defined(HAVE_TERM_H)
+#include <term.h>
+#endif
+#endif
+])
diff -Naur ncurses-5.7.orig/test/blue.c ncurses-5.7/test/blue.c
--- ncurses-5.7.orig/test/blue.c	2008-08-03 14:20:27.000000000 -0400
+++ ncurses-5.7/test/blue.c	2011-01-08 18:13:50.763157024 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2006,2008 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -40,7 +40,7 @@
  * results, use the ncurses(3) library.  On non-Intel machines, SVr4 curses is
  * just as good.
  *
- * $Id: blue.c,v 1.30 2008/08/03 18:20:27 tom Exp $
+ * $Id: blue.c,v 1.33 2009/10/24 21:03:35 tom Exp $
  */
 
 #include <test.priv.h>
@@ -300,7 +300,7 @@
 		if (selection[i] != NOCARD) {
 		    move(BASEROW + (selection[i] / GRID_WIDTH) * 2 + 3,
 			 (selection[i] % GRID_WIDTH) * 5);
-		    (void) printw("   %c ", *lp++ = 'a' + i);
+		    (void) printw("   %c ", (*lp++ = (char) ('a' + i)));
 		}
 	    };
 	    *lp = '\0';
@@ -326,7 +326,9 @@
 		    clrtoeol();
 		    (void) addch(' ');
 		} while
-		    (((c = getch()) < 'a' || c > 'd') && (c != 'r') && (c != 'q'));
+		    (((c = (char) getch()) < 'a' || c > 'd')
+		     && (c != 'r')
+		     && (c != 'q'));
 	    }
 
 	    for (j = 0; j < 4; j++)
@@ -353,9 +355,9 @@
     }
 
     move(PROMPTROW, 0);
-    standout();
+    (void) standout();
     (void) printw("Finished deal %d - type any character to continue...", deal_number);
-    standend();
+    (void) standend();
     (void) getch();
 }
 
@@ -386,7 +388,7 @@
 {
     clear();
     (void) printw("You finished the game in %d deals. This is ", deal);
-    standout();
+    (void) standout();
     if (deal < 2)
 	(void) addstr("excellent");
     else if (deal < 4)
@@ -395,7 +397,7 @@
 	(void) addstr("average");
     else
 	(void) addstr("poor");
-    standend();
+    (void) standend();
     (void) addstr(".         ");
     refresh();
 }
diff -Naur ncurses-5.7.orig/test/bs.c ncurses-5.7/test/bs.c
--- ncurses-5.7.orig/test/bs.c	2008-08-03 14:30:28.000000000 -0400
+++ ncurses-5.7/test/bs.c	2011-01-08 18:18:29.486655656 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2007,2008 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            *
@@ -34,7 +34,7 @@
  * v2.0 featuring strict ANSI/POSIX conformance, November 1993.
  * v2.1 with ncurses mouse support, September 1995
  *
- * $Id: bs.c,v 1.47 2008/08/03 18:30:28 tom Exp $
+ * $Id: bs.c,v 1.52 2010/11/13 20:07:52 tom Exp $
  */
 
 #include <test.priv.h>
@@ -222,7 +222,7 @@
 
     if ((tmpname = getlogin()) != 0) {
 	(void) strcpy(name, tmpname);
-	name[0] = toupper(UChar(name[0]));
+	name[0] = (char) toupper(UChar(name[0]));
     } else
 	(void) strcpy(name, dftname);
 
@@ -235,7 +235,7 @@
 
 #ifdef PENGUIN
     (void) clear();
-    (void) mvaddstr(4, 29, "Welcome to Battleship!");
+    MvAddStr(4, 29, "Welcome to Battleship!");
     (void) move(8, 0);
     PR("                                                  \\\n");
     PR("                           \\                     \\ \\\n");
@@ -248,7 +248,7 @@
     PR("            \\                                                     /\n");
     PR("             \\___________________________________________________/\n");
 
-    (void) mvaddstr(22, 27, "Hit any key to continue...");
+    MvAddStr(22, 27, "Hit any key to continue...");
     (void) refresh();
     (void) getch();
 #endif /* PENGUIN */
@@ -337,7 +337,7 @@
     ship_t *ss;
 
     (void) clear();
-    (void) mvaddstr(0, 35, "BATTLESHIPS");
+    MvAddStr(0, 35, "BATTLESHIPS");
     (void) move(PROMPTLINE + 2, 0);
     announceopts();
 
@@ -362,10 +362,10 @@
     }
 
     /* draw empty boards */
-    (void) mvaddstr(PYBASE - 2, PXBASE + 5, "Main Board");
-    (void) mvaddstr(PYBASE - 1, PXBASE - 3, numbers);
+    MvAddStr(PYBASE - 2, PXBASE + 5, "Main Board");
+    MvAddStr(PYBASE - 1, PXBASE - 3, numbers);
     for (i = 0; i < BDEPTH; ++i) {
-	(void) mvaddch(PYBASE + i, PXBASE - 3, (chtype) (i + 'A'));
+	MvAddCh(PYBASE + i, PXBASE - 3, (chtype) (i + 'A'));
 #ifdef A_COLOR
 	if (has_colors())
 	    attron(COLOR_PAIR(COLOR_BLUE));
@@ -374,16 +374,16 @@
 	for (j = 0; j < BWIDTH; j++)
 	    (void) addstr(" . ");
 #ifdef A_COLOR
-	attrset(0);
+	(void) attrset(0);
 #endif /* A_COLOR */
 	(void) addch(' ');
 	(void) addch((chtype) (i + 'A'));
     }
-    (void) mvaddstr(PYBASE + BDEPTH, PXBASE - 3, numbers);
-    (void) mvaddstr(CYBASE - 2, CXBASE + 7, "Hit/Miss Board");
-    (void) mvaddstr(CYBASE - 1, CXBASE - 3, numbers);
+    MvAddStr(PYBASE + BDEPTH, PXBASE - 3, numbers);
+    MvAddStr(CYBASE - 2, CXBASE + 7, "Hit/Miss Board");
+    MvAddStr(CYBASE - 1, CXBASE - 3, numbers);
     for (i = 0; i < BDEPTH; ++i) {
-	(void) mvaddch(CYBASE + i, CXBASE - 3, (chtype) (i + 'A'));
+	MvAddCh(CYBASE + i, CXBASE - 3, (chtype) (i + 'A'));
 #ifdef A_COLOR
 	if (has_colors())
 	    attron(COLOR_PAIR(COLOR_BLUE));
@@ -392,33 +392,33 @@
 	for (j = 0; j < BWIDTH; j++)
 	    (void) addstr(" . ");
 #ifdef A_COLOR
-	attrset(0);
+	(void) attrset(0);
 #endif /* A_COLOR */
 	(void) addch(' ');
 	(void) addch((chtype) (i + 'A'));
     }
 
-    (void) mvaddstr(CYBASE + BDEPTH, CXBASE - 3, numbers);
+    MvAddStr(CYBASE + BDEPTH, CXBASE - 3, numbers);
 
-    (void) mvprintw(HYBASE, HXBASE,
-		    "To position your ships: move the cursor to a spot, then");
-    (void) mvprintw(HYBASE + 1, HXBASE,
-		    "type the first letter of a ship type to select it, then");
-    (void) mvprintw(HYBASE + 2, HXBASE,
-		    "type a direction ([hjkl] or [4862]), indicating how the");
-    (void) mvprintw(HYBASE + 3, HXBASE,
-		    "ship should be pointed. You may also type a ship letter");
-    (void) mvprintw(HYBASE + 4, HXBASE,
-		    "followed by `r' to position it randomly, or type `R' to");
-    (void) mvprintw(HYBASE + 5, HXBASE,
-		    "place all remaining ships randomly.");
-
-    (void) mvaddstr(MYBASE, MXBASE, "Aiming keys:");
-    (void) mvaddstr(SYBASE, SXBASE, "y k u    7 8 9");
-    (void) mvaddstr(SYBASE + 1, SXBASE, " \\|/      \\|/ ");
-    (void) mvaddstr(SYBASE + 2, SXBASE, "h-+-l    4-+-6");
-    (void) mvaddstr(SYBASE + 3, SXBASE, " /|\\      /|\\ ");
-    (void) mvaddstr(SYBASE + 4, SXBASE, "b j n    1 2 3");
+    MvPrintw(HYBASE, HXBASE,
+	     "To position your ships: move the cursor to a spot, then");
+    MvPrintw(HYBASE + 1, HXBASE,
+	     "type the first letter of a ship type to select it, then");
+    MvPrintw(HYBASE + 2, HXBASE,
+	     "type a direction ([hjkl] or [4862]), indicating how the");
+    MvPrintw(HYBASE + 3, HXBASE,
+	     "ship should be pointed. You may also type a ship letter");
+    MvPrintw(HYBASE + 4, HXBASE,
+	     "followed by `r' to position it randomly, or type `R' to");
+    MvPrintw(HYBASE + 5, HXBASE,
+	     "place all remaining ships randomly.");
+
+    MvAddStr(MYBASE, MXBASE, "Aiming keys:");
+    MvAddStr(SYBASE, SXBASE, "y k u    7 8 9");
+    MvAddStr(SYBASE + 1, SXBASE, " \\|/      \\|/ ");
+    MvAddStr(SYBASE + 2, SXBASE, "h-+-l    4-+-6");
+    MvAddStr(SYBASE + 3, SXBASE, " /|\\      /|\\ ");
+    MvAddStr(SYBASE + 4, SXBASE, "b j n    1 2 3");
 
     /* have the computer place ships */
     for (ss = cpuship; ss < cpuship + SHIPTYPES; ss++) {
@@ -440,7 +440,7 @@
 	/* get a command letter */
 	prompt(1, "Type one of [%s] to pick a ship.", docked + 1);
 	do {
-	    c = getcoord(PLAYER);
+	    c = (char) getcoord(PLAYER);
 	} while
 	    (!strchr(docked, c));
 
@@ -457,7 +457,7 @@
 	}
 
 	do {
-	    c = getch();
+	    c = (char) getch();
 	} while
 	    (!(strchr("hjklrR", c) || c == FF));
 
@@ -518,18 +518,18 @@
 
     turn = rnd(2);
 
-    (void) mvprintw(HYBASE, HXBASE,
-		    "To fire, move the cursor to your chosen aiming point   ");
-    (void) mvprintw(HYBASE + 1, HXBASE,
-		    "and strike any key other than a motion key.            ");
-    (void) mvprintw(HYBASE + 2, HXBASE,
-		    "                                                       ");
-    (void) mvprintw(HYBASE + 3, HXBASE,
-		    "                                                       ");
-    (void) mvprintw(HYBASE + 4, HXBASE,
-		    "                                                       ");
-    (void) mvprintw(HYBASE + 5, HXBASE,
-		    "                                                       ");
+    MvPrintw(HYBASE, HXBASE,
+	     "To fire, move the cursor to your chosen aiming point   ");
+    MvPrintw(HYBASE + 1, HXBASE,
+	     "and strike any key other than a motion key.            ");
+    MvPrintw(HYBASE + 2, HXBASE,
+	     "                                                       ");
+    MvPrintw(HYBASE + 3, HXBASE,
+	     "                                                       ");
+    MvPrintw(HYBASE + 4, HXBASE,
+	     "                                                       ");
+    MvPrintw(HYBASE + 5, HXBASE,
+	     "                                                       ");
 
     (void) prompt(0, "Press any key to start...", "");
     (void) getch();
@@ -547,12 +547,12 @@
     (void) refresh();
     for (;;) {
 	if (atcpu) {
-	    (void) mvprintw(CYBASE + BDEPTH + 1, CXBASE + 11, "(%d, %c)",
-			    curx, 'A' + cury);
+	    MvPrintw(CYBASE + BDEPTH + 1, CXBASE + 11, "(%d, %c)",
+		     curx, 'A' + cury);
 	    cgoto(cury, curx);
 	} else {
-	    (void) mvprintw(PYBASE + BDEPTH + 1, PXBASE + 11, "(%d, %c)",
-			    curx, 'A' + cury);
+	    MvPrintw(PYBASE + BDEPTH + 1, PXBASE + 11, "(%d, %c)",
+		     curx, 'A' + cury);
 	    pgoto(cury, curx);
 	}
 
@@ -633,9 +633,9 @@
 
 	default:
 	    if (atcpu)
-		(void) mvaddstr(CYBASE + BDEPTH + 1, CXBASE + 11, "      ");
+		MvAddStr(CYBASE + BDEPTH + 1, CXBASE + 11, "      ");
 	    else
-		(void) mvaddstr(PYBASE + BDEPTH + 1, PXBASE + 11, "      ");
+		MvAddStr(PYBASE + BDEPTH + 1, PXBASE + 11, "      ");
 	    return (c);
 	}
 
@@ -773,7 +773,7 @@
 #endif /* A_COLOR */
 				    (void) addch(MARK_MISS);
 #ifdef A_COLOR
-				    attrset(0);
+				    (void) attrset(0);
 #endif /* A_COLOR */
 				} else {
 				    pgoto(y1, x1);
@@ -799,7 +799,7 @@
 #endif /* A_COLOR */
 			(void) addch(SHOWHIT);
 #ifdef A_COLOR
-			attrset(0);
+			(void) attrset(0);
 #endif /* A_COLOR */
 		    }
 		}
@@ -829,7 +829,7 @@
 	    break;
     }
     hit = IS_SHIP(board[COMPUTER][curx][cury]);
-    hits[PLAYER][curx][cury] = (hit ? MARK_HIT : MARK_MISS);
+    hits[PLAYER][curx][cury] = (char) (hit ? MARK_HIT : MARK_MISS);
     cgoto(cury, curx);
 #ifdef A_COLOR
     if (has_colors()) {
@@ -841,7 +841,7 @@
 #endif /* A_COLOR */
     (void) addch((chtype) hits[PLAYER][curx][cury]);
 #ifdef A_COLOR
-    attrset(0);
+    (void) attrset(0);
 #endif /* A_COLOR */
 
     prompt(1, "You %s.", hit ? "scored a hit" : "missed");
@@ -952,10 +952,11 @@
     bool hit, sunk;
     ship_t *ss = NULL;
 
-    hits[COMPUTER][x][y] = (hit = (board[PLAYER][x][y])) ? MARK_HIT : MARK_MISS;
-    (void) mvprintw(PROMPTLINE, 0,
-		    "I shoot at %c%d. I %s!", y + 'A', x, hit ? "hit" :
-		    "miss");
+    hit = board[PLAYER][x][y] ? MARK_HIT : MARK_MISS;
+    hits[COMPUTER][x][y] = (char) hit;
+    MvPrintw(PROMPTLINE, 0,
+	     "I shoot at %c%d. I %s!", y + 'A', x, hit ? "hit" :
+	     "miss");
     if ((sunk = (hit && (ss = hitship(x, y)))) != 0)
 	(void) printw(" I've sunk your %s", ss->name);
     (void) clrtoeol();
@@ -971,7 +972,7 @@
 #endif /* A_COLOR */
     (void) addch((chtype) (hit ? SHOWHIT : SHOWSPLASH));
 #ifdef A_COLOR
-    attrset(0);
+    (void) attrset(0);
 #endif /* A_COLOR */
 
     return hit ? (sunk ? S_SUNK : S_HIT) : S_MISS;
@@ -1106,9 +1107,9 @@
 	(void) sleep(1);
     }
 #ifdef DEBUG
-    (void) mvprintw(PROMPTLINE + 2, 0,
-		    "New state %d, x=%d, y=%d, d=%d",
-		    next, x, y, d);
+    MvPrintw(PROMPTLINE + 2, 0,
+	     "New state %d, x=%d, y=%d, d=%d",
+	     next, x, y, d);
 #endif /* DEBUG */
     return ((hit) ? TRUE : FALSE);
 }
@@ -1129,13 +1130,13 @@
 	++cpuwon;
     else
 	++plywon;
-    j = 18 + strlen(name);
+    j = 18 + (int) strlen(name);
     if (plywon >= 10)
 	++j;
     if (cpuwon >= 10)
 	++j;
-    (void) mvprintw(1, (COLWIDTH - j) / 2,
-		    "%s: %d     Computer: %d", name, plywon, cpuwon);
+    MvPrintw(1, (COLWIDTH - j) / 2,
+	     "%s: %d     Computer: %d", name, plywon, cpuwon);
 
     prompt(2, (awinna())? "Want to be humiliated again, %s [yn]? "
 	   : "Going to give me a chance for revenge, %s [yn]? ", name);
diff -Naur ncurses-5.7.orig/test/cardfile.c ncurses-5.7/test/cardfile.c
--- ncurses-5.7.orig/test/cardfile.c	2008-08-04 20:42:24.000000000 -0400
+++ ncurses-5.7/test/cardfile.c	2011-01-08 18:18:29.486655656 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1999-2007,2008 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            *
@@ -29,7 +29,7 @@
 /*
  * Author: Thomas E. Dickey
  *
- * $Id: cardfile.c,v 1.35 2008/08/05 00:42:24 tom Exp $
+ * $Id: cardfile.c,v 1.38 2010/11/14 00:58:45 tom Exp $
  *
  * File format: text beginning in column 1 is a title; other text is content.
  */
@@ -91,7 +91,7 @@
 static void
 trim(char *buffer)
 {
-    unsigned n = strlen(buffer);
+    size_t n = strlen(buffer);
     while (n-- && isspace(UChar(buffer[n])))
 	buffer[n] = 0;
 }
@@ -129,7 +129,7 @@
 static void
 add_content(CARD * card, const char *content)
 {
-    unsigned total, offset;
+    size_t total, offset;
 
     content = skip(content);
     if ((total = strlen(content)) != 0) {
@@ -262,7 +262,7 @@
 	if (isVisible(tst))
 	    now = tst;
 	else
-	    tst = next_card(tst);
+	    (void) next_card(tst);
     }
     return now;
 }
@@ -523,14 +523,12 @@
 #if NO_LEAKS
     while (all_cards != 0) {
 	FIELD **f;
-	int count;
 
 	p = all_cards;
 	all_cards = all_cards->link;
 
 	if (isVisible(p)) {
 	    f = form_fields(p->form);
-	    count = field_count(p->form);
 
 	    unpost_form(p->form);	/* ...so we can free it */
 	    free_form(p->form);	/* this also disconnects the fields */
diff -Naur ncurses-5.7.orig/test/chgat.c ncurses-5.7/test/chgat.c
--- ncurses-5.7.orig/test/chgat.c	2008-02-09 18:19:13.000000000 -0500
+++ ncurses-5.7/test/chgat.c	2011-01-08 18:13:50.767157473 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2006-2007,2008 Free Software Foundation, Inc.              *
+ * Copyright (c) 2006-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            *
@@ -26,7 +26,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: chgat.c,v 1.8 2008/02/09 23:19:13 tom Exp $
+ * $Id: chgat.c,v 1.11 2010/05/01 19:12:26 tom Exp $
  *
  * test-driver for chgat/wchgat/mvchgat/mvwchgat
  */
@@ -47,7 +47,7 @@
 typedef struct {
     unsigned c;
     unsigned v;
-    int pair;
+    short pair;
     unsigned attr;
     int count;
     int ch;
@@ -60,12 +60,12 @@
 } STATUS;
 
 static const char *
-color_params(unsigned state, int *pair)
+color_params(unsigned state, short *pair)
 {
     /* *INDENT-OFF* */
     static struct {
-	int pair;
-	int fg, bg;
+	short pair;
+	short fg, bg;
 	const char *msg;
     } table[] = {
 	{ 0, COLOR_DEFAULT, COLOR_DEFAULT, "default" },
@@ -124,10 +124,17 @@
 fill_window(WINDOW *win)
 {
     int y, x;
+    int y0 = -1, x0 = -1;
 
     getyx(win, y, x);
     wmove(win, 0, 0);
     while (waddstr(win, "0123456789 abcdefghijklmnopqrstuvwxyz ") != ERR) {
+	int y1, x1;
+	getyx(win, y1, x1);
+	if (y1 == y0 && x1 == x0)
+	    break;
+	x0 = x1;
+	y0 = y1;
     }
     wmove(win, y, x);
 }
@@ -214,7 +221,7 @@
 
     getmaxyx(win, y_max, x_max);
     for (row = 0; row < (int) SIZEOF(table) && row < y_max; ++row) {
-	mvwprintw(win, row, 0, "%.*s", x_max, table[row]);
+	MvWPrintw(win, row, 0, "%.*s", x_max, table[row]);
     }
     while (wgetch(win) != 'q')
 	beep();
diff -Naur ncurses-5.7.orig/test/clip_printw.c ncurses-5.7/test/clip_printw.c
--- ncurses-5.7.orig/test/clip_printw.c	1969-12-31 19:00:00.000000000 -0500
+++ ncurses-5.7/test/clip_printw.c	2011-01-08 18:18:29.486655656 -0500
@@ -0,0 +1,380 @@
+/****************************************************************************
+ * Copyright (c) 2008-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            *
+ * "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: clip_printw.c,v 1.7 2010/11/13 20:48:48 tom Exp $
+ *
+ * demonstrate how to use printw without wrapping.
+ */
+
+#include <test.priv.h>
+
+#ifdef HAVE_VW_PRINTW
+
+#define SHOW(n) ((n) == ERR ? "ERR" : "OK")
+#define COLOR_DEFAULT (-1)
+
+typedef struct {
+    unsigned c;
+    unsigned v;
+    int status;
+    int pair;
+    attr_t attr;
+    int count;
+    int ch;
+    const char *c_msg;
+    const char *v_msg;
+    int y_val;
+    int x_val;
+    int y_beg, x_beg;
+    int y_max, x_max;
+} STATUS;
+
+static int
+clip_wprintw(WINDOW *win, NCURSES_CONST char *fmt,...)
+{
+    int y0, x0, y1, x1, width;
+    WINDOW *sub;
+    va_list ap;
+    int rc;
+
+    /*
+     * Allocate a single-line derived window extending from the current
+     * cursor position to the end of the current line in the given window.
+     * Disable scrolling in the derived window.
+     */
+    getyx(win, y0, x0);
+    width = getmaxx(win) - x0;
+    sub = derwin(win, 1, width, y0, x0);
+    scrollok(sub, FALSE);
+
+    /*
+     * Print the text.
+     */
+    va_start(ap, fmt);
+    rc = vw_printw(sub, fmt, ap);
+    va_end(ap);
+
+    getyx(sub, y1, x1);
+    delwin(sub);
+
+    wmove(win, y1 + y0, x1 + x0);
+
+    return rc;
+}
+
+static const char *
+color_params(unsigned state, int *pair)
+{
+    /* *INDENT-OFF* */
+    static struct {
+	int pair;
+	int fg, bg;
+	const char *msg;
+    } table[] = {
+	{ 0, COLOR_DEFAULT, COLOR_DEFAULT, "default" },
+	{ 1, COLOR_RED,     COLOR_BLACK,   "red/black" },
+	{ 2, COLOR_WHITE,   COLOR_BLUE,    "white/blue" },
+    };
+    /* *INDENT-ON* */
+
+    static bool first = TRUE;
+    const char *result = 0;
+
+    if (has_colors()) {
+	if (first) {
+	    unsigned n;
+
+	    start_color();
+	    for (n = 0; n < SIZEOF(table); ++n) {
+		init_pair((short) table[n].pair,
+			  (short) table[n].fg,
+			  (short) table[n].bg);
+	    }
+	}
+	if (state < SIZEOF(table)) {
+	    *pair = table[state].pair;
+	    result = table[state].msg;
+	}
+    }
+    return result;
+}
+
+static const char *
+video_params(unsigned state, attr_t *attr)
+{
+    /* *INDENT-OFF* */
+    static struct {
+	attr_t attr;
+	const char *msg;
+    } table[] = {
+	{ A_NORMAL,	"normal" },
+	{ A_BOLD,	"bold" },
+	{ A_REVERSE,	"reverse" },
+	{ A_UNDERLINE,	"underline" },
+	{ A_BLINK, 	"blink" },
+    };
+    /* *INDENT-ON* */
+
+    const char *result = 0;
+
+    if (state < SIZEOF(table)) {
+	*attr = table[state].attr;
+	result = table[state].msg;
+    }
+    return result;
+}
+
+/* fill the window with a test-pattern */
+static void
+fill_window(WINDOW *win)
+{
+    int y, x;
+    int y0 = -1, x0 = -1;
+
+    getyx(win, y, x);
+    wmove(win, 0, 0);
+    while (waddstr(win, "0123456789 abcdefghijklmnopqrstuvwxyz ") != ERR) {
+	int y1, x1;
+	getyx(win, y1, x1);
+	if (y1 == y0 && x1 == x0)
+	    break;
+	x0 = x1;
+	y0 = y1;
+    }
+    wmove(win, y, x);
+}
+
+static void
+show_status(WINDOW *win, STATUS * sp)
+{
+    int y, x;
+
+    getyx(win, y, x);
+    wmove(win, 0, 0);
+    wprintw(win, "Count %d", sp->count);
+    if (sp->v_msg != 0)
+	wprintw(win, " Video %s", sp->v_msg);
+    if (sp->c_msg != 0)
+	wprintw(win, " Color %s", sp->c_msg);
+    wprintw(win, " (%d)", sp->status);
+    wclrtoeol(win);
+    wmove(win, y, x);
+}
+
+static void
+do_subwindow(WINDOW *win, STATUS * sp, void func(WINDOW *))
+{
+    WINDOW *win1 = newwin(sp->y_max - 2, sp->x_max - 2,
+			  sp->y_beg + 1, sp->x_beg + 1);
+
+    if (win1 != 0 && sp->y_max > 4 && sp->x_max > 4) {
+	WINDOW *win2 = derwin(win1, sp->y_max - 4, sp->x_max - 4, 1, 1);
+
+	if (win2 != 0) {
+	    box(win1, 0, 0);
+	    wrefresh(win1);
+	    func(win2);
+
+	    delwin(win2);
+	} else {
+	    beep();
+	}
+	delwin(win1);
+	touchwin(win);
+    } else {
+	beep();
+    }
+}
+
+static void
+init_status(WINDOW *win, STATUS * sp)
+{
+    memset(sp, 0, sizeof(*sp));
+    sp->c = 99;
+    sp->v = 99;
+    sp->ch = ' ';
+
+    keypad(win, TRUE);
+    fill_window(win);
+
+    getbegyx(win, sp->y_beg, sp->x_beg);
+    getmaxyx(win, sp->y_max, sp->x_max);
+}
+
+static void
+show_help(WINDOW *win)
+{
+    static const char *table[] =
+    {
+	"Basic commands:"
+	,"Use h/j/k/l or arrow keys to move the cursor."
+	,"Set the count parameter for clip_wprintw by entering digits 0-9."
+	,""
+	,"Other commands:"
+	,"space toggles through the set of video attributes and colors."
+	,"t     touches (forces repaint) of the current line."
+	,".     calls clip_wprintw at the current position with the given count."
+	,"=     resets count to zero."
+	,"?     shows this help-window"
+	,""
+    };
+
+    int y_max, x_max;
+    int row;
+
+    getmaxyx(win, y_max, x_max);
+    for (row = 0; row < (int) SIZEOF(table) && row < y_max; ++row) {
+	MvWPrintw(win, row, 0, "%.*s", x_max, table[row]);
+    }
+    while (wgetch(win) != 'q')
+	beep();
+}
+
+static void
+update_status(WINDOW *win, STATUS * sp)
+{
+    switch (sp->ch) {
+    case ' ':			/* next test-iteration */
+	if (has_colors()) {
+	    if ((sp->c_msg = color_params(++(sp->c), &(sp->pair))) == 0) {
+		sp->c_msg = color_params(sp->c = 0, &(sp->pair));
+		if ((sp->v_msg = video_params(++(sp->v), &(sp->attr))) == 0) {
+		    sp->v_msg = video_params(sp->v = 0, &(sp->attr));
+		}
+	    }
+	} else {
+	    if ((sp->v_msg = video_params(++(sp->v), &(sp->attr))) == 0) {
+		sp->v_msg = video_params(sp->v = 0, &(sp->attr));
+	    }
+	}
+	sp->count = 0;
+	show_status(win, sp);
+	break;
+    case KEY_LEFT:
+    case 'h':
+	if (sp->x_val > 0)
+	    wmove(win, sp->y_val, --(sp->x_val));
+	break;
+    case KEY_DOWN:
+    case 'j':
+	if (sp->y_val < sp->y_max)
+	    wmove(win, ++(sp->y_val), sp->x_val);
+	break;
+    case KEY_UP:
+    case 'k':
+	if (sp->y_val > 0)
+	    wmove(win, --(sp->y_val), sp->x_val);
+	break;
+    case KEY_RIGHT:
+    case 'l':
+	if (sp->x_val < sp->x_max)
+	    wmove(win, sp->y_val, ++(sp->x_val));
+	break;
+    case 't':
+	touchline(win, sp->y_val, 1);
+	break;
+    case '=':
+	sp->count = 0;
+	show_status(win, sp);
+	break;
+    case '?':
+	do_subwindow(win, sp, show_help);
+	break;
+    default:
+	if (isdigit(sp->ch)) {
+	    sp->count = (sp->count * 10) + (sp->ch - '0');
+	    show_status(win, sp);
+	} else {
+	    beep();
+	}
+	break;
+    }
+}
+
+static void
+test_clipping(WINDOW *win)
+{
+    STATUS st;
+    char fmt[80];
+    char *buffer;
+    unsigned j, need;
+
+    init_status(win, &st);
+
+    do {
+	switch (st.ch) {
+	case '.':		/* change from current position */
+	    (void) wattrset(win, st.attr | (chtype) COLOR_PAIR(st.pair));
+	    if (st.count > 0) {
+		need = (unsigned) st.count + 1;
+		sprintf(fmt, "%%c%%%ds%%c", st.count);
+	    } else {
+		need = (unsigned) getmaxx(win) - 1;
+		strcpy(fmt, "%c%s%c");
+	    }
+	    if ((buffer = typeMalloc(char, need)) != 0) {
+		for (j = 0; j < need; ++j) {
+		    buffer[j] = (char) ('A' + (j % 26));
+		}
+		buffer[need - 1] = '\0';
+		st.status = clip_wprintw(win, fmt, '[', buffer, ']');
+	    }
+	    break;
+	case 'w':
+	    do_subwindow(win, &st, test_clipping);
+	    break;
+	case 'q':
+	    return;
+	default:
+	    update_status(win, &st);
+	    break;
+	}
+    } while ((st.ch = wgetch(win)) != ERR);
+}
+
+int
+main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
+{
+    initscr();
+    cbreak();
+    noecho();
+
+    test_clipping(stdscr);
+    endwin();
+
+    ExitProgram(EXIT_SUCCESS);
+}
+
+#else
+int
+main(void)
+{
+    printf("This program requires the curses vw_printw function\n");
+    ExitProgram(EXIT_FAILURE);
+}
+#endif
diff -Naur ncurses-5.7.orig/test/configure ncurses-5.7/test/configure
--- ncurses-5.7.orig/test/configure	2008-09-06 18:11:48.000000000 -0400
+++ ncurses-5.7/test/configure	2011-01-08 18:18:29.610657668 -0500
@@ -1,26 +1,155 @@
 #! /bin/sh
-
 # Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 2.13.20030927 
-# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
+# Generated by Autoconf 2.52.20101001.
 #
+# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
+# Free Software Foundation, Inc.
 # This configure script is free software; the Free Software Foundation
 # gives unlimited permission to copy, distribute and modify it.
 
-# Defaults:
-ac_help=
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+  set -o posix
+fi
+
+# Name of the executable.
+as_me=`echo "$0" |sed 's,.*[\\/],,'`
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+  # We could just check for DJGPP; but this test a) works b) is more generic
+  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+  if test -f conf$$.exe; then
+    # Don't use ln at all; we don't have any links
+    as_ln_s='cp -p'
+  else
+    as_ln_s='ln -s'
+  fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s=ln
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
+
+as_executable_p="test -f"
+
+# Support unset when possible.
+if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+# NLS nuisances.
+$as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
+$as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
+$as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
+$as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
+$as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
+$as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
+$as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
+$as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
+
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" 	$as_nl"
+
+# CDPATH.
+$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
+
+# Name of the host.
+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+exec 6>&1
+
+#
+# Initializations.
+#
 ac_default_prefix=/usr/local
-# Any additions from configure.in:
+cross_compiling=no
+subdirs=
+MFLAGS= MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Maximum number of lines to put in a shell here document.
+# This variable seems obsolete.  It should probably be removed, and
+# only ac_max_sed_lines should be used.
+: ${ac_max_here_lines=38}
+
+ac_unique_file="ncurses.c"
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#if STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# if HAVE_STDLIB_H
+#  include <stdlib.h>
+# endif
+#endif
+#if HAVE_STRING_H
+# if !STDC_HEADERS && HAVE_MEMORY_H
+#  include <memory.h>
+# endif
+# include <string.h>
+#endif
+#if HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#if HAVE_INTTYPES_H
+# include <inttypes.h>
+#else
+# if HAVE_STDINT_H
+#  include <stdint.h>
+# endif
+#endif
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
 
 # Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
 # The variables have the same names as the options, with
 # dashes changed to underlines.
-build=NONE
-cache_file=./config.cache
+cache_file=/dev/null
 exec_prefix=NONE
-host=NONE
 no_create=
-nonopt=NONE
 no_recursion=
 prefix=NONE
 program_prefix=NONE
@@ -29,10 +158,15 @@
 silent=
 site=
 srcdir=
-target=NONE
 verbose=
 x_includes=NONE
 x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
 bindir='${exec_prefix}/bin'
 sbindir='${exec_prefix}/sbin'
 libexecdir='${exec_prefix}/libexec'
@@ -46,17 +180,16 @@
 infodir='${prefix}/info'
 mandir='${prefix}/man'
 
-# Initialize some other variables.
-subdirs=
-MFLAGS= MAKEFLAGS=
-SHELL=${CONFIG_SHELL-/bin/sh}
-# Maximum number of lines to put in a shell here document.
-ac_max_here_lines=12
+# Identity of this package.
+PACKAGE_NAME=
+PACKAGE_TARNAME=
+PACKAGE_VERSION=
+PACKAGE_STRING=
+PACKAGE_BUGREPORT=
 
 ac_prev=
 for ac_option
 do
-
   # If the previous option needs an argument, assign it.
   if test -n "$ac_prev"; then
     eval "$ac_prev=\$ac_option"
@@ -64,59 +197,59 @@
     continue
   fi
 
-  case "$ac_option" in
-  -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
-  *) ac_optarg= ;;
-  esac
+  ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
 
   # Accept the important Cygnus configure options, so we can diagnose typos.
 
-  case "$ac_option" in
+  case $ac_option in
 
   -bindir | --bindir | --bindi | --bind | --bin | --bi)
     ac_prev=bindir ;;
   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
-    bindir="$ac_optarg" ;;
+    bindir=$ac_optarg ;;
 
   -build | --build | --buil | --bui | --bu)
-    ac_prev=build ;;
+    ac_prev=build_alias ;;
   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
-    build="$ac_optarg" ;;
+    build_alias=$ac_optarg ;;
 
   -cache-file | --cache-file | --cache-fil | --cache-fi \
   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
     ac_prev=cache_file ;;
   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
-    cache_file="$ac_optarg" ;;
+    cache_file=$ac_optarg ;;
+
+  --config-cache | -C)
+    cache_file=config.cache ;;
 
   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
     ac_prev=datadir ;;
   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
   | --da=*)
-    datadir="$ac_optarg" ;;
+    datadir=$ac_optarg ;;
 
   -disable-* | --disable-*)
-    ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
+    ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
     # Reject names that are not valid shell variable names.
-    if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
-      { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
-    fi
-    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
-    eval "enable_${ac_feature}=no" ;;
+    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+   { (exit 1); exit 1; }; }
+    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+    eval "enable_$ac_feature=no" ;;
 
   -enable-* | --enable-*)
-    ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
+    ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
     # Reject names that are not valid shell variable names.
-    if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
-      { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
-    fi
-    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
-    case "$ac_option" in
-      *=*) ;;
+    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+   { (exit 1); exit 1; }; }
+    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+    case $ac_option in
+      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
       *) ac_optarg=yes ;;
     esac
-    eval "enable_${ac_feature}='$ac_optarg'" ;;
+    eval "enable_$ac_feature='$ac_optarg'" ;;
 
   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
@@ -125,106 +258,47 @@
   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
   | --exec=* | --exe=* | --ex=*)
-    exec_prefix="$ac_optarg" ;;
+    exec_prefix=$ac_optarg ;;
 
   -gas | --gas | --ga | --g)
     # Obsolete; use --with-gas.
     with_gas=yes ;;
 
-  -help | --help | --hel | --he)
-    # Omit some internal or obsolete options to make the list less imposing.
-    # This message is too long to be a string in the A/UX 3.1 sh.
-    cat << EOF
-Usage: configure [options] [host]
-Options: [defaults in brackets after descriptions]
-Configuration:
-  --cache-file=FILE       cache test results in FILE
-  --help                  print this message
-  --no-create             do not create output files
-  --quiet, --silent       do not print \`checking...' messages
-  --version               print the version of autoconf that created configure
-Directory and file names:
-  --prefix=PREFIX         install architecture-independent files in PREFIX
-                          [$ac_default_prefix]
-  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
-                          [same as prefix]
-  --bindir=DIR            user executables in DIR [EPREFIX/bin]
-  --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
-  --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
-  --datadir=DIR           read-only architecture-independent data in DIR
-                          [PREFIX/share]
-  --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
-  --sharedstatedir=DIR    modifiable architecture-independent data in DIR
-                          [PREFIX/com]
-  --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
-  --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
-  --includedir=DIR        C header files in DIR [PREFIX/include]
-  --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
-  --infodir=DIR           info documentation in DIR [PREFIX/info]
-  --mandir=DIR            man documentation in DIR [PREFIX/man]
-  --srcdir=DIR            find the sources in DIR [configure dir or ..]
-  --program-prefix=PREFIX prepend PREFIX to installed program names
-  --program-suffix=SUFFIX append SUFFIX to installed program names
-  --program-transform-name=PROGRAM
-                          run sed PROGRAM on installed program names
-EOF
-    cat << EOF
-Host type:
-  --build=BUILD           configure for building on BUILD [BUILD=HOST]
-  --host=HOST             configure for HOST [guessed]
-  --target=TARGET         configure for TARGET [TARGET=HOST]
-Features and packages:
-  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
-  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
-  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
-  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
-  --x-includes=DIR        X include files are in DIR
-  --x-libraries=DIR       X library files are in DIR
-EOF
-cat <<\EOF
---enable and --with options recognized:
-  --disable-echo          display "compiling" commands
-  --enable-warnings       test: turn on gcc compiler warnings
-  --with-curses-dir=DIR   directory in which (n)curses is installed
-  --with-5lib             use SunOS sysv-libraries
-  --with-ncursesw         use wide ncurses-libraries (installed)
-  --with-ncurses          use ncurses-libraries (installed)
-  --with-pdcurses         compile/link with pdcurses X11 library
-  --with-x                use the X Window System
-  --with-Xaw3d            link with Xaw 3d library
-  --with-neXtaw           link with neXT Athena library
-  --with-XawPlus          link with Athena-Plus library
-EOF
-    exit 0 ;;
+  -help | --help | --hel | --he | -h)
+    ac_init_help=long ;;
+  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+    ac_init_help=recursive ;;
+  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+    ac_init_help=short ;;
 
   -host | --host | --hos | --ho)
-    ac_prev=host ;;
+    ac_prev=host_alias ;;
   -host=* | --host=* | --hos=* | --ho=*)
-    host="$ac_optarg" ;;
+    host_alias=$ac_optarg ;;
 
   -includedir | --includedir | --includedi | --included | --include \
   | --includ | --inclu | --incl | --inc)
     ac_prev=includedir ;;
   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
   | --includ=* | --inclu=* | --incl=* | --inc=*)
-    includedir="$ac_optarg" ;;
+    includedir=$ac_optarg ;;
 
   -infodir | --infodir | --infodi | --infod | --info | --inf)
     ac_prev=infodir ;;
   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
-    infodir="$ac_optarg" ;;
+    infodir=$ac_optarg ;;
 
   -libdir | --libdir | --libdi | --libd)
     ac_prev=libdir ;;
   -libdir=* | --libdir=* | --libdi=* | --libd=*)
-    libdir="$ac_optarg" ;;
+    libdir=$ac_optarg ;;
 
   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
   | --libexe | --libex | --libe)
     ac_prev=libexecdir ;;
   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
   | --libexe=* | --libex=* | --libe=*)
-    libexecdir="$ac_optarg" ;;
+    libexecdir=$ac_optarg ;;
 
   -localstatedir | --localstatedir | --localstatedi | --localstated \
   | --localstate | --localstat | --localsta | --localst \
@@ -233,12 +307,12 @@
   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
-    localstatedir="$ac_optarg" ;;
+    localstatedir=$ac_optarg ;;
 
   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
     ac_prev=mandir ;;
   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
-    mandir="$ac_optarg" ;;
+    mandir=$ac_optarg ;;
 
   -nfp | --nfp | --nf)
     # Obsolete; use --without-fp.
@@ -259,26 +333,26 @@
   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
-    oldincludedir="$ac_optarg" ;;
+    oldincludedir=$ac_optarg ;;
 
   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
     ac_prev=prefix ;;
   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
-    prefix="$ac_optarg" ;;
+    prefix=$ac_optarg ;;
 
   -program-prefix | --program-prefix | --program-prefi | --program-pref \
   | --program-pre | --program-pr | --program-p)
     ac_prev=program_prefix ;;
   -program-prefix=* | --program-prefix=* | --program-prefi=* \
   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
-    program_prefix="$ac_optarg" ;;
+    program_prefix=$ac_optarg ;;
 
   -program-suffix | --program-suffix | --program-suffi | --program-suff \
   | --program-suf | --program-su | --program-s)
     ac_prev=program_suffix ;;
   -program-suffix=* | --program-suffix=* | --program-suffi=* \
   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
-    program_suffix="$ac_optarg" ;;
+    program_suffix=$ac_optarg ;;
 
   -program-transform-name | --program-transform-name \
   | --program-transform-nam | --program-transform-na \
@@ -295,7 +369,7 @@
   | --program-transfo=* | --program-transf=* \
   | --program-trans=* | --program-tran=* \
   | --progr-tra=* | --program-tr=* | --program-t=*)
-    program_transform_name="$ac_optarg" ;;
+    program_transform_name=$ac_optarg ;;
 
   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
   | -silent | --silent | --silen | --sile | --sil)
@@ -305,7 +379,7 @@
     ac_prev=sbindir ;;
   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
   | --sbi=* | --sb=*)
-    sbindir="$ac_optarg" ;;
+    sbindir=$ac_optarg ;;
 
   -sharedstatedir | --sharedstatedir | --sharedstatedi \
   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
@@ -316,58 +390,57 @@
   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
   | --sha=* | --sh=*)
-    sharedstatedir="$ac_optarg" ;;
+    sharedstatedir=$ac_optarg ;;
 
   -site | --site | --sit)
     ac_prev=site ;;
   -site=* | --site=* | --sit=*)
-    site="$ac_optarg" ;;
+    site=$ac_optarg ;;
 
   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
     ac_prev=srcdir ;;
   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
-    srcdir="$ac_optarg" ;;
+    srcdir=$ac_optarg ;;
 
   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
   | --syscon | --sysco | --sysc | --sys | --sy)
     ac_prev=sysconfdir ;;
   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
-    sysconfdir="$ac_optarg" ;;
+    sysconfdir=$ac_optarg ;;
 
   -target | --target | --targe | --targ | --tar | --ta | --t)
-    ac_prev=target ;;
+    ac_prev=target_alias ;;
   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
-    target="$ac_optarg" ;;
+    target_alias=$ac_optarg ;;
 
   -v | -verbose | --verbose | --verbos | --verbo | --verb)
     verbose=yes ;;
 
-  -version | --version | --versio | --versi | --vers)
-    echo "configure generated by autoconf version 2.13.20030927"
-    exit 0 ;;
+  -version | --version | --versio | --versi | --vers | -V)
+    ac_init_version=: ;;
 
   -with-* | --with-*)
-    ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
+    ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
     # Reject names that are not valid shell variable names.
-    if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
-      { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
-    fi
+    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid package name: $ac_package" >&2
+   { (exit 1); exit 1; }; }
     ac_package=`echo $ac_package| sed 's/-/_/g'`
-    case "$ac_option" in
-      *=*) ;;
+    case $ac_option in
+      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
       *) ac_optarg=yes ;;
     esac
-    eval "with_${ac_package}='$ac_optarg'" ;;
+    eval "with_$ac_package='$ac_optarg'" ;;
 
   -without-* | --without-*)
-    ac_package=`echo $ac_option|sed -e 's/-*without-//'`
+    ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
     # Reject names that are not valid shell variable names.
-    if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
-      { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
-    fi
-    ac_package=`echo $ac_package| sed 's/-/_/g'`
-    eval "with_${ac_package}=no" ;;
+    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid package name: $ac_package" >&2
+   { (exit 1); exit 1; }; }
+    ac_package=`echo $ac_package | sed 's/-/_/g'`
+    eval "with_$ac_package=no" ;;
 
   --x)
     # Obsolete; use --with-x.
@@ -378,98 +451,98 @@
     ac_prev=x_includes ;;
   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
-    x_includes="$ac_optarg" ;;
+    x_includes=$ac_optarg ;;
 
   -x-libraries | --x-libraries | --x-librarie | --x-librari \
   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
     ac_prev=x_libraries ;;
   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
-    x_libraries="$ac_optarg" ;;
+    x_libraries=$ac_optarg ;;
 
-  -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
+  -*) { echo "$as_me: error: unrecognized option: $ac_option
+Try \`$0 --help' for more information." >&2
+   { (exit 1); exit 1; }; }
     ;;
 
+  *=*)
+    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+   { (exit 1); exit 1; }; }
+    ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
+    eval "$ac_envvar='$ac_optarg'"
+    export $ac_envvar ;;
+
   *)
-    if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
-      echo "configure: warning: $ac_option: invalid host type" 1>&2
-    fi
-    if test "x$nonopt" != xNONE; then
-      { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
-    fi
-    nonopt="$ac_option"
+    # FIXME: should be removed in autoconf 3.0.
+    echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
     ;;
 
   esac
 done
 
 if test -n "$ac_prev"; then
-  { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
-fi
-
-trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
-
-# File descriptor usage:
-# 0 standard input
-# 1 file creation
-# 2 errors and warnings
-# 3 some systems may open it to /dev/tty
-# 4 used on the Kubota Titan
-# 6 checking for... messages and results
-# 5 compiler messages saved in config.log
-if test "$silent" = yes; then
-  exec 6>/dev/null
-else
-  exec 6>&1
+  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+  { echo "$as_me: error: missing argument to $ac_option" >&2
+   { (exit 1); exit 1; }; }
 fi
-exec 5>./config.log
 
-echo "\
-This file contains any messages produced by compilers while
-running configure, to aid debugging if configure makes a mistake.
-" 1>&5
+# Be sure to have absolute paths.
+for ac_var in exec_prefix prefix
+do
+  eval ac_val=$`echo $ac_var`
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
+    *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
+   { (exit 1); exit 1; }; };;
+  esac
+done
 
-# Strip out --no-create and --no-recursion so they do not pile up.
-# Also quote any args containing shell metacharacters.
-ac_configure_args=
-for ac_arg
+# Be sure to have absolute paths.
+for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
+              localstatedir libdir includedir oldincludedir infodir mandir
 do
-  case "$ac_arg" in
-  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
-  | --no-cr | --no-c) ;;
-  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
-  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
-  *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
-  ac_configure_args="$ac_configure_args '$ac_arg'" ;;
-  *) ac_configure_args="$ac_configure_args $ac_arg" ;;
+  eval ac_val=$`echo $ac_var`
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* ) ;;
+    *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
+   { (exit 1); exit 1; }; };;
   esac
 done
 
-# NLS nuisances.
-# Only set these to C if already set.  These must not be set unconditionally
-# because not all systems understand e.g. LANG=C (notably SCO).
-# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
-# Non-C LC_CTYPE values break the ctype check.
-if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
-if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
-if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
-if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: should be removed in autoconf 3.0.
+if test "x$host_alias" != x; then
+  if test "x$build_alias" = x; then
+    cross_compiling=maybe
+    echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+    If a cross compiler is detected then cross compile mode will be used." >&2
+  elif test "x$build_alias" != "x$host_alias"; then
+    cross_compiling=yes
+  fi
+fi
 
-# confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -rf conftest* confdefs.h
-# AIX cpp loses on an empty file, so make sure it contains at least a newline.
-echo > confdefs.h
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
 
-# A filename unique to this package, relative to the directory that
-# configure is in, which we can look for to find out if srcdir is correct.
-ac_unique_file=ncurses.c
+test "$silent" = yes && exec 6>/dev/null
 
 # Find the source files, if location was not specified.
 if test -z "$srcdir"; then
   ac_srcdir_defaulted=yes
   # Try the directory containing this script, then its parent.
   ac_prog=$0
-  ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
+  ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'`
   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
   srcdir=$ac_confdir
   if test ! -r $srcdir/$ac_unique_file; then
@@ -480,348 +553,530 @@
 fi
 if test ! -r $srcdir/$ac_unique_file; then
   if test "$ac_srcdir_defaulted" = yes; then
-    { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
+    { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2
+   { (exit 1); exit 1; }; }
   else
-    { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
+    { echo "$as_me: error: cannot find sources in $srcdir" >&2
+   { (exit 1); exit 1; }; }
   fi
 fi
-srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
+srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
+ac_env_build_alias_set=${build_alias+set}
+ac_env_build_alias_value=$build_alias
+ac_cv_env_build_alias_set=${build_alias+set}
+ac_cv_env_build_alias_value=$build_alias
+ac_env_host_alias_set=${host_alias+set}
+ac_env_host_alias_value=$host_alias
+ac_cv_env_host_alias_set=${host_alias+set}
+ac_cv_env_host_alias_value=$host_alias
+ac_env_target_alias_set=${target_alias+set}
+ac_env_target_alias_value=$target_alias
+ac_cv_env_target_alias_set=${target_alias+set}
+ac_cv_env_target_alias_value=$target_alias
+ac_env_CC_set=${CC+set}
+ac_env_CC_value=$CC
+ac_cv_env_CC_set=${CC+set}
+ac_cv_env_CC_value=$CC
+ac_env_CFLAGS_set=${CFLAGS+set}
+ac_env_CFLAGS_value=$CFLAGS
+ac_cv_env_CFLAGS_set=${CFLAGS+set}
+ac_cv_env_CFLAGS_value=$CFLAGS
+ac_env_LDFLAGS_set=${LDFLAGS+set}
+ac_env_LDFLAGS_value=$LDFLAGS
+ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
+ac_cv_env_LDFLAGS_value=$LDFLAGS
+ac_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_env_CPPFLAGS_value=$CPPFLAGS
+ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_cv_env_CPPFLAGS_value=$CPPFLAGS
+ac_env_CPP_set=${CPP+set}
+ac_env_CPP_value=$CPP
+ac_cv_env_CPP_set=${CPP+set}
+ac_cv_env_CPP_value=$CPP
 
-# Prefer explicitly selected file to automatically selected ones.
-if test -z "$CONFIG_SITE"; then
-  if test "x$prefix" != xNONE; then
-    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
-  else
-    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
-  fi
-fi
-for ac_site_file in $CONFIG_SITE; do
-  if test -r "$ac_site_file"; then
-    echo "loading site script $ac_site_file"
-    . "$ac_site_file"
-  fi
-done
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+  # Omit some internal or obsolete options to make the list less imposing.
+  # This message is too long to be a string in the A/UX 3.1 sh.
+  cat <<EOF
+\`configure' configures this package to adapt to many kinds of systems.
 
-if test -r "$cache_file"; then
-  echo "loading cache $cache_file"
-  . $cache_file
-else
-  echo "creating cache $cache_file"
-  > $cache_file
-fi
+Usage: $0 [OPTION]... [VAR=VALUE]...
 
-ac_ext=c
-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
-
-ac_exeext=
-ac_objext=o
-if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
-  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
-  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
-    ac_n= ac_c='
-' ac_t='	'
-  else
-    ac_n=-n ac_c= ac_t=
-  fi
-else
-  ac_n= ac_c='\c' ac_t=
-fi
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE.  See below for descriptions of some of the useful variables.
 
-# If we find X, set shell vars x_includes and x_libraries to the
-# paths, otherwise set no_x=yes.
-# Uses ac_ vars as temps to allow command line to override cache and checks.
-# --without-x overrides everything else, but does not touch the cache.
-echo $ac_n "checking for X""... $ac_c" 1>&6
-echo "configure:540: checking for X" >&5
+Defaults for the options are specified in brackets.
 
+Configuration:
+  -h, --help              display this help and exit
+      --help=short        display options specific to this package
+      --help=recursive    display the short help of all the included packages
+  -V, --version           display version information and exit
+  -q, --quiet, --silent   do not print \`checking...' messages
+      --cache-file=FILE   cache test results in FILE [disabled]
+  -C, --config-cache      alias for \`--cache-file=config.cache'
+  -n, --no-create         do not create output files
+      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
 
-# Check whether --with-x or --without-x was given.
-if test "${with_x+set}" = set; then
-  withval="$with_x"
-  :
-fi
+EOF
 
-# $have_x is `yes', `no', `disabled', or empty when we do not yet know.
-if test "x$with_x" = xno; then
-  # The user explicitly disabled X.
-  have_x=disabled
-else
-  if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
-    # Both variables are already set.
-    have_x=yes
-  else
-if eval "test \"`echo '$''{'ac_cv_have_x'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  # One or both of the vars are not set, and there is no cached value.
-ac_x_includes=NO ac_x_libraries=NO
-rm -fr conftestdir
-if mkdir conftestdir; then
-  cd conftestdir
-  # Make sure to not put "make" in the Imakefile rules, since we grep it out.
-  cat > Imakefile <<'EOF'
-acfindx:
-	@echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
+  cat <<EOF
+Installation directories:
+  --prefix=PREFIX         install architecture-independent files in PREFIX
+                          [$ac_default_prefix]
+  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
+                          [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+  --bindir=DIR            user executables [EPREFIX/bin]
+  --sbindir=DIR           system admin executables [EPREFIX/sbin]
+  --libexecdir=DIR        program executables [EPREFIX/libexec]
+  --datadir=DIR           read-only architecture-independent data [PREFIX/share]
+  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
+  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
+  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
+  --libdir=DIR            object code libraries [EPREFIX/lib]
+  --includedir=DIR        C header files [PREFIX/include]
+  --oldincludedir=DIR     C header files for non-gcc [/usr/include]
+  --infodir=DIR           info documentation [PREFIX/info]
+  --mandir=DIR            man documentation [PREFIX/man]
 EOF
-  if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
-    # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
-    eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
-    # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
-    for ac_extension in a so sl; do
-      if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
-        test -f $ac_im_libdir/libX11.$ac_extension; then
-        ac_im_usrlibdir=$ac_im_libdir; break
-      fi
-    done
-    # Screen out bogus values from the imake configuration.  They are
-    # bogus both because they are the default anyway, and because
-    # using them would break gcc on systems where it needs fixed includes.
-    case "$ac_im_incroot" in
-	/usr/include) ;;
-	*) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes="$ac_im_incroot" ;;
-    esac
-    case "$ac_im_usrlibdir" in
-	/usr/lib | /lib) ;;
-	*) test -d "$ac_im_usrlibdir" && ac_x_libraries="$ac_im_usrlibdir" ;;
-    esac
-  fi
-  cd ..
-  rm -fr conftestdir
-fi
 
-if test "$ac_x_includes" = NO; then
-  # Guess where to find include files, by looking for this one X11 .h file.
-  test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
+  cat <<\EOF
 
-  # First, try using that file with no special directory specified.
-cat > conftest.$ac_ext <<EOF
-#line 603 "configure"
-#include "confdefs.h"
-#include <$x_direct_test_include>
+Program names:
+  --program-prefix=PREFIX            prepend PREFIX to installed program names
+  --program-suffix=SUFFIX            append SUFFIX to installed program names
+  --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
+
+X features:
+  --x-includes=DIR    X include files are in DIR
+  --x-libraries=DIR   X library files are in DIR
+
+System types:
+  --build=BUILD           configure for building on BUILD [guessed]
+  --host=HOST       build programs to run on HOST [BUILD]
 EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:608: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  # We can compile using X headers with no special include directory.
-ac_x_includes=
-else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  # Look for the header file in a standard set of common directories.
-# Check X11 before X11Rn because it is often a symlink to the current release.
-  for ac_dir in               \
-    /usr/X11/include          \
-    /usr/X11R6/include        \
-    /usr/X11R5/include        \
-    /usr/X11R4/include        \
-                              \
-    /usr/include/X11          \
-    /usr/include/X11R6        \
-    /usr/include/X11R5        \
-    /usr/include/X11R4        \
-                              \
-    /usr/local/X11/include    \
-    /usr/local/X11R6/include  \
-    /usr/local/X11R5/include  \
-    /usr/local/X11R4/include  \
-                              \
-    /usr/local/include/X11    \
-    /usr/local/include/X11R6  \
-    /usr/local/include/X11R5  \
-    /usr/local/include/X11R4  \
-                              \
-    /usr/X386/include         \
-    /usr/x386/include         \
-    /usr/XFree86/include/X11  \
-                              \
-    /usr/include              \
-    /usr/local/include        \
-    /usr/unsupported/include  \
-    /usr/athena/include       \
-    /usr/local/x11r5/include  \
-    /usr/lpp/Xamples/include  \
-                              \
-    /usr/openwin/include      \
-    /usr/openwin/share/include \
-    ; \
-  do
-    if test -r "$ac_dir/$x_direct_test_include"; then
-      ac_x_includes=$ac_dir
-      break
-    fi
-  done
 fi
-rm -f conftest*
-fi # $ac_x_includes = NO
 
-if test "$ac_x_libraries" = NO; then
-  # Check for the libraries.
+if test -n "$ac_init_help"; then
 
-  test -z "$x_direct_test_library" && x_direct_test_library=Xt
-  test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
+  cat <<\EOF
 
-  # See if we find them without any special options.
-  # Don't add to $LIBS permanently.
-  ac_save_LIBS="$LIBS"
-  LIBS="-l$x_direct_test_library $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 677 "configure"
-#include "confdefs.h"
+Optional Features:
+  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
+  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
+
+Optional Packages:
+  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+
+  --disable-echo          display "compiling" commands
+  --enable-warnings       test: turn on gcc compiler warnings
+  --with-dmalloc          test: use Gray Watson's dmalloc library
+  --with-dbmalloc         test: use Conor Cahill's dbmalloc library
+  --with-valgrind         test: use valgrind
+  --disable-leaks         test: free permanent memory, analyze leaks
+  --with-curses-dir=DIR   directory in which (n)curses is installed
+  --with-5lib             use SunOS sysv-libraries
+  --with-ncursesw         use wide ncurses-libraries (installed)
+  --with-ncurses          use ncurses-libraries (installed)
+  --with-pdcurses         compile/link with pdcurses X11 library
+  --with-Xaw3d            link with Xaw 3d library
+  --with-neXtaw           link with neXT Athena library
+  --with-XawPlus          link with Athena-Plus library
+  --with-pkg-config{=path} enable/disable use of pkg-config
+  --with-x                use the X Window System
+  --with-ncurses-wrap-prefix naming-prefix for ncurses wrapped-variables
+
+Some influential environment variables:
+  CC          C compiler command
+  CFLAGS      C compiler flags
+  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
+              nonstandard directory <lib dir>
+  CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
+              headers in a nonstandard directory <include dir>
+  CPP         C preprocessor
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
 
-int main() {
-${x_direct_test_function}()
-; return 0; }
 EOF
-if { (eval echo configure:684: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  LIBS="$ac_save_LIBS"
-# We can link X programs with no special library path.
-ac_x_libraries=
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  LIBS="$ac_save_LIBS"
-# First see if replacing the include by lib works.
-# Check X11 before X11Rn because it is often a symlink to the current release.
-for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \
-    /usr/X11/lib          \
-    /usr/X11R6/lib        \
-    /usr/X11R5/lib        \
-    /usr/X11R4/lib        \
-                          \
-    /usr/lib/X11          \
-    /usr/lib/X11R6        \
-    /usr/lib/X11R5        \
-    /usr/lib/X11R4        \
-                          \
-    /usr/local/X11/lib    \
-    /usr/local/X11R6/lib  \
-    /usr/local/X11R5/lib  \
-    /usr/local/X11R4/lib  \
-                          \
-    /usr/local/lib/X11    \
-    /usr/local/lib/X11R6  \
-    /usr/local/lib/X11R5  \
-    /usr/local/lib/X11R4  \
-                          \
-    /usr/X386/lib         \
-    /usr/x386/lib         \
-    /usr/XFree86/lib/X11  \
-                          \
-    /usr/lib              \
-    /usr/local/lib        \
-    /usr/unsupported/lib  \
-    /usr/athena/lib       \
-    /usr/local/x11r5/lib  \
-    /usr/lpp/Xamples/lib  \
-    /lib/usr/lib/X11	  \
-                          \
-    /usr/openwin/lib      \
-    /usr/openwin/share/lib \
-    ; \
-do
-  for ac_extension in a so sl; do
-    if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
-      ac_x_libraries=$ac_dir
-      break 2
+fi
+
+if test "$ac_init_help" = "recursive"; then
+  # If there are subdirs, report their specific --help.
+  ac_popdir=`pwd`
+  for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
+    cd $ac_subdir
+    # A "../" for each directory in /$ac_subdir.
+    ac_dots=`echo $ac_subdir |
+             sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
+
+    case $srcdir in
+    .) # No --srcdir option.  We are building in place.
+      ac_sub_srcdir=$srcdir ;;
+    [\\/]* | ?:[\\/]* ) # Absolute path.
+      ac_sub_srcdir=$srcdir/$ac_subdir ;;
+    *) # Relative path.
+      ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;;
+    esac
+
+    # Check for guested configure; otherwise get Cygnus style configure.
+    if test -f $ac_sub_srcdir/configure.gnu; then
+      echo
+      $SHELL $ac_sub_srcdir/configure.gnu  --help=recursive
+    elif test -f $ac_sub_srcdir/configure; then
+      echo
+      $SHELL $ac_sub_srcdir/configure  --help=recursive
+    elif test -f $ac_sub_srcdir/configure.ac ||
+           test -f $ac_sub_srcdir/configure.in; then
+      echo
+      $ac_configure --help
+    else
+      echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
     fi
+    cd $ac_popdir
   done
-done
 fi
-rm -f conftest*
-fi # $ac_x_libraries = NO
 
-if test "$ac_x_includes" = NO || test "$ac_x_libraries" = NO; then
-  # Didn't find X anywhere.  Cache the known absence of X.
-  ac_cv_have_x="have_x=no"
-else
-  # Record where we found X for the cache.
-  ac_cv_have_x="have_x=yes \
-	        ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
-fi
+test -n "$ac_init_help" && exit 0
+if $ac_init_version; then
+  cat <<\EOF
+
+Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
+Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+EOF
+  exit 0
 fi
-  fi
-  eval "$ac_cv_have_x"
-fi # $with_x != no
+exec 5>config.log
+cat >&5 <<EOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
 
-if test "$have_x" != yes; then
-  echo "$ac_t""$have_x" 1>&6
-  no_x=yes
-else
-  # If each of the values was on the command line, it overrides each guess.
-  test "x$x_includes" = xNONE && x_includes=$ac_x_includes
-  test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
-  # Update the cache value to reflect the command line values.
-  ac_cv_have_x="have_x=yes \
-		ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
-  echo "$ac_t""libraries $x_libraries, headers $x_includes" 1>&6
-fi
+It was created by $as_me, which was
+generated by GNU Autoconf 2.52.20101001.  Invocation command line was
 
+  $ $0 $@
 
+EOF
+{
+cat <<_ASUNAME
+## ---------- ##
+## Platform.  ##
+## ---------- ##
 
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
 
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
 
-test -f config.guess || ( test -f ../config.guess && cp ../config.guess ./ )
+/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
+/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
+/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
+/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
+/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
 
+PATH = $PATH
 
-test -f config.sub || ( test -f ../config.sub && cp ../config.sub ./ )
+_ASUNAME
+} >&5
 
-ac_aux_dir=
-for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
-  if test -f $ac_dir/install-sh; then
-    ac_aux_dir=$ac_dir
-    ac_install_sh="$ac_aux_dir/install-sh -c"
-    break
-  elif test -f $ac_dir/install.sh; then
-    ac_aux_dir=$ac_dir
-    ac_install_sh="$ac_aux_dir/install.sh -c"
-    break
-  fi
-done
-if test -z "$ac_aux_dir"; then
-  { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
-fi
-ac_config_guess=$ac_aux_dir/config.guess
-ac_config_sub=$ac_aux_dir/config.sub
-ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
+cat >&5 <<EOF
+## ------------ ##
+## Core tests.  ##
+## ------------ ##
 
+EOF
 
-if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
-	
-# Make sure we can run config.sub.
-if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
-else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
-fi
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Also quote any args containing shell meta-characters.
+ac_configure_args=
+ac_sep=
+for ac_arg
+do
+  case $ac_arg in
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c) ;;
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
+  *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+    ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
+    ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
+    ac_sep=" " ;;
+  *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
+     ac_sep=" " ;;
+  esac
+  # Get rid of the leading space.
+done
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log.  We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+trap 'exit_status=$?
+  # Save into config.log some information that might help in debugging.
+  echo >&5
+  echo "## ----------------- ##" >&5
+  echo "## Cache variables.  ##" >&5
+  echo "## ----------------- ##" >&5
+  echo >&5
+  # The following way of writing the cache mishandles newlines in values,
+{
+  (set) 2>&1 |
+    case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
+    *ac_space=\ *)
+      sed -n \
+        "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
+    	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
+      ;;
+    *)
+      sed -n \
+        "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+      ;;
+    esac;
+} >&5
+  sed "/^$/d" confdefs.h >conftest.log
+  if test -s conftest.log; then
+    echo >&5
+    echo "## ------------ ##" >&5
+    echo "## confdefs.h.  ##" >&5
+    echo "## ------------ ##" >&5
+    echo >&5
+    cat conftest.log >&5
+  fi
+  (echo; echo) >&5
+  test "$ac_signal" != 0 &&
+    echo "$as_me: caught signal $ac_signal" >&5
+  echo "$as_me: exit $exit_status" >&5
+  rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
+    exit $exit_status
+     ' 0
+for ac_signal in 1 2 13 15; do
+  trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo >confdefs.h
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$CONFIG_SITE"; then
+  if test "x$prefix" != xNONE; then
+    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+  else
+    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+  fi
+fi
+for ac_site_file in $CONFIG_SITE; do
+  if test -r "$ac_site_file"; then
+    { echo "$as_me:894: loading site script $ac_site_file" >&5
+echo "$as_me: loading site script $ac_site_file" >&6;}
+    cat "$ac_site_file" >&5
+    . "$ac_site_file"
+  fi
+done
+
+if test -r "$cache_file"; then
+  # Some versions of bash will fail to source /dev/null (special
+  # files actually), so we avoid doing that.
+  if test -f "$cache_file"; then
+    { echo "$as_me:905: loading cache $cache_file" >&5
+echo "$as_me: loading cache $cache_file" >&6;}
+    case $cache_file in
+      [\\/]* | ?:[\\/]* ) . $cache_file;;
+      *)                      . ./$cache_file;;
+    esac
+  fi
+else
+  { echo "$as_me:913: creating cache $cache_file" >&5
+echo "$as_me: creating cache $cache_file" >&6;}
+  >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in `(set) 2>&1 |
+               sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
+  eval ac_old_set=\$ac_cv_env_${ac_var}_set
+  eval ac_new_set=\$ac_env_${ac_var}_set
+  eval ac_old_val="\$ac_cv_env_${ac_var}_value"
+  eval ac_new_val="\$ac_env_${ac_var}_value"
+  case $ac_old_set,$ac_new_set in
+    set,)
+      { echo "$as_me:929: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,set)
+      { echo "$as_me:933: error: \`$ac_var' was not set in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,);;
+    *)
+      if test "x$ac_old_val" != "x$ac_new_val"; then
+        { echo "$as_me:939: error: \`$ac_var' has changed since the previous run:" >&5
+echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+        { echo "$as_me:941:   former value:  $ac_old_val" >&5
+echo "$as_me:   former value:  $ac_old_val" >&2;}
+        { echo "$as_me:943:   current value: $ac_new_val" >&5
+echo "$as_me:   current value: $ac_new_val" >&2;}
+        ac_cache_corrupted=:
+      fi;;
+  esac
+  # Pass precious variables to config.status.  It doesn't matter if
+  # we pass some twice (in addition to the command line arguments).
+  if test "$ac_new_set" = set; then
+    case $ac_new_val in
+    *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+      ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
+      ac_configure_args="$ac_configure_args '$ac_arg'"
+      ;;
+    *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
+       ;;
+    esac
+  fi
+done
+if $ac_cache_corrupted; then
+  { echo "$as_me:962: error: changes in the environment can compromise the build" >&5
+echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+  { { echo "$as_me:964: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+ac_main_return=return
+
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+  *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T='	' ;;
+  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+  *)      ECHO_N= ECHO_C='\c' ECHO_T= ;;
+esac
+echo "#! $SHELL" >conftest.sh
+echo  "exit 0"   >>conftest.sh
+chmod +x conftest.sh
+if { (echo "$as_me:985: PATH=\".;.\"; conftest.sh") >&5
+  (PATH=".;."; conftest.sh) 2>&5
+  ac_status=$?
+  echo "$as_me:988: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  ac_path_separator=';'
+else
+  ac_path_separator=:
+fi
+PATH_SEPARATOR="$ac_path_separator"
+rm -f conftest.sh
+
+ac_config_headers="$ac_config_headers ncurses_cfg.h:ncurses_tst.hin"
+
+test -f config.guess || ( test -f ../config.guess && cp ../config.guess ./ )
+
+test -f config.sub || ( test -f ../config.sub && cp ../config.sub ./ )
+
+ac_aux_dir=
+for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
+  if test -f $ac_dir/install-sh; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install-sh -c"
+    break
+  elif test -f $ac_dir/install.sh; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install.sh -c"
+    break
+  elif test -f $ac_dir/shtool; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/shtool install -c"
+    break
+  fi
+done
+if test -z "$ac_aux_dir"; then
+  { { echo "$as_me:1020: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
+echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"
+ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
 
-echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:807: checking host system type" >&5
+# Make sure we can run config.sub.
+$ac_config_sub sun4 >/dev/null 2>&1 ||
+  { { echo "$as_me:1030: error: cannot run $ac_config_sub" >&5
+echo "$as_me: error: cannot run $ac_config_sub" >&2;}
+   { (exit 1); exit 1; }; }
+
+echo "$as_me:1034: checking build system type" >&5
+echo $ECHO_N "checking build system type... $ECHO_C" >&6
+if test "${ac_cv_build+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_build_alias=$build_alias
+test -z "$ac_cv_build_alias" &&
+  ac_cv_build_alias=`$ac_config_guess`
+test -z "$ac_cv_build_alias" &&
+  { { echo "$as_me:1043: error: cannot guess build type; you must specify one" >&5
+echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
+   { (exit 1); exit 1; }; }
+ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
+  { { echo "$as_me:1047: error: $ac_config_sub $ac_cv_build_alias failed." >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
+   { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:1052: result: $ac_cv_build" >&5
+echo "${ECHO_T}$ac_cv_build" >&6
+build=$ac_cv_build
+build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
 
-host_alias=$host
-case "$host_alias" in
-NONE)
-  case $nonopt in
-  NONE)
-    if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
-    else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
-    fi ;;
-  *) host_alias=$nonopt ;;
-  esac ;;
-esac
-
-host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
-host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-echo "$ac_t""$host" 1>&6
+if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
+	echo "$as_me:1060: checking host system type" >&5
+echo $ECHO_N "checking host system type... $ECHO_C" >&6
+if test "${ac_cv_host+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_host_alias=$host_alias
+test -z "$ac_cv_host_alias" &&
+  ac_cv_host_alias=$ac_cv_build_alias
+ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
+  { { echo "$as_me:1069: error: $ac_config_sub $ac_cv_host_alias failed" >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:1074: result: $ac_cv_host" >&5
+echo "${ECHO_T}$ac_cv_host" >&6
+host=$ac_cv_host
+host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
 
 	system_name="$host_os"
 else
@@ -830,261 +1085,643 @@
 		system_name="`(hostname) 2>/dev/null`"
 	fi
 fi
-test -n "$system_name" && cat >> confdefs.h <<EOF
+test -n "$system_name" && cat >>confdefs.h <<EOF
 #define SYSTEM_NAME "$system_name"
 EOF
 
-if eval "test \"`echo '$''{'cf_cv_system_name'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+if test "${cf_cv_system_name+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cf_cv_system_name="$system_name"
 fi
 
-
 test -z "$system_name" && system_name="$cf_cv_system_name"
-test -n "$cf_cv_system_name" && echo "$ac_t""Configuring for $cf_cv_system_name" 1>&6
+test -n "$cf_cv_system_name" && echo "$as_me:1099: result: Configuring for $cf_cv_system_name" >&5
+echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
 
 if test ".$system_name" != ".$cf_cv_system_name" ; then
-	echo "$ac_t""Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" 1>&6
-	{ echo "configure: error: "Please remove config.cache and try again."" 1>&2; exit 1; }
-fi
-
-
-echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:855: checking whether ${MAKE-make} sets \${MAKE}" >&5
-set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+	echo "$as_me:1103: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
+echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
+	{ { echo "$as_me:1105: error: \"Please remove config.cache and try again.\"" >&5
+echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+test "$program_prefix" != NONE &&
+  program_transform_name="s,^,$program_prefix,;$program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+  program_transform_name="s,\$,$program_suffix,;$program_transform_name"
+# Double any \ or $.  echo might interpret backslashes.
+# By default was `s,x,x', remove it if useless.
+cat <<\_ACEOF >conftest.sed
+s/[\\$]/&&/g;s/;s,x,x,$//
+_ACEOF
+program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
+rm conftest.sed
+
+echo "$as_me:1123: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
+set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
+if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftestmake <<\EOF
+  cat >conftest.make <<\EOF
 all:
 	@echo 'ac_maketemp="${MAKE}"'
 EOF
 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
-eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
+eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
 if test -n "$ac_maketemp"; then
   eval ac_cv_prog_make_${ac_make}_set=yes
 else
   eval ac_cv_prog_make_${ac_make}_set=no
 fi
-rm -f conftestmake
+rm -f conftest.make
 fi
 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
+  echo "$as_me:1143: result: yes" >&5
+echo "${ECHO_T}yes" >&6
   SET_MAKE=
 else
-  echo "$ac_t""no" 1>&6
+  echo "$as_me:1147: result: no" >&5
+echo "${ECHO_T}no" >&6
   SET_MAKE="MAKE=${MAKE-make}"
 fi
 
-# Extract the first word of "gcc", so it can be a program name with args.
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+ac_main_return=return
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+echo "$as_me:1161: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_CC="${ac_tool_prefix}gcc"
+echo "$as_me:1176: found $ac_dir/$ac_word" >&5
+break
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  echo "$as_me:1184: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+  echo "$as_me:1187: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+  ac_ct_CC=$CC
+  # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:884: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:1196: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_ac_ct_CC="gcc"
+echo "$as_me:1211: found $ac_dir/$ac_word" >&5
+break
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  echo "$as_me:1219: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+  echo "$as_me:1222: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  CC=$ac_ct_CC
+else
+  CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+echo "$as_me:1235: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
-  ac_dummy="$PATH"
-  for ac_dir in $ac_dummy; do
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
-      ac_cv_prog_CC="gcc"
-      break
-    fi
-  done
-  IFS="$ac_save_ifs"
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_CC="${ac_tool_prefix}cc"
+echo "$as_me:1250: found $ac_dir/$ac_word" >&5
+break
+done
+
 fi
 fi
-CC="$ac_cv_prog_CC"
+CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  echo "$ac_t""$CC" 1>&6
+  echo "$as_me:1258: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+  echo "$as_me:1261: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+  ac_ct_CC=$CC
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo "$as_me:1270: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_ac_ct_CC="cc"
+echo "$as_me:1285: found $ac_dir/$ac_word" >&5
+break
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  echo "$as_me:1293: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+  echo "$as_me:1296: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  CC=$ac_ct_CC
 else
-  echo "$ac_t""no" 1>&6
+  CC="$ac_cv_prog_CC"
 fi
 
+fi
 if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:914: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:1309: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
   ac_prog_rejected=no
-  ac_dummy="$PATH"
-  for ac_dir in $ac_dummy; do
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
-      if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
-        ac_prog_rejected=yes
-	continue
-      fi
-      ac_cv_prog_CC="cc"
-      break
-    fi
-  done
-  IFS="$ac_save_ifs"
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  $as_executable_p "$ac_dir/$ac_word" || continue
+if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
+  ac_prog_rejected=yes
+  continue
+fi
+ac_cv_prog_CC="cc"
+echo "$as_me:1329: found $ac_dir/$ac_word" >&5
+break
+done
+
 if test $ac_prog_rejected = yes; then
   # We found a bogon in the path, so make sure we never use it.
   set dummy $ac_cv_prog_CC
   shift
-  if test $# -gt 0; then
+  if test $# != 0; then
     # We chose a different compiler from the bogus one.
     # However, it has the same basename, so the bogon will be chosen
     # first if we set CC to just the basename; use the full file name.
     shift
-    set dummy "$ac_dir/$ac_word" "$@"
+    set dummy "$ac_dir/$ac_word" ${1+"$@"}
     shift
     ac_cv_prog_CC="$@"
   fi
 fi
 fi
 fi
-CC="$ac_cv_prog_CC"
+CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  echo "$ac_t""$CC" 1>&6
+  echo "$as_me:1351: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
 else
-  echo "$ac_t""no" 1>&6
+  echo "$as_me:1354: result: no" >&5
+echo "${ECHO_T}no" >&6
 fi
 
-  if test -z "$CC"; then
-    case "`uname -s`" in
-    *win32* | *WIN32*)
-      # Extract the first word of "cl", so it can be a program name with args.
-set dummy cl; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:965: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+fi
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in cl
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+echo "$as_me:1365: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
-  ac_dummy="$PATH"
-  for ac_dir in $ac_dummy; do
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
-      ac_cv_prog_CC="cl"
-      break
-    fi
-  done
-  IFS="$ac_save_ifs"
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+echo "$as_me:1380: found $ac_dir/$ac_word" >&5
+break
+done
+
 fi
 fi
-CC="$ac_cv_prog_CC"
+CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  echo "$ac_t""$CC" 1>&6
+  echo "$as_me:1388: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
 else
-  echo "$ac_t""no" 1>&6
+  echo "$as_me:1391: result: no" >&5
+echo "${ECHO_T}no" >&6
 fi
- ;;
-    esac
-  fi
-  test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
+
+    test -n "$CC" && break
+  done
+fi
+if test -z "$CC"; then
+  ac_ct_CC=$CC
+  for ac_prog in cl
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:1404: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_ac_ct_CC="$ac_prog"
+echo "$as_me:1419: found $ac_dir/$ac_word" >&5
+break
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  echo "$as_me:1427: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+  echo "$as_me:1430: result: no" >&5
+echo "${ECHO_T}no" >&6
 fi
 
-echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:997: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+  test -n "$ac_ct_CC" && break
+done
 
-ac_ext=c
-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
+  CC=$ac_ct_CC
+fi
+
+fi
 
-cat > conftest.$ac_ext << EOF
+test -z "$CC" && { { echo "$as_me:1442: error: no acceptable cc found in \$PATH" >&5
+echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
+   { (exit 1); exit 1; }; }
+
+# Provide some information about the compiler.
+echo "$as_me:1447:" \
+     "checking for C compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (eval echo "$as_me:1450: \"$ac_compiler --version </dev/null >&5\"") >&5
+  (eval $ac_compiler --version </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:1453: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (eval echo "$as_me:1455: \"$ac_compiler -v </dev/null >&5\"") >&5
+  (eval $ac_compiler -v </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:1458: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (eval echo "$as_me:1460: \"$ac_compiler -V </dev/null >&5\"") >&5
+  (eval $ac_compiler -V </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:1463: \$? = $ac_status" >&5
+  (exit $ac_status); }
 
-#line 1008 "configure"
+cat >conftest.$ac_ext <<_ACEOF
+#line 1467 "configure"
 #include "confdefs.h"
 
-main(){return(0);}
-EOF
-if { (eval echo configure:1013: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  ac_cv_prog_cc_works=yes
-  # If we can't run a trivial program, we are probably using a cross compiler.
-  if (./conftest; exit) 2>/dev/null; then
-    ac_cv_prog_cc_cross=no
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.exe"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+echo "$as_me:1483: checking for C compiler default output" >&5
+echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
+ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+if { (eval echo "$as_me:1486: \"$ac_link_default\"") >&5
+  (eval $ac_link_default) 2>&5
+  ac_status=$?
+  echo "$as_me:1489: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  # Find the output, starting from the most likely.  This scheme is
+# not robust to junk in `.', hence go to wildcards (a.*) only as a last
+# resort.
+for ac_file in `ls a.exe conftest.exe 2>/dev/null;
+                ls a.out conftest 2>/dev/null;
+                ls a.* conftest.* 2>/dev/null`; do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
+    a.out ) # We found the default executable, but exeext='' is most
+            # certainly right.
+            break;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+          # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
+          export ac_cv_exeext
+          break;;
+    * ) break;;
+  esac
+done
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+{ { echo "$as_me:1512: error: C compiler cannot create executables" >&5
+echo "$as_me: error: C compiler cannot create executables" >&2;}
+   { (exit 77); exit 77; }; }
+fi
+
+ac_exeext=$ac_cv_exeext
+echo "$as_me:1518: result: $ac_file" >&5
+echo "${ECHO_T}$ac_file" >&6
+
+# Check the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:1523: checking whether the C compiler works" >&5
+echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
+# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
+# If not cross compiling, check that we can run a simple program.
+if test "$cross_compiling" != yes; then
+  if { ac_try='./$ac_file'
+  { (eval echo "$as_me:1529: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:1532: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+    cross_compiling=no
   else
-    ac_cv_prog_cc_cross=yes
+    if test "$cross_compiling" = maybe; then
+	cross_compiling=yes
+    else
+	{ { echo "$as_me:1539: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'." >&5
+echo "$as_me: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'." >&2;}
+   { (exit 1); exit 1; }; }
+    fi
   fi
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  ac_cv_prog_cc_works=no
 fi
-rm -fr conftest*
-ac_ext=c
-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
+echo "$as_me:1547: result: yes" >&5
+echo "${ECHO_T}yes" >&6
 
-echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
-if test $ac_cv_prog_cc_works = no; then
-  { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
+rm -f a.out a.exe conftest$ac_cv_exeext
+ac_clean_files=$ac_clean_files_save
+# Check the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:1554: checking whether we are cross compiling" >&5
+echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
+echo "$as_me:1556: result: $cross_compiling" >&5
+echo "${ECHO_T}$cross_compiling" >&6
+
+echo "$as_me:1559: checking for executable suffix" >&5
+echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
+if { (eval echo "$as_me:1561: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:1564: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+          export ac_cv_exeext
+          break;;
+    * ) break;;
+  esac
+done
+else
+  { { echo "$as_me:1580: error: cannot compute EXEEXT: cannot compile and link" >&5
+echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
+   { (exit 1); exit 1; }; }
 fi
-echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1039: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
-echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
-cross_compiling=$ac_cv_prog_cc_cross
 
-echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1044: checking whether we are using GNU C" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+rm -f conftest$ac_cv_exeext
+echo "$as_me:1586: result: $ac_cv_exeext" >&5
+echo "${ECHO_T}$ac_cv_exeext" >&6
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+echo "$as_me:1592: checking for object suffix" >&5
+echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
+if test "${ac_cv_objext+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.c <<EOF
-#ifdef __GNUC__
-  yes;
-#endif
-EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1053: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
-  ac_cv_prog_gcc=yes
+  cat >conftest.$ac_ext <<_ACEOF
+#line 1598 "configure"
+#include "confdefs.h"
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { (eval echo "$as_me:1610: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:1613: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
+    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+       break;;
+  esac
+done
 else
-  ac_cv_prog_gcc=no
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+{ { echo "$as_me:1625: error: cannot compute OBJEXT: cannot compile" >&5
+echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
+   { (exit 1); exit 1; }; }
 fi
+
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
 fi
+echo "$as_me:1632: result: $ac_cv_objext" >&5
+echo "${ECHO_T}$ac_cv_objext" >&6
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+echo "$as_me:1636: checking whether we are using the GNU C compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
+if test "${ac_cv_c_compiler_gnu+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 1642 "configure"
+#include "confdefs.h"
 
-echo "$ac_t""$ac_cv_prog_gcc" 1>&6
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
 
-if test $ac_cv_prog_gcc = yes; then
-  GCC=yes
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:1657: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:1660: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:1663: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:1666: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_compiler_gnu=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_compiler_gnu=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+echo "$as_me:1678: result: $ac_cv_c_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
+GCC=`test $ac_compiler_gnu = yes && echo yes`
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+CFLAGS="-g"
+echo "$as_me:1684: checking whether $CC accepts -g" >&5
+echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_g+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  GCC=
-fi
+  cat >conftest.$ac_ext <<_ACEOF
+#line 1690 "configure"
+#include "confdefs.h"
 
-ac_test_CFLAGS="${CFLAGS+set}"
-ac_save_CFLAGS="$CFLAGS"
-CFLAGS=
-echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1072: checking whether ${CC-cc} accepts -g" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  echo 'void f(){}' > conftest.c
-if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:1702: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:1705: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:1708: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:1711: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_prog_cc_g=yes
 else
-  ac_cv_prog_cc_g=no
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_prog_cc_g=no
 fi
-rm -f conftest*
-
+rm -f conftest.$ac_objext conftest.$ac_ext
 fi
-
-echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
+echo "$as_me:1721: result: $ac_cv_prog_cc_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
 if test "$ac_test_CFLAGS" = set; then
-  CFLAGS="$ac_save_CFLAGS"
+  CFLAGS=$ac_save_CFLAGS
 elif test $ac_cv_prog_cc_g = yes; then
   if test "$GCC" = yes; then
     CFLAGS="-g -O2"
@@ -1098,280 +1735,748 @@
     CFLAGS=
   fi
 fi
+# Some people use a C++ compiler to compile C.  Since we use `exit',
+# in C++ we need to declare it.  In case someone uses the same compiler
+# for both compiling C and C++ we need to have the C++ compiler decide
+# the declaration of exit, since it's the most demanding environment.
+cat >conftest.$ac_ext <<_ACEOF
+#ifndef __cplusplus
+  choke me
+#endif
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:1748: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:1751: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:1754: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:1757: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  for ac_declaration in \
+   ''\
+   '#include <stdlib.h>' \
+   'extern "C" void std::exit (int) throw (); using std::exit;' \
+   'extern "C" void std::exit (int); using std::exit;' \
+   'extern "C" void exit (int) throw ();' \
+   'extern "C" void exit (int);' \
+   'void exit (int);'
+do
+  cat >conftest.$ac_ext <<_ACEOF
+#line 1769 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+$ac_declaration
+int
+main ()
+{
+exit (42);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:1782: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:1785: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:1788: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:1791: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+continue
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+  cat >conftest.$ac_ext <<_ACEOF
+#line 1801 "configure"
+#include "confdefs.h"
+$ac_declaration
+int
+main ()
+{
+exit (42);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:1813: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:1816: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:1819: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:1822: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  break
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+done
+rm -rf conftest*
+if test -n "$ac_declaration"; then
+  echo '#ifdef __cplusplus' >>confdefs.h
+  echo $ac_declaration      >>confdefs.h
+  echo '#endif'             >>confdefs.h
+fi
+
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+ac_main_return=return
 
-echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1104: checking how to run the C preprocessor" >&5
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+ac_main_return=return
+echo "$as_me:1856: checking how to run the C preprocessor" >&5
+echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
 fi
 if test -z "$CPP"; then
-if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+  if test "${ac_cv_prog_CPP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-    # This must be in double quotes, not single quotes, because CPP may get
-  # substituted into the Makefile and "${CC-cc}" will confuse make.
-  CPP="${CC-cc} -E"
+      # Double quotes because CPP needs to be expanded
+    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
   # On the NeXT, cc -E runs the code through the compiler's parser,
-  # not just through cpp.
-  cat > conftest.$ac_ext <<EOF
-#line 1119 "configure"
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+#line 1877 "configure"
 #include "confdefs.h"
 #include <assert.h>
-Syntax Error
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1125: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  :
+                     Syntax error
+_ACEOF
+if { (eval echo "$as_me:1882: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  egrep -v '^ *\+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:1888: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
 else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  CPP="${CC-cc} -E -traditional-cpp"
-  cat > conftest.$ac_ext <<EOF
-#line 1136 "configure"
-#include "confdefs.h"
-#include <assert.h>
-Syntax Error
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1142: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
   :
 else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
+  echo "$as_me: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  CPP="${CC-cc} -nologo -E"
-  cat > conftest.$ac_ext <<EOF
-#line 1153 "configure"
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether non-existent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+#line 1911 "configure"
 #include "confdefs.h"
-#include <assert.h>
-Syntax Error
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1159: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  :
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:1915: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  egrep -v '^ *\+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:1921: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
 else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  CPP=/lib/cpp
+  ac_cpp_err=yes
 fi
-rm -f conftest*
+if test -z "$ac_cpp_err"; then
+  # Broken: success on invalid input.
+continue
+else
+  echo "$as_me: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  # Passes both tests.
+ac_preproc_ok=:
+break
 fi
-rm -f conftest*
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  break
 fi
-rm -f conftest*
-  ac_cv_prog_CPP="$CPP"
+
+    done
+    ac_cv_prog_CPP=$CPP
+
 fi
-  CPP="$ac_cv_prog_CPP"
+  CPP=$ac_cv_prog_CPP
 else
-  ac_cv_prog_CPP="$CPP"
+  ac_cv_prog_CPP=$CPP
 fi
-echo "$ac_t""$CPP" 1>&6
-
-for ac_prog in mawk gawk nawk awk
+echo "$as_me:1958: result: $CPP" >&5
+echo "${ECHO_T}$CPP" >&6
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
 do
-# Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1188: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+#line 1968 "configure"
+#include "confdefs.h"
+#include <assert.h>
+                     Syntax error
+_ACEOF
+if { (eval echo "$as_me:1973: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  egrep -v '^ *\+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:1979: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
 else
-  if test -n "$AWK"; then
-  ac_cv_prog_AWK="$AWK" # Let the user override the test.
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  :
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
-  ac_dummy="$PATH"
-  for ac_dir in $ac_dummy; do
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
-      ac_cv_prog_AWK="$ac_prog"
-      break
-    fi
-  done
-  IFS="$ac_save_ifs"
+  echo "$as_me: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether non-existent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+#line 2002 "configure"
+#include "confdefs.h"
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:2006: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  egrep -v '^ *\+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:2012: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  # Broken: success on invalid input.
+continue
+else
+  echo "$as_me: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  :
+else
+  { { echo "$as_me:2040: error: C preprocessor \"$CPP\" fails sanity check" >&5
+echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+ac_main_return=return
+
+for ac_prog in mawk gawk nawk awk
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:2056: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_AWK+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$AWK"; then
+  ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_AWK="$ac_prog"
+echo "$as_me:2071: found $ac_dir/$ac_word" >&5
+break
+done
+
 fi
 fi
-AWK="$ac_cv_prog_AWK"
+AWK=$ac_cv_prog_AWK
 if test -n "$AWK"; then
-  echo "$ac_t""$AWK" 1>&6
+  echo "$as_me:2079: result: $AWK" >&5
+echo "${ECHO_T}$AWK" >&6
 else
-  echo "$ac_t""no" 1>&6
+  echo "$as_me:2082: result: no" >&5
+echo "${ECHO_T}no" >&6
 fi
 
-test -n "$AWK" && break
+  test -n "$AWK" && break
 done
 
+# Find a good install program.  We prefer a C program (faster),
+# so one script is as good as another.  But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# ./install, which can be erroneously created by make from ./install.sh.
+echo "$as_me:2101: checking for a BSD compatible install" >&5
+echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+    ac_save_IFS=$IFS; IFS=$ac_path_separator
+  for ac_dir in $PATH; do
+    IFS=$ac_save_IFS
+    # Account for people who put trailing slashes in PATH elements.
+    case $ac_dir/ in
+    / | ./ | .// | /cC/* \
+    | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
+    | /usr/ucb/* ) ;;
+    *)
+      # OSF1 and SCO ODT 3.0 have their own names for install.
+      # Don't use installbsd from OSF since it installs stuff as root
+      # by default.
+      for ac_prog in ginstall scoinst install; do
+        if $as_executable_p "$ac_dir/$ac_prog"; then
+	  if test $ac_prog = install &&
+            grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
+	    # AIX install.  It has an incompatible calling convention.
+	    :
+	  elif test $ac_prog = install &&
+	    grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
+	    # program-specific install script used by HP pwplus--don't use.
+	    :
+	  else
+	    ac_cv_path_install="$ac_dir/$ac_prog -c"
+	    break 2
+	  fi
+	fi
+      done
+      ;;
+    esac
+  done
+
+fi
+  if test "${ac_cv_path_install+set}" = set; then
+    INSTALL=$ac_cv_path_install
+  else
+    # As a last resort, use the slow shell script.  We don't cache a
+    # path for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the path is relative.
+    INSTALL=$ac_install_sh
+  fi
+fi
+echo "$as_me:2150: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&6
 
-CC_G_OPT="-g"					
-CC_SHARED_OPTS=unknown			
-CPPFLAGS="$CPPFLAGS"			
-DFT_DEP_SUFFIX=""				
-DFT_OBJ_SUBDIR=`pwd|sed -e's:.*/::'`	
-DFT_UPR_MODEL="NORMAL"			
-LD="ld"							
-LDFLAGS_SHARED=""				
-LDFLAGS_STATIC=""				
-LD_MODEL=""						
-LD_SHARED_OPTS=""				
-LIBTOOL=""						
-LIB_CLEAN=""					
-LIB_COMPILE=""					
-LIB_LINK='${CC}'				
-LINK_TESTS=""					
-LINT=lint						
-LINT_OPTS=""					
-LOCAL_LDFLAGS=""				
-MATH_LIB="-lm"					
-PTHREAD="-lm"					
-TEST_ARGS=""					
-TEST_DEPS=""					
-TEST_LIBS=""					
-TINFO_ARGS='$(LIBS_CURSES)'		
-cf_cv_abi_version=""			
-cf_cv_rel_version=""			
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
 
-cf_cv_screen=curses
-cf_cv_libtype=
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+case $INSTALL in
+/*)
+  ;;
+*)
+  cf_dir=`echo $INSTALL | sed -e 's%/[^/]*$%%'`
+  test -z "$cf_dir" && cf_dir=.
+  INSTALL=`cd $cf_dir && pwd`/`echo $INSTALL | sed -e 's%^.*/%%'`
+  ;;
+esac
+
+for ac_prog in tdlint lint alint splint lclint
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:2175: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_LINT+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$LINT"; then
+  ac_cv_prog_LINT="$LINT" # Let the user override the test.
+else
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_LINT="$ac_prog"
+echo "$as_me:2190: found $ac_dir/$ac_word" >&5
+break
+done
 
-echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
-echo "configure:1250: checking for Cygwin environment" >&5
-if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+fi
+fi
+LINT=$ac_cv_prog_LINT
+if test -n "$LINT"; then
+  echo "$as_me:2198: result: $LINT" >&5
+echo "${ECHO_T}$LINT" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 1255 "configure"
-#include "confdefs.h"
+  echo "$as_me:2201: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
 
-int main() {
+  test -n "$LINT" && break
+done
 
-#ifndef __CYGWIN__
-#define __CYGWIN__ __CYGWIN32__
-#endif
-return __CYGWIN__;
-; return 0; }
-EOF
-if { (eval echo configure:1266: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
-  ac_cv_cygwin=yes
+echo "$as_me:2208: checking if filesystem supports mixed-case filenames" >&5
+echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
+if test "${cf_cv_mixedcase+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_cygwin=no
+
+if test "$cross_compiling" = yes ; then
+	case $target_alias in #(vi
+	*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-mingw32*|*-uwin*) #(vi
+		cf_cv_mixedcase=no
+		;;
+	*)
+		cf_cv_mixedcase=yes
+		;;
+	esac
+else
+	rm -f conftest CONFTEST
+	echo test >conftest
+	if test -f CONFTEST ; then
+		cf_cv_mixedcase=no
+	else
+		cf_cv_mixedcase=yes
+	fi
+	rm -f conftest CONFTEST
 fi
-rm -f conftest*
-rm -f conftest*
+
 fi
+echo "$as_me:2235: result: $cf_cv_mixedcase" >&5
+echo "${ECHO_T}$cf_cv_mixedcase" >&6
+test "$cf_cv_mixedcase" = yes && cat >>confdefs.h <<\EOF
+#define MIXEDCASE_FILENAMES 1
+EOF
+
+for ac_prog in exctags ctags
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:2245: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CTAGS+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CTAGS"; then
+  ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
+else
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_CTAGS="$ac_prog"
+echo "$as_me:2260: found $ac_dir/$ac_word" >&5
+break
+done
 
-echo "$ac_t""$ac_cv_cygwin" 1>&6
-CYGWIN=
-test "$ac_cv_cygwin" = yes && CYGWIN=yes
-echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
-echo "configure:1283: checking for mingw32 environment" >&5
-if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+fi
+fi
+CTAGS=$ac_cv_prog_CTAGS
+if test -n "$CTAGS"; then
+  echo "$as_me:2268: result: $CTAGS" >&5
+echo "${ECHO_T}$CTAGS" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 1288 "configure"
-#include "confdefs.h"
+  echo "$as_me:2271: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
 
-int main() {
-return __MINGW32__;
-; return 0; }
-EOF
-if { (eval echo configure:1295: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
-  ac_cv_mingw32=yes
+  test -n "$CTAGS" && break
+done
+
+for ac_prog in exetags etags
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:2282: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ETAGS+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ETAGS"; then
+  ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
+else
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_ETAGS="$ac_prog"
+echo "$as_me:2297: found $ac_dir/$ac_word" >&5
+break
+done
+
+fi
+fi
+ETAGS=$ac_cv_prog_ETAGS
+if test -n "$ETAGS"; then
+  echo "$as_me:2305: result: $ETAGS" >&5
+echo "${ECHO_T}$ETAGS" >&6
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_mingw32=no
+  echo "$as_me:2308: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  test -n "$ETAGS" && break
+done
+
+# Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
+set dummy ${CTAGS:-ctags}; ac_word=$2
+echo "$as_me:2317: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$MAKE_LOWER_TAGS"; then
+  ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
+else
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_MAKE_LOWER_TAGS="yes"
+echo "$as_me:2332: found $ac_dir/$ac_word" >&5
+break
+done
+
+  test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
 fi
-rm -f conftest*
-rm -f conftest*
 fi
+MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
+if test -n "$MAKE_LOWER_TAGS"; then
+  echo "$as_me:2341: result: $MAKE_LOWER_TAGS" >&5
+echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
+else
+  echo "$as_me:2344: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+if test "$cf_cv_mixedcase" = yes ; then
+	# Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
+set dummy ${ETAGS:-etags}; ac_word=$2
+echo "$as_me:2351: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$MAKE_UPPER_TAGS"; then
+  ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
+else
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_MAKE_UPPER_TAGS="yes"
+echo "$as_me:2366: found $ac_dir/$ac_word" >&5
+break
+done
 
-echo "$ac_t""$ac_cv_mingw32" 1>&6
-MINGW32=
-test "$ac_cv_mingw32" = yes && MINGW32=yes
-
-
-echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:1314: checking for executable suffix" >&5
-if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  if test "$CYGWIN" = yes || test "$MINGW32" = yes; then
-  ac_cv_exeext=.exe
-else
-  rm -f conftest*
-  echo 'int main () { return 0; }' > conftest.$ac_ext
-  ac_cv_exeext=
-  if { (eval echo configure:1324: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
-    for file in conftest.*; do
-      case $file in
-      *.c | *.o | *.obj) ;;
-      *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
-      esac
-    done
-  else
-    { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
-  fi
-  rm -f conftest*
-  test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
+  test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
 fi
 fi
+MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
+if test -n "$MAKE_UPPER_TAGS"; then
+  echo "$as_me:2375: result: $MAKE_UPPER_TAGS" >&5
+echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
+else
+  echo "$as_me:2378: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
 
-EXEEXT=""
-test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
-echo "$ac_t""${ac_cv_exeext}" 1>&6
-ac_exeext=$EXEEXT
+else
+	MAKE_UPPER_TAGS=no
+fi
 
-echo $ac_n "checking for object suffix""... $ac_c" 1>&6
-echo "configure:1345: checking for object suffix" >&5
-if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  rm -f conftest*
-echo 'int i = 1;' > conftest.$ac_ext
-if { (eval echo configure:1351: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  for ac_file in conftest.*; do
-    case $ac_file in
-    *.c) ;;
-    *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
-    esac
-  done
+if test "$MAKE_UPPER_TAGS" = yes ; then
+	MAKE_UPPER_TAGS=
 else
-  { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
+	MAKE_UPPER_TAGS="#"
 fi
-rm -f conftest*
+
+if test "$MAKE_LOWER_TAGS" = yes ; then
+	MAKE_LOWER_TAGS=
+else
+	MAKE_LOWER_TAGS="#"
 fi
 
-echo "$ac_t""$ac_cv_objext" 1>&6
-OBJEXT=$ac_cv_objext
-ac_objext=$ac_cv_objext
+echo "$as_me:2398: checking if -lm needed for math functions" >&5
+echo $ECHO_N "checking if -lm needed for math functions... $ECHO_C" >&6
+if test "${cf_cv_need_libm+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+	cat >conftest.$ac_ext <<_ACEOF
+#line 2405 "configure"
+#include "confdefs.h"
+
+	#include <stdio.h>
+	#include <math.h>
 
+int
+main ()
+{
+double x = rand(); printf("result = %g\n", sin(x))
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:2420: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:2423: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:2426: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:2429: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_need_libm=no
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_need_libm=yes
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:2439: result: $cf_cv_need_libm" >&5
+echo "${ECHO_T}$cf_cv_need_libm" >&6
+if test "$cf_cv_need_libm" = yes
+then
+MATH_LIB=-lm
+fi
 
+CC_G_OPT="-g"
+CC_SHARED_OPTS=unknown
+CPPFLAGS="$CPPFLAGS"
+DFT_DEP_SUFFIX=""
+DFT_OBJ_SUBDIR=`pwd|sed -e's:.*/::'`
+DFT_UPR_MODEL="NORMAL"
+LD="ld"
+LDFLAGS_SHARED=""
+LDFLAGS_STATIC=""
+LD_MODEL=""
+LD_SHARED_OPTS=""
+LIBTOOL=""
+LIB_CLEAN=""
+LIB_COMPILE=""
+LIB_LINK='${CC}'
+LINK_TESTS=""
+LOCAL_LDFLAGS=""
+PTHREAD="-lm"
+TEST_ARGS=""
+TEST_DEPS=""
+TEST_LIBS=""
+TINFO_ARGS='$(LIBS_CURSES)'
+cf_cv_abi_version=""
+cf_cv_rel_version=""
 
-echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
-echo "configure:1371: checking for ${CC-cc} option to accept ANSI C" >&5
-if eval "test \"`echo '$''{'cf_cv_ansi_cc'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+cf_cv_screen=curses
+cf_cv_libtype=
+
+echo "$as_me:2474: checking for ${CC:-cc} option to accept ANSI C" >&5
+echo $ECHO_N "checking for ${CC:-cc} option to accept ANSI C... $ECHO_C" >&6
+if test "${cf_cv_ansi_cc+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  
+
 cf_cv_ansi_cc=no
 cf_save_CFLAGS="$CFLAGS"
 cf_save_CPPFLAGS="$CPPFLAGS"
@@ -1390,7 +2495,7 @@
 	"-Aa -D_HPUX_SOURCE" \
 	-Xc
 do
-	
+
 cf_fix_cppflags=no
 cf_new_cflags=
 cf_new_cppflags=
@@ -1407,8 +2512,8 @@
 			cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
 
 			test "${cf_add_cflags}" != "${cf_tst_cflags}" \
-			&& test -z "${cf_tst_cflags}" \
-			&& cf_fix_cppflags=yes
+				&& test -z "${cf_tst_cflags}" \
+				&& cf_fix_cppflags=yes
 
 			if test $cf_fix_cppflags = yes ; then
 				cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
@@ -1423,6 +2528,16 @@
 		*$cf_add_cflags) #(vi
 			;;
 		*) #(vi
+			case $cf_add_cflags in #(vi
+			-D*)
+				cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
+
+CPPFLAGS=`echo "$CPPFLAGS" | \
+	sed	-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?[ 	]/ /g' \
+		-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?$//g'`
+
+				;;
+			esac
 			cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
 			;;
 		esac
@@ -1438,32 +2553,29 @@
 	cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
 
 	test "${cf_add_cflags}" != "${cf_tst_cflags}" \
-	&& test -z "${cf_tst_cflags}" \
-	&& cf_fix_cppflags=no
+		&& test -z "${cf_tst_cflags}" \
+		&& cf_fix_cppflags=no
 	;;
 esac
 done
 
 if test -n "$cf_new_cflags" ; then
-	
+
 	CFLAGS="$CFLAGS $cf_new_cflags"
 fi
 
 if test -n "$cf_new_cppflags" ; then
-	
-	CPPFLAGS="$cf_new_cppflags $CPPFLAGS"
+
+	CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
 fi
 
 if test -n "$cf_new_extra_cppflags" ; then
-	
+
 	EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
 fi
 
-
-
-
-	cat > conftest.$ac_ext <<EOF
-#line 1467 "configure"
+	cat >conftest.$ac_ext <<_ACEOF
+#line 2578 "configure"
 #include "confdefs.h"
 
 #ifndef CC_HAS_PROTOS
@@ -1472,32 +2584,46 @@
 #endif
 #endif
 
-int main() {
+int
+main ()
+{
 
 	int test (int i, double x);
 	struct s1 {int (*f) (int a);};
 	struct s2 {int (*f) (double a);};
-; return 0; }
-EOF
-if { (eval echo configure:1483: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:2599: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:2602: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:2605: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:2608: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   cf_cv_ansi_cc="$cf_arg"; break
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
 fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
 done
 CFLAGS="$cf_save_CFLAGS"
 CPPFLAGS="$cf_save_CPPFLAGS"
 
 fi
-
-echo "$ac_t""$cf_cv_ansi_cc" 1>&6
+echo "$as_me:2621: result: $cf_cv_ansi_cc" >&5
+echo "${ECHO_T}$cf_cv_ansi_cc" >&6
 
 if test "$cf_cv_ansi_cc" != "no"; then
 if test ".$cf_cv_ansi_cc" != ".-DCC_HAS_PROTOS"; then
-	
+
 cf_fix_cppflags=no
 cf_new_cflags=
 cf_new_cppflags=
@@ -1514,8 +2640,8 @@
 			cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
 
 			test "${cf_add_cflags}" != "${cf_tst_cflags}" \
-			&& test -z "${cf_tst_cflags}" \
-			&& cf_fix_cppflags=yes
+				&& test -z "${cf_tst_cflags}" \
+				&& cf_fix_cppflags=yes
 
 			if test $cf_fix_cppflags = yes ; then
 				cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
@@ -1530,6 +2656,16 @@
 		*$cf_add_cflags) #(vi
 			;;
 		*) #(vi
+			case $cf_add_cflags in #(vi
+			-D*)
+				cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
+
+CPPFLAGS=`echo "$CPPFLAGS" | \
+	sed	-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?[ 	]/ /g' \
+		-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?$//g'`
+
+				;;
+			esac
 			cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
 			;;
 		esac
@@ -1545,48 +2681,49 @@
 	cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
 
 	test "${cf_add_cflags}" != "${cf_tst_cflags}" \
-	&& test -z "${cf_tst_cflags}" \
-	&& cf_fix_cppflags=no
+		&& test -z "${cf_tst_cflags}" \
+		&& cf_fix_cppflags=no
 	;;
 esac
 done
 
 if test -n "$cf_new_cflags" ; then
-	
+
 	CFLAGS="$CFLAGS $cf_new_cflags"
 fi
 
 if test -n "$cf_new_cppflags" ; then
-	
-	CPPFLAGS="$cf_new_cppflags $CPPFLAGS"
+
+	CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
 fi
 
 if test -n "$cf_new_extra_cppflags" ; then
-	
+
 	EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
 fi
 
-
-
-
 else
-	cat >> confdefs.h <<\EOF
+	cat >>confdefs.h <<\EOF
 #define CC_HAS_PROTOS 1
 EOF
 
 fi
 fi
 
-
 if test "$cf_cv_ansi_cc" = "no"; then
-	{ echo "configure: error: Your compiler does not appear to recognize prototypes.
+	{ { echo "$as_me:2714: error: Your compiler does not appear to recognize prototypes.
 You have the following choices:
 	a. adjust your compiler options
 	b. get an up-to-date compiler
-	c. use a wrapper such as unproto" 1>&2; exit 1; }
+	c. use a wrapper such as unproto" >&5
+echo "$as_me: error: Your compiler does not appear to recognize prototypes.
+You have the following choices:
+	a. adjust your compiler options
+	b. get an up-to-date compiler
+	c. use a wrapper such as unproto" >&2;}
+   { (exit 1); exit 1; }; }
 fi
 
-
 if test "$GCC" = yes
 then
 cat > conftest.i <<EOF
@@ -1605,10 +2742,10 @@
 EOF
 if test "$GCC" = yes
 then
-	echo "checking for $CC __attribute__ directives" 1>&6
-echo "configure:1610: checking for $CC __attribute__ directives" >&5
+	{ echo "$as_me:2745: checking for $CC __attribute__ directives..." >&5
+echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
 cat > conftest.$ac_ext <<EOF
-#line 1612 "${as_me-configure}"
+#line 2748 "${as_me:-configure}"
 #include "confdefs.h"
 #include "conftest.h"
 #include "conftest.i"
@@ -1627,28 +2764,68 @@
 extern void foo(void) GCC_NORETURN;
 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
 EOF
+	cf_printf_attribute=no
+	cf_scanf_attribute=no
 	for cf_attribute in scanf printf unused noreturn
 	do
-		
+
 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
 
 		cf_directive="__attribute__(($cf_attribute))"
 		echo "checking for $CC $cf_directive" 1>&5
-		case $cf_attribute in
-		scanf|printf)
-		cat >conftest.h <<EOF
+
+		case $cf_attribute in #(vi
+		printf) #(vi
+			cf_printf_attribute=yes
+			cat >conftest.h <<EOF
+#define GCC_$cf_ATTRIBUTE 1
+EOF
+			;;
+		scanf) #(vi
+			cf_scanf_attribute=yes
+			cat >conftest.h <<EOF
 #define GCC_$cf_ATTRIBUTE 1
 EOF
 			;;
-		*)
-		cat >conftest.h <<EOF
+		*) #(vi
+			cat >conftest.h <<EOF
 #define GCC_$cf_ATTRIBUTE $cf_directive
 EOF
 			;;
 		esac
-		if { (eval echo configure:1650: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-			test -n "$verbose" && echo "$ac_t""... $cf_attribute" 1>&6
+
+		if { (eval echo "$as_me:2797: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:2800: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+			test -n "$verbose" && echo "$as_me:2802: result: ... $cf_attribute" >&5
+echo "${ECHO_T}... $cf_attribute" >&6
 			cat conftest.h >>confdefs.h
+			case $cf_attribute in #(vi
+			printf) #(vi
+				if test "$cf_printf_attribute" = no ; then
+					cat >>confdefs.h <<EOF
+#define GCC_PRINTFLIKE(fmt,var) /* nothing */
+EOF
+				else
+					cat >>confdefs.h <<EOF
+#define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
+EOF
+				fi
+				;;
+			scanf) #(vi
+				if test "$cf_scanf_attribute" = no ; then
+					cat >>confdefs.h <<EOF
+#define GCC_SCANFLIKE(fmt,var) /* nothing */
+EOF
+				else
+					cat >>confdefs.h <<EOF
+#define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
+EOF
+				fi
+				;;
+			esac
 		fi
 	done
 else
@@ -1657,130 +2834,120 @@
 rm -rf conftest*
 fi
 
-
-echo $ac_n "checking if $CC -U and -D options work together""... $ac_c" 1>&6
-echo "configure:1663: checking if $CC -U and -D options work together" >&5
-if eval "test \"`echo '$''{'cf_cv_cc_u_d_options'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  
-	cf_save_CPPFLAGS="$CPPFLAGS"
-	CPPFLAGS="-UU_D_OPTIONS -DU_D_OPTIONS -DD_U_OPTIONS -UD_U_OPTIONS"
-	cat > conftest.$ac_ext <<EOF
-#line 1671 "configure"
-#include "confdefs.h"
-
-int main() {
-
-#ifndef U_D_OPTIONS
-make an undefined-error
-#endif
-#ifdef  D_U_OPTIONS
-make a defined-error
-#endif
-	
-; return 0; }
-EOF
-if { (eval echo configure:1685: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
-  
-	cf_cv_cc_u_d_options=yes
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  
-	cf_cv_cc_u_d_options=no
-fi
-rm -f conftest*
-	CPPFLAGS="$cf_save_CPPFLAGS"
-
-fi
-
-echo "$ac_t""$cf_cv_cc_u_d_options" 1>&6
-
-
-
-
-
 cf_XOPEN_SOURCE=500
 cf_POSIX_C_SOURCE=199506L
+cf_xopen_source=
 
 case $host_os in #(vi
-aix[45]*) #(vi
-	CPPFLAGS="$CPPFLAGS -D_ALL_SOURCE"
+aix[456]*) #(vi
+	cf_xopen_source="-D_ALL_SOURCE"
 	;;
-freebsd*) #(vi
+darwin[0-8].*) #(vi
+	cf_xopen_source="-D_APPLE_C_SOURCE"
+	;;
+darwin*) #(vi
+	cf_xopen_source="-D_DARWIN_C_SOURCE"
+	;;
+freebsd*|dragonfly*) #(vi
 	# 5.x headers associate
 	#	_XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
 	#	_XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
 	cf_POSIX_C_SOURCE=200112L
 	cf_XOPEN_SOURCE=600
-	CPPFLAGS="$CPPFLAGS -D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
+	cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
+	;;
+hpux11*) #(vi
+	cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
 	;;
 hpux*) #(vi
-	CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE"
+	cf_xopen_source="-D_HPUX_SOURCE"
 	;;
 irix[56].*) #(vi
-	CPPFLAGS="$CPPFLAGS -D_SGI_SOURCE"
+	cf_xopen_source="-D_SGI_SOURCE"
 	;;
-linux*|gnu*|k*bsd*-gnu) #(vi
-	
-echo $ac_n "checking if we must define _GNU_SOURCE""... $ac_c" 1>&6
-echo "configure:1731: checking if we must define _GNU_SOURCE" >&5
-if eval "test \"`echo '$''{'cf_cv_gnu_source'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+linux*|gnu*|mint*|k*bsd*-gnu) #(vi
+
+echo "$as_me:2870: checking if we must define _GNU_SOURCE" >&5
+echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
+if test "${cf_cv_gnu_source+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  
-cat > conftest.$ac_ext <<EOF
-#line 1737 "configure"
+
+cat >conftest.$ac_ext <<_ACEOF
+#line 2877 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
-int main() {
+int
+main ()
+{
 
 #ifndef _XOPEN_SOURCE
 make an error
 #endif
-; return 0; }
-EOF
-if { (eval echo configure:1747: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:2892: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:2895: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:2898: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:2901: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   cf_cv_gnu_source=no
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  cf_save="$CPPFLAGS"
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_save="$CPPFLAGS"
 	 CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
-	 cat > conftest.$ac_ext <<EOF
-#line 1757 "configure"
+	 cat >conftest.$ac_ext <<_ACEOF
+#line 2910 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
-int main() {
+int
+main ()
+{
 
 #ifdef _XOPEN_SOURCE
 make an error
 #endif
-; return 0; }
-EOF
-if { (eval echo configure:1767: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:2925: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:2928: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:2931: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:2934: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   cf_cv_gnu_source=no
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  cf_cv_gnu_source=yes
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_gnu_source=yes
 fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
 	CPPFLAGS="$cf_save"
-	
-fi
-rm -f conftest*
 
 fi
+rm -f conftest.$ac_objext conftest.$ac_ext
 
-echo "$ac_t""$cf_cv_gnu_source" 1>&6
+fi
+echo "$as_me:2949: result: $cf_cv_gnu_source" >&5
+echo "${ECHO_T}$cf_cv_gnu_source" >&6
 test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
 
 	;;
@@ -1794,137 +2961,247 @@
 	# setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
 	;;
 osf[45]*) #(vi
-	CPPFLAGS="$CPPFLAGS -D_OSF_SOURCE"
+	cf_xopen_source="-D_OSF_SOURCE"
 	;;
 nto-qnx*) #(vi
-	CPPFLAGS="$CPPFLAGS -D_QNX_SOURCE"
+	cf_xopen_source="-D_QNX_SOURCE"
 	;;
 sco*) #(vi
 	# setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
 	;;
-solaris*) #(vi
-	CPPFLAGS="$CPPFLAGS -D__EXTENSIONS__"
+solaris2.1[0-9]) #(vi
+	cf_xopen_source="-D__EXTENSIONS__ -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
+	;;
+solaris2.[1-9]) #(vi
+	cf_xopen_source="-D__EXTENSIONS__"
 	;;
 *)
-	echo $ac_n "checking if we should define _XOPEN_SOURCE""... $ac_c" 1>&6
-echo "configure:1811: checking if we should define _XOPEN_SOURCE" >&5
-if eval "test \"`echo '$''{'cf_cv_xopen_source'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+	echo "$as_me:2979: checking if we should define _XOPEN_SOURCE" >&5
+echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
+if test "${cf_cv_xopen_source+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  
-	cat > conftest.$ac_ext <<EOF
-#line 1817 "configure"
+
+	cat >conftest.$ac_ext <<_ACEOF
+#line 2986 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
-int main() {
+int
+main ()
+{
 
 #ifndef _XOPEN_SOURCE
 make an error
 #endif
-; return 0; }
-EOF
-if { (eval echo configure:1827: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:3001: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:3004: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:3007: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:3010: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   cf_cv_xopen_source=no
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  cf_save="$CPPFLAGS"
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_save="$CPPFLAGS"
 	 CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
-	 cat > conftest.$ac_ext <<EOF
-#line 1837 "configure"
+	 cat >conftest.$ac_ext <<_ACEOF
+#line 3019 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
-int main() {
+int
+main ()
+{
 
 #ifdef _XOPEN_SOURCE
 make an error
 #endif
-; return 0; }
-EOF
-if { (eval echo configure:1847: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:3034: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:3037: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:3040: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:3043: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   cf_cv_xopen_source=no
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  cf_cv_xopen_source=$cf_XOPEN_SOURCE
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_xopen_source=$cf_XOPEN_SOURCE
 fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
 	CPPFLAGS="$cf_save"
-	
-fi
-rm -f conftest*
 
 fi
+rm -f conftest.$ac_objext conftest.$ac_ext
 
-echo "$ac_t""$cf_cv_xopen_source" 1>&6
+fi
+echo "$as_me:3058: result: $cf_cv_xopen_source" >&5
+echo "${ECHO_T}$cf_cv_xopen_source" >&6
 	if test "$cf_cv_xopen_source" != no ; then
-		
-# remove _XOPEN_SOURCE symbol from $CFLAGS
+
 CFLAGS=`echo "$CFLAGS" | \
-	sed	-e 's/-[UD]_XOPEN_SOURCE\(=[^ 	]*\)\?[ 	]/ /g' \
-		-e 's/-[UD]_XOPEN_SOURCE\(=[^ 	]*\)\?$//g'`
+	sed	-e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ 	]*\)\?[ 	]/ /g' \
+		-e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ 	]*\)\?$//g'`
 
-		
-# remove _XOPEN_SOURCE symbol from $CPPFLAGS
 CPPFLAGS=`echo "$CPPFLAGS" | \
-	sed	-e 's/-[UD]_XOPEN_SOURCE\(=[^ 	]*\)\?[ 	]/ /g' \
-		-e 's/-[UD]_XOPEN_SOURCE\(=[^ 	]*\)\?$//g'`
-
-		test "$cf_cv_cc_u_d_options" = yes && \
-			CPPFLAGS="$CPPFLAGS -U_XOPEN_SOURCE"
-		CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_cv_xopen_source"
-	fi
-	
-cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
+	sed	-e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ 	]*\)\?[ 	]/ /g' \
+		-e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ 	]*\)\?$//g'`
 
-cf_save_CFLAGS="$CFLAGS"
-cf_save_CPPFLAGS="$CPPFLAGS"
+		cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
 
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
 
-# remove _POSIX_C_SOURCE symbol from $cf_save_CFLAGS
-cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
-	sed	-e 's/-[UD]_POSIX_C_SOURCE\(=[^ 	]*\)\?[ 	]/ /g' \
-		-e 's/-[UD]_POSIX_C_SOURCE\(=[^ 	]*\)\?$//g'`
+for cf_add_cflags in $cf_temp_xopen_source
+do
+case $cf_fix_cppflags in
+no)
+	case $cf_add_cflags in #(vi
+	-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
+		case $cf_add_cflags in
+		-D*)
+			cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
 
+			test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+				&& test -z "${cf_tst_cflags}" \
+				&& cf_fix_cppflags=yes
 
-# remove _POSIX_C_SOURCE symbol from $cf_save_CPPFLAGS
-cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
-	sed	-e 's/-[UD]_POSIX_C_SOURCE\(=[^ 	]*\)\?[ 	]/ /g' \
-		-e 's/-[UD]_POSIX_C_SOURCE\(=[^ 	]*\)\?$//g'`
+			if test $cf_fix_cppflags = yes ; then
+				cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+				continue
+			elif test "${cf_tst_cflags}" = "\"'" ; then
+				cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+				continue
+			fi
+			;;
+		esac
+		case "$CPPFLAGS" in
+		*$cf_add_cflags) #(vi
+			;;
+		*) #(vi
+			case $cf_add_cflags in #(vi
+			-D*)
+				cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
 
+CPPFLAGS=`echo "$CPPFLAGS" | \
+	sed	-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?[ 	]/ /g' \
+		-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?$//g'`
 
-echo $ac_n "checking if we should define _POSIX_C_SOURCE""... $ac_c" 1>&6
-echo "configure:1902: checking if we should define _POSIX_C_SOURCE" >&5
-if eval "test \"`echo '$''{'cf_cv_posix_c_source'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  
-	
-echo "${as_me-configure}:1908: testing if the symbol is already defined go no further ..." 1>&5
+				;;
+			esac
+			cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
+			;;
+		esac
+		;;
+	*)
+		cf_new_cflags="$cf_new_cflags $cf_add_cflags"
+		;;
+	esac
+	;;
+yes)
+	cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
 
-	cat > conftest.$ac_ext <<EOF
-#line 1911 "configure"
+	cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
+
+	test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+		&& test -z "${cf_tst_cflags}" \
+		&& cf_fix_cppflags=no
+	;;
+esac
+done
+
+if test -n "$cf_new_cflags" ; then
+
+	CFLAGS="$CFLAGS $cf_new_cflags"
+fi
+
+if test -n "$cf_new_cppflags" ; then
+
+	CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
+fi
+
+if test -n "$cf_new_extra_cppflags" ; then
+
+	EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+fi
+
+	fi
+
+cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
+
+cf_save_CFLAGS="$CFLAGS"
+cf_save_CPPFLAGS="$CPPFLAGS"
+
+cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
+	sed	-e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ 	]*\)\?[ 	]/ /g' \
+		-e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ 	]*\)\?$//g'`
+
+cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
+	sed	-e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ 	]*\)\?[ 	]/ /g' \
+		-e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ 	]*\)\?$//g'`
+
+echo "$as_me:3165: checking if we should define _POSIX_C_SOURCE" >&5
+echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
+if test "${cf_cv_posix_c_source+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+echo "${as_me:-configure}:3171: testing if the symbol is already defined go no further ..." 1>&5
+
+	cat >conftest.$ac_ext <<_ACEOF
+#line 3174 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
-int main() {
+int
+main ()
+{
 
 #ifndef _POSIX_C_SOURCE
 make an error
 #endif
-; return 0; }
-EOF
-if { (eval echo configure:1921: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:3189: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:3192: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:3195: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:3198: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   cf_cv_posix_c_source=no
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  cf_want_posix_source=no
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_want_posix_source=no
 	 case .$cf_POSIX_C_SOURCE in #(vi
 	 .[12]??*) #(vi
 		cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
@@ -1938,169 +3215,459 @@
 		;;
 	 esac
 	 if test "$cf_want_posix_source" = yes ; then
-		cat > conftest.$ac_ext <<EOF
-#line 1943 "configure"
+		cat >conftest.$ac_ext <<_ACEOF
+#line 3219 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
-int main() {
+int
+main ()
+{
 
 #ifdef _POSIX_SOURCE
 make an error
 #endif
-; return 0; }
-EOF
-if { (eval echo configure:1953: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:3234: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:3237: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:3240: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:3243: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   :
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
 fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
 	 fi
-	 
-echo "${as_me-configure}:1964: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
+
+echo "${as_me:-configure}:3254: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
 
 	 CFLAGS="$cf_trim_CFLAGS"
 	 CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
-	 
-echo "${as_me-configure}:1969: testing if the second compile does not leave our definition intact error ..." 1>&5
 
-	 cat > conftest.$ac_ext <<EOF
-#line 1972 "configure"
+echo "${as_me:-configure}:3259: testing if the second compile does not leave our definition intact error ..." 1>&5
+
+	 cat >conftest.$ac_ext <<_ACEOF
+#line 3262 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
-int main() {
+int
+main ()
+{
 
 #ifndef _POSIX_C_SOURCE
 make an error
 #endif
-; return 0; }
-EOF
-if { (eval echo configure:1982: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:3277: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:3280: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:3283: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:3286: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   :
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  cf_cv_posix_c_source=no
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_posix_c_source=no
 fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
 	 CFLAGS="$cf_save_CFLAGS"
 	 CPPFLAGS="$cf_save_CPPFLAGS"
-	
-fi
-rm -f conftest*
 
 fi
+rm -f conftest.$ac_objext conftest.$ac_ext
 
-echo "$ac_t""$cf_cv_posix_c_source" 1>&6
+fi
+echo "$as_me:3302: result: $cf_cv_posix_c_source" >&5
+echo "${ECHO_T}$cf_cv_posix_c_source" >&6
 
 if test "$cf_cv_posix_c_source" != no ; then
 	CFLAGS="$cf_trim_CFLAGS"
 	CPPFLAGS="$cf_trim_CPPFLAGS"
-	if test "$cf_cv_cc_u_d_options" = yes ; then
-		cf_temp_posix_c_source=`echo "$cf_cv_posix_c_source" | \
-				sed -e 's/-D/-U/g' -e 's/=[^ 	]*//g'`
-		CPPFLAGS="$CPPFLAGS $cf_temp_posix_c_source"
-	fi
-	CPPFLAGS="$CPPFLAGS $cf_cv_posix_c_source"
+
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
+
+for cf_add_cflags in $cf_cv_posix_c_source
+do
+case $cf_fix_cppflags in
+no)
+	case $cf_add_cflags in #(vi
+	-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
+		case $cf_add_cflags in
+		-D*)
+			cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
+
+			test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+				&& test -z "${cf_tst_cflags}" \
+				&& cf_fix_cppflags=yes
+
+			if test $cf_fix_cppflags = yes ; then
+				cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+				continue
+			elif test "${cf_tst_cflags}" = "\"'" ; then
+				cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+				continue
+			fi
+			;;
+		esac
+		case "$CPPFLAGS" in
+		*$cf_add_cflags) #(vi
+			;;
+		*) #(vi
+			case $cf_add_cflags in #(vi
+			-D*)
+				cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
+
+CPPFLAGS=`echo "$CPPFLAGS" | \
+	sed	-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?[ 	]/ /g' \
+		-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?$//g'`
+
+				;;
+			esac
+			cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
+			;;
+		esac
+		;;
+	*)
+		cf_new_cflags="$cf_new_cflags $cf_add_cflags"
+		;;
+	esac
+	;;
+yes)
+	cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+	cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
+
+	test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+		&& test -z "${cf_tst_cflags}" \
+		&& cf_fix_cppflags=no
+	;;
+esac
+done
+
+if test -n "$cf_new_cflags" ; then
+
+	CFLAGS="$CFLAGS $cf_new_cflags"
+fi
+
+if test -n "$cf_new_cppflags" ; then
+
+	CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
+fi
+
+if test -n "$cf_new_extra_cppflags" ; then
+
+	EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
 fi
 
+fi
 
 	;;
 esac
 
-echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:2017: checking for working const" >&5
-if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 2022 "configure"
-#include "confdefs.h"
+if test -n "$cf_xopen_source" ; then
+
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
 
-int main() {
+for cf_add_cflags in $cf_xopen_source
+do
+case $cf_fix_cppflags in
+no)
+	case $cf_add_cflags in #(vi
+	-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
+		case $cf_add_cflags in
+		-D*)
+			cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
 
-/* Ultrix mips cc rejects this.  */
-typedef int charset[2]; const charset x;
-/* SunOS 4.1.1 cc rejects this.  */
-char const *const *ccp;
-char **p;
-/* NEC SVR4.0.2 mips cc rejects this.  */
-struct point {int x, y;};
-static struct point const zero = {0,0};
-/* AIX XL C 1.02.0.0 rejects this.
-   It does not let you subtract one const X* pointer from another in an arm
-   of an if-expression whose if-part is not a constant expression */
-const char *g = "string";
-ccp = &g + (g ? g-g : 0);
-/* HPUX 7.0 cc rejects these. */
-++ccp;
-p = (char**) ccp;
-ccp = (char const *const *) p;
-{ /* SCO 3.2v4 cc rejects this.  */
-  char *t;
-  char const *s = 0 ? (char *) 0 : (char const *) 0;
+			test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+				&& test -z "${cf_tst_cflags}" \
+				&& cf_fix_cppflags=yes
 
-  *t++ = 0;
-}
-{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
-  int x[] = {25, 17};
-  const int *foo = &x[0];
-  ++foo;
-}
-{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
-  typedef const int *iptr;
-  iptr p = 0;
-  ++p;
+			if test $cf_fix_cppflags = yes ; then
+				cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+				continue
+			elif test "${cf_tst_cflags}" = "\"'" ; then
+				cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+				continue
+			fi
+			;;
+		esac
+		case "$CPPFLAGS" in
+		*$cf_add_cflags) #(vi
+			;;
+		*) #(vi
+			case $cf_add_cflags in #(vi
+			-D*)
+				cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
+
+CPPFLAGS=`echo "$CPPFLAGS" | \
+	sed	-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?[ 	]/ /g' \
+		-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?$//g'`
+
+				;;
+			esac
+			cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
+			;;
+		esac
+		;;
+	*)
+		cf_new_cflags="$cf_new_cflags $cf_add_cflags"
+		;;
+	esac
+	;;
+yes)
+	cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+	cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
+
+	test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+		&& test -z "${cf_tst_cflags}" \
+		&& cf_fix_cppflags=no
+	;;
+esac
+done
+
+if test -n "$cf_new_cflags" ; then
+
+	CFLAGS="$CFLAGS $cf_new_cflags"
+fi
+
+if test -n "$cf_new_cppflags" ; then
+
+	CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
+fi
+
+if test -n "$cf_new_extra_cppflags" ; then
+
+	EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+fi
+
+fi
+
+echo "$as_me:3474: checking for $CC option to accept ANSI C" >&5
+echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_stdc+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_prog_cc_stdc=no
+ac_save_CC=$CC
+cat >conftest.$ac_ext <<_ACEOF
+#line 3482 "configure"
+#include "confdefs.h"
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+     char **p;
+     int i;
+{
+  return p[i];
 }
-{ /* AIX XL C 1.02.0.0 rejects this saying
-     "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
-  struct s { int j; const int *ap[3]; };
-  struct s *b; b->j = 5;
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+  char *s;
+  va_list v;
+  va_start (v,p);
+  s = g (p, va_arg (v,int));
+  va_end (v);
+  return s;
 }
-{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
-  const int foo = 10;
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
+  ;
+  return 0;
 }
+_ACEOF
+# Don't try gcc -ansi; that turns off useful extensions and
+# breaks some systems' header files.
+# AIX			-qlanglvl=ansi
+# Ultrix and OSF/1	-std1
+# HP-UX 10.20 and later	-Ae
+# HP-UX older versions	-Aa -D_HPUX_SOURCE
+# SVR4			-Xc -D__EXTENSIONS__
+for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  rm -f conftest.$ac_objext
+if { (eval echo "$as_me:3531: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:3534: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:3537: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:3540: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_prog_cc_stdc=$ac_arg
+break
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext
+done
+rm -f conftest.$ac_ext conftest.$ac_objext
+CC=$ac_save_CC
 
-; return 0; }
-EOF
-if { (eval echo configure:2071: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
+fi
+
+case "x$ac_cv_prog_cc_stdc" in
+  x|xno)
+    echo "$as_me:3557: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6 ;;
+  *)
+    echo "$as_me:3560: result: $ac_cv_prog_cc_stdc" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
+    CC="$CC $ac_cv_prog_cc_stdc" ;;
+esac
+
+echo "$as_me:3565: checking for an ANSI C-conforming const" >&5
+echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
+if test "${ac_cv_c_const+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 3571 "configure"
+#include "confdefs.h"
+
+int
+main ()
+{
+/* FIXME: Include the comments suggested by Paul. */
+#ifndef __cplusplus
+  /* Ultrix mips cc rejects this.  */
+  typedef int charset[2];
+  const charset x;
+  /* SunOS 4.1.1 cc rejects this.  */
+  char const *const *ccp;
+  char **p;
+  /* NEC SVR4.0.2 mips cc rejects this.  */
+  struct point {int x, y;};
+  static struct point const zero = {0,0};
+  /* AIX XL C 1.02.0.0 rejects this.
+     It does not let you subtract one const X* pointer from another in
+     an arm of an if-expression whose if-part is not a constant
+     expression */
+  const char *g = "string";
+  ccp = &g + (g ? g-g : 0);
+  /* HPUX 7.0 cc rejects these. */
+  ++ccp;
+  p = (char**) ccp;
+  ccp = (char const *const *) p;
+  { /* SCO 3.2v4 cc rejects this.  */
+    char *t;
+    char const *s = 0 ? (char *) 0 : (char const *) 0;
+
+    *t++ = 0;
+  }
+  { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
+    int x[] = {25, 17};
+    const int *foo = &x[0];
+    ++foo;
+  }
+  { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
+    typedef const int *iptr;
+    iptr p = 0;
+    ++p;
+  }
+  { /* AIX XL C 1.02.0.0 rejects this saying
+       "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
+    struct s { int j; const int *ap[3]; };
+    struct s *b; b->j = 5;
+  }
+  { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
+    const int foo = 10;
+  }
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:3629: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:3632: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:3635: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:3638: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_c_const=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_c_const=no
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_c_const=no
 fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
 fi
-
-echo "$ac_t""$ac_cv_c_const" 1>&6
+echo "$as_me:3648: result: $ac_cv_c_const" >&5
+echo "${ECHO_T}$ac_cv_c_const" >&6
 if test $ac_cv_c_const = no; then
-  cat >> confdefs.h <<\EOF
-#define const 
+
+cat >>confdefs.h <<\EOF
+#define const
 EOF
 
 fi
 
-
-echo $ac_n "checking for signal global datatype""... $ac_c" 1>&6
-echo "configure:2093: checking for signal global datatype" >&5
-if eval "test \"`echo '$''{'cf_cv_sig_atomic_t'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:3658: checking for signal global datatype" >&5
+echo $ECHO_N "checking for signal global datatype... $ECHO_C" >&6
+if test "${cf_cv_sig_atomic_t+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  
+
 	for cf_type in \
 		"volatile sig_atomic_t" \
 		"sig_atomic_t" \
 		"int"
 	do
-	cat > conftest.$ac_ext <<EOF
-#line 2104 "configure"
+	cat >conftest.$ac_ext <<_ACEOF
+#line 3670 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -2113,156 +3680,281 @@
 {
 	x = 5;
 }
-int main() {
+int
+main ()
+{
 signal(SIGINT, handler);
 		 x = 1
-; return 0; }
-EOF
-if { (eval echo configure:2122: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:3693: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:3696: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:3699: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:3702: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   cf_cv_sig_atomic_t=$cf_type
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  cf_cv_sig_atomic_t=no
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_sig_atomic_t=no
 fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
 		test "$cf_cv_sig_atomic_t" != no && break
 	done
-	
+
 fi
 
-echo "$ac_t""$cf_cv_sig_atomic_t" 1>&6
-test "$cf_cv_sig_atomic_t" != no && cat >> confdefs.h <<EOF
+echo "$as_me:3716: result: $cf_cv_sig_atomic_t" >&5
+echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6
+test "$cf_cv_sig_atomic_t" != no && cat >>confdefs.h <<EOF
 #define SIG_ATOMIC_T $cf_cv_sig_atomic_t
 EOF
 
-
-
-
-echo $ac_n "checking if you want to see long compiling messages""... $ac_c" 1>&6
-echo "configure:2146: checking if you want to see long compiling messages" >&5
+echo "$as_me:3722: checking if you want to see long compiling messages" >&5
+echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
 
 # Check whether --enable-echo or --disable-echo was given.
 if test "${enable_echo+set}" = set; then
   enableval="$enable_echo"
   test "$enableval" != no && enableval=yes
   if test "$enableval" != "yes" ; then
-    
+
     ECHO_LT='--silent'
     ECHO_LD='@echo linking $@;'
-    RULE_CC='	@echo compiling $<'
-    SHOW_CC='	@echo compiling $@'
+    RULE_CC='@echo compiling $<'
+    SHOW_CC='@echo compiling $@'
     ECHO_CC='@'
- 
+
   else
-    
+
     ECHO_LT=''
     ECHO_LD=''
-    RULE_CC='# compiling'
-    SHOW_CC='# compiling'
+    RULE_CC=''
+    SHOW_CC=''
     ECHO_CC=''
 
   fi
 else
-  enableval=yes 
-  
+  enableval=yes
+
     ECHO_LT=''
     ECHO_LD=''
-    RULE_CC='# compiling'
-    SHOW_CC='# compiling'
+    RULE_CC=''
+    SHOW_CC=''
     ECHO_CC=''
 
-  
+fi;
+echo "$as_me:3756: result: $enableval" >&5
+echo "${ECHO_T}$enableval" >&6
+
+GCC_VERSION=none
+if test "$GCC" = yes ; then
+	echo "$as_me:3761: checking version of $CC" >&5
+echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
+	GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
+	test -z "$GCC_VERSION" && GCC_VERSION=unknown
+	echo "$as_me:3765: result: $GCC_VERSION" >&5
+echo "${ECHO_T}$GCC_VERSION" >&6
 fi
 
-echo "$ac_t""$enableval" 1>&6
-
-
-
-
-
-
-
-
-GCC_VERSION=none
-if test "$GCC" = yes ; then
-	echo $ac_n "checking version of $CC""... $ac_c" 1>&6
-echo "configure:2193: checking version of $CC" >&5
-	GCC_VERSION="`${CC} --version| sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
-	test -z "$GCC_VERSION" && GCC_VERSION=unknown
-	echo "$ac_t""$GCC_VERSION" 1>&6
-fi
-
-
 if ( test "$GCC" = yes || test "$GXX" = yes )
 then
-echo $ac_n "checking if you want to turn on gcc warnings""... $ac_c" 1>&6
-echo "configure:2203: checking if you want to turn on gcc warnings" >&5
+echo "$as_me:3771: checking if you want to turn on gcc warnings" >&5
+echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
 
 # Check whether --enable-warnings or --disable-warnings was given.
 if test "${enable_warnings+set}" = set; then
   enableval="$enable_warnings"
   test "$enableval" != yes && enableval=no
   if test "$enableval" != "no" ; then
-    with_warnings=yes 
+    with_warnings=yes
   else
     with_warnings=no
   fi
 else
-  enableval=no 
+  enableval=no
   with_warnings=no
-  
-fi
 
-echo "$ac_t""$with_warnings" 1>&6
+fi;
+echo "$as_me:3788: result: $with_warnings" >&5
+echo "${ECHO_T}$with_warnings" >&6
 if test "$with_warnings" = "yes"
 then
-	
 
+if test "$GCC" = yes
+then
+cat > conftest.i <<EOF
+#ifndef GCC_PRINTF
+#define GCC_PRINTF 0
+#endif
+#ifndef GCC_SCANF
+#define GCC_SCANF 0
+#endif
+#ifndef GCC_NORETURN
+#define GCC_NORETURN /* nothing */
+#endif
+#ifndef GCC_UNUSED
+#define GCC_UNUSED /* nothing */
+#endif
+EOF
+if test "$GCC" = yes
+then
+	{ echo "$as_me:3811: checking for $CC __attribute__ directives..." >&5
+echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
+cat > conftest.$ac_ext <<EOF
+#line 3814 "${as_me:-configure}"
+#include "confdefs.h"
+#include "conftest.h"
+#include "conftest.i"
+#if	GCC_PRINTF
+#define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
+#else
+#define GCC_PRINTFLIKE(fmt,var) /*nothing*/
+#endif
+#if	GCC_SCANF
+#define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
+#else
+#define GCC_SCANFLIKE(fmt,var)  /*nothing*/
+#endif
+extern void wow(char *,...) GCC_SCANFLIKE(1,2);
+extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
+extern void foo(void) GCC_NORETURN;
+int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
+EOF
+	cf_printf_attribute=no
+	cf_scanf_attribute=no
+	for cf_attribute in scanf printf unused noreturn
+	do
+
+cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
+
+		cf_directive="__attribute__(($cf_attribute))"
+		echo "checking for $CC $cf_directive" 1>&5
+
+		case $cf_attribute in #(vi
+		printf) #(vi
+			cf_printf_attribute=yes
+			cat >conftest.h <<EOF
+#define GCC_$cf_ATTRIBUTE 1
+EOF
+			;;
+		scanf) #(vi
+			cf_scanf_attribute=yes
+			cat >conftest.h <<EOF
+#define GCC_$cf_ATTRIBUTE 1
+EOF
+			;;
+		*) #(vi
+			cat >conftest.h <<EOF
+#define GCC_$cf_ATTRIBUTE $cf_directive
+EOF
+			;;
+		esac
+
+		if { (eval echo "$as_me:3863: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:3866: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+			test -n "$verbose" && echo "$as_me:3868: result: ... $cf_attribute" >&5
+echo "${ECHO_T}... $cf_attribute" >&6
+			cat conftest.h >>confdefs.h
+			case $cf_attribute in #(vi
+			printf) #(vi
+				if test "$cf_printf_attribute" = no ; then
+					cat >>confdefs.h <<EOF
+#define GCC_PRINTFLIKE(fmt,var) /* nothing */
+EOF
+				else
+					cat >>confdefs.h <<EOF
+#define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
+EOF
+				fi
+				;;
+			scanf) #(vi
+				if test "$cf_scanf_attribute" = no ; then
+					cat >>confdefs.h <<EOF
+#define GCC_SCANFLIKE(fmt,var) /* nothing */
+EOF
+				else
+					cat >>confdefs.h <<EOF
+#define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
+EOF
+				fi
+				;;
+			esac
+		fi
+	done
+else
+	fgrep define conftest.i >>confdefs.h
+fi
+rm -rf conftest*
+fi
 
 INTEL_COMPILER=no
 
 if test "$GCC" = yes ; then
 	case $host_os in
 	linux*|gnu*)
-		echo $ac_n "checking if this is really Intel C compiler""... $ac_c" 1>&6
-echo "configure:2232: checking if this is really Intel C compiler" >&5
+		echo "$as_me:3908: checking if this is really Intel C compiler" >&5
+echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
 		cf_save_CFLAGS="$CFLAGS"
 		CFLAGS="$CFLAGS -no-gcc"
-		cat > conftest.$ac_ext <<EOF
-#line 2236 "configure"
+		cat >conftest.$ac_ext <<_ACEOF
+#line 3913 "configure"
 #include "confdefs.h"
 
-int main() {
+int
+main ()
+{
 
 #ifdef __INTEL_COMPILER
 #else
 make an error
 #endif
 
-; return 0; }
-EOF
-if { (eval echo configure:2248: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:3930: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:3933: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:3936: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:3939: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   INTEL_COMPILER=yes
 cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc"
 
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
 fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
 		CFLAGS="$cf_save_CFLAGS"
-		echo "$ac_t""$INTEL_COMPILER" 1>&6
+		echo "$as_me:3950: result: $INTEL_COMPILER" >&5
+echo "${ECHO_T}$INTEL_COMPILER" >&6
 		;;
 	esac
 fi
 
-
 cat > conftest.$ac_ext <<EOF
-#line 2266 "${as_me-configure}"
+#line 3957 "${as_me:-configure}"
 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
 EOF
 
@@ -2270,7 +3962,6 @@
 then
 # The "-wdXXX" options suppress warnings:
 # remark #1419: external declaration in primary source file
-# remark #1682: implicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
 # remark #193: zero used for undefined preprocessing identifier
@@ -2278,27 +3969,31 @@
 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
 # remark #869: parameter "tw" was never referenced
 # remark #981: operands are evaluated in unspecified order
-# warning #269: invalid format string conversion
+# warning #279: controlling expression is constant
 
-	echo "checking for $CC warning options" 1>&6
-echo "configure:2285: checking for $CC warning options" >&5
+	{ echo "$as_me:3974: checking for $CC warning options..." >&5
+echo "$as_me: checking for $CC warning options..." >&6;}
 	cf_save_CFLAGS="$CFLAGS"
 	EXTRA_CFLAGS="-Wall"
 	for cf_opt in \
 		wd1419 \
-		wd1682 \
 		wd1683 \
 		wd1684 \
 		wd193 \
-		wd279 \
 		wd593 \
+		wd279 \
 		wd810 \
 		wd869 \
 		wd981
 	do
 		CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
-		if { (eval echo configure:2301: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-			test -n "$verbose" && echo "$ac_t""... -$cf_opt" 1>&6
+		if { (eval echo "$as_me:3990: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:3993: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+			test -n "$verbose" && echo "$as_me:3995: result: ... -$cf_opt" >&5
+echo "${ECHO_T}... -$cf_opt" >&6
 			EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
 		fi
 	done
@@ -2306,13 +4001,13 @@
 
 elif test "$GCC" = yes
 then
-	echo "checking for $CC warning options" 1>&6
-echo "configure:2311: checking for $CC warning options" >&5
+	{ echo "$as_me:4004: checking for $CC warning options..." >&5
+echo "$as_me: checking for $CC warning options..." >&6;}
 	cf_save_CFLAGS="$CFLAGS"
-	EXTRA_CFLAGS="-W -Wall"
+	EXTRA_CFLAGS=
 	cf_warn_CONST=""
 	test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
-	for cf_opt in \
+	for cf_opt in W Wall \
 		Wbad-function-cast \
 		Wcast-align \
 		Wcast-qual \
@@ -2323,22 +4018,26 @@
 		Wpointer-arith \
 		Wshadow \
 		Wstrict-prototypes \
-		Wundef $cf_warn_CONST 
+		Wundef $cf_warn_CONST
 	do
 		CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
-		if { (eval echo configure:2330: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-			test -n "$verbose" && echo "$ac_t""... -$cf_opt" 1>&6
+		if { (eval echo "$as_me:4024: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:4027: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+			test -n "$verbose" && echo "$as_me:4029: result: ... -$cf_opt" >&5
+echo "${ECHO_T}... -$cf_opt" >&6
 			case $cf_opt in #(vi
 			Wcast-qual) #(vi
 				CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
 				;;
 			Winline) #(vi
 				case $GCC_VERSION in
-				3.3*)
+				[34].*)
 					test -n "$verbose" && echo "	feature is broken in gcc $GCC_VERSION" 1>&6
 
-echo "${as_me-configure}:2341: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
-
+echo "${as_me:-configure}:4040: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
 
 					continue;;
 				esac
@@ -2349,827 +4048,618 @@
 	done
 	CFLAGS="$cf_save_CFLAGS"
 fi
-rm -f conftest*
-
-
+rm -rf conftest*
 
 fi
 fi
 
+echo "$as_me:4056: checking if you want to use dmalloc for testing" >&5
+echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
 
+# Check whether --with-dmalloc or --without-dmalloc was given.
+if test "${with_dmalloc+set}" = set; then
+  withval="$with_dmalloc"
+  cat >>confdefs.h <<\EOF
+#define USE_DMALLOC 1
+EOF
+
+	: ${with_cflags:=-g}
+	: ${with_no_leaks:=yes}
+	 with_dmalloc=yes
+else
+  with_dmalloc=
+fi;
+echo "$as_me:4072: result: ${with_dmalloc:-no}" >&5
+echo "${ECHO_T}${with_dmalloc:-no}" >&6
+
+case .$with_cflags in #(vi
+.*-g*)
+	case .$CFLAGS in #(vi
+	.*-g*) #(vi
+		;;
+	*)
 
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
 
-# Check whether --with-curses-dir or --without-curses-dir was given.
-if test "${with_curses_dir+set}" = set; then
-  withval="$with_curses_dir"
-  
-if test "x$prefix" != xNONE; then
-  cf_path_syntax="$prefix"
-else
-  cf_path_syntax="$ac_default_prefix"
-fi
+for cf_add_cflags in -g
+do
+case $cf_fix_cppflags in
+no)
+	case $cf_add_cflags in #(vi
+	-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
+		case $cf_add_cflags in
+		-D*)
+			cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
 
-case ".$withval" in #(vi
-.\$\(*\)*|.\'*\'*) #(vi
-  ;;
-..|./*|.\\*) #(vi
-  ;;
-.[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
-  ;;
-.\${*prefix}*) #(vi
-  eval withval="$withval"
-  case ".$withval" in #(vi
-  .NONE/*)
-    withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
-    ;;
-  esac
-  ;; #(vi
-.no|.NONE/*)
-  withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
-  ;;
-*)
-  { echo "configure: error: expected a pathname, not \"$withval\"" 1>&2; exit 1; }
-  ;;
+			test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+				&& test -z "${cf_tst_cflags}" \
+				&& cf_fix_cppflags=yes
+
+			if test $cf_fix_cppflags = yes ; then
+				cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+				continue
+			elif test "${cf_tst_cflags}" = "\"'" ; then
+				cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+				continue
+			fi
+			;;
+		esac
+		case "$CPPFLAGS" in
+		*$cf_add_cflags) #(vi
+			;;
+		*) #(vi
+			case $cf_add_cflags in #(vi
+			-D*)
+				cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
+
+CPPFLAGS=`echo "$CPPFLAGS" | \
+	sed	-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?[ 	]/ /g' \
+		-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?$//g'`
+
+				;;
+			esac
+			cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
+			;;
+		esac
+		;;
+	*)
+		cf_new_cflags="$cf_new_cflags $cf_add_cflags"
+		;;
+	esac
+	;;
+yes)
+	cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+	cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
+
+	test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+		&& test -z "${cf_tst_cflags}" \
+		&& cf_fix_cppflags=no
+	;;
 esac
+done
 
-	 cf_cv_curses_dir=$withval
-else
-  cf_cv_curses_dir=no
+if test -n "$cf_new_cflags" ; then
+
+	CFLAGS="$CFLAGS $cf_new_cflags"
 fi
 
+if test -n "$cf_new_cppflags" ; then
 
+	CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
+fi
 
+if test -n "$cf_new_extra_cppflags" ; then
 
-# Check whether --with-5lib or --without-5lib was given.
-if test "${with_5lib+set}" = set; then
-  withval="$with_5lib"
-  LIBS="-L/usr/5lib $LIBS"
-	 CPPFLAGS="$CPPFLAGS -I/usr/5include"
+	EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
 fi
 
+		;;
+	esac
+	;;
+esac
 
-
-# Check whether --with-ncursesw or --without-ncursesw was given.
-if test "${with_ncursesw+set}" = set; then
-  withval="$with_ncursesw"
-  cf_cv_screen=ncursesw
+if test "$with_dmalloc" = yes ; then
+	echo "$as_me:4166: checking for dmalloc.h" >&5
+echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
+if test "${ac_cv_header_dmalloc_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 4172 "configure"
+#include "confdefs.h"
+#include <dmalloc.h>
+_ACEOF
+if { (eval echo "$as_me:4176: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  egrep -v '^ *\+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:4182: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_cv_header_dmalloc_h=yes
 else
-  
+  echo "$as_me: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  ac_cv_header_dmalloc_h=no
+fi
+rm -f conftest.err conftest.$ac_ext
+fi
+echo "$as_me:4201: result: $ac_cv_header_dmalloc_h" >&5
+echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
+if test $ac_cv_header_dmalloc_h = yes; then
 
+echo "$as_me:4205: checking for dmalloc_debug in -ldmalloc" >&5
+echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
+if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldmalloc  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line 4213 "configure"
+#include "confdefs.h"
 
-# Check whether --with-ncurses or --without-ncurses was given.
-if test "${with_ncurses+set}" = set; then
-  withval="$with_ncurses"
-  cf_cv_screen=ncurses
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dmalloc_debug ();
+int
+main ()
+{
+dmalloc_debug ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:4232: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:4235: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:4238: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:4241: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_dmalloc_dmalloc_debug=yes
 else
-  
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_dmalloc_dmalloc_debug=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:4252: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
+echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
+if test $ac_cv_lib_dmalloc_dmalloc_debug = yes; then
+  cat >>confdefs.h <<EOF
+#define HAVE_LIBDMALLOC 1
+EOF
 
+  LIBS="-ldmalloc $LIBS"
 
-# Check whether --with-pdcurses or --without-pdcurses was given.
-if test "${with_pdcurses+set}" = set; then
-  withval="$with_pdcurses"
-  cf_cv_screen=pdcurses
 fi
 
 fi
 
 fi
 
+echo "$as_me:4267: checking if you want to use dbmalloc for testing" >&5
+echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
 
-case $cf_cv_screen in
-curses)
-	
+# Check whether --with-dbmalloc or --without-dbmalloc was given.
+if test "${with_dbmalloc+set}" = set; then
+  withval="$with_dbmalloc"
+  cat >>confdefs.h <<\EOF
+#define USE_DBMALLOC 1
+EOF
 
-echo $ac_n "checking for extra include directories""... $ac_c" 1>&6
-echo "configure:2445: checking for extra include directories" >&5
-if eval "test \"`echo '$''{'cf_cv_curses_incdir'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+	: ${with_cflags:=-g}
+	: ${with_no_leaks:=yes}
+	 with_dbmalloc=yes
 else
-  
-cf_cv_curses_incdir=no
-case $host_os in #(vi
-hpux10.*) #(vi
-	test -d /usr/include/curses_colr && \
-	cf_cv_curses_incdir="-I/usr/include/curses_colr"
-	;;
-sunos3*|sunos4*)
-	test -d /usr/5lib && \
-	test -d /usr/5include && \
-	cf_cv_curses_incdir="-I/usr/5include"
-	;;
-esac
+  with_dbmalloc=
+fi;
+echo "$as_me:4283: result: ${with_dbmalloc:-no}" >&5
+echo "${ECHO_T}${with_dbmalloc:-no}" >&6
 
-fi
-
-echo "$ac_t""$cf_cv_curses_incdir" 1>&6
-test "$cf_cv_curses_incdir" != no && CPPFLAGS="$cf_cv_curses_incdir $CPPFLAGS"
+case .$with_cflags in #(vi
+.*-g*)
+	case .$CFLAGS in #(vi
+	.*-g*) #(vi
+		;;
+	*)
 
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
 
-echo $ac_n "checking if we have identified curses headers""... $ac_c" 1>&6
-echo "configure:2470: checking if we have identified curses headers" >&5
-if eval "test \"`echo '$''{'cf_cv_ncurses_header'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  
-cf_cv_ncurses_header=none
-for cf_header in \
-	curses.h \
-	ncurses.h \
-	ncurses/curses.h \
-	ncurses/ncurses.h
+for cf_add_cflags in -g
 do
-cat > conftest.$ac_ext <<EOF
-#line 2483 "configure"
-#include "confdefs.h"
-#include <${cf_header}>
-int main() {
-initscr(); tgoto("?", 0,0)
-; return 0; }
-EOF
-if { (eval echo configure:2490: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
-  cf_cv_ncurses_header=$cf_header; break
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-fi
-rm -f conftest*
-done
-
-fi
+case $cf_fix_cppflags in
+no)
+	case $cf_add_cflags in #(vi
+	-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
+		case $cf_add_cflags in
+		-D*)
+			cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
 
-echo "$ac_t""$cf_cv_ncurses_header" 1>&6
+			test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+				&& test -z "${cf_tst_cflags}" \
+				&& cf_fix_cppflags=yes
 
-if test "$cf_cv_ncurses_header" = none ; then
-	{ echo "configure: error: No curses header-files found" 1>&2; exit 1; }
-fi
+			if test $cf_fix_cppflags = yes ; then
+				cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+				continue
+			elif test "${cf_tst_cflags}" = "\"'" ; then
+				cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+				continue
+			fi
+			;;
+		esac
+		case "$CPPFLAGS" in
+		*$cf_add_cflags) #(vi
+			;;
+		*) #(vi
+			case $cf_add_cflags in #(vi
+			-D*)
+				cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
 
-# cheat, to get the right #define's for HAVE_NCURSES_H, etc.
-for ac_hdr in $cf_cv_ncurses_header
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2513: checking for $ac_hdr" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 2518 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2523: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
-else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
-EOF
- 
-else
-  echo "$ac_t""no" 1>&6
-fi
-done
+CPPFLAGS=`echo "$CPPFLAGS" | \
+	sed	-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?[ 	]/ /g' \
+		-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?$//g'`
 
+				;;
+			esac
+			cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
+			;;
+		esac
+		;;
+	*)
+		cf_new_cflags="$cf_new_cflags $cf_add_cflags"
+		;;
+	esac
+	;;
+yes)
+	cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
 
+	cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
 
-echo $ac_n "checking for terminfo header""... $ac_c" 1>&6
-echo "configure:2552: checking for terminfo header" >&5
-if eval "test \"`echo '$''{'cf_cv_term_header'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  
-case ${cf_cv_ncurses_header} in #(vi
-*/ncurses.h|*/ncursesw.h) #(vi
-	cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
-	;;
-*)
-	cf_term_header=term.h
+	test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+		&& test -z "${cf_tst_cflags}" \
+		&& cf_fix_cppflags=no
 	;;
 esac
-
-for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
-do
-cat > conftest.$ac_ext <<EOF
-#line 2569 "configure"
-#include "confdefs.h"
-#include <stdio.h>
-#include <${cf_cv_ncurses_header-curses.h}>
-#include <$cf_test>
-
-int main() {
-int x = auto_left_margin
-; return 0; }
-EOF
-if { (eval echo configure:2579: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
-  
-	cf_cv_term_header="$cf_test"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  
-	cf_cv_term_header=unknown
-	
-fi
-rm -f conftest*
-	test "$cf_cv_term_header" != unknown && break
 done
 
-fi
-
-echo "$ac_t""$cf_cv_term_header" 1>&6
+if test -n "$cf_new_cflags" ; then
 
-# Set definitions to allow ifdef'ing to accommodate subdirectories
+	CFLAGS="$CFLAGS $cf_new_cflags"
+fi
 
-case $cf_cv_term_header in # (vi
-*term.h)
-	cat >> confdefs.h <<\EOF
-#define HAVE_TERM_H 1
-EOF
+if test -n "$cf_new_cppflags" ; then
 
-	;;
-esac
+	CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
+fi
 
-case $cf_cv_term_header in # (vi
-ncurses/term.h) #(vi
-	cat >> confdefs.h <<\EOF
-#define HAVE_NCURSES_TERM_H 1
-EOF
+if test -n "$cf_new_extra_cppflags" ; then
 
-	;;
-ncursesw/term.h)
-	cat >> confdefs.h <<\EOF
-#define HAVE_NCURSESW_TERM_H 1
-EOF
+	EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+fi
 
+		;;
+	esac
 	;;
 esac
 
-
-	
-echo $ac_n "checking for ncurses version""... $ac_c" 1>&6
-echo "configure:2628: checking for ncurses version" >&5
-if eval "test \"`echo '$''{'cf_cv_ncurses_version'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+if test "$with_dbmalloc" = yes ; then
+	echo "$as_me:4377: checking for dbmalloc.h" >&5
+echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
+if test "${ac_cv_header_dbmalloc_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 4383 "configure"
+#include "confdefs.h"
+#include <dbmalloc.h>
+_ACEOF
+if { (eval echo "$as_me:4387: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  egrep -v '^ *\+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:4393: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
 else
-  
-	cf_cv_ncurses_version=no
-	cf_tempfile=out$$
-	rm -f $cf_tempfile
-	if test "$cross_compiling" = yes; then
-  
-
-	# This will not work if the preprocessor splits the line after the
-	# Autoconf token.  The 'unproto' program does that.
-	cat > conftest.$ac_ext <<EOF
-#include <${cf_cv_ncurses_header-curses.h}>
-#undef Autoconf
-#ifdef NCURSES_VERSION
-Autoconf NCURSES_VERSION
-#else
-#ifdef __NCURSES_H
-Autoconf "old"
-#endif
-;
-#endif
-EOF
-	cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
-	{ (eval echo configure:2654: \"$cf_try\") 1>&5; (eval $cf_try) 2>&5; }
-	if test -f conftest.out ; then
-		cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
-		test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
-		rm -f conftest.out
-	fi
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_cv_header_dbmalloc_h=yes
+else
+  echo "$as_me: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  ac_cv_header_dbmalloc_h=no
+fi
+rm -f conftest.err conftest.$ac_ext
+fi
+echo "$as_me:4412: result: $ac_cv_header_dbmalloc_h" >&5
+echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
+if test $ac_cv_header_dbmalloc_h = yes; then
 
+echo "$as_me:4416: checking for debug_malloc in -ldbmalloc" >&5
+echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
+if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 2663 "configure"
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldbmalloc  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line 4424 "configure"
 #include "confdefs.h"
 
-#include <${cf_cv_ncurses_header-curses.h}>
-#include <stdio.h>
-int main()
-{
-	FILE *fp = fopen("$cf_tempfile", "w");
-#ifdef NCURSES_VERSION
-# ifdef NCURSES_VERSION_PATCH
-	fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
-# else
-	fprintf(fp, "%s\n", NCURSES_VERSION);
-# endif
-#else
-# ifdef __NCURSES_H
-	fprintf(fp, "old\n");
-# else
-	make an error
-# endif
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
 #endif
-	${cf_cv_main_return-return}(0);
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char debug_malloc ();
+int
+main ()
+{
+debug_malloc ();
+  ;
+  return 0;
 }
-EOF
-if { (eval echo configure:2687: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
-  
-	cf_cv_ncurses_version=`cat $cf_tempfile`
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:4443: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:4446: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:4449: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:4452: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_dbmalloc_debug_malloc=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-fi
-rm -fr conftest*
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_dbmalloc_debug_malloc=no
 fi
-
-	rm -f $cf_tempfile
-
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
-
-echo "$ac_t""$cf_cv_ncurses_version" 1>&6
-test "$cf_cv_ncurses_version" = no || cat >> confdefs.h <<\EOF
-#define NCURSES 1
+echo "$as_me:4463: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
+echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
+if test $ac_cv_lib_dbmalloc_debug_malloc = yes; then
+  cat >>confdefs.h <<EOF
+#define HAVE_LIBDBMALLOC 1
 EOF
 
+  LIBS="-ldbmalloc $LIBS"
 
-	
-
-echo $ac_n "checking if we have identified curses libraries""... $ac_c" 1>&6
-echo "configure:2711: checking if we have identified curses libraries" >&5
-cat > conftest.$ac_ext <<EOF
-#line 2713 "configure"
-#include "confdefs.h"
-#include <${cf_cv_ncurses_header-curses.h}>
-int main() {
-initscr(); tgoto("?", 0,0)
-; return 0; }
-EOF
-if { (eval echo configure:2720: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  cf_result=yes
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  cf_result=no
 fi
-rm -f conftest*
-echo "$ac_t""$cf_result" 1>&6
-
-if test "$cf_result" = no ; then
-case $host_os in #(vi
-freebsd*) #(vi
-    echo $ac_n "checking for tgoto in -lmytinfo""... $ac_c" 1>&6
-echo "configure:2736: checking for tgoto in -lmytinfo" >&5
-ac_lib_var=`echo mytinfo'_'tgoto | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  ac_save_LIBS="$LIBS"
-LIBS="-lmytinfo  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 2744 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char tgoto();
 
-int main() {
-tgoto()
-; return 0; }
-EOF
-if { (eval echo configure:2755: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
 fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
 
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  LIBS="-lmytinfo $LIBS"
-else
-  echo "$ac_t""no" 1>&6
-fi
 
-    ;;
-hpux10.*) #(vi
-    echo $ac_n "checking for initscr in -lcur_colr""... $ac_c" 1>&6
-echo "configure:2778: checking for initscr in -lcur_colr" >&5
-ac_lib_var=`echo cur_colr'_'initscr | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  ac_save_LIBS="$LIBS"
-LIBS="-lcur_colr  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 2786 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char initscr();
+echo "$as_me:4478: checking if you want to use valgrind for testing" >&5
+echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
 
-int main() {
-initscr()
-; return 0; }
+# Check whether --with-valgrind or --without-valgrind was given.
+if test "${with_valgrind+set}" = set; then
+  withval="$with_valgrind"
+  cat >>confdefs.h <<\EOF
+#define USE_VALGRIND 1
 EOF
-if { (eval echo configure:2797: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
 
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  
-        LIBS="-lcur_colr $LIBS"
-        ac_cv_func_initscr=yes
-        
+	: ${with_cflags:=-g}
+	: ${with_no_leaks:=yes}
+	 with_valgrind=yes
 else
-  echo "$ac_t""no" 1>&6
+  with_valgrind=
+fi;
+echo "$as_me:4494: result: ${with_valgrind:-no}" >&5
+echo "${ECHO_T}${with_valgrind:-no}" >&6
 
-    echo $ac_n "checking for initscr in -lHcurses""... $ac_c" 1>&6
-echo "configure:2820: checking for initscr in -lHcurses" >&5
-ac_lib_var=`echo Hcurses'_'initscr | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  ac_save_LIBS="$LIBS"
-LIBS="-lHcurses  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 2828 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char initscr();
+case .$with_cflags in #(vi
+.*-g*)
+	case .$CFLAGS in #(vi
+	.*-g*) #(vi
+		;;
+	*)
 
-int main() {
-initscr()
-; return 0; }
-EOF
-if { (eval echo configure:2839: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
 
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  
-        # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
-        LIBS="-lHcurses $LIBS"
-        CPPFLAGS="-D__HP_CURSES -D_HP_CURSES $CPPFLAGS"
-        ac_cv_func_initscr=yes
-        
-else
-  echo "$ac_t""no" 1>&6
-fi
+for cf_add_cflags in -g
+do
+case $cf_fix_cppflags in
+no)
+	case $cf_add_cflags in #(vi
+	-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
+		case $cf_add_cflags in
+		-D*)
+			cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
 
-fi
+			test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+				&& test -z "${cf_tst_cflags}" \
+				&& cf_fix_cppflags=yes
 
-    ;;
-linux*) # Suse Linux does not follow /usr/lib convention
-    
-if test -n "/lib" ; then
-  for cf_add_libdir in /lib
-  do
-    if test $cf_add_libdir = /usr/lib ; then
-      :
-    elif test -d $cf_add_libdir
-    then
-      cf_have_libdir=no
-      if test -n "$LDFLAGS$LIBS" ; then
-        # a loop is needed to ensure we can add subdirs of existing dirs
-        for cf_test_libdir in $LDFLAGS $LIBS ; do
-          if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
-            cf_have_libdir=yes; break
-          fi
-        done
-      fi
-      if test "$cf_have_libdir" = no ; then
-        test -n "$verbose" && echo "	adding $cf_add_libdir to library-path" 1>&6
-
-echo "${as_me-configure}:2888: testing adding $cf_add_libdir to library-path ..." 1>&5
-
-
-        LDFLAGS="-L$cf_add_libdir $LDFLAGS"
-      fi
-    fi
-  done
-fi
-
-    ;;
-sunos3*|sunos4*)
-    if test -d /usr/5lib ; then
-      
-if test -n "/usr/5lib" ; then
-  for cf_add_libdir in /usr/5lib
-  do
-    if test $cf_add_libdir = /usr/lib ; then
-      :
-    elif test -d $cf_add_libdir
-    then
-      cf_have_libdir=no
-      if test -n "$LDFLAGS$LIBS" ; then
-        # a loop is needed to ensure we can add subdirs of existing dirs
-        for cf_test_libdir in $LDFLAGS $LIBS ; do
-          if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
-            cf_have_libdir=yes; break
-          fi
-        done
-      fi
-      if test "$cf_have_libdir" = no ; then
-        test -n "$verbose" && echo "	adding $cf_add_libdir to library-path" 1>&6
+			if test $cf_fix_cppflags = yes ; then
+				cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+				continue
+			elif test "${cf_tst_cflags}" = "\"'" ; then
+				cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+				continue
+			fi
+			;;
+		esac
+		case "$CPPFLAGS" in
+		*$cf_add_cflags) #(vi
+			;;
+		*) #(vi
+			case $cf_add_cflags in #(vi
+			-D*)
+				cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
 
-echo "${as_me-configure}:2920: testing adding $cf_add_libdir to library-path ..." 1>&5
+CPPFLAGS=`echo "$CPPFLAGS" | \
+	sed	-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?[ 	]/ /g' \
+		-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?$//g'`
 
+				;;
+			esac
+			cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
+			;;
+		esac
+		;;
+	*)
+		cf_new_cflags="$cf_new_cflags $cf_add_cflags"
+		;;
+	esac
+	;;
+yes)
+	cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
 
-        LDFLAGS="-L$cf_add_libdir $LDFLAGS"
-      fi
-    fi
-  done
-fi
+	cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
 
-      LIBS="$LIBS -lcurses -ltermcap"
-    fi
-    ac_cv_func_initscr=yes
-    ;;
+	test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+		&& test -z "${cf_tst_cflags}" \
+		&& cf_fix_cppflags=no
+	;;
 esac
+done
 
-if test ".$ac_cv_func_initscr" != .yes ; then
-    cf_save_LIBS="$LIBS"
-    cf_term_lib=""
-    cf_curs_lib=""
-
-    if test ".${cf_cv_ncurses_version-no}" != .no
-    then
-        cf_check_list="ncurses curses cursesX"
-    else
-        cf_check_list="cursesX curses ncurses"
-    fi
-
-    # Check for library containing tgoto.  Do this before curses library
-    # because it may be needed to link the test-case for initscr.
-    echo $ac_n "checking for tgoto""... $ac_c" 1>&6
-echo "configure:2950: checking for tgoto" >&5
-if eval "test \"`echo '$''{'ac_cv_func_tgoto'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 2955 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char tgoto(); below.  */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char tgoto();
-
-int main() {
-
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined (__stub_tgoto) || defined (__stub___tgoto)
-choke me
-#else
-tgoto();
-#endif
+if test -n "$cf_new_cflags" ; then
 
-; return 0; }
-EOF
-if { (eval echo configure:2978: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func_tgoto=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_tgoto=no"
-fi
-rm -f conftest*
+	CFLAGS="$CFLAGS $cf_new_cflags"
 fi
 
-if eval "test \"`echo '$ac_cv_func_'tgoto`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  cf_term_lib=predefined
-else
-  echo "$ac_t""no" 1>&6
-
-        for cf_term_lib in $cf_check_list termcap termlib unknown
-        do
-            echo $ac_n "checking for tgoto in -l$cf_term_lib""... $ac_c" 1>&6
-echo "configure:2999: checking for tgoto in -l$cf_term_lib" >&5
-ac_lib_var=`echo $cf_term_lib'_'tgoto | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  ac_save_LIBS="$LIBS"
-LIBS="-l$cf_term_lib  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 3007 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char tgoto();
+if test -n "$cf_new_cppflags" ; then
 
-int main() {
-tgoto()
-; return 0; }
-EOF
-if { (eval echo configure:3018: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+	CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
 fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
 
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  break
-else
-  echo "$ac_t""no" 1>&6
-fi
+if test -n "$cf_new_extra_cppflags" ; then
 
-        done
-    
+	EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
 fi
 
+		;;
+	esac
+	;;
+esac
+
+echo "$as_me:4587: checking if you want to perform memory-leak testing" >&5
+echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
 
-    # Check for library containing initscr
-    test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
-    for cf_curs_lib in $cf_check_list xcurses jcurses unknown
-    do
-        echo $ac_n "checking for initscr in -l$cf_curs_lib""... $ac_c" 1>&6
-echo "configure:3048: checking for initscr in -l$cf_curs_lib" >&5
-ac_lib_var=`echo $cf_curs_lib'_'initscr | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+# Check whether --enable-leaks or --disable-leaks was given.
+if test "${enable_leaks+set}" = set; then
+  enableval="$enable_leaks"
+  if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
 else
-  ac_save_LIBS="$LIBS"
-LIBS="-l$cf_curs_lib  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 3056 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char initscr();
+  : ${with_no_leaks:=no}
+fi;
+echo "$as_me:4597: result: $with_no_leaks" >&5
+echo "${ECHO_T}$with_no_leaks" >&6
 
-int main() {
-initscr()
-; return 0; }
+if test "$with_no_leaks" = yes ; then
+	cat >>confdefs.h <<\EOF
+#define NO_LEAKS 1
+EOF
+
+	cat >>confdefs.h <<\EOF
+#define YY_NO_LEAKS 1
 EOF
-if { (eval echo configure:3067: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
 
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  break
-else
-  echo "$ac_t""no" 1>&6
 fi
 
-    done
-    test $cf_curs_lib = unknown && { echo "configure: error: no curses library found" 1>&2; exit 1; }
+echo "$as_me:4611: checking for specific curses-directory" >&5
+echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
 
-    LIBS="-l$cf_curs_lib $cf_save_LIBS"
-    if test "$cf_term_lib" = unknown ; then
-        echo $ac_n "checking if we can link with $cf_curs_lib library""... $ac_c" 1>&6
-echo "configure:3093: checking if we can link with $cf_curs_lib library" >&5
-        cat > conftest.$ac_ext <<EOF
-#line 3095 "configure"
-#include "confdefs.h"
-#include <${cf_cv_ncurses_header-curses.h}>
-int main() {
-initscr()
-; return 0; }
-EOF
-if { (eval echo configure:3102: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  cf_result=yes
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  cf_result=no
-fi
-rm -f conftest*
-        echo "$ac_t""$cf_result" 1>&6
-        test $cf_result = no && { echo "configure: error: Cannot link curses library" 1>&2; exit 1; }
-    elif test "$cf_curs_lib" = "$cf_term_lib" ; then
-        :
-    elif test "$cf_term_lib" != predefined ; then
-        echo $ac_n "checking if we need both $cf_curs_lib and $cf_term_lib libraries""... $ac_c" 1>&6
-echo "configure:3118: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
-        cat > conftest.$ac_ext <<EOF
-#line 3120 "configure"
-#include "confdefs.h"
-#include <${cf_cv_ncurses_header-curses.h}>
-int main() {
-initscr(); tgoto((char *)0, 0, 0);
-; return 0; }
-EOF
-if { (eval echo configure:3127: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  cf_result=no
+# Check whether --with-curses-dir or --without-curses-dir was given.
+if test "${with_curses_dir+set}" = set; then
+  withval="$with_curses_dir"
+  cf_cv_curses_dir=$withval
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  
-            LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
-            cat > conftest.$ac_ext <<EOF
-#line 3137 "configure"
-#include "confdefs.h"
-#include <${cf_cv_ncurses_header-curses.h}>
-int main() {
-initscr()
-; return 0; }
-EOF
-if { (eval echo configure:3144: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  cf_result=yes
+  cf_cv_curses_dir=no
+fi;
+echo "$as_me:4621: result: $cf_cv_curses_dir" >&5
+echo "${ECHO_T}$cf_cv_curses_dir" >&6
+
+if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
+then
+
+if test "x$prefix" != xNONE; then
+  cf_path_syntax="$prefix"
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  cf_result=error
-fi
-rm -f conftest*
-            
-fi
-rm -f conftest*
-        echo "$ac_t""$cf_result" 1>&6
-    fi
-fi
+  cf_path_syntax="$ac_default_prefix"
 fi
 
+case ".$withval" in #(vi
+.\$\(*\)*|.\'*\'*) #(vi
+  ;;
+..|./*|.\\*) #(vi
+  ;;
+.[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
+  ;;
+.\${*prefix}*) #(vi
+  eval withval="$withval"
+  case ".$withval" in #(vi
+  .NONE/*)
+    withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
+    ;;
+  esac
+  ;; #(vi
+.no|.NONE/*)
+  withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
+  ;;
+*)
+  { { echo "$as_me:4652: error: expected a pathname, not \"$withval\"" >&5
+echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
+   { (exit 1); exit 1; }; }
+  ;;
+esac
 
-	;;
-ncurses)
-	
-
-cf_ncuhdr_root=ncurses
+	if test -d "$cf_cv_curses_dir"
+	then
 
-test -n "$cf_cv_curses_dir" && \
-test "$cf_cv_curses_dir" != "no" && { \
-  
-if test -n "$cf_cv_curses_dir/include $cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
-  for cf_add_incdir in $cf_cv_curses_dir/include $cf_cv_curses_dir/include/$cf_ncuhdr_root
+if test -n "$cf_cv_curses_dir/include" ; then
+  for cf_add_incdir in $cf_cv_curses_dir/include
   do
 	while test $cf_add_incdir != /usr/include
 	do
@@ -3186,28 +4676,42 @@
 		fi
 
 		if test "$cf_have_incdir" = no ; then
-          if test "$cf_add_incdir" = /usr/local/include ; then
+		  if test "$cf_add_incdir" = /usr/local/include ; then
 			if test "$GCC" = yes
 			then
 			  cf_save_CPPFLAGS=$CPPFLAGS
 			  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
-			  cat > conftest.$ac_ext <<EOF
-#line 3196 "configure"
+			  cat >conftest.$ac_ext <<_ACEOF
+#line 4685 "configure"
 #include "confdefs.h"
 #include <stdio.h>
-int main() {
+int
+main ()
+{
 printf("Hello")
-; return 0; }
-EOF
-if { (eval echo configure:3203: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:4697: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:4700: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:4703: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:4706: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   :
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  cf_have_incdir=yes
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_have_incdir=yes
 fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
 			  CPPFLAGS=$cf_save_CPPFLAGS
 			fi
 		  fi
@@ -3216,14 +4720,13 @@
 		if test "$cf_have_incdir" = no ; then
 		  test -n "$verbose" && echo "	adding $cf_add_incdir to include-path" 1>&6
 
-echo "${as_me-configure}:3220: testing adding $cf_add_incdir to include-path ..." 1>&5
+echo "${as_me:-configure}:4723: testing adding $cf_add_incdir to include-path ..." 1>&5
 
+		  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
 
-		  CPPFLAGS="-I$cf_add_incdir $CPPFLAGS"
-
-          cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
-          test "$cf_top_incdir" = "$cf_add_incdir" && break
-          cf_add_incdir="$cf_top_incdir"
+		  cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
+		  test "$cf_top_incdir" = "$cf_add_incdir" && break
+		  cf_add_incdir="$cf_top_incdir"
 		else
 		  break
 		fi
@@ -3232,486 +4735,311 @@
   done
 fi
 
-}
-
-echo $ac_n "checking for $cf_ncuhdr_root header in include-path""... $ac_c" 1>&6
-echo "configure:3239: checking for $cf_ncuhdr_root header in include-path" >&5
-if eval "test \"`echo '$''{'cf_cv_ncurses_h'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  
-	cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
-	( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
-	for cf_header in $cf_header_list
-	do
-		
-	cat > conftest.$ac_ext <<EOF
-#line 3250 "configure"
-#include "confdefs.h"
-
+if test -n "$cf_cv_curses_dir/lib" ; then
+  for cf_add_libdir in $cf_cv_curses_dir/lib
+  do
+    if test $cf_add_libdir = /usr/lib ; then
+      :
+    elif test -d $cf_add_libdir
+    then
+      cf_have_libdir=no
+      if test -n "$LDFLAGS$LIBS" ; then
+        # a loop is needed to ensure we can add subdirs of existing dirs
+        for cf_test_libdir in $LDFLAGS $LIBS ; do
+          if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
+            cf_have_libdir=yes; break
+          fi
+        done
+      fi
+      if test "$cf_have_libdir" = no ; then
+        test -n "$verbose" && echo "	adding $cf_add_libdir to library-path" 1>&6
 
-#include <$cf_header>
-int main() {
+echo "${as_me:-configure}:4757: testing adding $cf_add_libdir to library-path ..." 1>&5
 
-#ifdef NCURSES_VERSION
+        LDFLAGS="-L$cf_add_libdir $LDFLAGS"
+      fi
+    fi
+  done
+fi
 
-printf("%s\n", NCURSES_VERSION);
-#else
-#ifdef __NCURSES_H
-printf("old\n");
-#else
-	make an error
-#endif
-#endif
-	
-	
-; return 0; }
-EOF
-if { (eval echo configure:3271: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
-  cf_cv_ncurses_h=$cf_header
-	
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  cf_cv_ncurses_h=no
+	fi
 fi
-rm -f conftest*
 
-		test "$cf_cv_ncurses_h" != no && break
-	done
+# Check whether --with-5lib or --without-5lib was given.
+if test "${with_5lib+set}" = set; then
+  withval="$with_5lib"
+  LIBS="-L/usr/5lib $LIBS"
+	 CPPFLAGS="$CPPFLAGS -I/usr/5include"
+fi;
 
-fi
+# Check whether --with-ncursesw or --without-ncursesw was given.
+if test "${with_ncursesw+set}" = set; then
+  withval="$with_ncursesw"
+  cf_cv_screen=ncursesw
+else
 
-echo "$ac_t""$cf_cv_ncurses_h" 1>&6
+# Check whether --with-ncurses or --without-ncurses was given.
+if test "${with_ncurses+set}" = set; then
+  withval="$with_ncurses"
+  cf_cv_screen=ncurses
+else
 
+# Check whether --with-pdcurses or --without-pdcurses was given.
+if test "${with_pdcurses+set}" = set; then
+  withval="$with_pdcurses"
+  cf_cv_screen=pdcurses
+fi;
+fi;
+fi;
 
+case $cf_cv_screen in
+curses)
 
-if test "$cf_cv_ncurses_h" != no ; then
-	cf_cv_ncurses_header=$cf_cv_ncurses_h
+echo "$as_me:4798: checking for extra include directories" >&5
+echo $ECHO_N "checking for extra include directories... $ECHO_C" >&6
+if test "${cf_cv_curses_incdir+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-echo $ac_n "checking for $cf_ncuhdr_root include-path""... $ac_c" 1>&6
-echo "configure:3297: checking for $cf_ncuhdr_root include-path" >&5
-if eval "test \"`echo '$''{'cf_cv_ncurses_h2'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  
-	test -n "$verbose" && echo
-	cf_search=""
+cf_cv_curses_incdir=no
+case $host_os in #(vi
+hpux10.*) #(vi
+	test -d /usr/include/curses_colr && \
+	cf_cv_curses_incdir="-I/usr/include/curses_colr"
+	;;
+sunos3*|sunos4*)
+	test -d /usr/5lib && \
+	test -d /usr/5include && \
+	cf_cv_curses_incdir="-I/usr/5include"
+	;;
+esac
 
+fi
+echo "$as_me:4818: result: $cf_cv_curses_incdir" >&5
+echo "${ECHO_T}$cf_cv_curses_incdir" >&6
+test "$cf_cv_curses_incdir" != no && CPPFLAGS="$CPPFLAGS $cf_cv_curses_incdir"
+
+echo "$as_me:4822: checking if we have identified curses headers" >&5
+echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
+if test "${cf_cv_ncurses_header+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
 
-test "/usr" != "$prefix" && \
-test -d "/usr" && \
-(test $prefix = NONE || test -d $prefix) && {
-	test -n "$verbose" && echo "	... testing for include-directories under /usr"
-	test -d /usr/include &&          cf_search="$cf_search /usr/include"
-	test -d /usr/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
-	test -d /usr/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include"
-	test -d /usr/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/$cf_ncuhdr_root/include"
-	test -d /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
+cf_cv_ncurses_header=none
+for cf_header in  \
+	curses.h \
+	ncurses.h ncurses/curses.h ncurses/ncurses.h
+do
+cat >conftest.$ac_ext <<_ACEOF
+#line 4834 "configure"
+#include "confdefs.h"
+#include <${cf_header}>
+int
+main ()
+{
+initscr(); tgoto("?", 0,0)
+  ;
+  return 0;
 }
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:4846: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:4849: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:4852: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:4855: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_ncurses_header=$cf_header; break
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+done
 
+fi
+echo "$as_me:4866: result: $cf_cv_ncurses_header" >&5
+echo "${ECHO_T}$cf_cv_ncurses_header" >&6
 
-test "$prefix" != "NONE" && \
-test -d "$prefix" && \
- {
-	test -n "$verbose" && echo "	... testing for include-directories under $prefix"
-	test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
-	test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
-	test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
-	test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
-	test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
-}
-
+if test "$cf_cv_ncurses_header" = none ; then
+	{ { echo "$as_me:4870: error: No curses header-files found" >&5
+echo "$as_me: error: No curses header-files found" >&2;}
+   { (exit 1); exit 1; }; }
+fi
 
-test "/usr/local" != "$prefix" && \
-test -d "/usr/local" && \
-(test $prefix = NONE || test -d $prefix) && {
-	test -n "$verbose" && echo "	... testing for include-directories under /usr/local"
-	test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
-	test -d /usr/local/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
-	test -d /usr/local/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include"
-	test -d /usr/local/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include"
-	test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
-}
+# cheat, to get the right #define's for HAVE_NCURSES_H, etc.
 
+for ac_header in $cf_cv_ncurses_header
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+echo "$as_me:4880: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 4886 "configure"
+#include "confdefs.h"
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:4890: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  egrep -v '^ *\+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:4896: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  eval "$as_ac_Header=yes"
+else
+  echo "$as_me: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  eval "$as_ac_Header=no"
+fi
+rm -f conftest.err conftest.$ac_ext
+fi
+echo "$as_me:4915: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+EOF
 
-test "/opt" != "$prefix" && \
-test -d "/opt" && \
-(test $prefix = NONE || test -d $prefix) && {
-	test -n "$verbose" && echo "	... testing for include-directories under /opt"
-	test -d /opt/include &&          cf_search="$cf_search /opt/include"
-	test -d /opt/include/$cf_ncuhdr_root &&       cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
-	test -d /opt/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include"
-	test -d /opt/$cf_ncuhdr_root/include &&       cf_search="$cf_search /opt/$cf_ncuhdr_root/include"
-	test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
-}
+fi
+done
 
+echo "$as_me:4925: checking for terminfo header" >&5
+echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
+if test "${cf_cv_term_header+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
 
-test "$HOME" != "$prefix" && \
-test -d "$HOME" && \
-(test $prefix = NONE || test -d $prefix) && {
-	test -n "$verbose" && echo "	... testing for include-directories under $HOME"
-	test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
-	test -d $HOME/include/$cf_ncuhdr_root &&       cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
-	test -d $HOME/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include"
-	test -d $HOME/$cf_ncuhdr_root/include &&       cf_search="$cf_search $HOME/$cf_ncuhdr_root/include"
-	test -d $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
-}
+case ${cf_cv_ncurses_header} in #(vi
+*/ncurses.h|*/ncursesw.h) #(vi
+	cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
+	;;
+*)
+	cf_term_header=term.h
+	;;
+esac
 
+for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
+do
+cat >conftest.$ac_ext <<_ACEOF
+#line 4943 "configure"
+#include "confdefs.h"
+#include <stdio.h>
+#include <${cf_cv_ncurses_header:-curses.h}>
+#include <$cf_test>
 
-test "$includedir" != NONE && \
-test "$includedir" != "/usr/include" && \
-test -d "$includedir" && {
-	test -d $includedir &&    cf_search="$cf_search $includedir"
-	test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
+int
+main ()
+{
+int x = auto_left_margin
+  ;
+  return 0;
 }
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:4958: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:4961: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:4964: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:4967: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
 
-test "$oldincludedir" != NONE && \
-test "$oldincludedir" != "/usr/include" && \
-test -d "$oldincludedir" && {
-	test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
-	test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
-}
+	cf_cv_term_header="$cf_test"
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
 
+	cf_cv_term_header=unknown
 
-	test -n "$verbose" && echo search path $cf_search
-	cf_save2_CPPFLAGS="$CPPFLAGS"
-	for cf_incdir in $cf_search
-	do
-		
-if test -n "$cf_incdir" ; then
-  for cf_add_incdir in $cf_incdir
-  do
-	while test $cf_add_incdir != /usr/include
-	do
-	  if test -d $cf_add_incdir
-	  then
-		cf_have_incdir=no
-		if test -n "$CFLAGS$CPPFLAGS" ; then
-		  # a loop is needed to ensure we can add subdirs of existing dirs
-		  for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
-			if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
-			  cf_have_incdir=yes; break
-			fi
-		  done
-		fi
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+	test "$cf_cv_term_header" != unknown && break
+done
 
-		if test "$cf_have_incdir" = no ; then
-          if test "$cf_add_incdir" = /usr/local/include ; then
-			if test "$GCC" = yes
-			then
-			  cf_save_CPPFLAGS=$CPPFLAGS
-			  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
-			  cat > conftest.$ac_ext <<EOF
-#line 3410 "configure"
-#include "confdefs.h"
-#include <stdio.h>
-int main() {
-printf("Hello")
-; return 0; }
-EOF
-if { (eval echo configure:3417: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  :
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  cf_have_incdir=yes
 fi
-rm -f conftest*
-			  CPPFLAGS=$cf_save_CPPFLAGS
-			fi
-		  fi
-		fi
+echo "$as_me:4983: result: $cf_cv_term_header" >&5
+echo "${ECHO_T}$cf_cv_term_header" >&6
 
-		if test "$cf_have_incdir" = no ; then
-		  test -n "$verbose" && echo "	adding $cf_add_incdir to include-path" 1>&6
+# Set definitions to allow ifdef'ing to accommodate subdirectories
 
-echo "${as_me-configure}:3434: testing adding $cf_add_incdir to include-path ..." 1>&5
+case $cf_cv_term_header in # (vi
+*term.h)
+	cat >>confdefs.h <<\EOF
+#define HAVE_TERM_H 1
+EOF
 
+	;;
+esac
 
-		  CPPFLAGS="-I$cf_add_incdir $CPPFLAGS"
+case $cf_cv_term_header in # (vi
+ncurses/term.h) #(vi
+	cat >>confdefs.h <<\EOF
+#define HAVE_NCURSES_TERM_H 1
+EOF
 
-          cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
-          test "$cf_top_incdir" = "$cf_add_incdir" && break
-          cf_add_incdir="$cf_top_incdir"
-		else
-		  break
-		fi
-	  fi
-	done
-  done
-fi
+	;;
+ncursesw/term.h)
+	cat >>confdefs.h <<\EOF
+#define HAVE_NCURSESW_TERM_H 1
+EOF
 
-		for cf_header in \
-			ncurses.h \
-			curses.h
-		do
-			
-	cat > conftest.$ac_ext <<EOF
-#line 3456 "configure"
-#include "confdefs.h"
+	;;
+esac
 
+echo "$as_me:5012: checking for ncurses version" >&5
+echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
+if test "${cf_cv_ncurses_version+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
 
-#include <$cf_header>
-int main() {
+	cf_cv_ncurses_version=no
+	cf_tempfile=out$$
+	rm -f $cf_tempfile
+	if test "$cross_compiling" = yes; then
 
+	# This will not work if the preprocessor splits the line after the
+	# Autoconf token.  The 'unproto' program does that.
+	cat > conftest.$ac_ext <<EOF
+#include <${cf_cv_ncurses_header:-curses.h}>
+#undef Autoconf
 #ifdef NCURSES_VERSION
-
-printf("%s\n", NCURSES_VERSION);
+Autoconf NCURSES_VERSION
 #else
 #ifdef __NCURSES_H
-printf("old\n");
-#else
-	make an error
+Autoconf "old"
 #endif
-#endif
-	
-	
-; return 0; }
-EOF
-if { (eval echo configure:3477: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
-  cf_cv_ncurses_h2=$cf_header
-	
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  cf_cv_ncurses_h2=no
-fi
-rm -f conftest*
-
-			if test "$cf_cv_ncurses_h2" != no ; then
-				cf_cv_ncurses_h2=$cf_incdir/$cf_header
-				test -n "$verbose" && echo $ac_n "	... found $ac_c" 1>&6
-				break
-			fi
-			test -n "$verbose" && echo "	... tested $cf_incdir/$cf_header" 1>&6
-		done
-		CPPFLAGS="$cf_save2_CPPFLAGS"
-		test "$cf_cv_ncurses_h2" != no && break
-	done
-	test "$cf_cv_ncurses_h2" = no && { echo "configure: error: not found" 1>&2; exit 1; }
-	
-fi
-
-echo "$ac_t""$cf_cv_ncurses_h2" 1>&6
-
-	cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
-	cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
-	if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
-		cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
-	fi
-	
-if test -n "$cf_1st_incdir" ; then
-  for cf_add_incdir in $cf_1st_incdir
-  do
-	while test $cf_add_incdir != /usr/include
-	do
-	  if test -d $cf_add_incdir
-	  then
-		cf_have_incdir=no
-		if test -n "$CFLAGS$CPPFLAGS" ; then
-		  # a loop is needed to ensure we can add subdirs of existing dirs
-		  for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
-			if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
-			  cf_have_incdir=yes; break
-			fi
-		  done
-		fi
-
-		if test "$cf_have_incdir" = no ; then
-          if test "$cf_add_incdir" = /usr/local/include ; then
-			if test "$GCC" = yes
-			then
-			  cf_save_CPPFLAGS=$CPPFLAGS
-			  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
-			  cat > conftest.$ac_ext <<EOF
-#line 3535 "configure"
-#include "confdefs.h"
-#include <stdio.h>
-int main() {
-printf("Hello")
-; return 0; }
-EOF
-if { (eval echo configure:3542: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  :
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  cf_have_incdir=yes
-fi
-rm -f conftest*
-			  CPPFLAGS=$cf_save_CPPFLAGS
-			fi
-		  fi
-		fi
-
-		if test "$cf_have_incdir" = no ; then
-		  test -n "$verbose" && echo "	adding $cf_add_incdir to include-path" 1>&6
-
-echo "${as_me-configure}:3559: testing adding $cf_add_incdir to include-path ..." 1>&5
-
-
-		  CPPFLAGS="-I$cf_add_incdir $CPPFLAGS"
-
-          cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
-          test "$cf_top_incdir" = "$cf_add_incdir" && break
-          cf_add_incdir="$cf_top_incdir"
-		else
-		  break
-		fi
-	  fi
-	done
-  done
-fi
-
-
-fi
-
-# Set definitions to allow ifdef'ing for ncurses.h
-
-case $cf_cv_ncurses_header in # (vi
-*ncurses.h)
-	cat >> confdefs.h <<\EOF
-#define HAVE_NCURSES_H 1
-EOF
-
-	;;
-esac
-
-case $cf_cv_ncurses_header in # (vi
-ncurses/curses.h|ncurses/ncurses.h)
-	cat >> confdefs.h <<\EOF
-#define HAVE_NCURSES_NCURSES_H 1
-EOF
-
-	;;
-ncursesw/curses.h|ncursesw/ncurses.h)
-	cat >> confdefs.h <<\EOF
-#define HAVE_NCURSESW_NCURSES_H 1
-EOF
-
-	;;
-esac
-
-
-
-echo $ac_n "checking for terminfo header""... $ac_c" 1>&6
-echo "configure:3607: checking for terminfo header" >&5
-if eval "test \"`echo '$''{'cf_cv_term_header'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  
-case ${cf_cv_ncurses_header} in #(vi
-*/ncurses.h|*/ncursesw.h) #(vi
-	cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
-	;;
-*)
-	cf_term_header=term.h
-	;;
-esac
-
-for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
-do
-cat > conftest.$ac_ext <<EOF
-#line 3624 "configure"
-#include "confdefs.h"
-#include <stdio.h>
-#include <${cf_cv_ncurses_header-curses.h}>
-#include <$cf_test>
-
-int main() {
-int x = auto_left_margin
-; return 0; }
-EOF
-if { (eval echo configure:3634: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
-  
-	cf_cv_term_header="$cf_test"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  
-	cf_cv_term_header=unknown
-	
-fi
-rm -f conftest*
-	test "$cf_cv_term_header" != unknown && break
-done
-
-fi
-
-echo "$ac_t""$cf_cv_term_header" 1>&6
-
-# Set definitions to allow ifdef'ing to accommodate subdirectories
-
-case $cf_cv_term_header in # (vi
-*term.h)
-	cat >> confdefs.h <<\EOF
-#define HAVE_TERM_H 1
-EOF
-
-	;;
-esac
-
-case $cf_cv_term_header in # (vi
-ncurses/term.h) #(vi
-	cat >> confdefs.h <<\EOF
-#define HAVE_NCURSES_TERM_H 1
-EOF
-
-	;;
-ncursesw/term.h)
-	cat >> confdefs.h <<\EOF
-#define HAVE_NCURSESW_TERM_H 1
-EOF
-
-	;;
-esac
-
-
-# some applications need this, but should check for NCURSES_VERSION
-cat >> confdefs.h <<\EOF
-#define NCURSES 1
-EOF
-
-
-
-echo $ac_n "checking for ncurses version""... $ac_c" 1>&6
-echo "configure:3689: checking for ncurses version" >&5
-if eval "test \"`echo '$''{'cf_cv_ncurses_version'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  
-	cf_cv_ncurses_version=no
-	cf_tempfile=out$$
-	rm -f $cf_tempfile
-	if test "$cross_compiling" = yes; then
-  
-
-	# This will not work if the preprocessor splits the line after the
-	# Autoconf token.  The 'unproto' program does that.
-	cat > conftest.$ac_ext <<EOF
-#include <${cf_cv_ncurses_header-curses.h}>
-#undef Autoconf
-#ifdef NCURSES_VERSION
-Autoconf NCURSES_VERSION
-#else
-#ifdef __NCURSES_H
-Autoconf "old"
-#endif
-;
+;
 #endif
 EOF
 	cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
-	{ (eval echo configure:3715: \"$cf_try\") 1>&5; (eval $cf_try) 2>&5; }
+	{ (eval echo "$as_me:5038: \"$cf_try\"") >&5
+  (eval $cf_try) 2>&5
+  ac_status=$?
+  echo "$as_me:5041: \$? = $ac_status" >&5
+  (exit $ac_status); }
 	if test -f conftest.out ; then
 		cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
 		test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
@@ -3719,11 +5047,11 @@
 	fi
 
 else
-  cat > conftest.$ac_ext <<EOF
-#line 3724 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 5051 "configure"
 #include "confdefs.h"
 
-#include <${cf_cv_ncurses_header-curses.h}>
+#include <${cf_cv_ncurses_header:-curses.h}>
 #include <stdio.h>
 int main()
 {
@@ -3741,176 +5069,253 @@
 	make an error
 # endif
 #endif
-	${cf_cv_main_return-return}(0);
+	${cf_cv_main_return:-return}(0);
 }
-EOF
-if { (eval echo configure:3748: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
-  
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:5076: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:5079: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:5081: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:5084: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+
 	cf_cv_ncurses_version=`cat $cf_tempfile`
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
 fi
-rm -fr conftest*
+rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
-
 	rm -f $cf_tempfile
 
 fi
-
-echo "$ac_t""$cf_cv_ncurses_version" 1>&6
-test "$cf_cv_ncurses_version" = no || cat >> confdefs.h <<\EOF
+echo "$as_me:5098: result: $cf_cv_ncurses_version" >&5
+echo "${ECHO_T}$cf_cv_ncurses_version" >&6
+test "$cf_cv_ncurses_version" = no || cat >>confdefs.h <<\EOF
 #define NCURSES 1
 EOF
 
+echo "$as_me:5104: checking if we have identified curses libraries" >&5
+echo $ECHO_N "checking if we have identified curses libraries... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line 5107 "configure"
+#include "confdefs.h"
+#include <${cf_cv_ncurses_header:-curses.h}>
+int
+main ()
+{
+initscr(); tgoto("?", 0,0)
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:5119: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:5122: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:5125: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:5128: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_result=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_result=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+echo "$as_me:5137: result: $cf_result" >&5
+echo "${ECHO_T}$cf_result" >&6
 
-
-	
-
-cf_nculib_root=ncurses
-	# This works, except for the special case where we find gpm, but
-	# ncurses is in a nonstandard location via $LIBS, and we really want
-	# to link gpm.
-cf_ncurses_LIBS=""
-cf_ncurses_SAVE="$LIBS"
-echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6
-echo "configure:3779: checking for Gpm_Open in -lgpm" >&5
-ac_lib_var=`echo gpm'_'Gpm_Open | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+if test "$cf_result" = no ; then
+case $host_os in #(vi
+freebsd*) #(vi
+    echo "$as_me:5143: checking for tgoto in -lmytinfo" >&5
+echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
+if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_save_LIBS="$LIBS"
-LIBS="-lgpm  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 3787 "configure"
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lmytinfo  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line 5151 "configure"
 #include "confdefs.h"
+
 /* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
 /* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char Gpm_Open();
-
-int main() {
-Gpm_Open()
-; return 0; }
-EOF
-if { (eval echo configure:3798: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+   builtin and then its argument prototype would still apply.  */
+char tgoto ();
+int
+main ()
+{
+tgoto ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:5170: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:5173: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:5176: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:5179: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_mytinfo_tgoto=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_mytinfo_tgoto=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:5190: result: $ac_cv_lib_mytinfo_tgoto" >&5
+echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
+if test $ac_cv_lib_mytinfo_tgoto = yes; then
+  LIBS="-lmytinfo $LIBS"
 fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
 
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  echo $ac_n "checking for initscr in -lgpm""... $ac_c" 1>&6
-echo "configure:3814: checking for initscr in -lgpm" >&5
-ac_lib_var=`echo gpm'_'initscr | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+    ;;
+hpux10.*) #(vi
+    echo "$as_me:5198: checking for initscr in -lcur_colr" >&5
+echo $ECHO_N "checking for initscr in -lcur_colr... $ECHO_C" >&6
+if test "${ac_cv_lib_cur_colr_initscr+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_save_LIBS="$LIBS"
-LIBS="-lgpm  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 3822 "configure"
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lcur_colr  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line 5206 "configure"
 #include "confdefs.h"
+
 /* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
 /* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char initscr();
-
-int main() {
-initscr()
-; return 0; }
-EOF
-if { (eval echo configure:3833: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
+   builtin and then its argument prototype would still apply.  */
+char initscr ();
+int
+main ()
+{
+initscr ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:5225: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:5228: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:5231: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:5234: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_cur_colr_initscr=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_cur_colr_initscr=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:5245: result: $ac_cv_lib_cur_colr_initscr" >&5
+echo "${ECHO_T}$ac_cv_lib_cur_colr_initscr" >&6
+if test $ac_cv_lib_cur_colr_initscr = yes; then
 
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  LIBS="$cf_ncurses_SAVE"
-else
-  echo "$ac_t""no" 1>&6
-cf_ncurses_LIBS="-lgpm"
-fi
+        LIBS="-lcur_colr $LIBS"
+        ac_cv_func_initscr=yes
 
 else
-  echo "$ac_t""no" 1>&6
-fi
-
 
-case $host_os in #(vi
-freebsd*)
-	# This is only necessary if you are linking against an obsolete
-	# version of ncurses (but it should do no harm, since it's static).
-	if test "$cf_nculib_root" = ncurses ; then
-		echo $ac_n "checking for tgoto in -lmytinfo""... $ac_c" 1>&6
-echo "configure:3865: checking for tgoto in -lmytinfo" >&5
-ac_lib_var=`echo mytinfo'_'tgoto | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+    echo "$as_me:5254: checking for initscr in -lHcurses" >&5
+echo $ECHO_N "checking for initscr in -lHcurses... $ECHO_C" >&6
+if test "${ac_cv_lib_Hcurses_initscr+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_save_LIBS="$LIBS"
-LIBS="-lmytinfo  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 3873 "configure"
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lHcurses  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line 5262 "configure"
 #include "confdefs.h"
+
 /* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
 /* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char tgoto();
+   builtin and then its argument prototype would still apply.  */
+char initscr ();
+int
+main ()
+{
+initscr ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:5281: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:5284: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:5287: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:5290: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_Hcurses_initscr=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_Hcurses_initscr=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:5301: result: $ac_cv_lib_Hcurses_initscr" >&5
+echo "${ECHO_T}$ac_cv_lib_Hcurses_initscr" >&6
+if test $ac_cv_lib_Hcurses_initscr = yes; then
+
+        # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
+        LIBS="-lHcurses $LIBS"
+        CPPFLAGS="$CPPFLAGS -D__HP_CURSES -D_HP_CURSES"
+        ac_cv_func_initscr=yes
 
-int main() {
-tgoto()
-; return 0; }
-EOF
-if { (eval echo configure:3884: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
 fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
 
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
-else
-  echo "$ac_t""no" 1>&6
-fi
-
-	fi
-	;;
-esac
 
-LIBS="$cf_ncurses_LIBS $LIBS"
+    ;;
+linux*) # Suse Linux does not follow /usr/lib convention
 
-if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
-then
-	
-if test -n "$cf_cv_curses_dir/lib" ; then
-  for cf_add_libdir in $cf_cv_curses_dir/lib
+if test -n "/lib" ; then
+  for cf_add_libdir in /lib
   do
     if test $cf_add_libdir = /usr/lib ; then
       :
@@ -3928,8 +5333,38 @@
       if test "$cf_have_libdir" = no ; then
         test -n "$verbose" && echo "	adding $cf_add_libdir to library-path" 1>&6
 
-echo "${as_me-configure}:3932: testing adding $cf_add_libdir to library-path ..." 1>&5
+echo "${as_me:-configure}:5336: testing adding $cf_add_libdir to library-path ..." 1>&5
+
+        LDFLAGS="-L$cf_add_libdir $LDFLAGS"
+      fi
+    fi
+  done
+fi
+
+    ;;
+sunos3*|sunos4*)
+    if test -d /usr/5lib ; then
+
+if test -n "/usr/5lib" ; then
+  for cf_add_libdir in /usr/5lib
+  do
+    if test $cf_add_libdir = /usr/lib ; then
+      :
+    elif test -d $cf_add_libdir
+    then
+      cf_have_libdir=no
+      if test -n "$LDFLAGS$LIBS" ; then
+        # a loop is needed to ensure we can add subdirs of existing dirs
+        for cf_test_libdir in $LDFLAGS $LIBS ; do
+          if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
+            cf_have_libdir=yes; break
+          fi
+        done
+      fi
+      if test "$cf_have_libdir" = no ; then
+        test -n "$verbose" && echo "	adding $cf_add_libdir to library-path" 1>&6
 
+echo "${as_me:-configure}:5367: testing adding $cf_add_libdir to library-path ..." 1>&5
 
         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
       fi
@@ -3937,298 +5372,508 @@
   done
 fi
 
-	LIBS="-l$cf_nculib_root $LIBS"
-else
-	
-	eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
-	cf_libdir=""
-	echo $ac_n "checking for initscr""... $ac_c" 1>&6
-echo "configure:3947: checking for initscr" >&5
-if eval "test \"`echo '$''{'ac_cv_func_initscr'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+      LIBS="-lcurses -ltermcap $LIBS"
+    fi
+    ac_cv_func_initscr=yes
+    ;;
+esac
+
+if test ".$ac_cv_func_initscr" != .yes ; then
+    cf_save_LIBS="$LIBS"
+    cf_term_lib=""
+    cf_curs_lib=""
+
+    if test ".${cf_cv_ncurses_version:-no}" != .no
+    then
+        cf_check_list="ncurses curses cursesX"
+    else
+        cf_check_list="cursesX curses ncurses"
+    fi
+
+    # Check for library containing tgoto.  Do this before curses library
+    # because it may be needed to link the test-case for initscr.
+    echo "$as_me:5395: checking for tgoto" >&5
+echo $ECHO_N "checking for tgoto... $ECHO_C" >&6
+if test "${ac_cv_func_tgoto+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 3952 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 5401 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char initscr(); below.  */
+    which can conflict with char tgoto (); below.  */
 #include <assert.h>
 /* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
 /* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char initscr();
-
-int main() {
+   builtin and then its argument prototype would still apply.  */
+char tgoto ();
+char (*f) ();
 
+int
+main ()
+{
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined (__stub_initscr) || defined (__stub___initscr)
+#if defined (__stub_tgoto) || defined (__stub___tgoto)
 choke me
 #else
-initscr();
+f = tgoto;
 #endif
 
-; return 0; }
-EOF
-if { (eval echo configure:3975: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func_initscr=yes"
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:5432: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:5435: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:5438: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:5441: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_tgoto=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_func_tgoto=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:5451: result: $ac_cv_func_tgoto" >&5
+echo "${ECHO_T}$ac_cv_func_tgoto" >&6
+if test $ac_cv_func_tgoto = yes; then
+  cf_term_lib=predefined
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_initscr=no"
-fi
-rm -f conftest*
-fi
 
-if eval "test \"`echo '$ac_cv_func_'initscr`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
+        for cf_term_lib in $cf_check_list termcap termlib unknown
+        do
+            as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh`
+echo "$as_me:5460: checking for tgoto in -l$cf_term_lib" >&5
+echo $ECHO_N "checking for tgoto in -l$cf_term_lib... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Lib+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  echo "$ac_t""no" 1>&6
-
-		cf_save_LIBS="$LIBS"
-		echo $ac_n "checking for initscr in -l$cf_nculib_root""... $ac_c" 1>&6
-echo "configure:3995: checking for initscr in -l$cf_nculib_root" >&5
-		LIBS="-l$cf_nculib_root $LIBS"
-		cat > conftest.$ac_ext <<EOF
-#line 3998 "configure"
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-l$cf_term_lib  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line 5468 "configure"
 #include "confdefs.h"
-#include <${cf_cv_ncurses_header-curses.h}>
-int main() {
-initscr()
-; return 0; }
-EOF
-if { (eval echo configure:4005: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  echo "$ac_t""yes" 1>&6
-			 eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
-			
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  echo "$ac_t""no" 1>&6
-			cf_search=""
 
-
-test "/usr" != "$prefix" && \
-test -d "/usr" && \
-(test $prefix = NONE || test -d $prefix) && {
-	test -n "$verbose" && echo "	... testing for lib-directories under /usr"
-	test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
-	test -d /usr/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/lib/$cf_nculib_root"
-	test -d /usr/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/lib/$cf_nculib_root/lib"
-	test -d /usr/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/$cf_nculib_root/lib"
-	test -d /usr/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/$cf_nculib_root/lib/$cf_nculib_root"
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char tgoto ();
+int
+main ()
+{
+tgoto ();
+  ;
+  return 0;
 }
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:5487: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:5490: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:5493: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:5496: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_Lib=yes"
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+eval "$as_ac_Lib=no"
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:5507: result: `eval echo '${'$as_ac_Lib'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
+if test `eval echo '${'$as_ac_Lib'}'` = yes; then
+  break
+fi
 
+        done
 
-test "$prefix" != "NONE" && \
-test -d "$prefix" && \
- {
-	test -n "$verbose" && echo "	... testing for lib-directories under $prefix"
-	test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
-	test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
-	test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
-	test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
-	test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
-}
+fi
 
+    # Check for library containing initscr
+    test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
+ 	for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
+    do
+        as_ac_Lib=`echo "ac_cv_lib_$cf_curs_lib''_initscr" | $as_tr_sh`
+echo "$as_me:5522: checking for initscr in -l$cf_curs_lib" >&5
+echo $ECHO_N "checking for initscr in -l$cf_curs_lib... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Lib+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-l$cf_curs_lib  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line 5530 "configure"
+#include "confdefs.h"
 
-test "/usr/local" != "$prefix" && \
-test -d "/usr/local" && \
-(test $prefix = NONE || test -d $prefix) && {
-	test -n "$verbose" && echo "	... testing for lib-directories under /usr/local"
-	test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
-	test -d /usr/local/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/local/lib/$cf_nculib_root"
-	test -d /usr/local/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib"
-	test -d /usr/local/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/local/$cf_nculib_root/lib"
-	test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root"
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char initscr ();
+int
+main ()
+{
+initscr ();
+  ;
+  return 0;
 }
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:5549: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:5552: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:5555: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:5558: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_Lib=yes"
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+eval "$as_ac_Lib=no"
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:5569: result: `eval echo '${'$as_ac_Lib'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
+if test `eval echo '${'$as_ac_Lib'}'` = yes; then
+  break
+fi
 
+    done
+    test $cf_curs_lib = unknown && { { echo "$as_me:5576: error: no curses library found" >&5
+echo "$as_me: error: no curses library found" >&2;}
+   { (exit 1); exit 1; }; }
 
-test "/opt" != "$prefix" && \
-test -d "/opt" && \
-(test $prefix = NONE || test -d $prefix) && {
-	test -n "$verbose" && echo "	... testing for lib-directories under /opt"
-	test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
-	test -d /opt/lib/$cf_nculib_root &&       cf_search="$cf_search /opt/lib/$cf_nculib_root"
-	test -d /opt/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /opt/lib/$cf_nculib_root/lib"
-	test -d /opt/$cf_nculib_root/lib &&       cf_search="$cf_search /opt/$cf_nculib_root/lib"
-	test -d /opt/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root"
+    LIBS="-l$cf_curs_lib $cf_save_LIBS"
+    if test "$cf_term_lib" = unknown ; then
+        echo "$as_me:5582: checking if we can link with $cf_curs_lib library" >&5
+echo $ECHO_N "checking if we can link with $cf_curs_lib library... $ECHO_C" >&6
+        cat >conftest.$ac_ext <<_ACEOF
+#line 5585 "configure"
+#include "confdefs.h"
+#include <${cf_cv_ncurses_header:-curses.h}>
+int
+main ()
+{
+initscr()
+  ;
+  return 0;
 }
-
-
-test "$HOME" != "$prefix" && \
-test -d "$HOME" && \
-(test $prefix = NONE || test -d $prefix) && {
-	test -n "$verbose" && echo "	... testing for lib-directories under $HOME"
-	test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
-	test -d $HOME/lib/$cf_nculib_root &&       cf_search="$cf_search $HOME/lib/$cf_nculib_root"
-	test -d $HOME/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib"
-	test -d $HOME/$cf_nculib_root/lib &&       cf_search="$cf_search $HOME/$cf_nculib_root/lib"
-	test -d $HOME/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root"
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:5597: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:5600: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:5603: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:5606: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_result=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_result=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+        echo "$as_me:5615: result: $cf_result" >&5
+echo "${ECHO_T}$cf_result" >&6
+        test $cf_result = no && { { echo "$as_me:5617: error: Cannot link curses library" >&5
+echo "$as_me: error: Cannot link curses library" >&2;}
+   { (exit 1); exit 1; }; }
+    elif test "$cf_curs_lib" = "$cf_term_lib" ; then
+        :
+    elif test "$cf_term_lib" != predefined ; then
+        echo "$as_me:5623: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
+echo $ECHO_N "checking if we need both $cf_curs_lib and $cf_term_lib libraries... $ECHO_C" >&6
+        cat >conftest.$ac_ext <<_ACEOF
+#line 5626 "configure"
+#include "confdefs.h"
+#include <${cf_cv_ncurses_header:-curses.h}>
+int
+main ()
+{
+initscr(); tgoto((char *)0, 0, 0);
+  ;
+  return 0;
 }
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:5638: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:5641: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:5644: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:5647: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_result=no
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
 
-
-			for cf_libdir in $cf_search
-			do
-				echo $ac_n "checking for -l$cf_nculib_root in $cf_libdir""... $ac_c" 1>&6
-echo "configure:4081: checking for -l$cf_nculib_root in $cf_libdir" >&5
-				LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
-				cat > conftest.$ac_ext <<EOF
-#line 4084 "configure"
+            LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
+            cat >conftest.$ac_ext <<_ACEOF
+#line 5656 "configure"
 #include "confdefs.h"
-#include <${cf_cv_ncurses_header-curses.h}>
-int main() {
+#include <${cf_cv_ncurses_header:-curses.h}>
+int
+main ()
+{
 initscr()
-; return 0; }
-EOF
-if { (eval echo configure:4091: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  echo "$ac_t""yes" 1>&6
-			 		 eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
-					 break
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:5668: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:5671: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:5674: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:5677: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_result=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  echo "$ac_t""no" 1>&6
-					 LIBS="$cf_save_LIBS"
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_result=error
 fi
-rm -f conftest*
-			done
-			
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+        echo "$as_me:5689: result: $cf_result" >&5
+echo "${ECHO_T}$cf_result" >&6
+    fi
 fi
-rm -f conftest*
-		
 fi
 
-eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
+	;;
+ncurses)
 
-if test $cf_found_library = no ; then
-	{ echo "configure: error: Cannot link $cf_nculib_root library" 1>&2; exit 1; }
-fi
+cf_ncuconfig_root=ncurses
 
+echo "Looking for ${cf_ncuconfig_root}-config"
+for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:5705: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_NCURSES_CONFIG+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $NCURSES_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  if $as_executable_p "$ac_dir/$ac_word"; then
+   ac_cv_path_NCURSES_CONFIG="$ac_dir/$ac_word"
+   echo "$as_me:5722: found $ac_dir/$ac_word" >&5
+   break
+fi
+done
 
+  ;;
+esac
 fi
+NCURSES_CONFIG=$ac_cv_path_NCURSES_CONFIG
 
-if test -n "$cf_ncurses_LIBS" ; then
-	echo $ac_n "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS""... $ac_c" 1>&6
-echo "configure:4122: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
-	cf_ncurses_SAVE="$LIBS"
-	for p in $cf_ncurses_LIBS ; do
-		q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
-		if test "$q" != "$LIBS" ; then
-			LIBS="$q"
-		fi
-	done
-	cat > conftest.$ac_ext <<EOF
-#line 4131 "configure"
-#include "confdefs.h"
-#include <${cf_cv_ncurses_header-curses.h}>
-int main() {
-initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
-; return 0; }
-EOF
-if { (eval echo configure:4138: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  echo "$ac_t""yes" 1>&6
+if test -n "$NCURSES_CONFIG"; then
+  echo "$as_me:5733: result: $NCURSES_CONFIG" >&5
+echo "${ECHO_T}$NCURSES_CONFIG" >&6
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  echo "$ac_t""no" 1>&6
-		 LIBS="$cf_ncurses_SAVE"
-fi
-rm -f conftest*
+  echo "$as_me:5736: result: no" >&5
+echo "${ECHO_T}no" >&6
 fi
 
+  test -n "$NCURSES_CONFIG" && break
+done
+test -n "$NCURSES_CONFIG" || NCURSES_CONFIG="none"
 
-cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
+if test "$NCURSES_CONFIG" != none ; then
 
-cat >> confdefs.h <<EOF
-#define $cf_nculib_ROOT 1
-EOF
+CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
+LIBS="`$NCURSES_CONFIG --libs` $LIBS"
 
+# even with config script, some packages use no-override for curses.h
 
-	;;
-ncursesw)
-	cf_cv_libtype=w
-	
-echo $ac_n "checking for multibyte character support""... $ac_c" 1>&6
-echo "configure:4164: checking for multibyte character support" >&5
-if eval "test \"`echo '$''{'cf_cv_utf8_lib'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:5751: checking if we have identified curses headers" >&5
+echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
+if test "${cf_cv_ncurses_header+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  
-	cf_save_LIBS="$LIBS"
-	cat > conftest.$ac_ext <<EOF
-#line 4171 "configure"
-#include "confdefs.h"
 
-#include <stdlib.h>
-int main() {
-putwc(0,0);
-; return 0; }
-EOF
-if { (eval echo configure:4179: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  cf_cv_utf8_lib=yes
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  LIBS="-lutf8 $LIBS"
-	 cat > conftest.$ac_ext <<EOF
-#line 4188 "configure"
+cf_cv_ncurses_header=none
+for cf_header in  \
+    ncurses/curses.h \
+	ncurses/ncurses.h \
+	curses.h \
+	ncurses.h
+do
+cat >conftest.$ac_ext <<_ACEOF
+#line 5765 "configure"
 #include "confdefs.h"
-
-#include <libutf8.h>
-int main() {
-putwc(0,0);
-; return 0; }
-EOF
-if { (eval echo configure:4196: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  cf_cv_utf8_lib=add-on
+#include <${cf_header}>
+int
+main ()
+{
+initscr(); tgoto("?", 0,0)
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:5777: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:5780: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:5783: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:5786: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_ncurses_header=$cf_header; break
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  cf_cv_utf8_lib=no
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
 fi
-rm -f conftest*
-	LIBS="$cf_save_LIBS"
+rm -f conftest.$ac_objext conftest.$ac_ext
+done
 
 fi
-rm -f conftest*
-fi
+echo "$as_me:5797: result: $cf_cv_ncurses_header" >&5
+echo "${ECHO_T}$cf_cv_ncurses_header" >&6
 
-echo "$ac_t""$cf_cv_utf8_lib" 1>&6
-
-# HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
-# ncurses/ncursesw:
-if test "$cf_cv_utf8_lib" = "add-on" ; then
-	cat >> confdefs.h <<\EOF
-#define HAVE_LIBUTF8_H 1
-EOF
-
-	LIBS="-lutf8 $LIBS"
+if test "$cf_cv_ncurses_header" = none ; then
+	{ { echo "$as_me:5801: error: No curses header-files found" >&5
+echo "$as_me: error: No curses header-files found" >&2;}
+   { (exit 1); exit 1; }; }
 fi
 
-	
+# cheat, to get the right #define's for HAVE_NCURSES_H, etc.
 
-cf_ncuhdr_root=ncursesw
+for ac_header in $cf_cv_ncurses_header
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+echo "$as_me:5811: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 5817 "configure"
+#include "confdefs.h"
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:5821: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  egrep -v '^ *\+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:5827: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  eval "$as_ac_Header=yes"
+else
+  echo "$as_me: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  eval "$as_ac_Header=no"
+fi
+rm -f conftest.err conftest.$ac_ext
+fi
+echo "$as_me:5846: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+EOF
+
+fi
+done
+
+cat >>confdefs.h <<\EOF
+#define NCURSES 1
+EOF
+
+cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
+
+cat >>confdefs.h <<EOF
+#define $cf_nculib_ROOT 1
+EOF
+
+cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
+
+else
+
+cf_ncuhdr_root=ncurses
 
 test -n "$cf_cv_curses_dir" && \
 test "$cf_cv_curses_dir" != "no" && { \
-  
-if test -n "$cf_cv_curses_dir/include $cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
-  for cf_add_incdir in $cf_cv_curses_dir/include $cf_cv_curses_dir/include/$cf_ncuhdr_root
+
+if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
+  for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
   do
 	while test $cf_add_incdir != /usr/include
 	do
@@ -4245,28 +5890,42 @@
 		fi
 
 		if test "$cf_have_incdir" = no ; then
-          if test "$cf_add_incdir" = /usr/local/include ; then
+		  if test "$cf_add_incdir" = /usr/local/include ; then
 			if test "$GCC" = yes
 			then
 			  cf_save_CPPFLAGS=$CPPFLAGS
 			  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
-			  cat > conftest.$ac_ext <<EOF
-#line 4255 "configure"
+			  cat >conftest.$ac_ext <<_ACEOF
+#line 5899 "configure"
 #include "confdefs.h"
 #include <stdio.h>
-int main() {
+int
+main ()
+{
 printf("Hello")
-; return 0; }
-EOF
-if { (eval echo configure:4262: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:5911: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:5914: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:5917: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:5920: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   :
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  cf_have_incdir=yes
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_have_incdir=yes
 fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
 			  CPPFLAGS=$cf_save_CPPFLAGS
 			fi
 		  fi
@@ -4275,14 +5934,13 @@
 		if test "$cf_have_incdir" = no ; then
 		  test -n "$verbose" && echo "	adding $cf_add_incdir to include-path" 1>&6
 
-echo "${as_me-configure}:4279: testing adding $cf_add_incdir to include-path ..." 1>&5
+echo "${as_me:-configure}:5937: testing adding $cf_add_incdir to include-path ..." 1>&5
 
+		  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
 
-		  CPPFLAGS="-I$cf_add_incdir $CPPFLAGS"
-
-          cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
-          test "$cf_top_incdir" = "$cf_add_incdir" && break
-          cf_add_incdir="$cf_top_incdir"
+		  cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
+		  test "$cf_top_incdir" = "$cf_add_incdir" && break
+		  cf_add_incdir="$cf_top_incdir"
 		else
 		  break
 		fi
@@ -4293,35 +5951,28 @@
 
 }
 
-echo $ac_n "checking for $cf_ncuhdr_root header in include-path""... $ac_c" 1>&6
-echo "configure:4298: checking for $cf_ncuhdr_root header in include-path" >&5
-if eval "test \"`echo '$''{'cf_cv_ncurses_h'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:5954: checking for $cf_ncuhdr_root header in include-path" >&5
+echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
+if test "${cf_cv_ncurses_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  
+
 	cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
 	( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
 	for cf_header in $cf_header_list
 	do
-		
-	cat > conftest.$ac_ext <<EOF
-#line 4309 "configure"
-#include "confdefs.h"
 
-
-#define _XOPEN_SOURCE_EXTENDED
-#undef  HAVE_LIBUTF8_H	/* in case we used CF_UTF8_LIB */
-#define HAVE_LIBUTF8_H	/* to force ncurses' header file to use cchar_t */
+	cat >conftest.$ac_ext <<_ACEOF
+#line 5966 "configure"
+#include "confdefs.h"
 
 #include <$cf_header>
-int main() {
+int
+main ()
+{
 
 #ifdef NCURSES_VERSION
 
-#ifndef WACS_BSSB
-	make an error
-#endif
-
 printf("%s\n", NCURSES_VERSION);
 #else
 #ifdef __NCURSES_H
@@ -4330,48 +5981,86 @@
 	make an error
 #endif
 #endif
-	
-	
-; return 0; }
-EOF
-if { (eval echo configure:4338: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:5990: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:5993: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:5996: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:5999: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   cf_cv_ncurses_h=$cf_header
-	
+
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  cf_cv_ncurses_h=no
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_ncurses_h=no
 fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
 
 		test "$cf_cv_ncurses_h" != no && break
 	done
 
 fi
-
-echo "$ac_t""$cf_cv_ncurses_h" 1>&6
-
-
+echo "$as_me:6014: result: $cf_cv_ncurses_h" >&5
+echo "${ECHO_T}$cf_cv_ncurses_h" >&6
 
 if test "$cf_cv_ncurses_h" != no ; then
 	cf_cv_ncurses_header=$cf_cv_ncurses_h
 else
 
-echo $ac_n "checking for $cf_ncuhdr_root include-path""... $ac_c" 1>&6
-echo "configure:4364: checking for $cf_ncuhdr_root include-path" >&5
-if eval "test \"`echo '$''{'cf_cv_ncurses_h2'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:6021: checking for $cf_ncuhdr_root include-path" >&5
+echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
+if test "${cf_cv_ncurses_h2+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  
+
 	test -n "$verbose" && echo
-	cf_search=""
 
+cf_search=
+
+# collect the current set of include-directories from compiler flags
+cf_header_path_list=""
+if test -n "${CFLAGS}${CPPFLAGS}" ; then
+	for cf_header_path in $CPPFLAGS $CFLAGS
+	do
+		case $cf_header_path in #(vi
+		-I*)
+			cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
+
+test "$cf_header_path" != "NONE" && \
+test -d "$cf_header_path" && \
+ {
+	test -n "$verbose" && echo "	... testing for include-directories under $cf_header_path"
+	test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
+	test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
+	test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
+	test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
+	test -d $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
+}
+
+			cf_header_path_list="$cf_header_path_list $cf_search"
+			;;
+		esac
+	done
+fi
+
+# add the variations for the package we are looking for
+
+cf_search=
 
 test "/usr" != "$prefix" && \
 test -d "/usr" && \
-(test $prefix = NONE || test -d $prefix) && {
+(test $prefix = NONE || test "/usr" != "$prefix") && {
 	test -n "$verbose" && echo "	... testing for include-directories under /usr"
 	test -d /usr/include &&          cf_search="$cf_search /usr/include"
 	test -d /usr/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
@@ -4380,7 +6069,6 @@
 	test -d /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
 }
 
-
 test "$prefix" != "NONE" && \
 test -d "$prefix" && \
  {
@@ -4392,10 +6080,9 @@
 	test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
 }
 
-
 test "/usr/local" != "$prefix" && \
 test -d "/usr/local" && \
-(test $prefix = NONE || test -d $prefix) && {
+(test $prefix = NONE || test "/usr/local" != "$prefix") && {
 	test -n "$verbose" && echo "	... testing for include-directories under /usr/local"
 	test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
 	test -d /usr/local/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
@@ -4404,10 +6091,9 @@
 	test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
 }
 
-
 test "/opt" != "$prefix" && \
 test -d "/opt" && \
-(test $prefix = NONE || test -d $prefix) && {
+(test $prefix = NONE || test "/opt" != "$prefix") && {
 	test -n "$verbose" && echo "	... testing for include-directories under /opt"
 	test -d /opt/include &&          cf_search="$cf_search /opt/include"
 	test -d /opt/include/$cf_ncuhdr_root &&       cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
@@ -4416,10 +6102,9 @@
 	test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
 }
 
-
 test "$HOME" != "$prefix" && \
 test -d "$HOME" && \
-(test $prefix = NONE || test -d $prefix) && {
+(test $prefix = NONE || test "$HOME" != "$prefix") && {
 	test -n "$verbose" && echo "	... testing for include-directories under $HOME"
 	test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
 	test -d $HOME/include/$cf_ncuhdr_root &&       cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
@@ -4428,7 +6113,6 @@
 	test -d $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
 }
 
-
 test "$includedir" != NONE && \
 test "$includedir" != "/usr/include" && \
 test -d "$includedir" && {
@@ -4443,12 +6127,13 @@
 	test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
 }
 
+cf_search="$cf_search $cf_header_path_list"
 
 	test -n "$verbose" && echo search path $cf_search
 	cf_save2_CPPFLAGS="$CPPFLAGS"
 	for cf_incdir in $cf_search
 	do
-		
+
 if test -n "$cf_incdir" ; then
   for cf_add_incdir in $cf_incdir
   do
@@ -4467,28 +6152,42 @@
 		fi
 
 		if test "$cf_have_incdir" = no ; then
-          if test "$cf_add_incdir" = /usr/local/include ; then
+		  if test "$cf_add_incdir" = /usr/local/include ; then
 			if test "$GCC" = yes
 			then
 			  cf_save_CPPFLAGS=$CPPFLAGS
 			  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
-			  cat > conftest.$ac_ext <<EOF
-#line 4477 "configure"
+			  cat >conftest.$ac_ext <<_ACEOF
+#line 6161 "configure"
 #include "confdefs.h"
 #include <stdio.h>
-int main() {
+int
+main ()
+{
 printf("Hello")
-; return 0; }
-EOF
-if { (eval echo configure:4484: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:6173: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:6176: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:6179: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:6182: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   :
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  cf_have_incdir=yes
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_have_incdir=yes
 fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
 			  CPPFLAGS=$cf_save_CPPFLAGS
 			fi
 		  fi
@@ -4497,14 +6196,13 @@
 		if test "$cf_have_incdir" = no ; then
 		  test -n "$verbose" && echo "	adding $cf_add_incdir to include-path" 1>&6
 
-echo "${as_me-configure}:4501: testing adding $cf_add_incdir to include-path ..." 1>&5
-
+echo "${as_me:-configure}:6199: testing adding $cf_add_incdir to include-path ..." 1>&5
 
-		  CPPFLAGS="-I$cf_add_incdir $CPPFLAGS"
+		  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
 
-          cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
-          test "$cf_top_incdir" = "$cf_add_incdir" && break
-          cf_add_incdir="$cf_top_incdir"
+		  cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
+		  test "$cf_top_incdir" = "$cf_add_incdir" && break
+		  cf_add_incdir="$cf_top_incdir"
 		else
 		  break
 		fi
@@ -4517,14 +6215,15 @@
 			ncurses.h \
 			curses.h
 		do
-			
-	cat > conftest.$ac_ext <<EOF
-#line 4523 "configure"
-#include "confdefs.h"
 
+	cat >conftest.$ac_ext <<_ACEOF
+#line 6220 "configure"
+#include "confdefs.h"
 
 #include <$cf_header>
-int main() {
+int
+main ()
+{
 
 #ifdef NCURSES_VERSION
 
@@ -4536,21 +6235,31 @@
 	make an error
 #endif
 #endif
-	
-	
-; return 0; }
-EOF
-if { (eval echo configure:4544: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:6244: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:6247: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:6250: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:6253: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   cf_cv_ncurses_h2=$cf_header
-	
+
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  cf_cv_ncurses_h2=no
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_ncurses_h2=no
 fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
 
 			if test "$cf_cv_ncurses_h2" != no ; then
 				cf_cv_ncurses_h2=$cf_incdir/$cf_header
@@ -4562,18 +6271,20 @@
 		CPPFLAGS="$cf_save2_CPPFLAGS"
 		test "$cf_cv_ncurses_h2" != no && break
 	done
-	test "$cf_cv_ncurses_h2" = no && { echo "configure: error: not found" 1>&2; exit 1; }
-	
-fi
+	test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:6274: error: not found" >&5
+echo "$as_me: error: not found" >&2;}
+   { (exit 1); exit 1; }; }
 
-echo "$ac_t""$cf_cv_ncurses_h2" 1>&6
+fi
+echo "$as_me:6279: result: $cf_cv_ncurses_h2" >&5
+echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
 
 	cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
 	cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
 	if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
 		cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
 	fi
-	
+
 if test -n "$cf_1st_incdir" ; then
   for cf_add_incdir in $cf_1st_incdir
   do
@@ -4592,28 +6303,42 @@
 		fi
 
 		if test "$cf_have_incdir" = no ; then
-          if test "$cf_add_incdir" = /usr/local/include ; then
+		  if test "$cf_add_incdir" = /usr/local/include ; then
 			if test "$GCC" = yes
 			then
 			  cf_save_CPPFLAGS=$CPPFLAGS
 			  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
-			  cat > conftest.$ac_ext <<EOF
-#line 4602 "configure"
+			  cat >conftest.$ac_ext <<_ACEOF
+#line 6312 "configure"
 #include "confdefs.h"
 #include <stdio.h>
-int main() {
+int
+main ()
+{
 printf("Hello")
-; return 0; }
-EOF
-if { (eval echo configure:4609: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:6324: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:6327: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:6330: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:6333: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   :
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  cf_have_incdir=yes
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_have_incdir=yes
 fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
 			  CPPFLAGS=$cf_save_CPPFLAGS
 			fi
 		  fi
@@ -4622,14 +6347,13 @@
 		if test "$cf_have_incdir" = no ; then
 		  test -n "$verbose" && echo "	adding $cf_add_incdir to include-path" 1>&6
 
-echo "${as_me-configure}:4626: testing adding $cf_add_incdir to include-path ..." 1>&5
+echo "${as_me:-configure}:6350: testing adding $cf_add_incdir to include-path ..." 1>&5
 
+		  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
 
-		  CPPFLAGS="-I$cf_add_incdir $CPPFLAGS"
-
-          cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
-          test "$cf_top_incdir" = "$cf_add_incdir" && break
-          cf_add_incdir="$cf_top_incdir"
+		  cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
+		  test "$cf_top_incdir" = "$cf_add_incdir" && break
+		  cf_add_incdir="$cf_top_incdir"
 		else
 		  break
 		fi
@@ -4638,14 +6362,13 @@
   done
 fi
 
-
 fi
 
 # Set definitions to allow ifdef'ing for ncurses.h
 
 case $cf_cv_ncurses_header in # (vi
 *ncurses.h)
-	cat >> confdefs.h <<\EOF
+	cat >>confdefs.h <<\EOF
 #define HAVE_NCURSES_H 1
 EOF
 
@@ -4654,27 +6377,25 @@
 
 case $cf_cv_ncurses_header in # (vi
 ncurses/curses.h|ncurses/ncurses.h)
-	cat >> confdefs.h <<\EOF
+	cat >>confdefs.h <<\EOF
 #define HAVE_NCURSES_NCURSES_H 1
 EOF
 
 	;;
 ncursesw/curses.h|ncursesw/ncurses.h)
-	cat >> confdefs.h <<\EOF
+	cat >>confdefs.h <<\EOF
 #define HAVE_NCURSESW_NCURSES_H 1
 EOF
 
 	;;
 esac
 
-
-
-echo $ac_n "checking for terminfo header""... $ac_c" 1>&6
-echo "configure:4674: checking for terminfo header" >&5
-if eval "test \"`echo '$''{'cf_cv_term_header'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:6393: checking for terminfo header" >&5
+echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
+if test "${cf_cv_term_header+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  
+
 case ${cf_cv_ncurses_header} in #(vi
 */ncurses.h|*/ncursesw.h) #(vi
 	cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
@@ -4686,42 +6407,55 @@
 
 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
 do
-cat > conftest.$ac_ext <<EOF
-#line 4691 "configure"
+cat >conftest.$ac_ext <<_ACEOF
+#line 6411 "configure"
 #include "confdefs.h"
 #include <stdio.h>
-#include <${cf_cv_ncurses_header-curses.h}>
+#include <${cf_cv_ncurses_header:-curses.h}>
 #include <$cf_test>
 
-int main() {
+int
+main ()
+{
 int x = auto_left_margin
-; return 0; }
-EOF
-if { (eval echo configure:4701: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
-  
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:6426: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:6429: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:6432: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:6435: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+
 	cf_cv_term_header="$cf_test"
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+
 	cf_cv_term_header=unknown
-	
+
 fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
 	test "$cf_cv_term_header" != unknown && break
 done
 
 fi
-
-echo "$ac_t""$cf_cv_term_header" 1>&6
+echo "$as_me:6451: result: $cf_cv_term_header" >&5
+echo "${ECHO_T}$cf_cv_term_header" >&6
 
 # Set definitions to allow ifdef'ing to accommodate subdirectories
 
 case $cf_cv_term_header in # (vi
 *term.h)
-	cat >> confdefs.h <<\EOF
+	cat >>confdefs.h <<\EOF
 #define HAVE_TERM_H 1
 EOF
 
@@ -4730,43 +6464,39 @@
 
 case $cf_cv_term_header in # (vi
 ncurses/term.h) #(vi
-	cat >> confdefs.h <<\EOF
+	cat >>confdefs.h <<\EOF
 #define HAVE_NCURSES_TERM_H 1
 EOF
 
 	;;
 ncursesw/term.h)
-	cat >> confdefs.h <<\EOF
+	cat >>confdefs.h <<\EOF
 #define HAVE_NCURSESW_TERM_H 1
 EOF
 
 	;;
 esac
 
-
 # some applications need this, but should check for NCURSES_VERSION
-cat >> confdefs.h <<\EOF
+cat >>confdefs.h <<\EOF
 #define NCURSES 1
 EOF
 
-
-
-echo $ac_n "checking for ncurses version""... $ac_c" 1>&6
-echo "configure:4756: checking for ncurses version" >&5
-if eval "test \"`echo '$''{'cf_cv_ncurses_version'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:6485: checking for ncurses version" >&5
+echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
+if test "${cf_cv_ncurses_version+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  
+
 	cf_cv_ncurses_version=no
 	cf_tempfile=out$$
 	rm -f $cf_tempfile
 	if test "$cross_compiling" = yes; then
-  
 
 	# This will not work if the preprocessor splits the line after the
 	# Autoconf token.  The 'unproto' program does that.
 	cat > conftest.$ac_ext <<EOF
-#include <${cf_cv_ncurses_header-curses.h}>
+#include <${cf_cv_ncurses_header:-curses.h}>
 #undef Autoconf
 #ifdef NCURSES_VERSION
 Autoconf NCURSES_VERSION
@@ -4778,7 +6508,11 @@
 #endif
 EOF
 	cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
-	{ (eval echo configure:4782: \"$cf_try\") 1>&5; (eval $cf_try) 2>&5; }
+	{ (eval echo "$as_me:6511: \"$cf_try\"") >&5
+  (eval $cf_try) 2>&5
+  ac_status=$?
+  echo "$as_me:6514: \$? = $ac_status" >&5
+  (exit $ac_status); }
 	if test -f conftest.out ; then
 		cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
 		test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
@@ -4786,11 +6520,11 @@
 	fi
 
 else
-  cat > conftest.$ac_ext <<EOF
-#line 4791 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 6524 "configure"
 #include "confdefs.h"
 
-#include <${cf_cv_ncurses_header-curses.h}>
+#include <${cf_cv_ncurses_header:-curses.h}>
 #include <stdio.h>
 int main()
 {
@@ -4808,163 +6542,207 @@
 	make an error
 # endif
 #endif
-	${cf_cv_main_return-return}(0);
+	${cf_cv_main_return:-return}(0);
 }
-EOF
-if { (eval echo configure:4815: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
-  
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:6549: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:6552: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:6554: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:6557: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+
 	cf_cv_ncurses_version=`cat $cf_tempfile`
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
 fi
-rm -fr conftest*
+rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
-
 	rm -f $cf_tempfile
 
 fi
-
-echo "$ac_t""$cf_cv_ncurses_version" 1>&6
-test "$cf_cv_ncurses_version" = no || cat >> confdefs.h <<\EOF
+echo "$as_me:6571: result: $cf_cv_ncurses_version" >&5
+echo "${ECHO_T}$cf_cv_ncurses_version" >&6
+test "$cf_cv_ncurses_version" = no || cat >>confdefs.h <<\EOF
 #define NCURSES 1
 EOF
 
-
-
-	
-
-cf_nculib_root=ncursesw
+cf_nculib_root=ncurses
 	# This works, except for the special case where we find gpm, but
 	# ncurses is in a nonstandard location via $LIBS, and we really want
 	# to link gpm.
 cf_ncurses_LIBS=""
 cf_ncurses_SAVE="$LIBS"
-echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6
-echo "configure:4846: checking for Gpm_Open in -lgpm" >&5
-ac_lib_var=`echo gpm'_'Gpm_Open | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:6583: checking for Gpm_Open in -lgpm" >&5
+echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
+if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_save_LIBS="$LIBS"
+  ac_check_lib_save_LIBS=$LIBS
 LIBS="-lgpm  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 4854 "configure"
+cat >conftest.$ac_ext <<_ACEOF
+#line 6591 "configure"
 #include "confdefs.h"
+
 /* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
 /* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char Gpm_Open();
-
-int main() {
-Gpm_Open()
-; return 0; }
-EOF
-if { (eval echo configure:4865: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  echo $ac_n "checking for initscr in -lgpm""... $ac_c" 1>&6
-echo "configure:4881: checking for initscr in -lgpm" >&5
-ac_lib_var=`echo gpm'_'initscr | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+   builtin and then its argument prototype would still apply.  */
+char Gpm_Open ();
+int
+main ()
+{
+Gpm_Open ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:6610: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:6613: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:6616: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:6619: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_gpm_Gpm_Open=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_gpm_Gpm_Open=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:6630: result: $ac_cv_lib_gpm_Gpm_Open" >&5
+echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
+if test $ac_cv_lib_gpm_Gpm_Open = yes; then
+  echo "$as_me:6633: checking for initscr in -lgpm" >&5
+echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
+if test "${ac_cv_lib_gpm_initscr+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_save_LIBS="$LIBS"
+  ac_check_lib_save_LIBS=$LIBS
 LIBS="-lgpm  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 4889 "configure"
+cat >conftest.$ac_ext <<_ACEOF
+#line 6641 "configure"
 #include "confdefs.h"
+
 /* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
 /* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char initscr();
-
-int main() {
-initscr()
-; return 0; }
-EOF
-if { (eval echo configure:4900: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
+   builtin and then its argument prototype would still apply.  */
+char initscr ();
+int
+main ()
+{
+initscr ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:6660: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:6663: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:6666: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:6669: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_gpm_initscr=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_gpm_initscr=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:6680: result: $ac_cv_lib_gpm_initscr" >&5
+echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
+if test $ac_cv_lib_gpm_initscr = yes; then
   LIBS="$cf_ncurses_SAVE"
 else
-  echo "$ac_t""no" 1>&6
-cf_ncurses_LIBS="-lgpm"
+  cf_ncurses_LIBS="-lgpm"
 fi
 
-else
-  echo "$ac_t""no" 1>&6
 fi
 
-
 case $host_os in #(vi
 freebsd*)
 	# This is only necessary if you are linking against an obsolete
 	# version of ncurses (but it should do no harm, since it's static).
 	if test "$cf_nculib_root" = ncurses ; then
-		echo $ac_n "checking for tgoto in -lmytinfo""... $ac_c" 1>&6
-echo "configure:4932: checking for tgoto in -lmytinfo" >&5
-ac_lib_var=`echo mytinfo'_'tgoto | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+		echo "$as_me:6695: checking for tgoto in -lmytinfo" >&5
+echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
+if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_save_LIBS="$LIBS"
+  ac_check_lib_save_LIBS=$LIBS
 LIBS="-lmytinfo  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 4940 "configure"
+cat >conftest.$ac_ext <<_ACEOF
+#line 6703 "configure"
 #include "confdefs.h"
+
 /* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
 /* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char tgoto();
-
-int main() {
-tgoto()
-; return 0; }
-EOF
-if { (eval echo configure:4951: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
+   builtin and then its argument prototype would still apply.  */
+char tgoto ();
+int
+main ()
+{
+tgoto ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:6722: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:6725: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:6728: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:6731: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_mytinfo_tgoto=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_mytinfo_tgoto=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:6742: result: $ac_cv_lib_mytinfo_tgoto" >&5
+echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
+if test $ac_cv_lib_mytinfo_tgoto = yes; then
   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
-else
-  echo "$ac_t""no" 1>&6
 fi
 
 	fi
@@ -4975,115 +6753,142 @@
 
 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
 then
-	
-if test -n "$cf_cv_curses_dir/lib" ; then
-  for cf_add_libdir in $cf_cv_curses_dir/lib
-  do
-    if test $cf_add_libdir = /usr/lib ; then
-      :
-    elif test -d $cf_add_libdir
-    then
-      cf_have_libdir=no
-      if test -n "$LDFLAGS$LIBS" ; then
-        # a loop is needed to ensure we can add subdirs of existing dirs
-        for cf_test_libdir in $LDFLAGS $LIBS ; do
-          if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
-            cf_have_libdir=yes; break
-          fi
-        done
-      fi
-      if test "$cf_have_libdir" = no ; then
-        test -n "$verbose" && echo "	adding $cf_add_libdir to library-path" 1>&6
-
-echo "${as_me-configure}:4999: testing adding $cf_add_libdir to library-path ..." 1>&5
-
-
-        LDFLAGS="-L$cf_add_libdir $LDFLAGS"
-      fi
-    fi
-  done
-fi
-
 	LIBS="-l$cf_nculib_root $LIBS"
 else
-	
+
 	eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
 	cf_libdir=""
-	echo $ac_n "checking for initscr""... $ac_c" 1>&6
-echo "configure:5014: checking for initscr" >&5
-if eval "test \"`echo '$''{'ac_cv_func_initscr'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+	echo "$as_me:6761: checking for initscr" >&5
+echo $ECHO_N "checking for initscr... $ECHO_C" >&6
+if test "${ac_cv_func_initscr+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 5019 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 6767 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char initscr(); below.  */
+    which can conflict with char initscr (); below.  */
 #include <assert.h>
 /* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
 /* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char initscr();
-
-int main() {
+   builtin and then its argument prototype would still apply.  */
+char initscr ();
+char (*f) ();
 
+int
+main ()
+{
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
 #if defined (__stub_initscr) || defined (__stub___initscr)
 choke me
 #else
-initscr();
+f = initscr;
 #endif
 
-; return 0; }
-EOF
-if { (eval echo configure:5042: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func_initscr=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_initscr=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'initscr`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:6798: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:6801: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:6804: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:6807: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_initscr=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_func_initscr=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:6817: result: $ac_cv_func_initscr" >&5
+echo "${ECHO_T}$ac_cv_func_initscr" >&6
+if test $ac_cv_func_initscr = yes; then
   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
 else
-  echo "$ac_t""no" 1>&6
 
 		cf_save_LIBS="$LIBS"
-		echo $ac_n "checking for initscr in -l$cf_nculib_root""... $ac_c" 1>&6
-echo "configure:5062: checking for initscr in -l$cf_nculib_root" >&5
+		echo "$as_me:6824: checking for initscr in -l$cf_nculib_root" >&5
+echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
 		LIBS="-l$cf_nculib_root $LIBS"
-		cat > conftest.$ac_ext <<EOF
-#line 5065 "configure"
+		cat >conftest.$ac_ext <<_ACEOF
+#line 6828 "configure"
 #include "confdefs.h"
-#include <${cf_cv_ncurses_header-curses.h}>
-int main() {
+#include <${cf_cv_ncurses_header:-curses.h}>
+int
+main ()
+{
 initscr()
-; return 0; }
-EOF
-if { (eval echo configure:5072: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  echo "$ac_t""yes" 1>&6
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:6840: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:6843: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:6846: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:6849: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  echo "$as_me:6851: result: yes" >&5
+echo "${ECHO_T}yes" >&6
 			 eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
-			
+
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  echo "$ac_t""no" 1>&6
-			cf_search=""
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+echo "$as_me:6858: result: no" >&5
+echo "${ECHO_T}no" >&6
+
+cf_search=
+cf_library_path_list=""
+if test -n "${LDFLAGS}${LIBS}" ; then
+	for cf_library_path in $LDFLAGS $LIBS
+	do
+		case $cf_library_path in #(vi
+		-L*)
+			cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
+
+test "$cf_library_path" != "NONE" && \
+test -d "$cf_library_path" && \
+ {
+	test -n "$verbose" && echo "	... testing for lib-directories under $cf_library_path"
+	test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
+	test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
+	test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
+	test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
+	test -d $cf_library_path/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib/$cf_nculib_root"
+}
+
+			cf_library_path_list="$cf_library_path_list $cf_search"
+			;;
+		esac
+	done
+fi
 
+cf_search=
 
 test "/usr" != "$prefix" && \
 test -d "/usr" && \
-(test $prefix = NONE || test -d $prefix) && {
+(test $prefix = NONE || test "/usr" != "$prefix") && {
 	test -n "$verbose" && echo "	... testing for lib-directories under /usr"
 	test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
 	test -d /usr/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/lib/$cf_nculib_root"
@@ -5092,7 +6897,6 @@
 	test -d /usr/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/$cf_nculib_root/lib/$cf_nculib_root"
 }
 
-
 test "$prefix" != "NONE" && \
 test -d "$prefix" && \
  {
@@ -5104,10 +6908,9 @@
 	test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
 }
 
-
 test "/usr/local" != "$prefix" && \
 test -d "/usr/local" && \
-(test $prefix = NONE || test -d $prefix) && {
+(test $prefix = NONE || test "/usr/local" != "$prefix") && {
 	test -n "$verbose" && echo "	... testing for lib-directories under /usr/local"
 	test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
 	test -d /usr/local/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/local/lib/$cf_nculib_root"
@@ -5116,10 +6919,9 @@
 	test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root"
 }
 
-
 test "/opt" != "$prefix" && \
 test -d "/opt" && \
-(test $prefix = NONE || test -d $prefix) && {
+(test $prefix = NONE || test "/opt" != "$prefix") && {
 	test -n "$verbose" && echo "	... testing for lib-directories under /opt"
 	test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
 	test -d /opt/lib/$cf_nculib_root &&       cf_search="$cf_search /opt/lib/$cf_nculib_root"
@@ -5128,10 +6930,9 @@
 	test -d /opt/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root"
 }
 
-
 test "$HOME" != "$prefix" && \
 test -d "$HOME" && \
-(test $prefix = NONE || test -d $prefix) && {
+(test $prefix = NONE || test "$HOME" != "$prefix") && {
 	test -n "$verbose" && echo "	... testing for lib-directories under $HOME"
 	test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
 	test -d $HOME/lib/$cf_nculib_root &&       cf_search="$cf_search $HOME/lib/$cf_nculib_root"
@@ -5140,52 +6941,69 @@
 	test -d $HOME/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root"
 }
 
+cf_search="$cf_library_path_list $cf_search"
 
 			for cf_libdir in $cf_search
 			do
-				echo $ac_n "checking for -l$cf_nculib_root in $cf_libdir""... $ac_c" 1>&6
-echo "configure:5148: checking for -l$cf_nculib_root in $cf_libdir" >&5
+				echo "$as_me:6948: checking for -l$cf_nculib_root in $cf_libdir" >&5
+echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
 				LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
-				cat > conftest.$ac_ext <<EOF
-#line 5151 "configure"
+				cat >conftest.$ac_ext <<_ACEOF
+#line 6952 "configure"
 #include "confdefs.h"
-#include <${cf_cv_ncurses_header-curses.h}>
-int main() {
+#include <${cf_cv_ncurses_header:-curses.h}>
+int
+main ()
+{
 initscr()
-; return 0; }
-EOF
-if { (eval echo configure:5158: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  echo "$ac_t""yes" 1>&6
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:6964: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:6967: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:6970: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:6973: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  echo "$as_me:6975: result: yes" >&5
+echo "${ECHO_T}yes" >&6
 			 		 eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
 					 break
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  echo "$ac_t""no" 1>&6
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+echo "$as_me:6982: result: no" >&5
+echo "${ECHO_T}no" >&6
 					 LIBS="$cf_save_LIBS"
 fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 			done
-			
+
 fi
-rm -f conftest*
-		
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+
 fi
 
 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
 
 if test $cf_found_library = no ; then
-	{ echo "configure: error: Cannot link $cf_nculib_root library" 1>&2; exit 1; }
+	{ { echo "$as_me:6997: error: Cannot link $cf_nculib_root library" >&5
+echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
+   { (exit 1); exit 1; }; }
 fi
 
-
 fi
 
 if test -n "$cf_ncurses_LIBS" ; then
-	echo $ac_n "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS""... $ac_c" 1>&6
-echo "configure:5189: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
+	echo "$as_me:7005: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
+echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
 	cf_ncurses_SAVE="$LIBS"
 	for p in $cf_ncurses_LIBS ; do
 		q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
@@ -5193,651 +7011,4222 @@
 			LIBS="$q"
 		fi
 	done
-	cat > conftest.$ac_ext <<EOF
-#line 5198 "configure"
+	cat >conftest.$ac_ext <<_ACEOF
+#line 7015 "configure"
 #include "confdefs.h"
-#include <${cf_cv_ncurses_header-curses.h}>
-int main() {
+#include <${cf_cv_ncurses_header:-curses.h}>
+int
+main ()
+{
 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
-; return 0; }
-EOF
-if { (eval echo configure:5205: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  echo "$ac_t""yes" 1>&6
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  echo "$ac_t""no" 1>&6
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:7027: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:7030: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:7033: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:7036: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  echo "$as_me:7038: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+echo "$as_me:7043: result: no" >&5
+echo "${ECHO_T}no" >&6
 		 LIBS="$cf_ncurses_SAVE"
 fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
 
-
 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
 
-cat >> confdefs.h <<EOF
+cat >>confdefs.h <<EOF
 #define $cf_nculib_ROOT 1
 EOF
 
+fi
 
 	;;
-pdcurses) #(vi
-	if test "$no_x" = yes; then
-  # Not all programs may use this symbol, but it does not hurt to define it.
-  cat >> confdefs.h <<\EOF
-#define X_DISPLAY_MISSING 1
-EOF
+ncursesw)
+	cf_cv_libtype=w
 
-  X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
+echo "$as_me:7062: checking for multibyte character support" >&5
+echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
+if test "${cf_cv_utf8_lib+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test -n "$x_includes"; then
-    X_CFLAGS="$X_CFLAGS -I$x_includes"
-  fi
 
-  # It would also be nice to do this for all -L options, not just this one.
-  if test -n "$x_libraries"; then
-    X_LIBS="$X_LIBS -L$x_libraries"
-    # For Solaris; some versions of Sun CC require a space after -R and
-    # others require no space.  Words are not sufficient . . . .
-    case "`(uname -sr) 2>/dev/null`" in
-    "SunOS 5"*)
-      echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6
-echo "configure:5248: checking whether -R must be followed by a space" >&5
-      ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries"
-      cat > conftest.$ac_ext <<EOF
-#line 5251 "configure"
+	cf_save_LIBS="$LIBS"
+	cat >conftest.$ac_ext <<_ACEOF
+#line 7070 "configure"
 #include "confdefs.h"
 
-int main() {
-
-; return 0; }
+#include <stdlib.h>
+int
+main ()
+{
+putwc(0,0);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:7083: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:7086: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:7089: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:7092: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_utf8_lib=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+
+# If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
+# will be set on completion of the AC_TRY_LINK below.
+cf_cv_header_path_utf8=
+cf_cv_library_path_utf8=
+
+echo "${as_me:-configure}:7104: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
+
+cf_save_LIBS="$LIBS"
+
+cat >conftest.$ac_ext <<_ACEOF
+#line 7109 "configure"
+#include "confdefs.h"
+
+#include <libutf8.h>
+int
+main ()
+{
+putwc(0,0);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:7122: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:7125: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:7128: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:7131: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+
+	cf_cv_find_linkage_utf8=yes
+	cf_cv_header_path_utf8=/usr/include
+	cf_cv_library_path_utf8=/usr/lib
+
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+
+LIBS="-lutf8  $cf_save_LIBS"
+
+cat >conftest.$ac_ext <<_ACEOF
+#line 7145 "configure"
+#include "confdefs.h"
+
+#include <libutf8.h>
+int
+main ()
+{
+putwc(0,0);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:7158: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:7161: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:7164: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:7167: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+
+	cf_cv_find_linkage_utf8=yes
+	cf_cv_header_path_utf8=/usr/include
+	cf_cv_library_path_utf8=/usr/lib
+	cf_cv_library_file_utf8="-lutf8"
+
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+
+	cf_cv_find_linkage_utf8=no
+	LIBS="$cf_save_LIBS"
+
+    test -n "$verbose" && echo "	find linkage for utf8 library" 1>&6
+
+echo "${as_me:-configure}:7184: testing find linkage for utf8 library ..." 1>&5
+
+echo "${as_me:-configure}:7186: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
+
+    cf_save_CPPFLAGS="$CPPFLAGS"
+    cf_test_CPPFLAGS="$CPPFLAGS"
+
+cf_search=
+
+# collect the current set of include-directories from compiler flags
+cf_header_path_list=""
+if test -n "${CFLAGS}${CPPFLAGS}" ; then
+	for cf_header_path in $CPPFLAGS $CFLAGS
+	do
+		case $cf_header_path in #(vi
+		-I*)
+			cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
+
+test "$cf_header_path" != "NONE" && \
+test -d "$cf_header_path" && \
+ {
+	test -n "$verbose" && echo "	... testing for include-directories under $cf_header_path"
+	test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
+	test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
+	test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
+	test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
+	test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
+}
+
+			cf_header_path_list="$cf_header_path_list $cf_search"
+			;;
+		esac
+	done
+fi
+
+# add the variations for the package we are looking for
+
+cf_search=
+
+test "/usr" != "$prefix" && \
+test -d "/usr" && \
+(test $prefix = NONE || test "/usr" != "$prefix") && {
+	test -n "$verbose" && echo "	... testing for include-directories under /usr"
+	test -d /usr/include &&          cf_search="$cf_search /usr/include"
+	test -d /usr/include/utf8 &&       cf_search="$cf_search /usr/include/utf8"
+	test -d /usr/include/utf8/include &&    cf_search="$cf_search /usr/include/utf8/include"
+	test -d /usr/utf8/include &&       cf_search="$cf_search /usr/utf8/include"
+	test -d /usr/utf8/include/utf8 &&    cf_search="$cf_search /usr/utf8/include/utf8"
+}
+
+test "$prefix" != "NONE" && \
+test -d "$prefix" && \
+ {
+	test -n "$verbose" && echo "	... testing for include-directories under $prefix"
+	test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
+	test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
+	test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
+	test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
+	test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
+}
+
+test "/usr/local" != "$prefix" && \
+test -d "/usr/local" && \
+(test $prefix = NONE || test "/usr/local" != "$prefix") && {
+	test -n "$verbose" && echo "	... testing for include-directories under /usr/local"
+	test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
+	test -d /usr/local/include/utf8 &&       cf_search="$cf_search /usr/local/include/utf8"
+	test -d /usr/local/include/utf8/include &&    cf_search="$cf_search /usr/local/include/utf8/include"
+	test -d /usr/local/utf8/include &&       cf_search="$cf_search /usr/local/utf8/include"
+	test -d /usr/local/utf8/include/utf8 &&    cf_search="$cf_search /usr/local/utf8/include/utf8"
+}
+
+test "/opt" != "$prefix" && \
+test -d "/opt" && \
+(test $prefix = NONE || test "/opt" != "$prefix") && {
+	test -n "$verbose" && echo "	... testing for include-directories under /opt"
+	test -d /opt/include &&          cf_search="$cf_search /opt/include"
+	test -d /opt/include/utf8 &&       cf_search="$cf_search /opt/include/utf8"
+	test -d /opt/include/utf8/include &&    cf_search="$cf_search /opt/include/utf8/include"
+	test -d /opt/utf8/include &&       cf_search="$cf_search /opt/utf8/include"
+	test -d /opt/utf8/include/utf8 &&    cf_search="$cf_search /opt/utf8/include/utf8"
+}
+
+test "$HOME" != "$prefix" && \
+test -d "$HOME" && \
+(test $prefix = NONE || test "$HOME" != "$prefix") && {
+	test -n "$verbose" && echo "	... testing for include-directories under $HOME"
+	test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
+	test -d $HOME/include/utf8 &&       cf_search="$cf_search $HOME/include/utf8"
+	test -d $HOME/include/utf8/include &&    cf_search="$cf_search $HOME/include/utf8/include"
+	test -d $HOME/utf8/include &&       cf_search="$cf_search $HOME/utf8/include"
+	test -d $HOME/utf8/include/utf8 &&    cf_search="$cf_search $HOME/utf8/include/utf8"
+}
+
+test "$includedir" != NONE && \
+test "$includedir" != "/usr/include" && \
+test -d "$includedir" && {
+	test -d $includedir &&    cf_search="$cf_search $includedir"
+	test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
+}
+
+test "$oldincludedir" != NONE && \
+test "$oldincludedir" != "/usr/include" && \
+test -d "$oldincludedir" && {
+	test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
+	test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
+}
+
+cf_search="$cf_search $cf_header_path_list"
+
+    for cf_cv_header_path_utf8 in $cf_search
+    do
+      if test -d $cf_cv_header_path_utf8 ; then
+        test -n "$verbose" && echo "	... testing $cf_cv_header_path_utf8" 1>&6
+
+echo "${as_me:-configure}:7299: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
+
+        CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_utf8"
+        cat >conftest.$ac_ext <<_ACEOF
+#line 7303 "configure"
+#include "confdefs.h"
+
+#include <libutf8.h>
+int
+main ()
+{
+putwc(0,0);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:7316: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:7319: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:7322: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:7325: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+
+            test -n "$verbose" && echo "	... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
+
+echo "${as_me:-configure}:7330: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
+
+            cf_cv_find_linkage_utf8=maybe
+            cf_test_CPPFLAGS="$CPPFLAGS"
+            break
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+
+            CPPFLAGS="$cf_save_CPPFLAGS"
+
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+      fi
+    done
+
+    if test "$cf_cv_find_linkage_utf8" = maybe ; then
+
+echo "${as_me:-configure}:7348: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
+
+      cf_save_LIBS="$LIBS"
+      cf_save_LDFLAGS="$LDFLAGS"
+
+      if test "$cf_cv_find_linkage_utf8" != yes ; then
+
+cf_search=
+cf_library_path_list=""
+if test -n "${LDFLAGS}${LIBS}" ; then
+	for cf_library_path in $LDFLAGS $LIBS
+	do
+		case $cf_library_path in #(vi
+		-L*)
+			cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
+
+test "$cf_library_path" != "NONE" && \
+test -d "$cf_library_path" && \
+ {
+	test -n "$verbose" && echo "	... testing for lib-directories under $cf_library_path"
+	test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
+	test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
+	test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
+	test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
+	test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
+}
+
+			cf_library_path_list="$cf_library_path_list $cf_search"
+			;;
+		esac
+	done
+fi
+
+cf_search=
+
+test "/usr" != "$prefix" && \
+test -d "/usr" && \
+(test $prefix = NONE || test "/usr" != "$prefix") && {
+	test -n "$verbose" && echo "	... testing for lib-directories under /usr"
+	test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
+	test -d /usr/lib/utf8 &&       cf_search="$cf_search /usr/lib/utf8"
+	test -d /usr/lib/utf8/lib &&    cf_search="$cf_search /usr/lib/utf8/lib"
+	test -d /usr/utf8/lib &&       cf_search="$cf_search /usr/utf8/lib"
+	test -d /usr/utf8/lib/utf8 &&    cf_search="$cf_search /usr/utf8/lib/utf8"
+}
+
+test "$prefix" != "NONE" && \
+test -d "$prefix" && \
+ {
+	test -n "$verbose" && echo "	... testing for lib-directories under $prefix"
+	test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
+	test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
+	test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
+	test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
+	test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
+}
+
+test "/usr/local" != "$prefix" && \
+test -d "/usr/local" && \
+(test $prefix = NONE || test "/usr/local" != "$prefix") && {
+	test -n "$verbose" && echo "	... testing for lib-directories under /usr/local"
+	test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
+	test -d /usr/local/lib/utf8 &&       cf_search="$cf_search /usr/local/lib/utf8"
+	test -d /usr/local/lib/utf8/lib &&    cf_search="$cf_search /usr/local/lib/utf8/lib"
+	test -d /usr/local/utf8/lib &&       cf_search="$cf_search /usr/local/utf8/lib"
+	test -d /usr/local/utf8/lib/utf8 &&    cf_search="$cf_search /usr/local/utf8/lib/utf8"
+}
+
+test "/opt" != "$prefix" && \
+test -d "/opt" && \
+(test $prefix = NONE || test "/opt" != "$prefix") && {
+	test -n "$verbose" && echo "	... testing for lib-directories under /opt"
+	test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
+	test -d /opt/lib/utf8 &&       cf_search="$cf_search /opt/lib/utf8"
+	test -d /opt/lib/utf8/lib &&    cf_search="$cf_search /opt/lib/utf8/lib"
+	test -d /opt/utf8/lib &&       cf_search="$cf_search /opt/utf8/lib"
+	test -d /opt/utf8/lib/utf8 &&    cf_search="$cf_search /opt/utf8/lib/utf8"
+}
+
+test "$HOME" != "$prefix" && \
+test -d "$HOME" && \
+(test $prefix = NONE || test "$HOME" != "$prefix") && {
+	test -n "$verbose" && echo "	... testing for lib-directories under $HOME"
+	test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
+	test -d $HOME/lib/utf8 &&       cf_search="$cf_search $HOME/lib/utf8"
+	test -d $HOME/lib/utf8/lib &&    cf_search="$cf_search $HOME/lib/utf8/lib"
+	test -d $HOME/utf8/lib &&       cf_search="$cf_search $HOME/utf8/lib"
+	test -d $HOME/utf8/lib/utf8 &&    cf_search="$cf_search $HOME/utf8/lib/utf8"
+}
+
+cf_search="$cf_library_path_list $cf_search"
+
+        for cf_cv_library_path_utf8 in $cf_search
+        do
+          if test -d $cf_cv_library_path_utf8 ; then
+            test -n "$verbose" && echo "	... testing $cf_cv_library_path_utf8" 1>&6
+
+echo "${as_me:-configure}:7445: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
+
+            CPPFLAGS="$cf_test_CPPFLAGS"
+            LIBS="-lutf8  $cf_save_LIBS"
+            LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
+            cat >conftest.$ac_ext <<_ACEOF
+#line 7451 "configure"
+#include "confdefs.h"
+
+#include <libutf8.h>
+int
+main ()
+{
+putwc(0,0);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:7464: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:7467: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:7470: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:7473: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+
+                test -n "$verbose" && echo "	... found utf8 library in $cf_cv_library_path_utf8" 1>&6
+
+echo "${as_me:-configure}:7478: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
+
+                cf_cv_find_linkage_utf8=yes
+                cf_cv_library_file_utf8="-lutf8"
+                break
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+
+                CPPFLAGS="$cf_save_CPPFLAGS"
+                LIBS="$cf_save_LIBS"
+                LDFLAGS="$cf_save_LDFLAGS"
+
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+          fi
+        done
+        CPPFLAGS="$cf_save_CPPFLAGS"
+        LDFLAGS="$cf_save_LDFLAGS"
+      fi
+
+    else
+      cf_cv_find_linkage_utf8=no
+    fi
+
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+
+LIBS="$cf_save_LIBS"
+
+if test "$cf_cv_find_linkage_utf8" = yes ; then
+cf_cv_utf8_lib=add-on
+else
+cf_cv_utf8_lib=no
+fi
+
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:7520: result: $cf_cv_utf8_lib" >&5
+echo "${ECHO_T}$cf_cv_utf8_lib" >&6
+
+# HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
+# ncurses/ncursesw:
+if test "$cf_cv_utf8_lib" = "add-on" ; then
+	cat >>confdefs.h <<\EOF
+#define HAVE_LIBUTF8_H 1
+EOF
+
+if test -n "$cf_cv_header_path_utf8" ; then
+  for cf_add_incdir in $cf_cv_header_path_utf8
+  do
+	while test $cf_add_incdir != /usr/include
+	do
+	  if test -d $cf_add_incdir
+	  then
+		cf_have_incdir=no
+		if test -n "$CFLAGS$CPPFLAGS" ; then
+		  # a loop is needed to ensure we can add subdirs of existing dirs
+		  for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
+			if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
+			  cf_have_incdir=yes; break
+			fi
+		  done
+		fi
+
+		if test "$cf_have_incdir" = no ; then
+		  if test "$cf_add_incdir" = /usr/local/include ; then
+			if test "$GCC" = yes
+			then
+			  cf_save_CPPFLAGS=$CPPFLAGS
+			  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
+			  cat >conftest.$ac_ext <<_ACEOF
+#line 7554 "configure"
+#include "confdefs.h"
+#include <stdio.h>
+int
+main ()
+{
+printf("Hello")
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:7566: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:7569: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:7572: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:7575: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_have_incdir=yes
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+			  CPPFLAGS=$cf_save_CPPFLAGS
+			fi
+		  fi
+		fi
+
+		if test "$cf_have_incdir" = no ; then
+		  test -n "$verbose" && echo "	adding $cf_add_incdir to include-path" 1>&6
+
+echo "${as_me:-configure}:7592: testing adding $cf_add_incdir to include-path ..." 1>&5
+
+		  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
+
+		  cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
+		  test "$cf_top_incdir" = "$cf_add_incdir" && break
+		  cf_add_incdir="$cf_top_incdir"
+		else
+		  break
+		fi
+	  fi
+	done
+  done
+fi
+
+if test -n "$cf_cv_library_path_utf8" ; then
+  for cf_add_libdir in $cf_cv_library_path_utf8
+  do
+    if test $cf_add_libdir = /usr/lib ; then
+      :
+    elif test -d $cf_add_libdir
+    then
+      cf_have_libdir=no
+      if test -n "$LDFLAGS$LIBS" ; then
+        # a loop is needed to ensure we can add subdirs of existing dirs
+        for cf_test_libdir in $LDFLAGS $LIBS ; do
+          if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
+            cf_have_libdir=yes; break
+          fi
+        done
+      fi
+      if test "$cf_have_libdir" = no ; then
+        test -n "$verbose" && echo "	adding $cf_add_libdir to library-path" 1>&6
+
+echo "${as_me:-configure}:7626: testing adding $cf_add_libdir to library-path ..." 1>&5
+
+        LDFLAGS="-L$cf_add_libdir $LDFLAGS"
+      fi
+    fi
+  done
+fi
+
+	LIBS="$cf_cv_library_file_utf8 $LIBS"
+fi
+
+cf_ncuconfig_root=ncursesw
+
+echo "Looking for ${cf_ncuconfig_root}-config"
+for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:7644: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_NCURSES_CONFIG+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $NCURSES_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  if $as_executable_p "$ac_dir/$ac_word"; then
+   ac_cv_path_NCURSES_CONFIG="$ac_dir/$ac_word"
+   echo "$as_me:7661: found $ac_dir/$ac_word" >&5
+   break
+fi
+done
+
+  ;;
+esac
+fi
+NCURSES_CONFIG=$ac_cv_path_NCURSES_CONFIG
+
+if test -n "$NCURSES_CONFIG"; then
+  echo "$as_me:7672: result: $NCURSES_CONFIG" >&5
+echo "${ECHO_T}$NCURSES_CONFIG" >&6
+else
+  echo "$as_me:7675: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  test -n "$NCURSES_CONFIG" && break
+done
+test -n "$NCURSES_CONFIG" || NCURSES_CONFIG="none"
+
+if test "$NCURSES_CONFIG" != none ; then
+
+CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
+LIBS="`$NCURSES_CONFIG --libs` $LIBS"
+
+# even with config script, some packages use no-override for curses.h
+
+echo "$as_me:7690: checking if we have identified curses headers" >&5
+echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
+if test "${cf_cv_ncurses_header+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+cf_cv_ncurses_header=none
+for cf_header in  \
+    ncursesw/curses.h \
+	ncursesw/ncurses.h \
+	curses.h \
+	ncurses.h
+do
+cat >conftest.$ac_ext <<_ACEOF
+#line 7704 "configure"
+#include "confdefs.h"
+#include <${cf_header}>
+int
+main ()
+{
+initscr(); tgoto("?", 0,0)
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:7716: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:7719: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:7722: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:7725: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_ncurses_header=$cf_header; break
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+done
+
+fi
+echo "$as_me:7736: result: $cf_cv_ncurses_header" >&5
+echo "${ECHO_T}$cf_cv_ncurses_header" >&6
+
+if test "$cf_cv_ncurses_header" = none ; then
+	{ { echo "$as_me:7740: error: No curses header-files found" >&5
+echo "$as_me: error: No curses header-files found" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+# cheat, to get the right #define's for HAVE_NCURSES_H, etc.
+
+for ac_header in $cf_cv_ncurses_header
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+echo "$as_me:7750: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 7756 "configure"
+#include "confdefs.h"
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:7760: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  egrep -v '^ *\+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:7766: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  eval "$as_ac_Header=yes"
+else
+  echo "$as_me: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  eval "$as_ac_Header=no"
+fi
+rm -f conftest.err conftest.$ac_ext
+fi
+echo "$as_me:7785: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+EOF
+
+fi
+done
+
+cat >>confdefs.h <<\EOF
+#define NCURSES 1
+EOF
+
+cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
+
+cat >>confdefs.h <<EOF
+#define $cf_nculib_ROOT 1
+EOF
+
+cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
+
+else
+
+cf_ncuhdr_root=ncursesw
+
+test -n "$cf_cv_curses_dir" && \
+test "$cf_cv_curses_dir" != "no" && { \
+
+if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
+  for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
+  do
+	while test $cf_add_incdir != /usr/include
+	do
+	  if test -d $cf_add_incdir
+	  then
+		cf_have_incdir=no
+		if test -n "$CFLAGS$CPPFLAGS" ; then
+		  # a loop is needed to ensure we can add subdirs of existing dirs
+		  for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
+			if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
+			  cf_have_incdir=yes; break
+			fi
+		  done
+		fi
+
+		if test "$cf_have_incdir" = no ; then
+		  if test "$cf_add_incdir" = /usr/local/include ; then
+			if test "$GCC" = yes
+			then
+			  cf_save_CPPFLAGS=$CPPFLAGS
+			  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
+			  cat >conftest.$ac_ext <<_ACEOF
+#line 7838 "configure"
+#include "confdefs.h"
+#include <stdio.h>
+int
+main ()
+{
+printf("Hello")
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:7850: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:7853: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:7856: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:7859: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_have_incdir=yes
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+			  CPPFLAGS=$cf_save_CPPFLAGS
+			fi
+		  fi
+		fi
+
+		if test "$cf_have_incdir" = no ; then
+		  test -n "$verbose" && echo "	adding $cf_add_incdir to include-path" 1>&6
+
+echo "${as_me:-configure}:7876: testing adding $cf_add_incdir to include-path ..." 1>&5
+
+		  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
+
+		  cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
+		  test "$cf_top_incdir" = "$cf_add_incdir" && break
+		  cf_add_incdir="$cf_top_incdir"
+		else
+		  break
+		fi
+	  fi
+	done
+  done
+fi
+
+}
+
+echo "$as_me:7893: checking for $cf_ncuhdr_root header in include-path" >&5
+echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
+if test "${cf_cv_ncurses_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+	cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
+	( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
+	for cf_header in $cf_header_list
+	do
+
+	cat >conftest.$ac_ext <<_ACEOF
+#line 7905 "configure"
+#include "confdefs.h"
+
+#define _XOPEN_SOURCE_EXTENDED
+#undef  HAVE_LIBUTF8_H	/* in case we used CF_UTF8_LIB */
+#define HAVE_LIBUTF8_H	/* to force ncurses' header file to use cchar_t */
+
+#include <$cf_header>
+int
+main ()
+{
+
+#ifdef NCURSES_VERSION
+
+#ifndef WACS_BSSB
+	make an error
+#endif
+
+printf("%s\n", NCURSES_VERSION);
+#else
+#ifdef __NCURSES_H
+printf("old\n");
+#else
+	make an error
+#endif
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:7937: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:7940: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:7943: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:7946: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_ncurses_h=$cf_header
+
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_ncurses_h=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+		test "$cf_cv_ncurses_h" != no && break
+	done
+
+fi
+echo "$as_me:7961: result: $cf_cv_ncurses_h" >&5
+echo "${ECHO_T}$cf_cv_ncurses_h" >&6
+
+if test "$cf_cv_ncurses_h" != no ; then
+	cf_cv_ncurses_header=$cf_cv_ncurses_h
+else
+
+echo "$as_me:7968: checking for $cf_ncuhdr_root include-path" >&5
+echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
+if test "${cf_cv_ncurses_h2+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+	test -n "$verbose" && echo
+
+cf_search=
+
+# collect the current set of include-directories from compiler flags
+cf_header_path_list=""
+if test -n "${CFLAGS}${CPPFLAGS}" ; then
+	for cf_header_path in $CPPFLAGS $CFLAGS
+	do
+		case $cf_header_path in #(vi
+		-I*)
+			cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
+
+test "$cf_header_path" != "NONE" && \
+test -d "$cf_header_path" && \
+ {
+	test -n "$verbose" && echo "	... testing for include-directories under $cf_header_path"
+	test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
+	test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
+	test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
+	test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
+	test -d $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
+}
+
+			cf_header_path_list="$cf_header_path_list $cf_search"
+			;;
+		esac
+	done
+fi
+
+# add the variations for the package we are looking for
+
+cf_search=
+
+test "/usr" != "$prefix" && \
+test -d "/usr" && \
+(test $prefix = NONE || test "/usr" != "$prefix") && {
+	test -n "$verbose" && echo "	... testing for include-directories under /usr"
+	test -d /usr/include &&          cf_search="$cf_search /usr/include"
+	test -d /usr/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
+	test -d /usr/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include"
+	test -d /usr/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/$cf_ncuhdr_root/include"
+	test -d /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
+}
+
+test "$prefix" != "NONE" && \
+test -d "$prefix" && \
+ {
+	test -n "$verbose" && echo "	... testing for include-directories under $prefix"
+	test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
+	test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
+	test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
+	test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
+	test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
+}
+
+test "/usr/local" != "$prefix" && \
+test -d "/usr/local" && \
+(test $prefix = NONE || test "/usr/local" != "$prefix") && {
+	test -n "$verbose" && echo "	... testing for include-directories under /usr/local"
+	test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
+	test -d /usr/local/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
+	test -d /usr/local/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include"
+	test -d /usr/local/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include"
+	test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
+}
+
+test "/opt" != "$prefix" && \
+test -d "/opt" && \
+(test $prefix = NONE || test "/opt" != "$prefix") && {
+	test -n "$verbose" && echo "	... testing for include-directories under /opt"
+	test -d /opt/include &&          cf_search="$cf_search /opt/include"
+	test -d /opt/include/$cf_ncuhdr_root &&       cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
+	test -d /opt/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include"
+	test -d /opt/$cf_ncuhdr_root/include &&       cf_search="$cf_search /opt/$cf_ncuhdr_root/include"
+	test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
+}
+
+test "$HOME" != "$prefix" && \
+test -d "$HOME" && \
+(test $prefix = NONE || test "$HOME" != "$prefix") && {
+	test -n "$verbose" && echo "	... testing for include-directories under $HOME"
+	test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
+	test -d $HOME/include/$cf_ncuhdr_root &&       cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
+	test -d $HOME/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include"
+	test -d $HOME/$cf_ncuhdr_root/include &&       cf_search="$cf_search $HOME/$cf_ncuhdr_root/include"
+	test -d $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
+}
+
+test "$includedir" != NONE && \
+test "$includedir" != "/usr/include" && \
+test -d "$includedir" && {
+	test -d $includedir &&    cf_search="$cf_search $includedir"
+	test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
+}
+
+test "$oldincludedir" != NONE && \
+test "$oldincludedir" != "/usr/include" && \
+test -d "$oldincludedir" && {
+	test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
+	test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
+}
+
+cf_search="$cf_search $cf_header_path_list"
+
+	test -n "$verbose" && echo search path $cf_search
+	cf_save2_CPPFLAGS="$CPPFLAGS"
+	for cf_incdir in $cf_search
+	do
+
+if test -n "$cf_incdir" ; then
+  for cf_add_incdir in $cf_incdir
+  do
+	while test $cf_add_incdir != /usr/include
+	do
+	  if test -d $cf_add_incdir
+	  then
+		cf_have_incdir=no
+		if test -n "$CFLAGS$CPPFLAGS" ; then
+		  # a loop is needed to ensure we can add subdirs of existing dirs
+		  for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
+			if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
+			  cf_have_incdir=yes; break
+			fi
+		  done
+		fi
+
+		if test "$cf_have_incdir" = no ; then
+		  if test "$cf_add_incdir" = /usr/local/include ; then
+			if test "$GCC" = yes
+			then
+			  cf_save_CPPFLAGS=$CPPFLAGS
+			  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
+			  cat >conftest.$ac_ext <<_ACEOF
+#line 8108 "configure"
+#include "confdefs.h"
+#include <stdio.h>
+int
+main ()
+{
+printf("Hello")
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:8120: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:8123: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:8126: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:8129: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_have_incdir=yes
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+			  CPPFLAGS=$cf_save_CPPFLAGS
+			fi
+		  fi
+		fi
+
+		if test "$cf_have_incdir" = no ; then
+		  test -n "$verbose" && echo "	adding $cf_add_incdir to include-path" 1>&6
+
+echo "${as_me:-configure}:8146: testing adding $cf_add_incdir to include-path ..." 1>&5
+
+		  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
+
+		  cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
+		  test "$cf_top_incdir" = "$cf_add_incdir" && break
+		  cf_add_incdir="$cf_top_incdir"
+		else
+		  break
+		fi
+	  fi
+	done
+  done
+fi
+
+		for cf_header in \
+			ncurses.h \
+			curses.h
+		do
+
+	cat >conftest.$ac_ext <<_ACEOF
+#line 8167 "configure"
+#include "confdefs.h"
+
+#include <$cf_header>
+int
+main ()
+{
+
+#ifdef NCURSES_VERSION
+
+printf("%s\n", NCURSES_VERSION);
+#else
+#ifdef __NCURSES_H
+printf("old\n");
+#else
+	make an error
+#endif
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:8191: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:8194: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:8197: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:8200: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_ncurses_h2=$cf_header
+
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_ncurses_h2=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+			if test "$cf_cv_ncurses_h2" != no ; then
+				cf_cv_ncurses_h2=$cf_incdir/$cf_header
+				test -n "$verbose" && echo $ac_n "	... found $ac_c" 1>&6
+				break
+			fi
+			test -n "$verbose" && echo "	... tested $cf_incdir/$cf_header" 1>&6
+		done
+		CPPFLAGS="$cf_save2_CPPFLAGS"
+		test "$cf_cv_ncurses_h2" != no && break
+	done
+	test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8221: error: not found" >&5
+echo "$as_me: error: not found" >&2;}
+   { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:8226: result: $cf_cv_ncurses_h2" >&5
+echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
+
+	cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
+	cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
+	if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
+		cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
+	fi
+
+if test -n "$cf_1st_incdir" ; then
+  for cf_add_incdir in $cf_1st_incdir
+  do
+	while test $cf_add_incdir != /usr/include
+	do
+	  if test -d $cf_add_incdir
+	  then
+		cf_have_incdir=no
+		if test -n "$CFLAGS$CPPFLAGS" ; then
+		  # a loop is needed to ensure we can add subdirs of existing dirs
+		  for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
+			if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
+			  cf_have_incdir=yes; break
+			fi
+		  done
+		fi
+
+		if test "$cf_have_incdir" = no ; then
+		  if test "$cf_add_incdir" = /usr/local/include ; then
+			if test "$GCC" = yes
+			then
+			  cf_save_CPPFLAGS=$CPPFLAGS
+			  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
+			  cat >conftest.$ac_ext <<_ACEOF
+#line 8259 "configure"
+#include "confdefs.h"
+#include <stdio.h>
+int
+main ()
+{
+printf("Hello")
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:8271: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:8274: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:8277: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:8280: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_have_incdir=yes
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+			  CPPFLAGS=$cf_save_CPPFLAGS
+			fi
+		  fi
+		fi
+
+		if test "$cf_have_incdir" = no ; then
+		  test -n "$verbose" && echo "	adding $cf_add_incdir to include-path" 1>&6
+
+echo "${as_me:-configure}:8297: testing adding $cf_add_incdir to include-path ..." 1>&5
+
+		  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
+
+		  cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
+		  test "$cf_top_incdir" = "$cf_add_incdir" && break
+		  cf_add_incdir="$cf_top_incdir"
+		else
+		  break
+		fi
+	  fi
+	done
+  done
+fi
+
+fi
+
+# Set definitions to allow ifdef'ing for ncurses.h
+
+case $cf_cv_ncurses_header in # (vi
+*ncurses.h)
+	cat >>confdefs.h <<\EOF
+#define HAVE_NCURSES_H 1
+EOF
+
+	;;
+esac
+
+case $cf_cv_ncurses_header in # (vi
+ncurses/curses.h|ncurses/ncurses.h)
+	cat >>confdefs.h <<\EOF
+#define HAVE_NCURSES_NCURSES_H 1
+EOF
+
+	;;
+ncursesw/curses.h|ncursesw/ncurses.h)
+	cat >>confdefs.h <<\EOF
+#define HAVE_NCURSESW_NCURSES_H 1
+EOF
+
+	;;
+esac
+
+echo "$as_me:8340: checking for terminfo header" >&5
+echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
+if test "${cf_cv_term_header+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+case ${cf_cv_ncurses_header} in #(vi
+*/ncurses.h|*/ncursesw.h) #(vi
+	cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
+	;;
+*)
+	cf_term_header=term.h
+	;;
+esac
+
+for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
+do
+cat >conftest.$ac_ext <<_ACEOF
+#line 8358 "configure"
+#include "confdefs.h"
+#include <stdio.h>
+#include <${cf_cv_ncurses_header:-curses.h}>
+#include <$cf_test>
+
+int
+main ()
+{
+int x = auto_left_margin
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:8373: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:8376: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:8379: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:8382: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+
+	cf_cv_term_header="$cf_test"
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+
+	cf_cv_term_header=unknown
+
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+	test "$cf_cv_term_header" != unknown && break
+done
+
+fi
+echo "$as_me:8398: result: $cf_cv_term_header" >&5
+echo "${ECHO_T}$cf_cv_term_header" >&6
+
+# Set definitions to allow ifdef'ing to accommodate subdirectories
+
+case $cf_cv_term_header in # (vi
+*term.h)
+	cat >>confdefs.h <<\EOF
+#define HAVE_TERM_H 1
+EOF
+
+	;;
+esac
+
+case $cf_cv_term_header in # (vi
+ncurses/term.h) #(vi
+	cat >>confdefs.h <<\EOF
+#define HAVE_NCURSES_TERM_H 1
+EOF
+
+	;;
+ncursesw/term.h)
+	cat >>confdefs.h <<\EOF
+#define HAVE_NCURSESW_TERM_H 1
+EOF
+
+	;;
+esac
+
+# some applications need this, but should check for NCURSES_VERSION
+cat >>confdefs.h <<\EOF
+#define NCURSES 1
+EOF
+
+echo "$as_me:8432: checking for ncurses version" >&5
+echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
+if test "${cf_cv_ncurses_version+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+	cf_cv_ncurses_version=no
+	cf_tempfile=out$$
+	rm -f $cf_tempfile
+	if test "$cross_compiling" = yes; then
+
+	# This will not work if the preprocessor splits the line after the
+	# Autoconf token.  The 'unproto' program does that.
+	cat > conftest.$ac_ext <<EOF
+#include <${cf_cv_ncurses_header:-curses.h}>
+#undef Autoconf
+#ifdef NCURSES_VERSION
+Autoconf NCURSES_VERSION
+#else
+#ifdef __NCURSES_H
+Autoconf "old"
+#endif
+;
+#endif
+EOF
+	cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
+	{ (eval echo "$as_me:8458: \"$cf_try\"") >&5
+  (eval $cf_try) 2>&5
+  ac_status=$?
+  echo "$as_me:8461: \$? = $ac_status" >&5
+  (exit $ac_status); }
+	if test -f conftest.out ; then
+		cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
+		test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
+		rm -f conftest.out
+	fi
+
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 8471 "configure"
+#include "confdefs.h"
+
+#include <${cf_cv_ncurses_header:-curses.h}>
+#include <stdio.h>
+int main()
+{
+	FILE *fp = fopen("$cf_tempfile", "w");
+#ifdef NCURSES_VERSION
+# ifdef NCURSES_VERSION_PATCH
+	fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
+# else
+	fprintf(fp, "%s\n", NCURSES_VERSION);
+# endif
+#else
+# ifdef __NCURSES_H
+	fprintf(fp, "old\n");
+# else
+	make an error
+# endif
+#endif
+	${cf_cv_main_return:-return}(0);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:8496: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:8499: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:8501: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:8504: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+
+	cf_cv_ncurses_version=`cat $cf_tempfile`
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+	rm -f $cf_tempfile
+
+fi
+echo "$as_me:8518: result: $cf_cv_ncurses_version" >&5
+echo "${ECHO_T}$cf_cv_ncurses_version" >&6
+test "$cf_cv_ncurses_version" = no || cat >>confdefs.h <<\EOF
+#define NCURSES 1
+EOF
+
+cf_nculib_root=ncursesw
+	# This works, except for the special case where we find gpm, but
+	# ncurses is in a nonstandard location via $LIBS, and we really want
+	# to link gpm.
+cf_ncurses_LIBS=""
+cf_ncurses_SAVE="$LIBS"
+echo "$as_me:8530: checking for Gpm_Open in -lgpm" >&5
+echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
+if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lgpm  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line 8538 "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char Gpm_Open ();
+int
+main ()
+{
+Gpm_Open ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:8557: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:8560: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:8563: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:8566: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_gpm_Gpm_Open=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_gpm_Gpm_Open=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:8577: result: $ac_cv_lib_gpm_Gpm_Open" >&5
+echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
+if test $ac_cv_lib_gpm_Gpm_Open = yes; then
+  echo "$as_me:8580: checking for initscr in -lgpm" >&5
+echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
+if test "${ac_cv_lib_gpm_initscr+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lgpm  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line 8588 "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char initscr ();
+int
+main ()
+{
+initscr ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:8607: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:8610: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:8613: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:8616: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_gpm_initscr=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_gpm_initscr=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:8627: result: $ac_cv_lib_gpm_initscr" >&5
+echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
+if test $ac_cv_lib_gpm_initscr = yes; then
+  LIBS="$cf_ncurses_SAVE"
+else
+  cf_ncurses_LIBS="-lgpm"
+fi
+
+fi
+
+case $host_os in #(vi
+freebsd*)
+	# This is only necessary if you are linking against an obsolete
+	# version of ncurses (but it should do no harm, since it's static).
+	if test "$cf_nculib_root" = ncurses ; then
+		echo "$as_me:8642: checking for tgoto in -lmytinfo" >&5
+echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
+if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lmytinfo  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line 8650 "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char tgoto ();
+int
+main ()
+{
+tgoto ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:8669: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:8672: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:8675: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:8678: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_mytinfo_tgoto=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_mytinfo_tgoto=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:8689: result: $ac_cv_lib_mytinfo_tgoto" >&5
+echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
+if test $ac_cv_lib_mytinfo_tgoto = yes; then
+  cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
+fi
+
+	fi
+	;;
+esac
+
+LIBS="$cf_ncurses_LIBS $LIBS"
+
+if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
+then
+	LIBS="-l$cf_nculib_root $LIBS"
+else
+
+	eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
+	cf_libdir=""
+	echo "$as_me:8708: checking for initscr" >&5
+echo $ECHO_N "checking for initscr... $ECHO_C" >&6
+if test "${ac_cv_func_initscr+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 8714 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char initscr (); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char initscr ();
+char (*f) ();
+
+int
+main ()
+{
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_initscr) || defined (__stub___initscr)
+choke me
+#else
+f = initscr;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:8745: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:8748: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:8751: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:8754: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_initscr=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_func_initscr=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:8764: result: $ac_cv_func_initscr" >&5
+echo "${ECHO_T}$ac_cv_func_initscr" >&6
+if test $ac_cv_func_initscr = yes; then
+  eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
+else
+
+		cf_save_LIBS="$LIBS"
+		echo "$as_me:8771: checking for initscr in -l$cf_nculib_root" >&5
+echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
+		LIBS="-l$cf_nculib_root $LIBS"
+		cat >conftest.$ac_ext <<_ACEOF
+#line 8775 "configure"
+#include "confdefs.h"
+#include <${cf_cv_ncurses_header:-curses.h}>
+int
+main ()
+{
+initscr()
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:8787: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:8790: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:8793: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:8796: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  echo "$as_me:8798: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+			 eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
+
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+echo "$as_me:8805: result: no" >&5
+echo "${ECHO_T}no" >&6
+
+cf_search=
+cf_library_path_list=""
+if test -n "${LDFLAGS}${LIBS}" ; then
+	for cf_library_path in $LDFLAGS $LIBS
+	do
+		case $cf_library_path in #(vi
+		-L*)
+			cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
+
+test "$cf_library_path" != "NONE" && \
+test -d "$cf_library_path" && \
+ {
+	test -n "$verbose" && echo "	... testing for lib-directories under $cf_library_path"
+	test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
+	test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
+	test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
+	test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
+	test -d $cf_library_path/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib/$cf_nculib_root"
+}
+
+			cf_library_path_list="$cf_library_path_list $cf_search"
+			;;
+		esac
+	done
+fi
+
+cf_search=
+
+test "/usr" != "$prefix" && \
+test -d "/usr" && \
+(test $prefix = NONE || test "/usr" != "$prefix") && {
+	test -n "$verbose" && echo "	... testing for lib-directories under /usr"
+	test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
+	test -d /usr/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/lib/$cf_nculib_root"
+	test -d /usr/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/lib/$cf_nculib_root/lib"
+	test -d /usr/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/$cf_nculib_root/lib"
+	test -d /usr/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/$cf_nculib_root/lib/$cf_nculib_root"
+}
+
+test "$prefix" != "NONE" && \
+test -d "$prefix" && \
+ {
+	test -n "$verbose" && echo "	... testing for lib-directories under $prefix"
+	test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
+	test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
+	test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
+	test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
+	test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
+}
+
+test "/usr/local" != "$prefix" && \
+test -d "/usr/local" && \
+(test $prefix = NONE || test "/usr/local" != "$prefix") && {
+	test -n "$verbose" && echo "	... testing for lib-directories under /usr/local"
+	test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
+	test -d /usr/local/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/local/lib/$cf_nculib_root"
+	test -d /usr/local/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib"
+	test -d /usr/local/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/local/$cf_nculib_root/lib"
+	test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root"
+}
+
+test "/opt" != "$prefix" && \
+test -d "/opt" && \
+(test $prefix = NONE || test "/opt" != "$prefix") && {
+	test -n "$verbose" && echo "	... testing for lib-directories under /opt"
+	test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
+	test -d /opt/lib/$cf_nculib_root &&       cf_search="$cf_search /opt/lib/$cf_nculib_root"
+	test -d /opt/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /opt/lib/$cf_nculib_root/lib"
+	test -d /opt/$cf_nculib_root/lib &&       cf_search="$cf_search /opt/$cf_nculib_root/lib"
+	test -d /opt/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root"
+}
+
+test "$HOME" != "$prefix" && \
+test -d "$HOME" && \
+(test $prefix = NONE || test "$HOME" != "$prefix") && {
+	test -n "$verbose" && echo "	... testing for lib-directories under $HOME"
+	test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
+	test -d $HOME/lib/$cf_nculib_root &&       cf_search="$cf_search $HOME/lib/$cf_nculib_root"
+	test -d $HOME/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib"
+	test -d $HOME/$cf_nculib_root/lib &&       cf_search="$cf_search $HOME/$cf_nculib_root/lib"
+	test -d $HOME/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root"
+}
+
+cf_search="$cf_library_path_list $cf_search"
+
+			for cf_libdir in $cf_search
+			do
+				echo "$as_me:8895: checking for -l$cf_nculib_root in $cf_libdir" >&5
+echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
+				LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
+				cat >conftest.$ac_ext <<_ACEOF
+#line 8899 "configure"
+#include "confdefs.h"
+#include <${cf_cv_ncurses_header:-curses.h}>
+int
+main ()
+{
+initscr()
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:8911: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:8914: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:8917: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:8920: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  echo "$as_me:8922: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+			 		 eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
+					 break
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+echo "$as_me:8929: result: no" >&5
+echo "${ECHO_T}no" >&6
+					 LIBS="$cf_save_LIBS"
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+			done
+
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+
+fi
+
+eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
+
+if test $cf_found_library = no ; then
+	{ { echo "$as_me:8944: error: Cannot link $cf_nculib_root library" >&5
+echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+fi
+
+if test -n "$cf_ncurses_LIBS" ; then
+	echo "$as_me:8952: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
+echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
+	cf_ncurses_SAVE="$LIBS"
+	for p in $cf_ncurses_LIBS ; do
+		q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
+		if test "$q" != "$LIBS" ; then
+			LIBS="$q"
+		fi
+	done
+	cat >conftest.$ac_ext <<_ACEOF
+#line 8962 "configure"
+#include "confdefs.h"
+#include <${cf_cv_ncurses_header:-curses.h}>
+int
+main ()
+{
+initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:8974: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:8977: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:8980: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:8983: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  echo "$as_me:8985: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+echo "$as_me:8990: result: no" >&5
+echo "${ECHO_T}no" >&6
+		 LIBS="$cf_ncurses_SAVE"
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+
+cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
+
+cat >>confdefs.h <<EOF
+#define $cf_nculib_ROOT 1
+EOF
+
+fi
+
+	;;
+pdcurses) #(vi
+
+echo "$as_me:9008: checking if you want to use pkg-config" >&5
+echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
+
+# Check whether --with-pkg-config or --without-pkg-config was given.
+if test "${with_pkg_config+set}" = set; then
+  withval="$with_pkg_config"
+  cf_pkg_config=$withval
+else
+  cf_pkg_config=yes
+fi;
+echo "$as_me:9018: result: $cf_pkg_config" >&5
+echo "${ECHO_T}$cf_pkg_config" >&6
+
+case $cf_pkg_config in #(vi
+no) #(vi
+	PKG_CONFIG=none
+	;;
+yes) #(vi
+	# Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+echo "$as_me:9028: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  if $as_executable_p "$ac_dir/$ac_word"; then
+   ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
+   echo "$as_me:9045: found $ac_dir/$ac_word" >&5
+   break
+fi
+done
+
+  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="none"
+  ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+
+if test -n "$PKG_CONFIG"; then
+  echo "$as_me:9057: result: $PKG_CONFIG" >&5
+echo "${ECHO_T}$PKG_CONFIG" >&6
+else
+  echo "$as_me:9060: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+	;;
+*)
+	PKG_CONFIG=$withval
+	;;
+esac
+
+test -z "$PKG_CONFIG" && PKG_CONFIG=none
+if test "$PKG_CONFIG" != none ; then
+
+if test "x$prefix" != xNONE; then
+  cf_path_syntax="$prefix"
+else
+  cf_path_syntax="$ac_default_prefix"
+fi
+
+case ".$PKG_CONFIG" in #(vi
+.\$\(*\)*|.\'*\'*) #(vi
+  ;;
+..|./*|.\\*) #(vi
+  ;;
+.[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
+  ;;
+.\${*prefix}*) #(vi
+  eval PKG_CONFIG="$PKG_CONFIG"
+  case ".$PKG_CONFIG" in #(vi
+  .NONE/*)
+    PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
+    ;;
+  esac
+  ;; #(vi
+.no|.NONE/*)
+  PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
+  ;;
+*)
+  { { echo "$as_me:9098: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
+echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
+   { (exit 1); exit 1; }; }
+  ;;
+esac
+
+fi
+
+echo "$as_me:9106: checking for X" >&5
+echo $ECHO_N "checking for X... $ECHO_C" >&6
+
+# Check whether --with-x or --without-x was given.
+if test "${with_x+set}" = set; then
+  withval="$with_x"
+
+fi;
+# $have_x is `yes', `no', `disabled', or empty when we do not yet know.
+if test "x$with_x" = xno; then
+  # The user explicitly disabled X.
+  have_x=disabled
+else
+  if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
+    # Both variables are already set.
+    have_x=yes
+  else
+    if test "${ac_cv_have_x+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # One or both of the vars are not set, and there is no cached value.
+ac_x_includes=no ac_x_libraries=no
+rm -fr conftest.dir
+if mkdir conftest.dir; then
+  cd conftest.dir
+  # Make sure to not put "make" in the Imakefile rules, since we grep it out.
+  cat >Imakefile <<'EOF'
+acfindx:
+	@echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
+EOF
+  if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
+    # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+    eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
+    # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
+    for ac_extension in a so sl dylib dll; do
+      if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
+         test -f $ac_im_libdir/libX11.$ac_extension; then
+        ac_im_usrlibdir=$ac_im_libdir; break
+      fi
+    done
+    # Screen out bogus values from the imake configuration.  They are
+    # bogus both because they are the default anyway, and because
+    # using them would break gcc on systems where it needs fixed includes.
+    case $ac_im_incroot in
+	/usr/include) ;;
+	*) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
+    esac
+    case $ac_im_usrlibdir in
+	/usr/lib | /lib) ;;
+	*) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
+    esac
+  fi
+  cd ..
+  rm -fr conftest.dir
+fi
+
+# Standard set of common directories for X headers.
+# Check X11 before X11Rn because it is often a symlink to the current release.
+ac_x_header_dirs='
+/usr/X11/include
+/usr/X11R6/include
+/usr/X11R5/include
+/usr/X11R4/include
+
+/usr/include/X11
+/usr/include/X11R6
+/usr/include/X11R5
+/usr/include/X11R4
+
+/usr/local/X11/include
+/usr/local/X11R6/include
+/usr/local/X11R5/include
+/usr/local/X11R4/include
+
+/usr/local/include/X11
+/usr/local/include/X11R6
+/usr/local/include/X11R5
+/usr/local/include/X11R4
+
+/usr/X386/include
+/usr/x386/include
+/usr/XFree86/include/X11
+
+/usr/include
+/usr/local/include
+/usr/unsupported/include
+/usr/athena/include
+/usr/local/x11r5/include
+/usr/lpp/Xamples/include
+
+/usr/openwin/include
+/usr/openwin/share/include'
+
+if test "$ac_x_includes" = no; then
+  # Guess where to find include files, by looking for Intrinsic.h.
+  # First, try using that file with no special directory specified.
+  cat >conftest.$ac_ext <<_ACEOF
+#line 9203 "configure"
+#include "confdefs.h"
+#include <X11/Intrinsic.h>
+_ACEOF
+if { (eval echo "$as_me:9207: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  egrep -v '^ *\+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:9213: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  # We can compile using X headers with no special include directory.
+ac_x_includes=
+else
+  echo "$as_me: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  for ac_dir in $ac_x_header_dirs; do
+  if test -r "$ac_dir/X11/Intrinsic.h"; then
+    ac_x_includes=$ac_dir
+    break
+  fi
+done
+fi
+rm -f conftest.err conftest.$ac_ext
+fi # $ac_x_includes = no
+
+if test "$ac_x_libraries" = no; then
+  # Check for the libraries.
+  # See if we find them without any special options.
+  # Don't add to $LIBS permanently.
+  ac_save_LIBS=$LIBS
+  LIBS="-lXt $LIBS"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 9246 "configure"
+#include "confdefs.h"
+#include <X11/Intrinsic.h>
+int
+main ()
+{
+XtMalloc (0)
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:9258: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:9261: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:9264: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:9267: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  LIBS=$ac_save_LIBS
+# We can link X programs with no special library path.
+ac_x_libraries=
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+LIBS=$ac_save_LIBS
+for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
+do
+  # Don't even attempt the hair of trying to link an X program!
+  for ac_extension in a so sl dylib dll; do
+    if test -r $ac_dir/libXt.$ac_extension; then
+      ac_x_libraries=$ac_dir
+      break 2
+    fi
+  done
+done
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi # $ac_x_libraries = no
+
+if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
+  # Didn't find X anywhere.  Cache the known absence of X.
+  ac_cv_have_x="have_x=no"
+else
+  # Record where we found X for the cache.
+  ac_cv_have_x="have_x=yes \
+	        ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
+fi
+fi
+
+  fi
+  eval "$ac_cv_have_x"
+fi # $with_x != no
+
+if test "$have_x" != yes; then
+  echo "$as_me:9305: result: $have_x" >&5
+echo "${ECHO_T}$have_x" >&6
+  no_x=yes
+else
+  # If each of the values was on the command line, it overrides each guess.
+  test "x$x_includes" = xNONE && x_includes=$ac_x_includes
+  test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
+  # Update the cache value to reflect the command line values.
+  ac_cv_have_x="have_x=yes \
+		ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
+  echo "$as_me:9315: result: libraries $x_libraries, headers $x_includes" >&5
+echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
+fi
+
+if test "$no_x" = yes; then
+  # Not all programs may use this symbol, but it does not hurt to define it.
+
+cat >>confdefs.h <<\EOF
+#define X_DISPLAY_MISSING 1
+EOF
+
+  X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
+else
+  if test -n "$x_includes"; then
+    X_CFLAGS="$X_CFLAGS -I$x_includes"
+  fi
+
+  # It would also be nice to do this for all -L options, not just this one.
+  if test -n "$x_libraries"; then
+    X_LIBS="$X_LIBS -L$x_libraries"
+    # For Solaris; some versions of Sun CC require a space after -R and
+    # others require no space.  Words are not sufficient . . . .
+    case `(uname -sr) 2>/dev/null` in
+    "SunOS 5"*)
+      echo "$as_me:9339: checking whether -R must be followed by a space" >&5
+echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
+      ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
+      cat >conftest.$ac_ext <<_ACEOF
+#line 9343 "configure"
+#include "confdefs.h"
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:9355: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:9358: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:9361: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:9364: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_R_nospace=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_R_nospace=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+      if test $ac_R_nospace = yes; then
+	echo "$as_me:9374: result: no" >&5
+echo "${ECHO_T}no" >&6
+	X_LIBS="$X_LIBS -R$x_libraries"
+      else
+	LIBS="$ac_xsave_LIBS -R $x_libraries"
+	cat >conftest.$ac_ext <<_ACEOF
+#line 9380 "configure"
+#include "confdefs.h"
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:9392: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:9395: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:9398: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:9401: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_R_space=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_R_space=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+	if test $ac_R_space = yes; then
+	  echo "$as_me:9411: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+	  X_LIBS="$X_LIBS -R $x_libraries"
+	else
+	  echo "$as_me:9415: result: neither works" >&5
+echo "${ECHO_T}neither works" >&6
+	fi
+      fi
+      LIBS=$ac_xsave_LIBS
+    esac
+  fi
+
+  # Check for system-dependent libraries X programs must link with.
+  # Do this before checking for the system-independent R6 libraries
+  # (-lICE), since we may need -lsocket or whatever for X linking.
+
+  if test "$ISC" = yes; then
+    X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
+  else
+    # Martyn Johnson says this is needed for Ultrix, if the X
+    # libraries were built with DECnet support.  And Karl Berry says
+    # the Alpha needs dnet_stub (dnet does not exist).
+    ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
+    cat >conftest.$ac_ext <<_ACEOF
+#line 9435 "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char XOpenDisplay ();
+int
+main ()
+{
+XOpenDisplay ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:9454: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:9457: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:9460: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:9463: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+echo "$as_me:9469: checking for dnet_ntoa in -ldnet" >&5
+echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
+if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldnet  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line 9477 "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dnet_ntoa ();
+int
+main ()
+{
+dnet_ntoa ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:9496: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:9499: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:9502: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:9505: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_dnet_dnet_ntoa=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_dnet_dnet_ntoa=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:9516: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
+echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
+if test $ac_cv_lib_dnet_dnet_ntoa = yes; then
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
+fi
+
+    if test $ac_cv_lib_dnet_dnet_ntoa = no; then
+      echo "$as_me:9523: checking for dnet_ntoa in -ldnet_stub" >&5
+echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
+if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldnet_stub  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line 9531 "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dnet_ntoa ();
+int
+main ()
+{
+dnet_ntoa ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:9550: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:9553: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:9556: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:9559: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_dnet_stub_dnet_ntoa=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_dnet_stub_dnet_ntoa=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:9570: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
+echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
+if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
+fi
+
+    fi
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+    LIBS="$ac_xsave_LIBS"
+
+    # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
+    # to get the SysV transport functions.
+    # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
+    # needs -lnsl.
+    # The nsl library prevents programs from opening the X display
+    # on Irix 5.2, according to T.E. Dickey.
+    # The functions gethostbyname, getservbyname, and inet_addr are
+    # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
+    echo "$as_me:9589: checking for gethostbyname" >&5
+echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
+if test "${ac_cv_func_gethostbyname+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 9595 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char gethostbyname (); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char gethostbyname ();
+char (*f) ();
+
+int
+main ()
+{
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
+choke me
+#else
+f = gethostbyname;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:9626: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:9629: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:9632: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:9635: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_gethostbyname=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_func_gethostbyname=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:9645: result: $ac_cv_func_gethostbyname" >&5
+echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
+
+    if test $ac_cv_func_gethostbyname = no; then
+      echo "$as_me:9649: checking for gethostbyname in -lnsl" >&5
+echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
+if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lnsl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line 9657 "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char gethostbyname ();
+int
+main ()
+{
+gethostbyname ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:9676: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:9679: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:9682: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:9685: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_nsl_gethostbyname=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_nsl_gethostbyname=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:9696: result: $ac_cv_lib_nsl_gethostbyname" >&5
+echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
+if test $ac_cv_lib_nsl_gethostbyname = yes; then
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
+fi
+
+      if test $ac_cv_lib_nsl_gethostbyname = no; then
+        echo "$as_me:9703: checking for gethostbyname in -lbsd" >&5
+echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
+if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lbsd  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line 9711 "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char gethostbyname ();
+int
+main ()
+{
+gethostbyname ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:9730: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:9733: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:9736: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:9739: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_bsd_gethostbyname=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_bsd_gethostbyname=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:9750: result: $ac_cv_lib_bsd_gethostbyname" >&5
+echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
+if test $ac_cv_lib_bsd_gethostbyname = yes; then
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
+fi
+
+      fi
+    fi
+
+    # lieder@skyler.mavd.honeywell.com says without -lsocket,
+    # socket/setsockopt and other routines are undefined under SCO ODT
+    # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
+    # on later versions), says Simon Leinen: it contains gethostby*
+    # variants that don't use the nameserver (or something).  -lsocket
+    # must be given before -lnsl if both are needed.  We assume that
+    # if connect needs -lnsl, so does gethostbyname.
+    echo "$as_me:9766: checking for connect" >&5
+echo $ECHO_N "checking for connect... $ECHO_C" >&6
+if test "${ac_cv_func_connect+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 9772 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char connect (); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char connect ();
+char (*f) ();
+
+int
+main ()
+{
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_connect) || defined (__stub___connect)
+choke me
+#else
+f = connect;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:9803: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:9806: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:9809: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:9812: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_connect=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_func_connect=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:9822: result: $ac_cv_func_connect" >&5
+echo "${ECHO_T}$ac_cv_func_connect" >&6
+
+    if test $ac_cv_func_connect = no; then
+      echo "$as_me:9826: checking for connect in -lsocket" >&5
+echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
+if test "${ac_cv_lib_socket_connect+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line 9834 "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char connect ();
+int
+main ()
+{
+connect ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:9853: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:9856: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:9859: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:9862: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_socket_connect=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_socket_connect=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:9873: result: $ac_cv_lib_socket_connect" >&5
+echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
+if test $ac_cv_lib_socket_connect = yes; then
+  X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
+fi
+
+    fi
+
+    # Guillermo Gomez says -lposix is necessary on A/UX.
+    echo "$as_me:9882: checking for remove" >&5
+echo $ECHO_N "checking for remove... $ECHO_C" >&6
+if test "${ac_cv_func_remove+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 9888 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char remove (); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char remove ();
+char (*f) ();
+
+int
+main ()
+{
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_remove) || defined (__stub___remove)
+choke me
+#else
+f = remove;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:9919: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:9922: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:9925: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:9928: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_remove=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_func_remove=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:9938: result: $ac_cv_func_remove" >&5
+echo "${ECHO_T}$ac_cv_func_remove" >&6
+
+    if test $ac_cv_func_remove = no; then
+      echo "$as_me:9942: checking for remove in -lposix" >&5
+echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
+if test "${ac_cv_lib_posix_remove+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lposix  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line 9950 "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char remove ();
+int
+main ()
+{
+remove ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:9969: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:9972: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:9975: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:9978: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_posix_remove=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_posix_remove=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:9989: result: $ac_cv_lib_posix_remove" >&5
+echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
+if test $ac_cv_lib_posix_remove = yes; then
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
+fi
+
+    fi
+
+    # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
+    echo "$as_me:9998: checking for shmat" >&5
+echo $ECHO_N "checking for shmat... $ECHO_C" >&6
+if test "${ac_cv_func_shmat+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 10004 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char shmat (); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char shmat ();
+char (*f) ();
+
+int
+main ()
+{
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_shmat) || defined (__stub___shmat)
+choke me
+#else
+f = shmat;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:10035: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:10038: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:10041: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:10044: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_shmat=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_func_shmat=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:10054: result: $ac_cv_func_shmat" >&5
+echo "${ECHO_T}$ac_cv_func_shmat" >&6
+
+    if test $ac_cv_func_shmat = no; then
+      echo "$as_me:10058: checking for shmat in -lipc" >&5
+echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
+if test "${ac_cv_lib_ipc_shmat+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lipc  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line 10066 "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char shmat ();
+int
+main ()
+{
+shmat ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:10085: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:10088: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:10091: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:10094: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_ipc_shmat=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_ipc_shmat=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:10105: result: $ac_cv_lib_ipc_shmat" >&5
+echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
+if test $ac_cv_lib_ipc_shmat = yes; then
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
+fi
+
+    fi
+  fi
+
+  # Check for libraries that X11R6 Xt/Xaw programs need.
+  ac_save_LDFLAGS=$LDFLAGS
+  test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
+  # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
+  # check for ICE first), but we must link in the order -lSM -lICE or
+  # we get undefined symbols.  So assume we have SM if we have ICE.
+  # These have to be linked with before -lX11, unlike the other
+  # libraries we check for below, so use a different variable.
+  # John Interrante, Karl Berry
+  echo "$as_me:10123: checking for IceConnectionNumber in -lICE" >&5
+echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
+if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lICE $X_EXTRA_LIBS $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line 10131 "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char IceConnectionNumber ();
+int
+main ()
+{
+IceConnectionNumber ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:10150: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:10153: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:10156: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:10159: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_ICE_IceConnectionNumber=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_ICE_IceConnectionNumber=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:10170: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
+echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
+if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then
+  X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
+fi
+
+  LDFLAGS=$ac_save_LDFLAGS
+
+fi
+
+cf_x_athena=${cf_x_athena:-Xaw}
+
+echo "$as_me:10182: checking if you want to link with Xaw 3d library" >&5
+echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6
+withval=
+
+# Check whether --with-Xaw3d or --without-Xaw3d was given.
+if test "${with_Xaw3d+set}" = set; then
+  withval="$with_Xaw3d"
+
+fi;
+if test "$withval" = yes ; then
+	cf_x_athena=Xaw3d
+	echo "$as_me:10193: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+	echo "$as_me:10196: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+echo "$as_me:10200: checking if you want to link with neXT Athena library" >&5
+echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6
+withval=
+
+# Check whether --with-neXtaw or --without-neXtaw was given.
+if test "${with_neXtaw+set}" = set; then
+  withval="$with_neXtaw"
+
+fi;
+if test "$withval" = yes ; then
+	cf_x_athena=neXtaw
+	echo "$as_me:10211: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+	echo "$as_me:10214: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+echo "$as_me:10218: checking if you want to link with Athena-Plus library" >&5
+echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6
+withval=
+
+# Check whether --with-XawPlus or --without-XawPlus was given.
+if test "${with_XawPlus+set}" = set; then
+  withval="$with_XawPlus"
+
+fi;
+if test "$withval" = yes ; then
+	cf_x_athena=XawPlus
+	echo "$as_me:10229: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+	echo "$as_me:10232: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+cf_x_athena_lib=""
+
+if test "$PKG_CONFIG" != none ; then
+	cf_athena_list=
+	test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
+	for cf_athena_pkg in \
+		$cf_athena_list \
+		${cf_x_athena} \
+		${cf_x_athena}-devel \
+		lib${cf_x_athena} \
+		lib${cf_x_athena}-devel
+	do
+
+if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists $cf_athena_pkg; then
+	test -n "$verbose" && echo "	found package $cf_athena_pkg" 1>&6
+
+echo "${as_me:-configure}:10252: testing found package $cf_athena_pkg ..." 1>&5
+
+	cf_pkgconfig_incs="`$PKG_CONFIG --cflags $cf_athena_pkg 2>/dev/null`"
+	cf_pkgconfig_libs="`$PKG_CONFIG --libs   $cf_athena_pkg 2>/dev/null`"
+	test -n "$verbose" && echo "	package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6
+
+echo "${as_me:-configure}:10258: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
+
+	test -n "$verbose" && echo "	package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6
+
+echo "${as_me:-configure}:10262: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
+
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
+
+for cf_add_cflags in $cf_pkgconfig_incs
+do
+case $cf_fix_cppflags in
+no)
+	case $cf_add_cflags in #(vi
+	-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
+		case $cf_add_cflags in
+		-D*)
+			cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
+
+			test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+				&& test -z "${cf_tst_cflags}" \
+				&& cf_fix_cppflags=yes
+
+			if test $cf_fix_cppflags = yes ; then
+				cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+				continue
+			elif test "${cf_tst_cflags}" = "\"'" ; then
+				cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+				continue
+			fi
+			;;
+		esac
+		case "$CPPFLAGS" in
+		*$cf_add_cflags) #(vi
+			;;
+		*) #(vi
+			case $cf_add_cflags in #(vi
+			-D*)
+				cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
+
+CPPFLAGS=`echo "$CPPFLAGS" | \
+	sed	-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?[ 	]/ /g' \
+		-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?$//g'`
+
+				;;
+			esac
+			cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
+			;;
+		esac
+		;;
+	*)
+		cf_new_cflags="$cf_new_cflags $cf_add_cflags"
+		;;
+	esac
+	;;
+yes)
+	cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+	cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
+
+	test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+		&& test -z "${cf_tst_cflags}" \
+		&& cf_fix_cppflags=no
+	;;
+esac
+done
+
+if test -n "$cf_new_cflags" ; then
+
+	CFLAGS="$CFLAGS $cf_new_cflags"
+fi
+
+if test -n "$cf_new_cppflags" ; then
+
+	CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
+fi
+
+if test -n "$cf_new_extra_cppflags" ; then
+
+	EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+fi
+
+	LIBS="$cf_pkgconfig_libs $LIBS"
+
+			cf_x_athena_lib="$cf_pkgconfig_libs"
+
+cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
+
+			cat >>confdefs.h <<EOF
+#define $cf_x_athena_LIBS 1
 EOF
-if { (eval echo configure:5258: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  ac_R_nospace=yes
+
+echo "$as_me:10352: checking for usable $cf_x_athena/Xmu package" >&5
+echo $ECHO_N "checking for usable $cf_x_athena/Xmu package... $ECHO_C" >&6
+if test "${cf_cv_xaw_compat+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+cat >conftest.$ac_ext <<_ACEOF
+#line 10359 "configure"
+#include "confdefs.h"
+
+#include <X11/Xmu/CharSet.h>
+
+int
+main ()
+{
+
+int check = XmuCompareISOLatin1("big", "small")
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:10375: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:10378: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:10381: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:10384: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_xaw_compat=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_xaw_compat=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:10394: result: $cf_cv_xaw_compat" >&5
+echo "${ECHO_T}$cf_cv_xaw_compat" >&6
+
+			if test "$cf_cv_xaw_compat" = no
+			then
+				# workaround for broken ".pc" files...
+				case "$cf_x_athena_lib" in #(vi
+				*-lXmu*) #(vi
+					;;
+				*)
+					test -n "$verbose" && echo "	work around broken package" 1>&6
+
+echo "${as_me:-configure}:10406: testing work around broken package ..." 1>&5
+
+if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xmu; then
+	test -n "$verbose" && echo "	found package xmu" 1>&6
+
+echo "${as_me:-configure}:10411: testing found package xmu ..." 1>&5
+
+	cf_pkgconfig_incs="`$PKG_CONFIG --cflags xmu 2>/dev/null`"
+	cf_pkgconfig_libs="`$PKG_CONFIG --libs   xmu 2>/dev/null`"
+	test -n "$verbose" && echo "	package xmu CFLAGS: $cf_pkgconfig_incs" 1>&6
+
+echo "${as_me:-configure}:10417: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
+
+	test -n "$verbose" && echo "	package xmu LIBS: $cf_pkgconfig_libs" 1>&6
+
+echo "${as_me:-configure}:10421: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
+
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
+
+for cf_add_cflags in $cf_pkgconfig_incs
+do
+case $cf_fix_cppflags in
+no)
+	case $cf_add_cflags in #(vi
+	-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
+		case $cf_add_cflags in
+		-D*)
+			cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
+
+			test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+				&& test -z "${cf_tst_cflags}" \
+				&& cf_fix_cppflags=yes
+
+			if test $cf_fix_cppflags = yes ; then
+				cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+				continue
+			elif test "${cf_tst_cflags}" = "\"'" ; then
+				cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+				continue
+			fi
+			;;
+		esac
+		case "$CPPFLAGS" in
+		*$cf_add_cflags) #(vi
+			;;
+		*) #(vi
+			case $cf_add_cflags in #(vi
+			-D*)
+				cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
+
+CPPFLAGS=`echo "$CPPFLAGS" | \
+	sed	-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?[ 	]/ /g' \
+		-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?$//g'`
+
+				;;
+			esac
+			cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
+			;;
+		esac
+		;;
+	*)
+		cf_new_cflags="$cf_new_cflags $cf_add_cflags"
+		;;
+	esac
+	;;
+yes)
+	cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+	cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
+
+	test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+		&& test -z "${cf_tst_cflags}" \
+		&& cf_fix_cppflags=no
+	;;
+esac
+done
+
+if test -n "$cf_new_cflags" ; then
+
+	CFLAGS="$CFLAGS $cf_new_cflags"
+fi
+
+if test -n "$cf_new_cppflags" ; then
+
+	CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
+fi
+
+if test -n "$cf_new_extra_cppflags" ; then
+
+	EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+fi
+
+	LIBS="$cf_pkgconfig_libs $LIBS"
+	:
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_R_nospace=no
+
+test -n "$verbose" && echo "	...before $LIBS" 1>&6
+
+echo "${as_me:-configure}:10507: testing ...before $LIBS ..." 1>&5
+
+LIBS=`echo "$LIBS" | sed -e "s/[ 	][ 	]*/ /g" -e "s,-lXt ,-lXt -lXmu ," -e 's/  / /g'`
+test -n "$verbose" && echo "	...after  $LIBS" 1>&6
+
+echo "${as_me:-configure}:10512: testing ...after  $LIBS ..." 1>&5
+
 fi
-rm -f conftest*
-      if test $ac_R_nospace = yes; then
-	echo "$ac_t""no" 1>&6
-	X_LIBS="$X_LIBS -R$x_libraries"
-      else
-	LIBS="$ac_xsave_LIBS -R $x_libraries"
-	cat > conftest.$ac_ext <<EOF
-#line 5274 "configure"
+
+					;;
+				esac
+			fi
+
+			break
+else
+	:
+fi
+
+	done
+fi
+
+if test -z "$cf_x_athena_lib" ; then
+
+if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists Xext; then
+	test -n "$verbose" && echo "	found package Xext" 1>&6
+
+echo "${as_me:-configure}:10533: testing found package Xext ..." 1>&5
+
+	cf_pkgconfig_incs="`$PKG_CONFIG --cflags Xext 2>/dev/null`"
+	cf_pkgconfig_libs="`$PKG_CONFIG --libs   Xext 2>/dev/null`"
+	test -n "$verbose" && echo "	package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6
+
+echo "${as_me:-configure}:10539: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
+
+	test -n "$verbose" && echo "	package Xext LIBS: $cf_pkgconfig_libs" 1>&6
+
+echo "${as_me:-configure}:10543: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
+
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
+
+for cf_add_cflags in $cf_pkgconfig_incs
+do
+case $cf_fix_cppflags in
+no)
+	case $cf_add_cflags in #(vi
+	-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
+		case $cf_add_cflags in
+		-D*)
+			cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
+
+			test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+				&& test -z "${cf_tst_cflags}" \
+				&& cf_fix_cppflags=yes
+
+			if test $cf_fix_cppflags = yes ; then
+				cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+				continue
+			elif test "${cf_tst_cflags}" = "\"'" ; then
+				cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+				continue
+			fi
+			;;
+		esac
+		case "$CPPFLAGS" in
+		*$cf_add_cflags) #(vi
+			;;
+		*) #(vi
+			case $cf_add_cflags in #(vi
+			-D*)
+				cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
+
+CPPFLAGS=`echo "$CPPFLAGS" | \
+	sed	-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?[ 	]/ /g' \
+		-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?$//g'`
+
+				;;
+			esac
+			cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
+			;;
+		esac
+		;;
+	*)
+		cf_new_cflags="$cf_new_cflags $cf_add_cflags"
+		;;
+	esac
+	;;
+yes)
+	cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+	cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
+
+	test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+		&& test -z "${cf_tst_cflags}" \
+		&& cf_fix_cppflags=no
+	;;
+esac
+done
+
+if test -n "$cf_new_cflags" ; then
+
+	CFLAGS="$CFLAGS $cf_new_cflags"
+fi
+
+if test -n "$cf_new_cppflags" ; then
+
+	CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
+fi
+
+if test -n "$cf_new_extra_cppflags" ; then
+
+	EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+fi
+
+	LIBS="$cf_pkgconfig_libs $LIBS"
+	:
+else
+
+	echo "$as_me:10627: checking for XextCreateExtension in -lXext" >&5
+echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6
+if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lXext  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line 10635 "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char XextCreateExtension ();
+int
+main ()
+{
+XextCreateExtension ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:10654: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:10657: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:10660: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:10663: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_Xext_XextCreateExtension=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_Xext_XextCreateExtension=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:10674: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
+echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6
+if test $ac_cv_lib_Xext_XextCreateExtension = yes; then
+  LIBS="-lXext $LIBS"
+fi
+
+fi
+
+cf_have_X_LIBS=no
+
+if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
+	test -n "$verbose" && echo "	found package xt" 1>&6
+
+echo "${as_me:-configure}:10687: testing found package xt ..." 1>&5
+
+	cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
+	cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
+	test -n "$verbose" && echo "	package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
+
+echo "${as_me:-configure}:10693: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
+
+	test -n "$verbose" && echo "	package xt LIBS: $cf_pkgconfig_libs" 1>&6
+
+echo "${as_me:-configure}:10697: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
+
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
+
+for cf_add_cflags in $cf_pkgconfig_incs
+do
+case $cf_fix_cppflags in
+no)
+	case $cf_add_cflags in #(vi
+	-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
+		case $cf_add_cflags in
+		-D*)
+			cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
+
+			test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+				&& test -z "${cf_tst_cflags}" \
+				&& cf_fix_cppflags=yes
+
+			if test $cf_fix_cppflags = yes ; then
+				cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+				continue
+			elif test "${cf_tst_cflags}" = "\"'" ; then
+				cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+				continue
+			fi
+			;;
+		esac
+		case "$CPPFLAGS" in
+		*$cf_add_cflags) #(vi
+			;;
+		*) #(vi
+			case $cf_add_cflags in #(vi
+			-D*)
+				cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
+
+CPPFLAGS=`echo "$CPPFLAGS" | \
+	sed	-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?[ 	]/ /g' \
+		-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?$//g'`
+
+				;;
+			esac
+			cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
+			;;
+		esac
+		;;
+	*)
+		cf_new_cflags="$cf_new_cflags $cf_add_cflags"
+		;;
+	esac
+	;;
+yes)
+	cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+	cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
+
+	test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+		&& test -z "${cf_tst_cflags}" \
+		&& cf_fix_cppflags=no
+	;;
+esac
+done
+
+if test -n "$cf_new_cflags" ; then
+
+	CFLAGS="$CFLAGS $cf_new_cflags"
+fi
+
+if test -n "$cf_new_cppflags" ; then
+
+	CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
+fi
+
+if test -n "$cf_new_extra_cppflags" ; then
+
+	EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+fi
+
+	LIBS="$cf_pkgconfig_libs $LIBS"
+
+	case "x$LIBS" in #(vi
+	*-lX11*) #(vi
+		;;
+	*)
+# we have an "xt" package, but it may omit Xt's dependency on X11
+echo "$as_me:10784: checking for usable X dependency" >&5
+echo $ECHO_N "checking for usable X dependency... $ECHO_C" >&6
+if test "${cf_cv_xt_x11_compat+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+cat >conftest.$ac_ext <<_ACEOF
+#line 10791 "configure"
 #include "confdefs.h"
 
-int main() {
+#include <X11/Xlib.h>
+
+int
+main ()
+{
+
+	int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
+	int rc2 = XClearWindow((Display*) 0, (Window) 0);
+	int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0);
+	int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0);
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:10810: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:10813: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:10816: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:10819: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_xt_x11_compat=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_xt_x11_compat=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:10829: result: $cf_cv_xt_x11_compat" >&5
+echo "${ECHO_T}$cf_cv_xt_x11_compat" >&6
+		if test "$cf_cv_xt_x11_compat" = no
+		then
+			test -n "$verbose" && echo "	work around broken X11 dependency" 1>&6
+
+echo "${as_me:-configure}:10835: testing work around broken X11 dependency ..." 1>&5
+
+			# 2010/11/19 - good enough until a working Xt on Xcb is delivered.
+
+if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
+	test -n "$verbose" && echo "	found package x11" 1>&6
+
+echo "${as_me:-configure}:10842: testing found package x11 ..." 1>&5
+
+	cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
+	cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
+	test -n "$verbose" && echo "	package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
+
+echo "${as_me:-configure}:10848: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
+
+	test -n "$verbose" && echo "	package x11 LIBS: $cf_pkgconfig_libs" 1>&6
+
+echo "${as_me:-configure}:10852: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
+
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
+
+for cf_add_cflags in $cf_pkgconfig_incs
+do
+case $cf_fix_cppflags in
+no)
+	case $cf_add_cflags in #(vi
+	-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
+		case $cf_add_cflags in
+		-D*)
+			cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
+
+			test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+				&& test -z "${cf_tst_cflags}" \
+				&& cf_fix_cppflags=yes
+
+			if test $cf_fix_cppflags = yes ; then
+				cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+				continue
+			elif test "${cf_tst_cflags}" = "\"'" ; then
+				cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+				continue
+			fi
+			;;
+		esac
+		case "$CPPFLAGS" in
+		*$cf_add_cflags) #(vi
+			;;
+		*) #(vi
+			case $cf_add_cflags in #(vi
+			-D*)
+				cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
+
+CPPFLAGS=`echo "$CPPFLAGS" | \
+	sed	-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?[ 	]/ /g' \
+		-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?$//g'`
+
+				;;
+			esac
+			cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
+			;;
+		esac
+		;;
+	*)
+		cf_new_cflags="$cf_new_cflags $cf_add_cflags"
+		;;
+	esac
+	;;
+yes)
+	cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+	cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
+
+	test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+		&& test -z "${cf_tst_cflags}" \
+		&& cf_fix_cppflags=no
+	;;
+esac
+done
+
+if test -n "$cf_new_cflags" ; then
 
-; return 0; }
-EOF
-if { (eval echo configure:5281: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  ac_R_space=yes
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_R_space=no
+	CFLAGS="$CFLAGS $cf_new_cflags"
 fi
-rm -f conftest*
-	if test $ac_R_space = yes; then
-	  echo "$ac_t""yes" 1>&6
-	  X_LIBS="$X_LIBS -R $x_libraries"
-	else
-	  echo "$ac_t""neither works" 1>&6
-	fi
-      fi
-      LIBS="$ac_xsave_LIBS"
-    esac
-  fi
 
-  # Check for system-dependent libraries X programs must link with.
-  # Do this before checking for the system-independent R6 libraries
-  # (-lICE), since we may need -lsocket or whatever for X linking.
-
-  if test "$ISC" = yes; then
-    X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
-  else
-    # Martyn.Johnson@cl.cam.ac.uk says this is needed for Ultrix, if the X
-    # libraries were built with DECnet support.  And karl@cs.umb.edu says
-    # the Alpha needs dnet_stub (dnet does not exist).
-    echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6
-echo "configure:5313: checking for dnet_ntoa in -ldnet" >&5
-ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  ac_save_LIBS="$LIBS"
-LIBS="-ldnet  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 5321 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char dnet_ntoa();
+if test -n "$cf_new_cppflags" ; then
 
-int main() {
-dnet_ntoa()
-; return 0; }
-EOF
-if { (eval echo configure:5332: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+	CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
 fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
 
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
-else
-  echo "$ac_t""no" 1>&6
+if test -n "$cf_new_extra_cppflags" ; then
+
+	EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
 fi
 
-    if test $ac_cv_lib_dnet_dnet_ntoa = no; then
-      echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6
-echo "configure:5354: checking for dnet_ntoa in -ldnet_stub" >&5
-ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+	LIBS="$cf_pkgconfig_libs $LIBS"
+	:
 else
-  ac_save_LIBS="$LIBS"
-LIBS="-ldnet_stub  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 5362 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char dnet_ntoa();
 
-int main() {
-dnet_ntoa()
-; return 0; }
-EOF
-if { (eval echo configure:5373: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
+test -n "$verbose" && echo "	...before $LIBS" 1>&6
+
+echo "${as_me:-configure}:10938: testing ...before $LIBS ..." 1>&5
+
+LIBS=`echo "$LIBS" | sed -e "s/[ 	][ 	]*/ /g" -e "s,-lXt ,-lXt -lX11 ," -e 's/  / /g'`
+test -n "$verbose" && echo "	...after  $LIBS" 1>&6
+
+echo "${as_me:-configure}:10943: testing ...after  $LIBS ..." 1>&5
 
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
-else
-  echo "$ac_t""no" 1>&6
 fi
 
-    fi
+		fi
+		;;
+	esac
 
-    # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
-    # to get the SysV transport functions.
-    # chad@anasazi.com says the Pyramis MIS-ES running DC/OSx (SVR4)
-    # needs -lnsl.
-    # The nsl library prevents programs from opening the X display
-    # on Irix 5.2, according to dickey@clark.net.
-    echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
-echo "configure:5402: checking for gethostbyname" >&5
-if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:10951: checking for usable X Toolkit package" >&5
+echo $ECHO_N "checking for usable X Toolkit package... $ECHO_C" >&6
+if test "${cf_cv_xt_ice_compat+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 5407 "configure"
+
+cat >conftest.$ac_ext <<_ACEOF
+#line 10958 "configure"
 #include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char gethostbyname(); below.  */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char gethostbyname();
 
-int main() {
+#include <X11/Shell.h>
 
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
-choke me
-#else
-gethostbyname();
-#endif
+int
+main ()
+{
+int num = IceConnectionNumber(0)
 
-; return 0; }
-EOF
-if { (eval echo configure:5430: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func_gethostbyname=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_gethostbyname=no"
-fi
-rm -f conftest*
-fi
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:10973: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:10976: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:10979: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:10982: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_xt_ice_compat=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_xt_ice_compat=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:10992: result: $cf_cv_xt_ice_compat" >&5
+echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
+
+	if test "$cf_cv_xt_ice_compat" = no
+	then
+		# workaround for broken ".pc" files used for X Toolkit.
+		case "x$X_PRE_LIBS" in #(vi
+		*-lICE*)
+			case "x$LIBS" in #(vi
+			*-lICE*) #(vi
+				;;
+			*)
+				test -n "$verbose" && echo "	work around broken ICE dependency" 1>&6
 
-if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  :
-else
-  echo "$ac_t""no" 1>&6
-fi
+echo "${as_me:-configure}:11006: testing work around broken ICE dependency ..." 1>&5
 
-    if test $ac_cv_func_gethostbyname = no; then
-      echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
-echo "configure:5451: checking for gethostbyname in -lnsl" >&5
-ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  ac_save_LIBS="$LIBS"
-LIBS="-lnsl  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 5459 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char gethostbyname();
+if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
+	test -n "$verbose" && echo "	found package ice" 1>&6
 
-int main() {
-gethostbyname()
-; return 0; }
-EOF
-if { (eval echo configure:5470: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
+echo "${as_me:-configure}:11011: testing found package ice ..." 1>&5
 
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
-else
-  echo "$ac_t""no" 1>&6
-fi
+	cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
+	cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
+	test -n "$verbose" && echo "	package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
 
-    fi
+echo "${as_me:-configure}:11017: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
 
-    # lieder@skyler.mavd.honeywell.com says without -lsocket,
-    # socket/setsockopt and other routines are undefined under SCO ODT
-    # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
-    # on later versions), says simon@lia.di.epfl.ch: it contains
-    # gethostby* variants that don't use the nameserver (or something).
-    # -lsocket must be given before -lnsl if both are needed.
-    # We assume that if connect needs -lnsl, so does gethostbyname.
-    echo $ac_n "checking for connect""... $ac_c" 1>&6
-echo "configure:5500: checking for connect" >&5
-if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 5505 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char connect(); below.  */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char connect();
+	test -n "$verbose" && echo "	package ice LIBS: $cf_pkgconfig_libs" 1>&6
 
-int main() {
+echo "${as_me:-configure}:11021: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
 
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined (__stub_connect) || defined (__stub___connect)
-choke me
-#else
-connect();
-#endif
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
 
-; return 0; }
-EOF
-if { (eval echo configure:5528: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func_connect=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_connect=no"
-fi
-rm -f conftest*
-fi
+for cf_add_cflags in $cf_pkgconfig_incs
+do
+case $cf_fix_cppflags in
+no)
+	case $cf_add_cflags in #(vi
+	-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
+		case $cf_add_cflags in
+		-D*)
+			cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
 
-if eval "test \"`echo '$ac_cv_func_'connect`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  :
-else
-  echo "$ac_t""no" 1>&6
-fi
+			test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+				&& test -z "${cf_tst_cflags}" \
+				&& cf_fix_cppflags=yes
 
-    if test $ac_cv_func_connect = no; then
-      echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6
-echo "configure:5549: checking for connect in -lsocket" >&5
-ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  ac_save_LIBS="$LIBS"
-LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 5557 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char connect();
+			if test $cf_fix_cppflags = yes ; then
+				cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+				continue
+			elif test "${cf_tst_cflags}" = "\"'" ; then
+				cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+				continue
+			fi
+			;;
+		esac
+		case "$CPPFLAGS" in
+		*$cf_add_cflags) #(vi
+			;;
+		*) #(vi
+			case $cf_add_cflags in #(vi
+			-D*)
+				cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
 
-int main() {
-connect()
-; return 0; }
-EOF
-if { (eval echo configure:5568: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+CPPFLAGS=`echo "$CPPFLAGS" | \
+	sed	-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?[ 	]/ /g' \
+		-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?$//g'`
+
+				;;
+			esac
+			cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
+			;;
+		esac
+		;;
+	*)
+		cf_new_cflags="$cf_new_cflags $cf_add_cflags"
+		;;
+	esac
+	;;
+yes)
+	cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+	cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
+
+	test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+		&& test -z "${cf_tst_cflags}" \
+		&& cf_fix_cppflags=no
+	;;
+esac
+done
+
+if test -n "$cf_new_cflags" ; then
+
+	CFLAGS="$CFLAGS $cf_new_cflags"
 fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
 
+if test -n "$cf_new_cppflags" ; then
+
+	CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
-else
-  echo "$ac_t""no" 1>&6
+
+if test -n "$cf_new_extra_cppflags" ; then
+
+	EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
 fi
 
-    fi
+	LIBS="$cf_pkgconfig_libs $LIBS"
 
-    # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX.
-    echo $ac_n "checking for remove""... $ac_c" 1>&6
-echo "configure:5592: checking for remove" >&5
-if eval "test \"`echo '$''{'ac_cv_func_remove'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 5597 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char remove(); below.  */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char remove();
+if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
+	test -n "$verbose" && echo "	found package sm" 1>&6
 
-int main() {
+echo "${as_me:-configure}:11106: testing found package sm ..." 1>&5
 
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined (__stub_remove) || defined (__stub___remove)
-choke me
-#else
-remove();
-#endif
+	cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
+	cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
+	test -n "$verbose" && echo "	package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
 
-; return 0; }
-EOF
-if { (eval echo configure:5620: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func_remove=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_remove=no"
-fi
-rm -f conftest*
-fi
+echo "${as_me:-configure}:11112: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
 
-if eval "test \"`echo '$ac_cv_func_'remove`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  :
-else
-  echo "$ac_t""no" 1>&6
-fi
+	test -n "$verbose" && echo "	package sm LIBS: $cf_pkgconfig_libs" 1>&6
 
-    if test $ac_cv_func_remove = no; then
-      echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
-echo "configure:5641: checking for remove in -lposix" >&5
-ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  ac_save_LIBS="$LIBS"
-LIBS="-lposix  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 5649 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char remove();
+echo "${as_me:-configure}:11116: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
 
-int main() {
-remove()
-; return 0; }
-EOF
-if { (eval echo configure:5660: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
 
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
-else
-  echo "$ac_t""no" 1>&6
-fi
+for cf_add_cflags in $cf_pkgconfig_incs
+do
+case $cf_fix_cppflags in
+no)
+	case $cf_add_cflags in #(vi
+	-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
+		case $cf_add_cflags in
+		-D*)
+			cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
 
-    fi
+			test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+				&& test -z "${cf_tst_cflags}" \
+				&& cf_fix_cppflags=yes
 
-    # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
-    echo $ac_n "checking for shmat""... $ac_c" 1>&6
-echo "configure:5684: checking for shmat" >&5
-if eval "test \"`echo '$''{'ac_cv_func_shmat'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 5689 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char shmat(); below.  */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char shmat();
+			if test $cf_fix_cppflags = yes ; then
+				cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+				continue
+			elif test "${cf_tst_cflags}" = "\"'" ; then
+				cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+				continue
+			fi
+			;;
+		esac
+		case "$CPPFLAGS" in
+		*$cf_add_cflags) #(vi
+			;;
+		*) #(vi
+			case $cf_add_cflags in #(vi
+			-D*)
+				cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
 
-int main() {
+CPPFLAGS=`echo "$CPPFLAGS" | \
+	sed	-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?[ 	]/ /g' \
+		-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?$//g'`
 
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined (__stub_shmat) || defined (__stub___shmat)
-choke me
-#else
-shmat();
-#endif
+				;;
+			esac
+			cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
+			;;
+		esac
+		;;
+	*)
+		cf_new_cflags="$cf_new_cflags $cf_add_cflags"
+		;;
+	esac
+	;;
+yes)
+	cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
 
-; return 0; }
-EOF
-if { (eval echo configure:5712: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func_shmat=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_shmat=no"
-fi
-rm -f conftest*
-fi
+	cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
 
-if eval "test \"`echo '$ac_cv_func_'shmat`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  :
-else
-  echo "$ac_t""no" 1>&6
-fi
+	test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+		&& test -z "${cf_tst_cflags}" \
+		&& cf_fix_cppflags=no
+	;;
+esac
+done
 
-    if test $ac_cv_func_shmat = no; then
-      echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
-echo "configure:5733: checking for shmat in -lipc" >&5
-ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  ac_save_LIBS="$LIBS"
-LIBS="-lipc  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 5741 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char shmat();
+if test -n "$cf_new_cflags" ; then
 
-int main() {
-shmat()
-; return 0; }
-EOF
-if { (eval echo configure:5752: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+	CFLAGS="$CFLAGS $cf_new_cflags"
 fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
 
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
-else
-  echo "$ac_t""no" 1>&6
+if test -n "$cf_new_cppflags" ; then
+
+	CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
 fi
 
-    fi
-  fi
+if test -n "$cf_new_extra_cppflags" ; then
 
-  # Check for libraries that X11R6 Xt/Xaw programs need.
-  ac_save_LDFLAGS="$LDFLAGS"
-  test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
-  # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
-  # check for ICE first), but we must link in the order -lSM -lICE or
-  # we get undefined symbols.  So assume we have SM if we have ICE.
-  # These have to be linked with before -lX11, unlike the other
-  # libraries we check for below, so use a different variable.
-  #  --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
-  echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6
-echo "configure:5785: checking for IceConnectionNumber in -lICE" >&5
-ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  ac_save_LIBS="$LIBS"
-LIBS="-lICE $X_EXTRA_LIBS $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 5793 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char IceConnectionNumber();
+	EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+fi
 
-int main() {
-IceConnectionNumber()
-; return 0; }
-EOF
-if { (eval echo configure:5804: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+	LIBS="$cf_pkgconfig_libs $LIBS"
+	:
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+	:
 fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
 
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
 else
-  echo "$ac_t""no" 1>&6
-fi
 
-  LDFLAGS="$ac_save_LDFLAGS"
+test -n "$verbose" && echo "	...before $LIBS" 1>&6
 
-fi
+echo "${as_me:-configure}:11206: testing ...before $LIBS ..." 1>&5
 
+LIBS=`echo "$LIBS" | sed -e "s/[ 	][ 	]*/ /g" -e "s,-lXt ,-lXt $X_PRE_LIBS ," -e 's/  / /g'`
+test -n "$verbose" && echo "	...after  $LIBS" 1>&6
 
+echo "${as_me:-configure}:11211: testing ...after  $LIBS ..." 1>&5
 
+fi
 
+				;;
+			esac
+			;;
+		esac
+	fi
 
-# SYSTEM_NAME=`echo "$cf_cv_system_name"|tr ' ' -`
+	cf_have_X_LIBS=yes
 
-cf_have_X_LIBS=no
+else
 
-LDFLAGS="$X_LIBS $LDFLAGS"
+	LDFLAGS="$X_LIBS $LDFLAGS"
 
 test -n "$verbose" && echo "	checking additions to CFLAGS" 1>&6
 
-echo "${as_me-configure}:5840: testing checking additions to CFLAGS ..." 1>&5
-
+echo "${as_me:-configure}:11229: testing checking additions to CFLAGS ..." 1>&5
 
 cf_check_cflags="$CFLAGS"
 cf_check_cppflags="$CPPFLAGS"
@@ -5858,8 +11247,8 @@
 			cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
 
 			test "${cf_add_cflags}" != "${cf_tst_cflags}" \
-			&& test -z "${cf_tst_cflags}" \
-			&& cf_fix_cppflags=yes
+				&& test -z "${cf_tst_cflags}" \
+				&& cf_fix_cppflags=yes
 
 			if test $cf_fix_cppflags = yes ; then
 				cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
@@ -5874,6 +11263,16 @@
 		*$cf_add_cflags) #(vi
 			;;
 		*) #(vi
+			case $cf_add_cflags in #(vi
+			-D*)
+				cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
+
+CPPFLAGS=`echo "$CPPFLAGS" | \
+	sed	-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?[ 	]/ /g' \
+		-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?$//g'`
+
+				;;
+			esac
 			cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
 			;;
 		esac
@@ -5889,8 +11288,8 @@
 	cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
 
 	test "${cf_add_cflags}" != "${cf_tst_cflags}" \
-	&& test -z "${cf_tst_cflags}" \
-	&& cf_fix_cppflags=no
+		&& test -z "${cf_tst_cflags}" \
+		&& cf_fix_cppflags=no
 	;;
 esac
 done
@@ -5898,8 +11297,7 @@
 if test -n "$cf_new_cflags" ; then
 	test -n "$verbose" && echo "	add to \$CFLAGS $cf_new_cflags" 1>&6
 
-echo "${as_me-configure}:5902: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
-
+echo "${as_me:-configure}:11300: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
 
 	CFLAGS="$CFLAGS $cf_new_cflags"
 fi
@@ -5907,348 +11305,315 @@
 if test -n "$cf_new_cppflags" ; then
 	test -n "$verbose" && echo "	add to \$CPPFLAGS $cf_new_cppflags" 1>&6
 
-echo "${as_me-configure}:5911: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
-
+echo "${as_me:-configure}:11308: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
 
-	CPPFLAGS="$cf_new_cppflags $CPPFLAGS"
+	CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
 fi
 
 if test -n "$cf_new_extra_cppflags" ; then
 	test -n "$verbose" && echo "	add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
 
-echo "${as_me-configure}:5920: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
-
+echo "${as_me:-configure}:11316: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
 
 	EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
 fi
 
-
-
-
 if test "$cf_check_cflags" != "$CFLAGS" ; then
-cat > conftest.$ac_ext <<EOF
-#line 5931 "configure"
+cat >conftest.$ac_ext <<_ACEOF
+#line 11323 "configure"
 #include "confdefs.h"
 #include <stdio.h>
-int main() {
+int
+main ()
+{
 printf("Hello world");
-; return 0; }
-EOF
-if { (eval echo configure:5938: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:11335: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:11338: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:11341: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:11344: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   :
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  test -n "$verbose" && echo "	test-compile failed.  Undoing change to \$CFLAGS" 1>&6
-
-echo "${as_me-configure}:5946: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+test -n "$verbose" && echo "	test-compile failed.  Undoing change to \$CFLAGS" 1>&6
 
+echo "${as_me:-configure}:11352: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
 
 	 if test "$cf_check_cppflags" != "$CPPFLAGS" ; then
 		 test -n "$verbose" && echo "	but keeping change to \$CPPFLAGS" 1>&6
 
-echo "${as_me-configure}:5952: testing but keeping change to \$CPPFLAGS ..." 1>&5
-
+echo "${as_me:-configure}:11357: testing but keeping change to \$CPPFLAGS ..." 1>&5
 
 	 fi
 	 CFLAGS="$cf_check_flags"
 fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
 
-
-echo $ac_n "checking for XOpenDisplay""... $ac_c" 1>&6
-echo "configure:5963: checking for XOpenDisplay" >&5
-if eval "test \"`echo '$''{'ac_cv_func_XOpenDisplay'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+	echo "$as_me:11365: checking for XOpenDisplay" >&5
+echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6
+if test "${ac_cv_func_XOpenDisplay+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 5968 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 11371 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char XOpenDisplay(); below.  */
+    which can conflict with char XOpenDisplay (); below.  */
 #include <assert.h>
 /* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
 /* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char XOpenDisplay();
-
-int main() {
+   builtin and then its argument prototype would still apply.  */
+char XOpenDisplay ();
+char (*f) ();
 
+int
+main ()
+{
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
 #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
 choke me
 #else
-XOpenDisplay();
+f = XOpenDisplay;
 #endif
 
-; return 0; }
-EOF
-if { (eval echo configure:5991: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func_XOpenDisplay=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_XOpenDisplay=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'XOpenDisplay`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:11402: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:11405: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:11408: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:11411: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_XOpenDisplay=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_func_XOpenDisplay=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:11421: result: $ac_cv_func_XOpenDisplay" >&5
+echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6
+if test $ac_cv_func_XOpenDisplay = yes; then
   :
 else
-  echo "$ac_t""no" 1>&6
 
-echo $ac_n "checking for XOpenDisplay in -lX11""... $ac_c" 1>&6
-echo "configure:6010: checking for XOpenDisplay in -lX11" >&5
-ac_lib_var=`echo X11'_'XOpenDisplay | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+	echo "$as_me:11427: checking for XOpenDisplay in -lX11" >&5
+echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
+if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_save_LIBS="$LIBS"
+  ac_check_lib_save_LIBS=$LIBS
 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 6018 "configure"
+cat >conftest.$ac_ext <<_ACEOF
+#line 11435 "configure"
 #include "confdefs.h"
+
 /* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
 /* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char XOpenDisplay();
-
-int main() {
-XOpenDisplay()
-; return 0; }
-EOF
-if { (eval echo configure:6029: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
+   builtin and then its argument prototype would still apply.  */
+char XOpenDisplay ();
+int
+main ()
+{
+XOpenDisplay ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:11454: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:11457: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:11460: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:11463: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_X11_XOpenDisplay=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_X11_XOpenDisplay=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:11474: result: $ac_cv_lib_X11_XOpenDisplay" >&5
+echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
+if test $ac_cv_lib_X11_XOpenDisplay = yes; then
   LIBS="-lX11 $LIBS"
-else
-  echo "$ac_t""no" 1>&6
 fi
 
 fi
 
-
-echo $ac_n "checking for XtAppInitialize""... $ac_c" 1>&6
-echo "configure:6053: checking for XtAppInitialize" >&5
-if eval "test \"`echo '$''{'ac_cv_func_XtAppInitialize'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+	echo "$as_me:11482: checking for XtAppInitialize" >&5
+echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6
+if test "${ac_cv_func_XtAppInitialize+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 6058 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 11488 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char XtAppInitialize(); below.  */
+    which can conflict with char XtAppInitialize (); below.  */
 #include <assert.h>
 /* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
 /* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char XtAppInitialize();
-
-int main() {
+   builtin and then its argument prototype would still apply.  */
+char XtAppInitialize ();
+char (*f) ();
 
+int
+main ()
+{
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
 #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
 choke me
 #else
-XtAppInitialize();
+f = XtAppInitialize;
 #endif
 
-; return 0; }
-EOF
-if { (eval echo configure:6081: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func_XtAppInitialize=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_XtAppInitialize=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'XtAppInitialize`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:11519: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:11522: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:11525: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:11528: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_XtAppInitialize=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_func_XtAppInitialize=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:11538: result: $ac_cv_func_XtAppInitialize" >&5
+echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6
+if test $ac_cv_func_XtAppInitialize = yes; then
   :
 else
-  echo "$ac_t""no" 1>&6
 
-echo $ac_n "checking for XtAppInitialize in -lXt""... $ac_c" 1>&6
-echo "configure:6100: checking for XtAppInitialize in -lXt" >&5
-ac_lib_var=`echo Xt'_'XtAppInitialize | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+	echo "$as_me:11544: checking for XtAppInitialize in -lXt" >&5
+echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6
+if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_save_LIBS="$LIBS"
+  ac_check_lib_save_LIBS=$LIBS
 LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 6108 "configure"
+cat >conftest.$ac_ext <<_ACEOF
+#line 11552 "configure"
 #include "confdefs.h"
+
 /* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
 /* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char XtAppInitialize();
-
-int main() {
-XtAppInitialize()
-; return 0; }
-EOF
-if { (eval echo configure:6119: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  cat >> confdefs.h <<\EOF
+   builtin and then its argument prototype would still apply.  */
+char XtAppInitialize ();
+int
+main ()
+{
+XtAppInitialize ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:11571: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:11574: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:11577: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:11580: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_Xt_XtAppInitialize=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_Xt_XtAppInitialize=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:11591: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
+echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6
+if test $ac_cv_lib_Xt_XtAppInitialize = yes; then
+  cat >>confdefs.h <<\EOF
 #define HAVE_LIBXT 1
 EOF
 
-	 cf_have_X_LIBS=Xt
-	 LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
-else
-  echo "$ac_t""no" 1>&6
+		 cf_have_X_LIBS=Xt
+		 LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
 fi
 
 fi
 
+fi
 
 if test $cf_have_X_LIBS = no ; then
-	echo "configure: warning: Unable to successfully link X Toolkit library (-lXt) with
+	{ echo "$as_me:11607: WARNING: Unable to successfully link X Toolkit library (-lXt) with
 test program.  You will have to check and add the proper libraries by hand
-to makefile." 1>&2
-fi
-
-
-cf_x_athena=${cf_x_athena-Xaw}
-
-echo $ac_n "checking if you want to link with Xaw 3d library""... $ac_c" 1>&6
-echo "configure:6157: checking if you want to link with Xaw 3d library" >&5
-withval=
-
-# Check whether --with-Xaw3d or --without-Xaw3d was given.
-if test "${with_Xaw3d+set}" = set; then
-  withval="$with_Xaw3d"
-  :
-fi
-
-if test "$withval" = yes ; then
-	cf_x_athena=Xaw3d
-	echo "$ac_t""yes" 1>&6
-else
-	echo "$ac_t""no" 1>&6
-fi
-
-echo $ac_n "checking if you want to link with neXT Athena library""... $ac_c" 1>&6
-echo "configure:6174: checking if you want to link with neXT Athena library" >&5
-withval=
-
-# Check whether --with-neXtaw or --without-neXtaw was given.
-if test "${with_neXtaw+set}" = set; then
-  withval="$with_neXtaw"
-  :
-fi
-
-if test "$withval" = yes ; then
-	cf_x_athena=neXtaw
-	echo "$ac_t""yes" 1>&6
-else
-	echo "$ac_t""no" 1>&6
-fi
-
-echo $ac_n "checking if you want to link with Athena-Plus library""... $ac_c" 1>&6
-echo "configure:6191: checking if you want to link with Athena-Plus library" >&5
-withval=
-
-# Check whether --with-XawPlus or --without-XawPlus was given.
-if test "${with_XawPlus+set}" = set; then
-  withval="$with_XawPlus"
-  :
-fi
-
-if test "$withval" = yes ; then
-	cf_x_athena=XawPlus
-	echo "$ac_t""yes" 1>&6
-else
-	echo "$ac_t""no" 1>&6
-fi
-
-echo $ac_n "checking for XextCreateExtension in -lXext""... $ac_c" 1>&6
-echo "configure:6208: checking for XextCreateExtension in -lXext" >&5
-ac_lib_var=`echo Xext'_'XextCreateExtension | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  ac_save_LIBS="$LIBS"
-LIBS="-lXext  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 6216 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char XextCreateExtension();
-
-int main() {
-XextCreateExtension()
-; return 0; }
-EOF
-if { (eval echo configure:6227: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-  LIBS="-lXext $LIBS"
-else
-  echo "$ac_t""no" 1>&6
+to makefile." >&5
+echo "$as_me: WARNING: Unable to successfully link X Toolkit library (-lXt) with
+test program.  You will have to check and add the proper libraries by hand
+to makefile." >&2;}
 fi
 
-
-cf_x_athena_lib=""
-
-
 cf_x_athena_root=$cf_x_athena
-cf_x_athena_include=""
+cf_x_athena_inc=""
 
 for cf_path in default \
 	/usr/contrib/X11R6 \
@@ -6256,40 +11621,54 @@
 	/usr/lib/X11R5 \
 	/usr/local
 do
-	if test -z "$cf_x_athena_include" ; then
+	if test -z "$cf_x_athena_inc" ; then
 		cf_save="$CPPFLAGS"
 		cf_test=X11/$cf_x_athena_root/SimpleMenu.h
 		if test $cf_path != default ; then
-			CPPFLAGS="-I$cf_path/include $cf_save"
-			echo $ac_n "checking for $cf_test in $cf_path""... $ac_c" 1>&6
-echo "configure:6266: checking for $cf_test in $cf_path" >&5
+			CPPFLAGS="$cf_save -I$cf_path/include"
+			echo "$as_me:11629: checking for $cf_test in $cf_path" >&5
+echo $ECHO_N "checking for $cf_test in $cf_path... $ECHO_C" >&6
 		else
-			echo $ac_n "checking for $cf_test""... $ac_c" 1>&6
-echo "configure:6269: checking for $cf_test" >&5
+			echo "$as_me:11632: checking for $cf_test" >&5
+echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
 		fi
-		cat > conftest.$ac_ext <<EOF
-#line 6272 "configure"
+		cat >conftest.$ac_ext <<_ACEOF
+#line 11636 "configure"
 #include "confdefs.h"
 
 #include <X11/Intrinsic.h>
 #include <$cf_test>
-int main() {
+int
+main ()
+{
 
-; return 0; }
-EOF
-if { (eval echo configure:6281: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:11650: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:11653: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:11656: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:11659: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   cf_result=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  cf_result=no
-fi
-rm -f conftest*
-		echo "$ac_t""$cf_result" 1>&6
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_result=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+		echo "$as_me:11668: result: $cf_result" >&5
+echo "${ECHO_T}$cf_result" >&6
 		if test "$cf_result" = yes ; then
-			cf_x_athena_include=$cf_path
+			cf_x_athena_inc=$cf_path
 			break
 		else
 			CPPFLAGS="$cf_save"
@@ -6297,13 +11676,13 @@
 	fi
 done
 
-if test -z "$cf_x_athena_include" ; then
-	echo "configure: warning: Unable to successfully find Athena header files with test program" 1>&2
-elif test "$cf_x_athena_include" != default ; then
-	CPPFLAGS="$CPPFLAGS -I$cf_x_athena_include"
+if test -z "$cf_x_athena_inc" ; then
+	{ echo "$as_me:11680: WARNING: Unable to successfully find Athena header files with test program" >&5
+echo "$as_me: WARNING: Unable to successfully find Athena header files with test program" >&2;}
+elif test "$cf_x_athena_inc" != default ; then
+	CPPFLAGS="$CPPFLAGS -I$cf_x_athena_inc"
 fi
 
-
 cf_x_athena_root=$cf_x_athena
 cf_x_athena_lib=""
 
@@ -6323,32 +11702,46 @@
 			cf_test=XawSimpleMenuAddGlobalActions
 			if test $cf_path != default ; then
 				LIBS="-L$cf_path/lib $cf_lib $LIBS"
-				echo $ac_n "checking for $cf_lib in $cf_path""... $ac_c" 1>&6
-echo "configure:6328: checking for $cf_lib in $cf_path" >&5
+				echo "$as_me:11705: checking for $cf_lib in $cf_path" >&5
+echo $ECHO_N "checking for $cf_lib in $cf_path... $ECHO_C" >&6
 			else
 				LIBS="$cf_lib $LIBS"
-				echo $ac_n "checking for $cf_test in $cf_lib""... $ac_c" 1>&6
-echo "configure:6332: checking for $cf_test in $cf_lib" >&5
+				echo "$as_me:11709: checking for $cf_test in $cf_lib" >&5
+echo $ECHO_N "checking for $cf_test in $cf_lib... $ECHO_C" >&6
 			fi
-			cat > conftest.$ac_ext <<EOF
-#line 6335 "configure"
+			cat >conftest.$ac_ext <<_ACEOF
+#line 11713 "configure"
 #include "confdefs.h"
 
-int main() {
+int
+main ()
+{
 $cf_test()
-; return 0; }
-EOF
-if { (eval echo configure:6342: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:11725: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:11728: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:11731: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:11734: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   cf_result=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  cf_result=no
-fi
-rm -f conftest*
-			echo "$ac_t""$cf_result" 1>&6
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_result=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+			echo "$as_me:11743: result: $cf_result" >&5
+echo "${ECHO_T}$cf_result" >&6
 			if test "$cf_result" = yes ; then
 				cf_x_athena_lib="$cf_lib"
 				break
@@ -6359,66 +11752,65 @@
 done
 
 if test -z "$cf_x_athena_lib" ; then
-	{ echo "configure: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" 1>&2; exit 1; }
+	{ { echo "$as_me:11755: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
+echo "$as_me: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&2;}
+   { (exit 1); exit 1; }; }
 fi
 
-
 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
 
-cat >> confdefs.h <<EOF
+cat >>confdefs.h <<EOF
 #define $cf_x_athena_LIBS 1
 EOF
 
-
-
-
-
+fi
 
 for ac_prog in xcurses-config
 do
-# Extract the first word of "$ac_prog", so it can be a program name with args.
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:6383: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_XCURSES_CONFIG'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:11772: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_XCURSES_CONFIG+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  case "$XCURSES_CONFIG" in
-  /*)
+  case $XCURSES_CONFIG in
+  [\\/]* | ?:[\\/]*)
   ac_cv_path_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test with a path.
   ;;
-  ?:/*)			 
-  ac_cv_path_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test with a dos path.
-  ;;
   *)
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
-  ac_dummy="$PATH"
-  for ac_dir in $ac_dummy; do 
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$ac_word; then
-      ac_cv_path_XCURSES_CONFIG="$ac_dir/$ac_word"
-      break
-    fi
-  done
-  IFS="$ac_save_ifs"
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=.
+  if $as_executable_p "$ac_dir/$ac_word"; then
+   ac_cv_path_XCURSES_CONFIG="$ac_dir/$ac_word"
+   echo "$as_me:11789: found $ac_dir/$ac_word" >&5
+   break
+fi
+done
+
   ;;
 esac
 fi
-XCURSES_CONFIG="$ac_cv_path_XCURSES_CONFIG"
+XCURSES_CONFIG=$ac_cv_path_XCURSES_CONFIG
+
 if test -n "$XCURSES_CONFIG"; then
-  echo "$ac_t""$XCURSES_CONFIG" 1>&6
+  echo "$as_me:11800: result: $XCURSES_CONFIG" >&5
+echo "${ECHO_T}$XCURSES_CONFIG" >&6
 else
-  echo "$ac_t""no" 1>&6
+  echo "$as_me:11803: result: no" >&5
+echo "${ECHO_T}no" >&6
 fi
 
-test -n "$XCURSES_CONFIG" && break
+  test -n "$XCURSES_CONFIG" && break
 done
 test -n "$XCURSES_CONFIG" || XCURSES_CONFIG="none"
 
-
 if test "$XCURSES_CONFIG" != none ; then
 
-CPPFLAGS="`$XCURSES_CONFIG --cflags` $CPPFLAGS"
+CPPFLAGS="$CPPFLAGS `$XCURSES_CONFIG --cflags`"
 LIBS="`$XCURSES_CONFIG --libs` $LIBS"
 
 cf_cv_lib_XCurses=yes
@@ -6429,8 +11821,7 @@
 
 test -n "$verbose" && echo "	checking additions to CFLAGS" 1>&6
 
-echo "${as_me-configure}:6433: testing checking additions to CFLAGS ..." 1>&5
-
+echo "${as_me:-configure}:11824: testing checking additions to CFLAGS ..." 1>&5
 
 cf_check_cflags="$CFLAGS"
 cf_check_cppflags="$CPPFLAGS"
@@ -6451,8 +11842,8 @@
 			cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
 
 			test "${cf_add_cflags}" != "${cf_tst_cflags}" \
-			&& test -z "${cf_tst_cflags}" \
-			&& cf_fix_cppflags=yes
+				&& test -z "${cf_tst_cflags}" \
+				&& cf_fix_cppflags=yes
 
 			if test $cf_fix_cppflags = yes ; then
 				cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
@@ -6467,6 +11858,16 @@
 		*$cf_add_cflags) #(vi
 			;;
 		*) #(vi
+			case $cf_add_cflags in #(vi
+			-D*)
+				cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
+
+CPPFLAGS=`echo "$CPPFLAGS" | \
+	sed	-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?[ 	]/ /g' \
+		-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?$//g'`
+
+				;;
+			esac
 			cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
 			;;
 		esac
@@ -6482,8 +11883,8 @@
 	cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
 
 	test "${cf_add_cflags}" != "${cf_tst_cflags}" \
-	&& test -z "${cf_tst_cflags}" \
-	&& cf_fix_cppflags=no
+		&& test -z "${cf_tst_cflags}" \
+		&& cf_fix_cppflags=no
 	;;
 esac
 done
@@ -6491,8 +11892,7 @@
 if test -n "$cf_new_cflags" ; then
 	test -n "$verbose" && echo "	add to \$CFLAGS $cf_new_cflags" 1>&6
 
-echo "${as_me-configure}:6495: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
-
+echo "${as_me:-configure}:11895: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
 
 	CFLAGS="$CFLAGS $cf_new_cflags"
 fi
@@ -6500,1558 +11900,3478 @@
 if test -n "$cf_new_cppflags" ; then
 	test -n "$verbose" && echo "	add to \$CPPFLAGS $cf_new_cppflags" 1>&6
 
-echo "${as_me-configure}:6504: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
+echo "${as_me:-configure}:11903: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
 
-
-	CPPFLAGS="$cf_new_cppflags $CPPFLAGS"
+	CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
 fi
 
 if test -n "$cf_new_extra_cppflags" ; then
 	test -n "$verbose" && echo "	add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
 
-echo "${as_me-configure}:6513: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
-
+echo "${as_me:-configure}:11911: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
 
 	EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
 fi
 
-
-
-
 if test "$cf_check_cflags" != "$CFLAGS" ; then
-cat > conftest.$ac_ext <<EOF
-#line 6524 "configure"
+cat >conftest.$ac_ext <<_ACEOF
+#line 11918 "configure"
 #include "confdefs.h"
 #include <stdio.h>
-int main() {
+int
+main ()
+{
 printf("Hello world");
-; return 0; }
-EOF
-if { (eval echo configure:6531: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:11930: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:11933: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:11936: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:11939: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   :
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  test -n "$verbose" && echo "	test-compile failed.  Undoing change to \$CFLAGS" 1>&6
-
-echo "${as_me-configure}:6539: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+test -n "$verbose" && echo "	test-compile failed.  Undoing change to \$CFLAGS" 1>&6
 
+echo "${as_me:-configure}:11947: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
 
 	 if test "$cf_check_cppflags" != "$CPPFLAGS" ; then
 		 test -n "$verbose" && echo "	but keeping change to \$CPPFLAGS" 1>&6
 
-echo "${as_me-configure}:6545: testing but keeping change to \$CPPFLAGS ..." 1>&5
-
+echo "${as_me:-configure}:11952: testing but keeping change to \$CPPFLAGS ..." 1>&5
 
 	 fi
 	 CFLAGS="$cf_check_flags"
 fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
 
-echo $ac_n "checking for XOpenDisplay in -lX11""... $ac_c" 1>&6
-echo "configure:6555: checking for XOpenDisplay in -lX11" >&5
-ac_lib_var=`echo X11'_'XOpenDisplay | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:11960: checking for XOpenDisplay in -lX11" >&5
+echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
+if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_save_LIBS="$LIBS"
+  ac_check_lib_save_LIBS=$LIBS
 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 6563 "configure"
+cat >conftest.$ac_ext <<_ACEOF
+#line 11968 "configure"
 #include "confdefs.h"
+
 /* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
 /* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char XOpenDisplay();
-
-int main() {
-XOpenDisplay()
-; return 0; }
-EOF
-if { (eval echo configure:6574: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
+   builtin and then its argument prototype would still apply.  */
+char XOpenDisplay ();
+int
+main ()
+{
+XOpenDisplay ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:11987: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:11990: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:11993: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:11996: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_X11_XOpenDisplay=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_X11_XOpenDisplay=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:12007: result: $ac_cv_lib_X11_XOpenDisplay" >&5
+echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
+if test $ac_cv_lib_X11_XOpenDisplay = yes; then
   LIBS="-lX11 $LIBS"
-else
-  echo "$ac_t""no" 1>&6
 fi
 
-echo $ac_n "checking for XCurses library""... $ac_c" 1>&6
-echo "configure:6595: checking for XCurses library" >&5
-if eval "test \"`echo '$''{'cf_cv_lib_XCurses'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:12013: checking for XCurses library" >&5
+echo $ECHO_N "checking for XCurses library... $ECHO_C" >&6
+if test "${cf_cv_lib_XCurses+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  
+
 LIBS="-lXCurses $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 6602 "configure"
+cat >conftest.$ac_ext <<_ACEOF
+#line 12021 "configure"
 #include "confdefs.h"
 
 #include <xcurses.h>
 char *XCursesProgramName = "test";
 
-int main() {
+int
+main ()
+{
 XCursesExit();
-; return 0; }
-EOF
-if { (eval echo configure:6612: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:12036: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:12039: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:12042: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:12045: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   cf_cv_lib_XCurses=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  cf_cv_lib_XCurses=no
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_lib_XCurses=no
 fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 
 fi
-
-echo "$ac_t""$cf_cv_lib_XCurses" 1>&6
+echo "$as_me:12056: result: $cf_cv_lib_XCurses" >&5
+echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
 
 fi
 
 if test $cf_cv_lib_XCurses = yes ; then
-	cat >> confdefs.h <<\EOF
+	cat >>confdefs.h <<\EOF
 #define UNIX 1
 EOF
 
-	cat >> confdefs.h <<\EOF
+	cat >>confdefs.h <<\EOF
 #define XCURSES 1
 EOF
 
-	cat >> confdefs.h <<\EOF
+	cat >>confdefs.h <<\EOF
 #define HAVE_XCURSES 1
 EOF
 
 else
-	{ echo "configure: error: Cannot link with XCurses" 1>&2; exit 1; }
+	{ { echo "$as_me:12075: error: Cannot link with XCurses" >&5
+echo "$as_me: error: Cannot link with XCurses" >&2;}
+   { (exit 1); exit 1; }; }
 fi
 
 	;;
 esac
 
-
-
 case $cf_cv_screen in #(vi
 pdcurses) #(vi
 	;;
 *)
 	# look for curses-related libraries
-	echo $ac_n "checking for new_panel in -lpanel$cf_cv_libtype""... $ac_c" 1>&6
-echo "configure:6657: checking for new_panel in -lpanel$cf_cv_libtype" >&5
-ac_lib_var=`echo panel$cf_cv_libtype'_'new_panel | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+
+as_ac_Lib=`echo "ac_cv_lib_panel$cf_cv_libtype''_new_panel" | $as_tr_sh`
+echo "$as_me:12090: checking for new_panel in -lpanel$cf_cv_libtype" >&5
+echo $ECHO_N "checking for new_panel in -lpanel$cf_cv_libtype... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Lib+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpanel$cf_cv_libtype  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line 12098 "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char new_panel ();
+int
+main ()
+{
+new_panel ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:12117: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:12120: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:12123: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:12126: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_Lib=yes"
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+eval "$as_ac_Lib=no"
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:12137: result: `eval echo '${'$as_ac_Lib'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
+if test `eval echo '${'$as_ac_Lib'}'` = yes; then
+  cat >>confdefs.h <<EOF
+#define `echo "HAVE_LIBpanel$cf_cv_libtype" | $as_tr_cpp` 1
+EOF
+
+  LIBS="-lpanel$cf_cv_libtype $LIBS"
+
+fi
+
+as_ac_Lib=`echo "ac_cv_lib_menu$cf_cv_libtype''_menu_driver" | $as_tr_sh`
+echo "$as_me:12149: checking for menu_driver in -lmenu$cf_cv_libtype" >&5
+echo $ECHO_N "checking for menu_driver in -lmenu$cf_cv_libtype... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Lib+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lmenu$cf_cv_libtype  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line 12157 "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char menu_driver ();
+int
+main ()
+{
+menu_driver ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:12176: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:12179: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:12182: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:12185: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_Lib=yes"
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+eval "$as_ac_Lib=no"
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:12196: result: `eval echo '${'$as_ac_Lib'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
+if test `eval echo '${'$as_ac_Lib'}'` = yes; then
+  cat >>confdefs.h <<EOF
+#define `echo "HAVE_LIBmenu$cf_cv_libtype" | $as_tr_cpp` 1
+EOF
+
+  LIBS="-lmenu$cf_cv_libtype $LIBS"
+
+fi
+
+as_ac_Lib=`echo "ac_cv_lib_form$cf_cv_libtype''_form_driver" | $as_tr_sh`
+echo "$as_me:12208: checking for form_driver in -lform$cf_cv_libtype" >&5
+echo $ECHO_N "checking for form_driver in -lform$cf_cv_libtype... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Lib+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lform$cf_cv_libtype  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line 12216 "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char form_driver ();
+int
+main ()
+{
+form_driver ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:12235: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:12238: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:12241: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:12244: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_Lib=yes"
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+eval "$as_ac_Lib=no"
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:12255: result: `eval echo '${'$as_ac_Lib'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
+if test `eval echo '${'$as_ac_Lib'}'` = yes; then
+  cat >>confdefs.h <<EOF
+#define `echo "HAVE_LIBform$cf_cv_libtype" | $as_tr_cpp` 1
+EOF
+
+  LIBS="-lform$cf_cv_libtype $LIBS"
+
+fi
+
+	# look for curses-related headers
+
+for ac_header in \
+		nc_alloc.h \
+		nomacros.h \
+		form.h \
+		menu.h \
+		panel.h \
+		term_entry.h \
+
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+echo "$as_me:12278: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 12284 "configure"
+#include "confdefs.h"
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:12288: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  egrep -v '^ *\+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:12294: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  eval "$as_ac_Header=yes"
+else
+  echo "$as_me: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  eval "$as_ac_Header=no"
+fi
+rm -f conftest.err conftest.$ac_ext
+fi
+echo "$as_me:12313: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+EOF
+
+fi
+done
+
+	;;
+esac
+
+echo "$as_me:12326: checking return type of signal handlers" >&5
+echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6
+if test "${ac_cv_type_signal+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 12332 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <signal.h>
+#ifdef signal
+# undef signal
+#endif
+#ifdef __cplusplus
+extern "C" void (*signal (int, void (*)(int)))(int);
+#else
+void (*signal ()) ();
+#endif
+
+int
+main ()
+{
+int i;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:12354: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:12357: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:12360: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:12363: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_type_signal=void
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_type_signal=int
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:12373: result: $ac_cv_type_signal" >&5
+echo "${ECHO_T}$ac_cv_type_signal" >&6
+
+cat >>confdefs.h <<EOF
+#define RETSIGTYPE $ac_cv_type_signal
+EOF
+
+echo "$as_me:12380: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
+if test "${ac_cv_header_stdc+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 12386 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+_ACEOF
+if { (eval echo "$as_me:12394: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  egrep -v '^ *\+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:12400: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_cv_header_stdc=yes
+else
+  echo "$as_me: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  ac_cv_header_stdc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+  cat >conftest.$ac_ext <<_ACEOF
+#line 12422 "configure"
+#include "confdefs.h"
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "memchr" >/dev/null 2>&1; then
+  :
+else
+  ac_cv_header_stdc=no
+fi
+rm -rf conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+  cat >conftest.$ac_ext <<_ACEOF
+#line 12440 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "free" >/dev/null 2>&1; then
+  :
+else
+  ac_cv_header_stdc=no
+fi
+rm -rf conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+  if test "$cross_compiling" = yes; then
+  :
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 12461 "configure"
+#include "confdefs.h"
+#include <ctype.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
+                     || ('j' <= (c) && (c) <= 'r') \
+                     || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+        || toupper (i) != TOUPPER (i))
+      $ac_main_return(2);
+  $ac_main_return (0);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:12487: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:12490: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:12492: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:12495: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_header_stdc=no
+fi
+rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+fi
+echo "$as_me:12508: result: $ac_cv_header_stdc" >&5
+echo "${ECHO_T}$ac_cv_header_stdc" >&6
+if test $ac_cv_header_stdc = yes; then
+
+cat >>confdefs.h <<\EOF
+#define STDC_HEADERS 1
+EOF
+
+fi
+
+echo "$as_me:12518: checking whether time.h and sys/time.h may both be included" >&5
+echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
+if test "${ac_cv_header_time+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 12524 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <sys/time.h>
+#include <time.h>
+
+int
+main ()
+{
+if ((struct tm *) 0)
+return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:12540: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:12543: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:12546: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:12549: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_header_time=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_header_time=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:12559: result: $ac_cv_header_time" >&5
+echo "${ECHO_T}$ac_cv_header_time" >&6
+if test $ac_cv_header_time = yes; then
+
+cat >>confdefs.h <<\EOF
+#define TIME_WITH_SYS_TIME 1
+EOF
+
+fi
+
+for ac_header in \
+getopt.h \
+locale.h \
+stdarg.h \
+sys/ioctl.h \
+sys/select.h \
+sys/time.h \
+termios.h \
+unistd.h \
+
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+echo "$as_me:12581: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 12587 "configure"
+#include "confdefs.h"
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:12591: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  egrep -v '^ *\+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:12597: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  eval "$as_ac_Header=yes"
+else
+  echo "$as_me: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  eval "$as_ac_Header=no"
+fi
+rm -f conftest.err conftest.$ac_ext
+fi
+echo "$as_me:12616: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+EOF
+
+fi
+done
+
+for ac_func in \
+gettimeofday \
+mblen \
+mbrlen \
+mbrtowc \
+mbsrtowcs \
+mbstowcs \
+mbtowc \
+strdup \
+wcsrtombs \
+wcstombs \
+
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:12640: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_save_LIBS="$LIBS"
-LIBS="-lpanel$cf_cv_libtype  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 6665 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 12646 "configure"
 #include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.  */
+#include <assert.h>
 /* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
 /* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char new_panel();
+   builtin and then its argument prototype would still apply.  */
+char $ac_func ();
+char (*f) ();
 
-int main() {
-new_panel()
-; return 0; }
-EOF
-if { (eval echo configure:6676: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
+int
+main ()
+{
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+f = $ac_func;
+#endif
 
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_lib=HAVE_LIB`echo panel$cf_cv_libtype | sed -e 's/[^a-zA-Z0-9_]/_/g' \
-    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:12677: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:12680: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:12683: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:12686: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+eval "$as_ac_var=no"
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:12696: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 EOF
 
-  LIBS="-lpanel$cf_cv_libtype $LIBS"
+fi
+done
 
+echo "$as_me:12706: checking if we must define _XOPEN_SOURCE_EXTENDED" >&5
+echo $ECHO_N "checking if we must define _XOPEN_SOURCE_EXTENDED... $ECHO_C" >&6
+if test "${cf_cv_need_xopen_extension+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  echo "$ac_t""no" 1>&6
-fi
 
-	echo $ac_n "checking for menu_driver in -lmenu$cf_cv_libtype""... $ac_c" 1>&6
-echo "configure:6704: checking for menu_driver in -lmenu$cf_cv_libtype" >&5
-ac_lib_var=`echo menu$cf_cv_libtype'_'menu_driver | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+cat >conftest.$ac_ext <<_ACEOF
+#line 12713 "configure"
+#include "confdefs.h"
+
+#include <stdlib.h>
+#include <${cf_cv_ncurses_header:-curses.h}>
+int
+main ()
+{
+
+#if defined(NCURSES_VERSION_PATCH)
+if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
+	make an error
+#endif
+#endif
+	long x = winnstr(stdscr, "", 0);
+	int x1, y1;
+	getbegyx(stdscr, y1, x1)
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:12735: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:12738: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:12741: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:12744: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_need_xopen_extension=no
 else
-  ac_save_LIBS="$LIBS"
-LIBS="-lmenu$cf_cv_libtype  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 6712 "configure"
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cat >conftest.$ac_ext <<_ACEOF
+#line 12751 "configure"
 #include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char menu_driver();
 
-int main() {
-menu_driver()
-; return 0; }
-EOF
-if { (eval echo configure:6723: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+#define _XOPEN_SOURCE_EXTENDED
+#include <stdlib.h>
+#include <${cf_cv_ncurses_header:-curses.h}>
+int
+main ()
+{
+
+#ifdef NCURSES_VERSION
+	cchar_t check;
+	int check2 = curs_set((int)sizeof(check));
+#endif
+	long x = winnstr(stdscr, "", 0);
+	int x1, y1;
+	getbegyx(stdscr, y1, x1)
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:12773: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:12776: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:12779: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:12782: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_need_xopen_extension=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_need_xopen_extension=unknown
 fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_lib=HAVE_LIB`echo menu$cf_cv_libtype | sed -e 's/[^a-zA-Z0-9_]/_/g' \
-    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
-EOF
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:12794: result: $cf_cv_need_xopen_extension" >&5
+echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
+test $cf_cv_need_xopen_extension = yes && CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"
 
-  LIBS="-lmenu$cf_cv_libtype $LIBS"
+echo "$as_me:12798: checking for term.h" >&5
+echo $ECHO_N "checking for term.h... $ECHO_C" >&6
+if test "${cf_cv_term_header+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+# If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
+# for <term.h> if we do not find the variant.
+for cf_header in \
+	`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%/.*%/%'`term.h \
+	term.h
+do
+	cat >conftest.$ac_ext <<_ACEOF
+#line 12811 "configure"
+#include "confdefs.h"
 
+#include <${cf_cv_ncurses_header:-curses.h}>
+#include <${cf_header}>
+int
+main ()
+{
+WINDOW *x
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:12825: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:12828: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:12831: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:12834: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_term_header=$cf_header
+	 break
 else
-  echo "$ac_t""no" 1>&6
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_term_header=no
 fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+done
 
-	echo $ac_n "checking for form_driver in -lform$cf_cv_libtype""... $ac_c" 1>&6
-echo "configure:6751: checking for form_driver in -lform$cf_cv_libtype" >&5
-ac_lib_var=`echo form$cf_cv_libtype'_'form_driver | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  ac_save_LIBS="$LIBS"
-LIBS="-lform$cf_cv_libtype  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 6759 "configure"
+case $cf_cv_term_header in #(vi
+no)
+	# If curses is ncurses, some packagers still mess it up by trying to make
+	# us use GNU termcap.  This handles the most common case.
+	for cf_header in ncurses/term.h ncursesw/term.h
+	do
+		cat >conftest.$ac_ext <<_ACEOF
+#line 12853 "configure"
 #include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char form_driver();
 
-int main() {
-form_driver()
-; return 0; }
-EOF
-if { (eval echo configure:6770: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+#include <${cf_cv_ncurses_header:-curses.h}>
+#ifdef NCURSES_VERSION
+#include <${cf_header}>
+#else
+make an error
+#endif
+int
+main ()
+{
+WINDOW *x
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:12871: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:12874: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:12877: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:12880: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_term_header=$cf_header
+			 break
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_term_header=no
 fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
+rm -f conftest.$ac_objext conftest.$ac_ext
+	done
+	;;
+esac
 
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_lib=HAVE_LIB`echo form$cf_cv_libtype | sed -e 's/[^a-zA-Z0-9_]/_/g' \
-    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
-EOF
-
-  LIBS="-lform$cf_cv_libtype $LIBS"
+echo "$as_me:12895: result: $cf_cv_term_header" >&5
+echo "${ECHO_T}$cf_cv_term_header" >&6
 
-else
-  echo "$ac_t""no" 1>&6
-fi
+case $cf_cv_term_header in #(vi
+term.h) #(vi
+	cat >>confdefs.h <<\EOF
+#define HAVE_TERM_H 1
+EOF
 
+	;;
+ncurses/term.h) #(vi
+	cat >>confdefs.h <<\EOF
+#define HAVE_NCURSES_TERM_H 1
+EOF
 
-	# look for curses-related headers
-	for ac_hdr in \
-		nc_alloc.h \
-		nomacros.h \
-		form.h \
-		menu.h \
-		panel.h \
-		
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6809: checking for $ac_hdr" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 6814 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6819: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
-else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
+	;;
+ncursesw/term.h)
+	cat >>confdefs.h <<\EOF
+#define HAVE_NCURSESW_TERM_H 1
 EOF
- 
-else
-  echo "$ac_t""no" 1>&6
-fi
-done
 
 	;;
 esac
 
-echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:6849: checking return type of signal handlers" >&5
-if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+for cf_func in \
+chgat \
+color_set \
+filter \
+getbegx \
+getcurx \
+getmaxx \
+getnstr \
+getparx \
+getwin \
+mvvline \
+mvwvline \
+napms \
+putwin \
+resize_term \
+resizeterm \
+ripoffline \
+setupterm \
+slk_color \
+slk_init \
+termattrs \
+tgetent \
+tigetnum \
+tigetstr \
+typeahead \
+use_default_colors \
+vw_printw \
+vsscanf \
+wchgat \
+winsstr \
+wresize \
+
+do
+
+cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
+
+	echo "$as_me:12955: checking for ${cf_func}" >&5
+echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
+
+echo "${as_me:-configure}:12958: testing ${cf_func} ..." 1>&5
+
+	if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 6854 "configure"
+
+		eval cf_result='$ac_cv_func_'$cf_func
+		if test ".$cf_result" != ".no"; then
+			cat >conftest.$ac_ext <<_ACEOF
+#line 12967 "configure"
 #include "confdefs.h"
-#include <sys/types.h>
-#include <signal.h>
-#ifdef signal
-#undef signal
-#endif
-#ifdef __cplusplus
-extern "C" void (*signal (int, void (*)(int)))(int);
+
+#ifdef HAVE_XCURSES
+#include <xcurses.h>
+char * XCursesProgramName = "test";
 #else
-void (*signal ()) ();
+#include <${cf_cv_ncurses_header:-curses.h}>
+#if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
+#include <ncursesw/term.h>
+#elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
+#include <ncurses/term.h>
+#elif defined(HAVE_TERM_H)
+#include <term.h>
+#endif
 #endif
 
-int main() {
-int i;
-; return 0; }
-EOF
-if { (eval echo configure:6871: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
-  ac_cv_type_signal=void
+int
+main ()
+{
+
+#ifndef ${cf_func}
+long foo = (long)(&${cf_func});
+${cf_cv_main_return:-return}(foo == 0);
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:12998: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:13001: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:13004: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:13007: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_result=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_type_signal=int
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_result=no
 fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+		fi
+		eval 'cf_cv_func_'$cf_func'=$cf_result'
+
 fi
 
-echo "$ac_t""$ac_cv_type_signal" 1>&6
-cat >> confdefs.h <<EOF
-#define RETSIGTYPE $ac_cv_type_signal
+	# use the computed/retrieved cache-value:
+	eval 'cf_result=$cf_cv_func_'$cf_func
+	echo "$as_me:13023: result: $cf_result" >&5
+echo "${ECHO_T}$cf_result" >&6
+	if test $cf_result != no; then
+		cat >>confdefs.h <<EOF
+#define HAVE_${cf_tr_func} 1
 EOF
 
+	fi
+done
 
-
-echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:6891: checking for ANSI C header files" >&5
-if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 6896 "configure"
-#include "confdefs.h"
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6904: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  ac_cv_header_stdc=yes
+echo "$as_me:13033: checking for ncurses extended functions" >&5
+echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
+if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_header_stdc=no
-fi
-rm -f conftest*
 
-if test $ac_cv_header_stdc = yes; then
-  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
-cat > conftest.$ac_ext <<EOF
-#line 6921 "configure"
+cat >conftest.$ac_ext <<_ACEOF
+#line 13040 "configure"
 #include "confdefs.h"
-#include <string.h>
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "memchr" >/dev/null 2>&1; then
-  :
-else
-  rm -rf conftest*
-  ac_cv_header_stdc=no
-fi
-rm -f conftest*
 
-fi
+#include <${cf_cv_ncurses_header:-curses.h}>
+int
+main ()
+{
 
-if test $ac_cv_header_stdc = yes; then
-  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
-cat > conftest.$ac_ext <<EOF
-#line 6939 "configure"
-#include "confdefs.h"
-#include <stdlib.h>
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "free" >/dev/null 2>&1; then
-  :
+int x = NCURSES_EXT_FUNCS
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:13055: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:13058: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:13061: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:13064: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_ncurses_ext_funcs=defined
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+
+cat >conftest.$ac_ext <<_ACEOF
+#line 13072 "configure"
+#include "confdefs.h"
+
+#include <${cf_cv_ncurses_header:-curses.h}>
+int
+main ()
+{
+
+	(void) assume_default_colors (0, 0);
+	(void) curses_version ();
+	(void) define_key (0, 0);
+	(void) is_term_resized (0, 0);
+	(void) key_defined (0);
+	(void) keybound (0, 0);
+	(void) keyok (0, 0);
+	(void) resize_term (0, 0);
+	(void) resizeterm (0, 0);
+	(void) use_default_colors ();
+	(void) use_extended_names (0);
+	(void) wresize (0, 0, 0);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:13097: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:13100: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:13103: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:13106: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_ncurses_ext_funcs=yes
 else
-  rm -rf conftest*
-  ac_cv_header_stdc=no
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_ncurses_ext_funcs=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+
 fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
 
 fi
+echo "$as_me:13120: result: $cf_cv_ncurses_ext_funcs" >&5
+echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
+test "$cf_cv_ncurses_ext_funcs" = yes && cat >>confdefs.h <<\EOF
+#define NCURSES_EXT_FUNCS 1
+EOF
 
-if test $ac_cv_header_stdc = yes; then
-  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
-if test "$cross_compiling" = yes; then
-  :
+echo "$as_me:13126: checking for wide-character functions" >&5
+echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
+if test "${cf_cv_widechar_funcs+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 6960 "configure"
+
+cat >conftest.$ac_ext <<_ACEOF
+#line 13133 "configure"
 #include "confdefs.h"
-#include <ctype.h>
-#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int main () { int i; for (i = 0; i < 256; i++)
-if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
-exit (0); }
 
-EOF
-if { (eval echo configure:6971: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
-  :
+#include <${cf_cv_ncurses_header:-curses.h}>
+int
+main ()
+{
+
+	static wchar_t src_wchar[2];
+	static cchar_t dst_cchar;
+	setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:13150: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:13153: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:13156: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:13159: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_widechar_funcs=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -fr conftest*
-  ac_cv_header_stdc=no
-fi
-rm -fr conftest*
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_widechar_funcs=no
 fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 
 fi
-fi
+echo "$as_me:13170: result: $cf_cv_widechar_funcs" >&5
+echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
+if test "$cf_cv_widechar_funcs" != no ; then
+	cat >>confdefs.h <<\EOF
+#define USE_WIDEC_SUPPORT 1
+EOF
 
-echo "$ac_t""$ac_cv_header_stdc" 1>&6
-if test $ac_cv_header_stdc = yes; then
-  cat >> confdefs.h <<\EOF
-#define STDC_HEADERS 1
+else
+	cat >>confdefs.h <<\EOF
+#define USE_WIDEC_SUPPORT 0
 EOF
 
 fi
 
-echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:6995: checking whether time.h and sys/time.h may both be included" >&5
-if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 7000 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#include <sys/time.h>
-#include <time.h>
-int main() {
-struct tm *tp;
-; return 0; }
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+                  inttypes.h stdint.h unistd.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+echo "$as_me:13190: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 13196 "configure"
+#include "confdefs.h"
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:13202: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:13205: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:13208: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:13211: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_Header=yes"
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+eval "$as_ac_Header=no"
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:13221: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
 EOF
-if { (eval echo configure:7009: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
-  ac_cv_header_time=yes
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  ac_cv_header_time=no
-fi
-rm -f conftest*
+
 fi
+done
 
-echo "$ac_t""$ac_cv_header_time" 1>&6
-if test $ac_cv_header_time = yes; then
-  cat >> confdefs.h <<\EOF
-#define TIME_WITH_SYS_TIME 1
+echo "$as_me:13231: checking for pid_t" >&5
+echo $ECHO_N "checking for pid_t... $ECHO_C" >&6
+if test "${ac_cv_type_pid_t+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 13237 "configure"
+#include "confdefs.h"
+$ac_includes_default
+int
+main ()
+{
+if ((pid_t *) 0)
+  return 0;
+if (sizeof (pid_t))
+  return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:13252: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:13255: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:13258: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:13261: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_type_pid_t=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_type_pid_t=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:13271: result: $ac_cv_type_pid_t" >&5
+echo "${ECHO_T}$ac_cv_type_pid_t" >&6
+if test $ac_cv_type_pid_t = yes; then
+  :
+else
+
+cat >>confdefs.h <<EOF
+#define pid_t int
 EOF
 
 fi
 
-for ac_hdr in \
-getopt.h \
-locale.h \
-stdarg.h \
-sys/ioctl.h \
-sys/select.h \
-sys/time.h \
-termios.h \
-unistd.h \
-
+for ac_header in unistd.h vfork.h
 do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:7042: checking for $ac_hdr" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 7047 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7052: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+echo "$as_me:13286: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 13292 "configure"
+#include "confdefs.h"
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:13296: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  egrep -v '^ *\+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:13302: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  eval "$as_ac_Header=yes"
 else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
+  echo "$as_me: failed program was:" >&5
   cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
+  eval "$as_ac_Header=no"
 fi
-rm -f conftest*
+rm -f conftest.err conftest.$ac_ext
 fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
+echo "$as_me:13321: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
 EOF
- 
-else
-  echo "$ac_t""no" 1>&6
+
 fi
 done
 
-
-for ac_func in \
-gettimeofday \
-mblen \
-mbrlen \
-mbrtowc \
-mbsrtowcs \
-mbstowcs \
-mbtowc \
-strdup \
-wcsrtombs \
-wcstombs \
-
+for ac_func in fork vfork
 do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:7093: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:13334: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.$ac_ext <<EOF
-#line 7098 "configure"
+  cat >conftest.$ac_ext <<_ACEOF
+#line 13340 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func(); below.  */
+    which can conflict with char $ac_func (); below.  */
 #include <assert.h>
 /* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
 /* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char $ac_func();
-
-int main() {
+   builtin and then its argument prototype would still apply.  */
+char $ac_func ();
+char (*f) ();
 
+int
+main ()
+{
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
 choke me
 #else
-$ac_func();
+f = $ac_func;
 #endif
 
-; return 0; }
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:13371: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:13374: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:13377: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:13380: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+eval "$as_ac_var=no"
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:13390: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 EOF
-if { (eval echo configure:7121: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=yes"
+
+fi
+done
+
+ac_cv_func_fork_works=$ac_cv_func_fork
+if test "x$ac_cv_func_fork" = xyes; then
+  echo "$as_me:13402: checking for working fork" >&5
+echo $ECHO_N "checking for working fork... $ECHO_C" >&6
+if test "${ac_cv_func_fork_works+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test "$cross_compiling" = yes; then
+  ac_cv_func_fork_works=cross
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* By Rüdiger Kuhlmann. */
+      #include <sys/types.h>
+      #if HAVE_UNISTD_H
+      # include <unistd.h>
+      #endif
+      /* Some systems only have a dummy stub for fork() */
+      int main ()
+      {
+        if (fork() < 0)
+          $ac_main_return (1);
+        $ac_main_return (0);
+      }
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:13425: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:13428: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:13430: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:13433: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_fork_works=yes
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_func_fork_works=no
+fi
+rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+echo "$as_me:13445: result: $ac_cv_func_fork_works" >&5
+echo "${ECHO_T}$ac_cv_func_fork_works" >&6
+
+fi
+if test "x$ac_cv_func_fork_works" = xcross; then
+  case $host in
+    *-*-amigaos* | *-*-msdosdjgpp*)
+      # Override, as these systems have only a dummy fork() stub
+      ac_cv_func_fork_works=no
+      ;;
+    *)
+      ac_cv_func_fork_works=yes
+      ;;
+  esac
+  { echo "$as_me:13459: WARNING: CROSS: Result $ac_cv_func_fork_works guessed due to cross-compiling." >&5
+echo "$as_me: WARNING: CROSS: Result $ac_cv_func_fork_works guessed due to cross-compiling." >&2;}
+fi
+ac_cv_func_vfork_works=$ac_cv_func_vfork
+if test "x$ac_cv_func_vfork" = xyes; then
+  echo "$as_me:13464: checking for working vfork" >&5
+echo $ECHO_N "checking for working vfork... $ECHO_C" >&6
+if test "${ac_cv_func_vfork_works+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_func_$ac_func=no"
+  if test "$cross_compiling" = yes; then
+  ac_cv_func_vfork_works=cross
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 13473 "configure"
+#include "confdefs.h"
+/* Thanks to Paul Eggert for this test.  */
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+#if HAVE_VFORK_H
+# include <vfork.h>
+#endif
+/* On some sparc systems, changes by the child to local and incoming
+   argument registers are propagated back to the parent.  The compiler
+   is told about this with #include <vfork.h>, but some compilers
+   (e.g. gcc -O) don't grok <vfork.h>.  Test for this by using a
+   static variable whose address is put into a register that is
+   clobbered by the vfork.  */
+static
+#ifdef __cplusplus
+sparc_address_test (int arg)
+# else
+sparc_address_test (arg) int arg;
+#endif
+{
+  static pid_t child;
+  if (!child) {
+    child = vfork ();
+    if (child < 0) {
+      perror ("vfork");
+      _exit(2);
+    }
+    if (!child) {
+      arg = getpid();
+      write(-1, "", 0);
+      _exit (arg);
+    }
+  }
+}
+
+int
+main ()
+{
+  pid_t parent = getpid ();
+  pid_t child;
+
+  sparc_address_test ();
+
+  child = vfork ();
+
+  if (child == 0) {
+    /* Here is another test for sparc vfork register problems.  This
+       test uses lots of local variables, at least as many local
+       variables as main has allocated so far including compiler
+       temporaries.  4 locals are enough for gcc 1.40.3 on a Solaris
+       4.1.3 sparc, but we use 8 to be safe.  A buggy compiler should
+       reuse the register of parent for one of the local variables,
+       since it will think that parent can't possibly be used any more
+       in this routine.  Assigning to the local variable will thus
+       munge parent in the parent process.  */
+    pid_t
+      p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(),
+      p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid();
+    /* Convince the compiler that p..p7 are live; otherwise, it might
+       use the same hardware register for all 8 local variables.  */
+    if (p != p1 || p != p2 || p != p3 || p != p4
+	|| p != p5 || p != p6 || p != p7)
+      _exit(1);
+
+    /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent
+       from child file descriptors.  If the child closes a descriptor
+       before it execs or exits, this munges the parent's descriptor
+       as well.  Test for this by closing stdout in the child.  */
+    _exit(close(fileno(stdout)) != 0);
+  } else {
+    int status;
+    struct stat st;
+
+    while (wait(&status) != child)
+      ;
+    $ac_main_return(
+	 /* Was there some problem with vforking?  */
+	 child < 0
+
+	 /* Did the child fail?  (This shouldn't happen.)  */
+	 || status
+
+	 /* Did the vfork/compiler bug occur?  */
+	 || parent != getpid()
+
+	 /* Did the file descriptor bug occur?  */
+	 || fstat(fileno(stdout), &st) != 0
+	 );
+  }
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:13570: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:13573: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:13575: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:13578: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_vfork_works=yes
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_func_vfork_works=no
 fi
-rm -f conftest*
+rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
+fi
+echo "$as_me:13590: result: $ac_cv_func_vfork_works" >&5
+echo "${ECHO_T}$ac_cv_func_vfork_works" >&6
+
+fi;
+if test "x$ac_cv_func_fork_works" = xcross; then
+  ac_cv_func_vfork_works=ac_cv_func_vfork
+  { echo "$as_me:13596: WARNING: CROSS: Result $ac_cv_func_vfork_works guessed due to cross-compiling." >&5
+echo "$as_me: WARNING: CROSS: Result $ac_cv_func_vfork_works guessed due to cross-compiling." >&2;}
+fi
+
+if test "x$ac_cv_func_vfork_works" = xyes; then
 
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
+cat >>confdefs.h <<\EOF
+#define HAVE_WORKING_VFORK 1
 EOF
- 
+
 else
-  echo "$ac_t""no" 1>&6
+
+cat >>confdefs.h <<\EOF
+#define vfork fork
+EOF
+
 fi
-done
+if test "x$ac_cv_func_fork_works" = xyes; then
 
+cat >>confdefs.h <<\EOF
+#define HAVE_WORKING_FORK 1
+EOF
 
+fi
 
-echo $ac_n "checking if we must define _XOPEN_SOURCE_EXTENDED""... $ac_c" 1>&6
-echo "configure:7148: checking if we must define _XOPEN_SOURCE_EXTENDED" >&5
-if eval "test \"`echo '$''{'cf_cv_need_xopen_extension'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:13621: checking if sys/time.h works with sys/select.h" >&5
+echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
+if test "${cf_cv_sys_time_select+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  
-cat > conftest.$ac_ext <<EOF
-#line 7154 "configure"
+
+cat >conftest.$ac_ext <<_ACEOF
+#line 13628 "configure"
 #include "confdefs.h"
 
-#include <stdlib.h>
-#include <${cf_cv_ncurses_header-curses.h}>
-int main() {
+#include <sys/types.h>
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#ifdef HAVE_SYS_SELECT_H
+#include <sys/select.h>
+#endif
 
-	long x = winnstr(stdscr, "", 0);
-	int x1, y1;
-	getbegyx(stdscr, y1, x1)
-; return 0; }
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:13648: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:13651: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:13654: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:13657: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_sys_time_select=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_sys_time_select=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+fi
+
+echo "$as_me:13669: result: $cf_cv_sys_time_select" >&5
+echo "${ECHO_T}$cf_cv_sys_time_select" >&6
+test "$cf_cv_sys_time_select" = yes && cat >>confdefs.h <<\EOF
+#define HAVE_SYS_TIME_SELECT 1
 EOF
-if { (eval echo configure:7166: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  cf_cv_need_xopen_extension=no
+
+echo "$as_me:13675: checking for function curses_version" >&5
+echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
+if test "${cf_cv_func_curses_version+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  cat > conftest.$ac_ext <<EOF
-#line 7174 "configure"
+
+if test "$cross_compiling" = yes; then
+  cf_cv_func_curses_version=unknown
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 13685 "configure"
 #include "confdefs.h"
 
-#define _XOPEN_SOURCE_EXTENDED
-#include <stdlib.h>
-#include <${cf_cv_ncurses_header-curses.h}>
-int main() {
+#include <${cf_cv_ncurses_header:-curses.h}>
+int main()
+{
+	char temp[1024];
+	sprintf(temp, "%s\n", curses_version());
+	${cf_cv_main_return:-return}(0);
+}
+
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:13698: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:13701: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:13703: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:13706: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_func_curses_version=yes
 
-	long x = winnstr(stdscr, "", 0);
-	int x1, y1;
-	getbegyx(stdscr, y1, x1)
-; return 0; }
-EOF
-if { (eval echo configure:7187: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  cf_cv_need_xopen_extension=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  cf_cv_need_xopen_extension=unknown
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_func_curses_version=no
+
 fi
-rm -f conftest*
+rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
-rm -f conftest*
+rm -f core
 fi
+echo "$as_me:13721: result: $cf_cv_func_curses_version" >&5
+echo "${ECHO_T}$cf_cv_func_curses_version" >&6
+test "$cf_cv_func_curses_version" = yes && cat >>confdefs.h <<\EOF
+#define HAVE_CURSES_VERSION 1
+EOF
 
-echo "$ac_t""$cf_cv_need_xopen_extension" 1>&6
-test $cf_cv_need_xopen_extension = yes && CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"
-
+echo "$as_me:13727: checking for ncurses wrap-prefix" >&5
+echo $ECHO_N "checking for ncurses wrap-prefix... $ECHO_C" >&6
 
-echo $ac_n "checking for term.h""... $ac_c" 1>&6
-echo "configure:7206: checking for term.h" >&5
-if eval "test \"`echo '$''{'cf_cv_term_header'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+# Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
+if test "${with_ncurses_wrap_prefix+set}" = set; then
+  withval="$with_ncurses_wrap_prefix"
+  NCURSES_WRAP_PREFIX=$withval
+else
+  NCURSES_WRAP_PREFIX=_nc_
+fi;
+echo "$as_me:13737: result: $NCURSES_WRAP_PREFIX" >&5
+echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
+
+echo "$as_me:13740: checking for alternate character set array" >&5
+echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
+if test "${cf_cv_curses_acs_map+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  
 
-# If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
-# for <term.h> if we do not find the variant.
-for cf_header in \
-	`echo ${cf_cv_ncurses_header-curses.h} | sed -e 's%/.*%/%'`term.h \
-	term.h
+cf_cv_curses_acs_map=unknown
+for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
 do
-	cat > conftest.$ac_ext <<EOF
-#line 7219 "configure"
+cat >conftest.$ac_ext <<_ACEOF
+#line 13750 "configure"
 #include "confdefs.h"
 
-#include <${cf_cv_ncurses_header-curses.h}>
-#include <${cf_header}>
-int main() {
-WINDOW *x
-; return 0; }
-EOF
-if { (eval echo configure:7228: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
-  cf_cv_term_header=$cf_header
-	 break
+#include <${cf_cv_ncurses_header:-curses.h}>
+
+int
+main ()
+{
+
+$name['k'] = ACS_PLUS
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:13766: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:13769: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:13772: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:13775: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_curses_acs_map=$name; break
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  cf_cv_term_header=no
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
 fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 done
 
 fi
+echo "$as_me:13786: result: $cf_cv_curses_acs_map" >&5
+echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
 
-echo "$ac_t""$cf_cv_term_header" 1>&6
-
-case $cf_cv_term_header in #(vi
-term.h) #(vi
-	cat >> confdefs.h <<\EOF
-#define HAVE_TERM_H 1
-EOF
-
-	;;
-ncurses/term.h)
-	cat >> confdefs.h <<\EOF
-#define HAVE_NCURSES_TERM_H 1
-EOF
-
-	;;
-ncursesw/term.h)
-	cat >> confdefs.h <<\EOF
-#define HAVE_NCURSESW_TERM_H 1
+test "$cf_cv_curses_acs_map" != unknown && cat >>confdefs.h <<EOF
+#define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
 EOF
 
-	;;
-esac
+echo "$as_me:13793: checking for wide alternate character set array" >&5
+echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
+if test "${cf_cv_curses_wacs_map+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
 
+	cf_cv_curses_wacs_map=unknown
+	for name in wacs_map _wacs_map __wacs_map _nc_wacs
+	do
+	cat >conftest.$ac_ext <<_ACEOF
+#line 13803 "configure"
+#include "confdefs.h"
 
+#ifndef _XOPEN_SOURCE_EXTENDED
+#define _XOPEN_SOURCE_EXTENDED
+#endif
+#include <${cf_cv_ncurses_header:-curses.h}>
+int
+main ()
+{
+$name['k'] = *WACS_PLUS
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:13819: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:13822: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:13825: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:13828: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_curses_wacs_map=$name
+	 break
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+	done
+fi
+echo "$as_me:13839: result: $cf_cv_curses_wacs_map" >&5
+echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
 
+echo "$as_me:13842: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
+echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line 13845 "configure"
+#include "confdefs.h"
 
-for cf_func in \
-chgat \
-color_set \
-filter \
-getbegx \
-getcurx \
-getmaxx \
-getnstr \
-getparx \
-getwin \
-mvvline \
-mvwvline \
-napms \
-putwin \
-resize_term \
-resizeterm \
-ripoffline \
-setupterm \
-slk_color \
-slk_init \
-termattrs \
-tgetent \
-tigetnum \
-tigetstr \
-typeahead \
-use_default_colors \
-vsscanf \
-wchgat \
-winsstr \
-wresize \
+#ifndef _XOPEN_SOURCE_EXTENDED
+#define _XOPEN_SOURCE_EXTENDED
+#endif
+#include <${cf_cv_ncurses_header:-curses.h}>
+int
+main ()
+{
 
-do
-	
-cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
+attr_t foo
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:13863: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:13866: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:13869: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:13872: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_result=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_result=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:13881: result: $cf_result" >&5
+echo "${ECHO_T}$cf_result" >&6
+if test $cf_result = yes ; then
+
+cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
 
-	echo $ac_n "checking for ${cf_func}""... $ac_c" 1>&6
-echo "configure:7305: checking for ${cf_func}" >&5
-	
-echo "${as_me-configure}:7307: testing ${cf_func} ..." 1>&5
+	cat >>confdefs.h <<EOF
+#define $cf_result 1
+EOF
 
-	if eval "test \"`echo '$''{'cf_cv_func_$cf_func'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
 else
-  
-		eval cf_result='$ac_cv_func_'$cf_func
-		if test ".$cf_result" != ".no"; then
-			cat > conftest.$ac_ext <<EOF
-#line 7316 "configure"
+	cat >>confdefs.h <<EOF
+#define attr_t long
+EOF
+
+fi
+
+# This is needed on Tru64 5.0 to declare mbstate_t
+echo "$as_me:13899: checking if we must include wchar.h to declare mbstate_t" >&5
+echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
+if test "${cf_cv_mbstate_t+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+cat >conftest.$ac_ext <<_ACEOF
+#line 13906 "configure"
 #include "confdefs.h"
 
-#ifdef HAVE_XCURSES
-#include <xcurses.h>
-char * XCursesProgramName = "test";
-#else
-#include <${cf_cv_ncurses_header-curses.h}>
-#if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
-#include <ncursesw/term.h>
-#else
-#if defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
-#include <ncurses/term.h>
-#else
-#ifdef HAVE_TERM_H
-#include <term.h>
-#endif
-#endif
-#endif
+#include <stdlib.h>
+#include <stdarg.h>
+#include <stdio.h>
+#ifdef HAVE_LIBUTF8_H
+#include <libutf8.h>
 #endif
-int main() {
+int
+main ()
+{
+mbstate_t state
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:13924: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:13927: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:13930: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:13933: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_mbstate_t=no
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cat >conftest.$ac_ext <<_ACEOF
+#line 13940 "configure"
+#include "confdefs.h"
 
-#ifndef ${cf_func}
-long foo = (long)(&${cf_func});
-${cf_cv_main_return-return}(foo == 0);
+#include <stdlib.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <wchar.h>
+#ifdef HAVE_LIBUTF8_H
+#include <libutf8.h>
 #endif
-			
-; return 0; }
-EOF
-if { (eval echo configure:7345: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  cf_result=yes
+int
+main ()
+{
+mbstate_t value
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:13959: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:13962: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:13965: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:13968: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_mbstate_t=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  cf_result=no
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_mbstate_t=unknown
 fi
-rm -f conftest*
-		fi
-		eval 'cf_cv_func_'$cf_func'=$cf_result'
-	
+rm -f conftest.$ac_objext conftest.$ac_ext
 fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:13980: result: $cf_cv_mbstate_t" >&5
+echo "${ECHO_T}$cf_cv_mbstate_t" >&6
 
-	# use the computed/retrieved cache-value:
-	eval 'cf_result=$cf_cv_func_'$cf_func
-	echo "$ac_t""$cf_result" 1>&6
-	if test $cf_result != no; then
-		cat >> confdefs.h <<EOF
-#define HAVE_${cf_tr_func} 1
+if test "$cf_cv_mbstate_t" = yes ; then
+	cat >>confdefs.h <<\EOF
+#define NEED_WCHAR_H 1
 EOF
 
-	fi
-done
+	NEED_WCHAR_H=1
+fi
 
+# if we do not find mbstate_t in either place, use substitution to provide a fallback.
+if test "$cf_cv_mbstate_t" = unknown ; then
+	NCURSES_MBSTATE_T=1
+fi
+
+# if we find mbstate_t in either place, use substitution to provide a fallback.
+if test "$cf_cv_mbstate_t" != unknown ; then
+	NCURSES_OK_MBSTATE_T=1
+fi
 
-echo $ac_n "checking for ncurses extended functions""... $ac_c" 1>&6
-echo "configure:7373: checking for ncurses extended functions" >&5
-if eval "test \"`echo '$''{'cf_cv_ncurses_ext_funcs'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+# This is needed on Tru64 5.0 to declare wchar_t
+echo "$as_me:14002: checking if we must include wchar.h to declare wchar_t" >&5
+echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
+if test "${cf_cv_wchar_t+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  
-cat > conftest.$ac_ext <<EOF
-#line 7379 "configure"
+
+cat >conftest.$ac_ext <<_ACEOF
+#line 14009 "configure"
 #include "confdefs.h"
 
-#include <${cf_cv_ncurses_header-curses.h}>
-int main() {
+#include <stdlib.h>
+#include <stdarg.h>
+#include <stdio.h>
+#ifdef HAVE_LIBUTF8_H
+#include <libutf8.h>
+#endif
+int
+main ()
+{
+wchar_t state
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:14027: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:14030: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:14033: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:14036: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_wchar_t=no
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cat >conftest.$ac_ext <<_ACEOF
+#line 14043 "configure"
+#include "confdefs.h"
 
-	(void) assume_default_colors (0, 0);
-	(void) curses_version ();
-	(void) define_key (0, 0);
-	(void) is_term_resized (0, 0);
-	(void) key_defined (0);
-	(void) keybound (0, 0);
-	(void) keyok (0, 0);
-	(void) resize_term (0, 0);
-	(void) resizeterm (0, 0);
-	(void) use_default_colors ();
-	(void) use_extended_names (0);
-	(void) wresize (0, 0, 0);
-; return 0; }
-EOF
-if { (eval echo configure:7399: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  cf_cv_ncurses_ext_funcs=yes
+#include <stdlib.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <wchar.h>
+#ifdef HAVE_LIBUTF8_H
+#include <libutf8.h>
+#endif
+int
+main ()
+{
+wchar_t value
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:14062: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:14065: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:14068: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:14071: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_wchar_t=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  cf_cv_ncurses_ext_funcs=no
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_wchar_t=unknown
 fi
-rm -f conftest*
-
+rm -f conftest.$ac_objext conftest.$ac_ext
 fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:14083: result: $cf_cv_wchar_t" >&5
+echo "${ECHO_T}$cf_cv_wchar_t" >&6
 
-echo "$ac_t""$cf_cv_ncurses_ext_funcs" 1>&6
-test "$cf_cv_ncurses_ext_funcs" != no && cat >> confdefs.h <<\EOF
-#define NCURSES_EXT_FUNCS 1
+if test "$cf_cv_wchar_t" = yes ; then
+	cat >>confdefs.h <<\EOF
+#define NEED_WCHAR_H 1
 EOF
 
+	NEED_WCHAR_H=1
+fi
+
+# if we do not find wchar_t in either place, use substitution to provide a fallback.
+if test "$cf_cv_wchar_t" = unknown ; then
+	NCURSES_WCHAR_T=1
+fi
+
+# if we find wchar_t in either place, use substitution to provide a fallback.
+if test "$cf_cv_wchar_t" != unknown ; then
+	NCURSES_OK_WCHAR_T=1
+fi
 
-echo $ac_n "checking for wide-character functions""... $ac_c" 1>&6
-echo "configure:7419: checking for wide-character functions" >&5
-if eval "test \"`echo '$''{'cf_cv_widechar_funcs'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+# This is needed on Tru64 5.0 to declare wint_t
+echo "$as_me:14105: checking if we must include wchar.h to declare wint_t" >&5
+echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
+if test "${cf_cv_wint_t+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  
-cat > conftest.$ac_ext <<EOF
-#line 7425 "configure"
+
+cat >conftest.$ac_ext <<_ACEOF
+#line 14112 "configure"
 #include "confdefs.h"
 
-#include <${cf_cv_ncurses_header-curses.h}>
-int main() {
+#include <stdlib.h>
+#include <stdarg.h>
+#include <stdio.h>
+#ifdef HAVE_LIBUTF8_H
+#include <libutf8.h>
+#endif
+int
+main ()
+{
+wint_t state
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:14130: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:14133: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:14136: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:14139: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_wint_t=no
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cat >conftest.$ac_ext <<_ACEOF
+#line 14146 "configure"
+#include "confdefs.h"
 
-	static wchar_t src_wchar[2];
-	static cchar_t dst_cchar;
-	setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
-	
-; return 0; }
-EOF
-if { (eval echo configure:7437: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  cf_cv_widechar_funcs=yes
+#include <stdlib.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <wchar.h>
+#ifdef HAVE_LIBUTF8_H
+#include <libutf8.h>
+#endif
+int
+main ()
+{
+wint_t value
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:14165: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:14168: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:14171: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:14174: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_wint_t=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  cf_cv_widechar_funcs=no
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_wint_t=unknown
 fi
-rm -f conftest*
-
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
 fi
+echo "$as_me:14186: result: $cf_cv_wint_t" >&5
+echo "${ECHO_T}$cf_cv_wint_t" >&6
 
-echo "$ac_t""$cf_cv_widechar_funcs" 1>&6
-if test "$cf_cv_widechar_funcs" != no ; then
-	cat >> confdefs.h <<\EOF
-#define USE_WIDEC_SUPPORT 1
+if test "$cf_cv_wint_t" = yes ; then
+	cat >>confdefs.h <<\EOF
+#define NEED_WCHAR_H 1
 EOF
 
-else
-	cat >> confdefs.h <<\EOF
-#define USE_WIDEC_SUPPORT 0
-EOF
+	NEED_WCHAR_H=1
+fi
 
+# if we do not find wint_t in either place, use substitution to provide a fallback.
+if test "$cf_cv_wint_t" = unknown ; then
+	NCURSES_WINT_T=1
 fi
 
+# if we find wint_t in either place, use substitution to provide a fallback.
+if test "$cf_cv_wint_t" != unknown ; then
+	NCURSES_OK_WINT_T=1
+fi
 
-echo $ac_n "checking if sys/time.h works with sys/select.h""... $ac_c" 1>&6
-echo "configure:7465: checking if sys/time.h works with sys/select.h" >&5
-if eval "test \"`echo '$''{'cf_cv_sys_time_select'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  
-cat > conftest.$ac_ext <<EOF
-#line 7471 "configure"
+if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
+
+echo "$as_me:14209: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
+echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line 14212 "configure"
 #include "confdefs.h"
 
-#include <sys/types.h>
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-#ifdef HAVE_SYS_SELECT_H
-#include <sys/select.h>
+#ifndef _XOPEN_SOURCE_EXTENDED
+#define _XOPEN_SOURCE_EXTENDED
 #endif
+#include <${cf_cv_ncurses_header:-curses.h}>
+int
+main ()
+{
 
-int main() {
+mbstate_t foo
 
-; return 0; }
-EOF
-if { (eval echo configure:7486: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
-  cf_cv_sys_time_select=yes
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:14230: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:14233: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:14236: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:14239: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_result=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  cf_cv_sys_time_select=no
-fi
-rm -f conftest*
-     
-fi
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_result=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:14248: result: $cf_result" >&5
+echo "${ECHO_T}$cf_result" >&6
+if test $cf_result = yes ; then
 
-echo "$ac_t""$cf_cv_sys_time_select" 1>&6
-test "$cf_cv_sys_time_select" = yes && cat >> confdefs.h <<\EOF
-#define HAVE_SYS_TIME_SELECT 1
+cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
+
+	cat >>confdefs.h <<EOF
+#define $cf_result 1
+EOF
+
+else
+	cat >>confdefs.h <<EOF
+#define mbstate_t long
 EOF
 
+fi
 
+fi
 
-echo $ac_n "checking for function curses_version""... $ac_c" 1>&6
-echo "configure:7507: checking for function curses_version" >&5
-if eval "test \"`echo '$''{'cf_cv_func_curses_version'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  
-if test "$cross_compiling" = yes; then
-  cf_cv_func_curses_version=unknown
-else
-  cat > conftest.$ac_ext <<EOF
-#line 7516 "configure"
+if test "$NCURSES_OK_WCHAR_T" = 0 ; then
+
+echo "$as_me:14269: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
+echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line 14272 "configure"
 #include "confdefs.h"
 
-#include <${cf_cv_ncurses_header-curses.h}>
-int main()
+#ifndef _XOPEN_SOURCE_EXTENDED
+#define _XOPEN_SOURCE_EXTENDED
+#endif
+#include <${cf_cv_ncurses_header:-curses.h}>
+int
+main ()
 {
-	char temp[1024];
-	sprintf(temp, "%s\n", curses_version());
-	${cf_cv_main_return-return}(0);
+
+wchar_t foo
+
+  ;
+  return 0;
 }
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:14290: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:14293: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:14296: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:14299: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_result=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_result=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:14308: result: $cf_result" >&5
+echo "${ECHO_T}$cf_result" >&6
+if test $cf_result = yes ; then
 
+cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
+
+	cat >>confdefs.h <<EOF
+#define $cf_result 1
 EOF
-if { (eval echo configure:7528: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
-  cf_cv_func_curses_version=yes
 
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -fr conftest*
-  cf_cv_func_curses_version=no
+	cat >>confdefs.h <<EOF
+#define wchar_t long
+EOF
 
 fi
-rm -fr conftest*
-fi
 
-rm -f core
 fi
 
-echo "$ac_t""$cf_cv_func_curses_version" 1>&6
-test "$cf_cv_func_curses_version" = yes && cat >> confdefs.h <<\EOF
-#define HAVE_CURSES_VERSION 1
-EOF
-
-
+if test "$NCURSES_OK_WINT_T" = 0 ; then
 
-echo $ac_n "checking for alternate character set array""... $ac_c" 1>&6
-echo "configure:7553: checking for alternate character set array" >&5
-if eval "test \"`echo '$''{'cf_cv_curses_acs_map'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  
-cf_cv_curses_acs_map=unknown
-for name in acs_map _acs_map __acs_map _nc_acs_map
-do
-cat > conftest.$ac_ext <<EOF
-#line 7562 "configure"
+echo "$as_me:14329: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
+echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line 14332 "configure"
 #include "confdefs.h"
 
-#include <${cf_cv_ncurses_header-curses.h}>
+#ifndef _XOPEN_SOURCE_EXTENDED
+#define _XOPEN_SOURCE_EXTENDED
+#endif
+#include <${cf_cv_ncurses_header:-curses.h}>
+int
+main ()
+{
 
-int main() {
+wint_t foo
 
-$name['k'] = ACS_PLUS
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:14350: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:14353: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:14356: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:14359: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_result=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_result=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:14368: result: $cf_result" >&5
+echo "${ECHO_T}$cf_result" >&6
+if test $cf_result = yes ; then
+
+cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
 
-; return 0; }
+	cat >>confdefs.h <<EOF
+#define $cf_result 1
 EOF
-if { (eval echo configure:7573: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  cf_cv_curses_acs_map=$name; break
+
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
+	cat >>confdefs.h <<EOF
+#define wint_t long
+EOF
+
 fi
-rm -f conftest*
-done
 
 fi
 
-echo "$ac_t""$cf_cv_curses_acs_map" 1>&6
+echo "$as_me:14387: checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
+echo $ECHO_N "checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line 14390 "configure"
+#include "confdefs.h"
 
-test "$cf_cv_curses_acs_map" != unknown && cat >> confdefs.h <<EOF
-#define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
+#ifdef HAVE_XCURSES
+#include <xcurses.h>
+char * XCursesProgramName = "test";
+#else
+#include <${cf_cv_ncurses_header:-curses.h}>
+#if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
+#include <ncursesw/term.h>
+#elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
+#include <ncurses/term.h>
+#elif defined(HAVE_TERM_H)
+#include <term.h>
+#endif
+#endif
+
+int
+main ()
+{
+
+void *foo = &(boolnames)
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:14418: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:14421: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:14424: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:14427: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_result=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_result=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:14436: result: $cf_result" >&5
+echo "${ECHO_T}$cf_result" >&6
+if test $cf_result = yes ; then
+
+cf_result=`echo "have_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
+
+	cat >>confdefs.h <<EOF
+#define $cf_result 1
 EOF
 
+else
+	echo "$as_me:14447: checking for data boolnames in library" >&5
+echo $ECHO_N "checking for data boolnames in library... $ECHO_C" >&6
+	cat >conftest.$ac_ext <<_ACEOF
+#line 14450 "configure"
+#include "confdefs.h"
+
+#ifdef HAVE_XCURSES
+#include <xcurses.h>
+char * XCursesProgramName = "test";
+#else
+#include <${cf_cv_ncurses_header:-curses.h}>
+#if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
+#include <ncursesw/term.h>
+#elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
+#include <ncurses/term.h>
+#elif defined(HAVE_TERM_H)
+#include <term.h>
+#endif
+#endif
+
+extern char boolnames;
+int
+main ()
+{
 
+	do {
+		void *foo = &(boolnames);
+		${cf_cv_main_return:-return}(foo == 0);
+	} while (0)
 
-echo $ac_n "checking for wide alternate character set array""... $ac_c" 1>&6
-echo "configure:7594: checking for wide alternate character set array" >&5
-if eval "test \"`echo '$''{'cf_cv_curses_wacs_map'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:14482: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:14485: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:14488: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:14491: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_result=yes
 else
-  
-	cf_cv_curses_wacs_map=unknown
-	for name in wacs_map _wacs_map __wacs_map _nc_wacs
-	do
-	cat > conftest.$ac_ext <<EOF
-#line 7603 "configure"
-#include "confdefs.h"
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_result=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+	echo "$as_me:14500: result: $cf_result" >&5
+echo "${ECHO_T}$cf_result" >&6
+	if test $cf_result = yes ; then
 
-#ifndef _XOPEN_SOURCE_EXTENDED
-#define _XOPEN_SOURCE_EXTENDED
-#endif
-#include <${cf_cv_ncurses_header-curses.h}>
-int main() {
-$name['k'] = *WACS_PLUS
-; return 0; }
-EOF
-if { (eval echo configure:7614: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  cf_cv_curses_wacs_map=$name
-	 break
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-fi
-rm -f conftest*
-	done
-fi
+cf_result=`echo "decl_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
 
-echo "$ac_t""$cf_cv_curses_wacs_map" 1>&6
+		cat >>confdefs.h <<EOF
+#define $cf_result 1
+EOF
 
+	fi
+fi
 
-echo $ac_n "checking for type attr_t in ${cf_cv_ncurses_header-curses.h}""... $ac_c" 1>&6
-echo "configure:7630: checking for type attr_t in ${cf_cv_ncurses_header-curses.h}" >&5
-cat > conftest.$ac_ext <<EOF
-#line 7632 "configure"
+echo "$as_me:14513: checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
+echo $ECHO_N "checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line 14516 "configure"
 #include "confdefs.h"
 
-#ifndef _XOPEN_SOURCE_EXTENDED
-#define _XOPEN_SOURCE_EXTENDED
+#ifdef HAVE_XCURSES
+#include <xcurses.h>
+char * XCursesProgramName = "test";
+#else
+#include <${cf_cv_ncurses_header:-curses.h}>
+#if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
+#include <ncursesw/term.h>
+#elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
+#include <ncurses/term.h>
+#elif defined(HAVE_TERM_H)
+#include <term.h>
+#endif
 #endif
-#include <${cf_cv_ncurses_header-curses.h}>
-int main() {
 
-attr_t foo
+int
+main ()
+{
 
-; return 0; }
-EOF
-if { (eval echo configure:7645: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
+void *foo = &(boolfnames)
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:14544: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:14547: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:14550: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:14553: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   cf_result=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  cf_result=no
-fi
-rm -f conftest*
-echo "$ac_t""$cf_result" 1>&6
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_result=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:14562: result: $cf_result" >&5
+echo "${ECHO_T}$cf_result" >&6
 if test $cf_result = yes ; then
-	
-cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
 
-	cat >> confdefs.h <<EOF
+cf_result=`echo "have_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
+
+	cat >>confdefs.h <<EOF
 #define $cf_result 1
 EOF
 
 else
-	cat >> confdefs.h <<EOF
-#define attr_t long
-EOF
-
-fi
-
-
-echo $ac_n "checking for type mbstate_t in ${cf_cv_ncurses_header-curses.h}""... $ac_c" 1>&6
-echo "configure:7673: checking for type mbstate_t in ${cf_cv_ncurses_header-curses.h}" >&5
-cat > conftest.$ac_ext <<EOF
-#line 7675 "configure"
+	echo "$as_me:14573: checking for data boolfnames in library" >&5
+echo $ECHO_N "checking for data boolfnames in library... $ECHO_C" >&6
+	cat >conftest.$ac_ext <<_ACEOF
+#line 14576 "configure"
 #include "confdefs.h"
 
-#ifndef _XOPEN_SOURCE_EXTENDED
-#define _XOPEN_SOURCE_EXTENDED
+#ifdef HAVE_XCURSES
+#include <xcurses.h>
+char * XCursesProgramName = "test";
+#else
+#include <${cf_cv_ncurses_header:-curses.h}>
+#if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
+#include <ncursesw/term.h>
+#elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
+#include <ncurses/term.h>
+#elif defined(HAVE_TERM_H)
+#include <term.h>
+#endif
 #endif
-#include <${cf_cv_ncurses_header-curses.h}>
-int main() {
 
-mbstate_t foo
+extern char boolfnames;
+int
+main ()
+{
 
-; return 0; }
-EOF
-if { (eval echo configure:7688: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-  rm -rf conftest*
+	do {
+		void *foo = &(boolfnames);
+		${cf_cv_main_return:-return}(foo == 0);
+	} while (0)
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:14608: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:14611: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:14614: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:14617: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   cf_result=yes
 else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  cf_result=no
-fi
-rm -f conftest*
-echo "$ac_t""$cf_result" 1>&6
-if test $cf_result = yes ; then
-	
-cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_result=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+	echo "$as_me:14626: result: $cf_result" >&5
+echo "${ECHO_T}$cf_result" >&6
+	if test $cf_result = yes ; then
 
-	cat >> confdefs.h <<EOF
-#define $cf_result 1
-EOF
+cf_result=`echo "decl_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
 
-else
-	cat >> confdefs.h <<EOF
-#define mbstate_t long
+		cat >>confdefs.h <<EOF
+#define $cf_result 1
 EOF
 
+	fi
 fi
 
-
 TEST_ARGS="$LIBS"
 LIBS=
 
-
-trap '' 1 2 15
-cat > confcache <<\EOF
+ac_config_files="$ac_config_files Makefile"
+ac_config_commands="$ac_config_commands default"
+cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
 # tests run on this system so they can be shared between configure
-# scripts and configure runs.  It is not useful on other systems.
-# If it contains results you don't want to keep, you may remove or edit it.
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems.  If it contains results you don't
+# want to keep, you may remove or edit it.
 #
-# By default, configure uses ./config.cache as the cache file,
-# creating it if it does not exist already.  You can give configure
-# the --cache-file=FILE option to use a different cache file; that is
-# what configure does when it calls configure scripts in
-# subdirectories, so they share the cache.
-# Giving --cache-file=/dev/null disables caching, for debugging configure.
-# config.status only pays attention to the cache file if you give it the
-# --recheck option to rerun configure.
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
 #
-EOF
+# `ac_cv_env_foo' variables (set or unset) will be overriden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
 # The following way of writing the cache mishandles newlines in values,
 # but we know of no workaround that is simple, portable, and efficient.
 # So, don't put newlines in cache variables' values.
 # Ultrix sh set writes to stderr and can't be redirected directly,
 # and sets the high bit in the cache file unless we assign to the vars.
-(set) 2>&1 |
-  case `(ac_space=' '; set | grep ac_space) 2>&1` in
-  *ac_space=\ *)
-    # `set' does not quote correctly, so add quotes (double-quote substitution
-    # turns \\\\ into \\, and sed turns \\ into \).
-    sed -n \
-      -e "s/'/'\\\\''/g" \
-      -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
-    ;;
-  *)
-    # `set' quotes correctly as required by POSIX, so do not add quotes.
-    sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
-    ;;
-  esac >> confcache
-if cmp -s $cache_file confcache; then
-  :
-else
+{
+  (set) 2>&1 |
+    case `(ac_space=' '; set | grep ac_space) 2>&1` in
+    *ac_space=\ *)
+      # `set' does not quote correctly, so add quotes (double-quote
+      # substitution turns \\\\ into \\, and sed turns \\ into \).
+      sed -n \
+        "s/'/'\\\\''/g;
+    	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+      ;;
+    *)
+      # `set' quotes correctly as required by POSIX, so do not add quotes.
+      sed -n \
+        "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+      ;;
+    esac;
+} |
+  sed '
+     t clear
+     : clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+     : end' >>confcache
+if cmp -s $cache_file confcache; then :; else
   if test -w $cache_file; then
-    echo "updating cache $cache_file"
-    cat confcache > $cache_file
+    test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
+    cat confcache >$cache_file
   else
     echo "not updating unwritable cache $cache_file"
   fi
 fi
 rm -f confcache
 
-trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
-
 test "x$prefix" = xNONE && prefix=$ac_default_prefix
 # Let make expand exec_prefix.
 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
 
-# Any assignment to VPATH causes Sun make to only execute
-# the first set of double-colon rules, so remove it if not needed.
-# If there is a colon in the path, we need to keep it.
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
 if test "x$srcdir" = x.; then
-  ac_vpsub='/^[ 	]*VPATH[ 	]*=[^:]*$/d'
+  ac_vpsub='/^[ 	]*VPATH[ 	]*=/{
+s/:*\$(srcdir):*/:/;
+s/:*\${srcdir}:*/:/;
+s/:*@srcdir@:*/:/;
+s/^\([^=]*=[ 	]*\):*/\1/;
+s/:*$//;
+s/^[^=]*=[ 	]*$//;
+}'
 fi
 
-trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
-
 DEFS=-DHAVE_CONFIG_H
 
-# Without the "./", some shells look in PATH for config.status.
 : ${CONFIG_STATUS=./config.status}
-
-echo creating $CONFIG_STATUS
-rm -f $CONFIG_STATUS
-cat > $CONFIG_STATUS <<EOF
-#! /bin/sh
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ echo "$as_me:14723: creating $CONFIG_STATUS" >&5
+echo "$as_me: creating $CONFIG_STATUS" >&6;}
+cat >$CONFIG_STATUS <<_ACEOF
+#! $SHELL
 # Generated automatically by configure.
 # Run this file to recreate the current configuration.
-# This directory was configured as follows,
-# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-#
-# $0 $ac_configure_args
-#
 # Compiler output produced by configure, useful for debugging
-# configure, is in ./config.log if it exists.
+# configure, is in config.log if it exists.
 
-ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
-for ac_option
+debug=false
+SHELL=\${CONFIG_SHELL-$SHELL}
+ac_cs_invocation="\$0 \$@"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+  set -o posix
+fi
+
+# Name of the executable.
+as_me=`echo "$0" |sed 's,.*[\\/],,'`
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+  # We could just check for DJGPP; but this test a) works b) is more generic
+  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+  if test -f conf$$.exe; then
+    # Don't use ln at all; we don't have any links
+    as_ln_s='cp -p'
+  else
+    as_ln_s='ln -s'
+  fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s=ln
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
+
+as_executable_p="test -f"
+
+# Support unset when possible.
+if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+# NLS nuisances.
+$as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
+$as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
+$as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
+$as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
+$as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
+$as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
+$as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
+$as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
+
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" 	$as_nl"
+
+# CDPATH.
+$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
+
+exec 6>&1
+
+_ACEOF
+
+# Files that config.status was made for.
+if test -n "$ac_config_files"; then
+  echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_headers"; then
+  echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_links"; then
+  echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_commands"; then
+  echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
+fi
+
+cat >>$CONFIG_STATUS <<\EOF
+
+ac_cs_usage="\
+\`$as_me' instantiates files from templates according to the
+current configuration.
+
+Usage: $0 [OPTIONS] [FILE]...
+
+  -h, --help       print this help, then exit
+  -V, --version    print version number, then exit
+  -d, --debug      don't remove temporary files
+      --recheck    update $as_me by reconfiguring in the same conditions
+  --file=FILE[:TEMPLATE]
+                   instantiate the configuration file FILE
+  --header=FILE[:TEMPLATE]
+                   instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Configuration commands:
+$config_commands
+
+Report bugs to <dickey@invisible-island.net>."
+EOF
+
+cat >>$CONFIG_STATUS <<EOF
+ac_cs_version="\\
+config.status
+configured by $0, generated by GNU Autoconf 2.52.20101001,
+  with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
+Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+srcdir=$srcdir
+INSTALL="$INSTALL"
+EOF
+
+cat >>$CONFIG_STATUS <<\EOF
+# If no file are specified by the user, then we need to provide default
+# value.  By we need to know if files were specified by the user.
+ac_need_defaults=:
+while test $# != 0
 do
-  case "\$ac_option" in
+  case $1 in
+  --*=*)
+    ac_option=`expr "x$1" : 'x\([^=]*\)='`
+    ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
+    shift
+    set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
+    shift
+    ;;
+  -*);;
+  *) # This is not an option, so the user has probably given explicit
+     # arguments.
+     ac_need_defaults=false;;
+  esac
+
+  case $1 in
+  # Handling of the options.
+EOF
+cat >>$CONFIG_STATUS <<EOF
   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
-    echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
-    exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
-  -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
-    echo "$CONFIG_STATUS generated by autoconf version 2.13.20030927"
-    exit 0 ;;
-  -help | --help | --hel | --he | --h)
-    echo "\$ac_cs_usage"; exit 0 ;;
-  *) echo "\$ac_cs_usage"; exit 1 ;;
+    echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
+    exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
+EOF
+cat >>$CONFIG_STATUS <<\EOF
+  --version | --vers* | -V )
+    echo "$ac_cs_version"; exit 0 ;;
+  --he | --h)
+    # Conflict between --help and --header
+    { { echo "$as_me:14899: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&2;}
+   { (exit 1); exit 1; }; };;
+  --help | --hel | -h )
+    echo "$ac_cs_usage"; exit 0 ;;
+  --debug | --d* | -d )
+    debug=: ;;
+  --file | --fil | --fi | --f )
+    shift
+    CONFIG_FILES="$CONFIG_FILES $1"
+    ac_need_defaults=false;;
+  --header | --heade | --head | --hea )
+    shift
+    CONFIG_HEADERS="$CONFIG_HEADERS $1"
+    ac_need_defaults=false;;
+
+  # This is an error.
+  -*) { { echo "$as_me:14918: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&2;}
+   { (exit 1); exit 1; }; } ;;
+
+  *) ac_config_targets="$ac_config_targets $1" ;;
+
   esac
+  shift
 done
 
-ac_given_srcdir=$srcdir
+exec 5>>config.log
+cat >&5 << _ACEOF
 
-trap 'rm -fr `echo "Makefile ncurses_cfg.h:ncurses_tst.hin" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
-EOF
-cat >> $CONFIG_STATUS <<EOF
+## ----------------------- ##
+## Running config.status.  ##
+## ----------------------- ##
 
-# Protect against being on the right side of a sed subst in config.status.
-sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
- s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
-$ac_vpsub
-$extrasub
-s%@SHELL@%$SHELL%g
-s%@CFLAGS@%$CFLAGS%g
-s%@CPPFLAGS@%$CPPFLAGS%g
-s%@CXXFLAGS@%$CXXFLAGS%g
-s%@FFLAGS@%$FFLAGS%g
-s%@DEFS@%$DEFS%g
-s%@LDFLAGS@%$LDFLAGS%g
-s%@LIBS@%$LIBS%g
-s%@exec_prefix@%$exec_prefix%g
-s%@prefix@%$prefix%g
-s%@program_transform_name@%$program_transform_name%g
-s%@bindir@%$bindir%g
-s%@sbindir@%$sbindir%g
-s%@libexecdir@%$libexecdir%g
-s%@datadir@%$datadir%g
-s%@sysconfdir@%$sysconfdir%g
-s%@sharedstatedir@%$sharedstatedir%g
-s%@localstatedir@%$localstatedir%g
-s%@libdir@%$libdir%g
-s%@includedir@%$includedir%g
-s%@oldincludedir@%$oldincludedir%g
-s%@infodir@%$infodir%g
-s%@mandir@%$mandir%g
-s%@host@%$host%g
-s%@host_alias@%$host_alias%g
-s%@host_cpu@%$host_cpu%g
-s%@host_vendor@%$host_vendor%g
-s%@host_os@%$host_os%g
-s%@SET_MAKE@%$SET_MAKE%g
-s%@CC@%$CC%g
-s%@CPP@%$CPP%g
-s%@AWK@%$AWK%g
-s%@CC_G_OPT@%$CC_G_OPT%g
-s%@CC_SHARED_OPTS@%$CC_SHARED_OPTS%g
-s%@DFT_DEP_SUFFIX@%$DFT_DEP_SUFFIX%g
-s%@DFT_OBJ_SUBDIR@%$DFT_OBJ_SUBDIR%g
-s%@DFT_UPR_MODEL@%$DFT_UPR_MODEL%g
-s%@LD@%$LD%g
-s%@LDFLAGS_SHARED@%$LDFLAGS_SHARED%g
-s%@LDFLAGS_STATIC@%$LDFLAGS_STATIC%g
-s%@LD_MODEL@%$LD_MODEL%g
-s%@LD_SHARED_OPTS@%$LD_SHARED_OPTS%g
-s%@LIBTOOL@%$LIBTOOL%g
-s%@LIB_CLEAN@%$LIB_CLEAN%g
-s%@LIB_COMPILE@%$LIB_COMPILE%g
-s%@LIB_LINK@%$LIB_LINK%g
-s%@LINK_TESTS@%$LINK_TESTS%g
-s%@LINT@%$LINT%g
-s%@LINT_OPTS@%$LINT_OPTS%g
-s%@LOCAL_LDFLAGS@%$LOCAL_LDFLAGS%g
-s%@MATH_LIB@%$MATH_LIB%g
-s%@PTHREAD@%$PTHREAD%g
-s%@TEST_ARGS@%$TEST_ARGS%g
-s%@TEST_DEPS@%$TEST_DEPS%g
-s%@TEST_LIBS@%$TEST_LIBS%g
-s%@TINFO_ARGS@%$TINFO_ARGS%g
-s%@cf_cv_abi_version@%$cf_cv_abi_version%g
-s%@cf_cv_rel_version@%$cf_cv_rel_version%g
-s%@EXEEXT@%$EXEEXT%g
-s%@OBJEXT@%$OBJEXT%g
-s%@EXTRA_CPPFLAGS@%$EXTRA_CPPFLAGS%g
-s%@ECHO_LT@%$ECHO_LT%g
-s%@ECHO_LD@%$ECHO_LD%g
-s%@RULE_CC@%$RULE_CC%g
-s%@SHOW_CC@%$SHOW_CC%g
-s%@ECHO_CC@%$ECHO_CC%g
-s%@EXTRA_CFLAGS@%$EXTRA_CFLAGS%g
-s%@X_CFLAGS@%$X_CFLAGS%g
-s%@X_PRE_LIBS@%$X_PRE_LIBS%g
-s%@X_LIBS@%$X_LIBS%g
-s%@X_EXTRA_LIBS@%$X_EXTRA_LIBS%g
-s%@XCURSES_CONFIG@%$XCURSES_CONFIG%g
+This file was extended by $as_me 2.52.20101001, executed with
+  CONFIG_FILES    = $CONFIG_FILES
+  CONFIG_HEADERS  = $CONFIG_HEADERS
+  CONFIG_LINKS    = $CONFIG_LINKS
+  CONFIG_COMMANDS = $CONFIG_COMMANDS
+  > $ac_cs_invocation
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
 
-CEOF
+_ACEOF
 EOF
 
-cat >> $CONFIG_STATUS <<\EOF
+cat >>$CONFIG_STATUS <<EOF
+#
+# INIT-COMMANDS section.
+#
 
-# Split the substitutions into bite-sized pieces for seds with
-# small command number limits, like on Digital OSF/1 and HP-UX.
-ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
-ac_file=1 # Number of current file.
-ac_beg=1 # First line for current file.
-ac_end=$ac_max_sed_cmds # Line after last line for current file.
-ac_more_lines=:
-ac_sed_cmds=""
-while $ac_more_lines; do
-  if test $ac_beg -gt 1; then
-    sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
-  else
-    sed "${ac_end}q" conftest.subs > conftest.s$ac_file
-  fi
-  if test ! -s conftest.s$ac_file; then
-    ac_more_lines=false
-    rm -f conftest.s$ac_file
-  else
-    if test -z "$ac_sed_cmds"; then
-      ac_sed_cmds="sed -f conftest.s$ac_file"
-    else
-      ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
-    fi
-    ac_file=`expr $ac_file + 1`
-    ac_beg=$ac_end
-    ac_end=`expr $ac_end + $ac_max_sed_cmds`
-  fi
+AWK="$AWK"
+ECHO_LD="$ECHO_LD"
+
+EOF
+
+cat >>$CONFIG_STATUS <<\EOF
+for ac_config_target in $ac_config_targets
+do
+  case "$ac_config_target" in
+  # Handling of arguments.
+  "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+  "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
+  "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
+  *) { { echo "$as_me:14966: error: invalid argument: $ac_config_target" >&5
+echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
+   { (exit 1); exit 1; }; };;
+  esac
 done
-if test -z "$ac_sed_cmds"; then
-  ac_sed_cmds=cat
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used.  Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+  test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+  test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
 fi
+
+# Create a temporary directory, and hook for its removal unless debugging.
+$debug ||
+{
+  trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
+  trap '{ (exit 1); exit 1; }' 1 2 13 15
+}
+
+# Create a (secure) tmp directory for tmp files.
+: ${TMPDIR=/tmp}
+{
+  tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
+  test -n "$tmp" && test -d "$tmp"
+}  ||
+{
+  tmp=$TMPDIR/cs$$-$RANDOM
+  (umask 077 && mkdir $tmp)
+} ||
+{
+   echo "$me: cannot create a temporary directory in $TMPDIR" >&2
+   { (exit 1); exit 1; }
+}
+
+EOF
+
+cat >>$CONFIG_STATUS <<EOF
+
+#
+# CONFIG_FILES section.
+#
+
+# No need to generate the scripts if there are no CONFIG_FILES.
+# This happens for instance when ./config.status config.h
+if test -n "\$CONFIG_FILES"; then
+  # Protect against being on the right side of a sed subst in config.status.
+  sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
+   s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
+s,@SHELL@,$SHELL,;t t
+s,@exec_prefix@,$exec_prefix,;t t
+s,@prefix@,$prefix,;t t
+s,@program_transform_name@,$program_transform_name,;t t
+s,@bindir@,$bindir,;t t
+s,@sbindir@,$sbindir,;t t
+s,@libexecdir@,$libexecdir,;t t
+s,@datadir@,$datadir,;t t
+s,@sysconfdir@,$sysconfdir,;t t
+s,@sharedstatedir@,$sharedstatedir,;t t
+s,@localstatedir@,$localstatedir,;t t
+s,@libdir@,$libdir,;t t
+s,@includedir@,$includedir,;t t
+s,@oldincludedir@,$oldincludedir,;t t
+s,@infodir@,$infodir,;t t
+s,@mandir@,$mandir,;t t
+s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
+s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
+s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
+s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
+s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
+s,@build_alias@,$build_alias,;t t
+s,@host_alias@,$host_alias,;t t
+s,@target_alias@,$target_alias,;t t
+s,@ECHO_C@,$ECHO_C,;t t
+s,@ECHO_N@,$ECHO_N,;t t
+s,@ECHO_T@,$ECHO_T,;t t
+s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
+s,@DEFS@,$DEFS,;t t
+s,@LIBS@,$LIBS,;t t
+s,@build@,$build,;t t
+s,@build_cpu@,$build_cpu,;t t
+s,@build_vendor@,$build_vendor,;t t
+s,@build_os@,$build_os,;t t
+s,@host@,$host,;t t
+s,@host_cpu@,$host_cpu,;t t
+s,@host_vendor@,$host_vendor,;t t
+s,@host_os@,$host_os,;t t
+s,@SET_MAKE@,$SET_MAKE,;t t
+s,@CC@,$CC,;t t
+s,@CFLAGS@,$CFLAGS,;t t
+s,@LDFLAGS@,$LDFLAGS,;t t
+s,@CPPFLAGS@,$CPPFLAGS,;t t
+s,@ac_ct_CC@,$ac_ct_CC,;t t
+s,@EXEEXT@,$EXEEXT,;t t
+s,@OBJEXT@,$OBJEXT,;t t
+s,@CPP@,$CPP,;t t
+s,@AWK@,$AWK,;t t
+s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
+s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
+s,@INSTALL_DATA@,$INSTALL_DATA,;t t
+s,@LINT@,$LINT,;t t
+s,@LINT_OPTS@,$LINT_OPTS,;t t
+s,@CTAGS@,$CTAGS,;t t
+s,@ETAGS@,$ETAGS,;t t
+s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
+s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
+s,@MATH_LIB@,$MATH_LIB,;t t
+s,@CC_G_OPT@,$CC_G_OPT,;t t
+s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
+s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
+s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
+s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
+s,@LD@,$LD,;t t
+s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t
+s,@LDFLAGS_STATIC@,$LDFLAGS_STATIC,;t t
+s,@LD_MODEL@,$LD_MODEL,;t t
+s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
+s,@LIBTOOL@,$LIBTOOL,;t t
+s,@LIB_CLEAN@,$LIB_CLEAN,;t t
+s,@LIB_COMPILE@,$LIB_COMPILE,;t t
+s,@LIB_LINK@,$LIB_LINK,;t t
+s,@LINK_TESTS@,$LINK_TESTS,;t t
+s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
+s,@PTHREAD@,$PTHREAD,;t t
+s,@TEST_ARGS@,$TEST_ARGS,;t t
+s,@TEST_DEPS@,$TEST_DEPS,;t t
+s,@TEST_LIBS@,$TEST_LIBS,;t t
+s,@TINFO_ARGS@,$TINFO_ARGS,;t t
+s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
+s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
+s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
+s,@ECHO_LT@,$ECHO_LT,;t t
+s,@ECHO_LD@,$ECHO_LD,;t t
+s,@RULE_CC@,$RULE_CC,;t t
+s,@SHOW_CC@,$SHOW_CC,;t t
+s,@ECHO_CC@,$ECHO_CC,;t t
+s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
+s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
+s,@PKG_CONFIG@,$PKG_CONFIG,;t t
+s,@X_CFLAGS@,$X_CFLAGS,;t t
+s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
+s,@X_LIBS@,$X_LIBS,;t t
+s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
+s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
+s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
+CEOF
+
 EOF
 
-cat >> $CONFIG_STATUS <<EOF
+  cat >>$CONFIG_STATUS <<\EOF
+  # Split the substitutions into bite-sized pieces for seds with
+  # small command number limits, like on Digital OSF/1 and HP-UX.
+  ac_max_sed_lines=48
+  ac_sed_frag=1 # Number of current file.
+  ac_beg=1 # First line for current file.
+  ac_end=$ac_max_sed_lines # Line after last line for current file.
+  ac_more_lines=:
+  ac_sed_cmds=
+  while $ac_more_lines; do
+    if test $ac_beg -gt 1; then
+      sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
+    else
+      sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
+    fi
+    if test ! -s $tmp/subs.frag; then
+      ac_more_lines=false
+    else
+      # The purpose of the label and of the branching condition is to
+      # speed up the sed processing (if there are no `@' at all, there
+      # is no need to browse any of the substitutions).
+      # These are the two extra sed commands mentioned above.
+      (echo ':t
+  /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
+      if test -z "$ac_sed_cmds"; then
+  	ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
+      else
+  	ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
+      fi
+      ac_sed_frag=`expr $ac_sed_frag + 1`
+      ac_beg=$ac_end
+      ac_end=`expr $ac_end + $ac_max_sed_lines`
+    fi
+  done
+  if test -z "$ac_sed_cmds"; then
+    ac_sed_cmds=cat
+  fi
+fi # test -n "$CONFIG_FILES"
 
-CONFIG_FILES=\${CONFIG_FILES-"Makefile"}
 EOF
-cat >> $CONFIG_STATUS <<\EOF
-for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
+cat >>$CONFIG_STATUS <<\EOF
+for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
-  case "$ac_file" in
-  *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
-       ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
-  *) ac_file_in="${ac_file}.in" ;;
+  case $ac_file in
+  - | *:- | *:-:* ) # input from stdin
+        cat >$tmp/stdin
+        ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+        ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+  *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+        ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+  * )   ac_file_in=$ac_file.in ;;
   esac
 
-  # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
-
-  # Remove last slash and all that follows it.  Not all systems have dirname.
-  ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+  # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
+  ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+         X"$ac_file" : 'X\(//\)[^/]' \| \
+         X"$ac_file" : 'X\(//\)$' \| \
+         X"$ac_file" : 'X\(/\)' \| \
+         .     : '\(.\)' 2>/dev/null ||
+echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
-    # The file is in a subdirectory.
-    test ! -d "$ac_dir" && mkdir "$ac_dir"
-    ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
+    { case "$ac_dir" in
+  [\\/]* | ?:[\\/]* ) as_incr_dir=;;
+  *)                      as_incr_dir=.;;
+esac
+as_dummy="$ac_dir"
+for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
+  case $as_mkdir_dir in
+    # Skip DOS drivespec
+    ?:) as_incr_dir=$as_mkdir_dir ;;
+    *)
+      as_incr_dir=$as_incr_dir/$as_mkdir_dir
+      test -d "$as_incr_dir" || mkdir "$as_incr_dir"
+    ;;
+  esac
+done; }
+
+    ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
     # A "../" for each directory in $ac_dir_suffix.
-    ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
+    ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
   else
     ac_dir_suffix= ac_dots=
   fi
 
-  case "$ac_given_srcdir" in
-  .)  srcdir=.
-      if test -z "$ac_dots"; then top_srcdir=.
-      else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
-  /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
+  case $srcdir in
+  .)  ac_srcdir=.
+      if test -z "$ac_dots"; then
+         ac_top_srcdir=.
+      else
+         ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
+      fi ;;
+  [\\/]* | ?:[\\/]* )
+      ac_srcdir=$srcdir$ac_dir_suffix;
+      ac_top_srcdir=$srcdir ;;
   *) # Relative path.
-    srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
-    top_srcdir="$ac_dots$ac_given_srcdir" ;;
+    ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_dots$srcdir ;;
   esac
 
-
-  echo creating "$ac_file"
-  rm -f "$ac_file"
-  configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
-  case "$ac_file" in
-  *Makefile*) ac_comsub="1i\\
-# $configure_input" ;;
-  *) ac_comsub= ;;
+  case $INSTALL in
+  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+  *) ac_INSTALL=$ac_dots$INSTALL ;;
   esac
 
-  ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
-  sed -e "$ac_comsub
-s%@configure_input@%$configure_input%g
-s%@srcdir@%$srcdir%g
-s%@top_srcdir@%$top_srcdir%g
-" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
-fi; done
-rm -f conftest.s*
+  if test x"$ac_file" != x-; then
+    { echo "$as_me:15228: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+    rm -f "$ac_file"
+  fi
+  # Let's still pretend it is `configure' which instantiates (i.e., don't
+  # use $as_me), people would be surprised to read:
+  #    /* config.h.  Generated automatically by config.status.  */
+  configure_input="Generated automatically from `echo $ac_file_in |
+                                                 sed 's,.*/,,'` by configure."
+
+  # First look for the input files in the build tree, otherwise in the
+  # src tree.
+  ac_file_inputs=`IFS=:
+    for f in $ac_file_in; do
+      case $f in
+      -) echo $tmp/stdin ;;
+      [\\/$]*)
+         # Absolute (can't be DOS-style, as IFS=:)
+         test -f "$f" || { { echo "$as_me:15246: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+   { (exit 1); exit 1; }; }
+         echo $f;;
+      *) # Relative
+         if test -f "$f"; then
+           # Build tree
+           echo $f
+         elif test -f "$srcdir/$f"; then
+           # Source tree
+           echo $srcdir/$f
+         else
+           # /dev/null tree
+           { { echo "$as_me:15259: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+   { (exit 1); exit 1; }; }
+         fi;;
+      esac
+    done` || { (exit 1); exit 1; }
+EOF
+cat >>$CONFIG_STATUS <<EOF
+  sed "$ac_vpsub
+$extrasub
+EOF
+cat >>$CONFIG_STATUS <<\EOF
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s,@configure_input@,$configure_input,;t t
+s,@srcdir@,$ac_srcdir,;t t
+s,@top_srcdir@,$ac_top_srcdir,;t t
+s,@INSTALL@,$ac_INSTALL,;t t
+" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
+  rm -f $tmp/stdin
+  if test x"$ac_file" != x-; then
+    mv $tmp/out $ac_file
+  else
+    cat $tmp/out
+    rm -f $tmp/out
+  fi
+
+done
+EOF
+cat >>$CONFIG_STATUS <<\EOF
+
+#
+# CONFIG_HEADER section.
+#
 
 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
 # NAME is the cpp macro being defined and VALUE is the value it is being given.
 #
 # ac_d sets the value in "#define NAME VALUE" lines.
-ac_dA='s%^\([ 	]*\)#\([ 	]*define[ 	][ 	]*\)'
-ac_dB='\([ 	][ 	]*\)[^ 	]*%\1#\2'
-ac_dC='\3'
-ac_dD='%g'
-# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
-ac_uA='s%^\([ 	]*\)#\([ 	]*\)undef\([ 	][ 	]*\)'
-ac_uB='\([ 	]\)%\1#\2define\3'
+ac_dA='s,^\([ 	]*\)#\([ 	]*define[ 	][ 	]*\)'
+ac_dB='[ 	].*$,\1#\2'
+ac_dC=' '
+ac_dD=',;t'
+# ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
+ac_iA='s,^\([ 	]*\)#\([ 	]*\)undef\([ 	][ 	]*\)'
+ac_iB='\([ 	]\),\1#\2define\3'
+ac_iC=' '
+ac_iD='\4,;t'
+# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
+ac_uA='s,^\([ 	]*\)#\([ 	]*\)undef\([ 	][ 	]*\)'
+ac_uB='$,\1#\2define\3'
 ac_uC=' '
-ac_uD='\4%g'
-# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
-ac_eA='s%^\([ 	]*\)#\([ 	]*\)undef\([ 	][ 	]*\)'
-ac_eB='$%\1#\2define\3'
-ac_eC=' '
-ac_eD='%g'
+ac_uD=',;t'
 
-if test "${CONFIG_HEADERS+set}" != set; then
-EOF
-cat >> $CONFIG_STATUS <<EOF
-  CONFIG_HEADERS="ncurses_cfg.h:ncurses_tst.hin"
-EOF
-cat >> $CONFIG_STATUS <<\EOF
-fi
-for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
+for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
-  case "$ac_file" in
-  *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
-       ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
-  *) ac_file_in="${ac_file}.in" ;;
+  case $ac_file in
+  - | *:- | *:-:* ) # input from stdin
+        cat >$tmp/stdin
+        ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+        ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+  *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+        ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+  * )   ac_file_in=$ac_file.in ;;
   esac
 
-  echo creating $ac_file
+  test x"$ac_file" != x- && { echo "$as_me:15325: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
 
-  rm -f conftest.frag conftest.in conftest.out
-  ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
-  cat $ac_file_inputs > conftest.in
+  # First look for the input files in the build tree, otherwise in the
+  # src tree.
+  ac_file_inputs=`IFS=:
+    for f in $ac_file_in; do
+      case $f in
+      -) echo $tmp/stdin ;;
+      [\\/$]*)
+         # Absolute (can't be DOS-style, as IFS=:)
+         test -f "$f" || { { echo "$as_me:15336: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+   { (exit 1); exit 1; }; }
+         echo $f;;
+      *) # Relative
+         if test -f "$f"; then
+           # Build tree
+           echo $f
+         elif test -f "$srcdir/$f"; then
+           # Source tree
+           echo $srcdir/$f
+         else
+           # /dev/null tree
+           { { echo "$as_me:15349: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+   { (exit 1); exit 1; }; }
+         fi;;
+      esac
+    done` || { (exit 1); exit 1; }
+  # Remove the trailing spaces.
+  sed 's/[ 	]*$//' $ac_file_inputs >$tmp/in
 
 EOF
 
-
 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
 # be either 'cat' or 'sort'.
-cat confdefs.h >conftest.vals
+cat confdefs.h | uniq >conftest.vals
 
 # Break up conftest.vals because some shells have a limit on
 # the size of here documents, and old seds have small limits too.
 
 rm -f conftest.tail
 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
-while :
+while grep . conftest.vals >/dev/null
 do
-  ac_lines=`grep -c . conftest.vals`
-  # grep -c gives empty output for an empty file on some AIX systems.
-  if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
   # Write chunks of a limited-size here document to conftest.frag.
   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
-  sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
+  sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
   echo 'CEOF' >> $CONFIG_STATUS
   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
   rm -f conftest.vals
@@ -8059,82 +15379,147 @@
 done
 rm -f conftest.vals
 
-# Run sed to substitute the contents of conftest.frag into conftest.in at the
+# Run sed to substitute the contents of conftest.frag into $tmp/in at the
 # marker @DEFS@.
 echo '  cat >> conftest.edit <<CEOF
 /@DEFS@/r conftest.frag
 /@DEFS@/d
 CEOF
-sed -f conftest.edit conftest.in > conftest.out
-rm -f conftest.in
-mv conftest.out conftest.in
+sed -f conftest.edit $tmp/in > $tmp/out
+rm -f $tmp/in
+mv $tmp/out $tmp/in
 rm -f conftest.edit conftest.frag
 ' >> $CONFIG_STATUS
 
-
-cat >> $CONFIG_STATUS <<\EOF
-  rm -f conftest.frag conftest.h
-  echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
-  cat conftest.in >> conftest.h
-  rm -f conftest.in
-  if cmp -s $ac_file conftest.h 2>/dev/null; then
-    echo "$ac_file is unchanged"
-    rm -f conftest.h
+cat >>$CONFIG_STATUS <<\EOF
+  # Let's still pretend it is `configure' which instantiates (i.e., don't
+  # use $as_me), people would be surprised to read:
+  #    /* config.h.  Generated automatically by config.status.  */
+  if test x"$ac_file" = x-; then
+    echo "/* Generated automatically by configure.  */" >$tmp/config.h
   else
-    # Remove last slash and all that follows it.  Not all systems have dirname.
-      ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+    echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
+  fi
+  cat $tmp/in >>$tmp/config.h
+  rm -f $tmp/in
+  if test x"$ac_file" != x-; then
+    if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
+      { echo "$as_me:15407: $ac_file is unchanged" >&5
+echo "$as_me: $ac_file is unchanged" >&6;}
+    else
+      ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+         X"$ac_file" : 'X\(//\)[^/]' \| \
+         X"$ac_file" : 'X\(//\)$' \| \
+         X"$ac_file" : 'X\(/\)' \| \
+         .     : '\(.\)' 2>/dev/null ||
+echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
-      # The file is in a subdirectory.
-      test ! -d "$ac_dir" && mkdir "$ac_dir"
+        { case "$ac_dir" in
+  [\\/]* | ?:[\\/]* ) as_incr_dir=;;
+  *)                      as_incr_dir=.;;
+esac
+as_dummy="$ac_dir"
+for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
+  case $as_mkdir_dir in
+    # Skip DOS drivespec
+    ?:) as_incr_dir=$as_mkdir_dir ;;
+    *)
+      as_incr_dir=$as_incr_dir/$as_mkdir_dir
+      test -d "$as_incr_dir" || mkdir "$as_incr_dir"
+    ;;
+  esac
+done; }
+
+      fi
+      rm -f $ac_file
+      mv $tmp/config.h $ac_file
     fi
-    rm -f $ac_file
-    mv conftest.h $ac_file
+  else
+    cat $tmp/config.h
+    rm -f $tmp/config.h
   fi
-fi; done
-
-EOF
-cat >> $CONFIG_STATUS <<EOF
-# Extra initialization commands, if any
-
-AWK="$AWK"
-ECHO_LD="$ECHO_LD"
-
+done
 EOF
-cat >> $CONFIG_STATUS <<\EOF
-# Extra commands, if any
+cat >>$CONFIG_STATUS <<\EOF
+#
+# CONFIG_COMMANDS section.
+#
+for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
+  ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
+  ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
 
+  case $ac_dest in
+    default )
 
 for cf_dir in .
 do
 	if test ! -d $srcdir/$cf_dir; then
 		continue
 	elif test -f $srcdir/$cf_dir/programs; then
-		$AWK -f $srcdir/mk-test.awk ECHO_LINK="$ECHO_LD" $srcdir/$cf_dir/programs >>$cf_dir/Makefile
+		$AWK -f $srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD" $srcdir/$cf_dir/programs >>$cf_dir/Makefile
 	fi
 done
 
-
 	cat >>Makefile <<TEST_EOF
 
 # These rules are generated so we do not rely on suffix rules, which do not
 # work consistently for different make-programs (the '\$(MODEL)/' confuses
 # some, and the '\$x' confuses others).
 TEST_EOF
+
 LIST=`sed -e 's/[ 	].*//' -e '/^[#@]/d' $srcdir/modules`
 for N in $LIST
 do
 	cat >>Makefile <<TEST_EOF
 
-\$(MODEL)/$N.o : $N.c \\
-	test.priv.h \\
+\$(MODEL)/$N.o : \$(srcdir)/$N.c \\
+	\$(srcdir)/test.priv.h \\
 	ncurses_cfg.h
-	@echo compiling $N; \$(CC) -c \$(CFLAGS_DEFAULT) $N.c
+	@echo compiling $N; \$(CC) -c \$(CFLAGS_DEFAULT) \$(srcdir)/$N.c
+TEST_EOF
+done
+
+if test -f ../config.guess && test -f ../config.sub
+then
+	cat >>Makefile <<TEST_EOF
+
+# if we used CF_INHERIT for getting these files, we can remove them
+distclean::
+	rm -f config.guess config.sub
 TEST_EOF
+fi
+ ;;
+  esac
 done
+EOF
+
+cat >>$CONFIG_STATUS <<\EOF
 
-exit 0
+{ (exit 0); exit 0; }
 EOF
 chmod +x $CONFIG_STATUS
-rm -fr confdefs* $ac_clean_files
-test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
+ac_clean_files=$ac_clean_files_save
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded.  So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status.  When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+  ac_cs_success=:
+  exec 5>/dev/null
+  $SHELL $CONFIG_STATUS || ac_cs_success=false
+  exec 5>>config.log
+  # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+  # would make configure fail if this is the last instruction.
+  $ac_cs_success || { (exit 1); exit 1; }
+fi
 
diff -Naur ncurses-5.7.orig/test/configure.in ncurses-5.7/test/configure.in
--- ncurses-5.7.orig/test/configure.in	2008-09-06 18:10:23.000000000 -0400
+++ ncurses-5.7/test/configure.in	2011-01-08 18:18:29.610657668 -0500
@@ -1,5 +1,5 @@
 dnl***************************************************************************
-dnl Copyright (c) 1998-2007,2008 Free Software Foundation, Inc.              *
+dnl Copyright (c) 1998-2009,2010 Free Software Foundation, Inc.              *
 dnl                                                                          *
 dnl Permission is hereby granted, free of charge, to any person obtaining a  *
 dnl copy of this software and associated documentation files (the            *
@@ -28,7 +28,7 @@
 dnl
 dnl Author: Thomas E. Dickey 1996, etc.
 dnl
-dnl $Id: configure.in,v 1.67 2008/09/06 22:10:23 tom Exp $
+dnl $Id: configure.in,v 1.85 2010/11/28 16:38:04 tom Exp $
 dnl This is a simple configuration-script for the ncurses test programs that
 dnl allows the test-directory to be separately configured against a reference
 dnl system (i.e., sysvr4 curses)
@@ -46,10 +46,18 @@
 CF_INHERIT_SCRIPT(config.sub)
 CF_CHECK_CACHE
 
+AC_ARG_PROGRAM
+
 AC_PROG_MAKE_SET
 AC_PROG_CC
 AC_PROG_CPP
 AC_PROG_AWK
+CF_PROG_INSTALL
+CF_PROG_LINT
+CF_MAKE_TAGS
+
+CF_MATH_LIB(MATH_LIB,sin(x))
+AC_SUBST(MATH_LIB)
 
 dnl Things that we don't need (or must override) if we're not building ncurses
 CC_G_OPT="-g"					AC_SUBST(CC_G_OPT)
@@ -68,10 +76,7 @@
 LIB_COMPILE=""					AC_SUBST(LIB_COMPILE)
 LIB_LINK='${CC}'				AC_SUBST(LIB_LINK)
 LINK_TESTS=""					AC_SUBST(LINK_TESTS)
-LINT=lint						AC_SUBST(LINT)
-LINT_OPTS=""					AC_SUBST(LINT_OPTS)
 LOCAL_LDFLAGS=""				AC_SUBST(LOCAL_LDFLAGS)
-MATH_LIB="-lm"					AC_SUBST(MATH_LIB)
 PTHREAD="-lm"					AC_SUBST(PTHREAD)
 TEST_ARGS=""					AC_SUBST(TEST_ARGS)
 TEST_DEPS=""					AC_SUBST(TEST_DEPS)
@@ -95,6 +100,7 @@
 CF_DISABLE_ECHO
 CF_ENABLE_WARNINGS
 
+CF_DISABLE_LEAKS
 CF_WITH_CURSES_DIR
 
 dnl SunOS 4.x
@@ -120,19 +126,15 @@
 
 case $cf_cv_screen in
 curses)
-	CF_CURSES_CPPFLAGS
-	CF_NCURSES_VERSION
-	CF_CURSES_LIBS
+	CF_CURSES_CONFIG
 	;;
 ncurses)
-	CF_NCURSES_CPPFLAGS
-	CF_NCURSES_LIBS
+	CF_NCURSES_CONFIG
 	;;
 ncursesw)
 	cf_cv_libtype=w
 	CF_UTF8_LIB
-	CF_NCURSES_CPPFLAGS(ncursesw)
-	CF_NCURSES_LIBS(ncursesw)
+	CF_NCURSES_CONFIG(ncursesw)
 	;;
 pdcurses) #(vi
 	CF_PDCURSES_X11
@@ -160,6 +162,7 @@
 		form.h \
 		menu.h \
 		panel.h \
+		term_entry.h \
 		)
 	;;
 esac
@@ -218,36 +221,18 @@
 tigetstr \
 typeahead \
 use_default_colors \
+vw_printw \
 vsscanf \
 wchgat \
 winsstr \
 wresize \
 )
 
-AC_CACHE_CHECK(for ncurses extended functions,cf_cv_ncurses_ext_funcs,[
-AC_TRY_LINK([
-#include <${cf_cv_ncurses_header-curses.h}>],
-[
-	(void) assume_default_colors (0, 0);
-	(void) curses_version ();
-	(void) define_key (0, 0);
-	(void) is_term_resized (0, 0);
-	(void) key_defined (0);
-	(void) keybound (0, 0);
-	(void) keyok (0, 0);
-	(void) resize_term (0, 0);
-	(void) resizeterm (0, 0);
-	(void) use_default_colors ();
-	(void) use_extended_names (0);
-	(void) wresize (0, 0, 0);],
-	[cf_cv_ncurses_ext_funcs=yes],
-	[cf_cv_ncurses_ext_funcs=no])
-])
-test "$cf_cv_ncurses_ext_funcs" != no && AC_DEFINE(NCURSES_EXT_FUNCS)
+CF_NCURSES_EXT_FUNCS
 
 AC_CACHE_CHECK(for wide-character functions,cf_cv_widechar_funcs,[
 AC_TRY_LINK([
-#include <${cf_cv_ncurses_header-curses.h}>],
+#include <${cf_cv_ncurses_header:-curses.h}>],
 [
 	static wchar_t src_wchar[2];
 	static cchar_t dst_cchar;
@@ -262,12 +247,32 @@
 	AC_DEFINE(USE_WIDEC_SUPPORT,0)
 fi
 
+AC_FUNC_VFORK
 CF_SYS_TIME_SELECT
 CF_FUNC_CURSES_VERSION
 CF_CURSES_ACS_MAP
 CF_CURSES_WACS_MAP
+
 CF_CURSES_CHECK_TYPE(attr_t,long)
-CF_CURSES_CHECK_TYPE(mbstate_t,long)
+
+CF_WCHAR_TYPE(mbstate_t, NCURSES_MBSTATE_T, NCURSES_OK_MBSTATE_T)
+CF_WCHAR_TYPE(wchar_t,   NCURSES_WCHAR_T,   NCURSES_OK_WCHAR_T)
+CF_WCHAR_TYPE(wint_t,    NCURSES_WINT_T,    NCURSES_OK_WINT_T)
+
+if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
+	CF_CURSES_CHECK_TYPE(mbstate_t,long)
+fi
+
+if test "$NCURSES_OK_WCHAR_T" = 0 ; then
+	CF_CURSES_CHECK_TYPE(wchar_t,long)
+fi
+
+if test "$NCURSES_OK_WINT_T" = 0 ; then
+	CF_CURSES_CHECK_TYPE(wint_t,long)
+fi
+
+CF_CURSES_CHECK_DATA(boolnames)
+CF_CURSES_CHECK_DATA(boolfnames)
 
 TEST_ARGS="$LIBS"
 LIBS=
@@ -275,24 +280,35 @@
 dnl ---------------------------------------------------------------------------
 
 AC_OUTPUT(Makefile,[
-CF_PRG_RULES([$srcdir/mk-test.awk ECHO_LINK="$ECHO_LD"], .)
+CF_PRG_RULES([$srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD"], .)
 	cat >>Makefile <<TEST_EOF
 
 # These rules are generated so we do not rely on suffix rules, which do not
 # work consistently for different make-programs (the '\$(MODEL)/' confuses
 # some, and the '\$x' confuses others).
 TEST_EOF
+
 LIST=`sed -e 's/[[ 	]].*//' -e '/^[[#@]]/d' $srcdir/modules`
 for N in $LIST
 do
 	cat >>Makefile <<TEST_EOF
 
-\$(MODEL)/$N.o : $N.c \\
-	test.priv.h \\
+\$(MODEL)/$N.o : \$(srcdir)/$N.c \\
+	\$(srcdir)/test.priv.h \\
 	ncurses_cfg.h
-	@echo compiling $N; \$(CC) -c \$(CFLAGS_DEFAULT) $N.c
+	@echo compiling $N; \$(CC) -c \$(CFLAGS_DEFAULT) \$(srcdir)/$N.c
 TEST_EOF
 done
+
+if test -f ../config.guess && test -f ../config.sub
+then
+	cat >>Makefile <<TEST_EOF
+
+# if we used CF_INHERIT for getting these files, we can remove them
+distclean::
+	rm -f config.guess config.sub
+TEST_EOF
+fi
 ],[
 AWK="$AWK"
 ECHO_LD="$ECHO_LD"
diff -Naur ncurses-5.7.orig/test/demo_altkeys.c ncurses-5.7/test/demo_altkeys.c
--- ncurses-5.7.orig/test/demo_altkeys.c	2008-04-12 18:06:22.000000000 -0400
+++ ncurses-5.7/test/demo_altkeys.c	2011-01-08 18:18:29.494656729 -0500
@@ -26,7 +26,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: demo_altkeys.c,v 1.8 2008/04/12 22:06:22 tom Exp $
+ * $Id: demo_altkeys.c,v 1.9 2010/11/14 00:59:26 tom Exp $
  *
  * Demonstrate the define_key() function.
  * Thomas Dickey - 2005/10/22
@@ -128,8 +128,8 @@
 
 #if HAVE_GETTIMEOFDAY
 	gettimeofday(&current, 0);
-	secs = current.tv_sec - previous.tv_sec;
-	msecs = (current.tv_usec - previous.tv_usec) / 1000;
+	secs = (int) (current.tv_sec - previous.tv_sec);
+	msecs = (int) ((current.tv_usec - previous.tv_usec) / 1000);
 	if (msecs < 0) {
 	    msecs += 1000;
 	    --secs;
diff -Naur ncurses-5.7.orig/test/demo_defkey.c ncurses-5.7/test/demo_defkey.c
--- ncurses-5.7.orig/test/demo_defkey.c	2008-08-04 12:24:47.000000000 -0400
+++ ncurses-5.7/test/demo_defkey.c	2011-01-08 18:18:29.494656729 -0500
@@ -26,7 +26,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: demo_defkey.c,v 1.19 2008/08/04 16:24:47 tom Exp $
+ * $Id: demo_defkey.c,v 1.20 2010/11/14 00:59:35 tom Exp $
  *
  * Demonstrate the define_key() function.
  * Thomas Dickey - 2002/11/23
@@ -98,7 +98,7 @@
 visible(const char *string)
 {
     char *result = 0;
-    unsigned need = 1;
+    size_t need = 1;
     int pass;
     int n;
 
diff -Naur ncurses-5.7.orig/test/demo_forms.c ncurses-5.7/test/demo_forms.c
--- ncurses-5.7.orig/test/demo_forms.c	2008-10-18 16:38:20.000000000 -0400
+++ ncurses-5.7/test/demo_forms.c	2011-01-08 18:18:29.494656729 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2003-2007,2008 Free Software Foundation, Inc.              *
+ * Copyright (c) 2003-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            *
@@ -26,7 +26,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: demo_forms.c,v 1.30 2008/10/18 20:38:20 tom Exp $
+ * $Id: demo_forms.c,v 1.36 2010/11/13 20:49:50 tom Exp $
  *
  * Demonstrate a variety of functions from the form library.
  * Thomas Dickey - 2003/4/26
@@ -83,7 +83,7 @@
 
     if (f) {
 	set_field_buffer(f, 0, label);
-	set_field_opts(f, (int) (field_opts(f) & ~O_ACTIVE));
+	set_field_opts(f, (int) ((unsigned) field_opts(f) & ~O_ACTIVE));
     }
     return (f);
 }
@@ -97,6 +97,8 @@
     FIELD *f = new_field(rows, cols, frow, fcol, o_value, 1);
 
     if (f) {
+	FieldAttrs *ptr;
+
 	set_field_back(f, A_UNDERLINE);
 	/*
 	 * If -j and -d options are combined, -j loses.  It is documented in
@@ -122,7 +124,12 @@
 	/*
 	 * The userptr is used in edit_field.c's inactive_field().
 	 */
-	set_field_userptr(f, (void *) (long) field_back(f));
+	ptr = (FieldAttrs *) field_userptr(f);
+	if (ptr == 0) {
+	    ptr = typeCalloc(FieldAttrs, 1);
+	    ptr->background = field_back(f);
+	}
+	set_field_userptr(f, (void *) ptr);
 	if (t_value)
 	    set_field_buffer(f, 0, t_value);
     }
@@ -168,7 +175,7 @@
 static void
 show_insert_mode(bool insert_mode)
 {
-    mvaddstr(5, 57, (insert_mode
+    MvAddStr(5, 57, (insert_mode
 		     ? "form_status: insert "
 		     : "form_status: overlay"));
 }
@@ -209,7 +216,7 @@
     case MY_EDT_MODE:
 	if ((field = current_field(form)) != 0) {
 	    set_current_field(form, another_field(form, field));
-	    if (field_opts(field) & O_EDIT) {
+	    if ((unsigned) field_opts(field) & O_EDIT) {
 		field_opts_off(field, O_EDIT);
 		set_field_status(field, 0);
 	    } else {
@@ -285,7 +292,7 @@
 		waddstr(win, "other");
 	}
 
-	if (field_opts(field) & O_EDIT)
+	if ((unsigned) field_opts(field) & O_EDIT)
 	    waddstr(win, " editable");
 	else
 	    waddstr(win, " readonly");
@@ -300,13 +307,13 @@
 	}
 
 	waddch(win, ' ');
-	wattrset(win, field_fore(field));
+	(void) wattrset(win, field_fore(field));
 	waddstr(win, "fore");
 	wattroff(win, field_fore(field));
 
 	waddch(win, '/');
 
-	wattrset(win, field_back(field));
+	(void) wattrset(win, field_back(field));
 	waddstr(win, "back");
 	wattroff(win, field_back(field));
 
@@ -317,7 +324,7 @@
 	for (nbuf = 0; nbuf <= 2; ++nbuf) {
 	    if ((buffer = field_buffer(field, nbuf)) != 0) {
 		wprintw(win, "buffer %d:", nbuf);
-		wattrset(win, A_REVERSE);
+		(void) wattrset(win, A_REVERSE);
 		waddstr(win, buffer);
 		wattroff(win, A_REVERSE);
 		waddstr(win, "\n");
@@ -344,7 +351,7 @@
 
     help_edit_field();
 
-    mvaddstr(4, 57, "Forms Entry Test");
+    MvAddStr(4, 57, "Forms Entry Test");
     show_insert_mode(TRUE);
 
     refresh();
@@ -416,7 +423,7 @@
 	set_field_buffer(f[n - 1], 1, "Hello\nWorld!");
     }
 
-    f[n++] = (FIELD *) 0;
+    f[n] = (FIELD *) 0;
 
     if ((form = new_form(f)) != 0) {
 
@@ -444,8 +451,11 @@
 
 	free_form(form);
     }
-    for (c = 0; f[c] != 0; c++)
+    for (c = 0; f[c] != 0; c++) {
+	void *ptr = field_userptr(f[c]);
+	free(ptr);
 	free_field(f[c]);
+    }
     noraw();
     nl();
 
diff -Naur ncurses-5.7.orig/test/demo_menus.c ncurses-5.7/test/demo_menus.c
--- ncurses-5.7.orig/test/demo_menus.c	2008-08-23 16:31:54.000000000 -0400
+++ ncurses-5.7/test/demo_menus.c	2011-01-08 18:18:29.494656729 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2005-2007,2008 Free Software Foundation, Inc.              *
+ * Copyright (c) 2005-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            *
@@ -26,7 +26,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: demo_menus.c,v 1.28 2008/08/23 20:31:54 tom Exp $
+ * $Id: demo_menus.c,v 1.31 2010/11/13 20:06:46 tom Exp $
  *
  * Demonstrate a variety of functions from the menu library.
  * Thomas Dickey - 2005/4/9
@@ -260,13 +260,13 @@
 {
     int count;
 
-    Trace(("menu_destroy %p", m));
+    Trace(("menu_destroy %p", (void *) m));
     if (m != 0) {
 	ITEM **items = menu_items(m);
 	const char *blob = 0;
 
 	count = item_count(m);
-	Trace(("menu_destroy %p count %d", m, count));
+	Trace(("menu_destroy %p count %d", (void *) m, count));
 	if ((count > 0) && (m == mpSelect)) {
 	    blob = item_name(*items);
 	}
@@ -368,7 +368,9 @@
 	    CONST_MENUS char **list = typeCalloc(CONST_MENUS char *, size + 1);
 
 	    items = typeCalloc(ITEM *, size + 1);
-	    Trace(("build_select_menu blob=%p, items=%p", blob, items));
+	    Trace(("build_select_menu blob=%p, items=%p",
+		   (void *) blob,
+		   (void *) items));
 	    if (blob != 0 && list != 0) {
 		FILE *fp = fopen(filename, "r");
 		if (fp != 0) {
@@ -544,8 +546,8 @@
 	    trace(newtrace);
 	    Trace(("trace level interactively set to %s", tracetrace(_nc_tracing)));
 
-	    (void) mvprintw(LINES - 2, 0,
-			    "Trace level is %s\n", tracetrace(_nc_tracing));
+	    MvPrintw(LINES - 2, 0,
+		     "Trace level is %s\n", tracetrace(_nc_tracing));
 	    refresh();
 	}
     }
diff -Naur ncurses-5.7.orig/test/demo_panels.c ncurses-5.7/test/demo_panels.c
--- ncurses-5.7.orig/test/demo_panels.c	2008-08-04 09:33:48.000000000 -0400
+++ ncurses-5.7/test/demo_panels.c	2011-01-08 18:13:50.779157101 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2007,2008 Free Software Foundation, Inc.                   *
+ * Copyright (c) 2007-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,7 +26,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: demo_panels.c,v 1.33 2008/08/04 13:33:48 tom Exp $
+ * $Id: demo_panels.c,v 1.37 2010/05/01 22:19:02 tom Exp $
  *
  * Demonstrate a variety of functions from the panel library.
  */
@@ -117,10 +117,9 @@
     int result = 0;
     int x1, y1;
     char cmd;
-    WINDOW *win;
 
     getyx(stdscr, y1, x1);
-    win = statusline();
+    (void) statusline();
 
     show_position(text, also, which, y1, x1);
 
@@ -494,6 +493,7 @@
     PANEL *pan;
     int j;
 
+    memset(table, 0, sizeof(table));
     for (j = 1; j <= MAX_PANELS; ++j) {
 	table[j].valid = (px[j] != 0);
 	if (table[j].valid) {
@@ -507,7 +507,7 @@
 	keypad(win, TRUE);
 	if ((pan = new_panel(win)) != 0) {
 	    werase(win);
-	    mvwprintw(win, 0, 0, "Panels:\n");
+	    MvWPrintw(win, 0, 0, "Panels:\n");
 	    for (j = 1; j <= MAX_PANELS; ++j) {
 		if (table[j].valid) {
 		    wprintw(win, " %d:", j);
diff -Naur ncurses-5.7.orig/test/demo_termcap.c ncurses-5.7/test/demo_termcap.c
--- ncurses-5.7.orig/test/demo_termcap.c	2008-02-09 13:08:36.000000000 -0500
+++ ncurses-5.7/test/demo_termcap.c	2011-01-08 18:13:50.779157101 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2005-2007,2008 Free Software Foundation, Inc.              *
+ * Copyright (c) 2005-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            *
@@ -29,7 +29,7 @@
 /*
  * Author: Thomas E. Dickey
  *
- * $Id: demo_termcap.c,v 1.7 2008/02/09 18:08:36 tom Exp $
+ * $Id: demo_termcap.c,v 1.13 2010/05/01 22:04:08 tom Exp $
  *
  * A simple demo of the termcap interface.
  */
@@ -38,10 +38,25 @@
 
 #if HAVE_TGETENT
 
+#if defined(HAVE_CURSES_DATA_BOOLNAMES) || defined(DECL_CURSES_DATA_BOOLNAMES)
+#define USE_CODE_LISTS 1
+#else
+#define USE_CODE_LISTS 0
+#endif
+
+#define FCOLS 8
+#define FNAME(type) "%s %-*s = ", #type, FCOLS
+
+#if USE_CODE_LISTS
+static bool b_opt = FALSE;
+static bool n_opt = FALSE;
+static bool s_opt = FALSE;
+#endif
+
 #define isCapName(c) (isgraph(c) && strchr("^#=:\\", c) == 0)
 
 static void
-dumpit(char *cap)
+dumpit(NCURSES_CONST char *cap)
 {
     /*
      * One of the limitations of the termcap interface is that the library
@@ -59,7 +74,7 @@
 	 * Note that the strings returned are mostly terminfo format, since
 	 * ncurses does not convert except for a handful of special cases.
 	 */
-	printf("str %s = ", cap);
+	printf(FNAME(str), cap);
 	while (*str != 0) {
 	    int ch = UChar(*str++);
 	    switch (ch) {
@@ -108,15 +123,17 @@
 	}
 	printf("\n");
     } else if ((num = tgetnum(cap)) >= 0) {
-	printf("num %s = %d\n", cap, num);
-    } else if ((num = tgetflag(cap)) > 0) {
-	printf("flg %s\n", cap);
+	printf(FNAME(num), cap);
+	printf(" %d\n", num);
+    } else if (tgetflag(cap) > 0) {
+	printf(FNAME(flg), cap);
+	printf("%s\n", "true");
     }
     fflush(stdout);
 }
 
 static void
-demo_termcap(char *name)
+brute_force(const char *name)
 {
     char buffer[1024];
 
@@ -127,10 +144,10 @@
 
 	cap[2] = 0;
 	for (c1 = 0; c1 < 256; ++c1) {
-	    cap[0] = c1;
+	    cap[0] = (char) c1;
 	    if (isCapName(c1)) {
 		for (c2 = 0; c2 < 256; ++c2) {
-		    cap[1] = c2;
+		    cap[1] = (char) c2;
 		    if (isCapName(c2)) {
 			dumpit(cap);
 		    }
@@ -140,22 +157,141 @@
     }
 }
 
+#if USE_CODE_LISTS
+static void
+demo_terminfo(NCURSES_CONST char *name)
+{
+    unsigned n;
+    NCURSES_CONST char *cap;
+
+    printf("Terminal type \"%s\"\n", name);
+    setupterm(name, 1, (int *) 0);
+
+    if (b_opt) {
+	for (n = 0;; ++n) {
+	    cap = boolcodes[n];
+	    if (cap == 0)
+		break;
+	    dumpit(cap);
+	}
+    }
+
+    if (n_opt) {
+	for (n = 0;; ++n) {
+	    cap = numcodes[n];
+	    if (cap == 0)
+		break;
+	    dumpit(cap);
+	}
+    }
+
+    if (s_opt) {
+	for (n = 0;; ++n) {
+	    cap = strcodes[n];
+	    if (cap == 0)
+		break;
+	    dumpit(cap);
+	}
+    }
+}
+
+static void
+usage(void)
+{
+    static const char *msg[] =
+    {
+	"Usage: demo_terminfo [options] [terminal]",
+	"",
+	"If no options are given, print all (boolean, numeric, string)",
+	"capabilities for the given terminal, using short names.",
+	"",
+	"Options:",
+	" -a       try all names, print capabilities found",
+	" -b       print boolean-capabilities",
+	" -n       print numeric-capabilities",
+	" -r COUNT repeat for given count",
+	" -s       print string-capabilities",
+    };
+    unsigned n;
+    for (n = 0; n < SIZEOF(msg); ++n) {
+	fprintf(stderr, "%s\n", msg[n]);
+    }
+    ExitProgram(EXIT_FAILURE);
+}
+#endif
+
 int
 main(int argc, char *argv[])
 {
     int n;
     char *name;
+    bool a_opt = FALSE;
+
+#if USE_CODE_LISTS
+    int repeat;
+    int r_opt = 1;
+
+    while ((n = getopt(argc, argv, "abnr:s")) != -1) {
+	switch (n) {
+	case 'a':
+	    a_opt = TRUE;
+	    break;
+	case 'b':
+	    b_opt = TRUE;
+	    break;
+	case 'n':
+	    n_opt = TRUE;
+	    break;
+	case 'r':
+	    if ((r_opt = atoi(optarg)) <= 0)
+		usage();
+	    break;
+	case 's':
+	    s_opt = TRUE;
+	    break;
+	default:
+	    usage();
+	    break;
+	}
+    }
 
-    if (argc > 1) {
-	for (n = 1; n < argc; ++n) {
-	    demo_termcap(argv[n]);
-	}
-    } else if ((name = getenv("TERM")) != 0) {
-	demo_termcap(name);
-    } else {
-	static char dumb[] = "dumb";
-	demo_termcap(dumb);
+    if (!(b_opt || n_opt || s_opt)) {
+	b_opt = TRUE;
+	n_opt = TRUE;
+	s_opt = TRUE;
+    }
+#else
+    a_opt = TRUE;
+#endif
+
+    if (a_opt) {
+	if (optind < argc) {
+	    for (n = optind; n < argc; ++n) {
+		brute_force(argv[n]);
+	    }
+	} else if ((name = getenv("TERM")) != 0) {
+	    brute_force(name);
+	} else {
+	    static char dumb[] = "dumb";
+	    brute_force(dumb);
+	}
+    }
+#if USE_CODE_LISTS
+    else {
+	for (repeat = 0; repeat < r_opt; ++repeat) {
+	    if (optind < argc) {
+		for (n = optind; n < argc; ++n) {
+		    demo_terminfo(argv[n]);
+		}
+	    } else if ((name = getenv("TERM")) != 0) {
+		demo_terminfo(name);
+	    } else {
+		static char dumb[] = "dumb";
+		demo_terminfo(dumb);
+	    }
+	}
     }
+#endif
 
     ExitProgram(EXIT_SUCCESS);
 }
diff -Naur ncurses-5.7.orig/test/demo_terminfo.c ncurses-5.7/test/demo_terminfo.c
--- ncurses-5.7.orig/test/demo_terminfo.c	1969-12-31 19:00:00.000000000 -0500
+++ ncurses-5.7/test/demo_terminfo.c	2011-01-08 18:18:29.578656369 -0500
@@ -0,0 +1,317 @@
+/****************************************************************************
+ * Copyright (c) 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            *
+ * "Software"), to deal in the Software without restriction, including      *
+ * without limitation the rights to use, copy, modify, merge, publish,      *
+ * distribute, distribute with modifications, sublicense, and/or sell       *
+ * copies of the Software, and to permit persons to whom the Software is    *
+ * furnished to do so, subject to the following conditions:                 *
+ *                                                                          *
+ * The above copyright notice and this permission notice shall be included  *
+ * in all copies or substantial portions of the Software.                   *
+ *                                                                          *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
+ *                                                                          *
+ * Except as contained in this notice, the name(s) of the above copyright   *
+ * holders shall not be used in advertising or otherwise to promote the     *
+ * sale, use or other dealings in this Software without prior written       *
+ * authorization.                                                           *
+ ****************************************************************************/
+
+/*
+ * Author: Thomas E. Dickey
+ *
+ * $Id: demo_terminfo.c,v 1.9 2010/11/28 00:15:27 tom Exp $
+ *
+ * A simple demo of the terminfo interface.
+ */
+#define USE_TINFO
+#include <test.priv.h>
+
+#ifdef NCURSES_VERSION
+#if !(defined(HAVE_TERM_ENTRY_H) && HAVE_TERM_ENTRY_H)
+#undef NCURSES_XNAMES
+#define NCURSES_XNAMES 0
+#endif
+#if NCURSES_XNAMES
+#include <term_entry.h>
+#endif
+#endif
+
+#if HAVE_TIGETSTR
+#if defined(HAVE_CURSES_DATA_BOOLNAMES) || defined(DECL_CURSES_DATA_BOOLNAMES)
+
+static bool b_opt = FALSE;
+static bool f_opt = FALSE;
+static bool n_opt = FALSE;
+static bool s_opt = FALSE;
+static bool x_opt = FALSE;
+
+#define FCOLS 8
+#define FNAME(type) "%s %-*s = ", #type, FCOLS
+
+static void
+dumpit(NCURSES_CONST char *cap)
+{
+    /*
+     * One of the limitations of the termcap interface is that the library
+     * cannot determine the size of the buffer passed via tgetstr(), nor the
+     * amount of space remaining.  This demo simply reuses the whole buffer
+     * for each call; a normal termcap application would try to use the buffer
+     * to hold all of the strings extracted from the terminal entry.
+     */
+    const char *str;
+    int num;
+
+    if ((str = tigetstr(cap)) != 0 && (str != (char *) -1)) {
+	/*
+	 * Note that the strings returned are mostly terminfo format, since
+	 * ncurses does not convert except for a handful of special cases.
+	 */
+	printf(FNAME(str), cap);
+	while (*str != 0) {
+	    int ch = UChar(*str++);
+	    switch (ch) {
+	    case '\177':
+		fputs("^?", stdout);
+		break;
+	    case '\033':
+		fputs("\\E", stdout);
+		break;
+	    case '\b':
+		fputs("\\b", stdout);
+		break;
+	    case '\f':
+		fputs("\\f", stdout);
+		break;
+	    case '\n':
+		fputs("\\n", stdout);
+		break;
+	    case '\r':
+		fputs("\\r", stdout);
+		break;
+	    case ' ':
+		fputs("\\s", stdout);
+		break;
+	    case '\t':
+		fputs("\\t", stdout);
+		break;
+	    case '^':
+		fputs("\\^", stdout);
+		break;
+	    case ':':
+		fputs("\\072", stdout);
+		break;
+	    case '\\':
+		fputs("\\\\", stdout);
+		break;
+	    default:
+		if (isgraph(ch))
+		    fputc(ch, stdout);
+		else if (ch < 32)
+		    printf("^%c", ch + '@');
+		else
+		    printf("\\%03o", ch);
+		break;
+	    }
+	}
+	printf("\n");
+    } else if ((num = tigetnum(cap)) >= 0) {
+	printf(FNAME(num), cap);
+	printf(" %d\n", num);
+    } else if ((num = tigetflag(cap)) >= 0) {
+	printf(FNAME(flg), cap);
+	printf("%s\n", num ? "true" : "false");
+    }
+    fflush(stdout);
+}
+
+static void
+demo_terminfo(char *name)
+{
+    unsigned n;
+    NCURSES_CONST char *cap;
+
+    printf("Terminal type \"%s\"\n", name);
+    setupterm(name, 1, (int *) 0);
+
+    if (b_opt) {
+	for (n = 0;; ++n) {
+	    cap = f_opt ? boolfnames[n] : boolnames[n];
+	    if (cap == 0)
+		break;
+	    dumpit(cap);
+	}
+    }
+
+    if (n_opt) {
+	for (n = 0;; ++n) {
+	    cap = f_opt ? numfnames[n] : numnames[n];
+	    if (cap == 0)
+		break;
+	    dumpit(cap);
+	}
+    }
+
+    if (s_opt) {
+	for (n = 0;; ++n) {
+	    cap = f_opt ? strfnames[n] : strnames[n];
+	    if (cap == 0)
+		break;
+	    dumpit(cap);
+	}
+    }
+#ifdef NCURSES_VERSION
+    if (x_opt) {
+	int mod;
+	if (f_opt) {
+#if NCURSES_XNAMES
+	    TERMTYPE *term = &(cur_term->type);
+	    if (term != 0
+		&& ((NUM_BOOLEANS(term) != BOOLCOUNT)
+		    || (NUM_NUMBERS(term) != NUMCOUNT)
+		    || (NUM_STRINGS(term) != STRCOUNT))) {
+		for (n = BOOLCOUNT; n < NUM_BOOLEANS(term); ++n) {
+		    dumpit(ExtBoolname(term, (int) n, boolnames));
+		}
+		for (n = NUMCOUNT; n < NUM_NUMBERS(term); ++n) {
+		    dumpit(ExtNumname(term, (int) n, numnames));
+		}
+		for (n = STRCOUNT; n < NUM_STRINGS(term); ++n) {
+		    dumpit(ExtStrname(term, (int) n, strnames));
+		}
+	    }
+#endif
+	} else {
+	    char temp[10];
+	    static const char *xterm_keys[] =
+	    {
+		"kDC", "kDN", "kEND", "kHOM", "kIC",
+		"kLFT", "kNXT", "kPRV", "kRIT", "kUP",
+	    };
+	    for (n = 0; n < SIZEOF(xterm_keys); ++n) {
+		for (mod = 0; mod < 8; ++mod) {
+		    if (mod == 0)
+			strcpy(temp, xterm_keys[n]);
+		    else
+			sprintf(temp, "%s%d", xterm_keys[n], mod);
+		    dumpit(temp);
+		}
+	    }
+	}
+    }
+#endif
+
+}
+
+static void
+usage(void)
+{
+    static const char *msg[] =
+    {
+	"Usage: demo_terminfo [options] [terminal]",
+	"",
+	"If no options are given, print all (boolean, numeric, string)",
+	"capabilities for the given terminal, using short names.",
+	"",
+	"Options:",
+	" -b       print boolean-capabilities",
+	" -f       print full names",
+	" -n       print numeric-capabilities",
+	" -r COUNT repeat for given count",
+	" -s       print string-capabilities",
+#ifdef NCURSES_VERSION
+	" -x       print extended capabilities",
+#endif
+    };
+    unsigned n;
+    for (n = 0; n < SIZEOF(msg); ++n) {
+	fprintf(stderr, "%s\n", msg[n]);
+    }
+    ExitProgram(EXIT_FAILURE);
+}
+
+int
+main(int argc, char *argv[])
+{
+    int n;
+    int repeat;
+    char *name;
+    int r_opt = 1;
+
+    while ((n = getopt(argc, argv, "bfnr:sx")) != -1) {
+	switch (n) {
+	case 'b':
+	    b_opt = TRUE;
+	    break;
+	case 'f':
+	    f_opt = TRUE;
+	    break;
+	case 'n':
+	    n_opt = TRUE;
+	    break;
+	case 'r':
+	    if ((r_opt = atoi(optarg)) <= 0)
+		usage();
+	    break;
+	case 's':
+	    s_opt = TRUE;
+	    break;
+#ifdef NCURSES_VERSION
+	case 'x':
+	    x_opt = TRUE;
+	    use_extended_names(TRUE);
+	    break;
+#endif
+	default:
+	    usage();
+	    break;
+	}
+    }
+
+    if (!(b_opt || n_opt || s_opt || x_opt)) {
+	b_opt = TRUE;
+	n_opt = TRUE;
+	s_opt = TRUE;
+    }
+
+    for (repeat = 0; repeat < r_opt; ++repeat) {
+	if (optind < argc) {
+	    for (n = optind; n < argc; ++n) {
+		demo_terminfo(argv[n]);
+	    }
+	} else if ((name = getenv("TERM")) != 0) {
+	    demo_terminfo(name);
+	} else {
+	    static char dumb[] = "dumb";
+	    demo_terminfo(dumb);
+	}
+    }
+
+    ExitProgram(EXIT_SUCCESS);
+}
+
+#else
+int
+main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
+{
+    printf("This program requires the terminfo arrays\n");
+    ExitProgram(EXIT_FAILURE);
+}
+#endif
+#else /* !HAVE_TIGETSTR */
+int
+main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
+{
+    printf("This program requires the terminfo functions such as tigetstr\n");
+    ExitProgram(EXIT_FAILURE);
+}
+#endif /* HAVE_TIGETSTR */
diff -Naur ncurses-5.7.orig/test/ditto.c ncurses-5.7/test/ditto.c
--- ncurses-5.7.orig/test/ditto.c	2008-08-04 09:21:41.000000000 -0400
+++ ncurses-5.7/test/ditto.c	2011-01-08 18:18:29.494656729 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2007,2008 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            *
@@ -29,7 +29,7 @@
 /*
  * Author: Thomas E. Dickey (1998-on)
  *
- * $Id: ditto.c,v 1.32 2008/08/04 13:21:41 tom Exp $
+ * $Id: ditto.c,v 1.40 2010/11/14 01:06:47 tom Exp $
  *
  * The program illustrates how to set up multiple screens from a single
  * program.
@@ -43,7 +43,6 @@
  */
 #include <test.priv.h>
 #include <sys/stat.h>
-#include <errno.h>
 
 #ifdef USE_PTHREADS
 #include <pthread.h>
@@ -137,8 +136,8 @@
 {
     int result = -1;
     if (peek->sequence < fifo->sequence) {
-	peek->sequence += 1;
 	result = fifo->data[THIS_FIFO(peek->sequence)];
+	peek->sequence += 1;
     }
     return result;
 }
@@ -152,12 +151,11 @@
     int aslave;
     char slave_name[1024];
     char s_option[sizeof(slave_name) + 80];
-    char *leaf;
 
     if (openpty(&amaster, &aslave, slave_name, 0, 0) != 0
 	|| strlen(slave_name) > sizeof(slave_name) - 1)
 	failed("openpty");
-    if ((leaf = strrchr(slave_name, '/')) == 0) {
+    if (strrchr(slave_name, '/') == 0) {
 	errno = EISDIR;
 	failed(slave_name);
     }
@@ -188,7 +186,11 @@
 }
 
 static void
-init_screen(SCREEN *sp GCC_UNUSED, void *arg)
+init_screen(
+#if HAVE_USE_WINDOW
+	       SCREEN *sp GCC_UNUSED,
+#endif
+	       void *arg)
 {
     DITTO *target = (DITTO *) arg;
     int high, wide;
@@ -209,7 +211,7 @@
 	WINDOW *inner = derwin(outer, high - 2, wide - 2, 1, 1);
 
 	box(outer, 0, 0);
-	mvwaddstr(outer, 0, 2, target->titles[k]);
+	MvWAddStr(outer, 0, 2, target->titles[k]);
 	wnoutrefresh(outer);
 
 	scrollok(inner, TRUE);
@@ -237,6 +239,7 @@
     target->which1 = which1;
     target->titles = source;
     target->length = length;
+    target->fifo.head = -1;
     target->screen = newterm((char *) 0,	/* assume $TERM is the same */
 			     target->output,
 			     target->input);
@@ -248,9 +251,15 @@
 }
 
 static int
-close_screen(SCREEN *sp GCC_UNUSED, void *arg GCC_UNUSED)
+close_screen(
+#if HAVE_USE_WINDOW
+		SCREEN *sp GCC_UNUSED,
+#endif
+		void *arg GCC_UNUSED)
 {
+#if HAVE_USE_WINDOW
     (void) sp;
+#endif
     (void) arg;
     return endwin();
 }
@@ -259,7 +268,11 @@
  * Read data from the 'source' screen.
  */
 static int
-read_screen(SCREEN *sp GCC_UNUSED, void *arg)
+read_screen(
+#if HAVE_USE_WINDOW
+	       SCREEN *sp GCC_UNUSED,
+#endif
+	       void *arg)
 {
     DDATA *data = (DDATA *) arg;
     DITTO *ditto = &(data->ditto[data->source]);
@@ -278,7 +291,11 @@
  * Write all of the data that's in fifos for the 'target' screen.
  */
 static int
-write_screen(SCREEN *sp GCC_UNUSED, void *arg GCC_UNUSED)
+write_screen(
+#if HAVE_USE_WINDOW
+		SCREEN *sp GCC_UNUSED,
+#endif
+		void *arg GCC_UNUSED)
 {
     DDATA *data = (DDATA *) arg;
     DITTO *ditto = &(data->ditto[data->target]);
@@ -309,6 +326,7 @@
 {
     int n;
 
+    (void) data;
     for (n = 0; n < count; n++) {
 	ddata->target = n;
 	USING_SCREEN(data[n].screen, write_screen, (void *) ddata);
@@ -364,6 +382,8 @@
     if ((data = typeCalloc(DITTO, (size_t) argc)) == 0)
 	failed("calloc data");
 
+    assert(data != 0);
+
     for (j = 0; j < argc; j++) {
 	open_screen(&data[j], argv, argc, j);
     }
diff -Naur ncurses-5.7.orig/test/dots.c ncurses-5.7/test/dots.c
--- ncurses-5.7.orig/test/dots.c	2008-02-09 13:08:50.000000000 -0500
+++ ncurses-5.7/test/dots.c	2011-01-08 18:18:29.494656729 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1999-2007,2008 Free Software Foundation, Inc.              *
+ * Copyright (c) 1999-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            *
@@ -29,7 +29,7 @@
 /*
  * Author: Thomas E. Dickey <dickey@clark.net> 1999
  *
- * $Id: dots.c,v 1.17 2008/02/09 18:08:50 tom Exp $
+ * $Id: dots.c,v 1.22 2010/11/14 01:00:02 tom Exp $
  *
  * A simple demo of the terminfo interface.
  */
@@ -49,13 +49,16 @@
 static int
 outc(TPUTS_ARG c)
 {
+    int rc = c;
+
     if (interrupted) {
-	char tmp = c;
-	write(STDOUT_FILENO, &tmp, 1);
+	char tmp = (char) c;
+	if (write(STDOUT_FILENO, &tmp, 1) == -1)
+	    rc = EOF;
     } else {
-	putc(c, stdout);
+	rc = putc(c, stdout);
     }
-    return 0;
+    return rc;
 }
 
 static bool
@@ -79,7 +82,7 @@
 
     printf("\n\n%ld total chars, rate %.2f/sec\n",
 	   total_chars,
-	   ((double) (total_chars) / (time((time_t *) 0) - started)));
+	   ((double) (total_chars) / (double) (time((time_t *) 0) - started)));
 }
 
 static void
@@ -88,21 +91,20 @@
     interrupted = TRUE;
 }
 
-static float
+static double
 ranf(void)
 {
     long r = (rand() & 077777);
-    return ((float) r / 32768.);
+    return ((double) r / 32768.);
 }
 
 int
-main(
-	int argc GCC_UNUSED,
-	char *argv[]GCC_UNUSED)
+main(int argc GCC_UNUSED,
+     char *argv[]GCC_UNUSED)
 {
     int x, y, z, p;
-    float r;
-    float c;
+    double r;
+    double c;
 
     CATCHALL(onsig);
 
@@ -117,8 +119,8 @@
 	    max_colors = -1;
     }
 
-    r = (float) (lines - 4);
-    c = (float) (columns - 4);
+    r = (double) (lines - 4);
+    c = (double) (columns - 4);
     started = time((time_t *) 0);
 
     while (!interrupted) {
diff -Naur ncurses-5.7.orig/test/dots_mvcur.c ncurses-5.7/test/dots_mvcur.c
--- ncurses-5.7.orig/test/dots_mvcur.c	2008-02-09 13:08:57.000000000 -0500
+++ ncurses-5.7/test/dots_mvcur.c	2011-01-08 18:18:29.494656729 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1999-2007,2008 Free Software Foundation, Inc.              *
+ * Copyright (c) 2007-2008,2009 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -29,7 +29,7 @@
 /*
  * Author: Thomas E. Dickey - 2007
  *
- * $Id: dots_mvcur.c,v 1.2 2008/02/09 18:08:57 tom Exp $
+ * $Id: dots_mvcur.c,v 1.6 2010/11/14 01:00:44 tom Exp $
  *
  * A simple demo of the terminfo interface, and mvcur.
  */
@@ -49,13 +49,17 @@
 static int
 outc(TPUTS_ARG c)
 {
+    int rc = c;
+
     if (interrupted) {
-	char tmp = c;
-	write(STDOUT_FILENO, &tmp, 1);
+	char tmp = (char) c;
+	if (write(STDOUT_FILENO, &tmp, 1) == -1)
+	    rc = EOF;
     } else {
-	putc(c, stdout);
+	if (putc(c, stdout) == EOF)
+	    rc = EOF;
     }
-    return 0;
+    return rc;
 }
 
 static bool
@@ -79,7 +83,7 @@
 
     printf("\n\n%ld total chars, rate %.2f/sec\n",
 	   total_chars,
-	   ((double) (total_chars) / (time((time_t *) 0) - started)));
+	   ((double) (total_chars) / (double) (time((time_t *) 0) - started)));
 }
 
 static void
@@ -88,22 +92,21 @@
     interrupted = TRUE;
 }
 
-static float
+static double
 ranf(void)
 {
     long r = (rand() & 077777);
-    return ((float) r / 32768.);
+    return ((double) r / 32768.);
 }
 
 int
-main(
-	int argc GCC_UNUSED,
-	char *argv[]GCC_UNUSED)
+main(int argc GCC_UNUSED,
+     char *argv[]GCC_UNUSED)
 {
     int x0 = 1, y0 = 1;
     int x, y, z, p;
-    float r;
-    float c;
+    double r;
+    double c;
     SCREEN *sp;
 
     CATCHALL(onsig);
@@ -120,8 +123,8 @@
 	    max_colors = -1;
     }
 
-    r = (float) (lines - 4);
-    c = (float) (columns - 4);
+    r = (double) (lines - 4);
+    c = (double) (columns - 4);
     started = time((time_t *) 0);
 
     while (!interrupted) {
diff -Naur ncurses-5.7.orig/test/echochar.c ncurses-5.7/test/echochar.c
--- ncurses-5.7.orig/test/echochar.c	2008-04-12 18:06:04.000000000 -0400
+++ ncurses-5.7/test/echochar.c	2011-01-08 18:18:29.494656729 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2006-2007,2008 Free Software Foundation, Inc.              *
+ * Copyright (c) 2006-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,7 +26,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: echochar.c,v 1.6 2008/04/12 22:06:04 tom Exp $
+ * $Id: echochar.c,v 1.8 2010/11/14 01:00:44 tom Exp $
  *
  * Demonstrate the echochar function (compare to dots.c).
  * Thomas Dickey - 2006/11/4
@@ -49,7 +49,7 @@
 
     printf("\n\n%ld total chars, rate %.2f/sec\n",
 	   total_chars,
-	   ((double) (total_chars) / (time((time_t *) 0) - started)));
+	   ((double) (total_chars) / (double) (time((time_t *) 0) - started)));
 }
 
 static void
@@ -58,11 +58,11 @@
     interrupted = TRUE;
 }
 
-static float
+static double
 ranf(void)
 {
     long r = (rand() & 077777);
-    return ((float) r / 32768.);
+    return ((double) r / 32768.);
 }
 
 static void
@@ -70,19 +70,20 @@
 {
     int pair = (fg * COLORS) + bg;
     if (!my_pairs[pair]) {
-	init_pair(pair, fg, bg);
+	init_pair((short) pair,
+		  (short) fg,
+		  (short) bg);
     }
     attron(COLOR_PAIR(pair));
 }
 
 int
-main(
-	int argc GCC_UNUSED,
-	char *argv[]GCC_UNUSED)
+main(int argc GCC_UNUSED,
+     char *argv[]GCC_UNUSED)
 {
     int ch, x, y, z, p;
-    float r;
-    float c;
+    double r;
+    double c;
     bool use_colors;
     bool opt_r = FALSE;
     char *my_pairs = 0;
@@ -107,7 +108,7 @@
     if (use_colors) {
 	start_color();
 	if (COLOR_PAIRS > 0) {
-	    my_pairs = typeCalloc(char, COLOR_PAIRS);
+	    my_pairs = typeCalloc(char, (size_t) COLOR_PAIRS);
 	}
 	use_colors = (my_pairs != 0);
     }
@@ -116,8 +117,8 @@
 
     curs_set(0);
 
-    r = (float) (LINES - 4);
-    c = (float) (COLS - 4);
+    r = (double) (LINES - 4);
+    c = (double) (COLS - 4);
     started = time((time_t *) 0);
 
     while (!interrupted) {
diff -Naur ncurses-5.7.orig/test/edit_field.c ncurses-5.7/test/edit_field.c
--- ncurses-5.7.orig/test/edit_field.c	2008-10-18 16:40:20.000000000 -0400
+++ ncurses-5.7/test/edit_field.c	2011-01-08 18:13:50.779157101 -0500
@@ -26,7 +26,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: edit_field.c,v 1.14 2008/10/18 20:40:20 tom Exp $
+ * $Id: edit_field.c,v 1.15 2008/12/20 19:23:01 tom Exp $
  *
  * A wrapper for form_driver() which keeps track of the user's editing changes
  * for each field, and makes the result available as a null-terminated string
@@ -294,8 +294,8 @@
 static void
 inactive_field(FIELD * f)
 {
-    void *ptr = field_userptr(f);
-    set_field_back(f, (chtype) ptr);
+    FieldAttrs *ptr = (FieldAttrs *) field_userptr(f);
+    set_field_back(f, ptr->background);
 }
 
 int
diff -Naur ncurses-5.7.orig/test/edit_field.h ncurses-5.7/test/edit_field.h
--- ncurses-5.7.orig/test/edit_field.h	2006-06-03 12:38:57.000000000 -0400
+++ ncurses-5.7/test/edit_field.h	2011-01-08 18:13:50.779157101 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2003-2004,2005 Free Software Foundation, Inc.              *
+ * Copyright (c) 2003-2006,2008 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -26,7 +26,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: edit_field.h,v 1.5 2006/06/03 16:38:57 tom Exp $
+ * $Id: edit_field.h,v 1.6 2008/12/20 19:23:18 tom Exp $
  *
  * Interface of edit_field.c
  */
@@ -43,6 +43,10 @@
 #define MY_EDT_MODE	EDIT_FIELD('e')
 #define MY_INS_MODE	EDIT_FIELD('t')
 
+typedef struct {
+    chtype background;
+} FieldAttrs;
+
 extern void help_edit_field(void);
 extern int edit_field(FORM * form, int *result);
 
diff -Naur ncurses-5.7.orig/test/filter.c ncurses-5.7/test/filter.c
--- ncurses-5.7.orig/test/filter.c	2006-12-09 11:53:47.000000000 -0500
+++ ncurses-5.7/test/filter.c	2011-01-08 18:18:29.494656729 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2005,2006 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            *
@@ -29,7 +29,7 @@
 /*
  * Author:  Thomas E. Dickey <dickey@clark.net> 1998
  *
- * $Id: filter.c,v 1.11 2006/12/09 16:53:47 tom Exp $
+ * $Id: filter.c,v 1.13 2010/11/13 20:55:54 tom Exp $
  */
 #include <test.priv.h>
 
@@ -78,16 +78,50 @@
     return code;
 }
 
+static void
+usage(void)
+{
+    static const char *msg[] =
+    {
+	"Usage: filter [options]"
+	,""
+	,"Options:"
+	,"  -i   use initscr() rather than newterm()"
+    };
+    unsigned n;
+    for (n = 0; n < SIZEOF(msg); n++)
+	fprintf(stderr, "%s\n", msg[n]);
+    ExitProgram(EXIT_FAILURE);
+}
+
 int
-main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
+main(int argc, char *argv[])
 {
+    int ch;
     char buffer[80];
     attr_t underline;
+    bool i_option = FALSE;
 
     setlocale(LC_ALL, "");
 
+    while ((ch = getopt(argc, argv, "i")) != -1) {
+	switch (ch) {
+	case 'i':
+	    i_option = TRUE;
+	    break;
+	default:
+	    usage();
+	}
+    }
+
+    printf("starting filter program using %s...\n",
+	   i_option ? "initscr" : "newterm");
     filter();
-    (void) newterm((char *) 0, stdout, stdin);
+    if (i_option) {
+	initscr();
+    } else {
+	(void) newterm((char *) 0, stdout, stdin);
+    }
     cbreak();
     keypad(stdscr, TRUE);
 
@@ -98,7 +132,7 @@
 	if (use_default_colors() != ERR)
 	    background = -1;
 #endif
-	init_pair(1, COLOR_CYAN, background);
+	init_pair(1, COLOR_CYAN, (short) background);
 	underline = COLOR_PAIR(1);
     } else {
 	underline = A_UNDERLINE;
diff -Naur ncurses-5.7.orig/test/firework.c ncurses-5.7/test/firework.c
--- ncurses-5.7.orig/test/firework.c	2006-05-20 11:36:08.000000000 -0400
+++ ncurses-5.7/test/firework.c	2011-01-08 18:18:29.494656729 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2005,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            *
@@ -26,13 +26,13 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: firework.c,v 1.24 2006/05/20 15:36:08 tom Exp $
+ * $Id: firework.c,v 1.27 2010/11/13 20:58:25 tom Exp $
  */
 #include <test.priv.h>
 
 #include <time.h>
 
-static int my_bg = COLOR_BLACK;
+static short my_bg = COLOR_BLACK;
 
 static void
 cleanup(void)
@@ -70,7 +70,7 @@
     }
 }
 
-static int
+static short
 get_colour(chtype *bold)
 {
     int attr;
@@ -81,7 +81,7 @@
 	*bold = A_BOLD;
 	attr &= 7;
     }
-    return (attr);
+    return (short) (attr);
 }
 
 static
@@ -90,50 +90,50 @@
 {
     chtype bold;
     erase();
-    mvprintw(row, col, "-");
+    MvPrintw(row, col, "-");
     showit();
 
     init_pair(1, get_colour(&bold), my_bg);
-    attrset(COLOR_PAIR(1) | bold);
-    mvprintw(row - 1, col - 1, " - ");
-    mvprintw(row + 0, col - 1, "-+-");
-    mvprintw(row + 1, col - 1, " - ");
+    (void) attrset(COLOR_PAIR(1) | bold);
+    MvPrintw(row - 1, col - 1, " - ");
+    MvPrintw(row + 0, col - 1, "-+-");
+    MvPrintw(row + 1, col - 1, " - ");
     showit();
 
     init_pair(1, get_colour(&bold), my_bg);
-    attrset(COLOR_PAIR(1) | bold);
-    mvprintw(row - 2, col - 2, " --- ");
-    mvprintw(row - 1, col - 2, "-+++-");
-    mvprintw(row + 0, col - 2, "-+#+-");
-    mvprintw(row + 1, col - 2, "-+++-");
-    mvprintw(row + 2, col - 2, " --- ");
+    (void) attrset(COLOR_PAIR(1) | bold);
+    MvPrintw(row - 2, col - 2, " --- ");
+    MvPrintw(row - 1, col - 2, "-+++-");
+    MvPrintw(row + 0, col - 2, "-+#+-");
+    MvPrintw(row + 1, col - 2, "-+++-");
+    MvPrintw(row + 2, col - 2, " --- ");
     showit();
 
     init_pair(1, get_colour(&bold), my_bg);
-    attrset(COLOR_PAIR(1) | bold);
-    mvprintw(row - 2, col - 2, " +++ ");
-    mvprintw(row - 1, col - 2, "++#++");
-    mvprintw(row + 0, col - 2, "+# #+");
-    mvprintw(row + 1, col - 2, "++#++");
-    mvprintw(row + 2, col - 2, " +++ ");
+    (void) attrset(COLOR_PAIR(1) | bold);
+    MvPrintw(row - 2, col - 2, " +++ ");
+    MvPrintw(row - 1, col - 2, "++#++");
+    MvPrintw(row + 0, col - 2, "+# #+");
+    MvPrintw(row + 1, col - 2, "++#++");
+    MvPrintw(row + 2, col - 2, " +++ ");
     showit();
 
     init_pair(1, get_colour(&bold), my_bg);
-    attrset(COLOR_PAIR(1) | bold);
-    mvprintw(row - 2, col - 2, "  #  ");
-    mvprintw(row - 1, col - 2, "## ##");
-    mvprintw(row + 0, col - 2, "#   #");
-    mvprintw(row + 1, col - 2, "## ##");
-    mvprintw(row + 2, col - 2, "  #  ");
+    (void) attrset(COLOR_PAIR(1) | bold);
+    MvPrintw(row - 2, col - 2, "  #  ");
+    MvPrintw(row - 1, col - 2, "## ##");
+    MvPrintw(row + 0, col - 2, "#   #");
+    MvPrintw(row + 1, col - 2, "## ##");
+    MvPrintw(row + 2, col - 2, "  #  ");
     showit();
 
     init_pair(1, get_colour(&bold), my_bg);
-    attrset(COLOR_PAIR(1) | bold);
-    mvprintw(row - 2, col - 2, " # # ");
-    mvprintw(row - 1, col - 2, "#   #");
-    mvprintw(row + 0, col - 2, "     ");
-    mvprintw(row + 1, col - 2, "#   #");
-    mvprintw(row + 2, col - 2, " # # ");
+    (void) attrset(COLOR_PAIR(1) | bold);
+    MvPrintw(row - 2, col - 2, " # # ");
+    MvPrintw(row - 1, col - 2, "#   #");
+    MvPrintw(row + 0, col - 2, "     ");
+    MvPrintw(row + 1, col - 2, "#   #");
+    MvPrintw(row + 2, col - 2, " # # ");
     showit();
 }
 
@@ -162,7 +162,7 @@
     }
     curs_set(0);
 
-    seed = time((time_t *) 0);
+    seed = (unsigned) time((time_t *) 0);
     srand(seed);
     for (;;) {
 	do {
@@ -173,9 +173,9 @@
 	    direction = (start > end) ? -1 : 1;
 	    diff = abs(start - end);
 	} while (diff < 2 || diff >= LINES - 2);
-	attrset(A_NORMAL);
+	(void) attrset(A_NORMAL);
 	for (row = 0; row < diff; row++) {
-	    mvprintw(LINES - row, start + (row * direction),
+	    MvPrintw(LINES - row, start + (row * direction),
 		     (direction < 0) ? "\\" : "/");
 	    if (flag++) {
 		showit();
@@ -187,7 +187,7 @@
 	    showit();
 	    flag = 0;
 	}
-	seed = time((time_t *) 0);
+	seed = (unsigned) time((time_t *) 0);
 	srand(seed);
 	explode(LINES - row, start + (diff * direction));
 	erase();
diff -Naur ncurses-5.7.orig/test/firstlast.c ncurses-5.7/test/firstlast.c
--- ncurses-5.7.orig/test/firstlast.c	2006-04-01 14:03:18.000000000 -0500
+++ ncurses-5.7/test/firstlast.c	2011-01-08 18:13:50.779157101 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2005,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            *
@@ -29,7 +29,7 @@
  * This test was written by Alexander V. Lukyanov to demonstrate difference
  * between ncurses 4.1 and SVR4 curses
  *
- * $Id: firstlast.c,v 1.5 2006/04/01 19:03:18 tom Exp $
+ * $Id: firstlast.c,v 1.7 2010/05/01 19:11:55 tom Exp $
  */
 
 #include <test.priv.h>
@@ -38,12 +38,19 @@
 fill(WINDOW *w, const char *str)
 {
     const char *s;
+    int x0 = -1, y0 = -1;
+    int x1, y1;
+
     for (;;) {
 	for (s = str; *s; s++) {
-	    if (waddch(w, UChar(*s)) == ERR) {
+	    getyx(w, y1, x1);
+	    if (waddch(w, UChar(*s)) == ERR
+		|| (x1 == x0 && y1 == y0)) {
 		wmove(w, 0, 0);
 		return;
 	    }
+	    x0 = x1;
+	    y0 = y1;
 	}
     }
 }
@@ -66,14 +73,14 @@
     wrefresh(large);
     wrefresh(small);
 
-    mvwaddstr(small, 5, 5, "   Test <place to change> String   ");
+    MvWAddStr(small, 5, 5, "   Test <place to change> String   ");
     wrefresh(small);
     getch();
 
     touchwin(large);
     wrefresh(large);
 
-    mvwaddstr(small, 5, 5, "   Test <***************> String   ");
+    MvWAddStr(small, 5, 5, "   Test <***************> String   ");
     wrefresh(small);
 
     /* DIFFERENCE! */
diff -Naur ncurses-5.7.orig/test/foldkeys.c ncurses-5.7/test/foldkeys.c
--- ncurses-5.7.orig/test/foldkeys.c	2006-12-09 11:54:07.000000000 -0500
+++ ncurses-5.7/test/foldkeys.c	2011-01-08 18:18:29.494656729 -0500
@@ -29,7 +29,7 @@
 /*
  * Author: Thomas E. Dickey, 2006
  *
- * $Id: foldkeys.c,v 1.3 2006/12/09 16:54:07 tom Exp $
+ * $Id: foldkeys.c,v 1.4 2010/11/14 01:00:53 tom Exp $
  *
  * Demonstrate a method for altering key definitions at runtime.
  *
@@ -229,8 +229,8 @@
 
 #if HAVE_GETTIMEOFDAY
 	gettimeofday(&current, 0);
-	secs = current.tv_sec - previous.tv_sec;
-	msecs = (current.tv_usec - previous.tv_usec) / 1000;
+	secs = (int) (current.tv_sec - previous.tv_sec);
+	msecs = (int) ((current.tv_usec - previous.tv_usec) / 1000);
 	if (msecs < 0) {
 	    msecs += 1000;
 	    --secs;
diff -Naur ncurses-5.7.orig/test/gdc.c ncurses-5.7/test/gdc.c
--- ncurses-5.7.orig/test/gdc.c	2008-08-03 19:58:42.000000000 -0400
+++ ncurses-5.7/test/gdc.c	2011-01-08 18:18:29.494656729 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2007,2008 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            *
@@ -33,7 +33,7 @@
  * modified 10-18-89 for curses (jrl)
  * 10-18-89 added signal handling
  *
- * $Id: gdc.c,v 1.31 2008/08/03 23:58:42 tom Exp $
+ * $Id: gdc.c,v 1.34 2010/11/13 21:01:23 tom Exp $
  */
 
 #include <test.priv.h>
@@ -78,22 +78,22 @@
     int n;
 
     if (hascolor)
-	attrset(COLOR_PAIR(PAIR_FRAMES));
+	(void) attrset(COLOR_PAIR(PAIR_FRAMES));
 
-    mvaddch(YBASE - 1, XBASE - 1, ACS_ULCORNER);
+    MvAddCh(YBASE - 1, XBASE - 1, ACS_ULCORNER);
     hline(ACS_HLINE, XLENGTH);
-    mvaddch(YBASE - 1, XBASE + XLENGTH, ACS_URCORNER);
+    MvAddCh(YBASE - 1, XBASE + XLENGTH, ACS_URCORNER);
 
-    mvaddch(YBASE + YDEPTH, XBASE - 1, ACS_LLCORNER);
+    MvAddCh(YBASE + YDEPTH, XBASE - 1, ACS_LLCORNER);
     if ((mvinchnstr(YBASE + YDEPTH, XBASE, bottom, XLENGTH)) != ERR) {
 	for (n = 0; n < XLENGTH; n++) {
 	    if (!scrolling)
 		bottom[n] &= ~A_COLOR;
 	    bottom[n] = ACS_HLINE | (bottom[n] & (A_ATTRIBUTES | A_COLOR));
 	}
-	mvaddchnstr(YBASE + YDEPTH, XBASE, bottom, XLENGTH);
+	(void) mvaddchnstr(YBASE + YDEPTH, XBASE, bottom, XLENGTH);
     }
-    mvaddch(YBASE + YDEPTH, XBASE + XLENGTH, ACS_LRCORNER);
+    MvAddCh(YBASE + YDEPTH, XBASE + XLENGTH, ACS_LRCORNER);
 
     move(YBASE, XBASE - 1);
     vline(ACS_VLINE, YDEPTH);
@@ -102,7 +102,7 @@
     vline(ACS_VLINE, YDEPTH);
 
     if (hascolor)
-	attrset(COLOR_PAIR(PAIR_OTHERS));
+	(void) attrset(COLOR_PAIR(PAIR_OTHERS));
 }
 
 static void
@@ -211,7 +211,7 @@
     hascolor = has_colors();
 
     if (hascolor) {
-	int bg = COLOR_BLACK;
+	short bg = COLOR_BLACK;
 	start_color();
 #if HAVE_USE_DEFAULT_COLORS
 	if (use_default_colors() == OK)
@@ -220,7 +220,7 @@
 	init_pair(PAIR_DIGITS, COLOR_BLACK, COLOR_RED);
 	init_pair(PAIR_OTHERS, COLOR_RED, bg);
 	init_pair(PAIR_FRAMES, COLOR_WHITE, bg);
-	attrset(COLOR_PAIR(PAIR_OTHERS));
+	(void) attrset(COLOR_PAIR(PAIR_OTHERS));
     }
 
   restart:
@@ -295,7 +295,7 @@
 	/* this depends on the detailed format of ctime(3) */
 	(void) strcpy(buf, ctime(&now));
 	(void) strcpy(buf + 10, buf + 19);
-	mvaddstr(16, 30, buf);
+	MvAddStr(16, 30, buf);
 
 	move(6, 0);
 	drawbox(FALSE);
@@ -335,7 +335,7 @@
 	    goto restart;
 	case ERR:
 	    if (sigtermed) {
-		standend();
+		(void) standend();
 		endwin();
 		fprintf(stderr, "gdc terminated by signal %d\n", sigtermed);
 		ExitProgram(EXIT_FAILURE);
@@ -345,7 +345,7 @@
 	    continue;
 	}
     } while (--count);
-    standend();
+    (void) standend();
     endwin();
     ExitProgram(EXIT_SUCCESS);
 }
diff -Naur ncurses-5.7.orig/test/hanoi.c ncurses-5.7/test/hanoi.c
--- ncurses-5.7.orig/test/hanoi.c	2008-08-04 06:57:59.000000000 -0400
+++ ncurses-5.7/test/hanoi.c	2011-01-08 18:18:29.494656729 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2006,2008 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            *
@@ -41,7 +41,7 @@
  *
  *	Date: 05.Nov.90
  *
- * $Id: hanoi.c,v 1.27 2008/08/04 10:57:59 tom Exp $
+ * $Id: hanoi.c,v 1.31 2010/11/14 01:01:07 tom Exp $
  */
 
 #include <test.priv.h>
@@ -67,8 +67,12 @@
 
 static struct Peg Pegs[NPEGS];
 static int PegPos[] =
-{LEFTPEG, MIDPEG, RIGHTPEG};
-static int TileColour[] =
+{
+    LEFTPEG,
+    MIDPEG,
+    RIGHTPEG
+};
+static short TileColour[] =
 {
     COLOR_GREEN,		/* Length 3 */
     COLOR_MAGENTA,		/* Length 5 */
@@ -132,14 +136,14 @@
     initscr();
     if (has_colors()) {
 	int i;
-	int bg = COLOR_BLACK;
+	short bg = COLOR_BLACK;
 	start_color();
 #if HAVE_USE_DEFAULT_COLORS
 	if (use_default_colors() == OK)
 	    bg = -1;
 #endif
 	for (i = 0; i < 9; i++)
-	    init_pair(i + 1, bg, TileColour[i]);
+	    init_pair((short) (i + 1), bg, TileColour[i]);
     }
     cbreak();
     if (LINES < 24) {
@@ -165,14 +169,14 @@
 	    if (GetMove(&FromCol, &ToCol))
 		break;
 	    if (InvalidMove(FromCol, ToCol)) {
-		mvaddstr(STATUSLINE, 0, "Invalid Move !!");
+		MvAddStr(STATUSLINE, 0, "Invalid Move !!");
 		refresh();
 		beep();
 		continue;
 	    }
 	    MakeMove(FromCol, ToCol);
 	    if (Solved(NTiles)) {
-		mvprintw(STATUSLINE, 0,
+		MvPrintw(STATUSLINE, 0,
 			 "Well Done !! You did it in %d moves", NMoves);
 		refresh();
 		sleep(5);
@@ -212,7 +216,7 @@
     int Size, SlotNo;
 
     for (Size = NTiles * 2 + 1, SlotNo = 0; Size >= 3; Size -= 2)
-	Pegs[0].Length[SlotNo++] = Size;
+	Pegs[0].Length[SlotNo++] = (size_t) Size;
 
     Pegs[0].Count = NTiles;
     Pegs[1].Count = 0;
@@ -226,48 +230,48 @@
     char TileBuf[BUFSIZ];
 
     erase();
-    mvaddstr(1, 24, "T O W E R S   O F   H A N O I");
-    mvaddstr(3, 34, "SJR 1990");
-    mvprintw(19, 5, "Moves : %d", NMoves);
-    attrset(A_REVERSE);
-    mvaddstr(BASELINE, 8,
+    MvAddStr(1, 24, "T O W E R S   O F   H A N O I");
+    MvAddStr(3, 34, "SJR 1990");
+    MvPrintw(19, 5, "Moves : %d", NMoves);
+    (void) attrset(A_REVERSE);
+    MvAddStr(BASELINE, 8,
 	     "                                                               ");
 
     for (Line = TOPLINE; Line < BASELINE; Line++) {
-	mvaddch(Line, LEFTPEG, ' ');
-	mvaddch(Line, MIDPEG, ' ');
-	mvaddch(Line, RIGHTPEG, ' ');
+	MvAddCh(Line, LEFTPEG, ' ');
+	MvAddCh(Line, MIDPEG, ' ');
+	MvAddCh(Line, RIGHTPEG, ' ');
     }
-    mvaddch(BASELINE, LEFTPEG, '1');
-    mvaddch(BASELINE, MIDPEG, '2');
-    mvaddch(BASELINE, RIGHTPEG, '3');
-    attrset(A_NORMAL);
+    MvAddCh(BASELINE, LEFTPEG, '1');
+    MvAddCh(BASELINE, MIDPEG, '2');
+    MvAddCh(BASELINE, RIGHTPEG, '3');
+    (void) attrset(A_NORMAL);
 
     /* Draw tiles */
     for (peg = 0; peg < NPEGS; peg++) {
 	for (SlotNo = 0; SlotNo < Pegs[peg].Count; SlotNo++) {
-	    unsigned len = Pegs[peg].Length[SlotNo];
-	    if (len < sizeof(TileBuf) - 1 && len < (unsigned) PegPos[peg]) {
+	    size_t len = Pegs[peg].Length[SlotNo];
+	    if (len < sizeof(TileBuf) - 1 && len < (size_t) PegPos[peg]) {
 		memset(TileBuf, ' ', len);
 		TileBuf[len] = '\0';
 		if (has_colors())
-		    attrset(COLOR_PAIR(LENTOIND(len)));
+		    (void) attrset(COLOR_PAIR(LENTOIND(len)));
 		else
-		    attrset(A_REVERSE);
-		mvaddstr(BASELINE - (SlotNo + 1),
-			 (int) (PegPos[peg] - len / 2),
+		    (void) attrset(A_REVERSE);
+		MvAddStr(BASELINE - (SlotNo + 1),
+			 (PegPos[peg] - (int) len / 2),
 			 TileBuf);
 	    }
 	}
     }
-    attrset(A_NORMAL);
+    (void) attrset(A_NORMAL);
     refresh();
 }
 
 static int
 GetMove(int *From, int *To)
 {
-    mvaddstr(STATUSLINE, 0, "Next move ('q' to quit) from ");
+    MvAddStr(STATUSLINE, 0, "Next move ('q' to quit) from ");
     clrtoeol();
     refresh();
     if ((*From = getch()) == 'q')
diff -Naur ncurses-5.7.orig/test/hashtest.c ncurses-5.7/test/hashtest.c
--- ncurses-5.7.orig/test/hashtest.c	2008-08-16 13:26:44.000000000 -0400
+++ ncurses-5.7/test/hashtest.c	2011-01-08 18:18:29.498656661 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2007,2008 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            *
@@ -30,7 +30,7 @@
  *
  * Generate timing statistics for vertical-motion optimization.
  *
- * $Id: hashtest.c,v 1.29 2008/08/16 17:26:44 tom Exp $
+ * $Id: hashtest.c,v 1.31 2010/11/13 23:43:15 tom Exp $
  */
 
 #include <test.priv.h>
@@ -86,7 +86,8 @@
 
     move(head_lines, 0);
     for (i = head_lines; i < LINES - foot_lines; i++) {
-	chtype c = (base - LO_CHAR + i) % (HI_CHAR - LO_CHAR + 1) + LO_CHAR;
+	chtype c = (chtype) ((base - LO_CHAR + i) % (HI_CHAR - LO_CHAR + 1)
+			     + LO_CHAR);
 	int hi = (extend_corner || (i < LINES - 1)) ? COLS : COLS - 1;
 	for (j = 0; j < hi; j++)
 	    addch(c);
@@ -140,10 +141,10 @@
 #endif
 
     if (reverse_loops)
-	for (ch = hi; ch >= lo; ch--)
+	for (ch = (char) hi; ch >= lo; ch--)
 	    one_cycle(ch);
     else
-	for (ch = lo; ch <= hi; ch++)
+	for (ch = (char) lo; ch <= hi; ch++)
 	    one_cycle(ch);
 }
 
diff -Naur ncurses-5.7.orig/test/inch_wide.c ncurses-5.7/test/inch_wide.c
--- ncurses-5.7.orig/test/inch_wide.c	2007-07-21 14:37:38.000000000 -0400
+++ ncurses-5.7/test/inch_wide.c	2011-01-08 18:13:50.783157055 -0500
@@ -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,7 +26,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: inch_wide.c,v 1.6 2007/07/21 18:37:38 tom Exp $
+ * $Id: inch_wide.c,v 1.7 2010/05/01 19:13:46 tom Exp $
  */
 /*
        int in_wch(cchar_t *wcval);
@@ -153,7 +153,7 @@
 	    break;
 	}
 
-	mvwprintw(chrwin, 0, 0, "char:");
+	MvWPrintw(chrwin, 0, 0, "char:");
 	wclrtoeol(chrwin);
 
 	if (txtwin != stdscr) {
@@ -189,7 +189,7 @@
 	}
 	wnoutrefresh(chrwin);
 
-	mvwprintw(strwin, 0, 0, "text:");
+	MvWPrintw(strwin, 0, 0, "text:");
 	wclrtobot(strwin);
 
 	limit = getmaxx(strwin) - 5;
@@ -197,38 +197,38 @@
 	if (txtwin != stdscr) {
 	    wmove(txtwin, txt_y, txt_x);
 	    if (win_wchstr(txtwin, text) != ERR) {
-		mvwadd_wchstr(strwin, 0, 5, text);
+		(void) mvwadd_wchstr(strwin, 0, 5, text);
 	    }
 
 	    wmove(txtwin, txt_y, txt_x);
 	    if (win_wchnstr(txtwin, text, limit) != ERR) {
-		mvwadd_wchstr(strwin, 1, 5, text);
+		(void) mvwadd_wchstr(strwin, 1, 5, text);
 	    }
 
 	    if (mvwin_wchstr(txtwin, txt_y, txt_x, text) != ERR) {
-		mvwadd_wchstr(strwin, 2, 5, text);
+		(void) mvwadd_wchstr(strwin, 2, 5, text);
 	    }
 
 	    if (mvwin_wchnstr(txtwin, txt_y, txt_x, text, limit) != ERR) {
-		mvwadd_wchstr(strwin, 3, 5, text);
+		(void) mvwadd_wchstr(strwin, 3, 5, text);
 	    }
 	} else {
 	    move(txt_y, txt_x);
 	    if (in_wchstr(text) != ERR) {
-		mvwadd_wchstr(strwin, 0, 5, text);
+		(void) mvwadd_wchstr(strwin, 0, 5, text);
 	    }
 
 	    move(txt_y, txt_x);
 	    if (in_wchnstr(text, limit) != ERR) {
-		mvwadd_wchstr(strwin, 1, 5, text);
+		(void) mvwadd_wchstr(strwin, 1, 5, text);
 	    }
 
 	    if (mvin_wchstr(txt_y, txt_x, text) != ERR) {
-		mvwadd_wchstr(strwin, 2, 5, text);
+		(void) mvwadd_wchstr(strwin, 2, 5, text);
 	    }
 
 	    if (mvin_wchnstr(txt_y, txt_x, text, limit) != ERR) {
-		mvwadd_wchstr(strwin, 3, 5, text);
+		(void) mvwadd_wchstr(strwin, 3, 5, text);
 	    }
 	}
 
diff -Naur ncurses-5.7.orig/test/inchs.c ncurses-5.7/test/inchs.c
--- ncurses-5.7.orig/test/inchs.c	2007-07-21 15:01:43.000000000 -0400
+++ ncurses-5.7/test/inchs.c	2011-01-08 18:18:29.498656661 -0500
@@ -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,7 +26,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: inchs.c,v 1.9 2007/07/21 19:01:43 tom Exp $
+ * $Id: inchs.c,v 1.11 2010/11/13 23:41:23 tom Exp $
  *
  * Author: Thomas E Dickey
  */
@@ -152,16 +152,16 @@
 	    break;
 	}
 
-	mvwprintw(chrwin, 0, 0, "char:");
+	MvWPrintw(chrwin, 0, 0, "char:");
 	wclrtoeol(chrwin);
 
 	if (txtwin != stdscr) {
 	    wmove(txtwin, txt_y, txt_x);
 
-	    if ((ch = winch(txtwin)) != ERR) {
+	    if ((ch = (int) winch(txtwin)) != ERR) {
 		if (waddch(chrwin, (chtype) ch) != ERR) {
 		    for (j = txt_x + 1; j < getmaxx(txtwin); ++j) {
-			if ((ch = mvwinch(txtwin, txt_y, j)) != ERR) {
+			if ((ch = (int) mvwinch(txtwin, txt_y, j)) != ERR) {
 			    if (waddch(chrwin, (chtype) ch) == ERR) {
 				break;
 			    }
@@ -174,10 +174,10 @@
 	} else {
 	    move(txt_y, txt_x);
 
-	    if ((ch = inch()) != ERR) {
+	    if ((ch = (int) inch()) != ERR) {
 		if (waddch(chrwin, (chtype) ch) != ERR) {
 		    for (j = txt_x + 1; j < getmaxx(txtwin); ++j) {
-			if ((ch = mvinch(txt_y, j)) != ERR) {
+			if ((ch = (int) mvinch(txt_y, j)) != ERR) {
 			    if (waddch(chrwin, (chtype) ch) == ERR) {
 				break;
 			    }
@@ -190,7 +190,7 @@
 	}
 	wnoutrefresh(chrwin);
 
-	mvwprintw(strwin, 0, 0, "text:");
+	MvWPrintw(strwin, 0, 0, "text:");
 	wclrtobot(strwin);
 
 	limit = getmaxx(strwin) - 5;
@@ -198,38 +198,38 @@
 	if (txtwin != stdscr) {
 	    wmove(txtwin, txt_y, txt_x);
 	    if (winchstr(txtwin, text) != ERR) {
-		mvwaddchstr(strwin, 0, 5, text);
+		MvWAddChStr(strwin, 0, 5, text);
 	    }
 
 	    wmove(txtwin, txt_y, txt_x);
 	    if (winchnstr(txtwin, text, limit) != ERR) {
-		mvwaddchstr(strwin, 1, 5, text);
+		MvWAddChStr(strwin, 1, 5, text);
 	    }
 
 	    if (mvwinchstr(txtwin, txt_y, txt_x, text) != ERR) {
-		mvwaddchstr(strwin, 2, 5, text);
+		MvWAddChStr(strwin, 2, 5, text);
 	    }
 
 	    if (mvwinchnstr(txtwin, txt_y, txt_x, text, limit) != ERR) {
-		mvwaddchstr(strwin, 3, 5, text);
+		MvWAddChStr(strwin, 3, 5, text);
 	    }
 	} else {
 	    move(txt_y, txt_x);
 	    if (inchstr(text) != ERR) {
-		mvwaddchstr(strwin, 0, 5, text);
+		MvWAddChStr(strwin, 0, 5, text);
 	    }
 
 	    move(txt_y, txt_x);
 	    if (inchnstr(text, limit) != ERR) {
-		mvwaddchstr(strwin, 1, 5, text);
+		MvWAddChStr(strwin, 1, 5, text);
 	    }
 
 	    if (mvinchstr(txt_y, txt_x, text) != ERR) {
-		mvwaddchstr(strwin, 2, 5, text);
+		MvWAddChStr(strwin, 2, 5, text);
 	    }
 
 	    if (mvinchnstr(txt_y, txt_x, text, limit) != ERR) {
-		mvwaddchstr(strwin, 3, 5, text);
+		MvWAddChStr(strwin, 3, 5, text);
 	    }
 	}
 
diff -Naur ncurses-5.7.orig/test/ins_wide.c ncurses-5.7/test/ins_wide.c
--- ncurses-5.7.orig/test/ins_wide.c	2007-07-21 13:41:55.000000000 -0400
+++ ncurses-5.7/test/ins_wide.c	2011-01-08 18:18:29.738781565 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2002-2006,2007 Free Software Foundation, Inc.              *
+ * Copyright (c) 2002-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            *
@@ -26,7 +26,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: ins_wide.c,v 1.9 2007/07/21 17:41:55 tom Exp $
+ * $Id: ins_wide.c,v 1.15 2010/12/12 00:20:14 tom Exp $
  *
  * Demonstrate the wins_wstr() and wins_wch functions.
  * Thomas Dickey - 2002/11/23
@@ -45,13 +45,16 @@
 
 #if USE_WIDEC_SUPPORT
 
+#define WIDE_LINEDATA
+#include <linedata.h>
+
 /* definitions to make it simpler to compare with inserts.c */
 #define InsNStr    ins_nwstr
 #define InsStr     ins_wstr
-#define MvInsNStr  mvins_nwstr
-#define MvInsStr   mvins_wstr
-#define MvWInsNStr mvwins_nwstr
-#define MvWInsStr  mvwins_wstr
+#define MvInsNStr  (void) mvins_nwstr
+#define MvInsStr   (void) mvins_wstr
+#define MvWInsNStr (void) mvwins_nwstr
+#define MvWInsStr  (void) mvwins_wstr
 #define WInsNStr   wins_nwstr
 #define WInsStr    wins_wstr
 
@@ -71,7 +74,7 @@
 static void
 legend(WINDOW *win, int level, Options state, wchar_t *buffer, int length)
 {
-    NCURSES_CONST char *showstate;
+    const char *showstate;
 
     switch (state) {
     default:
@@ -93,7 +96,7 @@
     wprintw(win,
 	    "The Strings/Chars displays should match.  Enter any characters, except:\n");
     wprintw(win,
-	    "down-arrow or ^N to repeat on next line, 'w' for inner window, 'q' to exit.\n");
+	    "down-arrow or ^N to repeat on next line, ^W for inner window, ESC to exit.\n");
     wclrtoeol(win);
     wprintw(win, "Level %d,%s inserted %d characters <", level,
 	    showstate, length);
@@ -143,7 +146,7 @@
 {
     wchar_t tmp_wchar[2];
 
-    tmp_wchar[0] = source;
+    tmp_wchar[0] = (wchar_t) source;
     tmp_wchar[1] = 0;
     if (setcchar(target, tmp_wchar, A_NORMAL, 0, (void *) 0) == ERR) {
 	beep();
@@ -214,8 +217,7 @@
 {
     static bool first = TRUE;
 
-    wint_t ch;
-    int code;
+    int ch;
     int limit;
     int row = 1;
     int col;
@@ -256,14 +258,14 @@
     keypad(work, TRUE);
 
     for (col = margin + 1; col < COLS; col += MY_TABSIZE)
-	mvwvline(work, row, col, '.', limit - 2);
+	MvWVLine(work, row, col, '.', limit - 2);
 
-    mvwvline(work, row, margin, ACS_VLINE, limit - 2);
-    mvwvline(work, row, margin + 1, ACS_VLINE, limit - 2);
+    MvWVLine(work, row, margin, ACS_VLINE, limit - 2);
+    MvWVLine(work, row, margin + 1, ACS_VLINE, limit - 2);
     limit /= 2;
 
-    mvwaddstr(work, 1, 2, "String");
-    mvwaddstr(work, limit + 1, 2, "Chars");
+    MvWAddStr(work, 1, 2, "String");
+    MvWAddStr(work, limit + 1, 2, "Chars");
     wnoutrefresh(work);
 
     buffer[length = 0] = '\0';
@@ -282,30 +284,10 @@
 	wbkgdset(work, COLOR_PAIR(1) | ' ');
     }
 
-    while ((code = wget_wch(work, &ch)) != ERR) {
-
-	if (code == KEY_CODE_YES) {
-	    switch (ch) {
-	    case KEY_DOWN:
-		ch = CTRL('N');
-		break;
-	    case KEY_BACKSPACE:
-		ch = '\b';
-		break;
-	    default:
-		beep();
-		continue;
-	    }
-	} else if (code == ERR) {
-	    beep();
-	    break;
-	}
-	if (ch == 'q')
-	    break;
-
+    while ((ch = read_linedata(work)) != ERR && !isQUIT(ch)) {
 	wmove(work, row, margin + 1);
 	switch (ch) {
-	case 'w':
+	case key_RECUR:
 	    test_inserts(level + 1);
 
 	    touchwin(look);
@@ -318,7 +300,7 @@
 
 	    doupdate();
 	    break;
-	case CTRL('N'):
+	case key_NEWLINE:
 	    if (row < limit) {
 		++row;
 		/* put the whole string in, all at once */
@@ -401,9 +383,6 @@
 		beep();
 	    }
 	    break;
-	case KEY_BACKSPACE:
-	    ch = '\b';
-	    /* FALLTHRU */
 	default:
 	    buffer[length++] = ch;
 	    buffer[length] = '\0';
@@ -433,19 +412,19 @@
 	    switch (option) {
 	    case oDefault:
 		if (move(limit + row, col) != ERR) {
-		    InsCh(ch);
+		    InsCh((chtype) ch);
 		}
 		break;
 	    case oMove:
-		MvInsCh(limit + row, col, ch);
+		MvInsCh(limit + row, col, (chtype) ch);
 		break;
 	    case oWindow:
 		if (wmove(work, limit + row, col) != ERR) {
-		    WInsCh(work, ch);
+		    WInsCh(work, (chtype) ch);
 		}
 		break;
 	    case oMoveWindow:
-		MvWInsCh(work, limit + row, col, ch);
+		MvWInsCh(work, limit + row, col, (chtype) ch);
 		break;
 	    }
 
@@ -473,6 +452,7 @@
 	"Usage: inserts [options]"
 	,""
 	,"Options:"
+	,"  -f FILE read data from given file"
 	,"  -n NUM  limit string-inserts to NUM bytes on ^N replay"
 	,"  -m      perform wmove/move separately from insert-functions"
 	,"  -w      use window-parameter even when stdscr would be implied"
@@ -490,8 +470,11 @@
 
     setlocale(LC_ALL, "");
 
-    while ((ch = getopt(argc, argv, "mn:w")) != -1) {
+    while ((ch = getopt(argc, argv, "f:mn:w")) != -1) {
 	switch (ch) {
+	case 'f':
+	    init_linedata(optarg);
+	    break;
 	case 'm':
 	    m_opt = TRUE;
 	    break;
diff -Naur ncurses-5.7.orig/test/insdelln.c ncurses-5.7/test/insdelln.c
--- ncurses-5.7.orig/test/insdelln.c	1969-12-31 19:00:00.000000000 -0500
+++ ncurses-5.7/test/insdelln.c	2011-01-08 18:18:29.498656661 -0500
@@ -0,0 +1,387 @@
+/****************************************************************************
+ * Copyright (c) 2008-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            *
+ * "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: insdelln.c,v 1.5 2010/11/13 23:39:38 tom Exp $
+ *
+ * test-driver for deleteln, wdeleteln, insdelln, winsdelln, insertln, winsertln
+ */
+
+#include <test.priv.h>
+
+#define SHOW(n) ((n) == ERR ? "ERR" : "OK")
+#define COLOR_DEFAULT (-1)
+
+typedef struct {
+    unsigned c;
+    unsigned v;
+    int pair;
+    unsigned attr;
+    int count;
+    int ch;
+    const char *c_msg;
+    const char *v_msg;
+    int y_val;
+    int x_val;
+    int y_beg, x_beg;
+    int y_max, x_max;
+} STATUS;
+
+static const char *
+color_params(unsigned state, int *pair)
+{
+    /* *INDENT-OFF* */
+    static struct {
+	short pair;
+	short fg, bg;
+	const char *msg;
+    } table[] = {
+	{ 0, COLOR_DEFAULT, COLOR_DEFAULT, "default" },
+	{ 1, COLOR_RED,     COLOR_BLACK,   "red/black" },
+	{ 2, COLOR_WHITE,   COLOR_BLUE,    "white/blue" },
+    };
+    /* *INDENT-ON* */
+
+    static bool first = TRUE;
+    const char *result = 0;
+
+    if (has_colors()) {
+	if (first) {
+	    unsigned n;
+
+	    start_color();
+	    for (n = 0; n < SIZEOF(table); ++n) {
+		init_pair(table[n].pair, table[n].fg, table[n].bg);
+	    }
+	}
+	if (state < SIZEOF(table)) {
+	    *pair = table[state].pair;
+	    result = table[state].msg;
+	}
+    }
+    return result;
+}
+
+static const char *
+video_params(unsigned state, unsigned *attr)
+{
+    /* *INDENT-OFF* */
+    static struct {
+	unsigned attr;
+	const char *msg;
+    } table[] = {
+	{ A_NORMAL,	"normal" },
+	{ A_BOLD,	"bold" },
+	{ A_REVERSE,	"reverse" },
+	{ A_UNDERLINE,	"underline" },
+	{ A_BLINK, 	"blink" },
+    };
+    /* *INDENT-ON* */
+
+    const char *result = 0;
+
+    if (state < SIZEOF(table)) {
+	*attr = table[state].attr;
+	result = table[state].msg;
+    }
+    return result;
+}
+
+/* fill the window with a test-pattern */
+static void
+fill_window(WINDOW *win)
+{
+    int y, x;
+    int y0 = -1, x0 = -1;
+
+    getyx(win, y, x);
+    wmove(win, 0, 0);
+    while (waddstr(win, "0123456789 abcdefghijklmnopqrstuvwxyz ") != ERR) {
+	int y1, x1;
+	getyx(win, y1, x1);
+	if (y1 == y0 && x1 == x0)
+	    break;
+	x0 = x1;
+	y0 = y1;
+    }
+    wmove(win, y, x);
+}
+
+static void
+show_status(WINDOW *win, STATUS * sp)
+{
+    int y, x;
+
+    getyx(win, y, x);
+    wmove(win, 0, 0);
+    wprintw(win, "Count %d", sp->count);
+    if (sp->v_msg != 0)
+	wprintw(win, " Video %s", sp->v_msg);
+    if (sp->c_msg != 0)
+	wprintw(win, " Color %s", sp->c_msg);
+    wclrtoeol(win);
+    wmove(win, y, x);
+}
+
+static void
+reshow_status(WINDOW *win, STATUS * sp)
+{
+    fill_window(win);
+    show_status(win, sp);
+}
+
+static void
+do_subwindow(WINDOW *win, STATUS * sp, void func(WINDOW *))
+{
+    WINDOW *win1 = newwin(sp->y_max - 2, sp->x_max - 2,
+			  sp->y_beg + 1, sp->x_beg + 1);
+
+    if (win1 != 0 && sp->y_max > 4 && sp->x_max > 4) {
+	WINDOW *win2 = derwin(win1, sp->y_max - 4, sp->x_max - 4, 1, 1);
+
+	if (win2 != 0) {
+	    box(win1, 0, 0);
+	    wrefresh(win1);
+	    func(win2);
+
+	    delwin(win2);
+	} else {
+	    beep();
+	}
+	delwin(win1);
+	touchwin(win);
+    } else {
+	beep();
+    }
+}
+
+static void
+init_status(WINDOW *win, STATUS * sp)
+{
+    memset(sp, 0, sizeof(*sp));
+    sp->c = 99;
+    sp->v = 99;
+    sp->ch = ' ';
+
+    keypad(win, TRUE);
+    fill_window(win);
+
+    getbegyx(win, sp->y_beg, sp->x_beg);
+    getmaxyx(win, sp->y_max, sp->x_max);
+}
+
+static void
+show_help(WINDOW *win)
+{
+    static const char *table[] =
+    {
+	"Basic commands:"
+	,"Use h/j/k/l or arrow keys to move the cursor."
+	,"Set the count parameter for insert/delete by entering digits 0-9."
+	,""
+	,"Other commands:"
+	,"space toggles through the set of video attributes and colors."
+	,"t     touches (forces repaint) of the current line."
+	,"i     calls insertln at the current position with the given count."
+	,"d     calls deleteln at the window beginning with the given count."
+	,"I     calls insdelln at the window beginning with the given count."
+	,"D     calls insdelln at the window beginning with the given -count."
+	,"f     refills the window with test-pattern using current attributes."
+	,"w     recur to test windows other than stdscr"
+	,"q     quit"
+	,"=     resets count to zero."
+	,"?     shows this help-window"
+	,""
+	,""
+    };
+
+    int y_max, x_max;
+    int row;
+
+    getmaxyx(win, y_max, x_max);
+    for (row = 0; row < (int) SIZEOF(table) && row < y_max; ++row) {
+	MvWPrintw(win, row, 0, "%.*s", x_max, table[row]);
+    }
+    while (wgetch(win) != 'q')
+	beep();
+}
+
+static void
+update_status(WINDOW *win, STATUS * sp)
+{
+    switch (sp->ch) {
+    case ' ':			/* next test-iteration */
+	if (has_colors()) {
+	    if ((sp->c_msg = color_params(++(sp->c), &(sp->pair))) == 0) {
+		sp->c_msg = color_params(sp->c = 0, &(sp->pair));
+		if ((sp->v_msg = video_params(++(sp->v), &(sp->attr))) == 0) {
+		    sp->v_msg = video_params(sp->v = 0, &(sp->attr));
+		}
+	    }
+	} else {
+	    if ((sp->v_msg = video_params(++(sp->v), &(sp->attr))) == 0) {
+		sp->v_msg = video_params(sp->v = 0, &(sp->attr));
+	    }
+	}
+	sp->count = 0;
+	show_status(win, sp);
+	break;
+    case KEY_LEFT:
+    case 'h':
+	if (sp->x_val > 0)
+	    wmove(win, sp->y_val, --(sp->x_val));
+	break;
+    case KEY_DOWN:
+    case 'j':
+	if (sp->y_val < sp->y_max)
+	    wmove(win, ++(sp->y_val), sp->x_val);
+	break;
+    case KEY_UP:
+    case 'k':
+	if (sp->y_val > 0)
+	    wmove(win, --(sp->y_val), sp->x_val);
+	break;
+    case KEY_RIGHT:
+    case 'l':
+	if (sp->x_val < sp->x_max)
+	    wmove(win, sp->y_val, ++(sp->x_val));
+	break;
+    case 't':
+	touchline(win, sp->y_val, 1);
+	break;
+    case '=':
+	sp->count = 0;
+	show_status(win, sp);
+	break;
+    case '?':
+	do_subwindow(win, sp, show_help);
+	break;
+    default:
+	if (isdigit(sp->ch)) {
+	    sp->count = (sp->count * 10) + (sp->ch - '0');
+	    show_status(win, sp);
+	} else {
+	    beep();
+	}
+	break;
+    }
+}
+
+static void
+test_winsdelln(WINDOW *win)
+{
+    STATUS st;
+    int n;
+
+    init_status(win, &st);
+
+    do {
+	(void) wattrset(win, st.attr | (attr_t) COLOR_PAIR(st.pair));
+	switch (st.ch) {
+	case 'i':
+	    for (n = 0; n < st.count; ++n)
+		winsertln(win);
+	    break;
+	case 'd':
+	    for (n = 0; n < st.count; ++n)
+		wdeleteln(win);
+	    break;
+	case 'I':
+	    winsdelln(win, st.count);
+	    break;
+	case 'D':
+	    winsdelln(win, -st.count);
+	    break;
+	case 'f':
+	    fill_window(win);
+	    reshow_status(win, &st);
+	    break;
+	case 'w':
+	    do_subwindow(win, &st, test_winsdelln);
+	    break;
+	case 'q':
+	    return;
+	default:
+	    update_status(win, &st);
+	    break;
+	}
+    } while ((st.ch = wgetch(win)) != ERR);
+}
+
+static void
+test_insdelln(void)
+{
+    STATUS st;
+    int n;
+
+    init_status(stdscr, &st);
+
+    do {
+	(void) attrset(st.attr | (attr_t) COLOR_PAIR(st.pair));
+	switch (st.ch) {
+	case 'i':
+	    for (n = 0; n < st.count; ++n)
+		insertln();
+	    break;
+	case 'd':
+	    for (n = 0; n < st.count; ++n)
+		deleteln();
+	    break;
+	case 'I':
+	    insdelln(st.count);
+	    break;
+	case 'D':
+	    insdelln(-st.count);
+	    break;
+	case 'f':
+	    fill_window(stdscr);
+	    reshow_status(stdscr, &st);
+	    break;
+	case 'w':
+	    do_subwindow(stdscr, &st, test_winsdelln);
+	    break;
+	case 'q':
+	    return;
+	default:
+	    update_status(stdscr, &st);
+	    break;
+	}
+    } while ((st.ch = getch()) != ERR);
+}
+
+int
+main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
+{
+    initscr();
+    cbreak();
+    noecho();
+
+    test_insdelln();
+    endwin();
+
+    ExitProgram(EXIT_SUCCESS);
+}
diff -Naur ncurses-5.7.orig/test/inserts.c ncurses-5.7/test/inserts.c
--- ncurses-5.7.orig/test/inserts.c	2007-07-21 13:41:55.000000000 -0400
+++ ncurses-5.7/test/inserts.c	2011-01-08 18:18:29.738781565 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2002-2006,2007 Free Software Foundation, Inc.              *
+ * Copyright (c) 2002-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            *
@@ -26,7 +26,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: inserts.c,v 1.18 2007/07/21 17:41:55 tom Exp $
+ * $Id: inserts.c,v 1.23 2010/12/12 00:19:55 tom Exp $
  *
  * Demonstrate the winsstr() and winsch functions.
  * Thomas Dickey - 2002/10/19
@@ -36,18 +36,20 @@
 
 #if HAVE_WINSSTR
 
+#include <linedata.h>
+
 #define InsNStr    insnstr
 #define InsStr     insstr
-#define MvInsNStr  mvinsnstr
-#define MvInsStr   mvinsstr
-#define MvWInsNStr mvwinsnstr
-#define MvWInsStr  mvwinsstr
+#define MvInsNStr  (void) mvinsnstr
+#define MvInsStr   (void) mvinsstr
+#define MvWInsNStr (void) mvwinsnstr
+#define MvWInsStr  (void) mvwinsstr
 #define WInsNStr   winsnstr
 #define WInsStr    winsstr
 
 #define InsCh      insch
-#define MvInsCh    mvinsch
-#define MvWInsCh   mvwinsch
+#define MvInsCh    (void) mvinsch
+#define MvWInsCh   (void) mvwinsch
 #define WInsCh     winsch
 
 #define MY_TABSIZE 8
@@ -66,7 +68,7 @@
 static void
 legend(WINDOW *win, int level, Options state, char *buffer, int length)
 {
-    NCURSES_CONST char *showstate;
+    const char *showstate;
 
     switch (state) {
     default:
@@ -88,7 +90,7 @@
     wprintw(win,
 	    "The Strings/Chars displays should match.  Enter any characters, except:\n");
     wprintw(win,
-	    "down-arrow or ^N to repeat on next line, 'w' for inner window, 'q' to exit.\n");
+	    "down-arrow or ^N to repeat on next line, ^W for inner window, ESC to exit.\n");
     wclrtoeol(win);
     wprintw(win, "Level %d,%s inserted %d characters <%s>", level,
 	    showstate, length, buffer);
@@ -182,14 +184,14 @@
     keypad(work, TRUE);
 
     for (col = margin + 1; col < COLS; col += MY_TABSIZE)
-	mvwvline(work, row, col, '.', limit - 2);
+	MvWVLine(work, row, col, '.', limit - 2);
 
-    mvwvline(work, row, margin, ACS_VLINE, limit - 2);
-    mvwvline(work, row, margin + 1, ACS_VLINE, limit - 2);
+    MvWVLine(work, row, margin, ACS_VLINE, limit - 2);
+    MvWVLine(work, row, margin + 1, ACS_VLINE, limit - 2);
     limit /= 2;
 
-    mvwaddstr(work, 1, 2, "String");
-    mvwaddstr(work, limit + 1, 2, "Chars");
+    MvWAddStr(work, 1, 2, "String");
+    MvWAddStr(work, limit + 1, 2, "Chars");
     wnoutrefresh(work);
 
     buffer[length = 0] = '\0';
@@ -208,14 +210,10 @@
 	wbkgdset(work, COLOR_PAIR(1) | ' ');
     }
 
-    while ((ch = wgetch(work)) != 'q') {
-	if (ch == ERR) {
-	    beep();
-	    break;
-	}
+    while ((ch = read_linedata(work)) != ERR && !isQUIT(ch)) {
 	wmove(work, row, margin + 1);
 	switch (ch) {
-	case 'w':
+	case key_RECUR:
 	    test_inserts(level + 1);
 
 	    touchwin(look);
@@ -228,8 +226,7 @@
 
 	    doupdate();
 	    break;
-	case CTRL('N'):
-	case KEY_DOWN:
+	case key_NEWLINE:
 	    if (row < limit) {
 		++row;
 		/* put the whole string in, all at once */
@@ -312,15 +309,12 @@
 		beep();
 	    }
 	    break;
-	case KEY_BACKSPACE:
-	    ch = '\b';
-	    /* FALLTHRU */
 	default:
 	    if (ch <= 0 || ch > 255) {
 		beep();
 		break;
 	    }
-	    buffer[length++] = ch;
+	    buffer[length++] = (char) ch;
 	    buffer[length] = '\0';
 
 	    /* put the string in, one character at a time */
@@ -388,6 +382,7 @@
 	"Usage: inserts [options]"
 	,""
 	,"Options:"
+	,"  -f FILE read data from given file"
 	,"  -n NUM  limit string-inserts to NUM bytes on ^N replay"
 	,"  -m      perform wmove/move separately from insert-functions"
 	,"  -w      use window-parameter even when stdscr would be implied"
@@ -405,8 +400,11 @@
 
     setlocale(LC_ALL, "");
 
-    while ((ch = getopt(argc, argv, "mn:w")) != -1) {
+    while ((ch = getopt(argc, argv, "f:mn:w")) != -1) {
 	switch (ch) {
+	case 'f':
+	    init_linedata(optarg);
+	    break;
 	case 'm':
 	    m_opt = TRUE;
 	    break;
diff -Naur ncurses-5.7.orig/test/knight.c ncurses-5.7/test/knight.c
--- ncurses-5.7.orig/test/knight.c	2008-08-03 19:04:26.000000000 -0400
+++ ncurses-5.7/test/knight.c	2011-01-08 18:18:29.498656661 -0500
@@ -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            *
@@ -33,7 +33,7 @@
  * Eric S. Raymond <esr@snark.thyrsus.com> July 22 1995.  Mouse support
  * added September 20th 1995.
  *
- * $Id: knight.c,v 1.28 2008/08/03 23:04:26 tom Exp $
+ * $Id: knight.c,v 1.31 2010/11/13 20:44:21 tom Exp $
  */
 
 #include <test.priv.h>
@@ -119,9 +119,9 @@
 	    bg = -1;
 #endif
 
-	(void) init_pair(TRAIL_COLOR, COLOR_CYAN, bg);
-	(void) init_pair(PLUS_COLOR, COLOR_RED, bg);
-	(void) init_pair(MINUS_COLOR, COLOR_GREEN, bg);
+	(void) init_pair(TRAIL_COLOR, (short) COLOR_CYAN, (short) bg);
+	(void) init_pair(PLUS_COLOR, (short) COLOR_RED, (short) bg);
+	(void) init_pair(MINUS_COLOR, (short) COLOR_GREEN, (short) bg);
 
 	trail |= COLOR_PAIR(TRAIL_COLOR);
 	plus |= COLOR_PAIR(PLUS_COLOR);
@@ -155,8 +155,8 @@
     (void) waddstr(helpwin, "puzzle; also inform you when you run out\n");
     (void) waddstr(helpwin, "of legal moves.\n\n");
 
-    (void) mvwaddstr(helpwin, NOTIFYY - INSTRY, 0,
-		     "Press `?' to go to keystroke help.");
+    MvWAddStr(helpwin, NOTIFYY - INSTRY, 0,
+	      "Press `?' to go to keystroke help.");
 }
 
 static void
@@ -181,8 +181,8 @@
     (void) waddstr(helpwin, "square with spacebar, Enter, or the keypad\n");
     (void) waddstr(helpwin, "center key.  Use F/B to review the path.\n");
 
-    (void) mvwaddstr(helpwin, NOTIFYY - INSTRY, 0,
-		     "Press `?' to go to game explanation");
+    MvWAddStr(helpwin, NOTIFYY - INSTRY, 0,
+	      "Press `?' to go to game explanation");
 }
 
 static void
@@ -226,7 +226,7 @@
 {
     int i, j;
 
-    mvaddstr(0, 20, "KNIGHT'S MOVE -- a logical solitaire");
+    MvAddStr(0, 20, "KNIGHT'S MOVE -- a logical solitaire");
 
     move(BOARDY, BOARDX);
     waddch(boardwin, ACS_ULCORNER);
@@ -319,12 +319,12 @@
 	    newx = oldx + offsets[k].x;
 	    if (chksqr(newy, newx)) {
 		if (first < 0)
-		    first = k;
+		    first = (int) k;
 		if (newy == *y
 		    && newx == *x) {
-		    found = k;
+		    found = (int) k;
 		} else if (found >= 0) {
-		    next = k;
+		    next = (int) k;
 		    break;
 		}
 	    }
@@ -586,8 +586,8 @@
 			     history[movecount - 1].y,
 			     history[movecount - 1].x,
 			     rw, col);
-		    history[movecount].y = rw;
-		    history[movecount].x = col;
+		    history[movecount].y = (short) rw;
+		    history[movecount].x = (short) col;
 		    movecount++;
 		    trialcount++;
 
diff -Naur ncurses-5.7.orig/test/linedata.h ncurses-5.7/test/linedata.h
--- ncurses-5.7.orig/test/linedata.h	1969-12-31 19:00:00.000000000 -0500
+++ ncurses-5.7/test/linedata.h	2011-01-08 18:18:29.498656661 -0500
@@ -0,0 +1,100 @@
+/****************************************************************************
+ * Copyright (c) 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            *
+ * "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.                                                           *
+ ****************************************************************************/
+
+#define isQUIT(c)     ((c) == QUIT || (c) == ESCAPE)
+
+#define key_RECUR     CTRL('W')
+#define key_NEWLINE   CTRL('N')
+#define key_BACKSPACE '\b'
+
+static FILE *linedata;
+
+static void
+failed(const char *s)
+{
+    perror(s);
+    ExitProgram(EXIT_FAILURE);
+}
+
+static void
+init_linedata(const char *name)
+{
+    if ((linedata = fopen(name, "r")) == 0) {
+	failed(name);
+    }
+}
+
+static int
+read_linedata(WINDOW *work)
+{
+    int result;
+    if (linedata != 0) {
+	result = fgetc(linedata);
+	if (result == EOF) {
+	    fclose(linedata);
+	    linedata = 0;
+	    result = read_linedata(work);
+	} else {
+	    wrefresh(work);
+	    if (result == '\n') {
+		result = key_NEWLINE;
+	    }
+	}
+    } else {
+#ifdef WIDE_LINEDATA
+	wint_t ch;
+	int code;
+
+	result = ERR;
+	while ((code = wget_wch(work, &ch)) != ERR) {
+
+	    if (code == KEY_CODE_YES) {
+		switch (ch) {
+		case KEY_DOWN:
+		    result = key_NEWLINE;
+		    break;
+		case KEY_BACKSPACE:
+		    result = key_BACKSPACE;
+		    break;
+		default:
+		    beep();
+		    continue;
+		}
+	    } else if (code != ERR) {
+		result = (int) ch;
+		break;
+	    } else {
+		break;
+	    }
+	}
+#else
+	result = wgetch(work);
+#endif
+    }
+    return result;
+}
diff -Naur ncurses-5.7.orig/test/listused.sh ncurses-5.7/test/listused.sh
--- ncurses-5.7.orig/test/listused.sh	2006-06-03 12:39:37.000000000 -0400
+++ ncurses-5.7/test/listused.sh	2011-01-08 18:18:29.250657520 -0500
@@ -1,6 +1,6 @@
 #!/bin/sh
 ##############################################################################
-# Copyright (c) 2003,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 "Software"), #
@@ -26,12 +26,13 @@
 # use or other dealings in this Software without prior written               #
 # authorization.                                                             #
 ##############################################################################
-# $Id: listused.sh,v 1.7 2006/06/03 16:39:37 tom Exp $
-# A very simple script to list entrypoints that are used by either a test
+# $Id: listused.sh,v 1.8 2010/09/18 15:15:15 tom Exp $
+# A very simple script to list all entrypoints that are used by either a test
 # program, or within the libraries.  This relies on the output format of 'nm',
 # and assumes that the libraries are configured with TRACE defined, and using
 # these options:
 #	--disable-macros
+#	--enable-sp-funcs
 #	--enable-widec
 # Static libraries are used, to provide some filtering based on internal usage
 # of the different symbols.
diff -Naur ncurses-5.7.orig/test/lrtest.c ncurses-5.7/test/lrtest.c
--- ncurses-5.7.orig/test/lrtest.c	2005-12-31 11:51:53.000000000 -0500
+++ ncurses-5.7/test/lrtest.c	2011-01-08 18:13:50.783157055 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2004,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            *
@@ -34,7 +34,7 @@
  * This can't be part of the ncurses test-program, because ncurses rips off the
  * bottom line to do labels.
  *
- * $Id: lrtest.c,v 1.21 2005/12/31 16:51:53 tom Exp $
+ * $Id: lrtest.c,v 1.22 2010/05/01 19:11:55 tom Exp $
  */
 
 #include <test.priv.h>
@@ -51,7 +51,7 @@
 static void
 show(MARK *m)
 {
-    mvaddch(m->y, m->x, m->value);
+    MvAddCh(m->y, m->x, m->value);
     if (m->mode == 0) {		/* along the x-direction */
 	m->x += m->inc;
 	if (m->x >= COLS) {
diff -Naur ncurses-5.7.orig/test/make-tar.sh ncurses-5.7/test/make-tar.sh
--- ncurses-5.7.orig/test/make-tar.sh	1969-12-31 19:00:00.000000000 -0500
+++ ncurses-5.7/test/make-tar.sh	2011-01-08 18:18:29.466658298 -0500
@@ -0,0 +1,83 @@
+#!/bin/sh
+# $Id: make-tar.sh,v 1.4 2010/11/06 18:31:46 tom Exp $
+##############################################################################
+# 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.                                                             #
+##############################################################################
+# Construct a tar-file containing only the test tree as well as its associated
+# scripts.  The reason for doing that is to simplify distributing the test
+# programs as a separate package.
+
+TARGET=`pwd`
+
+: ${ROOTNAME:=ncurses-test}
+: ${DESTDIR:=$TARGET}
+: ${TMPDIR:=/tmp}
+
+# This can be run from either the test subdirectory, or from the top-level
+# source directory.  We will put the tar file in the original directory.
+test -d ./test && cd ./test
+
+BUILD=$TMPDIR/make-tar$$
+trap "cd /; rm -rf $BUILD; exit 0" 0 1 2 5 15
+
+umask 077
+if ! ( mkdir $BUILD )
+then
+	echo "? cannot make build directory $BUILD"
+fi
+
+umask 022
+mkdir $BUILD/$ROOTNAME
+
+cp -p -r * $BUILD/$ROOTNAME/ || exit
+
+# Add the config.* utility scripts from the top-level directory.
+for i in . ..
+do
+	for j in config.guess config.sub install-sh tar-copy.sh
+	do
+		test -f $i/$j && cp -p $i/$j $BUILD/$ROOTNAME/
+	done
+done
+
+cd $BUILD || exit 
+
+# There is no need for this script in the tar file.
+rm -f $ROOTNAME/make-tar.sh
+
+# Remove build-artifacts.
+find . -name RCS -exec rm -rf {} \;
+find . -name "*.gz" -exec rm -rf {} \;
+
+# Make the files writable...
+chmod -R u+w .
+
+tar cf - $ROOTNAME | gzip >$DESTDIR/$ROOTNAME.tar.gz
+cd $DESTDIR
+
+pwd
+ls -l $ROOTNAME.tar.gz
diff -Naur ncurses-5.7.orig/test/mk-test.awk ncurses-5.7/test/mk-test.awk
--- ncurses-5.7.orig/test/mk-test.awk	2007-01-20 16:28:47.000000000 -0500
+++ ncurses-5.7/test/mk-test.awk	2011-01-08 18:18:29.466658298 -0500
@@ -1,6 +1,6 @@
-# $Id: mk-test.awk,v 1.5 2007/01/20 21:28:47 tom Exp $
+# $Id: mk-test.awk,v 1.12 2010/11/06 23:06:48 tom Exp $
 ##############################################################################
-# Copyright (c) 2006,2007 Free Software Foundation, Inc.                     #
+# Copyright (c) 2006-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 "Software"), #
@@ -73,31 +73,52 @@
 	print	"sources:"
 	print	""
 	print	"tags:"
-	print	"	ctags *.[ch]"
+	print	"	$(CTAGS) *.[ch]"
 	print	""
+	print	"# no libraries here"
 	print	"libs \\"
-	print	"install \\"
 	print	"install.libs \\"
-	print	"install.test:"
-	print	""
-	print	"uninstall:"
 	print	"uninstall.libs:"
-	print	"uninstall.test:"
+	print	""
+	if (INSTALL == "yes") {
+		print	"# we might install the test-programs"
+		print	"install \\"
+		print	"install.test: $(BINDIR) $(TESTS)"
+		print	"	$(SHELL) -c 'for src in $(TESTS); do \\"
+		print	"	dst=`echo $$src | $(TRANSFORM)`; \\"
+		print	"	$(INSTALL_PROG) $$src $(BINDIR)/$$dst; \\"
+		print	"	done'"
+		print	""
+		print	"uninstall \\"
+		print	"uninstall.test:"
+		print	"	$(SHELL) -c 'for src in $(TESTS); do \\"
+		print	"	dst=`echo $$src | $(TRANSFORM)`; \\"
+		print	"	rm -f $(BINDIR)/$$dst; \\"
+		print	"	done'"
+	} else {
+		print	"install \\"
+		print	"install.test \\"
+		print	"uninstall \\"
+		print	"uninstall.test:"
+	}
 	print	""
 	print	"mostlyclean ::"
 	print	"	-rm -f core tags TAGS *~ *.bak *.i *.ln *.atac trace"
 	print	""
 	print	"clean :: mostlyclean"
-	print	"	-sh -c \"if test -n '$x' ; then $(MAKE) clean x=''; fi\""
+	print	"	-$(SHELL) -c \"if test -n '$x' ; then $(MAKE) clean x=''; fi\""
 	print	"	-rm -rf *$o screendump *.lis $(TESTS) .libs"
 	print	""
 	print	"distclean :: clean"
-	print	"	-rm -f Makefile ncurses_cfg.h config.*"
+	print	"	-rm -f Makefile ncurses_cfg.h config.status config.log"
 	print	""
 	print	"realclean :: distclean"
 	print	""
 	print	"lint:"
-	print	"	sh -c 'for N in $(TESTS); do echo LINT:$$N; $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/$$N.c $(LINT_LIBS); done'"
+	print	"	$(SHELL) -c 'for N in $(TESTS); do echo LINT:$$N; $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/$$N.c $(LINT_LIBS); done'"
+	print	"$(BINDIR) :"
+	print	"	mkdir -p $@"
+
 
 	if (ECHO_LINK != "") {
 		ECHO_LINK="@ echo linking $@ ... ;"
diff -Naur ncurses-5.7.orig/test/modules ncurses-5.7/test/modules
--- ncurses-5.7.orig/test/modules	2007-08-18 13:57:08.000000000 -0400
+++ ncurses-5.7/test/modules	2011-01-08 18:13:50.787157167 -0500
@@ -1,6 +1,6 @@
-# $Id: modules,v 1.36 2007/08/18 17:57:08 tom Exp $
+# $Id: modules,v 1.43 2010/01/23 17:51:38 tom Exp $
 ##############################################################################
-# Copyright (c) 1998-2006,2007 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 "Software"), #
@@ -37,20 +37,22 @@
 bs		progs		$(srcdir)	$(HEADER_DEPS)
 cardfile	progs		$(srcdir)	$(HEADER_DEPS)	../include/panel.h ../include/form.h
 chgat		progs		$(srcdir)	$(HEADER_DEPS)
+clip_printw	progs		$(srcdir)	$(HEADER_DEPS)
 color_set	progs		$(srcdir)	$(HEADER_DEPS)
 demo_altkeys	progs		$(srcdir)	$(HEADER_DEPS)
 demo_defkey	progs		$(srcdir)	$(HEADER_DEPS)
-demo_forms	progs		$(srcdir)	$(HEADER_DEPS)	../include/form.h $(srcdir)/edit_field.h
+demo_forms	progs		$(srcdir)	$(HEADER_DEPS)	$(srcdir)/edit_field.h
 demo_keyok	progs		$(srcdir)	$(HEADER_DEPS)
 demo_menus	progs		$(srcdir)	$(HEADER_DEPS)	../include/menu.h
 demo_panels	progs		$(srcdir)	$(HEADER_DEPS)	../include/panel.h
 demo_termcap	progs		$(srcdir)	$(HEADER_DEPS)
+demo_terminfo	progs		$(srcdir)	$(HEADER_DEPS)
 ditto		progs		$(srcdir)	$(HEADER_DEPS)
 dots		progs		$(srcdir)	$(HEADER_DEPS)
 dots_mvcur	progs		$(srcdir)	$(HEADER_DEPS)
 echochar	progs		$(srcdir)	$(HEADER_DEPS)
 edit_field	progs		$(srcdir)	$(HEADER_DEPS)	$(srcdir)/edit_field.h
-filter		progs		$(srcdir)	$(HEADER_DEPS)	../include/form.h
+filter		progs		$(srcdir)	$(HEADER_DEPS)
 firework	progs		$(srcdir)	$(HEADER_DEPS)
 firstlast	progs		$(srcdir)	$(HEADER_DEPS)
 foldkeys	progs		$(srcdir)	$(HEADER_DEPS)
@@ -59,8 +61,9 @@
 hashtest	progs		$(srcdir)	$(HEADER_DEPS)
 inch_wide	progs		$(srcdir)	$(HEADER_DEPS)
 inchs		progs		$(srcdir)	$(HEADER_DEPS)
-ins_wide	progs		$(srcdir)	$(HEADER_DEPS)
-inserts		progs		$(srcdir)	$(HEADER_DEPS)
+ins_wide	progs		$(srcdir)	$(HEADER_DEPS)	$(srcdir)/linedata.h
+insdelln	progs		$(srcdir)	$(HEADER_DEPS)
+inserts		progs		$(srcdir)	$(HEADER_DEPS)	$(srcdir)/linedata.h
 key_names	progs		$(srcdir)	$(HEADER_DEPS)
 keynames	progs		$(srcdir)	$(HEADER_DEPS)
 knight		progs		$(srcdir)	$(HEADER_DEPS)
@@ -73,6 +76,10 @@
 redraw		progs		$(srcdir)	$(HEADER_DEPS)
 savescreen	progs		$(srcdir)	$(HEADER_DEPS)
 tclock		progs		$(srcdir)	$(HEADER_DEPS)
+test_add_wchstr	progs		$(srcdir)	$(HEADER_DEPS)	$(srcdir)/linedata.h
+test_addchstr	progs		$(srcdir)	$(HEADER_DEPS)	$(srcdir)/linedata.h
+test_addstr	progs		$(srcdir)	$(HEADER_DEPS)	$(srcdir)/linedata.h
+test_addwstr	progs		$(srcdir)	$(HEADER_DEPS)	$(srcdir)/linedata.h
 test_arrays	progs		$(srcdir)	$(HEADER_DEPS)
 test_get_wstr	progs		$(srcdir)	$(HEADER_DEPS)
 test_getstr	progs		$(srcdir)	$(HEADER_DEPS)
diff -Naur ncurses-5.7.orig/test/movewindow.c ncurses-5.7/test/movewindow.c
--- ncurses-5.7.orig/test/movewindow.c	2008-04-12 18:01:41.000000000 -0400
+++ ncurses-5.7/test/movewindow.c	2011-01-08 18:18:29.498656661 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2006-2007,2008 Free Software Foundation, Inc.              *
+ * Copyright (c) 2006-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,7 +26,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: movewindow.c,v 1.22 2008/04/12 22:01:41 tom Exp $
+ * $Id: movewindow.c,v 1.24 2010/11/13 23:34:55 tom Exp $
  *
  * Demonstrate move functions for windows and derived windows from the curses
  * library.
@@ -196,12 +196,12 @@
     head_line("Use arrows to move cursor, anything else to mark corner 1");
     if ((tmp = selectcell(parent, min_line, min_col, max_line, max_col)) != 0) {
 	*ul = *tmp;
-	mvwaddch(parent, ul->y, ul->x, '*');
+	MvWAddCh(parent, ul->y, ul->x, '*');
 
 	head_line("Use arrows to move cursor, anything else to mark corner 2");
 	if ((tmp = selectcell(parent, ul->y, ul->x, max_line, max_col)) != 0) {
 	    *lr = *tmp;
-	    mvwaddch(parent, lr->y, lr->x, '*');
+	    MvWAddCh(parent, lr->y, lr->x, '*');
 	    wmove(parent, lr->y, lr->x);
 	    wsyncdown(parent);
 	    wrefresh(parent);
@@ -224,16 +224,16 @@
     getyx(win, y0, x0);
     getmaxyx(win, y1, x1);
 
-    mvwhline(win, 0, 0, ACS_HLINE, x1);
-    mvwhline(win, y1 - 1, 0, ACS_HLINE, x1);
+    MvWHLine(win, 0, 0, ACS_HLINE, x1);
+    MvWHLine(win, y1 - 1, 0, ACS_HLINE, x1);
 
-    mvwvline(win, 0, 0, ACS_VLINE, y1);
-    mvwvline(win, 0, x1 - 1, ACS_VLINE, y1);
+    MvWVLine(win, 0, 0, ACS_VLINE, y1);
+    MvWVLine(win, 0, x1 - 1, ACS_VLINE, y1);
 
-    mvwaddch(win, 0, 0, ACS_ULCORNER);
-    mvwaddch(win, y1 - 1, 0, ACS_LLCORNER);
-    mvwaddch(win, 0, x1 - 1, ACS_URCORNER);
-    mvwaddch(win, y1 - 1, x1 - 1, ACS_LRCORNER);
+    MvWAddCh(win, 0, 0, ACS_ULCORNER);
+    MvWAddCh(win, y1 - 1, 0, ACS_LLCORNER);
+    MvWAddCh(win, 0, x1 - 1, ACS_URCORNER);
+    MvWAddCh(win, y1 - 1, x1 - 1, ACS_LRCORNER);
 
     wsyncdown(win);
     wmove(win, y0, x0);
@@ -311,7 +311,7 @@
     int n = window2num(win);
 
     if (n++ >= 0) {
-	result = all_windows[n % num_windows].child;
+	result = all_windows[(unsigned) n % num_windows].child;
 	wmove(result, 0, 0);
 	wrefresh(result);
     }
@@ -326,8 +326,8 @@
 
     if (n-- >= 0) {
 	if (n < 0)
-	    n = num_windows - 1;
-	result = all_windows[n % num_windows].child;
+	    n = (int) (num_windows - 1);
+	result = all_windows[(unsigned) n % num_windows].child;
 	wmove(result, 0, 0);
 	wrefresh(result);
     }
@@ -441,7 +441,7 @@
     getmaxyx(win, y1, x1);
     for (y = 0; y < y1; ++y) {
 	for (x = 0; x < x1; ++x) {
-	    mvwaddch(win, y, x, ch);
+	    MvWAddCh(win, y, x, ch);
 	}
     }
     wsyncdown(win);
diff -Naur ncurses-5.7.orig/test/ncurses.c ncurses-5.7/test/ncurses.c
--- ncurses-5.7.orig/test/ncurses.c	2008-09-27 10:34:58.000000000 -0400
+++ ncurses-5.7/test/ncurses.c	2011-01-08 18:18:29.498656661 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2007,2008 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            *
@@ -40,7 +40,7 @@
    Author: Eric S. Raymond <esr@snark.thyrsus.com> 1993
            Thomas E. Dickey (beginning revision 1.27 in 1996).
 
-$Id: ncurses.c,v 1.329 2008/09/27 14:34:58 tom Exp $
+$Id: ncurses.c,v 1.362 2010/11/14 01:04:13 tom Exp $
 
 ***************************************************************************/
 
@@ -121,22 +121,22 @@
 #if HAVE_WCSRTOMBS
 #define count_wchars(src, len, state)      wcsrtombs(0,   &src, len, state)
 #define trans_wchars(dst, src, len, state) wcsrtombs(dst, &src, len, state)
-#define reset_wchars(state) memset(&state, 0, sizeof(state))
+#define reset_wchars(state) init_mb(state)
 #elif HAVE_WCSTOMBS && HAVE_MBTOWC && HAVE_MBLEN
 #define count_wchars(src, len, state)      wcstombs(0,   src, len)
 #define trans_wchars(dst, src, len, state) wcstombs(dst, src, len)
-#define reset_wchars(state) mblen(NULL, 0), mbtowc(NULL, NULL, 0)
+#define reset_wchars(state) IGNORE_RC(mblen(NULL, 0)), IGNORE_RC(mbtowc(NULL, NULL, 0))
 #define state_unused
 #endif
 
 #if HAVE_MBSRTOWCS
 #define count_mbytes(src, len, state)      mbsrtowcs(0,   &src, len, state)
 #define trans_mbytes(dst, src, len, state) mbsrtowcs(dst, &src, len, state)
-#define reset_mbytes(state) memset(&state, 0, sizeof(state))
+#define reset_mbytes(state) init_mb(state)
 #elif HAVE_MBSTOWCS && HAVE_MBTOWC && HAVE_MBLEN
 #define count_mbytes(src, len, state)      mbstowcs(0,   src, len)
 #define trans_mbytes(dst, src, len, state) mbstowcs(dst, src, len)
-#define reset_mbytes(state) mblen(NULL, 0), mbtowc(NULL, NULL, 0)
+#define reset_mbytes(state) IGNORE_RC(mblen(NULL, 0)), IGNORE_RC(mbtowc(NULL, NULL, 0))
 #define state_unused
 #endif
 
@@ -171,14 +171,14 @@
 do_h_line(int y, int x, chtype c, int to)
 {
     if ((to) > (x))
-	mvhline(y, x, c, (to) - (x));
+	MvHLine(y, x, c, (to) - (x));
 }
 
 static void
 do_v_line(int y, int x, chtype c, int to)
 {
     if ((to) > (y))
-	mvvline(y, x, c, (to) - (y));
+	MvVLine(y, x, c, (to) - (y));
 }
 
 static void
@@ -232,7 +232,7 @@
 
     echo();
     getyx(win, y0, x0);
-    wattrset(win, A_REVERSE);
+    (void) wattrset(win, A_REVERSE);
 
     x = (int) strlen(buffer);
     while (!done) {
@@ -318,6 +318,7 @@
     *target = 0;
 }
 
+#if USE_LIBPANEL
 static void
 make_fullwidth_digit(cchar_t *target, int digit)
 {
@@ -327,6 +328,7 @@
     source[1] = 0;
     setcchar(target, source, A_NORMAL, 0, 0);
 }
+#endif
 
 static int
 wGet_wchar(WINDOW *win, wint_t *result)
@@ -363,7 +365,7 @@
 
     echo();
     getyx(win, y0, x0);
-    wattrset(win, A_REVERSE);
+    (void) wattrset(win, A_REVERSE);
 
     x = (int) wcslen(buffer);
     while (!done) {
@@ -483,7 +485,11 @@
 	addstr("Shelling out...");
     def_prog_mode();
     endwin();
+#ifdef __MINGW32__
+    system("cmd.exe");
+#else
     system("sh");
+#endif
     if (message)
 	addstr("returned from shellout.\n");
     refresh();
@@ -499,7 +505,7 @@
 {
     static char buf[80 + (5 * 10) + (32 * 15)];
 
-    (void) sprintf(buf, "id %2d  at (%2d, %2d, %2d) state %4lx = {",
+    (void) sprintf(buf, "id %2d at (%2d, %2d, %d) state %4lx = {",
 		   ep->id, ep->x, ep->y, ep->z, (unsigned long) ep->bstate);
 
 #define SHOW(m, s) if ((ep->bstate & m)==m) {strcat(buf,s); strcat(buf, ", ");}
@@ -561,6 +567,42 @@
     (void) strcat(buf, "}");
     return (buf);
 }
+
+static void
+show_mouse(WINDOW *win)
+{
+    int y, x;
+    MEVENT event;
+    bool outside;
+    bool show_loc;
+
+    getmouse(&event);
+    outside = !wenclose(win, event.y, event.x);
+
+    if (outside) {
+	(void) wstandout(win);
+	waddstr(win, "KEY_MOUSE");
+	(void) wstandend(win);
+    } else {
+	waddstr(win, "KEY_MOUSE");
+    }
+    wprintw(win, ", %s", mouse_decode(&event));
+
+    if (outside)
+	win = stdscr;
+
+    show_loc = wmouse_trafo(win, &event.y, &event.x, FALSE);
+
+    if (show_loc) {
+	getyx(win, y, x);
+	wmove(win, event.y, event.x);
+	waddch(win, '*');
+	wmove(win, y, x);
+    }
+
+    if (outside)
+	wnoutrefresh(win);
+}
 #endif /* NCURSES_MOUSE_VERSION */
 
 /****************************************************************************
@@ -569,8 +611,11 @@
  *
  ****************************************************************************/
 
+#define NUM_GETCH_FLAGS 256
+typedef bool GetchFlags[NUM_GETCH_FLAGS];
+
 static void
-setup_getch(WINDOW *win, bool flags[])
+setup_getch(WINDOW *win, GetchFlags flags)
 {
     keypad(win, flags['k']);	/* should be redundant, but for testing */
     meta(win, flags['m']);	/* force this to a known state */
@@ -581,7 +626,17 @@
 }
 
 static void
-wgetch_help(WINDOW *win, bool flags[])
+init_getch(WINDOW *win, GetchFlags flags)
+{
+    memset(flags, FALSE, NUM_GETCH_FLAGS);
+    flags[UChar('k')] = (win == stdscr);
+    flags[UChar('m')] = TRUE;
+
+    setup_getch(win, flags);
+}
+
+static void
+wgetch_help(WINDOW *win, GetchFlags flags)
 {
     static const char *help[] =
     {
@@ -610,12 +665,12 @@
 	int flg = ((strstr(help[n], "toggle") != 0)
 		   && (flags[UChar(*help[n])] != FALSE));
 	if (flg)
-	    standout();
-	mvprintw(row, col, "%s", help[n]);
+	    (void) standout();
+	MvPrintw(row, col, "%s", help[n]);
 	if (col == 0)
 	    clrtoeol();
 	if (flg)
-	    standend();
+	    (void) standend();
     }
     wrefresh(stdscr);
     wmove(win, y, x);
@@ -657,7 +712,7 @@
 {
     unsigned need = (level + 1) * 2;
 
-    assert(level < COLS);
+    assert(level < (unsigned) COLS);
 
     if (winstack == 0) {
 	len_winstack = 20;
@@ -731,13 +786,10 @@
     int first_y, first_x;
     int c;
     int incount = 0;
-    bool flags[256];
+    GetchFlags flags;
     bool blocking = (delay < 0);
 
-    memset(flags, FALSE, sizeof(flags));
-    flags[UChar('k')] = (win == stdscr);
-
-    setup_getch(win, flags);
+    init_getch(win, flags);
     wtimeout(win, delay);
     getyx(win, first_y, first_x);
 
@@ -817,15 +869,7 @@
 	    wprintw(win, "Key pressed: %04o ", c);
 #ifdef NCURSES_MOUSE_VERSION
 	    if (c == KEY_MOUSE) {
-		int y, x;
-		MEVENT event;
-
-		getmouse(&event);
-		wprintw(win, "KEY_MOUSE, %s", mouse_decode(&event));
-		getyx(win, y, x);
-		move(event.y, event.x);
-		addch('*');
-		wmove(win, y, x);
+		show_mouse(win);
 	    } else
 #endif /* NCURSES_MOUSE_VERSION */
 	    if (c >= KEY_MIN) {
@@ -835,12 +879,18 @@
 		}
 #endif
 		(void) waddstr(win, keyname(c));
-	    } else if (c > 0x80) {
-		unsigned c2 = (unsigned) (c & 0x7f);
-		if (isprint(c2))
-		    (void) wprintw(win, "M-%c", UChar(c2));
-		else
+	    } else if (c >= 0x80) {
+		unsigned c2 = (unsigned) c;
+#if !(defined(NCURSES_VERSION) || defined(_XOPEN_CURSES))
+		/* at least Solaris SVR4 curses breaks unctrl(128), etc. */
+		c2 &= 0x7f;
+#endif
+		if (isprint(c))
+		    (void) wprintw(win, "%c", UChar(c));
+		else if (c2 != UChar(c))
 		    (void) wprintw(win, "M-%s", unctrl(c2));
+		else
+		    (void) wprintw(win, "%s", unctrl(c2));
 		waddstr(win, " (high-half character)");
 	    } else {
 		if (isprint(c))
@@ -854,6 +904,9 @@
     }
 
     wtimeout(win, -1);
+
+    if (!level)
+	init_getch(win, flags);
 }
 
 static int
@@ -905,6 +958,7 @@
     wgetch_test(0, stdscr, delay);
     forget_boxes();
     finish_getch_test();
+    slk_clear();
 }
 
 #if USE_WIDEC_SUPPORT
@@ -978,15 +1032,12 @@
     int first_y, first_x;
     wint_t c;
     int incount = 0;
-    bool flags[256];
+    GetchFlags flags;
     bool blocking = (delay < 0);
-    int y, x, code;
+    int code;
     char *temp;
 
-    memset(flags, FALSE, sizeof(flags));
-    flags[UChar('k')] = (win == stdscr);
-
-    setup_getch(win, flags);
+    init_getch(win, flags);
     wtimeout(win, delay);
     getyx(win, first_y, first_x);
 
@@ -1080,14 +1131,7 @@
 	    wprintw(win, "Key pressed: %04o ", (int) c);
 #ifdef NCURSES_MOUSE_VERSION
 	    if (c == KEY_MOUSE) {
-		MEVENT event;
-
-		getmouse(&event);
-		wprintw(win, "KEY_MOUSE, %s", mouse_decode(&event));
-		getyx(win, y, x);
-		move(event.y, event.x);
-		addch('*');
-		wmove(win, y, x);
+		show_mouse(win);
 	    } else
 #endif /* NCURSES_MOUSE_VERSION */
 	    if (code == KEY_CODE_YES) {
@@ -1096,14 +1140,14 @@
 		    resize_wide_boxes(level, win);
 		}
 #endif
-		(void) waddstr(win, key_name((wchar_t) c));
+		(void) waddstr(win, keyname((wchar_t) c));
 	    } else {
+		(void) waddstr(win, key_name((wchar_t) c));
 		if (c < 256 && iscntrl(c)) {
-		    (void) wprintw(win, "%s (control character)", unctrl(c));
+		    (void) wprintw(win, " (control character)");
 		} else {
-		    wchar_t c2 = (wchar_t) c;
-		    waddnwstr(win, &c2, 1);
-		    (void) wprintw(win, " = %#x (printable character)", (unsigned) c);
+		    (void) wprintw(win, " = %#x (printable character)",
+				   (unsigned) c);
 		}
 	    }
 	    wgetch_wrap(win, first_y);
@@ -1111,6 +1155,9 @@
     }
 
     wtimeout(win, -1);
+
+    if (!level)
+	init_getch(win, flags);
 }
 
 static void
@@ -1122,6 +1169,7 @@
     wget_wch_test(0, stdscr, delay);
     forget_boxes();
     finish_getch_test();
+    slk_clear();
 }
 #endif
 
@@ -1188,29 +1236,29 @@
     int row = 1;
     int col = 1;
 
-    mvwprintw(helpwin, row++, col,
+    MvWPrintw(helpwin, row++, col,
 	      "ESC to exit.");
-    mvwprintw(helpwin, row++, col,
+    MvWPrintw(helpwin, row++, col,
 	      "^L repaints.");
     ++row;
-    mvwprintw(helpwin, row++, col,
+    MvWPrintw(helpwin, row++, col,
 	      "Modify the test strings:");
-    mvwprintw(helpwin, row++, col,
+    MvWPrintw(helpwin, row++, col,
 	      "  A digit sets gaps on each side of displayed attributes");
-    mvwprintw(helpwin, row++, col,
+    MvWPrintw(helpwin, row++, col,
 	      "  </> shifts the text left/right. ");
     ++row;
-    mvwprintw(helpwin, row++, col,
+    MvWPrintw(helpwin, row++, col,
 	      "Toggles:");
     if (use_colors) {
-	mvwprintw(helpwin, row++, col,
+	MvWPrintw(helpwin, row++, col,
 		  "  f/F/b/F toggle foreground/background background color");
-	mvwprintw(helpwin, row++, col,
+	MvWPrintw(helpwin, row++, col,
 		  "  t/T     toggle text/background color attribute");
     }
-    mvwprintw(helpwin, row++, col,
+    MvWPrintw(helpwin, row++, col,
 	      "  a/A     toggle ACS (alternate character set) mapping");
-    mvwprintw(helpwin, row++, col,
+    MvWPrintw(helpwin, row, col,
 	      "  v/V     toggle video attribute to combine with each line");
 }
 
@@ -1312,9 +1360,9 @@
     chtype test = attr & (chtype) (~A_ALTCHARSET);
 
     if (arrow)
-	mvprintw(row, 5, "-->");
-    mvprintw(row, 8, "%s mode:", name);
-    mvprintw(row, 24, "|");
+	MvPrintw(row, 5, "-->");
+    MvPrintw(row, 8, "%s mode:", name);
+    MvPrintw(row, 24, "|");
     if (skip)
 	printw("%*s", skip, " ");
     /*
@@ -1331,7 +1379,7 @@
 	    addch(ch | attr);
 	}
     } else {
-	attrset(attr);
+	(void) attrset(attr);
 	addstr(attr_test_string);
 	attroff(attr);
     }
@@ -1486,7 +1534,7 @@
 		if (init_pair(pair, fg, bg) == ERR) {
 		    beep();
 		} else {
-		    normal |= COLOR_PAIR(pair);
+		    normal |= (chtype) COLOR_PAIR(pair);
 		}
 	    }
 	    if (tx >= 0) {
@@ -1494,7 +1542,7 @@
 		if (init_pair(pair, tx, bg) == ERR) {
 		    beep();
 		} else {
-		    extras |= COLOR_PAIR(pair);
+		    extras |= (chtype) COLOR_PAIR(pair);
 		}
 	    }
 	}
@@ -1503,7 +1551,7 @@
 	erase();
 
 	box(stdscr, 0, 0);
-	mvaddstr(0, 20, "Character attribute test display");
+	MvAddStr(0, 20, "Character attribute test display");
 
 	for (j = 0; j < SIZEOF(attrs_to_test); ++j) {
 	    bool arrow = (j == k);
@@ -1514,10 +1562,10 @@
 			    attrs_to_test[j].name);
 	}
 
-	mvprintw(row, 8,
+	MvPrintw(row, 8,
 		 "This terminal does %shave the magic-cookie glitch",
 		 get_xmc() > -1 ? "" : "not ");
-	mvprintw(row + 1, 8, "Enter '?' for help.");
+	MvPrintw(row + 1, 8, "Enter '?' for help.");
 	show_color_attr(fg, bg, tx);
 	printw("  ACS (%d)", ac != 0);
 
@@ -1600,9 +1648,9 @@
     chtype test = attr & ~WA_ALTCHARSET;
 
     if (arrow)
-	mvprintw(row, 5, "-->");
-    mvprintw(row, 8, "%s mode:", name);
-    mvprintw(row, 24, "|");
+	MvPrintw(row, 5, "-->");
+    MvPrintw(row, 8, "%s mode:", name);
+    MvPrintw(row, 24, "|");
     if (skip)
 	printw("%*s", skip, " ");
 
@@ -1626,10 +1674,10 @@
 	attr_t old_attr;
 	short old_pair;
 
-	attr_get(&old_attr, &old_pair, 0);
-	attr_set(attr, pair, 0);
+	(void) attr_get(&old_attr, &old_pair, 0);
+	(void) attr_set(attr, pair, 0);
 	addwstr(wide_attr_test_string);
-	attr_set(old_attr, old_pair, 0);
+	(void) attr_set(old_attr, old_pair, 0);
     }
     if (skip)
 	printw("%*s", skip, " ");
@@ -1775,21 +1823,21 @@
 	erase();
 
 	box_set(stdscr, 0, 0);
-	mvaddstr(0, 20, "Character attribute test display");
+	MvAddStr(0, 20, "Character attribute test display");
 
 	for (j = 0; j < SIZEOF(attrs_to_test); ++j) {
 	    row = wide_show_attr(row, n, j == k,
-				 ac |
-				 attrs_to_test[j].attr |
-				 attrs_to_test[k].attr,
+				 ((attr_t) ac |
+				  attrs_to_test[j].attr |
+				  attrs_to_test[k].attr),
 				 extras,
 				 attrs_to_test[j].name);
 	}
 
-	mvprintw(row, 8,
+	MvPrintw(row, 8,
 		 "This terminal does %shave the magic-cookie glitch",
 		 get_xmc() > -1 ? "" : "not ");
-	mvprintw(row + 1, 8, "Enter '?' for help.");
+	MvPrintw(row + 1, 8, "Enter '?' for help.");
 	show_color_attr(fg, bg, tx);
 	printw("  ACS (%d)", ac != 0);
 
@@ -1840,6 +1888,8 @@
 	    width = 4;
 	} else if (color >= 8) {
 	    sprintf(temp, "[%02d]", color);
+	} else if (color < 0) {
+	    strcpy(temp, "default");
 	} else {
 	    strcpy(temp, the_color_names[color]);
 	}
@@ -1853,33 +1903,35 @@
     int row = 1;
     int col = 1;
 
-    mvwprintw(helpwin, row++, col,
+    MvWPrintw(helpwin, row++, col,
 	      "ESC to exit.");
     ++row;
-    mvwprintw(helpwin, row++, col,
+    MvWPrintw(helpwin, row++, col,
 	      "Use up/down arrow to scroll through the display if it is");
-    mvwprintw(helpwin, row++, col,
+    MvWPrintw(helpwin, row++, col,
 	      "longer than one screen. Control/N and Control/P can be used");
-    mvwprintw(helpwin, row++, col,
+    MvWPrintw(helpwin, row++, col,
 	      "in place of up/down arrow.  Use pageup/pagedown to scroll a");
-    mvwprintw(helpwin, row++, col,
+    MvWPrintw(helpwin, row++, col,
 	      "full screen; control/B and control/F can be used here.");
     ++row;
-    mvwprintw(helpwin, row++, col,
+    MvWPrintw(helpwin, row++, col,
 	      "Toggles:");
-    mvwprintw(helpwin, row++, col,
+    MvWPrintw(helpwin, row++, col,
 	      "  a/A     toggle altcharset off/on");
-    mvwprintw(helpwin, row++, col,
+    MvWPrintw(helpwin, row++, col,
 	      "  b/B     toggle bold off/on");
-    mvwprintw(helpwin, row++, col,
+    MvWPrintw(helpwin, row++, col,
 	      "  n/N     toggle text/number on/off");
-    mvwprintw(helpwin, row++, col,
+    MvWPrintw(helpwin, row++, col,
+	      "  r/R     toggle reverse on/off");
+    MvWPrintw(helpwin, row++, col,
 	      "  w/W     toggle width between 8/16 colors");
 #if USE_WIDEC_SUPPORT
     if (wide) {
-	mvwprintw(helpwin, row++, col,
+	MvWPrintw(helpwin, row++, col,
 		  "Wide characters:");
-	mvwprintw(helpwin, row++, col,
+	MvWPrintw(helpwin, row, col,
 		  "  x/X     toggle text between ASCII and wide-character");
     }
 #else
@@ -1906,12 +1958,19 @@
     bool done = FALSE;
     bool opt_acsc = FALSE;
     bool opt_bold = FALSE;
-    bool opt_wide = FALSE;
+    bool opt_revs = FALSE;
     bool opt_nums = FALSE;
+    bool opt_wide = FALSE;
     WINDOW *helpwin;
 
-    if (pairs_max > COLOR_PAIRS)
-	pairs_max = COLOR_PAIRS;
+    if (COLORS * COLORS == COLOR_PAIRS) {
+	int limit = (COLORS - min_colors) * (COLORS - min_colors);
+	if (pairs_max > limit)
+	    pairs_max = limit;
+    } else {
+	if (pairs_max > COLOR_PAIRS)
+	    pairs_max = COLOR_PAIRS;
+    }
 
     while (!done) {
 	int shown = 0;
@@ -1926,23 +1985,25 @@
 	    hello = "Hello";
 	    per_row = 8;
 	}
+	per_row -= min_colors;
 
 	row_limit = (pairs_max + per_row - 1) / per_row;
 
 	move(0, 0);
-	(void) printw("There are %d color pairs and %d colors\n",
-		      pairs_max, COLORS);
+	(void) printw("There are %d color pairs and %d colors%s\n",
+		      pairs_max, COLORS,
+		      min_colors ? " besides 'default'" : "");
 
 	clrtobot();
-	(void) mvprintw(top + 1, 0,
-			"%dx%d matrix of foreground/background colors, bold *%s*\n",
-			row_limit,
-			per_row,
-			opt_bold ? "on" : "off");
+	MvPrintw(top + 1, 0,
+		 "%dx%d matrix of foreground/background colors, bold *%s*\n",
+		 row_limit,
+		 per_row,
+		 opt_bold ? "on" : "off");
 
 	/* show color names/numbers across the top */
 	for (i = 0; i < per_row; i++)
-	    show_color_name(top + 2, (i + 1) * width, i, opt_wide);
+	    show_color_name(top + 2, (i + 1) * width, i + min_colors, opt_wide);
 
 	/* show a grid of colors, with color names/ numbers on the left */
 	for (i = (short) (base_row * per_row); i < pairs_max; i++) {
@@ -1950,9 +2011,11 @@
 	    int col = (i % per_row + 1) * width;
 	    short pair = i;
 
+#define InxToFG(i) (short) ((i % (COLORS - min_colors)) + min_colors)
+#define InxToBG(i) (short) ((i / (COLORS - min_colors)) + min_colors)
 	    if (row >= 0 && move(row, col) != ERR) {
-		short fg = (short) (i % COLORS);
-		short bg = (short) (i / COLORS);
+		short fg = InxToFG(i);
+		short bg = InxToBG(i);
 
 		init_pair(pair, fg, bg);
 		attron((attr_t) COLOR_PAIR(pair));
@@ -1960,16 +2023,18 @@
 		    attron((attr_t) A_ALTCHARSET);
 		if (opt_bold)
 		    attron((attr_t) A_BOLD);
+		if (opt_revs)
+		    attron((attr_t) A_REVERSE);
 
 		if (opt_nums) {
 		    sprintf(numbered, "{%02X}", i);
 		    hello = numbered;
 		}
 		printw("%-*.*s", width, width, hello);
-		attrset(A_NORMAL);
+		(void) attrset(A_NORMAL);
 
-		if ((i % per_row) == 0 && (i % COLORS) == 0) {
-		    show_color_name(row, 0, i / COLORS, opt_wide);
+		if ((i % per_row) == 0 && InxToFG(i) == min_colors) {
+		    show_color_name(row, 0, InxToBG(i), opt_wide);
 		}
 		++shown;
 	    } else if (shown) {
@@ -1996,6 +2061,12 @@
 	case 'N':
 	    opt_nums = TRUE;
 	    break;
+	case 'r':
+	    opt_revs = FALSE;
+	    break;
+	case 'R':
+	    opt_revs = TRUE;
+	    break;
 	case case_QUIT:
 	    done = TRUE;
 	    continue;
@@ -2067,13 +2138,12 @@
 static void
 wide_color_test(void)
 {
-    int c;
     int i;
     int top = 0, width;
     int base_row = 0;
     int grid_top = top + 3;
     int page_size = (LINES - grid_top);
-    int pairs_max = COLOR_PAIRS;
+    int pairs_max = (unsigned short) (-1);
     int row_limit;
     int per_row;
     char numbered[80];
@@ -2081,12 +2151,22 @@
     bool done = FALSE;
     bool opt_acsc = FALSE;
     bool opt_bold = FALSE;
+    bool opt_revs = FALSE;
     bool opt_wide = FALSE;
     bool opt_nums = FALSE;
     bool opt_xchr = FALSE;
     wchar_t buffer[10];
     WINDOW *helpwin;
 
+    if (COLORS * COLORS == COLOR_PAIRS) {
+	int limit = (COLORS - min_colors) * (COLORS - min_colors);
+	if (pairs_max > limit)
+	    pairs_max = limit;
+    } else {
+	if (pairs_max > COLOR_PAIRS)
+	    pairs_max = COLOR_PAIRS;
+    }
+
     while (!done) {
 	int shown = 0;
 
@@ -2100,6 +2180,8 @@
 	    hello = "Hello";
 	    per_row = 8;
 	}
+	per_row -= min_colors;
+
 	if (opt_xchr) {
 	    make_fullwidth_text(buffer, hello);
 	    width *= 2;
@@ -2111,19 +2193,20 @@
 	row_limit = (pairs_max + per_row - 1) / per_row;
 
 	move(0, 0);
-	(void) printw("There are %d color pairs and %d colors\n",
-		      pairs_max, COLORS);
+	(void) printw("There are %d color pairs and %d colors%s\n",
+		      pairs_max, COLORS,
+		      min_colors ? " besides 'default'" : "");
 
 	clrtobot();
-	(void) mvprintw(top + 1, 0,
-			"%dx%d matrix of foreground/background colors, bold *%s*\n",
-			row_limit,
-			per_row,
-			opt_bold ? "on" : "off");
+	MvPrintw(top + 1, 0,
+		 "%dx%d matrix of foreground/background colors, bold *%s*\n",
+		 row_limit,
+		 per_row,
+		 opt_bold ? "on" : "off");
 
 	/* show color names/numbers across the top */
 	for (i = 0; i < per_row; i++)
-	    show_color_name(top + 2, (i + 1) * width, i, opt_wide);
+	    show_color_name(top + 2, (i + 1) * width, i + min_colors, opt_wide);
 
 	/* show a grid of colors, with color names/ numbers on the left */
 	for (i = (base_row * per_row); i < pairs_max; i++) {
@@ -2132,12 +2215,14 @@
 	    short pair = (short) i;
 
 	    if (row >= 0 && move(row, col) != ERR) {
-		init_pair(pair, (short) (i % COLORS), (short) (i / COLORS));
+		init_pair(pair, InxToFG(i), InxToBG(i));
 		color_set(pair, NULL);
 		if (opt_acsc)
 		    attr_on((attr_t) A_ALTCHARSET, NULL);
 		if (opt_bold)
 		    attr_on((attr_t) A_BOLD, NULL);
+		if (opt_revs)
+		    attr_on((attr_t) A_REVERSE, NULL);
 
 		if (opt_nums) {
 		    sprintf(numbered, "{%02X}", i);
@@ -2148,10 +2233,10 @@
 		    }
 		}
 		addnwstr(buffer, width);
-		attr_set(A_NORMAL, 0, NULL);
+		(void) attr_set(A_NORMAL, 0, NULL);
 
-		if ((i % per_row) == 0 && (i % COLORS) == 0) {
-		    show_color_name(row, 0, i / COLORS, opt_wide);
+		if ((i % per_row) == 0 && InxToFG(i) == min_colors) {
+		    show_color_name(row, 0, InxToBG(i), opt_wide);
 		}
 		++shown;
 	    } else if (shown) {
@@ -2159,7 +2244,7 @@
 	    }
 	}
 
-	switch (c = wGetchar(stdscr)) {
+	switch (wGetchar(stdscr)) {
 	case 'a':
 	    opt_acsc = FALSE;
 	    break;
@@ -2178,6 +2263,12 @@
 	case 'N':
 	    opt_nums = TRUE;
 	    break;
+	case 'r':
+	    opt_revs = FALSE;
+	    break;
+	case 'R':
+	    opt_revs = TRUE;
+	    break;
 	case case_QUIT:
 	    done = TRUE;
 	    continue;
@@ -2305,13 +2396,13 @@
     for (i = 0; i < max_colors; i++)
 	init_pair((short) i, (short) COLOR_WHITE, (short) i);
 
-    mvprintw(LINES - 2, 0, "Number: %d", value);
+    MvPrintw(LINES - 2, 0, "Number: %d", value);
 
     do {
 	short red, green, blue;
 
 	attron(A_BOLD);
-	mvaddstr(0, 20, "Color RGB Value Editing");
+	MvAddStr(0, 20, "Color RGB Value Editing");
 	attroff(A_BOLD);
 
 	for (i = (short) top_color;
@@ -2320,13 +2411,13 @@
 	    char numeric[80];
 
 	    sprintf(numeric, "[%d]", i);
-	    mvprintw(2 + i - top_color, 0, "%c %-8s:",
+	    MvPrintw(2 + i - top_color, 0, "%c %-8s:",
 		     (i == current ? '>' : ' '),
 		     (i < (int) SIZEOF(the_color_names)
 		      ? the_color_names[i] : numeric));
-	    attrset(COLOR_PAIR(i));
+	    (void) attrset((attr_t) COLOR_PAIR(i));
 	    addstr("        ");
-	    attrset(A_NORMAL);
+	    (void) attrset(A_NORMAL);
 
 	    color_content((short) i, &red, &green, &blue);
 	    addstr("   R = ");
@@ -2334,29 +2425,29 @@
 		attron(A_STANDOUT);
 	    printw("%04d", red);
 	    if (current == i && field == 0)
-		attrset(A_NORMAL);
+		(void) attrset(A_NORMAL);
 	    addstr(", G = ");
 	    if (current == i && field == 1)
 		attron(A_STANDOUT);
 	    printw("%04d", green);
 	    if (current == i && field == 1)
-		attrset(A_NORMAL);
+		(void) attrset(A_NORMAL);
 	    addstr(", B = ");
 	    if (current == i && field == 2)
 		attron(A_STANDOUT);
 	    printw("%04d", blue);
 	    if (current == i && field == 2)
-		attrset(A_NORMAL);
-	    attrset(A_NORMAL);
+		(void) attrset(A_NORMAL);
+	    (void) attrset(A_NORMAL);
 	    printw(" ( %3d %3d %3d )",
 		   scaled_rgb(red),
 		   scaled_rgb(green),
 		   scaled_rgb(blue));
 	}
 
-	mvaddstr(LINES - 3, 0,
+	MvAddStr(LINES - 3, 0,
 		 "Use up/down to select a color, left/right to change fields.");
-	mvaddstr(LINES - 2, 0,
+	MvAddStr(LINES - 2, 0,
 		 "Modify field by typing nnn=, nnn-, or nnn+.  ? for help.");
 
 	move(2 + current - top_color, 0);
@@ -2449,6 +2540,8 @@
 	case 'm':
 	    endwin();
 	    main_menu(FALSE);
+	    for (i = 0; i < max_colors; i++)
+		init_pair((short) i, (short) COLOR_WHITE, (short) i);
 	    refresh();
 	    break;
 
@@ -2469,7 +2562,7 @@
 	if (current - top_color >= page_size)
 	    top_color = current - (page_size - 1);
 
-	mvprintw(LINES - 1, 0, "Number: %d", value);
+	MvPrintw(LINES - 1, 0, "Number: %d", value);
 	clrtoeol();
     } while
 	(!isQuit(this_c));
@@ -2510,8 +2603,9 @@
 	,"[12345678] -- set label; labels are numbered 1 through 8"
 	,"e          -- erase stdscr (should not erase labels)"
 	,"s          -- test scrolling of shortened screen"
+	,"v/V        -- cycle through video attributes"
 #if HAVE_SLK_COLOR
-	,"F/B        -- cycle through foreground/background colors"
+	,"F/f/B/b    -- cycle through foreground/background colors"
 #endif
 	,"ESC        -- return to main menu"
 	,""
@@ -2529,14 +2623,100 @@
     refresh();
 }
 
+/****************************************************************************
+ *
+ * Alternate character-set stuff
+ *
+ ****************************************************************************/
+/* *INDENT-OFF* */
+static struct {
+    chtype attr;
+    const char *name;
+} attrs_to_cycle[] = {
+    { A_NORMAL,		"normal" },
+    { A_BOLD,		"bold" },
+    { A_BLINK,		"blink" },
+    { A_REVERSE,	"reverse" },
+    { A_UNDERLINE,	"underline" },
+};
+/* *INDENT-ON* */
+
+static bool
+cycle_attr(int ch, unsigned *at_code, chtype *attr)
+{
+    bool result = TRUE;
+
+    switch (ch) {
+    case 'v':
+	if ((*at_code += 1) >= SIZEOF(attrs_to_cycle))
+	    *at_code = 0;
+	break;
+    case 'V':
+	if (*at_code == 0)
+	    *at_code = SIZEOF(attrs_to_cycle) - 1;
+	else
+	    *at_code -= 1;
+	break;
+    default:
+	result = FALSE;
+	break;
+    }
+    if (result)
+	*attr = attrs_to_cycle[*at_code].attr;
+    return result;
+}
+
+static bool
+cycle_colors(int ch, int *fg, int *bg, short *pair)
+{
+    bool result = FALSE;
+
+    if (use_colors) {
+	result = TRUE;
+	switch (ch) {
+	case 'F':
+	    if ((*fg -= 1) < 0)
+		*fg = COLORS - 1;
+	    break;
+	case 'f':
+	    if ((*fg += 1) >= COLORS)
+		*fg = 0;
+	    break;
+	case 'B':
+	    if ((*bg -= 1) < 0)
+		*bg = COLORS - 1;
+	    break;
+	case 'b':
+	    if ((*bg += 1) >= COLORS)
+		*bg = 0;
+	    break;
+	default:
+	    result = FALSE;
+	    break;
+	}
+	if (result) {
+	    *pair = (short) (*fg != COLOR_BLACK || *bg != COLOR_BLACK);
+	    if (*pair != 0) {
+		*pair = 1;
+		if (init_pair(*pair, (short) *fg, (short) *bg) == ERR) {
+		    result = FALSE;
+		}
+	    }
+	}
+    }
+    return result;
+}
+
 #if HAVE_SLK_COLOR
 static void
-call_slk_color(short fg, short bg)
+call_slk_color(int fg, int bg)
 {
-    init_pair(1, bg, fg);
+    init_pair(1, (short) bg, (short) fg);
     slk_color(1);
-    mvprintw(SLK_WORK, 0, "Colors %d/%d\n", fg, bg);
+    MvPrintw(SLK_WORK, 0, "Colors %d/%d\n", fg, bg);
     clrtoeol();
+    slk_touch();
+    slk_noutrefresh();
     refresh();
 }
 #endif
@@ -2548,9 +2728,12 @@
     int c, fmt = 1;
     char buf[9];
     char *s;
+    chtype attr = A_NORMAL;
+    unsigned at_code = 0;
 #if HAVE_SLK_COLOR
-    short fg = COLOR_BLACK;
-    short bg = COLOR_WHITE;
+    int fg = COLOR_BLACK;
+    int bg = COLOR_WHITE;
+    short pair = 0;
 #endif
 
     c = CTRL('l');
@@ -2566,7 +2749,7 @@
 	case CTRL('l'):
 	    erase();
 	    attron(A_BOLD);
-	    mvaddstr(0, 20, "Soft Key Exerciser");
+	    MvAddStr(0, 20, "Soft Key Exerciser");
 	    attroff(A_BOLD);
 
 	    slk_help();
@@ -2581,7 +2764,7 @@
 	    break;
 
 	case 's':
-	    mvprintw(SLK_WORK, 0, "Press Q to stop the scrolling-test: ");
+	    MvPrintw(SLK_WORK, 0, "Press Q to stop the scrolling-test: ");
 	    while ((c = Getchar()) != 'Q' && (c != ERR))
 		addch((chtype) c);
 	    break;
@@ -2610,7 +2793,7 @@
 	case '6':
 	case '7':
 	case '8':
-	    (void) mvaddstr(SLK_WORK, 0, "Please enter the label value: ");
+	    MvAddStr(SLK_WORK, 0, "Please enter the label value: ");
 	    strcpy(buf, "");
 	    if ((s = slk_label(c - '0')) != 0) {
 		strncpy(buf, s, 8);
@@ -2625,20 +2808,6 @@
 	case case_QUIT:
 	    goto done;
 
-#if HAVE_SLK_COLOR
-	case 'F':
-	    if (use_colors) {
-		fg = (short) ((fg + 1) % COLORS);
-		call_slk_color(fg, bg);
-	    }
-	    break;
-	case 'B':
-	    if (use_colors) {
-		bg = (short) ((bg + 1) % COLORS);
-		call_slk_color(fg, bg);
-	    }
-	    break;
-#endif
 #if defined(NCURSES_VERSION) && defined(KEY_RESIZE) && HAVE_WRESIZE
 	case KEY_RESIZE:
 	    wnoutrefresh(stdscr);
@@ -2646,7 +2815,24 @@
 #endif
 
 	default:
+	    if (cycle_attr(c, &at_code, &attr)) {
+		slk_attrset(attr);
+		slk_touch();
+		slk_noutrefresh();
+		break;
+	    }
+#if HAVE_SLK_COLOR
+	    if (cycle_colors(c, &fg, &bg, &pair)) {
+		if (use_colors) {
+		    call_slk_color(fg, bg);
+		} else {
+		    beep();
+		}
+		break;
+	    }
+#endif
 	    beep();
+	    break;
 	}
     } while (!isQuit(c = Getchar()));
 
@@ -2665,8 +2851,11 @@
     int c, fmt = 1;
     wchar_t buf[SLKLEN + 1];
     char *s;
-    short fg = COLOR_BLACK;
-    short bg = COLOR_WHITE;
+    chtype attr = A_NORMAL;
+    unsigned at_code = 0;
+    int fg = COLOR_BLACK;
+    int bg = COLOR_WHITE;
+    short pair = 0;
 
     c = CTRL('l');
     if (use_colors) {
@@ -2678,7 +2867,7 @@
 	case CTRL('l'):
 	    erase();
 	    attr_on(WA_BOLD, NULL);
-	    mvaddstr(0, 20, "Soft Key Exerciser");
+	    MvAddStr(0, 20, "Soft Key Exerciser");
 	    attr_off(WA_BOLD, NULL);
 
 	    slk_help();
@@ -2693,7 +2882,7 @@
 	    break;
 
 	case 's':
-	    mvprintw(SLK_WORK, 0, "Press Q to stop the scrolling-test: ");
+	    MvPrintw(SLK_WORK, 0, "Press Q to stop the scrolling-test: ");
 	    while ((c = Getchar()) != 'Q' && (c != ERR))
 		addch((chtype) c);
 	    break;
@@ -2722,7 +2911,7 @@
 	case '6':
 	case '7':
 	case '8':
-	    (void) mvaddstr(SLK_WORK, 0, "Please enter the label value: ");
+	    MvAddStr(SLK_WORK, 0, "Please enter the label value: ");
 	    *buf = 0;
 	    if ((s = slk_label(c - '0')) != 0) {
 		char *temp = strdup(s);
@@ -2778,7 +2967,24 @@
 	    break;
 #endif
 	default:
+	    if (cycle_attr(c, &at_code, &attr)) {
+		slk_attr_set(attr, (fg || bg), NULL);
+		slk_touch();
+		slk_noutrefresh();
+		break;
+	    }
+#if HAVE_SLK_COLOR
+	    if (cycle_colors(c, &fg, &bg, &pair)) {
+		if (use_colors) {
+		    call_slk_color(fg, bg);
+		} else {
+		    beep();
+		}
+		break;
+	    }
+#endif
 	    beep();
+	    break;
 	}
     } while (!isQuit(c = Getchar()));
 
@@ -2790,89 +2996,6 @@
 #endif
 #endif /* SLK_INIT */
 
-/****************************************************************************
- *
- * Alternate character-set stuff
- *
- ****************************************************************************/
-/* *INDENT-OFF* */
-static struct {
-    chtype attr;
-    const char *name;
-} attrs_to_cycle[] = {
-    { A_NORMAL,		"normal" },
-    { A_BOLD,		"bold" },
-    { A_REVERSE,	"reverse" },
-    { A_UNDERLINE,	"underline" },
-};
-/* *INDENT-ON* */
-
-static bool
-cycle_attr(int ch, unsigned *at_code, chtype *attr)
-{
-    bool result = TRUE;
-
-    switch (ch) {
-    case 'v':
-	if ((*at_code += 1) >= SIZEOF(attrs_to_cycle))
-	    *at_code = 0;
-	break;
-    case 'V':
-	if (*at_code == 1)
-	    *at_code = SIZEOF(attrs_to_cycle) - 1;
-	else
-	    *at_code -= 1;
-	break;
-    default:
-	result = FALSE;
-	break;
-    }
-    if (result)
-	*attr = attrs_to_cycle[*at_code].attr;
-    return result;
-}
-
-static bool
-cycle_colors(int ch, int *fg, int *bg, short *pair)
-{
-    bool result = FALSE;
-
-    if (use_colors) {
-	result = TRUE;
-	switch (ch) {
-	case 'F':
-	    if ((*fg -= 1) < 0)
-		*fg = COLORS - 1;
-	    break;
-	case 'f':
-	    if ((*fg += 1) >= COLORS)
-		*fg = 0;
-	    break;
-	case 'B':
-	    if ((*bg -= 1) < 0)
-		*bg = COLORS - 1;
-	    break;
-	case 'b':
-	    if ((*bg += 1) >= COLORS)
-		*bg = 0;
-	    break;
-	default:
-	    result = FALSE;
-	    break;
-	}
-	if (result) {
-	    *pair = (short) (*fg != COLOR_BLACK || *bg != COLOR_BLACK);
-	    if (*pair != 0) {
-		*pair = 1;
-		if (init_pair(*pair, (short) *fg, (short) *bg) == ERR) {
-		    result = FALSE;
-		}
-	    }
-	}
-    }
-    return result;
-}
-
 /* ISO 6429:  codes 0x80 to 0x9f may be control characters that cause the
  * terminal to perform functions.  The remaining codes can be graphic.
  */
@@ -2886,7 +3009,7 @@
 
     erase();
     attron(A_BOLD);
-    mvprintw(0, 20, "Display of %s Character Codes %d to %d",
+    MvPrintw(0, 20, "Display of %s Character Codes %d to %d",
 	     C1 ? "C1" : "GR", first, last);
     attroff(A_BOLD);
     refresh();
@@ -2897,12 +3020,12 @@
 	int col = ((int) (code - first) / 16) * COLS / 2;
 	char tmp[80];
 	sprintf(tmp, "%3u (0x%x)", code, code);
-	mvprintw(row, col, "%*s: ", COLS / 4, tmp);
+	MvPrintw(row, col, "%*s: ", COLS / 4, tmp);
 
 	do {
 	    if (C1)
 		nodelay(stdscr, TRUE);
-	    echochar(code | attr | COLOR_PAIR(pair));
+	    echochar(colored_chtype(code, attr, pair));
 	    if (C1) {
 		/* (yes, this _is_ crude) */
 		while ((reply = Getchar()) != ERR) {
@@ -2924,19 +3047,19 @@
 
     erase();
     attron(A_BOLD);
-    mvprintw(0, 20, "Display of PC Character Codes");
+    MvPrintw(0, 20, "Display of PC Character Codes");
     attroff(A_BOLD);
     refresh();
 
     for (code = 0; code < 16; ++code) {
-	mvprintw(2, (int) code * PC_COLS + 8, "%X", code);
+	MvPrintw(2, (int) code * PC_COLS + 8, "%X", code);
     }
     for (code = 0; code < 256; code++) {
 	int count = repeat;
 	int row = 3 + (int) (code / 16) + (code >= 128);
 	int col = 8 + (int) (code % 16) * PC_COLS;
 	if ((code % 16) == 0)
-	    mvprintw(row, 0, "0x%02x:", code);
+	    MvPrintw(row, 0, "0x%02x:", code);
 	move(row, col);
 	do {
 	    switch (code) {
@@ -2951,7 +3074,7 @@
 		 */
 		break;
 	    default:
-		addch(code | A_ALTCHARSET | attr | COLOR_PAIR(pair));
+		addch(colored_chtype(code, A_ALTCHARSET | attr, pair));
 		break;
 	    }
 	} while (--count > 0);
@@ -2962,22 +3085,31 @@
 show_box_chars(int repeat, attr_t attr, short pair)
 {
     (void) repeat;
-    attr |= COLOR_PAIR(pair);
+
+    attr |= (attr_t) COLOR_PAIR(pair);
 
     erase();
     attron(A_BOLD);
-    mvaddstr(0, 20, "Display of the ACS Line-Drawing Set");
+    MvAddStr(0, 20, "Display of the ACS Line-Drawing Set");
     attroff(A_BOLD);
     refresh();
-    box(stdscr, 0, 0);
     /* *INDENT-OFF* */
-    mvhline(LINES / 2, 0,        ACS_HLINE | attr, COLS);
-    mvvline(0,         COLS / 2, ACS_VLINE | attr, LINES);
-    mvaddch(0,         COLS / 2, ACS_TTEE | attr);
-    mvaddch(LINES / 2, COLS / 2, ACS_PLUS | attr);
-    mvaddch(LINES - 1, COLS / 2, ACS_BTEE | attr);
-    mvaddch(LINES / 2, 0,        ACS_LTEE | attr);
-    mvaddch(LINES / 2, COLS - 1, ACS_RTEE | attr);
+    wborder(stdscr,
+	    colored_chtype(ACS_VLINE,	 attr, pair),
+	    colored_chtype(ACS_VLINE,	 attr, pair),
+            colored_chtype(ACS_HLINE,    attr, pair),
+	    colored_chtype(ACS_HLINE,	 attr, pair),
+	    colored_chtype(ACS_ULCORNER, attr, pair),
+	    colored_chtype(ACS_URCORNER, attr, pair),
+            colored_chtype(ACS_LLCORNER, attr, pair),
+	    colored_chtype(ACS_LRCORNER, attr, pair));
+    MvHLine(LINES / 2, 0,        colored_chtype(ACS_HLINE, attr, pair), COLS);
+    MvVLine(0,         COLS / 2, colored_chtype(ACS_VLINE, attr, pair), LINES);
+    MvAddCh(0,         COLS / 2, colored_chtype(ACS_TTEE,  attr, pair));
+    MvAddCh(LINES / 2, COLS / 2, colored_chtype(ACS_PLUS,  attr, pair));
+    MvAddCh(LINES - 1, COLS / 2, colored_chtype(ACS_BTEE,  attr, pair));
+    MvAddCh(LINES / 2, 0,        colored_chtype(ACS_LTEE,  attr, pair));
+    MvAddCh(LINES / 2, COLS - 1, colored_chtype(ACS_RTEE,  attr, pair));
     /* *INDENT-ON* */
 
 }
@@ -2989,7 +3121,7 @@
     int row = 2 + (n % height);
     int col = (n / height) * COLS / 2;
 
-    mvprintw(row, col, "%*s : ", COLS / 4, name);
+    MvPrintw(row, col, "%*s : ", COLS / 4, name);
     do {
 	addch(code);
     } while (--repeat > 0);
@@ -3002,11 +3134,11 @@
 {
     int n;
 
-#define BOTH(name) #name, (name | attr | COLOR_PAIR(pair))
+#define BOTH(name) #name, colored_chtype(name, attr, (chtype) pair)
 
     erase();
     attron(A_BOLD);
-    mvaddstr(0, 20, "Display of the ACS Character Set");
+    MvAddStr(0, 20, "Display of the ACS Character Set");
     attroff(A_BOLD);
     refresh();
 
@@ -3051,7 +3183,7 @@
     n = show_1_acs(n, repeat, BOTH(ACS_S1));
     n = show_1_acs(n, repeat, BOTH(ACS_S3));
     n = show_1_acs(n, repeat, BOTH(ACS_S7));
-    n = show_1_acs(n, repeat, BOTH(ACS_S9));
+    (void) show_1_acs(n, repeat, BOTH(ACS_S9));
 #endif
 }
 
@@ -3134,18 +3266,18 @@
 	else
 	    show_upper_chars((unsigned) (digit * 32 + 128), repeat, attr, pair);
 
-	mvprintw(LINES - 3, 0,
+	MvPrintw(LINES - 3, 0,
 		 "Note: ANSI terminals may not display C1 characters.");
-	mvprintw(LINES - 2, 0,
+	MvPrintw(LINES - 2, 0,
 		 "Select: a=ACS, x=box, %s0=C1, 1-3,+/- non-ASCII, </> repeat, ESC=quit",
 		 pch_kludge);
 	if (use_colors) {
-	    mvprintw(LINES - 1, 0,
+	    MvPrintw(LINES - 1, 0,
 		     "v/V, f/F, b/B cycle through video attributes (%s) and color %d/%d.",
 		     attrs_to_cycle[at_code].name,
 		     fg, bg);
 	} else {
-	    mvprintw(LINES - 1, 0,
+	    MvPrintw(LINES - 1, 0,
 		     "v/V cycles through video attributes (%s).",
 		     attrs_to_cycle[at_code].name);
 	}
@@ -3161,21 +3293,18 @@
 static cchar_t *
 merge_wide_attr(cchar_t *dst, const cchar_t *src, attr_t attr, short pair)
 {
-    int count = getcchar(src, NULL, NULL, NULL, 0);
-    wchar_t *wch = 0;
-    attr_t ignore_attr;
-    short ignore_pair;
+    int count;
 
     *dst = *src;
-    if (count > 0) {
-	if ((wch = typeMalloc(wchar_t, (unsigned) count + 1)) != 0) {
-	    if (getcchar(src, wch, &ignore_attr, &ignore_pair, 0) != ERR) {
-		attr |= (ignore_attr & A_ALTCHARSET);
-		setcchar(dst, wch, attr, pair, 0);
-	    }
-	    free(wch);
-	}
-    }
+    do {
+	TEST_CCHAR(src, count, {
+	    attr |= (test_attrs & A_ALTCHARSET);
+	    setcchar(dst, test_wch, attr, pair, NULL);
+	}
+	, {
+	    ;
+	});
+    } while (0);
     return dst;
 }
 
@@ -3188,7 +3317,7 @@
 
     erase();
     attron(A_BOLD);
-    mvprintw(0, 20, "Display of Character Codes %d to %d", first, last);
+    MvPrintw(0, 20, "Display of Character Codes %d to %d", first, last);
     attroff(A_BOLD);
 
     for (code = first; (int) code <= last; code++) {
@@ -3202,7 +3331,7 @@
 	memset(&codes, 0, sizeof(codes));
 	codes[0] = code;
 	sprintf(tmp, "%3ld (0x%lx)", (long) code, (long) code);
-	mvprintw(row, col, "%*s: ", COLS / 4, tmp);
+	MvPrintw(row, col, "%*s: ", COLS / 4, tmp);
 	setcchar(&temp, codes, attr, pair, 0);
 	do {
 	    /*
@@ -3211,8 +3340,11 @@
 	     * Mark them with reverse-video to make them simpler to find on
 	     * the display.
 	     */
-	    if (wcwidth(code) == 0)
-		addch(space | A_REVERSE);
+	    if (wcwidth(code) == 0) {
+		addch((chtype) space |
+		      (A_REVERSE ^ attr) |
+		      (attr_t) COLOR_PAIR(pair));
+	    }
 	    /*
 	     * This could use add_wch(), but is done for comparison with the
 	     * normal 'f' test (and to make a test-case for echo_wchar()).
@@ -3237,8 +3369,8 @@
     int row = 2 + (n % height);
     int col = (n / height) * COLS / 2;
 
-    mvprintw(row, col, "%*s : ", COLS / 4, name);
-    while (repeat-- >= 0) {
+    MvPrintw(row, col, "%*s : ", COLS / 4, name);
+    while (--repeat >= 0) {
 	add_wch(code);
     }
     return n + 1;
@@ -3259,7 +3391,7 @@
 
     erase();
     attron(A_BOLD);
-    mvaddstr(0, 20, "Display of the Wide-ACS Character Set");
+    MvAddStr(0, 20, "Display of the Wide-ACS Character Set");
     attroff(A_BOLD);
     refresh();
 
@@ -3301,37 +3433,165 @@
     n = show_1_wacs(n, repeat, BOTH2(WACS_S1));
     n = show_1_wacs(n, repeat, BOTH2(WACS_S3));
     n = show_1_wacs(n, repeat, BOTH2(WACS_S7));
-    n = show_1_wacs(n, repeat, BOTH2(WACS_S9));
+    (void) show_1_wacs(n, repeat, BOTH2(WACS_S9));
+#endif
+}
+
+#ifdef WACS_D_PLUS
+static void
+show_wacs_chars_double(int repeat, attr_t attr, short pair)
+/* display the wide-ACS character set */
+{
+    cchar_t temp;
+
+    int n;
+
+/*#define BOTH2(name) #name, &(name) */
+#define BOTH2(name) #name, MERGE_ATTR(name)
+
+    erase();
+    attron(A_BOLD);
+    MvAddStr(0, 20, "Display of the Wide-ACS Character Set");
+    attroff(A_BOLD);
+    refresh();
+
+    n = show_1_wacs(0, repeat, BOTH2(WACS_D_ULCORNER));
+    n = show_1_wacs(n, repeat, BOTH2(WACS_D_URCORNER));
+    n = show_1_wacs(n, repeat, BOTH2(WACS_D_LLCORNER));
+    n = show_1_wacs(n, repeat, BOTH2(WACS_D_LRCORNER));
+
+    n = show_1_wacs(n, repeat, BOTH2(WACS_D_LTEE));
+    n = show_1_wacs(n, repeat, BOTH2(WACS_D_RTEE));
+    n = show_1_wacs(n, repeat, BOTH2(WACS_D_TTEE));
+    n = show_1_wacs(n, repeat, BOTH2(WACS_D_BTEE));
+
+    n = show_1_wacs(n, repeat, BOTH2(WACS_D_HLINE));
+    n = show_1_wacs(n, repeat, BOTH2(WACS_D_VLINE));
+
+    n = show_1_wacs(n, repeat, BOTH2(WACS_LARROW));
+    n = show_1_wacs(n, repeat, BOTH2(WACS_RARROW));
+    n = show_1_wacs(n, repeat, BOTH2(WACS_UARROW));
+    n = show_1_wacs(n, repeat, BOTH2(WACS_DARROW));
+
+    n = show_1_wacs(n, repeat, BOTH2(WACS_BLOCK));
+    n = show_1_wacs(n, repeat, BOTH2(WACS_BOARD));
+    n = show_1_wacs(n, repeat, BOTH2(WACS_LANTERN));
+    n = show_1_wacs(n, repeat, BOTH2(WACS_BULLET));
+    n = show_1_wacs(n, repeat, BOTH2(WACS_CKBOARD));
+    n = show_1_wacs(n, repeat, BOTH2(WACS_DEGREE));
+    n = show_1_wacs(n, repeat, BOTH2(WACS_DIAMOND));
+    n = show_1_wacs(n, repeat, BOTH2(WACS_PLMINUS));
+    n = show_1_wacs(n, repeat, BOTH2(WACS_PLUS));
+
+#ifdef CURSES_WACS_ARRAY
+    n = show_1_wacs(n, repeat, BOTH2(WACS_GEQUAL));
+    n = show_1_wacs(n, repeat, BOTH2(WACS_NEQUAL));
+    n = show_1_wacs(n, repeat, BOTH2(WACS_LEQUAL));
+
+    n = show_1_wacs(n, repeat, BOTH2(WACS_STERLING));
+    n = show_1_wacs(n, repeat, BOTH2(WACS_PI));
+    n = show_1_wacs(n, repeat, BOTH2(WACS_S1));
+    n = show_1_wacs(n, repeat, BOTH2(WACS_S3));
+    n = show_1_wacs(n, repeat, BOTH2(WACS_S7));
+    (void) show_1_wacs(n, repeat, BOTH2(WACS_S9));
+#endif
+}
+#endif
+
+#ifdef WACS_T_PLUS
+static void
+show_wacs_chars_thick(int repeat, attr_t attr, short pair)
+/* display the wide-ACS character set */
+{
+    cchar_t temp;
+
+    int n;
+
+/*#define BOTH2(name) #name, &(name) */
+#define BOTH2(name) #name, MERGE_ATTR(name)
+
+    erase();
+    attron(A_BOLD);
+    MvAddStr(0, 20, "Display of the Wide-ACS Character Set");
+    attroff(A_BOLD);
+    refresh();
+
+    n = show_1_wacs(0, repeat, BOTH2(WACS_T_ULCORNER));
+    n = show_1_wacs(n, repeat, BOTH2(WACS_T_URCORNER));
+    n = show_1_wacs(n, repeat, BOTH2(WACS_T_LLCORNER));
+    n = show_1_wacs(n, repeat, BOTH2(WACS_T_LRCORNER));
+
+    n = show_1_wacs(n, repeat, BOTH2(WACS_T_LTEE));
+    n = show_1_wacs(n, repeat, BOTH2(WACS_T_RTEE));
+    n = show_1_wacs(n, repeat, BOTH2(WACS_T_TTEE));
+    n = show_1_wacs(n, repeat, BOTH2(WACS_T_BTEE));
+
+    n = show_1_wacs(n, repeat, BOTH2(WACS_T_HLINE));
+    n = show_1_wacs(n, repeat, BOTH2(WACS_T_VLINE));
+
+    n = show_1_wacs(n, repeat, BOTH2(WACS_LARROW));
+    n = show_1_wacs(n, repeat, BOTH2(WACS_RARROW));
+    n = show_1_wacs(n, repeat, BOTH2(WACS_UARROW));
+    n = show_1_wacs(n, repeat, BOTH2(WACS_DARROW));
+
+    n = show_1_wacs(n, repeat, BOTH2(WACS_BLOCK));
+    n = show_1_wacs(n, repeat, BOTH2(WACS_BOARD));
+    n = show_1_wacs(n, repeat, BOTH2(WACS_LANTERN));
+    n = show_1_wacs(n, repeat, BOTH2(WACS_BULLET));
+    n = show_1_wacs(n, repeat, BOTH2(WACS_CKBOARD));
+    n = show_1_wacs(n, repeat, BOTH2(WACS_DEGREE));
+    n = show_1_wacs(n, repeat, BOTH2(WACS_DIAMOND));
+    n = show_1_wacs(n, repeat, BOTH2(WACS_PLMINUS));
+    n = show_1_wacs(n, repeat, BOTH2(WACS_PLUS));
+
+#ifdef CURSES_WACS_ARRAY
+    n = show_1_wacs(n, repeat, BOTH2(WACS_GEQUAL));
+    n = show_1_wacs(n, repeat, BOTH2(WACS_NEQUAL));
+    n = show_1_wacs(n, repeat, BOTH2(WACS_LEQUAL));
+
+    n = show_1_wacs(n, repeat, BOTH2(WACS_STERLING));
+    n = show_1_wacs(n, repeat, BOTH2(WACS_PI));
+    n = show_1_wacs(n, repeat, BOTH2(WACS_S1));
+    n = show_1_wacs(n, repeat, BOTH2(WACS_S3));
+    n = show_1_wacs(n, repeat, BOTH2(WACS_S7));
+    (void) show_1_wacs(n, repeat, BOTH2(WACS_S9));
 #endif
 }
+#endif
 
 #undef MERGE_ATTR
 
-#define MERGE_ATTR(wch) merge_wide_attr(&temp, wch, attr, pair)
+#define MERGE_ATTR(n,wch) merge_wide_attr(&temp[n], wch, attr, pair)
 
 static void
 show_wbox_chars(int repeat, attr_t attr, short pair)
 {
-    cchar_t temp;
+    cchar_t temp[8];
 
     (void) repeat;
     erase();
     attron(A_BOLD);
-    mvaddstr(0, 20, "Display of the Wide-ACS Line-Drawing Set");
+    MvAddStr(0, 20, "Display of the Wide-ACS Line-Drawing Set");
     attroff(A_BOLD);
     refresh();
 
-    attr_set(attr, pair, 0);
-    box_set(stdscr, 0, 0);
-    attr_set(A_NORMAL, 0, 0);
+    wborder_set(stdscr,
+		MERGE_ATTR(0, WACS_VLINE),
+		MERGE_ATTR(1, WACS_VLINE),
+		MERGE_ATTR(2, WACS_HLINE),
+		MERGE_ATTR(3, WACS_HLINE),
+		MERGE_ATTR(4, WACS_ULCORNER),
+		MERGE_ATTR(5, WACS_URCORNER),
+		MERGE_ATTR(6, WACS_LLCORNER),
+		MERGE_ATTR(7, WACS_LRCORNER));
     /* *INDENT-OFF* */
-    mvhline_set(LINES / 2, 0,        MERGE_ATTR(WACS_HLINE), COLS);
-    mvvline_set(0,         COLS / 2, MERGE_ATTR(WACS_VLINE), LINES);
-    mvadd_wch(0,           COLS / 2, MERGE_ATTR(WACS_TTEE));
-    mvadd_wch(LINES / 2,   COLS / 2, MERGE_ATTR(WACS_PLUS));
-    mvadd_wch(LINES - 1,   COLS / 2, MERGE_ATTR(WACS_BTEE));
-    mvadd_wch(LINES / 2,   0,        MERGE_ATTR(WACS_LTEE));
-    mvadd_wch(LINES / 2,   COLS - 1, MERGE_ATTR(WACS_RTEE));
+    (void) mvhline_set(LINES / 2, 0,        MERGE_ATTR(0, WACS_HLINE), COLS);
+    (void) mvvline_set(0,         COLS / 2, MERGE_ATTR(0, WACS_VLINE), LINES);
+    (void) mvadd_wch(0,           COLS / 2, MERGE_ATTR(0, WACS_TTEE));
+    (void) mvadd_wch(LINES / 2,   COLS / 2, MERGE_ATTR(0, WACS_PLUS));
+    (void) mvadd_wch(LINES - 1,   COLS / 2, MERGE_ATTR(0, WACS_BTEE));
+    (void) mvadd_wch(LINES / 2,   0,        MERGE_ATTR(0, WACS_LTEE));
+    (void) mvadd_wch(LINES / 2,   COLS - 1, MERGE_ATTR(0, WACS_RTEE));
     /* *INDENT-ON* */
 
 }
@@ -3346,10 +3606,10 @@
     int col = (n / height) * COLS / 2;
     char temp[80];
 
-    mvprintw(row, col, "%*s : ", COLS / 4, name);
-    attr_set(attr, pair, 0);
+    MvPrintw(row, col, "%*s : ", COLS / 4, name);
+    (void) attr_set(attr, pair, 0);
     addstr(strcpy(temp, code));
-    attr_set(A_NORMAL, 0, 0);
+    (void) attr_set(A_NORMAL, 0, 0);
     return n + 1;
 }
 
@@ -3363,7 +3623,7 @@
     (void) repeat;
     erase();
     attron(A_BOLD);
-    mvaddstr(0, 20, "Display of the Wide-ACS Character Set");
+    MvAddStr(0, 20, "Display of the Wide-ACS Character Set");
     attroff(A_BOLD);
     refresh();
     /* *INDENT-OFF* */
@@ -3403,7 +3663,7 @@
     n = SHOW_UTF8(n, "WACS_S1",		"\342\216\272");
     n = SHOW_UTF8(n, "WACS_S3",		"\342\216\273");
     n = SHOW_UTF8(n, "WACS_S7",		"\342\216\274");
-    n = SHOW_UTF8(n, "WACS_S9",		"\342\216\275");
+    (void) SHOW_UTF8(n, "WACS_S9",	"\342\216\275");
     /* *INDENT-ON* */
 
 }
@@ -3431,6 +3691,16 @@
 	case 'a':
 	    ToggleAcs(last_show_wacs, show_wacs_chars);
 	    break;
+#ifdef WACS_D_PLUS
+	case 'd':
+	    ToggleAcs(last_show_wacs, show_wacs_chars_double);
+	    break;
+#endif
+#ifdef WACS_T_PLUS
+	case 't':
+	    ToggleAcs(last_show_wacs, show_wacs_chars_thick);
+	    break;
+#endif
 	case 'x':
 	    ToggleAcs(last_show_wacs, show_wbox_chars);
 	    break;
@@ -3469,15 +3739,15 @@
 	else
 	    show_upper_widechars(digit * 32 + 128, repeat, space, attr, pair);
 
-	mvprintw(LINES - 3, 0,
-		 "Select: a WACS, x box, u UTF-8, 0-9,+/- non-ASCII, </> repeat, ESC=quit");
+	MvPrintw(LINES - 3, 0,
+		 "Select: a/d/t WACS, x box, u UTF-8, 0-9,+/- non-ASCII, </> repeat, ESC=quit");
 	if (use_colors) {
-	    mvprintw(LINES - 2, 0,
+	    MvPrintw(LINES - 2, 0,
 		     "v/V, f/F, b/B cycle through video attributes (%s) and color %d/%d.",
 		     attrs_to_cycle[at_code].name,
 		     fg, bg);
 	} else {
-	    mvprintw(LINES - 2, 0,
+	    MvPrintw(LINES - 2, 0,
 		     "v/V cycles through video attributes (%s).",
 		     attrs_to_cycle[at_code].name);
 	}
@@ -3509,58 +3779,58 @@
 	}
 	bkgdset(normal);
 	erase();
-	mvprintw(1, 20, "Graphic rendition test pattern:");
+	MvPrintw(1, 20, "Graphic rendition test pattern:");
 
-	mvprintw(4, 1, "vanilla");
+	MvPrintw(4, 1, "vanilla");
 
 #define set_sgr(mask) bkgdset((normal^(mask)));
 	set_sgr(A_BOLD);
-	mvprintw(4, 40, "bold");
+	MvPrintw(4, 40, "bold");
 
 	set_sgr(A_UNDERLINE);
-	mvprintw(6, 6, "underline");
+	MvPrintw(6, 6, "underline");
 
 	set_sgr(A_BOLD | A_UNDERLINE);
-	mvprintw(6, 45, "bold underline");
+	MvPrintw(6, 45, "bold underline");
 
 	set_sgr(A_BLINK);
-	mvprintw(8, 1, "blink");
+	MvPrintw(8, 1, "blink");
 
 	set_sgr(A_BLINK | A_BOLD);
-	mvprintw(8, 40, "bold blink");
+	MvPrintw(8, 40, "bold blink");
 
 	set_sgr(A_UNDERLINE | A_BLINK);
-	mvprintw(10, 6, "underline blink");
+	MvPrintw(10, 6, "underline blink");
 
 	set_sgr(A_BOLD | A_UNDERLINE | A_BLINK);
-	mvprintw(10, 45, "bold underline blink");
+	MvPrintw(10, 45, "bold underline blink");
 
 	set_sgr(A_REVERSE);
-	mvprintw(12, 1, "negative");
+	MvPrintw(12, 1, "negative");
 
 	set_sgr(A_BOLD | A_REVERSE);
-	mvprintw(12, 40, "bold negative");
+	MvPrintw(12, 40, "bold negative");
 
 	set_sgr(A_UNDERLINE | A_REVERSE);
-	mvprintw(14, 6, "underline negative");
+	MvPrintw(14, 6, "underline negative");
 
 	set_sgr(A_BOLD | A_UNDERLINE | A_REVERSE);
-	mvprintw(14, 45, "bold underline negative");
+	MvPrintw(14, 45, "bold underline negative");
 
 	set_sgr(A_BLINK | A_REVERSE);
-	mvprintw(16, 1, "blink negative");
+	MvPrintw(16, 1, "blink negative");
 
 	set_sgr(A_BOLD | A_BLINK | A_REVERSE);
-	mvprintw(16, 40, "bold blink negative");
+	MvPrintw(16, 40, "bold blink negative");
 
 	set_sgr(A_UNDERLINE | A_BLINK | A_REVERSE);
-	mvprintw(18, 6, "underline blink negative");
+	MvPrintw(18, 6, "underline blink negative");
 
 	set_sgr(A_BOLD | A_UNDERLINE | A_BLINK | A_REVERSE);
-	mvprintw(18, 45, "bold underline blink negative");
+	MvPrintw(18, 45, "bold underline blink negative");
 
 	bkgdset(normal);
-	mvprintw(LINES - 2, 1, "%s background. ", pass == 0 ? "Dark" :
+	MvPrintw(LINES - 2, 1, "%s background. ", pass == 0 ? "Dark" :
 		 "Light");
 	clrtoeol();
 	Pause();
@@ -3708,7 +3978,7 @@
 {
     newwin_legend(curp);
     if (msg) {
-	mvaddstr(LINES - 1, 0, msg);
+	MvAddStr(LINES - 1, 0, msg);
 	refresh();
 	napms(1000);
     }
@@ -3798,10 +4068,10 @@
 outerbox(pair ul, pair lr, bool onoff)
 /* draw or erase a box *outside* the given pair of corners */
 {
-    mvaddch(ul.y - 1, lr.x - 1, onoff ? ACS_ULCORNER : ' ');
-    mvaddch(ul.y - 1, lr.x + 1, onoff ? ACS_URCORNER : ' ');
-    mvaddch(lr.y + 1, lr.x + 1, onoff ? ACS_LRCORNER : ' ');
-    mvaddch(lr.y + 1, ul.x - 1, onoff ? ACS_LLCORNER : ' ');
+    MvAddCh(ul.y - 1, lr.x - 1, onoff ? ACS_ULCORNER : ' ');
+    MvAddCh(ul.y - 1, lr.x + 1, onoff ? ACS_URCORNER : ' ');
+    MvAddCh(lr.y + 1, lr.x + 1, onoff ? ACS_LRCORNER : ' ');
+    MvAddCh(lr.y + 1, ul.x - 1, onoff ? ACS_LLCORNER : ' ');
     move(ul.y - 1, ul.x);
     hline(onoff ? ACS_HLINE : ' ', lr.x - ul.x + 1);
     move(ul.y, ul.x - 1);
@@ -3826,7 +4096,7 @@
     if ((tmp = selectcell(2, 1, LINES - BOTLINES - 2, COLS - 2)) == (pair *) 0)
 	return ((WINDOW *) 0);
     memcpy(&ul, tmp, sizeof(pair));
-    mvaddch(ul.y - 1, ul.x - 1, ACS_ULCORNER);
+    MvAddCh(ul.y - 1, ul.x - 1, ACS_ULCORNER);
     move(0, 0);
     clrtoeol();
     addstr("Use arrows to move cursor, anything else to mark corner 2");
@@ -3895,7 +4165,7 @@
 {
     int c;
     FRAME *current = (FRAME *) 0, *neww;
-    WINDOW *usescr = stdscr;
+    WINDOW *usescr;
 #if HAVE_PUTWIN && HAVE_GETWIN
     FILE *fp;
 #endif
@@ -4095,7 +4365,7 @@
 			break;
 		    x = getmaxx(frame_win(current)) - 1;
 		}
-		mvwdelch(frame_win(current), y, x);
+		(void) mvwdelch(frame_win(current), y, x);
 	    }
 	    break;
 
@@ -4202,7 +4472,7 @@
 	    short bg = color;
 
 	    init_pair(color, fg, bg);
-	    wbkgdset(win, (chtype) (COLOR_PAIR(color) | ' '));
+	    wbkgdset(win, (attr_t) (COLOR_PAIR(color) | ' '));
 	} else {
 	    wbkgdset(win, A_BOLD | ' ');
 	}
@@ -4496,12 +4766,13 @@
 	"Number repeats.  Toggle legend:? filler:a timer:t scrollmark:s."
     };
     int n = ((int) SIZEOF(legend) - (LINES - line));
-    if (line < LINES && (n >= 0)) {
-	move(line, 0);
-	if (show_panner_legend)
-	    printw("%s", legend[n]);
-	clrtoeol();
-	return show_panner_legend;
+    if (n >= 0) {
+	if (move(line, 0) != ERR) {
+	    if (show_panner_legend)
+		printw("%s", legend[n]);
+	    clrtoeol();
+	    return show_panner_legend;
+	}
     }
     return FALSE;
 }
@@ -4739,7 +5010,7 @@
 	    break;
 	}
 
-	mvaddch(top_y - 1, top_x - 1, ACS_ULCORNER);
+	MvAddCh(top_y - 1, top_x - 1, ACS_ULCORNER);
 	do_v_line(top_y, top_x - 1, ACS_VLINE, porty);
 	do_h_line(top_y - 1, top_x, ACS_HLINE, portx);
 
@@ -4777,9 +5048,9 @@
 	} else
 	    do_v_line(top_y, portx - 1, ACS_VLINE, porty);
 
-	mvaddch(top_y - 1, portx - 1, ACS_URCORNER);
-	mvaddch(porty - 1, top_x - 1, ACS_LLCORNER);
-	mvaddch(porty - 1, portx - 1, ACS_LRCORNER);
+	MvAddCh(top_y - 1, portx - 1, ACS_URCORNER);
+	MvAddCh(porty - 1, top_x - 1, ACS_LLCORNER);
+	MvAddCh(porty - 1, portx - 1, ACS_LRCORNER);
 
 	if (!pending_pan) {
 #if HAVE_GETTIMEOFDAY
@@ -4795,11 +5066,11 @@
 
 	    doupdate();
 #if HAVE_GETTIMEOFDAY
+#define TIMEVAL2S(data) ((double) data.tv_sec + ((double) data.tv_usec / 1.0e6))
 	    if (timing) {
 		double elapsed;
 		gettimeofday(&after, 0);
-		elapsed = (after.tv_sec + after.tv_usec / 1.0e6)
-		    - (before.tv_sec + before.tv_usec / 1.0e6);
+		elapsed = (TIMEVAL2S(after) - TIMEVAL2S(before));
 		move(LINES - 1, COLS - 12);
 		printw("Secs: %2.03f", elapsed);
 		refresh();
@@ -4927,7 +5198,7 @@
 {
     noecho();
     wmove(win, 10, 1);
-    mvwaddstr(win, 10, 1, " Press any key to continue");
+    MvWAddStr(win, 10, 1, " Press any key to continue");
     wrefresh(win);
     wGetchar(win);
 }
@@ -4954,9 +5225,9 @@
 	wbkgd(subWin, COLOR_PAIR(2) | ' ');
     }
 #endif
-    wattrset(subWin, A_BOLD);
+    (void) wattrset(subWin, A_BOLD);
     box(subWin, ACS_VLINE, ACS_HLINE);
-    mvwaddstr(subWin, 2, 1, "This is a subwindow");
+    MvWAddStr(subWin, 2, 1, "This is a subwindow");
     wrefresh(win);
 
     /*
@@ -4967,15 +5238,15 @@
      * character to return without needing a newline. - T.Dickey 1997/10/11.
      */
     cbreak();
-    mvwaddstr(win, 0, 1, "This is a test of the flushinp() call.");
+    MvWAddStr(win, 0, 1, "This is a test of the flushinp() call.");
 
-    mvwaddstr(win, 2, 1, "Type random keys for 5 seconds.");
-    mvwaddstr(win, 3, 1,
+    MvWAddStr(win, 2, 1, "Type random keys for 5 seconds.");
+    MvWAddStr(win, 3, 1,
 	      "These should be discarded (not echoed) after the subwindow goes away.");
     wrefresh(win);
 
     for (i = 0; i < 5; i++) {
-	mvwprintw(subWin, 1, 1, "Time = %d", i);
+	MvWPrintw(subWin, 1, 1, "Time = %d", i);
 	wrefresh(subWin);
 	napms(1000);
 	flushinp();
@@ -4987,19 +5258,19 @@
     wrefresh(win);
     napms(1000);
 
-    mvwaddstr(win, 2, 1,
+    MvWAddStr(win, 2, 1,
 	      "If you were still typing when the window timer expired,");
-    mvwaddstr(win, 3, 1,
+    MvWAddStr(win, 3, 1,
 	      "or else you typed nothing at all while it was running,");
-    mvwaddstr(win, 4, 1,
+    MvWAddStr(win, 4, 1,
 	      "test was invalid.  You'll see garbage or nothing at all. ");
-    mvwaddstr(win, 6, 1, "Press a key");
+    MvWAddStr(win, 6, 1, "Press a key");
     wmove(win, 9, 10);
     wrefresh(win);
     echo();
     wGetchar(win);
     flushinp();
-    mvwaddstr(win, 12, 0,
+    MvWAddStr(win, 12, 0,
 	      "If you see any key other than what you typed, flushinp() is broken.");
     Continue(win);
 
@@ -5083,12 +5354,12 @@
 #ifdef NCURSES_MOUSE_VERSION
     mousemask(ALL_MOUSE_EVENTS, (mmask_t *) 0);
 #endif
-    mvaddstr(0, 0, "This is the menu test:");
-    mvaddstr(2, 0, "  Use up and down arrow to move the select bar.");
-    mvaddstr(3, 0, "  'n' and 'p' act like arrows.");
-    mvaddstr(4, 0,
+    MvAddStr(0, 0, "This is the menu test:");
+    MvAddStr(2, 0, "  Use up and down arrow to move the select bar.");
+    MvAddStr(3, 0, "  'n' and 'p' act like arrows.");
+    MvAddStr(4, 0,
 	     "  'b' and 'f' scroll up/down (page), 'u' and 'd' (line).");
-    mvaddstr(5, 0, "  Press return to exit.");
+    MvAddStr(5, 0, "  Press return to exit.");
     refresh();
 
     for (ap = animals; *ap; ap++) {
@@ -5119,8 +5390,8 @@
 	continue;
     }
 
-    (void) mvprintw(LINES - 2, 0,
-		    "You chose: %s\n", item_name(current_item(m)));
+    MvPrintw(LINES - 2, 0,
+	     "You chose: %s\n", item_name(current_item(m)));
     (void) addstr("Press any key to continue...");
     wGetchar(stdscr);
 
@@ -5241,11 +5512,11 @@
     int n;
     WINDOW *menuwin;
 
-    mvaddstr(0, 0, "Interactively set trace level:");
-    mvaddstr(2, 0, "  Press space bar to toggle a selection.");
-    mvaddstr(3, 0, "  Use up and down arrow to move the select bar.");
-    mvaddstr(4, 0, "  Press return to set the trace level.");
-    mvprintw(6, 0, "(Current trace level is %s)", tracetrace(_nc_tracing));
+    MvAddStr(0, 0, "Interactively set trace level:");
+    MvAddStr(2, 0, "  Press space bar to toggle a selection.");
+    MvAddStr(3, 0, "  Use up and down arrow to move the select bar.");
+    MvAddStr(4, 0, "  Press return to set the trace level.");
+    MvPrintw(6, 0, "(Current trace level is %s)", tracetrace(_nc_tracing));
 
     refresh();
 
@@ -5289,8 +5560,8 @@
     trace(newtrace);
     Trace(("trace level interactively set to %s", tracetrace(_nc_tracing)));
 
-    (void) mvprintw(LINES - 2, 0,
-		    "Trace level is %s\n", tracetrace(_nc_tracing));
+    MvPrintw(LINES - 2, 0,
+	     "Trace level is %s\n", tracetrace(_nc_tracing));
     (void) addstr("Press any key to continue...");
     wGetchar(stdscr);
 
@@ -5317,7 +5588,7 @@
 
     if (f) {
 	set_field_buffer(f, 0, label);
-	set_field_opts(f, (int) (field_opts(f) & ~O_ACTIVE));
+	set_field_opts(f, (int) ((unsigned) field_opts(f) & ~O_ACTIVE));
     }
     return (f);
 }
@@ -5496,7 +5767,7 @@
 	    }
 	}
     }
-    mvprintw(0, COLS - 6, "(%s)", mode == REQ_INS_MODE ? "INS" : "OVL");
+    MvPrintw(0, COLS - 6, "(%s)", mode == REQ_INS_MODE ? "INS" : "OVL");
 
     /*
      * Force the field that the user is typing into to be in reverse video,
@@ -5648,7 +5919,7 @@
     addstr("^K   -- clear to end of field  ^X  -- clear field\n");
     addstr("Arrow keys move within a field as you would expect. ^] toggles overlay mode.");
 
-    mvaddstr(4, 57, "Forms Entry Test");
+    MvAddStr(4, 57, "Forms Entry Test");
 
     refresh();
 
@@ -5675,7 +5946,7 @@
     secure =
 	f[n++] = make_field(5, 30, 1, 9, TRUE);
     set_field_type(f[n - 1], fty_passwd);
-    f[n++] = (FIELD *) 0;
+    f[n] = (FIELD *) 0;
 
     if ((form = new_form(f)) != 0) {
 
@@ -5687,7 +5958,7 @@
 	while (!finished) {
 	    switch (form_driver(form, c = form_virtualize(form, w))) {
 	    case E_OK:
-		mvaddstr(5, 57, field_buffer(secure, 1));
+		MvAddStr(5, 57, field_buffer(secure, 1));
 		clrtoeol();
 		refresh();
 		break;
@@ -5774,18 +6045,18 @@
 
     switch (flavor) {
     case 0:
-	wattrset(win, A_NORMAL);
+	(void) wattrset(win, A_NORMAL);
 	break;
     case 1:
-	wattrset(win, A_BOLD);
+	(void) wattrset(win, A_BOLD);
 	break;
     case 2:
 	init_pair(cpair, COLOR_BLUE, COLOR_WHITE);
-	wattrset(win, COLOR_PAIR(cpair) | A_NORMAL);
+	(void) wattrset(win, (attr_t) COLOR_PAIR(cpair) | A_NORMAL);
 	break;
     case 3:
 	init_pair(cpair, COLOR_WHITE, COLOR_BLUE);
-	wattrset(win, COLOR_PAIR(cpair) | A_BOLD);
+	(void) wattrset(win, (attr_t) COLOR_PAIR(cpair) | A_BOLD);
 	break;
     }
 }
@@ -5804,7 +6075,7 @@
 	break;
     case 2:
 	init_pair(cpair, COLOR_RED, COLOR_GREEN);
-	wbkgdset(win, ' ' | A_BLINK | COLOR_PAIR(cpair));
+	wbkgdset(win, colored_chtype(' ', A_BLINK, cpair));
 	break;
     case 3:
 	wbkgdset(win, ' ' | A_NORMAL);
@@ -5890,7 +6161,7 @@
 	    break;
 	}
 	overlap_helpitem(state, item, msg);
-	wattrset(stdscr, A_NORMAL);
+	(void) wattrset(stdscr, A_NORMAL);
 	wbkgdset(stdscr, ' ' | A_NORMAL);
     }
     move(LINES - 1, 0);
@@ -5915,7 +6186,7 @@
 {
     overlap_test_1_attr(a, flavor, col);
     fillwin(a, fill);
-    wattrset(a, A_NORMAL);
+    (void) wattrset(a, A_NORMAL);
 }
 
 static void
@@ -6255,7 +6526,7 @@
     wbkgd(win, A_REVERSE);
     werase(win);
     wmove(win, 0, 0);
-    wprintw(win, "footer: window %p, %d columns", win, cols);
+    wprintw(win, "footer: window %p, %d columns", (void *) win, cols);
     wnoutrefresh(win);
     return OK;
 }
@@ -6266,7 +6537,7 @@
     wbkgd(win, A_REVERSE);
     werase(win);
     wmove(win, 0, 0);
-    wprintw(win, "header: window %p, %d columns", win, cols);
+    wprintw(win, "header: window %p, %d columns", (void *) win, cols);
     wnoutrefresh(win);
     return OK;
 }
@@ -6330,8 +6601,8 @@
 	(void) fflush(stdout);	/* necessary under SVr4 curses */
 
 	/*
-	 * This used to be an 'fgets()' call.  However (on Linux, at least)
-	 * mixing stream I/O and 'read()' (used in the library) causes the
+	 * This used to be an 'fgets()' call (until 1996/10).  However with
+	 * some runtime libraries, mixing stream I/O and 'read()' causes the
 	 * input stream to be flushed when switching between the two.
 	 */
 	command = 0;
@@ -6442,7 +6713,7 @@
 	    break;
 #if USE_LIBPANEL
 	case 's':
-	    nap_msec = atol(optarg);
+	    nap_msec = (int) atol(optarg);
 	    break;
 #endif
 #ifdef TRACE
@@ -6497,7 +6768,7 @@
 	    min_colors = -1;
 	}
 #if NCURSES_VERSION_PATCH >= 20000708
-	else if (assumed_colors)
+	if (assumed_colors)
 	    assume_default_colors(default_fg, default_bg);
 #endif
 #endif
diff -Naur ncurses-5.7.orig/test/newdemo.c ncurses-5.7/test/newdemo.c
--- ncurses-5.7.orig/test/newdemo.c	2008-08-03 16:19:38.000000000 -0400
+++ ncurses-5.7/test/newdemo.c	2011-01-08 18:18:29.738781565 -0500
@@ -2,7 +2,7 @@
  *  newdemo.c	-	A demo program using PDCurses. The program illustrate
  *  	 		the use of colours for text output.
  *
- * $Id: newdemo.c,v 1.31 2008/08/03 20:19:38 tom Exp $
+ * $Id: newdemo.c,v 1.35 2010/12/12 00:19:15 tom Exp $
  */
 
 #include <test.priv.h>
@@ -33,7 +33,7 @@
  */
 #define NMESSAGES   6
 
-static NCURSES_CONST char *messages[] =
+static const char *messages[] =
 {
     "Hello from the Land Down Under",
     "The Land of crocs. and a big Red Rock",
@@ -66,7 +66,7 @@
     nodelay(win, TRUE);
     t = time((time_t *) 0);
     while (1) {
-	if ((int) (key = wgetch(win)) != ERR) {
+	if ((int) (key = (chtype) wgetch(win)) != ERR) {
 	    if (key == 'q' || key == 'Q')
 		return 1;
 	    else
@@ -83,8 +83,8 @@
     if (has_colors()) {
 	if (pair > COLOR_PAIRS)
 	    pair = COLOR_PAIRS;
-	init_pair(pair, foreground, background);
-	wattrset(win, COLOR_PAIR(pair));
+	init_pair((short) pair, (short) foreground, (short) background);
+	(void) wattrset(win, (attr_t) COLOR_PAIR(pair));
     }
 }
 
@@ -94,9 +94,9 @@
     if (has_colors()) {
 	if (pair > COLOR_PAIRS)
 	    pair = COLOR_PAIRS;
-	attrs |= COLOR_PAIR(pair);
+	attrs |= (chtype) COLOR_PAIR(pair);
     }
-    wattrset(win, attrs);
+    (void) wattrset(win, attrs);
     return attrs;
 }
 
@@ -122,17 +122,17 @@
 
     set_colors(swin1, 8, COLOR_RED, COLOR_BLUE);
     werase(swin1);
-    mvwaddstr(swin1, 0, 3, "Sub-window 1");
+    MvWAddStr(swin1, 0, 3, "Sub-window 1");
     wrefresh(swin1);
 
     set_colors(swin2, 9, COLOR_CYAN, COLOR_MAGENTA);
     werase(swin2);
-    mvwaddstr(swin2, 0, 3, "Sub-window 2");
+    MvWAddStr(swin2, 0, 3, "Sub-window 2");
     wrefresh(swin2);
 
     set_colors(swin3, 10, COLOR_YELLOW, COLOR_GREEN);
     werase(swin3);
-    mvwaddstr(swin3, 0, 3, "Sub-window 3");
+    MvWAddStr(swin3, 0, 3, "Sub-window 3");
     wrefresh(swin3);
 
     delwin(swin1);
@@ -192,13 +192,13 @@
 	y3 = bounce(y3, &yd3, h);
 
 	set_colors(win, 11, COLOR_RED, COLOR_BLUE);
-	mvwaddch(win, y1, x1, 'O');
+	MvWAddCh(win, y1, x1, 'O');
 
 	set_colors(win, 12, COLOR_BLUE, COLOR_RED);
-	mvwaddch(win, y2, x2, '*');
+	MvWAddCh(win, y2, x2, '*');
 
 	set_colors(win, 13, COLOR_YELLOW, COLOR_WHITE);
-	mvwaddch(win, y3, x3, '@');
+	MvWAddCh(win, y3, x3, '@');
 
 	wmove(win, 0, 0);
 	wrefresh(win);
@@ -251,7 +251,7 @@
 	for (i = 0; i < 5000; ++i) {
 	    x = rand() % (width - 2) + 1;
 	    y = rand() % (height - 2) + 1;
-	    mvwaddch(win, y, x, c);
+	    MvWAddCh(win, y, x, c);
 	    wrefresh(win);
 	    nodelay(win, TRUE);
 	    if (wgetch(win) != ERR)
@@ -276,7 +276,7 @@
 	use_colors(win, 4, A_BOLD);
 	i = 0;
 	while (*AusMap[i]) {
-	    mvwaddstr(win, i + 1, 8, AusMap[i]);
+	    MvWAddStr(win, i + 1, 8, AusMap[i]);
 	    wrefresh(win);
 	    delay_output(50);
 	    ++i;
@@ -284,7 +284,7 @@
 
 	set_colors(win, 5, COLOR_BLUE, COLOR_WHITE);
 	use_colors(win, 5, A_BLINK);
-	mvwaddstr(win, height - 2, 6, " PDCurses 2.1 for DOS, OS/2 and Unix");
+	MvWAddStr(win, height - 2, 6, " PDCurses 2.1 for DOS, OS/2 and Unix");
 	wrefresh(win);
 
 	/* Draw running messages */
@@ -300,9 +300,9 @@
 	    }
 
 	    if (i < w)
-		mvwaddnstr(win, height / 2, w - i, buffer, i);
+		(void) mvwaddnstr(win, height / 2, w - i, buffer, i);
 	    else
-		mvwaddnstr(win, height / 2, 1, buffer, w);
+		(void) mvwaddnstr(win, height / 2, 1, buffer, w);
 
 	    wrefresh(win);
 	    nodelay(win, TRUE);
@@ -321,19 +321,19 @@
 	set_colors(win, 7, COLOR_RED, COLOR_GREEN);
 	memset(save, ' ', sizeof(save));
 	for (i = 2; i < width - 4; ++i) {
-	    k = mvwinch(win, 4, i);
+	    k = (int) mvwinch(win, 4, i);
 	    if (k == ERR)
 		break;
-	    save[j++] = c = k;
+	    save[j++] = c = (chtype) k;
 	    c &= A_CHARTEXT;
-	    mvwaddch(win, 4, i, c);
+	    MvWAddCh(win, 4, i, c);
 	}
 	wrefresh(win);
 
 	/* Put a message up wait for a key */
 	i = height - 2;
 	use_colors(win, 5, A_NORMAL);
-	mvwaddstr(win, i, 5, " Type a key to continue or 'Q' to quit ");
+	MvWAddStr(win, i, 5, " Type a key to continue or 'Q' to quit ");
 	wrefresh(win);
 
 	if (WaitForUser(win) == 1)
@@ -341,14 +341,14 @@
 
 	j = 0;			/* Restore the old line */
 	for (i = 2; i < width - 4; ++i)
-	    mvwaddch(win, 4, i, save[j++]);
+	    MvWAddCh(win, 4, i, save[j++]);
 	wrefresh(win);
 
 	BouncingBalls(win);
 	/* Put a message up wait for a key */
 	i = height - 2;
 	use_colors(win, 5, A_NORMAL);
-	mvwaddstr(win, i, 5, " Type a key to continue or 'Q' to quit ");
+	MvWAddStr(win, i, 5, " Type a key to continue or 'Q' to quit ");
 	wrefresh(win);
 	if (WaitForUser(win) == 1)
 	    break;
diff -Naur ncurses-5.7.orig/test/programs ncurses-5.7/test/programs
--- ncurses-5.7.orig/test/programs	2008-08-16 17:47:39.000000000 -0400
+++ ncurses-5.7/test/programs	2011-01-08 18:13:50.791157110 -0500
@@ -1,6 +1,6 @@
-# $Id: programs,v 1.14 2008/08/16 21:47:39 tom Exp $
+# $Id: programs,v 1.19 2009/09/12 19:44:01 tom Exp $
 ##############################################################################
-# Copyright (c) 2006-2007,2008 Free Software Foundation, Inc.                #
+# Copyright (c) 2006-2008,2009 Free 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"), #
@@ -35,6 +35,7 @@
 bs		$(LDFLAGS_CURSES)	$(LOCAL_LIBS)	bs
 cardfile	$(LDFLAGS_DEFAULT)	$(LOCAL_LIBS)	cardfile
 chgat		$(LDFLAGS_CURSES)	$(LOCAL_LIBS)	chgat
+clip_printw	$(LDFLAGS_CURSES)	$(LOCAL_LIBS)	clip_printw
 color_set	$(LDFLAGS_CURSES)	$(LOCAL_LIBS)	color_set
 demo_altkeys	$(LDFLAGS_CURSES)	$(LOCAL_LIBS)	demo_altkeys
 demo_defkey	$(LDFLAGS_CURSES)	$(LOCAL_LIBS)	demo_defkey
@@ -43,6 +44,7 @@
 demo_menus	$(LDFLAGS_DEFAULT)	$(LOCAL_LIBS)	demo_menus
 demo_panels	$(LDFLAGS_DEFAULT)	$(LOCAL_LIBS)	demo_panels
 demo_termcap	$(LDFLAGS_TINFO)	$(LOCAL_LIBS)	demo_termcap
+demo_terminfo	$(LDFLAGS_TINFO)	$(LOCAL_LIBS)	demo_terminfo
 ditto		$(LDFLAGS_THREADS)	$(LOCAL_LIBS)	ditto
 dots		$(LDFLAGS_TINFO)	$(LOCAL_LIBS)	dots
 dots_mvcur	$(LDFLAGS_CURSES)	$(LOCAL_LIBS)	dots_mvcur
@@ -57,6 +59,7 @@
 inch_wide	$(LDFLAGS_CURSES)	$(LOCAL_LIBS)	inch_wide
 inchs		$(LDFLAGS_CURSES)	$(LOCAL_LIBS)	inchs
 ins_wide	$(LDFLAGS_CURSES)	$(LOCAL_LIBS)	ins_wide
+insdelln	$(LDFLAGS_CURSES)	$(LOCAL_LIBS)	insdelln
 inserts		$(LDFLAGS_CURSES)	$(LOCAL_LIBS)	inserts
 key_names	$(LDFLAGS_CURSES)	$(LOCAL_LIBS)	key_names
 keynames	$(LDFLAGS_CURSES)	$(LOCAL_LIBS)	keynames
@@ -70,6 +73,10 @@
 redraw		$(LDFLAGS_CURSES)	$(LOCAL_LIBS)	redraw
 savescreen	$(LDFLAGS_CURSES)	$(LOCAL_LIBS)	savescreen
 tclock		$(LDFLAGS_CURSES)	$(LOCAL_LIBS)	tclock
+test_add_wchstr	$(LDFLAGS_CURSES)	$(LOCAL_LIBS)	test_add_wchstr
+test_addchstr	$(LDFLAGS_CURSES)	$(LOCAL_LIBS)	test_addchstr
+test_addstr	$(LDFLAGS_CURSES)	$(LOCAL_LIBS)	test_addstr
+test_addwstr	$(LDFLAGS_CURSES)	$(LOCAL_LIBS)	test_addwstr
 test_arrays	$(LDFLAGS_TINFO)	$(LOCAL_LIBS)	test_arrays
 test_get_wstr	$(LDFLAGS_CURSES)	$(LOCAL_LIBS)	test_get_wstr
 test_getstr	$(LDFLAGS_CURSES)	$(LOCAL_LIBS)	test_getstr
diff -Naur ncurses-5.7.orig/test/railroad.c ncurses-5.7/test/railroad.c
--- ncurses-5.7.orig/test/railroad.c	2008-02-09 13:08:43.000000000 -0500
+++ ncurses-5.7/test/railroad.c	2011-01-08 18:13:50.791157110 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2000-2007,2008 Free Software Foundation, Inc.              *
+ * Copyright (c) 2000-2008,2009 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -29,7 +29,7 @@
 /*
  * Author: Thomas E. Dickey - 2000
  *
- * $Id: railroad.c,v 1.16 2008/02/09 18:08:43 tom Exp $
+ * $Id: railroad.c,v 1.19 2009/10/24 21:37:56 tom Exp $
  *
  * A simple demo of the termcap interface.
  */
@@ -58,13 +58,17 @@
 static int
 outc(TPUTS_ARG c)
 {
+    int rc = OK;
+
     if (interrupted) {
-	char tmp = c;
-	write(STDOUT_FILENO, &tmp, 1);
+	char tmp = (char) c;
+	if (write(STDOUT_FILENO, &tmp, 1) == -1)
+	    rc = ERR;
     } else {
-	putc(c, stdout);
+	if (putc(c, stdout) == EOF)
+	    rc = ERR;
     }
-    return 0;
+    return rc;
 }
 
 static void
@@ -82,7 +86,7 @@
 }
 
 static void
-ShowCursor(int flag)
+MyShowCursor(int flag)
 {
     if (startC != 0 && finisC != 0) {
 	tputs(flag ? startC : finisC, 1, outc);
@@ -166,7 +170,7 @@
 {
     Underline(0);
     StandOut(0);
-    ShowCursor(1);
+    MyShowCursor(1);
 }
 
 static void
@@ -214,14 +218,14 @@
 	startC = tgetstr("ve", &ap);
 	finisC = tgetstr("vi", &ap);
 
-	ShowCursor(0);
+	MyShowCursor(0);
 
 	CATCHALL(onsig);
 
 	while (*args) {
 	    ShowSign(*args++);
 	}
-	ShowCursor(1);
+	MyShowCursor(1);
     }
 }
 
diff -Naur ncurses-5.7.orig/test/rain.c ncurses-5.7/test/rain.c
--- ncurses-5.7.orig/test/rain.c	2008-05-24 19:34:34.000000000 -0400
+++ ncurses-5.7/test/rain.c	2011-01-08 18:18:29.498656661 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2006,2008 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            *
@@ -26,7 +26,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: rain.c,v 1.34 2008/05/24 23:34:34 tom Exp $
+ * $Id: rain.c,v 1.38 2010/11/13 20:11:46 tom Exp $
  */
 #include <test.priv.h>
 
@@ -74,23 +74,23 @@
     ExitProgram(EXIT_FAILURE);
 }
 
-static float
+static double
 ranf(void)
 {
     long r = (rand() & 077777);
-    return ((float) r / 32768.);
+    return ((double) r / 32768.);
 }
 
 static int
 random_x(void)
 {
-    return (((float) (COLS - 4) * ranf()) + 2);
+    return (int) (((double) (COLS - 4) * ranf()) + 2);
 }
 
 static int
 random_y(void)
 {
-    return (((float) (LINES - 4) * ranf()) + 2);
+    return (int) (((double) (LINES - 4) * ranf()) + 2);
 }
 
 static int
@@ -102,10 +102,10 @@
 	--j;
     if (has_colors()) {
 	int z = (int) (3 * ranf());
-	chtype color = COLOR_PAIR(z);
+	chtype color = (chtype) COLOR_PAIR(z);
 	if (z)
 	    color |= A_BOLD;
-	attrset(color);
+	(void) attrset(color);
     }
     return j;
 }
@@ -113,47 +113,47 @@
 static void
 part1(DATA * drop)
 {
-    mvaddch(drop->y, drop->x, '.');
+    MvAddCh(drop->y, drop->x, '.');
 }
 
 static void
 part2(DATA * drop)
 {
-    mvaddch(drop->y, drop->x, 'o');
+    MvAddCh(drop->y, drop->x, 'o');
 }
 
 static void
 part3(DATA * drop)
 {
-    mvaddch(drop->y, drop->x, 'O');
+    MvAddCh(drop->y, drop->x, 'O');
 }
 
 static void
 part4(DATA * drop)
 {
-    mvaddch(drop->y - 1, drop->x, '-');
-    mvaddstr(drop->y, drop->x - 1, "|.|");
-    mvaddch(drop->y + 1, drop->x, '-');
+    MvAddCh(drop->y - 1, drop->x, '-');
+    MvAddStr(drop->y, drop->x - 1, "|.|");
+    MvAddCh(drop->y + 1, drop->x, '-');
 }
 
 static void
 part5(DATA * drop)
 {
-    mvaddch(drop->y - 2, drop->x, '-');
-    mvaddstr(drop->y - 1, drop->x - 1, "/ \\");
-    mvaddstr(drop->y, drop->x - 2, "| O |");
-    mvaddstr(drop->y + 1, drop->x - 1, "\\ /");
-    mvaddch(drop->y + 2, drop->x, '-');
+    MvAddCh(drop->y - 2, drop->x, '-');
+    MvAddStr(drop->y - 1, drop->x - 1, "/ \\");
+    MvAddStr(drop->y, drop->x - 2, "| O |");
+    MvAddStr(drop->y + 1, drop->x - 1, "\\ /");
+    MvAddCh(drop->y + 2, drop->x, '-');
 }
 
 static void
 part6(DATA * drop)
 {
-    mvaddch(drop->y - 2, drop->x, ' ');
-    mvaddstr(drop->y - 1, drop->x - 1, "   ");
-    mvaddstr(drop->y, drop->x - 2, "     ");
-    mvaddstr(drop->y + 1, drop->x - 1, "   ");
-    mvaddch(drop->y + 2, drop->x, ' ');
+    MvAddCh(drop->y - 2, drop->x, ' ');
+    MvAddStr(drop->y - 1, drop->x - 1, "   ");
+    MvAddStr(drop->y, drop->x - 2, "     ");
+    MvAddStr(drop->y + 1, drop->x - 1, "   ");
+    MvAddCh(drop->y + 2, drop->x, ' ');
 }
 
 #ifdef USE_PTHREADS
@@ -222,7 +222,11 @@
      * Find myself in the list of threads so we can count the number of loops.
      */
     for (mystats = 0; mystats < MAX_THREADS; ++mystats) {
+#ifdef __MINGW32__
+	if (drop_threads[mystats].myself.p == pthread_self().p)
+#else
 	if (drop_threads[mystats].myself == pthread_self())
+#endif
 	    break;
     }
 
@@ -310,8 +314,8 @@
 	if (use_default_colors() == OK)
 	    bg = -1;
 #endif
-	init_pair(1, COLOR_BLUE, bg);
-	init_pair(2, COLOR_CYAN, bg);
+	init_pair(1, COLOR_BLUE, (short) bg);
+	init_pair(2, COLOR_CYAN, (short) bg);
     }
     nl();
     noecho();
diff -Naur ncurses-5.7.orig/test/redraw.c ncurses-5.7/test/redraw.c
--- ncurses-5.7.orig/test/redraw.c	2007-06-30 13:55:06.000000000 -0400
+++ ncurses-5.7/test/redraw.c	2011-01-08 18:13:50.791157110 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2006,2007 Free Software Foundation, Inc.                   *
+ * Copyright (c) 2006-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: redraw.c,v 1.4 2007/06/30 17:55:06 tom Exp $
+ * $Id: redraw.c,v 1.5 2010/05/01 22:04:08 tom Exp $
  *
  * Demonstrate the redrawwin() and wredrawln() functions.
  * Thomas Dickey - 2006/11/4
@@ -65,6 +65,8 @@
     int max_y, max_x;
     int beg_y, beg_x;
 
+    assert(win != 0);
+
     scrollok(win, TRUE);
     keypad(win, TRUE);
     getmaxyx(win, max_y, max_x);
diff -Naur ncurses-5.7.orig/test/savescreen.c ncurses-5.7/test/savescreen.c
--- ncurses-5.7.orig/test/savescreen.c	2007-07-21 13:57:37.000000000 -0400
+++ ncurses-5.7/test/savescreen.c	2011-01-08 18:18:29.498656661 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2007 Free Software Foundation, Inc.                        *
+ * Copyright (c) 2007-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            *
@@ -26,7 +26,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: savescreen.c,v 1.10 2007/07/21 17:57:37 tom Exp $
+ * $Id: savescreen.c,v 1.13 2010/11/13 21:18:00 tom Exp $
  *
  * Demonstrate save/restore functions from the curses library.
  * Thomas Dickey - 2007/7/14
@@ -34,6 +34,9 @@
 
 #include <test.priv.h>
 
+#include <sys/types.h>
+#include <sys/stat.h>
+
 #if TIME_WITH_SYS_TIME
 # include <sys/time.h>
 # include <time.h>
@@ -47,6 +50,13 @@
 
 static bool use_init = FALSE;
 
+static int
+fexists(const char *name)
+{
+    struct stat sb;
+    return (stat(name, &sb) == 0 && (sb.st_mode & S_IFMT) == S_IFREG);
+}
+
 static void
 setup_next(void)
 {
@@ -163,6 +173,14 @@
 	}
     }
 
+    files = argv + optind;
+    last = argc - optind - 1;
+
+    if (replaying) {
+	while (last >= 0 && !fexists(files[last]))
+	    --last;
+    }
+
     initscr();
     cbreak();
     noecho();
@@ -171,13 +189,11 @@
     if (has_colors()) {
 	start_color();
 	for (ch = 0; ch < COLOR_PAIRS; ++ch) {
-	    short pair = ch % COLOR_PAIRS;
-	    init_pair(pair, COLOR_WHITE, ch % COLORS);
+	    short pair = (short) (ch % COLOR_PAIRS);
+	    init_pair(pair, COLOR_WHITE, (short) (ch % COLORS));
 	}
     }
 
-    files = argv + optind;
-    last = argc - optind - 1;
     if (replaying) {
 
 	/*
@@ -251,7 +267,7 @@
 	getyx(stdscr, y, x);
 
 	while (!done) {
-	    switch (ch = get_command(which, last)) {
+	    switch (get_command(which, last)) {
 	    case 'n':
 		setup_next();
 		done = TRUE;
@@ -273,8 +289,8 @@
 		    }
 		    ++which;
 		    if (has_colors()) {
-			short pair = which % COLOR_PAIRS;
-			bkgd(COLOR_PAIR(pair));
+			short pair = (short) (which % COLOR_PAIRS);
+			bkgd((chtype) COLOR_PAIR(pair));
 		    }
 		} else {
 		    beep();
diff -Naur ncurses-5.7.orig/test/savescreen.sh ncurses-5.7/test/savescreen.sh
--- ncurses-5.7.orig/test/savescreen.sh	2007-07-14 17:50:26.000000000 -0400
+++ ncurses-5.7/test/savescreen.sh	2011-01-08 18:13:50.791157110 -0500
@@ -1,6 +1,6 @@
 #!/bin/sh
 ##############################################################################
-# Copyright (c) 2007 Free Software Foundation, Inc.                          #
+# Copyright (c) 2007,2009 Free 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"), #
@@ -26,7 +26,7 @@
 # use or other dealings in this Software without prior written               #
 # authorization.                                                             #
 ##############################################################################
-# $Id: savescreen.sh,v 1.3 2007/07/14 21:50:26 tom Exp $
+# $Id: savescreen.sh,v 1.4 2009/10/10 17:08:45 tom Exp $
 #
 # Use this script to exercise "savescreen".
 # It starts by generating a series of temporary-filenames, which are passed
@@ -49,6 +49,7 @@
 	while test -f $BEGINS
 	do
 		./savescreen -r $PARAMS
+		test $? != 0 && break
 	done
 else
 	echo "No screens were saved"
diff -Naur ncurses-5.7.orig/test/tclock.c ncurses-5.7/test/tclock.c
--- ncurses-5.7.orig/test/tclock.c	2005-04-16 12:39:27.000000000 -0400
+++ ncurses-5.7/test/tclock.c	2011-01-08 18:18:29.498656661 -0500
@@ -1,4 +1,4 @@
-/* $Id: tclock.c,v 1.25 2005/04/16 16:39:27 tom Exp $ */
+/* $Id: tclock.c,v 1.29 2010/11/14 01:04:52 tom Exp $ */
 
 #include <test.priv.h>
 
@@ -53,7 +53,7 @@
 static void
 plot(int x, int y, char col)
 {
-    mvaddch(y, x, (chtype) col);
+    MvAddCh(y, x, (chtype) col);
 }
 
 /* Draw a diagonal(arbitrary) line using Bresenham's alogrithm. */
@@ -67,7 +67,7 @@
     int d;
 
     if (has_colors())
-	attrset(COLOR_PAIR(pair));
+	(void) attrset((attr_t) COLOR_PAIR(pair));
 
     dx = x2 - from_x;
     dy = y2 - from_y;
@@ -130,7 +130,7 @@
     struct tm *t;
     char szChar[10];
     char *text;
-    int my_bg = COLOR_BLACK;
+    short my_bg = COLOR_BLACK;
 #if HAVE_GETTIMEOFDAY
     struct timeval current;
     double fraction = 0.0;
@@ -175,10 +175,10 @@
 	sdy = A2Y(sangle, sradius);
 	sprintf(szChar, "%d", i + 1);
 
-	mvaddstr(cy - sdy, cx + sdx, szChar);
+	MvAddStr(cy - sdy, cx + sdx, szChar);
     }
 
-    mvaddstr(0, 0, "ASCII Clock by Howard Jones (ha.jones@ic.ac.uk),1994");
+    MvAddStr(0, 0, "ASCII Clock by Howard Jones (ha.jones@ic.ac.uk),1994");
 
     sradius = (4 * sradius) / 5;
     for (;;) {
@@ -201,7 +201,7 @@
 
 #if HAVE_GETTIMEOFDAY
 	gettimeofday(&current, 0);
-	fraction = (current.tv_usec / 1.0e6);
+	fraction = ((double) current.tv_usec / 1.0e6);
 #endif
 	sangle = ((t->tm_sec + fraction) * (2.0 * PI) / 60.0);
 	sdx = A2X(sangle, sradius);
@@ -209,20 +209,20 @@
 
 	dline(3, cx, cy, cx + mdx, cy - mdy, '#');
 
-	attrset(A_REVERSE);
+	(void) attrset(A_REVERSE);
 	dline(2, cx, cy, cx + hdx, cy - hdy, '.');
 	attroff(A_REVERSE);
 
 	if (has_colors())
-	    attrset(COLOR_PAIR(1));
+	    (void) attrset(COLOR_PAIR(1));
 
 	dline(1, cx, cy, cx + sdx, cy - sdy, 'O');
 
 	if (has_colors())
-	    attrset(COLOR_PAIR(0));
+	    (void) attrset(COLOR_PAIR(0));
 
 	text = ctime(&tim);
-	mvprintw(2, 0, "%.*s", (int) (strlen(text) - 1), text);
+	MvPrintw(2, 0, "%.*s", (int) (strlen(text) - 1), text);
 	refresh();
 	if ((t->tm_sec % 5) == 0
 	    && t->tm_sec != lastbeep) {
diff -Naur ncurses-5.7.orig/test/test.priv.h ncurses-5.7/test/test.priv.h
--- ncurses-5.7.orig/test/test.priv.h	2008-10-04 17:53:41.000000000 -0400
+++ ncurses-5.7/test/test.priv.h	2011-01-08 18:18:29.498656661 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2007,2008 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            *
@@ -29,7 +29,7 @@
 /****************************************************************************
  *  Author: Thomas E. Dickey                    1996-on                     *
  ****************************************************************************/
-/* $Id: test.priv.h,v 1.79 2008/10/04 21:53:41 tom Exp $ */
+/* $Id: test.priv.h,v 1.97 2010/11/13 20:33:36 tom Exp $ */
 
 #ifndef __TEST_PRIV_H
 #define __TEST_PRIV_H 1
@@ -42,14 +42,17 @@
  */
 #ifdef  HAVE_LIBFORMW
 #define HAVE_LIBFORMW 1
+#define HAVE_LIBFORM 1
 #endif
 
 #ifdef  HAVE_LIBMENUW
 #define HAVE_LIBMENUW 1
+#define HAVE_LIBMENU 1
 #endif
 
 #ifdef  HAVE_LIBPANELW
 #define HAVE_LIBPANELW 1
+#define HAVE_LIBPANEL 1
 #endif
 
 /*
@@ -183,10 +186,6 @@
 #define HAVE_TYPEAHEAD 0
 #endif
 
-#ifndef HAVE_TIGETSTR
-#define HAVE_TIGETSTR 0
-#endif
-
 #ifndef HAVE_WINSSTR
 #define HAVE_WINSSTR 0
 #endif
@@ -207,19 +206,32 @@
 #define NEED_PTEM_H 0
 #endif
 
+#ifndef NEED_WCHAR_H
+#define NEED_WCHAR_H 0
+#endif
+
 #ifndef NO_LEAKS
 #define NO_LEAKS 0
 #endif
 
 #include <stdlib.h>
+#include <stdarg.h>
 #include <string.h>
 #include <sys/types.h>
+#include <errno.h>
 
 #if HAVE_UNISTD_H
 #include <unistd.h>
 #endif
 
-#include <signal.h>	/* include before curses.h to work around glibc bug */
+#include <signal.h>		/* include before curses.h to work around glibc bug */
+
+#if NEED_WCHAR_H
+#include <wchar.h>
+#ifdef HAVE_LIBUTF8_H
+#include <libutf8.h>
+#endif
+#endif
 
 #if defined(HAVE_XCURSES)
 #include <xcurses.h>
@@ -274,20 +286,20 @@
 #if HAVE_LOCALE_H
 #include <locale.h>
 #else
-#define setlocale(name,string) /* nothing */
+#define setlocale(name,string)	/* nothing */
 #endif
 
 #include <assert.h>
 #include <ctype.h>
 
 #ifndef GCC_NORETURN
-#define GCC_NORETURN /* nothing */
+#define GCC_NORETURN		/* nothing */
 #endif
 #ifndef GCC_PRINTFLIKE
-#define GCC_PRINTFLIKE(a,b) /* nothing */
+#define GCC_PRINTFLIKE(a,b)	/* nothing */
 #endif
 #ifndef GCC_UNUSED
-#define GCC_UNUSED /* nothing */
+#define GCC_UNUSED		/* nothing */
 #endif
 
 #ifndef HAVE_GETNSTR
@@ -303,7 +315,7 @@
 #endif
 
 #ifndef USE_WIDEC_SUPPORT
-#if defined(_XOPEN_SOURCE_EXTENDED) && defined(WACS_ULCORNER)
+#if (defined(_XOPEN_SOURCE_EXTENDED) || defined(_XPG5)) && defined(WACS_ULCORNER)
 #define USE_WIDEC_SUPPORT 1
 #else
 #define USE_WIDEC_SUPPORT 0
@@ -356,9 +368,18 @@
 #define ESCAPE		CTRL('[')
 
 #ifndef KEY_MIN
-#define KEY_MIN 256	/* not defined in Solaris 8 */
+#define KEY_MIN 256		/* not defined in Solaris 8 */
 #endif
 
+#ifdef DECL_CURSES_DATA_BOOLNAMES
+extern char *boolnames[], *boolcodes[], *boolfnames[];
+extern char *numnames[], *numcodes[], *numfnames[];
+extern char *strnames[], *strcodes[], *strfnames[];
+#endif
+
+#define colored_chtype(ch, attr, pair) \
+	((chtype) (ch) | (chtype) (attr) | (chtype) COLOR_PAIR(pair))
+
 /*
  * Workaround for HPUX
  */
@@ -374,6 +395,25 @@
 #endif
 
 /*
+ * Workaround in case getcchar() returns a positive value when the source
+ * string produces only a L'\0'.
+ */
+#define TEST_CCHAR(s, count, then_stmt, else_stmt) \
+	if ((count = getcchar(s, NULL, NULL, NULL, NULL)) > 0) { \
+	    wchar_t test_wch[CCHARW_MAX + 2]; \
+	    attr_t test_attrs; \
+	    short test_pair; \
+	    \
+	    if (getcchar( s, test_wch, &test_attrs, &test_pair, NULL) == OK \
+		&& test_wch[0] != L'\0') { \
+		then_stmt \
+	    } else { \
+		else_stmt \
+	    } \
+	} else { \
+	    else_stmt \
+	}
+/*
  * These usually are implemented as macros, but may be functions.
  */
 #if !defined(getcurx) && !HAVE_GETCURX
@@ -464,12 +504,20 @@
 #define EXIT_FAILURE 1
 #endif
 
+#ifdef __MINGW32__
+#include <nc_mingw.h>
+/* conflicts in test/firstlast.c */
+#undef large
+#undef small
+
+#endif
+
 /* Use this to quiet gcc's -Wwrite-strings warnings, but accommodate SVr4
  * curses which doesn't have const parameters declared (so far) in the places
  * that XSI shows.
  */
 #ifndef NCURSES_CONST
-#define NCURSES_CONST /* nothing */
+#define NCURSES_CONST		/* nothing */
 #endif
 
 /* out-of-band values for representing absent capabilities */
@@ -482,7 +530,7 @@
 #define CANCELLED_NUMERIC	(-2)
 #define CANCELLED_STRING	(char *)(-1)
 
-#define VALID_BOOLEAN(s) ((unsigned char)(s) <= 1) /* reject "-1" */
+#define VALID_BOOLEAN(s) ((unsigned char)(s) <= 1)	/* reject "-1" */
 #define VALID_NUMERIC(s) ((s) >= 0)
 #define VALID_STRING(s)  ((s) != CANCELLED_STRING && (s) != ABSENT_STRING)
 
@@ -521,12 +569,32 @@
 #endif
 
 /*
+ * Workaround to build with Sun's default SVr4 curses.
+ */
+#ifdef NCURSES_VERSION
+#ifndef HAVE_VW_PRINTW
+#define HAVE_VW_PRINTW 1
+#endif
+#endif
+
+/*
+ * ncurses provides arrays of capability names; X/Open discarded these SVr4
+ * features.  Some implementations continue to provide them (see the test
+ * configure script).
+ */
+#ifdef NCURSES_VERSION
+#ifndef HAVE_CURSES_DATA_BOOLNAMES
+#define HAVE_CURSES_DATA_BOOLNAMES 1
+#endif
+#endif
+
+/*
  * ncurses uses const in some places where X/Open does (or did) not allow.
  */
 #ifdef NCURSES_VERSION
 #define CONST_MENUS const
 #else
-#define CONST_MENUS /* nothing */
+#define CONST_MENUS		/* nothing */
 #endif
 
 #ifndef HAVE_USE_WINDOW
@@ -542,8 +610,8 @@
  */
 
 #if !HAVE_USE_WINDOW
-typedef int (*NCURSES_WINDOW_CB)(WINDOW *, void *);
-typedef int (*NCURSES_SCREEN_CB)(SCREEN *, void *);
+typedef int (*NCURSES_WINDOW_CB) (WINDOW *, void *);
+typedef int (*NCURSES_SCREEN_CB) (SCREEN *, void *);
 #endif
 
 #if HAVE_USE_WINDOW
@@ -560,7 +628,7 @@
 #define USING_SCREEN(s,func,data) use_screen(s, (NCURSES_SCREEN_CB) func, data)
 #define WANT_USE_SCREEN() extern void _nc_want_use_screen(void)
 #else
-#define USING_SCREEN(s,func,data) func(s,data)
+#define USING_SCREEN(s,func,data) func(data)
 #define WANT_USE_SCREEN() extern void _nc_want_use_screen(void)
 #endif
 
@@ -572,6 +640,27 @@
 #define USE_TRACE 0
 #endif
 
+#define MvAddCh         (void) mvaddch
+#define MvWAddCh        (void) mvwaddch
+#define MvAddStr        (void) mvaddstr
+#define MvWAddStr       (void) mvwaddstr
+#define MvWAddChStr     (void) mvwaddchstr
+#define MvPrintw        (void) mvprintw
+#define MvWPrintw       (void) mvwprintw
+#define MvHLine         (void) mvhline
+#define MvWHLine        (void) mvwhline
+#define MvVLine         (void) mvvline
+#define MvWVLine        (void) mvwvline
+
+/*
+ * Workaround for defective implementation of gcc attribute warn_unused_result
+ */
+#if defined(__GNUC__) && defined(_FORTIFY_SOURCE)
+#define IGNORE_RC(func) errno = func
+#else
+#define IGNORE_RC(func) (void) func
+#endif /* gcc workarounds */
+
 #define init_mb(state)	memset(&state, 0, sizeof(state))
 
 #endif /* __TEST_PRIV_H */
diff -Naur ncurses-5.7.orig/test/test_add_wchstr.c ncurses-5.7/test/test_add_wchstr.c
--- ncurses-5.7.orig/test/test_add_wchstr.c	1969-12-31 19:00:00.000000000 -0500
+++ ncurses-5.7/test/test_add_wchstr.c	2011-01-08 18:18:29.774782290 -0500
@@ -0,0 +1,589 @@
+/****************************************************************************
+ * Copyright (c) 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            *
+ * "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: test_add_wchstr.c,v 1.13 2010/12/25 22:49:28 tom Exp $
+ *
+ * Demonstrate the waddwchstr() and wadd_wch functions.
+ * Thomas Dickey - 2009/9/12
+ *
+ * Note: to provide inputs for *add_wch(), we use setcchar().  A quirk of the
+ * X/Open definition for that function is that the string contains no
+ * characters with negative width.  Any control character (such as tab) falls
+ * into that category.  So it follows that *add_wch() cannot render a tab
+ * character because there is no legal way to construct a cchar_t containing
+ * one.  X/Open does not document this, and it would be logical to assume that
+ * *addwchstr() has the same limitation, but it uses a wchar_t string directly,
+ * and does not document how tabs are handled.
+ */
+
+#include <test.priv.h>
+
+#if USE_WIDEC_SUPPORT
+
+#define WIDE_LINEDATA
+#include <linedata.h>
+
+#undef MvAddCh
+#undef MvAddStr
+#undef MvWAddCh
+#undef MvWAddStr
+
+/* definitions to make it simpler to compare with test_addstr.c */
+#define AddNStr    add_wchnstr
+#define AddStr     add_wchstr
+#define MvAddNStr  (void) mvadd_wchnstr
+#define MvAddStr   (void) mvadd_wchstr
+#define MvWAddNStr (void) mvwadd_wchnstr
+#define MvWAddStr  (void) mvwadd_wchstr
+#define WAddNStr   wadd_wchnstr
+#define WAddStr    wadd_wchstr
+
+#define MY_TABSIZE 8
+
+typedef enum {
+    oDefault = 0,
+    oMove = 1,
+    oWindow = 2,
+    oMoveWindow = 3
+} Options;
+
+static bool m_opt = FALSE;
+static bool pass_ctls = FALSE;
+static bool w_opt = FALSE;
+static int n_opt = -1;
+
+static cchar_t *temp_buffer;
+static size_t temp_length;
+
+#define TempBuffer(source_len, source_cast) \
+    if (source != 0) { \
+	const char *temp; \
+	size_t need = source_len + 1; \
+	wchar_t have[2]; \
+	int n = 0; \
+ \
+	if (need > temp_length) { \
+	    temp_length = need * 2; \
+	    temp_buffer = typeRealloc(cchar_t, temp_length, temp_buffer); \
+	} \
+	have[0] = 0; \
+	have[1] = 0; \
+	do { \
+	    have[0] = source_cast; \
+	    if (!pass_ctls \
+	     && have[0] != 0 \
+	     && have[0] < 256 \
+	     && (temp = unctrl((chtype) have[0])) != 0 \
+	     && strlen(temp) > 1) { \
+		while (*temp != '\0') { \
+		    have[0] = *temp++; \
+		    setcchar(&temp_buffer[n++], have, A_NORMAL, 0, NULL); \
+		} \
+	    } else { \
+		setcchar(&temp_buffer[n++], have, A_NORMAL, 0, NULL); \
+	    } \
+	} while (have[0] != 0); \
+    } else if (temp_buffer != 0) { \
+	free(temp_buffer); \
+	temp_buffer = 0; \
+	temp_length = 0; \
+    } \
+    return temp_buffer;
+
+static size_t
+ChWLen(const wchar_t *source)
+{
+    size_t result = wcslen(source);
+
+    if (!pass_ctls) {
+	size_t adjust = 0;
+	size_t n;
+	NCURSES_CONST char *s;
+
+	for (n = 0; n < result; ++n) {
+	    if (source[n] < 256 && (s = unctrl((chtype) source[n])) != 0) {
+		adjust += (strlen(s) - 1);
+	    }
+	}
+	result += adjust;
+    }
+    return result;
+}
+
+static cchar_t *
+ChStr(const char *source)
+{
+    TempBuffer(strlen(source), UChar(*source++));
+}
+
+static cchar_t *
+ChWStr(const wchar_t *source)
+{
+    TempBuffer(ChWLen(source), *source++);
+}
+
+static void
+legend(WINDOW *win, int level, Options state, wchar_t *buffer, int length)
+{
+    const char *showstate;
+
+    switch (state) {
+    default:
+    case oDefault:
+	showstate = "";
+	break;
+    case oMove:
+	showstate = " (mvXXX)";
+	break;
+    case oWindow:
+	showstate = " (winXXX)";
+	break;
+    case oMoveWindow:
+	showstate = " (mvwinXXX)";
+	break;
+    }
+
+    wmove(win, 0, 0);
+    wprintw(win,
+	    "The Strings/Chars displays should match.  Enter any characters, except:\n");
+    wprintw(win,
+	    "down-arrow or ^N to repeat on next line, ^W for inner window, ESC to exit.\n");
+    wclrtoeol(win);
+    wprintw(win, "Level %d,%s added %d characters <", level,
+	    showstate, length);
+    waddwstr(win, buffer);
+    waddstr(win, ">");
+}
+
+static int
+ColOf(wchar_t *buffer, int length, int margin)
+{
+    int n;
+    int result;
+
+    for (n = 0, result = margin + 1; n < length; ++n) {
+	int ch = buffer[n];
+	switch (ch) {
+	case '\n':
+	    /* actually newline should clear the remainder of the line
+	     * and move to the next line - but that seems a little awkward
+	     * in this example.
+	     */
+	case '\r':
+	    result = 0;
+	    break;
+	case '\b':
+	    if (result > 0)
+		--result;
+	    break;
+	case '\t':
+	    result += (MY_TABSIZE - (result % MY_TABSIZE));
+	    break;
+	case '\177':
+	    result += 2;
+	    break;
+	default:
+	    result += wcwidth(ch);
+	    if (ch < 32)
+		++result;
+	    break;
+	}
+    }
+    return result;
+}
+
+static int
+ConvertCh(chtype source, cchar_t *target)
+{
+    wchar_t tmp_wchar[2];
+
+    tmp_wchar[0] = (wchar_t) source;
+    tmp_wchar[1] = 0;
+    if (setcchar(target, tmp_wchar, A_NORMAL, 0, (void *) 0) == ERR) {
+	beep();
+	return FALSE;
+    }
+    return TRUE;
+}
+
+static int
+MvWAddCh(WINDOW *win, int y, int x, chtype ch)
+{
+    int code;
+    cchar_t tmp_cchar;
+
+    if (ConvertCh(ch, &tmp_cchar)) {
+	code = mvwadd_wch(win, y, x, &tmp_cchar);
+    } else {
+	code = mvwaddch(win, y, x, ch);
+    }
+    return code;
+}
+
+static int
+MvAddCh(int y, int x, chtype ch)
+{
+    int code;
+    cchar_t tmp_cchar;
+
+    if (ConvertCh(ch, &tmp_cchar)) {
+	code = mvadd_wch(y, x, &tmp_cchar);
+    } else {
+	code = mvaddch(y, x, ch);
+    }
+    return code;
+}
+
+static int
+WAddCh(WINDOW *win, chtype ch)
+{
+    int code;
+    cchar_t tmp_cchar;
+
+    if (ConvertCh(ch, &tmp_cchar)) {
+	code = wadd_wch(win, &tmp_cchar);
+    } else {
+	code = waddch(win, ch);
+    }
+    return code;
+}
+
+static int
+AddCh(chtype ch)
+{
+    int code;
+    cchar_t tmp_cchar;
+
+    if (ConvertCh(ch, &tmp_cchar)) {
+	code = add_wch(&tmp_cchar);
+    } else {
+	code = addch(ch);
+    }
+    return code;
+}
+
+#define LEN(n) ((length - (n) > n_opt) ? n_opt : (length - (n)))
+static void
+test_add_wchstr(int level)
+{
+    static bool first = TRUE;
+
+    int ch;
+    int limit;
+    int row = 1;
+    int col;
+    int row2, col2;
+    int length;
+    wchar_t buffer[BUFSIZ];
+    WINDOW *look = 0;
+    WINDOW *work = 0;
+    WINDOW *show = 0;
+    int margin = (2 * MY_TABSIZE) - 1;
+    Options option = ((m_opt ? oMove : oDefault)
+		      | ((w_opt || (level > 0)) ? oWindow : oDefault));
+
+    if (first) {
+	static char cmd[80];
+	setlocale(LC_ALL, "");
+
+	putenv(strcpy(cmd, "TABSIZE=8"));
+
+	initscr();
+	(void) cbreak();	/* take input chars one at a time, no wait for \n */
+	(void) noecho();	/* don't echo input */
+	keypad(stdscr, TRUE);
+    }
+
+    limit = LINES - 5;
+    if (level > 0) {
+	look = newwin(limit, COLS - (2 * (level - 1)), 0, level - 1);
+	work = newwin(limit - 2, COLS - (2 * level), 1, level);
+	show = newwin(4, COLS, limit + 1, 0);
+	box(look, 0, 0);
+	wnoutrefresh(look);
+	limit -= 2;
+    } else {
+	work = stdscr;
+	show = derwin(stdscr, 4, COLS, limit + 1, 0);
+    }
+    keypad(work, TRUE);
+
+    for (col = margin + 1; col < COLS; col += MY_TABSIZE)
+	MvWVLine(work, row, col, '.', limit - 2);
+
+    MvWVLine(work, row, margin, ACS_VLINE, limit - 2);
+    MvWVLine(work, row, margin + 1, ACS_VLINE, limit - 2);
+    limit /= 2;
+
+    (void) mvwadd_wchstr(work, 1, 2, ChStr("String"));
+    (void) mvwadd_wchstr(work, limit + 1, 2, ChStr("Chars"));
+    wnoutrefresh(work);
+
+    buffer[length = 0] = '\0';
+    legend(show, level, option, buffer, length);
+    wnoutrefresh(show);
+
+    doupdate();
+
+    /*
+     * Show the characters added in color, to distinguish from those that
+     * are shifted.
+     */
+    if (has_colors()) {
+	start_color();
+	init_pair(1, COLOR_WHITE, COLOR_BLUE);
+	wbkgdset(work, COLOR_PAIR(1) | ' ');
+    }
+
+    while ((ch = read_linedata(work)) != ERR && !isQUIT(ch)) {
+	wmove(work, row, margin + 1);
+	switch (ch) {
+	case key_RECUR:
+	    test_add_wchstr(level + 1);
+
+	    touchwin(look);
+	    touchwin(work);
+	    touchwin(show);
+
+	    wnoutrefresh(look);
+	    wnoutrefresh(work);
+	    wnoutrefresh(show);
+
+	    doupdate();
+	    break;
+	case key_NEWLINE:
+	    if (row < limit) {
+		++row;
+		/* put the whole string in, all at once */
+		col2 = margin + 1;
+		switch (option) {
+		case oDefault:
+		    if (n_opt > 1) {
+			for (col = 0; col < length; col += n_opt) {
+			    col2 = ColOf(buffer, col, margin);
+			    if (move(row, col2) != ERR) {
+				AddNStr(ChWStr(buffer + col), LEN(col));
+			    }
+			}
+		    } else {
+			if (move(row, col2) != ERR) {
+			    AddStr(ChWStr(buffer));
+			}
+		    }
+		    break;
+		case oMove:
+		    if (n_opt > 1) {
+			for (col = 0; col < length; col += n_opt) {
+			    col2 = ColOf(buffer, col, margin);
+			    MvAddNStr(row, col2, ChWStr(buffer + col), LEN(col));
+			}
+		    } else {
+			MvAddStr(row, col2, ChWStr(buffer));
+		    }
+		    break;
+		case oWindow:
+		    if (n_opt > 1) {
+			for (col = 0; col < length; col += n_opt) {
+			    col2 = ColOf(buffer, col, margin);
+			    if (wmove(work, row, col2) != ERR) {
+				WAddNStr(work, ChWStr(buffer + col), LEN(col));
+			    }
+			}
+		    } else {
+			if (wmove(work, row, col2) != ERR) {
+			    WAddStr(work, ChWStr(buffer));
+			}
+		    }
+		    break;
+		case oMoveWindow:
+		    if (n_opt > 1) {
+			for (col = 0; col < length; col += n_opt) {
+			    col2 = ColOf(buffer, col, margin);
+			    MvWAddNStr(work, row, col2, ChWStr(buffer +
+							       col), LEN(col));
+			}
+		    } else {
+			MvWAddStr(work, row, col2, ChWStr(buffer));
+		    }
+		    break;
+		}
+
+		/* do the corresponding single-character add */
+		row2 = limit + row;
+		for (col = 0; col < length; ++col) {
+		    col2 = ColOf(buffer, col, margin);
+		    switch (option) {
+		    case oDefault:
+			if (move(row2, col2) != ERR) {
+			    AddCh((chtype) buffer[col]);
+			}
+			break;
+		    case oMove:
+			MvAddCh(row2, col2, (chtype) buffer[col]);
+			break;
+		    case oWindow:
+			if (wmove(work, row2, col2) != ERR) {
+			    WAddCh(work, (chtype) buffer[col]);
+			}
+			break;
+		    case oMoveWindow:
+			MvWAddCh(work, row2, col2, (chtype) buffer[col]);
+			break;
+		    }
+		}
+	    } else {
+		beep();
+	    }
+	    break;
+	default:
+	    buffer[length++] = ch;
+	    buffer[length] = '\0';
+
+	    /* put the string in, one character at a time */
+	    col = ColOf(buffer, length - 1, margin);
+	    switch (option) {
+	    case oDefault:
+		if (move(row, col) != ERR) {
+		    AddStr(ChWStr(buffer + length - 1));
+		}
+		break;
+	    case oMove:
+		MvAddStr(row, col, ChWStr(buffer + length - 1));
+		break;
+	    case oWindow:
+		if (wmove(work, row, col) != ERR) {
+		    WAddStr(work, ChWStr(buffer + length - 1));
+		}
+		break;
+	    case oMoveWindow:
+		MvWAddStr(work, row, col, ChWStr(buffer + length - 1));
+		break;
+	    }
+
+	    /* do the corresponding single-character add */
+	    switch (option) {
+	    case oDefault:
+		if (move(limit + row, col) != ERR) {
+		    AddCh((chtype) ch);
+		}
+		break;
+	    case oMove:
+		MvAddCh(limit + row, col, (chtype) ch);
+		break;
+	    case oWindow:
+		if (wmove(work, limit + row, col) != ERR) {
+		    WAddCh(work, (chtype) ch);
+		}
+		break;
+	    case oMoveWindow:
+		MvWAddCh(work, limit + row, col, (chtype) ch);
+		break;
+	    }
+
+	    wnoutrefresh(work);
+
+	    legend(show, level, option, buffer, length);
+	    wnoutrefresh(show);
+
+	    doupdate();
+	    break;
+	}
+    }
+    if (level > 0) {
+	delwin(show);
+	delwin(work);
+	delwin(look);
+    }
+}
+
+static void
+usage(void)
+{
+    static const char *tbl[] =
+    {
+	"Usage: test_add_wchstr [options]"
+	,""
+	,"Options:"
+	,"  -f FILE read data from given file"
+	,"  -n NUM  limit string-adds to NUM bytes on ^N replay"
+	,"  -m      perform wmove/move separately from add-functions"
+	,"  -p      pass-thru control characters without using unctrl()"
+	,"  -w      use window-parameter even when stdscr would be implied"
+    };
+    unsigned n;
+    for (n = 0; n < SIZEOF(tbl); ++n)
+	fprintf(stderr, "%s\n", tbl[n]);
+    ExitProgram(EXIT_FAILURE);
+}
+
+int
+main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
+{
+    int ch;
+
+    setlocale(LC_ALL, "");
+
+    while ((ch = getopt(argc, argv, "f:mn:pw")) != -1) {
+	switch (ch) {
+	case 'f':
+	    init_linedata(optarg);
+	    break;
+	case 'm':
+	    m_opt = TRUE;
+	    break;
+	case 'n':
+	    n_opt = atoi(optarg);
+	    if (n_opt == 0)
+		n_opt = -1;
+	    break;
+	case 'p':
+	    pass_ctls = TRUE;
+	    break;
+	case 'w':
+	    w_opt = TRUE;
+	    break;
+	default:
+	    usage();
+	    break;
+	}
+    }
+    if (optind < argc)
+	usage();
+
+    test_add_wchstr(0);
+    endwin();
+    ExitProgram(EXIT_SUCCESS);
+}
+#else
+int
+main(void)
+{
+    printf("This program requires the wide-ncurses library\n");
+    ExitProgram(EXIT_FAILURE);
+}
+#endif
diff -Naur ncurses-5.7.orig/test/test_addchstr.c ncurses-5.7/test/test_addchstr.c
--- ncurses-5.7.orig/test/test_addchstr.c	1969-12-31 19:00:00.000000000 -0500
+++ ncurses-5.7/test/test_addchstr.c	2011-01-08 18:18:29.738781565 -0500
@@ -0,0 +1,511 @@
+/****************************************************************************
+ * Copyright (c) 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            *
+ * "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: test_addchstr.c,v 1.13 2010/12/12 01:28:24 tom Exp $
+ *
+ * Demonstrate the waddchstr() and waddch functions.
+ * Thomas Dickey - 2009/9/12
+ */
+
+#include <test.priv.h>
+
+#include <linedata.h>
+
+#undef MvAddStr
+#undef MvWAddStr
+
+#define AddNStr    addchnstr
+#define AddStr     addchstr
+#define MvAddNStr  (void) mvaddchnstr
+#define MvAddStr   (void) mvaddchstr
+#define MvWAddNStr (void) mvwaddchnstr
+#define MvWAddStr  (void) mvwaddchstr
+#define WAddNStr   waddchnstr
+#define WAddStr    waddchstr
+
+#define AddCh      addch
+#define WAddCh     waddch
+
+#define MY_TABSIZE 8
+
+typedef enum {
+    oDefault = 0,
+    oMove = 1,
+    oWindow = 2,
+    oMoveWindow = 3
+} Options;
+
+static bool m_opt = FALSE;
+static bool pass_ctls = FALSE;
+static bool w_opt = FALSE;
+static int n_opt = -1;
+
+static attr_t show_attr;
+static chtype *temp_buffer;
+static size_t temp_length;
+
+#define TempBuffer(source_cast)
+
+static size_t
+ChLen(const char *source)
+{
+    size_t result = strlen(source);
+
+    if (!pass_ctls) {
+	size_t adjust = 0;
+	size_t n;
+
+	for (n = 0; n < result; ++n) {
+	    const char *s = unctrl(UChar(source[n]));
+	    if (s != 0) {
+		adjust += (strlen(s) - 1);
+	    }
+	}
+	result += adjust;
+    }
+    return result;
+}
+
+static chtype *
+ChStr(const char *source)
+{
+    if (source != 0) {
+	size_t need = ChLen(source) + 1;
+	int n = 0;
+
+	if (need > temp_length) {
+	    temp_length = need * 2;
+	    temp_buffer = typeRealloc(chtype, temp_length, temp_buffer);
+	}
+	do {
+	    const char *s;
+	    chtype ch = UChar(*source++);
+	    if (!pass_ctls && (s = unctrl(ch)) != 0) {
+		while (*s != '\0') {
+		    temp_buffer[n++] = UChar(*s++);
+		}
+	    } else {
+		temp_buffer[n++] = ch;
+	    }
+	} while (source[0] != 0);
+	temp_buffer[n] = 0;
+    } else if (temp_buffer != 0) {
+	free(temp_buffer);
+	temp_buffer = 0;
+	temp_length = 0;
+    }
+    return temp_buffer;
+}
+
+/* color the strings drawn in the workspace */
+static chtype *
+ChStr2(const char *source)
+{
+    size_t len = ChLen(source);
+    size_t n;
+    chtype *result = ChStr(source);
+    for (n = 0; n < len; ++n) {
+	result[n] |= show_attr;
+    }
+    return result;
+}
+
+static void
+legend(WINDOW *win, int level, Options state, char *buffer, int length)
+{
+    const char *showstate;
+
+    switch (state) {
+    default:
+    case oDefault:
+	showstate = "";
+	break;
+    case oMove:
+	showstate = " (mvXXX)";
+	break;
+    case oWindow:
+	showstate = " (winXXX)";
+	break;
+    case oMoveWindow:
+	showstate = " (mvwinXXX)";
+	break;
+    }
+
+    wmove(win, 0, 0);
+    wprintw(win,
+	    "The Strings/Chars displays should match.  Enter any characters, except:\n");
+    wprintw(win,
+	    "down-arrow or ^N to repeat on next line, ^W for inner window, ESC to exit.\n");
+    wclrtoeol(win);
+    wprintw(win, "Level %d,%s added %d characters <%s>", level,
+	    showstate, length, buffer);
+}
+
+static int
+ColOf(char *buffer, int length, int margin)
+{
+    int n;
+    int result;
+
+    for (n = 0, result = margin + 1; n < length; ++n) {
+	int ch = UChar(buffer[n]);
+	switch (ch) {
+	case '\n':
+	    /* actually newline should clear the remainder of the line
+	     * and move to the next line - but that seems a little awkward
+	     * in this example.
+	     */
+	case '\r':
+	    result = 0;
+	    break;
+	case '\b':
+	    if (result > 0)
+		--result;
+	    break;
+	case '\t':
+	    result += (MY_TABSIZE - (result % MY_TABSIZE));
+	    break;
+	case '\177':
+	    result += 2;
+	    break;
+	default:
+	    ++result;
+	    if (ch < 32)
+		++result;
+	    break;
+	}
+    }
+    return result;
+}
+
+#define LEN(n) ((length - (n) > n_opt) ? n_opt : (length - (n)))
+static void
+test_adds(int level)
+{
+    static bool first = TRUE;
+
+    int ch;
+    int limit;
+    int row = 1;
+    int col;
+    int row2, col2;
+    int length;
+    char buffer[BUFSIZ];
+    WINDOW *look = 0;
+    WINDOW *work = 0;
+    WINDOW *show = 0;
+    int margin = (2 * MY_TABSIZE) - 1;
+    Options option = (Options) ((unsigned) (m_opt
+					    ? oMove
+					    : oDefault)
+				| (unsigned) ((w_opt || (level > 0))
+					      ? oWindow
+					      : oDefault));
+
+    if (first) {
+	static char cmd[80];
+	setlocale(LC_ALL, "");
+
+	putenv(strcpy(cmd, "TABSIZE=8"));
+
+	initscr();
+	(void) cbreak();	/* take input chars one at a time, no wait for \n */
+	(void) noecho();	/* don't echo input */
+	keypad(stdscr, TRUE);
+    }
+
+    limit = LINES - 5;
+    if (level > 0) {
+	look = newwin(limit, COLS - (2 * (level - 1)), 0, level - 1);
+	work = newwin(limit - 2, COLS - (2 * level), 1, level);
+	show = newwin(4, COLS, limit + 1, 0);
+	box(look, 0, 0);
+	wnoutrefresh(look);
+	limit -= 2;
+    } else {
+	work = stdscr;
+	show = derwin(stdscr, 4, COLS, limit + 1, 0);
+    }
+    keypad(work, TRUE);
+
+    for (col = margin + 1; col < COLS; col += MY_TABSIZE)
+	MvWVLine(work, row, col, '.', limit - 2);
+
+    MvWVLine(work, row, margin, ACS_VLINE, limit - 2);
+    MvWVLine(work, row, margin + 1, ACS_VLINE, limit - 2);
+    limit /= 2;
+
+    MvWAddChStr(work, 1, 2, ChStr("String"));
+    MvWAddChStr(work, limit + 1, 2, ChStr("Chars"));
+    wnoutrefresh(work);
+
+    buffer[length = 0] = '\0';
+    legend(show, level, option, buffer, length);
+    wnoutrefresh(show);
+
+    doupdate();
+
+    /*
+     * Show the characters added in color, to distinguish from those that
+     * are shifted.
+     */
+    if (has_colors()) {
+	start_color();
+	init_pair(1, COLOR_WHITE, COLOR_BLUE);
+	show_attr = COLOR_PAIR(1);
+	wbkgdset(work, show_attr | ' ');
+    } else {
+	show_attr = A_STANDOUT;
+    }
+
+    while ((ch = read_linedata(work)) != ERR && !isQUIT(ch)) {
+	wmove(work, row, margin + 1);
+	switch (ch) {
+	case key_RECUR:
+	    test_adds(level + 1);
+
+	    touchwin(look);
+	    touchwin(work);
+	    touchwin(show);
+
+	    wnoutrefresh(look);
+	    wnoutrefresh(work);
+	    wnoutrefresh(show);
+
+	    doupdate();
+	    break;
+	case key_NEWLINE:
+	    if (row < limit) {
+		++row;
+		/* put the whole string in, all at once */
+		col2 = margin + 1;
+		switch (option) {
+		case oDefault:
+		    if (n_opt > 1) {
+			for (col = 0; col < length; col += n_opt) {
+			    col2 = ColOf(buffer, col, margin);
+			    if (move(row, col2) != ERR) {
+				AddNStr(ChStr2(buffer + col), LEN(col));
+			    }
+			}
+		    } else {
+			if (move(row, col2) != ERR) {
+			    AddStr(ChStr2(buffer));
+			}
+		    }
+		    break;
+		case oMove:
+		    if (n_opt > 1) {
+			for (col = 0; col < length; col += n_opt) {
+			    col2 = ColOf(buffer, col, margin);
+			    MvAddNStr(row, col2, ChStr2(buffer + col), LEN(col));
+			}
+		    } else {
+			MvAddStr(row, col2, ChStr2(buffer));
+		    }
+		    break;
+		case oWindow:
+		    if (n_opt > 1) {
+			for (col = 0; col < length; col += n_opt) {
+			    col2 = ColOf(buffer, col, margin);
+			    if (wmove(work, row, col2) != ERR) {
+				WAddNStr(work, ChStr2(buffer + col), LEN(col));
+			    }
+			}
+		    } else {
+			if (wmove(work, row, col2) != ERR) {
+			    WAddStr(work, ChStr2(buffer));
+			}
+		    }
+		    break;
+		case oMoveWindow:
+		    if (n_opt > 1) {
+			for (col = 0; col < length; col += n_opt) {
+			    col2 = ColOf(buffer, col, margin);
+			    MvWAddNStr(work, row, col2, ChStr2(buffer + col),
+				       LEN(col));
+			}
+		    } else {
+			MvWAddStr(work, row, col2, ChStr2(buffer));
+		    }
+		    break;
+		}
+
+		/* do the corresponding single-character add */
+		row2 = limit + row;
+		for (col = 0; col < length; ++col) {
+		    col2 = ColOf(buffer, col, margin);
+		    switch (option) {
+		    case oDefault:
+			if (move(row2, col2) != ERR) {
+			    AddCh(UChar(buffer[col]));
+			}
+			break;
+		    case oMove:
+			MvAddCh(row2, col2, UChar(buffer[col]));
+			break;
+		    case oWindow:
+			if (wmove(work, row2, col2) != ERR) {
+			    WAddCh(work, UChar(buffer[col]));
+			}
+			break;
+		    case oMoveWindow:
+			MvWAddCh(work, row2, col2, UChar(buffer[col]));
+			break;
+		    }
+		}
+	    } else {
+		beep();
+	    }
+	    break;
+	case KEY_BACKSPACE:
+	    ch = '\b';
+	    /* FALLTHRU */
+	default:
+	    if (ch <= 0 || ch > 255) {
+		beep();
+		break;
+	    }
+	    buffer[length++] = (char) ch;
+	    buffer[length] = '\0';
+
+	    /* put the string in, one character at a time */
+	    col = ColOf(buffer, length - 1, margin);
+	    switch (option) {
+	    case oDefault:
+		if (move(row, col) != ERR) {
+		    AddStr(ChStr2(buffer + length - 1));
+		}
+		break;
+	    case oMove:
+		MvAddStr(row, col, ChStr2(buffer + length - 1));
+		break;
+	    case oWindow:
+		if (wmove(work, row, col) != ERR) {
+		    WAddStr(work, ChStr2(buffer + length - 1));
+		}
+		break;
+	    case oMoveWindow:
+		MvWAddStr(work, row, col, ChStr2(buffer + length - 1));
+		break;
+	    }
+
+	    /* do the corresponding single-character add */
+	    switch (option) {
+	    case oDefault:
+		if (move(limit + row, col) != ERR) {
+		    AddCh(UChar(ch));
+		}
+		break;
+	    case oMove:
+		MvAddCh(limit + row, col, UChar(ch));
+		break;
+	    case oWindow:
+		if (wmove(work, limit + row, col) != ERR) {
+		    WAddCh(work, UChar(ch));
+		}
+		break;
+	    case oMoveWindow:
+		MvWAddCh(work, limit + row, col, UChar(ch));
+		break;
+	    }
+
+	    wnoutrefresh(work);
+
+	    legend(show, level, option, buffer, length);
+	    wnoutrefresh(show);
+
+	    doupdate();
+	    break;
+	}
+    }
+    if (level > 0) {
+	delwin(show);
+	delwin(work);
+	delwin(look);
+    }
+}
+
+static void
+usage(void)
+{
+    static const char *tbl[] =
+    {
+	"Usage: test_addchstr [options]"
+	,""
+	,"Options:"
+	,"  -f FILE read data from given file"
+	,"  -n NUM  limit string-adds to NUM bytes on ^N replay"
+	,"  -m      perform wmove/move separately from add-functions"
+	,"  -p      pass-thru control characters without using unctrl()"
+	,"  -w      use window-parameter even when stdscr would be implied"
+    };
+    unsigned n;
+    for (n = 0; n < SIZEOF(tbl); ++n)
+	fprintf(stderr, "%s\n", tbl[n]);
+    ExitProgram(EXIT_FAILURE);
+}
+
+int
+main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
+{
+    int ch;
+
+    setlocale(LC_ALL, "");
+
+    while ((ch = getopt(argc, argv, "f:mn:pw")) != -1) {
+	switch (ch) {
+	case 'f':
+	    init_linedata(optarg);
+	    break;
+	case 'm':
+	    m_opt = TRUE;
+	    break;
+	case 'n':
+	    n_opt = atoi(optarg);
+	    if (n_opt == 0)
+		n_opt = -1;
+	    break;
+	case 'p':
+	    pass_ctls = TRUE;
+	    break;
+	case 'w':
+	    w_opt = TRUE;
+	    break;
+	default:
+	    usage();
+	    break;
+	}
+    }
+    if (optind < argc)
+	usage();
+
+    test_adds(0);
+    endwin();
+    ExitProgram(EXIT_SUCCESS);
+}
diff -Naur ncurses-5.7.orig/test/test_addstr.c ncurses-5.7/test/test_addstr.c
--- ncurses-5.7.orig/test/test_addstr.c	1969-12-31 19:00:00.000000000 -0500
+++ ncurses-5.7/test/test_addstr.c	2011-01-08 18:18:29.738781565 -0500
@@ -0,0 +1,424 @@
+/****************************************************************************
+ * Copyright (c) 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            *
+ * "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: test_addstr.c,v 1.6 2010/12/12 00:17:37 tom Exp $
+ *
+ * Demonstrate the waddstr() and waddch functions.
+ * Thomas Dickey - 2009/9/12
+ */
+
+#include <test.priv.h>
+
+#include <linedata.h>
+
+#define AddNStr    addnstr
+#define AddStr     addstr
+#define MvAddNStr  (void) mvaddnstr
+#define MvWAddNStr (void) mvwaddnstr
+#define WAddNStr   waddnstr
+#define WAddStr    waddstr
+
+#define AddCh      addch
+#define WAddCh     waddch
+
+#define MY_TABSIZE 8
+
+typedef enum {
+    oDefault = 0,
+    oMove = 1,
+    oWindow = 2,
+    oMoveWindow = 3
+} Options;
+
+static bool m_opt = FALSE;
+static bool w_opt = FALSE;
+static int n_opt = -1;
+
+static void
+legend(WINDOW *win, int level, Options state, char *buffer, int length)
+{
+    const char *showstate;
+
+    switch (state) {
+    default:
+    case oDefault:
+	showstate = "";
+	break;
+    case oMove:
+	showstate = " (mvXXX)";
+	break;
+    case oWindow:
+	showstate = " (winXXX)";
+	break;
+    case oMoveWindow:
+	showstate = " (mvwinXXX)";
+	break;
+    }
+
+    wmove(win, 0, 0);
+    wprintw(win,
+	    "The Strings/Chars displays should match.  Enter any characters, except:\n");
+    wprintw(win,
+	    "down-arrow or ^N to repeat on next line, ^W for inner window, ESC to exit.\n");
+    wclrtoeol(win);
+    wprintw(win, "Level %d,%s added %d characters <%s>", level,
+	    showstate, length, buffer);
+}
+
+static int
+ColOf(char *buffer, int length, int margin)
+{
+    int n;
+    int result;
+
+    for (n = 0, result = margin + 1; n < length; ++n) {
+	int ch = UChar(buffer[n]);
+	switch (ch) {
+	case '\n':
+	    /* actually newline should clear the remainder of the line
+	     * and move to the next line - but that seems a little awkward
+	     * in this example.
+	     */
+	case '\r':
+	    result = 0;
+	    break;
+	case '\b':
+	    if (result > 0)
+		--result;
+	    break;
+	case '\t':
+	    result += (MY_TABSIZE - (result % MY_TABSIZE));
+	    break;
+	case '\177':
+	    result += 2;
+	    break;
+	default:
+	    ++result;
+	    if (ch < 32)
+		++result;
+	    break;
+	}
+    }
+    return result;
+}
+
+#define LEN(n) ((length - (n) > n_opt) ? n_opt : (length - (n)))
+static void
+test_adds(int level)
+{
+    static bool first = TRUE;
+
+    int ch;
+    int limit;
+    int row = 1;
+    int col;
+    int row2, col2;
+    int length;
+    char buffer[BUFSIZ];
+    WINDOW *look = 0;
+    WINDOW *work = 0;
+    WINDOW *show = 0;
+    int margin = (2 * MY_TABSIZE) - 1;
+    Options option = (Options) ((unsigned) (m_opt
+					    ? oMove
+					    : oDefault)
+				| (unsigned) ((w_opt || (level > 0))
+					      ? oWindow
+					      : oDefault));
+
+    if (first) {
+	static char cmd[80];
+	setlocale(LC_ALL, "");
+
+	putenv(strcpy(cmd, "TABSIZE=8"));
+
+	initscr();
+	(void) cbreak();	/* take input chars one at a time, no wait for \n */
+	(void) noecho();	/* don't echo input */
+	keypad(stdscr, TRUE);
+    }
+
+    limit = LINES - 5;
+    if (level > 0) {
+	look = newwin(limit, COLS - (2 * (level - 1)), 0, level - 1);
+	work = newwin(limit - 2, COLS - (2 * level), 1, level);
+	show = newwin(4, COLS, limit + 1, 0);
+	box(look, 0, 0);
+	wnoutrefresh(look);
+	limit -= 2;
+    } else {
+	work = stdscr;
+	show = derwin(stdscr, 4, COLS, limit + 1, 0);
+    }
+    keypad(work, TRUE);
+
+    for (col = margin + 1; col < COLS; col += MY_TABSIZE)
+	MvWVLine(work, row, col, '.', limit - 2);
+
+    MvWVLine(work, row, margin, ACS_VLINE, limit - 2);
+    MvWVLine(work, row, margin + 1, ACS_VLINE, limit - 2);
+    limit /= 2;
+
+    MvWAddStr(work, 1, 2, "String");
+    MvWAddStr(work, limit + 1, 2, "Chars");
+    wnoutrefresh(work);
+
+    buffer[length = 0] = '\0';
+    legend(show, level, option, buffer, length);
+    wnoutrefresh(show);
+
+    doupdate();
+
+    /*
+     * Show the characters added in color, to distinguish from those that
+     * are shifted.
+     */
+    if (has_colors()) {
+	start_color();
+	init_pair(1, COLOR_WHITE, COLOR_BLUE);
+	wbkgdset(work, COLOR_PAIR(1) | ' ');
+    }
+
+    while ((ch = read_linedata(work)) != ERR && !isQUIT(ch)) {
+	wmove(work, row, margin + 1);
+	switch (ch) {
+	case key_RECUR:
+	    test_adds(level + 1);
+
+	    touchwin(look);
+	    touchwin(work);
+	    touchwin(show);
+
+	    wnoutrefresh(look);
+	    wnoutrefresh(work);
+	    wnoutrefresh(show);
+
+	    doupdate();
+	    break;
+	case key_NEWLINE:
+	    if (row < limit) {
+		++row;
+		/* put the whole string in, all at once */
+		col2 = margin + 1;
+		switch (option) {
+		case oDefault:
+		    if (n_opt > 1) {
+			for (col = 0; col < length; col += n_opt) {
+			    col2 = ColOf(buffer, col, margin);
+			    if (move(row, col2) != ERR) {
+				AddNStr(buffer + col, LEN(col));
+			    }
+			}
+		    } else {
+			if (move(row, col2) != ERR) {
+			    AddStr(buffer);
+			}
+		    }
+		    break;
+		case oMove:
+		    if (n_opt > 1) {
+			for (col = 0; col < length; col += n_opt) {
+			    col2 = ColOf(buffer, col, margin);
+			    MvAddNStr(row, col2, buffer + col, LEN(col));
+			}
+		    } else {
+			MvAddStr(row, col2, buffer);
+		    }
+		    break;
+		case oWindow:
+		    if (n_opt > 1) {
+			for (col = 0; col < length; col += n_opt) {
+			    col2 = ColOf(buffer, col, margin);
+			    if (wmove(work, row, col2) != ERR) {
+				WAddNStr(work, buffer + col, LEN(col));
+			    }
+			}
+		    } else {
+			if (wmove(work, row, col2) != ERR) {
+			    WAddStr(work, buffer);
+			}
+		    }
+		    break;
+		case oMoveWindow:
+		    if (n_opt > 1) {
+			for (col = 0; col < length; col += n_opt) {
+			    col2 = ColOf(buffer, col, margin);
+			    MvWAddNStr(work, row, col2, buffer + col, LEN(col));
+			}
+		    } else {
+			MvWAddStr(work, row, col2, buffer);
+		    }
+		    break;
+		}
+
+		/* do the corresponding single-character add */
+		row2 = limit + row;
+		for (col = 0; col < length; ++col) {
+		    col2 = ColOf(buffer, col, margin);
+		    switch (option) {
+		    case oDefault:
+			if (move(row2, col2) != ERR) {
+			    AddCh(UChar(buffer[col]));
+			}
+			break;
+		    case oMove:
+			MvAddCh(row2, col2, UChar(buffer[col]));
+			break;
+		    case oWindow:
+			if (wmove(work, row2, col2) != ERR) {
+			    WAddCh(work, UChar(buffer[col]));
+			}
+			break;
+		    case oMoveWindow:
+			MvWAddCh(work, row2, col2, UChar(buffer[col]));
+			break;
+		    }
+		}
+	    } else {
+		beep();
+	    }
+	    break;
+	default:
+	    if (ch <= 0 || ch > 255) {
+		beep();
+		break;
+	    }
+	    buffer[length++] = (char) ch;
+	    buffer[length] = '\0';
+
+	    /* put the string in, one character at a time */
+	    col = ColOf(buffer, length - 1, margin);
+	    switch (option) {
+	    case oDefault:
+		if (move(row, col) != ERR) {
+		    AddStr(buffer + length - 1);
+		}
+		break;
+	    case oMove:
+		MvAddStr(row, col, buffer + length - 1);
+		break;
+	    case oWindow:
+		if (wmove(work, row, col) != ERR) {
+		    WAddStr(work, buffer + length - 1);
+		}
+		break;
+	    case oMoveWindow:
+		MvWAddStr(work, row, col, buffer + length - 1);
+		break;
+	    }
+
+	    /* do the corresponding single-character add */
+	    switch (option) {
+	    case oDefault:
+		if (move(limit + row, col) != ERR) {
+		    AddCh(UChar(ch));
+		}
+		break;
+	    case oMove:
+		MvAddCh(limit + row, col, UChar(ch));
+		break;
+	    case oWindow:
+		if (wmove(work, limit + row, col) != ERR) {
+		    WAddCh(work, UChar(ch));
+		}
+		break;
+	    case oMoveWindow:
+		MvWAddCh(work, limit + row, col, UChar(ch));
+		break;
+	    }
+
+	    wnoutrefresh(work);
+
+	    legend(show, level, option, buffer, length);
+	    wnoutrefresh(show);
+
+	    doupdate();
+	    break;
+	}
+    }
+    if (level > 0) {
+	delwin(show);
+	delwin(work);
+	delwin(look);
+    }
+}
+
+static void
+usage(void)
+{
+    static const char *tbl[] =
+    {
+	"Usage: test_addstr [options]"
+	,""
+	,"Options:"
+	,"  -f FILE read data from given file"
+	,"  -n NUM  limit string-adds to NUM bytes on ^N replay"
+	,"  -m      perform wmove/move separately from add-functions"
+	,"  -w      use window-parameter even when stdscr would be implied"
+    };
+    unsigned n;
+    for (n = 0; n < SIZEOF(tbl); ++n)
+	fprintf(stderr, "%s\n", tbl[n]);
+    ExitProgram(EXIT_FAILURE);
+}
+
+int
+main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
+{
+    int ch;
+
+    setlocale(LC_ALL, "");
+
+    while ((ch = getopt(argc, argv, "f:mn:w")) != -1) {
+	switch (ch) {
+	case 'f':
+	    init_linedata(optarg);
+	    break;
+	case 'm':
+	    m_opt = TRUE;
+	    break;
+	case 'n':
+	    n_opt = atoi(optarg);
+	    if (n_opt == 0)
+		n_opt = -1;
+	    break;
+	case 'w':
+	    w_opt = TRUE;
+	    break;
+	default:
+	    usage();
+	    break;
+	}
+    }
+    if (optind < argc)
+	usage();
+
+    test_adds(0);
+    endwin();
+    ExitProgram(EXIT_SUCCESS);
+}
diff -Naur ncurses-5.7.orig/test/test_addwstr.c ncurses-5.7/test/test_addwstr.c
--- ncurses-5.7.orig/test/test_addwstr.c	1969-12-31 19:00:00.000000000 -0500
+++ ncurses-5.7/test/test_addwstr.c	2011-01-08 18:18:29.738781565 -0500
@@ -0,0 +1,516 @@
+/****************************************************************************
+ * Copyright (c) 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            *
+ * "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: test_addwstr.c,v 1.6 2010/12/12 00:18:00 tom Exp $
+ *
+ * Demonstrate the waddwstr() and wadd_wch functions.
+ * Thomas Dickey - 2009/9/12
+ *
+ * Note: to provide inputs for *add_wch(), we use setcchar().  A quirk of the
+ * X/Open definition for that function is that the string contains no
+ * characters with negative width.  Any control character (such as tab) falls
+ * into that category.  So it follows that *add_wch() cannot render a tab
+ * character because there is no legal way to construct a cchar_t containing
+ * one.  X/Open does not document this, and it would be logical to assume that
+ * *addwstr() has the same limitation, but it uses a wchar_t string directly,
+ * and does not document how tabs are handled.
+ */
+
+#include <test.priv.h>
+
+#if USE_WIDEC_SUPPORT
+
+#define WIDE_LINEDATA
+#include <linedata.h>
+
+#undef MvAddCh
+#undef MvAddStr
+#undef MvWAddCh
+#undef MvWAddStr
+
+/* definitions to make it simpler to compare with inserts.c */
+#define AddNStr    addnwstr
+#define AddStr     addwstr
+#define MvAddNStr  (void) mvaddnwstr
+#define MvAddStr   (void) mvaddwstr
+#define MvWAddNStr (void) mvwaddnwstr
+#define MvWAddStr  (void) mvwaddwstr
+#define WAddNStr   waddnwstr
+#define WAddStr    waddwstr
+
+#define MY_TABSIZE 8
+
+typedef enum {
+    oDefault = 0,
+    oMove = 1,
+    oWindow = 2,
+    oMoveWindow = 3
+} Options;
+
+static bool m_opt = FALSE;
+static bool w_opt = FALSE;
+static int n_opt = -1;
+
+static void
+legend(WINDOW *win, int level, Options state, wchar_t *buffer, int length)
+{
+    const char *showstate;
+
+    switch (state) {
+    default:
+    case oDefault:
+	showstate = "";
+	break;
+    case oMove:
+	showstate = " (mvXXX)";
+	break;
+    case oWindow:
+	showstate = " (winXXX)";
+	break;
+    case oMoveWindow:
+	showstate = " (mvwinXXX)";
+	break;
+    }
+
+    wmove(win, 0, 0);
+    wprintw(win,
+	    "The Strings/Chars displays should match.  Enter any characters, except:\n");
+    wprintw(win,
+	    "down-arrow or ^N to repeat on next line, ^W for inner window, ESC to exit.\n");
+    wclrtoeol(win);
+    wprintw(win, "Level %d,%s inserted %d characters <", level,
+	    showstate, length);
+    waddwstr(win, buffer);
+    waddstr(win, ">");
+}
+
+static int
+ColOf(wchar_t *buffer, int length, int margin)
+{
+    int n;
+    int result;
+
+    for (n = 0, result = margin + 1; n < length; ++n) {
+	int ch = buffer[n];
+	switch (ch) {
+	case '\n':
+	    /* actually newline should clear the remainder of the line
+	     * and move to the next line - but that seems a little awkward
+	     * in this example.
+	     */
+	case '\r':
+	    result = 0;
+	    break;
+	case '\b':
+	    if (result > 0)
+		--result;
+	    break;
+	case '\t':
+	    result += (MY_TABSIZE - (result % MY_TABSIZE));
+	    break;
+	case '\177':
+	    result += 2;
+	    break;
+	default:
+	    result += wcwidth(ch);
+	    if (ch < 32)
+		++result;
+	    break;
+	}
+    }
+    return result;
+}
+
+static int
+ConvertCh(chtype source, cchar_t *target)
+{
+    wchar_t tmp_wchar[2];
+
+    tmp_wchar[0] = (wchar_t) source;
+    tmp_wchar[1] = 0;
+    if (setcchar(target, tmp_wchar, A_NORMAL, 0, (void *) 0) == ERR) {
+	beep();
+	return FALSE;
+    }
+    return TRUE;
+}
+
+static int
+MvWAddCh(WINDOW *win, int y, int x, chtype ch)
+{
+    int code;
+    cchar_t tmp_cchar;
+
+    if (ConvertCh(ch, &tmp_cchar)) {
+	code = mvwadd_wch(win, y, x, &tmp_cchar);
+    } else {
+	code = mvwaddch(win, y, x, ch);
+    }
+    return code;
+}
+
+static int
+MvAddCh(int y, int x, chtype ch)
+{
+    int code;
+    cchar_t tmp_cchar;
+
+    if (ConvertCh(ch, &tmp_cchar)) {
+	code = mvadd_wch(y, x, &tmp_cchar);
+    } else {
+	code = mvaddch(y, x, ch);
+    }
+    return code;
+}
+
+static int
+WAddCh(WINDOW *win, chtype ch)
+{
+    int code;
+    cchar_t tmp_cchar;
+
+    if (ConvertCh(ch, &tmp_cchar)) {
+	code = wadd_wch(win, &tmp_cchar);
+    } else {
+	code = waddch(win, ch);
+    }
+    return code;
+}
+
+static int
+AddCh(chtype ch)
+{
+    int code;
+    cchar_t tmp_cchar;
+
+    if (ConvertCh(ch, &tmp_cchar)) {
+	code = add_wch(&tmp_cchar);
+    } else {
+	code = addch(ch);
+    }
+    return code;
+}
+
+#define LEN(n) ((length - (n) > n_opt) ? n_opt : (length - (n)))
+static void
+test_inserts(int level)
+{
+    static bool first = TRUE;
+
+    int ch;
+    int limit;
+    int row = 1;
+    int col;
+    int row2, col2;
+    int length;
+    wchar_t buffer[BUFSIZ];
+    WINDOW *look = 0;
+    WINDOW *work = 0;
+    WINDOW *show = 0;
+    int margin = (2 * MY_TABSIZE) - 1;
+    Options option = ((m_opt ? oMove : oDefault)
+		      | ((w_opt || (level > 0)) ? oWindow : oDefault));
+
+    if (first) {
+	static char cmd[80];
+	setlocale(LC_ALL, "");
+
+	putenv(strcpy(cmd, "TABSIZE=8"));
+
+	initscr();
+	(void) cbreak();	/* take input chars one at a time, no wait for \n */
+	(void) noecho();	/* don't echo input */
+	keypad(stdscr, TRUE);
+    }
+
+    limit = LINES - 5;
+    if (level > 0) {
+	look = newwin(limit, COLS - (2 * (level - 1)), 0, level - 1);
+	work = newwin(limit - 2, COLS - (2 * level), 1, level);
+	show = newwin(4, COLS, limit + 1, 0);
+	box(look, 0, 0);
+	wnoutrefresh(look);
+	limit -= 2;
+    } else {
+	work = stdscr;
+	show = derwin(stdscr, 4, COLS, limit + 1, 0);
+    }
+    keypad(work, TRUE);
+
+    for (col = margin + 1; col < COLS; col += MY_TABSIZE)
+	MvWVLine(work, row, col, '.', limit - 2);
+
+    MvWVLine(work, row, margin, ACS_VLINE, limit - 2);
+    MvWVLine(work, row, margin + 1, ACS_VLINE, limit - 2);
+    limit /= 2;
+
+    (void) mvwaddstr(work, 1, 2, "String");
+    (void) mvwaddstr(work, limit + 1, 2, "Chars");
+    wnoutrefresh(work);
+
+    buffer[length = 0] = '\0';
+    legend(show, level, option, buffer, length);
+    wnoutrefresh(show);
+
+    doupdate();
+
+    /*
+     * Show the characters inserted in color, to distinguish from those that
+     * are shifted.
+     */
+    if (has_colors()) {
+	start_color();
+	init_pair(1, COLOR_WHITE, COLOR_BLUE);
+	wbkgdset(work, COLOR_PAIR(1) | ' ');
+    }
+
+    while ((ch = read_linedata(work)) != ERR && !isQUIT(ch)) {
+	wmove(work, row, margin + 1);
+	switch (ch) {
+	case key_RECUR:
+	    test_inserts(level + 1);
+
+	    touchwin(look);
+	    touchwin(work);
+	    touchwin(show);
+
+	    wnoutrefresh(look);
+	    wnoutrefresh(work);
+	    wnoutrefresh(show);
+
+	    doupdate();
+	    break;
+	case key_NEWLINE:
+	    if (row < limit) {
+		++row;
+		/* put the whole string in, all at once */
+		col2 = margin + 1;
+		switch (option) {
+		case oDefault:
+		    if (n_opt > 1) {
+			for (col = 0; col < length; col += n_opt) {
+			    col2 = ColOf(buffer, col, margin);
+			    if (move(row, col2) != ERR) {
+				AddNStr(buffer + col, LEN(col));
+			    }
+			}
+		    } else {
+			if (move(row, col2) != ERR) {
+			    AddStr(buffer);
+			}
+		    }
+		    break;
+		case oMove:
+		    if (n_opt > 1) {
+			for (col = 0; col < length; col += n_opt) {
+			    col2 = ColOf(buffer, col, margin);
+			    MvAddNStr(row, col2, buffer + col, LEN(col));
+			}
+		    } else {
+			MvAddStr(row, col2, buffer);
+		    }
+		    break;
+		case oWindow:
+		    if (n_opt > 1) {
+			for (col = 0; col < length; col += n_opt) {
+			    col2 = ColOf(buffer, col, margin);
+			    if (wmove(work, row, col2) != ERR) {
+				WAddNStr(work, buffer + col, LEN(col));
+			    }
+			}
+		    } else {
+			if (wmove(work, row, col2) != ERR) {
+			    WAddStr(work, buffer);
+			}
+		    }
+		    break;
+		case oMoveWindow:
+		    if (n_opt > 1) {
+			for (col = 0; col < length; col += n_opt) {
+			    col2 = ColOf(buffer, col, margin);
+			    MvWAddNStr(work, row, col2, buffer + col, LEN(col));
+			}
+		    } else {
+			MvWAddStr(work, row, col2, buffer);
+		    }
+		    break;
+		}
+
+		/* do the corresponding single-character insertion */
+		row2 = limit + row;
+		for (col = 0; col < length; ++col) {
+		    col2 = ColOf(buffer, col, margin);
+		    switch (option) {
+		    case oDefault:
+			if (move(row2, col2) != ERR) {
+			    AddCh((chtype) buffer[col]);
+			}
+			break;
+		    case oMove:
+			MvAddCh(row2, col2, (chtype) buffer[col]);
+			break;
+		    case oWindow:
+			if (wmove(work, row2, col2) != ERR) {
+			    WAddCh(work, (chtype) buffer[col]);
+			}
+			break;
+		    case oMoveWindow:
+			MvWAddCh(work, row2, col2, (chtype) buffer[col]);
+			break;
+		    }
+		}
+	    } else {
+		beep();
+	    }
+	    break;
+	case KEY_BACKSPACE:
+	    ch = '\b';
+	    /* FALLTHRU */
+	default:
+	    buffer[length++] = ch;
+	    buffer[length] = '\0';
+
+	    /* put the string in, one character at a time */
+	    col = ColOf(buffer, length - 1, margin);
+	    switch (option) {
+	    case oDefault:
+		if (move(row, col) != ERR) {
+		    AddStr(buffer + length - 1);
+		}
+		break;
+	    case oMove:
+		MvAddStr(row, col, buffer + length - 1);
+		break;
+	    case oWindow:
+		if (wmove(work, row, col) != ERR) {
+		    WAddStr(work, buffer + length - 1);
+		}
+		break;
+	    case oMoveWindow:
+		MvWAddStr(work, row, col, buffer + length - 1);
+		break;
+	    }
+
+	    /* do the corresponding single-character insertion */
+	    switch (option) {
+	    case oDefault:
+		if (move(limit + row, col) != ERR) {
+		    AddCh((chtype) ch);
+		}
+		break;
+	    case oMove:
+		MvAddCh(limit + row, col, (chtype) ch);
+		break;
+	    case oWindow:
+		if (wmove(work, limit + row, col) != ERR) {
+		    WAddCh(work, (chtype) ch);
+		}
+		break;
+	    case oMoveWindow:
+		MvWAddCh(work, limit + row, col, (chtype) ch);
+		break;
+	    }
+
+	    wnoutrefresh(work);
+
+	    legend(show, level, option, buffer, length);
+	    wnoutrefresh(show);
+
+	    doupdate();
+	    break;
+	}
+    }
+    if (level > 0) {
+	delwin(show);
+	delwin(work);
+	delwin(look);
+    }
+}
+
+static void
+usage(void)
+{
+    static const char *tbl[] =
+    {
+	"Usage: inserts [options]"
+	,""
+	,"Options:"
+	,"  -f FILE read data from given file"
+	,"  -n NUM  limit string-inserts to NUM bytes on ^N replay"
+	,"  -m      perform wmove/move separately from insert-functions"
+	,"  -w      use window-parameter even when stdscr would be implied"
+    };
+    unsigned n;
+    for (n = 0; n < SIZEOF(tbl); ++n)
+	fprintf(stderr, "%s\n", tbl[n]);
+    ExitProgram(EXIT_FAILURE);
+}
+
+int
+main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
+{
+    int ch;
+
+    setlocale(LC_ALL, "");
+
+    while ((ch = getopt(argc, argv, "f:mn:w")) != -1) {
+	switch (ch) {
+	case 'f':
+	    init_linedata(optarg);
+	    break;
+	case 'm':
+	    m_opt = TRUE;
+	    break;
+	case 'n':
+	    n_opt = atoi(optarg);
+	    if (n_opt == 0)
+		n_opt = -1;
+	    break;
+	case 'w':
+	    w_opt = TRUE;
+	    break;
+	default:
+	    usage();
+	    break;
+	}
+    }
+    if (optind < argc)
+	usage();
+
+    test_inserts(0);
+    endwin();
+    ExitProgram(EXIT_SUCCESS);
+}
+#else
+int
+main(void)
+{
+    printf("This program requires the wide-ncurses library\n");
+    ExitProgram(EXIT_FAILURE);
+}
+#endif
diff -Naur ncurses-5.7.orig/test/test_arrays.c ncurses-5.7/test/test_arrays.c
--- ncurses-5.7.orig/test/test_arrays.c	2008-02-09 13:09:43.000000000 -0500
+++ ncurses-5.7/test/test_arrays.c	2011-01-08 18:18:29.502657976 -0500
@@ -26,7 +26,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: test_arrays.c,v 1.3 2008/02/09 18:09:43 tom Exp $
+ * $Id: test_arrays.c,v 1.5 2010/11/13 19:57:57 tom Exp $
  *
  * Author: Thomas E Dickey
  *
@@ -47,7 +47,8 @@
 #define USE_TINFO
 #include <test.priv.h>
 
-#if defined(NCURSES_VERSION) || !defined(_XOPEN_CURSES)
+#if HAVE_TIGETSTR
+#if defined(HAVE_CURSES_DATA_BOOLNAMES) || defined(DECL_CURSES_DATA_BOOLNAMES)
 
 #define DUMP(name) dump_array(#name, name)
 
@@ -88,3 +89,11 @@
     ExitProgram(EXIT_FAILURE);
 }
 #endif
+#else /* !HAVE_TIGETSTR */
+int
+main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
+{
+    printf("This program requires the terminfo functions such as tigetstr\n");
+    ExitProgram(EXIT_FAILURE);
+}
+#endif /* HAVE_TIGETSTR */
diff -Naur ncurses-5.7.orig/test/test_get_wstr.c ncurses-5.7/test/test_get_wstr.c
--- ncurses-5.7.orig/test/test_get_wstr.c	2007-08-11 13:01:43.000000000 -0400
+++ ncurses-5.7/test/test_get_wstr.c	2011-01-08 18:13:50.795157100 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2007 Free Software Foundation, Inc.                        *
+ * Copyright (c) 2007,2009 Free 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: test_get_wstr.c,v 1.5 2007/08/11 17:01:43 tom Exp $
+ * $Id: test_get_wstr.c,v 1.6 2009/08/29 19:02:25 tom Exp $
  *
  * Author: Thomas E Dickey
  *
@@ -269,7 +269,7 @@
 	    *buffer = '\0';
 	    rc = ERR;
 	    echo();
-	    wattrset(txtwin, A_REVERSE);
+	    (void) wattrset(txtwin, A_REVERSE);
 	    switch (flavor) {
 	    case eGetStr:
 		if (txtwin != stdscr) {
@@ -307,9 +307,9 @@
 		break;
 	    }
 	    noecho();
-	    wattrset(txtwin, A_NORMAL);
+	    (void) wattrset(txtwin, A_NORMAL);
 	    wprintw(strwin, "%d", rc);
-	    waddwstr(strwin, (wchar_t *) buffer);
+	    (void) waddwstr(strwin, (wchar_t *) buffer);
 	    wnoutrefresh(strwin);
 	    break;
 	default:
diff -Naur ncurses-5.7.orig/test/test_getstr.c ncurses-5.7/test/test_getstr.c
--- ncurses-5.7.orig/test/test_getstr.c	2008-02-09 13:09:35.000000000 -0500
+++ ncurses-5.7/test/test_getstr.c	2011-01-08 18:13:50.795157100 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2007,2008 Free Software Foundation, Inc.                   *
+ * Copyright (c) 2007-2008,2009 Free 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: test_getstr.c,v 1.8 2008/02/09 18:09:35 tom Exp $
+ * $Id: test_getstr.c,v 1.9 2009/08/29 19:02:25 tom Exp $
  *
  * Author: Thomas E Dickey
  *
@@ -271,7 +271,7 @@
 	    *buffer = '\0';
 	    rc = ERR;
 	    echo();
-	    wattrset(txtwin, A_REVERSE);
+	    (void) wattrset(txtwin, A_REVERSE);
 	    switch (flavor) {
 	    case eGetStr:
 		if (txtwin != stdscr) {
@@ -309,7 +309,7 @@
 		break;
 	    }
 	    noecho();
-	    wattrset(txtwin, A_NORMAL);
+	    (void) wattrset(txtwin, A_NORMAL);
 	    wprintw(strwin, "%d:%s", rc, buffer);
 	    wnoutrefresh(strwin);
 	    break;
diff -Naur ncurses-5.7.orig/test/test_instr.c ncurses-5.7/test/test_instr.c
--- ncurses-5.7.orig/test/test_instr.c	2007-07-21 15:38:04.000000000 -0400
+++ ncurses-5.7/test/test_instr.c	2011-01-08 18:13:50.795157100 -0500
@@ -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,7 +26,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: test_instr.c,v 1.4 2007/07/21 19:38:04 tom Exp $
+ * $Id: test_instr.c,v 1.5 2010/05/01 19:13:46 tom Exp $
  *
  * Author: Thomas E Dickey
  *
@@ -56,7 +56,7 @@
 static void
 show_1st(WINDOW *win, int line, char *buffer)
 {
-    mvwaddstr(win, line, 5, buffer);
+    MvWAddStr(win, line, 5, buffer);
 }
 
 static void
@@ -174,7 +174,7 @@
 	    break;
 	}
 
-	mvwprintw(chrwin, 0, 0, "line:");
+	MvWPrintw(chrwin, 0, 0, "line:");
 	wclrtoeol(chrwin);
 
 	if (txtwin != stdscr) {
@@ -198,7 +198,7 @@
 	}
 	wnoutrefresh(chrwin);
 
-	mvwprintw(strwin, 0, 0, "%4d:", limit);
+	MvWPrintw(strwin, 0, 0, "%4d:", limit);
 	wclrtobot(strwin);
 
 	if (txtwin != stdscr) {
diff -Naur ncurses-5.7.orig/test/test_inwstr.c ncurses-5.7/test/test_inwstr.c
--- ncurses-5.7.orig/test/test_inwstr.c	2007-07-21 18:47:42.000000000 -0400
+++ ncurses-5.7/test/test_inwstr.c	2011-01-08 18:13:50.795157100 -0500
@@ -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,7 +26,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: test_inwstr.c,v 1.3 2007/07/21 22:47:42 tom Exp $
+ * $Id: test_inwstr.c,v 1.4 2010/05/01 19:13:46 tom Exp $
  *
  * Author: Thomas E Dickey
  *
@@ -58,7 +58,7 @@
 static void
 show_1st(WINDOW *win, int line, wchar_t *buffer)
 {
-    mvwaddwstr(win, line, 5, buffer);
+    (void) mvwaddwstr(win, line, 5, buffer);
 }
 
 static void
@@ -175,7 +175,7 @@
 	    break;
 	}
 
-	mvwprintw(chrwin, 0, 0, "line:");
+	MvWPrintw(chrwin, 0, 0, "line:");
 	wclrtoeol(chrwin);
 
 	if (txtwin != stdscr) {
@@ -199,7 +199,7 @@
 	}
 	wnoutrefresh(chrwin);
 
-	mvwprintw(strwin, 0, 0, "%4d:", limit);
+	MvWPrintw(strwin, 0, 0, "%4d:", limit);
 	wclrtobot(strwin);
 
 	if (txtwin != stdscr) {
diff -Naur ncurses-5.7.orig/test/test_opaque.c ncurses-5.7/test/test_opaque.c
--- ncurses-5.7.orig/test/test_opaque.c	2008-07-05 19:18:40.000000000 -0400
+++ ncurses-5.7/test/test_opaque.c	2011-01-08 18:13:50.795157100 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2007,2008 Free Software Foundation, Inc.                   *
+ * Copyright (c) 2007-2008,2009 Free 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: test_opaque.c,v 1.7 2008/07/05 23:18:40 tom Exp $
+ * $Id: test_opaque.c,v 1.9 2009/10/24 21:21:29 tom Exp $
  *
  * Author: Thomas E Dickey
  *
@@ -185,10 +185,10 @@
 {
     to_keyword(stswin, cell);
     if (active == cell)
-	wstandout(stswin);
+	(void) wstandout(stswin);
     wprintw(stswin, "%s:", name);
     if (active == cell)
-	wstandend(stswin);
+	(void) wstandend(stswin);
 }
 /* *INDENT-OFF* */
 static struct {
@@ -231,7 +231,7 @@
 
     show_keyword(stswin, n, active, "wgetparent");
     to_result(stswin, n, TRUE);
-    wprintw(stswin, "%p", wgetparent(txtwin));
+    wprintw(stswin, "%p", (void *) wgetparent(txtwin));
 
     ++n;
     show_keyword(stswin, n, active, "wgetscrreg");
diff -Naur ncurses-5.7.orig/test/testaddch.c ncurses-5.7/test/testaddch.c
--- ncurses-5.7.orig/test/testaddch.c	2006-04-01 14:08:03.000000000 -0500
+++ ncurses-5.7/test/testaddch.c	2011-01-08 18:13:50.795157100 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2002,2006 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2006,2009 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -29,7 +29,7 @@
  * This is an example written by Alexander V. Lukyanov <lav@yars.free.net>,
  * to demonstrate an inconsistency between ncurses and SVr4 curses.
  *
- * $Id: testaddch.c,v 1.6 2006/04/01 19:08:03 tom Exp $
+ * $Id: testaddch.c,v 1.7 2009/08/29 19:02:25 tom Exp $
  */
 #include <test.priv.h>
 
@@ -66,7 +66,7 @@
 	attr = (i & 4) ? COLOR_PAIR(4) : 0;
 
 	bkgdset(back);
-	attrset(set);
+	(void) attrset(set);
 
 	attr_addstr("Test string with spaces ->   <-\n", attr);
     }
@@ -77,7 +77,7 @@
 	attr = (i & 4) ? COLOR_PAIR(4) : 0;
 
 	bkgdset(back);
-	attrset(set);
+	(void) attrset(set);
 
 	attr_addstr("Test string with spaces ->   <-\n", attr);
     }
diff -Naur ncurses-5.7.orig/test/testcurs.c ncurses-5.7/test/testcurs.c
--- ncurses-5.7.orig/test/testcurs.c	2008-08-03 13:58:09.000000000 -0400
+++ ncurses-5.7/test/testcurs.c	2011-01-08 18:18:29.502657976 -0500
@@ -1,5 +1,4 @@
 /*
- *
  * This is a test program for the PDCurses screen package for IBM PC type
  * machines.
  *
@@ -7,7 +6,7 @@
  *  wrs(5/28/93) -- modified to be consistent (perform identically) with either
  *                  PDCurses or under Unix System V, R4
  *
- * $Id: testcurs.c,v 1.39 2008/08/03 17:58:09 tom Exp $
+ * $Id: testcurs.c,v 1.43 2010/11/13 21:02:28 tom Exp $
  */
 
 #include <test.priv.h>
@@ -165,11 +164,11 @@
 
     save = mvwinch(win, y0, x1 - 1);
 
-    mvwaddstr(win, y0, x0, " Press any key to continue");
+    MvWAddStr(win, y0, x0, " Press any key to continue");
     wclrtoeol(win);
     getyx(win, y0, x0);
 
-    mvwaddch(win, y0, x1 - 1, save);
+    MvWAddCh(win, y0, x1 - 1, save);
 
     wmove(win, y0, x0);
     raw();
@@ -218,9 +217,9 @@
     box(win, ACS_VLINE, ACS_HLINE);
     wrefresh(win);
     cbreak();
-    mvwaddstr(win, 1, 1,
+    MvWAddStr(win, 1, 1,
 	      "You should have rectangle in the middle of the screen");
-    mvwaddstr(win, 2, 1, "You should have heard a beep");
+    MvWAddStr(win, 2, 1, "You should have heard a beep");
     Continue(win);
     return;
 }
@@ -236,7 +235,7 @@
     wclear(win);
     OldY = getmaxy(win);
     half = OldY / 2;
-    mvwprintw(win, OldY - 2, 1, Message);
+    MvWAddStr(win, OldY - 2, 1, Message);
     wrefresh(win);
     scrollok(win, TRUE);
     for (i = 1; i <= OldY; i++) {
@@ -247,9 +246,9 @@
 
     werase(win);
     for (i = 1; i < OldY; i++) {
-	mvwprintw(win, i, 1, "Line %d", i);
+	MvWPrintw(win, i, 1, "Line %d", i);
     }
-    mvwprintw(win, OldY - 2, 1, "The top of the window will scroll");
+    MvWPrintw(win, OldY - 2, 1, "The top of the window will scroll");
     wmove(win, 1, 1);
     wsetscrreg(win, 0, half - 1);
     box(win, ACS_VLINE, ACS_HLINE);
@@ -263,9 +262,9 @@
 
     werase(win);
     for (i = 1; i < OldY; i++) {
-	mvwprintw(win, i, 1, "Line %d", i);
+	MvWPrintw(win, i, 1, "Line %d", i);
     }
-    mvwprintw(win, 1, 1, "The bottom of the window will scroll");
+    MvWPrintw(win, 1, 1, "The bottom of the window will scroll");
     wmove(win, OldY - 2, 1);
     wsetscrreg(win, half, --OldY);
     box(win, ACS_VLINE, ACS_HLINE);
@@ -309,14 +308,14 @@
     wrefresh(win);
 
     nocbreak();
-    mvwaddstr(win, 2, 1, "Press some keys for 5 seconds");
-    mvwaddstr(win, 1, 1, "Pressing ^C should do nothing");
+    MvWAddStr(win, 2, 1, "Press some keys for 5 seconds");
+    MvWAddStr(win, 1, 1, "Pressing ^C should do nothing");
     wrefresh(win);
 
     werase(subWin);
     box(subWin, ACS_VLINE, ACS_HLINE);
     for (i = 0; i < 5; i++) {
-	mvwprintw(subWin, 1, 1, "Time = %d", i);
+	MvWPrintw(subWin, 1, 1, "Time = %d", i);
 	wrefresh(subWin);
 	napms(1000);
 	flushinp();
@@ -328,7 +327,7 @@
     wrefresh(win);
     napms(500);
 
-    mvwaddstr(win, 2, 1, "Press a key, followed by ENTER");
+    MvWAddStr(win, 2, 1, "Press a key, followed by ENTER");
     wmove(win, 9, 10);
     wrefresh(win);
     echo();
@@ -338,12 +337,12 @@
 
     wmove(win, 9, 10);
     wdelch(win);
-    mvwaddstr(win, 4, 1, "The character should now have been deleted");
+    MvWAddStr(win, 4, 1, "The character should now have been deleted");
     Continue(win);
 
     wclear(win);
-    mvwaddstr(win, 1, 1, "Press keys (or mouse buttons) to show their names");
-    mvwaddstr(win, 2, 1, "Press spacebar to finish");
+    MvWAddStr(win, 1, 1, "Press keys (or mouse buttons) to show their names");
+    MvWAddStr(win, 2, 1, "Press spacebar to finish");
     wrefresh(win);
 
     keypad(win, TRUE);
@@ -416,13 +415,13 @@
 	    "%d %[][a-zA-Z]s",
 	    "%d %[^0-9]"
 	};
-	const char *format = fmt[repeat % SIZEOF(fmt)];
+	const char *format = fmt[(unsigned) repeat % SIZEOF(fmt)];
 
 	wclear(win);
-	mvwaddstr(win, 3, 2, "The window should have moved");
-	mvwaddstr(win, 4, 2,
+	MvWAddStr(win, 3, 2, "The window should have moved");
+	MvWAddStr(win, 4, 2,
 		  "This text should have appeared without you pressing a key");
-	mvwprintw(win, 6, 2,
+	MvWPrintw(win, 6, 2,
 		  "Scanning with format \"%s\"", format);
 	mvwin(win, 2 + 2 * (repeat % 4), 1 + 2 * (repeat % 4));
 	erase();
@@ -433,7 +432,7 @@
 	num = 0;
 	*buffer = 0;
 	answered = mvwscanw(win, 7, 6, strdup(format), &num, buffer);
-	mvwprintw(win, 8, 6,
+	MvWPrintw(win, 8, 6,
 		  "String: %s Number: %d (%d values read)",
 		  buffer, num, answered);
 	Continue(win);
@@ -462,7 +461,7 @@
 
     nl();
     wclear(win);
-    mvwaddstr(win, 1, 1,
+    MvWAddStr(win, 1, 1,
 	      "You should now have a screen in the upper left corner, and this text should have wrapped");
     mvwin(win, 2, 1);
     waddstr(win, "\nThis text should be down\n");
@@ -471,17 +470,17 @@
 
     wclear(win);
     wattron(win, A_BOLD);
-    mvwaddstr(win, 1, 1, "A new window will appear with this text in it");
-    mvwaddstr(win, 8, 1, "Press any key to continue");
+    MvWAddStr(win, 1, 1, "A new window will appear with this text in it");
+    MvWAddStr(win, 8, 1, "Press any key to continue");
     wrefresh(win);
     wgetch(win);
 
     getbegyx(win, by, bx);
 
     if (LINES < 24 || COLS < 75) {
-	mvwaddstr(win, 5, 1,
+	MvWAddStr(win, 5, 1,
 		  "Some tests have been skipped as they require a");
-	mvwaddstr(win, 6, 1, "display of at least 24 LINES by 75 COLUMNS");
+	MvWAddStr(win, 6, 1, "display of at least 24 LINES by 75 COLUMNS");
 	Continue(win);
     } else {
 	win1 = newwin(10, 50, 14, 25);
@@ -499,7 +498,7 @@
 	wbkgd(win1, A_NORMAL);
 #endif
 	wclear(win1);
-	mvwaddstr(win1, 5, 1,
+	MvWAddStr(win1, 5, 1,
 		  "This text should appear; using overlay option");
 	copywin(win, win1, 0, 0, 0, 0, 9, 49, TRUE);
 
@@ -514,7 +513,7 @@
 
 	wclear(win1);
 	wattron(win1, A_BLINK);
-	mvwaddstr(win1, 4, 1,
+	MvWAddStr(win1, 4, 1,
 		  "This blinking text should appear in only the second window");
 	wattroff(win1, A_BLINK);
 	mvwin(win1, by, bx);
@@ -529,14 +528,14 @@
     clear();
     wclear(win);
     wrefresh(win);
-    mvwaddstr(win, 6, 2, "This line shouldn't appear");
-    mvwaddstr(win, 4, 2, "Only half of the next line is visible");
-    mvwaddstr(win, 5, 2, "Only half of the next line is visible");
+    MvWAddStr(win, 6, 2, "This line shouldn't appear");
+    MvWAddStr(win, 4, 2, "Only half of the next line is visible");
+    MvWAddStr(win, 5, 2, "Only half of the next line is visible");
     wmove(win, 6, 1);
     wclrtobot(win);
     wmove(win, 5, 20);
     wclrtoeol(win);
-    mvwaddstr(win, 8, 2, "This line also shouldn't appear");
+    MvWAddStr(win, 8, 2, "This line also shouldn't appear");
     wmove(win, 8, 1);
     wdeleteln(win);
     Continue(win);
@@ -551,20 +550,20 @@
     Continue(win);
 
 #if HAVE_WINSSTR
-    mvwinsstr(win, 6, 2, "A1B2C3D4E5");
+    (void) mvwinsstr(win, 6, 2, "A1B2C3D4E5");
     Continue(win);
 #endif
 
     wmove(win, 5, 1);
     winsertln(win);
-    mvwaddstr(win, 5, 2, "The lines below should have moved down");
+    MvWAddStr(win, 5, 2, "The lines below should have moved down");
     Continue(win);
 
     wclear(win);
     wmove(win, 2, 2);
     wprintw(win, "This is a formatted string in a window: %d %s\n", 42,
 	    "is it");
-    mvwaddstr(win, 10, 1, "Enter a string: ");
+    MvWAddStr(win, 10, 1, "Enter a string: ");
     wrefresh(win);
     noraw();
     echo();
@@ -572,21 +571,21 @@
     wscanw(win, "%s", Buffer);
 
     printw("This is a formatted string in stdscr: %d %s\n", 42, "is it");
-    mvaddstr(10, 1, "Enter a string: ");
+    MvAddStr(10, 1, "Enter a string: ");
     *Buffer = 0;
     scanw("%s", Buffer);
 
     if (TIGETSTR("cvvis", "vs") != 0) {
 	wclear(win);
 	curs_set(2);
-	mvwaddstr(win, 1, 1, "The cursor should appear as a block (visible)");
+	MvWAddStr(win, 1, 1, "The cursor should appear as a block (visible)");
 	Continue(win);
     }
 
     if (TIGETSTR("civis", "vi") != 0) {
 	wclear(win);
 	curs_set(0);
-	mvwaddstr(win, 1, 1,
+	MvWAddStr(win, 1, 1,
 		  "The cursor should have disappeared (invisible)");
 	Continue(win);
     }
@@ -594,13 +593,13 @@
     if (TIGETSTR("cnorm", "ve") != 0) {
 	wclear(win);
 	curs_set(1);
-	mvwaddstr(win, 1, 1, "The cursor should be an underline (normal)");
+	MvWAddStr(win, 1, 1, "The cursor should be an underline (normal)");
 	Continue(win);
     }
 #ifdef A_COLOR
     if (has_colors()) {
 	wclear(win);
-	mvwaddstr(win, 1, 1, "Colors should change after you press a key");
+	MvWAddStr(win, 1, 1, "Colors should change after you press a key");
 	Continue(win);
 	init_pair(1, COLOR_RED, COLOR_WHITE);
 	wrefresh(win);
@@ -610,20 +609,20 @@
     werase(win);
 
 #if HAVE_TERMNAME
-    mvwaddstr(win, 1, 1, "Information About Your Terminal");
-    mvwaddstr(win, 3, 1, termname());
-    mvwaddstr(win, 4, 1, longname());
+    MvWAddStr(win, 1, 1, "Information About Your Terminal");
+    MvWAddStr(win, 3, 1, termname());
+    MvWAddStr(win, 4, 1, longname());
     if (termattrs() & A_BLINK)
-	mvwaddstr(win, 5, 1, "This terminal supports blinking.");
+	MvWAddStr(win, 5, 1, "This terminal supports blinking.");
     else
-	mvwaddstr(win, 5, 1, "This terminal does NOT support blinking.");
+	MvWAddStr(win, 5, 1, "This terminal does NOT support blinking.");
 #endif
 
-    mvwaddnstr(win, 7, 5, "Have a nice day!ok", 16);
+    (void) mvwaddnstr(win, 7, 5, "Have a nice day!ok", 16);
     wrefresh(win);
 
-    mvwinnstr(win, 7, 5, Buffer, 18);
-    mvaddstr(LINES - 2, 10, Buffer);
+    (void) mvwinnstr(win, 7, 5, Buffer, 18);
+    MvAddStr(LINES - 2, 10, Buffer);
     refresh();
     Continue(win);
 }
@@ -657,13 +656,13 @@
 #endif
     wclear(win1);
 
-    mvwaddstr(win1, 1, 1, "The screen may now have 50 lines");
+    MvWAddStr(win1, 1, 1, "The screen may now have 50 lines");
     Continue(win1);
 
     wclear(win1);
     resetty();
 
-    mvwaddstr(win1, 1, 1, "The screen should now be reset");
+    MvWAddStr(win1, 1, 1, "The screen should now be reset");
     Continue(win1);
 
     delwin(win1);
@@ -681,29 +680,29 @@
 
     if ((pad = newpad(50, 100)) != 0) {
 	wattron(pad, A_REVERSE);
-	mvwaddstr(pad, 5, 2, "This is a new pad");
-	wattrset(pad, A_NORMAL);
-	mvwaddstr(pad, 8, 0,
+	MvWAddStr(pad, 5, 2, "This is a new pad");
+	(void) wattrset(pad, A_NORMAL);
+	MvWAddStr(pad, 8, 0,
 		  "The end of this line should be truncated here:except  now");
-	mvwaddstr(pad, 11, 1, "This line should not appear.It will now");
+	MvWAddStr(pad, 11, 1, "This line should not appear.It will now");
 	wmove(pad, 10, 1);
 	wclrtoeol(pad);
-	mvwaddstr(pad, 10, 1, " Press any key to continue");
+	MvWAddStr(pad, 10, 1, " Press any key to continue");
 	prefresh(pad, 0, 0, 0, 0, 10, 45);
 	keypad(pad, TRUE);
 	raw();
 	wgetch(pad);
 
 	spad = subpad(pad, 12, 25, 6, 52);
-	mvwaddstr(spad, 2, 2, "This is a new subpad");
+	MvWAddStr(spad, 2, 2, "This is a new subpad");
 	box(spad, 0, 0);
 	prefresh(pad, 0, 0, 0, 0, 15, 75);
 	keypad(pad, TRUE);
 	raw();
 	wgetch(pad);
 
-	mvwaddstr(pad, 35, 2, "This is displayed at line 35 in the pad");
-	mvwaddstr(pad, 40, 1, " Press any key to continue");
+	MvWAddStr(pad, 35, 2, "This is displayed at line 35 in the pad");
+	MvWAddStr(pad, 40, 1, " Press any key to continue");
 	prefresh(pad, 30, 0, 0, 0, 10, 45);
 	keypad(pad, TRUE);
 	raw();
@@ -720,19 +719,19 @@
 
     assert((new_option >= 0) && (new_option < MAX_OPTIONS));
 
-    attrset(A_NORMAL);
-    mvaddstr(3, 20, "PDCurses Test Program");
+    (void) attrset(A_NORMAL);
+    MvAddStr(3, 20, "PDCurses Test Program");
 
     for (i = 0; i < (int) MAX_OPTIONS; i++)
-	mvaddstr(5 + i, 25, command[i].text);
+	MvAddStr(5 + i, 25, command[i].text);
 
     if ((old_option >= 0) && (old_option < MAX_OPTIONS))
-	mvaddstr(5 + old_option, 25, command[old_option].text);
+	MvAddStr(5 + old_option, 25, command[old_option].text);
 
-    attrset(A_REVERSE);
-    mvaddstr(5 + new_option, 25, command[new_option].text);
-    attrset(A_NORMAL);
-    mvaddstr(13, 3,
+    (void) attrset(A_REVERSE);
+    MvAddStr(5 + new_option, 25, command[new_option].text);
+    (void) attrset(A_NORMAL);
+    MvAddStr(13, 3,
 	     "Use Up and Down Arrows to select - Enter to run - Q to quit");
     refresh();
 }
diff -Naur ncurses-5.7.orig/test/view.c ncurses-5.7/test/view.c
--- ncurses-5.7.orig/test/view.c	2008-09-06 18:10:50.000000000 -0400
+++ ncurses-5.7/test/view.c	2011-01-08 18:18:29.502657976 -0500
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2007,2008 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            *
@@ -50,7 +50,7 @@
  * scroll operation worked, and the refresh() code only had to do a
  * partial repaint.
  *
- * $Id: view.c,v 1.69 2008/09/06 22:10:50 tom Exp $
+ * $Id: view.c,v 1.81 2010/11/14 01:06:02 tom Exp $
  */
 
 #include <test.priv.h>
@@ -62,8 +62,10 @@
 #if HAVE_TERMIOS_H
 # include <termios.h>
 #else
+#if !defined(__MINGW32__)
 # include <sgtty.h>
 #endif
+#endif
 
 #if !defined(sun) || !HAVE_TERMIOS_H
 # if HAVE_SYS_IOCTL_H
@@ -81,7 +83,7 @@
 
 #if USE_WIDEC_SUPPORT
 #if HAVE_MBTOWC && HAVE_MBLEN
-#define reset_mbytes(state) mblen(NULL, 0), mbtowc(NULL, NULL, 0)
+#define reset_mbytes(state) IGNORE_RC(mblen(NULL, 0)), IGNORE_RC(mbtowc(NULL, NULL, 0))
 #define count_mbytes(buffer,length,state) mblen(buffer,length)
 #define check_mbytes(wch,buffer,length,state) \
 	(int) mbtowc(&wch, buffer, length)
@@ -149,11 +151,19 @@
 {
     int result = 0;
 #if USE_WIDEC_SUPPORT
+    int count;
 #endif
 
 #if USE_WIDEC_SUPPORT
-    while (getcchar(src++, NULL, NULL, NULL, NULL) > 0)
-	result++;
+    for (;;) {
+	TEST_CCHAR(src, count, {
+	    ++result;
+	    ++src;
+	}
+	, {
+	    break;
+	})
+    }
 #else
     while (*src++)
 	result++;
@@ -168,7 +178,7 @@
 static NCURSES_CH_T *
 ch_dup(char *src)
 {
-    unsigned len = strlen(src);
+    unsigned len = (unsigned) strlen(src);
     NCURSES_CH_T *dst = typeMalloc(NCURSES_CH_T, len + 1);
     unsigned j, k;
 #if USE_WIDEC_SUPPORT
@@ -187,7 +197,7 @@
 #endif
     for (j = k = 0; j < len; j++) {
 #if USE_WIDEC_SUPPORT
-	rc = check_mbytes(wch, src + j, len - j, state);
+	rc = (size_t) check_mbytes(wch, src + j, len - j, state);
 	if (rc == (size_t) -1 || rc == (size_t) -2)
 	    break;
 	j += rc - 1;
@@ -204,7 +214,7 @@
 	    wstr[l++] = L' ';
 	wstr[l++] = wch;
 #else
-	dst[k++] = src[j];
+	dst[k++] = (chtype) UChar(src[j]);
 #endif
     }
 #if USE_WIDEC_SUPPORT
@@ -281,9 +291,11 @@
     if (optind + 1 != argc)
 	usage();
 
-    if ((vec_lines = typeMalloc(NCURSES_CH_T *, MAXLINES + 2)) == 0)
+    if ((vec_lines = typeCalloc(NCURSES_CH_T *, (size_t) MAXLINES + 2)) == 0)
 	usage();
 
+    assert(vec_lines != 0);
+
     fname = argv[optind];
     if ((fp = fopen(fname, "r")) == 0) {
 	perror(fname);
@@ -321,14 +333,14 @@
 	    } else {
 		sprintf(d, "\\%03o", UChar(*s));
 		d += strlen(d);
-		col = (d - temp);
+		col = (int) (d - temp);
 	    }
 #endif
 	}
 	*lptr = ch_dup(temp);
     }
     (void) fclose(fp);
-    num_lines = lptr - vec_lines;
+    num_lines = (int) (lptr - vec_lines);
 
     (void) initscr();		/* initialize the curses library */
     keypad(stdscr, TRUE);	/* enable keyboard mapping */
@@ -355,7 +367,6 @@
 	if (!got_number)
 	    show_all(my_label);
 
-	n = 0;
 	for (;;) {
 #if CAN_RESIZE
 	    if (interrupted) {
@@ -368,7 +379,7 @@
 	    waiting = FALSE;
 	    if ((c < 127) && isdigit(c)) {
 		if (!got_number) {
-		    mvprintw(0, 0, "Count: ");
+		    MvPrintw(0, 0, "Count: ");
 		    clrtoeol();
 		}
 		addch(UChar(c));
@@ -394,7 +405,7 @@
 		    lptr++;
 		else
 		    break;
-	    scrl(lptr - olptr);
+	    scrl((int) (lptr - olptr));
 	    break;
 
 	case KEY_UP:
@@ -405,7 +416,7 @@
 		    lptr--;
 		else
 		    break;
-	    scrl(lptr - olptr);
+	    scrl((int) (lptr - olptr));
 	    break;
 
 	case 'h':
@@ -490,12 +501,11 @@
 
 #if CAN_RESIZE
 /*
- * This uses functions that are "unsafe", but it seems to work on SunOS and
- * Linux.  Usually:  the "unsafe" refers to the functions that POSIX lists
- * which may be called from a signal handler.  Those do not include buffered
- * I/O, which is used for instance in wrefresh().  To be really portable, you
- * should use the KEY_RESIZE return (which relies on ncurses' sigwinch
- * handler).
+ * This uses functions that are "unsafe", but it seems to work on SunOS. 
+ * Usually: the "unsafe" refers to the functions that POSIX lists which may be
+ * called from a signal handler.  Those do not include buffered I/O, which is
+ * used for instance in wrefresh().  To be really portable, you should use the
+ * KEY_RESIZE return (which relies on ncurses' sigwinch handler).
  *
  * The 'wrefresh(curscr)' is needed to force the refresh to start from the top
  * of the screen -- some xterms mangle the bitmap while resizing.
@@ -508,7 +518,7 @@
 
 	if (ioctl(fileno(stdout), TIOCGWINSZ, &size) == 0) {
 	    resize_term(size.ws_row, size.ws_col);
-	    wrefresh(curscr);	/* Linux needs this */
+	    wrefresh(curscr);
 	    show_all(sig ? "SIGWINCH" : "interrupt");
 	}
 	interrupted = FALSE;
@@ -529,9 +539,12 @@
 
 #if CAN_RESIZE
     sprintf(temp, "%.20s (%3dx%3d) col %d ", tag, LINES, COLS, shift);
-    i = strlen(temp);
-    if ((i + 7) < (int) sizeof(temp))
-	sprintf(temp + i, "view %.*s", (int) (sizeof(temp) - 7 - i), fname);
+    i = (int) strlen(temp);
+    if ((i + 7) < (int) sizeof(temp)) {
+	sprintf(temp + i, "view %.*s",
+		(int) (sizeof(temp) - 7 - (size_t) i),
+		fname);
+    }
 #else
     (void) tag;
     sprintf(temp, "view %.*s", (int) sizeof(temp) - 7, fname);
@@ -541,7 +554,7 @@
     clrtoeol();
     this_time = time((time_t *) 0);
     strcpy(temp, ctime(&this_time));
-    if ((i = strlen(temp)) != 0) {
+    if ((i = (int) strlen(temp)) != 0) {
 	temp[--i] = 0;
 	if (move(0, COLS - i - 2) != ERR)
 	    printw("  %s", temp);
diff -Naur ncurses-5.7.orig/test/worm.c ncurses-5.7/test/worm.c
--- ncurses-5.7.orig/test/worm.c	2008-10-04 17:54:09.000000000 -0400
+++ ncurses-5.7/test/worm.c	2011-01-08 18:18:29.502657976 -0500
@@ -61,7 +61,7 @@
   traces will be dumped.  The program stops and waits for one character of
   input at the beginning and end of the interval.
 
-  $Id: worm.c,v 1.58 2008/10/04 21:54:09 tom Exp $
+  $Id: worm.c,v 1.60 2010/11/13 20:21:21 tom Exp $
 */
 
 #include <test.priv.h>
@@ -79,7 +79,7 @@
 {
     'O', '*', '#', '$', '%', '0', '@',
 };
-static const short xinc[] =
+static const int xinc[] =
 {
     1, 1, 1, 0, -1, -1, -1, 0
 }, yinc[] =
@@ -90,8 +90,8 @@
 typedef struct worm {
     int orientation;
     int head;
-    short *xpos;
-    short *ypos;
+    int *xpos;
+    int *ypos;
     chtype attrs;
 #ifdef USE_PTHREADS
     pthread_t thread;
@@ -102,7 +102,7 @@
 static bool quitting = FALSE;
 
 static WORM worm[MAX_WORMS];
-static short **refs;
+static int **refs;
 static int last_x, last_y;
 
 static const char *field;
@@ -216,11 +216,11 @@
     ExitProgram(EXIT_FAILURE);
 }
 
-static float
+static double
 ranf(void)
 {
     long r = (rand() & 077777);
-    return ((float) r / 32768.);
+    return ((double) r / 32768.);
 }
 
 static int
@@ -228,7 +228,7 @@
 {
     WORM *w = (WORM *) data;
     const struct options *op;
-    unsigned mask = ~(1 << (w - worm));
+    unsigned mask = (unsigned) (~(1 << (w - worm)));
     chtype attrs = w->attrs | ((mask & pending) ? A_REVERSE : 0);
 
     int x;
@@ -291,7 +291,7 @@
 	w->orientation = op->opts[0];
 	break;
     default:
-	w->orientation = op->opts[(int) (ranf() * (float) op->nopts)];
+	w->orientation = op->opts[(int) (ranf() * (double) op->nopts)];
 	break;
     }
 
@@ -330,7 +330,11 @@
     while (!quit_worm(((struct worm *) arg) - worm)) {
 	while (compare < sequence) {
 	    ++compare;
+#if HAVE_USE_WINDOW
 	    use_window(stdscr, draw_worm, arg);
+#else
+	    draw_worm(stdscr, arg);
+#endif
 	}
     }
     Trace(("...start_worm (done)"));
@@ -356,7 +360,13 @@
     }
 #else
     for (n = 0, w = &worm[0]; n < number; n++, w++) {
-	if (USING_WINDOW2(stdscr, draw_worm, w))
+	if (
+#if HAVE_USE_WINDOW
+	       USING_WINDOW2(stdscr, draw_worm, w)
+#else
+	       draw_worm(stdscr, w)
+#endif
+	    )
 	    done = TRUE;
     }
 #endif
@@ -380,7 +390,7 @@
     (void) win;
     if (last_x != COLS - 1) {
 	for (y = 0; y <= last_y; y++) {
-	    refs[y] = typeRealloc(short, COLS, refs[y]);
+	    refs[y] = typeRealloc(int, (size_t) COLS, refs[y]);
 	    for (x = last_x + 1; x < COLS; x++)
 		refs[y][x] = 0;
 	}
@@ -389,9 +399,9 @@
     if (last_y != LINES - 1) {
 	for (y = LINES; y <= last_y; y++)
 	    free(refs[y]);
-	refs = typeRealloc(short *, LINES, refs);
+	refs = typeRealloc(int *, (size_t) LINES, refs);
 	for (y = last_y + 1; y < LINES; y++) {
-	    refs[y] = typeMalloc(short, COLS);
+	    refs[y] = typeMalloc(int, (size_t) COLS);
 	    for (x = 0; x < COLS; x++)
 		refs[y][x] = 0;
 	}
@@ -407,7 +417,7 @@
     int x, y;
     int n;
     struct worm *w;
-    short *ip;
+    int *ip;
     bool done = FALSE;
 
     setlocale(LC_ALL, "");
@@ -478,7 +488,7 @@
 #endif
 
 #define SET_COLOR(num, fg) \
-	    init_pair(num+1, fg, bg); \
+	    init_pair(num+1, (short) fg, (short) bg); \
 	    flavor[num] |= COLOR_PAIR(num+1) | A_BOLD
 
 	SET_COLOR(0, COLOR_GREEN);
@@ -491,9 +501,9 @@
     }
 #endif /* A_COLOR */
 
-    refs = typeMalloc(short *, LINES);
+    refs = typeMalloc(int *, (size_t) LINES);
     for (y = 0; y < LINES; y++) {
-	refs[y] = typeMalloc(short, COLS);
+	refs[y] = typeMalloc(int, (size_t) COLS);
 	for (x = 0; x < COLS; x++) {
 	    refs[y][x] = 0;
 	}
@@ -505,18 +515,18 @@
 #endif /* BADCORNER */
 
     for (n = number, w = &worm[0]; --n >= 0; w++) {
-	w->attrs = flavor[n % SIZEOF(flavor)];
+	w->attrs = flavor[(unsigned) n % SIZEOF(flavor)];
 	w->orientation = 0;
 	w->head = 0;
 
-	if (!(ip = typeMalloc(short, (length + 1)))) {
+	if (!(ip = typeMalloc(int, (size_t) (length + 1)))) {
 	    fprintf(stderr, "%s: out of memory\n", *argv);
 	    ExitProgram(EXIT_FAILURE);
 	}
 	w->xpos = ip;
 	for (x = length; --x >= 0;)
 	    *ip++ = -1;
-	if (!(ip = typeMalloc(short, (length + 1)))) {
+	if (!(ip = typeMalloc(int, (size_t) (length + 1)))) {
 	    fprintf(stderr, "%s: out of memory\n", *argv);
 	    ExitProgram(EXIT_FAILURE);
 	}
diff -Naur ncurses-5.7.orig/test/xmas.c ncurses-5.7/test/xmas.c
--- ncurses-5.7.orig/test/xmas.c	2008-08-03 07:08:59.000000000 -0400
+++ ncurses-5.7/test/xmas.c	2011-01-08 18:18:29.502657976 -0500
@@ -92,7 +92,7 @@
 /******************************************************************************/
 
 /*
- * $Id: xmas.c,v 1.24 2008/08/03 11:08:59 tom Exp $
+ * $Id: xmas.c,v 1.27 2010/11/13 20:24:10 tom Exp $
  */
 #include <test.priv.h>
 
@@ -154,11 +154,11 @@
 set_color(WINDOW *win, chtype color)
 {
     if (has_colors()) {
-	int n = (color + 1);
+	int n = (int) (color + 1);
 	if (my_pairs == 0)
-	    my_pairs = typeCalloc(bool, COLORS + 1);
+	    my_pairs = typeCalloc(bool, (size_t) (COLORS + 1));
 	if (!my_pairs[n]) {
-	    init_pair(n, color, my_bg);
+	    init_pair((short) n, (short) color, (short) my_bg);
 	    my_pairs[n] = TRUE;
 	}
 	wattroff(win, A_COLOR);
@@ -170,7 +170,7 @@
 unset_color(WINDOW *win)
 {
     if (has_colors())
-	wattrset(win, COLOR_PAIR(0));
+	(void) wattrset(win, COLOR_PAIR(0));
 }
 
 static void
@@ -249,203 +249,203 @@
 	ExitProgram(EXIT_FAILURE);
     }
 
-    mvwaddstr(w_del_msg, 0, 0, "Hit any key to quit");
+    MvWAddStr(w_del_msg, 0, 0, "Hit any key to quit");
 
-    mvwaddstr(w_holiday, 0, 0, "H A P P Y  H O L I D A Y S");
+    MvWAddStr(w_holiday, 0, 0, "H A P P Y  H O L I D A Y S");
 
     /* set up the windows for our various reindeer */
 
     /* lildeer1 */
-    mvwaddch(lildeer1, 0, 0, (chtype) 'V');
-    mvwaddch(lildeer1, 1, 0, (chtype) '@');
-    mvwaddch(lildeer1, 1, 1, (chtype) '<');
-    mvwaddch(lildeer1, 1, 2, (chtype) '>');
-    mvwaddch(lildeer1, 1, 3, (chtype) '~');
+    MvWAddCh(lildeer1, 0, 0, (chtype) 'V');
+    MvWAddCh(lildeer1, 1, 0, (chtype) '@');
+    MvWAddCh(lildeer1, 1, 1, (chtype) '<');
+    MvWAddCh(lildeer1, 1, 2, (chtype) '>');
+    MvWAddCh(lildeer1, 1, 3, (chtype) '~');
 
     /* lildeer2 */
-    mvwaddch(lildeer2, 0, 0, (chtype) 'V');
-    mvwaddch(lildeer2, 1, 0, (chtype) '@');
-    mvwaddch(lildeer2, 1, 1, (chtype) '|');
-    mvwaddch(lildeer2, 1, 2, (chtype) '|');
-    mvwaddch(lildeer2, 1, 3, (chtype) '~');
+    MvWAddCh(lildeer2, 0, 0, (chtype) 'V');
+    MvWAddCh(lildeer2, 1, 0, (chtype) '@');
+    MvWAddCh(lildeer2, 1, 1, (chtype) '|');
+    MvWAddCh(lildeer2, 1, 2, (chtype) '|');
+    MvWAddCh(lildeer2, 1, 3, (chtype) '~');
 
     /* lildeer3 */
-    mvwaddch(lildeer3, 0, 0, (chtype) 'V');
-    mvwaddch(lildeer3, 1, 0, (chtype) '@');
-    mvwaddch(lildeer3, 1, 1, (chtype) '>');
-    mvwaddch(lildeer3, 1, 2, (chtype) '<');
-    mvwaddch(lildeer2, 1, 3, (chtype) '~');
+    MvWAddCh(lildeer3, 0, 0, (chtype) 'V');
+    MvWAddCh(lildeer3, 1, 0, (chtype) '@');
+    MvWAddCh(lildeer3, 1, 1, (chtype) '>');
+    MvWAddCh(lildeer3, 1, 2, (chtype) '<');
+    MvWAddCh(lildeer2, 1, 3, (chtype) '~');
 
     /* middeer1 */
-    mvwaddch(middeer1, 0, 2, (chtype) 'y');
-    mvwaddch(middeer1, 0, 3, (chtype) 'y');
-    mvwaddch(middeer1, 1, 2, (chtype) '0');
-    mvwaddch(middeer1, 1, 3, (chtype) '(');
-    mvwaddch(middeer1, 1, 4, (chtype) '=');
-    mvwaddch(middeer1, 1, 5, (chtype) ')');
-    mvwaddch(middeer1, 1, 6, (chtype) '~');
-    mvwaddch(middeer1, 2, 3, (chtype) '\\');
-    mvwaddch(middeer1, 2, 4, (chtype) '/');
+    MvWAddCh(middeer1, 0, 2, (chtype) 'y');
+    MvWAddCh(middeer1, 0, 3, (chtype) 'y');
+    MvWAddCh(middeer1, 1, 2, (chtype) '0');
+    MvWAddCh(middeer1, 1, 3, (chtype) '(');
+    MvWAddCh(middeer1, 1, 4, (chtype) '=');
+    MvWAddCh(middeer1, 1, 5, (chtype) ')');
+    MvWAddCh(middeer1, 1, 6, (chtype) '~');
+    MvWAddCh(middeer1, 2, 3, (chtype) '\\');
+    MvWAddCh(middeer1, 2, 4, (chtype) '/');
 
     /* middeer2 */
-    mvwaddch(middeer2, 0, 2, (chtype) 'y');
-    mvwaddch(middeer2, 0, 3, (chtype) 'y');
-    mvwaddch(middeer2, 1, 2, (chtype) '0');
-    mvwaddch(middeer2, 1, 3, (chtype) '(');
-    mvwaddch(middeer2, 1, 4, (chtype) '=');
-    mvwaddch(middeer2, 1, 5, (chtype) ')');
-    mvwaddch(middeer2, 1, 6, (chtype) '~');
-    mvwaddch(middeer2, 2, 3, (chtype) '|');
-    mvwaddch(middeer2, 2, 5, (chtype) '|');
+    MvWAddCh(middeer2, 0, 2, (chtype) 'y');
+    MvWAddCh(middeer2, 0, 3, (chtype) 'y');
+    MvWAddCh(middeer2, 1, 2, (chtype) '0');
+    MvWAddCh(middeer2, 1, 3, (chtype) '(');
+    MvWAddCh(middeer2, 1, 4, (chtype) '=');
+    MvWAddCh(middeer2, 1, 5, (chtype) ')');
+    MvWAddCh(middeer2, 1, 6, (chtype) '~');
+    MvWAddCh(middeer2, 2, 3, (chtype) '|');
+    MvWAddCh(middeer2, 2, 5, (chtype) '|');
 
     /* middeer3 */
-    mvwaddch(middeer3, 0, 2, (chtype) 'y');
-    mvwaddch(middeer3, 0, 3, (chtype) 'y');
-    mvwaddch(middeer3, 1, 2, (chtype) '0');
-    mvwaddch(middeer3, 1, 3, (chtype) '(');
-    mvwaddch(middeer3, 1, 4, (chtype) '=');
-    mvwaddch(middeer3, 1, 5, (chtype) ')');
-    mvwaddch(middeer3, 1, 6, (chtype) '~');
-    mvwaddch(middeer3, 2, 2, (chtype) '/');
-    mvwaddch(middeer3, 2, 6, (chtype) '\\');
+    MvWAddCh(middeer3, 0, 2, (chtype) 'y');
+    MvWAddCh(middeer3, 0, 3, (chtype) 'y');
+    MvWAddCh(middeer3, 1, 2, (chtype) '0');
+    MvWAddCh(middeer3, 1, 3, (chtype) '(');
+    MvWAddCh(middeer3, 1, 4, (chtype) '=');
+    MvWAddCh(middeer3, 1, 5, (chtype) ')');
+    MvWAddCh(middeer3, 1, 6, (chtype) '~');
+    MvWAddCh(middeer3, 2, 2, (chtype) '/');
+    MvWAddCh(middeer3, 2, 6, (chtype) '\\');
 
     /* bigdeer1 */
-    mvwaddch(bigdeer1, 0, 17, (chtype) '\\');
-    mvwaddch(bigdeer1, 0, 18, (chtype) '/');
-    mvwaddch(bigdeer1, 0, 20, (chtype) '\\');
-    mvwaddch(bigdeer1, 0, 21, (chtype) '/');
-    mvwaddch(bigdeer1, 1, 18, (chtype) '\\');
-    mvwaddch(bigdeer1, 1, 20, (chtype) '/');
-    mvwaddch(bigdeer1, 2, 19, (chtype) '|');
-    mvwaddch(bigdeer1, 2, 20, (chtype) '_');
-    mvwaddch(bigdeer1, 3, 18, (chtype) '/');
-    mvwaddch(bigdeer1, 3, 19, (chtype) '^');
-    mvwaddch(bigdeer1, 3, 20, (chtype) '0');
-    mvwaddch(bigdeer1, 3, 21, (chtype) '\\');
-    mvwaddch(bigdeer1, 4, 17, (chtype) '/');
-    mvwaddch(bigdeer1, 4, 18, (chtype) '/');
-    mvwaddch(bigdeer1, 4, 19, (chtype) '\\');
-    mvwaddch(bigdeer1, 4, 22, (chtype) '\\');
-    mvwaddstr(bigdeer1, 5, 7, "^~~~~~~~~//  ~~U");
-    mvwaddstr(bigdeer1, 6, 7, "( \\_____( /");
-    mvwaddstr(bigdeer1, 7, 8, "( )    /");
-    mvwaddstr(bigdeer1, 8, 9, "\\\\   /");
-    mvwaddstr(bigdeer1, 9, 11, "\\>/>");
+    MvWAddCh(bigdeer1, 0, 17, (chtype) '\\');
+    MvWAddCh(bigdeer1, 0, 18, (chtype) '/');
+    MvWAddCh(bigdeer1, 0, 20, (chtype) '\\');
+    MvWAddCh(bigdeer1, 0, 21, (chtype) '/');
+    MvWAddCh(bigdeer1, 1, 18, (chtype) '\\');
+    MvWAddCh(bigdeer1, 1, 20, (chtype) '/');
+    MvWAddCh(bigdeer1, 2, 19, (chtype) '|');
+    MvWAddCh(bigdeer1, 2, 20, (chtype) '_');
+    MvWAddCh(bigdeer1, 3, 18, (chtype) '/');
+    MvWAddCh(bigdeer1, 3, 19, (chtype) '^');
+    MvWAddCh(bigdeer1, 3, 20, (chtype) '0');
+    MvWAddCh(bigdeer1, 3, 21, (chtype) '\\');
+    MvWAddCh(bigdeer1, 4, 17, (chtype) '/');
+    MvWAddCh(bigdeer1, 4, 18, (chtype) '/');
+    MvWAddCh(bigdeer1, 4, 19, (chtype) '\\');
+    MvWAddCh(bigdeer1, 4, 22, (chtype) '\\');
+    MvWAddStr(bigdeer1, 5, 7, "^~~~~~~~~//  ~~U");
+    MvWAddStr(bigdeer1, 6, 7, "( \\_____( /");
+    MvWAddStr(bigdeer1, 7, 8, "( )    /");
+    MvWAddStr(bigdeer1, 8, 9, "\\\\   /");
+    MvWAddStr(bigdeer1, 9, 11, "\\>/>");
 
     /* bigdeer2 */
-    mvwaddch(bigdeer2, 0, 17, (chtype) '\\');
-    mvwaddch(bigdeer2, 0, 18, (chtype) '/');
-    mvwaddch(bigdeer2, 0, 20, (chtype) '\\');
-    mvwaddch(bigdeer2, 0, 21, (chtype) '/');
-    mvwaddch(bigdeer2, 1, 18, (chtype) '\\');
-    mvwaddch(bigdeer2, 1, 20, (chtype) '/');
-    mvwaddch(bigdeer2, 2, 19, (chtype) '|');
-    mvwaddch(bigdeer2, 2, 20, (chtype) '_');
-    mvwaddch(bigdeer2, 3, 18, (chtype) '/');
-    mvwaddch(bigdeer2, 3, 19, (chtype) '^');
-    mvwaddch(bigdeer2, 3, 20, (chtype) '0');
-    mvwaddch(bigdeer2, 3, 21, (chtype) '\\');
-    mvwaddch(bigdeer2, 4, 17, (chtype) '/');
-    mvwaddch(bigdeer2, 4, 18, (chtype) '/');
-    mvwaddch(bigdeer2, 4, 19, (chtype) '\\');
-    mvwaddch(bigdeer2, 4, 22, (chtype) '\\');
-    mvwaddstr(bigdeer2, 5, 7, "^~~~~~~~~//  ~~U");
-    mvwaddstr(bigdeer2, 6, 7, "(( )____( /");
-    mvwaddstr(bigdeer2, 7, 7, "( /      |");
-    mvwaddstr(bigdeer2, 8, 8, "\\/      |");
-    mvwaddstr(bigdeer2, 9, 9, "|>     |>");
+    MvWAddCh(bigdeer2, 0, 17, (chtype) '\\');
+    MvWAddCh(bigdeer2, 0, 18, (chtype) '/');
+    MvWAddCh(bigdeer2, 0, 20, (chtype) '\\');
+    MvWAddCh(bigdeer2, 0, 21, (chtype) '/');
+    MvWAddCh(bigdeer2, 1, 18, (chtype) '\\');
+    MvWAddCh(bigdeer2, 1, 20, (chtype) '/');
+    MvWAddCh(bigdeer2, 2, 19, (chtype) '|');
+    MvWAddCh(bigdeer2, 2, 20, (chtype) '_');
+    MvWAddCh(bigdeer2, 3, 18, (chtype) '/');
+    MvWAddCh(bigdeer2, 3, 19, (chtype) '^');
+    MvWAddCh(bigdeer2, 3, 20, (chtype) '0');
+    MvWAddCh(bigdeer2, 3, 21, (chtype) '\\');
+    MvWAddCh(bigdeer2, 4, 17, (chtype) '/');
+    MvWAddCh(bigdeer2, 4, 18, (chtype) '/');
+    MvWAddCh(bigdeer2, 4, 19, (chtype) '\\');
+    MvWAddCh(bigdeer2, 4, 22, (chtype) '\\');
+    MvWAddStr(bigdeer2, 5, 7, "^~~~~~~~~//  ~~U");
+    MvWAddStr(bigdeer2, 6, 7, "(( )____( /");
+    MvWAddStr(bigdeer2, 7, 7, "( /      |");
+    MvWAddStr(bigdeer2, 8, 8, "\\/      |");
+    MvWAddStr(bigdeer2, 9, 9, "|>     |>");
 
     /* bigdeer3 */
-    mvwaddch(bigdeer3, 0, 17, (chtype) '\\');
-    mvwaddch(bigdeer3, 0, 18, (chtype) '/');
-    mvwaddch(bigdeer3, 0, 20, (chtype) '\\');
-    mvwaddch(bigdeer3, 0, 21, (chtype) '/');
-    mvwaddch(bigdeer3, 1, 18, (chtype) '\\');
-    mvwaddch(bigdeer3, 1, 20, (chtype) '/');
-    mvwaddch(bigdeer3, 2, 19, (chtype) '|');
-    mvwaddch(bigdeer3, 2, 20, (chtype) '_');
-    mvwaddch(bigdeer3, 3, 18, (chtype) '/');
-    mvwaddch(bigdeer3, 3, 19, (chtype) '^');
-    mvwaddch(bigdeer3, 3, 20, (chtype) '0');
-    mvwaddch(bigdeer3, 3, 21, (chtype) '\\');
-    mvwaddch(bigdeer3, 4, 17, (chtype) '/');
-    mvwaddch(bigdeer3, 4, 18, (chtype) '/');
-    mvwaddch(bigdeer3, 4, 19, (chtype) '\\');
-    mvwaddch(bigdeer3, 4, 22, (chtype) '\\');
-    mvwaddstr(bigdeer3, 5, 7, "^~~~~~~~~//  ~~U");
-    mvwaddstr(bigdeer3, 6, 6, "( ()_____( /");
-    mvwaddstr(bigdeer3, 7, 6, "/ /       /");
-    mvwaddstr(bigdeer3, 8, 5, "|/          \\");
-    mvwaddstr(bigdeer3, 9, 5, "/>           \\>");
+    MvWAddCh(bigdeer3, 0, 17, (chtype) '\\');
+    MvWAddCh(bigdeer3, 0, 18, (chtype) '/');
+    MvWAddCh(bigdeer3, 0, 20, (chtype) '\\');
+    MvWAddCh(bigdeer3, 0, 21, (chtype) '/');
+    MvWAddCh(bigdeer3, 1, 18, (chtype) '\\');
+    MvWAddCh(bigdeer3, 1, 20, (chtype) '/');
+    MvWAddCh(bigdeer3, 2, 19, (chtype) '|');
+    MvWAddCh(bigdeer3, 2, 20, (chtype) '_');
+    MvWAddCh(bigdeer3, 3, 18, (chtype) '/');
+    MvWAddCh(bigdeer3, 3, 19, (chtype) '^');
+    MvWAddCh(bigdeer3, 3, 20, (chtype) '0');
+    MvWAddCh(bigdeer3, 3, 21, (chtype) '\\');
+    MvWAddCh(bigdeer3, 4, 17, (chtype) '/');
+    MvWAddCh(bigdeer3, 4, 18, (chtype) '/');
+    MvWAddCh(bigdeer3, 4, 19, (chtype) '\\');
+    MvWAddCh(bigdeer3, 4, 22, (chtype) '\\');
+    MvWAddStr(bigdeer3, 5, 7, "^~~~~~~~~//  ~~U");
+    MvWAddStr(bigdeer3, 6, 6, "( ()_____( /");
+    MvWAddStr(bigdeer3, 7, 6, "/ /       /");
+    MvWAddStr(bigdeer3, 8, 5, "|/          \\");
+    MvWAddStr(bigdeer3, 9, 5, "/>           \\>");
 
     /* bigdeer4 */
-    mvwaddch(bigdeer4, 0, 17, (chtype) '\\');
-    mvwaddch(bigdeer4, 0, 18, (chtype) '/');
-    mvwaddch(bigdeer4, 0, 20, (chtype) '\\');
-    mvwaddch(bigdeer4, 0, 21, (chtype) '/');
-    mvwaddch(bigdeer4, 1, 18, (chtype) '\\');
-    mvwaddch(bigdeer4, 1, 20, (chtype) '/');
-    mvwaddch(bigdeer4, 2, 19, (chtype) '|');
-    mvwaddch(bigdeer4, 2, 20, (chtype) '_');
-    mvwaddch(bigdeer4, 3, 18, (chtype) '/');
-    mvwaddch(bigdeer4, 3, 19, (chtype) '^');
-    mvwaddch(bigdeer4, 3, 20, (chtype) '0');
-    mvwaddch(bigdeer4, 3, 21, (chtype) '\\');
-    mvwaddch(bigdeer4, 4, 17, (chtype) '/');
-    mvwaddch(bigdeer4, 4, 18, (chtype) '/');
-    mvwaddch(bigdeer4, 4, 19, (chtype) '\\');
-    mvwaddch(bigdeer4, 4, 22, (chtype) '\\');
-    mvwaddstr(bigdeer4, 5, 7, "^~~~~~~~~//  ~~U");
-    mvwaddstr(bigdeer4, 6, 6, "( )______( /");
-    mvwaddstr(bigdeer4, 7, 5, "(/          \\");
-    mvwaddstr(bigdeer4, 8, 0, "v___=             ----^");
+    MvWAddCh(bigdeer4, 0, 17, (chtype) '\\');
+    MvWAddCh(bigdeer4, 0, 18, (chtype) '/');
+    MvWAddCh(bigdeer4, 0, 20, (chtype) '\\');
+    MvWAddCh(bigdeer4, 0, 21, (chtype) '/');
+    MvWAddCh(bigdeer4, 1, 18, (chtype) '\\');
+    MvWAddCh(bigdeer4, 1, 20, (chtype) '/');
+    MvWAddCh(bigdeer4, 2, 19, (chtype) '|');
+    MvWAddCh(bigdeer4, 2, 20, (chtype) '_');
+    MvWAddCh(bigdeer4, 3, 18, (chtype) '/');
+    MvWAddCh(bigdeer4, 3, 19, (chtype) '^');
+    MvWAddCh(bigdeer4, 3, 20, (chtype) '0');
+    MvWAddCh(bigdeer4, 3, 21, (chtype) '\\');
+    MvWAddCh(bigdeer4, 4, 17, (chtype) '/');
+    MvWAddCh(bigdeer4, 4, 18, (chtype) '/');
+    MvWAddCh(bigdeer4, 4, 19, (chtype) '\\');
+    MvWAddCh(bigdeer4, 4, 22, (chtype) '\\');
+    MvWAddStr(bigdeer4, 5, 7, "^~~~~~~~~//  ~~U");
+    MvWAddStr(bigdeer4, 6, 6, "( )______( /");
+    MvWAddStr(bigdeer4, 7, 5, "(/          \\");
+    MvWAddStr(bigdeer4, 8, 0, "v___=             ----^");
 
     /* lookdeer1 */
-    mvwaddstr(lookdeer1, 0, 16, "\\/     \\/");
-    mvwaddstr(lookdeer1, 1, 17, "\\Y/ \\Y/");
-    mvwaddstr(lookdeer1, 2, 19, "\\=/");
-    mvwaddstr(lookdeer1, 3, 17, "^\\o o/^");
-    mvwaddstr(lookdeer1, 4, 17, "//( )");
-    mvwaddstr(lookdeer1, 5, 7, "^~~~~~~~~// \\O/");
-    mvwaddstr(lookdeer1, 6, 7, "( \\_____( /");
-    mvwaddstr(lookdeer1, 7, 8, "( )    /");
-    mvwaddstr(lookdeer1, 8, 9, "\\\\   /");
-    mvwaddstr(lookdeer1, 9, 11, "\\>/>");
+    MvWAddStr(lookdeer1, 0, 16, "\\/     \\/");
+    MvWAddStr(lookdeer1, 1, 17, "\\Y/ \\Y/");
+    MvWAddStr(lookdeer1, 2, 19, "\\=/");
+    MvWAddStr(lookdeer1, 3, 17, "^\\o o/^");
+    MvWAddStr(lookdeer1, 4, 17, "//( )");
+    MvWAddStr(lookdeer1, 5, 7, "^~~~~~~~~// \\O/");
+    MvWAddStr(lookdeer1, 6, 7, "( \\_____( /");
+    MvWAddStr(lookdeer1, 7, 8, "( )    /");
+    MvWAddStr(lookdeer1, 8, 9, "\\\\   /");
+    MvWAddStr(lookdeer1, 9, 11, "\\>/>");
 
     /* lookdeer2 */
-    mvwaddstr(lookdeer2, 0, 16, "\\/     \\/");
-    mvwaddstr(lookdeer2, 1, 17, "\\Y/ \\Y/");
-    mvwaddstr(lookdeer2, 2, 19, "\\=/");
-    mvwaddstr(lookdeer2, 3, 17, "^\\o o/^");
-    mvwaddstr(lookdeer2, 4, 17, "//( )");
-    mvwaddstr(lookdeer2, 5, 7, "^~~~~~~~~// \\O/");
-    mvwaddstr(lookdeer2, 6, 7, "(( )____( /");
-    mvwaddstr(lookdeer2, 7, 7, "( /      |");
-    mvwaddstr(lookdeer2, 8, 8, "\\/      |");
-    mvwaddstr(lookdeer2, 9, 9, "|>     |>");
+    MvWAddStr(lookdeer2, 0, 16, "\\/     \\/");
+    MvWAddStr(lookdeer2, 1, 17, "\\Y/ \\Y/");
+    MvWAddStr(lookdeer2, 2, 19, "\\=/");
+    MvWAddStr(lookdeer2, 3, 17, "^\\o o/^");
+    MvWAddStr(lookdeer2, 4, 17, "//( )");
+    MvWAddStr(lookdeer2, 5, 7, "^~~~~~~~~// \\O/");
+    MvWAddStr(lookdeer2, 6, 7, "(( )____( /");
+    MvWAddStr(lookdeer2, 7, 7, "( /      |");
+    MvWAddStr(lookdeer2, 8, 8, "\\/      |");
+    MvWAddStr(lookdeer2, 9, 9, "|>     |>");
 
     /* lookdeer3 */
-    mvwaddstr(lookdeer3, 0, 16, "\\/     \\/");
-    mvwaddstr(lookdeer3, 1, 17, "\\Y/ \\Y/");
-    mvwaddstr(lookdeer3, 2, 19, "\\=/");
-    mvwaddstr(lookdeer3, 3, 17, "^\\o o/^");
-    mvwaddstr(lookdeer3, 4, 17, "//( )");
-    mvwaddstr(lookdeer3, 5, 7, "^~~~~~~~~// \\O/");
-    mvwaddstr(lookdeer3, 6, 6, "( ()_____( /");
-    mvwaddstr(lookdeer3, 7, 6, "/ /       /");
-    mvwaddstr(lookdeer3, 8, 5, "|/          \\");
-    mvwaddstr(lookdeer3, 9, 5, "/>           \\>");
+    MvWAddStr(lookdeer3, 0, 16, "\\/     \\/");
+    MvWAddStr(lookdeer3, 1, 17, "\\Y/ \\Y/");
+    MvWAddStr(lookdeer3, 2, 19, "\\=/");
+    MvWAddStr(lookdeer3, 3, 17, "^\\o o/^");
+    MvWAddStr(lookdeer3, 4, 17, "//( )");
+    MvWAddStr(lookdeer3, 5, 7, "^~~~~~~~~// \\O/");
+    MvWAddStr(lookdeer3, 6, 6, "( ()_____( /");
+    MvWAddStr(lookdeer3, 7, 6, "/ /       /");
+    MvWAddStr(lookdeer3, 8, 5, "|/          \\");
+    MvWAddStr(lookdeer3, 9, 5, "/>           \\>");
 
     /* lookdeer4 */
-    mvwaddstr(lookdeer4, 0, 16, "\\/     \\/");
-    mvwaddstr(lookdeer4, 1, 17, "\\Y/ \\Y/");
-    mvwaddstr(lookdeer4, 2, 19, "\\=/");
-    mvwaddstr(lookdeer4, 3, 17, "^\\o o/^");
-    mvwaddstr(lookdeer4, 4, 17, "//( )");
-    mvwaddstr(lookdeer4, 5, 7, "^~~~~~~~~// \\O/");
-    mvwaddstr(lookdeer4, 6, 6, "( )______( /");
-    mvwaddstr(lookdeer4, 7, 5, "(/          \\");
-    mvwaddstr(lookdeer4, 8, 0, "v___=             ----^");
+    MvWAddStr(lookdeer4, 0, 16, "\\/     \\/");
+    MvWAddStr(lookdeer4, 1, 17, "\\Y/ \\Y/");
+    MvWAddStr(lookdeer4, 2, 19, "\\=/");
+    MvWAddStr(lookdeer4, 3, 17, "^\\o o/^");
+    MvWAddStr(lookdeer4, 4, 17, "//( )");
+    MvWAddStr(lookdeer4, 5, 7, "^~~~~~~~~// \\O/");
+    MvWAddStr(lookdeer4, 6, 6, "( )______( /");
+    MvWAddStr(lookdeer4, 7, 5, "(/          \\");
+    MvWAddStr(lookdeer4, 8, 0, "v___=             ----^");
 
 	/***********************************************/
     cbreak();
@@ -492,166 +492,166 @@
 	overlay(treescrn, treescrn3);
 
 	/*balls */
-	mvwaddch(treescrn3, 4, 18, ' ');
-	mvwaddch(treescrn3, 7, 6, ' ');
-	mvwaddch(treescrn3, 8, 19, ' ');
-	mvwaddch(treescrn3, 11, 22, ' ');
+	MvWAddCh(treescrn3, 4, 18, ' ');
+	MvWAddCh(treescrn3, 7, 6, ' ');
+	MvWAddCh(treescrn3, 8, 19, ' ');
+	MvWAddCh(treescrn3, 11, 22, ' ');
 
 	/*star */
-	mvwaddch(treescrn3, 0, 12, '*');
+	MvWAddCh(treescrn3, 0, 12, '*');
 
 	/*strng1 */
-	mvwaddch(treescrn3, 3, 11, ' ');
+	MvWAddCh(treescrn3, 3, 11, ' ');
 
 	/*strng2 */
-	mvwaddch(treescrn3, 5, 13, ' ');
-	mvwaddch(treescrn3, 6, 10, ' ');
+	MvWAddCh(treescrn3, 5, 13, ' ');
+	MvWAddCh(treescrn3, 6, 10, ' ');
 
 	/*strng3 */
-	mvwaddch(treescrn3, 7, 16, ' ');
-	mvwaddch(treescrn3, 7, 14, ' ');
+	MvWAddCh(treescrn3, 7, 16, ' ');
+	MvWAddCh(treescrn3, 7, 14, ' ');
 
 	/*strng4 */
-	mvwaddch(treescrn3, 10, 13, ' ');
-	mvwaddch(treescrn3, 10, 10, ' ');
-	mvwaddch(treescrn3, 11, 8, ' ');
+	MvWAddCh(treescrn3, 10, 13, ' ');
+	MvWAddCh(treescrn3, 10, 10, ' ');
+	MvWAddCh(treescrn3, 11, 8, ' ');
 
 	/*strng5 */
-	mvwaddch(treescrn3, 11, 18, ' ');
-	mvwaddch(treescrn3, 12, 13, ' ');
+	MvWAddCh(treescrn3, 11, 18, ' ');
+	MvWAddCh(treescrn3, 12, 13, ' ');
 
 	/* treescrn4 */
 
 	overlay(treescrn, treescrn4);
 
 	/*balls */
-	mvwaddch(treescrn4, 3, 9, ' ');
-	mvwaddch(treescrn4, 4, 16, ' ');
-	mvwaddch(treescrn4, 7, 6, ' ');
-	mvwaddch(treescrn4, 8, 19, ' ');
-	mvwaddch(treescrn4, 11, 2, ' ');
-	mvwaddch(treescrn4, 12, 23, ' ');
+	MvWAddCh(treescrn4, 3, 9, ' ');
+	MvWAddCh(treescrn4, 4, 16, ' ');
+	MvWAddCh(treescrn4, 7, 6, ' ');
+	MvWAddCh(treescrn4, 8, 19, ' ');
+	MvWAddCh(treescrn4, 11, 2, ' ');
+	MvWAddCh(treescrn4, 12, 23, ' ');
 
 	/*star */
-	wstandout(treescrn4);
-	mvwaddch(treescrn4, 0, 12, '*');
-	wstandend(treescrn4);
+	(void) wstandout(treescrn4);
+	MvWAddCh(treescrn4, 0, 12, '*');
+	(void) wstandend(treescrn4);
 
 	/*strng1 */
-	mvwaddch(treescrn4, 3, 13, ' ');
+	MvWAddCh(treescrn4, 3, 13, ' ');
 
 	/*strng2 */
 
 	/*strng3 */
-	mvwaddch(treescrn4, 7, 15, ' ');
-	mvwaddch(treescrn4, 8, 11, ' ');
+	MvWAddCh(treescrn4, 7, 15, ' ');
+	MvWAddCh(treescrn4, 8, 11, ' ');
 
 	/*strng4 */
-	mvwaddch(treescrn4, 9, 16, ' ');
-	mvwaddch(treescrn4, 10, 12, ' ');
-	mvwaddch(treescrn4, 11, 8, ' ');
+	MvWAddCh(treescrn4, 9, 16, ' ');
+	MvWAddCh(treescrn4, 10, 12, ' ');
+	MvWAddCh(treescrn4, 11, 8, ' ');
 
 	/*strng5 */
-	mvwaddch(treescrn4, 11, 18, ' ');
-	mvwaddch(treescrn4, 12, 14, ' ');
+	MvWAddCh(treescrn4, 11, 18, ' ');
+	MvWAddCh(treescrn4, 12, 14, ' ');
 
 	/* treescrn5 */
 
 	overlay(treescrn, treescrn5);
 
 	/*balls */
-	mvwaddch(treescrn5, 3, 15, ' ');
-	mvwaddch(treescrn5, 10, 20, ' ');
-	mvwaddch(treescrn5, 12, 1, ' ');
+	MvWAddCh(treescrn5, 3, 15, ' ');
+	MvWAddCh(treescrn5, 10, 20, ' ');
+	MvWAddCh(treescrn5, 12, 1, ' ');
 
 	/*star */
-	mvwaddch(treescrn5, 0, 12, '*');
+	MvWAddCh(treescrn5, 0, 12, '*');
 
 	/*strng1 */
-	mvwaddch(treescrn5, 3, 11, ' ');
+	MvWAddCh(treescrn5, 3, 11, ' ');
 
 	/*strng2 */
-	mvwaddch(treescrn5, 5, 12, ' ');
+	MvWAddCh(treescrn5, 5, 12, ' ');
 
 	/*strng3 */
-	mvwaddch(treescrn5, 7, 14, ' ');
-	mvwaddch(treescrn5, 8, 10, ' ');
+	MvWAddCh(treescrn5, 7, 14, ' ');
+	MvWAddCh(treescrn5, 8, 10, ' ');
 
 	/*strng4 */
-	mvwaddch(treescrn5, 9, 15, ' ');
-	mvwaddch(treescrn5, 10, 11, ' ');
-	mvwaddch(treescrn5, 11, 7, ' ');
+	MvWAddCh(treescrn5, 9, 15, ' ');
+	MvWAddCh(treescrn5, 10, 11, ' ');
+	MvWAddCh(treescrn5, 11, 7, ' ');
 
 	/*strng5 */
-	mvwaddch(treescrn5, 11, 17, ' ');
-	mvwaddch(treescrn5, 12, 13, ' ');
+	MvWAddCh(treescrn5, 11, 17, ' ');
+	MvWAddCh(treescrn5, 12, 13, ' ');
 
 	/* treescrn6 */
 
 	overlay(treescrn, treescrn6);
 
 	/*balls */
-	mvwaddch(treescrn6, 6, 7, ' ');
-	mvwaddch(treescrn6, 7, 18, ' ');
-	mvwaddch(treescrn6, 10, 4, ' ');
-	mvwaddch(treescrn6, 11, 23, ' ');
+	MvWAddCh(treescrn6, 6, 7, ' ');
+	MvWAddCh(treescrn6, 7, 18, ' ');
+	MvWAddCh(treescrn6, 10, 4, ' ');
+	MvWAddCh(treescrn6, 11, 23, ' ');
 
 	/*star */
-	wstandout(treescrn6);
-	mvwaddch(treescrn6, 0, 12, '*');
-	wstandend(treescrn6);
+	(void) wstandout(treescrn6);
+	MvWAddCh(treescrn6, 0, 12, '*');
+	(void) wstandend(treescrn6);
 
 	/*strng1 */
 
 	/*strng2 */
-	mvwaddch(treescrn6, 5, 11, ' ');
+	MvWAddCh(treescrn6, 5, 11, ' ');
 
 	/*strng3 */
-	mvwaddch(treescrn6, 7, 13, ' ');
-	mvwaddch(treescrn6, 8, 9, ' ');
+	MvWAddCh(treescrn6, 7, 13, ' ');
+	MvWAddCh(treescrn6, 8, 9, ' ');
 
 	/*strng4 */
-	mvwaddch(treescrn6, 9, 14, ' ');
-	mvwaddch(treescrn6, 10, 10, ' ');
-	mvwaddch(treescrn6, 11, 6, ' ');
+	MvWAddCh(treescrn6, 9, 14, ' ');
+	MvWAddCh(treescrn6, 10, 10, ' ');
+	MvWAddCh(treescrn6, 11, 6, ' ');
 
 	/*strng5 */
-	mvwaddch(treescrn6, 11, 16, ' ');
-	mvwaddch(treescrn6, 12, 12, ' ');
+	MvWAddCh(treescrn6, 11, 16, ' ');
+	MvWAddCh(treescrn6, 12, 12, ' ');
 
 	/* treescrn7 */
 
 	overlay(treescrn, treescrn7);
 
 	/*balls */
-	mvwaddch(treescrn7, 3, 15, ' ');
-	mvwaddch(treescrn7, 6, 7, ' ');
-	mvwaddch(treescrn7, 7, 18, ' ');
-	mvwaddch(treescrn7, 10, 4, ' ');
-	mvwaddch(treescrn7, 11, 22, ' ');
+	MvWAddCh(treescrn7, 3, 15, ' ');
+	MvWAddCh(treescrn7, 6, 7, ' ');
+	MvWAddCh(treescrn7, 7, 18, ' ');
+	MvWAddCh(treescrn7, 10, 4, ' ');
+	MvWAddCh(treescrn7, 11, 22, ' ');
 
 	/*star */
-	mvwaddch(treescrn7, 0, 12, '*');
+	MvWAddCh(treescrn7, 0, 12, '*');
 
 	/*strng1 */
-	mvwaddch(treescrn7, 3, 12, ' ');
+	MvWAddCh(treescrn7, 3, 12, ' ');
 
 	/*strng2 */
-	mvwaddch(treescrn7, 5, 13, ' ');
-	mvwaddch(treescrn7, 6, 9, ' ');
+	MvWAddCh(treescrn7, 5, 13, ' ');
+	MvWAddCh(treescrn7, 6, 9, ' ');
 
 	/*strng3 */
-	mvwaddch(treescrn7, 7, 15, ' ');
-	mvwaddch(treescrn7, 8, 11, ' ');
+	MvWAddCh(treescrn7, 7, 15, ' ');
+	MvWAddCh(treescrn7, 8, 11, ' ');
 
 	/*strng4 */
-	mvwaddch(treescrn7, 9, 16, ' ');
-	mvwaddch(treescrn7, 10, 12, ' ');
-	mvwaddch(treescrn7, 11, 8, ' ');
+	MvWAddCh(treescrn7, 9, 16, ' ');
+	MvWAddCh(treescrn7, 10, 12, ' ');
+	MvWAddCh(treescrn7, 11, 8, ' ');
 
 	/*strng5 */
-	mvwaddch(treescrn7, 11, 18, ' ');
-	mvwaddch(treescrn7, 12, 14, ' ');
+	MvWAddCh(treescrn7, 11, 18, ' ');
+	MvWAddCh(treescrn7, 12, 14, ' ');
 
 	look_out(150);
 	reindeer();
@@ -678,21 +678,21 @@
     int x = 0;
 
     while (x < 20) {
-	mvaddch(x, 7, '|');
+	MvAddCh(x, 7, '|');
 	++x;
     }
 
     x = 8;
 
     while (x < 80) {
-	mvaddch(19, x, '_');
+	MvAddCh(19, x, '_');
 	++x;
     }
 
     x = 0;
 
     while (x < 80) {
-	mvaddch(22, x, '_');
+	MvAddCh(22, x, '_');
 	++x;
     }
 
@@ -702,14 +702,14 @@
 static int
 seas(void)
 {
-    mvaddch(4, 1, 'S');
-    mvaddch(6, 1, 'E');
-    mvaddch(8, 1, 'A');
-    mvaddch(10, 1, 'S');
-    mvaddch(12, 1, 'O');
-    mvaddch(14, 1, 'N');
-    mvaddch(16, 1, '`');
-    mvaddch(18, 1, 'S');
+    MvAddCh(4, 1, 'S');
+    MvAddCh(6, 1, 'E');
+    MvAddCh(8, 1, 'A');
+    MvAddCh(10, 1, 'S');
+    MvAddCh(12, 1, 'O');
+    MvAddCh(14, 1, 'N');
+    MvAddCh(16, 1, '`');
+    MvAddCh(18, 1, 'S');
 
     return (0);
 }
@@ -717,15 +717,15 @@
 static int
 greet(void)
 {
-    mvaddch(3, 5, 'G');
-    mvaddch(5, 5, 'R');
-    mvaddch(7, 5, 'E');
-    mvaddch(9, 5, 'E');
-    mvaddch(11, 5, 'T');
-    mvaddch(13, 5, 'I');
-    mvaddch(15, 5, 'N');
-    mvaddch(17, 5, 'G');
-    mvaddch(19, 5, 'S');
+    MvAddCh(3, 5, 'G');
+    MvAddCh(5, 5, 'R');
+    MvAddCh(7, 5, 'E');
+    MvAddCh(9, 5, 'E');
+    MvAddCh(11, 5, 'T');
+    MvAddCh(13, 5, 'I');
+    MvAddCh(15, 5, 'N');
+    MvAddCh(17, 5, 'G');
+    MvAddCh(19, 5, 'S');
 
     return (0);
 }
@@ -733,7 +733,7 @@
 static int
 fromwho(void)
 {
-    mvaddstr(21, 13, FROMWHO);
+    MvAddStr(21, 13, FROMWHO);
     return (0);
 }
 
@@ -741,41 +741,41 @@
 tree(void)
 {
     set_color(treescrn, COLOR_GREEN);
-    mvwaddch(treescrn, 1, 11, (chtype) '/');
-    mvwaddch(treescrn, 2, 11, (chtype) '/');
-    mvwaddch(treescrn, 3, 10, (chtype) '/');
-    mvwaddch(treescrn, 4, 9, (chtype) '/');
-    mvwaddch(treescrn, 5, 9, (chtype) '/');
-    mvwaddch(treescrn, 6, 8, (chtype) '/');
-    mvwaddch(treescrn, 7, 7, (chtype) '/');
-    mvwaddch(treescrn, 8, 6, (chtype) '/');
-    mvwaddch(treescrn, 9, 6, (chtype) '/');
-    mvwaddch(treescrn, 10, 5, (chtype) '/');
-    mvwaddch(treescrn, 11, 3, (chtype) '/');
-    mvwaddch(treescrn, 12, 2, (chtype) '/');
-
-    mvwaddch(treescrn, 1, 13, (chtype) '\\');
-    mvwaddch(treescrn, 2, 13, (chtype) '\\');
-    mvwaddch(treescrn, 3, 14, (chtype) '\\');
-    mvwaddch(treescrn, 4, 15, (chtype) '\\');
-    mvwaddch(treescrn, 5, 15, (chtype) '\\');
-    mvwaddch(treescrn, 6, 16, (chtype) '\\');
-    mvwaddch(treescrn, 7, 17, (chtype) '\\');
-    mvwaddch(treescrn, 8, 18, (chtype) '\\');
-    mvwaddch(treescrn, 9, 18, (chtype) '\\');
-    mvwaddch(treescrn, 10, 19, (chtype) '\\');
-    mvwaddch(treescrn, 11, 21, (chtype) '\\');
-    mvwaddch(treescrn, 12, 22, (chtype) '\\');
-
-    mvwaddch(treescrn, 4, 10, (chtype) '_');
-    mvwaddch(treescrn, 4, 14, (chtype) '_');
-    mvwaddch(treescrn, 8, 7, (chtype) '_');
-    mvwaddch(treescrn, 8, 17, (chtype) '_');
+    MvWAddCh(treescrn, 1, 11, (chtype) '/');
+    MvWAddCh(treescrn, 2, 11, (chtype) '/');
+    MvWAddCh(treescrn, 3, 10, (chtype) '/');
+    MvWAddCh(treescrn, 4, 9, (chtype) '/');
+    MvWAddCh(treescrn, 5, 9, (chtype) '/');
+    MvWAddCh(treescrn, 6, 8, (chtype) '/');
+    MvWAddCh(treescrn, 7, 7, (chtype) '/');
+    MvWAddCh(treescrn, 8, 6, (chtype) '/');
+    MvWAddCh(treescrn, 9, 6, (chtype) '/');
+    MvWAddCh(treescrn, 10, 5, (chtype) '/');
+    MvWAddCh(treescrn, 11, 3, (chtype) '/');
+    MvWAddCh(treescrn, 12, 2, (chtype) '/');
+
+    MvWAddCh(treescrn, 1, 13, (chtype) '\\');
+    MvWAddCh(treescrn, 2, 13, (chtype) '\\');
+    MvWAddCh(treescrn, 3, 14, (chtype) '\\');
+    MvWAddCh(treescrn, 4, 15, (chtype) '\\');
+    MvWAddCh(treescrn, 5, 15, (chtype) '\\');
+    MvWAddCh(treescrn, 6, 16, (chtype) '\\');
+    MvWAddCh(treescrn, 7, 17, (chtype) '\\');
+    MvWAddCh(treescrn, 8, 18, (chtype) '\\');
+    MvWAddCh(treescrn, 9, 18, (chtype) '\\');
+    MvWAddCh(treescrn, 10, 19, (chtype) '\\');
+    MvWAddCh(treescrn, 11, 21, (chtype) '\\');
+    MvWAddCh(treescrn, 12, 22, (chtype) '\\');
+
+    MvWAddCh(treescrn, 4, 10, (chtype) '_');
+    MvWAddCh(treescrn, 4, 14, (chtype) '_');
+    MvWAddCh(treescrn, 8, 7, (chtype) '_');
+    MvWAddCh(treescrn, 8, 17, (chtype) '_');
 
-    mvwaddstr(treescrn, 13, 0, "//////////// \\\\\\\\\\\\\\\\\\\\\\\\");
+    MvWAddStr(treescrn, 13, 0, "//////////// \\\\\\\\\\\\\\\\\\\\\\\\");
 
-    mvwaddstr(treescrn, 14, 11, "| |");
-    mvwaddstr(treescrn, 15, 11, "|_|");
+    MvWAddStr(treescrn, 14, 11, "| |");
+    MvWAddStr(treescrn, 15, 11, "|_|");
 
     unset_color(treescrn);
     wrefresh(treescrn);
@@ -790,22 +790,22 @@
     overlay(treescrn, treescrn2);
 
     set_color(treescrn2, COLOR_BLUE);
-    mvwaddch(treescrn2, 3, 9, (chtype) '@');
-    mvwaddch(treescrn2, 3, 15, (chtype) '@');
-    mvwaddch(treescrn2, 4, 8, (chtype) '@');
-    mvwaddch(treescrn2, 4, 16, (chtype) '@');
-    mvwaddch(treescrn2, 5, 7, (chtype) '@');
-    mvwaddch(treescrn2, 5, 17, (chtype) '@');
-    mvwaddch(treescrn2, 7, 6, (chtype) '@');
-    mvwaddch(treescrn2, 7, 18, (chtype) '@');
-    mvwaddch(treescrn2, 8, 5, (chtype) '@');
-    mvwaddch(treescrn2, 8, 19, (chtype) '@');
-    mvwaddch(treescrn2, 10, 4, (chtype) '@');
-    mvwaddch(treescrn2, 10, 20, (chtype) '@');
-    mvwaddch(treescrn2, 11, 2, (chtype) '@');
-    mvwaddch(treescrn2, 11, 22, (chtype) '@');
-    mvwaddch(treescrn2, 12, 1, (chtype) '@');
-    mvwaddch(treescrn2, 12, 23, (chtype) '@');
+    MvWAddCh(treescrn2, 3, 9, (chtype) '@');
+    MvWAddCh(treescrn2, 3, 15, (chtype) '@');
+    MvWAddCh(treescrn2, 4, 8, (chtype) '@');
+    MvWAddCh(treescrn2, 4, 16, (chtype) '@');
+    MvWAddCh(treescrn2, 5, 7, (chtype) '@');
+    MvWAddCh(treescrn2, 5, 17, (chtype) '@');
+    MvWAddCh(treescrn2, 7, 6, (chtype) '@');
+    MvWAddCh(treescrn2, 7, 18, (chtype) '@');
+    MvWAddCh(treescrn2, 8, 5, (chtype) '@');
+    MvWAddCh(treescrn2, 8, 19, (chtype) '@');
+    MvWAddCh(treescrn2, 10, 4, (chtype) '@');
+    MvWAddCh(treescrn2, 10, 20, (chtype) '@');
+    MvWAddCh(treescrn2, 11, 2, (chtype) '@');
+    MvWAddCh(treescrn2, 11, 22, (chtype) '@');
+    MvWAddCh(treescrn2, 12, 1, (chtype) '@');
+    MvWAddCh(treescrn2, 12, 23, (chtype) '@');
 
     unset_color(treescrn2);
     wrefresh(treescrn2);
@@ -816,11 +816,11 @@
 static int
 star(void)
 {
-    wattrset(treescrn2, A_BOLD | A_BLINK);
+    (void) wattrset(treescrn2, A_BOLD | A_BLINK);
     set_color(treescrn2, COLOR_YELLOW);
 
-    mvwaddch(treescrn2, 0, 12, (chtype) '*');
-    wstandend(treescrn2);
+    MvWAddCh(treescrn2, 0, 12, (chtype) '*');
+    (void) wstandend(treescrn2);
 
     unset_color(treescrn2);
     wrefresh(treescrn2);
@@ -831,12 +831,12 @@
 static int
 strng1(void)
 {
-    wattrset(treescrn2, A_BOLD | A_BLINK);
+    (void) wattrset(treescrn2, A_BOLD | A_BLINK);
     set_color(treescrn2, COLOR_WHITE);
 
-    mvwaddch(treescrn2, 3, 13, (chtype) '\'');
-    mvwaddch(treescrn2, 3, 12, (chtype) ':');
-    mvwaddch(treescrn2, 3, 11, (chtype) '.');
+    MvWAddCh(treescrn2, 3, 13, (chtype) '\'');
+    MvWAddCh(treescrn2, 3, 12, (chtype) ':');
+    MvWAddCh(treescrn2, 3, 11, (chtype) '.');
 
     wattroff(treescrn2, A_BOLD | A_BLINK);
     unset_color(treescrn2);
@@ -849,15 +849,15 @@
 static int
 strng2(void)
 {
-    wattrset(treescrn2, A_BOLD | A_BLINK);
+    (void) wattrset(treescrn2, A_BOLD | A_BLINK);
     set_color(treescrn2, COLOR_WHITE);
 
-    mvwaddch(treescrn2, 5, 14, (chtype) '\'');
-    mvwaddch(treescrn2, 5, 13, (chtype) ':');
-    mvwaddch(treescrn2, 5, 12, (chtype) '.');
-    mvwaddch(treescrn2, 5, 11, (chtype) ',');
-    mvwaddch(treescrn2, 6, 10, (chtype) '\'');
-    mvwaddch(treescrn2, 6, 9, (chtype) ':');
+    MvWAddCh(treescrn2, 5, 14, (chtype) '\'');
+    MvWAddCh(treescrn2, 5, 13, (chtype) ':');
+    MvWAddCh(treescrn2, 5, 12, (chtype) '.');
+    MvWAddCh(treescrn2, 5, 11, (chtype) ',');
+    MvWAddCh(treescrn2, 6, 10, (chtype) '\'');
+    MvWAddCh(treescrn2, 6, 9, (chtype) ':');
 
     wattroff(treescrn2, A_BOLD | A_BLINK);
     unset_color(treescrn2);
@@ -870,17 +870,17 @@
 static int
 strng3(void)
 {
-    wattrset(treescrn2, A_BOLD | A_BLINK);
+    (void) wattrset(treescrn2, A_BOLD | A_BLINK);
     set_color(treescrn2, COLOR_WHITE);
 
-    mvwaddch(treescrn2, 7, 16, (chtype) '\'');
-    mvwaddch(treescrn2, 7, 15, (chtype) ':');
-    mvwaddch(treescrn2, 7, 14, (chtype) '.');
-    mvwaddch(treescrn2, 7, 13, (chtype) ',');
-    mvwaddch(treescrn2, 8, 12, (chtype) '\'');
-    mvwaddch(treescrn2, 8, 11, (chtype) ':');
-    mvwaddch(treescrn2, 8, 10, (chtype) '.');
-    mvwaddch(treescrn2, 8, 9, (chtype) ',');
+    MvWAddCh(treescrn2, 7, 16, (chtype) '\'');
+    MvWAddCh(treescrn2, 7, 15, (chtype) ':');
+    MvWAddCh(treescrn2, 7, 14, (chtype) '.');
+    MvWAddCh(treescrn2, 7, 13, (chtype) ',');
+    MvWAddCh(treescrn2, 8, 12, (chtype) '\'');
+    MvWAddCh(treescrn2, 8, 11, (chtype) ':');
+    MvWAddCh(treescrn2, 8, 10, (chtype) '.');
+    MvWAddCh(treescrn2, 8, 9, (chtype) ',');
 
     wattroff(treescrn2, A_BOLD | A_BLINK);
     unset_color(treescrn2);
@@ -893,22 +893,22 @@
 static int
 strng4(void)
 {
-    wattrset(treescrn2, A_BOLD | A_BLINK);
+    (void) wattrset(treescrn2, A_BOLD | A_BLINK);
     set_color(treescrn2, COLOR_WHITE);
 
-    mvwaddch(treescrn2, 9, 17, (chtype) '\'');
-    mvwaddch(treescrn2, 9, 16, (chtype) ':');
-    mvwaddch(treescrn2, 9, 15, (chtype) '.');
-    mvwaddch(treescrn2, 9, 14, (chtype) ',');
-    mvwaddch(treescrn2, 10, 13, (chtype) '\'');
-    mvwaddch(treescrn2, 10, 12, (chtype) ':');
-    mvwaddch(treescrn2, 10, 11, (chtype) '.');
-    mvwaddch(treescrn2, 10, 10, (chtype) ',');
-    mvwaddch(treescrn2, 11, 9, (chtype) '\'');
-    mvwaddch(treescrn2, 11, 8, (chtype) ':');
-    mvwaddch(treescrn2, 11, 7, (chtype) '.');
-    mvwaddch(treescrn2, 11, 6, (chtype) ',');
-    mvwaddch(treescrn2, 12, 5, (chtype) '\'');
+    MvWAddCh(treescrn2, 9, 17, (chtype) '\'');
+    MvWAddCh(treescrn2, 9, 16, (chtype) ':');
+    MvWAddCh(treescrn2, 9, 15, (chtype) '.');
+    MvWAddCh(treescrn2, 9, 14, (chtype) ',');
+    MvWAddCh(treescrn2, 10, 13, (chtype) '\'');
+    MvWAddCh(treescrn2, 10, 12, (chtype) ':');
+    MvWAddCh(treescrn2, 10, 11, (chtype) '.');
+    MvWAddCh(treescrn2, 10, 10, (chtype) ',');
+    MvWAddCh(treescrn2, 11, 9, (chtype) '\'');
+    MvWAddCh(treescrn2, 11, 8, (chtype) ':');
+    MvWAddCh(treescrn2, 11, 7, (chtype) '.');
+    MvWAddCh(treescrn2, 11, 6, (chtype) ',');
+    MvWAddCh(treescrn2, 12, 5, (chtype) '\'');
 
     wattroff(treescrn2, A_BOLD | A_BLINK);
     unset_color(treescrn2);
@@ -921,17 +921,17 @@
 static int
 strng5(void)
 {
-    wattrset(treescrn2, A_BOLD | A_BLINK);
+    (void) wattrset(treescrn2, A_BOLD | A_BLINK);
     set_color(treescrn2, COLOR_WHITE);
 
-    mvwaddch(treescrn2, 11, 19, (chtype) '\'');
-    mvwaddch(treescrn2, 11, 18, (chtype) ':');
-    mvwaddch(treescrn2, 11, 17, (chtype) '.');
-    mvwaddch(treescrn2, 11, 16, (chtype) ',');
-    mvwaddch(treescrn2, 12, 15, (chtype) '\'');
-    mvwaddch(treescrn2, 12, 14, (chtype) ':');
-    mvwaddch(treescrn2, 12, 13, (chtype) '.');
-    mvwaddch(treescrn2, 12, 12, (chtype) ',');
+    MvWAddCh(treescrn2, 11, 19, (chtype) '\'');
+    MvWAddCh(treescrn2, 11, 18, (chtype) ':');
+    MvWAddCh(treescrn2, 11, 17, (chtype) '.');
+    MvWAddCh(treescrn2, 11, 16, (chtype) ',');
+    MvWAddCh(treescrn2, 12, 15, (chtype) '\'');
+    MvWAddCh(treescrn2, 12, 14, (chtype) ':');
+    MvWAddCh(treescrn2, 12, 13, (chtype) '.');
+    MvWAddCh(treescrn2, 12, 12, (chtype) ',');
 
     wattroff(treescrn2, A_BOLD | A_BLINK);
     unset_color(treescrn2);
@@ -1014,7 +1014,7 @@
 	    y_pos = 1;
 	}
 	for (looper = 0; looper < 4; looper++) {
-	    mvwaddch(dotdeer0, y_pos, x_pos, (chtype) '.');
+	    MvWAddCh(dotdeer0, y_pos, x_pos, (chtype) '.');
 	    wrefresh(dotdeer0);
 	    wrefresh(w_del_msg);
 	    werase(dotdeer0);
@@ -1032,14 +1032,14 @@
 	    if (x_pos < 56) {
 		y_pos = 3;
 
-		mvwaddch(stardeer0, y_pos, x_pos, (chtype) '*');
+		MvWAddCh(stardeer0, y_pos, x_pos, (chtype) '*');
 		wrefresh(stardeer0);
 		wrefresh(w_del_msg);
 		werase(stardeer0);
 		wrefresh(stardeer0);
 		wrefresh(w_del_msg);
 	    } else {
-		mvwaddch(dotdeer0, y_pos, x_pos, (chtype) '*');
+		MvWAddCh(dotdeer0, y_pos, x_pos, (chtype) '*');
 		wrefresh(dotdeer0);
 		wrefresh(w_del_msg);
 		werase(dotdeer0);
diff -Naur ncurses-5.7.orig/test/xterm-256color.dat ncurses-5.7/test/xterm-256color.dat
--- ncurses-5.7.orig/test/xterm-256color.dat	1969-12-31 19:00:00.000000000 -0500
+++ ncurses-5.7/test/xterm-256color.dat	2011-01-08 18:13:50.799157068 -0500
@@ -0,0 +1,293 @@
+##############################################################################
+# Copyright (c) 2009 Free 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: xterm-256color.dat,v 1.1 2009/10/30 22:33:40 tom Exp $
+# This illustrates the predefined colors for xterm's "xterm-256color" feature.
+# If you set $TERM to "xterm-256color" (and have xterm compiled to support the
+# 256-color feature), you can use the ncurses 'd' screen to
+# manipulate the colors shown in the screen.  The 'd' screen is limited to
+# the first 16 colors, and xterm happens to use the same first 16 colors in
+# the extended color models that support initc.
+#
+# The colors shown are for xterm patch #189.
+scale:255
+0:	  0   0   0		black
+1:	205   0	  0		red3
+2:	  0 205	  0		green3
+3:	205 205	  0		yellow3
+4:	 30 144 255		DodgerBlue1
+5:	205   0 205		magenta3
+6:	  0 205 205		cyan3
+7:	229 229 229 		gray90
+8:	127 127 127 		gray50
+9:	255   0   0		red
+10:	  0 255   0		green
+11:	255 255   0		yellow
+12:	 99 184 255		SteelBlue1
+13:	255   0 255		magenta
+14:	  0 255 255		cyan
+15:	255 255 255		white
+16:	  0   0   0
+17:	  0   0  95
+18:	  0   0 135
+19:	  0   0 175
+20:	  0   0 215
+21:	  0   0 255
+22:	  0  95   0
+23:	  0  95	 95
+24:	  0  95 135
+25:	  0  95 175
+26:	  0  95 215
+27:	  0  95 255
+28:	  0 135   0
+29:	  0 135  95
+30:	  0 135 135
+31:	  0 135 175
+32:	  0 135 215
+33:	  0 135 255
+34:	  0 175   0
+35:	  0 175  95
+36:	  0 175 135
+37:	  0 175 175
+38:	  0 175 215
+39:	  0 175 255
+40:	  0 215   0
+41:	  0 215  95
+42:	  0 215 135
+43:	  0 215 175
+44:	  0 215 215
+45:	  0 215 255
+46:	  0 255   0
+47:	  0 255  95
+48:	  0 255 135
+49:	  0 255 175
+50:	  0 255 215
+51:	  0 255 255
+52:	 95   0   0
+53:	 95   0  95
+54:	 95   0 135
+55:	 95   0 175
+56:	 95   0 215
+57:	 95   0 255
+58:	 95  95   0
+59:	 95  95  95
+60:	 95  95 135
+61:	 95  95 175
+62:	 95  95 215
+63:	 95  95 255
+64:	 95 135   0
+65:	 95 135  95
+66:	 95 135 135
+67:	 95 135 175
+68:	 95 135 215
+69:	 95 135 255
+70:	 95 175   0
+71:	 95 175  95
+72:	 95 175 135
+73:	 95 175 175
+74:	 95 175 215
+75:	 95 175 255
+76:	 95 215   0
+77:	 95 215  95
+78:	 95 215 135
+79:	 95 215 175
+80:	 95 215 215
+81:	 95 215 255
+82:	 95 255   0
+83:	 95 255  95
+84:	 95 255 135
+85:	 95 255 175
+86:	 95 255 215
+87:	 95 255 255
+88:	135   0   0
+89:	135   0  95
+90:	135   0 135
+91:	135   0 175
+92:	135   0 215
+93:	135   0 255
+94:	135  95   0
+95:	135  95  95
+96:	135  95 135
+97:	135  95 175
+98:	135  95 215
+99:	135  95 255
+100:	135 135   0
+101:	135 135  95
+102:	135 135 135
+103:	135 135 175
+104:	135 135 215
+105:	135 135 255
+106:	135 175   0
+107:	135 175  95
+108:	135 175 135
+109:	135 175 175
+110:	135 175 215
+111:	135 175 255
+112:	135 215   0
+113:	135 215  95
+114:	135 215 135
+115:	135 215 175
+116:	135 215 215
+117:	135 215 255
+118:	135 255   0
+119:	135 255  95
+120:	135 255 135
+121:	135 255 175
+122:	135 255 215
+123:	135 255 255
+124:	175   0   0
+125:	175   0  95
+126:	175   0 135
+127:	175   0 175
+128:	175   0 215
+129:	175   0 255
+130:	175  95   0
+131:	175  95  95
+132:	175  95 135
+133:	175  95 175
+134:	175  95 215
+135:	175  95 255
+136:	175 135   0
+137:	175 135  95
+138:	175 135 135
+139:	175 135 175
+140:	175 135 215
+141:	175 135 255
+142:	175 175   0
+143:	175 175  95
+144:	175 175 135
+145:	175 175 175
+146:	175 175 215
+147:	175 175 255
+148:	175 215   0
+149:	175 215  95
+150:	175 215 135
+151:	175 215 175
+152:	175 215 215
+153:	175 215 255
+154:	175 255   0
+155:	175 255  95
+156:	175 255 135
+157:	175 255 175
+158:	175 255 215
+159:	175 255 255
+160:	215   0   0
+161:	215   0  95
+162:	215   0 135
+163:	215   0 175
+164:	215   0 215
+165:	215   0 255
+166:	215  95   0
+167:	215  95  95
+168:	215  95 135
+169:	215  95 175
+170:	215  95 215
+171:	215  95 255
+172:	215 135   0
+173:	215 135  95
+174:	215 135 135
+175:	215 135 175
+176:	215 135 215
+177:	215 135 255
+178:	215 175   0
+179:	215 175  95
+180:	215 175 135
+181:	215 175 175
+182:	215 175 215
+183:	215 175 255
+184:	215 215   0
+185:	215 215  95
+186:	215 215 135
+187:	215 215 175
+188:	215 215 215
+189:	215 215 255
+190:	215 255   0
+191:	215 255  95
+192:	215 255 135
+193:	215 255 175
+194:	215 255 215
+195:	215 255 255
+196:	255   0   0
+197:	255   0  95
+198:	255   0 135
+199:	255   0 175
+200:	255   0 215
+201:	255   0 255
+202:	255  95   0
+203:	255  95  95
+204:	255  95 135
+205:	255  95 175
+206:	255  95 215
+207:	255  95 255
+208:	255 135   0
+209:	255 135  95
+210:	255 135 135
+211:	255 135 175
+212:	255 135 215
+213:	255 135 255
+214:	255 175   0
+215:	255 175  95
+216:	255 175 135
+217:	255 175 175
+218:	255 175 215
+219:	255 175 255
+220:	255 215   0
+221:	255 215  95
+222:	255 215 135
+223:	255 215 175
+224:	255 215 215
+225:	255 215 255
+226:	255 255   0
+227:	255 255  95
+228:	255 255 135
+229:	255 255 175
+230:	255 255 215
+231:	255 255 255
+232:	  8   8   8
+233:	 18  18  18
+234:	 28  28  28
+235:	 38  38  38
+236:	 48  48  48
+237:	 58  58  58
+238:	 68  68  68
+239:	 78  78  78
+240:	 88  88  88
+241:	 98  98  98
+242:	108 108 108
+243:	118 118 118
+244:	128 128 128
+245:	138 138 138
+246:	148 148 148
+247:	158 158 158
+248:	168 168 168
+249:	178 178 178
+250:	188 188 188
+251:	198 198 198
+252:	208 208 208
+253:	218 218 218
+254:	228 228 228
+255:	238 238 238
diff -Naur ncurses-5.7.orig/test/xterm-88color.dat ncurses-5.7/test/xterm-88color.dat
--- ncurses-5.7.orig/test/xterm-88color.dat	2006-04-22 17:40:00.000000000 -0400
+++ ncurses-5.7/test/xterm-88color.dat	2011-01-08 18:13:50.799157068 -0500
@@ -1,5 +1,5 @@
 ##############################################################################
-# Copyright (c) 2005,2006 Free Software Foundation, Inc.                     #
+# Copyright (c) 2005-2006,2009 Free 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,8 +25,8 @@
 # use or other dealings in this Software without prior written               #
 # authorization.                                                             #
 ##############################################################################
-# $Id: xterm-88color.dat,v 1.2 2006/04/22 21:40:00 tom Exp $
-# This illustrates the predefined colors for XFree86 xterm's "xterm-16color". 
+# $Id: xterm-88color.dat,v 1.3 2009/10/30 22:33:56 tom Exp $
+# This illustrates the predefined colors for xterm's "xterm-88color" feature.
 # If you set $TERM to "xterm-88color" (and have xterm compiled to support the
 # 88-color or 256-color feature), you can use the ncurses 'd' screen to
 # manipulate the colors shown in the screen.  The 'd' screen is limited to
