mirror of
https://github.com/troglobit/editline.git
synced 2025-09-19 03:18:07 +08:00
Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
5b27b6ce4f | ||
![]() |
e828182cb0 | ||
![]() |
c1b3d17926 | ||
![]() |
69e01d11d4 | ||
![]() |
4898413730 | ||
![]() |
b1e74f3de2 | ||
![]() |
6d8d857dd4 | ||
![]() |
77d483da02 |
16
.bzrignore
Normal file
16
.bzrignore
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
Makefile
|
||||||
|
archive
|
||||||
|
autom4te.cache
|
||||||
|
config.h
|
||||||
|
config.log
|
||||||
|
config.status
|
||||||
|
stamp-h1
|
||||||
|
examples/.deps
|
||||||
|
examples/Makefile
|
||||||
|
examples/cli
|
||||||
|
examples/testit
|
||||||
|
man/Makefile
|
||||||
|
man/Makefile
|
||||||
|
include/Makefile
|
||||||
|
src/.deps
|
||||||
|
src/Makefile
|
@@ -32,7 +32,7 @@ POST_UNINSTALL = :
|
|||||||
subdir = .
|
subdir = .
|
||||||
DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
|
DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
|
||||||
$(srcdir)/Makefile.in $(srcdir)/config.h.in \
|
$(srcdir)/Makefile.in $(srcdir)/config.h.in \
|
||||||
$(top_srcdir)/configure TODO depcomp install-sh missing
|
$(top_srcdir)/configure NEWS TODO depcomp install-sh missing
|
||||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||||
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
|
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
|
||||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||||
|
9
NEWS
Normal file
9
NEWS
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
Notable Changes
|
||||||
|
|
||||||
|
* v0.3.0
|
||||||
|
** Support for ANSI arrow keys using --enable-arrow-keys
|
||||||
|
|
||||||
|
* v0.2.x
|
||||||
|
** Patches from Debian package merged.
|
||||||
|
** Support for custom command completion.
|
||||||
|
|
9
TODO
9
TODO
@@ -1,14 +1,5 @@
|
|||||||
TODO
|
TODO
|
||||||
|
|
||||||
* Merge in useful patches from Debian package
|
|
||||||
|
|
||||||
* Add --enable-FEATURE for features defined in Makefile-minix.in
|
* Add --enable-FEATURE for features defined in Makefile-minix.in
|
||||||
|
|
||||||
* Add support for custom completion, rl_attempted_completion_function.
|
|
||||||
|
|
||||||
* Add support for inhibiting completion: rl_inhibit_completion
|
* Add support for inhibiting completion: rl_inhibit_completion
|
||||||
|
|
||||||
* Add support for arrow keys, home, end, etc. See the following URL
|
|
||||||
for how to catch complex key strokes such as escape sequences:
|
|
||||||
http://www.unixwiz.net/techtips/termios-vmin-vtime.html
|
|
||||||
|
|
||||||
|
@@ -1,5 +1,8 @@
|
|||||||
/* config.h.in. Generated from configure.ac by autoheader. */
|
/* config.h.in. Generated from configure.ac by autoheader. */
|
||||||
|
|
||||||
|
/* Define to include ANSI arrow keys support in minix-editline */
|
||||||
|
#undef ANSI_ARROWS
|
||||||
|
|
||||||
/* Define to 1 if the `closedir' function returns void instead of `int'. */
|
/* Define to 1 if the `closedir' function returns void instead of `int'. */
|
||||||
#undef CLOSEDIR_VOID
|
#undef CLOSEDIR_VOID
|
||||||
|
|
||||||
@@ -19,6 +22,9 @@
|
|||||||
/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
|
/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
|
||||||
#undef HAVE_NDIR_H
|
#undef HAVE_NDIR_H
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `perror' function. */
|
||||||
|
#undef HAVE_PERROR
|
||||||
|
|
||||||
/* Define to 1 if you have the <sgtty.h> header file. */
|
/* Define to 1 if you have the <sgtty.h> header file. */
|
||||||
#undef HAVE_SGTTY_H
|
#undef HAVE_SGTTY_H
|
||||||
|
|
||||||
|
42
configure
vendored
42
configure
vendored
@@ -1,6 +1,6 @@
|
|||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
# Guess values for system-dependent variables and create Makefiles.
|
# Guess values for system-dependent variables and create Makefiles.
|
||||||
# Generated by GNU Autoconf 2.61 for Minix editline 0.2.2.
|
# Generated by GNU Autoconf 2.61 for Minix editline 0.3.0.
|
||||||
#
|
#
|
||||||
# Report bugs to <joachim@vmlinux.org>.
|
# Report bugs to <joachim@vmlinux.org>.
|
||||||
#
|
#
|
||||||
@@ -574,8 +574,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
|
|||||||
# Identity of this package.
|
# Identity of this package.
|
||||||
PACKAGE_NAME='Minix editline'
|
PACKAGE_NAME='Minix editline'
|
||||||
PACKAGE_TARNAME='minix-editline'
|
PACKAGE_TARNAME='minix-editline'
|
||||||
PACKAGE_VERSION='0.2.2'
|
PACKAGE_VERSION='0.3.0'
|
||||||
PACKAGE_STRING='Minix editline 0.2.2'
|
PACKAGE_STRING='Minix editline 0.3.0'
|
||||||
PACKAGE_BUGREPORT='joachim@vmlinux.org'
|
PACKAGE_BUGREPORT='joachim@vmlinux.org'
|
||||||
|
|
||||||
ac_unique_file="src/editline.c"
|
ac_unique_file="src/editline.c"
|
||||||
@@ -1210,7 +1210,7 @@ if test "$ac_init_help" = "long"; then
|
|||||||
# Omit some internal or obsolete options to make the list less imposing.
|
# 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.
|
# This message is too long to be a string in the A/UX 3.1 sh.
|
||||||
cat <<_ACEOF
|
cat <<_ACEOF
|
||||||
\`configure' configures Minix editline 0.2.2 to adapt to many kinds of systems.
|
\`configure' configures Minix editline 0.3.0 to adapt to many kinds of systems.
|
||||||
|
|
||||||
Usage: $0 [OPTION]... [VAR=VALUE]...
|
Usage: $0 [OPTION]... [VAR=VALUE]...
|
||||||
|
|
||||||
@@ -1276,7 +1276,7 @@ fi
|
|||||||
|
|
||||||
if test -n "$ac_init_help"; then
|
if test -n "$ac_init_help"; then
|
||||||
case $ac_init_help in
|
case $ac_init_help in
|
||||||
short | recursive ) echo "Configuration of Minix editline 0.2.2:";;
|
short | recursive ) echo "Configuration of Minix editline 0.3.0:";;
|
||||||
esac
|
esac
|
||||||
cat <<\_ACEOF
|
cat <<\_ACEOF
|
||||||
|
|
||||||
@@ -1286,6 +1286,7 @@ Optional Features:
|
|||||||
--disable-dependency-tracking speeds up one-time build
|
--disable-dependency-tracking speeds up one-time build
|
||||||
--enable-dependency-tracking do not reject slow dependency extractors
|
--enable-dependency-tracking do not reject slow dependency extractors
|
||||||
--enable-default-complete Enable default completion handler.
|
--enable-default-complete Enable default completion handler.
|
||||||
|
--enable-arrow-keys Enable ANSI arrow keys.
|
||||||
|
|
||||||
Some influential environment variables:
|
Some influential environment variables:
|
||||||
CC C compiler command
|
CC C compiler command
|
||||||
@@ -1361,7 +1362,7 @@ fi
|
|||||||
test -n "$ac_init_help" && exit $ac_status
|
test -n "$ac_init_help" && exit $ac_status
|
||||||
if $ac_init_version; then
|
if $ac_init_version; then
|
||||||
cat <<\_ACEOF
|
cat <<\_ACEOF
|
||||||
Minix editline configure 0.2.2
|
Minix editline configure 0.3.0
|
||||||
generated by GNU Autoconf 2.61
|
generated by GNU Autoconf 2.61
|
||||||
|
|
||||||
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
|
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
|
||||||
@@ -1375,7 +1376,7 @@ cat >config.log <<_ACEOF
|
|||||||
This file contains any messages produced by compilers while
|
This file contains any messages produced by compilers while
|
||||||
running configure, to aid debugging if configure makes a mistake.
|
running configure, to aid debugging if configure makes a mistake.
|
||||||
|
|
||||||
It was created by Minix editline $as_me 0.2.2, which was
|
It was created by Minix editline $as_me 0.3.0, which was
|
||||||
generated by GNU Autoconf 2.61. Invocation command line was
|
generated by GNU Autoconf 2.61. Invocation command line was
|
||||||
|
|
||||||
$ $0 $@
|
$ $0 $@
|
||||||
@@ -2070,7 +2071,7 @@ fi
|
|||||||
|
|
||||||
# Define the identity of the package.
|
# Define the identity of the package.
|
||||||
PACKAGE='minix-editline'
|
PACKAGE='minix-editline'
|
||||||
VERSION='0.2.2'
|
VERSION='0.3.0'
|
||||||
|
|
||||||
|
|
||||||
cat >>confdefs.h <<_ACEOF
|
cat >>confdefs.h <<_ACEOF
|
||||||
@@ -4879,7 +4880,8 @@ fi
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
for ac_func in strchr strdup strrchr tcgetattr
|
|
||||||
|
for ac_func in strchr strdup strrchr tcgetattr perror
|
||||||
do
|
do
|
||||||
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
|
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
|
||||||
{ echo "$as_me:$LINENO: checking for $ac_func" >&5
|
{ echo "$as_me:$LINENO: checking for $ac_func" >&5
|
||||||
@@ -5002,6 +5004,23 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
ac_enable_arrow_keys=no
|
||||||
|
# Check whether --enable-arrow-keys was given.
|
||||||
|
if test "${enable_arrow_keys+set}" = set; then
|
||||||
|
enableval=$enable_arrow_keys; ac_enable_arrow_keys=$enableval
|
||||||
|
else
|
||||||
|
ac_enable_arrow_keys=no
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
if test "x${ac_enable_arrow_keys}" = xyes ; then
|
||||||
|
|
||||||
|
cat >>confdefs.h <<\_ACEOF
|
||||||
|
#define ANSI_ARROWS
|
||||||
|
_ACEOF
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
ac_config_files="$ac_config_files Makefile src/Makefile include/Makefile man/Makefile examples/Makefile"
|
ac_config_files="$ac_config_files Makefile src/Makefile include/Makefile man/Makefile examples/Makefile"
|
||||||
|
|
||||||
cat >confcache <<\_ACEOF
|
cat >confcache <<\_ACEOF
|
||||||
@@ -5421,7 +5440,7 @@ exec 6>&1
|
|||||||
# report actual input values of CONFIG_FILES etc. instead of their
|
# report actual input values of CONFIG_FILES etc. instead of their
|
||||||
# values after options handling.
|
# values after options handling.
|
||||||
ac_log="
|
ac_log="
|
||||||
This file was extended by Minix editline $as_me 0.2.2, which was
|
This file was extended by Minix editline $as_me 0.3.0, which was
|
||||||
generated by GNU Autoconf 2.61. Invocation command line was
|
generated by GNU Autoconf 2.61. Invocation command line was
|
||||||
|
|
||||||
CONFIG_FILES = $CONFIG_FILES
|
CONFIG_FILES = $CONFIG_FILES
|
||||||
@@ -5474,7 +5493,7 @@ Report bugs to <bug-autoconf@gnu.org>."
|
|||||||
_ACEOF
|
_ACEOF
|
||||||
cat >>$CONFIG_STATUS <<_ACEOF
|
cat >>$CONFIG_STATUS <<_ACEOF
|
||||||
ac_cs_version="\\
|
ac_cs_version="\\
|
||||||
Minix editline config.status 0.2.2
|
Minix editline config.status 0.3.0
|
||||||
configured by $0, generated by GNU Autoconf 2.61,
|
configured by $0, generated by GNU Autoconf 2.61,
|
||||||
with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
|
with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
|
||||||
|
|
||||||
@@ -6341,3 +6360,4 @@ if test "$no_create" != yes; then
|
|||||||
$ac_cs_success || { (exit 1); exit 1; }
|
$ac_cs_success || { (exit 1); exit 1; }
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
15
configure.ac
15
configure.ac
@@ -2,7 +2,7 @@
|
|||||||
# Process this file with autoconf to produce a configure script.
|
# Process this file with autoconf to produce a configure script.
|
||||||
|
|
||||||
AC_PREREQ(2.61)
|
AC_PREREQ(2.61)
|
||||||
AC_INIT(Minix editline, 0.2.2, joachim@vmlinux.org)
|
AC_INIT(Minix editline, 0.3.0, joachim@vmlinux.org)
|
||||||
AC_CONFIG_SRCDIR([src/editline.c])
|
AC_CONFIG_SRCDIR([src/editline.c])
|
||||||
AC_CONFIG_HEADER([config.h])
|
AC_CONFIG_HEADER([config.h])
|
||||||
|
|
||||||
@@ -38,7 +38,7 @@ AC_PROG_GCC_TRADITIONAL
|
|||||||
#AC_FUNC_MALLOC
|
#AC_FUNC_MALLOC
|
||||||
#AC_FUNC_REALLOC
|
#AC_FUNC_REALLOC
|
||||||
AC_FUNC_STAT
|
AC_FUNC_STAT
|
||||||
AC_CHECK_FUNCS([strchr strdup strrchr tcgetattr])
|
AC_CHECK_FUNCS([strchr strdup strrchr tcgetattr perror])
|
||||||
|
|
||||||
AC_ARG_ENABLE([default-complete],
|
AC_ARG_ENABLE([default-complete],
|
||||||
[ --enable-default-complete Enable default completion handler.],[
|
[ --enable-default-complete Enable default completion handler.],[
|
||||||
@@ -55,4 +55,15 @@ AC_ARG_ENABLE([default-complete],
|
|||||||
esac],[complete=false])
|
esac],[complete=false])
|
||||||
AM_CONDITIONAL([COMPLETE], [test x$complete = xtrue])
|
AM_CONDITIONAL([COMPLETE], [test x$complete = xtrue])
|
||||||
|
|
||||||
|
ac_enable_arrow_keys=no
|
||||||
|
AC_ARG_ENABLE(arrow-keys,
|
||||||
|
[ --enable-arrow-keys Enable ANSI arrow keys.],
|
||||||
|
[ ac_enable_arrow_keys=$enableval ], [ ac_enable_arrow_keys=no])
|
||||||
|
|
||||||
|
if test "x${ac_enable_arrow_keys}" = xyes ; then
|
||||||
|
AC_DEFINE([ANSI_ARROWS], [],
|
||||||
|
[Define to include ANSI arrow keys support in minix-editline])
|
||||||
|
fi
|
||||||
|
|
||||||
AC_OUTPUT(Makefile src/Makefile include/Makefile man/Makefile examples/Makefile)
|
AC_OUTPUT(Makefile src/Makefile include/Makefile man/Makefile examples/Makefile)
|
||||||
|
|
||||||
|
@@ -62,7 +62,7 @@ int my_rl_list_possib(char *token, char ***av)
|
|||||||
return total;
|
return total;
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int ac, char *av[])
|
int main(int ac __attribute__ ((unused)), char *av[] __attribute__ ((unused)))
|
||||||
{
|
{
|
||||||
char *line;
|
char *line;
|
||||||
char *prompt = "cli> ";
|
char *prompt = "cli> ";
|
||||||
|
@@ -3,25 +3,35 @@
|
|||||||
** A "micro-shell" to test editline library.
|
** A "micro-shell" to test editline library.
|
||||||
** If given any arguments, commands aren't executed.
|
** If given any arguments, commands aren't executed.
|
||||||
*/
|
*/
|
||||||
|
#include <config.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#if defined(HAVE_STDLIB)
|
#if defined(HAVE_STDLIB_H)
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#endif /* defined(HAVE_STDLIB) */
|
#endif
|
||||||
|
#if defined(HAVE_STRING_H)
|
||||||
|
#include <string.h>
|
||||||
|
#endif
|
||||||
|
#if defined(HAVE_UNISTD_H)
|
||||||
|
#include <unistd.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
extern char *readline();
|
extern char *readline();
|
||||||
extern void add_history();
|
extern void add_history();
|
||||||
|
|
||||||
#if !defined(HAVE_STDLIB)
|
#if !defined(HAVE_STDLIB_H)
|
||||||
extern int chdir();
|
|
||||||
extern int free();
|
extern int free();
|
||||||
extern int strncmp();
|
|
||||||
extern int system();
|
extern int system();
|
||||||
extern void exit();
|
extern void exit();
|
||||||
extern char *getenv();
|
extern char *getenv();
|
||||||
#endif /* !defined(HAVE_STDLIB) */
|
#endif /* !defined(HAVE_STDLIB) */
|
||||||
|
#if !defined(HAVE_STRING_H)
|
||||||
|
extern int strncmp();
|
||||||
|
#endif
|
||||||
|
#if !defined(HAVE_UNISTD_H)
|
||||||
|
extern int chdir();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(HAVE_PERROR)
|
||||||
#if defined(NEED_PERROR)
|
|
||||||
void
|
void
|
||||||
perror(s)
|
perror(s)
|
||||||
char *s;
|
char *s;
|
||||||
@@ -37,7 +47,7 @@ perror(s)
|
|||||||
int
|
int
|
||||||
main(ac, av)
|
main(ac, av)
|
||||||
int ac;
|
int ac;
|
||||||
char *av[];
|
char *av[] __attribute__ ((unused));
|
||||||
{
|
{
|
||||||
char *prompt;
|
char *prompt;
|
||||||
char *p;
|
char *p;
|
||||||
|
@@ -4,8 +4,8 @@
|
|||||||
|
|
||||||
/* Assign these to get command completion, see cli.c for
|
/* Assign these to get command completion, see cli.c for
|
||||||
* example usage. */
|
* example usage. */
|
||||||
char *(*rl_complete)(char *token, int *match);
|
extern char *(*rl_complete)(char *token, int *match);
|
||||||
int (*rl_list_possib)(char *token, char ***av);
|
extern int (*rl_list_possib)(char *token, char ***av);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** For compatibility with FSF readline.
|
** For compatibility with FSF readline.
|
||||||
|
@@ -24,16 +24,12 @@ strdup(p)
|
|||||||
/*
|
/*
|
||||||
** strcmp-like sorting predicate for qsort.
|
** strcmp-like sorting predicate for qsort.
|
||||||
*/
|
*/
|
||||||
STATIC int
|
static int
|
||||||
compare(p1, p2)
|
compare(void *p1, void *p2)
|
||||||
CONST void *p1;
|
|
||||||
CONST void *p2;
|
|
||||||
{
|
{
|
||||||
CONST char **v1;
|
char **v1 = (char **)p1;
|
||||||
CONST char **v2;
|
char **v2 = (char **)p2;
|
||||||
|
|
||||||
v1 = (CONST char **)p1;
|
|
||||||
v2 = (CONST char **)p2;
|
|
||||||
return strcmp(*v1, *v2);
|
return strcmp(*v1, *v2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -41,7 +37,7 @@ compare(p1, p2)
|
|||||||
** Fill in *avp with an array of names that match file, up to its length.
|
** Fill in *avp with an array of names that match file, up to its length.
|
||||||
** Ignore . and .. .
|
** Ignore . and .. .
|
||||||
*/
|
*/
|
||||||
STATIC int
|
static int
|
||||||
FindMatches(dir, file, avp)
|
FindMatches(dir, file, avp)
|
||||||
char *dir;
|
char *dir;
|
||||||
char *file;
|
char *file;
|
||||||
@@ -124,7 +120,7 @@ FindMatches(dir, file, avp)
|
|||||||
/*
|
/*
|
||||||
** Split a pathname into allocated directory and trailing filename parts.
|
** Split a pathname into allocated directory and trailing filename parts.
|
||||||
*/
|
*/
|
||||||
STATIC int
|
static int
|
||||||
SplitPath(path, dirpart, filepart)
|
SplitPath(path, dirpart, filepart)
|
||||||
char *path;
|
char *path;
|
||||||
char **dirpart;
|
char **dirpart;
|
||||||
|
670
src/editline.c
670
src/editline.c
File diff suppressed because it is too large
Load Diff
@@ -35,21 +35,6 @@
|
|||||||
|
|
||||||
typedef unsigned char CHAR;
|
typedef unsigned char CHAR;
|
||||||
|
|
||||||
#if defined(HIDE)
|
|
||||||
#define STATIC static
|
|
||||||
#else
|
|
||||||
#define STATIC /* NULL */
|
|
||||||
#endif /* !defined(HIDE) */
|
|
||||||
|
|
||||||
#if !defined(CONST)
|
|
||||||
#if defined(__STDC__)
|
|
||||||
#define CONST const
|
|
||||||
#else
|
|
||||||
#define CONST
|
|
||||||
#endif /* defined(__STDC__) */
|
|
||||||
#endif /* !defined(CONST) */
|
|
||||||
|
|
||||||
|
|
||||||
#define MEM_INC 64
|
#define MEM_INC 64
|
||||||
#define SCREEN_INC 256
|
#define SCREEN_INC 256
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user