###
diff --git a/CHANGES b/CHANGES
index ea89632..193fa21 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,9 +1,66 @@
--- $Id: CHANGES,v 1.419 2012/07/06 18:18:48 tom Exp $
+-- $Id: CHANGES,v 1.458 2013/05/24 00:23:22 tom Exp $
-- Thomas E. Dickey
This version of dialog was originally from a Debian snapshot. I've done this
to it:
+2013/05/23
+ + modify ifdef in arrows.c to work around packages which use the
+ wide-character ncursesw headers with the ncurses library (report
+ by Aleksey Cheusov).
+ + correct workaround for xterm alternate-screen to work with/without
+ the fix made in ncurses that makes putp() always write to the
+ standard output (Debian #708829).
+ + improve limit-checks for checklist, in case the dialog is resized
+ (report by Ilya A Arkhipov).
+ + add --last-key option (adapted from patch by Jordi Pujol, Debian
+ #697607).
+
+2013/03/15
+ + update zh_TW.po, add an.po from
+ http://translationproject.org/latest/dialog/
+
+2012/12/30 - release 1.2
+ + improve some older changelog entries to help with HTML'izing content.
+ + various fixes/improvments for scrollbar appearance.
+ + add mappings for some equivalent options provided by whiptail;
+ add configure option --disable-whiptail to allow suppressing these.
+ + add configure option --disable-Xdialog2 to allow suppressing the
+ newer features, i.e., for cdialog 1.2
+ + add --no-items option, for consistency.
+ + add --no-tags option, like Xdialog.
+ + add buildlist, rangebox and treeview dialogs, like Xdialog.
+ + remove obsolete workaround for ncurses 4.2 scrolling in checklist
+ and menubox.
+ + improve dialog_helpfile() by preventing it from showing extra buttons
+ (suggested by xDog Walker).
+ + correct logic in formbox's scroll_next() function (report by xDog
+ Walker).
+ + fix a case with inputbox widget where preset input text is not shown
+ until moving the cursor within the text (report by xDog Walker).
+ + handle SIGCHLD in dialog_prgbox() to eliminate defunct processes
+ (report by xDog Walker).
+ + improve the way "hotkeys" are assigned to widget buttons by checking
+ if a given key has already been used in the row of buttons (Debian
+ #684933).
+ + amend fix for --trace parsing from 2012/07/03, which sometimes
+ skipped a parameter (report by xDog Walker).
+ + drop copismall and install files from samples, which were essentially
+ nonfunctional.
+ + correct secondary border colors in samples/slackware.rc and
+ samples/whiptail.rc
+ + update gl.po, add ia.po from
+ http://translationproject.org/latest/dialog/
+ + fix various issues reported by coverity scan.
+ + miscellaneous configure script fixes/updates:
+ + require autoconf 2.52+patches
+ + support --datarootdir option
+ + check for clang compiler
+ + check for tinfo library when looking for ncurses
+ + add 3rd parameter to AC_DEFINE for autoheader
+ + remove unused macros from aclocal.m4
+ + update config.guess, config.sub
+
2012/07/06
+ modify samples/setup-tempfile to work with Tru64's shell.
+ modify inputmenu sample scripts to make them more portable:
@@ -558,7 +615,8 @@ to it:
+ use $(INSTALL_SCRIPT) for installing dialog-config (report by
Santiago Vila).
-2007/02/27
+2007/02/27 - release 1.1
+ + mark as "dialog 1.1"
+ add dialog-config script, which provides applications with compile-
and link-information for using the dialog library.
+ move calls to dlg_trim_string() out of loop in dialog.c, so each
@@ -791,8 +849,7 @@ to it:
+ modify tailboxbg by resetting tty modes at the point where it forks a
process to update the screen, rather than waiting until that process
exits. This improves user feedback by making it apparent that dialog
- is no longer processing input after that point (Redhat Bugzilla
- #142538).
+ is no longer processing input after that point (Redhat #142538).
+ minor updates to some .po files using Babel Fish, comparing with lynx.
+ update es.po (Santiago Vila).
+ work around bug in NetBSD 1.6 curses which seems to be confused by
@@ -978,8 +1035,7 @@ to it:
before dialog is invoked (Debian #244746).
+ correct dlg_match_char() function, which was broken during rewrite
to support wide-characters (Debian #244777).
- + improved ru.po, uses UTF-8 charset (Leonid Kanter, Redhat Bugzilla
- #119200).
+ + improved ru.po, uses UTF-8 charset (Leonid Kanter, Redhat #119200).
+ correct position of shadow drawn for dialogs, which appeared to work
for most versions of curses (other than NetBSD) but would have been
visible for certain color schemes (discussion with Julian Coleman).
@@ -1310,7 +1366,7 @@ to it:
the --stdout option does not work on HPUX but otherwise dialog works.
+ updated el.po (patch by kromJx
-2002/05/19
+2002/05/19 - release 0.9b
+ add --no-collapse option to allow one to retain tabs and repeated
blanks in a message box (request by Roberto Simoni).
+ use DLG_EXIT_ESC constant rather than -1's in several places. This
@@ -1778,15 +1834,15 @@ to it:
Santiago Vila
1999/10/07
- + add a password dialog box.
+ + add a password dialog box (Debian #45964, patch by Joey Hess).
+ implement "--defaultno" option to specify if the default for
- the yes/no box is "No".
+ the yes/no box is "No" (Debian #46076, patch by Joey Hess).
1999/03/10
+ modify input.c to clear the input field to the right of the
- given string (unclear: this seems redundant, since the
- dialog is drawn in a new window).
+ given string, to help with screen-refresh
1998/12/08
- + check for list_height less than one in checklist.c
+ + check for list_height less than one in checklist.c (Debian
+ #22239).
1998/10/21
+ use function wscrl() in preference to scroll() in checklist.c
and menubox.c (unclear: in ncurses, scroll() is a macro that
@@ -1796,12 +1852,14 @@ to it:
that directory.
1998/09/12
+ simplify menubox.c using new functions print_arrows() and
- print_items().
- + add logic to handle KEY_NPAGE and KEY_PPAGE.
- + change sample scripts to use Debian tempfile utility rather
- than putting files into /tmp.
- + change sample scripts to use 'dialog' from user's path rather
- than in the parent directory as in the build directory.
+ print_items(). add logic to handle KEY_NPAGE and KEY_PPAGE
+ (Debian #26326).
+ + modifications to provide sample scripts (Debian #26211):
+ + change sample scripts to use Debian tempfile utility rather
+ than putting files into /tmp.
+ + change sample scripts to use 'dialog' from user's path
+ rather than in the parent directory as in the build
+ directory.
+ use the system copy of GPL rather than that in the build
directory as an example for the textbox script.
@@ -1827,16 +1885,16 @@ The relevant portions of the Debian change log for the original version
1998/05/24
+ Replaced guage.c by the one in dialog 0.6z, which is known to work.
- Fixes Bug #18284: unstable dialog.
+ Fixes Debian #18284: unstable dialog.
1997/12/16
+ dialog.c: dialog_input_result printed with "%s" format. This was
- Bug #9913, fixed by Bill Mitchell, but the change was lost.
+ Debian #9913, fixed by Bill Mitchell, but the change was lost.
+ Pristine source, .depend is not removed in clean target. Instead, it
- is made zero lenght (otherwise it would not work *without* fakeroot).
- + Added '^U' support in input box (Bug #9915, patch by joey@debian.org).
- + Wrote patch to fix core-dumping problem (Bug #13170). Sven Rudolph
+ is made zero length (otherwise it would not work *without* fakeroot).
+ + Added '^U' support in input box (Debian #9915, patch by Joey Hess).
+ + Wrote patch to fix core-dumping problem (Debian #13170). Sven Rudolph
-- vile:fk=8bit
diff --git a/VERSION b/VERSION
index 8c3a188..4001e25 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-10:4:0 1.1 20120706
+11:1:0 1.2 20130523
diff --git a/aclocal.m4 b/aclocal.m4
index 0c50c22..4fb129e 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,5 +1,5 @@
dnl macros used for DIALOG configure script
-dnl $Id: aclocal.m4,v 1.87 2012/02/16 02:11:26 tom Exp $
+dnl $Id: aclocal.m4,v 1.90 2012/12/02 20:07:30 tom Exp $
dnl ---------------------------------------------------------------------------
dnl Copyright 1999-2011,2012 -- Thomas E. Dickey
dnl
@@ -31,23 +31,21 @@ dnl see
dnl http://invisible-island.net/autoconf/
dnl ---------------------------------------------------------------------------
dnl ---------------------------------------------------------------------------
-dnl AM_GNU_GETTEXT version: 12 updated: 2010/06/19 07:02:11
+dnl AM_GNU_GETTEXT version: 13 updated: 2012/11/09 05:47:26
dnl --------------
dnl Usage: Just like AM_WITH_NLS, which see.
AC_DEFUN([AM_GNU_GETTEXT],
[AC_REQUIRE([AC_PROG_MAKE_SET])dnl
- AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_CANONICAL_HOST])dnl
AC_REQUIRE([AC_PROG_RANLIB])dnl
- AC_REQUIRE([AC_ISC_POSIX])dnl
AC_REQUIRE([AC_HEADER_STDC])dnl
- AC_REQUIRE([AC_C_CONST])dnl
AC_REQUIRE([AC_C_INLINE])dnl
AC_REQUIRE([AC_TYPE_OFF_T])dnl
AC_REQUIRE([AC_TYPE_SIZE_T])dnl
AC_REQUIRE([AC_FUNC_ALLOCA])dnl
AC_REQUIRE([AC_FUNC_MMAP])dnl
AC_REQUIRE([jm_GLIBC21])dnl
+ AC_REQUIRE([CF_PROG_CC])dnl
AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
stdlib.h string.h unistd.h sys/param.h])
@@ -282,7 +280,7 @@ fi
AC_SUBST($1)dnl
])dnl
dnl ---------------------------------------------------------------------------
-dnl AM_WITH_NLS version: 24 updated: 2010/06/20 09:24:28
+dnl AM_WITH_NLS version: 25 updated: 2012/10/06 08:57:51
dnl -----------
dnl Inserted as requested by gettext 0.10.40
dnl File from /usr/share/aclocal
@@ -385,7 +383,7 @@ AC_DEFUN([AM_WITH_NLS],
LIBS="$cf_save_LIBS_1"
if test "$cf_cv_func_gettext" = yes ; then
- AC_DEFINE(HAVE_LIBINTL_H)
+ AC_DEFINE(HAVE_LIBINTL_H,1,[Define to 1 if we have libintl.h])
dnl If an already present or preinstalled GNU gettext() is found,
dnl use it. But if this macro is used in GNU gettext, and GNU
@@ -592,14 +590,14 @@ changequote([,])dnl
AC_SUBST(GENCAT)
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_ACVERSION_CHECK version: 2 updated: 2011/05/08 11:22:03
+dnl CF_ACVERSION_CHECK version: 3 updated: 2012/10/03 18:39:53
dnl ------------------
dnl Conditionally generate script according to whether we're using a given autoconf.
dnl
dnl $1 = version to compare against
dnl $2 = code to use if AC_ACVERSION is at least as high as $1.
dnl $3 = code to use if AC_ACVERSION is older than $1.
-define(CF_ACVERSION_CHECK,
+define([CF_ACVERSION_CHECK],
[
ifdef([m4_version_compare],
[m4_if(m4_version_compare(m4_defn([AC_ACVERSION]), [$1]), -1, [$3], [$2])],
@@ -607,26 +605,16 @@ ifdef([m4_version_compare],
AC_PREREQ_CANON(AC_PREREQ_SPLIT([$1])),
AC_PREREQ_CANON(AC_PREREQ_SPLIT(AC_ACVERSION)), AC_ACVERSION, [$2], [$3])])])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_ACVERSION_COMPARE version: 2 updated: 2011/04/14 20:56:50
+dnl CF_ACVERSION_COMPARE version: 3 updated: 2012/10/03 18:39:53
dnl --------------------
dnl CF_ACVERSION_COMPARE(MAJOR1, MINOR1, TERNARY1,
dnl MAJOR2, MINOR2, TERNARY2,
dnl PRINTABLE2, not FOUND, FOUND)
-define(CF_ACVERSION_COMPARE,
+define([CF_ACVERSION_COMPARE],
[ifelse(builtin([eval], [$2 < $5]), 1,
[ifelse([$8], , ,[$8])],
[ifelse([$9], , ,[$9])])])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_AC_PREREQ version: 2 updated: 1997/09/06 13:24:56
-dnl ------------
-dnl Conditionally generate script according to whether we're using the release
-dnl version of autoconf, or a patched version (using the ternary component as
-dnl the patch-version).
-define(CF_AC_PREREQ,
-[CF_PREREQ_COMPARE(
-AC_PREREQ_CANON(AC_PREREQ_SPLIT(AC_ACVERSION)),
-AC_PREREQ_CANON(AC_PREREQ_SPLIT([$1])), [$1], [$2], [$3])])dnl
-dnl ---------------------------------------------------------------------------
dnl CF_ADD_CFLAGS version: 10 updated: 2010/05/26 05:38:42
dnl -------------
dnl Copy non-preprocessor flags to $CFLAGS, preprocessor flags to $CPPFLAGS
@@ -901,12 +889,6 @@ dnl Allow user to disable a normally-on option.
AC_DEFUN([CF_ARG_DISABLE],
[CF_ARG_OPTION($1,[$2],[$3],[$4],yes)])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_ARG_ENABLE version: 3 updated: 1999/03/30 17:24:31
-dnl -------------
-dnl Allow user to enable a normally-off option.
-AC_DEFUN([CF_ARG_ENABLE],
-[CF_ARG_OPTION($1,[$2],[$3],[$4],no)])dnl
-dnl ---------------------------------------------------------------------------
dnl CF_ARG_MSG_ENABLE version: 2 updated: 2000/07/29 19:32:03
dnl -----------------
dnl Verbose form of AC_ARG_ENABLE:
@@ -952,7 +934,7 @@ ifelse([$3],,[ :]dnl
])dnl
])])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_BUNDLED_INTL version: 16 updated: 2010/10/23 15:55:05
+dnl CF_BUNDLED_INTL version: 17 updated: 2012/10/06 08:57:51
dnl ---------------
dnl Top-level macro for configuring an application with a bundled copy of
dnl the intl and po directories for gettext.
@@ -1009,7 +991,7 @@ if test "$USE_NLS" = yes ; then
[ --with-textdomain=PKG NLS text-domain (default is package name)],
[NLS_TEXTDOMAIN=$withval],
[NLS_TEXTDOMAIN=$PACKAGE])
- AC_DEFINE_UNQUOTED(NLS_TEXTDOMAIN,"$NLS_TEXTDOMAIN")
+ AC_DEFINE_UNQUOTED(NLS_TEXTDOMAIN,"$NLS_TEXTDOMAIN",[Define to the nls textdomain value])
AC_SUBST(NLS_TEXTDOMAIN)
fi
@@ -1029,7 +1011,7 @@ if test "$USE_INCLUDED_LIBINTL" = yes ; then
INTLDIR_MAKE="#"
fi
if test -z "$INTLDIR_MAKE"; then
- AC_DEFINE(HAVE_LIBGETTEXT_H)
+ AC_DEFINE(HAVE_LIBGETTEXT_H,1,[Define to 1 if we have libgettext.h])
for cf_makefile in \
$srcdir/intl/Makefile.in \
$srcdir/intl/makefile.in
@@ -1072,17 +1054,43 @@ dnl own code, except ENABLE_NLS, which is too vague to be of any use.
if test "$USE_INCLUDED_LIBINTL" = yes ; then
if test "$nls_cv_force_use_gnu_gettext" = yes ; then
- AC_DEFINE(HAVE_GETTEXT)
+ AC_DEFINE(HAVE_GETTEXT,1,[Define to 1 if we have gettext function])
elif test "$nls_cv_use_gnu_gettext" = yes ; then
- AC_DEFINE(HAVE_GETTEXT)
+ AC_DEFINE(HAVE_GETTEXT,1,[Define to 1 if we have gettext function])
fi
if test -n "$nls_cv_header_intl" ; then
- AC_DEFINE(HAVE_LIBINTL_H)
+ AC_DEFINE(HAVE_LIBINTL_H,1,[Define to 1 if we have header-file for libintl])
fi
fi
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_CHECK_CACHE version: 11 updated: 2008/03/23 14:45:59
+dnl CF_CC_ENV_FLAGS version: 1 updated: 2012/10/03 05:25:49
+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 with
+dnl options, but eliminates a more common category of user confusion.
+AC_DEFUN([CF_CC_ENV_FLAGS],
+[
+# This should have been defined by AC_PROG_CC
+: ${CC:=cc}
+
+AC_MSG_CHECKING(\$CC variable)
+case "$CC" in #(vi
+*[[\ \ ]]-[[IUD]]*)
+ AC_MSG_RESULT(broken)
+ AC_MSG_WARN(your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options)
+ # humor him...
+ cf_flags=`echo "$CC" | sed -e 's/^[[^ ]]*[[ ]]//'`
+ CC=`echo "$CC" | sed -e 's/[[ ]].*//'`
+ CF_ADD_CFLAGS($cf_flags)
+ ;;
+*)
+ AC_MSG_RESULT(ok)
+ ;;
+esac
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_CHECK_CACHE version: 12 updated: 2012/10/02 20:55:03
dnl --------------
dnl Check if we're accidentally using a cache from a different machine.
dnl Derive the system name, as a check for reusing the autoconf cache.
@@ -1105,7 +1113,7 @@ else
system_name="`(hostname) 2>/dev/null`"
fi
fi
-test -n "$system_name" && AC_DEFINE_UNQUOTED(SYSTEM_NAME,"$system_name")
+test -n "$system_name" && AC_DEFINE_UNQUOTED(SYSTEM_NAME,"$system_name",[Define to the system name.])
AC_CACHE_VAL(cf_cv_system_name,[cf_cv_system_name="$system_name"])
test -z "$system_name" && system_name="$cf_cv_system_name"
@@ -1117,7 +1125,40 @@ if test ".$system_name" != ".$cf_cv_system_name" ; then
fi
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_CURSES_CHTYPE version: 7 updated: 2010/10/23 15:54:49
+dnl CF_CLANG_COMPILER version: 1 updated: 2012/06/16 14:55:39
+dnl -----------------
+dnl Check if the given compiler is really clang. clang's C driver defines
+dnl __GNUC__ (fooling the configure script into setting $GCC to yes) but does
+dnl not ignore some gcc options.
+dnl
+dnl This macro should be run "soon" after AC_PROG_CC or AC_PROG_CPLUSPLUS, to
+dnl ensure that it is not mistaken for gcc/g++. It is normally invoked from
+dnl the wrappers for gcc and g++ warnings.
+dnl
+dnl $1 = GCC (default) or GXX
+dnl $2 = INTEL_COMPILER (default) or INTEL_CPLUSPLUS
+dnl $3 = CFLAGS (default) or CXXFLAGS
+AC_DEFUN([CF_CLANG_COMPILER],[
+ifelse([$2],,CLANG_COMPILER,[$2])=no
+
+if test "$ifelse([$1],,[$1],GCC)" = yes ; then
+ AC_MSG_CHECKING(if this is really Clang ifelse([$1],GXX,C++,C) compiler)
+ cf_save_CFLAGS="$ifelse([$3],,CFLAGS,[$3])"
+ ifelse([$3],,CFLAGS,[$3])="$ifelse([$3],,CFLAGS,[$3]) -Qunused-arguments"
+ AC_TRY_COMPILE([],[
+#ifdef __clang__
+#else
+make an error
+#endif
+],[ifelse([$2],,CLANG_COMPILER,[$2])=yes
+cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
+],[])
+ ifelse([$3],,CFLAGS,[$3])="$cf_save_CFLAGS"
+ AC_MSG_RESULT($ifelse([$2],,CLANG_COMPILER,[$2]))
+fi
+])
+dnl ---------------------------------------------------------------------------
+dnl CF_CURSES_CHTYPE version: 8 updated: 2012/10/06 08:57:51
dnl ----------------
dnl Test if curses defines 'chtype' (usually a 'long' type for SysV curses).
AC_DEFUN([CF_CURSES_CHTYPE],
@@ -1129,14 +1170,14 @@ AC_CACHE_CHECK(for chtype typedef,cf_cv_chtype_decl,[
[cf_cv_chtype_decl=yes],
[cf_cv_chtype_decl=no])])
if test $cf_cv_chtype_decl = yes ; then
- AC_DEFINE(HAVE_TYPE_CHTYPE)
+ AC_DEFINE(HAVE_TYPE_CHTYPE,1,[Define to 1 if chtype is declared])
AC_CACHE_CHECK(if chtype is scalar or struct,cf_cv_chtype_type,[
AC_TRY_COMPILE([#include <${cf_cv_ncurses_header:-curses.h}>],
[chtype foo; long x = foo],
[cf_cv_chtype_type=scalar],
[cf_cv_chtype_type=struct])])
if test $cf_cv_chtype_type = scalar ; then
- AC_DEFINE(TYPE_CHTYPE_IS_SCALAR)
+ AC_DEFINE(TYPE_CHTYPE_IS_SCALAR,1,[Define to 1 if chtype is a scaler/integer])
fi
fi
])dnl
@@ -1252,7 +1293,7 @@ fi
AC_CHECK_HEADERS($cf_cv_ncurses_header)
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_CURSES_LIBS version: 35 updated: 2011/08/09 21:06:37
+dnl CF_CURSES_LIBS version: 36 updated: 2012/07/07 21:02:48
dnl --------------
dnl Look for the curses libraries. Older curses implementations may require
dnl termcap/termlib to be linked as well. Call CF_CURSES_CPPFLAGS first.
@@ -1332,7 +1373,7 @@ if test ".$ac_cv_func_initscr" != .yes ; then
# Check for library containing tgoto. Do this before curses library
# because it may be needed to link the test-case for initscr.
AC_CHECK_FUNC(tgoto,[cf_term_lib=predefined],[
- for cf_term_lib in $cf_check_list otermcap termcap termlib unknown
+ for cf_term_lib in $cf_check_list otermcap termcap tinfo termlib unknown
do
AC_CHECK_LIB($cf_term_lib,tgoto,[break])
done
@@ -1376,7 +1417,7 @@ fi
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_CURSES_TERM_H version: 9 updated: 2011/04/09 18:19:55
+dnl CF_CURSES_TERM_H version: 10 updated: 2012/10/06 08:57:51
dnl ----------------
dnl SVr4 curses should have term.h as well (where it puts the definitions of
dnl the low-level interface). This may not be true in old/broken implementations,
@@ -1435,18 +1476,18 @@ esac
case $cf_cv_term_header in #(vi
term.h) #(vi
- AC_DEFINE(HAVE_TERM_H)
+ AC_DEFINE(HAVE_TERM_H,1,[Define to 1 if we have term.h])
;;
ncurses/term.h) #(vi
- AC_DEFINE(HAVE_NCURSES_TERM_H)
+ AC_DEFINE(HAVE_NCURSES_TERM_H,1,[Define to 1 if we have ncurses/term.h])
;;
ncursesw/term.h)
- AC_DEFINE(HAVE_NCURSESW_TERM_H)
+ AC_DEFINE(HAVE_NCURSESW_TERM_H,1,[Define to 1 if we have ncursesw/term.h])
;;
esac
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_CURSES_UNCTRL_H version: 1 updated: 2011/04/09 18:19:55
+dnl CF_CURSES_UNCTRL_H version: 2 updated: 2012/10/06 08:57:51
dnl ------------------
dnl Any X/Open curses implementation must have unctrl.h, but ncurses packages
dnl may put it in a subdirectory (along with ncurses' other headers, of
@@ -1490,18 +1531,18 @@ esac
case $cf_cv_unctrl_header in #(vi
unctrl.h) #(vi
- AC_DEFINE(HAVE_UNCTRL_H)
+ AC_DEFINE(HAVE_UNCTRL_H,1,[Define to 1 if we have unctrl.h])
;;
ncurses/unctrl.h) #(vi
- AC_DEFINE(HAVE_NCURSES_UNCTRL_H)
+ AC_DEFINE(HAVE_NCURSES_UNCTRL_H,1,[Define to 1 if we have ncurses/unctrl.h])
;;
ncursesw/unctrl.h)
- AC_DEFINE(HAVE_NCURSESW_UNCTRL_H)
+ AC_DEFINE(HAVE_NCURSESW_UNCTRL_H,1,[Define to 1 if we have ncursesw/unctrl.h])
;;
esac
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_CURSES_WACS_MAP version: 5 updated: 2011/01/15 11:28:59
+dnl CF_CURSES_WACS_MAP version: 6 updated: 2012/10/06 08:57:51
dnl ------------------
dnl Check for likely values of wacs_map[].
AC_DEFUN([CF_CURSES_WACS_MAP],
@@ -1520,10 +1561,10 @@ AC_CACHE_CHECK(for wide alternate character set array, cf_cv_curses_wacs_map,[
break])
done])
-test "$cf_cv_curses_wacs_map" != unknown && AC_DEFINE_UNQUOTED(CURSES_WACS_ARRAY,$cf_cv_curses_wacs_map)
+test "$cf_cv_curses_wacs_map" != unknown && AC_DEFINE_UNQUOTED(CURSES_WACS_ARRAY,$cf_cv_curses_wacs_map,[Define to name of (n)curses wide-character array])
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_CURSES_WACS_SYMBOLS version: 1 updated: 2011/01/15 11:28:59
+dnl CF_CURSES_WACS_SYMBOLS version: 2 updated: 2012/10/06 08:57:51
dnl ----------------------
dnl Do a check to see if the WACS_xxx constants are defined compatibly with
dnl X/Open Curses. In particular, NetBSD's implementation of the WACS_xxx
@@ -1555,10 +1596,10 @@ else
fi
])
-test "$cf_cv_curses_wacs_symbols" != no && AC_DEFINE(CURSES_WACS_SYMBOLS)
+test "$cf_cv_curses_wacs_symbols" != no && AC_DEFINE(CURSES_WACS_SYMBOLS,1,[Define to 1 if (n)curses supports wide-character WACS_ symbols])
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_CURSES_WGETPARENT version: 2 updated: 2011/10/17 20:12:04
+dnl CF_CURSES_WGETPARENT version: 3 updated: 2012/10/06 08:57:51
dnl --------------------
dnl Check for curses support for directly determining the parent of a given
dnl window. Some implementations make this difficult, so we provide for
@@ -1577,7 +1618,7 @@ then
AC_MSG_RESULT($cf_window__parent)
if test "$cf_window__parent" = yes
then
- AC_DEFINE(HAVE_WINDOW__PARENT)
+ AC_DEFINE(HAVE_WINDOW__PARENT,1,[Define to 1 if WINDOW struct has _parent member])
fi
fi
])dnl
@@ -1587,7 +1628,7 @@ dnl ----------
dnl "dirname" is not portable, so we fake it with a shell script.
AC_DEFUN([CF_DIRNAME],[$1=`echo $2 | sed -e 's%/[[^/]]*$%%'`])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_DISABLE_ECHO version: 11 updated: 2009/12/13 13:16:57
+dnl CF_DISABLE_ECHO version: 12 updated: 2012/10/06 16:30:28
dnl ---------------
dnl You can always use "make -n" to see the actual options, but it's hard to
dnl pick out/analyze warning messages when the compile-line is long.
@@ -1602,7 +1643,7 @@ dnl
AC_DEFUN([CF_DISABLE_ECHO],[
AC_MSG_CHECKING(if you want to see long compiling messages)
CF_ARG_DISABLE(echo,
- [ --disable-echo display "compiling" commands],
+ [ --disable-echo do not display "compiling" commands],
[
ECHO_LT='--silent'
ECHO_LD='@echo linking [$]@;'
@@ -1667,38 +1708,6 @@ if test "$cf_disable_rpath_hack" = no ; then
fi
])
dnl ---------------------------------------------------------------------------
-dnl CF_FIND_HEADER version: 2 updated: 2007/07/29 11:32:00
-dnl --------------
-dnl Find a header file, searching for it if it is not already in the include
-dnl path.
-dnl
-dnl $1 = the header filename
-dnl $2 = the package name
-dnl $3 = action to perform if successful
-dnl $4 = action to perform if not successful
-AC_DEFUN([CF_FIND_HEADER],[
-AC_CHECK_HEADER([$1],
- cf_find_header=yes,[
- cf_find_header=no
-CF_HEADER_PATH(cf_search,$2)
-for cf_incdir in $cf_search
-do
- if test -f $cf_incdir/$1 ; then
- CF_ADD_INCDIR($cf_incdir)
- CF_VERBOSE(... found in $cf_incdir)
- cf_find_header=yes
- break
- fi
- CF_VERBOSE(... tested $cf_incdir)
-done
-])
-if test "$cf_find_header" = yes ; then
-ifelse([$3],,:,[$3])
-ifelse([$4],,,[else
-$4])
-fi
-])dnl
-dnl ---------------------------------------------------------------------------
dnl CF_FIND_LIBRARY version: 9 updated: 2008/03/23 14:48:54
dnl ---------------
dnl Look for a non-standard library, given parameters for AC_TRY_LINK. We
@@ -1879,7 +1888,7 @@ ifelse([$5],,AC_MSG_WARN(Cannot find $3 library),[$5])
fi
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_FUNC_WAIT version: 2 updated: 1997/10/21 19:45:33
+dnl CF_FUNC_WAIT version: 3 updated: 2012/10/06 08:57:51
dnl ------------
dnl Test for the presence of
dnl and/or 'waitpid()'.
@@ -1904,7 +1913,7 @@ if test $cf_cv_type_unionwait = yes; then
[cf_cv_arg_union_wait=no])
])
AC_MSG_RESULT($cf_cv_arg_union_wait)
- test $cf_cv_arg_union_wait = yes && AC_DEFINE(WAIT_USES_UNION)
+ test $cf_cv_arg_union_wait = yes && AC_DEFINE(WAIT_USES_UNION,1,[Define to 1 if wait() uses a union parameter])
AC_MSG_CHECKING(if union wait can be used as waitpid-arg)
AC_CACHE_VAL(cf_cv_arg_union_waitpid,[
@@ -1914,12 +1923,12 @@ if test $cf_cv_type_unionwait = yes; then
[cf_cv_arg_union_waitpid=no])
])
AC_MSG_RESULT($cf_cv_arg_union_waitpid)
- test $cf_cv_arg_union_waitpid = yes && AC_DEFINE(WAITPID_USES_UNION)
+ test $cf_cv_arg_union_waitpid = yes && AC_DEFINE(WAITPID_USES_UNION,1,[Define to 1 if waitpid() uses a union parameter])
fi
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_GCC_ATTRIBUTES version: 14 updated: 2010/10/23 15:52:32
+dnl CF_GCC_ATTRIBUTES version: 16 updated: 2012/10/02 20:55:03
dnl -----------------
dnl Test for availability of useful gcc __attribute__ directives to quiet
dnl compiler warnings. Though useful, not all are supported -- and contrary
@@ -1997,27 +2006,27 @@ EOF
test -n "$verbose" && AC_MSG_RESULT(... $cf_attribute)
cat conftest.h >>confdefs.h
case $cf_attribute in #(vi
+ noreturn) #(vi
+ AC_DEFINE_UNQUOTED(GCC_NORETURN,$cf_directive,[Define to noreturn-attribute for gcc])
+ ;;
printf) #(vi
- if test "$cf_printf_attribute" = no ; then
- cat >>confdefs.h <
-EOF
- else
- cat >>confdefs.h <
-EOF
+ cf_value='/* nothing */'
+ if test "$cf_printf_attribute" != no ; then
+ cf_value='__attribute__((format(printf,fmt,var)))'
+ AC_DEFINE(GCC_PRINTF,1,[Define to 1 if the compiler supports gcc-like printf attribute.])
fi
+ AC_DEFINE_UNQUOTED(GCC_PRINTFLIKE(fmt,var),$cf_value,[Define to printf-attribute for gcc])
;;
scanf) #(vi
- if test "$cf_scanf_attribute" = no ; then
- cat >>confdefs.h <
-EOF
- else
- cat >>confdefs.h <
-EOF
+ cf_value='/* nothing */'
+ if test "$cf_scanf_attribute" != no ; then
+ cf_value='__attribute__((format(scanf,fmt,var)))'
+ AC_DEFINE(GCC_SCANF,1,[Define to 1 if the compiler supports gcc-like scanf attribute.])
fi
+ AC_DEFINE_UNQUOTED(GCC_SCANFLIKE(fmt,var),$cf_value,[Define to sscanf-attribute for gcc])
+ ;;
+ unused) #(vi
+ AC_DEFINE_UNQUOTED(GCC_UNUSED,$cf_directive,[Define to unused-attribute for gcc])
;;
esac
fi
@@ -2029,7 +2038,7 @@ rm -rf conftest*
fi
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_GCC_VERSION version: 5 updated: 2010/04/24 11:02:31
+dnl CF_GCC_VERSION version: 7 updated: 2012/10/18 06:46:33
dnl --------------
dnl Find version of gcc
AC_DEFUN([CF_GCC_VERSION],[
@@ -2037,13 +2046,13 @@ AC_REQUIRE([AC_PROG_CC])
GCC_VERSION=none
if test "$GCC" = yes ; then
AC_MSG_CHECKING(version of $CC)
- GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[[^0-9.]]*//' -e 's/[[^0-9.]].*//'`"
+ GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC[[^)]]*) //' -e 's/^.*(Debian[[^)]]*) //' -e 's/^[[^0-9.]]*//' -e 's/[[^0-9.]].*//'`"
test -z "$GCC_VERSION" && GCC_VERSION=unknown
AC_MSG_RESULT($GCC_VERSION)
fi
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_GCC_WARNINGS version: 27 updated: 2010/10/23 15:52:32
+dnl CF_GCC_WARNINGS version: 29 updated: 2012/06/16 14:55:39
dnl ---------------
dnl Check if the compiler supports useful warning options. There's a few that
dnl we don't use, simply because they're too noisy:
@@ -2066,6 +2075,7 @@ AC_DEFUN([CF_GCC_WARNINGS],
[
AC_REQUIRE([CF_GCC_VERSION])
CF_INTEL_COMPILER(GCC,INTEL_COMPILER,CFLAGS)
+CF_CLANG_COMPILER(GCC,CLANG_COMPILER,CFLAGS)
cat > conftest.$ac_ext <
@@ -2141,6 +2151,13 @@ then
continue;;
esac
;;
+ Wpointer-arith) #(vi
+ case $GCC_VERSION in
+ [[12]].*)
+ CF_VERBOSE(feature is broken in gcc $GCC_VERSION)
+ continue;;
+ esac
+ ;;
esac
EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
fi
@@ -2239,77 +2256,6 @@ test -d "$oldincludedir" && {
$1="[$]$1 $cf_header_path_list"
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_HELP_MESSAGE version: 3 updated: 1998/01/14 10:56:23
-dnl ---------------
-dnl Insert text into the help-message, for readability, from AC_ARG_WITH.
-AC_DEFUN([CF_HELP_MESSAGE],
-[AC_DIVERT_HELP([$1])dnl
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_INCLUDE_DIRS version: 6 updated: 2009/01/06 19:37:40
-dnl ---------------
-dnl Construct the list of include-options according to whether we're building
-dnl in the source directory or using '--srcdir=DIR' option. If we're building
-dnl with gcc, don't append the includedir if it happens to be /usr/include,
-dnl since that usually breaks gcc's shadow-includes.
-AC_DEFUN([CF_INCLUDE_DIRS],
-[
-CPPFLAGS="$CPPFLAGS -I. -I../include"
-if test "$srcdir" != "."; then
- CPPFLAGS="$CPPFLAGS -I\${srcdir}/../include"
-fi
-if test "$GCC" != yes; then
- CPPFLAGS="$CPPFLAGS -I\${includedir}"
-elif test "$includedir" != "/usr/include"; then
- if test "$includedir" = '${prefix}/include' ; then
- if test $prefix != /usr ; then
- CPPFLAGS="$CPPFLAGS -I\${includedir}"
- fi
- else
- CPPFLAGS="$CPPFLAGS -I\${includedir}"
- fi
-fi
-AC_SUBST(CPPFLAGS)
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_INCLUDE_PATH version: 5 updated: 2010/01/17 20:36:17
-dnl ---------------
-dnl Adds to the include-path
-dnl
-dnl Autoconf 1.11 should have provided a way to add include path options to
-dnl the cpp-tests.
-dnl
-AC_DEFUN([CF_INCLUDE_PATH],
-[
-$1=
-for cf_path in $1
-do
- cf_result="no"
- AC_MSG_CHECKING(for directory $cf_path)
- if test -d $cf_path
- then
- INCLUDES="$INCLUDES -I$cf_path"
- ac_cpp="${ac_cpp} -I$cf_path"
- CFLAGS="$CFLAGS -I$cf_path"
- cf_result="yes"
- case $cf_path in
- /usr/include|/usr/include/*)
- ;;
- *)
- CF_DIRNAME(cf_temp,$cf_path)
- case $cf_temp in
- */include)
- INCLUDES="$INCLUDES -I$cf_temp"
- ac_cpp="${ac_cpp} -I$cf_temp"
- CFLAGS="$CFLAGS -I$cf_temp"
- ;;
- esac
- esac
- fi
- AC_MSG_RESULT($cf_result)
-done
-])dnl
-dnl ---------------------------------------------------------------------------
dnl CF_INTEL_COMPILER version: 4 updated: 2010/05/26 05:38:42
dnl -----------------
dnl Check if the given compiler is really the Intel compiler for Linux. It
@@ -2347,7 +2293,7 @@ cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc"
fi
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_LARGEFILE version: 7 updated: 2007/06/02 11:58:50
+dnl CF_LARGEFILE version: 8 updated: 2012/10/06 08:57:51
dnl ------------
dnl Add checks for large file support.
AC_DEFUN([CF_LARGEFILE],[
@@ -2381,7 +2327,7 @@ ifdef([AC_FUNC_FSEEKO],[
[cf_cv_struct_dirent64=yes],
[cf_cv_struct_dirent64=no])
])
- test "$cf_cv_struct_dirent64" = yes && AC_DEFINE(HAVE_STRUCT_DIRENT64)
+ test "$cf_cv_struct_dirent64" = yes && AC_DEFINE(HAVE_STRUCT_DIRENT64,1,[Define to 1 if we have struct dirent64])
fi
])
])
@@ -2587,7 +2533,7 @@ ifelse($1,,[
fi
])
dnl ---------------------------------------------------------------------------
-dnl CF_MBSTATE_T version: 3 updated: 2007/03/25 15:55:36
+dnl CF_MBSTATE_T version: 4 updated: 2012/10/06 08:57:51
dnl ------------
dnl Check if mbstate_t is declared, and if so, which header file.
dnl This (including wchar.h) is needed on Tru64 5.0 to declare mbstate_t,
@@ -2615,15 +2561,15 @@ AC_TRY_COMPILE([
[cf_cv_mbstate_t=unknown])])])
if test "$cf_cv_mbstate_t" = yes ; then
- AC_DEFINE(NEED_WCHAR_H)
+ AC_DEFINE(NEED_WCHAR_H,1,[Define to 1 if we must include wchar.h])
fi
if test "$cf_cv_mbstate_t" != unknown ; then
- AC_DEFINE(HAVE_MBSTATE_T)
+ AC_DEFINE(HAVE_MBSTATE_T,1,[Define to 1 if mbstate_t is declared])
fi
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_MIXEDCASE_FILENAMES version: 3 updated: 2003/09/20 17:07:55
+dnl CF_MIXEDCASE_FILENAMES version: 4 updated: 2012/10/02 20:55:03
dnl ----------------------
dnl Check if the file-system supports mixed-case filenames. If we're able to
dnl create a lowercase name and see it as uppercase, it doesn't support that.
@@ -2650,7 +2596,7 @@ else
rm -f conftest CONFTEST
fi
])
-test "$cf_cv_mixedcase" = yes && AC_DEFINE(MIXEDCASE_FILENAMES)
+test "$cf_cv_mixedcase" = yes && AC_DEFINE(MIXEDCASE_FILENAMES,1,[Define to 1 if filesystem supports mixed-case filenames.])
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_MSG_LOG version: 5 updated: 2010/10/23 15:52:32
@@ -2694,7 +2640,7 @@ printf("old\n");
,[$1=no])
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_NCURSES_CONFIG version: 9 updated: 2011/11/26 15:42:05
+dnl CF_NCURSES_CONFIG version: 10 updated: 2012/10/06 08:57:51
dnl -----------------
dnl Tie together the configure-script macros for ncurses.
dnl Prefer the "-config" script from ncurses 6.x, to simplify analysis.
@@ -2720,7 +2666,7 @@ CF_ADD_LIBS(`$NCURSES_CONFIG --libs`)
CF_CURSES_HEADER(ifelse($1,,ncurses,$1))
dnl like CF_NCURSES_CPPFLAGS
-AC_DEFINE(NCURSES)
+AC_DEFINE(NCURSES,1,[Define to 1 if we are using ncurses headers/libraries])
dnl like CF_NCURSES_LIBS
CF_UPPER(cf_nculib_ROOT,HAVE_LIB$cf_ncuconfig_root)
@@ -2737,7 +2683,7 @@ CF_NCURSES_LIBS(ifelse($1,,ncurses,$1))
fi
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_NCURSES_CPPFLAGS version: 20 updated: 2010/11/20 17:02:38
+dnl CF_NCURSES_CPPFLAGS version: 21 updated: 2012/10/06 08:57:51
dnl -------------------
dnl Look for the SVr4 curses clone 'ncurses' in the standard places, adjusting
dnl the CPPFLAGS variable so we can include its header.
@@ -2783,12 +2729,12 @@ CF_NCURSES_HEADER
CF_TERM_HEADER
# some applications need this, but should check for NCURSES_VERSION
-AC_DEFINE(NCURSES)
+AC_DEFINE(NCURSES,1,[Define to 1 if we are using ncurses headers/libraries])
CF_NCURSES_VERSION
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_NCURSES_HEADER version: 2 updated: 2008/03/23 14:48:54
+dnl CF_NCURSES_HEADER version: 3 updated: 2012/10/06 08:57:51
dnl -----------------
dnl Find a "curses" header file, e.g,. "curses.h", or one of the more common
dnl variations of ncurses' installs.
@@ -2839,16 +2785,16 @@ fi
case $cf_cv_ncurses_header in # (vi
*ncurses.h)
- AC_DEFINE(HAVE_NCURSES_H)
+ AC_DEFINE(HAVE_NCURSES_H,1,[Define to 1 if we have ncurses.h])
;;
esac
case $cf_cv_ncurses_header in # (vi
ncurses/curses.h|ncurses/ncurses.h)
- AC_DEFINE(HAVE_NCURSES_NCURSES_H)
+ AC_DEFINE(HAVE_NCURSES_NCURSES_H,1,[Define to 1 if we have ncurses/ncurses.h])
;;
ncursesw/curses.h|ncursesw/ncurses.h)
- AC_DEFINE(HAVE_NCURSESW_NCURSES_H)
+ AC_DEFINE(HAVE_NCURSESW_NCURSES_H,1,[Define to 1 if we have ncursesw/ncurses.h])
;;
esac
@@ -2922,7 +2868,7 @@ CF_UPPER(cf_nculib_ROOT,HAVE_LIB$cf_nculib_root)
AC_DEFINE_UNQUOTED($cf_nculib_ROOT)
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_NCURSES_VERSION version: 13 updated: 2010/10/23 15:54:49
+dnl CF_NCURSES_VERSION version: 14 updated: 2012/10/06 08:57:51
dnl ------------------
dnl Check for the version of ncurses, to aid in reporting bugs, etc.
dnl Call CF_CURSES_CPPFLAGS first, or CF_NCURSES_CPPFLAGS. We don't use
@@ -2981,17 +2927,17 @@ EOF
])
rm -f $cf_tempfile
])
-test "$cf_cv_ncurses_version" = no || AC_DEFINE(NCURSES)
+test "$cf_cv_ncurses_version" = no || AC_DEFINE(NCURSES,1,[Define to 1 if we are using ncurses headers/libraries])
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_NO_LEAKS_OPTION version: 4 updated: 2006/12/16 14:24:05
+dnl CF_NO_LEAKS_OPTION version: 5 updated: 2012/10/02 20:55:03
dnl ------------------
dnl see CF_WITH_NO_LEAKS
AC_DEFUN([CF_NO_LEAKS_OPTION],[
AC_MSG_CHECKING(if you want to use $1 for testing)
AC_ARG_WITH($1,
[$2],
- [AC_DEFINE($3)ifelse([$4],,[
+ [AC_DEFINE_UNQUOTED($3,1,"Define to 1 if you want to use $1 for testing.")ifelse([$4],,[
$4
])
: ${with_cflags:=-g}
@@ -3050,20 +2996,23 @@ AC_SUBST(MSG_DIR_MAKE)
AC_SUBST(SUB_MAKEFILE)
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_PATHSEP version: 5 updated: 2010/05/26 05:38:42
+dnl CF_PATHSEP version: 6 updated: 2012/09/29 18:38:12
dnl ----------
-dnl Provide a value for the $PATH and similar separator
+dnl Provide a value for the $PATH and similar separator (or amend the value
+dnl as provided in autoconf 2.5x).
AC_DEFUN([CF_PATHSEP],
[
+ AC_MSG_CHECKING(for PATH separator)
case $cf_cv_system_name in
os2*) PATH_SEPARATOR=';' ;;
- *) PATH_SEPARATOR=':' ;;
+ *) ${PATH_SEPARATOR:=':'} ;;
esac
ifelse([$1],,,[$1=$PATH_SEPARATOR])
AC_SUBST(PATH_SEPARATOR)
+ AC_MSG_RESULT($PATH_SEPARATOR)
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_PATH_SYNTAX version: 13 updated: 2010/05/26 05:38:42
+dnl CF_PATH_SYNTAX version: 14 updated: 2012/06/19 20:58:54
dnl --------------
dnl Check the argument to see that it looks like a pathname. Rewrite it if it
dnl begins with one of the prefix/exec_prefix variables, and then again if the
@@ -3083,7 +3032,7 @@ case ".[$]$1" in #(vi
;;
.[[a-zA-Z]]:[[\\/]]*) #(vi OS/2 EMX
;;
-.\[$]{*prefix}*) #(vi
+.\[$]{*prefix}*|.\[$]{*dir}*) #(vi
eval $1="[$]$1"
case ".[$]$1" in #(vi
.NONE/*)
@@ -3173,32 +3122,20 @@ fi
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_PROG_CC_U_D version: 1 updated: 2005/07/14 16:59:30
-dnl --------------
-dnl Check if C (preprocessor) -U and -D options are processed in the order
-dnl given rather than by type of option. Some compilers insist on apply all
-dnl of the -U options after all of the -D options. Others allow mixing them,
-dnl and may predefine symbols that conflict with those we define.
-AC_DEFUN([CF_PROG_CC_U_D],
-[
-AC_CACHE_CHECK(if $CC -U and -D options work together,cf_cv_cc_u_d_options,[
- cf_save_CPPFLAGS="$CPPFLAGS"
- CPPFLAGS="-UU_D_OPTIONS -DU_D_OPTIONS -DD_U_OPTIONS -UD_U_OPTIONS"
- AC_TRY_COMPILE([],[
-#ifndef U_D_OPTIONS
-make an undefined-error
-#endif
-#ifdef D_U_OPTIONS
-make a defined-error
-#endif
- ],[
- cf_cv_cc_u_d_options=yes],[
- cf_cv_cc_u_d_options=no])
- CPPFLAGS="$cf_save_CPPFLAGS"
-])
+dnl CF_PROG_CC version: 3 updated: 2012/10/06 15:31:55
+dnl ----------
+dnl standard check for CC, plus followup sanity checks
+dnl $1 = optional parameter to pass to AC_PROG_CC to specify compiler name
+AC_DEFUN([CF_PROG_CC],[
+ifelse($1,,[AC_PROG_CC],[AC_PROG_CC($1)])
+CF_GCC_VERSION
+CF_ACVERSION_CHECK(2.52,
+ [AC_PROG_CC_STDC],
+ [CF_ANSI_CC_REQD])
+CF_CC_ENV_FLAGS
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_PROG_EXT version: 10 updated: 2004/01/03 19:28:18
+dnl CF_PROG_EXT version: 11 updated: 2012/10/06 08:57:51
dnl -----------
dnl Compute $PROG_EXT, used for non-Unix ports, such as OS/2 EMX.
AC_DEFUN([CF_PROG_EXT],
@@ -3220,7 +3157,7 @@ AC_OBJEXT
PROG_EXT="$EXEEXT"
AC_SUBST(PROG_EXT)
-test -n "$PROG_EXT" && AC_DEFINE_UNQUOTED(PROG_EXT,"$PROG_EXT")
+test -n "$PROG_EXT" && AC_DEFINE_UNQUOTED(PROG_EXT,"$PROG_EXT",[Define to the program extension (normally blank)])
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_PROG_LINT version: 2 updated: 2009/08/12 04:43:14
@@ -3380,58 +3317,7 @@ CF_ADD_SUBDIR_PATH($1,$2,$3,/opt,$prefix)
CF_ADD_SUBDIR_PATH($1,$2,$3,[$]HOME,$prefix)
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_SUBST version: 4 updated: 2006/06/17 12:33:03
-dnl --------
-dnl Shorthand macro for substituting things that the user may override
-dnl with an environment variable.
-dnl
-dnl $1 = long/descriptive name
-dnl $2 = environment variable
-dnl $3 = default value
-AC_DEFUN([CF_SUBST],
-[AC_CACHE_VAL(cf_cv_subst_$2,[
-AC_MSG_CHECKING(for $1 (symbol $2))
-CF_SUBST_IF([-z "[$]$2"], [$2], [$3])
-cf_cv_subst_$2=[$]$2
-AC_MSG_RESULT([$]$2)
-])
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_SYSTYPE version: 3 updated: 2001/02/03 00:14:59
-dnl ----------
-dnl Derive the system-type (our main clue to the method of building shared
-dnl libraries).
-AC_DEFUN([CF_SYSTYPE],
-[
-AC_MSG_CHECKING(for system type)
-AC_CACHE_VAL(cf_cv_systype,[
-AC_ARG_WITH(system-type,
-[ --with-system-type=XXX test: override derived host system-type],
-[cf_cv_systype=$withval],
-[
-cf_cv_systype="`(uname -s || hostname || echo unknown) 2>/dev/null |sed -e s'/[[:\/.-]]/_/'g | sed 1q`"
-if test -z "$cf_cv_systype"; then cf_cv_systype=unknown;fi
-])])
-AC_MSG_RESULT($cf_cv_systype)
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_SYS_NAME version: 3 updated: 2008/03/23 14:48:54
-dnl -----------
-dnl Derive the system name, as a check for reusing the autoconf cache
-AC_DEFUN([CF_SYS_NAME],
-[
-SYS_NAME=`(uname -s -r || uname -a || hostname) 2>/dev/null | sed 1q`
-test -z "$SYS_NAME" && SYS_NAME=unknown
-AC_DEFINE_UNQUOTED(SYS_NAME,"$SYS_NAME")
-
-AC_CACHE_VAL(cf_cv_system_name,[cf_cv_system_name="$SYS_NAME"])
-
-if test ".$SYS_NAME" != ".$cf_cv_system_name" ; then
- AC_MSG_RESULT("Cached system name does not agree with actual")
- AC_MSG_ERROR("Please remove config.cache and try again.")
-fi])
-dnl ---------------------------------------------------------------------------
-dnl CF_TERM_HEADER version: 2 updated: 2010/10/23 15:54:49
+dnl CF_TERM_HEADER version: 3 updated: 2012/10/06 08:57:51
dnl --------------
dnl Look for term.h, which is part of X/Open curses. It defines the interface
dnl to terminfo database. Usually it is in the same include-path as curses.h,
@@ -3464,16 +3350,16 @@ done
case $cf_cv_term_header in # (vi
*term.h)
- AC_DEFINE(HAVE_TERM_H)
+ AC_DEFINE(HAVE_TERM_H,1,[Define to 1 if we have term.h])
;;
esac
case $cf_cv_term_header in # (vi
ncurses/term.h) #(vi
- AC_DEFINE(HAVE_NCURSES_TERM_H)
+ AC_DEFINE(HAVE_NCURSES_TERM_H,1,[Define to 1 if we have ncurses/term.h])
;;
ncursesw/term.h)
- AC_DEFINE(HAVE_NCURSESW_TERM_H)
+ AC_DEFINE(HAVE_NCURSESW_TERM_H,1,[Define to 1 if we have ncursesw/term.h])
;;
esac
])dnl
@@ -3517,7 +3403,7 @@ if test "$cf_cv_xopen_source" != no ; then
fi
])
dnl ---------------------------------------------------------------------------
-dnl CF_UNION_WAIT version: 5 updated: 1997/11/23 14:49:44
+dnl CF_UNION_WAIT version: 6 updated: 2012/10/06 08:57:51
dnl -------------
dnl Check to see if the BSD-style union wait is declared. Some platforms may
dnl use this, though it is deprecated in favor of the 'int' type in Posix.
@@ -3560,7 +3446,7 @@ AC_CACHE_VAL(cf_cv_type_unionwait,[
],
[cf_cv_type_unionwait=no])])])
AC_MSG_RESULT($cf_cv_type_unionwait)
-test $cf_cv_type_unionwait = yes && AC_DEFINE(HAVE_TYPE_UNIONWAIT)
+test $cf_cv_type_unionwait = yes && AC_DEFINE(HAVE_TYPE_UNIONWAIT,1,[Define to 1 if type unionwait is declared])
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_UPPER version: 5 updated: 2001/01/29 23:40:59
@@ -3572,7 +3458,7 @@ AC_DEFUN([CF_UPPER],
$1=`echo "$2" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_UTF8_LIB version: 7 updated: 2010/06/20 09:24:28
+dnl CF_UTF8_LIB version: 8 updated: 2012/10/06 08:57:51
dnl -----------
dnl Check for multibyte support, and if not found, utf8 compatibility library
AC_DEFUN([CF_UTF8_LIB],
@@ -3591,7 +3477,7 @@ AC_CACHE_CHECK(for multibyte character support,cf_cv_utf8_lib,[
# HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
# ncurses/ncursesw:
if test "$cf_cv_utf8_lib" = "add-on" ; then
- AC_DEFINE(HAVE_LIBUTF8_H)
+ AC_DEFINE(HAVE_LIBUTF8_H,1,[Define to 1 if we should include libutf8.h])
CF_ADD_INCDIR($cf_cv_header_path_utf8)
CF_ADD_LIBDIR($cf_cv_library_path_utf8)
CF_ADD_LIBS($cf_cv_library_file_utf8)
@@ -3606,7 +3492,7 @@ AC_DEFUN([CF_VERBOSE],
CF_MSG_LOG([$1])
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_VERSION_INFO version: 4 updated: 2011/01/02 19:09:47
+dnl CF_VERSION_INFO version: 5 updated: 2012/10/06 08:57:51
dnl ---------------
dnl Define several useful symbols derived from the VERSION file. A separate
dnl file is preferred to embedding the version numbers in various scripts.
@@ -3686,7 +3572,7 @@ dnl need the package name to ensure that the defined symbols are unique.
ifelse($1,,,[
cf_PACKAGE=$1
PACKAGE=ifelse($2,,$1,$2)
- AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
+ AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE",[Define to the package-name])
AC_SUBST(PACKAGE)
CF_UPPER(cf_PACKAGE,$cf_PACKAGE)
AC_DEFINE_UNQUOTED(${cf_PACKAGE}_VERSION,"${VERSION_MAJOR}.${VERSION_MINOR}")
@@ -3946,7 +3832,7 @@ esac
AC_SUBST(LIBTOOL_OPTS)
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_WITH_NO_LEAKS version: 1 updated: 2006/12/14 18:00:21
+dnl CF_WITH_NO_LEAKS version: 2 updated: 2012/10/06 08:57:51
dnl ----------------
AC_DEFUN([CF_WITH_NO_LEAKS],[
@@ -3958,11 +3844,11 @@ AC_REQUIRE([CF_WITH_VALGRIND])
AC_MSG_CHECKING(if you want to perform memory-leak testing)
AC_ARG_WITH(no-leaks,
[ --with-no-leaks test: free permanent memory, analyze leaks],
- [AC_DEFINE(NO_LEAKS)
+ [AC_DEFINE(NO_LEAKS,1,[Define to 1 to enable leak-checking])
cf_doalloc=".${with_dmalloc}${with_dbmalloc}${with_purify}${with_valgrind}"
case ${cf_doalloc} in #(vi
*yes*) ;;
- *) AC_DEFINE(DOALLOC,10000) ;;
+ *) AC_DEFINE(DOALLOC,10000,[Define to size of malloc-array]) ;;
esac
with_no_leaks=yes],
[with_no_leaks=])
diff --git a/argv.c b/argv.c
index c090290..7416054 100644
--- a/argv.c
+++ b/argv.c
@@ -1,9 +1,9 @@
/*
- * $Id: argv.c,v 1.1 2011/03/02 09:56:39 tom Exp $
+ * $Id: argv.c,v 1.2 2012/11/30 20:28:23 tom Exp $
*
* argv - Reusable functions for argv-parsing.
*
- * Copyright 2011 Thomas E. Dickey
+ * Copyright 2011,2012 Thomas E. Dickey
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License, version 2.1
@@ -56,12 +56,6 @@ dlg_string_to_argv(char *blob)
}
} else if (blob[n] == '\\') {
if (quoted && !isspace(UCH(blob[n + 1]))) {
- if (!inparm) {
- if (pass)
- result[count] = param;
- ++count;
- inparm = TRUE;
- }
if (pass) {
*param++ = blob[n];
*param++ = blob[n + 1];
diff --git a/arrows.c b/arrows.c
index ff706ad..5e5c723 100644
--- a/arrows.c
+++ b/arrows.c
@@ -1,9 +1,9 @@
/*
- * $Id: arrows.c,v 1.41 2011/10/20 23:37:17 tom Exp $
+ * $Id: arrows.c,v 1.50 2013/05/24 00:05:21 tom Exp $
*
* arrows.c -- draw arrows to indicate end-of-range for lists
*
- * Copyright 2000-2010,2011 Thomas E. Dickey
+ * Copyright 2000-2012,2013 Thomas E. Dickey
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License, version 2.1
@@ -136,7 +136,7 @@ dlg_draw_arrows2(WINDOW *win,
(void) wmove(win, bottom, x);
if (bottom_arrow) {
- (void) wattrset(win, merge_colors(darrow_attr, attr));
+ (void) wattrset(win, merge_colors(darrow_attr, borderattr));
(void) add_acs(win, ACS_DARROW);
(void) waddstr(win, "(+)");
} else {
@@ -196,34 +196,48 @@ dlg_draw_scrollbar(WINDOW *win,
whline(win, dlg_boxchar(ACS_HLINE), 4 - len);
}
}
-#define BARSIZE(num) (int) (((all_high * (num)) + all_high - 1) / total_data)
+#define BARSIZE(num) (int) (0.5 + (double) ((all_high * (int) (num)) / (double) total_data))
+#define ORDSIZE(num) (int) ((double) ((all_high * (int) (num)) / (double) all_diff))
if (dialog_state.use_scrollbar) {
int all_high = (bottom - top - 1);
+ this_data = MAX(0, this_data);
+
if (total_data > 0 && all_high > 0) {
+ int all_diff = (int) (total_data + 1);
+ int bar_diff = (int) (next_data + 1 - this_data);
int bar_high;
int bar_y;
- bar_high = BARSIZE(next_data - this_data);
+ bar_high = ORDSIZE(bar_diff);
if (bar_high <= 0)
bar_high = 1;
if (bar_high < all_high) {
+ int bar_last = BARSIZE(next_data);
+
wmove(win, top + 1, right);
(void) wattrset(win, save);
wvline(win, ACS_VLINE | A_REVERSE, all_high);
- bar_y = BARSIZE(this_data);
- if (bar_y > all_high - bar_high)
- bar_y = all_high - bar_high;
+ bar_y = ORDSIZE(this_data);
+ if (bar_y >= bar_last && bar_y > 0)
+ bar_y = bar_last - 1;
+ if (bar_last - bar_y > bar_high && bar_high > 1)
+ ++bar_y;
+ bar_last = MIN(bar_last, all_high);
wmove(win, top + 1 + bar_y, right);
(void) wattrset(win, position_indicator_attr);
wattron(win, A_REVERSE);
- wvline(win, ACS_BLOCK, bar_high);
+#if defined(WACS_BLOCK) && defined(NCURSES_VERSION) && defined(USE_WIDE_CURSES)
+ wvline_set(win, WACS_BLOCK, bar_last - bar_y);
+#else
+ wvline(win, ACS_BLOCK, bar_last - bar_y);
+#endif
}
}
}
diff --git a/buildlist.c b/buildlist.c
new file mode 100644
index 0000000..cb7c600
--- /dev/null
+++ b/buildlist.c
@@ -0,0 +1,1111 @@
+/*
+ * $Id: buildlist.c,v 1.57 2013/03/17 13:46:30 tom Exp $
+ *
+ * buildlist.c -- implements the buildlist dialog
+ *
+ * Copyright 2012,2013 Thomas E. Dickey
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License, version 2.1
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to
+ * Free Software Foundation, Inc.
+ * 51 Franklin St., Fifth Floor
+ * Boston, MA 02110, USA.
+ */
+
+#include
+#include
+
+/*
+ * Visually like menubox, but two columns.
+ */
+
+#define sLEFT (-2)
+#define sRIGHT (-1)
+
+#define KEY_TOGGLE ' '
+#define KEY_LEFTCOL '^'
+#define KEY_RIGHTCOL '$'
+
+#define MIN_HIGH (1 + (5 * MARGIN))
+
+typedef struct {
+ WINDOW *win;
+ int box_y;
+ int box_x;
+ int top_index;
+ int cur_index;
+} MY_DATA;
+
+typedef struct {
+ DIALOG_LISTITEM *items;
+ int base_y; /* base for mouse coordinates */
+ int base_x;
+ int use_height; /* actual size of column box */
+ int use_width;
+ int item_no;
+ int check_x;
+ int item_x;
+ MY_DATA list[2];
+} ALL_DATA;
+
+/*
+ * Print list item. The 'selected' parameter is true if 'choice' is the
+ * current item. That one is colored differently from the other items.
+ */
+static void
+print_item(ALL_DATA * data,
+ WINDOW *win,
+ DIALOG_LISTITEM * item,
+ int choice,
+ int selected)
+{
+ chtype save = dlg_get_attrs(win);
+ int i;
+ bool both = (!dialog_vars.no_tags && !dialog_vars.no_items);
+ bool first = TRUE;
+ int climit = (data->item_x - data->check_x - 1);
+ const char *show = (dialog_vars.no_items
+ ? item->name
+ : item->text);
+
+ /* Clear 'residue' of last item */
+ (void) wattrset(win, menubox_attr);
+ (void) wmove(win, choice, 0);
+ for (i = 0; i < getmaxx(win); i++)
+ (void) waddch(win, ' ');
+
+ (void) wmove(win, choice, data->check_x);
+ (void) wattrset(win, menubox_attr);
+
+ if (both) {
+ dlg_print_listitem(win, item->name, climit, first, selected);
+ (void) waddch(win, ' ');
+ first = FALSE;
+ }
+
+ (void) wmove(win, choice, data->item_x);
+ climit = (getmaxx(win) - data->item_x + 1);
+ dlg_print_listitem(win, show, climit, first, selected);
+
+ if (selected) {
+ dlg_item_help(item->help);
+ }
+ (void) wattrset(win, save);
+}
+
+/*
+ * Prints either the left (unselected) or right (selected) list.
+ */
+static void
+print_1_list(ALL_DATA * data,
+ int choice,
+ int selected)
+{
+ MY_DATA *moi = data->list + selected;
+ WINDOW *win = moi->win;
+ int i, j;
+ int last = 0;
+ int max_rows = getmaxy(win);
+
+ for (i = j = 0; j < max_rows; i++) {
+ int ii = i + moi->top_index;
+ if (ii >= data->item_no) {
+ break;
+ } else if (!(selected ^ (data->items[ii].state != 0))) {
+ print_item(data,
+ win,
+ &data->items[ii],
+ j, ii == choice);
+ last = ++j;
+ }
+ }
+ if (wmove(win, last, 0) != ERR)
+ wclrtobot(win);
+ (void) wnoutrefresh(win);
+}
+
+/*
+ * Return the previous item from the list, staying in the same column. If no
+ * further movement is possible, return the same choice as given.
+ */
+static int
+prev_item(ALL_DATA * data, int choice, int selected)
+{
+ int result = choice;
+ int n;
+
+ for (n = choice - 1; n >= 0; --n) {
+ if ((data->items[n].state != 0) == selected) {
+ result = n;
+ break;
+ }
+ }
+ return result;
+}
+
+/*
+ * Return true if the given choice is on the first page in the current column.
+ */
+static bool
+stop_prev(ALL_DATA * data, int choice, int selected)
+{
+ return (prev_item(data, choice, selected) == choice);
+}
+
+static bool
+check_hotkey(DIALOG_LISTITEM * items, int choice, int selected)
+{
+ bool result = FALSE;
+
+ if ((items[choice].state != 0) == selected) {
+ if (dlg_match_char(dlg_last_getc(),
+ (dialog_vars.no_tags
+ ? items[choice].text
+ : items[choice].name))) {
+ result = TRUE;
+ }
+ }
+ return result;
+}
+
+/*
+ * Return the next item from the list, staying in the same column. If no
+ * further movement is possible, return the same choice as given.
+ */
+static int
+next_item(ALL_DATA * data, int choice, int selected)
+{
+ int result = choice;
+ int n;
+
+ for (n = choice + 1; n < data->item_no; ++n) {
+ if ((data->items[n].state != 0) == selected) {
+ result = n;
+ break;
+ }
+ }
+ dlg_trace_msg("next_item(%d) ->%d\n", choice, result);
+ return result;
+}
+
+/*
+ * Translate a choice from items[] to a row-number in an unbounded column,
+ * starting at zero.
+ */
+static int
+index2row(ALL_DATA * data, int choice, int selected)
+{
+ int result = -1;
+ int n;
+ for (n = 0; n < data->item_no; ++n) {
+ if ((data->items[n].state != 0) == selected) {
+ ++result;
+ }
+ if (n == choice)
+ break;
+ }
+ return result;
+}
+
+/*
+ * Return the first choice from items[] for the given column.
+ */
+static int
+first_item(ALL_DATA * data, int selected)
+{
+ int result = -1;
+ int n;
+
+ for (n = 0; n < data->item_no; ++n) {
+ if ((data->items[n].state != 0) == selected) {
+ result = n;
+ break;
+ }
+ }
+ return result;
+}
+
+/*
+ * Return the last choice from items[] for the given column.
+ */
+static int
+last_item(ALL_DATA * data, int selected)
+{
+ int result = -1;
+ int n;
+
+ for (n = data->item_no - 1; n >= 0; --n) {
+ if ((data->items[n].state != 0) == selected) {
+ result = n;
+ break;
+ }
+ }
+ return result;
+}
+
+/*
+ * Convert a row-number back to an item number, i.e., index into items[].
+ */
+static int
+row2index(ALL_DATA * data, int row, int selected)
+{
+ int result = -1;
+ int n;
+ for (n = 0; n < data->item_no; ++n) {
+ if ((data->items[n].state != 0) == selected) {
+ if (row-- <= 0) {
+ result = n;
+ break;
+ }
+ }
+ }
+ return result;
+}
+
+static int
+skip_rows(ALL_DATA * data, int row, int skip, int selected)
+{
+ int choice = row2index(data, row, selected);
+ int result = row;
+ int n;
+ if (skip > 0) {
+ for (n = choice + 1; n < data->item_no; ++n) {
+ if ((data->items[n].state != 0) == selected) {
+ ++result;
+ if (--skip <= 0)
+ break;
+ }
+ }
+ } else if (skip < 0) {
+ for (n = choice - 1; n >= 0; --n) {
+ if ((data->items[n].state != 0) == selected) {
+ --result;
+ if (++skip >= 0)
+ break;
+ }
+ }
+ }
+ return result;
+}
+
+/*
+ * Find the closest item in the given column starting with the given choice.
+ */
+static int
+closest_item(ALL_DATA * data, int choice, int selected)
+{
+ int prev = choice;
+ int next = choice;
+ int result = choice;
+ int n;
+
+ for (n = choice; n >= 0; --n) {
+ if ((data->items[n].state != 0) == selected) {
+ prev = n;
+ break;
+ }
+ }
+ for (n = choice; n < data->item_no; ++n) {
+ if ((data->items[n].state != 0) == selected) {
+ next = n;
+ break;
+ }
+ }
+ if (prev != choice) {
+ result = prev;
+ if (next != choice) {
+ if ((choice - prev) > (next - choice)) {
+ result = next;
+ }
+ }
+ } else if (next != choice) {
+ result = next;
+ }
+ return result;
+}
+
+static void
+print_both(ALL_DATA * data,
+ int choice)
+{
+ int selected;
+ int cur_y, cur_x;
+ WINDOW *dialog = wgetparent(data->list[0].win);
+
+ getyx(dialog, cur_y, cur_x);
+ for (selected = 0; selected < 2; ++selected) {
+ MY_DATA *moi = data->list + selected;
+ WINDOW *win = moi->win;
+ int thumb_top = index2row(data, moi->top_index, selected);
+ int thumb_max = index2row(data, -1, selected);
+ int thumb_end = thumb_top + getmaxy(win);
+
+ print_1_list(data, choice, selected);
+
+ dlg_mouse_setcode(selected * KEY_MAX);
+ dlg_draw_scrollbar(dialog,
+ (long) (moi->top_index),
+ (long) (thumb_top),
+ (long) MIN(thumb_end, thumb_max),
+ (long) thumb_max,
+ moi->box_x + data->check_x,
+ moi->box_x + getmaxx(win),
+ moi->box_y,
+ moi->box_y + getmaxy(win) + 1,
+ menubox_border2_attr,
+ menubox_border_attr);
+ }
+ (void) wmove(dialog, cur_y, cur_x);
+ dlg_mouse_setcode(0);
+}
+
+static void
+set_top_item(ALL_DATA * data, int value, int selected)
+{
+ if (value != data->list[selected].top_index) {
+ dlg_trace_msg("set top of %s column to %d\n",
+ selected ? "right" : "left",
+ value);
+ data->list[selected].top_index = value;
+ }
+}
+
+/*
+ * Adjust the top-index as needed to ensure that it and the given item are
+ * visible.
+ */
+static void
+fix_top_item(ALL_DATA * data, int cur_item, int selected)
+{
+ int top_item = data->list[selected].top_index;
+ int cur_row = index2row(data, cur_item, selected);
+ int top_row = index2row(data, top_item, selected);
+
+ if (cur_row < top_row) {
+ top_item = cur_item;
+ } else if ((cur_row - top_row) > data->use_height) {
+ top_item = row2index(data, cur_row + 1 - data->use_height, selected);
+ }
+ if (cur_row < data->use_height) {
+ top_item = row2index(data, 0, selected);
+ }
+ dlg_trace_msg("fix_top_item(cur_item %d, selected %d) ->top_item %d\n",
+ cur_item, selected, top_item);
+ set_top_item(data, top_item, selected);
+}
+
+/*
+ * This is an alternate interface to 'buildlist' which allows the application
+ * to read the list item states back directly without putting them in the
+ * output buffer.
+ */
+int
+dlg_buildlist(const char *title,
+ const char *cprompt,
+ int height,
+ int width,
+ int list_height,
+ int item_no,
+ DIALOG_LISTITEM * items,
+ const char *states,
+ int order_mode,
+ int *current_item)
+{
+ /* *INDENT-OFF* */
+ static DLG_KEYS_BINDING binding[] = {
+ HELPKEY_BINDINGS,
+ ENTERKEY_BINDINGS,
+ DLG_KEYS_DATA( DLGK_FIELD_NEXT, KEY_RIGHT ),
+ DLG_KEYS_DATA( DLGK_FIELD_NEXT, TAB ),
+ DLG_KEYS_DATA( DLGK_FIELD_PREV, KEY_BTAB ),
+ DLG_KEYS_DATA( DLGK_FIELD_PREV, KEY_LEFT ),
+ DLG_KEYS_DATA( DLGK_ITEM_FIRST, KEY_HOME ),
+ DLG_KEYS_DATA( DLGK_ITEM_LAST, KEY_END ),
+ DLG_KEYS_DATA( DLGK_ITEM_LAST, KEY_LL ),
+ DLG_KEYS_DATA( DLGK_ITEM_NEXT, '+' ),
+ DLG_KEYS_DATA( DLGK_ITEM_NEXT, KEY_DOWN ),
+ DLG_KEYS_DATA( DLGK_ITEM_NEXT, CHR_NEXT ),
+ DLG_KEYS_DATA( DLGK_ITEM_PREV, '-' ),
+ DLG_KEYS_DATA( DLGK_ITEM_PREV, KEY_UP ),
+ DLG_KEYS_DATA( DLGK_ITEM_PREV, CHR_PREVIOUS ),
+ DLG_KEYS_DATA( DLGK_PAGE_NEXT, KEY_NPAGE ),
+ DLG_KEYS_DATA( DLGK_PAGE_NEXT, DLGK_MOUSE(KEY_NPAGE) ),
+ DLG_KEYS_DATA( DLGK_PAGE_NEXT, DLGK_MOUSE(KEY_NPAGE+KEY_MAX) ),
+ DLG_KEYS_DATA( DLGK_PAGE_PREV, KEY_PPAGE ),
+ DLG_KEYS_DATA( DLGK_PAGE_PREV, DLGK_MOUSE(KEY_PPAGE) ),
+ DLG_KEYS_DATA( DLGK_PAGE_PREV, DLGK_MOUSE(KEY_PPAGE+KEY_MAX) ),
+ DLG_KEYS_DATA( DLGK_GRID_LEFT, KEY_LEFTCOL ),
+ DLG_KEYS_DATA( DLGK_GRID_RIGHT, KEY_RIGHTCOL ),
+ END_KEYS_BINDING
+ };
+ /* *INDENT-ON* */
+
+#ifdef KEY_RESIZE
+ int old_height = height;
+ int old_width = width;
+#endif
+ ALL_DATA all;
+ MY_DATA *data = all.list;
+ int i, j, k, key2, found, x, y, cur_x, cur_y;
+ int key = 0, fkey;
+ bool save_visit = dialog_state.visit_items;
+ int button;
+ int cur_item;
+ int was_mouse;
+ int name_width, text_width, full_width, list_width;
+ int result = DLG_EXIT_UNKNOWN;
+ int num_states;
+ bool first = TRUE;
+ WINDOW *dialog;
+ char *prompt = dlg_strclone(cprompt);
+ const char **buttons = dlg_ok_labels();
+ const char *widget_name = "buildlist";
+
+ (void) order_mode;
+
+ /*
+ * Unlike other uses of --visit-items, we have two windows to visit.
+ */
+ if (dialog_state.visit_cols)
+ dialog_state.visit_cols = 2;
+
+ memset(&all, 0, sizeof(all));
+ all.items = items;
+ all.item_no = item_no;
+
+ if (dialog_vars.default_item != 0) {
+ cur_item = dlg_default_listitem(items);
+ } else {
+ if ((cur_item = first_item(&all, 0)) < 0)
+ cur_item = first_item(&all, 1);
+ }
+ button = (dialog_state.visit_items
+ ? (items[cur_item].state ? sRIGHT : sLEFT)
+ : dlg_default_button());
+
+ dlg_does_output();
+ dlg_tab_correct_str(prompt);
+
+#ifdef KEY_RESIZE
+ retry:
+#endif
+
+ all.use_height = list_height;
+ all.use_width = (2 * (dlg_calc_list_width(item_no, items)
+ + 4
+ + 2 * MARGIN)
+ + 1);
+ all.use_width = MAX(26, all.use_width);
+ if (all.use_height == 0) {
+ /* calculate height without items (4) */
+ dlg_auto_size(title, prompt, &height, &width, MIN_HIGH, all.use_width);
+ dlg_calc_listh(&height, &all.use_height, item_no);
+ } else {
+ dlg_auto_size(title, prompt,
+ &height, &width,
+ MIN_HIGH + all.use_height, all.use_width);
+ }
+ dlg_button_layout(buttons, &width);
+ dlg_print_size(height, width);
+ dlg_ctl_size(height, width);
+
+ /* we need at least two states */
+ if (states == 0 || strlen(states) < 2)
+ states = " *";
+ num_states = (int) strlen(states);
+
+ x = dlg_box_x_ordinate(width);
+ y = dlg_box_y_ordinate(height);
+
+ dialog = dlg_new_window(height, width, y, x);
+ dlg_register_window(dialog, widget_name, binding);
+ dlg_register_buttons(dialog, widget_name, buttons);
+
+ dlg_mouse_setbase(all.base_
2b5579c Update dialog to 1.2-20130523
CHANGES | 104 +-
VERSION | 2 +-
aclocal.m4 | 476 +++---
argv.c | 10 +-
arrows.c | 32 +-
buildlist.c | 1111 +++++++++++++
buttons.c | 213 ++-
calendar.c | 5 +-
checklist.c | 387 ++---
config.guess | 202 ++-
config.sub | 112 +-
configure | 3394 +++++++++++++++++++++------------------
configure.in | 51 +-
dialog-config.in | 5 +-
dialog.1 | 237 ++-
dialog.3 | 407 ++++-
dialog.c | 200 ++-
dialog.h | 54 +-
dlg_keys.h | 19 +-
editbox.c | 5 +-
formbox.c | 58 +-
fselect.c | 68 +-
guage.c | 7 +-
help.c | 17 +-
inputbox.c | 25 +-
inputstr.c | 27 +-
makefile.in | 3 +-
menubox.c | 420 +++--
mixedform.c | 5 +-
mixedgauge.c | 11 +-
mouse.c | 25 +-
mousewget.c | 6 +-
msgbox.c | 4 +-
package/debian/changelog | 20 +
package/dialog.spec | 8 +-
po/an.po | 111 ++
po/gl.po | 58 +-
po/ia.po | 111 ++
po/zh_TW.po | 36 +-
prgbox.c | 12 +-
progressbox.c | 17 +-
rangebox.c | 419 +++++
rc.c | 15 +-
rename.sh | 5 +-
samples/README | 35 +-
samples/buildlist | 20 +
samples/buildlist2 | 42 +
samples/checklist12 | 44 +
samples/copifuncs/admin.funcs | 200 ---
samples/copifuncs/common.funcs | 340 ----
samples/copifuncs/copi.funcs | 1303 ---------------
samples/copifuncs/copi.ifman1 | 29 -
samples/copifuncs/copi.ifman2 | 140 --
samples/copifuncs/copi.ifmcfg2 | 68 -
samples/copifuncs/copi.ifmcfg4 | 30 -
samples/copifuncs/copi.ifmcfg5 | 14 -
samples/copifuncs/copi.ifpoll1 | 9 -
samples/copifuncs/copi.ifpoll2 | 109 --
samples/copifuncs/copi.ifreq1 | 20 -
samples/copifuncs/copi.ifreq2 | 71 -
samples/copifuncs/copi.rcnews | 79 -
samples/copifuncs/copi.sendifm1 | 74 -
samples/copifuncs/copi.sendifm2 | 15 -
samples/copifuncs/copi.trnrc | 13 -
samples/copifuncs/copi.wheel | 54 -
samples/copifuncs/ifpatch | 101 --
samples/copismall | 296 ----
samples/install/FDISK.TEST | 28 -
samples/install/makefile.in | 35 -
samples/install/setup.c | 371 -----
samples/install/setup.help | 49 -
samples/menubox12 | 43 +
samples/rangebox | 11 +
samples/rangebox2 | 11 +
samples/rangebox3 | 11 +
samples/rangebox4 | 11 +
samples/slackware.rc | 4 +-
samples/treeview | 22 +
samples/treeview2 | 52 +
samples/whiptail.rc | 4 +-
tailbox.c | 6 +-
textbox.c | 62 +-
timebox.c | 7 +-
treeview.c | 672 ++++++++
ui_getc.c | 43 +-
util.c | 163 +-
yesno.c | 4 +-
87 files changed, 6819 insertions(+), 6410 deletions(-)
Upstream: github.com