From 91e802b0dd5f97879f57d12e9dd758e59ab8abb8 Mon Sep 17 00:00:00 2001 From: "Thomas E. Dickey" Date: Sun, 28 Jun 2015 01:06:27 +0000 Subject: [PATCH] ncurses 6.0 - patch 20150627 + modify configure script to remove deprecated ABI 5 symbols when building ABI 6. + add symbols _nc_Default_Field, _nc_Default_Form, _nc_has_mouse to map-files, but marked as deprecated so that they can easily be suppressed from ABI 6 builds (Debian #788610). + comment-out "screen.xterm" entry, and inherit screen.xterm-256color from xterm-new (report by Richard Birkett) -TD + modify read_entry.c to set the error-return to -1 if no terminal databases were found, as documented for setupterm. + add test_setupterm.c to demonstrate normal/error returns from the setupterm and restartterm functions. + amend cleanup change from 20110813 which removed redundant definition of ret_error, etc., from tinfo_driver.c, to account for the fact that it should return a bool rather than int (report/analysis by Johannes Schindelin). --- MANIFEST | 1 + NEWS | 19 ++- VERSION | 2 +- aclocal.m4 | 5 +- configure | 48 +++---- configure.in | 12 +- dist.mk | 4 +- misc/terminfo.src | 14 ++- ncurses/base/lib_restart.c | 6 +- ncurses/curses.priv.h | 9 +- ncurses/tinfo/lib_setup.c | 5 +- ncurses/tinfo/read_entry.c | 5 +- ncurses/tinfo/tinfo_driver.c | 10 +- package/debian-mingw/changelog | 4 +- package/debian-mingw64/changelog | 4 +- package/debian/changelog | 4 +- package/mingw-ncurses.nsi | 4 +- package/mingw-ncurses.spec | 2 +- package/ncurses.map | 8 +- package/ncurses.spec | 2 +- package/ncurses.sym | 7 +- package/ncursest.map | 8 +- package/ncursest.sym | 7 +- package/ncursestw.map | 8 +- package/ncursestw.sym | 7 +- package/ncursesw.map | 8 +- package/ncursesw.sym | 7 +- test/README | 15 +-- test/modules | 5 +- test/programs | 5 +- test/test_setupterm.c | 210 +++++++++++++++++++++++++++++++ 31 files changed, 349 insertions(+), 106 deletions(-) create mode 100644 test/test_setupterm.c diff --git a/MANIFEST b/MANIFEST index 5d6b1865..5ffc508a 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1160,6 +1160,7 @@ ./test/test_instr.c ./test/test_inwstr.c ./test/test_opaque.c +./test/test_setupterm.c ./test/test_vid_puts.c ./test/test_vidputs.c ./test/testaddch.c diff --git a/NEWS b/NEWS index b489609b..8f50430a 100644 --- a/NEWS +++ b/NEWS @@ -25,7 +25,7 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------- --- $Id: NEWS,v 1.2441 2015/06/14 01:13:38 tom Exp $ +-- $Id: NEWS,v 1.2448 2015/06/27 23:12:23 tom Exp $ ------------------------------------------------------------------------------- This is a log of changes that ncurses has gone through since Zeyd started @@ -45,6 +45,23 @@ See the AUTHORS file for the corresponding full names. Changes through 1.9.9e did not credit all contributions; it is not possible to add this information. +20150627 + + modify configure script to remove deprecated ABI 5 symbols when + building ABI 6. + + add symbols _nc_Default_Field, _nc_Default_Form, _nc_has_mouse to + map-files, but marked as deprecated so that they can easily be + suppressed from ABI 6 builds (Debian #788610). + + comment-out "screen.xterm" entry, and inherit screen.xterm-256color + from xterm-new (report by Richard Birkett) -TD + + modify read_entry.c to set the error-return to -1 if no terminal + databases were found, as documented for setupterm. + + add test_setupterm.c to demonstrate normal/error returns from the + setupterm and restartterm functions. + + amend cleanup change from 20110813 which removed redundant definition + of ret_error, etc., from tinfo_driver.c, to account for the fact that + it should return a bool rather than int (report/analysis by Johannes + Schindelin). + 20150613 + fix overflow warning for OSX with lib_baudrate.c (cf: 20010630). + modify script used to generate map/sym files to mark 5.9.20150530 as diff --git a/VERSION b/VERSION index 875b64d3..dc1c3ea9 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -5:0:9 6.0 20150613 +5:0:9 6.0 20150627 diff --git a/aclocal.m4 b/aclocal.m4 index c886b205..c7b9e24e 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -28,7 +28,7 @@ dnl*************************************************************************** dnl dnl Author: Thomas E. Dickey 1995-on dnl -dnl $Id: aclocal.m4,v 1.758 2015/06/06 23:27:44 tom Exp $ +dnl $Id: aclocal.m4,v 1.759 2015/06/27 23:10:38 tom Exp $ dnl Macros used in NCURSES auto-configuration script. dnl dnl These macros are maintained separately from NCURSES. The copyright on @@ -3228,7 +3228,7 @@ ifelse($1,,,[$1=$LIB_PREFIX]) AC_SUBST(LIB_PREFIX) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_LIB_RULES version: 81 updated: 2015/04/30 20:30:18 +dnl CF_LIB_RULES version: 82 updated: 2015/06/27 19:09:23 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 @@ -3285,6 +3285,7 @@ do if test -n "${cf_cv_abi_version}" && test "x${cf_cv_abi_version}" != "x5" then cf_sed_options="$cf_sed_options -e \"s/NCURSES\\([[WT]]\\+\\)\?_/NCURSES\\1${cf_cv_abi_version}_/g\"" + cf_sed_options="$cf_sed_options -e \"/deprecated in ABI${cf_cv_abi_version}/d\"" fi if test "x$WILDCARD_SYMS" = xno diff --git a/configure b/configure index d21f33af..ecf0f449 100755 --- a/configure +++ b/configure @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Revision: 1.617 . +# From configure.in Revision: 1.618 . # Guess values for system-dependent variables and create Makefiles. # Generated by Autoconf 2.52.20141204. # @@ -22275,19 +22275,10 @@ cf_filter_syms=no if test -n "$RESULTING_SYMS" then cf_filter_syms=$cf_dft_filter_syms - if test "$cf_filter_syms" = yes - then - test -n "$verbose" && echo " will map symbols to ABI=$cf_cv_abi_version" 1>&6 - -echo "${as_me:-configure}:22282: testing will map symbols to ABI=$cf_cv_abi_version ..." 1>&5 + test -n "$verbose" && echo " will map symbols to ABI=$cf_cv_abi_version" 1>&6 - cf_filter_syms=yes - else - test -n "$verbose" && echo " will map symbols to default ABI" 1>&6 +echo "${as_me:-configure}:22280: testing will map symbols to ABI=$cf_cv_abi_version ..." 1>&5 -echo "${as_me:-configure}:22288: testing will map symbols to default ABI ..." 1>&5 - - fi fi if test "x$WILDCARD_SYMS" = xno @@ -22388,7 +22379,7 @@ 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:22391: creating $CONFIG_STATUS" >&5 +{ echo "$as_me:22382: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL @@ -22564,7 +22555,7 @@ cat >>$CONFIG_STATUS <<\EOF echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header - { { echo "$as_me:22567: error: ambiguous option: $1 + { { echo "$as_me:22558: 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;} @@ -22583,7 +22574,7 @@ Try \`$0 --help' for more information." >&2;} ac_need_defaults=false;; # This is an error. - -*) { { echo "$as_me:22586: error: unrecognized option: $1 + -*) { { echo "$as_me:22577: 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;} @@ -22701,7 +22692,7 @@ do "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:22704: error: invalid argument: $ac_config_target" >&5 + *) { { echo "$as_me:22695: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac @@ -23156,7 +23147,7 @@ done; } esac if test x"$ac_file" != x-; then - { echo "$as_me:23159: creating $ac_file" >&5 + { echo "$as_me:23150: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi @@ -23174,7 +23165,7 @@ echo "$as_me: creating $ac_file" >&6;} -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:23177: error: cannot find input file: $f" >&5 + test -f "$f" || { { echo "$as_me:23168: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo $f;; @@ -23187,7 +23178,7 @@ echo "$as_me: error: cannot find input file: $f" >&2;} echo $srcdir/$f else # /dev/null tree - { { echo "$as_me:23190: error: cannot find input file: $f" >&5 + { { echo "$as_me:23181: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; @@ -23203,7 +23194,7 @@ cat >>$CONFIG_STATUS <<\EOF if test -n "$ac_seen"; then ac_used=`grep '@datarootdir@' $ac_item` if test -z "$ac_used"; then - { echo "$as_me:23206: WARNING: datarootdir was used implicitly but not set: + { echo "$as_me:23197: WARNING: datarootdir was used implicitly but not set: $ac_seen" >&5 echo "$as_me: WARNING: datarootdir was used implicitly but not set: $ac_seen" >&2;} @@ -23212,7 +23203,7 @@ $ac_seen" >&2;} fi ac_seen=`grep '${datarootdir}' $ac_item` if test -n "$ac_seen"; then - { echo "$as_me:23215: WARNING: datarootdir was used explicitly but not set: + { echo "$as_me:23206: WARNING: datarootdir was used explicitly but not set: $ac_seen" >&5 echo "$as_me: WARNING: datarootdir was used explicitly but not set: $ac_seen" >&2;} @@ -23249,7 +23240,7 @@ s,@INSTALL@,$ac_INSTALL,;t t ac_init=`egrep '[ ]*'$ac_name'[ ]*=' $ac_file` if test -z "$ac_init"; then ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'` - { echo "$as_me:23252: WARNING: Variable $ac_name is used but was not set: + { echo "$as_me:23243: WARNING: Variable $ac_name is used but was not set: $ac_seen" >&5 echo "$as_me: WARNING: Variable $ac_name is used but was not set: $ac_seen" >&2;} @@ -23260,7 +23251,7 @@ $ac_seen" >&2;} egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out if test -s $tmp/out; then ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out` - { echo "$as_me:23263: WARNING: Some variables may not be substituted: + { echo "$as_me:23254: WARNING: Some variables may not be substituted: $ac_seen" >&5 echo "$as_me: WARNING: Some variables may not be substituted: $ac_seen" >&2;} @@ -23309,7 +23300,7 @@ for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue * ) ac_file_in=$ac_file.in ;; esac - test x"$ac_file" != x- && { echo "$as_me:23312: creating $ac_file" >&5 + test x"$ac_file" != x- && { echo "$as_me:23303: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} # First look for the input files in the build tree, otherwise in the @@ -23320,7 +23311,7 @@ echo "$as_me: creating $ac_file" >&6;} -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:23323: error: cannot find input file: $f" >&5 + test -f "$f" || { { echo "$as_me:23314: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo $f;; @@ -23333,7 +23324,7 @@ echo "$as_me: error: cannot find input file: $f" >&2;} echo $srcdir/$f else # /dev/null tree - { { echo "$as_me:23336: error: cannot find input file: $f" >&5 + { { echo "$as_me:23327: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; @@ -23391,7 +23382,7 @@ cat >>$CONFIG_STATUS <<\EOF 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:23394: $ac_file is unchanged" >&5 + { echo "$as_me:23385: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ @@ -23494,6 +23485,7 @@ do if test -n "${cf_cv_abi_version}" && test "x${cf_cv_abi_version}" != "x5" then cf_sed_options="$cf_sed_options -e \"s/NCURSES\\([WT]\\+\\)\?_/NCURSES\\1${cf_cv_abi_version}_/g\"" + cf_sed_options="$cf_sed_options -e \"/deprecated in ABI${cf_cv_abi_version}/d\"" fi if test "x$WILDCARD_SYMS" = xno @@ -23728,7 +23720,7 @@ cf_ITEM=`echo "$cf_item" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQ (cygdll|msysdll|mingw) test "x$with_shared_cxx" = xno && test -n "$verbose" && echo " overriding CXX_MODEL to SHARED" 1>&6 -echo "${as_me:-configure}:23731: testing overriding CXX_MODEL to SHARED ..." 1>&5 +echo "${as_me:-configure}:23723: testing overriding CXX_MODEL to SHARED ..." 1>&5 with_shared_cxx=yes ;; diff --git a/configure.in b/configure.in index 00c44791..24181b94 100644 --- a/configure.in +++ b/configure.in @@ -28,14 +28,14 @@ dnl*************************************************************************** dnl dnl Author: Thomas E. Dickey 1995-on dnl -dnl $Id: configure.in,v 1.617 2015/06/06 21:29:03 tom Exp $ +dnl $Id: configure.in,v 1.618 2015/06/27 22:59:56 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.52.20030208) -AC_REVISION($Revision: 1.617 $) +AC_REVISION($Revision: 1.618 $) AC_INIT(ncurses/base/lib_initscr.c) AC_CONFIG_HEADER(include/ncurses_cfg.h:include/ncurses_cfg.hin) @@ -2160,13 +2160,7 @@ cf_filter_syms=no if test -n "$RESULTING_SYMS" then cf_filter_syms=$cf_dft_filter_syms - if test "$cf_filter_syms" = yes - then - CF_VERBOSE(will map symbols to ABI=$cf_cv_abi_version) - cf_filter_syms=yes - else - CF_VERBOSE(will map symbols to default ABI) - fi + CF_VERBOSE(will map symbols to ABI=$cf_cv_abi_version) fi if test "x$WILDCARD_SYMS" = xno diff --git a/dist.mk b/dist.mk index 2baa62a9..e6ed1c68 100644 --- a/dist.mk +++ b/dist.mk @@ -25,7 +25,7 @@ # use or other dealings in this Software without prior written # # authorization. # ############################################################################## -# $Id: dist.mk,v 1.1056 2015/06/13 10:39:10 tom Exp $ +# $Id: dist.mk,v 1.1057 2015/06/26 08:39:24 tom Exp $ # Makefile for creating ncurses distributions. # # This only needs to be used directly as a makefile by developers, but @@ -37,7 +37,7 @@ SHELL = /bin/sh # These define the major/minor/patch versions of ncurses. NCURSES_MAJOR = 6 NCURSES_MINOR = 0 -NCURSES_PATCH = 20150613 +NCURSES_PATCH = 20150627 # We don't append the patch to the version, since this only applies to releases VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR) diff --git a/misc/terminfo.src b/misc/terminfo.src index 6f2a41eb..c96aa0d6 100644 --- a/misc/terminfo.src +++ b/misc/terminfo.src @@ -6,8 +6,8 @@ # Report bugs and new terminal descriptions to # bug-ncurses@gnu.org # -# $Revision: 1.545 $ -# $Date: 2015/05/30 20:30:55 $ +# $Revision: 1.546 $ +# $Date: 2015/06/27 18:57:21 $ # # 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 @@ -6013,7 +6013,7 @@ screen-256color-bce-s|GNU Screen with 256 colors using BCE and status line, bce, use=xterm+256setaf, use=screen-s, screen.xterm-256color|GNU Screen with xterm using 256 colors, - use=xterm+256setaf, use=screen.xterm, + use=xterm+256setaf, use=screen.xterm-new, screen.konsole-256color|GNU Screen with konsole using 256 colors, use=xterm+256setaf, use=screen.konsole, @@ -6071,8 +6071,8 @@ screen.xterm-xfree86|screen.xterm-new|screen customized for modern xterm, invis@, kIC@, kNXT@, kPRV@, meml@, memu@, sgr=%?%p9%t\E(0%e\E(B%;\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;%?%p5%t;2%;m, E3@, use=screen+italics, use=screen+fkeys, use=xterm-new, -screen.xterm|screen for modern xterm, - use=screen.xterm-new, +#:screen.xterm|screen for modern xterm, +#: use=screen.xterm-new, # xterm-r6 does not really support khome/kend unless it is propped up by # the translations resource. screen.xterm-r6|screen customized for X11R6 xterm, @@ -23689,4 +23689,8 @@ v3220|LANPAR Vision II model 3220/3221/3222, # + remove spurious "%;" from st entry (report by Daniel Pitts) -TD # + add vte-2014, update vte to use that -TD # +# 2015-6-27 +# + comment-out "screen.xterm" entry, and inherit screen.xterm-256color +# from xterm-new (report by Richard Birkett) -TD +# ######## SHANTIH! SHANTIH! SHANTIH! diff --git a/ncurses/base/lib_restart.c b/ncurses/base/lib_restart.c index 3a3756e3..5bfb0788 100644 --- a/ncurses/base/lib_restart.c +++ b/ncurses/base/lib_restart.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2011,2012 Free Software Foundation, Inc. * + * Copyright (c) 1998-2012,2015 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -41,7 +41,7 @@ #include -MODULE_ID("$Id: lib_restart.c,v 1.15 2012/12/08 20:40:06 tom Exp $") +MODULE_ID("$Id: lib_restart.c,v 1.16 2015/06/27 18:12:15 tom Exp $") NCURSES_EXPORT(int) NCURSES_SP_NAME(restartterm) (NCURSES_SP_DCLx @@ -54,6 +54,7 @@ NCURSES_SP_NAME(restartterm) (NCURSES_SP_DCLx TERMINAL *new_term = 0; #endif + START_TRACE(); T((T_CALLED("restartterm(%p,%s,%d,%p)"), (void *) SP_PARM, termp, @@ -110,6 +111,7 @@ NCURSES_SP_NAME(restartterm) (NCURSES_SP_DCLx NCURSES_EXPORT(int) restartterm(NCURSES_CONST char *termp, int filenum, int *errret) { + START_TRACE(); return NCURSES_SP_NAME(restartterm) (CURRENT_SCREEN, termp, filenum, errret); } #endif diff --git a/ncurses/curses.priv.h b/ncurses/curses.priv.h index 66d15944..ec17d884 100644 --- a/ncurses/curses.priv.h +++ b/ncurses/curses.priv.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2013,2014 Free Software Foundation, Inc. * + * Copyright (c) 1998-2014,2015 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -34,7 +34,7 @@ ****************************************************************************/ /* - * $Id: curses.priv.h,v 1.546 2014/11/01 13:52:34 tom Exp $ + * $Id: curses.priv.h,v 1.547 2015/06/27 01:22:16 tom Exp $ * * curses.priv.h * @@ -1947,9 +1947,10 @@ extern NCURSES_EXPORT(void) _nc_tinfo_cmdch(TERMINAL *, int); extern NCURSES_EXPORT(int) _nc_ripoffline(int, int(*)(WINDOW*, int)); /* lib_setup.c */ +#define SETUP_FAIL ERR #define ret_error(code, fmt, arg) if (errret) {\ *errret = code;\ - returnCode(ERR);\ + returnCode(SETUP_FAIL);\ } else {\ fprintf(stderr, fmt, arg);\ exit(EXIT_FAILURE);\ @@ -1959,7 +1960,7 @@ extern NCURSES_EXPORT(int) _nc_ripoffline(int, int(*)(WINDOW*, int)); #define ret_error0(code, msg) if (errret) {\ *errret = code;\ - returnCode(ERR);\ + returnCode(SETUP_FAIL);\ } else {\ fprintf(stderr, msg);\ exit(EXIT_FAILURE);\ diff --git a/ncurses/tinfo/lib_setup.c b/ncurses/tinfo/lib_setup.c index b0acc7ba..0a0a1f5b 100644 --- a/ncurses/tinfo/lib_setup.c +++ b/ncurses/tinfo/lib_setup.c @@ -48,7 +48,7 @@ #include #endif -MODULE_ID("$Id: lib_setup.c,v 1.162 2015/05/17 17:15:03 tom Exp $") +MODULE_ID("$Id: lib_setup.c,v 1.164 2015/06/27 18:10:55 tom Exp $") /**************************************************************************** * @@ -706,7 +706,7 @@ TINFO_SETUP_TERM(TERMINAL ** tp, termp->Filedes = (short) Filedes; termp->_termname = strdup(tname); } else { - ret_error0(TGETENT_ERR, + ret_error0(errret ? *errret : TGETENT_ERR, "Could not find any driver to handle this terminal.\n"); } #else @@ -865,5 +865,6 @@ _nc_setupterm(NCURSES_CONST char *tname, NCURSES_EXPORT(int) setupterm(NCURSES_CONST char *tname, int Filedes, int *errret) { + START_TRACE(); return _nc_setupterm(tname, Filedes, errret, FALSE); } diff --git a/ncurses/tinfo/read_entry.c b/ncurses/tinfo/read_entry.c index e5c26b5f..81fdc46c 100644 --- a/ncurses/tinfo/read_entry.c +++ b/ncurses/tinfo/read_entry.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2013,2014 Free Software Foundation, Inc. * + * Copyright (c) 1998-2014,2015 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -41,7 +41,7 @@ #include -MODULE_ID("$Id: read_entry.c,v 1.128 2014/06/14 22:30:41 tom Exp $") +MODULE_ID("$Id: read_entry.c,v 1.129 2015/06/27 16:16:40 tom Exp $") #define TYPE_CALLOC(type,elts) typeCalloc(type, (unsigned)(elts)) @@ -626,6 +626,7 @@ _nc_read_entry(const char *const name, char *const filename, TERMTYPE *const tp) const char *path; _nc_first_db(&state, &offset); + code = TGETENT_ERR; while ((path = _nc_next_db(&state, &offset)) != 0) { TR(TRACE_DATABASE, ("_nc_read_tic_entry path=%s, name=%s", path, name)); code = _nc_read_tic_entry(filename, PATH_MAX, path, name, tp); diff --git a/ncurses/tinfo/tinfo_driver.c b/ncurses/tinfo/tinfo_driver.c index a17accd3..c6a1c22b 100644 --- a/ncurses/tinfo/tinfo_driver.c +++ b/ncurses/tinfo/tinfo_driver.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2008-2013,2014 Free Software Foundation, Inc. * + * Copyright (c) 2008-2014,2015 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -50,7 +50,7 @@ # endif #endif -MODULE_ID("$Id: tinfo_driver.c,v 1.39 2014/09/27 21:58:57 tom Exp $") +MODULE_ID("$Id: tinfo_driver.c,v 1.40 2015/06/27 01:20:41 tom Exp $") /* * SCO defines TIOCGSIZE and the corresponding struct. Other systems (SunOS, @@ -113,6 +113,9 @@ drv_Name(TERMINAL_CONTROL_BLOCK * TCB) return "tinfo"; } +#undef SETUP_FAIL +#define SETUP_FAIL FALSE + static bool drv_CanHandle(TERMINAL_CONTROL_BLOCK * TCB, const char *tname, int *errret) { @@ -121,6 +124,7 @@ drv_CanHandle(TERMINAL_CONTROL_BLOCK * TCB, const char *tname, int *errret) TERMINAL *termp; SCREEN *sp; + START_TRACE(); T((T_CALLED("tinfo::drv_CanHandle(%p)"), TCB)); assert(TCB != 0 && tname != 0); @@ -1186,7 +1190,7 @@ drv_read(TERMINAL_CONTROL_BLOCK * TCB, int *buf) if ((pthread_self) && (pthread_kill) && (pthread_equal)) _nc_globals.read_thread = pthread_self(); # endif - n = read(sp->_ifd, &c2, (size_t) 1); + n = (int) read(sp->_ifd, &c2, (size_t) 1); #if USE_PTHREADS_EINTR _nc_globals.read_thread = 0; #endif diff --git a/package/debian-mingw/changelog b/package/debian-mingw/changelog index bb9aa4d8..0ba6056f 100644 --- a/package/debian-mingw/changelog +++ b/package/debian-mingw/changelog @@ -1,8 +1,8 @@ -ncurses6 (6.0+20150613) unstable; urgency=low +ncurses6 (6.0+20150627) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Sat, 13 Jun 2015 06:39:10 -0400 + -- Thomas E. Dickey Fri, 26 Jun 2015 04:39:24 -0400 ncurses6 (5.9-20131005) unstable; urgency=low diff --git a/package/debian-mingw64/changelog b/package/debian-mingw64/changelog index bb9aa4d8..0ba6056f 100644 --- a/package/debian-mingw64/changelog +++ b/package/debian-mingw64/changelog @@ -1,8 +1,8 @@ -ncurses6 (6.0+20150613) unstable; urgency=low +ncurses6 (6.0+20150627) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Sat, 13 Jun 2015 06:39:10 -0400 + -- Thomas E. Dickey Fri, 26 Jun 2015 04:39:24 -0400 ncurses6 (5.9-20131005) unstable; urgency=low diff --git a/package/debian/changelog b/package/debian/changelog index d346773e..a9db3e2d 100644 --- a/package/debian/changelog +++ b/package/debian/changelog @@ -1,8 +1,8 @@ -ncurses6 (6.0+20150613) unstable; urgency=low +ncurses6 (6.0+20150627) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Sat, 13 Jun 2015 06:39:10 -0400 + -- Thomas E. Dickey Fri, 26 Jun 2015 04:39:24 -0400 ncurses6 (5.9-20120608) unstable; urgency=low diff --git a/package/mingw-ncurses.nsi b/package/mingw-ncurses.nsi index 4320e8cd..a4475178 100644 --- a/package/mingw-ncurses.nsi +++ b/package/mingw-ncurses.nsi @@ -1,4 +1,4 @@ -; $Id: mingw-ncurses.nsi,v 1.109 2015/06/13 10:39:10 tom Exp $ +; $Id: mingw-ncurses.nsi,v 1.110 2015/06/26 08:39:24 tom Exp $ ; TODO add examples ; TODO bump ABI to 6 @@ -10,7 +10,7 @@ !define VERSION_MAJOR "6" !define VERSION_MINOR "0" !define VERSION_YYYY "2015" -!define VERSION_MMDD "0613" +!define VERSION_MMDD "0627" !define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD} !define MY_ABI "5" diff --git a/package/mingw-ncurses.spec b/package/mingw-ncurses.spec index 6756acb0..60a5a1aa 100644 --- a/package/mingw-ncurses.spec +++ b/package/mingw-ncurses.spec @@ -3,7 +3,7 @@ Summary: shared libraries for terminal handling Name: mingw32-ncurses6 Version: 6.0 -Release: 20150613 +Release: 20150627 License: X11 Group: Development/Libraries Source: ncurses-%{version}-%{release}.tgz diff --git a/package/ncurses.map b/package/ncurses.map index 99e0fecc..a59484f8 100644 --- a/package/ncurses.map +++ b/package/ncurses.map @@ -1,4 +1,4 @@ -# $Id: ncurses.map,v 1.33 2015/06/13 21:23:49 tom Exp $ +# $Id: ncurses.map,v 1.34 2015/06/27 22:28:50 tom Exp $ # script for shared library symbol-versioning using ld # # This file was generated by ncu-mapsyms @@ -73,7 +73,10 @@ NCURSES_5.0.19991023 { TYPE_IPV4; TYPE_NUMERIC; TYPE_REGEXP; + _nc_Default_Field; # deprecated in ABI6 + _nc_Default_Form; # deprecated in ABI6 _nc_free_and_exit; + _nc_has_mouse; # deprecated in ABI6 _nc_panelhook; _nc_ripoffline; addch; @@ -470,9 +473,7 @@ NCURSES_5.0.19991023 { _nc_Connect_Items; _nc_Copy_Argument; _nc_Copy_Type; - _nc_Default_Field; _nc_Default_FieldType; - _nc_Default_Form; _nc_Default_Item; _nc_Default_Menu; _nc_Disconnect_Items; @@ -497,7 +498,6 @@ NCURSES_5.0.19991023 { _nc_do_color; _nc_expanded; _nc_freewin; - _nc_has_mouse; _nc_hash_map; _nc_lib_traceatr; _nc_lib_tracedmp; diff --git a/package/ncurses.spec b/package/ncurses.spec index 3f6e7df1..323aaeb4 100644 --- a/package/ncurses.spec +++ b/package/ncurses.spec @@ -1,7 +1,7 @@ Summary: shared libraries for terminal handling Name: ncurses6 Version: 6.0 -Release: 20150613 +Release: 20150627 License: X11 Group: Development/Libraries Source: ncurses-%{version}-%{release}.tgz diff --git a/package/ncurses.sym b/package/ncurses.sym index 6124a059..1e2cbf8c 100644 --- a/package/ncurses.sym +++ b/package/ncurses.sym @@ -1,4 +1,4 @@ -# $Id: ncurses.sym,v 1.22 2015/06/13 21:04:35 tom Exp $ +# $Id: ncurses.sym,v 1.23 2015/06/27 22:30:44 tom Exp $ # script for shared library symbol-visibility using libtool # # This file was generated by ncu-mapsyms @@ -51,7 +51,7 @@ # --disable-getcap --disable-leaks --disable-root-environ --disable-termcap --enable-hard-tabs --enable-sp-funcs --with-termlib --with-trace # --disable-getcap --disable-leaks --disable-root-environ --disable-termcap --enable-hard-tabs --enable-wgetch-events --with-hashed-db --with-termlib --with-ticlib --with-trace # --disable-getcap --disable-leaks --disable-root-environ --disable-termcap --enable-hard-tabs --with-broken_linker --with-termlib --with-ticlib --with-trace -# Configure options (6.0.20150606) +# Configure options (6.0.current) # --disable-getcap --disable-leaks --disable-root-environ --disable-termcap --enable-getcap --enable-getcap-cache --enable-hard-tabs --enable-termcap --with-termlib --with-trace # --disable-getcap --disable-leaks --disable-root-environ --disable-termcap --enable-hard-tabs --enable-interop --with-termlib --with-trace # --disable-getcap --disable-leaks --disable-root-environ --disable-termcap --enable-hard-tabs --enable-sp-funcs --with-broken_linker --with-hashed-db --with-termlib --with-trace @@ -77,6 +77,8 @@ TYPE_IPV4 TYPE_NUMERIC TYPE_REGEXP UP +_nc_Default_Field +_nc_Default_Form _nc_access _nc_add_to_try _nc_align_termtype @@ -128,6 +130,7 @@ _nc_get_type _nc_getenv_num _nc_globals _nc_handle_sigwinch +_nc_has_mouse _nc_head _nc_home_terminfo _nc_info_hash_table diff --git a/package/ncursest.map b/package/ncursest.map index 4b50c78b..eabdf028 100644 --- a/package/ncursest.map +++ b/package/ncursest.map @@ -1,4 +1,4 @@ -# $Id: ncursest.map,v 1.28 2015/06/13 22:19:28 tom Exp $ +# $Id: ncursest.map,v 1.29 2015/06/27 22:23:14 tom Exp $ # script for shared library symbol-versioning using ld # # This file was generated by ncu-mapsyms @@ -472,8 +472,11 @@ NCURSEST_5.7.20081102 { TYPE_REGEXP; _nc_COLORS; _nc_COLOR_PAIRS; + _nc_Default_Field; # deprecated in ABI6 + _nc_Default_Form; # deprecated in ABI6 _nc_ESCDELAY; _nc_free_and_exit; + _nc_has_mouse; # deprecated in ABI6 _nc_optimize_enable; _nc_panelhook; _nc_ripoffline; @@ -903,9 +906,7 @@ NCURSEST_5.7.20081102 { _nc_Connect_Items; _nc_Copy_Argument; _nc_Copy_Type; - _nc_Default_Field; _nc_Default_FieldType; - _nc_Default_Form; _nc_Default_Item; _nc_Default_Menu; _nc_Disconnect_Items; @@ -935,7 +936,6 @@ NCURSEST_5.7.20081102 { _nc_expanded; _nc_fifo_dump; _nc_freewin; - _nc_has_mouse; _nc_hash_map; _nc_insert_ch; _nc_linedump; diff --git a/package/ncursest.sym b/package/ncursest.sym index 73498ef3..498f07a1 100644 --- a/package/ncursest.sym +++ b/package/ncursest.sym @@ -1,4 +1,4 @@ -# $Id: ncursest.sym,v 1.23 2015/06/13 21:13:29 tom Exp $ +# $Id: ncursest.sym,v 1.24 2015/06/27 22:30:00 tom Exp $ # script for shared library symbol-visibility using libtool # # This file was generated by ncu-mapsyms @@ -35,7 +35,7 @@ # --disable-getcap --disable-leaks --disable-root-environ --disable-termcap --enable-hard-tabs --enable-sp-funcs --enable-weak-symbols --with-pthread --with-termlib --with-trace # --disable-getcap --disable-leaks --disable-root-environ --disable-termcap --enable-hard-tabs --enable-weak-symbols --enable-wgetch-events --with-hashed-db --with-pthread --with-termlib --with-ticlib --with-trace # --disable-getcap --disable-leaks --disable-root-environ --disable-termcap --enable-hard-tabs --enable-weak-symbols --with-broken_linker --with-pthread --with-termlib --with-ticlib --with-trace -# Configure options (6.0.20150606) +# Configure options (6.0.current) # --disable-getcap --disable-leaks --disable-root-environ --disable-termcap --enable-getcap --enable-getcap-cache --enable-hard-tabs --enable-termcap --enable-weak-symbols --with-pthread --with-termlib --with-trace # --disable-getcap --disable-leaks --disable-root-environ --disable-termcap --enable-hard-tabs --enable-interop --enable-weak-symbols --with-pthread --with-termlib --with-trace # --disable-getcap --disable-leaks --disable-root-environ --disable-termcap --enable-hard-tabs --enable-reentrant --enable-sp-funcs --enable-weak-symbols --with-pthread --with-termlib --with-trace @@ -60,6 +60,8 @@ UP _nc_COLORS _nc_COLOR_PAIRS _nc_COLS +_nc_Default_Field +_nc_Default_Form _nc_ESCDELAY _nc_LINES _nc_TABSIZE @@ -118,6 +120,7 @@ _nc_get_type _nc_getenv_num _nc_globals _nc_handle_sigwinch +_nc_has_mouse _nc_head _nc_home_terminfo _nc_infotocap diff --git a/package/ncursestw.map b/package/ncursestw.map index 7ddcbfe1..a2be0f7a 100644 --- a/package/ncursestw.map +++ b/package/ncursestw.map @@ -1,4 +1,4 @@ -# $Id: ncursestw.map,v 1.29 2015/06/13 22:17:50 tom Exp $ +# $Id: ncursestw.map,v 1.30 2015/06/27 22:27:57 tom Exp $ # script for shared library symbol-versioning using ld # # This file was generated by ncu-mapsyms @@ -478,8 +478,11 @@ NCURSESTW_5.7.20081102 { TYPE_REGEXP; _nc_COLORS; _nc_COLOR_PAIRS; + _nc_Default_Field; # deprecated in ABI6 + _nc_Default_Form; # deprecated in ABI6 _nc_ESCDELAY; _nc_free_and_exit; + _nc_has_mouse; # deprecated in ABI6 _nc_optimize_enable; _nc_panelhook; _nc_ripoffline; @@ -1008,9 +1011,7 @@ NCURSESTW_5.7.20081102 { _nc_Connect_Items; _nc_Copy_Argument; _nc_Copy_Type; - _nc_Default_Field; _nc_Default_FieldType; - _nc_Default_Form; _nc_Default_Item; _nc_Default_Menu; _nc_Disconnect_Items; @@ -1042,7 +1043,6 @@ NCURSESTW_5.7.20081102 { _nc_expanded; _nc_fifo_dump; _nc_freewin; - _nc_has_mouse; _nc_hash_map; _nc_init_wacs; _nc_insert_ch; diff --git a/package/ncursestw.sym b/package/ncursestw.sym index d0f5fbb5..717ca864 100644 --- a/package/ncursestw.sym +++ b/package/ncursestw.sym @@ -1,4 +1,4 @@ -# $Id: ncursestw.sym,v 1.21 2015/06/13 21:18:19 tom Exp $ +# $Id: ncursestw.sym,v 1.22 2015/06/27 22:29:28 tom Exp $ # script for shared library symbol-visibility using libtool # # This file was generated by ncu-mapsyms @@ -35,7 +35,7 @@ # --disable-getcap --disable-leaks --disable-root-environ --disable-termcap --enable-hard-tabs --enable-sp-funcs --enable-weak-symbols --enable-widec --with-pthread --with-termlib --with-trace # --disable-getcap --disable-leaks --disable-root-environ --disable-termcap --enable-hard-tabs --enable-weak-symbols --enable-wgetch-events --enable-widec --with-hashed-db --with-pthread --with-termlib --with-ticlib --with-trace # --disable-getcap --disable-leaks --disable-root-environ --disable-termcap --enable-hard-tabs --enable-weak-symbols --enable-widec --with-broken_linker --with-pthread --with-termlib --with-ticlib --with-trace -# Configure options (6.0.20150606) +# Configure options (6.0.current) # --disable-getcap --disable-leaks --disable-root-environ --disable-termcap --enable-getcap --enable-getcap-cache --enable-hard-tabs --enable-termcap --enable-weak-symbols --enable-widec --with-pthread --with-termlib --with-trace # --disable-getcap --disable-leaks --disable-root-environ --disable-termcap --enable-hard-tabs --enable-interop --enable-weak-symbols --enable-widec --with-pthread --with-termlib --with-trace # --disable-getcap --disable-leaks --disable-root-environ --disable-termcap --enable-hard-tabs --enable-reentrant --enable-sp-funcs --enable-weak-symbols --enable-widec --with-pthread --with-termlib --with-trace @@ -60,6 +60,8 @@ UP _nc_COLORS _nc_COLOR_PAIRS _nc_COLS +_nc_Default_Field +_nc_Default_Form _nc_ESCDELAY _nc_LINES _nc_TABSIZE @@ -118,6 +120,7 @@ _nc_get_type _nc_getenv_num _nc_globals _nc_handle_sigwinch +_nc_has_mouse _nc_head _nc_home_terminfo _nc_infotocap diff --git a/package/ncursesw.map b/package/ncursesw.map index f126b680..d18776e8 100644 --- a/package/ncursesw.map +++ b/package/ncursesw.map @@ -1,4 +1,4 @@ -# $Id: ncursesw.map,v 1.35 2015/06/13 23:07:40 tom Exp $ +# $Id: ncursesw.map,v 1.36 2015/06/27 22:26:52 tom Exp $ # script for shared library symbol-versioning using ld # # This file was generated by ncu-mapsyms @@ -476,7 +476,10 @@ NCURSESW_5.1.20000708 { TYPE_IPV4; TYPE_NUMERIC; TYPE_REGEXP; + _nc_Default_Field; # deprecated in ABI6 + _nc_Default_Form; # deprecated in ABI6 _nc_free_and_exit; + _nc_has_mouse; # deprecated in ABI6 _nc_panelhook; _nc_ripoffline; addch; @@ -877,9 +880,7 @@ NCURSESW_5.1.20000708 { _nc_Connect_Items; _nc_Copy_Argument; _nc_Copy_Type; - _nc_Default_Field; _nc_Default_FieldType; - _nc_Default_Form; _nc_Default_Item; _nc_Default_Menu; _nc_Disconnect_Items; @@ -904,7 +905,6 @@ NCURSESW_5.1.20000708 { _nc_do_color; _nc_expanded; _nc_freewin; - _nc_has_mouse; _nc_hash_map; _nc_make_oldhash; _nc_makenew; diff --git a/package/ncursesw.sym b/package/ncursesw.sym index 96756bd1..dfeba4f5 100644 --- a/package/ncursesw.sym +++ b/package/ncursesw.sym @@ -1,4 +1,4 @@ -# $Id: ncursesw.sym,v 1.23 2015/06/13 21:09:14 tom Exp $ +# $Id: ncursesw.sym,v 1.24 2015/06/27 22:30:29 tom Exp $ # script for shared library symbol-visibility using libtool # # This file was generated by ncu-mapsyms @@ -46,7 +46,7 @@ # --disable-getcap --disable-leaks --disable-root-environ --disable-termcap --enable-hard-tabs --enable-sp-funcs --enable-widec --with-termlib --with-trace # --disable-getcap --disable-leaks --disable-root-environ --disable-termcap --enable-hard-tabs --enable-wgetch-events --enable-widec --with-hashed-db --with-termlib --with-ticlib --with-trace # --disable-getcap --disable-leaks --disable-root-environ --disable-termcap --enable-hard-tabs --enable-widec --with-broken_linker --with-termlib --with-ticlib --with-trace -# Configure options (6.0.20150606) +# Configure options (6.0.current) # --disable-getcap --disable-leaks --disable-root-environ --disable-termcap --enable-getcap --enable-getcap-cache --enable-hard-tabs --enable-termcap --enable-widec --with-termlib --with-trace # --disable-getcap --disable-leaks --disable-root-environ --disable-termcap --enable-hard-tabs --enable-interop --enable-widec --with-termlib --with-trace # --disable-getcap --disable-leaks --disable-root-environ --disable-termcap --enable-hard-tabs --enable-sp-funcs --enable-widec --with-broken_linker --with-hashed-db --with-termlib --with-trace @@ -72,6 +72,8 @@ TYPE_IPV4 TYPE_NUMERIC TYPE_REGEXP UP +_nc_Default_Field +_nc_Default_Form _nc_access _nc_add_to_try _nc_align_termtype @@ -124,6 +126,7 @@ _nc_get_type _nc_getenv_num _nc_globals _nc_handle_sigwinch +_nc_has_mouse _nc_head _nc_home_terminfo _nc_info_hash_table diff --git a/test/README b/test/README index 91727d28..2043506f 100644 --- a/test/README +++ b/test/README @@ -25,7 +25,7 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------- --- $Id: README,v 1.50 2015/05/02 20:47:29 tom Exp $ +-- $Id: README,v 1.51 2015/06/27 19:41:39 tom Exp $ ------------------------------------------------------------------------------- The programs in this directory are used to test and demonstrate ncurses. @@ -73,6 +73,7 @@ to list the options. These programs provide examples of use, but do not comprise a complete set of tests. Here is a list of library externals, noting those that are used: + libform: ------- TYPE_ALNUM test: demo_forms @@ -525,7 +526,7 @@ 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 +newterm test: demo_altkeys ditto dots_mvcur filter foldkeys gdc key_names keynames test_setupterm 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 savescreen 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 @@ -569,7 +570,7 @@ redrawwin test: redraw view refresh test: blue bs demo_defkey demo_forms demo_keyok demo_menus demo_panels dots_curses echochar filter firstlast form_driver_w 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 test: bs filter savescreen test_setupterm reset_shell_mode_sp lib: ncurses resetty - resetty_sp - @@ -577,7 +578,7 @@ resize_term test: view resize_term_sp - resizeterm - resizeterm_sp lib: ncurses -restartterm - +restartterm test: test_setupterm restartterm_sp - ripoffline test: demo_menus ncurses ripoffline_sp - @@ -603,7 +604,7 @@ set_tabsize_sp - set_term lib: ncurses setcchar test: demo_panels ins_wide ncurses test_add_wchstr test_addwstr view setscrreg test: view -setupterm test: demo_terminfo dots test_vid_puts test_vidputs progs: clear tabs tput tset +setupterm test: demo_terminfo dots test_setupterm test_vid_puts test_vidputs progs: clear tabs tput tset slk_attr - slk_attr_off - slk_attr_on - @@ -701,11 +702,11 @@ use_window test: rain worm vid_attr test: test_vid_puts vid_attr_sp - vid_puts test: test_vid_puts -vid_puts_sp - +vid_puts_sp lib: ncurses vidattr test: test_vidputs vidattr_sp - vidputs test: test_vidputs -vidputs_sp lib: ncurses +vidputs_sp - vline test: gdc ncurses vline_set - vw_printw test: clip_printw diff --git a/test/modules b/test/modules index b1ee5a07..e255c286 100644 --- a/test/modules +++ b/test/modules @@ -1,6 +1,6 @@ -# $Id: modules,v 1.51 2014/06/21 15:28:46 tom Exp $ +# $Id: modules,v 1.52 2015/06/27 10:40:27 tom Exp $ ############################################################################## -# Copyright (c) 1998-2013,2014 Free Software Foundation, Inc. # +# Copyright (c) 1998-2014,2015 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # # copy of this software and associated documentation files (the "Software"), # @@ -89,6 +89,7 @@ test_getstr progs $(srcdir) $(HEADER_DEPS) test_instr progs $(srcdir) $(HEADER_DEPS) test_inwstr progs $(srcdir) $(HEADER_DEPS) test_opaque progs $(srcdir) $(HEADER_DEPS) +test_setupterm progs $(srcdir) $(HEADER_DEPS) test_vid_puts progs $(srcdir) $(HEADER_DEPS) test_vidputs progs $(srcdir) $(HEADER_DEPS) testaddch progs $(srcdir) $(HEADER_DEPS) diff --git a/test/programs b/test/programs index 1110ce5b..94765e2b 100644 --- a/test/programs +++ b/test/programs @@ -1,6 +1,6 @@ -# $Id: programs,v 1.25 2014/06/21 15:28:49 tom Exp $ +# $Id: programs,v 1.26 2015/06/27 10:40:53 tom Exp $ ############################################################################## -# Copyright (c) 2006-2013,2014 Free Software Foundation, Inc. # +# Copyright (c) 2006-2014,2015 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # # copy of this software and associated documentation files (the "Software"), # @@ -86,6 +86,7 @@ test_getstr $(LDFLAGS_CURSES) $(LOCAL_LIBS) test_getstr test_instr $(LDFLAGS_CURSES) $(LOCAL_LIBS) test_instr test_inwstr $(LDFLAGS_CURSES) $(LOCAL_LIBS) test_inwstr test_opaque $(LDFLAGS_CURSES) $(LOCAL_LIBS) test_opaque +test_setupterm $(LDFLAGS_CURSES) $(LOCAL_LIBS) test_setupterm test_vid_puts $(LDFLAGS_CURSES) $(LOCAL_LIBS) test_vid_puts test_vidputs $(LDFLAGS_CURSES) $(LOCAL_LIBS) test_vidputs testaddch $(LDFLAGS_CURSES) $(LOCAL_LIBS) testaddch diff --git a/test/test_setupterm.c b/test/test_setupterm.c new file mode 100644 index 00000000..6d7e0e29 --- /dev/null +++ b/test/test_setupterm.c @@ -0,0 +1,210 @@ +/**************************************************************************** + * Copyright (c) 2015 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not be used in advertising or otherwise to promote the * + * sale, use or other dealings in this Software without prior written * + * authorization. * + ****************************************************************************/ + +/* + * Author: Thomas E. Dickey + * + * $Id: test_setupterm.c,v 1.8 2015/06/28 00:53:46 tom Exp $ + * + * A simple demo of setupterm/restartterm. + */ +#include + +#if HAVE_TIGETSTR + +static bool a_opt = FALSE; +static bool f_opt = FALSE; +static bool n_opt = FALSE; +static bool r_opt = FALSE; + +static void +test_rc(NCURSES_CONST char *name, int actual_rc, int actual_err) +{ + int expect_rc = -1; + int expect_err = -1; + + if (name == 0) + name = getenv("TERM"); + if (name == 0) + name = "?"; + + switch (*name) { + case 'v': /* vt100 is normal */ + case 'd': /* dumb has no special flags */ + expect_rc = 0; + expect_err = 1; + break; + case 'l': /* lpr is hardcopy */ + expect_err = 1; + break; + case 'u': /* unknown is generic */ + expect_err = 0; + break; + default: + break; + } + if (n_opt) { + expect_rc = -1; + expect_err = -1; + } + printf("%s", + ((actual_rc == expect_rc && actual_err == expect_err) + ? "OK" + : "ERR")); + printf(" '%s'", name); + if (actual_rc == expect_rc) { + printf(" rc=%d", actual_rc); + } else { + printf(" rc=%d (%d)", actual_rc, expect_rc); + } + if (actual_err == expect_err) { + printf(" err=%d", actual_err); + } else { + printf(" err=%d (%d)", actual_err, expect_err); + } + printf("\n"); +} + +static void +test_setupterm(NCURSES_CONST char *name) +{ + int rc; + int err = -99; + + if (r_opt) { + rc = restartterm(name, 0, f_opt ? NULL : &err); + } else { + rc = setupterm(name, 0, f_opt ? NULL : &err); + } + test_rc(name, rc, err); +} + +static void +usage(void) +{ + static const char *msg[] = + { + "Usage: test_setupterm [options] [terminal]", + "", + "Demonstrate error-checking for setupterm and restartterm.", + "", + "Options:", + " -a automatic test for each success/error code", + " -f treat errors as fatal", + " -n set environment to disable terminfo database, assuming", + " the compiled-in paths for database also fail", + " -r test restartterm rather than setupterm", + }; + 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; + + while ((n = getopt(argc, argv, "afnr")) != -1) { + switch (n) { + case 'a': + a_opt = TRUE; + break; + case 'f': + f_opt = TRUE; + break; + case 'n': + n_opt = TRUE; + break; + case 'r': + r_opt = TRUE; + break; + default: + usage(); + break; + } + } + + if (n_opt) { + static char none[][25] = + { + "HOME=/GUI", + "TERMINFO=/GUI", + "TERMINFO_DIRS=/GUI" + }; + /* + * We can turn this off, but not on again, because ncurses caches the + * directory locations. + */ + printf("** without database\n"); + for (n = 0; n < 3; ++n) + putenv(none[n]); + } else { + printf("** with database\n"); + } + + /* + * The restartterm relies on an existing screen, so we make one here. + */ + if (r_opt) { + newterm("ansi", stdout, stdin); + reset_shell_mode(); + } + + if (a_opt) { + static char predef[][9] = + {"vt100", "dumb", "lpr", "unknown", "none-such"}; + if (optind < argc) { + usage(); + } + for (n = 0; n < 4; ++n) { + test_setupterm(predef[n]); + } + } else { + if (optind < argc) { + for (n = optind; n < argc; ++n) { + test_setupterm(argv[n]); + } + } else { + test_setupterm(NULL); + } + } + + ExitProgram(EXIT_SUCCESS); +} + +#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 */ -- 2.45.0