/* * This file is placed into the public domain by the author, * * Tim Vanderhoek * Shigio Yamaguchi */ diff -c -r -N ../less-358.org/cmd.h ./cmd.h *** ../less-358.org/cmd.h Sun Jul 9 09:26:43 2000 --- ./cmd.h Tue Jan 23 01:02:11 2001 *************** *** 63,68 **** --- 63,70 ---- #define A_F_FOREVER 50 #define A_GOPOS 51 #define A_REMOVE_FILE 52 + #define A_NEXT_TAG 53 + #define A_PREV_TAG 54 #define A_INVALID 100 #define A_NOACTION 101 diff -c -r -N ../less-358.org/command.c ./command.c *** ../less-358.org/command.c Sun Jul 9 09:26:43 2000 --- ./command.c Tue Jan 23 01:36:30 2001 *************** *** 214,219 **** --- 214,224 ---- if (secure) break; edit_list(cbuf); + /* + * If tag structure loaded then cleanup it leaving + * ifile structure. + */ + cleantags(); break; #endif #if SHELL_ESCAPE *************** *** 832,837 **** --- 837,843 ---- PARG parg; IFILE old_ifile; IFILE new_ifile; + char *tagfile; search_type = SRCH_FORW; wscroll = (sc_height + 1) / 2; *************** *** 1349,1354 **** --- 1355,1364 ---- /* * Examine next file. */ + if (ntags()) { + error("No next file", NULL_PARG); + break; + } if (number <= 0) number = 1; if (edit_next(number)) *************** *** 1365,1370 **** --- 1375,1384 ---- /* * Examine previous file. */ + if (ntags()) { + error("No previous file", NULL_PARG); + break; + } if (number <= 0) number = 1; if (edit_prev(number)) *************** *** 1372,1377 **** --- 1386,1415 ---- parg.p_string = (number > 1) ? "(N-th) " : ""; error("No %sprevious file", &parg); } + break; + + case A_NEXT_TAG: + if (number <= 0) + number = 1; + tagfile = nexttag(number); + if (tagfile == NULL) { + error("No next tag", NULL_PARG); + break; + } + if (!edit(tagfile)) + (void)tagsearch(); + break; + + case A_PREV_TAG: + if (number <= 0) + number = 1; + tagfile = prevtag(number); + if (tagfile == NULL) { + error("No previous tag", NULL_PARG); + break; + } + if (!edit(tagfile)) + (void)tagsearch(); break; case A_INDEX_FILE: diff -c -r -N ../less-358.org/configure ./configure *** ../less-358.org/configure Sun Jul 9 09:27:24 2000 --- ./configure Tue Jan 23 01:40:35 2001 *************** *** 1,7 **** #! /bin/sh # Guess values for system-dependent variables and create Makefiles. ! # Generated automatically using autoconf version 2.12 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. # # This configure script is free software; the Free Software Foundation --- 1,7 ---- #! /bin/sh # Guess values for system-dependent variables and create Makefiles. ! # Generated automatically using autoconf version 2.13 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. # # This configure script is free software; the Free Software Foundation *************** *** 53,58 **** --- 53,59 ---- # Initialize some other variables. subdirs= MFLAGS= MAKEFLAGS= + SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. ac_max_here_lines=12 *************** *** 336,342 **** verbose=yes ;; -version | --version | --versio | --versi | --vers) ! echo "configure generated by autoconf version 2.12" exit 0 ;; -with-* | --with-*) --- 337,343 ---- verbose=yes ;; -version | --version | --versio | --versi | --vers) ! echo "configure generated by autoconf version 2.13" exit 0 ;; -with-* | --with-*) *************** *** 506,514 **** # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ! ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then --- 507,517 ---- # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ! ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross + ac_exeext= + ac_objext=o if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then *************** *** 527,541 **** # 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:531: 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 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ! IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" ! for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_CC="gcc" --- 530,545 ---- # 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:534: 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 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ! IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ! ac_dummy="$PATH" ! for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_CC="gcc" *************** *** 556,571 **** # 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:560: 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 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ! IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" ac_prog_rejected=no ! for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then --- 560,576 ---- # 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:564: 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 if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ! IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_prog_rejected=no ! ac_dummy="$PATH" ! for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then *************** *** 600,624 **** echo "$ac_t""no" 1>&6 fi test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 ! echo "configure:608: 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. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ! ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross ! cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; 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 --- 605,665 ---- echo "$ac_t""no" 1>&6 fi + if test -z "$CC"; then + case "`uname -s`" in + *win32* | *WIN32*) + # Extract the first word of "cl", so it can be a program name with args. + set dummy cl; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 + echo "configure:615: 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 + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. + else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="cl" + break + fi + done + IFS="$ac_save_ifs" + fi + fi + CC="$ac_cv_prog_CC" + if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 + else + echo "$ac_t""no" 1>&6 + fi + ;; + esac + fi test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 ! echo "configure:647: 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. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ! ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross ! cat > conftest.$ac_ext << EOF ! ! #line 658 "configure" #include "confdefs.h" + main(){return(0);} EOF ! if { (eval echo configure:663: \"$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 *************** *** 632,649 **** ac_cv_prog_cc_works=no fi rm -fr conftest* echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 ! echo "configure:642: 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:647: 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 --- 673,696 ---- ac_cv_prog_cc_works=no fi rm -fr conftest* + ac_ext=c + # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. + ac_cpp='$CPP $CPPFLAGS' + ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' + ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' + cross_compiling=$ac_cv_prog_cc_cross echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 ! echo "configure:689: 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:694: 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 *************** *** 652,658 **** yes; #endif EOF ! if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:656: \"$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 --- 699,705 ---- yes; #endif EOF ! if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:703: \"$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 *************** *** 663,673 **** if test $ac_cv_prog_gcc = yes; then GCC=yes ! 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:671: 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 --- 710,724 ---- if test $ac_cv_prog_gcc = yes; then GCC=yes ! else ! GCC= ! fi ! ! 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:722: 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 *************** *** 682,701 **** fi echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 ! if test "$ac_test_CFLAGS" = set; then ! CFLAGS="$ac_save_CFLAGS" ! elif test $ac_cv_prog_cc_g = yes; then CFLAGS="-g -O2" else ! CFLAGS="-O2" fi else ! GCC= ! test "${CFLAGS+set}" = set || CFLAGS="-g" fi echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6 ! echo "configure:699: 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 --- 733,756 ---- fi echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 ! if test "$ac_test_CFLAGS" = set; then ! CFLAGS="$ac_save_CFLAGS" ! elif test $ac_cv_prog_cc_g = yes; then ! if test "$GCC" = yes; then CFLAGS="-g -O2" else ! CFLAGS="-g" fi else ! if test "$GCC" = yes; then ! CFLAGS="-O2" ! else ! CFLAGS= ! fi fi echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6 ! echo "configure:754: 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 *************** *** 716,722 **** fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 ! echo "configure:720: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= --- 771,777 ---- fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 ! echo "configure:775: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= *************** *** 731,744 **** # 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:741: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ! ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : else --- 786,799 ---- # 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:796: \"$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 : else *************** *** 748,761 **** 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:758: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ! ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : else --- 803,833 ---- 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:813: \"$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 ! : ! else ! echo "$ac_err" >&5 ! echo "configure: failed program was:" >&5 ! cat conftest.$ac_ext >&5 ! 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:830: \"$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 : else *************** *** 768,773 **** --- 840,847 ---- rm -f conftest* fi rm -f conftest* + fi + rm -f conftest* ac_cv_prog_CPP="$CPP" fi CPP="$ac_cv_prog_CPP" *************** *** 778,790 **** if test $ac_cv_prog_gcc = yes; then echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6 ! echo "configure:782: checking whether ${CC-cc} needs -traditional" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_pattern="Autoconf.*'x'" cat > conftest.$ac_ext < Autoconf TIOCGETP --- 852,864 ---- if test $ac_cv_prog_gcc = yes; then echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6 ! echo "configure:856: checking whether ${CC-cc} needs -traditional" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_pattern="Autoconf.*'x'" cat > conftest.$ac_ext < Autoconf TIOCGETP *************** *** 802,808 **** if test $ac_cv_prog_gcc_traditional = no; then cat > conftest.$ac_ext < Autoconf TCGETA --- 876,882 ---- if test $ac_cv_prog_gcc_traditional = no; then cat > conftest.$ac_ext < Autoconf TCGETA *************** *** 849,876 **** # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 ! echo "configure:857: 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 else ! IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do # Account for people who put trailing slashes in PATH elements. case "$ac_dir/" in /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. ! for ac_prog in ginstall installbsd scoinst install; do if test -f $ac_dir/$ac_prog; then if test $ac_prog = install && grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. - # OSF/1 installbsd also uses dspmsg, but is usable. : else ac_cv_path_install="$ac_dir/$ac_prog -c" --- 923,952 ---- # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install + # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 ! echo "configure:932: 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 else ! IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" for ac_dir in $PATH; do # Account for people who put trailing slashes in PATH elements. case "$ac_dir/" in /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. ! # Don't use installbsd from OSF since it installs stuff as root ! # by default. ! for ac_prog in ginstall scoinst install; do if test -f $ac_dir/$ac_prog; then if test $ac_prog = install && grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : else ac_cv_path_install="$ac_dir/$ac_prog -c" *************** *** 900,910 **** # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking for initscr in -lxcurses""... $ac_c" 1>&6 ! echo "configure:908: checking for initscr in -lxcurses" >&5 ac_lib_var=`echo xcurses'_'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 --- 976,988 ---- # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking for initscr in -lxcurses""... $ac_c" 1>&6 ! echo "configure:986: checking for initscr in -lxcurses" >&5 ac_lib_var=`echo xcurses'_'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 *************** *** 912,918 **** ac_save_LIBS="$LIBS" LIBS="-lxcurses $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else --- 1001,1007 ---- initscr() ; return 0; } EOF ! if { (eval echo configure:1005: \"$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 *************** *** 945,951 **** fi echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6 ! echo "configure:949: checking for initscr in -lncurses" >&5 ac_lib_var=`echo ncurses'_'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 --- 1023,1029 ---- fi echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6 ! echo "configure:1027: checking for initscr in -lncurses" >&5 ac_lib_var=`echo ncurses'_'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 *************** *** 953,959 **** ac_save_LIBS="$LIBS" LIBS="-lncurses $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else --- 1042,1048 ---- initscr() ; return 0; } EOF ! if { (eval echo configure:1046: \"$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 *************** *** 986,992 **** fi echo $ac_n "checking for initscr in -lcurses""... $ac_c" 1>&6 ! echo "configure:990: 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 --- 1064,1070 ---- fi echo $ac_n "checking for initscr in -lcurses""... $ac_c" 1>&6 ! echo "configure:1068: 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 *************** *** 994,1000 **** ac_save_LIBS="$LIBS" LIBS="-lcurses $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else --- 1083,1089 ---- initscr() ; return 0; } EOF ! if { (eval echo configure:1087: \"$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 *************** *** 1027,1033 **** fi echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6 ! echo "configure:1031: 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 --- 1105,1111 ---- fi echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6 ! echo "configure:1109: 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 *************** *** 1035,1041 **** ac_save_LIBS="$LIBS" LIBS="-ltermcap $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else --- 1124,1130 ---- tgetent() ; return 0; } EOF ! if { (eval echo configure:1128: \"$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 *************** *** 1068,1074 **** fi echo $ac_n "checking for tgetent in -ltermlib""... $ac_c" 1>&6 ! echo "configure:1072: checking for tgetent in -ltermlib" >&5 ac_lib_var=`echo termlib'_'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 --- 1146,1152 ---- fi echo $ac_n "checking for tgetent in -ltermlib""... $ac_c" 1>&6 ! echo "configure:1150: checking for tgetent in -ltermlib" >&5 ac_lib_var=`echo termlib'_'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 *************** *** 1076,1082 **** ac_save_LIBS="$LIBS" LIBS="-ltermlib $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else --- 1165,1171 ---- tgetent() ; return 0; } EOF ! if { (eval echo configure:1169: \"$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 *************** *** 1109,1115 **** fi echo $ac_n "checking for regcmp in -lgen""... $ac_c" 1>&6 ! echo "configure:1113: checking for regcmp in -lgen" >&5 ac_lib_var=`echo gen'_'regcmp | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 1187,1193 ---- fi echo $ac_n "checking for regcmp in -lgen""... $ac_c" 1>&6 ! echo "configure:1191: checking for regcmp in -lgen" >&5 ac_lib_var=`echo gen'_'regcmp | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 1117,1123 **** ac_save_LIBS="$LIBS" LIBS="-lgen $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else --- 1206,1212 ---- regcmp() ; return 0; } EOF ! if { (eval echo configure:1210: \"$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 *************** *** 1156,1162 **** fi echo $ac_n "checking for regcmp in -lintl""... $ac_c" 1>&6 ! echo "configure:1160: checking for regcmp in -lintl" >&5 ac_lib_var=`echo intl'_'regcmp | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 1234,1240 ---- fi echo $ac_n "checking for regcmp in -lintl""... $ac_c" 1>&6 ! echo "configure:1238: checking for regcmp in -lintl" >&5 ac_lib_var=`echo intl'_'regcmp | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 1164,1170 **** ac_save_LIBS="$LIBS" LIBS="-lintl $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else --- 1253,1259 ---- regcmp() ; return 0; } EOF ! if { (eval echo configure:1257: \"$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 *************** *** 1203,1209 **** fi echo $ac_n "checking for regcmp in -lPW""... $ac_c" 1>&6 ! echo "configure:1207: checking for regcmp in -lPW" >&5 ac_lib_var=`echo PW'_'regcmp | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 1281,1287 ---- fi echo $ac_n "checking for regcmp in -lPW""... $ac_c" 1>&6 ! echo "configure:1285: checking for regcmp in -lPW" >&5 ac_lib_var=`echo PW'_'regcmp | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 1211,1217 **** ac_save_LIBS="$LIBS" LIBS="-lPW $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else --- 1300,1306 ---- regcmp() ; return 0; } EOF ! if { (eval echo configure:1304: \"$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 *************** *** 1251,1257 **** echo $ac_n "checking for working terminal libraries""... $ac_c" 1>&6 ! echo "configure:1255: checking for working terminal libraries" >&5 TERMLIBS= curses_broken=0 --- 1329,1335 ---- echo $ac_n "checking for working terminal libraries""... $ac_c" 1>&6 ! echo "configure:1333: checking for working terminal libraries" >&5 TERMLIBS= curses_broken=0 *************** *** 1268,1281 **** SAVE_LIBS=$LIBS LIBS="$LIBS $TERMLIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* termok=yes else --- 1346,1359 ---- SAVE_LIBS=$LIBS LIBS="$LIBS $TERMLIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* termok=yes else *************** *** 1296,1309 **** SAVE_LIBS=$LIBS LIBS="$LIBS $TERMLIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* termok=yes else --- 1374,1387 ---- SAVE_LIBS=$LIBS LIBS="$LIBS $TERMLIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* termok=yes else *************** *** 1324,1337 **** SAVE_LIBS=$LIBS LIBS="$LIBS $TERMLIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* termok=yes else --- 1402,1415 ---- SAVE_LIBS=$LIBS LIBS="$LIBS $TERMLIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* termok=yes else *************** *** 1353,1366 **** SAVE_LIBS=$LIBS LIBS="$LIBS $TERMLIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* termok=yes else --- 1431,1444 ---- SAVE_LIBS=$LIBS LIBS="$LIBS $TERMLIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* termok=yes else *************** *** 1383,1396 **** SAVE_LIBS=$LIBS LIBS="$LIBS $TERMLIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* termok=yes else --- 1461,1474 ---- SAVE_LIBS=$LIBS LIBS="$LIBS $TERMLIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* termok=yes else *************** *** 1411,1424 **** SAVE_LIBS=$LIBS LIBS="$LIBS $TERMLIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* termok=yes else --- 1489,1502 ---- SAVE_LIBS=$LIBS LIBS="$LIBS $TERMLIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* termok=yes else *************** *** 1445,1462 **** do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 ! echo "configure:1449: 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:1459: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ! ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" --- 1523,1540 ---- do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 ! echo "configure:1527: 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:1537: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ! ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" *************** *** 1483,1494 **** echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 ! echo "configure:1487: 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 --- 1561,1572 ---- echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 ! echo "configure:1565: 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 *************** *** 1496,1503 **** #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1500: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ! ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* ac_cv_header_stdc=yes --- 1574,1581 ---- #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1578: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ! ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* ac_cv_header_stdc=yes *************** *** 1513,1519 **** 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 --- 1591,1597 ---- 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 *************** *** 1531,1537 **** 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 --- 1609,1615 ---- 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 *************** *** 1552,1558 **** : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') --- 1630,1636 ---- : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') *************** *** 1563,1569 **** exit (0); } EOF ! if { (eval echo configure:1567: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then : else --- 1641,1647 ---- exit (0); } EOF ! if { (eval echo configure:1645: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else *************** *** 1587,1598 **** fi echo $ac_n "checking for off_t""... $ac_c" 1>&6 ! echo "configure:1591: 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 --- 1665,1676 ---- fi echo $ac_n "checking for off_t""... $ac_c" 1>&6 ! echo "configure:1669: 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 *************** *** 1601,1607 **** #endif EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | ! egrep "off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then rm -rf conftest* ac_cv_type_off_t=yes else --- 1679,1685 ---- #endif EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | ! egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then rm -rf conftest* ac_cv_type_off_t=yes else *************** *** 1620,1635 **** fi echo $ac_n "checking for void""... $ac_c" 1>&6 ! echo "configure:1624: checking for void" >&5 cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF #define HAVE_VOID 1 --- 1698,1713 ---- fi echo $ac_n "checking for void""... $ac_c" 1>&6 ! echo "configure:1702: checking for void" >&5 cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF #define HAVE_VOID 1 *************** *** 1643,1658 **** fi rm -f conftest* echo $ac_n "checking for const""... $ac_c" 1>&6 ! echo "configure:1647: checking for const" >&5 cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF #define HAVE_CONST 1 --- 1721,1736 ---- fi rm -f conftest* echo $ac_n "checking for const""... $ac_c" 1>&6 ! echo "configure:1725: checking for const" >&5 cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF #define HAVE_CONST 1 *************** *** 1666,1681 **** fi rm -f conftest* echo $ac_n "checking for time_t""... $ac_c" 1>&6 ! echo "configure:1670: checking for time_t" >&5 cat > conftest.$ac_ext < int main() { time_t t = 0; ; return 0; } EOF ! if { (eval echo configure:1679: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF #define HAVE_TIME_T 1 --- 1744,1759 ---- fi rm -f conftest* echo $ac_n "checking for time_t""... $ac_c" 1>&6 ! echo "configure:1748: checking for time_t" >&5 cat > conftest.$ac_ext < int main() { time_t t = 0; ; return 0; } EOF ! if { (eval echo configure:1757: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF #define HAVE_TIME_T 1 *************** *** 1690,1701 **** rm -f conftest* echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 ! echo "configure:1694: 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 --- 1768,1779 ---- rm -f conftest* echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 ! echo "configure:1772: 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 *************** *** 1712,1718 **** int i; ; return 0; } EOF ! if { (eval echo configure:1716: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else --- 1790,1796 ---- int i; ; return 0; } EOF ! if { (eval echo configure:1794: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else *************** *** 1730,1744 **** EOF ! for ac_func in memcpy popen _setjmp sigprocmask sigsetmask stat strchr strstr system do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ! echo "configure:1737: 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 <&6 ! echo "configure:1815: 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; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else --- 1839,1845 ---- ; return 0; } EOF ! if { (eval echo configure:1843: \"$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 *************** *** 1787,1798 **** echo $ac_n "checking for tcgetattr""... $ac_c" 1>&6 ! echo "configure:1791: checking for tcgetattr" >&5 if eval "test \"`echo '$''{'ac_cv_func_tcgetattr'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:1869: checking for tcgetattr" >&5 if eval "test \"`echo '$''{'ac_cv_func_tcgetattr'+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; then rm -rf conftest* eval "ac_cv_func_tcgetattr=yes" else --- 1893,1899 ---- ; return 0; } EOF ! if { (eval echo configure:1897: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_tcgetattr=yes" else *************** *** 1839,1847 **** echo $ac_n "checking for fileno""... $ac_c" 1>&6 ! echo "configure:1843: checking for fileno" >&5 cat > conftest.$ac_ext <&6 ! echo "configure:1921: checking for fileno" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF #define HAVE_FILENO 1 --- 1929,1935 ---- static int x; x = fileno(stdin); ; return 0; } EOF ! if { (eval echo configure:1933: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF #define HAVE_FILENO 1 *************** *** 1866,1874 **** rm -f conftest* echo $ac_n "checking for strerror""... $ac_c" 1>&6 ! echo "configure:1870: checking for strerror" >&5 cat > conftest.$ac_ext <&6 ! echo "configure:1948: checking for strerror" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF #define HAVE_STRERROR 1 --- 1962,1968 ---- static char *x; x = strerror(0); ; return 0; } EOF ! if { (eval echo configure:1966: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF #define HAVE_STRERROR 1 *************** *** 1899,1914 **** rm -f conftest* echo $ac_n "checking for sys_errlist""... $ac_c" 1>&6 ! echo "configure:1903: checking for sys_errlist" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF #define HAVE_SYS_ERRLIST 1 --- 1977,1992 ---- rm -f conftest* echo $ac_n "checking for sys_errlist""... $ac_c" 1>&6 ! echo "configure:1981: checking for sys_errlist" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF #define HAVE_SYS_ERRLIST 1 *************** *** 1923,1931 **** rm -f conftest* echo $ac_n "checking for sigset_t""... $ac_c" 1>&6 ! echo "configure:1927: checking for sigset_t" >&5 cat > conftest.$ac_ext < --- 2001,2009 ---- rm -f conftest* echo $ac_n "checking for sigset_t""... $ac_c" 1>&6 ! echo "configure:2005: checking for sigset_t" >&5 cat > conftest.$ac_ext < *************** *** 1934,1940 **** sigset_t s; s = 0; ; return 0; } EOF ! if { (eval echo configure:1938: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF #define HAVE_SIGSET_T 1 --- 2012,2018 ---- sigset_t s; s = 0; ; return 0; } EOF ! if { (eval echo configure:2016: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF #define HAVE_SIGSET_T 1 *************** *** 1949,1957 **** rm -f conftest* echo $ac_n "checking for sigemptyset""... $ac_c" 1>&6 ! echo "configure:1953: checking for sigemptyset" >&5 cat > conftest.$ac_ext < --- 2027,2035 ---- rm -f conftest* echo $ac_n "checking for sigemptyset""... $ac_c" 1>&6 ! echo "configure:2031: checking for sigemptyset" >&5 cat > conftest.$ac_ext < *************** *** 1960,1966 **** sigset_t s; sigemptyset(&s); ; return 0; } EOF ! if { (eval echo configure:1964: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF #define HAVE_SIGEMPTYSET 1 --- 2038,2044 ---- sigset_t s; sigemptyset(&s); ; return 0; } EOF ! if { (eval echo configure:2042: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF #define HAVE_SIGEMPTYSET 1 *************** *** 1976,1984 **** have_errno=no echo $ac_n "checking for errno""... $ac_c" 1>&6 ! echo "configure:1980: checking for errno" >&5 cat > conftest.$ac_ext <&6 ! echo "configure:2058: checking for errno" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* echo "$ac_t""yes - in errno.h" 1>&6; cat >> confdefs.h <<\EOF #define HAVE_ERRNO 1 --- 2066,2072 ---- static int x; x = errno; ; return 0; } EOF ! if { (eval echo configure:2070: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""yes - in errno.h" 1>&6; cat >> confdefs.h <<\EOF #define HAVE_ERRNO 1 *************** *** 2001,2007 **** rm -f conftest* if test $have_errno = no; then cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* echo "$ac_t""yes - must define" 1>&6; cat >> confdefs.h <<\EOF #define HAVE_ERRNO 1 --- 2089,2095 ---- extern int errno; static int x; x = errno; ; return 0; } EOF ! if { (eval echo configure:2093: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""yes - must define" 1>&6; cat >> confdefs.h <<\EOF #define HAVE_ERRNO 1 *************** *** 2030,2038 **** fi echo $ac_n "checking for locale""... $ac_c" 1>&6 ! echo "configure:2034: checking for locale" >&5 cat > conftest.$ac_ext < #include --- 2108,2116 ---- fi echo $ac_n "checking for locale""... $ac_c" 1>&6 ! echo "configure:2112: checking for locale" >&5 cat > conftest.$ac_ext < #include *************** *** 2040,2046 **** setlocale(LC_CTYPE,""); isprint(0); iscntrl(0); ; return 0; } EOF ! if { (eval echo configure:2044: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF #define HAVE_LOCALE 1 --- 2118,2124 ---- setlocale(LC_CTYPE,""); isprint(0); iscntrl(0); ; return 0; } EOF ! if { (eval echo configure:2122: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF #define HAVE_LOCALE 1 *************** *** 2054,2062 **** fi rm -f conftest* echo $ac_n "checking for ctype functions""... $ac_c" 1>&6 ! echo "configure:2058: checking for ctype functions" >&5 cat > conftest.$ac_ext <&6 ! echo "configure:2136: checking for ctype functions" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF #define HAVE_UPPER_LOWER 1 --- 2144,2150 ---- static int x; x = isupper(x); x = tolower(x); x = toupper(x); ; return 0; } EOF ! if { (eval echo configure:2148: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF #define HAVE_UPPER_LOWER 1 *************** *** 2082,2090 **** have_ospeed=no echo $ac_n "checking termcap for ospeed""... $ac_c" 1>&6 ! echo "configure:2086: checking termcap for ospeed" >&5 cat > conftest.$ac_ext < --- 2160,2168 ---- have_ospeed=no echo $ac_n "checking termcap for ospeed""... $ac_c" 1>&6 ! echo "configure:2164: checking termcap for ospeed" >&5 cat > conftest.$ac_ext < *************** *** 2098,2104 **** ospeed = 0; ; return 0; } EOF ! if { (eval echo configure:2102: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* echo "$ac_t""yes - in termcap.h" 1>&6; cat >> confdefs.h <<\EOF #define HAVE_OSPEED 1 --- 2176,2182 ---- ospeed = 0; ; return 0; } EOF ! if { (eval echo configure:2180: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""yes - in termcap.h" 1>&6; cat >> confdefs.h <<\EOF #define HAVE_OSPEED 1 *************** *** 2111,2124 **** rm -f conftest* if test $have_ospeed = no; then cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* echo "$ac_t""yes - must define" 1>&6; cat >> confdefs.h <<\EOF #define HAVE_OSPEED 1 --- 2189,2202 ---- rm -f conftest* if test $have_ospeed = no; then cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""yes - must define" 1>&6; cat >> confdefs.h <<\EOF #define HAVE_OSPEED 1 *************** *** 2139,2145 **** have_regex=no have_posix_regex=unknown echo $ac_n "checking for regcomp""... $ac_c" 1>&6 ! echo "configure:2143: checking for regcomp" >&5 WANT_REGEX=auto # Check whether --with-regex or --without-regex was given. --- 2217,2223 ---- have_regex=no have_posix_regex=unknown echo $ac_n "checking for regcomp""... $ac_c" 1>&6 ! echo "configure:2221: checking for regcomp" >&5 WANT_REGEX=auto # Check whether --with-regex or --without-regex was given. *************** *** 2155,2161 **** have_posix_regex=unknown else cat > conftest.$ac_ext < --- 2233,2239 ---- have_posix_regex=unknown else cat > conftest.$ac_ext < *************** *** 2170,2176 **** #endif exit(0); } EOF ! if { (eval echo configure:2174: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then have_posix_regex=yes else --- 2248,2254 ---- #endif exit(0); } EOF ! if { (eval echo configure:2252: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then have_posix_regex=yes else *************** *** 2191,2197 **** have_regex=yes elif test $have_posix_regex = unknown; then cat > conftest.$ac_ext < --- 2269,2275 ---- have_regex=yes elif test $have_posix_regex = unknown; then cat > conftest.$ac_ext < *************** *** 2200,2206 **** regex_t *r; regfree(r); ; return 0; } EOF ! if { (eval echo configure:2204: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* echo "$ac_t""using POSIX regcomp" 1>&6 cat >> confdefs.h <<\EOF --- 2278,2284 ---- regex_t *r; regfree(r); ; return 0; } EOF ! if { (eval echo configure:2282: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""using POSIX regcomp" 1>&6 cat >> confdefs.h <<\EOF *************** *** 2221,2227 **** if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = pcre; then echo $ac_n "checking for pcre_compile in -lpcre""... $ac_c" 1>&6 ! echo "configure:2225: checking for pcre_compile in -lpcre" >&5 ac_lib_var=`echo pcre'_'pcre_compile | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 --- 2299,2305 ---- if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = pcre; then echo $ac_n "checking for pcre_compile in -lpcre""... $ac_c" 1>&6 ! echo "configure:2303: checking for pcre_compile in -lpcre" >&5 ac_lib_var=`echo pcre'_'pcre_compile | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 *************** *** 2229,2235 **** ac_save_LIBS="$LIBS" LIBS="-lpcre $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else --- 2318,2324 ---- pcre_compile() ; return 0; } EOF ! if { (eval echo configure:2322: \"$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 *************** *** 2269,2280 **** if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = regcmp; then echo $ac_n "checking for regcmp""... $ac_c" 1>&6 ! echo "configure:2273: checking for regcmp" >&5 if eval "test \"`echo '$''{'ac_cv_func_regcmp'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 ! echo "configure:2351: checking for regcmp" >&5 if eval "test \"`echo '$''{'ac_cv_func_regcmp'+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; then rm -rf conftest* eval "ac_cv_func_regcmp=yes" else --- 2375,2381 ---- ; return 0; } EOF ! if { (eval echo configure:2379: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_regcmp=yes" else *************** *** 2325,2331 **** if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = regcomp; then cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* echo "$ac_t""using V8 regcomp" 1>&6; cat >> confdefs.h <<\EOF #define HAVE_V8_REGCOMP 1 --- 2411,2417 ---- regcomp(""); ; return 0; } EOF ! if { (eval echo configure:2415: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""using V8 regcomp" 1>&6; cat >> confdefs.h <<\EOF #define HAVE_V8_REGCOMP 1 *************** *** 2362,2373 **** if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = re_comp; then echo "$ac_t""using re_comp" 1>&6; echo $ac_n "checking for re_comp""... $ac_c" 1>&6 ! echo "configure:2366: checking for re_comp" >&5 if eval "test \"`echo '$''{'ac_cv_func_re_comp'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6; echo $ac_n "checking for re_comp""... $ac_c" 1>&6 ! echo "configure:2444: checking for re_comp" >&5 if eval "test \"`echo '$''{'ac_cv_func_re_comp'+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; then rm -rf conftest* eval "ac_cv_func_re_comp=yes" else --- 2468,2474 ---- ; return 0; } EOF ! if { (eval echo configure:2472: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_re_comp=yes" else *************** *** 2455,2461 **** # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. (set) 2>&1 | ! case `(ac_space=' '; set) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote substitution # turns \\\\ into \\, and sed turns \\ into \). --- 2533,2539 ---- # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. (set) 2>&1 | ! case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote substitution # turns \\\\ into \\, and sed turns \\ into \). *************** *** 2522,2528 **** echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; -version | --version | --versio | --versi | --vers | --ver | --ve | --v) ! echo "$CONFIG_STATUS generated by autoconf version 2.12" exit 0 ;; -help | --help | --hel | --he | --h) echo "\$ac_cs_usage"; exit 0 ;; --- 2600,2606 ---- echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; -version | --version | --versio | --versi | --vers | --ver | --ve | --v) ! echo "$CONFIG_STATUS generated by autoconf version 2.13" exit 0 ;; -help | --help | --hel | --he | --h) echo "\$ac_cs_usage"; exit 0 ;; *************** *** 2542,2550 **** --- 2620,2630 ---- s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF $ac_vpsub $extrasub + s%@SHELL@%$SHELL%g s%@CFLAGS@%$CFLAGS%g s%@CPPFLAGS@%$CPPFLAGS%g s%@CXXFLAGS@%$CXXFLAGS%g + s%@FFLAGS@%$FFLAGS%g s%@DEFS@%$DEFS%g s%@LDFLAGS@%$LDFLAGS%g s%@LIBS@%$LIBS%g *************** *** 2566,2571 **** --- 2646,2652 ---- s%@CC@%$CC%g s%@CPP@%$CPP%g s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g + s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g s%@INSTALL_DATA@%$INSTALL_DATA%g s%@REGEX_O@%$REGEX_O%g diff -c -r -N ../less-358.org/configure.in ./configure.in *** ../less-358.org/configure.in Sun Jul 9 09:26:43 2000 --- ./configure.in Tue Jan 23 01:08:29 2001 *************** *** 139,145 **** dnl Checks for functions and external variables. AC_TYPE_SIGNAL ! AC_CHECK_FUNCS(memcpy popen _setjmp sigprocmask sigsetmask stat strchr strstr system) dnl Some systems have termios.h but not the corresponding functions. AC_CHECK_FUNC(tcgetattr, AC_DEFINE(HAVE_TERMIOS_FUNCS)) --- 139,145 ---- dnl Checks for functions and external variables. AC_TYPE_SIGNAL ! AC_CHECK_FUNCS(memcpy popen _setjmp sigprocmask sigsetmask stat strchr strstr system snprintf) dnl Some systems have termios.h but not the corresponding functions. AC_CHECK_FUNC(tcgetattr, AC_DEFINE(HAVE_TERMIOS_FUNCS)) diff -c -r -N ../less-358.org/decode.c ./decode.c *** ../less-358.org/decode.c Sun Jul 9 09:24:15 2000 --- ./decode.c Tue Jan 23 01:09:51 2001 *************** *** 159,164 **** --- 159,166 ---- 'Q',0, A_QUIT, ':','q',0, A_QUIT, ':','Q',0, A_QUIT, + 'T',0, A_PREV_TAG, + 't',0, A_NEXT_TAG, 'Z','Z',0, A_QUIT }; diff -c -r -N ../less-358.org/defines.h ./defines.h *** ../less-358.org/defines.h Thu Jan 1 09:00:00 1970 --- ./defines.h Tue Jan 23 01:58:58 2001 *************** *** 0 **** --- 1,339 ---- + /* defines.h. Generated automatically by configure. */ + /* defines.h.in. Generated automatically from configure.in by autoheader. */ + /* Unix definition file for less. -*- C -*- + * + * This file has 3 sections: + * User preferences. + * Settings always true on Unix. + * Settings automatically determined by configure. + * + * * * * * * WARNING * * * * * * + * If you edit defines.h by hand, do "touch stamp-h" before you run make + * so config.status doesn't overwrite your changes. + */ + + /* User preferences. */ + + /* + * SECURE is 1 if you wish to disable a bunch of features in order to + * be safe to run by unprivileged users. + */ + #define SECURE 0 + + /* + * SHELL_ESCAPE is 1 if you wish to allow shell escapes. + * (This is possible only if your system supplies the system() function.) + */ + #define SHELL_ESCAPE (!SECURE) + + /* + * EXAMINE is 1 if you wish to allow examining files by name from within less. + */ + #define EXAMINE (!SECURE) + + /* + * TAB_COMPLETE_FILENAME is 1 if you wish to allow the TAB key + * to complete filenames at prompts. + */ + #define TAB_COMPLETE_FILENAME (!SECURE) + + /* + * CMD_HISTORY is 1 if you wish to allow keys to cycle through + * previous commands at prompts. + */ + #define CMD_HISTORY 1 + + /* + * HILITE_SEARCH is 1 if you wish to have search targets to be + * displayed in standout mode. + */ + #define HILITE_SEARCH 1 + + /* + * EDITOR is 1 if you wish to allow editor invocation (the "v" command). + * (This is possible only if your system supplies the system() function.) + * EDIT_PGM is the name of the (default) editor to be invoked. + */ + #define EDITOR (!SECURE) + + /* + * TAGS is 1 if you wish to support tag files. + */ + #define TAGS (!SECURE) + + /* + * USERFILE is 1 if you wish to allow a .less file to specify + * user-defined key bindings. + */ + #define USERFILE (!SECURE) + + /* + * GLOB is 1 if you wish to have shell metacharacters expanded in filenames. + * This will generally work if your system provides the "popen" function + * and the "echo" shell command. + */ + #define GLOB (!SECURE) + + /* + * PIPEC is 1 if you wish to have the "|" command + * which allows the user to pipe data into a shell command. + */ + #define PIPEC (!SECURE) + + /* + * LOGFILE is 1 if you wish to allow the -l option (to create log files). + */ + #define LOGFILE (!SECURE) + + /* + * GNU_OPTIONS is 1 if you wish to support the GNU-style command + * line options --help and --version. + */ + #define GNU_OPTIONS 1 + + /* + * ONLY_RETURN is 1 if you want RETURN to be the only input which + * will continue past an error message. + * Otherwise, any key will continue past an error message. + */ + #define ONLY_RETURN 0 + + /* + * LESSKEYFILE is the filename of the default lesskey output file + * (in the HOME directory). + * LESSKEYFILE_SYS is the filename of the system-wide lesskey output file. + * DEF_LESSKEYINFILE is the filename of the default lesskey input + * (in the HOME directory). + */ + #define LESSKEYFILE ".less" + #define LESSKEYFILE_SYS SYSDIR "/.sysless" + #define DEF_LESSKEYINFILE ".lesskey" + + + /* Settings always true on Unix. */ + + /* + * Define MSDOS_COMPILER if compiling under Microsoft C. + */ + #define MSDOS_COMPILER 0 + + /* + * Pathname separator character. + */ + #define PATHNAME_SEP "/" + + /* + * HAVE_SYS_TYPES_H is 1 if your system has . + */ + #define HAVE_SYS_TYPES_H 1 + + /* + * Define if you have the header file. + */ + /* #undef HAVE_SGSTAT_H */ + + /* + * HAVE_PERROR is 1 if your system has the perror() call. + * (Actually, if it has sys_errlist, sys_nerr and errno.) + */ + #define HAVE_PERROR 1 + + /* + * HAVE_TIME is 1 if your system has the time() call. + */ + #define HAVE_TIME 1 + + /* + * HAVE_SHELL is 1 if your system supports a SHELL command interpreter. + */ + #define HAVE_SHELL 1 + + /* + * Default shell metacharacters and meta-escape character. + */ + #define DEF_METACHARS "; \t\n'\"()<>|&^`\\" + #define DEF_METAESCAPE "\\" + + /* + * HAVE_DUP is 1 if your system has the dup() call. + */ + #define HAVE_DUP 1 + + /* + * Sizes of various buffers. + */ + #define CMDBUF_SIZE 512 /* Buffer for multichar commands */ + #define UNGOT_SIZE 100 /* Max chars to unget() */ + #define LINEBUF_SIZE 1024 /* Max size of line in input file */ + #define OUTBUF_SIZE 1024 /* Output buffer */ + #define PROMPT_SIZE 200 /* Max size of prompt string */ + #define TERMBUF_SIZE 2048 /* Termcap buffer for tgetent */ + #define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ + #define TAGLINE_SIZE 512 /* Max size of line in tags file */ + + /* Settings automatically determined by configure. */ + + /* Define to `long' if doesn't define. */ + /* #undef off_t */ + + /* Define if you need to in order for stat and other things to work. */ + /* #undef _POSIX_SOURCE */ + + /* Define as the return type of signal handlers (int or void). */ + #define RETSIGTYPE void + + /* Define if you have the ANSI C header files. */ + #define STDC_HEADERS 1 + + /* + * Regular expression library. + * Define exactly one of the following to be 1: + * HAVE_POSIX_REGCOMP: POSIX regcomp() and regex.h + * HAVE_PCRE: PCRE (Perl-compatible regular expression) library + * HAVE_RE_COMP: BSD re_comp() + * HAVE_REGCMP: System V regcmp() + * HAVE_V8_REGCOMP: Henry Spencer V8 regcomp() and regexp.h + * NO_REGEX: pattern matching is supported, but without metacharacters. + */ + #define HAVE_POSIX_REGCOMP 1 + /* #undef HAVE_PCRE */ + /* #undef HAVE_RE_COMP */ + /* #undef HAVE_REGCMP */ + /* #undef HAVE_V8_REGCOMP */ + /* #undef NO_REGEX */ + /* #undef HAVE_REGEXEC2 */ + + /* Define HAVE_VOID if your compiler supports the "void" type. */ + #define HAVE_VOID 1 + + /* Define HAVE_CONST if your compiler supports the "const" modifier. */ + #define HAVE_CONST 1 + + /* Define HAVE_TIME_T if your system supports the "time_t" type. */ + #define HAVE_TIME_T 1 + + /* Define HAVE_STRERROR if you have the strerror() function. */ + #define HAVE_STRERROR 1 + + /* Define HAVE_FILENO if you have the fileno() macro. */ + #define HAVE_FILENO 1 + + /* Define HAVE_ERRNO if you have the errno variable */ + /* Define MUST_DEFINE_ERRNO if you have errno but it is not define + * in errno.h */ + #define HAVE_ERRNO 1 + /* #undef MUST_DEFINE_ERRNO */ + + /* Define HAVE_SYS_ERRLIST if you have the sys_errlist[] variable */ + #define HAVE_SYS_ERRLIST 1 + + /* Define HAVE_OSPEED if your termcap library has the ospeed variable */ + /* Define MUST_DEFINE_OSPEED if you have ospeed but it is not defined + * in termcap.h. */ + #define HAVE_OSPEED 1 + /* #undef MUST_DEFINE_OSPEED */ + + /* Define HAVE_LOCALE if you have locale.h and setlocale. */ + #define HAVE_LOCALE 1 + + /* Define HAVE_TERMIOS_FUNCS if you have tcgetattr/tcsetattr */ + #define HAVE_TERMIOS_FUNCS 1 + + /* Define HAVE_UPPER_LOWER if you have isupper, islower, toupper, tolower */ + #define HAVE_UPPER_LOWER 1 + + /* Define HAVE_SIGSET_T you have the sigset_t type */ + #define HAVE_SIGSET_T 1 + + /* Define HAVE_SIGEMPTYSET if you have the sigemptyset macro */ + #define HAVE_SIGEMPTYSET 1 + + /* Define EDIT_PGM to your editor. */ + #define EDIT_PGM "vi" + + /* Define if you have the _setjmp function. */ + #define HAVE__SETJMP 1 + + /* Define if you have the memcpy function. */ + #define HAVE_MEMCPY 1 + + /* Define if you have the popen function. */ + #define HAVE_POPEN 1 + + /* Define if you have the sigprocmask function. */ + #define HAVE_SIGPROCMASK 1 + + /* Define if you have the sigsetmask function. */ + #define HAVE_SIGSETMASK 1 + + /* Define if you have the snprintf function. */ + #define HAVE_SNPRINTF 1 + + /* Define if you have the stat function. */ + #define HAVE_STAT 1 + + /* Define if you have the strchr function. */ + #define HAVE_STRCHR 1 + + /* Define if you have the strstr function. */ + #define HAVE_STRSTR 1 + + /* Define if you have the system function. */ + #define HAVE_SYSTEM 1 + + /* Define if you have the header file. */ + #define HAVE_CTYPE_H 1 + + /* Define if you have the header file. */ + #define HAVE_ERRNO_H 1 + + /* Define if you have the header file. */ + #define HAVE_FCNTL_H 1 + + /* Define if you have the header file. */ + #define HAVE_LIMITS_H 1 + + /* Define if you have the header file. */ + #define HAVE_STDIO_H 1 + + /* Define if you have the header file. */ + #define HAVE_STDLIB_H 1 + + /* Define if you have the header file. */ + #define HAVE_STRING_H 1 + + /* Define if you have the header file. */ + #define HAVE_SYS_IOCTL_H 1 + + /* Define if you have the header file. */ + /* #undef HAVE_SYS_PTEM_H */ + + /* Define if you have the header file. */ + /* #undef HAVE_SYS_STREAM_H */ + + /* Define if you have the header file. */ + #define HAVE_TERMCAP_H 1 + + /* Define if you have the header file. */ + /* #undef HAVE_TERMIO_H */ + + /* Define if you have the header file. */ + #define HAVE_TERMIOS_H 1 + + /* Define if you have the header file. */ + #define HAVE_TIME_H 1 + + /* Define if you have the header file. */ + #define HAVE_UNISTD_H 1 + + /* Define if you have the header file. */ + /* #undef HAVE_VALUES_H */ + + /* Define if you have the PW library (-lPW). */ + /* #undef HAVE_LIBPW */ + + /* Define if you have the gen library (-lgen). */ + /* #undef HAVE_LIBGEN */ + + /* Define if you have the intl library (-lintl). */ + /* #undef HAVE_LIBINTL */ diff -c -r -N ../less-358.org/defines.h.in ./defines.h.in *** ../less-358.org/defines.h.in Fri Jul 7 02:09:46 2000 --- ./defines.h.in Tue Jan 23 01:10:24 2001 *************** *** 265,270 **** --- 265,273 ---- /* Define if you have the sigsetmask function. */ #undef HAVE_SIGSETMASK + /* Define if you have the snprintf function. */ + #undef HAVE_SNPRINTF + /* Define if you have the stat function. */ #undef HAVE_STAT diff -c -r -N ../less-358.org/funcs.h ./funcs.h *** ../less-358.org/funcs.h Sun Jul 9 09:28:04 2000 --- ./funcs.h Tue Jan 23 01:48:06 2001 *************** *** 231,239 **** --- 231,246 ---- public RETSIGTYPE winch (); public void init_signals (); public void psignals (); + public void cleantags(); + public int ntags(); + public int curr_tag(); public void findtag (); public int edit_tagfile (); + public int edit_tagfile (); public POSITION tagsearch (); + public char *nexttag (); + public char *prevtag (); + public int edit_tagfile (); public void open_getchr (); public void close_getchr (); public int getchr (); diff -c -r -N ../less-358.org/main.c ./main.c *** ../less-358.org/main.c Sun Jul 9 09:26:46 2000 --- ./main.c Tue Jan 23 01:12:44 2001 *************** *** 42,47 **** --- 42,48 ---- #endif #if TAGS + extern char * tags; extern char * tagoption; extern int jump_sline; #endif *************** *** 209,215 **** * Select the first file to examine. */ #if TAGS ! if (tagoption != NULL) { /* * A -t option was given. --- 210,216 ---- * Select the first file to examine. */ #if TAGS ! if (tagoption != NULL || !strcmp(tags, "-")) { /* * A -t option was given. diff -c -r -N ../less-358.org/prompt.c ./prompt.c *** ../less-358.org/prompt.c Sun Jul 9 09:26:47 2000 --- ./prompt.c Tue Jan 23 02:01:37 2001 *************** *** 41,53 **** * These strings are expanded by pr_expand(). */ static constant char s_proto[] = ! "?n?f%f .?m(file %i of %m) ..?e(END) ?x- Next\\: %x..%t"; static constant char m_proto[] = ! "?n?f%f .?m(file %i of %m) ..?e(END) ?x- Next\\: %x.:?pB%pB\\%:byte %bB?s/%s...%t"; static constant char M_proto[] = ! "?f%f .?n?m(file %i of %m) ..?ltlines %lt-%lb?L/%L. :byte %bB?s/%s. .?e(END) ?x- Next\\: %x.:?pB%pB\\%..%t"; static constant char e_proto[] = ! "?f%f .?m(file %i of %m) .?ltlines %lt-%lb?L/%L. .byte %bB?s/%s. ?e(END) :?pB%pB\\%..%t"; static constant char h_proto[] = "HELP -- ?eEND -- Press g to see it again:Press RETURN for more., or q when done"; --- 41,53 ---- * These strings are expanded by pr_expand(). */ static constant char s_proto[] = ! "?n?f%f .?m(%T %i of %m) ..?e(END) ?x- Next\\: %x..%t"; static constant char m_proto[] = ! "?n?f%f .?m(%T %i of %m) ..?e(END) ?x- Next\\: %x.:?pB%pB\\%:byte %bB?s/%s...%t"; static constant char M_proto[] = ! "?f%f .?n?m(%T %i of %m) ..?ltline %lt?L/%L. :byte %bB?s/%s. .?e(END) ?x- Next\\: %x.:?pB%pB\\%..%t"; static constant char e_proto[] = ! "?f%f .?m(%T %i of %m) .?ltline %lt?L/%L. .byte %bB?s/%s. ?e(END) :?pB%pB\\%..%t"; static constant char h_proto[] = "HELP -- ?eEND -- Press g to see it again:Press RETURN for more., or q when done"; *************** *** 186,193 **** case 'D': /* Same as L */ return (linenums && ch_length() != NULL_POSITION); case 'm': /* More than one file? */ ! return (nifile() > 1); case 'n': /* First prompt in a new file? */ return (new_file); case 'p': /* Percent into file (bytes) known? */ return (curr_byte(where) != NULL_POSITION && --- 186,196 ---- case 'D': /* Same as L */ return (linenums && ch_length() != NULL_POSITION); case 'm': /* More than one file? */ ! return (ntags() ? ntags() > 1 : nifile() > 1); case 'n': /* First prompt in a new file? */ + /* But while tag loaded every time true. */ + if (ntags()) + return 1; return (new_file); case 'p': /* Percent into file (bytes) known? */ return (curr_byte(where) != NULL_POSITION && *************** *** 200,206 **** case 'B': return (ch_length() != NULL_POSITION); case 'x': /* Is there a "next" file? */ ! return (next_ifile(curr_ifile) != NULL_IFILE); } return (0); } --- 203,212 ---- case 'B': return (ch_length() != NULL_POSITION); case 'x': /* Is there a "next" file? */ ! if (ntags()) ! return 0; ! else ! return (next_ifile(curr_ifile) != NULL_IFILE); } return (0); } *************** *** 271,278 **** ap_str(s); free(s); break; ! case 'i': /* Index into list of files */ ! ap_int(get_index(curr_ifile)); break; case 'l': /* Current line number */ n = currline(where); --- 277,287 ---- ap_str(s); free(s); break; ! case 'i': /* Index into list of object */ ! if (ntags()) ! ap_int(curr_tag()); ! else ! ap_int(get_index(curr_ifile)); break; case 'l': /* Current line number */ n = currline(where); *************** *** 289,296 **** else ap_int(n-1); break; ! case 'm': /* Number of files */ ! ap_int(nifile()); break; case 'p': /* Percent into file (bytes) */ pos = curr_byte(where); --- 298,309 ---- else ap_int(n-1); break; ! case 'm': /* Number of objects */ ! n = ntags(); ! if (n) ! ap_int(n); ! else ! ap_int(nifile()); break; case 'p': /* Percent into file (bytes) */ pos = curr_byte(where); *************** *** 320,325 **** --- 333,344 ---- case 't': /* Truncate trailing spaces in the message */ while (mp > message && mp[-1] == ' ') mp--; + break; + case 'T': /* Type of multiple list */ + if (ntags()) + ap_str("tag"); + else + ap_str("file"); break; case 'x': /* Name of next file */ h = next_ifile(curr_ifile); diff -c -r -N ../less-358.org/queue.h ./queue.h *** ../less-358.org/queue.h Thu Jan 1 09:00:00 1970 --- ./queue.h Tue Jan 23 01:41:17 2001 *************** *** 0 **** --- 1,528 ---- + /* + * Copyright (c) 1991, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)queue.h 8.5 (Berkeley) 8/20/94 + * $FreeBSD: src/sys/sys/queue.h,v 1.24.2.2 1999/12/17 01:34:30 jkh Exp $ + */ + + #ifndef _SYS_QUEUE_H_ + #define _SYS_QUEUE_H_ + + /* + * This file defines five types of data structures: singly-linked lists, + * slingly-linked tail queues, lists, tail queues, and circular queues. + * + * A singly-linked list is headed by a single forward pointer. The elements + * are singly linked for minimum space and pointer manipulation overhead at + * the expense of O(n) removal for arbitrary elements. New elements can be + * added to the list after an existing element or at the head of the list. + * Elements being removed from the head of the list should use the explicit + * macro for this purpose for optimum efficiency. A singly-linked list may + * only be traversed in the forward direction. Singly-linked lists are ideal + * for applications with large datasets and few or no removals or for + * implementing a LIFO queue. + * + * A singly-linked tail queue is headed by a pair of pointers, one to the + * head of the list and the other to the tail of the list. The elements are + * singly linked for minimum space and pointer manipulation overhead at the + * expense of O(n) removal for arbitrary elements. New elements can be added + * to the list after an existing element, at the head of the list, or at the + * end of the list. Elements being removed from the head of the tail queue + * should use the explicit macro for this purpose for optimum efficiency. + * A singly-linked tail queue may only be traversed in the forward direction. + * Singly-linked tail queues are ideal for applications with large datasets + * and few or no removals or for implementing a FIFO queue. + * + * A list is headed by a single forward pointer (or an array of forward + * pointers for a hash table header). The elements are doubly linked + * so that an arbitrary element can be removed without a need to + * traverse the list. New elements can be added to the list before + * or after an existing element or at the head of the list. A list + * may only be traversed in the forward direction. + * + * A tail queue is headed by a pair of pointers, one to the head of the + * list and the other to the tail of the list. The elements are doubly + * linked so that an arbitrary element can be removed without a need to + * traverse the list. New elements can be added to the list before or + * after an existing element, at the head of the list, or at the end of + * the list. A tail queue may only be traversed in the forward direction. + * + * A circle queue is headed by a pair of pointers, one to the head of the + * list and the other to the tail of the list. The elements are doubly + * linked so that an arbitrary element can be removed without a need to + * traverse the list. New elements can be added to the list before or after + * an existing element, at the head of the list, or at the end of the list. + * A circle queue may be traversed in either direction, but has a more + * complex end of list detection. + * + * For details on the use of these macros, see the queue(3) manual page. + * + * + * SLIST LIST STAILQ TAILQ CIRCLEQ + * _HEAD + + + + + + * _ENTRY + + + + + + * _INIT + + + + + + * _EMPTY + + + + + + * _FIRST + + + + + + * _NEXT + + + + + + * _PREV - - - + + + * _LAST - - + + + + * _FOREACH + + + + + + * _INSERT_HEAD + + + + + + * _INSERT_BEFORE - + - + + + * _INSERT_AFTER + + + + + + * _INSERT_TAIL - - + + + + * _REMOVE_HEAD + - + - - + * _REMOVE + + + + + + * + */ + + /* + * Singly-linked List definitions. + */ + #define SLIST_HEAD(name, type) \ + struct name { \ + struct type *slh_first; /* first element */ \ + } + + #define SLIST_HEAD_INITIALIZER(head) \ + { NULL } + + #define SLIST_ENTRY(type) \ + struct { \ + struct type *sle_next; /* next element */ \ + } + + /* + * Singly-linked List functions. + */ + #define SLIST_EMPTY(head) ((head)->slh_first == NULL) + + #define SLIST_FIRST(head) ((head)->slh_first) + + #define SLIST_FOREACH(var, head, field) \ + for((var) = (head)->slh_first; (var); (var) = (var)->field.sle_next) + + #define SLIST_INIT(head) { \ + (head)->slh_first = NULL; \ + } + + #define SLIST_INSERT_AFTER(slistelm, elm, field) do { \ + (elm)->field.sle_next = (slistelm)->field.sle_next; \ + (slistelm)->field.sle_next = (elm); \ + } while (0) + + #define SLIST_INSERT_HEAD(head, elm, field) do { \ + (elm)->field.sle_next = (head)->slh_first; \ + (head)->slh_first = (elm); \ + } while (0) + + #define SLIST_NEXT(elm, field) ((elm)->field.sle_next) + + #define SLIST_REMOVE_HEAD(head, field) do { \ + (head)->slh_first = (head)->slh_first->field.sle_next; \ + } while (0) + + #define SLIST_REMOVE(head, elm, type, field) do { \ + if ((head)->slh_first == (elm)) { \ + SLIST_REMOVE_HEAD((head), field); \ + } \ + else { \ + struct type *curelm = (head)->slh_first; \ + while( curelm->field.sle_next != (elm) ) \ + curelm = curelm->field.sle_next; \ + curelm->field.sle_next = \ + curelm->field.sle_next->field.sle_next; \ + } \ + } while (0) + + /* + * Singly-linked Tail queue definitions. + */ + #define STAILQ_HEAD(name, type) \ + struct name { \ + struct type *stqh_first;/* first element */ \ + struct type **stqh_last;/* addr of last next element */ \ + } + + #define STAILQ_HEAD_INITIALIZER(head) \ + { NULL, &(head).stqh_first } + + #define STAILQ_ENTRY(type) \ + struct { \ + struct type *stqe_next; /* next element */ \ + } + + /* + * Singly-linked Tail queue functions. + */ + #define STAILQ_EMPTY(head) ((head)->stqh_first == NULL) + + #define STAILQ_INIT(head) do { \ + (head)->stqh_first = NULL; \ + (head)->stqh_last = &(head)->stqh_first; \ + } while (0) + + #define STAILQ_FIRST(head) ((head)->stqh_first) + #define STAILQ_LAST(head) (*(head)->stqh_last) + + #define STAILQ_FOREACH(var, head, field) \ + for((var) = (head)->stqh_first; (var); (var) = (var)->field.stqe_next) + + #define STAILQ_INSERT_HEAD(head, elm, field) do { \ + if (((elm)->field.stqe_next = (head)->stqh_first) == NULL) \ + (head)->stqh_last = &(elm)->field.stqe_next; \ + (head)->stqh_first = (elm); \ + } while (0) + + #define STAILQ_INSERT_TAIL(head, elm, field) do { \ + (elm)->field.stqe_next = NULL; \ + *(head)->stqh_last = (elm); \ + (head)->stqh_last = &(elm)->field.stqe_next; \ + } while (0) + + #define STAILQ_INSERT_AFTER(head, tqelm, elm, field) do { \ + if (((elm)->field.stqe_next = (tqelm)->field.stqe_next) == NULL)\ + (head)->stqh_last = &(elm)->field.stqe_next; \ + (tqelm)->field.stqe_next = (elm); \ + } while (0) + + #define STAILQ_NEXT(elm, field) ((elm)->field.stqe_next) + + #define STAILQ_REMOVE_HEAD(head, field) do { \ + if (((head)->stqh_first = \ + (head)->stqh_first->field.stqe_next) == NULL) \ + (head)->stqh_last = &(head)->stqh_first; \ + } while (0) + + #define STAILQ_REMOVE_HEAD_UNTIL(head, elm, field) do { \ + if (((head)->stqh_first = (elm)->field.stqe_next) == NULL) \ + (head)->stqh_last = &(head)->stqh_first; \ + } while (0) + + #define STAILQ_REMOVE(head, elm, type, field) do { \ + if ((head)->stqh_first == (elm)) { \ + STAILQ_REMOVE_HEAD(head, field); \ + } \ + else { \ + struct type *curelm = (head)->stqh_first; \ + while( curelm->field.stqe_next != (elm) ) \ + curelm = curelm->field.stqe_next; \ + if((curelm->field.stqe_next = \ + curelm->field.stqe_next->field.stqe_next) == NULL) \ + (head)->stqh_last = &(curelm)->field.stqe_next; \ + } \ + } while (0) + + /* + * List definitions. + */ + #define LIST_HEAD(name, type) \ + struct name { \ + struct type *lh_first; /* first element */ \ + } + + #define LIST_HEAD_INITIALIZER(head) \ + { NULL } + + #define LIST_ENTRY(type) \ + struct { \ + struct type *le_next; /* next element */ \ + struct type **le_prev; /* address of previous next element */ \ + } + + /* + * List functions. + */ + + #define LIST_EMPTY(head) ((head)->lh_first == NULL) + + #define LIST_FIRST(head) ((head)->lh_first) + + #define LIST_FOREACH(var, head, field) \ + for((var) = (head)->lh_first; (var); (var) = (var)->field.le_next) + + #define LIST_INIT(head) do { \ + (head)->lh_first = NULL; \ + } while (0) + + #define LIST_INSERT_AFTER(listelm, elm, field) do { \ + if (((elm)->field.le_next = (listelm)->field.le_next) != NULL) \ + (listelm)->field.le_next->field.le_prev = \ + &(elm)->field.le_next; \ + (listelm)->field.le_next = (elm); \ + (elm)->field.le_prev = &(listelm)->field.le_next; \ + } while (0) + + #define LIST_INSERT_BEFORE(listelm, elm, field) do { \ + (elm)->field.le_prev = (listelm)->field.le_prev; \ + (elm)->field.le_next = (listelm); \ + *(listelm)->field.le_prev = (elm); \ + (listelm)->field.le_prev = &(elm)->field.le_next; \ + } while (0) + + #define LIST_INSERT_HEAD(head, elm, field) do { \ + if (((elm)->field.le_next = (head)->lh_first) != NULL) \ + (head)->lh_first->field.le_prev = &(elm)->field.le_next;\ + (head)->lh_first = (elm); \ + (elm)->field.le_prev = &(head)->lh_first; \ + } while (0) + + #define LIST_NEXT(elm, field) ((elm)->field.le_next) + + #define LIST_REMOVE(elm, field) do { \ + if ((elm)->field.le_next != NULL) \ + (elm)->field.le_next->field.le_prev = \ + (elm)->field.le_prev; \ + *(elm)->field.le_prev = (elm)->field.le_next; \ + } while (0) + + /* + * Tail queue definitions. + */ + #define TAILQ_HEAD(name, type) \ + struct name { \ + struct type *tqh_first; /* first element */ \ + struct type **tqh_last; /* addr of last next element */ \ + } + + #define TAILQ_HEAD_INITIALIZER(head) \ + { NULL, &(head).tqh_first } + + #define TAILQ_ENTRY(type) \ + struct { \ + struct type *tqe_next; /* next element */ \ + struct type **tqe_prev; /* address of previous next element */ \ + } + + /* + * Tail queue functions. + */ + #define TAILQ_EMPTY(head) ((head)->tqh_first == NULL) + + #define TAILQ_FOREACH(var, head, field) \ + for (var = TAILQ_FIRST(head); var; var = TAILQ_NEXT(var, field)) + + #define TAILQ_FIRST(head) ((head)->tqh_first) + + #define TAILQ_LAST(head, headname) \ + (*(((struct headname *)((head)->tqh_last))->tqh_last)) + + #define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next) + + #define TAILQ_PREV(elm, headname, field) \ + (*(((struct headname *)((elm)->field.tqe_prev))->tqh_last)) + + #define TAILQ_INIT(head) do { \ + (head)->tqh_first = NULL; \ + (head)->tqh_last = &(head)->tqh_first; \ + } while (0) + + #define TAILQ_INSERT_HEAD(head, elm, field) do { \ + if (((elm)->field.tqe_next = (head)->tqh_first) != NULL) \ + (head)->tqh_first->field.tqe_prev = \ + &(elm)->field.tqe_next; \ + else \ + (head)->tqh_last = &(elm)->field.tqe_next; \ + (head)->tqh_first = (elm); \ + (elm)->field.tqe_prev = &(head)->tqh_first; \ + } while (0) + + #define TAILQ_INSERT_TAIL(head, elm, field) do { \ + (elm)->field.tqe_next = NULL; \ + (elm)->field.tqe_prev = (head)->tqh_last; \ + *(head)->tqh_last = (elm); \ + (head)->tqh_last = &(elm)->field.tqe_next; \ + } while (0) + + #define TAILQ_INSERT_AFTER(head, listelm, elm, field) do { \ + if (((elm)->field.tqe_next = (listelm)->field.tqe_next) != NULL)\ + (elm)->field.tqe_next->field.tqe_prev = \ + &(elm)->field.tqe_next; \ + else \ + (head)->tqh_last = &(elm)->field.tqe_next; \ + (listelm)->field.tqe_next = (elm); \ + (elm)->field.tqe_prev = &(listelm)->field.tqe_next; \ + } while (0) + + #define TAILQ_INSERT_BEFORE(listelm, elm, field) do { \ + (elm)->field.tqe_prev = (listelm)->field.tqe_prev; \ + (elm)->field.tqe_next = (listelm); \ + *(listelm)->field.tqe_prev = (elm); \ + (listelm)->field.tqe_prev = &(elm)->field.tqe_next; \ + } while (0) + + #define TAILQ_REMOVE(head, elm, field) do { \ + if (((elm)->field.tqe_next) != NULL) \ + (elm)->field.tqe_next->field.tqe_prev = \ + (elm)->field.tqe_prev; \ + else \ + (head)->tqh_last = (elm)->field.tqe_prev; \ + *(elm)->field.tqe_prev = (elm)->field.tqe_next; \ + } while (0) + + /* + * Circular queue definitions. + */ + #define CIRCLEQ_HEAD(name, type) \ + struct name { \ + struct type *cqh_first; /* first element */ \ + struct type *cqh_last; /* last element */ \ + } + + #define CIRCLEQ_ENTRY(type) \ + struct { \ + struct type *cqe_next; /* next element */ \ + struct type *cqe_prev; /* previous element */ \ + } + + /* + * Circular queue functions. + */ + #define CIRCLEQ_EMPTY(head) ((head)->cqh_first == (void *)(head)) + + #define CIRCLEQ_FIRST(head) ((head)->cqh_first) + + #define CIRCLEQ_FOREACH(var, head, field) \ + for((var) = (head)->cqh_first; \ + (var) != (void *)(head); \ + (var) = (var)->field.cqe_next) + + #define CIRCLEQ_INIT(head) do { \ + (head)->cqh_first = (void *)(head); \ + (head)->cqh_last = (void *)(head); \ + } while (0) + + #define CIRCLEQ_INSERT_AFTER(head, listelm, elm, field) do { \ + (elm)->field.cqe_next = (listelm)->field.cqe_next; \ + (elm)->field.cqe_prev = (listelm); \ + if ((listelm)->field.cqe_next == (void *)(head)) \ + (head)->cqh_last = (elm); \ + else \ + (listelm)->field.cqe_next->field.cqe_prev = (elm); \ + (listelm)->field.cqe_next = (elm); \ + } while (0) + + #define CIRCLEQ_INSERT_BEFORE(head, listelm, elm, field) do { \ + (elm)->field.cqe_next = (listelm); \ + (elm)->field.cqe_prev = (listelm)->field.cqe_prev; \ + if ((listelm)->field.cqe_prev == (void *)(head)) \ + (head)->cqh_first = (elm); \ + else \ + (listelm)->field.cqe_prev->field.cqe_next = (elm); \ + (listelm)->field.cqe_prev = (elm); \ + } while (0) + + #define CIRCLEQ_INSERT_HEAD(head, elm, field) do { \ + (elm)->field.cqe_next = (head)->cqh_first; \ + (elm)->field.cqe_prev = (void *)(head); \ + if ((head)->cqh_last == (void *)(head)) \ + (head)->cqh_last = (elm); \ + else \ + (head)->cqh_first->field.cqe_prev = (elm); \ + (head)->cqh_first = (elm); \ + } while (0) + + #define CIRCLEQ_INSERT_TAIL(head, elm, field) do { \ + (elm)->field.cqe_next = (void *)(head); \ + (elm)->field.cqe_prev = (head)->cqh_last; \ + if ((head)->cqh_first == (void *)(head)) \ + (head)->cqh_first = (elm); \ + else \ + (head)->cqh_last->field.cqe_next = (elm); \ + (head)->cqh_last = (elm); \ + } while (0) + + #define CIRCLEQ_LAST(head) ((head)->cqh_last) + + #define CIRCLEQ_NEXT(elm,field) ((elm)->field.cqe_next) + + #define CIRCLEQ_PREV(elm,field) ((elm)->field.cqe_prev) + + #define CIRCLEQ_REMOVE(head, elm, field) do { \ + if ((elm)->field.cqe_next == (void *)(head)) \ + (head)->cqh_last = (elm)->field.cqe_prev; \ + else \ + (elm)->field.cqe_next->field.cqe_prev = \ + (elm)->field.cqe_prev; \ + if ((elm)->field.cqe_prev == (void *)(head)) \ + (head)->cqh_first = (elm)->field.cqe_next; \ + else \ + (elm)->field.cqe_prev->field.cqe_next = \ + (elm)->field.cqe_next; \ + } while (0) + + #ifdef KERNEL + + /* + * XXX insque() and remque() are an old way of handling certain queues. + * They bogusly assumes that all queue heads look alike. + */ + + struct quehead { + struct quehead *qh_link; + struct quehead *qh_rlink; + }; + + #ifdef __GNUC__ + + static __inline void + insque(void *a, void *b) + { + struct quehead *element = a, *head = b; + + element->qh_link = head->qh_link; + element->qh_rlink = head; + head->qh_link = element; + element->qh_link->qh_rlink = element; + } + + static __inline void + remque(void *a) + { + struct quehead *element = a; + + element->qh_link->qh_rlink = element->qh_rlink; + element->qh_rlink->qh_link = element->qh_link; + element->qh_rlink = 0; + } + + #else /* !__GNUC__ */ + + void insque __P((void *a, void *b)); + void remque __P((void *a)); + + #endif /* __GNUC__ */ + + #endif /* KERNEL */ + + #endif /* !_SYS_QUEUE_H_ */ diff -c -r -N ../less-358.org/tags.c ./tags.c *** ../less-358.org/tags.c Sun Jul 9 09:26:47 2000 --- ./tags.c Tue Jan 23 02:04:53 2001 *************** *** 15,48 **** #if TAGS ! public char *tags = "tags"; ! static char *tagfile; ! static char *tagpattern; ! static int taglinenum; ! static int tagendline; extern int linenums; extern int sigs; extern int jump_sline; /* ! * Find a tag in the "tags" file. ! * Sets "tagfile" to the name of the file containing the tag, ! * and "tagpattern" to the search pattern which should be used ! * to find the tag. */ public void findtag(tag) register char *tag; { char *p; char *q; register FILE *f; register int taglen; int search_char; int err; char tline[TAGLINE_SIZE]; p = unquote_file(tags); f = fopen(p, "r"); --- 15,267 ---- #if TAGS ! #include "queue.h" ! char *tags = "tags"; ! ! static int total; ! static int curseq; extern int linenums; extern int sigs; extern int jump_sline; /* ! * tag type ! */ ! enum { ! T_CTAGS, /* 'tags': standard and extended format (ctags) */ ! T_CTAGS_X, /* stdin: cross reference format (ctags) */ ! T_GTAGS, /* 'GTAGS': function defenition (global) */ ! T_GRTAGS, /* 'GRTAGS': function reference (global) */ ! T_GSYMS, /* 'GSYMS': other symbols (global) */ ! T_GPATH /* 'GPATH': path name (global) */ ! }; ! ! static void findctag(), findgtag(); ! static char *nextgtag(), *prevgtag(); ! static POSITION ctagsearch(), gtagsearch(); ! static int getentry(); ! ! /* ! * The queue of tags generated by the last findgtag() call. ! * ! * Use either pattern or line. ! * findgtag() use line, so pattern is always NULL. ! * findctag() useally use pattern, then line is 0 but sometimes use ! * line (old style tags format) instead of pattern. In such case, ! * pattern is NULL. ! */ ! static CIRCLEQ_HEAD(tag_q, tag) tag_q; ! struct tag { ! CIRCLEQ_ENTRY(tag) ptrs; ! char *tagfile; /* source file containing the tag */ ! int taglinenum; /* appropriate line number of source file */ ! char *tagpattern; /* pattern which should be used to find the tag */ ! char tagendline; /* 1: the pattern include '$' */ ! }; ! static struct tag *curtag; ! /* ! * Cleanup loading tag structure. ! */ ! public void ! cleantags() ! { ! struct tag *tag_p, *tag_save_p; ! ! /* Clear any existing tag circle queue */ ! /* XXX Ideally, we wouldn't do this until after we know that we ! * can load some other tag information. */ ! curtag = NULL; ! tag_p = CIRCLEQ_FIRST(&tag_q); ! if (tag_p) { ! while (tag_p != (void *)&tag_q) { ! tag_save_p = CIRCLEQ_NEXT(tag_p, ptrs); ! free(tag_p); ! tag_p = tag_save_p; ! } ! } ! CIRCLEQ_INIT(&tag_q); ! total = curseq = 0; ! } ! /* ! * Make new tag entry. ! * ! * return 0 when result is OK, -1 when memory allocation error. ! */ ! static struct tag * ! maketagent(name, file, line, pattern, end) ! char *name; ! char *file; ! int line; ! char *pattern; ! int end; ! { ! struct tag *tag_p; ! ! tag_p = calloc(sizeof(struct tag), 1); ! if (!tag_p) ! goto err; ! tag_p->tagfile = malloc(strlen(file) + 1); ! if (!tag_p->tagfile) ! goto err; ! strcpy(tag_p->tagfile, file); ! if (pattern) { ! tag_p->tagpattern = malloc(strlen(pattern) + 1); ! if (!tag_p->tagpattern) ! goto err; ! strcpy(tag_p->tagpattern, pattern); ! tag_p->tagendline = end; ! } else { ! tag_p->taglinenum = line; ! } ! return tag_p; ! err: ! if (tag_p) { ! /* These pointers are cleaned by default. */ ! if (tag_p->tagfile) ! free(tag_p->tagfile); ! if (tag_p->tagpattern) ! free(tag_p->tagpattern); ! free(tag_p); ! } ! return NULL; ! } ! ! /* ! * Get tag mode. ! * ! * Tag file name tell us the mode. ! */ ! #include ! public int ! gettagtype() ! { ! int type; ! struct stat sb; ! ! if (!strcmp(tags, "GTAGS")) ! type = T_GTAGS; ! else if (!strcmp(tags, "GRTAGS")) ! type = T_GRTAGS; ! else if (!strcmp(tags, "GSYMS")) ! type = T_GSYMS; ! else if (!strcmp(tags, "GPATH")) ! type = T_GPATH; ! else if (!strcmp(tags, "-")) ! type = T_CTAGS_X; ! else if (stat(tags, &sb) == 0) ! type = T_CTAGS; ! else ! type = T_GTAGS; ! return type; ! } ! /* ! * Find tags in tag file. */ public void findtag(tag) register char *tag; { + int type = gettagtype(); + switch (type) { + case T_CTAGS: + findctag(tag); + break; + case T_GTAGS: + case T_GRTAGS: + case T_GSYMS: + case T_GPATH: + case T_CTAGS_X: + findgtag(tag, type); + break; + } + } + + /* + * Search for a tag. + */ + public POSITION + tagsearch() + { + if (!curtag) + return (NULL_POSITION); /* No gtags loaded! */ + if (curtag->taglinenum) + return gtagsearch(); + else + return ctagsearch(); + } + /* + * Go to the next tag. + * + * return file name which should be read. + */ + public char * + nexttag(number) + int number; + { + char *tagfile; + + while (number--) tagfile = nextgtag(); + return tagfile; + } + /* + * Go to the previous tag. + * + * return file name which should be read. + */ + public char * + prevtag(number) + int number; + { + char *tagfile; + + while (number--) tagfile = prevgtag(); + return tagfile; + } + + /* + * return the total number of tag. + */ + public int + ntags() + { + return total; + } + /* + * return the sequence number of current tag. + */ + public int + curr_tag() + { + return curseq; + } + /******************************************************************************* + * + * ctags + * + */ + + /* + * Find tags in the "tags" file. + * Sets curtag to the first tag entry. + */ + static void + findctag(tag) + register char *tag; + { char *p; char *q; register FILE *f; register int taglen; + register int taglinenum; + char *tagfile; + char *tagpattern; + int tagendline; int search_char; int err; char tline[TAGLINE_SIZE]; + struct tag *tag_p; p = unquote_file(tags); f = fopen(p, "r"); *************** *** 50,59 **** if (f == NULL) { error("No tags file", NULL_PARG); - tagfile = NULL; return; } taglen = strlen(tag); /* --- 269,281 ---- if (f == NULL) { error("No tags file", NULL_PARG); return; } + /* Cleanup loading tag structure if any. */ + cleantags(); + total = 0; + taglen = strlen(tag); /* *************** *** 61,66 **** --- 283,293 ---- */ while (fgets(tline, sizeof(tline), f) != NULL) { + /* + * It's header of extended format. Skip. + */ + if (tline[0] == '!') + continue; if (strncmp(tag, tline, taglen) != 0 || !WHITESP(tline[taglen])) continue; *************** *** 72,79 **** * or a search pattern surrounded by a pair of delimiters. * Parse the line and extract these parts. */ ! tagfile = tagpattern = NULL; taglinenum = 0; /* * Skip over the whitespace after the tag name. --- 299,307 ---- * or a search pattern surrounded by a pair of delimiters. * Parse the line and extract these parts. */ ! tagfile = NULL; taglinenum = 0; + tagpattern = NULL; /* * Skip over the whitespace after the tag name. *************** *** 95,101 **** if (*p == '\0') /* Pattern is missing! */ continue; - tagfile = save(tagfile); /* * First see if it is a line number. --- 323,328 ---- *************** *** 113,151 **** search_char = *p++; if (*p == '^') p++; ! tagpattern = (char *) ecalloc(strlen(p)+1, sizeof(char)); ! q = tagpattern; while (*p != search_char && *p != '\0') { if (*p == '\\') p++; ! *q++ = *p++; } ! tagendline = (q[-1] == '$'); if (tagendline) ! q--; ! *q = '\0'; } ! ! fclose(f); ! return; } fclose(f); ! error("No such tag in tags file", NULL_PARG); ! tagfile = NULL; } ! public int edit_tagfile() { int r; ! if (tagfile == NULL) return (1); ! r = edit(tagfile); ! free(tagfile); ! tagfile = NULL; ! return (r); } /* --- 340,388 ---- search_char = *p++; if (*p == '^') p++; ! tagpattern = p; while (*p != search_char && *p != '\0') { if (*p == '\\') p++; ! p++; } ! tagendline = (p[-1] == '$'); if (tagendline) ! p--; ! *p = '\0'; } ! /* Make new entry and add to queue */ ! tag_p = maketagent(tag, tagfile, taglinenum, tagpattern, tagendline); ! if (tag_p) { ! CIRCLEQ_INSERT_TAIL(&tag_q, tag_p, ptrs); ! } else { ! error("malloc() failed", NULL_PARG); ! if (f != stdin) ! pclose(f); ! return; ! } ! total++; } fclose(f); ! if (total == 0) { ! error("No such tag in tags file", NULL_PARG); ! return; ! } ! curtag = CIRCLEQ_FIRST(&tag_q); ! curseq = 1; } ! /* ! * Edit current tagged file. ! */ public int edit_tagfile() { int r; ! if (curtag == NULL) return (1); ! return edit(curtag->tagfile); } /* *************** *** 157,177 **** * regcmp vs. re_comp) behave differently in the presence of * parentheses (which are almost always found in a tag). */ ! public POSITION ! tagsearch() { POSITION pos, linepos; int linenum; int len; char *line; - /* - * If we have the line number of the tag instead of the pattern, - * just use find_pos. - */ - if (taglinenum) - return (find_pos(taglinenum)); - pos = ch_zero(); linenum = find_linenum(pos); --- 394,407 ---- * regcmp vs. re_comp) behave differently in the presence of * parentheses (which are almost always found in a tag). */ ! static POSITION ! ctagsearch() { POSITION pos, linepos; int linenum; int len; char *line; pos = ch_zero(); linenum = find_linenum(pos); *************** *** 217,231 **** * If tagendline is set, make sure we match all * the way to end of line (no extra chars after the match). */ ! len = strlen(tagpattern); ! if (strncmp(tagpattern, line, len) == 0 && ! (!tagendline || line[len] == '\0' || line[len] == '\r')) break; } - free(tagpattern); - tagpattern = NULL; return (linepos); } #endif --- 447,755 ---- * If tagendline is set, make sure we match all * the way to end of line (no extra chars after the match). */ ! len = strlen(curtag->tagpattern); ! if (strncmp(curtag->tagpattern, line, len) == 0 && ! (!curtag->tagendline || line[len] == '\0' || line[len] == '\r')) { ! /* ! * Set line number to tag entry while forwarding. ! * It can be used while back fowarding. ! */ ! curtag->taglinenum = find_linenum(linepos); ! jump_back(curtag->taglinenum); break; + } } return (linepos); + } + + /******************************************************************************* + * + * gtags + * + */ + + /* + * Find tags in the GLOBAL's tag file. + * The findgtag() will try and load information about the requested tag. + * It does this by calling "global -x tag" and storing the parsed output + * for future use by gtagsearch(). + * Sets curtag to the first tag entry. + */ + static void + findgtag(tag, type) + char *tag; /* tag to load */ + int type; /* tags type */ + { + char command[512]; + char *flag; + char buf[256]; + int status; + FILE *fp; + struct tag *tag_p; + + if (type != T_CTAGS_X && !tag) { + return; + } + + /* Cleanup loading tag structure if any. */ + cleantags(); + total = 0; + + /* + * If type == T_CTAGS_X then read ctags's -x format from stdin + * else execute global(1) and read from it; + */ + if (type == T_CTAGS_X) { + fp = stdin; + /* + * Set tag default because we cannot read stdin again. + */ + tags = "tags"; + } else { + /* Get suitable flag value for global(1). */ + switch (type) { + case T_GTAGS: + flag = "" ; + break; + case T_GRTAGS: + flag = "r"; + break; + case T_GSYMS: + flag = "s"; + break; + case T_GPATH: + flag = "P"; + break; + default: + error("unknown tag type", NULL_PARG); + } + + /* Get our data from global(1) */ + #ifdef HAVE_SNPRINTF + snprintf(command, sizeof(command), + #else + sprintf(command, + #endif /* HAVE_SNPRINTF */ + "global -x%s '%s' 2>/dev/null", flag, tag); + fp = popen(command, "r"); + } + if (fp) { + while (fgets(buf, sizeof(buf), fp)) { + char *name, *file, *line; + + if (sigs) { + if (fp != stdin) + pclose(fp); + return; + } + + /* chop(buf) */ + if (buf[strlen(buf) - 1] == '\n') + buf[strlen(buf) - 1] = 0; + else + while (fgetc(fp) != '\n') + ; + + if (getentry(buf, &name, &file, &line)) { + /* + * Couldn't parse this line for some reason. + * We'll just pretend it never happened. + */ + break; + } + + /* Make new entry and add to queue */ + tag_p = maketagent(name, file, atoi(line), NULL, 0); + if (tag_p) { + CIRCLEQ_INSERT_TAIL(&tag_q, tag_p, ptrs); + } else { + error("malloc() failed", NULL_PARG); + if (fp != stdin) + pclose(fp); + return; + } + total++; + } + if (fp != stdin) { + status = pclose(fp); + if (status) { + error("No tags file", NULL_PARG); + curtag = NULL; + total = curseq = 0; + return; + } + } + } + + /* Check to see if we found anything. */ + if (CIRCLEQ_EMPTY(&tag_q)) + return; /* Nope! */ + + curtag = CIRCLEQ_FIRST(&tag_q); + curseq = 1; + } + + static int circular = 0; /* 1: circlular tag structure */ + /* + * Return the filename required for the next gtag in the queue that was setup + * by findgtag(). The next call to gtagsearch() will try to position at the + * appropriate tag. + */ + static char * + nextgtag() + { + if (!curtag) + /* No tag loaded */ + return NULL; + + /* + * It is the last tag entry. + */ + if (CIRCLEQ_NEXT(curtag, ptrs) == (void *)&tag_q) { + if (!circular) + return NULL; + /* Wrapped around to the head of the queue */ + curtag = CIRCLEQ_FIRST(&tag_q); + curseq = 1; + } else { + curtag = CIRCLEQ_NEXT(curtag, ptrs); + curseq++; + } + return curtag->tagfile; + } + + /* + * Return the filename required for the previous gtag in the queue that was + * setup by findgtat(). The next call to gtagsearch() will try to position + * at the appropriate tag. + */ + static char * + prevgtag() + { + if (!curtag) + /* No tag loaded */ + return NULL; + + /* + * It is the first tag entry. + */ + if (CIRCLEQ_PREV(curtag, ptrs) == (void *)&tag_q) { + if (!circular) + return NULL; + /* Wrapped around to the tail of the queue */ + curtag = CIRCLEQ_LAST(&tag_q); + curseq = total; + } else { + curtag = CIRCLEQ_PREV(curtag, ptrs); + curseq--; + } + return curtag->tagfile; + } + + /* + * Position the current file at at what is hopefully the tag that was chosen + * using either findtag() or one of nextgtag() and prevgtag(). Returns -1 + * if it was unable to position at the tag, 0 if succesful. + */ + static POSITION + gtagsearch() + { + if (!curtag) + return (NULL_POSITION); /* No gtags loaded! */ + + jump_back(curtag->taglinenum); + + /* + * XXX We'll assume we were successful --- jump_back() will call error() + * if it fails, so the user will receive some kind of notification. + * Eventually, jump_back() should do its work silently and let us + * perform the error notification, eventually allowing our caller + * (presumably tagsearch()) to go error("Could not locate tag."); + */ + return (find_pos(curtag->taglinenum)); + } + + /* + * The getentry() parses both standard and extended ctags -x format. + * + * [standard format] + * + * +------------------------------------------------ + * |main 30 main.c main(argc, argv) + * |func 21 subr.c func(arg) + * + * The following commands write this format. + * o Traditinal Ctags with -x option + * o Global with -x option + * See + * + * [extended format] + * + * +---------------------------------------------------------- + * |main function 30 main.c main(argc, argv) + * |func function 21 subr.c func(arg) + * + * The following commands write this format. + * o Exuberant Ctags with -x option + * See + * + * Returns 0 on success, -1 on error. + * The tag, file, and line will each be NUL-terminated pointers + * into buf. + */ + static int + getentry(buf, tag, file, line) + char *buf; /* standard or extended ctags -x format data */ + char **tag; /* name of the tag we actually found */ + char **file; /* file in which to find this tag */ + char **line; /* line number of file where this tag is found */ + { + char *p = buf; + + for (*tag = p; *p && !isspace(*p); p++) /* tag name */ + ; + if (*p == 0) + goto err; + *p++ = 0; + for (; *p && isspace(*p); p++) /* (skip blanks) */ + ; + if (*p == 0) + goto err; + /* + * If the second part begin with other than digit, + * it is assumed tag type. Skip it. + */ + if (!isdigit(*p)) { + for (; *p && !isspace(*p); p++) /* (skip tag type) */ + ; + for (; *p && isspace(*p); p++) /* (skip blanks) */ + ; + } + if (!isdigit(*p)) + goto err; + *line = p; /* line no */ + for (*line = p; *p && !isspace(*p); p++) + ; + if (*p == 0) + goto err; + *p++ = 0; + for (; *p && isspace(*p); p++) /* (skip blanks) */ + ; + if (*p == 0) + goto err; + *file = p; /* file name */ + for (*file = p; *p && !isspace(*p); p++) + ; + if (*p == 0) + goto err; + *p = 0; + + /* value check */ + if (strlen(*tag) && strlen(*line) && strlen(*file) && atoi(*line) > 0) + return (0); /* OK */ + err: + return (-1); /* ERROR */ } #endif