clex-3.15/0000777000076400007640000000000010470105530007405 500000000000000clex-3.15/README0000644000076400007640000000074507626370640010226 00000000000000CLEX is a file manager with a full-screen user interface written in C with the curses library. It displays directory contents (including file status details) and provides features like command history, filename insertion, or name completion in order to help the user to construct commands to be executed by the shell (there are no built-in commands). CLEX is easily configurable and all its features are explained in the on-line help. Visit http://www.clex.sk for more information. clex-3.15/configure.in0000644000076400007640000000310010465363560011641 00000000000000AC_PREREQ(2.57) AC_INIT([CLEX File Manager],[3.15],[clex@clex.sk],[clex]) AM_INIT_AUTOMAKE AC_CONFIG_SRCDIR([src/clex.h]) AC_CONFIG_HEADER([config.h]) # Checks for programs. AC_PROG_CC if test "$CC" = "gcc" ; then CFLAGS="$CFLAGS -Wall -pedantic" fi # Checks for libraries. AC_SEARCH_LIBS([initscr],[ncurses curses],,AC_MSG_ERROR([CLEX requires NCURSES package])) # AC_SYS_LARGEFILE # Checks for header files. AC_HEADER_DIRENT AC_HEADER_STDC AC_HEADER_MAJOR AC_HEADER_SYS_WAIT AC_HEADER_TIME AC_CHECK_HEADERS([locale.h ncurses.h sys/time.h term.h ncurses/term.h]) # Checks for typedefs, structures, and compiler characteristics. AC_HEADER_STAT AC_C_CONST AC_TYPE_UID_T AC_TYPE_MODE_T AC_TYPE_OFF_T AC_TYPE_PID_T AC_TYPE_SIZE_T AC_TYPE_SIGNAL AC_CHECK_MEMBERS([struct stat.st_rdev]) AC_CHECK_DECLS([sys_siglist],,, [ #include #include ]) # Checks for library functions. AC_FUNC_STRCOLL AC_FUNC_STRFTIME AC_DEFINE([_GNU_SOURCE],[1],[required for strsignal]) AC_CHECK_FUNCS([readlink lstat strchr putenv strerror uname notimeout setlocale strsignal]) # Other stuff if test "$ac_cv_func_strchr" != yes ; then AC_DEFINE([strchr],[index],[no strchr]) fi if test "$ac_cv_func_lstat" != yes ; then AC_DEFINE([lstat],[stat],[no lstat]) fi if test "$ac_cv_func_strcoll_works" != yes ; then AC_DEFINE([STRCOLL],[strcmp],[no working strcoll]) else AC_DEFINE([STRCOLL],[strcoll],[working strcoll]) fi if test "$ac_cv_func_strerror" != yes ; then AC_DEFINE([strerror],[my_strerror],[missing function replacement]) fi AC_CONFIG_FILES([Makefile clex.spec src/Makefile]) AC_OUTPUT clex-3.15/aclocal.m40000644000076400007640000007462010465364127011207 00000000000000# generated automatically by aclocal 1.9.5 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. # Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"]) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION so it can be traced. # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.9.5])]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 7 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE]) AC_SUBST([$1_FALSE]) if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 8 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "GCJ", or "OBJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH]) ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. #serial 3 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # So let's grep whole file. if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each `.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 12 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.58])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl # test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AM_PROG_INSTALL_SH AM_PROG_INSTALL_STRIP AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl ]) ]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $1 | $1:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl install_sh=${install_sh-"$am_aux_dir/install-sh"} AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 3 # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo done .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_MKDIR_P # --------------- # Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise. # # Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories # created by `make install' are always world readable, even if the # installer happens to have an overly restrictive umask (e.g. 077). # This was a mistake. There are at least two reasons why we must not # use `-m 0755': # - it causes special bits like SGID to be ignored, # - it may be too restrictive (some setups expect 775 directories). # # Do not use -m 0755 and let people choose whatever they expect by # setting umask. # # We cannot accept any implementation of `mkdir' that recognizes `-p'. # Some implementations (such as Solaris 8's) are not thread-safe: if a # parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c' # concurrently, both version can detect that a/ is missing, but only # one can create it and the other will error out. Consequently we # restrict ourselves to GNU make (using the --version option ensures # this.) AC_DEFUN([AM_PROG_MKDIR_P], [if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then # We used to keeping the `.' as first argument, in order to # allow $(mkdir_p) to be used without argument. As in # $(mkdir_p) $(somedir) # where $(somedir) is conditionally defined. However this is wrong # for two reasons: # 1. if the package is installed by a user who cannot write `.' # make install will fail, # 2. the above comment should most certainly read # $(mkdir_p) $(DESTDIR)$(somedir) # so it does not work when $(somedir) is undefined and # $(DESTDIR) is not. # To support the latter case, we have to write # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), # so the `.' trick is pointless. mkdir_p='mkdir -p --' else # On NextStep and OpenStep, the `mkdir' command does not # recognize any option. It will interpret all options as # directories to create, and then abort because `.' already # exists. for d in ./-p ./--version; do test -d $d && rmdir $d done # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. if test -f "$ac_aux_dir/mkinstalldirs"; then mkdir_p='$(mkinstalldirs)' else mkdir_p='$(install_sh) -d' fi fi AC_SUBST([mkdir_p])]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 3 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # ------------------------------ # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ---------------------------------- # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of `v7', `ustar', or `pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. AM_MISSING_PROG([AMTAR], [tar]) m4_if([$1], [v7], [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR clex-3.15/Makefile.am0000644000076400007640000000012310123302471011347 00000000000000SUBDIRS = src EXTRA_DIST = ChangeLog clex.spec clex.spec.in CLEANFILES = clex.spec clex-3.15/Makefile.in0000644000076400007640000004363310465364130011406 00000000000000# Makefile.in generated by automake 1.9.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = . am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/clex.spec.in \ $(srcdir)/config.h.in $(top_srcdir)/configure AUTHORS COPYING \ ChangeLog INSTALL NEWS depcomp install-sh missing \ mkinstalldirs ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno configure.status.lineno mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = clex.spec SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-exec-recursive install-info-recursive \ install-recursive installcheck-recursive installdirs-recursive \ pdf-recursive ps-recursive uninstall-info-recursive \ uninstall-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ { test ! -d $(distdir) \ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr $(distdir); }; } DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ ac_ct_CC = @ac_ct_CC@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ datadir = @datadir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ SUBDIRS = src EXTRA_DIST = ChangeLog clex.spec clex.spec.in CLEANFILES = clex.spec all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \ cd $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) cd $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) config.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ $(MAKE) stamp-h1; \ else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: $(am__configure_deps) cd $(top_srcdir) && $(AUTOHEADER) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 clex.spec: $(top_builddir)/config.status $(srcdir)/clex.spec.in cd $(top_builddir) && $(SHELL) ./config.status $@ uninstall-info-am: # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) mkdir $(distdir) $(mkdir_p) $(distdir)/. @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(mkdir_p) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ distdir) \ || exit 1; \ fi; \ done -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r $(distdir) dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && cd $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}' distuninstallcheck: @cd $(distuninstallcheck_dir) \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile config.h installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-exec-am: install-info: install-info-recursive install-man: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-info-am uninstall-info: uninstall-info-recursive .PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \ check-am clean clean-generic clean-recursive ctags \ ctags-recursive dist dist-all dist-bzip2 dist-gzip dist-shar \ dist-tarZ dist-zip distcheck distclean distclean-generic \ distclean-hdr distclean-recursive distclean-tags \ distcleancheck distdir distuninstallcheck dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-exec install-exec-am install-info \ install-info-am install-man install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic maintainer-clean-recursive \ mostlyclean mostlyclean-generic mostlyclean-recursive pdf \ pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \ uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: clex-3.15/clex.spec.in0000644000076400007640000000174310335453760011555 00000000000000# # CLEX File Manager RPM spec file # Summary: A file manager Name: clex Version: @VERSION@ Release: 1 License: GPL Group: Applications/File Source: http://www.clex.sk/download/clex-@VERSION@.tar.gz URL: http://www.clex.sk #Packager: PUT YOUR NAME HERE Requires: ncurses BuildRequires: ncurses-devel BuildRoot: %{_tmppath}/%{name}-root %description CLEX is a file manager with a full-screen text-based user interface. It displays directory contents including file status details and provides features like command history, filename insertion, or name completion in order to help the user to construct commands to be executed by the shell. CLEX is easily configurable and its features are explained in the on-line help. %prep %setup -q %build ./configure --bindir=/usr/bin --mandir=/usr/share/man --sysconfdir=/etc make %install make install DESTDIR=%{buildroot} %files %defattr(-,root,root) %{_bindir}/clex %{_mandir}/man1/clex.1.gz %clean [ %{buildroot} != "/" ] && rm -rf %{buildroot} clex-3.15/config.h.in0000644000076400007640000001122410465364136011361 00000000000000/* config.h.in. Generated from configure.in by autoheader. */ /* Define to 1 if you have the declaration of `sys_siglist', and to 0 if you don't. */ #undef HAVE_DECL_SYS_SIGLIST /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_DIRENT_H /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_LOCALE_H /* Define to 1 if you have the `lstat' function. */ #undef HAVE_LSTAT /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the header file. */ #undef HAVE_NCURSES_H /* Define to 1 if you have the header file. */ #undef HAVE_NCURSES_TERM_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_NDIR_H /* Define to 1 if you have the `notimeout' function. */ #undef HAVE_NOTIMEOUT /* Define to 1 if you have the `putenv' function. */ #undef HAVE_PUTENV /* Define to 1 if you have the `readlink' function. */ #undef HAVE_READLINK /* Define to 1 if you have the `setlocale' function. */ #undef HAVE_SETLOCALE /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `strchr' function. */ #undef HAVE_STRCHR /* Define to 1 if you have the `strcoll' function and it is properly defined. */ #undef HAVE_STRCOLL /* Define to 1 if you have the `strerror' function. */ #undef HAVE_STRERROR /* Define to 1 if you have the `strftime' function. */ #undef HAVE_STRFTIME /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strsignal' function. */ #undef HAVE_STRSIGNAL /* Define to 1 if `st_rdev' is member of `struct stat'. */ #undef HAVE_STRUCT_STAT_ST_RDEV /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_DIR_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_NDIR_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have that is POSIX.1 compatible. */ #undef HAVE_SYS_WAIT_H /* Define to 1 if you have the header file. */ #undef HAVE_TERM_H /* Define to 1 if you have the `uname' function. */ #undef HAVE_UNAME /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if `major', `minor', and `makedev' are declared in . */ #undef MAJOR_IN_MKDEV /* Define to 1 if `major', `minor', and `makedev' are declared in . */ #undef MAJOR_IN_SYSMACROS /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define as the return type of signal handlers (`int' or `void'). */ #undef RETSIGTYPE /* Define to 1 if the `S_IS*' macros in do not work properly. */ #undef STAT_MACROS_BROKEN /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* working strcoll */ #undef STRCOLL /* Define to 1 if you can safely include both and . */ #undef TIME_WITH_SYS_TIME /* Version number of package */ #undef VERSION /* Number of bits in a file offset, on hosts where this is settable. */ #undef _FILE_OFFSET_BITS /* required for strsignal */ #undef _GNU_SOURCE /* Define for large files, on AIX-style hosts. */ #undef _LARGE_FILES /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to `int' if doesn't define. */ #undef gid_t /* no lstat */ #undef lstat /* Define to `int' if does not define. */ #undef mode_t /* Define to `long' if does not define. */ #undef off_t /* Define to `int' if does not define. */ #undef pid_t /* Define to `unsigned' if does not define. */ #undef size_t /* no strchr */ #undef strchr /* missing function replacement */ #undef strerror /* Define to `int' if doesn't define. */ #undef uid_t clex-3.15/configure0000755000076400007640000064404110465364130011250 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.59 for CLEX File Manager 3.15. # # Report bugs to . # # Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` exec 6>&1 # # Initializations. # ac_default_prefix=/usr/local ac_config_libobj_dir=. cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. # This variable seems obsolete. It should probably be removed, and # only ac_max_sed_lines should be used. : ${ac_max_here_lines=38} # Identity of this package. PACKAGE_NAME='CLEX File Manager' PACKAGE_TARNAME='clex' PACKAGE_VERSION='3.15' PACKAGE_STRING='CLEX File Manager 3.15' PACKAGE_BUGREPORT='clex@clex.sk' ac_unique_file="src/clex.h" # Factoring default headers for most tests. ac_includes_default="\ #include #if HAVE_SYS_TYPES_H # include #endif #if HAVE_SYS_STAT_H # include #endif #if STDC_HEADERS # include # include #else # if HAVE_STDLIB_H # include # endif #endif #if HAVE_STRING_H # if !STDC_HEADERS && HAVE_MEMORY_H # include # endif # include #endif #if HAVE_STRINGS_H # include #endif #if HAVE_INTTYPES_H # include #else # if HAVE_STDINT_H # include # endif #endif #if HAVE_UNISTD_H # include #endif" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CPP EGREP LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_option in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "enable_$ac_feature='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/-/_/g'` eval "with_$ac_package=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` eval "$ac_envvar='$ac_optarg'" export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute paths. for ac_var in exec_prefix prefix do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* | NONE | '' ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ localstatedir libdir includedir oldincludedir infodir mandir do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_confdir=`(dirname "$0") 2>/dev/null || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 { (exit 1); exit 1; }; } else { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi fi (cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 { (exit 1); exit 1; }; } srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` ac_env_build_alias_set=${build_alias+set} ac_env_build_alias_value=$build_alias ac_cv_env_build_alias_set=${build_alias+set} ac_cv_env_build_alias_value=$build_alias ac_env_host_alias_set=${host_alias+set} ac_env_host_alias_value=$host_alias ac_cv_env_host_alias_set=${host_alias+set} ac_cv_env_host_alias_value=$host_alias ac_env_target_alias_set=${target_alias+set} ac_env_target_alias_value=$target_alias ac_cv_env_target_alias_set=${target_alias+set} ac_cv_env_target_alias_value=$target_alias ac_env_CC_set=${CC+set} ac_env_CC_value=$CC ac_cv_env_CC_set=${CC+set} ac_cv_env_CC_value=$CC ac_env_CFLAGS_set=${CFLAGS+set} ac_env_CFLAGS_value=$CFLAGS ac_cv_env_CFLAGS_set=${CFLAGS+set} ac_cv_env_CFLAGS_value=$CFLAGS ac_env_LDFLAGS_set=${LDFLAGS+set} ac_env_LDFLAGS_value=$LDFLAGS ac_cv_env_LDFLAGS_set=${LDFLAGS+set} ac_cv_env_LDFLAGS_value=$LDFLAGS ac_env_CPPFLAGS_set=${CPPFLAGS+set} ac_env_CPPFLAGS_value=$CPPFLAGS ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} ac_cv_env_CPPFLAGS_value=$CPPFLAGS ac_env_CPP_set=${CPP+set} ac_env_CPP_value=$CPP ac_cv_env_CPP_set=${CPP+set} ac_cv_env_CPP_value=$CPP # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures CLEX File Manager 3.15 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] _ACEOF cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --datadir=DIR read-only architecture-independent data [PREFIX/share] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --infodir=DIR info documentation [PREFIX/info] --mandir=DIR man documentation [PREFIX/man] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of CLEX File Manager 3.15:";; esac cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --disable-largefile omit support for large files Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d $ac_dir || continue ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac cd $ac_dir # Check for guested configure; otherwise get Cygnus style configure. if test -f $ac_srcdir/configure.gnu; then echo $SHELL $ac_srcdir/configure.gnu --help=recursive elif test -f $ac_srcdir/configure; then echo $SHELL $ac_srcdir/configure --help=recursive elif test -f $ac_srcdir/configure.ac || test -f $ac_srcdir/configure.in; then echo $ac_configure --help else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi cd $ac_popdir done fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF CLEX File Manager configure 3.15 generated by GNU Autoconf 2.59 Copyright (C) 2003 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit 0 fi exec 5>config.log cat >&5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by CLEX File Manager $as_me 3.15, which was generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ _ACEOF { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` hostinfo = `(hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" # Get rid of the leading space. ac_sep=" " ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Be sure not to use single quotes in there, as some shells, # such as our DU 5.0 friend, will then `close' the trap. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, { (set) 2>&1 | case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in *ac_space=\ *) sed -n \ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; *) sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------- ## ## Output files. ## ## ------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo sed "/^$/d" confdefs.h | sort echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core *.core && rm -rf conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo >confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . $cache_file;; *) . ./$cache_file;; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in `(set) 2>&1 | sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val="\$ac_cv_env_${ac_var}_value" eval ac_new_val="\$ac_env_${ac_var}_value" case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu am__api_version="1.9" ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f $ac_dir/shtool; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} { (exit 1); exit 1; }; } fi ac_config_guess="$SHELL $ac_aux_dir/config.guess" ac_config_sub="$SHELL $ac_aux_dir/config.sub" ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # 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" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /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 for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL=$ac_install_sh fi fi echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo "$as_me:$LINENO: checking whether build environment is sane" >&5 echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6 # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&5 echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&2;} { (exit 1); exit 1; }; } fi test "$2" = conftest.file ) then # Ok. : else { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! Check your system clock" >&5 echo "$as_me: error: newly created file is older than distributed files! Check your system clock" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 test "$program_prefix" != NONE && program_transform_name="s,^,$program_prefix,;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s,\$,$program_suffix,;$program_transform_name" # Double any \ or $. echo might interpret backslashes. # By default was `s,x,x', remove it if useless. cat <<\_ACEOF >conftest.sed s/[\\$]/&&/g;s/;s,x,x,$// _ACEOF program_transform_name=`echo $program_transform_name | sed -f conftest.sed` rm conftest.sed # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then # We used to keeping the `.' as first argument, in order to # allow $(mkdir_p) to be used without argument. As in # $(mkdir_p) $(somedir) # where $(somedir) is conditionally defined. However this is wrong # for two reasons: # 1. if the package is installed by a user who cannot write `.' # make install will fail, # 2. the above comment should most certainly read # $(mkdir_p) $(DESTDIR)$(somedir) # so it does not work when $(somedir) is undefined and # $(DESTDIR) is not. # To support the latter case, we have to write # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), # so the `.' trick is pointless. mkdir_p='mkdir -p --' else # On NextStep and OpenStep, the `mkdir' command does not # recognize any option. It will interpret all options as # directories to create, and then abort because `.' already # exists. for d in ./-p ./--version; do test -d $d && rmdir $d done # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. if test -f "$ac_aux_dir/mkinstalldirs"; then mkdir_p='$(mkinstalldirs)' else mkdir_p='$(install_sh) -d' fi fi for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_AWK+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then echo "$as_me:$LINENO: result: $AWK" >&5 echo "${ECHO_T}$AWK" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$AWK" && break done echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF all: @echo 'ac_maketemp="$(MAKE)"' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` if test -n "$ac_maketemp"; then eval ac_cv_prog_make_${ac_make}_set=yes else eval ac_cv_prog_make_${ac_make}_set=no fi rm -f conftest.make fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 SET_MAKE= else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} { (exit 1); exit 1; }; } fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='clex' VERSION='3.15' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} install_sh=${install_sh-"$am_aux_dir/install-sh"} # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then echo "$as_me:$LINENO: result: $STRIP" >&5 echo "${ECHO_T}$STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 echo "${ECHO_T}$ac_ct_STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi STRIP=$ac_ct_STRIP else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. AMTAR=${AMTAR-"${am_missing_run}tar"} am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' ac_config_headers="$ac_config_headers config.h" # Checks for programs. ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CC" && break done CC=$ac_ct_CC fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Find the output, starting from the most likely. This scheme is # not robust to junk in `.', hence go to wildcards (a.*) only as a last # resort. # Be careful to initialize this variable, since it used to be cached. # Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. ac_cv_exeext= # b.out is created by i960 compilers. for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; conftest.$ac_ext ) # This is the source file. ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` # FIXME: I believe we export ac_cv_exeext for Libtool, # but it would be cool to find out if it's true. Does anybody # maintain Libtool? --akim. export ac_cv_exeext break;; * ) break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6 # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6 echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` export ac_cv_exeext break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6 rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6 OBJEXT=$ac_cv_objext ac_objext=$OBJEXT echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS CFLAGS="-g" echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cc_g=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&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 "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 if test "${ac_cv_prog_cc_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_stdc=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std1 is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std1. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF # Don't try gcc -ansi; that turns off useful extensions and # breaks some systems' header files. # AIX -qlanglvl=ansi # Ultrix and OSF/1 -std1 # HP-UX 10.20 and later -Ae # HP-UX older versions -Aa -D_HPUX_SOURCE # SVR4 -Xc -D__EXTENSIONS__ for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_stdc=$ac_arg break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext done rm -f conftest.$ac_ext conftest.$ac_objext CC=$ac_save_CC fi case "x$ac_cv_prog_cc_stdc" in x|xno) echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6 ;; *) echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 CC="$CC $ac_cv_prog_cc_stdc" ;; esac # Some people use a C++ compiler to compile C. Since we use `exit', # in C++ we need to declare it. In case someone uses the same compiler # for both compiling C and C++ we need to have the C++ compiler decide # the declaration of exit, since it's the most demanding environment. cat >conftest.$ac_ext <<_ACEOF #ifndef __cplusplus choke me #endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ '' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration #include int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo done .PHONY: am__doit END # If we don't find an include directive, just comment out the code. echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6 am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi echo "$as_me:$LINENO: result: $_am_result" >&5 echo "${ECHO_T}$_am_result" >&6 rm -f confinc confmf # Check whether --enable-dependency-tracking or --disable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then enableval="$enable_dependency_tracking" fi; if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CC" am_compiler_list= echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6 CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi if test "$CC" = "gcc" ; then CFLAGS="$CFLAGS -Wall -pedantic" fi # Checks for libraries. echo "$as_me:$LINENO: checking for library containing initscr" >&5 echo $ECHO_N "checking for library containing initscr... $ECHO_C" >&6 if test "${ac_cv_search_initscr+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS ac_cv_search_initscr=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char initscr (); int main () { initscr (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_search_initscr="none required" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$ac_cv_search_initscr" = no; then for ac_lib in ncurses curses; do LIBS="-l$ac_lib $ac_func_search_save_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char initscr (); int main () { initscr (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_search_initscr="-l$ac_lib" break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext done fi LIBS=$ac_func_search_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_search_initscr" >&5 echo "${ECHO_T}$ac_cv_search_initscr" >&6 if test "$ac_cv_search_initscr" != no; then test "$ac_cv_search_initscr" = "none required" || LIBS="$ac_cv_search_initscr $LIBS" else { { echo "$as_me:$LINENO: error: CLEX requires NCURSES package" >&5 echo "$as_me: error: CLEX requires NCURSES package" >&2;} { (exit 1); exit 1; }; } fi # # Check whether --enable-largefile or --disable-largefile was given. if test "${enable_largefile+set}" = set; then enableval="$enable_largefile" fi; if test "$enable_largefile" != no; then echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5 echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6 if test "${ac_cv_sys_largefile_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_sys_largefile_CC=no if test "$GCC" != yes; then ac_save_CC=$CC while :; do # IRIX 6.2 and later do not support large files by default, # so use the C compiler's -n32 option if that helps. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext CC="$CC -n32" rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sys_largefile_CC=' -n32'; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext break done CC=$ac_save_CC rm -f conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5 echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6 if test "$ac_cv_sys_largefile_CC" != no; then CC=$CC$ac_cv_sys_largefile_CC fi echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5 echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6 if test "${ac_cv_sys_file_offset_bits+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else while :; do ac_cv_sys_file_offset_bits=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define _FILE_OFFSET_BITS 64 #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sys_file_offset_bits=64; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext break done fi echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5 echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6 if test "$ac_cv_sys_file_offset_bits" != no; then cat >>confdefs.h <<_ACEOF #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits _ACEOF fi rm -f conftest* echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5 echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6 if test "${ac_cv_sys_large_files+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else while :; do ac_cv_sys_large_files=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define _LARGE_FILES 1 #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sys_large_files=1; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext break done fi echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5 echo "${ECHO_T}$ac_cv_sys_large_files" >&6 if test "$ac_cv_sys_large_files" != no; then cat >>confdefs.h <<_ACEOF #define _LARGE_FILES $ac_cv_sys_large_files _ACEOF fi rm -f conftest* fi # Checks for header files. ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5 echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include <$ac_hdr> int main () { if ((DIR *) 0) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 _ACEOF ac_header_dirent=$ac_hdr; break fi done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then echo "$as_me:$LINENO: checking for library containing opendir" >&5 echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6 if test "${ac_cv_search_opendir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS ac_cv_search_opendir=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char opendir (); int main () { opendir (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_search_opendir="none required" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$ac_cv_search_opendir" = no; then for ac_lib in dir; do LIBS="-l$ac_lib $ac_func_search_save_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char opendir (); int main () { opendir (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_search_opendir="-l$ac_lib" break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext done fi LIBS=$ac_func_search_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 echo "${ECHO_T}$ac_cv_search_opendir" >&6 if test "$ac_cv_search_opendir" != no; then test "$ac_cv_search_opendir" = "none required" || LIBS="$ac_cv_search_opendir $LIBS" fi else echo "$as_me:$LINENO: checking for library containing opendir" >&5 echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6 if test "${ac_cv_search_opendir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS ac_cv_search_opendir=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char opendir (); int main () { opendir (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_search_opendir="none required" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$ac_cv_search_opendir" = no; then for ac_lib in x; do LIBS="-l$ac_lib $ac_func_search_save_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char opendir (); int main () { opendir (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_search_opendir="-l$ac_lib" break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext done fi LIBS=$ac_func_search_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 echo "${ECHO_T}$ac_cv_search_opendir" >&6 if test "$ac_cv_search_opendir" != no; then test "$ac_cv_search_opendir" = "none required" || LIBS="$ac_cv_search_opendir $LIBS" fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6 ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6 if test "${ac_cv_prog_egrep+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | (grep -E '(a|b)') >/dev/null 2>&1 then ac_cv_prog_egrep='grep -E' else ac_cv_prog_egrep='egrep' fi fi echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 echo "${ECHO_T}$ac_cv_prog_egrep" >&6 EGREP=$ac_cv_prog_egrep echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done echo "$as_me:$LINENO: checking whether sys/types.h defines makedev" >&5 echo $ECHO_N "checking whether sys/types.h defines makedev... $ECHO_C" >&6 if test "${ac_cv_header_sys_types_h_makedev+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { return makedev(0, 0); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_sys_types_h_makedev=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_sys_types_h_makedev=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_header_sys_types_h_makedev" >&5 echo "${ECHO_T}$ac_cv_header_sys_types_h_makedev" >&6 if test $ac_cv_header_sys_types_h_makedev = no; then if test "${ac_cv_header_sys_mkdev_h+set}" = set; then echo "$as_me:$LINENO: checking for sys/mkdev.h" >&5 echo $ECHO_N "checking for sys/mkdev.h... $ECHO_C" >&6 if test "${ac_cv_header_sys_mkdev_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_sys_mkdev_h" >&5 echo "${ECHO_T}$ac_cv_header_sys_mkdev_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking sys/mkdev.h usability" >&5 echo $ECHO_N "checking sys/mkdev.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking sys/mkdev.h presence" >&5 echo $ECHO_N "checking sys/mkdev.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: sys/mkdev.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: sys/mkdev.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: sys/mkdev.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: sys/mkdev.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: sys/mkdev.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: sys/mkdev.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: sys/mkdev.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: sys/mkdev.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## --------------------------- ## ## Report this to clex@clex.sk ## ## --------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for sys/mkdev.h" >&5 echo $ECHO_N "checking for sys/mkdev.h... $ECHO_C" >&6 if test "${ac_cv_header_sys_mkdev_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_sys_mkdev_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_sys_mkdev_h" >&5 echo "${ECHO_T}$ac_cv_header_sys_mkdev_h" >&6 fi if test $ac_cv_header_sys_mkdev_h = yes; then cat >>confdefs.h <<\_ACEOF #define MAJOR_IN_MKDEV 1 _ACEOF fi if test $ac_cv_header_sys_mkdev_h = no; then if test "${ac_cv_header_sys_sysmacros_h+set}" = set; then echo "$as_me:$LINENO: checking for sys/sysmacros.h" >&5 echo $ECHO_N "checking for sys/sysmacros.h... $ECHO_C" >&6 if test "${ac_cv_header_sys_sysmacros_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_sys_sysmacros_h" >&5 echo "${ECHO_T}$ac_cv_header_sys_sysmacros_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking sys/sysmacros.h usability" >&5 echo $ECHO_N "checking sys/sysmacros.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking sys/sysmacros.h presence" >&5 echo $ECHO_N "checking sys/sysmacros.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: sys/sysmacros.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: sys/sysmacros.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: sys/sysmacros.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: sys/sysmacros.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: sys/sysmacros.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: sys/sysmacros.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: sys/sysmacros.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: sys/sysmacros.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## --------------------------- ## ## Report this to clex@clex.sk ## ## --------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for sys/sysmacros.h" >&5 echo $ECHO_N "checking for sys/sysmacros.h... $ECHO_C" >&6 if test "${ac_cv_header_sys_sysmacros_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_sys_sysmacros_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_sys_sysmacros_h" >&5 echo "${ECHO_T}$ac_cv_header_sys_sysmacros_h" >&6 fi if test $ac_cv_header_sys_sysmacros_h = yes; then cat >>confdefs.h <<\_ACEOF #define MAJOR_IN_SYSMACROS 1 _ACEOF fi fi fi echo "$as_me:$LINENO: checking for sys/wait.h that is POSIX.1 compatible" >&5 echo $ECHO_N "checking for sys/wait.h that is POSIX.1 compatible... $ECHO_C" >&6 if test "${ac_cv_header_sys_wait_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #ifndef WEXITSTATUS # define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) #endif #ifndef WIFEXITED # define WIFEXITED(stat_val) (((stat_val) & 255) == 0) #endif int main () { int s; wait (&s); s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_sys_wait_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_sys_wait_h=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5 echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6 if test $ac_cv_header_sys_wait_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_SYS_WAIT_H 1 _ACEOF fi echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6 if test "${ac_cv_header_time+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include int main () { if ((struct tm *) 0) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_time=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_time=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 echo "${ECHO_T}$ac_cv_header_time" >&6 if test $ac_cv_header_time = yes; then cat >>confdefs.h <<\_ACEOF #define TIME_WITH_SYS_TIME 1 _ACEOF fi for ac_header in locale.h ncurses.h sys/time.h term.h ncurses/term.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## --------------------------- ## ## Report this to clex@clex.sk ## ## --------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # Checks for typedefs, structures, and compiler characteristics. echo "$as_me:$LINENO: checking whether stat file-mode macros are broken" >&5 echo $ECHO_N "checking whether stat file-mode macros are broken... $ECHO_C" >&6 if test "${ac_cv_header_stat_broken+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #if defined(S_ISBLK) && defined(S_IFDIR) # if S_ISBLK (S_IFDIR) You lose. # endif #endif #if defined(S_ISBLK) && defined(S_IFCHR) # if S_ISBLK (S_IFCHR) You lose. # endif #endif #if defined(S_ISLNK) && defined(S_IFREG) # if S_ISLNK (S_IFREG) You lose. # endif #endif #if defined(S_ISSOCK) && defined(S_IFREG) # if S_ISSOCK (S_IFREG) You lose. # endif #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "You lose" >/dev/null 2>&1; then ac_cv_header_stat_broken=yes else ac_cv_header_stat_broken=no fi rm -f conftest* fi echo "$as_me:$LINENO: result: $ac_cv_header_stat_broken" >&5 echo "${ECHO_T}$ac_cv_header_stat_broken" >&6 if test $ac_cv_header_stat_broken = yes; then cat >>confdefs.h <<\_ACEOF #define STAT_MACROS_BROKEN 1 _ACEOF fi echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 if test "${ac_cv_c_const+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { /* FIXME: Include the comments suggested by Paul. */ #ifndef __cplusplus /* Ultrix mips cc rejects this. */ typedef int charset[2]; const charset x; /* SunOS 4.1.1 cc rejects this. */ char const *const *ccp; char **p; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; ccp = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++ccp; p = (char**) ccp; ccp = (char const *const *) p; { /* SCO 3.2v4 cc rejects this. */ char *t; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; }; struct s *b; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; } #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_const=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_const=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 echo "${ECHO_T}$ac_cv_c_const" >&6 if test $ac_cv_c_const = no; then cat >>confdefs.h <<\_ACEOF #define const _ACEOF fi echo "$as_me:$LINENO: checking for uid_t in sys/types.h" >&5 echo $ECHO_N "checking for uid_t in sys/types.h... $ECHO_C" >&6 if test "${ac_cv_type_uid_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "uid_t" >/dev/null 2>&1; then ac_cv_type_uid_t=yes else ac_cv_type_uid_t=no fi rm -f conftest* fi echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&5 echo "${ECHO_T}$ac_cv_type_uid_t" >&6 if test $ac_cv_type_uid_t = no; then cat >>confdefs.h <<\_ACEOF #define uid_t int _ACEOF cat >>confdefs.h <<\_ACEOF #define gid_t int _ACEOF fi echo "$as_me:$LINENO: checking for mode_t" >&5 echo $ECHO_N "checking for mode_t... $ECHO_C" >&6 if test "${ac_cv_type_mode_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((mode_t *) 0) return 0; if (sizeof (mode_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_mode_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_mode_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_mode_t" >&5 echo "${ECHO_T}$ac_cv_type_mode_t" >&6 if test $ac_cv_type_mode_t = yes; then : else cat >>confdefs.h <<_ACEOF #define mode_t int _ACEOF fi echo "$as_me:$LINENO: checking for off_t" >&5 echo $ECHO_N "checking for off_t... $ECHO_C" >&6 if test "${ac_cv_type_off_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((off_t *) 0) return 0; if (sizeof (off_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_off_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_off_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 echo "${ECHO_T}$ac_cv_type_off_t" >&6 if test $ac_cv_type_off_t = yes; then : else cat >>confdefs.h <<_ACEOF #define off_t long _ACEOF fi echo "$as_me:$LINENO: checking for pid_t" >&5 echo $ECHO_N "checking for pid_t... $ECHO_C" >&6 if test "${ac_cv_type_pid_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((pid_t *) 0) return 0; if (sizeof (pid_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_pid_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_pid_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5 echo "${ECHO_T}$ac_cv_type_pid_t" >&6 if test $ac_cv_type_pid_t = yes; then : else cat >>confdefs.h <<_ACEOF #define pid_t int _ACEOF fi echo "$as_me:$LINENO: checking for size_t" >&5 echo $ECHO_N "checking for size_t... $ECHO_C" >&6 if test "${ac_cv_type_size_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((size_t *) 0) return 0; if (sizeof (size_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_size_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_size_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 echo "${ECHO_T}$ac_cv_type_size_t" >&6 if test $ac_cv_type_size_t = yes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned _ACEOF fi echo "$as_me:$LINENO: checking return type of signal handlers" >&5 echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6 if test "${ac_cv_type_signal+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #ifdef signal # undef signal #endif #ifdef __cplusplus extern "C" void (*signal (int, void (*)(int)))(int); #else void (*signal ()) (); #endif int main () { int i; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_signal=void else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_signal=int fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5 echo "${ECHO_T}$ac_cv_type_signal" >&6 cat >>confdefs.h <<_ACEOF #define RETSIGTYPE $ac_cv_type_signal _ACEOF echo "$as_me:$LINENO: checking for struct stat.st_rdev" >&5 echo $ECHO_N "checking for struct stat.st_rdev... $ECHO_C" >&6 if test "${ac_cv_member_struct_stat_st_rdev+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static struct stat ac_aggr; if (ac_aggr.st_rdev) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_member_struct_stat_st_rdev=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static struct stat ac_aggr; if (sizeof ac_aggr.st_rdev) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_member_struct_stat_st_rdev=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_stat_st_rdev=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_rdev" >&5 echo "${ECHO_T}$ac_cv_member_struct_stat_st_rdev" >&6 if test $ac_cv_member_struct_stat_st_rdev = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STAT_ST_RDEV 1 _ACEOF fi echo "$as_me:$LINENO: checking whether sys_siglist is declared" >&5 echo $ECHO_N "checking whether sys_siglist is declared... $ECHO_C" >&6 if test "${ac_cv_have_decl_sys_siglist+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { #ifndef sys_siglist char *p = (char *) sys_siglist; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_have_decl_sys_siglist=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_sys_siglist=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_have_decl_sys_siglist" >&5 echo "${ECHO_T}$ac_cv_have_decl_sys_siglist" >&6 if test $ac_cv_have_decl_sys_siglist = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_SYS_SIGLIST 1 _ACEOF else cat >>confdefs.h <<_ACEOF #define HAVE_DECL_SYS_SIGLIST 0 _ACEOF fi # Checks for library functions. echo "$as_me:$LINENO: checking for working strcoll" >&5 echo $ECHO_N "checking for working strcoll... $ECHO_C" >&6 if test "${ac_cv_func_strcoll_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_func_strcoll_works=no else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { exit (strcoll ("abc", "def") >= 0 || strcoll ("ABC", "DEF") >= 0 || strcoll ("123", "456") >= 0) ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_strcoll_works=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_strcoll_works=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $ac_cv_func_strcoll_works" >&5 echo "${ECHO_T}$ac_cv_func_strcoll_works" >&6 if test $ac_cv_func_strcoll_works = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_STRCOLL 1 _ACEOF fi for ac_func in strftime do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else # strftime is in -lintl on SCO UNIX. echo "$as_me:$LINENO: checking for strftime in -lintl" >&5 echo $ECHO_N "checking for strftime in -lintl... $ECHO_C" >&6 if test "${ac_cv_lib_intl_strftime+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lintl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char strftime (); int main () { strftime (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_intl_strftime=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_intl_strftime=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_intl_strftime" >&5 echo "${ECHO_T}$ac_cv_lib_intl_strftime" >&6 if test $ac_cv_lib_intl_strftime = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_STRFTIME 1 _ACEOF LIBS="-lintl $LIBS" fi fi done cat >>confdefs.h <<\_ACEOF #define _GNU_SOURCE 1 _ACEOF for ac_func in readlink lstat strchr putenv strerror uname notimeout setlocale strsignal do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done # Other stuff if test "$ac_cv_func_strchr" != yes ; then cat >>confdefs.h <<\_ACEOF #define strchr index _ACEOF fi if test "$ac_cv_func_lstat" != yes ; then cat >>confdefs.h <<\_ACEOF #define lstat stat _ACEOF fi if test "$ac_cv_func_strcoll_works" != yes ; then cat >>confdefs.h <<\_ACEOF #define STRCOLL strcmp _ACEOF else cat >>confdefs.h <<\_ACEOF #define STRCOLL strcoll _ACEOF fi if test "$ac_cv_func_strerror" != yes ; then cat >>confdefs.h <<\_ACEOF #define strerror my_strerror _ACEOF fi ac_config_files="$ac_config_files Makefile clex.spec src/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # 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 \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | sed ' t clear : clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ : end' >>confcache if diff $cache_file confcache >/dev/null 2>&1; then :; else if test -w $cache_file; then test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/; s/:*\${srcdir}:*/:/; s/:*@srcdir@:*/:/; s/^\([^=]*=[ ]*\):*/\1/; s/:*$//; s/^[^=]*=[ ]*$//; }' fi DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_i=`echo "$ac_i" | sed 's/\$U\././;s/\.o$//;s/\.obj$//'` # 2. Add them. ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH exec 6>&1 # Open the log real soon, to keep \$[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. Logging --version etc. is OK. exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX } >&5 cat >&5 <<_CSEOF This file was extended by CLEX File Manager $as_me 3.15, which was generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ _CSEOF echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 echo >&5 _ACEOF # Files that config.status was made for. if test -n "$ac_config_files"; then echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS fi if test -n "$ac_config_headers"; then echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS fi if test -n "$ac_config_links"; then echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS fi if test -n "$ac_config_commands"; then echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS fi cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ CLEX File Manager config.status 3.15 configured by $0, generated by GNU Autoconf 2.59, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2003 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." srcdir=$srcdir INSTALL="$INSTALL" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "x$1" : 'x\([^=]*\)='` ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` ac_shift=: ;; -*) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; *) # This is not an option, so the user has probably given explicit # arguments. ac_option=$1 ac_need_defaults=false;; esac case $ac_option in # Handling of the options. _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --vers* | -V ) echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header { { echo "$as_me:$LINENO: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # INIT-COMMANDS section. # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_config_target in $ac_config_targets do case "$ac_config_target" in # Handling of arguments. "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; "clex.spec" ) CONFIG_FILES="$CONFIG_FILES clex.spec" ;; "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason to put it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Create a temporary directory, and hook for its removal unless debugging. $debug || { trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./confstat$$-$RANDOM (umask 077 && mkdir $tmp) } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "\$CONFIG_FILES"; then # Protect against being on the right side of a sed subst in config.status. sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF s,@SHELL@,$SHELL,;t t s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t s,@exec_prefix@,$exec_prefix,;t t s,@prefix@,$prefix,;t t s,@program_transform_name@,$program_transform_name,;t t s,@bindir@,$bindir,;t t s,@sbindir@,$sbindir,;t t s,@libexecdir@,$libexecdir,;t t s,@datadir@,$datadir,;t t s,@sysconfdir@,$sysconfdir,;t t s,@sharedstatedir@,$sharedstatedir,;t t s,@localstatedir@,$localstatedir,;t t s,@libdir@,$libdir,;t t s,@includedir@,$includedir,;t t s,@oldincludedir@,$oldincludedir,;t t s,@infodir@,$infodir,;t t s,@mandir@,$mandir,;t t s,@build_alias@,$build_alias,;t t s,@host_alias@,$host_alias,;t t s,@target_alias@,$target_alias,;t t s,@DEFS@,$DEFS,;t t s,@ECHO_C@,$ECHO_C,;t t s,@ECHO_N@,$ECHO_N,;t t s,@ECHO_T@,$ECHO_T,;t t s,@LIBS@,$LIBS,;t t s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t s,@INSTALL_DATA@,$INSTALL_DATA,;t t s,@CYGPATH_W@,$CYGPATH_W,;t t s,@PACKAGE@,$PACKAGE,;t t s,@VERSION@,$VERSION,;t t s,@ACLOCAL@,$ACLOCAL,;t t s,@AUTOCONF@,$AUTOCONF,;t t s,@AUTOMAKE@,$AUTOMAKE,;t t s,@AUTOHEADER@,$AUTOHEADER,;t t s,@MAKEINFO@,$MAKEINFO,;t t s,@install_sh@,$install_sh,;t t s,@STRIP@,$STRIP,;t t s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t s,@mkdir_p@,$mkdir_p,;t t s,@AWK@,$AWK,;t t s,@SET_MAKE@,$SET_MAKE,;t t s,@am__leading_dot@,$am__leading_dot,;t t s,@AMTAR@,$AMTAR,;t t s,@am__tar@,$am__tar,;t t s,@am__untar@,$am__untar,;t t s,@CC@,$CC,;t t s,@CFLAGS@,$CFLAGS,;t t s,@LDFLAGS@,$LDFLAGS,;t t s,@CPPFLAGS@,$CPPFLAGS,;t t s,@ac_ct_CC@,$ac_ct_CC,;t t s,@EXEEXT@,$EXEEXT,;t t s,@OBJEXT@,$OBJEXT,;t t s,@DEPDIR@,$DEPDIR,;t t s,@am__include@,$am__include,;t t s,@am__quote@,$am__quote,;t t s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t s,@CCDEPMODE@,$CCDEPMODE,;t t s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t s,@CPP@,$CPP,;t t s,@EGREP@,$EGREP,;t t s,@LIBOBJS@,$LIBOBJS,;t t s,@LTLIBOBJS@,$LTLIBOBJS,;t t CEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_lines=48 ac_sed_frag=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_lines # Line after last line for current file. ac_more_lines=: ac_sed_cmds= while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag else sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag fi if test ! -s $tmp/subs.frag; then ac_more_lines=false else # The purpose of the label and of the branching condition is to # speed up the sed processing (if there are no `@' at all, there # is no need to browse any of the substitutions). # These are the two extra sed commands mentioned above. (echo ':t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" else ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" fi ac_sed_frag=`expr $ac_sed_frag + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_lines` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi fi # test -n "$CONFIG_FILES" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_builddir$INSTALL ;; esac if test x"$ac_file" != x-; then { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ if test x"$ac_file" = x-; then configure_input= else configure_input="$ac_file. " fi configure_input=$configure_input"Generated from `echo $ac_file_in | sed 's,.*/,,'` by configure." # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo "$f";; *) # Relative if test -f "$f"; then # Build tree echo "$f" elif test -f "$srcdir/$f"; then # Source tree echo "$srcdir/$f" else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s,@configure_input@,$configure_input,;t t s,@srcdir@,$ac_srcdir,;t t s,@abs_srcdir@,$ac_abs_srcdir,;t t s,@top_srcdir@,$ac_top_srcdir,;t t s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t s,@builddir@,$ac_builddir,;t t s,@abs_builddir@,$ac_abs_builddir,;t t s,@top_builddir@,$ac_top_builddir,;t t s,@abs_top_builddir@,$ac_abs_top_builddir,;t t s,@INSTALL@,$ac_INSTALL,;t t " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out rm -f $tmp/stdin if test x"$ac_file" != x-; then mv $tmp/out $ac_file else cat $tmp/out rm -f $tmp/out fi done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # # CONFIG_HEADER section. # # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where # NAME is the cpp macro being defined and VALUE is the value it is being given. # # ac_d sets the value in "#define NAME VALUE" lines. ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' ac_dB='[ ].*$,\1#\2' ac_dC=' ' ac_dD=',;t' # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ac_uB='$,\1#\2define\3' ac_uC=' ' ac_uD=',;t' for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } # Do quote $f, to prevent DOS paths from being IFS'd. echo "$f";; *) # Relative if test -f "$f"; then # Build tree echo "$f" elif test -f "$srcdir/$f"; then # Source tree echo "$srcdir/$f" else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } # Remove the trailing spaces. sed 's/[ ]*$//' $ac_file_inputs >$tmp/in _ACEOF # Transform confdefs.h into two sed scripts, `conftest.defines' and # `conftest.undefs', that substitutes the proper values into # config.h.in to produce config.h. The first handles `#define' # templates, and the second `#undef' templates. # And first: Protect against being on the right side of a sed subst in # config.status. Protect against being in an unquoted here document # in config.status. rm -f conftest.defines conftest.undefs # Using a here document instead of a string reduces the quoting nightmare. # Putting comments in sed scripts is not portable. # # `end' is used to avoid that the second main sed command (meant for # 0-ary CPP macros) applies to n-ary macro definitions. # See the Autoconf documentation for `clear'. cat >confdef2sed.sed <<\_ACEOF s/[\\&,]/\\&/g s,[\\$`],\\&,g t clear : clear s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp t end s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp : end _ACEOF # If some macros were called several times there might be several times # the same #defines, which is useless. Nevertheless, we may not want to # sort them, since we want the *last* AC-DEFINE to be honored. uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs rm -f confdef2sed.sed # This sed command replaces #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. cat >>conftest.undefs <<\_ACEOF s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, _ACEOF # Break up conftest.defines because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS echo ' :' >>$CONFIG_STATUS rm -f conftest.tail while grep . conftest.defines >/dev/null do # Write a limited-size here document to $tmp/defines.sed. echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS # Speed up: don't consider the non `#define' lines. echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/defines.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in ' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines echo ' fi # grep' >>$CONFIG_STATUS echo >>$CONFIG_STATUS # Break up conftest.undefs because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #undef templates' >>$CONFIG_STATUS rm -f conftest.tail while grep . conftest.undefs >/dev/null do # Write a limited-size here document to $tmp/undefs.sed. echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS # Speed up: don't consider the non `#undef' echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/undefs.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in ' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail rm -f conftest.undefs mv conftest.tail conftest.undefs done rm -f conftest.undefs cat >>$CONFIG_STATUS <<\_ACEOF # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ if test x"$ac_file" = x-; then echo "/* Generated by configure. */" >$tmp/config.h else echo "/* $ac_file. Generated by configure. */" >$tmp/config.h fi cat $tmp/in >>$tmp/config.h rm -f $tmp/in if test x"$ac_file" != x-; then if diff $ac_file $tmp/config.h >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } rm -f $ac_file mv $tmp/config.h $ac_file fi else cat $tmp/config.h rm -f $tmp/config.h fi # Compute $ac_file's index in $config_headers. _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $ac_file | $ac_file:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null || $as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X$ac_file : 'X\(//\)[^/]' \| \ X$ac_file : 'X\(//\)$' \| \ X$ac_file : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X$ac_file | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'`/stamp-h$_am_stamp_count done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # # CONFIG_COMMANDS section. # for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue ac_dest=`echo "$ac_file" | sed 's,:.*,,'` ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_dir=`(dirname "$ac_dest") 2>/dev/null || $as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_dest" : 'X\(//\)[^/]' \| \ X"$ac_dest" : 'X\(//\)$' \| \ X"$ac_dest" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_dest" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 echo "$as_me: executing $ac_dest commands" >&6;} case $ac_dest in depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # So let's grep whole file. if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then dirpart=`(dirname "$mf") 2>/dev/null || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`(dirname "$file") 2>/dev/null || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p $dirpart/$fdir else as_dir=$dirpart/$fdir as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5 echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;} { (exit 1); exit 1; }; }; } # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ;; esac done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi clex-3.15/AUTHORS0000644000076400007640000000025410044160352010372 00000000000000The author of CLEX is Vlado Potisk Many thanks to all the people who have taken the time to submit suggestions for enhancements or problem reports. clex-3.15/COPYING0000644000076400007640000004313310330657313010366 00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. clex-3.15/ChangeLog0000644000076400007640000003300410465364114011104 00000000000000* * * CLEX Revision History * * * 3.15 14-AUG-2006 Problems fixed: - the tilde expansion in the internal cd (change directory) command did not work in CLEX 3.14, the problem has been corrected - the usage of the key in the history panel has been corrected: press to delete the character from the command line and press to delete the entry from the panel - the situation when some external command crashes and leaves the non-blocking flag set on standard input is now properly handled New/improved functionality: - the locate file function was replaced by a more efficient panel filter mechanism. The filtering is available in several panel types (ctrl-F) - some key bindings has been redefined for compatibility reasons: old new move cursor left to next word ctrl-B --> alt-B move cursor right to next word ctrl-W --> alt-F delete word ctrl-D --> alt-D directory panel alt-D --> alt-W bookmark panel alt-B --> alt-K delete until the end of the line ctrl-Y -> ctrl-K complete from the command history ctrl-K --> alt-P main function menu ctrl-G --> alt-M insert the full filename -> ctrl-A - (for emacs users) ctrl-G has now the same meaning as ctrl-C (cancel) - user and group names longer than 8 characters were silently truncated in the file panel, such names are now displayed using the '>' mark - user (alt-U) and group (alt-G) information panels have been added - new panel ( ) that summarizes all completion and insertion functions has been added. Type of the completion can be specified using this panel - completion of commands from the history utilizes the same user interface as the name completion - changes made in the bookmark manager can be cancelled - the input line of the directory panel has no longer precedence over the panel contents. You can switch the focus (indicated by cursor bar's visibility) from the input line to the panel and back - it is no longer possible to execute commands directly from within the history panel. It was easy to make a mistake there and execute other command than intended (panel vs input line) - characters '!' and ':' are automatically quoted only if your shell is a C-shell - there is yet another new option in the directory compare panel - configuration parameter SHELLPROG: standard option -c is appended automatically if it is not specified - configuration parameters CMD_Fn: command parameters $c and $S have been added (cursor position and selected files) - configuration parameters LAYOUTn: there are two new fields: $S and $P (alternative forms of file size and permissions) 3.14 03-NOV-2005 New/improved functionality: - directories can be now bookmarked. Bookmarks are automatically saved to a file. Tools for managing bookmarks are provided in the bookmark panel - new configuration parameter KILOBYTE controls whether filesize is displayed in 1000 or 1024 bytes large units - minor code cleanup 3.13 21-SEP-2005 Problems fixed: - the filename completion routine did not handle correctly the special case when a directory and a command in the search path had the same name. Now both files appear in the completion list New/improved functionality: - the undo function (ctrl-Z) has been improved, several editing steps can be undone and the counterpart editing function redo has been added ctrl-Z = redo 3.12 14-JUN-2005 Problems fixed: - users could not save their configuration. This bug was introduced in the previous release and is now fixed 3.11 17-MAY-2005 Problems fixed: - the sort order of the directory names in the directory panel was not controlled by the configuration parameter COLLATE New/improved functionality: - the panel used for confirmation of the configuration changes has been merged into the configuration panel - new option has been added to the directory compare panel - if a file cannot be read during data comparison, files are marked as different (previously only an unreadability warning was given) - entries from the command history list can be now deleted with the key - pattern history has been removed from the select files function as it was not really helpfull - configuration parameter SHOW HIDDEN has been cancelled - added support for shifted left and right arrow keys 3.10 11-OCT-2004 Numbering scheme change: after 3.1.9 comes 3.10 Problems fixed: - user account data could be incomplete on some systems due to improper initialization - user account data was not updated on systems that do not store this information in /etc/passwd (e.g. with NIS); the user account data cache now expires after 5 minutes. Re-reading of the user account data can be also forced with the key pressed before the re-read command ctrl-R - the number of selected files was not shown correctly after selecting the last file in the panel - improved portability: signal names are printed using strsignal() instead of sys_siglist[] (if strsignal() is supported) - improved portability: GNU make utility is no longer required to build CLEX, standard make is sufficient New/improved functionality: - directory compare function got its own panel which allows finer control over the compare function, press = to activate it. - locate file function ctrl-F has been enhanced, the whole filename is checked for the entered string, not only its beginning - new locate file function ctrl-F has been added, it checks if the filename matches the entered pattern 3.1.9 29-APR-2004 Problems fixed: - name completion could not complete filenames starting with the '=' character - attempt to resize the CLEX window (in X) caused an error when "Press to continue" was displayed on the screen New/improved functionality: - simple 'cd' commands are processed internally, this means that you can write: cd /my/new/directory to change the working directory - configuration of the file panel layout has been revised: - new LAYOUT syntax is more flexible - three different file panel layouts can be stored in the configuration, you can switch between them - new configuration parameters allow better control over language dependent settings like date/time format: FMT_NUMBER, FMT_DATE, FMT_TIME, COLLATION these parameters replace LOCALE - obsolete configuration parameter WARN_CD has been removed - filename completion is able to deal with quoted filenames. Only backslash quoting \x is supported - handling of different formats of device major and minor numbers has been improved - source code has been revised to comply with the ISO C strict aliasing rules 3.1.8 03-MAR-2003 Problems fixed: - configuration parameters C_PANEL_SIZE and D_PANEL_SIZE could not be set to AUTO if AUTO was not the default value New/improved functionality: - on-line help starts with the Table of Contents - command line options --admin, --help, --version are recognized - screen size (columns x lines) is displayed while the CLEX window in X Window System is being resized - new editing command: ctrl-Z - undo last insert or delete operation - new editing command: ctrl-O - insert the target of a symbolic link into the command line - there are now two compare directories functions: - quick compare - compares file names and types - thorough compare - compares also the contents of files (file data) keyboard shortcut = is cancelled to prevent ambiguity - both panels are re-read automatically before doing directory comparison - in the main menu there are now keyboard shortcuts in order to ensure that all file panel functions have a shortcut: ctrl-G + - select all files ctrl-G - - deselect all files ctrl-G Q - quick compare ctrl-G T - thorough compare - a patch that fixes compile problems in the cygwin environment was contributed 3.1.7 15-JAN-2003 Problems fixed: - filename completion ignored broken symlinks - filename completion in the current directory used the file panel's data without refresh, now it scans the directory - ctrl-Z key was not recognized on systems which map it to KEY_SUSPEND New/improved functionality: - ctrl-Z (pressed while a command is being executed) suspends only the launched command, not the CLEX (this feature requires POSIX job control) - history panel displays a remark if a command failed - filename completion panel displays file types - filename completion recognizes the command substitution syntax `command` - configuration parameter DIRECTORIES was replaced by D_PANEL_SIZE with more meaningful semantics, two other parameters were renamed COMPLETIONS -> C_PANEL_SIZE HISTORY -> H_PANEL_SIZE this release recognizes both names. Please save your configuration if CLEX starts with warnings - parameters C_PANEL_SIZE and D_PANEL_SIZE can be set to AUTO (size of one screen without scrolling). AUTO is also the new default value - directory panel does not split the list of directory names into two parts - umask value affects field 'M' (file mode) in the file panel (see LAYOUT in CLEX configuration) - on-line help grammar corrections - help file format was changed to be better human readable - thorough help file consistency checks implemented - substantial reduction of dynamic memory operations - code review and cleanup 3.1.6 23-OCT-2002 Problems fixed: - rm (remove) command warning (configuration parameter WARN_RM) worked unreliably in the history panel New/improved functionality: - to quit CLEX press Q, the redundant X has been abandoned - new function: V - print program version - function keys - and work also in the file locating mode - filename completion of the type name=/some/file is performed only if the 'name' is a single word consisting of letters, digits, and the underscore character '_' 3.1.5 01-JUN-2002 Problems fixed: - command line in the history panel was missing when the history panel was entered from the main menu - problems with /etc/passwd and /etc/group were treated as errors and caused program exit, now only a warning is given New/improved functionality: - the on-line help was compiled into CLEX. The configuration parameter HELPFILE should not be set unless you have a translated or otherwise customized help stored in an external file - there are three new keyboard shortcuts for changing directories: / = root directory ~ = home directory . = parent directory - sorting files by time or size is available in both ascending and descending orders - selected sort order is valid for both file panels - filename completion recognizes shell metacharacters = < > >> | || && & - CLEX uses LFS (Large File Support) if available, LFS allows access to files larger than 2GB 3.1.4 29-APR-2002 New/improved functionality: - the file selection mark '*' is a part of the configurable file panel's layout. If you don't use the default, you should update your LAYOUT configuration parameter - navigation in the directory panel is easier, the most recently used directories are listed separately - the command being executed is shown in the xterm window title - no restart is required for CLEX re-configuration - code review and cleanup 3.1.3 09-MAR-2002 Problems fixed: - the compare directories function = has been rewritten to fix several problems New/improved functionality: - if GROUP_FILES is enabled in the configuration: - the . and .. directories are always on the top - devices can now be grouped together, in such a case they are automatically sorted by their major/minor numbers 3.1.2 10-FEB-2002 Problems fixed: - PROMPT change caused crash 3.1.1 17-JAN-2002 Problems fixed: - crash after editing text in the config panel 3.1.0 15-JAN-2002 Initial release of the 3.1 branch clex-3.15/INSTALL0000644000076400007640000002203010211072075010347 00000000000000Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is free documentation; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. Basic Installation ================== These are generic installation instructions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). It can also use an optional file (typically called `config.cache' and enabled with `--cache-file=config.cache' or simply `-C') that saves the results of its tests to speed up reconfiguring. (Caching is disabled by default to prevent problems with accidental use of stale cache files.) If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If you are using the cache, and at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.ac' (or `configure.in') is used to create `configure' by a program called `autoconf'. You only need `configure.ac' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. If you're using `csh' on an old version of System V, you might need to type `sh ./configure' instead to prevent `csh' from trying to execute `configure' itself. Running `configure' takes awhile. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package. 4. Type `make install' to install the programs and any data files and documentation. 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. Run `./configure --help' for details on some of the pertinent environment variables. You can give `configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you must use a version of `make' that supports the `VPATH' variable, such as GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. If you have to use a `make' that does not support the `VPATH' variable, you have to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. Installation Names ================== By default, `make install' will install the package's files in `/usr/local/bin', `/usr/local/man', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PATH'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you give `configure' the option `--exec-prefix=PATH', the package will use PATH as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=PATH' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Specifying the System Type ========================== There may be some features `configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, `configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the `--build=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the `--target=TYPE' option to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with `--host=TYPE'. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to `configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the `configure' command line, using `VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc will cause the specified gcc to be used as the C compiler (unless it is overridden in the site shell script). `configure' Invocation ====================== `configure' recognizes the following options to control how it operates. `--help' `-h' Print a summary of the options to `configure', and exit. `--version' `-V' Print the version of Autoconf used to generate the `configure' script, and exit. `--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally `config.cache'. FILE defaults to `/dev/null' to disable caching. `--config-cache' `-C' Alias for `--cache-file=config.cache'. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. clex-3.15/NEWS0000644000076400007640000000002407626367620010037 00000000000000NEWS: see ChangeLog clex-3.15/depcomp0000755000076400007640000003305210211072075010701 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects # Copyright 1999, 2000, 2003 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # `libtool' can also be set to `yes' or `no'. if test -z "$depfile"; then base=`echo "$object" | sed -e 's,^.*/,,' -e 's,\.\([^.]*\)$,.P\1,'` dir=`echo "$object" | sed 's,/.*$,/,'` if test "$dir" = "$object"; then dir= fi # FIXME: should be _deps on DOS. depfile="$dir.deps/$base" fi tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the `deleted header file' problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' ' ' < "$tmpdepfile" | ## Some versions of gcc put a space before the `:'. On the theory ## that the space means something, we add a space to the output as ## well. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like `#:fec' to the end of the # dependency line. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr ' ' ' ' >> $depfile echo >> $depfile # The second pass generates a dummy entry for each header file. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> $depfile else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts `$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` tmpdepfile="$stripped.u" if test "$libtool" = yes; then "$@" -Wc,-M else "$@" -M fi stat=$? if test -f "$tmpdepfile"; then : else stripped=`echo "$stripped" | sed 's,^.*/,,'` tmpdepfile="$stripped.u" fi if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi if test -f "$tmpdepfile"; then outname="$stripped.o" # Each line is of the form `foo.o: dependent.h'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler understands `-MD -MF file'. However on # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want: # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using \ : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in `foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1="$dir.libs/$base.lo.d" tmpdepfile2="$dir.libs/$base.d" "$@" -Wc,-MD else tmpdepfile1="$dir$base.o.d" tmpdepfile2="$dir$base.d" "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi if test -f "$tmpdepfile1"; then tmpdepfile="$tmpdepfile1" else tmpdepfile="$tmpdepfile2" fi if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for `:' # in the target name. This is to cope with DOS-style filenames: # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. "$@" $dashmflag | sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' ' ' < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # X makedepend shift cleared=no for arg in "$@"; do case $cleared in no) set ""; shift cleared=yes ;; esac case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix="`echo $object | sed 's/^.*\././'`" touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' ' ' | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o, # because we must use -o when running libtool. "$@" || exit $? IFS=" " for arg do case "$arg" in "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 clex-3.15/install-sh0000755000076400007640000001572210211072075011334 00000000000000#!/bin/sh # # install - install a program, script, or datafile # # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" transformbasename="" transform_arg="" instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" dir_arg="" while [ x"$1" != x ]; do case $1 in -c) instcmd=$cpprog shift continue;; -d) dir_arg=true shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd=$stripprog shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; *) if [ x"$src" = x ] then src=$1 else # this colon is to work around a 386BSD /bin/sh bug : dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "$0: no input file specified" >&2 exit 1 else : fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d "$dst" ]; then instcmd=: chmodcmd="" else instcmd=$mkdirprog fi else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f "$src" ] || [ -d "$src" ] then : else echo "$0: $src does not exist" >&2 exit 1 fi if [ x"$dst" = x ] then echo "$0: no destination specified" >&2 exit 1 else : fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d "$dst" ] then dst=$dst/`basename "$src"` else : fi fi ## this sed command emulates the dirname command dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # this part is taken from Noah Friedman's mkinstalldirs script # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then defaultIFS=' ' IFS="${IFS-$defaultIFS}" oIFS=$IFS # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` IFS=$oIFS pathcomp='' while [ $# -ne 0 ] ; do pathcomp=$pathcomp$1 shift if [ ! -d "$pathcomp" ] ; then $mkdirprog "$pathcomp" else : fi pathcomp=$pathcomp/ done fi if [ x"$dir_arg" != x ] then $doit $instcmd "$dst" && if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dst"; else : ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dst"; else : ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dst"; else : ; fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dst"; else : ; fi else # If we're going to rename the final executable, determine the name now. if [ x"$transformarg" = x ] then dstfile=`basename "$dst"` else dstfile=`basename "$dst" $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename if [ x"$dstfile" = x ] then dstfile=`basename "$dst"` else : fi # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up temp files at exit. trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0 trap '(exit $?); exit' 1 2 13 15 # Move or copy the file name to the temp name $doit $instcmd "$src" "$dsttmp" && # and set any options; do chmod last to preserve setuid bits # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $instcmd $src $dsttmp" command. if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dsttmp"; else :;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dsttmp"; else :;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dsttmp"; else :;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dsttmp"; else :;fi && # Now remove or move aside any old file at destination location. We try this # two ways since rm can't unlink itself on some systems and the destination # file might be busy for other reasons. In this case, the final cleanup # might fail but the new file should still install successfully. { if [ -f "$dstdir/$dstfile" ] then $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null || { echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 (exit 1); exit } else : fi } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" fi && # The final little trick to "correctly" pass the exit status to the exit trap. { (exit 0); exit } clex-3.15/missing0000755000076400007640000002403210211072075010721 00000000000000#! /bin/sh # Common stub for a few missing GNU programs while installing. # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003 Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi case "$1" in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case "$1" in -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch]" ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing 0.4 - GNU automake" ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; aclocal*) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case "$f" in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is needed, and you do not seem to have it handy on your system. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison|yacc) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.h fi ;; esac fi if [ ! -f y.tab.h ]; then echo >y.tab.h fi if [ ! -f y.tab.c ]; then echo 'main() { return 0; }' >y.tab.c fi ;; lex|flex) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if [ ! -f lex.yy.c ]; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` fi if [ -f "$file" ]; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit 1 fi ;; makeinfo) if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then # We have makeinfo, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` fi touch $file ;; tar) shift if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 fi # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error # messages. if (gnutar --version > /dev/null 2>&1); then gnutar "$@" && exit 0 fi if (gtar --version > /dev/null 2>&1); then gtar "$@" && exit 0 fi firstarg="$1" if shift; then case "$firstarg" in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac case "$firstarg" in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 ;; esac fi echo 1>&2 "\ WARNING: I can't seem to be able to run \`tar' with the given arguments. You may want to install GNU tar or Free paxutils, or check the command line arguments." exit 1 ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and you do not seem to have it handy on your system. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 clex-3.15/mkinstalldirs0000755000076400007640000000370410211072075012133 00000000000000#! /bin/sh # mkinstalldirs --- make directory hierarchy # Author: Noah Friedman # Created: 1993-05-16 # Public domain errstatus=0 dirmode="" usage="\ Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..." # process command line arguments while test $# -gt 0 ; do case $1 in -h | --help | --h*) # -h for help echo "$usage" 1>&2 exit 0 ;; -m) # -m PERM arg shift test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } dirmode=$1 shift ;; --) # stop option processing shift break ;; -*) # unknown option echo "$usage" 1>&2 exit 1 ;; *) # first non-opt arg break ;; esac done for file do if test -d "$file"; then shift else break fi done case $# in 0) exit 0 ;; esac case $dirmode in '') if mkdir -p -- . 2>/dev/null; then echo "mkdir -p -- $*" exec mkdir -p -- "$@" fi ;; *) if mkdir -m "$dirmode" -p -- . 2>/dev/null; then echo "mkdir -m $dirmode -p -- $*" exec mkdir -m "$dirmode" -p -- "$@" fi ;; esac for file do set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` shift pathcomp= for d do pathcomp="$pathcomp$d" case $pathcomp in -*) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then errstatus=$lasterr else if test ! -z "$dirmode"; then echo "chmod $dirmode $pathcomp" lasterr="" chmod "$dirmode" "$pathcomp" || lasterr=$? if test ! -z "$lasterr"; then errstatus=$lasterr fi fi fi fi pathcomp="$pathcomp/" done done exit $errstatus # Local Variables: # mode: shell-script # sh-indentation: 2 # End: # mkinstalldirs ends here clex-3.15/clex.spec0000644000076400007640000000173110465603421011140 00000000000000# # CLEX File Manager RPM spec file # Summary: A file manager Name: clex Version: 3.15 Release: 1 License: GPL Group: Applications/File Source: http://www.clex.sk/download/clex-3.15.tar.gz URL: http://www.clex.sk #Packager: PUT YOUR NAME HERE Requires: ncurses BuildRequires: ncurses-devel BuildRoot: %{_tmppath}/%{name}-root %description CLEX is a file manager with a full-screen text-based user interface. It displays directory contents including file status details and provides features like command history, filename insertion, or name completion in order to help the user to construct commands to be executed by the shell. CLEX is easily configurable and its features are explained in the on-line help. %prep %setup -q %build ./configure --bindir=/usr/bin --mandir=/usr/share/man --sysconfdir=/etc make %install make install DESTDIR=%{buildroot} %files %defattr(-,root,root) %{_bindir}/clex %{_mandir}/man1/clex.1.gz %clean [ %{buildroot} != "/" ] && rm -rf %{buildroot} clex-3.15/src/0000777000076400007640000000000010470105531010175 500000000000000clex-3.15/src/Makefile.am0000644000076400007640000000221310416373675012163 00000000000000CLEANFILES = help.inc EXTRA_DIST = clex.1 help_en.hlp BUILT_SOURCES = help.inc AM_CPPFLAGS = -DCONFIG_FILE=\"$(sysconfdir)/clexrc\" bin_PROGRAMS = clex clex_SOURCES = bookmarks.c bookmarks.h cfg.c cfg.h clex.h \ completion.c completion.h control.c control.h \ directory.c directory.h edit.c edit.h exec.c exec.h \ filepanel.c filepanel.h filter.c filter.h help.c help.h \ history.c history.h inout.c inout.h lang.c lang.h list.c list.h \ match.c match.h panel.c panel.h \ sdstring.c sdstring.h select.c select.h signals.c signals.h \ sort.c sort.h start.c tty.c tty.h undo.c undo.h \ userdata.c userdata.h ustring.c ustring.h util.c util.h \ xterm_title.c xterm_title.h # on-line help text -> C language array of structs { text, link } # ignore comments, set VERSION and CONFIG_FILE, quote \ ' " chars help.inc: help_en.hlp sed -e '/^#/d' \ -e 's:@VERSION\@:$(VERSION):g' \ -e 's:@CONFIG_FILE\@:$(sysconfdir)/clexrc:g' \ -e "s:\([\\'\"]\):\\\\\1:g" \ -e 's:\(.*\)@@=\(.*\):#"\1", "\2":' \ -e '/^#/!s:\(.*\):#"\1", 0:' \ -e 's: *":":g' \ -e 's:#\(.*\):{ \1 },:' help_en.hlp > help.inc ### clex manual page ### man_MANS = clex.1 clex-3.15/src/Makefile.in0000644000076400007640000004214010465364130012165 00000000000000# Makefile.in generated by automake 1.9.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ SOURCES = $(clex_SOURCES) srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : bin_PROGRAMS = clex$(EXEEXT) subdir = src DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) am_clex_OBJECTS = bookmarks.$(OBJEXT) cfg.$(OBJEXT) \ completion.$(OBJEXT) control.$(OBJEXT) directory.$(OBJEXT) \ edit.$(OBJEXT) exec.$(OBJEXT) filepanel.$(OBJEXT) \ filter.$(OBJEXT) help.$(OBJEXT) history.$(OBJEXT) \ inout.$(OBJEXT) lang.$(OBJEXT) list.$(OBJEXT) match.$(OBJEXT) \ panel.$(OBJEXT) sdstring.$(OBJEXT) select.$(OBJEXT) \ signals.$(OBJEXT) sort.$(OBJEXT) start.$(OBJEXT) tty.$(OBJEXT) \ undo.$(OBJEXT) userdata.$(OBJEXT) ustring.$(OBJEXT) \ util.$(OBJEXT) xterm_title.$(OBJEXT) clex_OBJECTS = $(am_clex_OBJECTS) clex_LDADD = $(LDADD) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(clex_SOURCES) DIST_SOURCES = $(clex_SOURCES) man1dir = $(mandir)/man1 NROFF = nroff MANS = $(man_MANS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ ac_ct_CC = @ac_ct_CC@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ datadir = @datadir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ CLEANFILES = help.inc EXTRA_DIST = clex.1 help_en.hlp BUILT_SOURCES = help.inc AM_CPPFLAGS = -DCONFIG_FILE=\"$(sysconfdir)/clexrc\" clex_SOURCES = bookmarks.c bookmarks.h cfg.c cfg.h clex.h \ completion.c completion.h control.c control.h \ directory.c directory.h edit.c edit.h exec.c exec.h \ filepanel.c filepanel.h filter.c filter.h help.c help.h \ history.c history.h inout.c inout.h lang.c lang.h list.c list.h \ match.c match.h panel.c panel.h \ sdstring.c sdstring.h select.c select.h signals.c signals.h \ sort.c sort.h start.c tty.c tty.h undo.c undo.h \ userdata.c userdata.h ustring.c ustring.h util.c util.h \ xterm_title.c xterm_title.h ### clex manual page ### man_MANS = clex.1 all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu src/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) clex$(EXEEXT): $(clex_OBJECTS) $(clex_DEPENDENCIES) @rm -f clex$(EXEEXT) $(LINK) $(clex_LDFLAGS) $(clex_OBJECTS) $(clex_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bookmarks.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cfg.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/completion.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/control.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/directory.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/edit.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exec.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filepanel.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filter.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/help.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/history.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inout.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lang.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/list.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/match.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/panel.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sdstring.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/select.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signals.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sort.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/start.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tty.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/undo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/userdata.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ustring.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xterm_title.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` uninstall-info-am: install-man1: $(man1_MANS) $(man_MANS) @$(NORMAL_INSTALL) test -z "$(man1dir)" || $(mkdir_p) "$(DESTDIR)$(man1dir)" @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ else file=$$i; fi; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 1*) ;; \ *) ext='1' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \ done uninstall-man1: @$(NORMAL_UNINSTALL) @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 1*) ;; \ *) ext='1' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \ rm -f "$(DESTDIR)$(man1dir)/$$inst"; \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(PROGRAMS) $(MANS) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-am clean-am: clean-binPROGRAMS clean-generic mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-man install-exec-am: install-binPROGRAMS install-info: install-info-am install-man: install-man1 installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-info-am uninstall-man uninstall-man: uninstall-man1 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic ctags distclean distclean-compile \ distclean-generic distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-exec install-exec-am \ install-info install-info-am install-man install-man1 \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-binPROGRAMS \ uninstall-info-am uninstall-man uninstall-man1 # on-line help text -> C language array of structs { text, link } # ignore comments, set VERSION and CONFIG_FILE, quote \ ' " chars help.inc: help_en.hlp sed -e '/^#/d' \ -e 's:@VERSION\@:$(VERSION):g' \ -e 's:@CONFIG_FILE\@:$(sysconfdir)/clexrc:g' \ -e "s:\([\\'\"]\):\\\\\1:g" \ -e 's:\(.*\)@@=\(.*\):#"\1", "\2":' \ -e '/^#/!s:\(.*\):#"\1", 0:' \ -e 's: *":":g' \ -e 's:#\(.*\):{ \1 },:' help_en.hlp > help.inc # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: clex-3.15/src/bookmarks.c0000644000076400007640000001655610465571544012301 00000000000000/* * * CLEX File Manager * * Copyright (C) 2001-2006 Vlado Potisk * * CLEX is free software without warranty of any kind; see the * GNU General Public License as set out in the "COPYING" document * which accompanies the CLEX File Manager package. * * CLEX can be downloaded from http://www.clex.sk * */ #include #include /* clex.h */ #include /* umask() */ #include /* errno */ #include /* va_list */ #include /* vprint() */ #include /* free() */ #include /* strerror() */ #include "clex.h" #include "bookmarks.h" #include "completion.h" /* compl_file() */ #include "control.h" /* control_loop() */ #include "edit.h" /* edit_setprompt() */ #include "filepanel.h" /* changedir() */ #include "inout.h" /* txt_printf() */ #include "panel.h" /* pan_adjust() */ #include "ustring.h" /* us_reset() */ #include "util.h" /* read_file() */ /* limits to protect resources */ #define BM_FILESIZE_LIMIT 10000 #define BM_ENTRIES_LIMIT 200 static USTRING bm_list[BM_ENTRIES_LIMIT]; /* list of bookmarks */ static int bm_cnt = 0; /* number of bookmarks */ static FLAG changed = 0; /* bookmarks have changed */ static const char *user_bm_file; /* personal bookmarks filename */ static time_t bm_file_mod = 0; /* last modification of the file */ extern int errno; static void bm_error(const char *format, ...) { va_list argptr; txt_printf("BOOKMARKS: Reading the bookmark file \"%s\"\n", user_bm_file); va_start(argptr,format); fputs("BOOKMARKS: ",stdout); vprintf(format,argptr); va_end(argptr); } /* * return value: * -1 = failure, original bookmarks are unchanged * 0 = bookmarks loaded (with or without problems) */ static int read_bm_file(void) { int error; size_t filesize; char *source, *ptr; filesize = BM_FILESIZE_LIMIT; source = read_file(user_bm_file,&filesize,&error); if (source == 0) { switch (error) { case 1: if (errno == ENOENT) { bm_cnt = 0; return 0; /* no file is OK */ } bm_error("Cannot open the file (%s)\n",strerror(errno)); break; case 2: bm_error("File is too big, limit is " STR(BM_FILESIZE_LIMIT) " bytes\n"); break; case 3: bm_error("File read error (%s)\n",strerror(errno)); } return -1; } bm_cnt = 0; for (ptr = source; ptr < source + filesize; ptr++) if (*ptr == '\n') *ptr = '\0'; for (ptr = source; ptr < source + filesize; ) { if (*ptr == '/') { if (bm_cnt == BM_ENTRIES_LIMIT) { bm_error("Too many lines, limit is " STR(BM_ENTRIES_LIMIT) "\n"); break; } us_copy(&bm_list[bm_cnt],ptr); bm_cnt++; } /* advance to the next line */ while (*ptr++) ; } free(source); return 0; } void bm_initialize(void) { int i; time_t mod; panel_bm_lst.bm = panel_bm_mng.bm = bm_list; for (i = 0; i < BM_ENTRIES_LIMIT; i++) US_INIT(bm_list[i]); pathname_set_directory(clex_data.homedir); user_bm_file = estrdup(pathname_join(".clexbm")); mod = mod_time(user_bm_file); if (read_bm_file() == 0) bm_file_mod = mod; } void bm_list_prepare(void) { time_t mod; mod = mod_time(user_bm_file); if (bm_file_mod != mod && read_bm_file() == 0) { bm_file_mod = mod; win_warning("Latest version of the bookmarks was loaded from the file."); } panel_bm_lst.pd->cnt = bm_cnt; if (panel_bm_lst.pd->curs < 0) panel_bm_lst.pd->curs = panel_bm_lst.pd->top = panel_bm_lst.pd->min; /* otherwise leave the cursor where it was */ panel = panel_bm_lst.pd; textline = 0; } void bm_mng_prepare(void) { panel_bm_mng.pd->cnt = bm_cnt; panel_bm_mng.pd->top = panel_bm_mng.pd->curs = panel_bm_mng.pd->min; panel = panel_bm_mng.pd; textline = 0; } void bm_edit_prepare(void) { /* panel = panel_bm_mng.pd; */ textline = &line_tmp; edit_setprompt(textline,"bookmark: "); edit_nu_putstr(USTR(bm_list[panel_bm_mng.pd->curs])); } static void bm_save(void) { int i; FLAG errflag; FILE *fp; umask(clex_data.umask | 022); fp = fopen(user_bm_file,"w"); umask(clex_data.umask); if (fp == 0) { win_warning("BOOKMARKS: Cannot open the bookmark file " "for writing."); return; } fprintf(fp, "#\n" "# CLEX bookmark file\n" "#\n"); for (i = 0; i < bm_cnt; i++) fprintf(fp,"%s\n",USTR(bm_list[i])); errflag = ferror(fp) != 0; if (fclose(fp) || errflag) win_warning("BOOKMARKS: File write error occurred."); else { win_remark("bookmark file updated"); changed = 0; } bm_file_mod = mod_time(user_bm_file); } void cx_bm_list_bookmark(void) { const char *dir; int i; dir = USTR(ppanel_file->dir); for (i = 0; i < bm_cnt; i++) if (strcmp(USTR(bm_list[i]),dir) == 0) { win_remark("already bookmarked"); panel_bm_lst.pd->curs = i; pan_adjust(panel_bm_lst.pd); win_panel(); return; } if (bm_cnt == BM_ENTRIES_LIMIT) { win_warning("Bookmark list is full."); return; } us_copy(&bm_list[bm_cnt],dir); panel_bm_lst.pd->curs = bm_cnt; panel_bm_lst.pd->cnt = ++bm_cnt; pan_adjust(panel_bm_lst.pd); win_panel(); changed = 1; bm_save(); } void cx_bm_list_enter(void) { if (changedir(USTR(bm_list[panel_bm_lst.pd->curs])) == 0) next_mode = MODE_SPECIAL_RETURN; } void cx_bm_mng_revert(void) { time_t mod; if (!changed) { win_remark("no changes were made"); return; } bm_cnt = 0; mod = mod_time(user_bm_file); if (read_bm_file() == 0) { bm_file_mod = mod; changed = 0; win_remark("bookmarks reverted to previous state"); } panel_bm_mng.pd->cnt = bm_cnt; win_panel(); } void cx_bm_mng_save(void) { if (changed) bm_save(); if (next_mode == 0) next_mode = MODE_SPECIAL_RETURN; /* otherwise next_mode is already set by EXTRA_LINE table */ } void cx_bm_mng_edit(void) { control_loop(MODE_BM_EDIT); win_panel_opt(); } void cx_bm_edit_enter(void) { if (*USTR(textline->line) != '/') { win_warning("Directory name must start with a slash / . "); return; } us_xchg(&textline->line,&bm_list[panel_bm_mng.pd->curs]); changed = 1; next_mode = MODE_SPECIAL_RETURN; } void cx_bm_edit_compl(void) { if (compl_file(COMPL_TYPE_DIRPANEL) < 0) win_remark("COMPLETION: please type at least the " "first character"); } void cx_bm_mng_up(void) { int pos; if ((pos = panel_bm_mng.pd->curs) == 0) return; us_xchg(&bm_list[pos],&bm_list[panel_bm_mng.pd->curs = pos - 1]); changed = 1; win_panel(); } void cx_bm_mng_down(void) { int pos; if ((pos = panel_bm_mng.pd->curs) == bm_cnt - 1) return; us_xchg(&bm_list[pos],&bm_list[panel_bm_mng.pd->curs = pos + 1]); changed = 1; win_panel(); } void cx_bm_mng_del(void) { int i, del; USTRING x; del = panel_bm_mng.pd->curs; panel_bm_mng.pd->cnt = --bm_cnt; if (panel_bm_mng.pd->curs == bm_cnt) { panel_bm_mng.pd->curs--; pan_adjust(panel_bm_mng.pd); } /* these are struct copy operations */ x = bm_list[del]; for (i = del; i < bm_cnt; i++) bm_list[i] = bm_list[i + 1]; bm_list[bm_cnt] = x; changed = 1; win_panel(); } void cx_bm_mng_new(void) { int i, ins; USTRING x; if (bm_cnt == BM_ENTRIES_LIMIT) { win_warning("Bookmark list is full."); return; } LIMIT_MIN(panel_bm_mng.pd->curs,-1); ins = ++panel_bm_mng.pd->curs; /* these are struct copy operations */ x = bm_list[bm_cnt]; for (i = bm_cnt; i > ins; i--) bm_list[i] = bm_list[i - 1]; bm_list[ins] = x; panel_bm_mng.pd->cnt = ++bm_cnt; us_copy(&bm_list[ins],"-- new bookmark --"); changed = 1; pan_adjust(panel_bm_mng.pd); win_panel(); us_copy(&bm_list[ins],"/"); cx_bm_mng_edit(); } clex-3.15/src/bookmarks.h0000644000076400007640000000101010465571434012257 00000000000000extern void bm_initialize(void); extern void bm_list_prepare(void); extern void bm_mng_prepare(void); extern void bm_edit_prepare(void); extern void cx_bm_list_enter(void); extern void cx_bm_list_bookmark(void); extern void cx_bm_mng_edit(void); extern void cx_bm_mng_save(void); extern void cx_bm_mng_revert(void); extern void cx_bm_mng_up(void); extern void cx_bm_mng_down(void); extern void cx_bm_mng_del(void); extern void cx_bm_mng_new(void); extern void cx_bm_edit_enter(void); extern void cx_bm_edit_compl(void); clex-3.15/src/cfg.c0000644000076400007640000005062410442752026011031 00000000000000/* * * CLEX File Manager * * Copyright (C) 2001-2006 Vlado Potisk * * CLEX is free software without warranty of any kind; see the * GNU General Public License as set out in the "COPYING" document * which accompanies the CLEX File Manager package. * * CLEX can be downloaded from http://www.clex.sk * */ #include #include /* mode_t */ #include /* stat() */ #include /* errno */ #include /* open() */ #include /* sprintf() */ #include /* strchr() */ #include /* stat() */ #include "clex.h" #include "cfg.h" #include "completion.h" /* completion_reconfig() */ #include "control.h" /* control_loop() */ #include "directory.h" /* dir_reconfig() */ #include "edit.h" /* edit_putstr() */ #include "exec.h" /* exec_shell_reconfig() */ #include "help.h" /* help_reconfig() */ #include "history.h" /* hist_reconfig() */ #include "inout.h" /* win_remark() */ #include "list.h" /* list_reconfig() */ #include "sort.h" /* sort_files() */ #include "ustring.h" /* USTR() */ #include "util.h" /* estrdup() */ #include "xterm_title.h"/* xterm_reconfig() */ #define CFG_LINES_LIMIT 100 /* config file size limit (in lines) */ #define CFG_ERRORS_LIMIT 12 /* error limit */ extern int errno; static const char *user_config_file; /* personal cfg filename */ /* used in error handling: */ static const char *cfgfile; /* name of the current cfg file */ static int cfgerror; /* error counter */ typedef struct { CODE code; /* CFG_XXX */ const char *extra_val; /* if defined - name of special value (represented as 0) */ int min, max, initial, current, new; /* values */ const char *desc[4]; /* if defined - show this text instead of numbers (enumerated type) */ } CNUM; static CNUM table_numeric[] = { /* enumerated */ { CFG_CMD_LINES, 0, 2, 4, 2, 0, 0, { "2 screen lines", "3 screen lines", "4 screen lines" } }, { CFG_KILOBYTE, 0, 0, 1, 0, 0, 0, { "1 KiB is 1024 bytes (IEC standard)", "1 KB is 1000 bytes (SI standard)" } }, { CFG_FMT_NUMBER, 0, 0, 2, 0, 0, 0, { "AUTO (according to the current locale)", "1.000.000 (dot separated)", "1,000,000 (comma separated)" } }, { CFG_FMT_TIME, 0, 0, 2, 0, 0, 0, { "AUTO (according to the current locale)", "12 hour clock", "24 hour clock" } }, { CFG_COLLATION, 0, 0, 1, 1, 0, 0, { "byte order (based on the character codes)", "dictionary order (based on the human language)" } }, { CFG_FRAME, 0, 0, 2, 0, 0, 0, { "-----", "=====", "line graphics (not supported on some terminals)" } }, { CFG_GROUP_FILES, 0, 0, 2, 2, 0, 0, { "Do not group", "Group: directories, special files, plain files", "Group: directories, devices, special files, plain files" } }, { CFG_LAYOUT, 0, 0, 2, 0, 0, 0, { "Layout #1", "Layout #2", "Layout #3" } }, { CFG_WARN_RM, 0, 0, 1, 1, 0, 0, { "No", "Yes" } }, { CFG_WARN_LONG, 0, 0, 1, 1, 0, 0, { "No", "Yes" } }, { CFG_WARN_SELECT, 0, 0, 1, 1, 0, 0, { "No", "Yes" } }, { CFG_XTERM_TITLE, 0, 0, 2, 1, 0, 0, { "No", "AUTO (checking the terminal type $TERM)", "Yes" } }, /* really numeric */ { CFG_C_SIZE, "AUTO", 10, 100, 0, 0, 0, { 0 } }, { CFG_D_SIZE, "AUTO", 10, 100, 0, 0, 0, { 0 } }, { CFG_H_SIZE, 0, 10, 100, 40, 0, 0, { 0 } } }; typedef struct { CODE code; /* CFG_XXX */ const char *extra_val; /* if defined - name of special value (represented as "") */ char *initial; char current[CFGVALUE_LEN + 1], new[CFGVALUE_LEN + 1]; } CSTR; static CSTR table_string[] = { { CFG_CMD_F3, 0, "more $f", "", "" }, { CFG_CMD_F4, 0, "vi $f", "", "" }, { CFG_CMD_F5, 0, "cp -ir $f $2", "", "" }, { CFG_CMD_F6, 0, "mv -i $f $2", "", "" }, { CFG_CMD_F7, 0, "mkdir ", "", "" }, { CFG_CMD_F8, 0, "rm $f", "", "" }, { CFG_CMD_F9, 0, "lpr $f", "", "" }, { CFG_CMD_F10, 0, "", "", "" }, { CFG_CMD_F11, 0, "", "", "" }, { CFG_CMD_F12, 0, "", "", "" }, { CFG_DIR2, "HOME", "", "", "" }, { CFG_FMT_DATE, "AUTO", "", "", "" }, { CFG_HELPFILE, "NONE", "", "", "" }, { CFG_LAYOUT1, 0, "$d $S $>$t $M $*| $p $o $L", "", "" }, { CFG_LAYOUT2, 0, "$d $S $t $*| $p $o", "", "" }, { CFG_LAYOUT3, 0, "$p $o $s $d $>$t $*| mode=$m atime=$a ctime=$i links=$l", "", "" }, { CFG_PROMPT, "AUTO", "", "", "" }, { CFG_QUOTE, 0, "", "", "" }, { CFG_SHELLPROG, "AUTO", "", "", "" } }; /* * help - everything in one place and alphabetically sorted for easy editing, * text should fit on minimal width screen */ static struct { CODE code; char *help; } table_help[CFG_VARIABLES] = { { CFG_C_SIZE, "Completion panel size (AUTO = screen size)" }, { CFG_CMD_F3, "Command F3 = view file(s)" }, { CFG_CMD_F4, "Command F4 = edit file(s)" }, { CFG_CMD_F5, "Command F5 = copy file(s)" }, { CFG_CMD_F6, "Command F6 = move file(s)" }, { CFG_CMD_F7, "Command F7 = make directory" }, { CFG_CMD_F8, "Command F8 = remove file(s)" }, { CFG_CMD_F9, "Command F9 = print file(s)" }, { CFG_CMD_F10, "Command F10 = user defined" }, { CFG_CMD_F11, "Command F11 = user defined" }, { CFG_CMD_F12, "Command F12 = user defined" }, { CFG_CMD_LINES, "Appearance: " "How many lines are occupied by the input line" }, { CFG_COLLATION, "Appearance: Filename collation sequence" }, { CFG_D_SIZE, "Directory panel size (AUTO = screen size)" }, { CFG_DIR2, "Secondary file panel's initial directory " "(HOME = home dir)" }, { CFG_FRAME, "Appearance: " "Panel frame: ----- or ===== or line graphics" }, { CFG_FMT_DATE, "Appearance: " "Format: date (e.g. dMy, y/m/d), or AUTO" }, { CFG_FMT_NUMBER, "Appearance: Format: thousands separator" }, { CFG_FMT_TIME, "Appearance: Format: 12/24 hour clock" }, { CFG_GROUP_FILES, "Appearance: " "Group files of the same type together" }, { CFG_H_SIZE, "History panel size" }, { CFG_HELPFILE, "External helpfile " "(NONE = use built-in help instead)" }, { CFG_KILOBYTE, "Appearance: Filesize unit definition" }, { CFG_LAYOUT, "Appearance: " "Which file panel layout is active" }, { CFG_LAYOUT1, "Appearance: File panel layout #1, see help" }, { CFG_LAYOUT2, "Appearance: File panel layout #2" }, { CFG_LAYOUT3, "Appearance: File panel layout #3" }, { CFG_PROMPT, "Appearance: " "Command line prompt (AUTO = according to shell)" }, { CFG_QUOTE, "Additional filename chars to be quoted, " "see help" }, { CFG_SHELLPROG, "Shell program, see help " "(AUTO = your login shell)" }, { CFG_WARN_RM, "Warn before executing 'rm' (remove) command" }, { CFG_WARN_LONG, "Warn that the command line is too long to be " "displayed" }, { CFG_WARN_SELECT, "Remind that you have selected some files" }, { CFG_XTERM_TITLE, "Appearance: " "Change the X terminal window title" } }; static CONFIG_ENTRY config[CFG_VARIABLES] = { /* do not exceed max length of CFGVAR_LEN */ { "FRAME", 0,0,0,0,0 }, { "CMD_LINES", 0,0,0,0,0 }, { "XTERM_TITLE", 0,0,0,0,0 }, { "GROUP_FILES", 0,0,0,0,0 }, { "PROMPT", 0,0,0,0,0 }, { "LAYOUT1", 0,0,0,0,0 }, { "LAYOUT2", 0,0,0,0,0 }, { "LAYOUT3", 0,0,0,0,0 }, { "ACTIVE_LAYOUT", 0,0,0,0,0 }, { "KILOBYTE", 0,0,0,0,0 }, { "FMT_NUMBER", 0,0,0,0,0 }, { "FMT_TIME", 0,0,0,0,0 }, { "FMT_DATE", 0,0,0,0,0 }, { "COLLATION", 0,0,0,0,0 }, { "SHELLPROG", 0,0,0,0,0 }, { "CMD_F3", 0,0,0,0,0 }, { "CMD_F4", 0,0,0,0,0 }, { "CMD_F5", 0,0,0,0,0 }, { "CMD_F6", 0,0,0,0,0 }, { "CMD_F7", 0,0,0,0,0 }, { "CMD_F8", 0,0,0,0,0 }, { "CMD_F9", 0,0,0,0,0 }, { "CMD_F10", 0,0,0,0,0 }, { "CMD_F11", 0,0,0,0,0 }, { "CMD_F12", 0,0,0,0,0 }, { "WARN_RM", 0,0,0,0,0 }, { "WARN_LONG", 0,0,0,0,0 }, { "WARN_SELECT", 0,0,0,0,0 }, { "DIR2", 0,0,0,0,0 }, { "HELPFILE", 0,0,0,0,0 }, { "QUOTE", 0,0,0,0,0 }, { "C_PANEL_SIZE", 0,0,0,0,0 }, { "D_PANEL_SIZE", 0,0,0,0,0 }, { "H_PANEL_SIZE", 0,0,0,0,0 } }; /* must exactly match CFG_XXX #defines */ /* 'move' values MOV_X2Y understood by set_value() */ #define MOV_SRC_CURRENT 1 #define MOV_SRC_INITIAL 2 #define MOV_SRC_NEW 4 #define MOV_DST_CURRENT 8 #define MOV_DST_NEW 16 #define MOV_N2C (MOV_SRC_NEW | MOV_DST_CURRENT) #define MOV_C2N (MOV_SRC_CURRENT | MOV_DST_NEW) #define MOV_I2N (MOV_SRC_INITIAL | MOV_DST_NEW) #define MOV_I2C (MOV_SRC_INITIAL | MOV_DST_CURRENT) static void set_value(int code, int move) { int src_num, *dst_num; const char *src_str; char *dst_str; CNUM *pnum; CSTR *pstr; if (config[code].isnum) { pnum = config[code].table; if (move & MOV_SRC_CURRENT) src_num = pnum->current; else if (move & MOV_SRC_INITIAL) src_num = pnum->initial; else src_num = pnum->new; if (move & MOV_DST_CURRENT) dst_num = &pnum->current; else dst_num = &pnum->new; *dst_num = src_num; } else { pstr = config[code].table; if (move & MOV_SRC_CURRENT) src_str = pstr->current; else if (move & MOV_SRC_INITIAL) src_str = pstr->initial; else src_str = pstr->new; if (move & MOV_DST_CURRENT) dst_str = pstr->current; else dst_str = pstr->new; strcpy(dst_str,src_str); } } static CONFIG_ENTRY * get_variable(const char *var) { int i; for (i = 0; i < CFG_VARIABLES; i++) if (strcmp(config[i].var,var) == 0) return config + i; return 0; } static CNUM * get_numeric(int code) { int i; for (i = 0; i < ARRAY_SIZE(table_numeric); i++) if (table_numeric[i].code == code) return table_numeric + i; return 0; } static CSTR * get_string(int code) { int i; for (i = 0; i < ARRAY_SIZE(table_string); i++) if (table_string[i].code == code) return table_string + i; return 0; } static const char * get_help(int code) { int i; const char *helpstr; for (i = 0; i < CFG_VARIABLES; i++) if (table_help[i].code == code) { helpstr = table_help[i].help; if (strlen(helpstr) > MIN_COLS - 4) err_exit("BUG: help string \"%s\" too long\n",helpstr); return helpstr; } return 0; } static void config_error_init(const char *filename) { cfgfile = filename; cfgerror = 0; } static void config_error(int line, const char *errmsg) { if (cfgerror == 0) txt_printf("CONFIG: Parsing configuration file \"%s\"\n", cfgfile); fputs("CONFIG: ",stdout); if (line > 0) printf("Line %d: ",line); puts(errmsg); if (++cfgerror > CFG_ERRORS_LIMIT) err_exit("CONFIG: Too many errors"); } static void read_configuration(const char *file, int setdefaults) { FILE *fp; char buff[CFGVAR_LEN + CFGVALUE_LEN + 16], *value; int len, ilen, nvalue, line; struct stat fst; CONFIG_ENTRY *pce; CNUM *pnum; CSTR *pstr; config_error_init(file); /* few basic checks */ if (stat(file,&fst) < 0 ) { /* it is OK if the file is missing */ if (errno != ENOENT) config_error(0,"File is unreadable"); return; } if ((fst.st_mode & S_IWOTH) == S_IWOTH) { /* little bit of security */ config_error(0,"File is unsafe (world-writable), skipped"); return; } if (!S_ISREG(fst.st_mode)) { /* sanity check */ config_error(0,"This is not a plain file"); return; } /* * yes, there is a race condition here, but the checks * above are merely detecting stupid mistakes */ fp = fopen(file,"r"); if (fp == 0) { config_error(0,"File is unreadable"); return; } for (line = 1; fgets(buff,sizeof(buff),fp); line++) { if (line > CFG_LINES_LIMIT) { config_error(line, "file is too long, skipping the rest of this file"); break; } /* ignore comments */ if (buff[0] == '\n' || buff[0] == '#' || buff[0] == '\0' /* can fgets() return empty string ? */) continue; /* strip newline */ len = strlen(buff) - 1; if (buff[len] != '\n') { config_error(line, "line is too long, skipping the rest of this file"); break; /* why bother to recover ? */ } buff[len] = '\0'; /* split VARIABLE and VALUE */ if ( (value = strchr(buff,'=')) == 0) { config_error(line, "incorrect syntax, format: VARIABLE=VALUE"); continue; } *value++ = '\0'; len -= value - buff; pce = get_variable(buff); if (pce == 0) { config_error(line,"unknown variable"); continue; } if (pce->isnum) { pnum = pce->table; if (sscanf(value," %d %n",&nvalue,&ilen) < 1 || ilen != len) config_error(line,"invalid number"); else if ((nvalue < pnum->min || nvalue > pnum->max) && (nvalue != 0 || pnum->extra_val == 0)) config_error(line,"numeric value out of range"); else if (setdefaults) pnum->initial = nvalue; else pnum->current = nvalue; } else { pstr = pce->table; if (len > CFGVALUE_LEN) config_error(line,"string value is too long"); else if (setdefaults) pstr->initial = estrdup(value); else strcpy(pstr->current,value); } } if (ferror(fp)) config_error(0,"File read error"); fclose(fp); } void config_initialize(void) { int i, fd; CNUM *pnum; CSTR *pstr; /* initialize 'config' & 'pcfg' tables */ for (i = 0; i < CFG_VARIABLES; i++) { if ( (pnum = get_numeric(i)) ) { config[i].isnum = 1; config[i].table = pnum; pcfg[i] = &pnum->current; } else if ( (pstr = get_string(i)) ) { config[i].table = pstr; pcfg[i] = &pstr->current; } else err_exit("BUG: config variable not defined (code %d)",i); if ( (config[i].help = get_help(i)) == 0) err_exit("BUG: no help for config variable (code %d)",i); } if (clex_data.admin) { /* * check user's access rights * this may create an empty file, never mind */ umask(022); fd = open(CONFIG_FILE,O_WRONLY | O_CREAT,0644); umask(clex_data.umask); if (fd < 0) err_exit( "You are not allowed to create/modify the system-wide\n" " configuration file \"%s\" (%s)", CONFIG_FILE,strerror(errno)); close(fd); /* initialize, read defaults */ for (i = 0; i < CFG_VARIABLES; i++) set_value(i,MOV_I2C); read_configuration(CONFIG_FILE,0); } else { /* user's configuration file name */ pathname_set_directory(clex_data.homedir); user_config_file = estrdup(pathname_join(".clexrc")); /* read defaults, initialize, read config */ read_configuration(CONFIG_FILE,1); for (i = 0; i < CFG_VARIABLES; i++) set_value(i,MOV_I2C); read_configuration(user_config_file,0); } panel_cfg.config = config; } /* the 'new' value in readable text form */ const char * config_print_value(int i) { static char buff[16]; CNUM *pnum; CSTR *pstr; /* string */ if (!config[i].isnum) { pstr = config[i].table; if (pstr->extra_val != 0 && *pstr->new == '\0') return pstr->extra_val; return pstr->new; } /* numeric */ pnum = config[i].table; if (pnum->extra_val != 0 && pnum->new == 0) return pnum->extra_val; if (pnum->desc[0]) /* numeric - enumerated */ return pnum->desc[pnum->new - pnum->min]; /* really numeric */ sprintf(buff,"%d",pnum->new); return buff; } static void config_save(void) { int i; FLAG errflag; FILE *fp; if (clex_data.admin) { umask(022); fp = fopen(CONFIG_FILE,"w"); } else { umask(clex_data.umask | 022); fp = fopen(user_config_file,"w"); } umask(clex_data.umask); if (fp == 0) { win_warning("CONFIG: Cannot open configuration file " "for writing."); return; } fprintf(fp, "#\n" "# CLEX configuration file\n" "#\n"); for (i = 0; i < CFG_VARIABLES; i++) if (config[i].saveit) { if (config[i].isnum) fprintf(fp,"%s=%d\n",config[i].var, ((CNUM *)config[i].table)->new); else fprintf(fp,"%s=%s\n",config[i].var, ((CSTR *)config[i].table)->new); } errflag = ferror(fp) != 0; if (fclose(fp) || errflag) win_warning("CONFIG: File write error occurred."); else win_remark("configuration saved"); } void config_prepare(void) { int i; for (i = 0; i < CFG_VARIABLES; i++) set_value(i,MOV_C2N); panel_cfg.pd->top = panel_cfg.pd->curs = panel_cfg.pd->min; panel = panel_cfg.pd; textline = 0; } void config_edit_num_prepare(void) { static char prompt[CFGVAR_LEN + 48]; CNUM *pnum; /* inherited panel = panel_cfg.pd */ pnum = config[panel_cfg.pd->curs].table; textline = &line_tmp; sprintf(prompt,"%s (range: %d - %d%s%s): ", config[panel_cfg.pd->curs].var,pnum->min,pnum->max, pnum->extra_val != 0 ? " or " : "", pnum->extra_val != 0 ? pnum->extra_val : ""); edit_setprompt(textline,prompt); edit_nu_putstr(config_print_value(panel_cfg.pd->curs)); } void config_edit_str_prepare(void) { static char prompt[CFGVAR_LEN + 32]; CSTR *pstr; /* inherited panel = panel_cfg.pd */ pstr = config[panel_cfg.pd->curs].table; textline = &line_tmp; sprintf(prompt,"%s (%d chars max%s%s): ", config[panel_cfg.pd->curs].var,CFGVALUE_LEN, pstr->extra_val != 0 ? " or " : "", pstr->extra_val != 0 ? pstr->extra_val : ""); edit_setprompt(textline,prompt); edit_nu_putstr(config_print_value(panel_cfg.pd->curs)); } void cx_config_num_enter(void) { int nvalue, ilen; CNUM *pnum; pnum = config[panel_cfg.pd->curs].table; if (pnum->extra_val != 0 && strcmp(USTR(textline->line),pnum->extra_val) == 0) { pnum->new = 0; next_mode = MODE_SPECIAL_RETURN; return; } if (sscanf(USTR(textline->line)," %d %n",&nvalue,&ilen) < 1 || ilen != textline->size) win_remark("numeric value required"); else if (nvalue < pnum->min || nvalue > pnum->max) win_remark("value is out of range"); else { pnum->new = nvalue; next_mode = MODE_SPECIAL_RETURN; } } void cx_config_str_enter(void) { CSTR *pstr; pstr = config[panel_cfg.pd->curs].table; if (pstr->extra_val != 0 && strcmp(USTR(textline->line),pstr->extra_val) == 0) { *pstr->new = '\0'; next_mode = MODE_SPECIAL_RETURN; return; } if (textline->size > CFGVALUE_LEN) win_remark("string is too long"); else { strcpy(pstr->new,USTR(textline->line)); next_mode = MODE_SPECIAL_RETURN; } } void cx_config_default(void) { set_value(panel_cfg.pd->curs,MOV_I2N); win_panel_opt(); } void cx_config_original(void) { set_value(panel_cfg.pd->curs,MOV_C2N); win_panel_opt(); } /* detect what has changed */ static void config_changes(void) { int i; CNUM *pnum; CSTR *pstr; for (i = 0; i < CFG_VARIABLES; i++) if (config[i].isnum) { pnum = config[i].table; config[i].changed = pnum->new != pnum->current; config[i].saveit = pnum->new != pnum->initial; } else { pstr = config[i].table; config[i].changed = strcmp(pstr->new,pstr->current) != 0; config[i].saveit = strcmp(pstr->new,pstr->initial) != 0; } } static void config_apply(void) { int i; FLAG reread, sort, prompt; for (i = 0; i < CFG_VARIABLES; i++) if (config[i].changed) set_value(i,MOV_N2C); reread = sort = prompt = 0; if (config[CFG_FRAME].changed) { win_frame_reconfig(); win_frame(); } if (config[CFG_CMD_LINES].changed) /* all it takes is to say it ... isn't it magic ?! */ txt_printf("SCREEN: changing geometry\n"); if (config[CFG_XTERM_TITLE].changed) { xterm_title_restore(); xterm_title_reconfig(); xterm_title_set(0,0); } if (config[CFG_GROUP_FILES].changed || config[CFG_COLLATION].changed) sort = 1; if (config[CFG_PROMPT].changed) prompt = 1; if (config[CFG_LAYOUT].changed || config[CFG_LAYOUT1].changed || config[CFG_LAYOUT2].changed || config[CFG_LAYOUT3].changed) { win_layout_reconfig(); reread = 1; } if (config[CFG_FMT_NUMBER].changed || config[CFG_FMT_TIME].changed || config[CFG_FMT_DATE].changed || config[CFG_KILOBYTE].changed) reread = 1; if (config[CFG_SHELLPROG].changed) { exec_shell_reconfig(); prompt = 1; } if (config[CFG_HELPFILE].changed) help_reconfig(); if (config[CFG_C_SIZE].changed) completion_reconfig(); if (config[CFG_D_SIZE].changed) dir_reconfig(); if (config[CFG_H_SIZE].changed) hist_reconfig(); if (prompt) exec_prompt_reconfig(); if (sort && !reread) { /* sort the primary panel */ filepos_save(); sort_files(); filepos_set(); /* sort the secondary panel */ /* * warning: during the sorting of the secondary panel, * the primary panel does not correspond with the current * working directory */ ppanel_file = ppanel_file->other; filepos_save(); sort_files(); filepos_set(); ppanel_file = ppanel_file->other; } else if (reread) { ppanel_file->other->expired = 1; list_reconfig(); list_directory(); } /* xxx_reconfigure() might have suspended curses mode */ if (!display.curses) curses_restart(); } void cx_config_admin_save(void) { config_changes(); config_save(); } void cx_config_save(void) { /* cursor -2 = ACCEPT, -1 = SAVE */ config_changes(); config_apply(); if (panel_cfg.pd->curs == -1) config_save(); } void cx_config_enter(void) { CNUM *pnum; if (config[panel_cfg.pd->curs].isnum) { pnum = config[panel_cfg.pd->curs].table; if (pnum->desc[0]) { if (++pnum->new > pnum->max) pnum->new = pnum->min; } else control_loop(MODE_CFG_EDIT_NUM); } else control_loop(MODE_CFG_EDIT_TXT); win_panel_opt(); } clex-3.15/src/cfg.h0000644000076400007640000000120010407352404011015 00000000000000extern void config_initialize(void); extern void config_prepare(void); extern void config_edit_num_prepare(void); extern void config_edit_str_prepare(void); extern const char *config_print_value(int); extern void cx_config_enter(void); extern void cx_config_num_enter(void); extern void cx_config_str_enter(void); extern void cx_config_default(void); extern void cx_config_original(void); extern void cx_config_save(void); extern void cx_config_admin_save(void); #define config_num(X) (*(const int *)pcfg[X]) #define config_str(X) ((const char *)pcfg[X]) #define config_layout \ ((const char *)pcfg[CFG_LAYOUT1 + config_num(CFG_LAYOUT)]) clex-3.15/src/clex.h0000644000076400007640000003737410442752432011242 00000000000000/* * * CLEX File Manager * * Copyright (C) 2001-2006 Vlado Potisk * * CLEX is free software without warranty of any kind; see the * GNU General Public License as set out in the "COPYING" document * which accompanies the CLEX File Manager package. * * CLEX can be downloaded from http://www.clex.sk * */ /* * naming convention for strings and buffers: * #define XXX_STR is a buffer size, i.e. with the trailing null byte * #define XXX_LEN is max string length, i.e. without the null byte */ /* useful macros */ #define ARRAY_SIZE(X) (sizeof(X) / sizeof(X[0])) #define TSET(X) ((X) ? 1 : ((X) = 1, 0)) /* test & set */ #define TCLR(X) ((X) ? ((X) = 0, 1) : 0) /* test & clear */ #define LIMIT_MIN(X,MIN) do if ((X) < (MIN)) (X) = (MIN); while(0) #define LIMIT_MAX(X,MAX) do if ((X) > (MAX)) (X) = (MAX); while(0) #define CH_ESC '\033' /* ASCII escape */ #define CH_CTRL(X) ((X) & 0x1F) /* ASCII ctrl-X */ #define IS_CHAR(X) (((X) & 0xFF) == (X)) /* X is a char */ /* CMP: no overflow and result is an int even if V1 and V2 are not */ #define CMP(V1,V2) ((V1) == (V2) ? 0 : (V1) < (V2) ? -1 : 1) /* you can't do this in one pass: */ #define STR(X) STRINGIZE(X) #define STRINGIZE(X) #X /* replacement function */ extern char *my_strerror(int); /* in util.c */ /* typedefs */ typedef unsigned short int FLAG; /* true or false */ typedef short int CODE; /* usually some #define-d value */ /* minimal required screen size */ #define MIN_COLS 64 #define MIN_LINES 12 /* * operation modes: * value 0 is reserved, it means mode unchanged in control_loop() * and also mode not set during startup */ #define MODE_BM_LIST 1 #define MODE_BM_MANAGER 2 #define MODE_BM_EDIT 3 #define MODE_CFG 4 #define MODE_CFG_EDIT_NUM 5 #define MODE_CFG_EDIT_TXT 6 #define MODE_COMPL 7 #define MODE_COMPARE 8 #define MODE_DESELECT 9 #define MODE_DIR 10 #define MODE_DIR_SPLIT 11 #define MODE_FILE 12 #define MODE_GROUP 13 #define MODE_HELP 14 #define MODE_HIST 15 #define MODE_MAINMENU 16 #define MODE_PASTE 17 #define MODE_SELECT 18 #define MODE_SORT 19 #define MODE_USER 20 /* pseudo-modes */ #define MODE_SPECIAL_QUIT 98 #define MODE_SPECIAL_RETURN 99 /* see sdstring.c for details */ #define SDSTRING_LEN 15 typedef struct { char *SDname; /* string if long, otherwise null */ char SDmem[SDSTRING_LEN + 1]; /* string if short */ } SDSTRING; /* see ustring.c for details */ typedef struct { char *USstr; /* space to hold some character string */ size_t USalloc; /* size of the allocated memory */ } USTRING; /* info about screen display/layout/appearance */ typedef struct { FLAG curses; /* curses active */ FLAG wait; /* a message has been written to the text-mode screen, wait for a keypress before starting curses */ int scrcols; /* number of columns */ int pancols; /* number of columns in the panel area */ int scrlines; /* number of lines */ int panlines; /* number of lines in the panel area */ int textline_area; /* number of chars available for the textline (including the prompt) */ int date_len; /* length of date/time field */ } DISPLAY; typedef struct { const char *login_at_host; /* my name: user@host */ char *shell; /* my login shell */ const char *homedir; /* my home directory */ pid_t pid; /* process ID */ mode_t umask; /* umask value */ FLAG isroot; /* effective uid is 0(root) */ FLAG admin; /* admin mode: clex -a */ CODE shelltype; /* Bourne shell (0), C-shell (1), other (2) */ } CLEX_DATA; /* description of an editing operation */ # define OP_NONE 0 /* no change (cursor movement is OK) */ # define OP_INS 1 /* simple insert */ # define OP_DEL 2 /* simple deletion */ # define OP_CHANGE 3 /* modification other than insert or delete */ typedef struct { int code; /* one of OP_XXX defined above */ /* 'pos' and 'len' are used with OP_INSERT and OP_DELETE only */ int pos; /* position within the edited string */ int len; /* length of the inserted/deleted part */ } EDIT_OP; #define UNDO_LEVELS 10 /* undo steps */ /* line of text where the user can enter and edit his/her input */ typedef struct { const char *prompt; /* prompt */ int promptlen; /* prompt length */ USTRING line; /* user's input */ int size; /* number of chars in the line */ int curs; /* cursor position from 0 to 'size' */ int offset; /* offset - when the line is too long, first 'offset' characters are hidden */ /* values for the UNDO function */ struct { USTRING save_line; int save_size; int save_curs; int save_offset; } undo [UNDO_LEVELS]; /* used in a circular manner */ int undo_base; /* index of the first entry */ int undo_levels; /* occupied entries for undo */ int redo_levels; /* free entries usable for redo */ EDIT_OP last_op; /* last editing operation */ } TEXTLINE; /* minimalistic version of TEXTLINE */ /* currently used only for panel filters */ #define INPUT_STR 25 typedef struct { char line[INPUT_STR]; /* user's input */ int size; /* number of chars in the line */ int curs; /* cursor position from 0 to 'size' */ FLAG changed; /* 'line' has been modified */ } INPUTLINE; /********************************************************************/ /* * panel types * if you change this, you must also update * the draw_panel_line() in inout.c */ #define PANEL_TYPE_BM 0 #define PANEL_TYPE_CFG 1 #define PANEL_TYPE_COMPARE 2 #define PANEL_TYPE_COMPL 3 #define PANEL_TYPE_DIR 4 #define PANEL_TYPE_DIR_SPLIT 5 #define PANEL_TYPE_FILE 6 #define PANEL_TYPE_GROUP 7 #define PANEL_TYPE_HELP 8 #define PANEL_TYPE_HIST 9 #define PANEL_TYPE_MAINMENU 10 #define PANEL_TYPE_PASTE 11 #define PANEL_TYPE_SORT 12 #define PANEL_TYPE_USER 13 #define PANEL_TYPE_NONE 99 /* not set (only during startup) */ /* * extra lines appear in a panel before the real first line, * extra lines: -MIN .. -1 * real lines: 0 .. MAX */ typedef struct { const char *text; /* text to be displayed in the panel */ /* default (if null): "Leave this panel" */ const char *info; /* text to be displayed in the info line */ /* when this extra line is selected: */ CODE mode_next; /* set next_mode to this mode and then ... */ void (*fn)(void); /* ... invoke this function */ } EXTRA_LINE; /* description of a panel */ typedef struct { int cnt, top; /* panel lines: total count, top of the screen */ int curs, min; /* panel lines: cursor bar, top of the panel */ /* * 'min' is used to insert extra lines before the real first line * which is always line number 0; to insert N extra lines set * 'min' to -N; the number of extra lines is not included in 'cnt' */ CODE type; /* panel type: one of PANEL_TYPE_XXX */ FLAG norev; /* do not show the current line in reversed video */ EXTRA_LINE *extra; /* extra panel lines */ INPUTLINE *filter; /* filter (if applicable to this panel type) */ CODE filtering; /* filter: 0 = off */ /* 1 = on - focus on the filter string */ /* 2 = on - focus on the command line */ } PANEL_DESC; #define VALID_CURSOR(P) ((P)->cnt > 0 && (P)->curs >= 0 && (P)->curs < (P)->cnt) /********************************************************************/ /* * file types recognized in the file panel, * if you change this, you must also update * the names of the types in inout.c */ #define FT_PLAIN_FILE 0 #define FT_PLAIN_EXEC 1 #define FT_PLAIN_SUID 2 #define FT_PLAIN_SUID_ROOT 3 #define FT_PLAIN_SGID 4 #define FT_DIRECTORY 5 #define FT_DIRECTORY_MNT 6 #define FT_DEV_BLOCK 7 #define FT_DEV_CHAR 8 #define FT_FIFO 9 #define FT_SOCKET 10 #define FT_OTHER 11 #define FT_NA 12 /* file type tests */ #define IS_FT_PLAIN(X) ((X) >= 0 && (X) <= 4) #define IS_FT_EXEC(X) ((X) >= 1 && (X) <= 4) #define IS_FT_DIR(X) ((X) >= 5 && (X) <= 6) #define IS_FT_DEV(X) ((X) >= 7 && (X) <= 8) /* * if you change any of the FE_XXX_STR #defines, you must change * the corresponding stat2xxx() function in list.c accordingly */ /* text buffer sizes */ /* examples: */ #define FE_LINKS_STR 4 /* 1 999 max */ #define FE_TIME_STR 12 /* 12:34am 1.01.04 01-jan-2004 */ #define FE_SIZE_DEV_STR 12 /* 3.222.891Ki */ #define FE_MODE_STR 5 /* 0644 */ #define FE_NAME_STR 10 /* root */ #define FE_OWNER_STR (2 * FE_NAME_STR) /* root:mail */ /* * file description - exhausting, isn't it ? * we allocate many of these, bitfields save memory */ typedef struct { SDSTRING file; /* file name */ USTRING link; /* where the symbolic link points to */ const char *extension; /* file name extension (suffix) */ time_t mtime; /* last file modification */ off_t size; /* file size */ dev_t devnum; /* major/minor numbers (devices only) */ CODE file_type; /* one of FT_XXX */ uid_t uid, gid; /* owner and group */ short int mode12; /* file mode - low 12 bits */ unsigned int select:1; /* flag: this entry is selected */ unsigned int symlink:1; /* flag: it is a symbolic link */ unsigned int dotdir:2; /* . (1) or .. (2) directory */ unsigned int fmatch:1; /* flag: matches the filter */ /* * note: the structure members below are used * only when the file panel layout requires them */ unsigned int normal_mode:1; /* file mode same as "normal" file */ unsigned int links:1; /* has multiple hard links */ char atime_str[FE_TIME_STR]; /* access time */ char ctime_str[FE_TIME_STR]; /* inode change time */ char mtime_str[FE_TIME_STR]; /* file modification time */ char links_str[FE_LINKS_STR]; /* number of links */ char mode_str[FE_MODE_STR]; /* file mode - octal number */ char owner_str[FE_OWNER_STR]; /* owner and group */ char size_str[FE_SIZE_DEV_STR]; /* file size or dev major/minor */ } FILE_ENTRY; typedef struct ppanel_file { PANEL_DESC *pd; USTRING dir; /* working directory */ struct ppanel_file *other; /* primary <--> secondary panel ptr */ int selected; /* number of selected entries */ FLAG expired; /* expiration: panel needs re-read */ FLAG filtype; /* filter type: 0 = substring, 1 = pattern */ int filt_cnt; /* saved number of entries while filtering is on */ int filt_sel; /* selected entries NOT matched by the filter */ int fe_alloc; /* allocated FILE_ENTRies in 'files' below */ FILE_ENTRY **files; /* main part: list of files in panel's working directory 'dir' */ } PANEL_FILE; /* * filter off: 0 .. cnt-1 = all file entries * filter on: 0 .. cnt-1 = entries matching the filter expression * cnt .. filtcnt-1 = saved entries not matching the filter */ /********************************************************************/ typedef struct { PANEL_DESC *pd; USTRING *bm; } PANEL_BM; /********************************************************************/ /* * file sort order - if you change this, you must also update * panel initization in start.c and descriptions in inout.c */ #define SORT_NAME 0 #define SORT_SUFFIX 1 #define SORT_SIZE 2 #define SORT_SIZE_REV 3 #define SORT_TIME 4 #define SORT_TIME_REV 5 #define SORT_EMAN 6 /* Name <--> emaN */ typedef struct { PANEL_DESC *pd; CODE order; /* file sort order: one of SORT_XXX */ } PANEL_SORT; /********************************************************************/ typedef struct { const char *name; /* directory name (see also shlen) */ int shlen; /* PANEL_DIR: length of the repeating name part (used for fancy formatting) PANEL_DIR_SPLIT: length of the string 'name' which is NOT null terminated */ } DIR_ENTRY; typedef struct { PANEL_DESC *pd; DIR_ENTRY *dir; /* list of directories to choose from */ } PANEL_DIR, PANEL_DIR_SPLIT; /********************************************************************/ /* * configuration variables, * if you change this, you must also update * the config[] array in cfg.c */ #define CFG_VARIABLES 34 /* appearance */ #define CFG_FRAME 0 #define CFG_CMD_LINES 1 #define CFG_XTERM_TITLE 2 #define CFG_GROUP_FILES 3 #define CFG_PROMPT 4 #define CFG_LAYOUT1 5 #define CFG_LAYOUT2 6 #define CFG_LAYOUT3 7 #define CFG_LAYOUT 8 #define CFG_KILOBYTE 9 #define CFG_FMT_NUMBER 10 #define CFG_FMT_TIME 11 #define CFG_FMT_DATE 12 #define CFG_COLLATION 13 /* command execution */ #define CFG_SHELLPROG 14 #define CFG_CMD_F3 15 #define CFG_CMD_F4 16 #define CFG_CMD_F5 17 #define CFG_CMD_F6 18 #define CFG_CMD_F7 19 #define CFG_CMD_F8 20 #define CFG_CMD_F9 21 #define CFG_CMD_F10 22 #define CFG_CMD_F11 23 #define CFG_CMD_F12 24 #define CFG_WARN_RM 25 #define CFG_WARN_LONG 26 #define CFG_WARN_SELECT 27 /* other */ #define CFG_DIR2 28 #define CFG_HELPFILE 29 #define CFG_QUOTE 30 #define CFG_C_SIZE 31 #define CFG_D_SIZE 32 #define CFG_H_SIZE 33 /* max string lengths */ #define CFGVAR_LEN 16 /* name */ #define CFGVALUE_LEN 60 /* string value */ typedef struct { const char *var; /* name of the variable */ const char *help; /* one line help */ void *table; /* -> internal table with details */ unsigned int isnum:1; /* is numeric (not string) */ unsigned int changed:1; /* value changed */ unsigned int saveit:1; /* value should be saved to disk */ } CONFIG_ENTRY; typedef struct { PANEL_DESC *pd; CONFIG_ENTRY *config; /* list of all configuration variables */ } PANEL_CFG; /********************************************************************/ typedef struct { USTRING cmd; /* command text */ FLAG failed; /* command failed or not */ } HIST_ENTRY; typedef struct { PANEL_DESC *pd; HIST_ENTRY **hist; /* list of previously executed commands */ } PANEL_HIST; /********************************************************************/ typedef struct { const char *txt; /* help text to be displayed */ const char *aux; /* additional data: link or page heading */ } HELP_ENTRY; typedef struct { PANEL_DESC *pd; CODE pagenum; /* internal number of current page */ const char *heading; /* heading of the current help page */ HELP_ENTRY *line; } PANEL_HELP; /********************************************************************/ typedef struct { SDSTRING str; /* name suitable for a completion */ FLAG is_link; /* filenames only: it is a symbolic link */ CODE file_type; /* filenames only: one of FT_XXX */ const char *aux; /* additional information (info line) */ } COMPL_ENTRY; typedef struct { PANEL_DESC *pd; FLAG filenames; /* names are names of files */ const char *description; /* completion type - as a string */ COMPL_ENTRY *candidate; /* menu of completion candidates */ } PANEL_COMPL; /********************************************************************/ typedef struct { PANEL_DESC *pd; /* no additional data */ } PANEL_MENU; /********************************************************************/ typedef struct { uid_t uid; const char *login; const char *gecos; } USER_ENTRY; typedef struct { PANEL_DESC *pd; USER_ENTRY *users; int usr_alloc; /* allocated entries in 'users' */ } PANEL_USER; typedef struct { gid_t gid; const char *group; } GROUP_ENTRY; typedef struct { PANEL_DESC *pd; GROUP_ENTRY *groups; int grp_alloc; /* allocated entries in 'groups' */ } PANEL_GROUP; /********************************************************************/ /* global variables */ extern const void *pcfg[CFG_VARIABLES]; extern DISPLAY display; extern CLEX_DATA clex_data; extern TEXTLINE *textline; /* -> active line */ extern TEXTLINE line_cmd, line_dir, line_tmp; extern PANEL_DESC *panel; /* -> description of the active panel */ extern PANEL_FILE *ppanel_file; extern PANEL_CFG panel_cfg; extern PANEL_BM panel_bm_lst, panel_bm_mng; extern PANEL_COMPL panel_compl; extern PANEL_DIR panel_dir; extern PANEL_DIR_SPLIT panel_dir_split; extern PANEL_GROUP panel_group; extern PANEL_HELP panel_help; extern PANEL_HIST panel_hist; extern PANEL_MENU panel_mainmenu, panel_compare, panel_paste; extern PANEL_SORT panel_sort; extern PANEL_USER panel_user; extern CODE next_mode; /* see control.c comments */ clex-3.15/src/completion.c0000644000076400007640000004611610460107374012444 00000000000000/* * * CLEX File Manager * * Copyright (C) 2001-2006 Vlado Potisk * * CLEX is free software without warranty of any kind; see the * GNU General Public License as set out in the "COPYING" document * which accompanies the CLEX File Manager package. * * CLEX can be downloaded from http://www.clex.sk * */ #include #include /* time_t */ #include /* stat() */ #include /* isalnum() */ #include /* errno */ #include /* qsort() */ #include /* strcmp() */ #include /* time() */ #include /* stat() */ /* readdir() */ #ifdef HAVE_DIRENT_H # include #else # define dirent direct # ifdef HAVE_SYS_NDIR_H # include # endif # ifdef HAVE_SYS_DIR_H # include # endif # ifdef HAVE_NDIR_H # include # endif #endif #include "clex.h" #include "completion.h" #include "cfg.h" /* config_num() */ #include "control.h" /* control_loop() */ #include "edit.h" /* edit_update() */ #include "history.h" /* get_hist_entry() */ #include "inout.h" /* win_waitmsg() */ #include "list.h" /* stat2type() */ #include "sdstring.h" /* SDSTR() */ #include "userdata.h" /* username_find() */ #include "ustring.h" /* USTR() */ #include "util.h" /* emalloc() */ /* internal use only */ #define COMPL_TYPE_PATHCMD 40 /* search $PATH */ #define COMPL_TYPE_USERDIR 50 /* with trailing slash (~name/) */ /* environment completion */ extern char **environ; static SDSTRING *env_var; /* environment variable names */ static int env_cnt = 0; /* number of environment variables */ /* * commands are stored in several linked lists depending on * the first character. It is more effective than sorting. */ #define LIST_NR(ch) ((ch) >= 'a' && (ch) <= 'z' ? (ch) - 'a' : 26) #define LISTS 27 typedef struct cmd { SDSTRING cmd; /* command name */ struct cmd *next; /* linked list ptr */ } CMD; /* PATHDIR holds info about commands in a $PATH directory */ typedef struct { const char *dir; /* PATH directory name */ time_t timestamp; /* time of last successfull directory scan, or 0 */ dev_t device; /* device/inode from stat() */ ino_t inode; CMD *commands[LISTS]; /* lists of commands in this directory */ } PATHDIR; static PATHDIR *pd_list; /* list of PATHDIRs */ static int pd_cnt = 0; /* number od PATHDIRs in pd_list */ /* input: completion request data */ static struct { CODE type; /* type of completion - one of COMPL_TYPE_XXX */ const char *str; /* string to be completed */ size_t strlen; /* length of 'str' */ const char *dir; /* directory to attempt the completion in */ size_t dirlen; /* length of 'dir' */ } rq; /* output: completion results */ static struct { FLAG filenames; /* names are filenames */ FLAG quote; /* quote names when inserting */ int cnt; /* number of completion candidates */ int err; /* errno value (if cnt is zero) */ size_t clen; /* how many characters following 'str' are the same for all candidates */ char first_char[256]; /* map: first characters following 'str'*/ } compl; /* output: candidates */ #define CC_LIST (panel_compl.candidate) static int cc_alloc = 0; /* max number of candidates in CC_LIST */ static int cc_max; /* max number of candidates to present */ static FLAG done; /* done: completion not possible or full (not partial) name was completed */ extern int errno; static void environ_completion_init(void) { int i; const char *src; size_t len; for (env_cnt = 0; environ[env_cnt];) env_cnt++; if (env_cnt == 0) return; /* no environment ?! */ env_var = emalloc(env_cnt * sizeof(SDSTRING)); for (i = 0; i < env_cnt; i++) { src = environ[i]; for (len = 0; src[len] != '=' && src[len] != '\0';) len++; SD_INIT(env_var[i]); sd_copyn(&env_var[i],src,len); } } static void command_completion_init(void) { char *path, *p; int i, list; if ( (path = getenv("PATH")) == 0) return; /* split PATH to components */ for (pd_cnt = 1, p = path = estrdup(path); *p; p++) if (*p == ':') { *p = '\0'; pd_cnt++; } pd_list = emalloc(pd_cnt * sizeof(PATHDIR)); for (i = 0, p = path; i < pd_cnt; i++) { pd_list[i].dir = *p ? p : "."; pd_list[i].timestamp = 0; for (list = 0; list < LISTS; list++) pd_list[i].commands[list] = 0; while (*p++) ; } } void completion_initialize(void) { command_completion_init(); environ_completion_init(); completion_reconfig(); } void completion_reconfig(void) { int i; if (cc_alloc > 0) { for (i = 0; i < cc_alloc; i++) sd_reset(&CC_LIST[i].str); free(CC_LIST); } cc_max = cc_alloc = config_num(CFG_C_SIZE); if (cc_max == 0) /* C_PANEL_SIZE = AUTO */ cc_alloc = 100; /* enough for every screen */ CC_LIST = emalloc(cc_alloc * sizeof(COMPL_ENTRY)); for (i = 0; i < cc_alloc; i++) SD_INIT(CC_LIST[i].str); } static const char * code2string(int type, int uppercase) { int i; const char *uc; static char lc[24]; switch (type) { case COMPL_TYPE_FILE: uc = "FILENAME"; break; case COMPL_TYPE_DIR: uc = "DIRECTORY NAME"; break; case COMPL_TYPE_PATHCMD: case COMPL_TYPE_CMD: case COMPL_TYPE_HIST: uc = "COMMAND"; break; case COMPL_TYPE_USER: case COMPL_TYPE_USERDIR: uc = "USER NAME"; break; case COMPL_TYPE_ENV: uc = "ENVIRONMENT VARIABLE"; break; default: return ""; } if (uppercase) return uc; for (i = 0; uc[i]; i++) lc[i] = tolower((unsigned char)uc[i]); lc[i] = '\0'; return lc; } static int qcmp1(const void *e1, const void *e2) { return STRCOLL( SDSTR(((COMPL_ENTRY *)e1)->str), SDSTR(((COMPL_ENTRY *)e2)->str)); } static int qcmp2(const void *e1, const void *e2) { return strcmp( SDSTR(((COMPL_ENTRY *)e1)->str), SDSTR(((COMPL_ENTRY *)e2)->str)); } void compl_prepare(void) { panel_compl.pd->cnt = compl.cnt; panel_compl.pd->top = panel_compl.pd->min; panel_compl.pd->curs = rq.type == COMPL_TYPE_HIST ? 0 : panel_compl.pd->min; panel_compl.filenames = compl.filenames; panel_compl.description = code2string(rq.type,1); if (rq.type != COMPL_TYPE_HIST) qsort(CC_LIST,compl.cnt,sizeof(COMPL_ENTRY), config_num(CFG_COLLATION) ? qcmp1 : qcmp2); else win_remark("commands are shown in order of their execution (recent first)"); panel = panel_compl.pd; /* textline inherited from previous mode */ } static void register_candidate(const char *cand, int is_link, int file_type, const char *aux) { size_t i; static const char *cand0; if (rq.type == COMPL_TYPE_PATHCMD && IS_FT_EXEC(file_type)) /* check for duplicates like awk in both /bin and /usr/bin */ for (i = 0; i < compl.cnt && i < cc_max; i++) if (strcmp(SDSTR(CC_LIST[i].str),cand) == 0 && IS_FT_EXEC(CC_LIST[i].file_type)) return; if (compl.cnt < cc_max) { sd_copy(&CC_LIST[compl.cnt].str,cand); CC_LIST[compl.cnt].is_link = is_link; CC_LIST[compl.cnt].file_type = file_type; CC_LIST[compl.cnt].aux = aux; } compl.first_char[cand[rq.strlen] & 0xFF] = 1; if (compl.cnt == 0) { cand0 = SDSTR(CC_LIST[0].str); /* cand0 = cand; is wrong */ compl.clen = strlen(cand0) - rq.strlen; } else for (i = 0; i < compl.clen ; i++) if (cand[rq.strlen + i] != cand0[rq.strlen + i]) { compl.clen = i; break; } compl.cnt++; } static void complete_environ(void) { int i; for (i = 0; i < env_cnt; i++) if (rq.strlen == 0 || strncmp(SDSTR(env_var[i]),rq.str,rq.strlen) == 0) register_candidate(SDSTR(env_var[i]),0,0,environ[i]); } static void complete_history() { int i; const HIST_ENTRY *ph; for (i = 0; (ph = get_history_entry(i)); i++) if (strncmp(USTR(ph->cmd),rq.str,rq.strlen) == 0) register_candidate(USTR(ph->cmd),0,0, ph->failed ? "this command failed last time" : 0); } static void complete_username(void) { const char *login, *fullname; username_find_init(rq.str,rq.strlen); while ( (login = username_find(&fullname)) ) register_candidate(login,0,0,fullname); } static void complete_file(void) { FLAG is_link; CODE type; const char *file, *path; struct stat st; struct dirent *direntry; DIR *dd; if ( (dd = opendir(rq.dir)) == 0) { compl.err = errno; return; } win_waitmsg(); pathname_set_directory(rq.dir); while ( ( direntry = readdir(dd)) ) { file = direntry->d_name; if (rq.strlen == 0) { if (file[0] == '.') { if (file[1] == '\0') continue; if (file[1] == '.' && file[2] == '\0') continue; } } else if (strncmp(file,rq.str,rq.strlen)) continue; if (lstat(path = pathname_join(file),&st) < 0) continue; /* file just deleted ? */ if ( (is_link = S_ISLNK(st.st_mode)) && stat(path,&st) < 0) type = FT_NA; else type = stat2type(st.st_mode,st.st_uid); if (rq.type == COMPL_TYPE_DIR && !IS_FT_DIR(type)) continue; /* must be a directory */ if (rq.type == COMPL_TYPE_CMD && !IS_FT_DIR(type) && !IS_FT_EXEC(type)) continue; /* must be a directory or executable */ if (rq.type == COMPL_TYPE_PATHCMD && !IS_FT_EXEC(type)) continue; /* must be an executable */ register_candidate(file,is_link,type, rq.type == COMPL_TYPE_PATHCMD ? rq.dir : 0); } closedir(dd); } static void pathcmd_refresh(PATHDIR *ppd) { FLAG stat_ok; int list; const char *file; struct dirent *direntry; struct stat st; DIR *dd; CMD *pc; /* * fstat(dirfd()) instead of stat() followed by opendir() * would be a cleaner solution, but dirfd() is an extension * not available on some systems */ stat_ok = stat(ppd->dir,&st) == 0; if (stat_ok && st.st_mtime < ppd->timestamp && st.st_dev == ppd->device && st.st_ino == ppd->inode) return; /* clear all command lists */ for (list = 0; list < LISTS; list++) { while ( (pc = ppd->commands[list]) ) { ppd->commands[list] = pc->next; sd_reset(&pc->cmd); free(pc); } } ppd->timestamp = time(0); if (!stat_ok || (dd = opendir(ppd->dir)) == 0) { ppd->timestamp = 0; return; } ppd->device = st.st_dev; ppd->inode = st.st_ino; win_waitmsg(); while ( (direntry = readdir(dd)) ) { file = direntry->d_name; list = LIST_NR(*file); pc = emalloc(sizeof(CMD)); SD_INIT(pc->cmd); sd_copy(&pc->cmd,file); pc->next = ppd->commands[list]; ppd->commands[list] = pc; } closedir(dd); } static void complete_pathcmd(void) { FLAG is_link; CODE file_type; int i, list; const char *file, *path; CMD *pc; PATHDIR *ppd; struct stat st; /* include subdirectories of the current directory */ rq.type = COMPL_TYPE_DIR; complete_file(); rq.type = COMPL_TYPE_PATHCMD; list = LIST_NR(*rq.str); for (i = 0; i < pd_cnt; i++) { ppd = &pd_list[i]; if (*ppd->dir == '/') { /* absolute PATH directories are cached */ pathcmd_refresh(ppd); pathname_set_directory(ppd->dir); for (pc = ppd->commands[list]; pc; pc = pc->next) { file = SDSTR(pc->cmd); if (strncmp(file,rq.str,rq.strlen) != 0) continue; if (lstat(path = pathname_join(file),&st) < 0) continue; if ( (is_link = S_ISLNK(st.st_mode)) && stat(path,&st) < 0) continue; file_type = stat2type(st.st_mode,st.st_uid); if (!IS_FT_EXEC(file_type)) continue; register_candidate(file,is_link,file_type,ppd->dir); } } else { /* relative PATH directories are impossible to cache */ rq.dir = ppd->dir; complete_file(); } } } static void complete_it(void) { int i; size_t len; static USTRING dequote_str = { 0, 0 }, dequote_dir = { 0, 0 }; /* C_PANEL_SIZE = AUTO */ if (config_num(CFG_C_SIZE) == 0) { /* * substract extra lines and leave the bottom * line empty to show there is no need to scroll */ cc_max = display.panlines + panel_compl.pd->min - 1; LIMIT_MAX(cc_max,cc_alloc); } /* dequote 'str' + add terminating null byte */ us_setsize(&dequote_str,rq.strlen + 1); len = dequote_txt(rq.str,rq.strlen,USTR(dequote_str)); rq.str = USTR(dequote_str); rq.strlen = len; /* dequote 'dir' + add terminating null byte (not for "." and "/") */ if (rq.dirlen != 1 || rq.dir[1] != '\0') { us_setsize(&dequote_dir,rq.dirlen + 1); len = dequote_txt(rq.dir,rq.dirlen,USTR(dequote_dir)); rq.dir = USTR(dequote_dir); rq.dirlen = len; } compl.cnt = 0; compl.err = 0; compl.quote = 0; compl.filenames = 0; for (i = 0; i < 256; i++) compl.first_char[i] = 0; if (rq.type == COMPL_TYPE_ENV) complete_environ(); else if (rq.type == COMPL_TYPE_USER || rq.type == COMPL_TYPE_USERDIR) complete_username(); else if (rq.type == COMPL_TYPE_HIST) complete_history(); else { compl.filenames = 1; if (textline == &line_cmd) compl.quote = 1; /* in command line only */ if (rq.type == COMPL_TYPE_PATHCMD) complete_pathcmd(); else /* FILE, DIR, CMD completion */ complete_file(); } } static void insert_candidate(int i) { done = 1; edit_nu_insertstr(SDSTR(CC_LIST[i].str) + rq.strlen,compl.quote); if ((compl.filenames && IS_FT_DIR(CC_LIST[i].file_type)) || rq.type == COMPL_TYPE_USERDIR /* ~user is a directory */ ) { edit_nu_insertchar('/'); done = 0; /* a directory may have subdirectories */ } else if (rq.type == COMPL_TYPE_HIST) /* leave it as it is */; else if (USTR(textline->line)[textline->curs] == ' ') textline->curs++; else edit_nu_insertchar(' '); edit_update(); } static void show_results(void) { static SDSTRING common = { 0, "" }; const char *errmsg; if (compl.cnt == 0) { done = 1; switch (compl.err) { case 0: errmsg = " (no match)"; break; case EACCES: errmsg = " (permission denied)"; break; case ENOENT: errmsg = " (no such directory)"; break; default: errmsg = ""; } win_remark_fmt("cannot complete that %s%s", code2string(rq.type,0),errmsg); return; } if (compl.cnt == 1) { insert_candidate(0); return; } if (compl.clen) { /* insert the common part of all candidates */ sd_copyn(&common,SDSTR(CC_LIST[0].str) + rq.strlen,compl.clen); edit_insertstr(SDSTR(common),compl.quote); /* * pretend that the string to be completed already contains * the chars just inserted */ rq.strlen += compl.clen; /* 'compl.first_char' map is no longer valid */ } if (compl.cnt <= cc_max) { control_loop(MODE_COMPL); return; } /* show at least the following character */ win_completion(compl.cnt,compl.clen ? 0 : compl.first_char); } /* * check name=/some/file syntax, name should be [A-Za-z0-9_]+ * * line -> the whole line * peq -> the '=' character */ static int check_eq_syntax(const char *line, const char *peq) { char ch; const char *p; if (peq == line || peq[-1] == ' ') return 0; for (p = peq - 1; p > line; p--) { ch = *p; if (ch == ' ') break; if (ch != '_' && (ch < 'A' || ch > 'Z') && (ch < 'a' || ch > 'z') && (ch < '0' || ch > '9')) return 0; } return 1; } /* * check backtick (`) syntax: * return 1 for opening backtick and 0 for closing backtick * (quoting issues ignored) */ static int check_bt_syntax(const char *line, const char *pbt) { FLAG ok; const char *p; ok = 1; for (p = line; p < pbt; p++) if (*p == '`') ok = !ok; return ok; } static int is_sep(int ch) { return ch == ' ' || ch == ';' || ch == '&' || ch == '|'; } /* * compl_file() attempts to complete the partial text in * the command line * * return value: * =0 = completion process completed (successfully or not) * <0 = nothing to complete (current word is an empty string): * -1 = first word (usually the command) * -2 = not the first word (usually one of the arguments) */ int compl_file(int type) { int first; /* it is the first word of the command */ char ch, *p, *pslash, *pstart, *pend, *plinestart, *plineend; done = 0; /* * plinestart -> start of the input line * plineend -> trailing null byte of the input line * pstart -> start of the string to be completed * pend -> position immediately after the last character of the string * pslash -> last slash '/' in string (if any) */ plinestart = USTR(textline->line); plineend = plinestart + textline->size; if (type == COMPL_TYPE_DIRPANEL || type == COMPL_TYPE_HIST) { first = 1; pstart = plinestart; pend = plineend; } else { for (first = -1, pstart = plinestart + textline->curs; first < 0;) { if (pstart == plinestart) first = 1; /* beginning of line */ else if ((ch = pstart[-1]) == ' ') { for (p = pstart; first < 0; p--) { if (p == plinestart) first = 1; else if ((ch = p[-1]) != ' ') first = is_sep((unsigned char)ch); } } else if (ch == '<' || ch == '>' || (ch == '=' && check_eq_syntax(plinestart,pstart - 1))) first = 0; /* I/O redirection or name=value */ else if (is_sep((unsigned char)ch)) first = 1; /* after a command separator */ else if (ch == '`') { if (!check_bt_syntax(plinestart,pstart - 1)) { win_remark("cannot complete after `command`"); done = 1; return 0; } first = 1; /* inside `command` */ } else pstart--; } for (pend = plinestart + textline->curs; pend < plineend; pend++) if (is_sep((unsigned char)(ch = *pend)) || ch == '<' || ch == '>') break; } if (pstart == pend) { /* nothing to complete */ done = 1; return first ? -1 : -2; } for (pslash = 0, p = pend; p > pstart;) if (*--p == '/') { pslash = p; break; } /* move cursor to the end of the current word */ textline->curs = pend - plinestart; edit_update_cursor(); /* set rq.dir, rq.dirlen, rq.str */ if (pslash == 0 || type == COMPL_TYPE_ENV || type == COMPL_TYPE_USER || type == COMPL_TYPE_USERDIR || type == COMPL_TYPE_HIST ) { rq.str = pstart; rq.dir = "."; rq.dirlen = 1; } else { rq.str = pslash + 1; if (*pstart == '~') { *pslash = '\0'; rq.dir = dir_tilde(pstart); rq.dirlen = strlen(rq.dir); *pslash = '/'; } else if (pstart == pslash) { rq.dir = "/"; rq.dirlen = 1; } else { rq.dir = pstart; rq.dirlen = pslash - pstart; } } if (type != COMPL_TYPE_AUTO && type != COMPL_TYPE_DIRPANEL) { /* completion type was set by the user */ rq.type = type; if (type == COMPL_TYPE_CMD && pslash == 0) rq.type = COMPL_TYPE_PATHCMD; else if (type == COMPL_TYPE_USER && *rq.str == '~') rq.str++; else if (type == COMPL_TYPE_ENV && *rq.str == '$') rq.str++; } else if (pslash == 0) { if (*pstart == '~') { rq.str++; rq.type = COMPL_TYPE_USERDIR; } else if (type == COMPL_TYPE_DIRPANEL) rq.type = COMPL_TYPE_DIR; else if (*pstart == '$') { rq.str++; rq.type = COMPL_TYPE_ENV; } else rq.type = first ? COMPL_TYPE_PATHCMD : COMPL_TYPE_FILE; } else if (type == COMPL_TYPE_DIRPANEL) rq.type = COMPL_TYPE_DIR; else rq.type = first ? COMPL_TYPE_CMD : COMPL_TYPE_FILE; rq.strlen = pend - rq.str; complete_it(); show_results(); return 0; } void cx_compl_complete(void) { insert_candidate(panel_compl.pd->curs); next_mode = MODE_SPECIAL_RETURN; } static void complete_type(int type) { if (compl_file(type)) win_remark("there is nothing to complete"); if (done && get_current_mode() != MODE_FILE) next_mode = MODE_SPECIAL_RETURN; } void cx_complete_auto(void) { complete_type(COMPL_TYPE_AUTO); } void cx_complete_file(void) { complete_type(COMPL_TYPE_FILE); } void cx_complete_dir(void) { complete_type(COMPL_TYPE_DIR); } void cx_complete_cmd(void) { complete_type(COMPL_TYPE_CMD); } void cx_complete_user(void) { complete_type(COMPL_TYPE_USER); } void cx_complete_env(void) { complete_type(COMPL_TYPE_ENV); } void cx_complete_hist(void) { complete_type(COMPL_TYPE_HIST); } clex-3.15/src/completion.h0000644000076400007640000000146110422400323012427 00000000000000#define COMPL_TYPE_AUTO 0 /* autodetect */ #define COMPL_TYPE_DIRPANEL 1 /* whole textline is one directory name */ #define COMPL_TYPE_FILE 2 /* any file */ #define COMPL_TYPE_DIR 3 /* directory */ #define COMPL_TYPE_CMD 4 /* executable */ #define COMPL_TYPE_USER 5 /* username */ #define COMPL_TYPE_ENV 6 /* environment variable */ #define COMPL_TYPE_HIST 7 /* command history */ extern void completion_initialize(void); extern void completion_reconfig(void); extern void compl_prepare(void); extern int compl_file(int); extern void cx_compl_complete(void); extern void cx_complete_auto(void); extern void cx_complete_file(void); extern void cx_complete_dir(void); extern void cx_complete_cmd(void); extern void cx_complete_user(void); extern void cx_complete_env(void); extern void cx_complete_hist(void); clex-3.15/src/control.c0000644000076400007640000005351010465571476011764 00000000000000/* * * CLEX File Manager * * Copyright (C) 2001-2006 Vlado Potisk * * CLEX is free software without warranty of any kind; see the * GNU General Public License as set out in the "COPYING" document * which accompanies the CLEX File Manager package. * * CLEX can be downloaded from http://www.clex.sk * */ #include #include /* clex.h */ #include /* iscntrl() */ #ifdef HAVE_NCURSES_H # include /* KEY_xxx */ #else # include #endif #include /* va_list */ #include /* exit() */ #include "clex.h" #include "control.h" #include "bookmarks.h" /* bm_list_prepare() */ #include "cfg.h" /* config_prepare() */ #include "completion.h" /* compl_prepare() */ #include "directory.h" /* dir_main_prepare() */ #include "edit.h" /* cx_edit_xxx() */ #include "filepanel.h" /* cx_files_xxx() */ #include "filter.h" /* cx_filteredit_xxx() */ #include "help.h" /* help_prepare() */ #include "history.h" /* history_prepare() */ #include "inout.h" /* win_panel() */ #include "panel.h" /* cx_pan_xxx() */ #include "select.h" /* select_prepare() */ #include "sort.h" /* sort_prepare() */ #include "tty.h" /* tty_reset() */ #include "undo.h" /* undo_reset() */ #include "userdata.h" /* user_prepare() */ #include "xterm_title.h" /* xterm_title_restore() */ /* * This is the main control section. It is table driven. * * PANEL is the main part of the screen, it shows various data * depending on the panel type, the user can scroll through it. * * TEXTLINE is a line of text where the user can enter and edit * his/her input. * * KEY_BINDING contains a keystroke and a corresponding function * to be called every time that key is pressed. All such handler * function names begin with the cx_ prefix. * * CLEX operation mode is defined by a PANEL, TEXTLINE, and a set of * KEY_BINDING tables. The PANEL and TEXTLINE are initialized by * a so-called preparation function after each mode change. * * Operation mode can be changed in one of two ways: * - straightforward transition from mode A to mode B; this * achieved by setting the 'next_mode' global variable * - nesting of modes; this is achieved by calling another * instance of 'control_loop()'. To go back the variable * 'next_mode' must be set to MODE_SPECIAL_RETURN. */ typedef struct { FLAG escp; /* press escape key first */ int key; /* if this key was pressed ... */ void (*fn)(void); /* ... then this function is to be invoked */ int options; /* options - see OPT_XXX below */ } KEY_BINDING; #define OPT_CURS 1 /* call the handler function only if the cursor is on a regular line, i.e. not on an extra line or in an empty panel */ /* * notes: extra panel lines: curs < 0 * regular panel lines: curs >= 0 * OPT_CURS does not apply to (i.e. ctrl-M) because * the EXTRA_LINE structure overrides the control */ #define CXM(X,M) void cx_mode_ ## X (void) { control_loop(MODE_ ## M); } static CXM(bm_list,BM_LIST) static CXM(cfg,CFG) static CXM(compare,COMPARE) static CXM(deselect,DESELECT) static CXM(dir,DIR) static CXM(group,GROUP) static CXM(history,HIST) static CXM(help,HELP) static CXM(mainmenu,MAINMENU) static CXM(paste,PASTE) static CXM(select,SELECT) static CXM(sort,SORT) static CXM(user,USER) #define CXT(X,M) void cx_trans_ ## X (void) { next_mode = MODE_ ## M; } static CXT(bm_list,BM_LIST) static CXT(quit,SPECIAL_QUIT) static CXT(return,SPECIAL_RETURN) static void noop(void) { ; } /* defined below */ static void menu_prepare(void); static void cx_menu_pick(void); static void paste_prepare(void); static void cx_paste_pick(void); static void cx_menu_na(void); static void cx_tmp_w_left(void) /* transition !! */ { win_remark("please use the alt-B key for this function"); cx_edit_w_left_(); } static void cx_tmp_w_del(void) /* transition !! */ { win_remark("please use the alt-D key for this function"); cx_edit_w_del_(); } static void cx_tmp_w_right(void) /* transition !! */ { win_remark("please use the alt-F key for this function"); cx_edit_w_right(); } static void cx_tmp_delend(void) /* transition !! */ { win_remark("please use the ctrl-K key for this function"); cx_edit_delend(); } static KEY_BINDING tab_bm_lst[] = { { 0, CH_CTRL('M'), cx_bm_list_enter, 0 }, { 0, 0, 0, 0 } }; static KEY_BINDING tab_bm_mng[] = { { 0, CH_CTRL('C'), cx_bm_mng_save, 0 }, { 0, CH_CTRL('M'), cx_bm_mng_edit, 0 }, { 0, 'd', cx_bm_mng_down, OPT_CURS }, { 0, 'i', cx_bm_mng_new, 0 }, { 0, KEY_IC, cx_bm_mng_new, 0 }, { 0, 'u', cx_bm_mng_up, OPT_CURS }, { 0, 'r', cx_bm_mng_del, OPT_CURS }, { 0, '\177', cx_bm_mng_del, OPT_CURS }, { 0, CH_CTRL('H'), cx_bm_mng_del, OPT_CURS }, { 0, 0, 0, 0 } }; static KEY_BINDING tab_bm_edit[] = { { 0, CH_CTRL('I'), cx_bm_edit_compl, 0 }, { 0, CH_CTRL('M'), cx_bm_edit_enter, 0 }, { 0, 0, 0, 0 } }; static KEY_BINDING tab_cfg[] = { { 0, CH_CTRL('M'), cx_config_enter, 0 }, { 0, 's', cx_config_default, OPT_CURS }, { 0, 'o', cx_config_original, OPT_CURS }, { 0, 0, 0, 0 } }; static KEY_BINDING tab_cfg_edit_num[] = { { 0, CH_CTRL('M'), cx_config_num_enter, 0 }, { 0, 0, 0, 0 } }; static KEY_BINDING tab_cfg_edit_str[] = { { 0, CH_CTRL('M'), cx_config_str_enter, 0 }, { 0, 0, 0, 0 } }; static KEY_BINDING tab_common[] = { { 0, CH_CTRL('C'), cx_trans_return, 0 }, { 1, 'q', cx_trans_quit, 0 }, { 1, 'v', cx_version, 0 }, { 0, CH_CTRL('F'), cx_filter, 0 }, { 1, 'm', cx_menu_na, 0 }, { 0, KEY_F(16), cx_menu_na, 0 }, { 0, KEY_F(1), cx_mode_help, 0 }, { 0, 0, 0, 0 } }; static KEY_BINDING tab_compare[] = { /* * these lines correspond with the menu of the compare panel * if you change this, you must update initialization * in start.c and descriptions in inout.c */ { 0, '0', cx_compare, 0 }, { 0, '1', cx_compare, 0 }, { 0, '2', cx_compare, 0 }, { 0, '3', cx_compare, 0 }, { 0, '4', cx_compare, 0 }, { 0, '5', cx_compare, 0 }, /* compare menu ends here */ { 0, CH_CTRL('M'), cx_compare, 0 }, { 0, 0, 0, 0 } }; static KEY_BINDING tab_compl[] = { { 0, CH_CTRL('I'), cx_compl_complete, OPT_CURS }, { 0, CH_CTRL('M'), cx_compl_complete, OPT_CURS }, { 0, 0, 0, 0 } }; static KEY_BINDING tab_dir[] = { { 1, 'k', cx_trans_bm_list, 0 }, { 0, CH_CTRL('I'), cx_dir_tab, 0 }, { 0, CH_CTRL('M'), cx_dir_enter, 0 }, { 0, 0, 0, 0 } }; static KEY_BINDING tab_edit[] = { { 1, 'b', cx_edit_w_left, 0 }, #ifdef KEY_SLEFT { 0, KEY_SLEFT, cx_edit_w_left, 0 }, #endif { 1, 'd', cx_edit_w_del, 0 }, { 1, 'f', cx_edit_w_right, 0 }, #ifdef KEY_SRIGHT { 0, KEY_SRIGHT, cx_edit_w_right, 0 }, #endif { 0, CH_CTRL('H'), cx_edit_backsp, 0 }, { 0, CH_CTRL('K'), cx_edit_delend, 0 }, { 0, CH_CTRL('U'), cx_edit_kill, 0 }, { 0, CH_CTRL('V'), cx_edit_insert_spc, 0 }, { 0, CH_CTRL('Z'), cx_undo, 0 }, { 1, CH_CTRL('Z'), cx_redo, 0 }, { 0, '\177', cx_edit_delchar, 0 }, { 0, KEY_LEFT, cx_edit_left, 0 }, { 0, KEY_RIGHT, cx_edit_right, 0 }, { 0, KEY_HOME, cx_edit_begin, 0 }, #ifdef KEY_END { 0, KEY_END, cx_edit_end, 0 }, #endif { 1, KEY_UP, cx_edit_up, 0 }, { 1, KEY_DOWN, cx_edit_down, 0 }, { 0, CH_CTRL('B'), cx_tmp_w_left, 0 }, /* transition !! */ { 0, CH_CTRL('D'), cx_tmp_w_del, 0 }, /* transition !! */ { 0, CH_CTRL('W'), cx_tmp_w_right, 0 }, /* transition !! */ { 0, CH_CTRL('Y'), cx_tmp_delend, 0 }, /* transition !! */ { 0, 0, 0, 0 } }; static KEY_BINDING tab_editcmd[] = { { 0, CH_CTRL('A'), cx_edit_fullpath, 0 }, { 0, CH_CTRL('E'), cx_edit_paste_dir, 0 }, { 0, CH_CTRL('I'), cx_files_tab, 0 }, { 1, CH_CTRL('I'), cx_mode_paste, 0 }, { 0, CH_CTRL('M'), cx_files_enter, 0 }, { 1, CH_CTRL('M'), cx_files_cd, OPT_CURS }, { 0, CH_CTRL('N'), cx_hist_next, 0 }, { 0, CH_CTRL('O'), cx_edit_paste_link, OPT_CURS }, { 0, CH_CTRL('P'), cx_hist_prev, 0 }, { 1, CH_CTRL('R'), cx_files_reread_ug, 0 }, { 0, CH_CTRL('T'), cx_select_toggle, OPT_CURS }, { 0, CH_CTRL('X'), cx_files_exchange, 0 }, { 1, 'g', cx_mode_group, 0 }, { 1, 'm', cx_mode_mainmenu, 0 }, { 1, 'p', cx_complete_hist, 0 }, { 0, KEY_F(16), cx_mode_mainmenu, 0 }, { 0, KEY_IC, cx_select_toggle, OPT_CURS }, { 0, KEY_F(2), cx_edit_cmd_f2, 0 }, { 0, KEY_F(3), cx_edit_cmd_f3, 0 }, { 0, KEY_F(4), cx_edit_cmd_f4, 0 }, { 0, KEY_F(5), cx_edit_cmd_f5, 0 }, { 0, KEY_F(6), cx_edit_cmd_f6, 0 }, { 0, KEY_F(7), cx_edit_cmd_f7, 0 }, { 0, KEY_F(8), cx_edit_cmd_f8, 0 }, { 0, KEY_F(9), cx_edit_cmd_f9, 0 }, { 0, KEY_F(10), cx_edit_cmd_f10, 0 }, { 0, KEY_F(11), cx_edit_cmd_f11, 0 }, { 0, KEY_F(12), cx_edit_cmd_f12, 0 }, { 0, 0, 0, 0 } }; static KEY_BINDING tab_filteredit[] = { { 0, CH_CTRL('H'), cx_filteredit_backsp, 0 }, { 0, CH_CTRL('U'), cx_filteredit_kill, 0 }, { 0, CH_CTRL('K'), cx_filteredit_delend, 0 }, { 0, '\177', cx_filteredit_delchar, 0 }, { 0, KEY_LEFT, cx_filteredit_left, 0 }, { 0, KEY_RIGHT, cx_filteredit_right, 0 }, { 0, KEY_HOME, cx_filteredit_begin, 0 }, #ifdef KEY_END { 0, KEY_END, cx_filteredit_end, 0 }, #endif { 0, 0, 0, 0 } }; static KEY_BINDING tab_help[] = { { 0, CH_CTRL('H'), cx_help_back, 0 }, { 0, CH_CTRL('M'), cx_help_link, 0 }, { 0, KEY_LEFT, cx_help_back, 0 }, { 0, KEY_RIGHT, cx_help_link, 0 }, { 0, KEY_F(1), cx_help_contents, 0 }, /* avoid F1 recursion */ { 0, 0, 0, 0 } }; static KEY_BINDING tab_hist[] = { { 1, '\177', cx_hist_del, OPT_CURS }, { 1, CH_CTRL('H'), cx_hist_del, OPT_CURS }, { 0, CH_CTRL('I'), cx_hist_paste, OPT_CURS }, { 0, CH_CTRL('M'), cx_hist_enter, OPT_CURS }, { 0, CH_CTRL('N'), cx_pan_up, 0 }, /* redefine history next */ { 0, CH_CTRL('P'), cx_pan_down, 0 }, /* redefine history prev */ { 0, 0, 0 } }; /* pseudo-table returned by do_action() */ static KEY_BINDING tab_insertchar[] = { { 0, 0, 0, 0 } }; static KEY_BINDING tab_mainmenu[] = { /* * these lines correspond with the main menu panel, * if you change this, you must update initialization * in start.c and descriptions in inout.c * * Warning: the OPT_CURS option would check the panel_mainmenu, * this is probably not what you want ! */ /* * no key for cx_mode_help, note the difference: * in tab_common: main menu -> help -> main menu * help in tab_mainmenu: main menu -> help -> file panel */ { 0, 0, cx_mode_help, 0 }, { 1, 'w', cx_mode_dir, 0 }, { 1, '/', cx_files_cd_root, 0 }, { 1, '.', cx_files_cd_parent, 0 }, { 1, '~', cx_files_cd_home, 0 }, { 1, 'k', cx_mode_bm_list, 0 }, { 1, 'h', cx_mode_history, 0 }, { 1, 's', cx_mode_sort, 0 }, { 0, CH_CTRL('R'), cx_files_reread, 0 }, { 1, '=', cx_mode_compare, 0 }, { 0, 0, cx_filter_toggle, 0 }, /* key in tab_mainmenu2 */ { 1, 'u', cx_mode_user, 0 }, { 0, 0, cx_select_allfiles, 0 }, /* key in tab_mainmenu2 */ { 0, 0, cx_select_nofiles, 0 }, /* key in tab_mainmenu2 */ { 1, '+', cx_mode_select, 0 }, { 1, '-', cx_mode_deselect, 0 }, { 1, '*', cx_select_invert, 0 }, { 1, 'c', cx_mode_cfg, 0 }, { 1, 'v', cx_version, 0 }, { 0, 0, cx_trans_quit, 0 }, /* key in tab_common */ { 0, 0, 0, 0 } }; /* main menu keys that are not to be used in the file panel */ /* this table must correspond with the panel_mainmenu as well ! */ static KEY_BINDING tab_mainmenu2[] = { { 0, 0, noop, 0 }, { 0, 0, noop, 0 }, { 0, 0, noop, 0 }, { 0, 0, noop, 0 }, { 0, 0, noop, 0 }, { 0, 0, noop, 0 }, { 0, 0, noop, 0 }, { 0, 0, noop, 0 }, { 0, 0, noop, 0 }, { 0, 0, noop, 0 }, { 0, CH_CTRL('F'), cx_filter_toggle, 0 }, { 1, 'g', cx_mode_group, 0 }, { 0, '+', cx_select_allfiles, 0 }, { 0, '-', cx_select_nofiles, 0 }, { 0, 0, noop, 0 }, { 0, 0, noop, 0 }, { 0, 0, noop, 0 }, { 0, 0, noop, 0 }, { 0, 0, noop, 0 }, { 0, 0, noop, 0 }, /* the main menu ends here, the following entry is hidden */ { 0, CH_CTRL('M'), cx_menu_pick, 0 }, { 0, 0, 0, 0 } }; static KEY_BINDING tab_panel[] = { { 0, KEY_UP, cx_pan_up, 0 }, { 0, KEY_DOWN, cx_pan_down, 0 }, { 0, KEY_PPAGE, cx_pan_pgup, 0 }, { 0, KEY_NPAGE, cx_pan_pgdown, 0 }, { 1, KEY_HOME, cx_pan_home, 0 }, #ifdef KEY_END { 1, KEY_END, cx_pan_end, 0 }, #endif { 0, 0, 0, 0 } }; static KEY_BINDING tab_pastemenu[] = { /* * these lines correspond with the paste menu panel, * if you change this, you must update initialization * in start.c and descriptions in inout.c */ { 0, 0, cx_complete_auto, 0 }, { 0, 0, cx_complete_file, 0 }, /* no key */ { 0, 0, cx_complete_dir, 0 }, /* no key */ { 0, 0, cx_complete_cmd, 0 }, /* no key */ { 0, 0, cx_complete_user, 0 }, /* no key */ { 0, 0, cx_complete_env, 0 }, /* no key */ { 1, 'p', cx_complete_hist, 0 }, { 0, KEY_F(2), cx_insert_filename, 0 }, { 1, KEY_F(2), cx_insert_filenames,0 }, { 0, CH_CTRL('A'), cx_insert_fullpath, 0 }, { 0, CH_CTRL('E'), cx_insert_d2, 0 }, { 1, CH_CTRL('E'), cx_insert_d1, 0 }, { 0, CH_CTRL('O'), cx_insert_link, 0 }, /* the menu ends here, the following entry is hidden */ { 0, CH_CTRL('M'), cx_paste_pick, 0 }, { 0, 0, 0, 0 } }; static KEY_BINDING tab_select[] = { { 0, CH_CTRL('M'), cx_select_files, 0 }, { 0, 0, 0, 0 } }; static KEY_BINDING tab_sort[] = { { 0, CH_CTRL('M'), cx_sort_set, 0 }, { 0, 0, 0, 0 } }; typedef struct { CODE mode; void (*prepare_fn)(void); KEY_BINDING *table[4]; /* up to 3 tables terminated with NULL; order is sometimes important, only the first KEY_BINDING for a given key is followed */ } MODE_DEFINITION; /* tab_edit and tab_common are appended automatically */ static MODE_DEFINITION mode_definition[] = { { MODE_BM_EDIT, bm_edit_prepare, { tab_bm_edit,0 } }, { MODE_BM_LIST, bm_list_prepare, { tab_bm_lst,tab_panel,0 } }, { MODE_BM_MANAGER, bm_mng_prepare, { tab_bm_mng,tab_panel,0 } }, { MODE_CFG, config_prepare, { tab_cfg,tab_panel,0 } }, { MODE_CFG_EDIT_NUM, config_edit_num_prepare, { tab_cfg_edit_num,0 } }, { MODE_CFG_EDIT_TXT, config_edit_str_prepare, { tab_cfg_edit_str,0 } }, { MODE_COMPARE, compare_prepare, { tab_compare,tab_panel,0 } }, { MODE_COMPL, compl_prepare, { tab_compl,tab_panel,0 } }, { MODE_DESELECT, select_prepare, { tab_select,tab_panel,0 } }, { MODE_DIR, dir_main_prepare, { tab_dir,tab_panel,0 } }, { MODE_DIR_SPLIT, dir_split_prepare, { tab_dir,tab_panel,0 } }, { MODE_FILE, files_main_prepare, { tab_editcmd,tab_mainmenu,tab_panel,0 } }, { MODE_GROUP, group_prepare, { tab_panel,0 } }, { MODE_HELP, help_prepare, { tab_help,tab_panel,0 } }, { MODE_HIST, hist_prepare, { tab_hist,tab_panel,0 } }, { MODE_MAINMENU, menu_prepare, { tab_mainmenu,tab_mainmenu2,tab_panel,0 } }, { MODE_SELECT, select_prepare, { tab_select,tab_panel,0 } }, { MODE_PASTE, paste_prepare, { tab_pastemenu,tab_panel,0 } }, { MODE_SORT, sort_prepare, { tab_sort,tab_panel,0 } }, { MODE_USER, user_prepare, { tab_panel,0 } }, { 0, 0, { 0 } } }; /* linked list of all control loop instances */ static struct operation_mode { CODE mode; PANEL_DESC *panel; TEXTLINE *textline; struct operation_mode *previous; } mode_init = { 0,0,0,0 }, *clex_mode = &mode_init; int get_current_mode(void) { return clex_mode->mode; } int get_previous_mode(void) { return clex_mode->previous->mode; } static MODE_DEFINITION * get_modedef(int mode) { MODE_DEFINITION *p; for (p = mode_definition; p->mode; p++) if (p->mode == mode) return p; err_exit("BUG: requested operation mode %d is invalid",mode); /* NOTREACHED */ return 0; } static KEY_BINDING * callfn(KEY_BINDING *tab, int in) { PANEL_DESC *pd; if (tab == tab_insertchar) /* special case: in = key */ (panel->filtering == 1 ? filteredit_insertchar : edit_insertchar)(in); else if ((tab[in].options & OPT_CURS) && ! VALID_CURSOR(panel)) return 0; else { /* set cursor for tables that correspond with their respective panels */ if ((tab == tab_mainmenu || tab == tab_mainmenu2) && get_current_mode() == MODE_MAINMENU) pd = panel_mainmenu.pd; else if (tab == tab_pastemenu) pd = panel_paste.pd; else if (tab == tab_compare) pd = panel_compare.pd; else pd = 0; if (pd && in != pd->curs && in < pd->cnt) { pd->curs = in; pan_adjust(pd); win_panel_opt(); } (*tab[in].fn)(); } return tab; } static KEY_BINDING * do_action(int key, KEY_BINDING **tables) { int lower_ch, i, t1, t2, noesc_idx; FLAG esc; EXTRA_LINE *extra; KEY_BINDING *tab, *noesc_tab; static KEY_BINDING *append[3] = { tab_edit, tab_common, 0 }; if (key == CH_ESC) return 0; if (panel->filtering == 1 && (key == CH_CTRL('M') || key == CH_CTRL('C'))) { if (panel->type != PANEL_TYPE_DIR || panel->filter->size == 0) filter_off(); else panel->filtering = 2; return 0; } /* extra lines */ if (key == CH_CTRL('M') && panel->min < 0 && panel->curs < 0) { extra = panel->extra + (panel->curs - panel->min); next_mode = extra->mode_next; if (extra->fn) (*extra->fn)(); return 0; } esc = kbd_esc(); lower_ch = IS_CHAR(key) ? tolower(key) : key; noesc_tab = 0; noesc_idx = 0; /* to prevent compiler warning */ for (t1 = t2 = 0; (tab = tables[t1]) || (tab = append[t2]); tables[t1] ? t1++ : t2++) { if (tab == tab_edit) { if (panel->filtering == 1) tab = tab_filteredit; else if (textline == 0) continue; } for (i = 0; tab[i].fn; i++) if (lower_ch == tab[i].key) { if (esc && !tab[i].escp) { /* * an entry with 'escp' flag has higher priority, * we must continue to search the tables to see * if such entry for the given key exists */ if (noesc_tab == 0) { /* accept the first definition only */ noesc_tab = tab; noesc_idx = i; } } else if (esc || !tab[i].escp) return callfn(tab,i); } } if (noesc_tab) return callfn(noesc_tab,noesc_idx); if ((textline || panel->filtering == 1) && IS_CHAR(key) && !iscntrl(key) && !esc) return callfn(tab_insertchar,key); #if 0 win_remark_fmt("DEBUG: %o key (no function)",key); #else win_remark("pressed key has no function " "(F1 - help, ctrl-C - cancel)"); #endif return 0; } /* * main control loop for a selected mode 'mode' * control loops for different modes are nested whenever necessary */ void control_loop(int mode) { MODE_DEFINITION *modedef; KEY_BINDING *kb_tab; struct operation_mode current_mode; FLAG filter, nr; current_mode.previous = clex_mode; clex_mode = ¤t_mode; /* panel and textline inherited the from previous mode */ clex_mode->panel = clex_mode->previous->panel; clex_mode->textline = clex_mode->previous->textline; for (next_mode = mode; /* until break */; ) { modedef = get_modedef(clex_mode->mode = next_mode); next_mode = 0; (*modedef->prepare_fn)(); win_heading(); if (panel != clex_mode->panel) { if (panel->filtering) { win_filter(); filter_update(); } else { if (clex_mode->panel && clex_mode->panel->filtering) win_filter(); pan_adjust(panel); win_panel(); } clex_mode->panel = panel; } if (textline != clex_mode->textline) { undo_reset(); edit_adjust(); win_edit(); clex_mode->textline = textline; } for (; /* until break */;) { undo_before(); kb_tab = do_action(kbd_input(),modedef->table); undo_after(); if (next_mode) { if (next_mode == MODE_SPECIAL_RETURN && clex_mode->previous->mode == 0) { win_remark("to quit CLEX press Q"); next_mode = 0; } else break; } /* some special handling not implemented with tables */ switch (clex_mode->mode) { case MODE_COMPL: if (kb_tab == tab_edit || kb_tab == tab_insertchar) next_mode = MODE_SPECIAL_RETURN; break; case MODE_DIR: case MODE_DIR_SPLIT: nr = kb_tab != tab_panel && textline->size > 0; if (panel->norev != nr) { panel->norev = nr; win_edit(); win_panel_opt(); } break; case MODE_MAINMENU: if (kb_tab == tab_mainmenu || kb_tab == tab_mainmenu2) next_mode = MODE_SPECIAL_RETURN; break; } if (panel->filtering && panel->filter->changed) filter_update(); if (next_mode) break; } if (next_mode == MODE_SPECIAL_QUIT) err_exit("Normal exit"); if (next_mode == MODE_SPECIAL_RETURN) { next_mode = 0; break; } } clex_mode = clex_mode->previous; win_heading(); if (panel != clex_mode->panel) { filter = panel->filtering || clex_mode->panel->filtering; panel = clex_mode->panel; if (filter) win_filter(); pan_adjust(panel); /* screen size might have changed */ win_panel(); } if (textline != clex_mode->textline) { textline = clex_mode->textline; edit_adjust(); win_edit(); } } static void menu_prepare(void) { /* leave cursor position unchanged */ panel = panel_mainmenu.pd; textline = 0; } static void cx_menu_pick(void) { (*tab_mainmenu[panel_mainmenu.pd->curs].fn)(); if (next_mode == 0) next_mode = MODE_SPECIAL_RETURN; } static void paste_prepare(void) { /* leave cursor position unchanged */ panel = panel_paste.pd; /* textline unchanged */ } static void cx_paste_pick(void) { (*tab_pastemenu[panel_paste.pd->curs].fn)(); } static void cx_menu_na(void) { win_remark("the menu (alt-M) exists only in the file panel"); } void cx_version(void) { win_remark("Welcome to CLEX " VERSION " !"); } /* * err_exit() is the only exit function that terminates CLEX main * process. It is used for normal (no error) termination as well. */ void err_exit(const char *format, ...) { va_list argptr; /* * all cleanup functions used here: * - must not call err_exit() * - must not require initialization */ xterm_title_restore(); if (display.curses) curses_stop(); tty_reset(); fputs("\nTerminating CLEX: ",stdout); va_start(argptr,format); vprintf(format,argptr); va_end(argptr); putchar('\n'); tty_pgrp_reset(); exit(0); /* NOTREACHED */ } clex-3.15/src/control.h0000644000076400007640000000025507613605161011755 00000000000000extern void control_loop(int); extern int get_current_mode(void); extern int get_previous_mode(void); extern void cx_version(void); extern void err_exit(const char *, ...); clex-3.15/src/directory.c0000644000076400007640000002466210426416314012300 00000000000000/* * * CLEX File Manager * * Copyright (C) 2001-2006 Vlado Potisk * * CLEX is free software without warranty of any kind; see the * GNU General Public License as set out in the "COPYING" document * which accompanies the CLEX File Manager package. * * CLEX can be downloaded from http://www.clex.sk * */ #include #include /* clex.h */ #include /* qsort() */ #include /* strcmp() */ #include "clex.h" #include "directory.h" #include "cfg.h" /* config_num() */ #include "completion.h" /* compl_file() */ #include "control.h" /* get_current_mode() */ #include "edit.h" /* edit_setprompt() */ #include "filepanel.h" /* changedir() */ #include "inout.h" /* win_panel() */ #include "panel.h" /* pan_adjust() */ #include "sdstring.h" /* sd_reset() */ #include "undo.h" /* undo_init() */ #include "ustring.h" /* us_copy() */ #include "userdata.h" /* dir_tilde() */ #include "util.h" /* emalloc() */ /* * The directory list 'dirlist' maintained here contains: * a) the names of recently visited directories, it is * a source for the directory panel 'panel_dir' * b) the last cursor position in all those directories, allowing * to restore the cursor position when the user re-enters * an already visited directory * * the 'dirlist' is never empty, the first element is inserted * already during startup */ /* additional entries to be allocated when the 'dirlist' table is full */ #define SAVEDIR_ALLOC_UNIT 32 #define SAVEDIR_ALLOC_MAX 384 /* 'dirlist' size limit */ typedef struct { USTRING dirname; /* directory name */ SDSTRING savefile; /* file panel's current file */ int savetop, savecurs; /* top line, cursor line */ } SAVEDIR; static SAVEDIR **dirlist; /* list of visited directories */ static int diralloc = 0; /* number of allocated entries in 'dirlist' */ static int dircnt = 0; /* number of used entries in 'dirlist' */ /* directory panel's data is built from 'dirlist' */ #define DP_LIST (panel_dir.dir) static int dp_alloc = 0; /* max number of entries in the dir panel */ static int dp_max; /* max number of entries to be used */ /* split directory panel */ #define DPS_LIST (panel_dir_split.dir) static int dps_alloc = 0; /* max number of entries in the dir_split panel */ void dir_initialize(void) { US_INIT(line_dir.line); undo_init(&line_dir); edit_setprompt(&line_dir,"Change directory: "); dir_reconfig(); } void dir_reconfig(void) { if (dp_alloc) free(DP_LIST); dp_max = dp_alloc = config_num(CFG_D_SIZE); if (dp_max == 0) /* D_PANEL_SIZE = AUTO */ dp_alloc = 100; /* enough for every screen */ DP_LIST = emalloc(dp_alloc * sizeof(DIR_ENTRY)); } /* * length of the common part of two directory names (FQDNs) * (this is not the same as common part of two strings) */ static size_t common_part(const char *dir1, const char *dir2) { char ch1, ch2; size_t i, slash; for (i = slash = 0; /* until return */; i++) { ch1 = dir1[i]; ch2 = dir2[i]; if (ch1 == '\0') return ch2 == '/' || ch2 == '\0' ? i : slash; if (ch2 == '\0') return ch1 == '/' ? i : slash; if (ch1 != ch2) return slash; if (ch1 == '/') slash = i; } } /* * check the relationship of two directories (FQDNs) * return -1: dir2 is subdir of dir1 (/dir2 = /dir1 + /sub) * return +1: dir1 is subdir of dir2 (/dir1 = /dir2 + /sub) * return 0: otherwise */ static int check_subdir(const char *dir1, const char *dir2) { size_t slash; slash = common_part(dir1,dir2); return (dir2[slash] == '\0') - (dir1[slash] == '\0'); } /* * comparison function for qsort() - comparing directories * (this is not the same as comparing strings) */ static int qcmp(const void *e1, const void *e2) { static USTRING dup1 = { 0,0 }, dup2 = { 0,0 }; size_t slash, len1, len2; const char *dir1, *dir2; dir1 = ((DIR_ENTRY *)e1)->name; dir2 = ((DIR_ENTRY *)e2)->name; /* skip the common part */ slash = common_part(dir1,dir2); if (dir1[slash] == '\0' && dir2[slash] == '\0') return 0; if (dir1[slash] == '\0') return -1; if (dir2[slash] == '\0') return 1; /* compare one directory component */ slash++; for (len1 = slash; dir1[len1] != '/' && dir1[len1] != '\0'; len1++) ; us_copyn(&dup1,dir1 + slash,len1); for (len2 = slash; dir2[len2] != '/' && dir2[len2] != '\0'; len2++) ; us_copyn(&dup2,dir2 + slash,len2); return (config_num(CFG_COLLATION) ? STRCOLL : strcmp) (USTR(dup1),USTR(dup2)); } /* * In order not to waste CPU cycles, the panel 'panel_dir' * is not maintained continuously. Following function builds the * directory panel from the 'dirlist'. */ #define NO_COMPACT 5 /* preserve top 5 directory names */ void dir_main_panel(void) { int i, j, cnt, sub; FLAG store; const char *dirname, *filter; /* D_PANEL_SIZE = AUTO */ if (config_num(CFG_D_SIZE) == 0) { /* * substract extra lines and leave the bottom * line empty to show there is no need to scroll */ dp_max = display.panlines + panel_dir.pd->min - 1; LIMIT_MAX(dp_max,dp_alloc); } filter = panel_dir.pd->filtering ? panel_dir.pd->filter->line : 0; for (i = cnt = 0; i < dircnt; i++) { if (cnt == dp_max) break; dirname = USTR(dirlist[i]->dirname); if (filter && !substring(dirname,filter,0)) continue; /* compacting */ store = 1; if (i >= NO_COMPACT) for (j = 0; j < cnt; j++) { sub = check_subdir(dirname,DP_LIST[j].name); if (sub == -1) store = 0; else if (sub == 1 && j >= NO_COMPACT) { DP_LIST[j].name = dirname; store = 0; } } if (store) DP_LIST[cnt++].name = dirname; } qsort(DP_LIST,cnt,sizeof(DIR_ENTRY),qcmp); /* * Two lines like these: * /aaa/bbb/111 * /aaa/bbb/2222 * are displayed as: * /aaa/bbb/111 * __/2222 * and for that purpose a string length 'shlen' is computed * |<---->| */ DP_LIST[0].shlen = 0; for (i = 1; i < cnt; i++) DP_LIST[i].shlen = common_part(DP_LIST[i].name,DP_LIST[i - 1].name); panel_dir.pd->cnt = cnt; } void dir_main_prepare(void) { int i; const char *prevdir; panel_dir.pd->filtering = 0; dir_main_panel(); panel_dir.pd->norev = 0; panel_dir.pd->top = panel_dir.pd->min; /* set cursor to previously used directory */ panel_dir.pd->curs = 0; prevdir = USTR(dirlist[(dircnt >= 2)]->dirname); /* [1] or [0] */ for (i = 0; i < panel_dir.pd->cnt; i++) if (DP_LIST[i].name == prevdir) { panel_dir.pd->curs = i; break; } panel = panel_dir.pd; textline = &line_dir; edit_nu_kill(); } static const char * sub_dir(int pos) { static USTRING tmp = { 0,0 }; us_copyn(&tmp,DPS_LIST[pos].name,DPS_LIST[pos].shlen); return USTR(tmp); } void dir_split_prepare(void) { char ch; int cnt, i; const char *dirname; dirname = DP_LIST[panel_dir.pd->curs].name; cnt = 1; if (dirname[1]) { for (i = 0; (ch = dirname[i]); i++ ) if (ch == '/') cnt++; } else i = 1; /* i is now strlen(dirname) */ if (cnt > dps_alloc) { if (dps_alloc) free(DPS_LIST); dps_alloc = cnt; DPS_LIST = emalloc(dps_alloc * sizeof(DIR_ENTRY)); } DPS_LIST[0].name = dirname; DPS_LIST[0].shlen = i; cnt = 1; if (dirname[1]) { while (--i >= 0) if (dirname[i] == '/') { DPS_LIST[cnt].name = dirname; DPS_LIST[cnt].shlen = i ? i : 1; /* 0 -> 1 */ cnt++; } } panel_dir_split.pd->cnt = cnt; panel_dir_split.pd->top = panel_dir_split.pd->min; panel_dir_split.pd->curs = 0; panel_dir_split.pd->norev = 0; panel = panel_dir_split.pd; /* textline inherited */ } /* * save the current directory name and the current cursor position * in the file panel to 'dirlist' */ void filepos_save(void) { int i; FLAG new; SAVEDIR *x, *top; if (dircnt == diralloc && diralloc < SAVEDIR_ALLOC_MAX) { diralloc += SAVEDIR_ALLOC_UNIT; dirlist = erealloc(dirlist,diralloc * sizeof(SAVEDIR *)); x = emalloc(SAVEDIR_ALLOC_UNIT * sizeof(SAVEDIR)); for (i = 0; i < SAVEDIR_ALLOC_UNIT; i++) { US_INIT(x[i].dirname); SD_INIT(x[i].savefile); dirlist[dircnt + i] = x + i; } } for (new = 1, top = dirlist[0], i = 0; i <= dircnt && i < SAVEDIR_ALLOC_MAX; i++) { x = dirlist[i]; dirlist[i] = top; top = x; if (i == dircnt) { dircnt++; break; } if (strcmp(USTR(top->dirname),USTR(ppanel_file->dir)) == 0) { /* no duplicates allowed */ new = 0; break; } } if (new) us_copy(&top->dirname,USTR(ppanel_file->dir)); if (ppanel_file->pd->cnt) { sd_copy(&top->savefile, SDSTR(ppanel_file->files[ppanel_file->pd->curs]->file)); top->savecurs = ppanel_file->pd->curs; top->savetop = ppanel_file->pd->top; } else if (new) { sd_copy(&top->savefile,".."); top->savecurs = 0; top->savetop = 0; } dirlist[0] = top; } /* set the file panel cursor according to data stored in 'dirlist' */ void filepos_set(void) { char *dir; int i, line; size_t len; SAVEDIR *pe; if (ppanel_file->pd->cnt) { dir = USTR(ppanel_file->dir); len = strlen(dir); for (i = 0; i < dircnt; i++) { pe = dirlist[i]; if (strcmp(dir,USTR(pe->dirname)) == 0) { /* found */ line = files_find(SDSTR(pe->savefile)); ppanel_file->pd->curs = line >= 0 ? line : pe->savecurs; ppanel_file->pd->top = pe->savetop; pan_adjust(ppanel_file->pd); return; } } /* not found */ line = files_find(".."); ppanel_file->pd->curs = line >= 0 ? line : 0; ppanel_file->pd->top = ppanel_file->pd->min; } pan_adjust(ppanel_file->pd); } /* following cx_dir_xxx functions are used in both MODE_DIR_XXX modes */ static const char * selected_dir(void) { return get_current_mode() == MODE_DIR_SPLIT ? sub_dir(panel_dir_split.pd->curs) : DP_LIST[panel_dir.pd->curs].name; } void cx_dir_tab(void) { const char *dir; if (textline->size) compl_file(COMPL_TYPE_DIRPANEL); else if (panel->curs >= 0) { dir = selected_dir(); edit_nu_insertstr(dir,0); if (dir[1]) edit_nu_insertchar('/'); edit_update(); } } void cx_dir_enter(void) { const char *dir; if (panel->norev) { /* focus on the input line */ if (textline->size == 0) return; dir = dir_tilde(USTR(textline->line)); } else { /* focus on the panel */ if (panel->curs < 0) /* next_mode is set by the EXTRA_LINE table */ return; if (get_current_mode() == MODE_DIR_SPLIT) dir = sub_dir(panel_dir_split.pd->curs); else { /* DIR_MAIN -> DIR_SPLIT */ cx_edit_kill(); next_mode = MODE_DIR_SPLIT; return; } } if (changedir(dir) == 0) { next_mode = MODE_SPECIAL_RETURN; return; } if (dir[0] == ' ' || dir[strlen(dir) - 1] == ' ') /* common user error */ win_remark("check the spaces around the directory name"); next_mode = 0; } clex-3.15/src/directory.h0000644000076400007640000000051510420021607012263 00000000000000extern void dir_initialize(void); extern void dir_reconfig(void); extern void dir_main_prepare(void); extern void dir_main_panel(void); extern void dir_split_prepare(void); extern void filepos_save(void); extern void filepos_set(void); extern void cx_dir_tab(void); extern void cx_dir_enter(void); extern void cx_dir_bookmark(void); clex-3.15/src/edit.c0000644000076400007640000003215310431037366011215 00000000000000/* * * CLEX File Manager * * Copyright (C) 2001-2006 Vlado Potisk * * CLEX is free software without warranty of any kind; see the * GNU General Public License as set out in the "COPYING" document * which accompanies the CLEX File Manager package. * * CLEX can be downloaded from http://www.clex.sk * */ #include #include /* clex.h */ #include /* strchr() */ #include "clex.h" #include "edit.h" #include "cfg.h" /* config_str() */ #include "inout.h" /* win_edit() */ #include "history.h" /* hist_reset_index() */ #include "sdstring.h" /* SDSTR() */ #include "undo.h" /* undo_before() */ #include "ustring.h" /* USTR() */ #define OFFSET_STEP 16 #define ROUND_UP(X) ((X + OFFSET_STEP - 1) / OFFSET_STEP * OFFSET_STEP) #define ROUND_DOWN(X) ((X) / OFFSET_STEP * OFFSET_STEP) /* adjust 'offset' so the cursor is visible */ int edit_adjust(void) { int old_offset, offset, screen, delta; if (textline == 0) return 0; old_offset = offset = textline->offset; /* screen = maximum number of characters that fit on the screen */ screen = display.textline_area; /* handle cursor too far left */ if (offset > textline->curs) offset = ROUND_DOWN(textline->curs); if (offset) { /* * delta = space left blank * eliminate it as much as possible */ delta = screen - (1 /* > mark */ + textline->size - offset); if (delta >= OFFSET_STEP) { offset -= ROUND_DOWN(delta); LIMIT_MIN(offset,0); } } if (textline->curs != textline->size) /* reserve one position for the possible continuation mark > */ screen--; /* handle cursor too far right (with the regular prompt) */ if (offset == 0 && textline->promptlen + textline->curs > screen) offset = OFFSET_STEP; /* will be handled below */ /* handle cursor too far right (with the continuation mark '>') */ if (offset) { /* * delta (if positive) = cursor position excess * eliminate it totaly */ delta = 1 + textline->curs - offset - screen; if (delta > 0) offset += ROUND_UP(delta); } return old_offset != (textline->offset = offset); } /* make changes to 'textline' visible on the screen */ void edit_update(void) { edit_adjust(); win_edit(); } /* * if you have only moved the cursor, use this optimized * version of edit_update() instead */ void edit_update_cursor(void) { if (edit_adjust()) win_edit(); } /* returns 1 if the line is too long to fit on the screen */ int edit_islong(void) { return textline->offset || textline->promptlen + textline->size > display.textline_area + 1; } void cx_edit_begin(void) { textline->curs = 0; edit_update_cursor(); } void cx_edit_end(void) { textline->curs = textline->size; edit_update_cursor(); } void cx_edit_left(void) { if (textline->curs > 0) { textline->curs--; edit_update_cursor(); } } void cx_edit_right(void) { if (textline->curs < textline->size) { textline->curs++; edit_update_cursor(); } } void cx_edit_up(void) { textline->curs -= display.scrcols; LIMIT_MIN(textline->curs,0); edit_update_cursor(); } void cx_edit_down(void) { textline->curs += display.scrcols; LIMIT_MAX(textline->curs,textline->size); edit_update_cursor(); } /* move one word left */ void cx_edit_w_left_(void) { const char *line; if (textline->curs > 0) { line = USTR(textline->line); while (textline->curs > 0 && line[textline->curs - 1] == ' ') textline->curs--; while (textline->curs > 0 && line[textline->curs - 1] != ' ') textline->curs--; edit_update_cursor(); } } /* alt-B -> alt-K !! */ void cx_edit_w_left(void) { if (textline->curs > 0) cx_edit_w_left_(); else win_remark("note: bookmark panel key is now Alt-K"); } /* move one word right */ void cx_edit_w_right(void) { const char *line; if (textline->curs < textline->size) { line = USTR(textline->line); while (textline->curs < textline->size && line[textline->curs] != ' ') textline->curs++; while (textline->curs < textline->size && line[textline->curs] == ' ') textline->curs++; edit_update_cursor(); } } /* * _nu_ means "no update" version, the caller is responsible * for calling the update function edit_update(). * * The main advantage is you can invoke several _nu_ functions * and then make the 'update' just once. * * Note: The edit_update() consists of edit_adjust() followed by * win_edit(). If the 'offset' is fine (e.g. after edit_nu_kill), * you can skip the edit_adjust(). */ void edit_nu_kill(void) { if (textline == &line_cmd) hist_reset_index(); textline->curs = textline->size = textline->offset = 0; /* * we call us_copy to possibly shrink the allocated memory block, * other delete functions don't do that */ us_copy(&textline->line,""); } void cx_edit_kill(void) { edit_nu_kill(); win_edit(); } /* delete 'cnt' chars at cursor position */ static void delete_chars(int cnt) { int i; char *line; line = USTR(textline->line); textline->size -= cnt; for (i = textline->curs; i <= textline->size; i++) line[i] = line[i + cnt]; } void cx_edit_backsp(void) { if (textline->curs) { textline->curs--; delete_chars(1); edit_update(); } } void cx_edit_delchar(void) { if (textline->curs < textline->size) { delete_chars(1); edit_update(); } } /* delete until the end of line */ void cx_edit_delend(void) { USTR(textline->line)[textline->size = textline->curs] = '\0'; edit_update(); } /* delete word */ static int edit_w_del(void) { int eow; char *line; eow = textline->curs; line = USTR(textline->line); if (line[eow] == ' ' || line[eow] == '\0') return 0; while (textline->curs > 0 && line[textline->curs - 1] != ' ') textline->curs--; while (eow < textline->size && line[eow] != ' ') eow++; while (line[eow] == ' ') eow++; delete_chars(eow - textline->curs); edit_update(); return 1; } /* alt-D -> alt-W !! */ void cx_edit_w_del(void) { if (edit_w_del() == 0) win_remark("note: directory panel key is now Alt-W"); } void cx_edit_w_del_(void) { edit_w_del(); } /* make room for 'cnt' chars at cursor position */ static char * insert_space(int cnt) { int i; char *line, *ins; us_resize(&textline->line,textline->size + cnt + 1); line = USTR(textline->line); ins = line + textline->curs; /* insert new character(s) here */ textline->size += cnt; textline->curs += cnt; for (i = textline->size; i >= textline->curs; i--) line[i] = line[i - cnt]; return ins; } void edit_nu_insertchar(int ch) { *insert_space(1) = (char)ch; } void edit_insertchar(int ch) { edit_nu_insertchar(ch); edit_update(); } /* convert a decimal digit */ static int conv_dec(int ch) { if (ch >= '0' && ch <= '9') return ch - '0'; return -1; } /* convert a hex digit */ static int conv_hex(int ch) { static char *hexnum = "0123456789ABCDEF0123456789abcdef"; char *pch; if (IS_CHAR(ch) && (pch = strchr(hexnum,ch))) return (pch - hexnum) & 0x0F; return -1; } /* insert special character literally or using its ASCII code */ void cx_edit_insert_spc(void) { int v1, v2, v3, val; int ch; ch = kbd_getraw(); /* nnn decimal (i.e. type 064 for @) */ if ((v1 = conv_dec(ch)) >= 0) { v2 = conv_dec(kbd_getraw()); v3 = conv_dec(kbd_getraw()); val = 100 * v1 + 10 * v2 + v3; if (v1 >= 0 && v2 >= 0 && v3 >= 0 && val > 0 && val < 256) edit_insertchar(val); else win_remark("usage: ctrl-V N N N, " "where NNN is decimal ASCII code (001 to 255)"); return; } /* Xnn hexadecimal (i.e. type X40 or x40 for @) */ if (ch == 'x' || ch == 'X') { v1 = conv_hex(kbd_getraw()); v2 = conv_hex(kbd_getraw()); val = 16 * v1 + v2; if (v1 >= 0 && v2 >= 0 && val > 0) edit_insertchar(val); else win_remark("usage: ctrl-V x H H, " "where HH is hex ASCII code (01 to FF)"); return; } /* literal character */ if (IS_CHAR(ch)) { if (ch != '\0') edit_insertchar(ch); } else win_remark("function key codes cannot be inserted"); } void cx_edit_paste_link(void) { FILE_ENTRY *pfe; pfe = ppanel_file->files[ppanel_file->pd->curs]; if (!pfe->symlink) win_remark("not a symbolic link"); else { edit_nu_insertstr(USTR(pfe->link),1); edit_insertchar(' '); } } /* returns 1 if 'ch' is a shell metacharacter */ int edit_isspecial(int ch) { /* built-in metacharacters (let's play it safe) */ if (strchr("\t ()<>[]{}#$&\\|?*;\'\"`~",ch)) return 1; /* C-shell */ if (clex_data.shelltype == 1 && (ch == '!' || ch == ':')) return 1; /* additional special characters to be quoted */ if (*config_str(CFG_QUOTE) && strchr(config_str(CFG_QUOTE),ch)) return 1; return 0; } /* set 'quoteflag' if special characters are to be quoted */ void edit_nu_insertstr(const char *str, int quoteflag) { char ch; int len, spec; char *ins; for (len = spec = 0; (ch = str[len]) != '\0'; len++) if (quoteflag && edit_isspecial((unsigned char)ch)) spec++; if (len > 0) { ins = insert_space(len + spec); while ((ch = *str++) != '\0') { if (quoteflag && edit_isspecial((unsigned char)ch)) *ins++ = '\\'; *ins++ = ch; } } /* * if 'quoteflag' is not set this is roughly equivalent to: * len = strlen(str); strncpy(insert_space(len),src,len); */ } void edit_insertstr(const char *str, int quoteflag) { edit_nu_insertstr(str,quoteflag); edit_update(); } void edit_nu_putstr(const char *str) { us_copy(&textline->line,str); textline->curs = textline->size = strlen(str); } void edit_putstr(const char *str) { edit_nu_putstr(str); edit_update(); } /* * insert string, expand $x variables: * $$ -> literal $ * $1 -> current directory name (primary panel's directory) * $2 -> secondary directory name (secondary panel's directory) * $F -> current file name * $S -> names of all selected file(s) * $f -> $S - if the key was pressed and * at least one file has been selected * $F - otherwise * everything else is copied literally */ void edit_macro(const char *macro) { char ch, *ins; const char *src; int i, cnt, curs; FLAG prefix; FILE_ENTRY *pfe; /* * implementation note: avoid char by char inserts whenever * possible, inserting bigger chunks requires much less overhead */ if (textline->curs == 0 || USTR(textline->line)[textline->curs - 1] == ' ') while (*macro == ' ') macro++; curs = -1; for (src = macro, prefix = 0; (ch = *macro++) != '\0'; ) { if (TCLR(prefix)) { /* first insert everything we saw before the '$' prefix */ cnt = macro - src - 2 /* two chars in "$x" */; if (cnt > 0) strncpy(insert_space(cnt),src,cnt); src = macro; /* now handle $x */ if (ch == 'f' && panel->cnt > 0) { ch = ppanel_file->selected && kbd_esc() ? 'S' : 'F'; if (ch == 'F' && ppanel_file->selected && config_num(CFG_WARN_SELECT)) win_remark("press before if you " "want to work with selected files"); } switch (ch) { case '$': edit_nu_insertchar('$'); break; case '1': edit_nu_insertstr(USTR(ppanel_file->dir),1); break; case '2': edit_nu_insertstr(USTR(ppanel_file->other->dir),1); break; case 'c': curs = textline->curs; break; case 'S': if (panel->cnt > 0) { for (i = cnt = 0; cnt < ppanel_file->selected; i++) { pfe = ppanel_file->files[i]; if (pfe->select) { if (cnt++) edit_nu_insertchar(' '); edit_nu_insertstr(SDSTR(pfe->file),1); } } } break; case 'F': case 'f': if (panel->cnt > 0) { pfe = ppanel_file->files[ppanel_file->pd->curs]; edit_nu_insertstr(SDSTR(pfe->file),1); } break; default: ins = insert_space(2); ins[0] = '$'; ins[1] = ch; } } else if (ch == '$') prefix = 1; } /* insert the rest */ edit_insertstr(src,0); if (curs >= 0) textline->curs = curs; } void cx_edit_cmd_f2(void) { edit_macro("$f "); } void cx_edit_cmd_f3(void) { edit_macro(config_str(CFG_CMD_F3)); } void cx_edit_cmd_f4(void) { edit_macro(config_str(CFG_CMD_F4)); } void cx_edit_cmd_f5(void) { edit_macro(config_str(CFG_CMD_F5)); } void cx_edit_cmd_f6(void) { edit_macro(config_str(CFG_CMD_F6)); } void cx_edit_cmd_f7(void) { edit_macro(config_str(CFG_CMD_F7)); } void cx_edit_cmd_f8(void) { edit_macro(config_str(CFG_CMD_F8)); } void cx_edit_cmd_f9(void) { edit_macro(config_str(CFG_CMD_F9)); } void cx_edit_cmd_f10(void) { edit_macro(config_str(CFG_CMD_F10)); } void cx_edit_cmd_f11(void) { edit_macro(config_str(CFG_CMD_F11)); } void cx_edit_cmd_f12(void) { edit_macro(config_str(CFG_CMD_F12)); } void cx_edit_paste_dir(void) { edit_macro(kbd_esc() ? " $1" : " $2"); } void cx_edit_fullpath(void) { edit_macro(strcmp(USTR(ppanel_file->dir),"/") ? " $1/$F " : " /$F "); } void edit_setprompt(TEXTLINE *pline, const char *prompt) { pline->promptlen = strlen(pline->prompt = prompt); } void cx_insert_filename(void) { edit_macro("$F "); next_mode = MODE_SPECIAL_RETURN; } void cx_insert_filenames(void) { if (ppanel_file->selected) edit_macro(" $S "); else win_remark("no selected files"); next_mode = MODE_SPECIAL_RETURN; } void cx_insert_fullpath(void) { cx_edit_fullpath(); next_mode = MODE_SPECIAL_RETURN; } void cx_insert_d1(void) { edit_macro(" $1"); next_mode = MODE_SPECIAL_RETURN; } void cx_insert_d2(void) { edit_macro(" $2"); next_mode = MODE_SPECIAL_RETURN; } void cx_insert_link(void) { cx_edit_paste_link(); next_mode = MODE_SPECIAL_RETURN; } clex-3.15/src/edit.h0000644000076400007640000000347210431036203011211 00000000000000extern void edit_update(void); extern void edit_update_cursor(void); extern int edit_adjust(void); extern int edit_islong(void); extern int edit_isspecial(int); extern void edit_nu_insertchar(int); extern void edit_insertchar(int); extern void edit_nu_insertstr(const char *, int); extern void edit_insertstr(const char *, int); extern void edit_nu_putstr(const char *); extern void edit_putstr(const char *); extern void edit_macro(const char *); extern void edit_nu_kill(void); extern void edit_setprompt(TEXTLINE *, const char *); extern void cx_edit_begin(void); extern void cx_edit_end(void); extern void cx_edit_left(void); extern void cx_edit_right(void); extern void cx_edit_up(void); extern void cx_edit_down(void); extern void cx_edit_w_left(void); extern void cx_edit_w_left_(void); /* transition !! */ extern void cx_edit_w_right(void); extern void cx_edit_backsp(void); extern void cx_edit_delchar(void); extern void cx_edit_delend(void); extern void cx_edit_w_del(void); extern void cx_edit_w_del_(void); /* transition !! */ extern void cx_edit_kill(void); extern void cx_edit_insert_spc(void); extern void cx_edit_cmd_f2(void); extern void cx_edit_cmd_f3(void); extern void cx_edit_cmd_f4(void); extern void cx_edit_cmd_f5(void); extern void cx_edit_cmd_f6(void); extern void cx_edit_cmd_f7(void); extern void cx_edit_cmd_f8(void); extern void cx_edit_cmd_f9(void); extern void cx_edit_cmd_f10(void); extern void cx_edit_cmd_f11(void); extern void cx_edit_cmd_f12(void); extern void cx_edit_paste_dir(void); extern void cx_edit_paste_link(void); extern void cx_edit_filename(void); extern void cx_edit_fullpath(void); extern void cx_insert_filename(void); extern void cx_insert_filenames(void); extern void cx_insert_fullpath(void); extern void cx_insert_d1(void); extern void cx_insert_d2(void); extern void cx_insert_link(void); clex-3.15/src/exec.c0000644000076400007640000002457210426204732011217 00000000000000/* * * CLEX File Manager * * Copyright (C) 2001-2006 Vlado Potisk * * CLEX is free software without warranty of any kind; see the * GNU General Public License as set out in the "COPYING" document * which accompanies the CLEX File Manager package. * * CLEX can be downloaded from http://www.clex.sk * */ #include #include /* pid_t */ #include /* errno */ #include /* sigaction() */ #include /* puts() */ #include /* exit() */ #include /* strcmp() */ #include /* fork() */ /* waitpid() */ #ifdef HAVE_SYS_WAIT_H # include #endif #ifndef WEXITSTATUS # define WEXITSTATUS(status) ((unsigned)(status) >> 8) #endif #ifndef WIFEXITED # define WIFEXITED(status) (((status) & 255) == 0) #endif #include "clex.h" #include "exec.h" #include "cfg.h" /* config_str() */ #include "control.h" /* get_current_mode() */ #include "edit.h" /* edit_islong() */ #include "inout.h" /* win_remark() */ #include "filepanel.h" /* changedir() */ #include "history.h" /* hist_save() */ #include "list.h" /* list_directory() */ #include "tty.h" /* tty_setraw() */ #include "undo.h" /* undo_init() */ #include "util.h" /* base_name() */ #include "userdata.h" /* dir_tilde() */ #include "ustring.h" /* us_copy() */ #include "xterm_title.h" /* xterm_title_set() */ extern int errno; #define MAX_SHELL_ARGS 8 static char *shell_argv[MAX_SHELL_ARGS + 2 + 1]; static int cmd_index; /* which parameter is the command to be executed */ void exec_initialize(void) { US_INIT(line_cmd.line); undo_init(&line_cmd); exec_shell_reconfig(); exec_prompt_reconfig(); /* prompt needs to know the shell */ } static int shelltype(const char *shell) { size_t len; shell = base_name(shell); len = strlen(shell); if (len >= 2 && strcmp(shell + len - 2,"sh") == 0) return (len >= 3 && shell[len - 3] == 'c'); return 2; } static int parse_shellprog(const char *shellprog) { char *pch; int i, ac; FLAG arg_end; static USTRING dup = { 0,0 }; us_copy(&dup,shellprog); /* split to arguments */ for (arg_end = 1, i = 0, pch = USTR(dup); *pch; pch++ ) if (*pch == ' ') { *pch = '\0'; arg_end = 1; } else if (TCLR(arg_end)) { if (i >= MAX_SHELL_ARGS) { txt_printf( "CONFIG: Incorrect SHELLPROG: too many arguments\n" " limit is " STR(MAX_SHELL_ARGS) "\n"); return -1; } shell_argv[i++] = pch; } shell_argv[ac = i] = 0; for (cmd_index = 0, i = 1; i < ac; i++) if (strcmp(shell_argv[i],"") == 0) { cmd_index = i; /* real command belongs here */ break; } /* append: -c */ if (cmd_index == 0) { shell_argv[ac] = "-c"; cmd_index = ac + 1; shell_argv[ac + 2] = 0; } clex_data.shelltype = shelltype(shell_argv[0]); return 0; } /* prepare to execute commands according to "SHELLPROG" */ void exec_shell_reconfig(void) { if (*config_str(CFG_SHELLPROG)) { if (parse_shellprog(config_str(CFG_SHELLPROG)) == 0) return; /* success */ txt_printf("EXEC: Will use your login shell: %s\n", clex_data.shell); } /* SHELLPROG = AUTO: loginshell -c */ parse_shellprog(clex_data.shell); } void exec_prompt_reconfig(void) { const char *prompt, *chars; static USTRING cmd_prompt = { 0,0 }; static char prompt_char[4] = " ? "; prompt = config_str(CFG_PROMPT); if (prompt[0] == '\0') { /* PROMPT=AUTO */ prompt = base_name(shell_argv[0]); switch (clex_data.shelltype) { case 0: chars = "$#"; /* Bourne shell or similar */ break; case 1: chars = "%#"; /* C-shell or similar */ break; default: chars = ">>"; /* some other shell */ break; } prompt_char[1] = chars[clex_data.isroot]; } else prompt_char[1] = '\0'; us_cat(&cmd_prompt,clex_data.isroot ? "ROOT " : "", prompt,prompt_char,(char *)0); edit_setprompt(&line_cmd,USTR(cmd_prompt)); } static int execute(const char *command) { pid_t childpid; FLAG failed; int status, code; struct sigaction act; const char *signame; failed = 1; xterm_title_set(1,command); childpid = fork(); if (childpid == -1) printf("EXEC: Cannot create new process (%s)\n", strerror(errno)); else if (childpid == 0) { /* child process = command */ #ifdef _POSIX_JOB_CONTROL /* move this process to a new foreground process group */ childpid = getpid(); setpgid(childpid,childpid); tcsetpgrp(STDIN_FILENO,childpid); #endif /* reset signal dispositions */ act.sa_handler = SIG_DFL; act.sa_flags = 0; sigemptyset(&act.sa_mask); sigaction(SIGINT,&act,0); sigaction(SIGQUIT,&act,0); #ifdef _POSIX_JOB_CONTROL sigaction(SIGTSTP,&act,0); sigaction(SIGTTIN,&act,0); sigaction(SIGTTOU,&act,0); #endif /* execute the command */ ((const char **)shell_argv)[cmd_index] = command; execv(shell_argv[0],shell_argv); printf("EXEC: Cannot execute shell %s (%s)\n", shell_argv[0],strerror(errno)); exit(99); /* NOTREACHED */ } else { /* parent process = CLEX */ #ifdef _POSIX_JOB_CONTROL /* move child process to a new foreground process group */ setpgid(childpid,childpid); tcsetpgrp(STDIN_FILENO,childpid); #endif for (; /* until break */;) { /* wait for child process exit or stop */ while (waitpid(childpid,&status,WUNTRACED) < 0) /* ignore EINTR */; #ifdef _POSIX_JOB_CONTROL /* move CLEX to foreground */ tcsetpgrp(STDIN_FILENO,clex_data.pid); #endif if (!WIFSTOPPED(status)) break; puts( "\r\n" "\r\n" "EXEC: CLEX does not provide job control\r\n" "EXEC: suspended command will be resumed shortly\r\n" "\r\n"); fflush(stdout); #ifdef _POSIX_JOB_CONTROL /* move command back to foreground */ tcsetpgrp(STDIN_FILENO,childpid); #endif sleep (2); kill(-childpid,SIGCONT); } tty_reset(); if (WIFEXITED(status)) { code = WEXITSTATUS(status); if (code == 0) { failed = 0; fputs("\nCommand successful. ",stdout); } else printf("\nExit code = %d. ",code); } else { code = WTERMSIG(status); printf("\nAbnormal termination, signal %d",code); #ifdef HAVE_STRSIGNAL signame = strsignal(code); if (signame != 0) printf(" (%s)",signame); #else #if HAVE_DECL_SYS_SIGLIST signame = sys_siglist[code]; if (signame != 0) printf(" (%s)",signame); #endif #endif #ifdef WCOREDUMP if (WCOREDUMP(status)) fputs(", core image dumped",stdout); #endif putchar('\n'); } } /* * List the directory while the user stares at the screen * reading the command output. This way CLEX appears to * restart much faster. All output routines called from * list_directory() must check if curses mode is active. */ xterm_title_set(0,command); list_directory(); ppanel_file->other->expired = 1; tty_press_enter(); xterm_title_set(0,0); return failed; } static int user_confirm(void) { int in, confirmed; fputs("\nExecute the command ? (y = YES) ",stdout); fflush(stdout); tty_setraw(); in = getchar(); tty_reset(); confirmed = in == 'y' || in == 'Y'; puts(confirmed ? "yes\n" : "no\n"); fflush(stdout); return confirmed; } static int test_word(const char *line, const char *word) { char ch; while (*line == ' ') line++; while ( (ch = *word++) != '\0') if (*line++ != ch) return 0; return 1; } /* * return value is the warning level: * 0 = no warning issued * 1 = only mandatory warning(s) * 2 = configurable warning(s) */ static int print_warnings(const char *cmd) { static USTRING cwd = { 0,0 }; int warn; warn = 0; /* 0 = no warning yet */ if (get_cwd_us(&cwd) < 0) { puts("WARNING: current working directory is not accessible"); warn = 1; /* 1 = this warning cannot be turned off */ us_copy(&cwd,"???"); } else if (strcmp(USTR(ppanel_file->dir),USTR(cwd))) { printf("WARNING: current working directory has been renamed:\n" " old name: %s\n" " new name: %s\n", USTR(ppanel_file->dir),USTR(cwd)); us_copy(&ppanel_file->dir,USTR(cwd)); warn = 1; } if (config_num(CFG_WARN_RM) && test_word(cmd,"rm ")) { printf("working directory: %s\n" "WARNING: rm command deletes files, please confirm\n", USTR(cwd)); warn = 2; /* 2 = this warning can be turned off */ } /* following warnings are not appropriate in history mode */ if (get_current_mode() == MODE_FILE) { /* * edit_islong() works with 'textline' instead of 'cmd', * because it is meaningfull only in MODE_FILE */ if (config_num(CFG_WARN_LONG) && edit_islong()) { puts("WARNING: This long command did not fit to the" " command line"); warn = 2; } } fflush(stdout); return warn; } static const char * check_cd(const char *str) { static USTRING dir = { 0,0 }; char ch; const char *dirstr; int i, real_len; FLAG quote, needs_dq, tilde; while (*str == ' ') str++; if (*str++ != 'c') return 0; if (*str++ != 'd') return 0; if (*str == '\0') return clex_data.homedir; /* cd without args */ if (*str++ != ' ') return 0; while (*str == ' ') str++; if (*str == '\0') return clex_data.homedir; /* cd without args */ tilde = *str == '~'; quote = needs_dq = 0; for (real_len = 0, i = tilde /* 0 or 1 */; (ch = str[i]); i++) { if (quote) quote = 0; else if (ch == '\\') quote = needs_dq = 1; else if (ch == ' ') { if (real_len == 0) real_len = i; } else if (real_len || edit_isspecial((unsigned char)ch)) return 0; /* not a simple 'cd' command */ } if (needs_dq) { /* dequote: \x -> x */ if (real_len == 0) real_len = i; us_setsize(&dir,real_len + 1); dequote_txt(str,real_len,USTR(dir)); dirstr = USTR(dir); } else if (real_len) { /* trim off the trailing space */ us_copyn(&dir,str,real_len); dirstr = USTR(dir); } else dirstr = str; return tilde ? dir_tilde(dirstr) : dirstr; } /* * function returns 1 if the command has been executed * (successfully or not), otherwise 0 */ int execute_cmd(const char *cmd) { static FLAG hint = 1; int do_exec, warn_level; const char *dir; /* intercept single 'cd' command */ if ( (dir = check_cd(cmd)) ) { if (changedir(dir) != 0) return 0; hist_save(cmd,0); win_heading(); win_panel(); win_remark("directory changed"); return 1; } curses_stop(); putchar('\n'); puts(cmd); putchar('\n'); fflush(stdout); warn_level = print_warnings(cmd); do_exec = warn_level == 0 || user_confirm(); if (do_exec) hist_save(cmd,execute(cmd) != 0); curses_restart(); if (warn_level >= 2 && TCLR(hint)) win_remark("warnings can be turned off in the config panel"); return do_exec; } clex-3.15/src/exec.h0000644000076400007640000000023007475421623011217 00000000000000extern void exec_initialize(void); extern void exec_shell_reconfig(void); extern void exec_prompt_reconfig(void); extern int execute_cmd(const char *); clex-3.15/src/filepanel.c0000644000076400007640000001620010437341027012220 00000000000000/* * * CLEX File Manager * * Copyright (C) 2001-2006 Vlado Potisk * * CLEX is free software without warranty of any kind; see the * GNU General Public License as set out in the "COPYING" document * which accompanies the CLEX File Manager package. * * CLEX can be downloaded from http://www.clex.sk * */ #include #include /* clex.h */ #include /* errno */ #include /* strcmp() */ #include /* chdir() */ #include "clex.h" #include "filepanel.h" #include "cfg.h" /* config_str() */ #include "completion.h" /* compl_file() */ #include "control.h" /* err_exit() */ #include "directory.h" /* filepos_save() */ #include "edit.h" /* edit_macro() */ #include "exec.h" /* execute_cmd() */ #include "inout.h" /* win_panel() */ #include "list.h" /* list_directory() */ #include "panel.h" /* pan_adjust() */ #include "sdstring.h" /* SDSTR() */ #include "undo.h" /* undo_reset() */ #include "userdata.h" /* userdata_expire() */ #include "ustring.h" /* USTR() */ #include "util.h" /* base_name() */ extern int errno; void files_initialize(void) { const char *dir2; static INPUTLINE filter1, filter2; static PANEL_DESC panel_desc_1 = { 0,0,0,0,PANEL_TYPE_FILE,0,0,&filter1,0 }; static PANEL_DESC panel_desc_2 = { 0,0,0,0,PANEL_TYPE_FILE,0,0,&filter2,0 }; static PANEL_FILE panel_f1 = { &panel_desc_1, { 0,0 }, 0,0,1,0,0 }; static PANEL_FILE panel_f2 = { &panel_desc_2, { 0,0 }, 0,0,1,0,0 }; if (get_cwd_us(&panel_f1.dir) < 0) err_exit("Cannot get the name of the working directory"); dir2 = config_str(CFG_DIR2); if (*dir2 != '/') { dir2 = clex_data.homedir; if (*dir2 != '/') dir2 = USTR(panel_f1.dir); } us_copy(&panel_f2.dir,dir2); panel_f1.other = &panel_f2; ppanel_file = panel_f2.other = &panel_f1; } void files_main_prepare(void) { static FLAG prepared = 0; /* * allow only one run of files_main_prepare(), successive calls * are merely an indirect result of panel exchange commands */ if (TSET(prepared)) return; textline = &line_cmd; edit_nu_kill(); panel = ppanel_file->pd; list_directory(); } int files_find(const char *name) { int i; for (i = 0; i < ppanel_file->pd->cnt; i++) if (strcmp(SDSTR(ppanel_file->files[i]->file),name) == 0) return i; return -1; } /* * this is an error recovery procedure used when the current working * directory and its name stored in the file panel are not in sync */ static void find_valid_cwd(void) { char *dir, *p; win_warning("CHANGE DIR: cannot access panel's directory, " "it will be changed."); ppanel_file->pd->cnt = ppanel_file->selected = 0; dir = USTR(ppanel_file->dir); for (p = dir + strlen(dir); p > dir ; p--) if (*p == '/') { *p = '\0'; if (chdir(dir) == 0) return; } /* last resort */ if (chdir("/") < 0) err_exit("Cannot access the root directory !"); us_copy(&ppanel_file->dir,"/"); } static void changedir_error(int errcode) { const char *msg; switch (errcode) { case EACCES: msg = "Permission denied"; break; case ENOTDIR: msg = "Not a directory"; break; case ENOENT: msg = "No such directory"; break; #ifdef ELOOP case ELOOP: msg = "Symbolic link loop"; break; #endif default: msg = "Cannot change directory"; } win_warning_fmt("CHANGE DIR: %s.",msg); } /* * changes working directory to 'dir' and updates the absolute * pathname in the primary file panel accordingly * * changedir() returns 0 on success, -1 when the directory could * not be changed. In very rare case when multiple errors occur, * changedir() might change to other directory as requested. Note * that in such case it returns 0 (cwd changed). */ int changedir(const char *dir) { int line; FLAG parent; static USTRING savedir = { 0,0 }; if (chdir(dir) < 0) { changedir_error(errno); return -1; } filepos_save(); /* leaving the old directory */ us_copy(&savedir,USTR(ppanel_file->dir)); if (get_cwd_us(&ppanel_file->dir) < 0) { /* not sure where we are -> must leave this dir */ if (chdir(USTR(savedir)) == 0) { /* we are back in old cwd */ changedir_error(0); return -1; } find_valid_cwd(); parent = 0; /* we have ignored the 'dir' */ } else parent = strcmp(dir,"..") == 0; if (strcmp(USTR(savedir),USTR(ppanel_file->dir))) /* panel contents is invalid in different directory */ ppanel_file->pd->cnt = ppanel_file->selected = 0; list_directory(); /* if 'dir' parameter is a pointer to some filepanel entry */ /* list_directory() has just invalidated it */ /* * special case: set cursor to the directory we have just left * because users prefer it this way */ if (parent) { line = files_find(base_name(USTR(savedir))); if (line >= 0) { ppanel_file->pd->curs = line; pan_adjust(ppanel_file->pd); } } return 0; } /* change working directory */ void cx_files_cd(void) { FILE_ENTRY *pfe; pfe = ppanel_file->files[ppanel_file->pd->curs]; if (IS_FT_DIR(pfe->file_type)) { if (changedir(SDSTR(pfe->file)) == 0) { win_heading(); win_panel(); } } else win_remark("not a directory"); } void cx_files_cd_root(void) { changedir("/"); win_heading(); win_panel(); } void cx_files_cd_parent(void) { changedir(".."); win_heading(); win_panel(); } void cx_files_cd_home(void) { changedir(clex_data.homedir); win_heading(); win_panel(); } void cx_files_reread(void) { list_directory(); win_panel(); } /* reread also user account information (users/groups) */ void cx_files_reread_ug(void) { userdata_expire(); list_directory(); win_panel(); } /* exchange panels */ void cx_files_exchange(void) { panel = (ppanel_file = ppanel_file->other)->pd; if (chdir(USTR(ppanel_file->dir)) == -1) { find_valid_cwd(); list_directory(); } else if (ppanel_file->expired) list_directory(); /* list_directory() invokes filepos_save() */ else /* put the new cwd to the top of the list */ filepos_save(); /* allow control_loop() to detect the 'panel' change */ next_mode = MODE_FILE; } /* pressed - several functions: exec, chdir and insert */ void cx_files_enter(void) { FILE_ENTRY *pfe; if (textline->size) { if (execute_cmd(USTR(textline->line))) { cx_edit_kill(); undo_reset(); } } else if (ppanel_file->pd->cnt) { pfe = ppanel_file->files[ppanel_file->pd->curs]; if (IS_FT_DIR(pfe->file_type)) { /* now doing cx_files_cd(); */ if (changedir(SDSTR(pfe->file)) == 0) { win_heading(); win_panel(); } } else if (IS_FT_EXEC(pfe->file_type)) edit_macro("./$F "); } } /* pressed - also multiple functions: complete and insert */ void cx_files_tab(void) { int compl, file_type; /* try completion first, it returns 0 on success */ compl = compl_file(COMPL_TYPE_AUTO); if (compl == -1) { file_type = ppanel_file->pd->cnt ? ppanel_file->files[ppanel_file->pd->curs]->file_type : FT_NA; /* -1: nothing to complete, this will be the first word */ if (IS_FT_EXEC(file_type)) edit_macro("./$F "); else if (IS_FT_DIR(file_type)) edit_macro("$F/"); else /* absolutely clueless ! */ win_remark("COMPLETION: please type at least the " "first character"); } else if (compl == -2) /* -2: nothing to complete, but not in the first word */ edit_macro("$F "); } clex-3.15/src/filepanel.h0000644000076400007640000000072010121115074012214 00000000000000extern void files_initialize(void); extern void files_main_prepare(void); extern int files_find(const char *); extern int changedir(const char *); extern void cx_files_cd(void); extern void cx_files_cd_root(void); extern void cx_files_cd_parent(void); extern void cx_files_cd_home(void); extern void cx_files_reread(void); extern void cx_files_reread_ug(void); extern void cx_files_exchange(void); extern void cx_files_enter(void); extern void cx_files_tab(void); clex-3.15/src/filter.c0000644000076400007640000001521310460101100011527 00000000000000/* * * CLEX File Manager * * Copyright (C) 2001-2006 Vlado Potisk * * CLEX is free software without warranty of any kind; see the * GNU General Public License as set out in the "COPYING" document * which accompanies the CLEX File Manager package. * * CLEX can be downloaded from http://www.clex.sk * */ #include /* clex.h */ #include /* free() */ #include "clex.h" #include "filter.h" #include "directory.h" /* dir_main_panel() */ #include "history.h" /* hist_panel() */ #include "inout.h" /* win_edit() */ #include "match.h" /* match() */ #include "panel.h" /* pan_adjust() */ #include "sdstring.h" /* SDSTR() */ #include "sort.h" /* sort_files() */ #include "util.h" /* substring() */ #include "userdata.h" /* user_panel() */ void cx_filteredit_begin(void) { panel->filter->curs = 0; } void cx_filteredit_end(void) { panel->filter->curs = panel->filter->size; } void cx_filteredit_left(void) { if (panel->filter->curs > 0) panel->filter->curs--; } void cx_filteredit_right(void) { if (panel->filter->curs < panel->filter->size) panel->filter->curs++; } void cx_filteredit_kill(void) { panel->filter->line[panel->filter->curs = panel->filter->size = 0] = '\0'; panel->filter->changed = 1; win_filter(); } /* delete 'cnt' chars at cursor position */ static void delete_chars(int cnt) { int i; panel->filter->size -= cnt; for (i = panel->filter->curs; i <= panel->filter->size; i++) panel->filter->line[i] = panel->filter->line[i + cnt]; panel->filter->changed = 1; } void cx_filteredit_backsp(void) { if (panel->filter->curs) { panel->filter->curs--; delete_chars(1); win_filter(); } } void cx_filteredit_delchar(void) { if (panel->filter->curs < panel->filter->size) { delete_chars(1); win_filter(); } } /* delete until the end of line */ void cx_filteredit_delend(void) { panel->filter->line[panel->filter->size = panel->filter->curs] = '\0'; panel->filter->changed = 1; win_filter(); } /* make room for 'cnt' chars at cursor position */ static char * insert_space(int cnt) { int i; char *ins; if (panel->filter->size + cnt >= INPUT_STR) return 0; ins = panel->filter->line + panel->filter->curs; /* insert new character(s) here */ panel->filter->size += cnt; panel->filter->curs += cnt; for (i = panel->filter->size; i >= panel->filter->curs; i--) panel->filter->line[i] = panel->filter->line[i - cnt]; panel->filter->changed = 1; return ins; } void filteredit_insertchar(int ch) { char *ins; if ( (ins = insert_space(1)) ) { *ins = (char)ch; win_filter(); } } /* * * filter_update functions * * */ static int ftype(const char *expr) { char ch; while ( (ch = *expr++) ) { if (ch == '*' || ch == '?' || ch == '[') return 1; } return 0; } static void filter_update_file(void) { const char *filter; int i, j, cnt, type; FILE_ENTRY *pfe; if (ppanel_file->filt_cnt == 0) return; filter = ppanel_file->pd->filter->line; type = ftype(filter); /* 1 pattern, 0 substring */ if (ppanel_file->filtype != type) { ppanel_file->filtype = type; win_filter(); } if (type && check_sre(filter) != 0) { win_remark("pattern is incomplete"); return; } /* set fmatch flag */ ppanel_file->selected = ppanel_file->filt_sel = 0; for (i = cnt = 0; i < ppanel_file->filt_cnt; i++) { pfe = ppanel_file->files[i]; pfe->fmatch = type ? (*filter == '\0' || match(SDSTR(pfe->file))) : substring(SDSTR(pfe->file),filter,0); if (pfe->fmatch) { cnt++; if (pfe->select) ppanel_file->selected++; } else if (pfe->select) ppanel_file->filt_sel++; } /* sort: fmatch entries before !fmatch entries */ filepos_save(); for (i = 0, j = ppanel_file->filt_cnt; i < cnt; i++) { if (!ppanel_file->files[i]->fmatch) { while (!ppanel_file->files[--j]->fmatch) ; pfe = ppanel_file->files[i]; ppanel_file->files[i] = ppanel_file->files[j]; ppanel_file->files[j] = pfe; } } /* present only the fmatch entries */ ppanel_file->pd->cnt = cnt; sort_files(); filepos_set(); } static void filter_update_dir(void) { int i, save_curs_rel; const char *save_curs_dir; /* save cursor */ if (panel_dir.pd->cnt) { save_curs_dir = panel_dir.dir[panel_dir.pd->curs].name; save_curs_rel = (100 * panel_dir.pd->curs) / panel_dir.pd->cnt; /* % */ } else { save_curs_dir = 0; save_curs_rel = 0; } /* apply filter */ dir_main_panel(); /* restore cursor */ if (save_curs_dir) for (i = 0; i < panel_dir.pd->cnt; i++) if (panel_dir.dir[i].name == save_curs_dir) { panel_dir.pd->curs = i; return; } panel_dir.pd->curs = (save_curs_rel * panel_dir.pd->cnt) / 100; } void filter_update(void) { switch (panel->type) { case PANEL_TYPE_DIR: filter_update_dir(); break; case PANEL_TYPE_FILE: filter_update_file(); break; case PANEL_TYPE_GROUP: group_panel(); break; case PANEL_TYPE_HIST: hist_panel(); break; case PANEL_TYPE_USER: user_panel(); break; } panel->filter->changed = 0; pan_adjust(panel); win_panel(); } /* * * filter_on, filter_off functions * * */ /* * note that filepanel filter can be controlled also from the main menu * and in such case 'panel' does not refer to the file panel; for this * reason all file panel operations which are available from the main menu * must use 'ppanel_file' instead of 'panel' */ static void filter_off_file(void) { ppanel_file->pd->filtering = 0; ppanel_file->pd->cnt = ppanel_file->filt_cnt; ppanel_file->selected += ppanel_file->filt_sel; filepos_save(); sort_files(); filepos_set(); } void filter_off(void) { if (panel->type == PANEL_TYPE_FILE) filter_off_file(); else { /* PANEL_TYPE_DIR, PANEL_TYPE_GROUP, PANEL_TYPE_HIST, PANEL_TYPE_USER */ panel->filtering = 0; filter_update(); win_filter(); } pan_adjust(panel); win_filter(); win_panel(); } static void filter_on_file(void) { ppanel_file->pd->filtering = 1; ppanel_file->pd->filter->curs = ppanel_file->pd->filter->size = 0; ppanel_file->pd->filter->line[0] = '\0'; ppanel_file->pd->filter->changed = 0; ppanel_file->filtype = 0; ppanel_file->filt_cnt = ppanel_file->pd->cnt; ppanel_file->filt_sel = 0; } void cx_filter(void) { if (panel->filter == 0) { win_remark("this panel does not support filtering"); return; } if (panel->filtering == 0) { if (panel->type == PANEL_TYPE_FILE) { filter_on_file(); win_filter(); } else { panel->filtering = 1; cx_filteredit_kill(); panel->filter->changed = 0; } } else if (panel->filter->size == 0) filter_off(); else /* switch focus: filter line (1) <--> input line (2) */ panel->filtering = 3 - panel->filtering; } void cx_filter_toggle(void) { if (ppanel_file->pd->filtering) filter_off_file(); else filter_on_file(); } clex-3.15/src/filter.h0000644000076400007640000000074010421253423011550 00000000000000extern void cx_filteredit_begin(void); extern void cx_filteredit_end(void); extern void cx_filteredit_left(void); extern void cx_filteredit_right(void); extern void cx_filteredit_kill(void); extern void cx_filteredit_backsp(void); extern void cx_filteredit_delchar(void); extern void cx_filteredit_delend(void); extern void filteredit_insertchar(int); extern void filter_update(void); extern void filter_off(void); extern void cx_filter(void); extern void cx_filter_toggle(void); clex-3.15/src/help.c0000644000076400007640000002441310427452760011224 00000000000000/* * * CLEX File Manager * * Copyright (C) 2001-2006 Vlado Potisk * * CLEX is free software without warranty of any kind; see the * GNU General Public License as set out in the "COPYING" document * which accompanies the CLEX File Manager package. * * CLEX can be downloaded from http://www.clex.sk * */ /* * helpfile format: * * - helpfile is a plain text file * - comments beginning with '#' on the first column are ignored * - please no TABs, always use SPACEs * - maximal width is 60 columns (MIN_COLS - 4) * * help file: * @V=VERSION <-- program version * * * .... * * * page: * @P=pgname [@@=heading] <-- new page named 'pgname' starts here * <-- one or more lines follow * * .... * * * line: * literal_text [@@=pgname] <-- line of text with an optional link */ #include #include /* clex.h */ #include /* errno */ #include /* va_list */ #include /* free() */ #include /* vprintf() */ #include /* strcmp() */ #include "clex.h" #include "help.h" #include "cfg.h" /* config_str() */ #include "control.h" /* get_previous_mode() */ #include "inout.h" /* win_panel() */ #include "panel.h" /* pan_adjust() */ #include "util.h" /* emalloc() */ #define HELP_HISTORY_ALLOC 16 /* limits to protect resources */ #define HELP_PAGES_LIMIT 60 /* pages max */ #define HELP_FILESIZE_LIMIT 75000 /* bytes max */ /* help sources: external(optional) and built-in */ static char *ext_help = 0; /* contents of the optional help file */ static HELP_ENTRY built_in_help[] = { # include "help.inc" { 0, 0 } }; /* built-in help */ /* parsed help */ static HELP_ENTRY *helpline = 0; /* help split into lines */ static struct { const char *name; /* page name (for links) */ const char *heading; /* heading to be displayed */ int firstline; /* first line = 'helpline[]' index */ int size; /* total number of lines in this page */ FLAG referred; /* for consistency check */ } helppage[HELP_PAGES_LIMIT]; /* help lines split into pages */ static int pagecnt; /* number of pages in 'helppage[]' */ static int tocnum; /* ToC page number */ /* error handling */ static const char *help_source; /* name of the help_source */ static FLAG helperror; /* there was an error */ /* help history - allows only to go back to previous page */ static struct { int pagenum, top, curs; } history[HELP_HISTORY_ALLOC]; static int head, tail; /* circular buffer indices */ /* increment/decrement (+1/-1) circular buffer index X */ #define MVINDEX(X,N) \ (X = (X + HELP_HISTORY_ALLOC + N) % HELP_HISTORY_ALLOC) extern int errno; static int page2num(const char *pagename) { int i; for (i = 0; i < pagecnt; i++) if (strcmp(helppage[i].name,pagename) == 0) return i; return -1; /* no such page */ } static void help_error_init(const char *filename) { help_source = filename ? filename : ""; helperror = 0; } static void help_error(const char *format, ...) { va_list argptr; if (!TSET(helperror)) txt_printf("HELP: Reading \"%s\"\n",help_source); va_start(argptr,format); fputs("HELP: ",stdout); vprintf(format,argptr); va_end(argptr); } /* read external file into memory and split it into lines */ static int read_external_help(const char *filename) { int error, line; char *ptr, *eot; size_t filesize; filesize = HELP_FILESIZE_LIMIT; ext_help = read_file(filename,&filesize,&error); if (ext_help == 0) { switch (error) { case 1: help_error("Cannot open the file (%s)\n",strerror(errno)); break; case 2: help_error("File is too big, limit is " STR(HELP_FILESIZE_LIMIT) " bytes\n"); break; case 3: help_error("File read error (%s)\n",strerror(errno)); } return -1; } /* count lines + add 1 extra */ line = 1; for (ptr = ext_help; ptr < ext_help + filesize; ptr++) if (*ptr == '\t' || *ptr == '\r') *ptr = ' '; else if (*ptr == '\n' || *ptr == '\0') { *ptr = '\0'; line++; } helpline = emalloc(line * sizeof(HELP_ENTRY)); line = 0; for (ptr = ext_help; ptr < ext_help + filesize; ) { if (*ptr != '#') { helpline[line].txt = ptr; helpline[line].aux = 0; /* split XXXX @@=YYYY, remove trailing spaces after XXXX */ for (eot = ptr; *ptr; ptr++) { if (ptr[0] == '@' && ptr[1] == '@' && ptr[2] == '=') { *ptr = *eot = '\0'; ptr += 3; helpline[line].aux = ptr; break; } else if (*ptr != ' ') eot = ptr + 1; } line++; } /* advance to the next line */ while (*ptr++) ; } /* end of data */ helpline[line].txt = 0; helpline[line].aux = 0; return 0; } /* parse_help() returns -1 on serious error */ static int parse_help(const char *filename) { FLAG pagestart; const char *ptr, *aux; int pg, line; /* initialize error handling */ help_error_init(filename); /* erase previous help */ if (ext_help) { free(ext_help); ext_help = 0; } if (helpline) { if (helpline != built_in_help) free(helpline); helpline = 0; } if (filename == 0) helpline = built_in_help; else if (read_external_help(filename) < 0) return -1; /* parse help */ pagestart = 0; pagecnt = 0; for (line = 0; (ptr = helpline[line].txt); line++) if (ptr[0] == '@' && ptr[1] == 'V' && ptr[2] == '=') { /* version stamp */ if (strcmp(ptr + 3,VERSION)) { help_error("Program and help file versions do not" " match; information\n" " in the on-line help might be inaccurate" " or out-of-date.\n" " Please consider using the built-in help.\n"); } } else if (ptr[0] == '@' && ptr[1] == 'P' && ptr[2] == '=') { /* page begin */ ptr += 3; if (pagecnt == HELP_PAGES_LIMIT) { help_error("Too many help pages, limit is " STR(HELP_PAGES_LIMIT) "\n"); return -1; } if (TSET(pagestart)) help_error("Page @P=%s is empty\n", helppage[pagecnt - 1].name); if ((pg = page2num(ptr)) >= 0) { help_error("Page @P=%s was redefined\n",ptr); helppage[pg].referred = 1; /* exclude from checks */ helppage[pg].name = "@@="; /* unmatchable */ } helppage[pagecnt].name = ptr; aux = helpline[line].aux; helppage[pagecnt].heading = aux ? aux : ptr; helppage[pagecnt].size = 0; helppage[pagecnt].referred = 0; pagecnt++; } else { /* literal text */ if (pagecnt == 0) help_error("Bogus text before the first page\n"); else { if (TCLR(pagestart)) helppage[pagecnt - 1].firstline = line; helppage[pagecnt - 1].size++; if (strlen(ptr) > MIN_COLS - 4) help_error("Line in the @P=%s page is longer " "than %d chars\n", helppage[pagecnt - 1].name,MIN_COLS - 4); } } /*** consistency checks ***/ /* A. broken links */ for (line = 0; (ptr = helpline[line].txt); line++) if ( (aux = helpline[line].aux) ) { if (ptr[0] == '@' && (ptr[1] == 'P' || ptr[1] == 'V') && ptr[2] == '=') continue; /* not a link */ pg = page2num(aux); if (pg >= 0) helppage[pg].referred = 1; else help_error("Broken link: @@=%s\n",aux); } /* B. ToC must exist */ if ( (tocnum = page2num("ToC")) < 0) { help_error("Table of contents @P=ToC is missing\n"); return -1; } helppage[tocnum].referred = 1; /* C. abandoned pages */ for (pg = 0; pg < pagecnt; pg++) if (!helppage[pg].referred) help_error("Abandoned page: @P=%s\n",helppage[pg].name); return 0; } void help_reconfig(void) { if (*config_str(CFG_HELPFILE)) { /* external help */ if (parse_help(config_str(CFG_HELPFILE)) == 0) return; help_error("Using the built-in help instead\n"); } parse_help(0); /* built-in help: each error is fatal */ if (helperror) err_exit("BUG: built-in help is incorrect"); } static void set_page(int pg) { int i; panel_help.pd->min = pg == tocnum ? 0 : -1; panel_help.pd->top = panel_help.pd->curs = panel_help.pd->min; panel_help.pd->cnt = helppage[pg].size; panel_help.pagenum = pg; panel_help.heading = helppage[pg].heading; if (panel_help.pd->cnt) { panel_help.line = helpline + helppage[pg].firstline; for (i = 0; i < panel_help.pd->cnt; i++) if (panel_help.line[i].txt[0] != '\0') { panel_help.pd->curs = i; pan_adjust(panel_help.pd); break; } } win_heading(); } static void help_goto(const char *pagename) { int pg; if ( (pg = page2num(pagename)) < 0) { /* ERROR 404 :-) */ win_warning_fmt("HELP: help-page '%s' not found.",pagename); return; } /* save current page parameters */ history[head].pagenum = panel_help.pagenum; history[head].top = panel_help.pd->top; history[head].curs = panel_help.pd->curs; MVINDEX(head,1); if (head == tail) MVINDEX(tail,1); /* new page */ set_page(pg); win_panel(); } void help_prepare(void) { const char *page; int pg; head = tail = 0; /* CLEX help is context sensitive */ switch (get_previous_mode()) { case MODE_BM_LIST: case MODE_BM_MANAGER: case MODE_BM_EDIT: page = "bookmarks"; break; case MODE_CFG: case MODE_CFG_EDIT_NUM: case MODE_CFG_EDIT_TXT: page = "config"; break; case MODE_COMPARE: page = "compare"; break; case MODE_COMPL: page = "completion"; break; case MODE_DIR: case MODE_DIR_SPLIT: page = "dir"; break; case MODE_FILE: page = "file"; break; /* there is no case MODE_HELP: */ case MODE_HIST: page = "history"; break; case MODE_MAINMENU: page = "menu"; break; case MODE_PASTE: page = "paste"; break; case MODE_SELECT: case MODE_DESELECT: page = "select"; break; case MODE_SORT: page = "sort"; break; case MODE_USER: case MODE_GROUP: page = "user"; break; default: page = "ToC"; } pg = page2num(page); if (pg < 0) pg = tocnum; set_page(pg); panel = panel_help.pd; textline = 0; } /* follow link */ void cx_help_link(void) { const char *link; link = VALID_CURSOR(panel_help.pd) ? panel_help.line[panel_help.pd->curs].aux : "ToC"; if (link) help_goto(link); } /* display table of contents */ void cx_help_contents(void) { if (panel_help.pagenum != tocnum) help_goto("ToC"); } /* go back to previous page */ void cx_help_back(void) { if (head == tail) { win_remark("there is no previous help-page"); return; } MVINDEX(head,-1); set_page(history[head].pagenum); panel_help.pd->top = history[head].top; panel_help.pd->curs = history[head].curs; pan_adjust(panel_help.pd); win_panel(); } clex-3.15/src/help.h0000644000076400007640000000031310427065373011222 00000000000000#define help_initialize help_reconfig extern void help_reconfig(void); extern void help_prepare(void); extern void cx_help_link(void); extern void cx_help_back(void); extern void cx_help_contents(void); clex-3.15/src/history.c0000644000076400007640000001034610427127534011773 00000000000000/* * * CLEX File Manager * * Copyright (C) 2001-2006 Vlado Potisk * * CLEX is free software without warranty of any kind; see the * GNU General Public License as set out in the "COPYING" document * which accompanies the CLEX File Manager package. * * CLEX can be downloaded from http://www.clex.sk * */ #include #include /* clex.h */ #include /* free() */ #include /* strcmp() */ #include "clex.h" #include "history.h" #include "cfg.h" /* config_num() */ #include "edit.h" /* edit_update() */ #include "inout.h" /* win_remark() */ #include "panel.h" /* pan_adjust() */ #include "util.h" /* emalloc() */ #include "ustring.h" /* us_copy() */ static HIST_ENTRY **history;/* command line history */ static int hs_alloc = 0; /* number of allocated entries */ static int hs_cnt; /* entries in use */ static int pn_index; /* index for previous/next cmd */ static USTRING save_line = { 0,0 }; /* for temporary saving of the command line */ void hist_reconfig(void) { int i; static HIST_ENTRY *storage; if (hs_alloc) { free(storage); free(history); free(panel_hist.hist); } hs_alloc = config_num(CFG_H_SIZE); storage = emalloc(hs_alloc * sizeof(HIST_ENTRY)); history = emalloc(hs_alloc * sizeof(HIST_ENTRY *)); panel_hist.hist = emalloc(hs_alloc * sizeof(HIST_ENTRY *)); for (i = 0; i < hs_alloc; i++) { history[i] = storage + i; US_INIT(history[i]->cmd); } hs_cnt = 0; hist_reset_index(); } void hist_panel(void) { int i, j; const char *filter; HIST_ENTRY *curs; if (VALID_CURSOR(panel_hist.pd)) curs = panel_hist.hist[panel_hist.pd->curs]; else { curs = 0; panel_hist.pd->curs = 0; } filter = panel_hist.pd->filtering ? panel_hist.pd->filter->line : 0; for (i = j = 0; i < hs_cnt; i++) { if (history[i] == curs) panel_hist.pd->curs = j; if (filter && !substring(USTR(history[i]->cmd),filter,0)) continue; panel_hist.hist[j++] = history[i]; } panel_hist.pd->cnt = j; } void hist_prepare(void) { panel_hist.pd->filtering = 0; hist_panel(); panel_hist.pd->top = panel_hist.pd->min; panel_hist.pd->curs = pn_index > 0 ? pn_index : 0; panel = panel_hist.pd; textline = &line_cmd; } const HIST_ENTRY * get_history_entry(int i) { return i < hs_cnt ? history[i] : 0; } void hist_reset_index(void) { pn_index = -1; } /* * hist_save() puts the command 'cmd' on the top * of the command history list. */ void hist_save(const char *cmd, int failed) { int i; FLAG new; HIST_ENTRY *x, *top; hist_reset_index(); new = 1; for (top = history[0], i = 0; i < hs_alloc; i++) { x = history[i]; history[i] = top; top = x; if (i == hs_cnt) { hs_cnt++; break; } if (strcmp(USTR(top->cmd),cmd) == 0) { /* avoid duplicates */ new = 0; break; } } if (new) us_copy(&top->cmd,cmd); top->failed = failed; history[0] = top; } /* file panel functions */ static void warn_fail(int n) { if (history[n]->failed) win_remark("this command failed last time"); } /* copy next (i.e. more recent) command from the history list */ void cx_hist_next(void) { if (pn_index == -1) { win_remark("top of the history list"); return; } if (pn_index-- == 0) edit_putstr(USTR(save_line)); else { edit_putstr(USTR(history[pn_index]->cmd)); warn_fail(pn_index); } } /* copy previous (i.e. older) command from the history list */ void cx_hist_prev(void) { if (pn_index >= hs_cnt - 1) { win_remark("bottom of the history list"); return; } if (++pn_index == 0) us_xchg(&save_line,&line_cmd.line); edit_putstr(USTR(history[pn_index]->cmd)); warn_fail(pn_index); } /* history panel functions */ void cx_hist_paste(void) { edit_insertstr(USTR(panel_hist.hist[panel_hist.pd->curs]->cmd),0); } void cx_hist_enter(void) { if (line_cmd.size == 0) cx_hist_paste(); next_mode = MODE_SPECIAL_RETURN; } void cx_hist_del(void) { int i; HIST_ENTRY *del; FLAG move; del = panel_hist.hist[panel_hist.pd->curs]; hs_cnt--; for (move = 0, i = 0; i < hs_cnt; i++) { if (history[i] == del) { if (pn_index > i) pn_index--; else if (pn_index == i) hist_reset_index(); move = 1; } if (move) history[i] = history[i + 1]; } history[hs_cnt] = del; hist_panel(); pan_adjust(panel_hist.pd); win_panel(); } clex-3.15/src/history.h0000644000076400007640000000064710427127537012006 00000000000000#define hist_initialize hist_reconfig extern void hist_reconfig(void); extern void hist_prepare(void); extern void hist_panel(void); extern void hist_save(const char *, int); extern void hist_reset_index(void); extern const HIST_ENTRY *get_history_entry(int i); extern void cx_hist_prev(void); extern void cx_hist_next(void); extern void cx_hist_paste(void); extern void cx_hist_enter(void); extern void cx_hist_del(void); clex-3.15/src/inout.c0000644000076400007640000007476410435065400011436 00000000000000/* * * CLEX File Manager * * Copyright (C) 2001-2006 Vlado Potisk * * CLEX is free software without warranty of any kind; see the * GNU General Public License as set out in the "COPYING" document * which accompanies the CLEX File Manager package. * * CLEX can be downloaded from http://www.clex.sk * */ #include #include /* clex.h */ #include /* iscntrl() */ #include /* va_list */ #include /* strcpy() */ #ifdef HAVE_NCURSES_H # include /* initscr() */ #else # include #endif #ifdef HAVE_TERM_H # include /* enter_bold_mode */ #else # ifdef HAVE_NCURSES_TERM_H # include # endif #endif #include "clex.h" #include "inout.h" #include "cfg.h" /* config_num() */ #include "control.h" /* get_current_mode() */ #include "edit.h" /* edit_adjust() */ #include "panel.h" /* pan_adjust() */ #include "sdstring.h" /* SDSTR() */ #include "signals.h" /* signal_initialize() */ #include "tty.h" /* tty_press_enter() */ #include "userdata.h" /* get_mylogin_at_host() */ #include "ustring.h" /* USTR() */ #ifndef A_NORMAL # define A_NORMAL 0 #endif #ifndef A_BOLD # define A_BOLD A_STANDOUT #endif #ifndef A_REVERSE # define A_REVERSE A_STANDOUT #endif #ifndef A_UNDERLINE # define A_UNDERLINE A_STANDOUT #endif #ifndef ACS_HLINE # define ACS_HLINE '-' #endif /* safe addch() */ #define ADDCH(X) addch(iscntrl(X) ? '?' | attrb : (X)) #define BLANK(X) do { char_line(' ',X); } while (0) static const char *layout_panel, /* layout: file panel part */ *layout_line; /* layout: info line part */ static const char *info_remark = 0, /* this remark is in the information line */ *info_warnmsg = 0; /* this warning is in the information line */ /* pos_xxx are used for win_position() control */ static CODE pos_resize = 0; /* --( COLSxLINES )-- window size */ static CODE pos_wait = 0; /* --< PLEASE WAIT >-- message */ static FLAG pos_panel = 0; /* --< CURSOR/TOTAL >-- normal info */ /* pos_resize, pos_wait: * 2 = msg should be displayed * 1 = msg is displayed and should be cleared * 0 = msg is not displayed * pos_panel: * 1 = data changed --> update the screen * 0 = no change */ static int prevkey = 0; /* previously pressed key */ static chtype attrr, attrb; /* reverse and bold or substitutes */ static int framechar; /* panel frame character (note that ACS_HLINE is an int) */ static void win_info(void); /* defined below */ static void win_position(void); /* defined below */ static char type_symbol[][5] = { " ", "exec", "suid", "Suid", "sgid", "/DIR", "/MNT", "Bdev", "Cdev", "FIFO", "sock", "spec", " ??" }; /* must correspond with FT_XXX */ /* draw everything from scratch */ static void screen_draw_all(void) { int y, x; for (;/* until break */;) { clear(); getmaxyx(stdscr,y,x); display.scrcols = x; display.scrlines = y; display.pancols = x - 4; /* 2 + 2 colums for border */ display.panlines = y - config_num(CFG_CMD_LINES) - 5; /* * there are 2 special positions: the bottom-right corner * is always left untouched to prevent automatic scrolling * and the position just before it is reserved for the * '>' continuation mark */ display.textline_area = x * config_num(CFG_CMD_LINES) - 2; if (x >= MIN_COLS && y >= MIN_LINES) break; /* window too small */ printw("SCREEN: this window %d x %d is too small, " "required is " STR(MIN_LINES) " x " STR(MIN_COLS) " or larger; press ctrl-C to " "exit the CLEX or (if possible) enlarge the window" #ifndef KEY_RESIZE " and press any other key to continue" #endif ". ",y,x); refresh(); if (getch() == CH_CTRL('C')) err_exit("Window is too small"); } win_heading(); win_frame(); win_bar(); if (panel) { /* panel is NULL only when starting clex */ pan_adjust(panel); win_panel(); win_info(); win_filter(); } edit_adjust(); win_edit(); } /* start CURSES */ void curses_initialize(void) { if (TCLR(display.wait)) tty_press_enter(); initscr(); /* restores signal dispositions on FreeBSD ! */ signal_initialize(); /* FreeBSD initscr() bug workaround ! */ raw(); nonl(); noecho(); keypad(stdscr,TRUE); #ifdef HAVE_NOTIMEOUT notimeout(stdscr,TRUE); #endif clear(); refresh(); display.curses = 1; if (enter_reverse_mode && *enter_reverse_mode) attrr = A_REVERSE; else attrr = A_STANDOUT; if (enter_bold_mode && *enter_bold_mode) attrb = A_BOLD; else if (enter_underline_mode && *enter_underline_mode) attrb = A_UNDERLINE; else attrb = A_STANDOUT; win_frame_reconfig(); win_layout_reconfig(); screen_draw_all(); } /* restart CURSES */ void curses_restart(void) { if (TCLR(display.wait)) tty_press_enter(); reset_prog_mode(); touchwin(stdscr); display.curses = 1; screen_draw_all(); } /* stop CURSES */ /* note: this is a cleanup function */ void curses_stop(void) { clear(); refresh(); endwin(); display.curses = 0; } /* set cursor to the proper position and refresh screen */ static void screen_refresh(void) { int pos; if (pos_wait || pos_resize || pos_panel) win_position(); /* display/clear message */ if (panel->filtering == 1) move(display.panlines + 2,13 + panel->filter->curs); else { if (textline == 0) pos = 0; else if (textline->offset) pos = 1 + textline->curs - textline->offset; else pos = textline->curs + textline->promptlen; move(display.panlines + 5 + pos / display.scrcols, pos % display.scrcols); } refresh(); } /* * like printf() but curses mode is suspended if necessary, * txt_printf() is to be used in xxx_reconfig() functions * which may be invoked in both curses and non-curses modes. * * after calling txt_printf() at least once, normal printf() may * be used as well */ void txt_printf(const char *format, ...) { va_list argptr; display.wait = 1; if (display.curses) { curses_stop(); puts("\nReconfiguring the CLEX"); } va_start(argptr,format); vprintf(format,argptr); va_end(argptr); fflush(stdout); } /****** keyboard input functions ******/ /* * get next input char, no processing except screen resize event, * use this input function to get unfiltered input */ int kbd_getraw(void) { int key, retries; for (;/* until return */;) { screen_refresh(); retries = 10; do { if (--retries < 0) err_exit("Cannot read the keyboard input"); key = getch(); } while (key == ERR); #ifdef KEY_RESIZE if (key == KEY_RESIZE) { pos_resize = 2; screen_draw_all(); continue; } #endif #ifdef KEY_SUSPEND if (key == KEY_SUSPEND) return CH_CTRL('Z'); #endif if (key == KEY_BACKSPACE) return CH_CTRL('H'); if (key == KEY_ENTER) return CH_CTRL('M'); if (key == CH_CTRL('G')) return CH_CTRL('C'); if (key == KEY_DC) return '\177'; if (key == KEY_IL) return KEY_IC; return key; } } /* * get next input char, not saved for kbd_esc() usage, * use this function to get a single key unrelated to the rest * of input stream (e.g. "press any key to continue") */ static int kbd_getany(void) { int key; while ((key = kbd_getraw()) == CH_CTRL('L')) /* redraw screen */ wrefresh(curscr); return key; } /* get next input char */ int kbd_input(void) { int ch; static int key = 0; /* show ASCII code */ if (info_remark == 0 && textline != 0) { ch = (unsigned char)USTR(textline->line)[textline->curs]; if (ch != '\0' && iscntrl(ch)) { if (ch >= 1 && ch <= 26) win_remark_fmt("Ctrl-%c ASCII %d",ch + 'A' - 1,ch); else win_remark_fmt("ASCII %d",ch); } } prevkey = key; key = kbd_getany(); /* 1 --> , 2 --> , ... 0 --> */ if (prevkey == CH_ESC && IS_CHAR(key) && isdigit(key)) { prevkey = 0; key = KEY_F((key - '0' + 9) % 10 + 1); } /* dismiss remark (if any) */ if (info_remark) { info_remark = 0; win_info(); } return key; } /* was the previous key an ESC ? */ int kbd_esc(void) { return prevkey == CH_ESC; } /****** output functions ******/ /* * following functions write to these screen areas: * * win_heading /usr/local * win_frame ---------- * win_panel DIR bin * win_panel >DIR etc < * win_panel DIR man * win_frame, win_filter, * win_waitmsg, win_position -< filt >----< 3/9 >- * win_info, win_warning, win_remark 0755 rwxr-xr-x * win_bar [ CLEX file manager ] * win_edit shell $ ls -l_ */ void win_frame_reconfig(void) { switch(config_num(CFG_FRAME)) { case 0: framechar = '-'; break; case 1: framechar = '='; break; default: framechar = ACS_HLINE; } } void win_layout_reconfig(void) { static USTRING layout = { 0,0 }; FLAG fld; char ch, *pch; us_copy(&layout,config_layout); /* split layout to panel fields and line fields */ layout_panel = USTR(layout); for (fld = 0, pch = USTR(layout); (ch = *pch); pch++) if (!TCLR(fld)) { if (ch == '$') fld = 1; else if (ch == '|') { *pch = '\0'; layout_line = pch + 1; return; /* success */ } } layout_line = "$m $p $o"; txt_printf("CONFIG: Incorrect LAYOUT syntax: missing bar '|'\n"); } /* write a line of repeating chars */ static void char_line(int ch, int cnt) { while (cnt-- > 0) addch(ch); } void win_frame(void) { move(1,0); char_line(framechar,display.scrcols); move(display.panlines + 2,0); char_line(framechar,display.scrcols); } static void print_position(const char *msg, int len, int bold) { static int prev_len = 0; if (prev_len > len) { move(display.panlines + 2,display.scrcols - prev_len - 2); char_line(framechar,prev_len - len); } else move(display.panlines + 2,display.scrcols - len - 2); if (bold) attrset(A_BOLD); addstr(msg); if (bold) attrset(A_NORMAL); prev_len = len; } static void win_position(void) { char buffer[48]; int len; if (pos_resize == 2) { len = sprintf(buffer,"( %dx%d )", display.scrcols,display.scrlines); print_position(buffer,len,1); pos_resize = 1; return; } if (pos_wait == 2) { print_position("< PLEASE WAIT >",15,1); pos_wait = 1; return; } pos_wait = pos_resize = pos_panel = 0; if (panel->cnt == 0) { print_position("< NO DATA >",11,1); return; } if (panel->curs < 0) { print_position("",0,0); return; } if (panel->type == PANEL_TYPE_FILE && ppanel_file->selected) len = sprintf(buffer,"< [%d] %d/%d >", ppanel_file->selected,panel->curs + 1,panel->cnt); else len = sprintf(buffer,"< %d/%d >",panel->curs + 1,panel->cnt); print_position(buffer,len,0); } void win_waitmsg(void) { if (display.curses && pos_wait == 0) { pos_wait = 2; screen_refresh(); } } void win_filter(void) { int len; len = INPUT_STR + 12; move(display.panlines + 2,2); if (panel->filtering) { if (panel->type == PANEL_TYPE_FILE && ppanel_file->filtype) addstr("< pattern: "); /* 11 */ else addstr("< filter: "); /* 11 */ attrset(attrb); addstr(panel->filter->line); attrset(A_NORMAL); addstr(" >"); /* 2 */ len -= 13 + panel->filter->size; } char_line(framechar,len); } /* * putstr_trunc() writes string 'str' padding or truncating it * to the total length of 'maxwidth'. Its behavior might be altered * by OPT_XXX options (may be OR-ed together) * * putstr_trunc() returns the total number of characters written * (only useful with OPT_NOPAD) */ #define OPT_NOPAD 1 /* do not pad */ #define OPT_NOCONT 2 /* do not write continuation mark '>' */ #define OPT_SQUEEZE 4 /* squeeze long str in the middle: abc...xyz */ static int putstr_trunc(const char *str, int maxwidth, int options) { int i, ch, len, dots, part1, part2; if (maxwidth <= 0) return 0; if (options & OPT_SQUEEZE) { len = strlen(str); if (len > maxwidth) { dots = maxwidth >= 6 ? 4 : 1; part2 = 5 * (maxwidth - dots) / 8; part1 = maxwidth - dots - part2; putstr_trunc(str,part1,OPT_NOCONT); char_line('.',dots); putstr_trunc(str + len - part2,part2,0); return maxwidth; } /* else: SQUEEZE option is superfluous --> ignored */ } for (i = 0; i < maxwidth - 1; i++) if ( (ch = (unsigned char)str[i]) ) ADDCH(ch); else { /* EOL */ if (options & OPT_NOPAD) return i; BLANK(maxwidth - i); return maxwidth; } ch = (unsigned char)str[i]; if (ch == '\0') { if (options & OPT_NOPAD) return i; addch(' '); } else if (str[i + 1] && !(options & OPT_NOCONT)) addch('>' | attrb); /* continuation mark in bold font */ else ADDCH(ch); return maxwidth; } /* file panel heading: primary + secondary panel's directory */ static void twodirs(void) { int len1, len2, opt1, opt2, width; const char *dir1, *dir2; /* * directory names are separated by 2 spaces * their width is kept in ratio 5:3 */ width = display.scrcols - 2; /* available room */ len1 = strlen(dir1 = USTR(ppanel_file->dir)); len2 = strlen(dir2 = USTR(ppanel_file->other->dir)); opt1 = opt2 = 0; if (len1 + len2 <= width) len1 = width - len2; /* enough room */ else if (len1 <= (5 * width) / 8) { len2 = width - len1; /* squeeze second */ opt2 = OPT_SQUEEZE; } else if (len2 <= (3 * width) / 8) { len1 = width - len2; /* squeeze first */ opt1 = OPT_SQUEEZE; } else { len1 = (5 * width) / 8; /* squeeze both */ len2 = width - len1; opt1 = opt2 = OPT_SQUEEZE; } attrset(attrb); putstr_trunc(dir1,len1,opt1); attrset(A_NORMAL); addstr(" "); putstr_trunc(dir2,len2,opt2); } /* panel heading - top screen line */ void win_heading(void) { int mode, len; const char *msg; move(0,0); mode = get_current_mode(); if (mode == MODE_FILE) { twodirs(); return; } addch(' '); len = 1; switch (mode) { case MODE_BM_EDIT: msg = "BOOKMARK MANAGER > EDIT"; break; case MODE_BM_LIST: msg = "CHANGE WORKING DIRECTORY > BOOKMARKS"; break; case MODE_BM_MANAGER: msg = "BOOKMARK MANAGER | U/D = up/down, or I, or R, = edit"; break; case MODE_CFG: msg = "CONFIGURATION | = change, O = original, S = standard"; break; case MODE_CFG_EDIT_NUM: case MODE_CFG_EDIT_TXT: msg = "CONFIGURATION > EDIT"; break; case MODE_COMPARE: msg = "DIRECTORY COMPARE"; break; case MODE_COMPL: msg = panel_compl.description; addstr(msg); len += strlen(msg); msg = " COMPLETION"; break; case MODE_DIR: case MODE_DIR_SPLIT: msg = "CHANGE WORKING DIRECTORY"; break; case MODE_GROUP: msg = "GROUP INFORMATION"; break; case MODE_HELP: addstr("HELP: "); len = 7; attrset(attrb); msg = panel_help.heading; break; case MODE_HIST: msg = "COMMAND HISTORY | = insert, = delete"; break; case MODE_MAINMENU: msg = "MAIN FUNCTION MENU"; break; case MODE_PASTE: msg = "COMPLETE/INSERT NAME"; break; case MODE_SELECT: case MODE_DESELECT: msg = "DESELECT FILES"; if (mode == MODE_SELECT) msg += 2; /* DESELECT... --> SELECT ... */ break; case MODE_SORT: msg = "SORT ORDER"; break; case MODE_USER: msg = "USER INFORMATION"; break; default: /* mode not set yet (during start-up) */ msg = "CLEX"; } putstr_trunc(msg,display.scrcols - len,0); if (mode == MODE_HELP) attrset(A_NORMAL); } /* "0644" -> "rw-r--r--" */ static void print_perms(const char *octal) { static const char *set1[8] = { "---","--x","-w-","-wx","r--","r-x","rw-","rwx" }, *set2[8] = { "--S","--s","-wS","-ws","r-S","r-s","rwS","rws" }, *set3[8] = { "--T","--t","-wT","-wt","r-T","r-t","rwT","rwt" }; addstr(((octal[0] - '0') & 4 ? set2 : set1)[(octal[1] - '0') & 7]); addstr(((octal[0] - '0') & 2 ? set2 : set1)[(octal[2] - '0') & 7]); addstr(((octal[0] - '0') & 1 ? set3 : set1)[(octal[3] - '0') & 7]); } /* * see CFG_LAYOUT1 for more information about 'fields', * function returns the remaining unused width */ static int print_fields(FILE_ENTRY *pfe, int width, const char *fields) { const char *txt; FLAG fld, left_align; int ch, i, fw; static char field[3] ="$x"; for (fld = left_align = 0; width > 0 && (ch = (unsigned char)*fields++); ) { if (!TCLR(fld)) { if (ch == '$') fld = 1; else { addch(ch); width--; /* choose proper alignment (left or right) */ left_align = (ch != ' '); } } else { switch (ch) { case 'a': /* access date/time */ fw = display.date_len; txt = pfe->atime_str; break; case 'd': /* modification date/time */ fw = display.date_len; txt = pfe->mtime_str; break; case 'i': /* inode change date/time */ fw = display.date_len; txt = pfe->ctime_str; break; case 'l': /* links (total number) */ fw = FE_LINKS_STR - 1; txt = pfe->links_str; break; case 'L': /* links (flag) */ fw = 3; txt = pfe->links ? "LNK" : " "; break; case 'm': /* file mode */ fw = FE_MODE_STR - 1; txt = pfe->mode_str; break; case 'M': /* file mode (alternative format) */ fw = FE_MODE_STR - 1; txt = pfe->normal_mode ? "" : pfe->mode_str; break; case 'o': /* owner */ fw = FE_OWNER_STR - 1; txt = pfe->owner_str; break; case 'p': /* permissions */ fw = 9; /* rwxrwxrwx */ txt = 0; break; case 'P': /* permissions (alternative format) */ fw = 9; txt = pfe->normal_mode ? "" : 0; break; case 's': /* file size (device major/minor) */ fw = FE_SIZE_DEV_STR - 1; txt = pfe->size_str; break; case 'S': /* file size (not for directories) */ fw = FE_SIZE_DEV_STR - 1; txt = IS_FT_DIR(pfe->file_type) ? "" : pfe->size_str; break; case 't': /* file type */ fw = 4; txt = type_symbol[pfe->file_type]; break; case '>': /* symbolic link */ fw = 2; txt = pfe->symlink ? "->" : " "; break; case '*': /* selection mark */ fw = 1; txt = pfe->select ? "*" : " "; break; case '$': /* literal $ */ fw = 1; txt = "$"; break; case '|': /* literal | */ fw = 1; txt = "|"; break; default: /* syntax error */ fw = 2; field[1] = ch; txt = field; } if (width < fw) break; /* * txt == NULL - compute the string * txt == "" - leave the field blank * txt == "string" - print this string */ if (txt == 0) { /* $p */ if (pfe->file_type != FT_NA) print_perms(pfe->mode_str); else BLANK(fw); } else if (*txt == '\0') BLANK(fw); else if (left_align && *txt == ' ') { /* change alignment from right to left */ for (i = 1; txt[i] == ' '; i++) ; addstr(txt + i); BLANK(i); } else addstr(txt); width -= fw; } } return width; } static void win_info_extra_line(int ln) { const char *msg; msg = panel->extra[ln].info; if (msg) { if (msg[0] == '@') { /* special handling */ addstr(" working directory is "); /* 23 */ putstr_trunc(USTR(ppanel_file->dir),display.scrcols - 23,0); } else { addstr(" "); putstr_trunc(msg,display.scrcols - 2,0); } } else clrtoeol(); } static void pfe_info(FILE_ENTRY *pfe) { if (pfe->file_type == FT_NA) addstr("no status information available"); else if (print_fields(pfe,display.scrcols,layout_line) == 0) return; clrtoeol(); } /* information line */ static void win_info(void) { int width; const char *msg; move(display.panlines + 3,0); /* warnmsg has greater priority than a remark */ if (info_warnmsg) { flash(); attrset(attrb); width = putstr_trunc(info_warnmsg,display.scrcols - 15,OPT_NOPAD); attrset(A_NORMAL); addstr(" Press any key."); /* 15 */ if (display.scrcols - width > 15) clrtoeol(); return; } if (info_remark) { attrset(attrb); addstr("-- "); /* 3 */ width = putstr_trunc(info_remark,display.scrcols - 6,OPT_NOPAD); addstr(" --"); /* 3 */ attrset(A_NORMAL); if (display.scrcols - width > 6) clrtoeol(); return; } if (panel->curs < 0 && panel->min < 0) { /* extra panel lines */ win_info_extra_line(panel->curs - panel->min); return; } if (panel->cnt == 0) { clrtoeol(); return; } switch (panel->type) { case PANEL_TYPE_CFG: addstr(" "); /* 2 */ msg = panel_cfg.config[panel->curs].help; putstr_trunc(msg,display.scrcols - 2,0); break; case PANEL_TYPE_COMPL: if ( (msg = panel_compl.candidate[panel->curs].aux) ) { addstr(" additional data: "); /* 19 */ putstr_trunc(msg,display.scrcols - 19,0); } else clrtoeol(); break; case PANEL_TYPE_FILE: pfe_info(ppanel_file->files[panel->curs]); break; default: clrtoeol(); } } /* warning message - can be used also in text mode */ void win_warning(const char *msg) { if (!display.curses) { if (get_current_mode() == 0) /* startup */ display.wait = 1; else { /* directory re-read after cmd execution */ putchar('\n'); fflush(stdout); } puts(msg); return; } /* * win_info() is responsible for this screen area, * real work is performed there */ info_warnmsg = msg; win_info(); kbd_getany(); info_warnmsg = 0; win_info(); } void win_warning_fmt(const char *format, ...) { va_list argptr; static char buff[160]; va_start(argptr,format); vsnprintf(buff,sizeof(buff),format,argptr); va_end(argptr); win_warning(buff); } void win_remark_fmt(const char *format, ...) { va_list argptr; static char buff[160]; if (!display.curses) { txt_printf("BUG: win_remark_fmt(\"%s\",...)\n" " called in text mode\n",format); return; } va_start(argptr,format); vsnprintf(buff,sizeof(buff),format,argptr); va_end(argptr); info_remark = buff; win_info(); } /* simplified version, 'str' must not be an automatic variable */ void win_remark(const char *str) { if (!display.curses) { txt_printf("BUG: win_remark(\"%s\")\n" " called in text mode\n",str); return; } info_remark = str; win_info(); } void win_completion(int cnt, const char *chars) { int i; char buffer[300], *dst; if (chars == 0) { win_remark_fmt("%d completion possibilities, " "press again for more info",cnt); return; } dst = buffer; if (chars[0]) { strcpy(dst,""); /* 6 */ dst += 6; } for (i = 1; i < 256; i++) if (chars[i]) *dst++ = i; *dst = '\0'; win_remark_fmt("next char: %s",buffer); } void win_bar(void) { int len; attrset(attrr); move(display.panlines + 4,0); len = strlen(clex_data.login_at_host) + 2; /* + 2 spaces */ addstr(" CLEX file manager - "); /* 21 */ putstr_trunc(clex_data.admin ? "ADMIN MODE" : "alt-M for menu, F1 for help",display.scrcols - 21 - len,0); addch(' '); putstr_trunc(clex_data.login_at_host,len + 1,0); attrset(A_NORMAL); } void win_edit(void) { int width, offset; move(display.panlines + 5,0); /* special case: no textline */ if (textline == 0) { clrtobot(); return; } /* special case: empty line (prompt not highlighted) */ if (textline->size == 0) { addstr(textline->prompt); clrtobot(); return; } /* prompt (or continuation mark) */ offset = textline->offset; width = display.textline_area; if (offset == 0) { if ((panel->type != PANEL_TYPE_DIR_SPLIT && panel->type != PANEL_TYPE_DIR) || panel->norev) attrset(attrb); addstr(textline->prompt); width -= textline->promptlen; } else { attrset(attrb); addch('<'); width--; } attrset(A_NORMAL); putstr_trunc(USTR(textline->line) + offset,width + 1,0); } /****** win_panel() and friends ******/ static void draw_line_bm(int ln) { putstr_trunc(USTR(panel_bm_lst.bm[ln]),display.pancols,0); } static void draw_line_cfg(int ln) { putstr_trunc(panel_cfg.config[ln].var,CFGVAR_LEN,0); addstr(" = "); /* 3 */ putstr_trunc(config_print_value(ln),display.pancols - CFGVAR_LEN - 3,0); } static void draw_line_compare(int ln) { static const char *description[] = { "0: name, type (symbolic links ok)", "1: name, type, size (symbolic links ok)", "2: name, type, size", "3: name, type, size, ownership+permissions", "4: name, type, size, contents", "5: name, type, size, ownership+permissions, contents", }; putstr_trunc(description[ln],display.pancols,0); } static void draw_line_compl(int ln) { COMPL_ENTRY *pcc; pcc = panel_compl.candidate + ln; if (panel_compl.filenames) { addstr(pcc->is_link ? "-> " : " " ); /* 3 */ addstr(type_symbol[pcc->file_type]); /* 4 */ addstr(" "); /* 2 */ } else BLANK(9); putstr_trunc(SDSTR(pcc->str),display.pancols - 9,0); } static void draw_line_dir(int ln) { int shlen; if ((shlen = panel_dir.dir[ln].shlen) && (ln == panel_dir.pd->top || shlen >= display.pancols)) shlen = 0; if (shlen) { BLANK(shlen - 2); addstr("__"); } putstr_trunc(panel_dir.dir[ln].name + shlen, display.pancols - shlen,0); } static void draw_line_dir_split(int ln) { int len; len = panel_dir_split.dir[ln].shlen; if (len > display.pancols) putstr_trunc(panel_dir_split.dir[ln].name,display.pancols,0); else { putstr_trunc(panel_dir_split.dir[ln].name,len,OPT_NOCONT); BLANK(display.pancols - len); } } static void draw_line_file(int ln) { FILE_ENTRY *pfe; int width; pfe = ppanel_file->files[ln]; if (pfe->select) attron(attrb); /* 10 columns reserved for the filename */ width = 10 + print_fields(pfe,display.pancols - 10,layout_panel); if (!pfe->symlink) putstr_trunc(SDSTR(pfe->file),width,0); else { width -= putstr_trunc(SDSTR(pfe->file),width,OPT_NOPAD); width -= putstr_trunc(" -> ",width,OPT_NOPAD); putstr_trunc(USTR(pfe->link),width,0); } if (pfe->select) attroff(attrb); } static void draw_line_grp(int ln) { printw("%10u ",(unsigned int)panel_group.groups[ln].gid); putstr_trunc(panel_group.groups[ln].group,display.pancols - 12,0); } static void draw_line_help(int ln) { FLAG link; if ( (link = panel_help.line[ln].aux != 0) ) attron(attrb); putstr_trunc(panel_help.line[ln].txt,display.pancols,0); if (link) attroff(attrb); } static void draw_line_hist(int ln) { if (panel_hist.hist[ln]->failed) addstr("failed: "); /* 8 */ else BLANK(8); putstr_trunc(USTR(panel_hist.hist[ln]->cmd),display.pancols - 8,0); } static void draw_line_mainmenu(int ln) { static const char *description[] = { "help ", "change working directory alt-W", " change into root directory alt-/", " change into parent directory alt-.", " change into home directory alt-~", " bookmarks alt-K", "command history alt-H", "sort order for filenames alt-S", "re-read current directory ctrl-R", "compare directories alt-=", "filter on/off ctrl-F", "user (group) information alt-U (alt-G)", "select files: select all (alt-M) +", " deselect all (alt-M) -", " select using pattern alt-+", " deselect using pattern alt--", " invert selection alt-*", "configure CLEX alt-C", "program version alt-V", "quit alt-Q" /* must correspond with tab_mainmenu[] in control.c */ }; putstr_trunc(description[ln],display.pancols,0); } static void draw_line_pastemenu(int ln) { static const char *description[] = { "complete name (auto)", "complete filename - any type", "complete filename - directory", "complete filename - executable", "complete username", "complete environment variable name", "complete command from the command history alt-P", "insert current filename ", "insert all selected filenames ", "insert full pathname of current file ctrl-A", "insert secondary working directory name ctrl-E", "insert current working directory name ctrl-E", "insert the target of a symbolic link ctrl-O" /* must correspond with tab_pastemenu[] in control.c */ }; putstr_trunc(description[ln],display.pancols,0); } static void draw_line_sort(int ln) { static const char *description[] = { "name", ".extension", "size [small -> large]", "size [large -> small]", "time of last modification [recent -> old]", "time of last modification [old -> recent]", "reversed name (use in sendmail queue directory)" /* must correspond with SORT_XXX */ }; addstr(panel_sort.order == ln ? "(x" : "( "); /* 2 */ addstr(") sort by "); /* 10 */ putstr_trunc(description[ln],display.pancols - 12,0); } static void draw_line_usr(int ln) { int len; printw("%10u ",(unsigned int)panel_user.users[ln].uid); len = putstr_trunc(panel_user.users[ln].login,48,OPT_NOPAD); if (len < 14) { BLANK(14 - len); len = 14; } addstr(" "); putstr_trunc(panel_user.users[ln].gecos,display.pancols - len - 13,0); } static void draw_panel_extra_line(int ln) { const char *msg; FLAG help; help = panel->type == PANEL_TYPE_HELP; if (help) { attrset(attrb); addstr("==> "); /* 4 */ } else addstr("--> "); /* 4 */ msg = panel->extra[ln].text; putstr_trunc(msg ? msg : "Leave this panel",display.pancols - 4,0); if (help) attrset(A_NORMAL); } static void draw_panel_line(int y) { int ln; /* must correspond with PANEL_TYPE_XXX */ static void (*draw_line[])(int) = { draw_line_bm, draw_line_cfg, draw_line_compare, draw_line_compl, draw_line_dir, draw_line_dir_split, draw_line_file, draw_line_grp, draw_line_help, draw_line_hist, draw_line_mainmenu, draw_line_pastemenu, draw_line_sort, draw_line_usr }; move(2 + y,0); ln = panel->top + y; if (ln >= panel->cnt) { clrtoeol(); return; } if (panel->curs == ln) { addch('>'); if (!panel->norev) attrset(attrr); addch(' '); } else addstr(" "); if (ln < 0) draw_panel_extra_line(ln - panel->min); else (*draw_line[panel->type])(ln); if (panel->curs == ln) { addch(' '); attrset(A_NORMAL); addch('<'); } else addstr(" "); } static void draw_panel(int optimize) { static int save_top, save_curs, save_ptype = PANEL_TYPE_NONE; int y; if (panel->type != save_ptype) { /* panel type has changed */ optimize = 0; save_ptype = panel->type; } if (optimize && save_top == panel->top) { /* redraw only the old and new current lines */ draw_panel_line(save_curs - panel->top); if (save_curs != panel->curs) { pos_panel = 1; draw_panel_line(panel->curs - panel->top); save_curs = panel->curs; } else if (panel->type == PANEL_TYPE_FILE) /* number of selected files could have changed */ pos_panel = 1; } else { pos_panel = 1; /* redraw all lines */ for (y = 0; y < display.panlines; y++) draw_panel_line(y); save_top = panel->top; save_curs = panel->curs; } win_info(); } /* win_panel() without optimization */ void win_panel(void) { draw_panel(0); } /* * win_panel() with optimization * * use this win_panel() version if the only change made since last * win_panel() call is a cursor movement or a modification of the * current line */ void win_panel_opt(void) { draw_panel(1); } clex-3.15/src/inout.h0000644000076400007640000000137410415731040011424 00000000000000extern void curses_initialize(void); extern void curses_stop(void); extern void curses_restart(void); extern void txt_printf(const char *, ...); extern int kbd_input(void); extern int kbd_esc(void); extern int kbd_getraw(void); extern void win_frame_reconfig(void); extern void win_layout_reconfig(void); extern void win_bar(void); extern void win_edit(void); extern void win_remark_fmt(const char *, ...); extern void win_remark(const char *); extern void win_filter(void); extern void win_frame(void); extern void win_heading(void); extern void win_panel(void); extern void win_panel_opt(void); extern void win_warning(const char *); extern void win_warning_fmt(const char *, ...); extern void win_waitmsg(void); extern void win_completion(int, const char *); clex-3.15/src/lang.c0000644000076400007640000000552110420644365011211 00000000000000/* * * CLEX File Manager * * Copyright (C) 2001-2006 Vlado Potisk * * CLEX is free software without warranty of any kind; see the * GNU General Public License as set out in the "COPYING" document * which accompanies the CLEX File Manager package. * * CLEX can be downloaded from http://www.clex.sk * */ #include #include /* time_t */ #include /* isalpha */ #include /* strchr() */ #include /* strftime() */ /* setlocale() */ #ifdef HAVE_LOCALE_H # include #endif #include "clex.h" #include "lang.h" #include "inout.h" /* txt_printf() */ static char sep000 = '.'; /* thousands separator */ static const char *fmt_date = "dMy"; /* format string for date */ static int clock24 = 1; /* 12 or 24 hour clock */ void lang_initialize(void) { #if defined(HAVE_SETLOCALE) && defined(HAVE_STRFTIME) FLAG errd; char *in, *out, teststr[32]; static char result[16]; struct lconv *lc; time_t testtime; testtime = 2916000; /* 03-feb-1970 18:00 */ if (setlocale(LC_ALL,"") == 0) txt_printf("LOCALE: cannot set program's locale\n"); /* thousands separator - dot or comma */ lc = localeconv(); sep000 = lc->thousands_sep[0]; if (sep000 != ',' && sep000 != '.') /* the opposite of the decimal point */ sep000 = lc->decimal_point[0] == ',' ? '.' : ','; /* 12/24 hour clock */ if (strftime(teststr,sizeof(teststr),"%X",gmtime(&testtime)) == 0) txt_printf("LOCALE: unable to autodetect time format," " using 24 hour clock"); else /* it is either 18:00 or 06:00 PM */ clock24 = strchr(teststr,'6') == 0; /* date format */ errd = 0; if (strftime(teststr,sizeof(teststr),"%x",gmtime(&testtime)) == 0) errd = 1; else for (in = teststr, out = result; /* until break */;) { if (strncmp(in,"03",2) == 0) { in += 2; *out++ = 'd'; } else if (strncmp(in,"3",1) == 0) { in += 1; *out++ = 'D'; } else if (strncmp(in,"02",2) == 0) { in += 2; *out++ = 'm'; } else if (strncmp(in,"1970",4) == 0) { in += 4; *out++ = 'Y'; } else if (strncmp(in,"70",2) == 0) { in += 2; *out++ = 'y'; } else if (isalpha((unsigned char)*in)) { /* * assuming this is month in written form * e.g. feb, February, or even some other language */ while (isalpha((unsigned char)*++in)) ; *out++ = 'M'; } else { /* assuming punctuation */ if ( (*out++ = *in++) == '\0') { fmt_date = result; break; /* finished */ } } if (out >= result + sizeof(result)) { errd = 1; break; /* output buffer overflow */ } } if (errd) txt_printf("LOCALE: unable to autodetect date format," " using \"dMy\" format"); #endif } int lang_sep000(void) { return sep000; } int lang_clock24(void) { return clock24; } const char * lang_fmt_date(void) { return fmt_date; } clex-3.15/src/lang.h0000644000076400007640000000021010024706742011202 00000000000000extern void lang_initialize(void); extern int lang_sep000(void); extern const char *lang_fmt_date(void); extern int lang_clock24(void); clex-3.15/src/list.c0000644000076400007640000004213110462677723011253 00000000000000/* * * CLEX File Manager * * Copyright (C) 2001-2006 Vlado Potisk * * CLEX is free software without warranty of any kind; see the * GNU General Public License as set out in the "COPYING" document * which accompanies the CLEX File Manager package. * * CLEX can be downloaded from http://www.clex.sk * */ #include #include /* time_t */ #include /* stat() */ #include /* errno */ #include /* filter_update() */ #include /* sprintf() */ #include /* strcmp() */ #include /* stat() */ /* struct tm, time() */ #if TIME_WITH_SYS_TIME # include # include #else # if HAVE_SYS_TIME_H # include # else # include # endif #endif /* readdir() */ #ifdef HAVE_DIRENT_H # include #else # define dirent direct # ifdef HAVE_SYS_NDIR_H # include # endif # ifdef HAVE_SYS_DIR_H # include # endif # ifdef HAVE_NDIR_H # include # endif #endif /* major() */ #ifdef MAJOR_IN_MKDEV # include #endif #ifdef MAJOR_IN_SYSMACROS # include #endif #ifndef S_ISLNK # define S_ISLNK(X) (0) #endif #include "clex.h" #include "list.h" #include "cfg.h" /* config_num() */ #include "directory.h" /* filepos_save() */ #include "inout.h" /* win_warning() */ #include "lang.h" /* lang_sep000 */ #include "sdstring.h" /* SDSTR() */ #include "sort.h" /* sort_files() */ #include "userdata.h" /* lookup_login() */ #include "ustring.h" /* USTR() */ #include "util.h" /* emalloc() */ /* * additional FILE_ENTRIES to be allocated when the file panel is full, * i.e. when all existing entries in 'files' are occupied */ #define FE_ALLOC_UNIT 128 #define CACHE_SIZE 24 /* size of cache for user/group name lookups */ extern int errno; static time_t now; static FLAG do_a, do_d, do_i, do_l, do_L, do_m, do_M, do_o, do_s; static FLAG clock24, use_pathname = 0; static char sep000; /* thousands separator */ static int tpad, dpad; /* length of padding for time and date */ static int K2; /* kilobyte/2 */ static const char *fmt_date;/* format string for date */ static dev_t dirdev; /* data of the inspected directory */ static mode_t normal_file, normal_dir; static int ucache_cnt = 0, gcache_cnt = 0; void list_reconfig(void) { const char *fields; FLAG fld; char ch; int i, dlen, tlen; /* KILOBYTE */ K2 = config_num(CFG_KILOBYTE) ? 500 : 512; /* FMT_DATE */ fmt_date = config_str(CFG_FMT_DATE); if (*fmt_date == '\0') fmt_date = lang_fmt_date(); /* compute the field length */ for (dlen = i = 0; (ch = fmt_date[i]); i++) switch (ch) { case 'Y': dlen += 4; break; case 'M': dlen += 3; break; case 'y': case 'm': case 'd': case 'D': dlen += 2; break; default: dlen += 1; } if (dlen >= FE_TIME_STR) { txt_printf("FMT_DATE: " "date string is too long, using \"dMy\" format\n"); fmt_date="dMy"; dlen = 7; } /* FMT_TIME */ switch (config_num(CFG_FMT_TIME)) { case 0: clock24 = lang_clock24(); break; case 1: clock24 = 0; break; case 2: clock24 = 1; break; } tlen = clock24 ? 5 : 7; /* DD:MM or DD:MMam */ /* * time string and date string are displayed in the same column, * prepare padding string to equalize their lengths */ if (tlen >= dlen) { tpad = 0; dpad = tlen - dlen; display.date_len = tlen; } else { dpad = 0; tpad = dlen - tlen; display.date_len = dlen; } /* FMT_NUMBER */ switch (config_num(CFG_FMT_NUMBER)) { case 0: sep000 = lang_sep000(); break; case 1: sep000 = '.' ; break; case 2: sep000 = ',' ; break; } /* which fields are going to be displayed ? */ do_a = do_d = do_i = do_l = 0; do_L = do_m = do_M = do_o = do_s = 0; for (fld = 0, fields = config_layout; (ch = *fields++); ) if (!TCLR(fld)) { if (ch == '$') fld = 1; } else { switch (ch) { case 'a': do_a = 1; break; case 'd': do_d = 1; break; case 'i': do_i = 1; break; case 'L': do_L = 1; break; case 'l': do_l = 1; break; case 'P': /* $P -> $M */ case 'M': do_M = 1; /* $M -> $m */ case 'p': /* $p -> $m */ case 'm': do_m = 1; break; case 'o': do_o = 1; break; case 'S': /* $S -> $s */ case 's': do_s = 1; break; /* default: ignore unknown formatting character */ } } } void list_initialize(void) { normal_dir = 0777 & ~clex_data.umask; /* dir or executable file */ normal_file = 0666 & ~clex_data.umask; /* any other file */ list_reconfig(); } /* * when calling any of the stat2xxx() functions always make sure * the string provided as 'str' argument can store the result. * Check the FE_XXX_STR #defines in clex.h for proper sizes. */ static void stat2time(char *str, time_t tm) { int i, len, hour; char ch; const char *ampm; struct tm *ptm; static char *month[] = { "jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec" }; ptm = localtime(&tm); /* print time of day, after 18 hrs (64800s) print date */ /* 5 mins (300s) tolerance */ if (tm <= now + 300 && now <= tm + 64800) { if (clock24) { hour = ptm->tm_hour; ampm = ""; } else { hour = 1 + (ptm->tm_hour + 11) % 12; ampm = ptm->tm_hour < 12 ? "am" : "pm"; } for (len = 0; len < tpad; len++) *str++ = ' '; sprintf(str,"%02d:%02d%s",hour,ptm->tm_min,ampm); } else { for (len = 0; len < dpad; len++) *str++ = ' '; for (i = 0; (ch = fmt_date[i]); i++) { switch (ch) { case 'Y': /* Y10K compliant ;-) */ sprintf(str,"%04d",(1900 + ptm->tm_year) % 10000); str += 4; break; case 'y': sprintf(str,"%02d",ptm->tm_year % 100); str += 2; break; case 'M': strcpy(str,month[ptm->tm_mon]); str += 3; break; case 'm': sprintf(str,"%02d",ptm->tm_mon + 1); str += 2; break; case 'd': sprintf(str,"%02d",ptm->tm_mday); str += 2; break; case 'D': sprintf(str,"%2d",ptm->tm_mday); str += 2; break; default: *str++ = ch; *str = '\0'; } } } } static void stat2size(char *str, off_t size) { int exp, roundup; for (exp = roundup = 0; size > 9999999 /* 9.999.999 */; exp++) { /* size = size / 1K */ size /= K2; roundup = size % 2; size /= 2; } sprintf(str," %7ld%c ",(long int)(size + roundup)," KMGTPEZY"[exp]); /* insert thousands separators: 1.234.567 */ if (str[5] != ' ') { if (str[2] != ' ') { str[0] = str[2]; str[1] = sep000; } str[2] = str[3]; str[3] = str[4]; str[4] = str[5]; str[5] = sep000; } if (exp && K2 == 512) str[10] = 'i'; } /* * stat2dev() prints device major:minor numbers * * FE_SIZE_DEV_STR is 12 ==> total number of digits is 10, * from these 10 digits are 2 to 7 used for minor device * number (printed in hex) and the rest is used for major * device number (printed in dec) * * some major:minor splits * 8 : 8 bits - Linux 2.4 * 14 : 18 bits - SunOS 5 * 8 : 24 bits - FreeBSD * 12 : 20 bits - Linux 2.6 */ #define MIN_MINOR_DIGITS 2 #define MAX_MINOR_DIGITS 7 static void stat2dev(char *str, unsigned int dev_major, unsigned int dev_minor) { static unsigned int digits_minor[] = { 0, 0xF, 0xFF, /* 2 digits, 8 bits */ 0xFFF, /* 3 digits, 12 bits */ 0xFFFF, /* 4 digits, 16 bits */ 0xFFFFF, /* 5 digits, 20 bits */ 0xFFFFFF, /* 6 digits, 24 bits */ 0xFFFFFFF,/* 7 digits, 28 bits */ 0xFFFFFFFF }; static unsigned int digits_major[] = { 0, 9, 99, 999, /* 3 digits, 9 bits */ 9999, /* 4 digits, 13 bits */ 99999, /* 5 digits, 16 bits */ 999999, /* 6 digits, 19 bits */ 9999999, /* 7 digits, 23 bits */ 99999999, /* 8 digits, 26 bits */ 999999999 }; static int minor_len = MIN_MINOR_DIGITS; static int major_len = FE_SIZE_DEV_STR - MIN_MINOR_DIGITS - 2; int minor_of; /* overflow */ /* determine the major digits / minor digits split */ while ( (minor_of = dev_minor > digits_minor[minor_len]) && minor_len < MAX_MINOR_DIGITS) { minor_len++; major_len--; } /* print major */ if (dev_major > digits_major[major_len]) sprintf(str,"%*s",major_len,".."); else sprintf(str,"%*d",major_len,dev_major); /* print minor */ if (minor_of) sprintf(str + major_len,":..%0*X", minor_len - 2,dev_minor & digits_minor[minor_len - 2]); else sprintf(str + major_len,":%0*X",minor_len,dev_minor); } int stat2type(mode_t mode, uid_t uid) { if (S_ISREG(mode)) { if ( (mode & S_IXUSR) != S_IXUSR && (mode & S_IXGRP) != S_IXGRP && (mode & S_IXOTH) != S_IXOTH) return FT_PLAIN_FILE; if ((mode & S_ISUID) == S_ISUID) return uid ? FT_PLAIN_SUID : FT_PLAIN_SUID_ROOT; if ((mode & S_ISGID) == S_ISGID) return FT_PLAIN_SGID; return FT_PLAIN_EXEC; } if (S_ISDIR(mode)) return FT_DIRECTORY; if (S_ISBLK(mode)) return FT_DEV_BLOCK; if (S_ISCHR(mode)) return FT_DEV_CHAR; if (S_ISFIFO(mode)) return FT_FIFO; #ifdef S_ISSOCK if (S_ISSOCK(mode)) return FT_SOCKET; #endif return FT_OTHER; } static void id2name(char *str, int leftalign, const char *name, unsigned int id) { char number[16]; size_t len; if (name == 0) { sprintf(number,"%u",id); name = number; } len = strlen(name); sprintf(str,len <= 9 ? (leftalign ? "%-9s" : "%9s") : "%4.4s>%4s",name,name + len - 4); } static const char * uid2name(uid_t uid) { static int pos = 0, replace = 0; static struct { uid_t uid; char name[FE_NAME_STR]; } cache[CACHE_SIZE]; if (pos < ucache_cnt && uid == cache[pos].uid) return cache[pos].name; for (pos = 0; pos < ucache_cnt; pos++) if (uid == cache[pos].uid) return cache[pos].name; if (ucache_cnt < CACHE_SIZE) pos = ucache_cnt++; else { pos = replace; if (++replace >= CACHE_SIZE) replace = 0; } cache[pos].uid = uid; id2name(cache[pos].name,0,lookup_login(uid),(unsigned int)uid); return cache[pos].name; } static const char * gid2name(gid_t gid) { static int pos = 0, replace = 0; static struct { gid_t gid; char name[FE_NAME_STR]; } cache[CACHE_SIZE]; if (pos < gcache_cnt && gid == cache[pos].gid) return cache[pos].name; for (pos = 0; pos < gcache_cnt; pos++) if (gid == cache[pos].gid) return cache[pos].name; if (gcache_cnt < CACHE_SIZE) pos = gcache_cnt++; else { pos = replace; if (++replace >= CACHE_SIZE) replace = 0; } cache[pos].gid = gid; id2name(cache[pos].name,1,lookup_group(gid),(unsigned int)gid); return cache[pos].name; } static void stat2owner(char *str, uid_t uid, gid_t gid) { strcpy(str,uid2name(uid)); str[FE_NAME_STR - 1] = ':'; strcpy(str + FE_NAME_STR,gid2name(gid)); } static void stat2links(char *str, nlink_t nlink) { if (nlink <= 999) sprintf(str,"%3d",(int)nlink); else strcpy(str,"max"); } /* * get the extension "ext" from "file.ext" * an exception: ".file" is a hidden file without an extension */ static const char * get_ext(const char *filename) { const char *ext; char ch; if (*filename++ == '\0') return ""; for (ext = ""; (ch = *filename); filename++) if (ch == '.') ext = filename + 1; return ext; } /* this file does exist, but no other information is available */ static void nofileinfo(FILE_ENTRY *pfe) { pfe->mtime = 0; pfe->size = 0; pfe->extension = get_ext(SDSTR(pfe->file)); pfe->file_type = FT_NA; pfe->size_str[0] = '\0'; pfe->atime_str[0] = '\0'; pfe->mtime_str[0] = '\0'; pfe->ctime_str[0] = '\0'; pfe->links_str[0] = '\0'; pfe->links = 0; pfe->mode_str[0] = '\0'; pfe->normal_mode = 1; pfe->owner_str[0] = '\0'; } /* fill-in all required information about a file */ static void fileinfo(FILE_ENTRY *pfe, struct stat *pst) { pfe->mtime = pst->st_mtime; pfe->size = pst->st_size; pfe->extension = get_ext(SDSTR(pfe->file)); pfe->file_type = stat2type(pst->st_mode,pst->st_uid); if (IS_FT_DEV(pfe->file_type)) #ifdef HAVE_STRUCT_STAT_ST_RDEV pfe->devnum = pst->st_rdev; #else pfe->devnum = 0; #endif /* special case: active mounting point */ if (pfe->file_type == FT_DIRECTORY && !pfe->symlink && !pfe->dotdir && pst->st_dev != dirdev) pfe->file_type = FT_DIRECTORY_MNT; if (do_a) stat2time(pfe->atime_str,pst->st_atime); if (do_d) stat2time(pfe->mtime_str,pst->st_mtime); if (do_i) stat2time(pfe->ctime_str,pst->st_ctime); if (do_l) stat2links(pfe->links_str,pst->st_nlink); if (do_L) pfe->links = pst->st_nlink > 1 && !IS_FT_DIR(pfe->file_type); pfe->mode12 = pst->st_mode & 07777; if (do_m) { sprintf(pfe->mode_str,"%04o",pfe->mode12); if (do_M) { if (S_ISREG(pst->st_mode)) pfe->normal_mode = pfe->mode12 == normal_file || pfe->mode12 == normal_dir /* same as exec */; else if (S_ISDIR(pst->st_mode)) pfe->normal_mode = pfe->mode12 == normal_dir; else pfe->normal_mode = pfe->mode12 == normal_file; } } pfe->uid = pst->st_uid; pfe->gid = pst->st_gid; if (do_o) stat2owner(pfe->owner_str,pst->st_uid,pst->st_gid); if (do_s) { if (IS_FT_DEV(pfe->file_type)) stat2dev(pfe->size_str, major(pfe->devnum),minor(pfe->devnum)); else stat2size(pfe->size_str,pst->st_size); } } /* build the FILE_ENTRY '*pfe' describing the file named 'name' */ static int describe_file(const char *name, FILE_ENTRY *pfe) { struct stat stdata; if (lstat(name,&stdata) < 0) { if (errno == ENOENT) return -1; /* file deleted in the meantime */ pfe->symlink = 0; nofileinfo(pfe); return 0; } if ( (pfe->symlink = S_ISLNK(stdata.st_mode)) ) { if (get_link_us(&pfe->link,name) < 0) us_copy(&pfe->link,"??"); /* need stat() instead of lstat() */ if (stat(name,&stdata) < 0) { nofileinfo(pfe); return 0; } } fileinfo(pfe,&stdata); return 0; } /* * We abandoned any form of caching and always build the file * panel from scratch. No caching algorithm was 100% perfect, * there were always few 'pathological' cases. */ static void directory_read(void) { int i, cnt1, cnt2; CODE dotdir; DIR *dd; FILE_ENTRY *pfe; struct stat st; struct dirent *direntry; const char *name; name = USTR(ppanel_file->dir); if (stat(name,&st) < 0 || (dd = opendir(name)) == 0) { ppanel_file->pd->cnt = ppanel_file->selected = 0; win_warning("LIST DIR: Cannot list the contents " "of the directory."); return; } dirdev = st.st_dev; /* * step #1: process selected files already listed in the panel * in order not to lose their selection mark */ cnt1 = 0; for (i = 0; cnt1 < ppanel_file->selected; i++) { pfe = ppanel_file->files[i]; if (!pfe->select) continue; name = SDSTR(pfe->file); if (describe_file(use_pathname ? pathname_join(name) : name, pfe) < 0) /* this entry is no more valid */ ppanel_file->selected--; else { /* OK, move it to the end of list we have so far */ /* by swapping pointers: [cnt1] <--> [i] */ ppanel_file->files[i] = ppanel_file->files[cnt1]; ppanel_file->files[cnt1] = pfe; cnt1++; } } /* step #2: add data about new files */ win_waitmsg(); cnt2 = cnt1; while ( (direntry = readdir(dd)) ) { name = direntry->d_name; dotdir = 0; if (name[0] == '.') { if (name[1] == '\0') dotdir = 1; else if (name[1] == '.' && name[2] == '\0') dotdir = 2; } /* didn't we see this file already in step #1 ? */ if (cnt1) { for (i = 0; i < cnt1; i++) if (strcmp(SDSTR(ppanel_file->files[i]->file),name) == 0) break; if (i < cnt1) continue; } /* allocate new bunch of FILE_ENTRies if needed */ if (cnt2 == ppanel_file->fe_alloc) { ppanel_file->fe_alloc += FE_ALLOC_UNIT; ppanel_file->files = erealloc(ppanel_file->files, ppanel_file->fe_alloc * sizeof(FILE_ENTRY *)); pfe = emalloc(FE_ALLOC_UNIT * sizeof(FILE_ENTRY)); for (i = 0; i < FE_ALLOC_UNIT; i++) { SD_INIT(pfe[i].file); US_INIT(pfe[i].link); ppanel_file->files[cnt2 + i] = pfe + i; } } pfe = ppanel_file->files[cnt2]; sd_copy(&pfe->file,name); pfe->dotdir = dotdir; if (describe_file(use_pathname ? pathname_join(name) : name, pfe) < 0) continue; pfe->select = 0; cnt2++; } ppanel_file->pd->cnt = cnt2; closedir(dd); } /* directory read wrapper */ static void filepanel_read(void) { filepos_save(); if (ppanel_file->pd->filtering) { /* suspend filtering */ ppanel_file->pd->cnt = ppanel_file->filt_cnt; ppanel_file->selected += ppanel_file->filt_sel; } directory_read(); if (ppanel_file->pd->filtering) { /* resume filtering */ ppanel_file->filt_cnt = ppanel_file->pd->cnt; ppanel_file->pd->filter->changed = 1; } else sort_files(); filepos_set(); ppanel_file->expired = 0; } void list_directory(void) { now = time(0); /* password data change invalidates data in both panels */ if (userdata_refresh()) { ppanel_file->other->expired = 1; ucache_cnt = gcache_cnt = 0; } filepanel_read(); } void list_both_directories(void) { PANEL_DESC *savep; savep = panel; now = time(0); if (userdata_refresh()) ucache_cnt = gcache_cnt = 0; filepanel_read(); panel = ppanel_file->pd; if (panel->filtering) filter_update(); /* * warning: during the re-read of the secondary panel, * the primary panel does not correspond with the current * working directory */ ppanel_file = ppanel_file->other; pathname_set_directory(USTR(ppanel_file->dir)); use_pathname = 1; /* must prepend directory name */ filepanel_read(); panel = ppanel_file->pd; if (panel->filtering) filter_update(); use_pathname = 0; ppanel_file = ppanel_file->other; panel = savep; } clex-3.15/src/list.h0000644000076400007640000000026507614257430011254 00000000000000extern void list_reconfig(void); extern void list_initialize(void); extern void list_directory(void); extern void list_both_directories(void); extern int stat2type(mode_t, uid_t); clex-3.15/src/match.c0000644000076400007640000002210410420646044011354 00000000000000/* * * CLEX File Manager * * Copyright (C) 2001-2006 Vlado Potisk * * CLEX is free software without warranty of any kind; see the * GNU General Public License as set out in the "COPYING" document * which accompanies the CLEX File Manager package. * * CLEX can be downloaded from http://www.clex.sk * */ /* match.c implements shell regular expression matching */ #include #include /* clex.h */ #include /* strlen() */ #include "clex.h" #include "match.h" #include "inout.h" /* win_warning() */ #include "ustring.h" /* us_setsize() */ static const char *expr; /* shell regular expression */ static char *sym; /* corresponding string of SYM_XXX */ static size_t expr_len; /* length of regular expression */ /* types of symbols in shell regular expression */ #define SYM_LITERAL 0 /* quoted or no special meaning */ #define SYM_IGNORE 1 /* ignore this char (e.g. quoting) */ #define SYM_ANY_CHAR 2 /* question mark ? metacharacter */ #define SYM_ANY_STRING 3 /* asterisk * metacharacter */ #define SYM_LIST_BEGIN 4 /* list begin [ metacharacter */ #define SYM_LIST_END 5 /* list end ] metacharacter */ #define SYM_LIST_INV 6 /* either ^ or ! after SYM_LIST_BEGIN */ #define SYM_RANGE_FROM 7 /* lower limit in a range a-z */ #define SYM_RANGE_TO 8 /* upper limit in a range a-z */ /* temporary values used during parsing process */ #define SYM_TEMP_HYPHEN 98 /* hyphen in a list, needs further checks */ #define SYM_TEMP_NQ 99 /* not quoted, needs further parsing */ /* finite state machine to parse quoting characters */ #define STATE_NORMAL 0 /* not quoted */ #define STATE_BACKSLASH 1 /* quoting backslash */ #define STATE_SINGLE 2 /* inside single quotes */ #define STATE_DOUBLE 3 /* inside double quotes */ #define STATE_DOUBLE_BACKSLASH 4 /* backslash inside double quotes */ /* finite state machine to parse metacharacters */ /* STATE_NORMAL shared */ #define STATE_LIST_BEGIN 1 /* [ encountered */ #define STATE_LIST_BEGIN_2 2 /* [^ or [! case */ #define STATE_LIST_BODY 3 /* between [ and ] */ /* finite state machine to parse ranges a-z */ /* STATE_NORMAL shared */ #define STATE_LIST 1 /* between [ and ] */ #define STATE_RANGE1 2 /* after a (looking for a-z) */ #define STATE_RANGE2 3 /* after a- (looking for a-z) */ /* match result - used in check_match() only */ #define MATCH_NO 1 #define MATCH_YES 2 #define MATCH_NEVER 3 /* errors in regular expression */ #define ERR_NONE 0 #define ERR_UNBALANCED 1 #define ERR_MISSING_SINGLE 2 #define ERR_MISSING_DOUBLE 3 #define ERR_BACKSLASH 4 #define TRANS(SYM,STAT) \ do { sym[i] = (SYM_ ## SYM); state = (STATE_ ## STAT); } while (0) #define SYM(SYM) \ do { sym[i] = (SYM_ ## SYM); /* state unchanged */ } while (0) #define STATE(STAT) \ do { /* symbol unchanged */ state = (STATE_ ## STAT); } while (0) static int rangecmp(int from, int ch, int to) { static char f[2] = "?", c[2] = "?", t[2] = "?"; f[0] = (char)from; c[0] = (char)ch; t[0] = (char)to; return STRCOLL(f,c) <= 0 && STRCOLL(c,t) <= 0; } /* * check if shell regular expression set by last successful check_sre() * call and starting at position 'i' matches the string 'word' */ static int check_match(size_t i, const char *word) { int m, from; FLAG inlist, inverse, listmatch; char ch; from = 0; ch = '\0'; /* to prevent compiler warning */ inverse = listmatch = 0; /* to prevent compiler warning */ inlist = 0; /* not inside [list] */ for (; i < expr_len; i++) switch (sym[i]) { case SYM_IGNORE: break; case SYM_LITERAL: if (inlist) { if (expr[i] == ch) listmatch = 1; } else if (expr[i] != *word++) return MATCH_NO; break; case SYM_ANY_CHAR: if (*word++ == '\0') return MATCH_NO; break; case SYM_ANY_STRING: if (i + 1 == expr_len) /* shortcut: single * matches it all */ return MATCH_YES; do { if ( (m = check_match(i + 1,word)) != MATCH_NO) return m; } while (*word++); /* * match impossible, stop recursion, otherwise you can * spend many hours here if there is lots of asterisks */ return MATCH_NEVER; case SYM_LIST_BEGIN: inlist = 1; inverse = listmatch = 0; if ((ch = *word++) == '\0') return MATCH_NO; break; case SYM_LIST_INV: inverse = 1; break; case SYM_RANGE_FROM: from = expr[i]; break; case SYM_RANGE_TO: if (rangecmp(from,ch,expr[i])) listmatch = 1; break; case SYM_LIST_END: if (listmatch == inverse) return MATCH_NO; inlist = 0; break; } return *word == '\0' ? MATCH_YES : MATCH_NO ; } static int parse_expression(void) { char ch; int state, symbol, from, hyphen; size_t i; /* * handle quoting: this finite state machine recognizes: * - special quoting characters (tagged as SYM_IGNORE) * - quoted text (SYM_LITERAL) * everything else is left tagged as SYM_TEMP_NQ */ for (state = STATE_NORMAL, i = 0; i < expr_len; i++) { ch = expr[i]; switch (state) { case STATE_NORMAL: if (ch == '\\') TRANS(IGNORE,BACKSLASH); else if (ch == '\'') TRANS(IGNORE,SINGLE); else if (ch == '\"') TRANS(IGNORE,DOUBLE); else SYM(TEMP_NQ); break; case STATE_BACKSLASH: TRANS(LITERAL,NORMAL); break; case STATE_DOUBLE_BACKSLASH: TRANS(LITERAL,DOUBLE); break; case STATE_SINGLE: if (ch == '\'') TRANS(IGNORE,NORMAL); else SYM(LITERAL); break; case STATE_DOUBLE: if (ch == '\\') /* backslash quotes only \ " and $ */ if (strchr("\\\"$",(unsigned char)expr[i + 1])) TRANS(IGNORE,DOUBLE_BACKSLASH); else SYM(LITERAL); else if (ch == '\"') TRANS(IGNORE,NORMAL); else SYM(LITERAL); } } if (state == STATE_SINGLE) return ERR_MISSING_SINGLE; if (state == STATE_DOUBLE || state == STATE_DOUBLE_BACKSLASH) return ERR_MISSING_DOUBLE; if (state == STATE_BACKSLASH) return ERR_BACKSLASH; /* * handle metacharacters: ?, *, and [list] * this finite state machine removes all occurrences of temporary * SYM_TEMP_NQ, it generates new symbols: * - SYM_ANY_CHAR and SYM_ANY_STRING * - SYM_LIST_BEGIN and SYM_LIST_END * - temporary SYM_TEMP_HYPHEN */ for (state = STATE_NORMAL, i = 0; i < expr_len; i++) { symbol = sym[i]; if (symbol == SYM_IGNORE) continue; ch = expr[i]; switch (state) { case STATE_NORMAL: if (symbol == SYM_LITERAL) break; if (ch == '[') TRANS(LIST_BEGIN,LIST_BEGIN); else if (ch == '?') SYM(ANY_CHAR); else if (ch == '*') SYM(ANY_STRING); else /* sym == SYM_TEMP_NQ, i.e. unquoted character */ SYM(LITERAL); break; case STATE_LIST_BEGIN: if (symbol == SYM_TEMP_NQ && (ch == '^' || ch == '!')) TRANS(LIST_INV,LIST_BEGIN_2); else TRANS(LITERAL,LIST_BODY); break; case STATE_LIST_BEGIN_2: TRANS(LITERAL,LIST_BODY); break; case STATE_LIST_BODY: if (symbol == SYM_TEMP_NQ && ch == ']') TRANS(LIST_END,NORMAL); else if (symbol == SYM_TEMP_NQ && ch == '-') SYM(TEMP_HYPHEN); else SYM(LITERAL); } } if (state != STATE_NORMAL) return ERR_UNBALANCED; /* * handle ranges a-z in [list] * if SYM_TEMP_HYPHEN is part of a valid range, this range will * be tagged with SYM_RANGE_FROM and SYM_RANGE_TO */ from = hyphen = 0; /* to prevent compiler warning */ for (state = STATE_NORMAL, i = 0; i < expr_len; i++) { symbol = sym[i]; if (symbol == SYM_IGNORE) continue; switch (state) { case STATE_NORMAL: if (symbol == SYM_LIST_BEGIN) STATE(LIST); break; case STATE_LIST: /* inside [...] */ if (symbol == SYM_LIST_END) STATE(NORMAL); else if (symbol == SYM_LITERAL) { from = i; STATE(RANGE1); } else if (symbol == SYM_TEMP_HYPHEN) /* e.g. second hyphen in a list like [a-z-_] */ sym[i] = SYM_LITERAL; break; case STATE_RANGE1: if (symbol == SYM_LIST_END) STATE(NORMAL); else if (symbol == SYM_LITERAL) from = i; else if (symbol == SYM_TEMP_HYPHEN) { hyphen = i; STATE(RANGE2); } break; case STATE_RANGE2: if (symbol == SYM_LIST_END) { sym[hyphen] = SYM_LITERAL; STATE(NORMAL); } else { /* valid range [a-z] */ sym[from] = SYM_RANGE_FROM; sym[hyphen] = SYM_IGNORE; sym[i] = SYM_RANGE_TO; STATE(LIST); } } } return ERR_NONE; } int match(const char *word) { size_t i; FLAG dot_match; if (*word == '.') { /* exception: only literal dot matches */ for (dot_match = 0, i = 0; i < expr_len; i++) { if (sym[i] == SYM_IGNORE) continue; if (sym[i] == SYM_LITERAL && expr[i] == '.') dot_match = 1; break; } if (!dot_match) return 0; } return check_match(0,word) == MATCH_YES; } int check_sre(const char *sre) { static USTRING symbols = { 0,0 }; expr = sre; expr_len = strlen(expr); us_setsize(&symbols,expr_len); sym = USTR(symbols); return parse_expression(); } int match_sre(const char *sre) { static char *errmsg[] = { 0, "Unbalanced [ ]", "Missing single quote", "Missing double quote", "Misplaced backslash" }; /* must match #ERR_XXX defines */ int code; if ((code = check_sre(sre)) == ERR_NONE) return 0; win_warning_fmt("SYNTAX CHECK: %s.",errmsg[code]); return -1; } clex-3.15/src/match.h0000644000076400007640000000015010130732675011362 00000000000000extern int match_sre(const char *); extern int check_sre(const char *); extern int match(const char *); clex-3.15/src/panel.c0000644000076400007640000000404410407511605011361 00000000000000/* * * CLEX File Manager * * Copyright (C) 2001-2006 Vlado Potisk * * CLEX is free software without warranty of any kind; see the * GNU General Public License as set out in the "COPYING" document * which accompanies the CLEX File Manager package. * * CLEX can be downloaded from http://www.clex.sk * */ #include #include /* clex.h */ #include "clex.h" #include "panel.h" #include "inout.h" /* win_panel_opt() */ void cx_pan_up(void) { if (panel->curs > panel->min) { panel->curs--; LIMIT_MAX(panel->top,panel->curs); win_panel_opt(); } } void cx_pan_down(void) { if (panel->curs < panel->cnt - 1) { panel->curs++; LIMIT_MIN(panel->top,panel->curs - display.panlines + 1); win_panel_opt(); } } void cx_pan_home(void) { panel->top = panel->curs = panel->min; win_panel_opt(); } void cx_pan_end(void) { panel->curs = panel->cnt - 1; LIMIT_MIN(panel->top,panel->curs - display.panlines + 1); win_panel_opt(); } void cx_pan_pgup(void) { if (panel->curs > panel->min) { if (panel->curs > panel->top) panel->curs = panel->top; else { panel->curs -= display.panlines; LIMIT_MIN(panel->curs,panel->min); panel->top = panel->curs; } win_panel_opt(); } } void cx_pan_pgdown(void) { if (panel->curs < panel->cnt - 1) { if (panel->curs < panel->top + display.panlines - 1) panel->curs = panel->top + display.panlines - 1; else panel->curs += display.panlines; LIMIT_MAX(panel->curs,panel->cnt - 1); LIMIT_MIN(panel->top,panel->curs - display.panlines + 1); win_panel_opt(); } } void pan_adjust(PANEL_DESC *p) { /* always in bounds */ LIMIT_MAX(p->top,p->cnt - 1); LIMIT_MIN(p->top,p->min); LIMIT_MAX(p->curs,p->cnt - 1); LIMIT_MIN(p->curs,p->min); /* cursor must be visible */ if (p->top > p->curs || p->top <= p->curs - display.panlines) p->top = p->curs - display.panlines / 3; /* bottom of the screen shouldn't be left blank ... */ LIMIT_MAX(p->top,p->cnt - display.panlines); /* ... but that is not always possible */ LIMIT_MIN(p->top,p->min); } clex-3.15/src/panel.h0000644000076400007640000000033710020716361011364 00000000000000extern void cx_pan_down(void); extern void cx_pan_end(void); extern void cx_pan_home(void); extern void cx_pan_pgdown(void); extern void cx_pan_pgup(void); extern void cx_pan_up(void); extern void pan_adjust(PANEL_DESC *); clex-3.15/src/sdstring.c0000644000076400007640000000377110407511612012123 00000000000000/* * * CLEX File Manager * * Copyright (C) 2001-2006 Vlado Potisk * * CLEX is free software without warranty of any kind; see the * GNU General Public License as set out in the "COPYING" document * which accompanies the CLEX File Manager package. * * CLEX can be downloaded from http://www.clex.sk * */ #include #include /* clex.h */ #include /* free() */ #include /* strlen() */ #include "clex.h" #include "sdstring.h" #include "util.h" /* estrdup() */ /* * The SDSTRING structure (defined in clex.h) was designed for * storing/retrieving of object names (e.g. file names or user * names). * * Up to 95% of such names are short (less than 16 chars), these * names are stored in static memory, long names are stored in * dynamically allocated memory. * * - to initialize before first use: * static SDSTRING sds = { 0, "initial_short_value" }; * or * SD_INIT(sdstring); * - to re-initialize, e.g. before deallocating dynamic SDSTRING: * sd_reset(); * - to store a name (NULL ptr cannot be stored): * sd_copy() * or * sd_copyn(); * - to retrieve a name: * SDSTR(sds) * or * PSDSTR(psds) * * WARNING: SD_INIT, SDSTR, and PSDSTR are macros. */ void sd_reset(SDSTRING *psd) { if (psd->SDname) { free(psd->SDname); psd->SDname = 0; } psd->SDmem[0] = '\0'; } void sd_copy(SDSTRING *psd, const char *src) { if (psd->SDname) free(psd->SDname); if (strlen(src) <= SDSTRING_LEN) { psd->SDname = 0; strcpy(psd->SDmem,src); } else { psd->SDname = estrdup(src); psd->SDmem[0] = '\0'; } } /* note: sd_copyn() adds terminating null byte */ void sd_copyn(SDSTRING *psd, const char *src, size_t len) { char *dst; if (psd->SDname) free(psd->SDname); if (len <= SDSTRING_LEN) { psd->SDname = 0; dst = psd->SDmem; } else { dst = psd->SDname = emalloc(len + 1); psd->SDmem[0] = '\0'; } dst[len] = '\0'; while (len-- > 0) dst[len] = src[len]; } clex-3.15/src/sdstring.h0000644000076400007640000000051007604575450012133 00000000000000#define SD_INIT(X) do { (X).SDname = 0; (X).SDmem[0] = '\0';} while (0) #define PSDSTR(X) ((X)->SDname ? (X)->SDname : (X)->SDmem) #define SDSTR(X) ((X).SDname ? (X).SDname : (X).SDmem) extern void sd_copy(SDSTRING *, const char *); extern void sd_copyn(SDSTRING *, const char *, size_t); extern void sd_reset(SDSTRING *); clex-3.15/src/select.c0000644000076400007640000001703310460124006011535 00000000000000/* * * CLEX File Manager * * Copyright (C) 2001-2006 Vlado Potisk * * CLEX is free software without warranty of any kind; see the * GNU General Public License as set out in the "COPYING" document * which accompanies the CLEX File Manager package. * * CLEX can be downloaded from http://www.clex.sk * */ #include #include /* clex.h */ #include /* stat() */ #include /* open() */ #include /* qsort() */ #include /* strcpy() */ #include /* close() */ #include "clex.h" #include "select.h" #include "control.h" /* get_current_mode() */ #include "edit.h" /* edit_putstr() */ #include "inout.h" /* win_panel() */ #include "match.h" /* match() */ #include "list.h" /* list_both_directories() */ #include "sdstring.h" /* SDSTR() */ #include "sort.h" /* sort_files() */ #include "ustring.h" /* USTR() */ #include "util.h" /* pathname_join() */ #define FN_SELECT 1 #define FN_DESELECT 2 #define FN_TOGGLE 3 void select_prepare(void) { static FLAG hint = 1; const char *prompt; panel = ppanel_file->pd; if (panel->filtering == 1) panel->filtering = 2; prompt = "DESELECT files: "; if (get_current_mode() == MODE_SELECT) prompt += 2; /* "SELECT files: " */ edit_setprompt(&line_tmp,prompt); textline = &line_tmp; edit_nu_putstr("*"); if (TCLR(hint)) win_remark("wildcards: ? * and [..], see help"); } void compare_prepare(void) { /* leave cursor position unchanged */ panel = panel_compare.pd; textline = 0; } static int selectfile(FILE_ENTRY *pfe, int function) { if (!pfe->select) { /* * dot and dot-dot directories cannot be selected * it is not a bug, it is a protection */ if (function != FN_DESELECT && !pfe->dotdir) { pfe->select = 1; /* one selected entry more */ return 1; } } else if (function != FN_SELECT) { pfe->select = 0; return -1; /* one less */ } return 0; /* no change */ } void cx_select_toggle(void) { ppanel_file->selected += selectfile(ppanel_file->files[ppanel_file->pd->curs],FN_TOGGLE); /* cursor down */ if (ppanel_file->pd->curs < ppanel_file->pd->cnt - 1) { ppanel_file->pd->curs++; LIMIT_MIN(ppanel_file->pd->top, ppanel_file->pd->curs - display.panlines + 1); } win_panel_opt(); } static void process_all(int function) { int i; for (i = 0; i < ppanel_file->pd->cnt; i++) ppanel_file->selected += selectfile(ppanel_file->files[i],function); win_panel(); } void cx_select_invert(void) { process_all(FN_TOGGLE); } void cx_select_allfiles(void) { process_all(FN_SELECT); } void cx_select_nofiles(void) { process_all(FN_DESELECT); } void cx_select_files(void) { int i, fn; FLAG select; const char *sre; FILE_ENTRY *pfe; if (line_tmp.size == 0) { next_mode = MODE_SPECIAL_RETURN; return; } sre = USTR(textline->line); if (match_sre(sre) < 0) /* return and correct the error */ return; if (get_current_mode() == MODE_SELECT) { select = 1; fn = FN_SELECT; } else { select = 0; fn = FN_DESELECT; } for (i = 0; i < ppanel_file->pd->cnt; i++) { pfe = ppanel_file->files[i]; if (select == !pfe->select && match(SDSTR(pfe->file))) ppanel_file->selected += selectfile(pfe,fn); } win_panel(); next_mode = MODE_SPECIAL_RETURN; } static int qcmp(const void *e1, const void *e2) { /* not strcoll() ! */ return strcmp( SDSTR((*(FILE_ENTRY **)e1)->file), SDSTR((*(FILE_ENTRY **)e2)->file)); } #define CMP_BUF_STR 16384 /* return value: -1 error, 0 compare ok, +1 compare failed */ static int data_cmp(int fd1, int fd2) { struct stat st1, st2; static char buff1[CMP_BUF_STR], buff2[CMP_BUF_STR]; off_t filesize; size_t chunksize; if (fstat(fd1,&st1) < 0 || !S_ISREG(st1.st_mode)) return -1; if (fstat(fd2,&st2) < 0 || !S_ISREG(st2.st_mode)) return -1; if (st1.st_dev == st2.st_dev && st1.st_ino == st2.st_ino) /* same file */ return 0; if ((filesize = st1.st_size) != st2.st_size) return 1; while (filesize > 0) { chunksize = filesize > CMP_BUF_STR ? CMP_BUF_STR : filesize; if ( read_fd(fd1,buff1,chunksize) != chunksize || read_fd(fd2,buff2,chunksize) != chunksize) return -1; if (memcmp(buff1,buff2,chunksize) != 0) return 1; filesize -= chunksize; } return 0; } /* return value: -1 error, 0 compare ok, +1 compare failed */ static int file_cmp(const char *file1, const char *file2) { int cmp, fd1, fd2; fd1 = open(file1,O_RDONLY | O_NONBLOCK); if (fd1 < 0) return -1; fd2 = open(file2,O_RDONLY | O_NONBLOCK); if (fd2 < 0) { close(fd1); return -1; } cmp = data_cmp(fd1,fd2); close(fd1); close(fd2); return cmp; } /* * compare panels * levels: * 0: name, type (symbolic links ok) * 1: name, type, size (symbolic links ok) * 2: name, type, size (exactly) * 3: name, type, size, ownership&mode * 4: name, type, size, contents * 5: name, type, size, ownership&mode, contents */ void compare_panels(int level) { int min, med, max, cmp, i, cnt1, errcnt; const char *name2; FILE_ENTRY *pfe1, *pfe2; errcnt = 0; /* reread panels */ list_both_directories(); if (level >= 4) { win_waitmsg(); pathname_set_directory(USTR(ppanel_file->other->dir)); } /* sort panel#1 by name (prepare for binary search) */ if ( (cnt1 = ppanel_file->pd->cnt) ) qsort(ppanel_file->files,cnt1,sizeof(FILE_ENTRY *),qcmp); /* select all files in the panel#1 */ for (i = 0; i < cnt1; i++) ppanel_file->selected += selectfile(ppanel_file->files[i],FN_SELECT); /* for all files in panel#2 search for matching file in panel#1 */ for (i = 0; i < ppanel_file->other->pd->cnt; i++) { pfe2 = ppanel_file->other->files[i]; ppanel_file->other->selected += selectfile(pfe2,FN_SELECT); /* all levels: comparing name */ name2 = SDSTR(pfe2->file); for (pfe1 = 0, min = 0, max = cnt1 - 1; min <= max; ) { med = (min + max) / 2; cmp = strcmp(name2,SDSTR(ppanel_file->files[med]->file)); if (cmp == 0) { pfe1 = ppanel_file->files[med]; /* entries *pfe1 and *pfe2 have the same name */ break; } if (cmp < 0) max = med - 1; else min = med + 1; } if (pfe1 == 0) continue; /* all levels: comparing type */ if ( !( (IS_FT_PLAIN(pfe1->file_type) && IS_FT_PLAIN(pfe2->file_type)) || (IS_FT_DIR(pfe1->file_type) && IS_FT_DIR(pfe2->file_type)) || (pfe1->file_type == pfe2->file_type && pfe1->file_type != FT_NA) )) continue; /* level 1+: comparing size (or device numbers) */ if (level >= 1 && ((IS_FT_DEV(pfe1->file_type) && pfe1->devnum != pfe2->devnum) || (IS_FT_PLAIN(pfe1->file_type) && pfe1->size != pfe2->size))) continue; /* level 2+: symbolic links not ok */ if (level >= 2 && pfe1->symlink != pfe2->symlink) continue; /* level 3,5+: ownership and mode */ if ((level == 3 || level >= 5) && (pfe1->uid != pfe2->uid || pfe1->gid != pfe2->gid || pfe1->mode12 != pfe2->mode12)) continue; /* level 4+: comparing data (contents) */ if (level >= 4 && IS_FT_PLAIN(pfe1->file_type) && (cmp = file_cmp(SDSTR(pfe1->file),pathname_join(name2))) ) { if (cmp < 0 && ++errcnt <= 3) win_warning_fmt("COMPARE: Cannot read file '%s'.", name2); continue; } /* pair of matching files found */ ppanel_file->selected += selectfile(pfe1,FN_DESELECT); ppanel_file->other->selected += selectfile(pfe2,FN_DESELECT); } if (errcnt > 3) win_warning_fmt("COMPARE: %d files could not be read.",errcnt); /* restore the sort order */ sort_files(); win_panel(); } static void compare_level(int level) { compare_panels(level); next_mode = MODE_SPECIAL_RETURN; } void cx_compare(void) { compare_level(panel_compare.pd->curs); } clex-3.15/src/select.h0000644000076400007640000000043110424647221011545 00000000000000extern void select_prepare(void); extern void compare_prepare(void); extern void cx_compare(void); extern void cx_select_toggle(void); extern void cx_select_invert(void); extern void cx_select_files(void); extern void cx_select_allfiles(void); extern void cx_select_nofiles(void); clex-3.15/src/signals.c0000644000076400007640000000232710407511622011723 00000000000000/* * * CLEX File Manager * * Copyright (C) 2001-2006 Vlado Potisk * * CLEX is free software without warranty of any kind; see the * GNU General Public License as set out in the "COPYING" document * which accompanies the CLEX File Manager package. * * CLEX can be downloaded from http://www.clex.sk * */ #include #include /* clex.h */ #include /* sigaction() */ #include /* _POSIX_JOB_CONTROL */ #include "clex.h" #include "signals.h" #include "control.h" /* err_exit() */ static RETSIGTYPE int_handler(int sn) { err_exit("Signal %s caught", sn == SIGTERM ? "SIGTERM" : "SIGHUP"); } void signal_initialize(void) { struct sigaction act; /* ignore keyboard generated signals */ act.sa_handler = SIG_IGN; act.sa_flags = 0; sigemptyset(&act.sa_mask); sigaction(SIGINT,&act,0); sigaction(SIGQUIT,&act,0); #ifdef _POSIX_JOB_CONTROL /* ignore job control signals */ sigaction(SIGTSTP,&act,0); sigaction(SIGTTIN,&act,0); sigaction(SIGTTOU,&act,0); #endif /* catch termination signals */ act.sa_handler = int_handler; sigaddset(&act.sa_mask,SIGTERM); sigaddset(&act.sa_mask,SIGHUP); sigaction(SIGTERM,&act,0); sigaction(SIGHUP,&act,0); } clex-3.15/src/signals.h0000644000076400007640000000004507613604754011741 00000000000000extern void signal_initialize(void); clex-3.15/src/sort.c0000644000076400007640000000726210421764020011253 00000000000000/* * * CLEX File Manager * * Copyright (C) 2001-2006 Vlado Potisk * * CLEX is free software without warranty of any kind; see the * GNU General Public License as set out in the "COPYING" document * which accompanies the CLEX File Manager package. * * CLEX can be downloaded from http://www.clex.sk * */ #include #include /* clex.h */ #include /* qsort() */ #include /* strcmp() */ /* major() */ #ifdef MAJOR_IN_MKDEV # include #endif #ifdef MAJOR_IN_SYSMACROS # include #endif #include "clex.h" #include "sort.h" #include "cfg.h" /* config_num() */ #include "directory.h" /* filepos_save() */ #include "sdstring.h" /* SDSTR() */ void sort_prepare(void) { panel_sort.pd->top = panel_sort.pd->min; panel_sort.pd->curs = 0; /* sort by name (default) */ panel = panel_sort.pd; textline = 0; } void cx_sort_set(void) { if (panel_sort.order != panel_sort.pd->curs) { panel_sort.order = panel_sort.pd->curs; filepos_save(); sort_files(); filepos_set(); ppanel_file->other->expired = 1; } next_mode = MODE_SPECIAL_RETURN; } /* compare reversed strings */ static int revstrcmp(const char *s1, const char *s2) { size_t i1, i2; int c1, c2; for (i1 = strlen(s1), i2 = strlen(s2); i1 > 0 && i2 > 0;) { c1 = (unsigned char)s1[--i1]; c2 = (unsigned char)s2[--i2]; /* * ignoring LOCALE, this sort order has nothing to do * with a human language, it is intended for sendmail * queue directories */ if (c1 != c2) return c1 - c2; } return CMP(i1,i2); } /* sort_group() return values (grouping order 1 < 2 < ... < 6 < 7) */ #define GROUP_DOTDIR 1 #define GROUP_DOTDOTDIR 2 #define GROUP_DIR 3 #define GROUP_BDEV 4 #define GROUP_CDEV 5 #define GROUP_OTHER 6 #define GROUP_PLAIN 7 static int sort_group(FILE_ENTRY *pfe) { int type; type = pfe->file_type; if (IS_FT_PLAIN(type)) return GROUP_PLAIN; if (IS_FT_DIR(type)) { if (pfe->dotdir == 1) return GROUP_DOTDIR; if (pfe->dotdir == 2) return GROUP_DOTDOTDIR; return GROUP_DIR; } if (config_num(CFG_GROUP_FILES) == 2) { if (type == FT_DEV_CHAR) return GROUP_CDEV; if (type == FT_DEV_BLOCK) return GROUP_BDEV; } return GROUP_OTHER; } static int qcmp(const void *e1, const void *e2) { int cmp, group1, group2; FILE_ENTRY *pfe1, *pfe2; pfe1 = (*(FILE_ENTRY **)e1); pfe2 = (*(FILE_ENTRY **)e2); /* I. file type grouping */ if (config_num(CFG_GROUP_FILES) > 0) { group1 = sort_group(pfe1); group2 = sort_group(pfe2); cmp = group1 - group2; if (cmp) return cmp; /* special sorting for devices */ if (config_num(CFG_GROUP_FILES) == 2 && (group1 == GROUP_BDEV || group1 == GROUP_CDEV) ) { cmp = major(pfe1->devnum) - major(pfe2->devnum); if (cmp) return cmp; cmp = minor(pfe1->devnum) - minor(pfe2->devnum); if (cmp) return cmp; } } /* II. sort order */ switch (panel_sort.order) { case SORT_EMAN: return revstrcmp(SDSTR(pfe1->file),SDSTR(pfe2->file)); case SORT_SUFFIX: cmp = (config_num(CFG_COLLATION) ? STRCOLL : strcmp) (pfe1->extension,pfe2->extension); break; case SORT_TIME: cmp = CMP(pfe2->mtime,pfe1->mtime); break; case SORT_TIME_REV: cmp = CMP(pfe1->mtime,pfe2->mtime); break; case SORT_SIZE: cmp = CMP(pfe1->size,pfe2->size); break; case SORT_SIZE_REV: cmp = CMP(pfe2->size,pfe1->size); break; default: /* SORT_NAME */ cmp = 0; } if (cmp) return cmp; /* III. sort by file name */ return (config_num(CFG_COLLATION) ? STRCOLL : strcmp) (SDSTR(pfe1->file),SDSTR(pfe2->file)); } void sort_files(void) { if (ppanel_file->pd->cnt == 0) return; qsort(ppanel_file->files,ppanel_file->pd->cnt,sizeof(FILE_ENTRY *),qcmp); } clex-3.15/src/sort.h0000644000076400007640000000013510420124236011246 00000000000000extern void sort_prepare(void); extern void sort_files(void); extern void cx_sort_set(void); clex-3.15/src/start.c0000644000076400007640000001733210430345605011424 00000000000000/* * * CLEX File Manager * * Copyright (C) 2001-2006 Vlado Potisk * * CLEX is free software without warranty of any kind; see the * GNU General Public License as set out in the "COPYING" document * which accompanies the CLEX File Manager package. * * CLEX can be downloaded from http://www.clex.sk * */ #include #include /* umask() */ #include /* umask() */ #include /* puts() */ #include /* putenv() */ #include /* strcmp() */ #include /* getpid() */ #include "clex.h" #include "bookmarks.h" /* bm_initialize() */ #include "cfg.h" /* config_initialize() */ #include "completion.h" /* completion_initialize() */ #include "control.h" /* control_loop() */ #include "directory.h" /* dir_initialize() */ #include "exec.h" /* exec_initialize() */ #include "filepanel.h" /* files_initialize() */ #include "help.h" /* help_initialize() */ #include "history.h" /* hist_initialize() */ #include "inout.h" /* curses_initialize() */ #include "lang.h" /* lang_initialize() */ #include "list.h" /* list_initialize() */ #include "signals.h" /* signal_initialize() */ #include "tty.h" /* tty_initialize() */ #include "undo.h" /* undo_init() */ #include "userdata.h" /* userdata_initialize() */ #include "ustring.h" /* US_INIT() */ #include "util.h" /* base_name() */ #include "xterm_title.h"/* xterm_title_initialize() */ /* GLOBAL VARIABLES */ static EXTRA_LINE el_leave[1] = { { 0,0,MODE_SPECIAL_RETURN,0 } }; static EXTRA_LINE el_bm_lst[3] = { { 0,0,MODE_SPECIAL_RETURN,0 }, { "Manage bookmarks",0,MODE_BM_MANAGER,0 }, { "Bookmark the current working directory", "@1" /* handled by win_info_extra_line() */, 0,cx_bm_list_bookmark } }; static EXTRA_LINE el_bm_mng[2] = { { 0, "Bookmarks are saved automatically",MODE_BM_LIST,cx_bm_mng_save }, { "Revert the bookmarks to previous state", "All changes will be lost",0,cx_bm_mng_revert } }; static EXTRA_LINE el_cfg[3] = { { "Cancel","No configuration change",MODE_SPECIAL_RETURN,0 }, { "Accept","Use the new configuration in this session", MODE_SPECIAL_RETURN,cx_config_save }, { "Accept+Save","Save the configuration to ~/.clexrc", MODE_SPECIAL_RETURN,cx_config_save } }; static EXTRA_LINE el_cfg_admin[2] = { { "Exit", "Exit program (don't forget to save the configuration first)", MODE_SPECIAL_QUIT,0 }, { "Save","Save the new system-wide defaults to " CONFIG_FILE, 0,cx_config_admin_save } }; /* pd_dir_split uses only the first entry of el_dir */ static EXTRA_LINE el_dir[2] = { { 0,0,MODE_SPECIAL_RETURN,cx_dir_enter }, { "Bookmarks",0,MODE_BM_LIST,cx_dir_enter } }; static EXTRA_LINE el_grp[2] = { { 0,0,MODE_SPECIAL_RETURN,0 }, { "Switch to user data",0,MODE_USER,0 } }; static EXTRA_LINE el_help[1] = { { "HELP: Table of Contents",0,0,cx_help_contents } }; static EXTRA_LINE el_usr[2] = { { 0,0,MODE_SPECIAL_RETURN,0 }, { "Switch to group data",0,MODE_GROUP,0 } }; static INPUTLINE il_filt; /* * PANEL_DESC initialization: * cnt, top, curs, min, type, norev, extra, filter, filtering */ static PANEL_DESC pd_bm_lst = { 0,0,0,-3,PANEL_TYPE_BM,0,el_bm_lst,0,0}; static PANEL_DESC pd_bm_mng = { 0,0,0,-2,PANEL_TYPE_BM,0,el_bm_mng,0,0}; static PANEL_DESC pd_cfg = { CFG_VARIABLES,0,0,-3,PANEL_TYPE_CFG,0,el_cfg,0,0 }; static PANEL_DESC pd_compare = /* 6 items in this menu */ { 6,-1,2,-1,PANEL_TYPE_COMPARE,0,el_leave,0,0 }; static PANEL_DESC pd_compl = { 0,0,0,-1,PANEL_TYPE_COMPL,0,el_leave,0,0 }; static PANEL_DESC pd_dir = { 0,0,0,-2,PANEL_TYPE_DIR,0,el_dir,&il_filt,0 }; static PANEL_DESC pd_dir_split = { 0,0,0,-1,PANEL_TYPE_DIR_SPLIT,0,el_dir,0,0 }; static PANEL_DESC pd_grp = { 0,0,0,-2,PANEL_TYPE_GROUP,0,el_grp,&il_filt,0 }; static PANEL_DESC pd_help = { 0,0,0,-1,PANEL_TYPE_HELP,1,el_help,0,0 }; static PANEL_DESC pd_hist = { 0,0,0,-1,PANEL_TYPE_HIST,0,el_leave,&il_filt,0 }; static PANEL_DESC pd_mainmenu = /* 20 items in this menu */ { 20,-1,-1,-1,PANEL_TYPE_MAINMENU,0,el_leave,0,0 }; static PANEL_DESC pd_paste = /* 13 items in this menu */ { 13,-1,-1,-1,PANEL_TYPE_PASTE,0,el_leave,0,0 }; static PANEL_DESC pd_sort = /* 7 items in this menu */ { 7,0,0,-1,PANEL_TYPE_SORT,0,el_leave,0,0 }; static PANEL_DESC pd_usr = { 0,0,0,-2,PANEL_TYPE_USER,0,el_usr,&il_filt,0 }; PANEL_DESC *panel = 0; PANEL_BM panel_bm_lst = { &pd_bm_lst }, panel_bm_mng = { &pd_bm_mng }; PANEL_COMPL panel_compl = { &pd_compl }; PANEL_CFG panel_cfg = { &pd_cfg }; PANEL_DIR panel_dir = { &pd_dir }, panel_dir_split = { &pd_dir_split }; PANEL_GROUP panel_group = { &pd_grp,0,0 }; PANEL_HELP panel_help = { &pd_help }; PANEL_HIST panel_hist = { &pd_hist }; PANEL_MENU panel_mainmenu = { &pd_mainmenu }; PANEL_MENU panel_compare = { &pd_compare }; PANEL_MENU panel_paste = { &pd_paste }; PANEL_SORT panel_sort = { &pd_sort, SORT_NAME }; PANEL_USER panel_user = { &pd_usr,0,0 }; PANEL_FILE *ppanel_file; DISPLAY display = { 0,0,0,0,0,0,0 }; CLEX_DATA clex_data; TEXTLINE *textline = 0, line_cmd, line_tmp, line_dir; CODE next_mode; const void *pcfg[CFG_VARIABLES]; int main(int argc, char *argv[]) { int i; FLAG help, version; const char *arg; /* check command line arguments */ clex_data.admin = help = version = 0; for (i = 1; i < argc; i++) { arg = argv[i]; if (strcmp(arg,"-a") == 0 || strcmp(arg,"--admin") == 0) clex_data.admin = 1; else if (strcmp(arg,"--help") == 0) help = 1; else if (strcmp(arg,"--version") == 0) version = 1; else err_exit("Unrecognized option '%s'\n" " try '%s --help' for more information", arg,base_name(argv[0])); } if (version) puts( "\nCLEX File Manager " VERSION "\n" " compiled with POSIX job control: " #ifdef _POSIX_JOB_CONTROL "yes\n" #else "no\n" #endif " compiled with locale support: " #if defined(HAVE_SETLOCALE) && defined(HAVE_STRFTIME) "yes\n" #else "no\n" #endif " system-wide configuration file: " CONFIG_FILE "\n\n" "Copyright (C) 2001-2006 Vlado Potisk " "\n\n" "This is free software distributed without any warranty.\n" "See the GNU General Public License for more details.\n" "\n" "Project homepage is http://www.clex.sk"); if (help) printf( "\nUsage: %s [OPTION]\n\n" " -a, --admin admin mode (system-wide configuration)\n" " --version display program version and exit\n" " --help display this help and exit\n", base_name(argv[0])); if (help || version) exit(0); /* no cleanup necessary at this stage */ /* real start */ puts("\n\n\n\nStarting CLEX " VERSION); #ifdef HAVE_PUTENV putenv("CLEX=" VERSION); /* let's have $CLEX (just so) */ #endif /* initialize program data */ clex_data.pid = getpid(); clex_data.umask = umask(0777); umask(clex_data.umask); clex_data.isroot = geteuid() == 0; /* 0 or 1 */; US_INIT(line_tmp.line); /* belongs to nowhere, initialize it here */ undo_init(&line_tmp); signal_initialize(); /* set signal dispositions */ userdata_initialize(); /* must be done before config */ config_initialize(); /* read configuration asap */ /* * initialize the rest, * the order is no longer important (except when noted) */ help_initialize(); if (!clex_data.admin) { /* all these features are not used in admin mode */ bm_initialize(); completion_initialize(); dir_initialize(); exec_initialize(); files_initialize(); hist_initialize(); lang_initialize(); /* lang_ before list_ */ list_initialize(); xterm_title_initialize(); } else { /* modify the configuration panel for use in the admin mode */ pd_cfg.min = -2; pd_cfg.extra = el_cfg_admin; } /* start CURSES screen handling */ tty_initialize(); curses_initialize(); /* let's go ! */ cx_version(); control_loop(clex_data.admin ? MODE_CFG : MODE_FILE); /* NOTREACHED */ return 0; } clex-3.15/src/tty.c0000644000076400007640000000445510407511653011113 00000000000000/* * * CLEX File Manager * * Copyright (C) 2001-2006 Vlado Potisk * * CLEX is free software without warranty of any kind; see the * GNU General Public License as set out in the "COPYING" document * which accompanies the CLEX File Manager package. * * CLEX can be downloaded from http://www.clex.sk * */ #include #include /* pid_t */ #include /* errno */ #include /* fcntl */ #include /* fputs() */ #include /* struct termios */ #include /* STDIN_FILENO */ #include "clex.h" #include "tty.h" #include "control.h" /* err_exit() */ extern int errno; static struct termios text_termios, raw_termios, *ptermios = 0; #ifdef _POSIX_JOB_CONTROL static pid_t save_pgid = 0; #endif void tty_initialize(void) { if (tcgetattr(STDIN_FILENO,&text_termios) < 0) err_exit("Cannot read the terminal settings"); ptermios = &text_termios; raw_termios = text_termios; /* struct copy */ raw_termios.c_lflag &= ~(ECHO | ICANON | ISIG | IEXTEN); raw_termios.c_cc[VMIN] = 1; raw_termios.c_cc[VTIME] = 0; #ifdef _POSIX_JOB_CONTROL /* move CLEX to its own process group */ save_pgid = tcgetpgrp(STDIN_FILENO); setpgid(clex_data.pid,clex_data.pid); tcsetpgrp(STDIN_FILENO,clex_data.pid); #endif } /* noncanonical, no echo */ void tty_setraw(void) { tcsetattr(STDIN_FILENO,TCSAFLUSH,&raw_termios); } /* note: this is a cleanup function */ void tty_reset(void) { if (ptermios) tcsetattr(STDIN_FILENO,TCSAFLUSH,ptermios); } /* note: this is a cleanup function */ void tty_pgrp_reset(void) { #ifdef _POSIX_JOB_CONTROL if (save_pgid) tcsetpgrp(STDIN_FILENO,save_pgid); #endif } void tty_press_enter(void) { int in, flags; fputs("Press to continue. ",stdout); fflush(stdout); tty_setraw(); while ((in = getchar()) != '\n' && in != '\r') { if (in != EOF) continue; if (errno == EINTR) continue; if (errno == EAGAIN) { flags = fcntl(STDIN_FILENO,F_GETFL); if ((flags & O_NONBLOCK) == O_NONBLOCK) { /* clear the non-blocking flag */ fcntl(STDIN_FILENO,F_SETFL,flags & ~O_NONBLOCK); continue; } } /* prevent looping in the case of an error */ err_exit("Cannot read from standard input"); } tty_reset(); puts("\n----------------------------------------------"); fflush(stdout); } clex-3.15/src/tty.h0000644000076400007640000000024207627475042011121 00000000000000extern void tty_initialize(void); extern void tty_setraw(void); extern void tty_reset(void); extern void tty_pgrp_reset(void); extern void tty_press_enter(void); clex-3.15/src/undo.c0000644000076400007640000001133610407511661011233 00000000000000/* * * CLEX File Manager * * Copyright (C) 2001-2006 Vlado Potisk * * CLEX is free software without warranty of any kind; see the * GNU General Public License as set out in the "COPYING" document * which accompanies the CLEX File Manager package. * * CLEX can be downloaded from http://www.clex.sk * */ #include #include /* clex.h */ #include /* strcmp() */ #include "clex.h" #include "undo.h" #include "control.h" /* err_exit() */ #include "edit.h" /* edit_update() */ #include "inout.h" /* win_remark() */ #include "ustring.h" /* USTRING */ static TEXTLINE *current; static USTRING undo_line = { 0,0 }; static int undo_size, undo_curs, undo_offset; static FLAG disable = 1; /* disable undo mechanism while performing undo operations */ EDIT_OP this_op; /* description of the current operation */ /* initialize data structures */ void undo_init(TEXTLINE *t) { int i; for (i = 0; i < UNDO_LEVELS; i++) US_INIT(t->undo[i].save_line); t->last_op.code = OP_NONE; t->undo_base = t->undo_levels = t->redo_levels = 0; } /* clear the undo history */ void undo_reset(void) { if (textline == 0) return; textline->last_op.code = OP_NONE; textline->undo_levels = textline->redo_levels = 0; disable = 1; } /* * check if 'lstr' is the same as 'sstr' would be * with 'len' chars inserted at position 'pos' */ static int cmp_strings(const char *sstr, const char *lstr, int pos, int len) { return pos >= 0 && len >=0 && (pos == 0 || strncmp(sstr,lstr,pos) == 0) && strcmp(sstr + pos,lstr + pos + len) == 0; } /* which edit operation was this one ? */ static void tell_edit_op(void) { int pos, len; const char *before, *after; before = USTR(undo_line); after = USTR(textline->line); len = textline->size - undo_size; if (len > 0) { if (cmp_strings(before,after,pos = textline->curs - len,len)) { this_op.code = OP_INS; this_op.pos = pos; this_op.len = len; return; } } else if (len == 0) { if (strcmp(before,after) == 0) { this_op.code = OP_NONE; return; } } else { if (cmp_strings(after,before,pos = textline->curs,len = -len)) { this_op.code = OP_DEL; this_op.pos = pos; this_op.len = len; return; } } this_op.code = OP_CHANGE; this_op.pos = this_op.len = 0; } /* make a copy of 'textline' before an edit operation ... */ void undo_before(void) { if (textline == 0) return; disable = 0; current = textline; us_copy(&undo_line,USTR(textline->line)); undo_size = textline->size; undo_curs = textline->curs; undo_offset = textline->offset; } /* ... and now see what happened with it afterwards */ void undo_after(void) { FLAG merge; int idx; if (TSET(disable) || textline == 0 || textline != current) return; tell_edit_op(); if (this_op.code == OP_NONE) return; /* can this edit operation be merged with the previous one ? */ merge = (this_op.code == OP_INS && textline->last_op.code == OP_INS && this_op.len + textline->last_op.len < 10 && this_op.pos == textline->last_op.pos + textline->last_op.len) || (this_op.code == OP_DEL && textline->last_op.code == OP_DEL && this_op.len == 1 && textline->last_op.len == 1 && (this_op.pos == textline->last_op.pos || this_op.pos == textline->last_op.pos - 1)); textline->last_op = this_op; /* struct copy */ textline->redo_levels = 0; if (merge) return; idx = (textline->undo_base + textline->undo_levels) % UNDO_LEVELS; if (textline->undo_levels < UNDO_LEVELS) textline->undo_levels++; else textline->undo_base = (textline->undo_base + 1) % UNDO_LEVELS; us_xchg(&textline->undo[idx].save_line,&undo_line); textline->undo[idx].save_size = undo_size; textline->undo[idx].save_curs = undo_curs; textline->undo[idx].save_offset = undo_offset; } static void undo_redo(int op) { int idx; if (textline == 0) return; if (op) { if (textline->undo_levels == 0) { win_remark("undo not possible"); return; } idx = --textline->undo_levels; textline->redo_levels++; } else { if (textline->redo_levels == 0) { win_remark("redo not possible"); return; } idx = textline->undo_levels++; textline->redo_levels--; } idx = (textline->undo_base + idx) % UNDO_LEVELS; us_xchg(&textline->line,&textline->undo[idx].save_line); textline->size = textline->undo[idx].save_size; textline->curs = textline->undo[idx].save_curs; textline->offset = textline->undo[idx].save_offset; us_xchg(&textline->undo[idx].save_line,&undo_line); textline->undo[idx].save_size = undo_size; textline->undo[idx].save_curs = undo_curs; textline->undo[idx].save_offset = undo_offset; edit_update(); textline->last_op.code = OP_CHANGE; disable = 1; } void cx_undo(void) { undo_redo(1); } void cx_redo(void) { undo_redo(0); } clex-3.15/src/undo.h0000644000076400007640000000026410300111476011226 00000000000000extern void undo_init(TEXTLINE *); extern void undo_reset(void); extern void undo_before(void); extern void undo_after(void); extern void cx_undo(void); extern void cx_redo(void); clex-3.15/src/userdata.c0000644000076400007640000003010010425452360012064 00000000000000/* * * CLEX File Manager * * Copyright (C) 2001-2006 Vlado Potisk * * CLEX is free software without warranty of any kind; see the * GNU General Public License as set out in the "COPYING" document * which accompanies the CLEX File Manager package. * * CLEX can be downloaded from http://www.clex.sk * */ /* * Routines in userdata.c mostly provide access to data stored * in /etc/passwd and /etc/group. All required data is read * into memory to speed up lookups. The data returned by * lookup_xxx() is valid only until next data refresh, the * caller must copy the returned string value if necessary. */ #include #include /* getpwent() */ #include /* stat() */ #include /* uname() */ #include /* time() */ #include /* getgrent() */ #include /* getpwent() */ #include /* strcmp() */ #include /* sprintf() */ #include /* qsort() */ #include /* stat() */ #include "clex.h" #include "userdata.h" #include "control.h" /* err_exit() */ #include "inout.h" /* win_warning() */ #include "sdstring.h" /* SDSTR() */ #include "ustring.h" /* us_cat() */ #include "util.h" /* emalloc() */ /* * cached user(group) records are re-read when: * - /etc/passwd (/etc/group) file changes, or * - the cache expires (EXPIRATION in seconds) to allow * changes e.g. in NIS to get detected, or * - explicitely requested */ #define EXPIRATION 300 /* 5 minutes */ typedef struct pwdata { struct pwdata *next; /* tmp pointer */ SDSTRING login; SDSTRING homedir; SDSTRING fullname; uid_t uid; } PWDATA; typedef struct grdata { struct grdata *next; /* tmp pointer */ SDSTRING group; gid_t gid; } GRDATA; typedef struct { time_t timestamp; /* when the data was obtained, or 0 */ dev_t device; /* device/inode for /etc/passwd */ ino_t inode; int cnt; /* # of entries */ PWDATA **by_name; /* sorted by name */ PWDATA **by_uid; /* sorted by uid */ } USERDATA; typedef struct { time_t timestamp; /* when the data was obtained, or 0 */ dev_t device; /* device/inode for /etc/group */ ino_t inode; int cnt; /* # of entries */ GRDATA **by_gid; /* sorted by gid */ } GROUPDATA; static USERDATA utable = { 0,0,0,0,0,0 }; static GROUPDATA gtable = { 0,0,0,0,0 }; static time_t now; static struct { const char *str; size_t len; int index; } find; /* used by username_find() */ static int qcmp_name(const void *e1, const void *e2) { return strcmp( SDSTR((*(PWDATA **)e1)->login), SDSTR((*(PWDATA **)e2)->login)); } static int qcmp_uid(const void *e1, const void *e2) { return CMP((*(PWDATA **)e1)->uid,(*(PWDATA **)e2)->uid); } static void read_utable(void) { int i, cnt; PWDATA *ud, *list; struct passwd *pw; static FLAG err = 0; if (utable.cnt) { for (i = 0; i < utable.cnt; i++) { sd_reset(&utable.by_name[i]->login); sd_reset(&utable.by_name[i]->homedir); sd_reset(&utable.by_name[i]->fullname); free(utable.by_name[i]); } free(utable.by_name); free(utable.by_uid); } utable.timestamp = now; list = 0; setpwent(); for (cnt = 0; (pw = getpwent()); cnt++) { ud = emalloc(sizeof(PWDATA)); SD_INIT(ud->login); SD_INIT(ud->homedir); SD_INIT(ud->fullname); sd_copy(&ud->login,pw->pw_name); sd_copy(&ud->homedir,pw->pw_dir); sd_copy(&ud->fullname,pw->pw_gecos); ud->uid = pw->pw_uid; ud->next = list; list = ud; } endpwent(); /* * I was told using errno for error detection * with getpwent() is not portable :-( */ if ((utable.cnt = cnt) == 0) { utable.timestamp = 0; if (!TSET(err)) win_warning("USER ACCOUNTS: " "Cannot obtain user account data."); return; } if (TCLR(err)) win_warning("USER ACCOUNTS: " "user account data is now available."); /* temporary linked list -> two sorted arrays */ utable.by_name = emalloc(cnt * sizeof(PWDATA *)); utable.by_uid = emalloc(cnt * sizeof(PWDATA *)); for (ud = list, i = 0; i < cnt; i++, ud = ud->next) utable.by_name[i] = utable.by_uid[i] = ud; qsort(utable.by_name,cnt,sizeof(PWDATA *),qcmp_name); qsort(utable.by_uid ,cnt,sizeof(PWDATA *),qcmp_uid ); } static int qcmp_gid(const void *e1, const void *e2) { return CMP((*(GRDATA **)e1)->gid,(*(GRDATA **)e2)->gid); } static void read_gtable(void) { int i, cnt; GRDATA *gd, *list; struct group *gr; static FLAG err = 0; if (gtable.cnt) { for (i = 0; i < gtable.cnt; i++) { sd_reset(>able.by_gid[i]->group); free(gtable.by_gid[i]); } free(gtable.by_gid); } gtable.timestamp = now; list = 0; setgrent(); for (cnt = 0; (gr = getgrent()); cnt++) { gd = emalloc(sizeof(GRDATA)); SD_INIT(gd->group); sd_copy(&gd->group,gr->gr_name); gd->gid = gr->gr_gid; gd->next = list; list = gd; } endgrent(); if ((gtable.cnt = cnt) == 0) { gtable.timestamp = 0; if (!TSET(err)) win_warning("USER ACCOUNTS: " "Cannot obtain user group data."); return; } if (TCLR(err)) win_warning("USER ACCOUNTS: " "user group data is now available."); /* temporary linked list -> sorted array */ gtable.by_gid = emalloc(cnt * sizeof(GRDATA *)); for (gd = list, i = 0; i < cnt; i++, gd = gd->next) gtable.by_gid[i] = gd; qsort(gtable.by_gid,cnt,sizeof(GRDATA *),qcmp_gid); } void userdata_initialize(void) { char buffer[16]; static SDSTRING host = { 0, "localhost" }; static USTRING lh = { 0,0 }; struct passwd *pw; #ifdef HAVE_UNAME char ch, *pch, *pdot; FLAG ip; struct utsname ut; uname(&ut); sd_copy(&host,ut.nodename); /* strip the domain part */ for (ip = 1, pdot = 0, pch = SDSTR(host); (ch = *pch); pch++) { if (ch == '.') { if (pdot == 0) pdot = pch; } else if (ch < '0' || ch > '9') ip = 0; /* this is a name and not an IP address */ if (!ip && pdot != 0) { *pdot = '\0'; break; } } #endif if ((pw = getpwuid(getuid())) == 0) { sprintf(buffer,"%d",(int)getuid()); txt_printf("USER ACCOUNTS: " "Cannot find your account (UID=%s) in /etc/passwd\n",buffer); us_cat(&lh,"uid",buffer,"@",SDSTR(host),(char *)0); clex_data.shell = "/bin/sh"; clex_data.homedir = getenv("HOME"); } else { us_cat(&lh,pw->pw_name,"@",SDSTR(host),(char *)0); clex_data.shell = *pw->pw_shell ? estrdup(pw->pw_shell) : "/bin/sh"; clex_data.homedir = estrdup(pw->pw_dir); } clex_data.login_at_host = USTR(lh); if (clex_data.homedir == 0 || *clex_data.homedir == '\0') clex_data.homedir = "/"; sd_reset(&host); } void userdata_expire(void) { utable.timestamp = gtable.timestamp = 0; } /* returns 1 if data was re-read, 0 if unchanged */ int userdata_refresh(void) { FLAG stat_ok; int reloaded; struct stat st; reloaded = 0; now = time(0); stat_ok = stat("/etc/passwd",&st) == 0; if (!stat_ok || st.st_mtime >= utable.timestamp || st.st_dev != utable.device || st.st_ino != utable.inode || now > utable.timestamp + EXPIRATION ) { read_utable(); utable.device = stat_ok ? st.st_dev : 0; utable.inode = stat_ok ? st.st_ino : 0; reloaded = 1; } stat_ok = stat("/etc/group",&st) == 0; if (!stat_ok || st.st_mtime >= gtable.timestamp || st.st_dev != gtable.device || st.st_ino != gtable.inode || now > gtable.timestamp + EXPIRATION) { read_gtable(); gtable.device = stat_ok ? st.st_dev : 0; gtable.inode = stat_ok ? st.st_ino : 0; reloaded = 1; } return reloaded; } /* simple binary search algorithm */ #define BIN_SEARCH(COUNT,CMPFUNC,RETVAL) \ { \ int min, med, max, cmp; \ for (min = 0, max = COUNT - 1; min <= max; ) { \ med = (min + max) / 2; \ cmp = CMPFUNC; \ if (cmp == 0) \ return RETVAL; \ if (cmp < 0) \ max = med - 1; \ else \ min = med + 1; \ } \ return 0; \ } /* end of BIN_SEARCH() macro */ /* numeric uid -> login name */ const char * lookup_login(uid_t uid) { BIN_SEARCH(utable.cnt, CMP(uid,utable.by_uid[med]->uid), SDSTR(utable.by_uid[med]->login)) } /* numeric gid -> group name */ const char * lookup_group(gid_t gid) { BIN_SEARCH(gtable.cnt, CMP(gid,gtable.by_gid[med]->gid), SDSTR(gtable.by_gid[med]->group)) } static const char * lookup_homedir(const char *user, size_t len) { if (len == 0) return clex_data.homedir; BIN_SEARCH(utable.cnt, strncmp(user,SDSTR(utable.by_name[med]->login),len), SDSTR(utable.by_name[med]->homedir)) } /* * dir_tilde() function performs tilde substitution. It understands * ~user/dir notation and transforms it to proper directory name. * The result of the substitution (if performed) is stored in * a static buffer that might get overwritten by successive calls. */ const char *dir_tilde(const char *dir) { char ch; size_t i; const char *home; static USTRING buff = { 0,0 }; if (dir[0] != '~') return dir; for (i = 1; (ch = dir[i]) && ch != '/'; i++) ; home = lookup_homedir(dir + 1,i - 1); if (home == 0) return dir; /* no such user */ us_cat(&buff,home,dir + i,(char *)0); return USTR(buff); } /* * Following two functions implement username completion. First * username_find_init() is called to initialize the search, thereafter * each call to username_find() returns one matching entry in * alphabetical order. */ void username_find_init(const char *str, size_t len) { int min, med, max, cmp; find.str = str; find.len = len; if (len == 0) { find.index = 0; return; } for (min = 0, max = utable.cnt - 1; min <= max; ) { med = (min + max) / 2; cmp = strncmp(str,SDSTR(utable.by_name[med]->login),len); if (cmp == 0) { /* * the binary search algorithm is slightly altered here, * there might be more matches than one and we need to * find the first one. */ if (min == max) { find.index = med; return; } max = med; } else if (cmp < 0) max = med - 1; else min = med + 1; } find.index = utable.cnt; } const char * username_find(const char **pfullname) { const char *login, *fullname; if (find.index >= utable.cnt) return 0; login = SDSTR(utable.by_name[find.index]->login); if (find.len && strncmp(find.str,login,find.len)) return 0; if (pfullname) { fullname = SDSTR(utable.by_name[find.index]->fullname); if (*fullname == '\0') fullname = login; *pfullname = fullname; } find.index++; return login; } void user_panel(void) { int i, j; const char *filter, *login, *gecos; uid_t curs; if (utable.cnt > panel_user.usr_alloc) { panel_user.usr_alloc = utable.cnt; if (panel_user.users) free(panel_user.users); panel_user.users = emalloc(panel_user.usr_alloc * sizeof(USER_ENTRY)); } curs = VALID_CURSOR(panel_user.pd) ? panel_user.users[panel_user.pd->curs].uid : 0; filter = panel_user.pd->filtering ? panel_user.pd->filter->line : 0; for (i = j = 0; i < utable.cnt; i++) { if (curs == utable.by_uid[i]->uid) panel_user.pd->curs = j; login = SDSTR(utable.by_uid[i]->login); gecos = SDSTR(utable.by_uid[i]->fullname); if (filter && !substring(login,filter,0) && !substring(gecos,filter,1)) continue; panel_user.users[j].uid = utable.by_uid[i]->uid; panel_user.users[j].login = login; panel_user.users[j++].gecos = gecos; } panel_user.pd->cnt = j; } void user_prepare(void) { panel_user.pd->filtering = 0; user_panel(); panel_user.pd->top = panel_user.pd->min; panel_user.pd->curs = 0; panel = panel_user.pd; textline = 0; } void group_panel(void) { int i, j; const char *filter, *group; gid_t curs; if (gtable.cnt > panel_group.grp_alloc) { panel_group.grp_alloc = gtable.cnt; if (panel_group.groups) free(panel_group.groups); panel_group.groups = emalloc(panel_group.grp_alloc * sizeof(GROUP_ENTRY)); } curs = VALID_CURSOR(panel_group.pd) ? panel_group.groups[panel_group.pd->curs].gid : 0; filter = panel_group.pd->filtering ? panel_group.pd->filter->line : 0; for (i = j = 0; i < gtable.cnt; i++) { if (curs == gtable.by_gid[i]->gid) panel_group.pd->curs = j; group = SDSTR(gtable.by_gid[i]->group); if (filter && !substring(group,filter,0)) continue; panel_group.groups[j].gid = gtable.by_gid[i]->gid; panel_group.groups[j++].group = group; } panel_group.pd->cnt = j; } void group_prepare(void) { panel_group.pd->filtering = 0; group_panel(); panel_group.pd->top = panel_group.pd->min; panel_group.pd->curs = 0; panel = panel_group.pd; textline = 0; } clex-3.15/src/userdata.h0000644000076400007640000000071610421521500012070 00000000000000extern void userdata_initialize(void); extern void userdata_expire(void); extern int userdata_refresh(void); extern const char *lookup_login(uid_t); extern const char *lookup_group(gid_t); extern void username_find_init(const char *, size_t); extern const char *username_find(const char **); extern const char *dir_tilde(const char *); extern void user_prepare(void); extern void user_panel(void); extern void group_prepare(void); extern void group_panel(void); clex-3.15/src/ustring.c0000644000076400007640000001064710407511673011770 00000000000000/* * * CLEX File Manager * * Copyright (C) 2001-2006 Vlado Potisk * * CLEX is free software without warranty of any kind; see the * GNU General Public License as set out in the "COPYING" document * which accompanies the CLEX File Manager package. * * CLEX can be downloaded from http://www.clex.sk * */ #include #include /* clex.h */ #include /* errno */ #include /* va_list */ #include /* free() */ #include /* strlen() */ #include /* getcwd() */ #include "clex.h" #include "ustring.h" #include "util.h" /* emalloc() */ extern int errno; /* * The USTRING structure (defined in clex.h) can store a string * of unlimited length. The memory is allocated dynamically. * * - to initialize (to NULL ptr value) before first use: * static USTRING us = { 0, 0 }; * or * US_INIT(ustring); * - to re-initialize, e.g. before deallocating dynamic USTRING: * us_reset(); * - to store a string * (NULL ptr cannot be stored, but see us_copy() function below): * us_copy(); * or * us_copyn(); * - to retrieve a string: * USTR(us) * or * PUSTR(pus) * - to edit stored name: * a) allocate enough memory with us_setsize() or us_resize() * b) edit the string starting at USTR() location * * WARNING: US_INIT, USTR, and PUSTR are macros */ /* these are tunable parameters */ #define ALLOC_UNIT 24 /* in bytes */ #define MINIMUM_FREE (4 * ALLOC_UNIT) /* * SHOULD_CHANGE_ALLOC() is true if * 1) we need more memory, or * 2) we can free considerable amount of memory (MINIMUM_FREE) */ #define SHOULD_CHANGE_ALLOC(RQ) \ (pustr->USalloc < RQ || pustr->USalloc >= RQ + MINIMUM_FREE) /* memory is allocated in chunks to prevent excessive resizing */ #define ROUND_ALLOC(RQ) \ ((1 + (RQ - 1) / ALLOC_UNIT) * ALLOC_UNIT) /* note that ROUND_ALLOC(0) is ALLOC_UNIT and not 0 */ void us_reset(USTRING *pustr) { if (pustr->USalloc) { free(pustr->USstr); pustr->USalloc = 0; } pustr->USstr = 0; } /* us_setsize() makes room for 'memreq' characters */ void us_setsize(USTRING *pustr, size_t memreq) { if (SHOULD_CHANGE_ALLOC(memreq)) { if (pustr->USalloc) free(pustr->USstr); pustr->USalloc = ROUND_ALLOC(memreq); pustr->USstr = emalloc(pustr->USalloc); } } /* like us_setsize(), but preserving contents */ void us_resize(USTRING *pustr, size_t memreq) { if (SHOULD_CHANGE_ALLOC(memreq)) { pustr->USalloc = ROUND_ALLOC(memreq); pustr->USstr = erealloc(pustr->USstr,pustr->USalloc); } } /* quick alternative to copy */ void us_xchg(USTRING *s1, USTRING *s2) { char *xstr; size_t xalloc; xstr = s1->USstr; s1->USstr = s2->USstr; s2->USstr = xstr; xalloc = s1->USalloc; s1->USalloc = s2->USalloc; s2->USalloc = xalloc; } void us_copy(USTRING *pustr, const char *src) { #if 0 /* uncomment this code to enable NULL ptr assignment */ if (src == 0) { us_reset(pustr); return; } #endif us_setsize(pustr,strlen(src) + 1); strcpy(pustr->USstr,src); } /* note: us_copyn() adds terminating null byte */ void us_copyn(USTRING *pustr, const char *src, size_t len) { char *dst; us_setsize(pustr,len + 1); dst = pustr->USstr; dst[len] = '\0'; while (len-- > 0) dst[len] = src[len]; } /* concatenation: us_cat(&ustring, str1, str2, ..., strN, (char *)0); */ void us_cat(USTRING *pustr, ...) { size_t len; char *str; va_list argptr; va_start(argptr,pustr); for (len = 1; (str = va_arg(argptr, char *)); ) len += strlen(str); va_end(argptr); us_setsize(pustr,len); va_start(argptr,pustr); for (len = 0; (str = va_arg(argptr, char *)); ) { strcpy(pustr->USstr + len,str); len += strlen(str); } va_end(argptr); } /* USTRING version of getcwd() */ int get_cwd_us(USTRING *pustr) { us_setsize(pustr,ALLOC_UNIT); for (;/* until return*/;) { if (getcwd(pustr->USstr,pustr->USalloc)) return 0; if (errno != ERANGE) return -1; /* increase buffer */ us_setsize(pustr,pustr->USalloc + ALLOC_UNIT); } } /* USTRING version of readlink() */ int get_link_us(USTRING *pustr, const char *path) { #ifndef HAVE_READLINK return -1; #else int len; us_setsize(pustr,ALLOC_UNIT); for (;/* until return*/;) { len = readlink(path,pustr->USstr,pustr->USalloc); if (len == -1) return -1; if (len < pustr->USalloc) { pustr->USstr[len] = '\0'; return 0; } /* increase buffer */ us_setsize(pustr,pustr->USalloc + ALLOC_UNIT); } #endif } clex-3.15/src/ustring.h0000644000076400007640000000077510300165235011765 00000000000000#define US_INIT(X) do { (X).USstr = 0; (X).USalloc = 0; } while (0) #define PUSTR(X) ((X)->USstr) #define USTR(X) ((X).USstr) extern void us_setsize(USTRING *, size_t); extern void us_resize(USTRING *, size_t); extern void us_xchg(USTRING *, USTRING *); extern void us_copy(USTRING *, const char *); extern void us_copyn(USTRING *, const char *, size_t); extern void us_cat(USTRING *, ...); extern void us_reset(USTRING *); extern int get_cwd_us(USTRING *); extern int get_link_us(USTRING *, const char *); clex-3.15/src/util.c0000644000076400007640000001224310421717565011250 00000000000000/* * * CLEX File Manager * * Copyright (C) 2001-2006 Vlado Potisk * * CLEX is free software without warranty of any kind; see the * GNU General Public License as set out in the "COPYING" document * which accompanies the CLEX File Manager package. * * CLEX can be downloaded from http://www.clex.sk * */ #include #include /* clex.h */ #include /* fstat() */ #include /* tolower */ #include /* open() */ #include /* sprintf() */ #include /* malloc() */ #include /* strlen() */ #include /* read() */ #include /* SSIZE_MAX */ #include "clex.h" #include "util.h" #include "control.h" /* err_exit() */ #include "ustring.h" /* us_resize() */ /* variables used in pathname_xxx() functions */ static USTRING sf_buff = { 0,0 }; static size_t sf_dirlen; /* get rid of directory part in 'pathname' */ const char * base_name(const char *pathname) { const char *base, *pch; char ch; for (pch = base = pathname; (ch = *pch++) != '\0'; ) if (ch == '/') base = pch; return base; } int substring(const char *haystack, const char *needle, int ic) { const char *h, *n; for ( ; ; haystack++ ) { for (h = haystack, n = needle; ; h++, n++) { if (*n == '\0') return 1; if (*h == '\0') return 0; if (ic ? tolower((unsigned char)*h) != tolower((unsigned char)*n) : *h != *n) break; } } /* NOTREACHED */ return 0; } static void alloc_fail(size_t size) { err_exit("Memory allocation failed, could not allocate %lu bytes", (unsigned long)size); /* NOTREACHED */ } /* malloc with error checking */ void * emalloc(size_t size) { void *mem; if (size > SSIZE_MAX) /* * possible problems with signed/unsigned int ! * * It is not normal to request such a huge memory * block anyway (16-bit systems are not supported) */ alloc_fail(size); if ((mem = malloc(size)) == 0) alloc_fail(size); return mem; } /* realloc with error checking */ void * erealloc(void *ptr, size_t size) { void *mem; /* not sure if really all realloc()s can handle this case */ if (ptr == 0) return emalloc(size); if (size > SSIZE_MAX) /* see emalloc() above */ alloc_fail(size); if ((mem = realloc(ptr,size)) == 0) alloc_fail(size); return mem; } /* strdup with error checking */ char * estrdup(const char *str) { char *dup; if (str == 0) return 0; dup = emalloc(strlen(str) + 1); strcpy(dup,str); return dup; } /* set the directory name for pathname_join() */ void pathname_set_directory(const char *dir) { char *str; sf_dirlen = strlen(dir); us_resize(&sf_buff,sf_dirlen + 24); /* 24 extra bytes = slash + initial space for the filename */ str = USTR(sf_buff); strcpy(str,dir); if (str[sf_dirlen - 1] != '/') str[sf_dirlen++] = '/'; /* the string is not null terminated now, that's ok */ } /* * join the filename 'file' with the directory set by * pathname_set_directory() above * * returned data is overwritten by subsequent calls */ char * pathname_join(const char *file) { us_resize(&sf_buff,sf_dirlen + strlen(file) + 1); strcpy(USTR(sf_buff) + sf_dirlen,file); return USTR(sf_buff); } char * my_strerror(int errcode) { static char buffer[32]; sprintf(buffer,"errno = %d",errcode); return buffer; } /* * dequote backslash quoted text: 'src' -> 'dst' * 'dst' buffer must be large enough */ size_t dequote_txt(const char *src, size_t len, char *dst) { char ch; size_t i, j; FLAG quote; for (i = j = 0, quote = 0; i < len; i++) { ch = src[i]; if (TCLR(quote) || !(quote = ch == '\\')) dst[j++] = ch; } dst[j] = '\0'; return j; } /* * under certain condition can read() return fewer bytes than requested, * this wrapper function handles it * * remember: error check should be (read() == -1) and not (read() < 0) */ ssize_t read_fd(int fd, char *buff, size_t bytes) { size_t total; ssize_t rd; for (total = 0; bytes > 0; total += rd, bytes -= rd) { rd = read(fd,buff + total,bytes); if (rd == -1) /* error */ return -1; if (rd == 0) /* EOF */ break; } return total; } /* * read file into memory * input: filename, *size = max size * output (success): return value = allocated buffer, *size = actual size * output (failure): return value = NULL, *errcode = error code */ char * read_file(const char *filename, size_t *size, int *errcode) { int fd; struct stat stbuf; size_t filesize; /* we do not need off_t here */ ssize_t rd; char *buffer; if ( (fd = open(filename,O_RDONLY)) < 0) { *errcode = 1; /* cannot open (errno is set) */ return 0; } fstat(fd,&stbuf); /* cannot fail with valid descriptor */ if (stbuf.st_size > *size) { close(fd); *errcode = 2; /* size too big */ return 0; } /* read into memory */ filesize = stbuf.st_size; buffer = emalloc(filesize + 1); rd = filesize ? read_fd(fd,buffer,filesize) : 0; close(fd); if (rd == -1) { free(buffer); *errcode = 3; /* read error (errno is set) */ return 0; } if (filesize && buffer[filesize - 1] != '\n') buffer[filesize++] = '\n'; *size = filesize; return buffer; } time_t mod_time(const char *file) { struct stat stbuf; return stat(file,&stbuf) < 0 ? 0 : stbuf.st_mtime; } clex-3.15/src/util.h0000644000076400007640000000075310421714176011253 00000000000000extern const char *base_name(const char *); extern int substring(const char *, const char *,int); extern void *emalloc(size_t); extern void *erealloc(void *, size_t); extern char *estrdup(const char *); extern void pathname_set_directory(const char *); extern char *pathname_join(const char *); extern size_t dequote_txt(const char *, size_t, char *); extern ssize_t read_fd(int, char *, size_t); extern char *read_file(const char *, size_t *, int *); extern time_t mod_time(const char *); clex-3.15/src/xterm_title.c0000644000076400007640000000761110420644452012627 00000000000000/* * * CLEX File Manager * * Copyright (C) 2001-2006 Vlado Potisk * * CLEX is free software without warranty of any kind; see the * GNU General Public License as set out in the "COPYING" document * which accompanies the CLEX File Manager package. * * CLEX can be downloaded from http://www.clex.sk * */ #include #include /* clex.h */ #include /* iscntrl() */ #include /* signal() */ #include /* va_list */ #include /* printf() */ #include /* getenv() */ #include /* strchr() */ #include /* fork() */ /* waitpid() */ #ifdef HAVE_SYS_WAIT_H # include #endif #include "clex.h" #include "xterm_title.h" #include "cfg.h" /* config_num() */ #include "util.h" /* estrdup() */ static FLAG enabled = 0; static const char *oldtitle = 0; #define XPROP_TIMEOUT 6 /* timeout for xprop command in seconds */ #define CMD_STR 20 /* name of executed command in the title */ void xterm_title_initialize(void) { xterm_title_reconfig(); xterm_title_set(0,0); } /* * run the command * xprop -id $WINDOWID WM_NAME * to get the current xterm title * * errors are not reported, we don't want to confuse the user */ static const char * get_title(void) { int fd[2]; ssize_t rd; const char *wid; char *p1, *p2, title[128]; pid_t pid; struct sigaction act; if ( (wid = getenv("WINDOWID")) == 0) return 0; if (pipe(fd) < 0 || (pid = fork()) < 0) return 0; if (pid == 0) { /* this is the child process */ close(fd[0]); /* close read end */ if (fd[1] != STDOUT_FILENO) { if (dup2(fd[1], STDOUT_FILENO) != STDOUT_FILENO) _exit(126); close(fd[1]); } act.sa_handler = SIG_DFL; act.sa_flags = 0; sigemptyset(&act.sa_mask); sigaction(SIGALRM,&act,0); alarm(XPROP_TIMEOUT); execlp("xprop", "xprop", "-id", wid, "WM_NAME", (char *)0); _exit(127); } /* parent continues here */ /* do not return before waitpid() or you create a zombie */ close(fd[1]); /* close write end */ rd = read_fd(fd[0],title,sizeof(title) - 1); close(fd[0]); if (waitpid(pid, 0, 0) < 0) return 0; if (rd == -1) return 0; title[rd] = '\0'; /* get the window title in quotation marks */ p1 = strchr(title,'\"'); if (p1 == 0) return 0; p2 = strchr(++p1,'\"'); if (p2 == 0) return 0; *p2 = '\0'; return estrdup(p1); } void xterm_title_reconfig(void) { const char *term; enabled = 0; /* 0 = disabled */ if (config_num(CFG_XTERM_TITLE) == 0) return; /* 1 = automatic -> check $TERM for xterm, kterm or dtterm */ if (config_num(CFG_XTERM_TITLE) == 1) { if ( (term = getenv("TERM")) == 0) return; if (strncmp(term,"xterm",5) && strncmp(term,"kterm",5) && strncmp(term,"dtterm",6)) return; } /* otherwise 2 = enabled */ if (oldtitle == 0 && (oldtitle = get_title()) == 0) oldtitle = "terminal"; enabled = 1; } static void set_xtitle(const char *str1, ...) { va_list argptr; const char *strn; fputs("\033]0;",stdout); fputs(str1,stdout); va_start(argptr,str1); while ( (strn = va_arg(argptr, char *)) ) fputs(strn,stdout); va_end(argptr); /* Xterm FAQ claims \007 is incorrect, but everybody uses it */ fputs("\007",stdout); fflush(stdout); } void xterm_title_set(int busy, const char *cmd) { char short_cmd[CMD_STR]; FLAG longcmd; int i, ch; if (!enabled) return; if (cmd == 0) { /* CLEX is idle */ set_xtitle("clex: ", clex_data.login_at_host, (char *)0); return; } /* CLEX is executing or was executing 'cmd' */ for (longcmd = 0, i = 0; (ch = (unsigned char)cmd[i]); i++) { if (i == CMD_STR - 1) { longcmd = 1; break; } short_cmd[i] = iscntrl(ch) ? '?' : ch; } short_cmd[i] = '\0'; set_xtitle("clex: ", busy ? "" : "(", short_cmd, longcmd ? "..." : "", busy ? "" : ")", (char *)0); } /* note: this is a cleanup function */ void xterm_title_restore(void) { if (enabled) set_xtitle(oldtitle,(char *)0); } clex-3.15/src/xterm_title.h0000644000076400007640000000025107547526615012645 00000000000000extern void xterm_title_initialize(void); extern void xterm_title_reconfig(void); extern void xterm_title_set(int, const char *); extern void xterm_title_restore(void); clex-3.15/src/clex.10000644000076400007640000000166010407346534011143 00000000000000.TH CLEX 1 .SH NAME clex \- file manager .SH SYNOPSIS .B clex .RI [ option ] .SH "DESCRIPTION" CLEX is an interactive full-screen file manager. Refer to the on-line help for more information about usage. .SH OPTIONS .TP .B \-a, \-\-admin Run CLEX in admin mode. System-wide configuration can be customized in admin mode. Write access to the system-wide configuration file is required. .TP .B \-\-version Display program version and some basic information (including location of the system-wide configuration file) and exit. .TP .B \-\-help Display help and exit. .SH NOTES CLEX uses CURSES library. .SH FILES .TP .BI sysconfdir /clexrc system-wide configuration file .RB ( sysconfdir directory is typically .I /etc or .IR /usr/local/etc ) .TP .I ~/.clexrc personal configuration file .TP .I ~/.clexbm personal bookmarks file .SH AUTHOR Copyright (C) 2001-2006 Vlado Potisk .SH NOTES CLEX web page: .B http://www.clex.sk clex-3.15/src/help_en.hlp0000644000076400007640000017330110465571755012260 00000000000000# # CLEX helpfile (English) # @V=@VERSION@ ############################################################ @P=changelog @@=what's new 3.15 14-AUG-2006 Problems fixed: - the tilde expansion in the internal cd (change directory) command did not work in CLEX 3.14, the problem has been corrected - the usage of the key in the history panel has been corrected: press to delete the character from the command line and press to delete the entry from the panel - the situation when some external command crashes and leaves the non-blocking flag set on standard input is now properly handled New/improved functionality: - the locate file function was replaced by a more efficient panel filter mechanism. The filtering is available in several panel types (ctrl-F) - some key bindings has been redefined for compatibility reasons ==> new key bindings @@=keys315 - (for emacs users) ctrl-G has now the same meaning as ctrl-C (cancel) - user and group names longer than 8 characters were silently truncated in the file panel, such names are now displayed using the '>' mark - user (alt-U) and group (alt-G) information panels have been added - new panel ( ) that summarizes all completion and insertion functions has been added. Type of the completion can be specified using this panel - completion of commands from the history utilizes the same user interface as the name completion - changes made in the bookmark manager can be cancelled - the input line of the directory panel has no longer precedence over the panel contents. You can switch the focus (indicated by cursor bar's visibility) from the input line to the panel and back - it is no longer possible to execute commands directly from within the history panel. It was easy to make a mistake there and execute other command than intended (panel vs input line) - characters '!' and ':' are automatically quoted only if your shell is a C-shell - there is yet another new option in the directory compare panel - configuration parameter SHELLPROG: standard option -c is appended automatically if it is not specified - configuration parameters CMD_Fn: command parameters $c and $S have been added (cursor position and selected files) - configuration parameters LAYOUTn: there are two new fields: $S and $P (alternative forms of file size and permissions) 3.14 03-NOV-2005 New/improved functionality: - directories can be now bookmarked. Bookmarks are automatically saved to a file. Tools for managing bookmarks are provided in the bookmark panel - new configuration parameter KILOBYTE controls whether filesize is displayed in 1000 or 1024 bytes large units - minor code cleanup 3.13 21-SEP-2005 Problems fixed: - the filename completion routine did not handle correctly the special case when a directory and a command in the search path had the same name. Now both files appear in the completion list New/improved functionality: - the undo function (ctrl-Z) has been improved, several editing steps can be undone and the counterpart editing function redo has been added ctrl-Z = redo 3.12 14-JUN-2005 Problems fixed: - users could not save their configuration. This bug was introduced in the previous release and is now fixed 3.11 17-MAY-2005 Problems fixed: - the sort order of the directory names in the directory panel was not controlled by the configuration parameter COLLATE New/improved functionality: - the panel used for confirmation of the configuration changes has been merged into the configuration panel - new option has been added to the directory compare panel - if a file cannot be read during data comparison, files are marked as different (previously only an unreadability warning was given) - entries from the command history list can be now deleted with the key - pattern history has been removed from the select files function as it was not really helpful - configuration parameter SHOW HIDDEN has been cancelled - added support for shifted left and right arrow keys -------------------- Details about versions released before 2005 can be found in the ChangeLog file which is part of the CLEX source code package. It can be also downloaded from the CLEX webpage www.clex.sk. ############################################################ @P=keys315 @@=new key bindings (CLEX version >= 3.15) These key bindings have been redefined; use the new keys instead of the old ones (please excuse the inconvenience) In order to make this transition as easy as possible CLEX 3.15 recognizes the old keystrokes where indicated (*). old new move cursor left to next word ctrl-B --> alt-B (*) move cursor right to next word ctrl-W --> alt-F (*) delete word ctrl-D --> alt-D (*) directory panel alt-D --> alt-W bookmark panel alt-B --> alt-K delete until the end of the line ctrl-Y -> ctrl-K (*) complete from the command history ctrl-K --> alt-P main function menu ctrl-G --> alt-M insert the full filename -> ctrl-A ############################################################ # # ToC should contain links to these pages: # bookmarks, compare, completion, config, dir, file, history, # menu, paste, select, sort, user # @P=ToC @@=TABLE OF CONTENTS (CLEX @VERSION@) ==> INDEX @@=index BASIC INFORMATION ==> How to use this on-line help @@=help ==> Screen overview @@=screen ==> Help with keys @@=keys WORKING WITH CLEX ==> File panel & command line @@=file In the file panel: ==> Selecting files using patterns @@=select ==> Sorting files @@=sort ==> Comparing directories @@=compare ==> Main function menu @@=menu ==> Name completion @@=completion ==> Directory panel @@=dir ==> Bookmark panel @@=bookmarks ==> Command history panel @@=history ==> Configuration panel @@=config ==> User and group data @@=user ==> Using filters @@=filter ABOUT CLEX ==> What's new <-- PLEASE READ after installation/upgrade @@=changelog ==> Miscellaneous notes @@=notes ==> About CLEX @@=about -------------------- - please report any errors or typos to clex@clex.sk - you can browse this help also on Internet: http://www.clex.sk/help/ ############################################################ @P=index @@=Index A about CLEX @@=about admin mode (configuration) @@=admin automatic filename quoting @@=quoting B bookmark panel (directory bookmarks) @@=bookmarks C changelog @@=changelog changing working directory: - the 'cd' command @@=cd - the directory panel @@=dir - the bookmark panel @@=bookmarks - in the file panel (see II. FILES AND DIRECTORIES) @@=file command history (history panel) @@=history command line options @@=options compare directories @@=compare completion (name completion) @@=completion completion/insertion panel @@=paste configuration, admin mode @@=admin configuration, configuration panel @@=config D directory panel @@=dir E editing: - advanced (file panel, see III. ADVANCED EDITING) @@=file - basic @@=keys_textline F file panel @@=file file panel screen @@=screen filename completion (name completion) @@=completion filters @@=filter G group information panel @@=user H history panel @@=history homepage: http://www.clex.sk K keys @@=keys L license agreement @@=license N name completion @@=completion M main function menu (main menu) @@=menu P panels: - bookmark panel @@=bookmarks - configuration panel @@=config - directory panel @@=dir - file panel @@=file - history panel @@=history primary panel (working directories) @@=2dirs Q quoting of filenames @@=quoting S screen overview (file panel screen) @@=screen secondary panel (working directories) @@=2dirs selecting files (file panel, II. FILES AND DIRECTORIES) @@=file selecting files using patterns @@=select sorting filenames @@=sort T tilde substitution @@=tilde U user information panel @@=user W working directories @@=2dirs ############################################################ @P=options @@=command line options These options are recognized when starting CLEX from the command line: -a, --admin Run CLEX in admin mode. System-wide configuration can be customized in admin mode. Write access to the system-wide configuration file is required. ==> admin mode @@=admin --version Display program version and some basic information and exit. --help Display help and exit. ############################################################ @P=help @@=help with on-line help display the table of contents ctrl-C or ctrl-G leave help and move cursor bar and move cursor bar or follow link to other help-page (links are highlighted) or go back to previous help-page On-line help is context sensitive: after pressing it displays the table of contents as its first page and the cursor bar is positioned on a link corresponding with the currently used panel. ############################################################ @P=screen @@=CLEX screen overview The screen is divided into two areas: the PANEL, where various kinds of data are displayed, and the INPUT LINE, where a user can enter and edit his/her input. PANEL heading ---> /usr/local/bin /tmp frame -----> ---------------------------------------- /-> 07:55 5.120 /DIR . /--> 23feb01 1.024 /DIR .. data --<---> >01sep01****650k***exec**perl**********< \--> 12oct99 49k exec gzip \-> frame -----> ---------------------------------<3/4>-- info line--> 0755 rwxr-xr-x root:sys acc=22:12 *CLEX*file*manager********************** INPUT LINE -------> shell $ echo "Hello, world!"_ prompt ------^ ^ user's input --------' There are several types of panels with a corresponding input line, e.g. the file panel with the COMMAND LINE or the configuration panel. One of the lines in the panel is highlighted with the CURSOR BAR. It is called the CURRENT LINE. If a line is too long to fit on the screen, it is indicated by a highlighted character '>' on the right. In the right margin in the panel frame there is the line number of the current line, and the total number of lines in the panel. The input line occupies only a few lines on the screen, but it can contain many lines of text. ############################################################ @P=keys @@=frequently used keys Notation: ctrl-X = press and alt-X = press and or and or press first and then (depends on your terminal/keyboard) Basic keys available in all panels: ==> CLEX control keys @@=keys_control ==> panel scrolling keys @@=keys_scroll ==> basic editing commands @@=keys_textline -------------------- Notes: - working arrow keys are an essential requirement - please read this note if special keys to are not working properly on your terminal ==> about function keys @@=keys_fn ############################################################ @P=keys_fn @@=problems with function keys If function keys to do not work on your terminal as expected, use this procedure until the problem gets fixed: press alt-1 (or 1) for alt-2 (or 2) for ... alt-9 (or 9) for alt-0 (or 0) for On some systems the keys work properly but sequences do not work. You have to press the key twice before pressing to . -------------------- Note: - N is not ############################################################ @P=keys_scroll @@=panel scrolling keys These keystrokes scroll a panel: line up line down page up page down go to the top of panel go to the bottom of panel ############################################################ @P=keys_textline @@=basic editing commands You can use following keys for editing: MOVE CURSOR character left character right to the beginning of the line to the end of the line alt-B or shift- word left (back) alt-F or shift- word right (forward) line up line down DELETE delete the character under the cursor alt-D delete the word at the cursor or ctrl-H delete the character to the left ctrl-K delete until the end of the line ctrl-U delete the entire line INSERT All regular text that you type is inserted, there is no overtype mode. Press ctrl-V to insert special characters. ctrl-V insert the following character X ctrl-V insert the code NNN decimal (001 to 255) ctrl-V X insert the code NN hex (01 to FF) UNDO/REDO ctrl-Z undo (reverse the last insert or delete operation) ctrl-Z redo (revert to the state before undo) Note: -------------------- - unprintable characters are displayed as highlighted question marks '?'. If you put the cursor over such character, you can see its ASCII value ############################################################ @P=keys_control @@=CLEX control commands These are the keys to remember: ctrl-C or ctrl-G cancel function or leave the current panel alt-M invoke main function menu ctrl-L redraw screen on-line help alt-Q quit program ############################################################ @P=file @@=file panel Working with the file panel is the basic operation mode. You can inspect files, change directories, create commands in the command line, and execute them. ==> introduction @@=file_intro I. ACCESS TO OTHER PANELS alt-M go to the main function menu ==> main function menu @@=menu alt-W go to the directory panel ==> change working directory @@=dir alt-K go to the bookmark panel ==> directory bookmarks @@=bookmarks alt-C go to the program configuration panel ==> configuring CLEX @@=config alt-S go to the sort panel ==> change sort order for files @@=sort alt-H go to the command history panel ==> command history list @@=history alt-U and alt-G go to the user/group panel ==> user and group information @@=user go to the completion/insertion panel ==> complete/insert text at the input line @@=paste II. FILES AND DIRECTORIES 1) Changing working directory / change into the root directory . change into the parent (..) directory ~ change into your home directory several functions, see below in 'II.3 Miscellaneous' alt-W go to the directory panel alt-K go to the bookmark panel (see above in 'I. OTHER PANELS') See also: ==> the 'cd' command @@=cd 2) Selecting files Selected names are to be used in commands, see the paragraph 'III.3 building commands' below. Directories . and .. cannot be selected. select/deselect current file ctrl-T ditto alt-+ select files that match pattern alt-- deselect files that match pattern ==> pattern matching rules @@=select alt-* invert selection (in the menu) select all files (in the menu) deselect all files alt-= compare files in both directories ==> how CLEX compares files @@=compare 3) Miscellaneous ctrl-R re-read the contents of the directory, i.e. refresh the file panel ctrl-R same as ctrl-R, but user account data gets reloaded as well (this is rarely needed because CLEX takes care of it automatically) ==> user account data caching @@=accounts ctrl-X exchange primary <--> secondary panel ctrl-F panel filter ==> how to use the panel filter @@=filter three functions: if there is a command in the command line: = execute the current command otherwise if current file is a directory: = change into this directory otherwise if current file is executable: = insert './file' into the command line change into a directory III. ADVANCED EDITING 1) Inserting (pasting) names into the command line insert or complete ==> using the key @@=tab insert the name of the current file insert the names of all selected files ctrl-A insert the full pathname of the current file: /path/to/file ctrl-E insert the name of the secondary working directory ctrl-E insert the name of the current working directory ==> about working directories @@=2dirs ctrl-O insert the target of a symbolic link 2) Filename completion insert or complete ==> using the key @@=tab 3) Building commands insert the name of the current file - insert a command: = view = edit = copy = move = make dir = delete = print to = user defined The commands above normally work with the current file. If you press before - then they work with the selected files. execute the command All inserted filenames are quoted. ==> automatic quoting @@=quoting 4) Command history ctrl-P recall the previous command from the history list ctrl-N recall the next command alt-P complete command, i.e. search the history for command(s) matching the text in the command line alt-H go to the history panel (see above in 'I. OTHER PANELS') A menu of selected functions can be found in the completion/insertion panel. Press to display it. ==> completion/insertion panel @@=paste ############################################################ @P=accounts @@=user account data CLEX internally caches the data about user and group accounts. This data is mainly used to obtain the file owners' names. CLEX automatically monitors /etc/passwd and /etc/group system files and detects any changes immediately. Account data may be also stored outside of these files, e.g. in a network database called NIS (this is a seldom used feature). The user account data cache expires after five minutes, so it can take up to five minutes before CLEX detects any modifications that have been made. To overcome this limitation you can press before ctrl-R to force immediate refresh of the user data cache. ############################################################ @P=file_intro @@=file panel introduction You can see two directory names on the top of the file panel screen: the current working directory on the left and the secondary working directory on the right. ==> working directories @@=2dirs The contents of the current working directory are listed in the file panel on the screen. One file is highlighted with the cursor bar. It is called the current file, additional information about it is displayed in the info line. The layout of the file panel screen is configurable; the following data may be shown in the listing of files or in the info line: - name of the file - where the symbolic link points to (links only) - date or time of last file modification - date or time of last file access - date or time of last inode change - file size in bytes, KB, or MB or device minor and major numbers (devices only) - whether it is a symbolic link (indicated by -> ) - type of file: [none] plain file exec plain file, executable suid executable file with set-UID bit set Suid set-UID file owned by root sgid executable file with set-GID bit set /DIR directory /MNT directory, active mount point Bdev block device Cdev character device FIFO FIFO; FIFOs are also called named pipes SOCK socket spec special file, i.e. anything else ?? type could not be determined due to an error - whether the file is selected (indicated by * ) - permission bits (as octal number and/or as a string) - owner and group - number of hard links or an indicator of multiple links The number of selected files (if any) is shown in the panel frame along with the line numbers. The command line occupies only a few lines on the screen, but it can contain many lines of text. Here you type and edit commands to be executed. The prompt is configurable. -------------------- Notes: - /DIR and /MNT - CLEX might not detect mount points created with mount --bind or mount --move available on modern linux kernels - time of the day instead of date is displayed for times within the last 18 hours - device minor numbers are shown in hexadecimal - owner and group names are limited to 9 characters here, visit the user or group information panel to see the full names ############################################################ @P=2dirs @@=working directories There are two file panels and two corresponding working directories: 1) The contents of the normal current working directory are listed in the primary file panel on the screen. 2) The so-called secondary working directory is used as a destination directory for copy and move commands. It is associated with the secondary file panel which is not displayed on the screen. Here are some related functions: ctrl-X exchange primary <--> secondary panel alt-= compare files in both directories and mark differences ctrl-E insert the name of the secondary working directory ctrl-E insert the name of the current working directory and commands COPY and MOVE normally copy and move files from the current directory to the secondary working directory ############################################################ @P=quoting @@=automatic filename quoting CLEX correctly handles special characters in filenames. For example: in order to delete a file named '*' (asterisk) it generates the correct command 'rm \*', and not the incorrect and disastrous 'rm *'. Please note that automatic quoting applies only to filenames being inserted into the command line ( and keys to ). See also: ==> configuration parameter QUOTE @@=config_other ############################################################ @P=tab @@=functions of the key The key has two really useful functions in the file panel: 1) if the cursor stands within or immediately after a word, attempts to complete it ==> name completion @@=completion 2) otherwise (if there is nothing to complete) inserts text into the command line: a) if a command name is expected (it is the first word in the command) and the current file is an executable file or a directory, then it inserts: ./executable or directory/ b) if an argument is expected (not the first word in the command), it inserts the name of the current file: file -------------------- Notes: - if you just want to insert filename(s) without any completion, you might also use the key - all inserted filenames are correctly quoted ==> automatic quoting @@=quoting ############################################################ @P=filter @@=ctrl-F - panel filter This function helps you to find an entry in a long listing quickly. It is available in the file panel (file names), the directory panel (directory names), the history panel (commands), and the user/group panels (user names). There are two filtering modes: - filter expression is a substring this is the default mode. - filter expression is a pattern this mode is available in the file panel only and is is automatically selected if the filter expression contains wildcards: * ? or []. ==> pattern matching details @@=patterns Type in some: - string appearing in the entry, or - pattern matching the filename, respectively. While you type, the panel contents shrink to display only those entries that match the filter expression you have entered. All panel functions are available while the panel filter is active. Finally press: - to cancel the panel filter (see the note below) ctrl-F - to return to the input line while the filter remains active. Repeated ctrl-F will bring you back to the filter expression. -------------------- Notes: - the filter in the directory panel cannot be cancelled (you can delete the filter expression though). This prevents an undesired interaction between filtering and compacting of the directory names. - warning 'pattern is incomplete' is shown when a closing quote or a closing brace is missing ############################################################ @P=compare @@=alt-= - comparing directories Files in the current working directory (primary panel) and files in the secondary working directory (secondary panel) are compared with each other and the differences are marked with selection marks. Files which are the same in both directories are not selected and files which do not appear in both directories or are different are selected. There are six comparison levels. In level 0 are two files equal if they have the same name and the same type, In addition to this level, the file size, file ownership and access permissions (the file mode) and/or the file data (contents of the files) are compared in levels 1 to 5. In level 0 and 1 there is relaxed type checking: symbolic links are treated as files of the same type. Starting from level 2 there is exact type checking: normal files and symbolic links are considered not equal. Select the desired level with the cursor bar or press the corresponding key 0 to 5. -------------------- Notes: - both directories are automatically re-read before comparison - only the data of plain files is compared ############################################################ @P=bm_manager @@=bookmark manager The bookmark manager is accessible directly from the bookmark panel and provides set of functions needed for the bookmark list maintenance: D move the entry down U move the entry up or I insert a new entry or R remove the bookmark from the list edit the current bookmark After finishing your work just leave the panel. The data are saved automatically, there is no SAVE function. In the case you change your mind and do not want to save the modified bookmark list, select '--> Revert' from the top of the panel, then start again or leave the panel. -------------------- Note: - bookmarked directory names must be absolute directories, i.e. starting from the root directory / ############################################################ @P=bookmarks @@=alt-K - bookmark panel Bookmarks are a list of directory names you wish to record. They are preserved even when you exit CLEX. To add a bookmark: - go to the directory you wish to bookmark - enter the bookmark panel and select '-->Bookmark current working directory' More functions (edit, delete, etc.) can be found in the bookmark manager - follow the '--> Manage bookmarks' link. ==> bookmark manager @@=bm_manager -------------------- Notes: - bookmarks are stored in a file named .clexbm in user's home directory - concurrent CLEX sessions: bookmarks changed in another session are loaded automatically every time the bookmark panel is entered ############################################################ @P=dir @@=alt-W - changing working directory The directory panel allows you to change the working directory using any of the following methods: 1) Choosing directory name from the panel CLEX maintains a list of recently visited directories to help you to return to a previously used directory easily. The list is sorted alphabetically and is compacted. ==> what is compacting @@=compacting Simply highlight the requested directory with the cursor bar and press . A new list will appear in the panel showing the chosen directory split into components. Confirm the requested directory again with . The panel filter (ctrl-F) can be used for finding directory names in the panel. ==> how to use the panel filter @@=filter 2) Entering new directory name Either press the key to insert the current name from the panel to the empty input line or simply start to type in the name of the new working directory. All editing functions are available. ==> editing text @@=keys_textline With the key you can try to complete a partial directory name. ==> name completion @@=completion Finally press . When the input line or the panel is being used, the focus automatically changes accordingly. The focus is indicated by the cursor bar's visibility and by highlighting of the input line prompt. Which directory name has the focus is important when you press the . 3) Choosing directory name from the bookmark list Follow the '--> Bookmarks' link (or press alt-K) to switch to the bookmark panel and then select a directory from the list. ==> bookmark panel @@=bookmarks Note that CLEX performs tilde substitution. ==> tilde substitution @@=tilde If an error occurs (e.g. directory not found), either correct the directory name and try again or press ctrl-C (or ctrl-G) to cancel the operation and leave the directory panel. -------------------- Please note that there are also convenient methods to change the working directory without using the directory panel: - make use of the 'cd' command in the command line ==> the 'cd' command @@=cd - traverse the directory tree: move the file panel cursor bar to the requested directory and press . The can be omitted if the command line is empty. - use the shortcuts for frequently used change directory commands: alt-/ change into the root directory alt-. change into the parent (..) directory alt-~ change into your home directory ############################################################ @P=compacting @@=compacted directory list If there are two directories in the list named for example /usr and /usr/X11R6/lib/X11/fonts/Type1, the former is considered to be contained in the latter and only the longer name appears in the list. If you then choose /usr/X11R6/lib/X11/fonts/Type1 from the list, CLEX splits it into a list of components like this: /usr/X11R6/lib/X11/fonts/Type1 /usr/X11R6/lib/X11/fonts /usr/X11R6/lib/X11 /usr/X11R6/lib /usr/X11R6 /usr / and the /usr directory from our example reappears in the panel this way. ############################################################ @P=cd @@=the 'cd' command The 'cd' command changes the current directory. Simply type cd /some/directory at the command line and press . To make it work, CLEX treats the 'cd' command as a special case and processes it internally. It is required that all special shell characters occurring in the directory name are quoted with a backslash, otherwise the command will not be processed internally. The tilde substitution is supported though. ==> tilde substitution @@=tilde The 'cd' command is an alternative to the directory panel. ==> directory panel @@=dir Examples: this command cd /var/log will be processed internally and will change the working directory, while this command cd /dev ; ls -l lp* will be executed normally, i.e. by a separate process and the effect of 'cd' will be lost after returning to CLEX. -------------------- Notes: - the special shell characters mentioned above are listed here: ==> QUOTE parameter @@=config_other ############################################################ @P=tilde @@=tilde substitution If the directory name begins with a tilde: ~ - the tilde will be substituted with your home directory ~username - if you append a username after the tilde, it will be substituted with the home directory of the the specified user. If no such user is found, then the original text is left unchanged Examples: ~root - the home directory of the user root ~/bin - the subdirectory bin in your home directory ############################################################ @P=history @@=alt-H - command history The history panel offers advanced functions for work with the command line history list. The most common tasks can be accomplished directly from the file panel: see ctrl-P, ctrl-N, and alt-P. In the history panel you can browse the list of recently executed commands, execute a chosen command, or insert the command(s) to the command line and edit them as required, for example you can easily combine two or more previously executed commands into one new command. Help with keys: ==> moving cursor bar @@=keys_scroll ==> editing text @@=keys_textline execute the command in the command line. If the command line is empty, the current command from the history list will be executed insert the text of the current command from the panel to the command line delete the entry from the history list ctrl-F activate the filter mode ==> the panel filter @@=filter ctrl-C or ctrl-G leave the history panel (changes made in the command line are preserved) ############################################################ @P=completion @@=name completion After pressing the key, CLEX attempts to complete any name (word) found at the cursor position. There are 5 types of name completion and the completion method is chosen automatically depending on the context: - command names the word to be completed is the first word in a command; if no directory is specified, $PATH is searched - directory names used in the directory panel - user names for names beginning with ~ (~username = user's home directory) - environment variables for names beginning with $ - filenames this general type of completion is performed in all other cases When finer control over the name completion is required, use the completion/insertion panel ( ). ==> completion/insertion panel @@=paste Filename completion tries to recognize certain shell metacharacters and completes filenames also in these situations: name=/some/file - name must be a single word command ' and '>>' command ; other_command command & other_command command || other_command - also '&&' command | other_command `command` If there is no completion possibility, you will get a warning. If there is only one completion possibility, CLEX completes the name, otherwise a list of completion candidates appears on the screen. In case this list would be too long, only the next character will be suggested. -------------------- Note: - if the special characters mentioned above (=><;&|`) are part of a filename or if quoting is used, the filename completion will be probably not able to complete names properly ############################################################ @P=paste @@= - completion/insertion panel This panel summarizes all editing functions from the file panel that complete text or insert text into the command line. Completion functions: - general name completion - name completion of specified type (5 functions) - command completion from the history list Insert functions: - insert filename(s) (3 functions) - insert the directory name (2 functions) - insert the symbolic link target ############################################################ @P=menu @@=alt-M - main function menu This is a self-explaining menu of all important file panel functions. All you need to do is press alt-M to display it. The main menu is available only in the file panel. Most of its functions can be activated directly (without going into this menu) using shortcuts which are displayed in the menu for your convenience. The individual main menu functions are described here: ==> file panel @@=file -------------------- Note: - on some PC keyboards the key activates the main menu as well (this key is located next to the right key) ############################################################ @P=sort @@=alt-S - changing sort order Select one of file sort orders on the menu in the sort panel and press to confirm. The sort order affects only the way the filenames are displayed and is valid for both file panels. Each time you start CLEX, the sort order is set to 'sort by name'. See also the GROUP_FILES configuration parameter. Files are first grouped and then the groups are sorted. See also the COLLATION parameter, there are two collate sequences for sorting by name. ==> configuring CLEX @@=config_app -------------------- Notes: - the sort by extension (filename suffix) considers a file named '.file' to be a so called hidden file without an extension - the unusual 'sort by reversed name' option is useful in sendmail queue directories, where files like 'qf1234', 'df1234', and 'xf1234' belong together ############################################################ @P=user @@=alt-U / alt-G - user / group information These twin panels show the list of user / group IDs with corresponding names that CLEX has saved during the last file panel read. The data can be only examined, not modified, that's why there are no functions defined in these panels. Filtering (ctrl-F) is available though. ==> the panel filter @@=filter ############################################################ @P=config @@=alt-C - configuring CLEX There are over 30 parameters controlling the program's behavior. ==> introduction @@=config_intro FRAME CMD_LINES XTERM_TITLE GROUP_FILES PROMPT LAYOUT1 LAYOUT2 LAYOUT3 ACTIVE_LAYOUT KILOBYTE FMT_NUMBER FMT_TIME FMT_DATE COLLATION ==> configuring appearance @@=config_app SHELLPROG CMD_F3 ... CMD_F12 WARN_RM WARN_LONG WARN_SELECT ==> configuring command execution @@=config_cmd DIR2 HELPFILE QUOTE C_PANEL_SIZE D_PANEL_SIZE H_PANEL_SIZE ==> other configuration parameters @@=config_other ############################################################ @P=config_intro @@=configuration process Eech user can customize his/her personal CLEX settings using the configuration panel. Program settings can be (and should be) saved to a configuration file and thus made permanent. Unsaved settings are lost when you exit CLEX. Choose one of the function in the top of the panel (Cancel, Accept, or Accept+Save) to finish the work in the configuration panel. Standard configuration values apply to all parameters which are not explicitly set by the user. These default values are built into the CLEX, but administrators can override them in the system-wide configuration file. ==> configuring CLEX in admin mode @@=admin Help with keys: ==> moving cursor bar @@=keys_scroll edit parameter S set parameter to standard value (default) O set parameter to original value Files: - personal configuration file: .clexrc in user's home directory - system-wide configuration file: @CONFIG_FILE@ ==> please read this security advice @@=security -------------------- Note: - concurrent CLEX sessions: configuration saved in one session does not affect other running sessions, only newly started programs. Every time you save the configuration, the previous one gets overwritten. ############################################################ @P=config_app @@=list of configurable parameters (1) The parameters below affect the program's visual appearance. Warning: do not change parameters you do not understand. If you are unsure, test the new value before saving the configuration. If any problems occur, reset the parameter to standard value. FRAME Choose a character for drawing horizontal lines on the screen. Try all settings and choose which one looks best on your screen. The option 'line graphics' does not work on some terminals. CMD_LINES Number of lines (2-4) that the command line (or input line) occupies on the screen. XTERM_TITLE Change the title of the terminal window when CLEX is run in X Window environment. CLEX tries to restore the original title at exit. The title is: clex: user@host - ready clex: command - executing command clex: (command) - execution is finished You can set this parameter to 'yes', 'no', or AUTO. The AUTO setting checks the terminal type before changing the title. Here are the details: ==> changing xterm title @@=xterm GROUP_FILES If enabled, CLEX will group files of the same type together. Files will be displayed in this order: - directories first (*1) - then special files - then plain files or alternatively: - directories (*1) - block devices (*2) - character devices (*2) - other special files - plain files Note 1: directories . and .. will be always on the top Note 2: despite the selected sort order, devices will be sorted by their major and minor numbers. ==> sort order for files @@=sort PROMPT Command line prompt. Enter AUTO here to use the shell's name as the prompt. ==> related parameter: SHELLPROG @@=config_cmd LAYOUT1 File panel layout. Format is: | where 'fields' is a list of fields to be displayed. ==> configuring file panel layout @@=layout LAYOUT2 Alternative file panel layout. LAYOUT3 Alternative file panel layout. ==> configuring file panel layout @@=layout ACTIVE_LAYOUT Pick one of the available layouts (1-3). KILOBYTE Select your preferred definition of one kilobyte (megabyte, etc.) The filesize is displayed according to this parameter. 1000: the prefix kilo means thousand 1024: for computer professionals one kilobyte is traditionally 1024 bytes. This is now written as 1 KiB according to the IEC International Standard 60027-2. FMT_NUMBER Choose dot or comma as the thousands separator for displaying file sizes, standard is AUTO (autodetect). FMT_TIME Select 12 or 24 hour clock, standard is AUTO (autodetect). FMT_DATE This is the date format (combination of the day, month, and year). Standard is AUTO for autodetect, but setting it explicitly gives you more possibilities. ==> how to set date format @@=date COLLATION There are two ways to sort filenames by name. Those two character collation sequences are: - byte order - based on the character encoding as used by the computer, typically the ASCII code - dictionary order - based on the human language as set by your locale, it takes in account case folding, accented characters, etc. -------------------- Notes: - the autodetect feature for FMT_XXX values reads the current locale setting, the COLLATION also makes use of the locale (a locale is a set of language and cultural rules), that's why your locale should be properly set - if you have superuser privileges, the word ROOT is included with the prompt to remind you to be careful ############################################################ @P=date @@=setting the date format Following letters are used to compose the date format, simply combine them together: day of month: d - two digits (01 to 31) D - like 'd', but without the leading zero (1 to 31) month: m - two digits (01 to 12) M - three letter acronym (jan to dec) year: y - last two digits (00 to 99) Y - all four digits (e.g. 2004) Examples: DMy 1mar04 d-M-Y 01-mar-2004 d.m.y 31.12.03 y/m/d 03/12/31 -------------------- Note: - the length of the resulting date string should not exceed 11 characters ############################################################ @P=config_cmd @@=list of configurable parameters (2) These parameters control the execution of commands. Warning: do not change parameters you do not understand. If you are unsure, test the new value before saving the configuration. If any problems occur, reset the parameter to standard value. SHELLPROG All commands are executed by this program. Enter the complete command, i.e. the full pathname of the shell, all required options, and the word at the place of the actual command. Type the word literally as shown here. For example: /bin/sh -c which can be shortened to: /bin/sh because the standard option -c is appended automatically whenever the is missing. Set this parameter to AUTO to use your login shell, this is the recommended setting. CMD_F3 = view file(s) CMD_F4 = edit file(s) CMD_F5 = copy file(s) CMD_F6 = move file(s) CMD_F7 = make directory CMD_F8 = remove file(s) CMD_F9 = print file(s) CMD_F10 = user defined CMD_F11 = user defined CMD_F12 = user defined All these parameters are templates used to build commands each time you press one of the function keys to . The following substitutions are performed before the specified text is inserted into the command line: $1 --> name of the current working directory $2 --> name of the secondary directory ==> working directories @@=2dirs $F --> name of the current file $S --> name(s) of the selected file(s) ($f is preferred) $f --> like $S when was pressed before the last keystroke and there are some selected files; like $F otherwise $$ --> single $ character $c --> this parameter only sets the cursor position - no text is inserted, e.g: find / -type f -name '$c' -print Normal cursor position (without $c) is at the end of inserted command All inserted file and directory names are quoted properly. ==> automatic quoting @@=quoting WARN_RM Warns before executing 'rm' (delete) command. Note that CLEX does not detect all occurrences of 'rm' command in the command line, it only checks the first word. WARN_LONG Warns if the command line is too long and you could not see the whole command on the screen before executing it. This warning is suppressed in the history panel. WARN_SELECT Reminds that you have selected some file(s). This warning should prevent mistakes when the current file is processed instead of selected file(s). All three warnings above are normally enabled. You might want to disable warnings that annoy you. ############################################################ @P=config_other @@=list of configurable parameters (3) Warning: do not change parameters you do not understand. If you are unsure, test the new value before saving the configuration. If any problems occur, reset the parameter to standard value. DIR2 Initial working directory for the secondary file panel. Standard value is your home directory, leave DIR2 set to HOME to use the home directory. DIR2 should be an absolute directory name starting with /. HELPFILE The on-line help is compiled into CLEX, but you can replace it with an optional external help file. Most users enter NONE here and use the built-in help; only if you have a help file, enter its name here. QUOTE Some characters have a special meaning for the shell. If these special characters appear in a filename being inserted to the command line, they must be taken literally, without the special meaning. This is achieved by quoting them with a preceding backslash. These characters are always quoted: ( ) < > [ ] { } # $ & \ | ? * ; ' " ` ~ space tab Another two characters are added to the list if your shell is a C-shell: ! : The QUOTE parameter allows you to specify a list of additional characters that need to be quoted. C_PANEL_SIZE Size of the filename completion panel, i.e. its maximum number of lines. The special value AUTO limits the panel size to the actual screen size (no scrolling). D_PANEL_SIZE Size of the directory panel. The value AUTO limits the panel size to the actual screen size. H_PANEL_SIZE Size of the command history panel. -------------------- Notes: - if you would like to translate the on-line help into your language and wish to obtain more information about the help file format, don't hesitate to contact us ==> contacts @@=about - screen size AUTO for X_PANEL_SIZE parameters leaves the bottom panel line blank to indicate that there is no need to scroll - changing H_PANEL_SIZE clears the contents of the command history list - your shell is considered to be a C-shell when its name ends with 'csh' ############################################################ @P=layout @@=configuring file panel layout The file panel layout can be configured to match individual customs and needs. The LAYOUT parameter is a string of the form: | where is a list of fields to be displayed, each field is represented by a dollar sign followed by a single character: $a - time/date of last access $d - time/date of last modification $i - time/date of last inode change $l - number of hard links $L - 'LNK' mark is displayed if there are multiple hard links, otherwise this field is blank $m - file mode as an octal number $M - like $m, but blank for normal file modes (i.e. mode 0666 or 0777 with umask value bits cleared) $o - owner - user:group $p - file mode as a string of permission bits $P - like $p, but blank for normal file modes $s - file size $S - like $s, but blank for directories $t - type of file $> - '->' is displayed for symbolic links $* - selection mark $$ - literal dollar sign '$' $| - literal vertical bar '|' Normal text can be inserted into the list of fields as well, e.g.: links:$l mode:$m $m($p) There are three predefined layouts in the standard configuration. LAYOUT1 is detailed, LAYOUT2 is brief, and the LAYOUT3 is similar to the 'ls -l' output: LAYOUT1 $d $S $>$t $M $*| $p $o $L LAYOUT2 $d $S $t $*| $p $o LAYOUT3 $p $o $s $d $>$t $*| mode=$m atime=$a ctime=$i links=$l All three LAYOUTs can be altered and one of them is selected with the ACTIVE_LAYOUT configuration parameter to act as the file panel layout. The filename is always displayed after all defined file panel fields. -------------------- Notes: - numbers and dates are automatically aligned to the proper field margin, e.g.: $d $s - aligned to the right mtime=$d size=$s - aligned to the left - time of the day instead of date is displayed for times within the last 18 hours - you can omit the selection mark $* if you accept the highlighting as a sufficient indicator - $L field is left blank also for all directories as they always have multiple hard links ############################################################ @P=xterm @@=changing xterm title When XTERM_TITLE is set to AUTO, the title change feature gets enabled only if $TERM is xterm, kterm, or dtterm, possibly including additional characters, e.g. xterm-mono. Following command is run to get the current window title: xprop -id $WINDOWID WM_NAME You can try it from the command line. If that command fails, CLEX is not able to restore the original X window title at exit and uses a general title 'terminal'. ############################################################ @P=security @@=security note Protect your configuration files! They contain templates for the commands you execute. Do not allow others to modify them: - only the system administrator(s) should have the write access to the system-wide configuration file, everybody else should have just the permission to read - only the owner should have the write access to his/her personal configuration file To reduce the risk, CLEX ignores world-writable configuration files. ############################################################ @P=admin @@=admin mode (for system administrators only) The configuration process at the program startup has three steps: 1) parameters are initialized to values compiled into CLEX 2) system-wide configuration file is processed 3) user's personal configuration file is processed In the admin mode the system administrator can alter the system-wide configuration. To enter the admin mode start the program with -a (or --admin) option: clex -a The configuration panel with the system-wide defaults for all parameters appears on the screen. Modify them as necessary and then save the configuration. You will need the permission to create/modify the system-wide configuration file. ==> protecting configuration files @@=security WARNING: System-wide defaults affect all CLEX users. It is recommended to check at least: CMD_F3 - you might prefer 'less' instead of 'more' CMD_F8 - you might prefer 'rm -i' (and disable WARN_RM) CMD_F9 - check the command for printing If your file utilities understand the end-of-options sign '--', you could use it in your CMD_FX command templates. ############################################################ @P=select @@=alt-+ and alt-- - selecting and deselecting files To specify files to be (de)selected, enter at the appropriate prompt a filename pattern. Follow the usual conventions for specifying filenames used in the shell. Wildcards: ? * [list] [!list] or [^list] Quoting: \c 'string' "string" ==> pattern matching details @@=patterns The current directory . (dot) and the parent directory .. (dot-dot) cannot be selected. This is a protective measure. ############################################################ @P=patterns @@=pattern matching Patterns are used to specify filenames. This concept is used in the command line shells like sh, bash, csh; see the appropriate documentation if you want to learn more. CLEX recognizes following special symbols: Wildcards: ? matches any single character * matches any string (zero or more characters) [list] matches one of the characters appearing in the list, ranges like 0-9 a-z are allowed [!list] matches one of the characters NOT appearing or [^list] in the list Exception: wildcards don't match a dot on the first position of a filename (to conceal so called hidden filenames). Quoting: \c a character preceded by a backslash loses its special meaning 'string' everything enclosed in single quotes is taken literally, even the backslash "string" backslash quotes the characters \, $, and ", everything else in double quotes is taken literally -------------------- Notes: - unlike the shell, escape sequences are not recognized, e.g. \t does not stand for the tab character. - handling of character ranges is affected by the locale setting. ############################################################ @P=about @@=about CLEX CLEX (pronounced KLEKS) is free software without warranty of any kind. See the GNU General Public License for details. ==> Software license @@=license The newest version of CLEX, related materials, etc. can be found on the CLEX web page. The URL is: http://www.clex.sk Please send your questions, comments, or bug reports to the e-mail address: clex@clex.sk Many thanks to all the people who have taken the time to submit suggestions for enhancements or problem reports. CLEX File Manager Copyright (C) 2001-2006 Vlado Potisk ############################################################ @P=license @@=Software license agreement Authors have developed the CLEX File Manager and made it available by means of electronic distribution at the Internet web page http://www.clex.sk. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA ############################################################ @P=notes @@=Miscellaneous notes GENERAL USAGE - CLEX does not support UTF-8 character encoding - special attention should be paid when dealing with filenames beginning with a hyphen. For example the correct way to delete a file named '-i' is: rm ./-i or (on some systems) rm -- -i You can redefine commands F3 - F9 to include this end-of-options sign -- - if the screen appears distorted and redraw (ctrl-L) does not solve the problem, run this command: tput reset - there is no way to change CLEX's environment variables, you must set them before starting CLEX X WINDOW SYSTEM - if you cannot see the output of executed commands on some X terminal emulators try to disable scrolling - to see highlighted text in color on your xterm, put these lines to your .Xresources file: XTerm*colorBD: blue3 <-- pick your own color XTerm*colorBDMode: true don't forget to run xrdb -merge .Xresources after a change - there were problems with the HOME and END keys in the original Fedora Core 4 xterm, but an updated xterm package was released - in some older versions of KDE you have to run xrdb every time you want to start xterm. Upgrade to more recent version or use this simple CLEX startup script as a workaround: #!/bin/sh XRES=$HOME/.Xresources [ -f $XRES ] && /usr/X11R6/bin/xrdb -merge $XRES exec /usr/X11R6/bin/xterm \ -geometry 80x32 -e /usr/bin/clex - if the input line gets cluttered after using the backspace key in KDE terminal emulator konsole, you have to upgrade to more recent KDE version