From f4b9601c1bdf90d4560e37b7b555f3db6a7bf149 Mon Sep 17 00:00:00 2001 From: Chris Allegretta Date: Wed, 3 Jan 2001 07:11:47 +0000 Subject: [PATCH] First try at browser git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@434 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- ChangeLog | 9 +- acconfig.h | 2 + config.h.in | 3 + configure | 384 +++++++++++++++++++++++++++------------------------ configure.in | 12 ++ files.c | 348 +++++++++++++++++++++++++++++++++++++++++++++- global.c | 31 ++++- nano.c | 4 +- nano.h | 9 +- proto.h | 10 +- winio.c | 28 ++-- 11 files changed, 641 insertions(+), 199 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9649d636..2389c71d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,10 @@ CVS code - +General - + - New file browser code. New functions in files.c:do_browser(), + helper functions browser_init(), tail(), striponedir(), + filestat(). New shortcut list browser_list. Some new + strings to translate. Chris needs to add comments to his + code. - faq.html: - Fix typos and small mistakes (Jordi). - files.c: @@ -16,9 +22,10 @@ CVS code - - winio.c: do_cursorpos() - Optimizations and cleanups by Rocco Corsi. - do_credits() - Spell Erik Andersen's name right. + titlebar() + - Now takes an arg, needed for browser function. nano 0.9.24 - 12/18/2000 General diff --git a/acconfig.h b/acconfig.h index 8b0bc026..f680ce0f 100644 --- a/acconfig.h +++ b/acconfig.h @@ -39,3 +39,5 @@ /* Define this to disable the ^G help menu */ #undef DISABLE_HELP +/* Define this to use the built-in (crappy) file browser */ +#undef ENABLE_BROWSER diff --git a/config.h.in b/config.h.in index 493740cd..6447cade 100644 --- a/config.h.in +++ b/config.h.in @@ -91,6 +91,9 @@ /* Define this to disable the ^G help menu */ #undef DISABLE_HELP +/* Define this to use the built-in (crappy) file browser */ +#undef ENABLE_BROWSER + /* Define if you have the __argz_count function. */ #undef HAVE___ARGZ_COUNT diff --git a/configure b/configure index e0af3db2..fd8b7bfc 100755 --- a/configure +++ b/configure @@ -24,6 +24,10 @@ ac_help="$ac_help --disable-speller Disables spell checker function" ac_help="$ac_help --disable-help Disables help function (^G)" +ac_help="$ac_help + --enable-browser Enable mini file browser" +ac_help="$ac_help + --enable-browser Enable mini file browser" ac_help="$ac_help --with-slang[=DIR] Use the slang library instead of curses" ac_help="$ac_help @@ -581,7 +585,7 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:585: checking for a BSD compatible install" >&5 +echo "configure:589: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -634,7 +638,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 -echo "configure:638: checking whether build environment is sane" >&5 +echo "configure:642: checking whether build environment is sane" >&5 # Just in case sleep 1 echo timestamp > conftestfile @@ -691,7 +695,7 @@ test "$program_suffix" != NONE && test "$program_transform_name" = "" && program_transform_name="s,x,x," echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:695: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:699: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -737,7 +741,7 @@ EOF missing_dir=`cd $ac_aux_dir && pwd` echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 -echo "configure:741: checking for working aclocal" >&5 +echo "configure:745: checking for working aclocal" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -750,7 +754,7 @@ else fi echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 -echo "configure:754: checking for working autoconf" >&5 +echo "configure:758: checking for working autoconf" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -763,7 +767,7 @@ else fi echo $ac_n "checking for working automake""... $ac_c" 1>&6 -echo "configure:767: checking for working automake" >&5 +echo "configure:771: checking for working automake" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -776,7 +780,7 @@ else fi echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 -echo "configure:780: checking for working autoheader" >&5 +echo "configure:784: checking for working autoheader" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -789,7 +793,7 @@ else fi echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 -echo "configure:793: checking for working makeinfo" >&5 +echo "configure:797: checking for working makeinfo" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -810,7 +814,7 @@ ALL_LINGUAS="es de fr it id fi" # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:814: checking for $ac_word" >&5 +echo "configure:818: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -840,7 +844,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:844: checking for $ac_word" >&5 +echo "configure:848: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -891,7 +895,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:895: checking for $ac_word" >&5 +echo "configure:899: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -923,7 +927,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:927: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:931: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -934,12 +938,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 938 "configure" +#line 942 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:943: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:947: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -965,12 +969,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:969: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:973: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:974: checking whether we are using GNU C" >&5 +echo "configure:978: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -979,7 +983,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:983: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:987: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -998,7 +1002,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:1002: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:1006: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1030,7 +1034,7 @@ else fi echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6 -echo "configure:1034: checking for POSIXized ISC" >&5 +echo "configure:1038: checking for POSIXized ISC" >&5 if test -d /etc/conf/kconfig.d && grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1 then @@ -1052,7 +1056,7 @@ fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1056: checking how to run the C preprocessor" >&5 +echo "configure:1060: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -1067,13 +1071,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1077: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1081: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1084,13 +1088,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1094: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1098: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1101,13 +1105,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1111: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1115: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1132,12 +1136,12 @@ fi echo "$ac_t""$CPP" 1>&6 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:1136: checking for ANSI C header files" >&5 +echo "configure:1140: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1145,7 +1149,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1149: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1153: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1162,7 +1166,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1180,7 +1184,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1201,7 +1205,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -1212,7 +1216,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:1216: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1220: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -1239,17 +1243,17 @@ for ac_hdr in fcntl.h unistd.h malloc.h termios.h termio.h limits.h getopt.h reg do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1243: checking for $ac_hdr" >&5 +echo "configure:1247: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1253: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1257: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1348,8 +1352,32 @@ EOF fi +# Check whether --enable-browser or --disable-browser was given. +if test "${enable_browser+set}" = set; then + enableval="$enable_browser" + if test x$enableval = xyes; then + cat >> confdefs.h <<\EOF +#define ENABLE_BROWSER 1 +EOF + + fi +fi + + +# Check whether --enable-browser or --disable-browser was given. +if test "${enable_browser+set}" = set; then + enableval="$enable_browser" + if test x$enableval = xyes; then + cat >> confdefs.h <<\EOF +#define ENABLE_BROWSER 1 +EOF + + fi +fi + + echo $ac_n "checking whether to use slang""... $ac_c" 1>&6 -echo "configure:1353: checking whether to use slang" >&5 +echo "configure:1381: checking whether to use slang" >&5 CURSES_LIB_NAME="" # Check whether --with-slang or --without-slang was given. if test "${with_slang+set}" = set; then @@ -1369,17 +1397,17 @@ if test "${with_slang+set}" = set; then ac_safe=`echo "slcurses.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for slcurses.h""... $ac_c" 1>&6 -echo "configure:1373: checking for slcurses.h" >&5 +echo "configure:1401: checking for slcurses.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1383: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1411: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1396,21 +1424,21 @@ fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for SLtt_initialize in -lslang""... $ac_c" 1>&6 -echo "configure:1400: checking for SLtt_initialize in -lslang" >&5 +echo "configure:1428: checking for SLtt_initialize in -lslang" >&5 _libs=$LIBS LIBS="$LIBS -lslang" if test "$cross_compiling" = yes; then echo "configure: warning: *** Can not use slang when cross-compiling" 1>&2 else cat > conftest.$ac_ext < #include int main () { SLtt_initialize (NULL); return 0; } EOF -if { (eval echo configure:1414: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1442: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then echo "$ac_t""yes" 1>&6 cat >> confdefs.h <<\EOF @@ -1433,7 +1461,7 @@ else # We might need the term library for termlib in ncurses curses termcap terminfo termlib; do echo $ac_n "checking for tputs in -l${termlib}""... $ac_c" 1>&6 -echo "configure:1437: checking for tputs in -l${termlib}" >&5 +echo "configure:1465: checking for tputs in -l${termlib}" >&5 ac_lib_var=`echo ${termlib}'_'tputs | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1441,7 +1469,7 @@ else ac_save_LIBS="$LIBS" LIBS="-l${termlib} $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1484: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1476,20 +1504,20 @@ fi done echo $ac_n "checking for SLtt_initialize in -lslang $tcap""... $ac_c" 1>&6 -echo "configure:1480: checking for SLtt_initialize in -lslang $tcap" >&5 +echo "configure:1508: checking for SLtt_initialize in -lslang $tcap" >&5 LIBS="$LIBS $tcap" if test "$cross_compiling" = yes; then echo "configure: warning: *** Can not use slang when cross-compiling" 1>&2 else cat > conftest.$ac_ext < #include int main () { SLtt_initialize (NULL); return 0; } EOF -if { (eval echo configure:1493: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1521: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then echo "$ac_t""yes" 1>&6 cat >> confdefs.h <<\EOF @@ -1511,20 +1539,20 @@ else echo "$ac_t""no" 1>&6 # We might need the math library echo $ac_n "checking for SLtt_initialize in -lslang $tcap -lm""... $ac_c" 1>&6 -echo "configure:1515: checking for SLtt_initialize in -lslang $tcap -lm" >&5 +echo "configure:1543: checking for SLtt_initialize in -lslang $tcap -lm" >&5 LIBS="$LIBS -lm" if test "$cross_compiling" = yes; then echo "configure: warning: *** Can not use slang when cross-compiling" 1>&2 else cat > conftest.$ac_ext < #include int main () { SLtt_initialize (NULL); return 0; } EOF -if { (eval echo configure:1528: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1556: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then echo "$ac_t""yes" 1>&6 cat >> confdefs.h <<\EOF @@ -1581,12 +1609,12 @@ fi for ac_func in snprintf vsnprintf do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1585: checking for $ac_func" >&5 +echo "configure:1613: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1641: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1688,7 +1716,7 @@ fi # Extract the first word of "glib-config", so it can be a program name with args. set dummy glib-config; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1692: checking for $ac_word" >&5 +echo "configure:1720: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GLIB_CONFIG'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1723,7 +1751,7 @@ fi min_glib_version=1.2.4 echo $ac_n "checking for GLIB - version >= $min_glib_version""... $ac_c" 1>&6 -echo "configure:1727: checking for GLIB - version >= $min_glib_version" >&5 +echo "configure:1755: checking for GLIB - version >= $min_glib_version" >&5 no_glib="" if test "$GLIB_CONFIG" = "no" ; then no_glib=yes @@ -1746,7 +1774,7 @@ echo "configure:1727: checking for GLIB - version >= $min_glib_version" >&5 echo $ac_n "cross compiling; assumed OK... $ac_c" else cat > conftest.$ac_ext < @@ -1822,7 +1850,7 @@ main () } EOF -if { (eval echo configure:1826: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1854: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -1856,7 +1884,7 @@ fi CFLAGS="$CFLAGS $GLIB_CFLAGS" LIBS="$LIBS $GLIB_LIBS" cat > conftest.$ac_ext < @@ -1866,7 +1894,7 @@ int main() { return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ; return 0; } EOF -if { (eval echo configure:1870: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1898: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding GLIB or finding the wrong" @@ -1913,12 +1941,12 @@ fi echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:1917: checking return type of signal handlers" >&5 +echo "configure:1945: checking return type of signal handlers" >&5 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1935,7 +1963,7 @@ int main() { int i; ; return 0; } EOF -if { (eval echo configure:1939: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1967: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else @@ -1954,12 +1982,12 @@ EOF echo $ac_n "checking for vprintf""... $ac_c" 1>&6 -echo "configure:1958: checking for vprintf" >&5 +echo "configure:1986: checking for vprintf" >&5 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2014: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_vprintf=yes" else @@ -2006,12 +2034,12 @@ fi if test "$ac_cv_func_vprintf" != yes; then echo $ac_n "checking for _doprnt""... $ac_c" 1>&6 -echo "configure:2010: checking for _doprnt" >&5 +echo "configure:2038: checking for _doprnt" >&5 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2066: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func__doprnt=yes" else @@ -2061,12 +2089,12 @@ fi for ac_func in getopt_long do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2065: checking for $ac_func" >&5 +echo "configure:2093: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2121: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2122,17 +2150,17 @@ then do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2126: checking for $ac_hdr" >&5 +echo "configure:2154: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2136: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2164: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2159,7 +2187,7 @@ fi done echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6 -echo "configure:2163: checking for tgetent in -lncurses" >&5 +echo "configure:2191: checking for tgetent in -lncurses" >&5 ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2167,7 +2195,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lncurses $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2210: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2203,7 +2231,7 @@ fi if eval "test x$CURSES_LIB_NAME = x" then echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6 -echo "configure:2207: checking for tgetent in -lcurses" >&5 +echo "configure:2235: checking for tgetent in -lcurses" >&5 ac_lib_var=`echo curses'_'tgetent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2211,7 +2239,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lcurses $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2254: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2248,7 +2276,7 @@ fi if eval "test x$CURSES_LIB_NAME = x" then echo $ac_n "checking for initscr in -lcurses""... $ac_c" 1>&6 -echo "configure:2252: checking for initscr in -lcurses" >&5 +echo "configure:2280: checking for initscr in -lcurses" >&5 ac_lib_var=`echo curses'_'initscr | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2256,7 +2284,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lcurses $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2299: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2292,7 +2320,7 @@ fi if eval "test x$CURSES_LIB_NAME = x" then echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6 -echo "configure:2296: checking for tgetent in -ltermcap" >&5 +echo "configure:2324: checking for tgetent in -ltermcap" >&5 ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2300,7 +2328,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ltermcap $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2343: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2345,7 +2373,7 @@ fi echo $ac_n "checking for wresize in -l$CURSES_LIB_NAME""... $ac_c" 1>&6 -echo "configure:2349: checking for wresize in -l$CURSES_LIB_NAME" >&5 +echo "configure:2377: checking for wresize in -l$CURSES_LIB_NAME" >&5 ac_lib_var=`echo $CURSES_LIB_NAME'_'wresize | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2353,7 +2381,7 @@ else ac_save_LIBS="$LIBS" LIBS="-l$CURSES_LIB_NAME $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2396: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2412,7 +2440,7 @@ fi # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2416: checking for $ac_word" >&5 +echo "configure:2444: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2440,12 +2468,12 @@ else fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:2444: checking for working const" >&5 +echo "configure:2472: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2526: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -2515,21 +2543,21 @@ EOF fi echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:2519: checking for inline" >&5 +echo "configure:2547: checking for inline" >&5 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2561: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -2555,12 +2583,12 @@ EOF esac echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:2559: checking for off_t" >&5 +echo "configure:2587: checking for off_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2588,12 +2616,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:2592: checking for size_t" >&5 +echo "configure:2620: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2623,19 +2651,19 @@ fi # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -echo "configure:2627: checking for working alloca.h" >&5 +echo "configure:2655: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { void *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:2639: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2667: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -2656,12 +2684,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:2660: checking for alloca" >&5 +echo "configure:2688: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2721: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -2721,12 +2749,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:2725: checking whether alloca needs Cray hooks" >&5 +echo "configure:2753: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2755: checking for $ac_func" >&5 +echo "configure:2783: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2811: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2806,7 +2834,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:2810: checking stack direction for C alloca" >&5 +echo "configure:2838: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2814,7 +2842,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2865: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else @@ -2858,17 +2886,17 @@ for ac_hdr in unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2862: checking for $ac_hdr" >&5 +echo "configure:2890: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2872: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2900: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2897,12 +2925,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2901: checking for $ac_func" >&5 +echo "configure:2929: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2957: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2950,7 +2978,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:2954: checking for working mmap" >&5 +echo "configure:2982: checking for working mmap" >&5 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2958,7 +2986,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3133: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_mmap_fixed_mapped=yes else @@ -3129,17 +3157,17 @@ unistd.h sys/param.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3133: checking for $ac_hdr" >&5 +echo "configure:3161: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3143: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3171: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3169,12 +3197,12 @@ done strdup __argz_count __argz_stringify __argz_next do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3173: checking for $ac_func" >&5 +echo "configure:3201: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3229: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3226,12 +3254,12 @@ done for ac_func in stpcpy do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3230: checking for $ac_func" >&5 +echo "configure:3258: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3286: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3288,19 +3316,19 @@ EOF if test $ac_cv_header_locale_h = yes; then echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6 -echo "configure:3292: checking for LC_MESSAGES" >&5 +echo "configure:3320: checking for LC_MESSAGES" >&5 if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { return LC_MESSAGES ; return 0; } EOF -if { (eval echo configure:3304: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3332: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* am_cv_val_LC_MESSAGES=yes else @@ -3321,7 +3349,7 @@ EOF fi fi echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6 -echo "configure:3325: checking whether NLS is requested" >&5 +echo "configure:3353: checking whether NLS is requested" >&5 # Check whether --enable-nls or --disable-nls was given. if test "${enable_nls+set}" = set; then enableval="$enable_nls" @@ -3341,7 +3369,7 @@ fi EOF echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6 -echo "configure:3345: checking whether included gettext is requested" >&5 +echo "configure:3373: checking whether included gettext is requested" >&5 # Check whether --with-included-gettext or --without-included-gettext was given. if test "${with_included_gettext+set}" = set; then withval="$with_included_gettext" @@ -3360,17 +3388,17 @@ fi ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for libintl.h""... $ac_c" 1>&6 -echo "configure:3364: checking for libintl.h" >&5 +echo "configure:3392: checking for libintl.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3374: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3402: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3387,19 +3415,19 @@ fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for gettext in libc""... $ac_c" 1>&6 -echo "configure:3391: checking for gettext in libc" >&5 +echo "configure:3419: checking for gettext in libc" >&5 if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { return (int) gettext ("") ; return 0; } EOF -if { (eval echo configure:3403: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3431: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gt_cv_func_gettext_libc=yes else @@ -3415,7 +3443,7 @@ echo "$ac_t""$gt_cv_func_gettext_libc" 1>&6 if test "$gt_cv_func_gettext_libc" != "yes"; then echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6 -echo "configure:3419: checking for bindtextdomain in -lintl" >&5 +echo "configure:3447: checking for bindtextdomain in -lintl" >&5 ac_lib_var=`echo intl'_'bindtextdomain | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3423,7 +3451,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lintl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3466: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3450,12 +3478,12 @@ fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6 -echo "configure:3454: checking for gettext in libintl" >&5 +echo "configure:3482: checking for gettext in libintl" >&5 if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else echo $ac_n "checking for gettext in -lintl""... $ac_c" 1>&6 -echo "configure:3459: checking for gettext in -lintl" >&5 +echo "configure:3487: checking for gettext in -lintl" >&5 ac_lib_var=`echo intl'_'gettext | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3463,7 +3491,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lintl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3506: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3513,7 +3541,7 @@ EOF # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3517: checking for $ac_word" >&5 +echo "configure:3545: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3547,12 +3575,12 @@ fi for ac_func in dcgettext do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3551: checking for $ac_func" >&5 +echo "configure:3579: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3607: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3602,7 +3630,7 @@ done # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3606: checking for $ac_word" >&5 +echo "configure:3634: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3638,7 +3666,7 @@ fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3642: checking for $ac_word" >&5 +echo "configure:3670: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3670,7 +3698,7 @@ else fi cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3710: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* CATOBJEXT=.gmo DATADIRNAME=share @@ -3701,7 +3729,7 @@ fi if test "$CATOBJEXT" = "NONE"; then echo $ac_n "checking whether catgets can be used""... $ac_c" 1>&6 -echo "configure:3705: checking whether catgets can be used" >&5 +echo "configure:3733: checking whether catgets can be used" >&5 # Check whether --with-catgets or --without-catgets was given. if test "${with_catgets+set}" = set; then withval="$with_catgets" @@ -3714,7 +3742,7 @@ fi if test "$nls_cv_use_catgets" = "yes"; then echo $ac_n "checking for main in -li""... $ac_c" 1>&6 -echo "configure:3718: checking for main in -li" >&5 +echo "configure:3746: checking for main in -li" >&5 ac_lib_var=`echo i'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3722,14 +3750,14 @@ else ac_save_LIBS="$LIBS" LIBS="-li $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3761: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3757,12 +3785,12 @@ else fi echo $ac_n "checking for catgets""... $ac_c" 1>&6 -echo "configure:3761: checking for catgets" >&5 +echo "configure:3789: checking for catgets" >&5 if eval "test \"`echo '$''{'ac_cv_func_catgets'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3817: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_catgets=yes" else @@ -3807,7 +3835,7 @@ EOF # Extract the first word of "gencat", so it can be a program name with args. set dummy gencat; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3811: checking for $ac_word" >&5 +echo "configure:3839: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GENCAT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3843,7 +3871,7 @@ fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3847: checking for $ac_word" >&5 +echo "configure:3875: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3880,7 +3908,7 @@ fi # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3884: checking for $ac_word" >&5 +echo "configure:3912: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3915,7 +3943,7 @@ fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3919: checking for $ac_word" >&5 +echo "configure:3947: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3973,7 +4001,7 @@ fi # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3977: checking for $ac_word" >&5 +echo "configure:4005: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4007,7 +4035,7 @@ fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4011: checking for $ac_word" >&5 +echo "configure:4039: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4043,7 +4071,7 @@ fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4047: checking for $ac_word" >&5 +echo "configure:4075: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4136,7 +4164,7 @@ fi LINGUAS= else echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6 -echo "configure:4140: checking for catalogs to be installed" >&5 +echo "configure:4168: checking for catalogs to be installed" >&5 NEW_LINGUAS= for lang in ${LINGUAS=$ALL_LINGUAS}; do case "$ALL_LINGUAS" in @@ -4164,17 +4192,17 @@ echo "configure:4140: checking for catalogs to be installed" >&5 if test "$CATOBJEXT" = ".cat"; then ac_safe=`echo "linux/version.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for linux/version.h""... $ac_c" 1>&6 -echo "configure:4168: checking for linux/version.h" >&5 +echo "configure:4196: checking for linux/version.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4178: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4206: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* diff --git a/configure.in b/configure.in index 88ef98b0..76760209 100644 --- a/configure.in +++ b/configure.in @@ -51,6 +51,18 @@ AC_ARG_ENABLE(help, AC_DEFINE(DISABLE_HELP) fi]) +AC_ARG_ENABLE(browser, +[ --enable-browser Enable mini file browser], + [if test x$enableval = xyes; then + AC_DEFINE(ENABLE_BROWSER) + fi]) + +AC_ARG_ENABLE(browser, +[ --enable-browser Enable mini file browser], + [if test x$enableval = xyes; then + AC_DEFINE(ENABLE_BROWSER) + fi]) + AC_MSG_CHECKING(whether to use slang) CURSES_LIB_NAME="" AC_ARG_WITH(slang, diff --git a/files.c b/files.c index 5d0c32e7..7fc950e1 100644 --- a/files.c +++ b/files.c @@ -271,6 +271,17 @@ int do_insertfile(void) realname = mallocstrcpy(realname, answer); #endif +#ifdef ENABLE_BROWSER + if (i == NANO_TOFILES_KEY) { + char *tmp = do_browser(getcwd(NULL, 0)); + + if (tmp != NULL) { + free(realname); + realname = tmp; + } + } +#endif + i = open_file(realname, 1, 0); free(realname); @@ -318,7 +329,7 @@ int write_file(char *name, int tmp) statusbar(_("Cancelled")); return -1; } - titlebar(); + titlebar(NULL); fileptr = fileage; if (realname != NULL) @@ -475,7 +486,7 @@ int write_file(char *name, int tmp) filename = mallocstrcpy(filename, realname); statusbar(_("Wrote %d lines"), lineswritten); UNSET(MODIFIED); - titlebar(); + titlebar(NULL); } return 1; } @@ -483,6 +494,7 @@ int write_file(char *name, int tmp) int do_writeout(int exiting) { int i = 0; + #ifdef NANO_EXTRA static int did_cred = 0; #endif @@ -509,6 +521,17 @@ int do_writeout(int exiting) if (i != -1) { +#ifdef ENABLE_BROWSER + if (i == NANO_TOFILES_KEY) { + char *tmp = do_browser(getcwd(NULL, 0)); + + if (tmp != NULL) { + free(answer); + answer = tmp; + } + } +#endif + #ifdef DEBUG fprintf(stderr, _("filename is %s"), answer); #endif @@ -1024,3 +1047,324 @@ char *input_tab(char *buf, int place, int *lastWasTab, int *newplace) return buf; } #endif + +#ifdef ENABLE_BROWSER + +/* Return the stat of the file pointed to by path */ +struct stat filestat(const char *path) { + struct stat st; + + stat(path, &st); + return st; +} + +/* Our sort routine for file listings - sort directories before + * files, and then alphabetically + */ +int diralphasort(const void *va, const void *vb) { + struct stat file1info, file2info; + char *a = *(char **)va, *b = *(char **)vb; + int answer = 0; + + if (stat(a, &file1info) == -1) + answer = 1; + else if (stat(b, &file2info) == -1) + answer = 1; + else { + /* If is a is a dir and b isn't, return -1. + Else if b is a dir and a isn't, return 0. + Else return a < b */ + + if (S_ISDIR(file1info.st_mode) && !S_ISDIR(file2info.st_mode)) + return -1; + else if (!S_ISDIR(file1info.st_mode) && S_ISDIR(file2info.st_mode)) + return 1; + else + answer = strcmp(a, b); + } + + return(answer); +} + +char **browser_init(char *path, int *longest, int *numents) +{ + DIR *dir; + struct dirent *next; + char **filelist = (char **) NULL; + int i = 0; + + dir = opendir(path); + if (!dir) + return NULL; + + *numents = 0; + while ((next = readdir(dir)) != NULL) { + if (!strcmp(next->d_name, ".")) + continue; + (*numents)++; + if (strlen(next->d_name) > *longest) + *longest = strlen(next->d_name); + } + rewinddir(dir); + *longest += 10; + + filelist = nmalloc(*numents * sizeof (char *)); + + while ((next = readdir(dir)) != NULL) { + if (!strcmp(next->d_name, ".")) + continue; + filelist[i] = nmalloc(strlen(next->d_name) + strlen(path) + 2); + + if (!strcmp(path, "/")) + snprintf(filelist[i], strlen(next->d_name) + strlen(path) + 1, + "%s%s", path, next->d_name); + else + snprintf(filelist[i], strlen(next->d_name) + strlen(path) + 2, + "%s/%s", path, next->d_name); + +/* + filelist[i] = mallocstrcpy(filelist[i], next->d_name); +*/ + i++; + } + + longest -= strlen(path); + + if (*longest > COLS - 1) + *longest = COLS - 1; + + return filelist; +} + +/* Free our malloced memory */ +void free_charptrarray(char **array, int len) +{ + int i; + + for (i = 0; i < len - 1; i++) + free(array[i]); + free(array); +} + +char *tail(char *foo) +{ + char *tmp = NULL; + + tmp = foo + strlen(foo); + while (*tmp != '/' && tmp != foo) + tmp--; + + tmp++; + + return tmp; +} + +void striponedir(char *foo) +{ + char *tmp = NULL; + + /* Don't strip the root dir */ + if (!strcmp(foo, "/")) + return; + + tmp = foo + strlen(foo); + if (*tmp == '/') + tmp--; + + while (*tmp != '/' && tmp != foo) + tmp--; + + if (tmp != foo) + *tmp = 0; + else + *(tmp+1) = 0; + + return; +} + +char *do_browser(char *inpath) +{ + struct stat st; + char *foo, *retval = NULL; + static char *path = NULL; + int numents = 0, i = 0, j = 0, kbinput = 0, longest = 0, abort = 0; + int col = 0, selected = 0, editline = 0, width = 0, filecols = 0; + char **filelist = (char **) NULL; + + if (path != NULL && strcmp(path, inpath)) { + free(path); + path = NULL; + } + + if (path == NULL) + path = mallocstrcpy(path, inpath); + + filelist = browser_init(path, &longest, &numents); + foo = nmalloc(longest + 8); + qsort(filelist, numents, sizeof(char *), diralphasort); + + titlebar(path); + bottombars(browser_list, BROWSER_LIST_LEN); + curs_set(0); + wmove(edit, 0, 0); + i = 0; + width = 0; + filecols = 0; + do { + blank_edit(); + blank_statusbar(); + editline = 0; + col = 0; + + switch (kbinput) { + case KEY_UP: + case 'u': + if (selected - width >= 0) + selected -= width; + break; + case KEY_LEFT: + case 'l': + if (selected > 0) + selected--; + break; + case KEY_DOWN: + case 'd': + if (selected + width <= numents - 1) + selected += width; + break; + case KEY_RIGHT: + case 'r': + if (selected < numents - 1) + selected++; + break; + case NANO_PREVPAGE_KEY: + case KEY_PPAGE: + if ((selected / width) % editwinrows == 0) { + if (selected - editwinrows >= 0) + selected -= editwinrows; + else + selected = 0; + } + else if (selected - (editwinrows + + (selected / width) % editwinrows) >= 0) + selected -= editwinrows + (selected / width) % editwinrows; + else + selected = 0; + break; + case NANO_NEXTPAGE_KEY: + case KEY_NPAGE: + if ((selected / width) % editwinrows == 0) { + if (selected + editwinrows <= numents - 1) + selected += editwinrows; + else + selected = numents - 1; + } + else if (selected + (editwinrows - + (selected / width) % editwinrows) <= numents - 1) + selected += editwinrows - (selected / width) % editwinrows; + else + selected = numents - 1; + break; + case KEY_ENTER: + case NANO_CONTROL_M: + if (!strcmp(filelist[selected], "/..") && !strcmp(path, "/")) + statusbar(_("Can't move up a directory")); + else + path = mallocstrcpy(path, filelist[selected]); + + st = filestat(path); + if (S_ISDIR(st.st_mode)) { + if (opendir(path) == NULL) { + statusbar(_("Can't open \"%s\": %s"), path, strerror(errno)); + striponedir(path); + align(&path); + break; + } + } + + st = filestat(path); + if (S_ISDIR(st.st_mode)) { + if (!strcmp("..", tail(path))) { + striponedir(path); + striponedir(path); + align(&path); + } + return do_browser(path); + } else { + ungetch(NANO_EXIT_KEY); + retval = path; + abort = 1; + } + break; + /* Stuff we want to abort the browser */ + case 'q': + case 'Q': + case 'e': /* Pico compatibility, yeech */ + case 'E': + abort = 1; + break; + } + if (abort) + break; + + if (width) + i = width * editwinrows * ((selected / width) / editwinrows); + else + i = 0; + + wmove(edit, 0, 0); + for (j = i; j < numents && editline <= editwinrows - 1; j++) { + filecols++; + + strncpy(foo, tail(filelist[j]), strlen(tail(filelist[j])) + 1); + while (strlen(foo) < longest) + strcat(foo, " "); + col += strlen(foo); + + /* Put file info in the string also */ + st = filestat(filelist[j]); + if (S_ISDIR(st.st_mode)) + strcpy(foo + longest - 5, "(dir)"); + else { + if (st.st_size < 1024) /* less than 1 K */ + sprintf(foo + longest - 7, "%4d B", (int) st.st_size); + else if (st.st_size > 1073741824) /* at least 1 gig */ + sprintf(foo + longest - 7, "%4d GB", (int) st.st_size / 1073741824); + else if (st.st_size > 1048576) /* at least 1 meg */ + sprintf(foo + longest - 7, "%4d MB", (int) st.st_size / 1048576); + else /* Its more than 1 k and less than a meg */ + sprintf(foo + longest - 7, "%4d KB", (int) st.st_size / 1024); + } + + if (j == selected) + wattron(edit, A_REVERSE); + waddnstr(edit, foo, strlen(foo)); + if (j == selected) + wattroff(edit, A_REVERSE); + + waddstr(edit, " "); + col += 2; + + /* And if the next entry isn't going to fit on the + line, move to the next one */ + if (col > (COLS - longest)) { + editline++; + wmove(edit, editline, 0); + col = 0; + if (width == 0) + width = filecols; + } + } + wrefresh(edit); + } while ((kbinput = wgetch(edit)) != NANO_EXIT_KEY); + curs_set(1); + blank_edit(); + titlebar(NULL); + edit_refresh(); + + free_charptrarray(filelist, numents); + free(foo); + return retval; +} +#endif + diff --git a/global.c b/global.c index ee5d61e4..f7125e7f 100644 --- a/global.c +++ b/global.c @@ -79,6 +79,10 @@ shortcut goto_list[GOTO_LIST_LEN]; shortcut writefile_list[WRITEFILE_LIST_LEN]; shortcut help_list[HELP_LIST_LEN]; shortcut spell_list[SPELL_LIST_LEN]; +#ifdef ENABLE_BROWSER +shortcut browser_list[BROWSER_LIST_LEN]; +#endif + toggle toggles[TOGGLE_LEN]; /* Regular expressions */ @@ -170,7 +174,7 @@ void shortcut_init(int unjustify) "", *nano_mark_msg = "", *nano_delete_msg = "", *nano_backspace_msg = "", *nano_tab_msg = "", *nano_enter_msg = "", *nano_case_msg = - "", *nano_cancel_msg = "", *nano_unjustify_msg = ""; + "", *nano_cancel_msg = "", *nano_unjustify_msg = "", *nano_tofiles_msg = ""; #ifndef NANO_SMALL nano_help_msg = _("Invoke the help menu"); @@ -205,6 +209,7 @@ void shortcut_init(int unjustify) nano_enter_msg = _("Insert a carriage return at the cursor position"); nano_case_msg = _("Make the current search or replace case (in)sensitive"); + nano_tofiles_msg = _("Go to file browser"); nano_cancel_msg = _("Cancel the current function"); #endif @@ -403,15 +408,31 @@ void shortcut_init(int unjustify) nano_exit_msg, 0, NANO_EXIT_FKEY, 0, VIEW, do_exit); - sc_init_one(&writefile_list[0], NANO_CANCEL_KEY, _("Cancel"), - nano_cancel_msg, 0, 0, 0, VIEW, 0); +#ifdef ENABLE_BROWSER + sc_init_one(&writefile_list[0], NANO_TOFILES_KEY, _("To Files"), + nano_tofiles_msg, 0, 0, 0, NOVIEW, 0); +#endif - - sc_init_one(&writefile_list[0], NANO_CANCEL_KEY, _("Cancel"), + sc_init_one(&writefile_list[WRITEFILE_LIST_LEN - 1], NANO_CANCEL_KEY, _("Cancel"), nano_cancel_msg, 0, 0, 0, VIEW, 0); sc_init_one(&spell_list[0], NANO_CANCEL_KEY, _("Cancel"), nano_cancel_msg, 0, 0, 0, VIEW, 0); +#ifdef ENABLE_BROWSER + sc_init_one(&browser_list[0], NANO_PREVPAGE_KEY, _("Prev Page"), + nano_prevpage_msg, + 0, NANO_PREVPAGE_FKEY, KEY_PPAGE, VIEW, 0); + + sc_init_one(&browser_list[1], NANO_NEXTPAGE_KEY, _("Next Page"), + nano_nextpage_msg, + 0, NANO_NEXTPAGE_FKEY, KEY_NPAGE, VIEW, 0); + + sc_init_one(&browser_list[2], NANO_EXIT_KEY, _("Exit"), + nano_exit_msg, 0, NANO_EXIT_FKEY, 0, VIEW, 0); + +#endif + + toggle_init(); } diff --git a/nano.c b/nano.c index 9e010072..f537986b 100644 --- a/nano.c +++ b/nano.c @@ -1601,7 +1601,7 @@ void handle_sigwinch(int s) /* Do these b/c width may have changed... */ refresh(); - titlebar(); + titlebar(NULL); edit_refresh(); display_main_list(); total_refresh(); @@ -2246,7 +2246,7 @@ int main(int argc, char *argv[]) fprintf(stderr, _("Main: open file\n")); #endif - titlebar(); + titlebar(NULL); /* Now we check to see if argv[optind] is non-null to determine if we're dealing with a new file or not, not argc == 1... */ diff --git a/nano.h b/nano.h index f5a6abc2..2a87ea97 100644 --- a/nano.h +++ b/nano.h @@ -226,6 +226,7 @@ know what you're doing */ #define NANO_SUSPEND_KEY NANO_CONTROL_Z #define NANO_ENTER_KEY NANO_CONTROL_M #define NANO_FROMSEARCHTOGOTO_KEY NANO_CONTROL_T +#define NANO_TOFILES_KEY NANO_CONTROL_T #define TOGGLE_CONST_KEY NANO_ALT_C #define TOGGLE_AUTOINDENT_KEY NANO_ALT_I @@ -243,10 +244,16 @@ know what you're doing */ #define REPLACE_LIST_LEN 6 #define REPLACE_LIST_2_LEN 3 #define GOTO_LIST_LEN 3 -#define WRITEFILE_LIST_LEN 1 #define HELP_LIST_LEN 3 #define SPELL_LIST_LEN 1 +#ifdef ENABLE_BROWSER +#define WRITEFILE_LIST_LEN 2 +#define BROWSER_LIST_LEN 3 +#else +#define WRITEFILE_LIST_LEN 1 +#endif + #ifdef HAVE_REGEX_H #define TOGGLE_LEN 9 #else diff --git a/proto.h b/proto.h index 0f5db60c..84d822f0 100644 --- a/proto.h +++ b/proto.h @@ -51,6 +51,9 @@ extern shortcut main_list[MAIN_LIST_LEN], whereis_list[WHEREIS_LIST_LEN]; extern shortcut replace_list[REPLACE_LIST_LEN], goto_list[GOTO_LIST_LEN]; extern shortcut writefile_list[WRITEFILE_LIST_LEN], help_list[HELP_LIST_LEN]; extern shortcut spell_list[SPELL_LIST_LEN], replace_list_2[REPLACE_LIST_LEN]; +#ifdef ENABLE_BROWSER +extern shortcut browser_list[BROWSER_LIST_LEN]; +#endif #ifdef HAVE_REGEX_H extern int use_regexp, regexp_compiled; @@ -109,7 +112,8 @@ void check_statblank(void); void update_line(filestruct * fileptr, int index); void fix_editbot(void); void statusbar(char *msg, ...); -void titlebar(void); +void blank_statusbar(void); +void titlebar(char *path); void previous_line(void); void center_cursor(void); void bottombars(shortcut s[], int slen); @@ -149,6 +153,10 @@ int do_delete(void), do_backspace(void), do_tab(void), do_justify(void); int do_first_line(void), do_last_line(void); int do_replace(void), do_help(void), do_enter_void(void); +#ifdef ENABLE_BROWSER +char *do_browser(char *path); +#endif + filestruct *copy_node(filestruct * src); filestruct *copy_filestruct(filestruct * src); filestruct *make_new_node(filestruct * prevnode); diff --git a/winio.c b/winio.c index 5281ce7a..fbc840fb 100644 --- a/winio.c +++ b/winio.c @@ -463,9 +463,13 @@ void horizbar(WINDOW * win, int y) wattroff(win, A_REVERSE); } -void titlebar(void) +void titlebar(char *path) { int namelen, space; + char *what = path; + + if (path == NULL) + what = filename; horizbar(topwin, 0); wattron(topwin, A_REVERSE); @@ -473,17 +477,23 @@ void titlebar(void) space = COLS - strlen(VERMSG) - strlen(VERSION) - 21; - namelen = strlen(filename); + namelen = strlen(what); - if (!strcmp(filename, "")) + if (!strcmp(what, "")) mvwaddstr(topwin, 0, center_x - 6, _("New Buffer")); else { if (namelen > space) { - waddstr(topwin, _(" File: ...")); - waddstr(topwin, &filename[namelen - space]); + if (path == NULL) + waddstr(topwin, _(" File: ...")); + else + waddstr(topwin, _(" DIR: ...")); + waddstr(topwin, &what[namelen - space]); } else { - mvwaddstr(topwin, 0, center_x - (namelen / 2 + 1), "File: "); - waddstr(topwin, filename); + if (path == NULL) + mvwaddstr(topwin, 0, center_x - (namelen / 2 + 1), "File: "); + else + mvwaddstr(topwin, 0, center_x - (namelen / 2 + 1), " DIR: "); + waddstr(topwin, what); } } if (ISSET(MODIFIED)) @@ -552,7 +562,7 @@ void set_modified(void) { if (!ISSET(MODIFIED)) { SET(MODIFIED); - titlebar(); + titlebar(NULL); wrefresh(topwin); } } @@ -1119,7 +1129,7 @@ int total_refresh(void) clearok(topwin, FALSE); clearok(bottomwin, FALSE); edit_refresh(); - titlebar(); + titlebar(NULL); return 1; }