mirror of
https://github.com/troglobit/editline.git
synced 2025-09-17 09:28:10 +08:00
Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
64cc1b5325 | ||
![]() |
f7b2ea938d | ||
![]() |
9a94fc9d4d | ||
![]() |
cab8f18472 | ||
![]() |
06a7f578d5 | ||
![]() |
4f88d8d823 | ||
![]() |
c76941f24f |
21
config.h.in
21
config.h.in
@@ -10,9 +10,8 @@
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#undef HAVE_INTTYPES_H
|
||||
|
||||
/* Define to 1 if your system has a GNU libc compatible `malloc' function, and
|
||||
to 0 otherwise. */
|
||||
#undef HAVE_MALLOC
|
||||
/* Define to 1 if you have the <malloc.h> header file. */
|
||||
#undef HAVE_MALLOC_H
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#undef HAVE_MEMORY_H
|
||||
@@ -20,13 +19,12 @@
|
||||
/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
|
||||
#undef HAVE_NDIR_H
|
||||
|
||||
/* Define to 1 if your system has a GNU libc compatible `realloc' function,
|
||||
and to 0 otherwise. */
|
||||
#undef HAVE_REALLOC
|
||||
|
||||
/* Define to 1 if you have the <sgtty.h> header file. */
|
||||
#undef HAVE_SGTTY_H
|
||||
|
||||
/* Define to 1 if you have the <signal.h> header file. */
|
||||
#undef HAVE_SIGNAL_H
|
||||
|
||||
/* Define to 1 if `stat' has the bug that it succeeds when given the
|
||||
zero-length file name argument. */
|
||||
#undef HAVE_STAT_EMPTY_STRING_BUG
|
||||
@@ -66,6 +64,9 @@
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#undef HAVE_SYS_TYPES_H
|
||||
|
||||
/* Define to 1 if you have the `tcgetattr' function. */
|
||||
#undef HAVE_TCGETATTR
|
||||
|
||||
/* Define to 1 if you have the <termios.h> header file. */
|
||||
#undef HAVE_TERMIOS_H
|
||||
|
||||
@@ -112,11 +113,5 @@
|
||||
/* Version number of package */
|
||||
#undef VERSION
|
||||
|
||||
/* Define to rpl_malloc if the replacement function should be used. */
|
||||
#undef malloc
|
||||
|
||||
/* Define to rpl_realloc if the replacement function should be used. */
|
||||
#undef realloc
|
||||
|
||||
/* Define to `unsigned int' if <sys/types.h> does not define. */
|
||||
#undef size_t
|
||||
|
503
configure
vendored
503
configure
vendored
@@ -1,6 +1,6 @@
|
||||
#! /bin/sh
|
||||
# Guess values for system-dependent variables and create Makefiles.
|
||||
# Generated by GNU Autoconf 2.61 for Minix editline 0.1.1.
|
||||
# Generated by GNU Autoconf 2.61 for Minix editline 0.2.0.
|
||||
#
|
||||
# Report bugs to <joachim@vmlinux.org>.
|
||||
#
|
||||
@@ -574,8 +574,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
|
||||
# Identity of this package.
|
||||
PACKAGE_NAME='Minix editline'
|
||||
PACKAGE_TARNAME='minix-editline'
|
||||
PACKAGE_VERSION='0.1.1'
|
||||
PACKAGE_STRING='Minix editline 0.1.1'
|
||||
PACKAGE_VERSION='0.2.0'
|
||||
PACKAGE_STRING='Minix editline 0.2.0'
|
||||
PACKAGE_BUGREPORT='joachim@vmlinux.org'
|
||||
|
||||
ac_unique_file="src/editline.c"
|
||||
@@ -1208,7 +1208,7 @@ 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 Minix editline 0.1.1 to adapt to many kinds of systems.
|
||||
\`configure' configures Minix editline 0.2.0 to adapt to many kinds of systems.
|
||||
|
||||
Usage: $0 [OPTION]... [VAR=VALUE]...
|
||||
|
||||
@@ -1274,7 +1274,7 @@ fi
|
||||
|
||||
if test -n "$ac_init_help"; then
|
||||
case $ac_init_help in
|
||||
short | recursive ) echo "Configuration of Minix editline 0.1.1:";;
|
||||
short | recursive ) echo "Configuration of Minix editline 0.2.0:";;
|
||||
esac
|
||||
cat <<\_ACEOF
|
||||
|
||||
@@ -1358,7 +1358,7 @@ fi
|
||||
test -n "$ac_init_help" && exit $ac_status
|
||||
if $ac_init_version; then
|
||||
cat <<\_ACEOF
|
||||
Minix editline configure 0.1.1
|
||||
Minix editline configure 0.2.0
|
||||
generated by GNU Autoconf 2.61
|
||||
|
||||
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
|
||||
@@ -1372,7 +1372,7 @@ cat >config.log <<_ACEOF
|
||||
This file contains any messages produced by compilers while
|
||||
running configure, to aid debugging if configure makes a mistake.
|
||||
|
||||
It was created by Minix editline $as_me 0.1.1, which was
|
||||
It was created by Minix editline $as_me 0.2.0, which was
|
||||
generated by GNU Autoconf 2.61. Invocation command line was
|
||||
|
||||
$ $0 $@
|
||||
@@ -2067,7 +2067,7 @@ fi
|
||||
|
||||
# Define the identity of the package.
|
||||
PACKAGE='minix-editline'
|
||||
VERSION='0.1.1'
|
||||
VERSION='0.2.0'
|
||||
|
||||
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
@@ -4213,6 +4213,8 @@ _ACEOF
|
||||
|
||||
fi
|
||||
|
||||
# Check for malloc.h instead of AC_FUNC_MALLOC/REALLOC AIX and others
|
||||
# mess up the traditional malloc check.
|
||||
# On IRIX 5.3, sys/types and inttypes.h are conflicting.
|
||||
|
||||
|
||||
@@ -4287,7 +4289,9 @@ done
|
||||
|
||||
|
||||
|
||||
for ac_header in sgtty.h stdlib.h string.h termio.h termios.h
|
||||
|
||||
|
||||
for ac_header in malloc.h signal.h sgtty.h stdlib.h string.h termio.h termios.h
|
||||
do
|
||||
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
|
||||
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
|
||||
@@ -4700,476 +4704,10 @@ echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6; }
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
for ac_header in stdlib.h
|
||||
do
|
||||
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
|
||||
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
|
||||
{ echo "$as_me:$LINENO: checking for $ac_header" >&5
|
||||
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
|
||||
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
|
||||
echo $ECHO_N "(cached) $ECHO_C" >&6
|
||||
fi
|
||||
ac_res=`eval echo '${'$as_ac_Header'}'`
|
||||
{ echo "$as_me:$LINENO: result: $ac_res" >&5
|
||||
echo "${ECHO_T}$ac_res" >&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 { (ac_try="$ac_compile"
|
||||
case "(($ac_try" in
|
||||
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
|
||||
*) ac_try_echo=$ac_try;;
|
||||
esac
|
||||
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
|
||||
test -z "$ac_c_werror_flag" ||
|
||||
test ! -s conftest.err
|
||||
} && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_cpp conftest.$ac_ext"
|
||||
case "(($ac_try" in
|
||||
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
|
||||
*) ac_try_echo=$ac_try;;
|
||||
esac
|
||||
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && {
|
||||
test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
|
||||
test ! -s conftest.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 joachim@vmlinux.org ##
|
||||
## ---------------------------------- ##
|
||||
_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 { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
|
||||
echo $ECHO_N "(cached) $ECHO_C" >&6
|
||||
else
|
||||
eval "$as_ac_Header=\$ac_header_preproc"
|
||||
fi
|
||||
ac_res=`eval echo '${'$as_ac_Header'}'`
|
||||
{ echo "$as_me:$LINENO: result: $ac_res" >&5
|
||||
echo "${ECHO_T}$ac_res" >&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
|
||||
|
||||
{ echo "$as_me:$LINENO: checking for GNU libc compatible malloc" >&5
|
||||
echo $ECHO_N "checking for GNU libc compatible malloc... $ECHO_C" >&6; }
|
||||
if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then
|
||||
echo $ECHO_N "(cached) $ECHO_C" >&6
|
||||
else
|
||||
if test "$cross_compiling" = yes; then
|
||||
ac_cv_func_malloc_0_nonnull=no
|
||||
else
|
||||
cat >conftest.$ac_ext <<_ACEOF
|
||||
/* confdefs.h. */
|
||||
_ACEOF
|
||||
cat confdefs.h >>conftest.$ac_ext
|
||||
cat >>conftest.$ac_ext <<_ACEOF
|
||||
/* end confdefs.h. */
|
||||
#if defined STDC_HEADERS || defined HAVE_STDLIB_H
|
||||
# include <stdlib.h>
|
||||
#else
|
||||
char *malloc ();
|
||||
#endif
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
return ! malloc (0);
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
rm -f conftest$ac_exeext
|
||||
if { (ac_try="$ac_link"
|
||||
case "(($ac_try" in
|
||||
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
|
||||
*) ac_try_echo=$ac_try;;
|
||||
esac
|
||||
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
|
||||
(eval "$ac_link") 2>&5
|
||||
ac_status=$?
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); } && { ac_try='./conftest$ac_exeext'
|
||||
{ (case "(($ac_try" in
|
||||
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
|
||||
*) ac_try_echo=$ac_try;;
|
||||
esac
|
||||
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
|
||||
(eval "$ac_try") 2>&5
|
||||
ac_status=$?
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); }; }; then
|
||||
ac_cv_func_malloc_0_nonnull=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_malloc_0_nonnull=no
|
||||
fi
|
||||
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
|
||||
fi
|
||||
|
||||
|
||||
fi
|
||||
{ echo "$as_me:$LINENO: result: $ac_cv_func_malloc_0_nonnull" >&5
|
||||
echo "${ECHO_T}$ac_cv_func_malloc_0_nonnull" >&6; }
|
||||
if test $ac_cv_func_malloc_0_nonnull = yes; then
|
||||
|
||||
cat >>confdefs.h <<\_ACEOF
|
||||
#define HAVE_MALLOC 1
|
||||
_ACEOF
|
||||
|
||||
else
|
||||
cat >>confdefs.h <<\_ACEOF
|
||||
#define HAVE_MALLOC 0
|
||||
_ACEOF
|
||||
|
||||
case " $LIBOBJS " in
|
||||
*" malloc.$ac_objext "* ) ;;
|
||||
*) LIBOBJS="$LIBOBJS malloc.$ac_objext"
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
cat >>confdefs.h <<\_ACEOF
|
||||
#define malloc rpl_malloc
|
||||
_ACEOF
|
||||
|
||||
fi
|
||||
|
||||
|
||||
|
||||
|
||||
for ac_header in stdlib.h
|
||||
do
|
||||
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
|
||||
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
|
||||
{ echo "$as_me:$LINENO: checking for $ac_header" >&5
|
||||
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
|
||||
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
|
||||
echo $ECHO_N "(cached) $ECHO_C" >&6
|
||||
fi
|
||||
ac_res=`eval echo '${'$as_ac_Header'}'`
|
||||
{ echo "$as_me:$LINENO: result: $ac_res" >&5
|
||||
echo "${ECHO_T}$ac_res" >&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 { (ac_try="$ac_compile"
|
||||
case "(($ac_try" in
|
||||
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
|
||||
*) ac_try_echo=$ac_try;;
|
||||
esac
|
||||
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
|
||||
test -z "$ac_c_werror_flag" ||
|
||||
test ! -s conftest.err
|
||||
} && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_cpp conftest.$ac_ext"
|
||||
case "(($ac_try" in
|
||||
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
|
||||
*) ac_try_echo=$ac_try;;
|
||||
esac
|
||||
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && {
|
||||
test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
|
||||
test ! -s conftest.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 joachim@vmlinux.org ##
|
||||
## ---------------------------------- ##
|
||||
_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 { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
|
||||
echo $ECHO_N "(cached) $ECHO_C" >&6
|
||||
else
|
||||
eval "$as_ac_Header=\$ac_header_preproc"
|
||||
fi
|
||||
ac_res=`eval echo '${'$as_ac_Header'}'`
|
||||
{ echo "$as_me:$LINENO: result: $ac_res" >&5
|
||||
echo "${ECHO_T}$ac_res" >&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
|
||||
|
||||
{ echo "$as_me:$LINENO: checking for GNU libc compatible realloc" >&5
|
||||
echo $ECHO_N "checking for GNU libc compatible realloc... $ECHO_C" >&6; }
|
||||
if test "${ac_cv_func_realloc_0_nonnull+set}" = set; then
|
||||
echo $ECHO_N "(cached) $ECHO_C" >&6
|
||||
else
|
||||
if test "$cross_compiling" = yes; then
|
||||
ac_cv_func_realloc_0_nonnull=no
|
||||
else
|
||||
cat >conftest.$ac_ext <<_ACEOF
|
||||
/* confdefs.h. */
|
||||
_ACEOF
|
||||
cat confdefs.h >>conftest.$ac_ext
|
||||
cat >>conftest.$ac_ext <<_ACEOF
|
||||
/* end confdefs.h. */
|
||||
#if defined STDC_HEADERS || defined HAVE_STDLIB_H
|
||||
# include <stdlib.h>
|
||||
#else
|
||||
char *realloc ();
|
||||
#endif
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
return ! realloc (0, 0);
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
rm -f conftest$ac_exeext
|
||||
if { (ac_try="$ac_link"
|
||||
case "(($ac_try" in
|
||||
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
|
||||
*) ac_try_echo=$ac_try;;
|
||||
esac
|
||||
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
|
||||
(eval "$ac_link") 2>&5
|
||||
ac_status=$?
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); } && { ac_try='./conftest$ac_exeext'
|
||||
{ (case "(($ac_try" in
|
||||
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
|
||||
*) ac_try_echo=$ac_try;;
|
||||
esac
|
||||
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
|
||||
(eval "$ac_try") 2>&5
|
||||
ac_status=$?
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); }; }; then
|
||||
ac_cv_func_realloc_0_nonnull=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_realloc_0_nonnull=no
|
||||
fi
|
||||
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
|
||||
fi
|
||||
|
||||
|
||||
fi
|
||||
{ echo "$as_me:$LINENO: result: $ac_cv_func_realloc_0_nonnull" >&5
|
||||
echo "${ECHO_T}$ac_cv_func_realloc_0_nonnull" >&6; }
|
||||
if test $ac_cv_func_realloc_0_nonnull = yes; then
|
||||
|
||||
cat >>confdefs.h <<\_ACEOF
|
||||
#define HAVE_REALLOC 1
|
||||
_ACEOF
|
||||
|
||||
else
|
||||
cat >>confdefs.h <<\_ACEOF
|
||||
#define HAVE_REALLOC 0
|
||||
_ACEOF
|
||||
|
||||
case " $LIBOBJS " in
|
||||
*" realloc.$ac_objext "* ) ;;
|
||||
*) LIBOBJS="$LIBOBJS realloc.$ac_objext"
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
cat >>confdefs.h <<\_ACEOF
|
||||
#define realloc rpl_realloc
|
||||
_ACEOF
|
||||
|
||||
fi
|
||||
|
||||
|
||||
|
||||
# Check for malloc.h instead of AC_FUNC_MALLOC/REALLOC AIX and others
|
||||
# mess up the traditional malloc check.
|
||||
#AC_FUNC_MALLOC
|
||||
#AC_FUNC_REALLOC
|
||||
{ echo "$as_me:$LINENO: checking whether lstat dereferences a symlink specified with a trailing slash" >&5
|
||||
echo $ECHO_N "checking whether lstat dereferences a symlink specified with a trailing slash... $ECHO_C" >&6; }
|
||||
if test "${ac_cv_func_lstat_dereferences_slashed_symlink+set}" = set; then
|
||||
@@ -5337,7 +4875,8 @@ fi
|
||||
|
||||
|
||||
|
||||
for ac_func in strchr strdup strrchr
|
||||
|
||||
for ac_func in strchr strdup strrchr tcgetattr
|
||||
do
|
||||
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
|
||||
{ echo "$as_me:$LINENO: checking for $ac_func" >&5
|
||||
@@ -5843,7 +5382,7 @@ exec 6>&1
|
||||
# report actual input values of CONFIG_FILES etc. instead of their
|
||||
# values after options handling.
|
||||
ac_log="
|
||||
This file was extended by Minix editline $as_me 0.1.1, which was
|
||||
This file was extended by Minix editline $as_me 0.2.0, which was
|
||||
generated by GNU Autoconf 2.61. Invocation command line was
|
||||
|
||||
CONFIG_FILES = $CONFIG_FILES
|
||||
@@ -5896,7 +5435,7 @@ Report bugs to <bug-autoconf@gnu.org>."
|
||||
_ACEOF
|
||||
cat >>$CONFIG_STATUS <<_ACEOF
|
||||
ac_cs_version="\\
|
||||
Minix editline config.status 0.1.1
|
||||
Minix editline config.status 0.2.0
|
||||
configured by $0, generated by GNU Autoconf 2.61,
|
||||
with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
|
||||
|
||||
|
14
configure.ac
14
configure.ac
@@ -2,7 +2,7 @@
|
||||
# Process this file with autoconf to produce a configure script.
|
||||
|
||||
AC_PREREQ(2.61)
|
||||
AC_INIT(Minix editline, 0.1.1, joachim@vmlinux.org)
|
||||
AC_INIT(Minix editline, 0.2.0, joachim@vmlinux.org)
|
||||
AC_CONFIG_SRCDIR([src/editline.c])
|
||||
AC_CONFIG_HEADER([config.h])
|
||||
|
||||
@@ -18,7 +18,9 @@ AC_PROG_RANLIB
|
||||
# Checks for header files.
|
||||
AC_HEADER_DIRENT
|
||||
AC_HEADER_STDC
|
||||
AC_CHECK_HEADERS([sgtty.h stdlib.h string.h termio.h termios.h])
|
||||
# Check for malloc.h instead of AC_FUNC_MALLOC/REALLOC AIX and others
|
||||
# mess up the traditional malloc check.
|
||||
AC_CHECK_HEADERS([malloc.h signal.h sgtty.h stdlib.h string.h termio.h termios.h])
|
||||
|
||||
# Checks for typedefs, structures, and compiler characteristics.
|
||||
AC_HEADER_STAT
|
||||
@@ -31,9 +33,11 @@ AC_TYPE_SIZE_T
|
||||
# Checks for library functions.
|
||||
AC_FUNC_CLOSEDIR_VOID
|
||||
AC_PROG_GCC_TRADITIONAL
|
||||
AC_FUNC_MALLOC
|
||||
AC_FUNC_REALLOC
|
||||
# Check for malloc.h instead of AC_FUNC_MALLOC/REALLOC AIX and others
|
||||
# mess up the traditional malloc check.
|
||||
#AC_FUNC_MALLOC
|
||||
#AC_FUNC_REALLOC
|
||||
AC_FUNC_STAT
|
||||
AC_CHECK_FUNCS([strchr strdup strrchr])
|
||||
AC_CHECK_FUNCS([strchr strdup strrchr tcgetattr])
|
||||
|
||||
AC_OUTPUT(Makefile src/Makefile include/Makefile man/Makefile examples/Makefile)
|
||||
|
@@ -1,3 +1,5 @@
|
||||
AUTOMAKE_OPTIONS = foreign
|
||||
|
||||
LDADD = $(top_builddir)/src/libedit.a
|
||||
AM_CFLAGS = -I$(top_srcdir)/src
|
||||
|
||||
|
@@ -142,6 +142,7 @@ sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
AUTOMAKE_OPTIONS = foreign
|
||||
LDADD = $(top_builddir)/src/libedit.a
|
||||
AM_CFLAGS = -I$(top_srcdir)/src
|
||||
testit_SOURCES = testit.c
|
||||
@@ -158,9 +159,9 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu examples/Makefile'; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign examples/Makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu examples/Makefile
|
||||
$(AUTOMAKE) --foreign examples/Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
|
@@ -49,18 +49,21 @@ main(ac, av)
|
||||
|
||||
while ((p = readline(prompt)) != NULL) {
|
||||
(void)printf("\t\t\t|%s|\n", p);
|
||||
if (doit)
|
||||
if (doit) {
|
||||
if (strncmp(p, "cd ", 3) == 0) {
|
||||
if (chdir(&p[3]) < 0)
|
||||
if (chdir(&p[3]) < 0) {
|
||||
perror(&p[3]);
|
||||
}
|
||||
}
|
||||
else if (system(p) != 0)
|
||||
else if (system(p) != 0) {
|
||||
perror(p);
|
||||
}
|
||||
}
|
||||
add_history(p);
|
||||
free(p);
|
||||
}
|
||||
exit(0);
|
||||
/* NOTREACHED */
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@@ -1,2 +1,4 @@
|
||||
AUTOMAKE_OPTIONS = foreign
|
||||
|
||||
library_includedir=$(includedir)
|
||||
library_include_HEADERS = editline.h
|
||||
|
@@ -139,6 +139,7 @@ sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
AUTOMAKE_OPTIONS = foreign
|
||||
library_includedir = $(includedir)
|
||||
library_include_HEADERS = editline.h
|
||||
all: all-am
|
||||
@@ -153,9 +154,9 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/Makefile'; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign include/Makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu include/Makefile
|
||||
$(AUTOMAKE) --foreign include/Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
|
@@ -5,7 +5,7 @@
|
||||
/*
|
||||
** For compatibility with FSF readline.
|
||||
*/
|
||||
extern rl_reset_terminal(char *p);
|
||||
extern void rl_reset_terminal(char *p);
|
||||
extern void rl_initialize(void);
|
||||
|
||||
extern char *readline(const char *prompt);
|
||||
|
@@ -1,2 +1,4 @@
|
||||
AUTOMAKE_OPTIONS = foreign
|
||||
|
||||
man3_MANS = editline.3
|
||||
dist_man_MANS = $(man3_MANS)
|
||||
|
@@ -131,6 +131,7 @@ sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
AUTOMAKE_OPTIONS = foreign
|
||||
man3_MANS = editline.3
|
||||
dist_man_MANS = $(man3_MANS)
|
||||
all: all-am
|
||||
@@ -145,9 +146,9 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu man/Makefile'; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign man/Makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu man/Makefile
|
||||
$(AUTOMAKE) --foreign man/Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
|
@@ -1,3 +1,5 @@
|
||||
AUTOMAKE_OPTIONS = foreign
|
||||
|
||||
lib_LIBRARIES = libedit.a
|
||||
|
||||
libedit_a_SOURCES = editline.c editline.h complete.c sysunix.c unix.h
|
||||
|
@@ -152,6 +152,7 @@ sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
AUTOMAKE_OPTIONS = foreign
|
||||
lib_LIBRARIES = libedit.a
|
||||
libedit_a_SOURCES = editline.c editline.h complete.c sysunix.c unix.h
|
||||
all: all-am
|
||||
@@ -167,9 +168,9 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu src/Makefile
|
||||
$(AUTOMAKE) --foreign src/Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
|
@@ -20,6 +20,8 @@
|
||||
#define META(x) ((x) | 0x80)
|
||||
#define ISMETA(x) ((x) & 0x80)
|
||||
#define UNMETA(x) ((x) & 0x7F)
|
||||
#define MAPSIZE 33
|
||||
#define METAMAPSIZE 17
|
||||
#if !defined(HIST_SIZE)
|
||||
#define HIST_SIZE 20
|
||||
#endif /* !defined(HIST_SIZE) */
|
||||
@@ -63,6 +65,9 @@ int rl_erase;
|
||||
int rl_intr;
|
||||
int rl_kill;
|
||||
int rl_quit;
|
||||
#if defined(DO_SIGTSTP)
|
||||
int rl_susp;
|
||||
#endif /* defined(DO_SIGTSTP) */
|
||||
|
||||
STATIC CHAR NIL[] = "";
|
||||
STATIC CONST CHAR *Input = NIL;
|
||||
@@ -80,8 +85,8 @@ STATIC int Point;
|
||||
STATIC int PushBack;
|
||||
STATIC int Pushed;
|
||||
STATIC int Signal;
|
||||
FORWARD KEYMAP Map[33];
|
||||
FORWARD KEYMAP MetaMap[17];
|
||||
FORWARD KEYMAP Map[MAPSIZE];
|
||||
FORWARD KEYMAP MetaMap[METAMAPSIZE];
|
||||
STATIC SIZE_T Length;
|
||||
STATIC SIZE_T ScreenCount;
|
||||
STATIC SIZE_T ScreenSize;
|
||||
@@ -90,18 +95,17 @@ STATIC int TTYwidth;
|
||||
STATIC int TTYrows;
|
||||
|
||||
/* Display print 8-bit chars as `M-x' or as the actual 8-bit char? */
|
||||
int rl_meta_chars = 0;
|
||||
int rl_meta_chars = 1;
|
||||
|
||||
/*
|
||||
** Declarations.
|
||||
*/
|
||||
STATIC CHAR *editinput();
|
||||
extern int read();
|
||||
extern int write();
|
||||
#if defined(USE_TERMCAP)
|
||||
extern char *getenv();
|
||||
extern char *tgetstr();
|
||||
extern int tgetent();
|
||||
extern int tgetnum();
|
||||
#endif /* defined(USE_TERMCAP) */
|
||||
|
||||
/*
|
||||
@@ -119,7 +123,7 @@ TTYflush()
|
||||
|
||||
STATIC void
|
||||
TTYput(c)
|
||||
CHAR c;
|
||||
CONST CHAR c;
|
||||
{
|
||||
Screen[ScreenCount] = c;
|
||||
if (++ScreenCount >= ScreenSize - 1) {
|
||||
@@ -864,12 +868,16 @@ emacs(c)
|
||||
STATUS s;
|
||||
KEYMAP *kp;
|
||||
|
||||
#if 0 /* Debian patch removes this to be able to handle 8-bit input */
|
||||
/* This test makes it impossible to enter eight-bit characters when
|
||||
* meta-char mode is enabled. */
|
||||
OldPoint = Point;
|
||||
if (rl_meta_chars && ISMETA(c)) {
|
||||
Pushed = 1;
|
||||
PushBack = UNMETA(c);
|
||||
return meta();
|
||||
}
|
||||
#endif /* Debian patch removal. */
|
||||
for (kp = Map; kp->Function; kp++)
|
||||
if (kp->Key == c)
|
||||
break;
|
||||
@@ -884,7 +892,7 @@ STATIC STATUS
|
||||
TTYspecial(c)
|
||||
unsigned int c;
|
||||
{
|
||||
if (ISMETA(c))
|
||||
if (rl_meta_chars && ISMETA(c))
|
||||
return CSdispatch;
|
||||
|
||||
if (c == rl_erase || c == DEL)
|
||||
@@ -907,6 +915,12 @@ TTYspecial(c)
|
||||
Signal = SIGQUIT;
|
||||
return CSeof;
|
||||
}
|
||||
#if defined(DO_SIGTSTP)
|
||||
if (c == rl_susp) {
|
||||
Signal = SIGTSTP;
|
||||
return CSsignal;
|
||||
}
|
||||
#endif /* defined(DO_SIGTSTP) */
|
||||
|
||||
return CSdispatch;
|
||||
}
|
||||
@@ -973,6 +987,32 @@ hist_add(p)
|
||||
H.Pos = H.Size - 1;
|
||||
}
|
||||
|
||||
STATIC char *
|
||||
read_redirected()
|
||||
{
|
||||
int size;
|
||||
char *p;
|
||||
char *line;
|
||||
char *end;
|
||||
|
||||
for (size = MEM_INC, p = line = NEW(char, size), end = p + size; ; p++) {
|
||||
if (p == end) {
|
||||
size += MEM_INC;
|
||||
p = line = realloc(line, size);
|
||||
end = p + size;
|
||||
}
|
||||
if (read(0, p, 1) <= 0) {
|
||||
/* Ignore "incomplete" lines at EOF, just like we do for a tty. */
|
||||
free(line);
|
||||
return NULL;
|
||||
}
|
||||
if (*p == '\n')
|
||||
break;
|
||||
}
|
||||
*p = '\0';
|
||||
return line;
|
||||
}
|
||||
|
||||
/*
|
||||
** For compatibility with FSF readline.
|
||||
*/
|
||||
@@ -995,6 +1035,11 @@ readline(prompt)
|
||||
CHAR *line;
|
||||
int s;
|
||||
|
||||
if (!isatty(0)) {
|
||||
TTYflush();
|
||||
return read_redirected();
|
||||
}
|
||||
|
||||
if (Line == NULL) {
|
||||
Length = MEM_INC;
|
||||
if ((Line = NEW(CHAR, Length)) == NULL)
|
||||
@@ -1119,7 +1164,7 @@ find_word()
|
||||
}
|
||||
|
||||
STATIC STATUS
|
||||
c_possible()
|
||||
c_possible(void)
|
||||
{
|
||||
CHAR **av;
|
||||
CHAR *word;
|
||||
@@ -1140,7 +1185,7 @@ c_possible()
|
||||
}
|
||||
|
||||
STATIC STATUS
|
||||
c_complete()
|
||||
c_complete(void)
|
||||
{
|
||||
CHAR *p, *q;
|
||||
CHAR *word, *new;
|
||||
|
@@ -4,6 +4,9 @@
|
||||
*/
|
||||
#include <config.h>
|
||||
#include <stdio.h>
|
||||
#ifdef HAVE_MALLOC_H
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
@@ -13,6 +16,9 @@
|
||||
#ifdef HAVE_DIRENT_H
|
||||
#include <dirent.h>
|
||||
#endif
|
||||
#ifdef HAVE_SIGNAL_H
|
||||
#include <signal.h>
|
||||
#endif
|
||||
#ifdef SYS_UNIX
|
||||
#include "unix.h"
|
||||
#endif /* defined(SYS_UNIX) */
|
||||
@@ -61,8 +67,11 @@ extern int rl_erase;
|
||||
extern int rl_intr;
|
||||
extern int rl_kill;
|
||||
extern int rl_quit;
|
||||
#if defined(DO_SIGTSTP)
|
||||
extern int rl_susp;
|
||||
#endif /* defined(DO_SIGTSTP) */
|
||||
extern char *rl_complete();
|
||||
extern int rl_list_possib();
|
||||
extern int rl_list_possib(char *pathname, char ***avp);
|
||||
extern void rl_ttyset();
|
||||
extern void rl_add_slash();
|
||||
|
||||
@@ -75,6 +84,7 @@ extern char *strcat();
|
||||
extern char *strchr();
|
||||
extern char *strrchr();
|
||||
extern char *strcpy();
|
||||
extern char *strdup();
|
||||
extern int strcmp();
|
||||
extern int strlen();
|
||||
extern int strncmp();
|
||||
|
@@ -15,19 +15,22 @@ rl_ttyset(Reset)
|
||||
struct termios new;
|
||||
|
||||
if (Reset == 0) {
|
||||
(void)tcgetattr(0, &old);
|
||||
if (tcgetattr(0, &old) < 0) perror("tcgetattr");
|
||||
rl_erase = old.c_cc[VERASE];
|
||||
rl_kill = old.c_cc[VKILL];
|
||||
rl_eof = old.c_cc[VEOF];
|
||||
rl_intr = old.c_cc[VINTR];
|
||||
rl_quit = old.c_cc[VQUIT];
|
||||
#if defined(DO_SIGTSTP)
|
||||
rl_susp = old.c_cc[VSUSP];
|
||||
#endif /* defined(DO_SIGTSTP) */
|
||||
|
||||
new = old;
|
||||
new.c_lflag &= ~(ECHO | ICANON | ISIG | IEXTEN);
|
||||
new.c_iflag &= ~(ICRNL);
|
||||
new.c_lflag &= ~(ECHO | ICANON | ISIG);
|
||||
new.c_iflag &= ~(ISTRIP | INPCK);
|
||||
new.c_cc[VMIN] = 1;
|
||||
new.c_cc[VTIME] = 0;
|
||||
(void)tcsetattr(0, TCSADRAIN, &new);
|
||||
if (tcsetattr(0, TCSADRAIN, &new) < 0) perror("tcsetattr");
|
||||
}
|
||||
else
|
||||
(void)tcsetattr(0, TCSADRAIN, &old);
|
||||
@@ -51,11 +54,13 @@ rl_ttyset(Reset)
|
||||
rl_eof = old.c_cc[VEOF];
|
||||
rl_intr = old.c_cc[VINTR];
|
||||
rl_quit = old.c_cc[VQUIT];
|
||||
#if defined(DO_SIGTSTP)
|
||||
rl_susp = old.c_cc[VSUSP];
|
||||
#endif /* defined(DO_SIGTSTP) */
|
||||
|
||||
new = old;
|
||||
new.c_cc[VINTR] = -1;
|
||||
new.c_cc[VQUIT] = -1;
|
||||
new.c_lflag &= ~(ECHO | ICANON);
|
||||
new.c_lflag &= ~(ECHO | ICANON | ISIG);
|
||||
new.c_iflag &= ~(ISTRIP | INPCK);
|
||||
new.c_cc[VMIN] = 1;
|
||||
new.c_cc[VTIME] = 0;
|
||||
(void)ioctl(0, TCSETAW, &new);
|
||||
@@ -75,6 +80,9 @@ rl_ttyset(Reset)
|
||||
static struct tchars old_tchars;
|
||||
struct sgttyb new_sgttyb;
|
||||
struct tchars new_tchars;
|
||||
#if defined(DO_SIGTSTP)
|
||||
struct ltchars old_ltchars;
|
||||
#endif /* defined(DO_SIGTSTP) */
|
||||
|
||||
if (Reset == 0) {
|
||||
(void)ioctl(0, TIOCGETP, &old_sgttyb);
|
||||
@@ -86,9 +94,17 @@ rl_ttyset(Reset)
|
||||
rl_intr = old_tchars.t_intrc;
|
||||
rl_quit = old_tchars.t_quitc;
|
||||
|
||||
#if defined(DO_SIGTSTP)
|
||||
(void)ioctl(0, TIOCGLTC, &old_ltchars);
|
||||
rl_susp = old_ltchars.t_suspc;
|
||||
#endif /* defined(DO_SIGTSTP) */
|
||||
|
||||
new_sgttyb = old_sgttyb;
|
||||
new_sgttyb.sg_flags &= ~ECHO;
|
||||
new_sgttyb.sg_flags |= RAW;
|
||||
#if defined(PASS8)
|
||||
new_sgttyb.sg_flags |= PASS8;
|
||||
#endif /* defined(PASS8) */
|
||||
(void)ioctl(0, TIOCSETP, &new_sgttyb);
|
||||
|
||||
new_tchars = old_tchars;
|
||||
|
@@ -8,6 +8,7 @@
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#if defined(USE_DIRENT)
|
||||
#include <dirent.h>
|
||||
|
Reference in New Issue
Block a user