From: Thomas E. Dickey Date: Sun, 1 Oct 2017 01:37:33 +0000 (+0000) Subject: ncurses 6.0 - patch 20170930 X-Git-Tag: v6.1~17 X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=commitdiff_plain;h=12b49d3c56a6130feb2d39fbe2d6c1bc0838f0fa ncurses 6.0 - patch 20170930 + fix a symbol conflict that made ncurses.c C/c menu not work with Solaris xpg4 curses. + add refresh() call to dots_mvcur.c, needed to use mvcur() with Solaris xpg4 curses after calling newterm(). + minor fixes for configure script from work on ncurses-examples and tin. + improve animation in test/xmas.c by adding a time-delay in blinkit(). + modify several test programs to reflect that ncurses honors existing signal handlers in initscr(), while other implementations do not. + modify bs.c to make it easier to quit. + change ncurses-examples to use attr_t vs chtype to follow X/Open documentation more closely since Solaris xpg4-curses uses different values for WA_xxx vs A_xxx that rely on attr_t being an unsigned short. Tru64 aka OSF1, HPUX, AIX did as ncurses does, equating the two sets. --- diff --git a/Ada95/aclocal.m4 b/Ada95/aclocal.m4 index 908be31e..d86b9ec5 100644 --- a/Ada95/aclocal.m4 +++ b/Ada95/aclocal.m4 @@ -28,7 +28,7 @@ dnl*************************************************************************** dnl dnl Author: Thomas E. Dickey dnl -dnl $Id: aclocal.m4,v 1.119 2017/08/12 12:08:48 tom Exp $ +dnl $Id: aclocal.m4,v 1.120 2017/09/30 19:48:36 tom Exp $ dnl Macros used in NCURSES Ada95 auto-configuration script. dnl dnl These macros are maintained separately from NCURSES. The copyright on @@ -524,7 +524,7 @@ AC_SUBST(BUILD_EXEEXT) AC_SUBST(BUILD_OBJEXT) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_CC_ENV_FLAGS version: 7 updated: 2017/02/25 18:57:40 +dnl CF_CC_ENV_FLAGS version: 8 updated: 2017/09/23 08:50:24 dnl --------------- dnl Check for user's environment-breakage by stuffing CFLAGS/CPPFLAGS content dnl into CC. This will not help with broken scripts that wrap the compiler @@ -548,7 +548,7 @@ case "$CC" in AC_MSG_WARN(your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options) # humor him... cf_prog=`echo "$CC" | sed -e 's/ / /g' -e 's/[[ ]]* / /g' -e 's/[[ ]]*[[ ]]-[[^ ]].*//'` - cf_flags=`echo "$CC" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", substr([$]0,1+length(prog))); }'` + cf_flags=`echo "$CC" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", [substr]([$]0,1+length(prog))); }'` CC="$cf_prog" for cf_arg in $cf_flags do diff --git a/NEWS b/NEWS index eee1184d..0dd7fc94 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.2955 2017/09/23 15:13:23 tom Exp $ +-- $Id: NEWS,v 1.2961 2017/09/30 23:18:33 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. +20170930 + + fix a symbol conflict that made ncurses.c C/c menu not work with + Solaris xpg4 curses. + + add refresh() call to dots_mvcur.c, needed to use mvcur() with + Solaris xpg4 curses after calling newterm(). + + minor fixes for configure script from work on ncurses-examples and + tin. + + improve animation in test/xmas.c by adding a time-delay in blinkit(). + + modify several test programs to reflect that ncurses honors existing + signal handlers in initscr(), while other implementations do not. + + modify bs.c to make it easier to quit. + + change ncurses-examples to use attr_t vs chtype to follow X/Open + documentation more closely since Solaris xpg4-curses uses different + values for WA_xxx vs A_xxx that rely on attr_t being an unsigned + short. Tru64 aka OSF1, HPUX, AIX did as ncurses does, equating the + two sets. + 20170923 + modify menu for test/ncurses.c to fit on 24-line screen. + build-fix for configure --with-caps=uwin diff --git a/VERSION b/VERSION index 85c480aa..83d476af 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -5:0:9 6.0 20170923 +5:0:9 6.0 20170930 diff --git a/aclocal.m4 b/aclocal.m4 index 43498989..770e5b28 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.811 2017/08/12 12:06:16 tom Exp $ +dnl $Id: aclocal.m4,v 1.812 2017/09/30 19:44:51 tom Exp $ dnl Macros used in NCURSES auto-configuration script. dnl dnl These macros are maintained separately from NCURSES. The copyright on @@ -727,7 +727,7 @@ AC_SUBST(BUILD_EXEEXT) AC_SUBST(BUILD_OBJEXT) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_CC_ENV_FLAGS version: 7 updated: 2017/02/25 18:57:40 +dnl CF_CC_ENV_FLAGS version: 8 updated: 2017/09/23 08:50:24 dnl --------------- dnl Check for user's environment-breakage by stuffing CFLAGS/CPPFLAGS content dnl into CC. This will not help with broken scripts that wrap the compiler @@ -751,7 +751,7 @@ case "$CC" in AC_MSG_WARN(your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options) # humor him... cf_prog=`echo "$CC" | sed -e 's/ / /g' -e 's/[[ ]]* / /g' -e 's/[[ ]]*[[ ]]-[[^ ]].*//'` - cf_flags=`echo "$CC" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", substr([$]0,1+length(prog))); }'` + cf_flags=`echo "$CC" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", [substr]([$]0,1+length(prog))); }'` CC="$cf_prog" for cf_arg in $cf_flags do diff --git a/dist.mk b/dist.mk index ce58b097..edb5da81 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.1184 2017/09/19 23:16:48 tom Exp $ +# $Id: dist.mk,v 1.1185 2017/09/28 08:10:00 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 = 20170923 +NCURSES_PATCH = 20170930 # We don't append the patch to the version, since this only applies to releases VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR) diff --git a/include/ncurses_defs b/include/ncurses_defs index 26f76460..66995015 100644 --- a/include/ncurses_defs +++ b/include/ncurses_defs @@ -1,4 +1,4 @@ -# $Id: ncurses_defs,v 1.80 2017/09/04 15:01:23 tom Exp $ +# $Id: ncurses_defs,v 1.81 2017/09/29 23:56:38 tom Exp $ ############################################################################## # Copyright (c) 2000-2016,2017 Free Software Foundation, Inc. # # # @@ -54,6 +54,7 @@ HAVE_COLOR_CONTENT 1 HAVE_COLOR_SET 1 HAVE_COPYWIN 1 HAVE_CURSCR 1 +HAVE_CURSES_DATA_TTYTYPE 1 HAVE_DERWIN 1 HAVE_DIRENT_H HAVE_DUPWIN 1 diff --git a/package/debian-mingw/changelog b/package/debian-mingw/changelog index 741abb2c..dd792386 100644 --- a/package/debian-mingw/changelog +++ b/package/debian-mingw/changelog @@ -1,8 +1,8 @@ -ncurses6 (6.0+20170923) unstable; urgency=low +ncurses6 (6.0+20170930) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Tue, 19 Sep 2017 19:16:48 -0400 + -- Thomas E. Dickey Thu, 28 Sep 2017 04:10:01 -0400 ncurses6 (5.9-20131005) unstable; urgency=low diff --git a/package/debian-mingw64/changelog b/package/debian-mingw64/changelog index 741abb2c..dd792386 100644 --- a/package/debian-mingw64/changelog +++ b/package/debian-mingw64/changelog @@ -1,8 +1,8 @@ -ncurses6 (6.0+20170923) unstable; urgency=low +ncurses6 (6.0+20170930) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Tue, 19 Sep 2017 19:16:48 -0400 + -- Thomas E. Dickey Thu, 28 Sep 2017 04:10:01 -0400 ncurses6 (5.9-20131005) unstable; urgency=low diff --git a/package/debian/changelog b/package/debian/changelog index e86faee9..d65c240c 100644 --- a/package/debian/changelog +++ b/package/debian/changelog @@ -1,8 +1,8 @@ -ncurses6 (6.0+20170923) unstable; urgency=low +ncurses6 (6.0+20170930) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Tue, 19 Sep 2017 19:16:48 -0400 + -- Thomas E. Dickey Thu, 28 Sep 2017 04:10:01 -0400 ncurses6 (5.9-20120608) unstable; urgency=low diff --git a/package/mingw-ncurses.nsi b/package/mingw-ncurses.nsi index 379de832..2a3747d8 100644 --- a/package/mingw-ncurses.nsi +++ b/package/mingw-ncurses.nsi @@ -1,4 +1,4 @@ -; $Id: mingw-ncurses.nsi,v 1.232 2017/09/19 23:16:48 tom Exp $ +; $Id: mingw-ncurses.nsi,v 1.233 2017/09/28 08:10:00 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 "2017" -!define VERSION_MMDD "0923" +!define VERSION_MMDD "0930" !define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD} !define MY_ABI "5" diff --git a/package/mingw-ncurses.spec b/package/mingw-ncurses.spec index 94993dc3..01bc163f 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: 20170923 +Release: 20170930 License: X11 Group: Development/Libraries Source: ncurses-%{version}-%{release}.tgz diff --git a/package/ncurses.spec b/package/ncurses.spec index 65e1f37b..97079f60 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: 20170923 +Release: 20170930 License: X11 Group: Development/Libraries Source: ncurses-%{version}-%{release}.tgz diff --git a/test/aclocal.m4 b/test/aclocal.m4 index 814f030b..304da8fa 100644 --- a/test/aclocal.m4 +++ b/test/aclocal.m4 @@ -26,7 +26,7 @@ dnl sale, use or other dealings in this Software without prior written * dnl authorization. * dnl*************************************************************************** dnl -dnl $Id: aclocal.m4,v 1.144 2017/09/07 21:08:12 tom Exp $ +dnl $Id: aclocal.m4,v 1.146 2017/09/30 19:41:21 tom Exp $ dnl dnl Author: Thomas E. Dickey dnl @@ -386,7 +386,7 @@ ifelse([$3],,[ :]dnl ])dnl ])])dnl dnl --------------------------------------------------------------------------- -dnl CF_CC_ENV_FLAGS version: 7 updated: 2017/02/25 18:57:40 +dnl CF_CC_ENV_FLAGS version: 8 updated: 2017/09/23 08:50:24 dnl --------------- dnl Check for user's environment-breakage by stuffing CFLAGS/CPPFLAGS content dnl into CC. This will not help with broken scripts that wrap the compiler @@ -410,7 +410,7 @@ case "$CC" in AC_MSG_WARN(your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options) # humor him... cf_prog=`echo "$CC" | sed -e 's/ / /g' -e 's/[[ ]]* / /g' -e 's/[[ ]]*[[ ]]-[[^ ]].*//'` - cf_flags=`echo "$CC" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", substr([$]0,1+length(prog))); }'` + cf_flags=`echo "$CC" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", [substr]([$]0,1+length(prog))); }'` CC="$cf_prog" for cf_arg in $cf_flags do @@ -1178,7 +1178,7 @@ if test "x$with_string_hacks" = "xyes"; then fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_ENABLE_WARNINGS version: 4 updated: 2009/07/26 17:53:03 +dnl CF_ENABLE_WARNINGS version: 5 updated: 2017/09/29 20:01:16 dnl ------------------ dnl Configure-option to enable gcc warnings AC_DEFUN([CF_ENABLE_WARNINGS],[ @@ -1193,7 +1193,7 @@ AC_MSG_RESULT($with_warnings) if test "$with_warnings" = "yes" then CF_GCC_ATTRIBUTES - CF_GCC_WARNINGS + CF_GCC_WARNINGS($1) fi fi ])dnl diff --git a/test/background.c b/test/background.c index e9f266e1..b7c2d1fb 100644 --- a/test/background.c +++ b/test/background.c @@ -26,7 +26,7 @@ * authorization. * ****************************************************************************/ /* - * $Id: background.c,v 1.16 2017/04/15 14:13:30 tom Exp $ + * $Id: background.c,v 1.17 2017/09/29 22:54:33 tom Exp $ */ #define NEED_COLOR_CODE 1 @@ -65,7 +65,7 @@ test_background(void) printw("Initializing pair 3 to %s/cyan (ACS_HLINE)\n", color_name(default_fg)); init_pair(3, (NCURSES_COLOR_T) default_fg, COLOR_CYAN); printw("...and drawing a box which should be followed by lines\n"); - bkgdset(ACS_HLINE | (attr_t) COLOR_PAIR(3)); + bkgdset(ACS_HLINE | (chtype) COLOR_PAIR(3)); /* * Characters from vt100 line-drawing should be mapped to line-drawing, * since A_ALTCHARSET is set in the background, and the character part diff --git a/test/blue.c b/test/blue.c index cb088ee8..9c4108a4 100644 --- a/test/blue.c +++ b/test/blue.c @@ -36,7 +36,7 @@ *****************************************************************************/ /* - * $Id: blue.c,v 1.49 2017/04/15 13:36:36 tom Exp $ + * $Id: blue.c,v 1.51 2017/09/30 17:43:18 tom Exp $ */ #include @@ -202,7 +202,7 @@ printcard(int value) } else { int which = (value / SUIT_LENGTH); int isuit = (value % SUIT_LENGTH); - attr_t color = (attr_t) COLOR_PAIR(((which % 2) == 0) + chtype color = (chtype) COLOR_PAIR(((which % 2) == 0) ? RED_ON_WHITE : BLACK_ON_WHITE); @@ -467,13 +467,11 @@ use_pc_display(void) int main(int argc, char *argv[]) { - CATCHALL(die); - setlocale(LC_ALL, ""); use_pc_display(); - initscr(); + InitAndCatch(initscr(), die); start_color(); init_pair(RED_ON_WHITE, COLOR_RED, COLOR_WHITE); diff --git a/test/bs.c b/test/bs.c index 59597588..a954d2d2 100644 --- a/test/bs.c +++ b/test/bs.c @@ -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.68 2017/06/17 18:45:40 tom Exp $ + * $Id: bs.c,v 1.70 2017/09/30 15:40:39 tom Exp $ */ #include @@ -64,6 +64,8 @@ static int getcoord(int); #define CTRLC '\003' /* used as terminate command */ #define FF '\014' /* used as redraw command */ +#define is_QUIT(c) ((c) == CTRLC || (c) == QUIT) + /* coordinate handling */ #define BWIDTH 10 #define BDEPTH 10 @@ -145,6 +147,7 @@ static bool checkplace(int b, ship_t * ss, int vis); #define SHIPIT(name, symbol, length) { name, 0, symbol, length, 0,0, 0, FALSE } +/* "ply=player", "cpu=computer" */ static ship_t plyship[SHIPTYPES] = { SHIPIT(carrier, 'A', 5), @@ -219,8 +222,7 @@ intro(void) srand((unsigned) (time(0L) + getpid())); /* Kick the random number generator */ - CATCHALL(uninitgame); - (void) initscr(); + InitAndCatch(initscr(), uninitgame); if ((tmpname = getlogin()) != 0 && (your_name = strdup(tmpname)) != 0) { @@ -462,9 +464,11 @@ initgame(void) do { c = (char) getch(); } while - (!(strchr("hjkl8462rR", c) || c == FF)); + (!(strchr("hjkl8462rR", c) || c == FF || is_QUIT(c))); - if (c == FF) { + if (is_QUIT(c)) { + uninitgame(0); + } else if (c == FF) { (void) clearok(stdscr, TRUE); (void) refresh(); } else if (ss == 0) { @@ -885,7 +889,7 @@ sgetc(const char *s) ch = getch(); if (islower(ch)) ch = toupper(ch); - if (ch == CTRLC) + if (is_QUIT(ch)) uninitgame(0); for (s1 = s; *s1 && ch != *s1; ++s1) continue; diff --git a/test/chgat.c b/test/chgat.c index 56f6d2cb..72dd48b6 100644 --- a/test/chgat.c +++ b/test/chgat.c @@ -26,7 +26,7 @@ * authorization. * ****************************************************************************/ /* - * $Id: chgat.c,v 1.16 2017/04/16 15:15:34 tom Exp $ + * $Id: chgat.c,v 1.17 2017/09/28 23:04:14 tom Exp $ * * test-driver for chgat/wchgat/mvchgat/mvwchgat */ @@ -103,11 +103,11 @@ video_params(size_t state, attr_t *attr) attr_t attr; const char *msg; } table[] = { - { A_NORMAL, "normal" }, - { A_BOLD, "bold" }, - { A_REVERSE, "reverse" }, - { A_UNDERLINE, "underline" }, - { A_BLINK, "blink" }, + { WA_NORMAL, "normal" }, + { WA_BOLD, "bold" }, + { WA_REVERSE, "reverse" }, + { WA_UNDERLINE, "underline" }, + { WA_BLINK, "blink" }, }; /* *INDENT-ON* */ diff --git a/test/clip_printw.c b/test/clip_printw.c index ef55954e..a1ee516b 100644 --- a/test/clip_printw.c +++ b/test/clip_printw.c @@ -26,7 +26,7 @@ * authorization. * ****************************************************************************/ /* - * $Id: clip_printw.c,v 1.14 2017/04/15 17:28:10 tom Exp $ + * $Id: clip_printw.c,v 1.15 2017/09/28 23:07:23 tom Exp $ * * demonstrate how to use printw without wrapping. */ @@ -133,11 +133,11 @@ video_params(unsigned state, attr_t *attr) attr_t attr; const char *msg; } table[] = { - { A_NORMAL, "normal" }, - { A_BOLD, "bold" }, - { A_REVERSE, "reverse" }, - { A_UNDERLINE, "underline" }, - { A_BLINK, "blink" }, + { WA_NORMAL, "normal" }, + { WA_BOLD, "bold" }, + { WA_REVERSE, "reverse" }, + { WA_UNDERLINE, "underline" }, + { WA_BLINK, "blink" }, }; /* *INDENT-ON* */ diff --git a/test/configure b/test/configure index a5956500..01f9a21a 100755 --- a/test/configure +++ b/test/configure @@ -17142,13 +17142,18 @@ fi fi fi -for cf_data in curscr +for cf_data in \ +curscr \ +ospeed \ +boolnames \ +boolfnames \ +ttytype do -echo "$as_me:17147: checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}" >&5 +echo "$as_me:17152: checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}" >&5 echo $ECHO_N "checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -#line 17151 "configure" +#line 17156 "configure" #include "confdefs.h" #ifdef HAVE_XCURSES @@ -17176,16 +17181,16 @@ void *foo = &($cf_data) } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:17179: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:17184: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:17182: \$? = $ac_status" >&5 + echo "$as_me:17187: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:17185: \"$ac_try\"") >&5 + { (eval echo "$as_me:17190: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:17188: \$? = $ac_status" >&5 + echo "$as_me:17193: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_result=yes @@ -17195,7 +17200,7 @@ cat conftest.$ac_ext >&5 cf_result=no fi rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:17198: result: $cf_result" >&5 +echo "$as_me:17203: result: $cf_result" >&5 echo "${ECHO_T}$cf_result" >&6 if test $cf_result = yes ; then @@ -17207,14 +17212,14 @@ cf_result=`echo "have_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./ EOF else - echo "$as_me:17210: checking for data $cf_data in library" >&5 + echo "$as_me:17215: checking for data $cf_data in library" >&5 echo $ECHO_N "checking for data $cf_data in library... $ECHO_C" >&6 # BSD linkers insist on making weak linkage, but resolve at runtime. if test "$cross_compiling" = yes; then # cross-compiling cat >conftest.$ac_ext <<_ACEOF -#line 17217 "configure" +#line 17222 "configure" #include "confdefs.h" #ifdef HAVE_XCURSES @@ -17247,16 +17252,16 @@ main (void) } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:17250: \"$ac_link\"") >&5 +if { (eval echo "$as_me:17255: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:17253: \$? = $ac_status" >&5 + echo "$as_me:17258: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:17256: \"$ac_try\"") >&5 + { (eval echo "$as_me:17261: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:17259: \$? = $ac_status" >&5 + echo "$as_me:17264: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_result=yes else @@ -17268,7 +17273,7 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext else cat >conftest.$ac_ext <<_ACEOF -#line 17271 "configure" +#line 17276 "configure" #include "confdefs.h" #ifdef HAVE_XCURSES @@ -17294,763 +17299,15 @@ int main(void) } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:17297: \"$ac_link\"") >&5 +if { (eval echo "$as_me:17302: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:17300: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:17302: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? echo "$as_me:17305: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cf_result=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_result=no -fi -rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - echo "$as_me:17317: result: $cf_result" >&5 -echo "${ECHO_T}$cf_result" >&6 - if test $cf_result = yes ; then - -cf_result=`echo "decl_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` - - cat >>confdefs.h <&5 -echo $ECHO_N "checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6 - -cat >conftest.$ac_ext <<_ACEOF -#line 17338 "configure" -#include "confdefs.h" - -#ifdef HAVE_XCURSES -#include -char * XCursesProgramName = "test"; -#else -#include <${cf_cv_ncurses_header:-curses.h}> -#if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H) -#include -#elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H) -#include -#elif defined(HAVE_TERM_H) -#include -#endif -#endif - -int -main (void) -{ - -void *foo = &($cf_data) - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:17366: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:17369: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:17372: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:17375: \$? = $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:17385: result: $cf_result" >&5 -echo "${ECHO_T}$cf_result" >&6 - -if test $cf_result = yes ; then - -cf_result=`echo "have_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` - - cat >>confdefs.h <&5 -echo $ECHO_N "checking for data $cf_data in library... $ECHO_C" >&6 - # BSD linkers insist on making weak linkage, but resolve at runtime. - if test "$cross_compiling" = yes; then - - # cross-compiling - cat >conftest.$ac_ext <<_ACEOF -#line 17404 "configure" -#include "confdefs.h" - -#ifdef HAVE_XCURSES -#include -char * XCursesProgramName = "test"; -#else -#include <${cf_cv_ncurses_header:-curses.h}> -#if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H) -#include -#elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H) -#include -#elif defined(HAVE_TERM_H) -#include -#endif -#endif - -extern char $cf_data; -int -main (void) -{ - - do { - void *foo = &($cf_data); - fprintf(stderr, "testing linkage of $cf_data:%p\n", foo); - ${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:17437: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:17440: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:17443: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:17446: \$? = $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 - -else - cat >conftest.$ac_ext <<_ACEOF -#line 17458 "configure" -#include "confdefs.h" - -#ifdef HAVE_XCURSES -#include -char * XCursesProgramName = "test"; -#else -#include <${cf_cv_ncurses_header:-curses.h}> -#if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H) -#include -#elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H) -#include -#elif defined(HAVE_TERM_H) -#include -#endif -#endif - -extern char $cf_data; -int main(void) -{ - void *foo = &($cf_data); - fprintf(stderr, "testing linkage of $cf_data:%p\n", foo); - ${cf_cv_main_return:-return}(foo == 0); -} -_ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:17484: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:17487: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:17489: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:17492: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cf_result=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_result=no -fi -rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - echo "$as_me:17504: result: $cf_result" >&5 -echo "${ECHO_T}$cf_result" >&6 - if test $cf_result = yes ; then - -cf_result=`echo "decl_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` - - cat >>confdefs.h <&5 -echo $ECHO_N "checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6 - -cat >conftest.$ac_ext <<_ACEOF -#line 17525 "configure" -#include "confdefs.h" - -#ifdef HAVE_XCURSES -#include -char * XCursesProgramName = "test"; -#else -#include <${cf_cv_ncurses_header:-curses.h}> -#if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H) -#include -#elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H) -#include -#elif defined(HAVE_TERM_H) -#include -#endif -#endif - -int -main (void) -{ - -void *foo = &($cf_data) - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:17553: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:17556: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:17559: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:17562: \$? = $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:17572: result: $cf_result" >&5 -echo "${ECHO_T}$cf_result" >&6 - -if test $cf_result = yes ; then - -cf_result=`echo "have_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` - - cat >>confdefs.h <&5 -echo $ECHO_N "checking for data $cf_data in library... $ECHO_C" >&6 - # BSD linkers insist on making weak linkage, but resolve at runtime. - if test "$cross_compiling" = yes; then - - # cross-compiling - cat >conftest.$ac_ext <<_ACEOF -#line 17591 "configure" -#include "confdefs.h" - -#ifdef HAVE_XCURSES -#include -char * XCursesProgramName = "test"; -#else -#include <${cf_cv_ncurses_header:-curses.h}> -#if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H) -#include -#elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H) -#include -#elif defined(HAVE_TERM_H) -#include -#endif -#endif - -extern char $cf_data; -int -main (void) -{ - - do { - void *foo = &($cf_data); - fprintf(stderr, "testing linkage of $cf_data:%p\n", foo); - ${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:17624: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:17627: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:17630: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:17633: \$? = $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 - -else - cat >conftest.$ac_ext <<_ACEOF -#line 17645 "configure" -#include "confdefs.h" - -#ifdef HAVE_XCURSES -#include -char * XCursesProgramName = "test"; -#else -#include <${cf_cv_ncurses_header:-curses.h}> -#if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H) -#include -#elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H) -#include -#elif defined(HAVE_TERM_H) -#include -#endif -#endif - -extern char $cf_data; -int main(void) -{ - void *foo = &($cf_data); - fprintf(stderr, "testing linkage of $cf_data:%p\n", foo); - ${cf_cv_main_return:-return}(foo == 0); -} -_ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:17671: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:17674: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:17676: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:17679: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cf_result=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_result=no -fi -rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - echo "$as_me:17691: result: $cf_result" >&5 -echo "${ECHO_T}$cf_result" >&6 - if test $cf_result = yes ; then - -cf_result=`echo "decl_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` - - cat >>confdefs.h <&5 -echo $ECHO_N "checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6 - -cat >conftest.$ac_ext <<_ACEOF -#line 17712 "configure" -#include "confdefs.h" - -#ifdef HAVE_XCURSES -#include -char * XCursesProgramName = "test"; -#else -#include <${cf_cv_ncurses_header:-curses.h}> -#if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H) -#include -#elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H) -#include -#elif defined(HAVE_TERM_H) -#include -#endif -#endif - -int -main (void) -{ - -void *foo = &($cf_data) - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:17740: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:17743: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:17746: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:17749: \$? = $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:17759: result: $cf_result" >&5 -echo "${ECHO_T}$cf_result" >&6 - -if test $cf_result = yes ; then - -cf_result=`echo "have_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` - - cat >>confdefs.h <&5 -echo $ECHO_N "checking for data $cf_data in library... $ECHO_C" >&6 - # BSD linkers insist on making weak linkage, but resolve at runtime. - if test "$cross_compiling" = yes; then - - # cross-compiling - cat >conftest.$ac_ext <<_ACEOF -#line 17778 "configure" -#include "confdefs.h" - -#ifdef HAVE_XCURSES -#include -char * XCursesProgramName = "test"; -#else -#include <${cf_cv_ncurses_header:-curses.h}> -#if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H) -#include -#elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H) -#include -#elif defined(HAVE_TERM_H) -#include -#endif -#endif - -extern char $cf_data; -int -main (void) -{ - - do { - void *foo = &($cf_data); - fprintf(stderr, "testing linkage of $cf_data:%p\n", foo); - ${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:17811: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:17814: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:17817: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:17820: \$? = $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 - -else - cat >conftest.$ac_ext <<_ACEOF -#line 17832 "configure" -#include "confdefs.h" - -#ifdef HAVE_XCURSES -#include -char * XCursesProgramName = "test"; -#else -#include <${cf_cv_ncurses_header:-curses.h}> -#if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H) -#include -#elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H) -#include -#elif defined(HAVE_TERM_H) -#include -#endif -#endif - -extern char $cf_data; -int main(void) -{ - void *foo = &($cf_data); - fprintf(stderr, "testing linkage of $cf_data:%p\n", foo); - ${cf_cv_main_return:-return}(foo == 0); -} -_ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:17858: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:17861: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:17863: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:17866: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cf_result=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_result=no -fi -rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - echo "$as_me:17878: result: $cf_result" >&5 -echo "${ECHO_T}$cf_result" >&6 - if test $cf_result = yes ; then - -cf_result=`echo "decl_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` - - cat >>confdefs.h <&5 -echo $ECHO_N "checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6 - -cat >conftest.$ac_ext <<_ACEOF -#line 17899 "configure" -#include "confdefs.h" - -#ifdef HAVE_XCURSES -#include -char * XCursesProgramName = "test"; -#else -#include <${cf_cv_ncurses_header:-curses.h}> -#if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H) -#include -#elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H) -#include -#elif defined(HAVE_TERM_H) -#include -#endif -#endif - -int -main (void) -{ - -void *foo = &($cf_data) - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:17927: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:17930: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:17933: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:17936: \$? = $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:17946: result: $cf_result" >&5 -echo "${ECHO_T}$cf_result" >&6 - -if test $cf_result = yes ; then - -cf_result=`echo "have_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` - - cat >>confdefs.h <&5 -echo $ECHO_N "checking for data $cf_data in library... $ECHO_C" >&6 - # BSD linkers insist on making weak linkage, but resolve at runtime. - if test "$cross_compiling" = yes; then - - # cross-compiling - cat >conftest.$ac_ext <<_ACEOF -#line 17965 "configure" -#include "confdefs.h" - -#ifdef HAVE_XCURSES -#include -char * XCursesProgramName = "test"; -#else -#include <${cf_cv_ncurses_header:-curses.h}> -#if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H) -#include -#elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H) -#include -#elif defined(HAVE_TERM_H) -#include -#endif -#endif - -extern char $cf_data; -int -main (void) -{ - - do { - void *foo = &($cf_data); - fprintf(stderr, "testing linkage of $cf_data:%p\n", foo); - ${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:17998: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:18001: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:18004: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:18007: \$? = $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 - -else - cat >conftest.$ac_ext <<_ACEOF -#line 18019 "configure" -#include "confdefs.h" - -#ifdef HAVE_XCURSES -#include -char * XCursesProgramName = "test"; -#else -#include <${cf_cv_ncurses_header:-curses.h}> -#if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H) -#include -#elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H) -#include -#elif defined(HAVE_TERM_H) -#include -#endif -#endif - -extern char $cf_data; -int main(void) -{ - void *foo = &($cf_data); - fprintf(stderr, "testing linkage of $cf_data:%p\n", foo); - ${cf_cv_main_return:-return}(foo == 0); -} -_ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:18045: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:18048: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:18050: \"$ac_try\"") >&5 + { (eval echo "$as_me:17307: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:18053: \$? = $ac_status" >&5 + echo "$as_me:17310: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_result=yes @@ -18062,7 +17319,7 @@ cf_result=no fi rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi - echo "$as_me:18065: result: $cf_result" >&5 + echo "$as_me:17322: result: $cf_result" >&5 echo "${ECHO_T}$cf_result" >&6 if test $cf_result = yes ; then @@ -18079,7 +17336,7 @@ done if ( test "$GCC" = yes || test "$GXX" = yes ) then -echo "$as_me:18082: checking if you want to turn on gcc warnings" >&5 +echo "$as_me:17339: 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. @@ -18096,7 +17353,7 @@ else with_warnings=no fi; -echo "$as_me:18099: result: $with_warnings" >&5 +echo "$as_me:17356: result: $with_warnings" >&5 echo "${ECHO_T}$with_warnings" >&6 if test "$with_warnings" = "yes" then @@ -18119,10 +17376,10 @@ cat > conftest.i <&5 + { echo "$as_me:17379: checking for $CC __attribute__ directives..." >&5 echo "$as_me: checking for $CC __attribute__ directives..." >&6;} cat > conftest.$ac_ext <&5 + if { (eval echo "$as_me:17431: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:18177: \$? = $ac_status" >&5 + echo "$as_me:17434: \$? = $ac_status" >&5 (exit $ac_status); }; then - test -n "$verbose" && echo "$as_me:18179: result: ... $cf_attribute" >&5 + test -n "$verbose" && echo "$as_me:17436: result: ... $cf_attribute" >&5 echo "${ECHO_T}... $cf_attribute" >&6 cat conftest.h >>confdefs.h case $cf_attribute in @@ -18240,12 +17497,12 @@ INTEL_COMPILER=no if test "$GCC" = yes ; then case $host_os in (linux*|gnu*) - echo "$as_me:18243: checking if this is really Intel C compiler" >&5 + echo "$as_me:17500: 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 18248 "configure" +#line 17505 "configure" #include "confdefs.h" int @@ -18262,16 +17519,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:18265: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:17522: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:18268: \$? = $ac_status" >&5 + echo "$as_me:17525: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:18271: \"$ac_try\"") >&5 + { (eval echo "$as_me:17528: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:18274: \$? = $ac_status" >&5 + echo "$as_me:17531: \$? = $ac_status" >&5 (exit $ac_status); }; }; then INTEL_COMPILER=yes cf_save_CFLAGS="$cf_save_CFLAGS -we147" @@ -18282,7 +17539,7 @@ cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext CFLAGS="$cf_save_CFLAGS" - echo "$as_me:18285: result: $INTEL_COMPILER" >&5 + echo "$as_me:17542: result: $INTEL_COMPILER" >&5 echo "${ECHO_T}$INTEL_COMPILER" >&6 ;; esac @@ -18291,12 +17548,12 @@ fi CLANG_COMPILER=no if test "$GCC" = yes ; then - echo "$as_me:18294: checking if this is really Clang C compiler" >&5 + echo "$as_me:17551: checking if this is really Clang C compiler" >&5 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6 cf_save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Qunused-arguments" cat >conftest.$ac_ext <<_ACEOF -#line 18299 "configure" +#line 17556 "configure" #include "confdefs.h" int @@ -18313,16 +17570,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:18316: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:17573: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:18319: \$? = $ac_status" >&5 + echo "$as_me:17576: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:18322: \"$ac_try\"") >&5 + { (eval echo "$as_me:17579: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:18325: \$? = $ac_status" >&5 + echo "$as_me:17582: \$? = $ac_status" >&5 (exit $ac_status); }; }; then CLANG_COMPILER=yes cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments" @@ -18333,12 +17590,12 @@ cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext CFLAGS="$cf_save_CFLAGS" - echo "$as_me:18336: result: $CLANG_COMPILER" >&5 + echo "$as_me:17593: result: $CLANG_COMPILER" >&5 echo "${ECHO_T}$CLANG_COMPILER" >&6 fi cat > conftest.$ac_ext <&5 + { echo "$as_me:17615: checking for $CC warning options..." >&5 echo "$as_me: checking for $CC warning options..." >&6;} cf_save_CFLAGS="$CFLAGS" EXTRA_CFLAGS="-Wall" @@ -18371,12 +17628,12 @@ echo "$as_me: checking for $CC warning options..." >&6;} wd981 do CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt" - if { (eval echo "$as_me:18374: \"$ac_compile\"") >&5 + if { (eval echo "$as_me:17631: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:18377: \$? = $ac_status" >&5 + echo "$as_me:17634: \$? = $ac_status" >&5 (exit $ac_status); }; then - test -n "$verbose" && echo "$as_me:18379: result: ... -$cf_opt" >&5 + test -n "$verbose" && echo "$as_me:17636: result: ... -$cf_opt" >&5 echo "${ECHO_T}... -$cf_opt" >&6 EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt" fi @@ -18385,7 +17642,7 @@ echo "${ECHO_T}... -$cf_opt" >&6 elif test "$GCC" = yes then - { echo "$as_me:18388: checking for $CC warning options..." >&5 + { echo "$as_me:17645: checking for $CC warning options..." >&5 echo "$as_me: checking for $CC warning options..." >&6;} cf_save_CFLAGS="$CFLAGS" EXTRA_CFLAGS= @@ -18406,15 +17663,15 @@ echo "$as_me: checking for $CC warning options..." >&6;} Wpointer-arith \ Wshadow \ Wstrict-prototypes \ - Wundef $cf_gcc_warnings $cf_warn_CONST + Wundef $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas do CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt" - if { (eval echo "$as_me:18412: \"$ac_compile\"") >&5 + if { (eval echo "$as_me:17669: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:18415: \$? = $ac_status" >&5 + echo "$as_me:17672: \$? = $ac_status" >&5 (exit $ac_status); }; then - test -n "$verbose" && echo "$as_me:18417: result: ... -$cf_opt" >&5 + test -n "$verbose" && echo "$as_me:17674: result: ... -$cf_opt" >&5 echo "${ECHO_T}... -$cf_opt" >&6 case $cf_opt in (Wcast-qual) @@ -18425,7 +17682,7 @@ echo "${ECHO_T}... -$cf_opt" >&6 ([34].*) test -n "$verbose" && echo " feature is broken in gcc $GCC_VERSION" 1>&6 -echo "${as_me:-configure}:18428: testing feature is broken in gcc $GCC_VERSION ..." 1>&5 +echo "${as_me:-configure}:17685: testing feature is broken in gcc $GCC_VERSION ..." 1>&5 continue;; esac @@ -18435,7 +17692,7 @@ echo "${as_me:-configure}:18428: testing feature is broken in gcc $GCC_VERSION . ([12].*) test -n "$verbose" && echo " feature is broken in gcc $GCC_VERSION" 1>&6 -echo "${as_me:-configure}:18438: testing feature is broken in gcc $GCC_VERSION ..." 1>&5 +echo "${as_me:-configure}:17695: testing feature is broken in gcc $GCC_VERSION ..." 1>&5 continue;; esac @@ -18451,7 +17708,7 @@ rm -rf conftest* fi fi -echo "$as_me:18454: checking if you want to use dmalloc for testing" >&5 +echo "$as_me:17711: 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. @@ -18468,7 +17725,7 @@ EOF else with_dmalloc= fi; -echo "$as_me:18471: result: ${with_dmalloc:-no}" >&5 +echo "$as_me:17728: result: ${with_dmalloc:-no}" >&5 echo "${ECHO_T}${with_dmalloc:-no}" >&6 case .$with_cflags in @@ -18582,23 +17839,23 @@ fi esac if test "$with_dmalloc" = yes ; then - echo "$as_me:18585: checking for dmalloc.h" >&5 + echo "$as_me:17842: 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 18591 "configure" +#line 17848 "configure" #include "confdefs.h" #include _ACEOF -if { (eval echo "$as_me:18595: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:17852: \"$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:18601: \$? = $ac_status" >&5 + echo "$as_me:17858: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -18617,11 +17874,11 @@ else fi rm -f conftest.err conftest.$ac_ext fi -echo "$as_me:18620: result: $ac_cv_header_dmalloc_h" >&5 +echo "$as_me:17877: 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:18624: checking for dmalloc_debug in -ldmalloc" >&5 +echo "$as_me:17881: 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 @@ -18629,7 +17886,7 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-ldmalloc $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 18632 "configure" +#line 17889 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -18648,16 +17905,16 @@ dmalloc_debug (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:18651: \"$ac_link\"") >&5 +if { (eval echo "$as_me:17908: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:18654: \$? = $ac_status" >&5 + echo "$as_me:17911: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:18657: \"$ac_try\"") >&5 + { (eval echo "$as_me:17914: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:18660: \$? = $ac_status" >&5 + echo "$as_me:17917: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dmalloc_dmalloc_debug=yes else @@ -18668,7 +17925,7 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:18671: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5 +echo "$as_me:17928: 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 <&5 +echo "$as_me:17943: 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. @@ -18700,7 +17957,7 @@ EOF else with_dbmalloc= fi; -echo "$as_me:18703: result: ${with_dbmalloc:-no}" >&5 +echo "$as_me:17960: result: ${with_dbmalloc:-no}" >&5 echo "${ECHO_T}${with_dbmalloc:-no}" >&6 case .$with_cflags in @@ -18814,23 +18071,23 @@ fi esac if test "$with_dbmalloc" = yes ; then - echo "$as_me:18817: checking for dbmalloc.h" >&5 + echo "$as_me:18074: 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 18823 "configure" +#line 18080 "configure" #include "confdefs.h" #include _ACEOF -if { (eval echo "$as_me:18827: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:18084: \"$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:18833: \$? = $ac_status" >&5 + echo "$as_me:18090: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -18849,11 +18106,11 @@ else fi rm -f conftest.err conftest.$ac_ext fi -echo "$as_me:18852: result: $ac_cv_header_dbmalloc_h" >&5 +echo "$as_me:18109: 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:18856: checking for debug_malloc in -ldbmalloc" >&5 +echo "$as_me:18113: 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 @@ -18861,7 +18118,7 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-ldbmalloc $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 18864 "configure" +#line 18121 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -18880,16 +18137,16 @@ debug_malloc (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:18883: \"$ac_link\"") >&5 +if { (eval echo "$as_me:18140: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:18886: \$? = $ac_status" >&5 + echo "$as_me:18143: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:18889: \"$ac_try\"") >&5 + { (eval echo "$as_me:18146: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:18892: \$? = $ac_status" >&5 + echo "$as_me:18149: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dbmalloc_debug_malloc=yes else @@ -18900,7 +18157,7 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:18903: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5 +echo "$as_me:18160: 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 <&5 +echo "$as_me:18175: 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. @@ -18932,7 +18189,7 @@ EOF else with_valgrind= fi; -echo "$as_me:18935: result: ${with_valgrind:-no}" >&5 +echo "$as_me:18192: result: ${with_valgrind:-no}" >&5 echo "${ECHO_T}${with_valgrind:-no}" >&6 case .$with_cflags in @@ -19045,7 +18302,7 @@ fi ;; esac -echo "$as_me:19048: checking if you want to perform memory-leak testing" >&5 +echo "$as_me:18305: 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. @@ -19055,7 +18312,7 @@ if test "${enable_leaks+set}" = set; then else : ${with_no_leaks:=no} fi; -echo "$as_me:19058: result: $with_no_leaks" >&5 +echo "$as_me:18315: result: $with_no_leaks" >&5 echo "${ECHO_T}$with_no_leaks" >&6 if test "$with_no_leaks" = yes ; then @@ -19071,7 +18328,7 @@ EOF fi LD_RPATH_OPT= -echo "$as_me:19074: checking for an rpath option" >&5 +echo "$as_me:18331: checking for an rpath option" >&5 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6 case $cf_cv_system_name in (irix*) @@ -19102,12 +18359,12 @@ case $cf_cv_system_name in (*) ;; esac -echo "$as_me:19105: result: $LD_RPATH_OPT" >&5 +echo "$as_me:18362: result: $LD_RPATH_OPT" >&5 echo "${ECHO_T}$LD_RPATH_OPT" >&6 case "x$LD_RPATH_OPT" in (x-R*) - echo "$as_me:19110: checking if we need a space after rpath option" >&5 + echo "$as_me:18367: 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" @@ -19128,7 +18385,7 @@ done LIBS="$cf_add_libs" cat >conftest.$ac_ext <<_ACEOF -#line 19131 "configure" +#line 18388 "configure" #include "confdefs.h" int @@ -19140,16 +18397,16 @@ main (void) } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:19143: \"$ac_link\"") >&5 +if { (eval echo "$as_me:18400: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:19146: \$? = $ac_status" >&5 + echo "$as_me:18403: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:19149: \"$ac_try\"") >&5 + { (eval echo "$as_me:18406: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:19152: \$? = $ac_status" >&5 + echo "$as_me:18409: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_rpath_space=no else @@ -19159,13 +18416,13 @@ cf_rpath_space=yes fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS="$cf_save_LIBS" - echo "$as_me:19162: result: $cf_rpath_space" >&5 + echo "$as_me:18419: result: $cf_rpath_space" >&5 echo "${ECHO_T}$cf_rpath_space" >&6 test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT " ;; esac -echo "$as_me:19168: checking if rpath-hack should be disabled" >&5 +echo "$as_me:18425: checking if rpath-hack should be disabled" >&5 echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6 # Check whether --enable-rpath-hack or --disable-rpath-hack was given. @@ -19182,21 +18439,21 @@ else cf_disable_rpath_hack=no fi; -echo "$as_me:19185: result: $cf_disable_rpath_hack" >&5 +echo "$as_me:18442: 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:19189: checking for updated LDFLAGS" >&5 +echo "$as_me:18446: 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:19192: result: maybe" >&5 + echo "$as_me:18449: 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:19199: checking for $ac_word" >&5 +echo "$as_me:18456: 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 @@ -19211,7 +18468,7 @@ for ac_dir in $ac_dummy; do 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:19214: found $ac_dir/$ac_word" >&5 +echo "$as_me:18471: found $ac_dir/$ac_word" >&5 break done @@ -19219,10 +18476,10 @@ fi fi cf_ldd_prog=$ac_cv_prog_cf_ldd_prog if test -n "$cf_ldd_prog"; then - echo "$as_me:19222: result: $cf_ldd_prog" >&5 + echo "$as_me:18479: result: $cf_ldd_prog" >&5 echo "${ECHO_T}$cf_ldd_prog" >&6 else - echo "$as_me:19225: result: no" >&5 + echo "$as_me:18482: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -19236,7 +18493,7 @@ test -n "$cf_ldd_prog" || cf_ldd_prog="no" cf_rpath_oops= cat >conftest.$ac_ext <<_ACEOF -#line 19239 "configure" +#line 18496 "configure" #include "confdefs.h" #include int @@ -19248,16 +18505,16 @@ printf("Hello"); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:19251: \"$ac_link\"") >&5 +if { (eval echo "$as_me:18508: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:19254: \$? = $ac_status" >&5 + echo "$as_me:18511: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:19257: \"$ac_try\"") >&5 + { (eval echo "$as_me:18514: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:19260: \$? = $ac_status" >&5 + echo "$as_me:18517: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_rpath_oops=`$cf_ldd_prog conftest$ac_exeext | fgrep ' not found' | sed -e 's% =>.*$%%' |sort | uniq` cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[ ]/%/%' -e 's%/[^/][^/]*$%%' |sort | uniq` @@ -19285,7 +18542,7 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext then test -n "$verbose" && echo " ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6 -echo "${as_me:-configure}:19288: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5 +echo "${as_me:-configure}:18545: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5 LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib" break @@ -19297,11 +18554,11 @@ echo "${as_me:-configure}:19288: testing ...adding -L$cf_rpath_dir/lib to LDFLAG test -n "$verbose" && echo " ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6 -echo "${as_me:-configure}:19300: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5 +echo "${as_me:-configure}:18557: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5 test -n "$verbose" && echo " ...checking LDFLAGS $LDFLAGS" 1>&6 -echo "${as_me:-configure}:19304: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5 +echo "${as_me:-configure}:18561: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5 cf_rpath_dst= for cf_rpath_src in $LDFLAGS @@ -19338,7 +18595,7 @@ do then test -n "$verbose" && echo " ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6 -echo "${as_me:-configure}:19341: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5 +echo "${as_me:-configure}:18598: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS" fi @@ -19351,11 +18608,11 @@ LDFLAGS=$cf_rpath_dst test -n "$verbose" && echo " ...checked LDFLAGS $LDFLAGS" 1>&6 -echo "${as_me:-configure}:19354: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5 +echo "${as_me:-configure}:18611: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5 test -n "$verbose" && echo " ...checking LIBS $LIBS" 1>&6 -echo "${as_me:-configure}:19358: testing ...checking LIBS $LIBS ..." 1>&5 +echo "${as_me:-configure}:18615: testing ...checking LIBS $LIBS ..." 1>&5 cf_rpath_dst= for cf_rpath_src in $LIBS @@ -19392,7 +18649,7 @@ do then test -n "$verbose" && echo " ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6 -echo "${as_me:-configure}:19395: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5 +echo "${as_me:-configure}:18652: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS" fi @@ -19405,14 +18662,14 @@ LIBS=$cf_rpath_dst test -n "$verbose" && echo " ...checked LIBS $LIBS" 1>&6 -echo "${as_me:-configure}:19408: testing ...checked LIBS $LIBS ..." 1>&5 +echo "${as_me:-configure}:18665: testing ...checked LIBS $LIBS ..." 1>&5 test -n "$verbose" && echo " ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6 -echo "${as_me:-configure}:19412: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5 +echo "${as_me:-configure}:18669: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5 else - echo "$as_me:19415: result: no" >&5 + echo "$as_me:18672: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -19502,7 +18759,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:19505: creating $CONFIG_STATUS" >&5 +{ echo "$as_me:18762: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL @@ -19678,7 +18935,7 @@ cat >>$CONFIG_STATUS <<\EOF echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header - { { echo "$as_me:19681: error: ambiguous option: $1 + { { echo "$as_me:18938: 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;} @@ -19697,7 +18954,7 @@ Try \`$0 --help' for more information." >&2;} ac_need_defaults=false;; # This is an error. - -*) { { echo "$as_me:19700: error: unrecognized option: $1 + -*) { { echo "$as_me:18957: 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;} @@ -19747,7 +19004,7 @@ do "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:19750: error: invalid argument: $ac_config_target" >&5 + *) { { echo "$as_me:19007: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac @@ -20038,7 +19295,7 @@ done; } esac if test x"$ac_file" != x-; then - { echo "$as_me:20041: creating $ac_file" >&5 + { echo "$as_me:19298: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi @@ -20056,7 +19313,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:20059: error: cannot find input file: $f" >&5 + test -f "$f" || { { echo "$as_me:19316: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo $f;; @@ -20069,7 +19326,7 @@ echo "$as_me: error: cannot find input file: $f" >&2;} echo $srcdir/$f else # /dev/null tree - { { echo "$as_me:20072: error: cannot find input file: $f" >&5 + { { echo "$as_me:19329: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; @@ -20085,7 +19342,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:20088: WARNING: datarootdir was used implicitly but not set: + { echo "$as_me:19345: 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;} @@ -20094,7 +19351,7 @@ $ac_seen" >&2;} fi ac_seen=`grep '${datarootdir}' $ac_item` if test -n "$ac_seen"; then - { echo "$as_me:20097: WARNING: datarootdir was used explicitly but not set: + { echo "$as_me:19354: 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;} @@ -20131,7 +19388,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:20134: WARNING: Variable $ac_name is used but was not set: + { echo "$as_me:19391: 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;} @@ -20142,7 +19399,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:20145: WARNING: Some variables may not be substituted: + { echo "$as_me:19402: WARNING: Some variables may not be substituted: $ac_seen" >&5 echo "$as_me: WARNING: Some variables may not be substituted: $ac_seen" >&2;} @@ -20191,7 +19448,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:20194: creating $ac_file" >&5 + test x"$ac_file" != x- && { echo "$as_me:19451: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} # First look for the input files in the build tree, otherwise in the @@ -20202,7 +19459,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:20205: error: cannot find input file: $f" >&5 + test -f "$f" || { { echo "$as_me:19462: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo $f;; @@ -20215,7 +19472,7 @@ echo "$as_me: error: cannot find input file: $f" >&2;} echo $srcdir/$f else # /dev/null tree - { { echo "$as_me:20218: error: cannot find input file: $f" >&5 + { { echo "$as_me:19475: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; @@ -20273,7 +19530,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:20276: $ac_file is unchanged" >&5 + { echo "$as_me:19533: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ diff --git a/test/configure.in b/test/configure.in index a73771b4..49298f51 100644 --- a/test/configure.in +++ b/test/configure.in @@ -28,7 +28,7 @@ dnl*************************************************************************** dnl dnl Author: Thomas E. Dickey 1996-on dnl -dnl $Id: configure.in,v 1.142 2017/09/09 23:07:56 tom Exp $ +dnl $Id: configure.in,v 1.143 2017/09/30 00:00:56 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) @@ -427,15 +427,16 @@ if test "$cf_enable_widec" = yes; then fi fi -CF_CURSES_CHECK_DATA(curscr) -CF_CURSES_CHECK_DATA(ospeed) -CF_CURSES_CHECK_DATA(boolnames) -CF_CURSES_CHECK_DATA(boolfnames) -CF_CURSES_CHECK_DATA(ttytype) +CF_CURSES_CHECK_DATA(\ +curscr \ +ospeed \ +boolnames \ +boolfnames \ +ttytype) dnl --------------------------------------------------------------------------- CF_HELP_MESSAGE(Testing/development Options:) -CF_ENABLE_WARNINGS +CF_ENABLE_WARNINGS(Wno-unknown-pragmas) CF_DISABLE_LEAKS CF_DISABLE_RPATH_HACK diff --git a/test/demo_new_pair.c b/test/demo_new_pair.c index 5f8e8e66..a0beb85c 100644 --- a/test/demo_new_pair.c +++ b/test/demo_new_pair.c @@ -26,7 +26,7 @@ * authorization. * ****************************************************************************/ /* - * $Id: demo_new_pair.c,v 1.16 2017/09/04 11:47:44 tom Exp $ + * $Id: demo_new_pair.c,v 1.17 2017/09/28 23:17:56 tom Exp $ * * Demonstrate the alloc_pair() function. */ @@ -63,19 +63,19 @@ next_attr(int now) attr_t bits[MAX_BITS]; init = TRUE; - bits[limit++] = A_NORMAL; + bits[limit++] = WA_NORMAL; if (valid_cap("smso")) - bits[limit++] = A_STANDOUT; + bits[limit++] = WA_STANDOUT; if (valid_cap("smul")) - bits[limit++] = A_UNDERLINE; + bits[limit++] = WA_UNDERLINE; if (valid_cap("rev")) - bits[limit++] = A_REVERSE; + bits[limit++] = WA_REVERSE; if (valid_cap("blink")) - bits[limit++] = A_BLINK; + bits[limit++] = WA_BLINK; if (valid_cap("dim")) - bits[limit++] = A_DIM; + bits[limit++] = WA_DIM; if (valid_cap("bold")) - bits[limit++] = A_BOLD; + bits[limit++] = WA_BOLD; for (j = 0; j < limit; ++j) { for (k = 0; k < limit; ++k) { table[j * limit + k] = bits[j] | bits[k]; diff --git a/test/dots.c b/test/dots.c index 474d8805..f9d2ef69 100644 --- a/test/dots.c +++ b/test/dots.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1999-2011,2013 Free Software Foundation, Inc. * + * Copyright (c) 1999-2013,2017 Free 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 1999 * - * $Id: dots.c,v 1.25 2013/09/28 22:12:09 tom Exp $ + * $Id: dots.c,v 1.26 2017/09/30 17:55:22 tom Exp $ * * A simple demo of the terminfo interface. */ @@ -107,10 +107,8 @@ main(int argc GCC_UNUSED, double c; int my_colors; - CATCHALL(onsig); - srand((unsigned) time(0)); - setupterm((char *) 0, 1, (int *) 0); + InitAndCatch(setupterm((char *) 0, 1, (int *) 0), onsig); outs(clear_screen); outs(cursor_invisible); my_colors = max_colors; diff --git a/test/dots_curses.c b/test/dots_curses.c index b3713888..d27f2e23 100644 --- a/test/dots_curses.c +++ b/test/dots_curses.c @@ -29,7 +29,7 @@ /* * Author: Thomas E. Dickey * - * $Id: dots_curses.c,v 1.4 2017/04/15 14:13:30 tom Exp $ + * $Id: dots_curses.c,v 1.5 2017/09/30 15:41:17 tom Exp $ * * A simple demo of the curses interface used for comparison with termcap. */ @@ -95,11 +95,9 @@ main(int argc GCC_UNUSED, double r; double c; - CATCHALL(onsig); - srand((unsigned) time(0)); - initscr(); + InitAndCatch(initscr(), onsig); if (has_colors()) { start_color(); for (fg = 0; fg < COLORS; fg++) { diff --git a/test/dots_mvcur.c b/test/dots_mvcur.c index 4812282e..ed9de8c2 100644 --- a/test/dots_mvcur.c +++ b/test/dots_mvcur.c @@ -29,7 +29,7 @@ /* * Author: Thomas E. Dickey - 2007 * - * $Id: dots_mvcur.c,v 1.11 2017/06/17 18:25:30 tom Exp $ + * $Id: dots_mvcur.c,v 1.13 2017/09/30 21:34:15 tom Exp $ * * A simple demo of the terminfo interface, and mvcur. */ @@ -110,13 +110,16 @@ main(int argc GCC_UNUSED, SCREEN *sp; int my_colors; - CATCHALL(onsig); + InitAndCatch((sp = newterm((char *) 0, stdout, stdin)), onsig); + refresh(); /* needed with Solaris curses to cancel endwin */ - srand((unsigned) time(0)); - if ((sp = newterm((char *) 0, stdout, stdin)) == 0) { + if (sp == 0) { fprintf(stderr, "Cannot initialize terminal\n"); ExitProgram(EXIT_FAILURE); } + + srand((unsigned) time(0)); + outs(clear_screen); outs(cursor_home); outs(cursor_invisible); diff --git a/test/dots_termcap.c b/test/dots_termcap.c index 53829e24..cd88b3eb 100644 --- a/test/dots_termcap.c +++ b/test/dots_termcap.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2013,2014 Free Software Foundation, Inc. * + * Copyright (c) 2013-2014,2017 Free 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: dots_termcap.c,v 1.9 2014/09/25 09:00:56 tom Exp $ + * $Id: dots_termcap.c,v 1.10 2017/09/30 17:55:22 tom Exp $ * * A simple demo of the termcap interface. */ @@ -177,14 +177,14 @@ main(int argc GCC_UNUSED, char area[1024]; char *name; - CATCHALL(onsig); - srand((unsigned) time(0)); if ((name = getenv("TERM")) == 0) { fprintf(stderr, "TERM is not set\n"); ExitProgram(EXIT_FAILURE); - } else if (tgetent(buffer, name) < 0) { + } + InitAndCatch(z = tgetent(buffer, name), onsig); + if (z < 0) { fprintf(stderr, "terminal description not found\n"); ExitProgram(EXIT_FAILURE); } else { diff --git a/test/echochar.c b/test/echochar.c index ef649ca4..1a3fd7d3 100644 --- a/test/echochar.c +++ b/test/echochar.c @@ -26,7 +26,7 @@ * authorization. * ****************************************************************************/ /* - * $Id: echochar.c,v 1.14 2017/09/04 11:48:15 tom Exp $ + * $Id: echochar.c,v 1.15 2017/09/30 15:42:10 tom Exp $ * * Demonstrate the echochar function (compare to dots.c). * Thomas Dickey - 2006/11/4 @@ -103,8 +103,7 @@ main(int argc GCC_UNUSED, } } - CATCHALL(onsig); - initscr(); + InitAndCatch(initscr(), onsig); use_colors = has_colors(); if (use_colors) { diff --git a/test/filter.c b/test/filter.c index 2bd9b20f..e070620b 100644 --- a/test/filter.c +++ b/test/filter.c @@ -29,7 +29,7 @@ /* * Author: Thomas E. Dickey 1998 * - * $Id: filter.c,v 1.31 2017/09/10 19:49:55 tom Exp $ + * $Id: filter.c,v 1.32 2017/09/28 23:40:39 tom Exp $ * * An example of the 'filter()' function in ncurses, this program prompts * for commands and executes them (like a command shell). It illustrates @@ -105,7 +105,7 @@ new_command(char *buffer, int length, int underline, bool clocked, bool polled) if (polled) { bool done = FALSE; bool first = TRUE; - int y, x; + int y = 0, x = 0; int n; int mark = 0; int used = 0; diff --git a/test/firework.c b/test/firework.c index 198c58d7..9fb236bf 100644 --- a/test/firework.c +++ b/test/firework.c @@ -26,7 +26,7 @@ * authorization. * ****************************************************************************/ /* - * $Id: firework.c,v 1.34 2017/09/09 00:35:56 tom Exp $ + * $Id: firework.c,v 1.35 2017/09/30 15:42:24 tom Exp $ */ #include @@ -183,9 +183,7 @@ main(int argc, char *argv[]) if (optind < argc) usage(); - CATCHALL(onsig); - - initscr(); + InitAndCatch(initscr(), onsig); noecho(); cbreak(); keypad(stdscr, TRUE); diff --git a/test/gdc.c b/test/gdc.c index c70efba8..deecdf7e 100644 --- a/test/gdc.c +++ b/test/gdc.c @@ -33,7 +33,7 @@ * modified 10-18-89 for curses (jrl) * 10-18-89 added signal handling * - * $Id: gdc.c,v 1.50 2017/09/09 20:23:09 tom Exp $ + * $Id: gdc.c,v 1.51 2017/09/30 18:10:05 tom Exp $ */ #include @@ -227,8 +227,6 @@ main(int argc, char *argv[]) setlocale(LC_ALL, ""); - CATCHALL(sighndl); - while ((k = getopt(argc, argv, "dnst:")) != -1) { switch (k) { #if HAVE_USE_DEFAULT_COLORS @@ -257,17 +255,20 @@ main(int argc, char *argv[]) if (optind < argc) usage(); - if (redirected) { - char *name = getenv("TERM"); - if (name == 0 - || newterm(name, ofp, ifp) == 0) { - fprintf(stderr, "cannot open terminal\n"); - ExitProgram(EXIT_FAILURE); + InitAndCatch({ + if (redirected) { + char *name = getenv("TERM"); + if (name == 0 + || newterm(name, ofp, ifp) == 0) { + fprintf(stderr, "cannot open terminal\n"); + ExitProgram(EXIT_FAILURE); + } + } else { + initscr(); } - - } else { - initscr(); } + ,sighndl); + cbreak(); noecho(); nodelay(stdscr, 1); diff --git a/test/hashtest.c b/test/hashtest.c index 65868154..9a3300b2 100644 --- a/test/hashtest.c +++ b/test/hashtest.c @@ -30,7 +30,7 @@ * * Generate timing statistics for vertical-motion optimization. * - * $Id: hashtest.c,v 1.33 2017/04/15 14:13:40 tom Exp $ + * $Id: hashtest.c,v 1.34 2017/09/30 15:42:53 tom Exp $ */ #include @@ -225,9 +225,7 @@ main(int argc, char *argv[]) trace(TRACE_TIMES); #endif - CATCHALL(finish); /* arrange interrupts to terminate */ - - (void) initscr(); /* initialize the curses library */ + InitAndCatch(initscr(), finish); keypad(stdscr, TRUE); /* enable keyboard mapping */ (void) nonl(); /* tell curses not to do NL->CR/NL on output */ (void) cbreak(); /* take input chars one at a time, no wait for \n */ diff --git a/test/key_names.c b/test/key_names.c index 579f02fc..f770edba 100644 --- a/test/key_names.c +++ b/test/key_names.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2007-2008,2014 Free Software Foundation, Inc. * + * Copyright (c) 2007-2014,2017 Free 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: key_names.c,v 1.5 2014/08/02 17:24:55 tom Exp $ + * $Id: key_names.c,v 1.6 2017/09/29 09:16:42 tom Exp $ */ #include @@ -77,7 +77,8 @@ main(int argc, char *argv[]) endwin(); } for (n = -1; n < KEY_MAX + 512; n++) { - const char *result = key_name((wchar_t) n); + int check = wcwidth(n); + const char *result = check >= 0 ? key_name((wchar_t) n) : "?"; if (result != 0) printf("%d(%5o):%s\n", n, n, result); } diff --git a/test/ncurses.c b/test/ncurses.c index 67696372..8e75a200 100644 --- a/test/ncurses.c +++ b/test/ncurses.c @@ -40,7 +40,7 @@ AUTHOR Author: Eric S. Raymond 1993 Thomas E. Dickey (beginning revision 1.27 in 1996). -$Id: ncurses.c,v 1.465 2017/09/23 15:42:49 tom Exp $ +$Id: ncurses.c,v 1.468 2017/10/01 00:14:01 tom Exp $ ***************************************************************************/ @@ -147,10 +147,9 @@ static unsigned save_trace = TRACE_ORDINARY | TRACE_ICALLS | TRACE_CALLS; #define BLANK ' ' /* this is the background character */ -#undef max_colors -static int max_colors; /* the actual number of colors we'll use */ -static int min_colors; /* the minimum color code */ -static bool use_colors; /* true if we use colors */ +static int MaxColors; /* the actual number of colors we'll use */ +static int MinColors; /* the minimum color code */ +static bool UseColors; /* true if we use colors */ #undef max_pairs static int max_pairs; /* ...and the number of color pairs */ @@ -222,6 +221,7 @@ wGetchar(WINDOW *win) } #define Getchar() wGetchar(stdscr) +#if HAVE_SLK_COLOR /* replaces wgetnstr(), since we want to be able to edit values */ static void wGetstring(WINDOW *win, char *buffer, int limit) @@ -289,6 +289,7 @@ wGetstring(WINDOW *win, char *buffer, int limit) wmove(win, y0, x0); noecho(); } +#endif #if USE_WIDEC_SUPPORT static wchar_t @@ -1300,7 +1301,7 @@ attr_legend(WINDOW *helpwin) ++row; MvWPrintw(helpwin, row++, col, "Toggles:"); - if (use_colors) { + if (UseColors) { MvWPrintw(helpwin, row++, col, " f/F/b/B toggle foreground/background background color"); MvWPrintw(helpwin, row++, col, @@ -1319,7 +1320,7 @@ attr_legend(WINDOW *helpwin) static void show_color_attr(int fg, int bg, int tx) { - if (use_colors) { + if (UseColors) { printw(" Colors (fg %d, bg %d", fg, bg); if (tx >= 0) printw(", text %d", tx); @@ -1332,7 +1333,7 @@ cycle_color_attr(int ch, NCURSES_COLOR_T *fg, NCURSES_COLOR_T *bg, NCURSES_COLOR { bool error = FALSE; - if (use_colors) { + if (UseColors) { switch (ch) { case 'f': *fg = (NCURSES_COLOR_T) (*fg + 1); @@ -1358,12 +1359,12 @@ cycle_color_attr(int ch, NCURSES_COLOR_T *fg, NCURSES_COLOR_T *bg, NCURSES_COLOR break; } if (*fg >= COLORS) - *fg = (NCURSES_COLOR_T) min_colors; - if (*fg < min_colors) + *fg = (NCURSES_COLOR_T) MinColors; + if (*fg < MinColors) *fg = (NCURSES_COLOR_T) (COLORS - 1); if (*bg >= COLORS) - *bg = (NCURSES_COLOR_T) min_colors; - if (*bg < min_colors) + *bg = (NCURSES_COLOR_T) MinColors; + if (*bg < MinColors) *bg = (NCURSES_COLOR_T) (COLORS - 1); if (*tx >= COLORS) *tx = -1; @@ -1504,7 +1505,7 @@ show_attr(WINDOW *win, int row, int skip, bool arrow, chtype attr, const char *n } typedef struct { - attr_t attr; + chtype attr; NCURSES_CONST char *name; } ATTR_TBL; /* *INDENT-OFF* */ @@ -1541,6 +1542,46 @@ init_attr_list(ATTR_TBL * target, attr_t attrs) return result; } +#if USE_WIDEC_SUPPORT +typedef struct { + attr_t attr; + NCURSES_CONST char *name; +} W_ATTR_TBL; +/* *INDENT-OFF* */ +static const W_ATTR_TBL w_attrs_to_test[] = { + { WA_STANDOUT, "STANDOUT" }, + { WA_REVERSE, "REVERSE" }, + { WA_BOLD, "BOLD" }, + { WA_UNDERLINE, "UNDERLINE" }, + { WA_DIM, "DIM" }, + { WA_BLINK, "BLINK" }, + { WA_PROTECT, "PROTECT" }, +#ifdef WA_INVIS + { WA_INVIS, "INVISIBLE" }, +#endif +#ifdef WA_ITALIC + { WA_ITALIC, "ITALIC" }, +#endif + { WA_NORMAL, "NORMAL" }, +}; +/* *INDENT-ON* */ + +static unsigned +init_w_attr_list(W_ATTR_TBL * target, attr_t attrs) +{ + unsigned result = 0; + size_t n; + + for (n = 0; n < SIZEOF(w_attrs_to_test); ++n) { + attr_t test = w_attrs_to_test[n].attr; + if (test == WA_NORMAL || (test & attrs) != 0) { + target[result++] = w_attrs_to_test[n]; + } + } + return result; +} +#endif + static bool attr_getc(int *skip, NCURSES_COLOR_T *fg, @@ -1643,7 +1684,7 @@ attr_test(bool recur GCC_UNUSED) chtype normal = A_NORMAL | BLANK; chtype extras = (chtype) ac; - if (use_colors) { + if (UseColors) { NCURSES_PAIRS_T pair = 0; if ((fg != COLOR_BLACK) || (bg != COLOR_BLACK)) { pair = 1; @@ -1795,7 +1836,7 @@ set_wide_background(NCURSES_PAIRS_T pair) static attr_t get_wide_background(void) { - attr_t result = A_NORMAL; + attr_t result = WA_NORMAL; attr_t attr; cchar_t ch; NCURSES_PAIRS_T pair; @@ -1815,12 +1856,12 @@ wide_show_attr(WINDOW *win, int row, int skip, bool arrow, - chtype attr, + attr_t attr, NCURSES_PAIRS_T pair, const char *name) { int ncv = get_ncv(); - chtype test = attr & ~WA_ALTCHARSET; + attr_t test = attr & ~WA_ALTCHARSET; if (arrow) MvPrintw(row, COLS_PRE_ATTRS - 3, "-->"); @@ -1979,9 +2020,9 @@ x_attr_test(bool recur GCC_UNUSED) NCURSES_COLOR_T tx = -1; int ac = 0; unsigned j, k; - ATTR_TBL my_list[SIZEOF(attrs_to_test)]; - WINDOW *my_wins[SIZEOF(attrs_to_test)]; - unsigned my_size = init_attr_list(my_list, term_attrs()); + W_ATTR_TBL my_list[SIZEOF(w_attrs_to_test)]; + WINDOW *my_wins[SIZEOF(w_attrs_to_test)]; + unsigned my_size = init_w_attr_list(my_list, term_attrs()); if (my_size > 1) { for (j = 0; j < my_size; ++j) { @@ -2003,7 +2044,7 @@ x_attr_test(bool recur GCC_UNUSED) NCURSES_PAIRS_T pair = 0; NCURSES_PAIRS_T extras = 0; - if (use_colors) { + if (UseColors) { pair = (NCURSES_PAIRS_T) (fg != COLOR_BLACK || bg != COLOR_BLACK); if (pair != 0) { pair = 1; @@ -2206,7 +2247,7 @@ color_test(bool recur GCC_UNUSED) bool opt_wide = FALSE; WINDOW *helpwin; - if (!use_colors) { + if (!UseColors) { Cannot("does not support color."); return ERR; } @@ -2225,7 +2266,7 @@ color_test(bool recur GCC_UNUSED) pairs_max = PAIR_NUMBER(A_COLOR) + 1; if (colors_max * colors_max <= COLOR_PAIRS) { - int limit = (colors_max - min_colors) * (colors_max - min_colors); + int limit = (colors_max - MinColors) * (colors_max - MinColors); if (pairs_max > limit) pairs_max = limit; } else { @@ -2243,7 +2284,7 @@ color_test(bool recur GCC_UNUSED) hello = "Hello"; per_row = (col_limit / 8); } - per_row -= min_colors; + per_row -= MinColors; row_limit = (pairs_max + per_row - 1) / per_row; @@ -2252,7 +2293,7 @@ color_test(bool recur GCC_UNUSED) pairs_max, COLORS); if (colors_max != COLORS) (void) printw(" (using %d colors)", colors_max); - if (min_colors) + if (MinColors) (void) addstr(" besides 'default'"); clrtobot(); @@ -2264,7 +2305,7 @@ color_test(bool recur GCC_UNUSED) /* show color names/numbers across the top */ for (i = 0; i < per_row; i++) - show_color_name(top + 2, (i + 1) * width, i + min_colors, opt_wide); + show_color_name(top + 2, (i + 1) * width, i + MinColors, opt_wide); /* show a grid of colors, with color names/ numbers on the left */ for (i = (NCURSES_PAIRS_T) (base_row * per_row); i < pairs_max; i++) { @@ -2275,8 +2316,8 @@ color_test(bool recur GCC_UNUSED) if ((i / per_row) > row_limit) break; -#define InxToFG(i) (NCURSES_COLOR_T) ((i % (colors_max - min_colors)) + min_colors) -#define InxToBG(i) (NCURSES_COLOR_T) ((i / (colors_max - min_colors)) + min_colors) +#define InxToFG(i) (NCURSES_COLOR_T) ((i % (colors_max - MinColors)) + MinColors) +#define InxToBG(i) (NCURSES_COLOR_T) ((i / (colors_max - MinColors)) + MinColors) if (row >= 0 && move(row, col) != ERR) { NCURSES_COLOR_T fg = InxToFG(i); NCURSES_COLOR_T bg = InxToBG(i); @@ -2298,7 +2339,7 @@ color_test(bool recur GCC_UNUSED) printw("%-*.*s", width, width, hello); (void) attrset(A_NORMAL); - if ((i % per_row) == 0 && InxToFG(i) == min_colors) { + if ((i % per_row) == 0 && InxToFG(i) == MinColors) { show_color_name(row, 0, InxToBG(i), opt_wide); } ++shown; @@ -2434,7 +2475,7 @@ x_color_test(bool recur GCC_UNUSED) wchar_t *buffer = 0; WINDOW *helpwin; - if (!use_colors) { + if (!UseColors) { Cannot("does not support color."); return ERR; } @@ -2453,7 +2494,7 @@ x_color_test(bool recur GCC_UNUSED) pairs_max = (unsigned short) (-1); if (colors_max * colors_max <= COLOR_PAIRS) { - int limit = (colors_max - min_colors) * (colors_max - min_colors); + int limit = (colors_max - MinColors) * (colors_max - MinColors); if (pairs_max > limit) pairs_max = limit; } else { @@ -2470,7 +2511,7 @@ x_color_test(bool recur GCC_UNUSED) hello = "Hello"; per_row = (col_limit / 8); } - per_row -= min_colors; + per_row -= MinColors; if (opt_xchr) { make_fullwidth_text(buffer, hello); @@ -2487,7 +2528,7 @@ x_color_test(bool recur GCC_UNUSED) pairs_max, COLORS); if (colors_max != COLORS) (void) printw(" (using %d colors)", colors_max); - if (min_colors) + if (MinColors) (void) addstr(" besides 'default'"); clrtobot(); @@ -2499,7 +2540,7 @@ x_color_test(bool recur GCC_UNUSED) /* show color names/numbers across the top */ for (i = 0; i < per_row; i++) - show_color_name(top + 2, (i + 1) * width, i + min_colors, opt_wide); + show_color_name(top + 2, (i + 1) * width, i + MinColors, opt_wide); /* show a grid of colors, with color names/ numbers on the left */ for (i = (base_row * per_row); i < pairs_max; i++) { @@ -2514,11 +2555,11 @@ x_color_test(bool recur GCC_UNUSED) init_pair(pair, InxToFG(i), InxToBG(i)); (void) color_set(pair, NULL); if (opt_acsc) - attr_on(A_ALTCHARSET, NULL); + attr_on(WA_ALTCHARSET, NULL); if (opt_bold) - attr_on(A_BOLD, NULL); + attr_on(WA_BOLD, NULL); if (opt_revs) - attr_on(A_REVERSE, NULL); + attr_on(WA_REVERSE, NULL); if (opt_nums) { _nc_SPRINTF(numbered, @@ -2533,7 +2574,7 @@ x_color_test(bool recur GCC_UNUSED) addnwstr(buffer, width); (void) attr_set(A_NORMAL, 0, NULL); - if ((i % per_row) == 0 && InxToFG(i) == min_colors) { + if ((i % per_row) == 0 && InxToFG(i) == MinColors) { show_color_name(row, 0, InxToBG(i), opt_wide); } ++shown; @@ -2686,7 +2727,7 @@ reset_all_colors(void) all_colors[c].blue); } -#define okCOLOR(n) ((n) >= 0 && (n) < max_colors) +#define okCOLOR(n) ((n) >= 0 && (n) < MaxColors) #define okRGB(n) ((n) >= 0 && (n) <= 1000) #define DecodeRGB(n) (NCURSES_COLOR_T) ((n * 1000) / 0xffff) @@ -2694,10 +2735,10 @@ static void init_all_colors(bool xterm_colors, char *palette_file) { NCURSES_PAIRS_T cp; - all_colors = typeMalloc(RGB_DATA, (unsigned) max_colors); + all_colors = typeMalloc(RGB_DATA, (unsigned) MaxColors); if (!all_colors) failed("all_colors"); - for (cp = 0; cp < max_colors; ++cp) { + for (cp = 0; cp < MaxColors; ++cp) { color_content(cp, &all_colors[cp].red, &all_colors[cp].green, @@ -2715,7 +2756,7 @@ init_all_colors(bool xterm_colors, char *palette_file) raw(); noecho(); - for (n = 0; n < max_colors; ++n) { + for (n = 0; n < MaxColors; ++n) { fprintf(stderr, "\033]4;%d;?\007", n); got = (int) read(0, result, sizeof(result) - 1); if (got < 0) @@ -2779,7 +2820,7 @@ color_edit(bool recur GCC_UNUSED) int top_color; int page_size; - if (!use_colors) { + if (!UseColors) { Cannot("does not support color."); return ERR; } else if (!can_change_color()) { @@ -2799,7 +2840,7 @@ color_edit(bool recur GCC_UNUSED) page_size = (LINES - 6); erase(); - for (i = 0; i < max_colors; i++) + for (i = 0; i < MaxColors; i++) init_pair((NCURSES_PAIRS_T) i, (NCURSES_COLOR_T) COLOR_WHITE, (NCURSES_COLOR_T) i); @@ -2815,7 +2856,7 @@ color_edit(bool recur GCC_UNUSED) for (i = (NCURSES_COLOR_T) top_color; (i - top_color < page_size) - && (i < max_colors); i++) { + && (i < MaxColors); i++) { char numeric[80]; _nc_SPRINTF(numeric, _nc_SLIMIT(sizeof(numeric)) "[%d]", i); @@ -2891,7 +2932,7 @@ color_edit(bool recur GCC_UNUSED) case CTRL('f'): case KEY_NPAGE: - if (current < (max_colors - 1)) + if (current < (MaxColors - 1)) current += (page_size - 1); else beep(); @@ -2899,12 +2940,12 @@ color_edit(bool recur GCC_UNUSED) case CTRL('p'): case KEY_UP: - current = (current == 0 ? (max_colors - 1) : current - 1); + current = (current == 0 ? (MaxColors - 1) : current - 1); break; case CTRL('n'): case KEY_DOWN: - current = (current == (max_colors - 1) ? 0 : current + 1); + current = (current == (MaxColors - 1) ? 0 : current + 1); break; case '\t': @@ -2967,7 +3008,7 @@ color_edit(bool recur GCC_UNUSED) case 'm': endwin(); main_menu(FALSE); - for (i = 0; i < max_colors; i++) + for (i = 0; i < MaxColors; i++) init_pair((NCURSES_PAIRS_T) i, (NCURSES_COLOR_T) COLOR_WHITE, (NCURSES_COLOR_T) i); @@ -2984,8 +3025,8 @@ color_edit(bool recur GCC_UNUSED) if (current < 0) current = 0; - if (current >= max_colors) - current = max_colors - 1; + if (current >= MaxColors) + current = MaxColors - 1; if (current < top_color) top_color = current; if (current - top_color >= page_size) @@ -3038,12 +3079,39 @@ cycle_attr(int ch, unsigned *at_code, chtype *attr, ATTR_TBL * list, unsigned li return result; } +#if USE_WIDEC_SUPPORT +static bool +cycle_w_attr(int ch, unsigned *at_code, attr_t *attr, W_ATTR_TBL * list, unsigned limit) +{ + bool result = TRUE; + + switch (ch) { + case 'v': + if ((*at_code += 1) >= limit) + *at_code = 0; + break; + case 'V': + if (*at_code == 0) + *at_code = limit - 1; + else + *at_code -= 1; + break; + default: + result = FALSE; + break; + } + if (result) + *attr = list[*at_code].attr; + return result; +} +#endif + static bool cycle_colors(int ch, int *fg, int *bg, NCURSES_PAIRS_T *pair) { bool result = FALSE; - if (use_colors) { + if (UseColors) { result = TRUE; switch (ch) { case 'F': @@ -3160,7 +3228,7 @@ slk_test(bool recur GCC_UNUSED) c = CTRL('l'); #if HAVE_SLK_COLOR - if (use_colors) { + if (UseColors) { call_slk_color(fg, bg); } #endif @@ -3245,7 +3313,7 @@ slk_test(bool recur GCC_UNUSED) } #if HAVE_SLK_COLOR if (cycle_colors(c, &fg, &bg, &pair)) { - if (use_colors) { + if (UseColors) { call_slk_color(fg, bg); } else { beep(); @@ -3274,16 +3342,16 @@ x_slk_test(bool recur GCC_UNUSED) int c, fmt = 1; wchar_t buf[SLKLEN + 1]; char *s; - chtype attr = A_NORMAL; + attr_t attr = WA_NORMAL; unsigned at_code = 0; int fg = COLOR_BLACK; int bg = COLOR_WHITE; NCURSES_PAIRS_T pair = 0; - ATTR_TBL my_list[SIZEOF(attrs_to_test)]; - unsigned my_size = init_attr_list(my_list, term_attrs()); + W_ATTR_TBL my_list[SIZEOF(w_attrs_to_test)]; + unsigned my_size = init_w_attr_list(my_list, term_attrs()); c = CTRL('l'); - if (use_colors) { + if (UseColors) { call_slk_color(fg, bg); } do { @@ -3375,13 +3443,13 @@ x_slk_test(bool recur GCC_UNUSED) goto done; case 'F': - if (use_colors) { + if (UseColors) { fg = (NCURSES_COLOR_T) ((fg + 1) % COLORS); call_slk_color(fg, bg); } break; case 'B': - if (use_colors) { + if (UseColors) { bg = (NCURSES_COLOR_T) ((bg + 1) % COLORS); call_slk_color(fg, bg); } @@ -3392,7 +3460,7 @@ x_slk_test(bool recur GCC_UNUSED) break; #endif default: - if (cycle_attr(c, &at_code, &attr, my_list, my_size)) { + if (cycle_w_attr(c, &at_code, &attr, my_list, my_size)) { slk_attr_set(attr, (NCURSES_COLOR_T) (fg || bg), NULL); slk_touch(); slk_noutrefresh(); @@ -3400,7 +3468,7 @@ x_slk_test(bool recur GCC_UNUSED) } #if HAVE_SLK_COLOR if (cycle_colors(c, &fg, &bg, &pair)) { - if (use_colors) { + if (UseColors) { call_slk_color(fg, bg); } else { beep(); @@ -3742,7 +3810,7 @@ acs_test(bool recur GCC_UNUSED) MvPrintw(LINES - 2, 0, "Select: a=ACS, w=all x=box, %s0=C1, 1-3,+/- non-ASCII, repeat, ESC=quit", pch_kludge); - if (use_colors) { + if (UseColors) { MvPrintw(LINES - 1, 0, "v/V, f/F, b/B cycle through video attributes (%s) and color %d/%d.", my_list[at_code].name, @@ -4201,14 +4269,14 @@ x_acs_test(bool recur GCC_UNUSED) int repeat = 1; int space = ' '; int pagesize = 32; - chtype attr = A_NORMAL; + attr_t attr = WA_NORMAL; int fg = COLOR_BLACK; int bg = COLOR_BLACK; unsigned at_code = 0; NCURSES_PAIRS_T pair = 0; void (*last_show_wacs) (int, attr_t, NCURSES_PAIRS_T) = 0; - ATTR_TBL my_list[SIZEOF(attrs_to_test)]; - unsigned my_size = init_attr_list(my_list, term_attrs()); + W_ATTR_TBL my_list[SIZEOF(w_attrs_to_test)]; + unsigned my_size = init_w_attr_list(my_list, term_attrs()); do { switch (c) { @@ -4258,7 +4326,7 @@ x_acs_test(bool recur GCC_UNUSED) } else if (c == '_') { space = (space == ' ') ? '_' : ' '; last_show_wacs = 0; - } else if (cycle_attr(c, &at_code, &attr, my_list, my_size) + } else if (cycle_w_attr(c, &at_code, &attr, my_list, my_size) || cycle_colors(c, &fg, &bg, &pair)) { if (last_show_wacs != 0) break; @@ -4280,7 +4348,7 @@ x_acs_test(bool recur GCC_UNUSED) "Select: a/d/t WACS, w=all x=box, u UTF-8, ^L repaint"); MvPrintw(LINES - 3, 2, "0-9,+/- non-ASCII, repeat, _ space, ESC=quit"); - if (use_colors) { + if (UseColors) { MvPrintw(LINES - 2, 2, "v/V, f/F, b/B cycle through video attributes (%s) and color %d/%d.", my_list[at_code].name, @@ -4313,7 +4381,7 @@ sgr_attr_test(bool recur GCC_UNUSED) chtype normal = ((pass == 0 ? A_NORMAL : A_REVERSE)) | BLANK; /* Use non-default colors if possible to exercise bce a little */ - if (use_colors) { + if (UseColors) { init_pair(1, COLOR_WHITE, COLOR_BLUE); normal |= (chtype) COLOR_PAIR(1); } @@ -4994,7 +5062,7 @@ mkpanel(NCURSES_COLOR_T color, int rows, int cols, int tly, int tlx) if ((win = newwin(rows, cols, tly, tlx)) != 0) { if ((pan = new_panel(win)) == 0) { delwin(win); - } else if (use_colors) { + } else if (UseColors) { NCURSES_COLOR_T fg = (NCURSES_COLOR_T) ((color == COLOR_BLUE) ? COLOR_WHITE : COLOR_BLACK); @@ -5738,7 +5806,7 @@ pad_test(bool recur GCC_UNUSED) return ERR; } #ifdef A_COLOR - if (use_colors) { + if (UseColors) { init_pair(1, COLOR_BLACK, COLOR_GREEN); init_pair(2, COLOR_CYAN, COLOR_BLUE); wbkgd(panpad, (chtype) (COLOR_PAIR(2) | ' ')); @@ -5800,7 +5868,7 @@ flushinp_test(bool recur GCC_UNUSED) return ERR; #ifdef A_COLOR - if (use_colors) { + if (UseColors) { init_pair(2, COLOR_CYAN, COLOR_BLUE); wbkgd(subWin, (chtype) (COLOR_PAIR(2) | ' ')); } @@ -6704,7 +6772,7 @@ overlap_help(int state, int flavors[OVERLAP_FLAVORS]) "refresh %s, then %s, then doupdate.", ths, tht); break; case 1: - if (use_colors) { + if (UseColors) { flavors[row] %= 4; } else { flavors[row] %= 2; @@ -6714,7 +6782,7 @@ overlap_help(int state, int flavors[OVERLAP_FLAVORS]) "fill window %s with letter %s.", ths, ths); break; case 2: - if (use_colors) { + if (UseColors) { flavors[row] %= 4; } else { flavors[row] %= 2; @@ -7013,6 +7081,10 @@ settings_test(bool recur GCC_UNUSED) #endif show_boolean_setting("has_ic", has_ic()); show_boolean_setting("has_il", has_il()); + show_boolean_setting("has_colors", has_colors()); +#if HAVE_COLOR_CONTENT + show_boolean_setting("can_change_color", can_change_color()); +#endif Pause(); erase(); exit_curses(); @@ -7396,16 +7468,16 @@ main(int argc, char *argv[]) def_prog_mode(); /* tests, in general, will want these modes */ - use_colors = (bool) (monochrome ? FALSE : has_colors()); + UseColors = (bool) (monochrome ? FALSE : has_colors()); - if (use_colors) { + if (UseColors) { start_color(); #ifdef NCURSES_VERSION_PATCH - max_colors = COLORS; /* was > 16 ? 16 : COLORS */ + MaxColors = COLORS; /* was > 16 ? 16 : COLORS */ #if HAVE_USE_DEFAULT_COLORS if (default_colors) { use_default_colors(); - min_colors = -1; + MinColors = -1; } #if HAVE_ASSUME_DEFAULT_COLORS if (assumed_colors) @@ -7413,7 +7485,7 @@ main(int argc, char *argv[]) #endif #endif #else /* normal SVr4 curses */ - max_colors = COLORS; /* was > 8 ? 8 : COLORS */ + MaxColors = COLORS; /* was > 8 ? 8 : COLORS */ #endif max_pairs = COLOR_PAIRS; /* was > 256 ? 256 : COLOR_PAIRS */ diff --git a/test/newdemo.c b/test/newdemo.c index 462e340b..20b26d02 100644 --- a/test/newdemo.c +++ b/test/newdemo.c @@ -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.44 2017/09/04 11:49:55 tom Exp $ + * $Id: newdemo.c,v 1.45 2017/09/30 15:43:08 tom Exp $ */ #include @@ -230,9 +230,7 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED) setlocale(LC_ALL, ""); - CATCHALL(trap); - - initscr(); + InitAndCatch(initscr(), trap); if (has_colors()) start_color(); cbreak(); diff --git a/test/railroad.c b/test/railroad.c index 33dc46f1..12844cbd 100644 --- a/test/railroad.c +++ b/test/railroad.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2000-2011,2013 Free Software Foundation, Inc. * + * Copyright (c) 2000-2013,2017 Free 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.21 2013/09/28 22:02:17 tom Exp $ + * $Id: railroad.c,v 1.22 2017/09/30 17:55:22 tom Exp $ * * A simple demo of the termcap interface. */ @@ -187,10 +187,13 @@ railroad(char **args) NCURSES_CONST char *name = getenv("TERM"); char buffer[1024]; char area[1024], *ap = area; + int z; if (name == 0) name = "dumb"; - if (tgetent(buffer, name) >= 0) { + + InitAndCatch(z = tgetent(buffer, name), onsig); + if (z >= 0) { wipeit = tgetstr("ce", &ap); height = tgetnum("li"); @@ -220,8 +223,6 @@ railroad(char **args) MyShowCursor(0); - CATCHALL(onsig); - while (*args) { ShowSign(*args++); } diff --git a/test/rain.c b/test/rain.c index c51c7b0a..cd51336e 100644 --- a/test/rain.c +++ b/test/rain.c @@ -26,7 +26,7 @@ * authorization. * ****************************************************************************/ /* - * $Id: rain.c,v 1.46 2017/09/09 00:37:51 tom Exp $ + * $Id: rain.c,v 1.47 2017/09/30 18:10:05 tom Exp $ */ #include #include @@ -349,9 +349,7 @@ main(int argc, char *argv[]) setlocale(LC_ALL, ""); - CATCHALL(onsig); - - initscr(); + InitAndCatch(initscr(), onsig); if (has_colors()) { int bg = COLOR_BLACK; start_color(); diff --git a/test/savescreen.c b/test/savescreen.c index e48800db..6cd4c608 100644 --- a/test/savescreen.c +++ b/test/savescreen.c @@ -26,7 +26,7 @@ * authorization. * ****************************************************************************/ /* - * $Id: savescreen.c,v 1.34 2017/09/04 15:01:45 tom Exp $ + * $Id: savescreen.c,v 1.35 2017/09/29 23:42:22 tom Exp $ * * Demonstrate save/restore functions from the curses library. * Thomas Dickey - 2007/7/14 @@ -475,7 +475,7 @@ main(int argc, char *argv[]) continue; } if (!done) { - attr_t attr = (A_REVERSE | (attr_t) COLOR_PAIR(color * COLORS)); + chtype attr = (A_REVERSE | (chtype) COLOR_PAIR(color * COLORS)); chtype ch2 = (altchars ? MyMarker : '#'); move(y, x); AddCh(ch2 | attr); diff --git a/test/test.priv.h b/test/test.priv.h index dcfa8e75..a7cc109c 100644 --- a/test/test.priv.h +++ b/test/test.priv.h @@ -29,7 +29,7 @@ /**************************************************************************** * Author: Thomas E. Dickey 1996-on * ****************************************************************************/ -/* $Id: test.priv.h,v 1.154 2017/09/06 20:07:40 tom Exp $ */ +/* $Id: test.priv.h,v 1.158 2017/09/30 17:58:37 tom Exp $ */ #ifndef __TEST_PRIV_H #define __TEST_PRIV_H 1 @@ -683,7 +683,15 @@ extern char *numnames[], *numcodes[], *numfnames[]; extern char *strnames[], *strcodes[], *strfnames[]; #endif -#ifdef DECL_CURSES_DATA_TTYTYPE +#ifndef HAVE_CURSES_DATA_TTYTYPE +#define HAVE_CURSES_DATA_TTYTYPE 0 +#endif + +#ifndef DECL_CURSES_DATA_TTYTYPE +#define DECL_CURSES_DATA_TTYTYPE 0 +#endif + +#if !HAVE_CURSES_DATA_TTYTYPE || DECL_CURSES_DATA_TTYTYPE #define ttytype termname() #endif @@ -890,12 +898,18 @@ extern char *strnames[], *strcodes[], *strfnames[]; #define VT_ACSC "``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~" -#define CATCHALL(handler) { \ +#define CATCHALL(handler) do { \ int nsig; \ for (nsig = SIGHUP; nsig < SIGTERM; ++nsig) \ if (nsig != SIGKILL) \ signal(nsig, handler); \ - } + } while(0) + +#ifdef NCURSES_VERSION +#define InitAndCatch(init,handler) do { CATCHALL(handler); init; } while (0) +#else +#define InitAndCatch(init,handler) do { init; CATCHALL(handler); } while (0) +#endif /* * Workaround for clean(er) compile with Solaris's legacy curses. @@ -1018,9 +1032,9 @@ extern int _nc_getenv_num(const char *); * The macro likely uses unsigned values, while X/Open prototype uses int. */ #if defined(wattrset) || defined(PDCURSES) -#define AttrArg(p,a) (attr_t) ((attr_t)(p) | (attr_t)(a)) +#define AttrArg(p,a) (chtype) ((chtype)(p) | (chtype)(a)) #else -#define AttrArg(p,a) (int) ((attr_t)(p) | (attr_t)(a)) +#define AttrArg(p,a) (int) ((chtype)(p) | (chtype)(a)) #endif /* diff --git a/test/test_addchstr.c b/test/test_addchstr.c index 0a1a1290..2158d147 100644 --- a/test/test_addchstr.c +++ b/test/test_addchstr.c @@ -26,7 +26,7 @@ * authorization. * ****************************************************************************/ /* - * $Id: test_addchstr.c,v 1.23 2017/09/06 09:27:20 tom Exp $ + * $Id: test_addchstr.c,v 1.24 2017/09/28 23:10:29 tom Exp $ * * Demonstrate the waddchstr() and waddch functions. * Thomas Dickey - 2009/9/12 @@ -64,7 +64,7 @@ static bool pass_ctls = FALSE; static bool w_opt = FALSE; static int n_opt = -1; -static attr_t show_attr; +static chtype show_attr; static chtype *temp_buffer; static size_t temp_length; @@ -282,7 +282,7 @@ recursive_test(int level) doupdate(); if (has_colors()) { - show_attr = (attr_t) COLOR_PAIR(1); + show_attr = (chtype) COLOR_PAIR(1); wbkgdset(work, show_attr | ' '); } else { show_attr = A_STANDOUT; diff --git a/test/test_get_wstr.c b/test/test_get_wstr.c index 5d560bb6..f07c2e05 100644 --- a/test/test_get_wstr.c +++ b/test/test_get_wstr.c @@ -26,7 +26,7 @@ * authorization. * ****************************************************************************/ /* - * $Id: test_get_wstr.c,v 1.10 2017/07/01 20:41:03 tom Exp $ + * $Id: test_get_wstr.c,v 1.11 2017/09/28 23:10:54 tom Exp $ * * Author: Thomas E Dickey * @@ -80,14 +80,14 @@ Remainder(WINDOW *txtwin) static void ShowPrompt(WINDOW *txtwin, int limit) { - wchgat(txtwin, limit, A_REVERSE, 0, NULL); + wchgat(txtwin, limit, WA_REVERSE, 0, NULL); wnoutrefresh(txtwin); } static void MovePrompt(WINDOW *txtwin, int limit, int y, int x) { - wchgat(txtwin, Remainder(txtwin), A_NORMAL, 0, NULL); + wchgat(txtwin, Remainder(txtwin), WA_NORMAL, 0, NULL); wmove(txtwin, y, x); ShowPrompt(txtwin, limit); } diff --git a/test/test_getstr.c b/test/test_getstr.c index bb1c1265..227394b1 100644 --- a/test/test_getstr.c +++ b/test/test_getstr.c @@ -26,7 +26,7 @@ * authorization. * ****************************************************************************/ /* - * $Id: test_getstr.c,v 1.12 2017/07/01 20:34:55 tom Exp $ + * $Id: test_getstr.c,v 1.13 2017/09/28 23:11:12 tom Exp $ * * Author: Thomas E Dickey * @@ -87,14 +87,14 @@ Remainder(WINDOW *txtwin) static void ShowPrompt(WINDOW *txtwin, int limit) { - wchgat(txtwin, limit, A_REVERSE, 0, NULL); + wchgat(txtwin, limit, WA_REVERSE, 0, NULL); wnoutrefresh(txtwin); } static void MovePrompt(WINDOW *txtwin, int limit, int y, int x) { - wchgat(txtwin, Remainder(txtwin), A_NORMAL, 0, NULL); + wchgat(txtwin, Remainder(txtwin), WA_NORMAL, 0, NULL); wmove(txtwin, y, x); ShowPrompt(txtwin, limit); } diff --git a/test/view.c b/test/view.c index 1f960b9a..e24628e2 100644 --- a/test/view.c +++ b/test/view.c @@ -50,7 +50,7 @@ * scroll operation worked, and the refresh() code only had to do a * partial repaint. * - * $Id: view.c,v 1.102 2017/09/04 00:39:24 tom Exp $ + * $Id: view.c,v 1.104 2017/09/30 17:50:38 tom Exp $ */ #include @@ -259,6 +259,7 @@ main(int argc, char *argv[]) int value = 0; bool done = FALSE; bool got_number = FALSE; + bool ignore_sigs = FALSE; bool single_step = FALSE; #if CAN_RESIZE bool nonposix_resize = FALSE; @@ -281,7 +282,7 @@ main(int argc, char *argv[]) try_color = TRUE; break; case 'i': - CATCHALL(SIG_IGN); + ignore_sigs = TRUE; break; case 'n': if ((MAXLINES = atoi(optarg)) < 1 || @@ -388,7 +389,11 @@ main(int argc, char *argv[]) (void) fclose(fp); num_lines = (int) (lptr - vec_lines); - (void) initscr(); /* initialize the curses library */ + if (ignore_sigs) { + InitAndCatch(initscr(), SIG_IGN); + } else { + initscr(); + } keypad(stdscr, TRUE); /* enable keyboard mapping */ (void) nonl(); /* tell curses not to do NL->CR/NL on output */ (void) cbreak(); /* take input chars one at a time, no wait for \n */ @@ -641,7 +646,7 @@ show_all(const char *tag) } #if defined(NCURSES_VERSION) || defined(HAVE_WCHGAT) if (try_color) - wchgat(stdscr, -1, A_NORMAL, my_pair, NULL); + wchgat(stdscr, -1, WA_NORMAL, my_pair, NULL); #endif } } diff --git a/test/xmas.c b/test/xmas.c index fbbf4f4f..f66ba6f0 100644 --- a/test/xmas.c +++ b/test/xmas.c @@ -92,7 +92,7 @@ /******************************************************************************/ /* - * $Id: xmas.c,v 1.31 2017/09/08 09:21:02 tom Exp $ + * $Id: xmas.c,v 1.33 2017/09/30 19:14:13 tom Exp $ */ #include @@ -454,37 +454,31 @@ blinkit(void) switch (cycle) { case 0: overlay(treescrn3, treescrn8); - wrefresh(treescrn8); - wrefresh(w_del_msg); break; case 1: overlay(treescrn4, treescrn8); - wrefresh(treescrn8); - wrefresh(w_del_msg); break; case 2: overlay(treescrn5, treescrn8); - wrefresh(treescrn8); - wrefresh(w_del_msg); break; case 3: overlay(treescrn6, treescrn8); - wrefresh(treescrn8); - wrefresh(w_del_msg); break; case 4: overlay(treescrn7, treescrn8); - wrefresh(treescrn8); - wrefresh(w_del_msg); break; } touchwin(treescrn8); + wrefresh(treescrn8); + wrefresh(w_del_msg); + look_out(50); /*ALL ON************************************************** */ overlay(treescrn, treescrn8); wrefresh(treescrn8); wrefresh(w_del_msg); + look_out(50); ++cycle; return (0); @@ -642,8 +636,6 @@ reindeer(void) static void done(int sig GCC_UNUSED) { - CATCHALL(done); - move(LINES - 1, 0); refresh(); exit_curses(); @@ -705,13 +697,11 @@ main(int argc, char *argv[]) setlocale(LC_ALL, ""); - initscr(); + InitAndCatch(initscr(), done); noecho(); nonl(); refresh(); - CATCHALL(done); - if (has_colors()) { start_color(); #if HAVE_USE_DEFAULT_COLORS