Completely unbundle libedit

FS-353

Signed-off-by: Travis Cross <tc@traviscross.com>
v1.4
James Le Cuirot 9 years ago committed by Travis Cross
parent 1cde5f01e0
commit 8574988c3a
  1. 27
      Makefile.am
  2. 2
      bootstrap.sh
  3. 15
      cmake_modules/FindLibedit.cmake
  4. 39
      configure.ac
  5. 1
      debian/bootstrap.sh
  6. 11
      debian/copyright
  7. 2
      docs/Doxygen.conf
  8. 22
      libs/.gitignore
  9. 1
      libs/esl/.gitignore
  10. 11
      libs/esl/Makefile.am
  11. 1
      libs/esl/eslmake.rules.in
  12. 59
      libs/esl/fs_cli.c
  13. 13
      libs/esl/src/include/esl_config_auto.h.in
  14. 19
      libs/libedit/CMakeLists.txt
  15. 23
      libs/libedit/COPYING
  16. 219
      libs/libedit/ChangeLog
  17. 229
      libs/libedit/INSTALL
  18. 40
      libs/libedit/Makefile.am
  19. 1
      libs/libedit/THANKS
  20. 67
      libs/libedit/acinclude.m4
  21. 89
      libs/libedit/configure.ac
  22. 4
      libs/libedit/configure.gnu
  23. 31
      libs/libedit/doc/Makefile.am
  24. 826
      libs/libedit/doc/editline.3.roff
  25. 513
      libs/libedit/doc/editrc.5.roff
  26. 459
      libs/libedit/doc/mdoc2man.awk
  27. 8
      libs/libedit/examples/Makefile.am
  28. 492
      libs/libedit/examples/fileman.c
  29. 292
      libs/libedit/examples/test.c
  30. 12
      libs/libedit/libedit.pc.in
  31. 29
      libs/libedit/patches/00-vis.h.patch
  32. 30
      libs/libedit/patches/01-term.c.patch
  33. 18
      libs/libedit/patches/02-el_term.h.patch
  34. 19
      libs/libedit/patches/03-unvis.c.patch
  35. 34
      libs/libedit/patches/04-strlcpy.c.patch
  36. 34
      libs/libedit/patches/05-strlcat.c.patch
  37. 88
      libs/libedit/patches/06-readline.c.patch
  38. 37
      libs/libedit/patches/07-sys.h.patch
  39. 11
      libs/libedit/patches/08-el.h.patch
  40. 10
      libs/libedit/patches/09-search.c.patch
  41. 24
      libs/libedit/patches/10-readline.h.patch
  42. 36
      libs/libedit/patches/11-el.c.patch
  43. 14
      libs/libedit/patches/12-history.c.patch
  44. 35
      libs/libedit/patches/13-vis.c.patch
  45. 10
      libs/libedit/patches/14-fgetln.c.patch
  46. 98
      libs/libedit/patches/15-filecomplete.c.patch
  47. 35
      libs/libedit/patches/16-tc1.c.patch
  48. 29
      libs/libedit/patches/17-editline.3.roff.patch
  49. 34
      libs/libedit/patches/18-editrc.5.roff.patch
  50. 62
      libs/libedit/patches/README
  51. 50
      libs/libedit/patches/cvs_export.sh
  52. 30
      libs/libedit/patches/extra_dist_list.sh
  53. 8
      libs/libedit/patches/patches_apply.sh
  54. 17
      libs/libedit/patches/patches_check.sh
  55. 17
      libs/libedit/patches/patches_make.sh
  56. 1
      libs/libedit/patches/timestamp.cvsexport
  57. 18
      libs/libedit/patches/update_dist.sh
  58. 17
      libs/libedit/patches/update_version.sh
  59. 25
      libs/libedit/src/CMakeLists.txt
  60. 46
      libs/libedit/src/Makefile.am
  61. 777
      libs/libedit/src/chared.c
  62. 167
      libs/libedit/src/chared.h
  63. 921
      libs/libedit/src/common.c
  64. 204
      libs/libedit/src/editline/readline.h
  65. 572
      libs/libedit/src/el.c
  66. 150
      libs/libedit/src/el.h
  67. 134
      libs/libedit/src/el_term.h
  68. 507
      libs/libedit/src/emacs.c
  69. 110
      libs/libedit/src/fgetln.c
  70. 561
      libs/libedit/src/filecomplete.c
  71. 47
      libs/libedit/src/filecomplete.h
  72. 210
      libs/libedit/src/hist.c
  73. 76
      libs/libedit/src/hist.h
  74. 227
      libs/libedit/src/histedit.h
  75. 987
      libs/libedit/src/history.c
  76. 706
      libs/libedit/src/key.c
  77. 81
      libs/libedit/src/key.h
  78. 250
      libs/libedit/src/makelist
  79. 1422
      libs/libedit/src/map.c
  80. 75
      libs/libedit/src/map.h
  81. 263
      libs/libedit/src/parse.c
  82. 48
      libs/libedit/src/parse.h
  83. 170
      libs/libedit/src/prompt.c
  84. 58
      libs/libedit/src/prompt.h
  85. 628
      libs/libedit/src/read.c
  86. 53
      libs/libedit/src/read.h
  87. 1970
      libs/libedit/src/readline.c
  88. 1139
      libs/libedit/src/refresh.c
  89. 59
      libs/libedit/src/refresh.h
  90. 634
      libs/libedit/src/search.c
  91. 66
      libs/libedit/src/search.h
  92. 5
      libs/libedit/src/shlib_version
  93. 194
      libs/libedit/src/sig.c
  94. 69
      libs/libedit/src/sig.h
  95. 74
      libs/libedit/src/strlcat.c
  96. 70
      libs/libedit/src/strlcpy.c
  97. 154
      libs/libedit/src/sys.h
  98. 1680
      libs/libedit/src/term.c
  99. 447
      libs/libedit/src/tokenizer.c
  100. 1312
      libs/libedit/src/tty.c
  101. Some files were not shown because too many files have changed in this diff Show More

@ -106,11 +106,6 @@ if HAVE_ODBC
CORE_CFLAGS += -DSWITCH_HAVE_ODBC $(ODBC_INC_FLAGS)
endif
if HAVE_LIBEDIT
CORE_CFLAGS += -I$(switch_srcdir)/libs/libedit/src -DSWITCH_HAVE_LIBEDIT
CORE_LIBS += libs/libedit/src/.libs/libedit.a
endif
if ENABLE_TIMERFD_WRAPPER
CORE_CFLAGS += -DTIMERFD_WRAP
endif
@ -123,15 +118,11 @@ libfreeswitch_spandsp_la_SOURCES = libs/spandsp/src/plc.c libs/spandsp/src/alloc
libfreeswitch_spandsp_la_CFLAGS = -Ilibs/spandsp/src $(CORE_CFLAGS) $(AM_CFLAGS)
CORE_LIBS+=libfreeswitch_spandsp.la
lib_LTLIBRARIES = libfreeswitch.la
libfreeswitch_la_CFLAGS = $(CORE_CFLAGS) $(CURL_CFLAGS) $(PCRE_CFLAGS) $(SPEEX_CFLAGS) $(AM_CFLAGS)
libfreeswitch_la_CFLAGS = $(CORE_CFLAGS) $(CURL_CFLAGS) $(PCRE_CFLAGS) $(SPEEX_CFLAGS) $(LIBEDIT_CFLAGS) $(AM_CFLAGS)
libfreeswitch_la_LDFLAGS = -version-info 1:0:0 $(AM_LDFLAGS) $(PLATFORM_CORE_LDFLAGS) -no-undefined
libfreeswitch_la_LIBADD = $(CORE_LIBS) $(APR_LIBS) $(CURL_LIBS) $(PCRE_LIBS) $(SPEEX_LIBS) $(PLATFORM_CORE_LIBS)
libfreeswitch_la_LIBADD = $(CORE_LIBS) $(APR_LIBS) $(CURL_LIBS) $(PCRE_LIBS) $(SPEEX_LIBS) $(LIBEDIT_LIBS) $(PLATFORM_CORE_LIBS)
libfreeswitch_la_DEPENDENCIES = $(BUILT_SOURCES)
if HAVE_LIBEDIT
libfreeswitch_la_LIBADD += $(TINFO_LIBS)
endif
if HAVE_ODBC
libfreeswitch_la_LDFLAGS += $(ODBC_LIB_FLAGS)
endif
@ -301,13 +292,8 @@ bin_PROGRAMS = freeswitch fs_cli fs_ivrd tone2wav fs_encode
##
fs_cli_SOURCES = libs/esl/src/esl.c libs/esl/src/esl_config.c libs/esl/src/esl_event.c \
libs/esl/src/esl_threadmutex.c libs/esl/fs_cli.c libs/esl/src/esl_json.c libs/esl/src/esl_buffer.c
fs_cli_CFLAGS = $(AM_CFLAGS) -I$(switch_srcdir)/libs/esl/src/include
fs_cli_LDFLAGS = $(AM_LDFLAGS) -lpthread $(ESL_LDFLAGS) -lm
if HAVE_LIBEDIT
fs_cli_CFLAGS += -DHAVE_EDITLINE -I$(switch_srcdir)/libs/libedit/src
fs_cli_LDADD = libs/libedit/src/.libs/libedit.a $(TINFO_LIBS)
endif
fs_cli_CFLAGS = $(AM_CFLAGS) -I$(switch_srcdir)/libs/esl/src/include $(LIBEDIT_CFLAGS)
fs_cli_LDFLAGS = $(AM_LDFLAGS) -lpthread $(ESL_LDFLAGS) -lm $(LIBEDIT_LIBS)
##
@ -353,11 +339,6 @@ freeswitch_CFLAGS = $(AM_CFLAGS) $(CORE_CFLAGS)
freeswitch_LDFLAGS = $(AM_LDFLAGS) -lpthread -rpath $(libdir)
freeswitch_LDADD = libfreeswitch.la libs/apr/libapr-1.la
if HAVE_LIBEDIT
freeswitch_CFLAGS += -Ilibs/libedit/src -DSWITCH_HAVE_LIBEDIT
freeswitch_LDADD += libs/libedit/src/.libs/libedit.a $(TINFO_LIBS)
endif
if HAVE_ODBC
freeswitch_LDADD += $(ODBC_LIB_FLAGS)
endif

@ -9,7 +9,7 @@ VERBOSE=false
BASEDIR=`pwd`;
LIBDIR=${BASEDIR}/libs;
SUBDIRS="apr \
libzrtp ilbc iksemel js js/nsprpub ldns libdingaling libedit libsndfile sofia-sip \
libzrtp ilbc iksemel js js/nsprpub ldns libdingaling libsndfile sofia-sip \
speex sqlite srtp openzap freetdm spandsp libg722_1 portaudio unimrcp tiff-4.0.2 broadvoice silk libcodec2 \
fs";

@ -1,15 +0,0 @@
find_path(PATH_INC_EDIT NAMES "histedit.h" PATHS ${CMAKE_SOURCE_DIR}/libs/libedit/src/)
if( NOT PATH_INC_EDIT )
message(FATAL_ERROR"Unable to locate libedit include files" )
endif( NOT PATH_INC_EDIT )
find_library(PATH_LIB_EDIT NAMES "libedit.a" PATHS ${CMAKE_SOURCE_DIR}/libs/libedit/src/.libs/)
if( NOT PATH_LIB_EDIT )
message(FATAL_ERROR "Unable to locate libedit library file" )
endif( NOT PATH_LIB_EDIT )
MESSAGE( STATUS "PATH_INC_EDIT = \"${PATH_INC_EDIT}\"" )
MESSAGE( STATUS "PATH_LIB_EDIT = \"${PATH_LIB_EDIT}\"" )

@ -17,6 +17,7 @@ AM_INIT_AUTOMAKE
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AC_CONFIG_SRCDIR([src/switch.c])
AC_CONFIG_HEADER([src/include/switch_private.h])
AC_CONFIG_HEADER([libs/esl/src/include/esl_config_auto.h])
AC_CONFIG_HEADER([libs/xmlrpc-c/xmlrpc_amconfig.h])
AC_PREFIX_DEFAULT(/usr/local/freeswitch)
@ -1079,20 +1080,27 @@ PKG_CHECK_MODULES([PCRE], [libpcre >= 7.8])
PKG_CHECK_MODULES([SPEEX], [speex >= 1.2rc1 speexdsp >= 1.2rc1])
AC_ARG_ENABLE(core-libedit-support,
[AS_HELP_STRING([--disable-core-libedit-support], [Compile without libedit Support])], [enable_core_libedit_support="$enableval"], [enable_core_libedit_support="yes"])
[AS_HELP_STRING([--disable-core-libedit-support], [Compile without libedit Support])])
if test "$enable_core_libedit_support" = "yes" ; then
AC_CHECK_LIB(tinfo, tgetent, [have_libtinfo="yes"], [have_libtinfo="no"])
if test "$have_libtinfo" == "yes" ; then
TINFO_LIBS="-ltinfo"
else
TINFO_LIBS=""
AC_CHECK_LIB(ncurses, tgetent,,
[AC_CHECK_LIB(curses, tgetent,,
[AC_MSG_ERROR([libtermcap, libcurses or libncurses are required!])] )] )
fi
AC_SUBST(TINFO_LIBS)
fi
case x$enable_core_libedit_support in
xno) ;;
xyes) PKG_CHECK_MODULES([LIBEDIT], [libedit >= 2.11]) ;;
*) PKG_CHECK_MODULES([LIBEDIT], [libedit >= 2.11],, [AC_MSG_RESULT([no]); enable_core_libedit_support=no]) ;;
esac
AS_IF([test "x$enable_core_libedit_support" != "xno"], [
# If making changes here, don't forget to run autoheader and
# update libs/esl/src/include/esl_config_auto.h.in manually.
AC_DEFINE([HAVE_LIBEDIT], [1], [Define to 1 if you have libedit is available])
save_LIBS="${LIBS}"
save_CPPFLAGS="${CPPFLAGS}"
LIBS="${LIBEDIT_LIBS}"
CPPFLAGS="${LIBEDIT_CFLAGS}"
AC_CHECK_DECLS([EL_PROMPT_ESC, EL_REFRESH],,, [[#include <histedit.h>]])
AC_CHECK_FUNCS([el_wset])
LIBS="${save_LIBS}"
CPPFLAGS="${save_CPPFLAGS}"
])
SAC_OPENSSL
@ -1118,7 +1126,6 @@ AC_ARG_ENABLE(parallel-build-v8,
AM_CONDITIONAL([ENABLE_PARALLEL_BUILD_V8],[test "x$enable_parallel_build_v8" != "xno"])
AM_CONDITIONAL([HAVE_ODBC],[test "x$enable_core_odbc_support" != "xno"])
AM_CONDITIONAL([HAVE_LIBEDIT],[test "x$enable_core_libedit_support" != "xno"])
AM_CONDITIONAL([HAVE_MYSQL],[test "$found_mysql" = "yes"])
#
@ -1518,10 +1525,6 @@ ac_configure_args="$ac_configure_args CONFIGURE_CFLAGS='$CFLAGS' CONFIGURE_CXXFL
# Run configure in all the subdirs
AC_CONFIG_SUBDIRS([libs/srtp])
AC_CONFIG_SUBDIRS([libs/sqlite])
if test "$enable_core_libedit_support" = "yes" ; then
AC_CONFIG_SUBDIRS([libs/libedit])
fi
AC_CONFIG_SUBDIRS([libs/apr])
AC_CONFIG_SUBDIRS([libs/apr-util])
AC_CONFIG_SUBDIRS([libs/ilbc])

@ -285,6 +285,7 @@ Build-Depends:
dpkg-dev (>= 1.15.8.12), gcc (>= 4:4.4.5), g++ (>= 4:4.4.5),
libc6-dev (>= 2.11.3), make (>= 3.81),
libpcre3-dev,
libedit-dev (>= 2.11),
wget, pkg-config,
# core codecs
libogg-dev, libspeex-dev, libspeexdsp-dev,

11
debian/copyright vendored

@ -1831,17 +1831,6 @@ Files: libs/libwebsockets/win32port/win32helpers/getopt_long.c
Copyright: 1987-1996, The Regents of the University of California.
License: BSD-4-clause
Files: libs/libedit/*
Copyright: 1992, 1993 The Regents of the University of California.
1997-2005 The NetBSD Foundation, Inc.
1998 Todd C. Miller <Todd.Miller@courtesan.com>
License: BSD-3-clause
Files: libs/libedit/src/strlcat.c
libs/libedit/src/strlcpy.c
Copyright: 1998 Todd C. Miller <Todd.Miller@courtesan.com>
License: ISC
Files: libs/esl/*
Copyright: 2007 Michael Jerris
2002 Todd C. Miller <Todd.Miller@courtesan.com>

@ -1242,7 +1242,7 @@ SEARCH_INCLUDES = YES
INCLUDE_PATH =../libs/apr ../libs/apr-util \
../libs/iksemel ../libs/ilbc ../libs/js \
../libs/libedit ../libs/libg722_1 ../libs/libnatpmp \
../libs/libg722_1 ../libs/libnatpmp \
../libs/libsndfile ../libs/miniupnpc \
../libs/portaudio ../libs/sofia-sip ../libs/spandsp \
../libs/sqlite ../libs/srtp \

22
libs/.gitignore vendored

@ -249,27 +249,6 @@ opal
/libdingaling/Makefile.in
/libdingaling/src/config.h
/libdingaling/src/stamp-h1
/libedit/config.h
/libedit/doc/editline.3
/libedit/doc/editrc.5
/libedit/doc/Makefile
/libedit/doc/Makefile.in
/libedit/examples/fileman
/libedit/examples/Makefile
/libedit/examples/Makefile.in
/libedit/examples/test
/libedit/Makefile
/libedit/Makefile.in
/libedit/src/common.h
/libedit/src/emacs.h
/libedit/src/fcns.c
/libedit/src/fcns.h
/libedit/src/help.c
/libedit/src/help.h
/libedit/src/Makefile
/libedit/src/Makefile.in
/libedit/src/vi.h
/libedit/stamp-h1
/libg722_1/config-h.in
/libg722_1/doc/Makefile
/libg722_1/doc/Makefile.in
@ -905,7 +884,6 @@ opal
!/yaml/configure
broadvoice/config/compile
ilbc/config/compile
libedit/compile
libg722_1/config/compile
pcre/compile
spandsp/config/compile

@ -2,3 +2,4 @@ eslmake.rules
testserver_fork
Makefile
Makefile.in
/src/include/esl_config_auto.h

@ -21,14 +21,9 @@ bin_PROGRAMS = fs_cli ivrd
noinst_PROGRAMS = testclient testserver testserver_fork
fs_cli_SOURCES = fs_cli.c
fs_cli_CFLAGS = $(AM_CFLAGS) -I$(switch_srcdir)/libs/esl/src/include
fs_cli_LDFLAGS = $(AM_LDFLAGS) $(LDFLAGS) $(LIBS)
fs_cli_LDADD = libesl.la
if HAVE_LIBEDIT
fs_cli_CFLAGS += -DHAVE_EDITLINE -I$(switch_srcdir)/libs/libedit/src
fs_cli_LDADD += ../libedit/src/.libs/libedit.a $(TINFO_LIBS)
endif
fs_cli_CFLAGS = $(AM_CFLAGS) -I$(switch_srcdir)/libs/esl/src/include $(LIBEDIT_CFLAGS)
fs_cli_LDFLAGS = $(AM_LDFLAGS) $(LDFLAGS) $(LIBS) $(LIBEDIT_LIBS)
fs_cli_LDADD = libesl.la
testclient_SOURCES = testclient.c
testclient_CFLAGS = $(AM_CFLAGS) -I$(switch_srcdir)/libs/esl/src/include

@ -1,4 +1,3 @@
TINFO_LIBS=@TINFO_LIBS@
SYSTEM_CFLAGS=@CFLAGS@
SYSTEM_LDFLAGS=@LDFLAGS@
CXX=@CXX@

@ -11,6 +11,7 @@
#define CMD_BUFLEN 1024
#ifndef WIN32
#include <esl_config_auto.h>
#include <sys/select.h>
#include <unistd.h>
#include <time.h>
@ -44,7 +45,7 @@ static int console_bufferInput (char *buf, int len, char *cmd, int key);
static unsigned char esl_console_complete(const char *buffer, const char *cursor, const char *lastchar);
#endif
#ifdef HAVE_EDITLINE
#ifdef HAVE_LIBEDIT
#include <histedit.h>
#endif
@ -87,7 +88,7 @@ static char *filter_uuid;
static char *logfilter;
static int timeout = 0;
static int connect_timeout = 0;
#ifdef HAVE_EDITLINE
#ifdef HAVE_LIBEDIT
static EditLine *el;
static History *myhistory;
static HistEvent ev;
@ -114,7 +115,7 @@ static void sleep_s(int secs) { _sleep_ns(secs, 0); }
static int process_command(esl_handle_t *handle, const char *cmd);
#if defined(HAVE_EDITLINE) || defined(WIN32)
#if defined(HAVE_LIBEDIT) || defined(WIN32)
static void clear_cli(void) {
if (global_profile->batch_mode) return;
putchar('\r');
@ -149,7 +150,7 @@ static void screen_size(int *x, int *y)
}
#if defined(HAVE_EDITLINE) || defined(WIN32)
#if defined(HAVE_LIBEDIT) || defined(WIN32)
/* If a fnkey is configured then process the command */
static unsigned char console_fnkey_pressed(int i)
{
@ -169,7 +170,7 @@ static unsigned char console_fnkey_pressed(int i)
}
#endif
#ifdef HAVE_EDITLINE
#ifdef HAVE_LIBEDIT
static char *prompt(EditLine *e) { return prompt_str; }
static unsigned char console_f1key(EditLine *el, int ch) { return console_fnkey_pressed(1); }
static unsigned char console_f2key(EditLine *el, int ch) { return console_fnkey_pressed(2); }
@ -678,7 +679,20 @@ static void clear_line(void)
static void redisplay(void)
{
#ifdef HAVE_EDITLINE
#ifdef HAVE_LIBEDIT
#ifdef HAVE_DECL_EL_REFRESH
#ifdef HAVE_EL_WSET
/* Current libedit versions don't implement EL_REFRESH in eln.c so
* use the wide version instead. */
el_wset(el, EL_REFRESH);
#else
/* This will work on future libedit versions and versions built
* without wide character support. */
el_set(el, EL_REFRESH);
#endif
#else
/* Old libedit versions don't implement EL_REFRESH at all so use
* our own implementation instead. */
const LineInfo *lf = el_line(el);
const char *c = lf->buffer;
if (global_profile->batch_mode) return;
@ -699,6 +713,7 @@ static void redisplay(void)
done:
return;
#endif
#endif
}
static int output_printf(const char *fmt, ...)
@ -1070,7 +1085,7 @@ static void set_fn_keys(cli_profile_t *profile)
profile->console_fnkeys[11] = "version";
}
#if defined(HAVE_EDITLINE) || defined(WIN32)
#if defined(HAVE_LIBEDIT) || defined(WIN32)
static char* end_of_str(char *s) { return (*s == '\0' ? s : s + strlen(s) - 1); }
static char* _strndup(const char *s, int n)
@ -1102,7 +1117,7 @@ static unsigned char esl_console_complete(const char *buffer, const char *cursor
buf++;
sc++;
}
#ifdef HAVE_EDITLINE
#ifdef HAVE_LIBEDIT
if (!*buf && sc) {
el_deletestr(el, sc);
sc = 0;
@ -1113,7 +1128,7 @@ static unsigned char esl_console_complete(const char *buffer, const char *cursor
sc++;
p--;
}
#ifdef HAVE_EDITLINE
#ifdef HAVE_LIBEDIT
if (sc > 1) {
el_deletestr(el, sc - 1);
*(p + 2) = '\0';
@ -1138,7 +1153,7 @@ static unsigned char esl_console_complete(const char *buffer, const char *cursor
w = p1+ 1;
}
printf("%s\n\n\n", r);
#ifdef HAVE_EDITLINE
#ifdef HAVE_LIBEDIT
el_deletestr(el, len);
el_insertstr(el, w);
#else
@ -1159,9 +1174,9 @@ static unsigned char esl_console_complete(const char *buffer, const char *cursor
esl_safe_free(dup);
return ret;
}
#endif /* if defined(HAVE_EDITLINE) || defined(WIN32) */
#endif /* if defined(HAVE_LIBEDIT) || defined(WIN32) */
#ifdef HAVE_EDITLINE
#ifdef HAVE_LIBEDIT
static unsigned char complete(EditLine *el, int ch)
{
const LineInfo *lf = el_line(el);
@ -1269,7 +1284,7 @@ static void read_config(const char *dft_cfile, const char *cfile) {
}
static void clear_el_buffer(void) {
#ifdef HAVE_EDITLINE
#ifdef HAVE_LIBEDIT
const LineInfo *lf = el_line(el);
int len = (int)(lf->lastchar - lf->buffer);
if (global_profile->batch_mode) return;
@ -1497,7 +1512,11 @@ int main(int argc, char *argv[])
}
bare_prompt_str_len = (int)strlen(bare_prompt_str);
if (feature_level) {
#ifdef HAVE_DECL_EL_PROMPT_ESC
snprintf(prompt_str, sizeof(prompt_str), "\1%s\1%s\1%s\1", prompt_color, bare_prompt_str, input_text_color);
#else
snprintf(prompt_str, sizeof(prompt_str), "%s%s%s", prompt_color, bare_prompt_str, input_text_color);
#endif
} else {
snprintf(prompt_str, sizeof(prompt_str), "%s", bare_prompt_str);
}
@ -1557,9 +1576,13 @@ int main(int argc, char *argv[])
return 0;
}
#ifdef HAVE_EDITLINE
#ifdef HAVE_LIBEDIT
el = el_init(__FILE__, stdin, stdout, stderr);
#ifdef HAVE_DECL_EL_PROMPT_ESC
el_set(el, EL_PROMPT_ESC, &prompt, '\1');
#else
el_set(el, EL_PROMPT, &prompt);
#endif
el_set(el, EL_EDITOR, "emacs");
el_set(el, EL_ADDFN, "f1-key", "F1 KEY PRESS", console_f1key);
@ -1637,13 +1660,13 @@ int main(int argc, char *argv[])
output_printf("%s\n", handle.last_sr_reply);
while (running > 0) {
int r;
#ifdef HAVE_EDITLINE
#ifdef HAVE_LIBEDIT
if (!(global_profile->batch_mode)) {
line = el_gets(el, &count);
} else {
#endif
line = basic_gets(&count);
#ifdef HAVE_EDITLINE
#ifdef HAVE_LIBEDIT
}
#endif
if (count > 1 && !esl_strlen_zero(line)) {
@ -1652,7 +1675,7 @@ int main(int argc, char *argv[])
if ((p = strrchr(cmd, '\r')) || (p = strrchr(cmd, '\n'))) {
*p = '\0';
}
#ifdef HAVE_EDITLINE
#ifdef HAVE_LIBEDIT
history(myhistory, &ev, H_ENTER, line);
#endif
if ((r = process_command(&handle, cmd))) {
@ -1668,7 +1691,7 @@ int main(int argc, char *argv[])
loops = 120;
goto connect;
}
#ifdef HAVE_EDITLINE
#ifdef HAVE_LIBEDIT
done:
history(myhistory, &ev, H_SAVE, hfile);
history_end(myhistory);

@ -0,0 +1,13 @@
/* Define to 1 if you have libedit available */
#undef HAVE_LIBEDIT
/* Define to 1 if you have the declaration `EL_PROMPT_ESC', and to 0
if you don't. */
#undef HAVE_DECL_EL_PROMPT_ESC
/* Define to 1 if you have the declaration `EL_REFRESH', and to 0 if
you don't. */
#undef HAVE_DECL_EL_REFRESH
/* Define to 1 if you have the `el_wset' function. */
#undef HAVE_EL_WSET

@ -1,19 +0,0 @@
cmake_minimum_required(VERSION 2.6)
add_definition(-DSCCSID)
add_definition(-DHAVE_CONFIG_H)
add_definition(-DPIC)
INCLUDE_DIRECTORIES(include/ ./ src/)
SET ( libedit_SRCS src/filecomplete.c src/key.c src/parse.h src/refresh.c src/sig.h src/tty.c src/el.c src/filecomplete.h src/key.h src/prompt.c src/refresh.h src/strlcat.c src/tty.h src/el.h src/hist.c src/prompt.h src/search.c src/strlcpy.c src/unvis.c src/chared.c src/el_term.h src/hist.h src/map.c src/read.c src/search.h src/sys.h src/vi.c src/chared.h src/emacs.c src/histedit.h src/map.h src/read.h src/term.c src/vis.c src/common.c src/fgetln.c src/history.c src/parse.c src/readline.c src/sig.c src/tokenizer.c src/vis.h)
ADD_LIBRARY(libedit STATIC ${libedit_SRCS})

@ -1,23 +0,0 @@
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the University nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.

@ -1,219 +0,0 @@
2007-08-31 Jess Thrysoee
* version-info: 0:26:0
* libedit.pc.in,Makefile.am,configure.ac,patches/extra_dist_list.sh:
Added pkg-config support for libedit. Patch by Masatake YAMATO.
2007-08-13 Jess Thrysoee
* version-info: 0:25:0
* all: sync with upstream source.
2007-03-02 Jess Thrysoee
* version-info: 0:24:0
* all: sync with upstream source.
2006-10-22 Jess Thrysoee
* version-info: 0:23:0
* src/shlib_version: Upstream bumped minor version from 9 to 10.
* all: sync with upstream source. More readline functions.
2006-10-22 Jess Thrysoee
* version-info: 0:22:0
* all: sync with upstream source.
2006-08-29 Jess Thrysoee
* version-info: 0:21:0
* all: License cleanup. All 4-clause advertising BSD licenses has been
changed to the 3-clause version by upstream.
* src/fgetln.c: use src/tools/compat/fgetln.c instead of
othersrc/libexec/tnftpd/libnetbsd/fgetln.c
2006-08-16 Jess Thrysoee
* version-info: 0:20:0
* all: sync with upstream source.
2006-06-03 Jess Thrysoee
* version-info: 0:19:0
* COPYING: added global license file
* all: sync with upstream source.
2006-02-13 Jess Thrysoee
* version-info: 0:18:0
* src/readline.c: Partial rl_getc_function support, patch by Kjeld Borch
Egevang.
* src/readline.c: Make write_history and read_history returncode readline
compatible. Upstream patch.
2006-01-03 Jess Thrysoee
* version-info: 0:17:0
* patches/cvs_export.sh: strlcat.c and strlcpy.c was moved to
src/common/lib/libc/string in the upstream cvs repository.
* all: sync with upstream source.
2005-10-22 Jess Thrysoee
* version-info: 0:16:0
* patches/*.patch, configure.ac: define SCCSID, undef LIBC_SCCS. Remove
fourteen cosmetic patches.
* all: sync with upstream source.
2005-09-11 Jess Thrysoee
* version-info: 0:15:0
* src/Makefile.am: fix typo that meant generated files were distributes,
and make generated file targets dependent on the the 'makelist' input
files.
* all: sync with upstream source. This is just a manpage update
2005-08-28 Jess Thrysoee
* version-info: 0:14:0
* src/sys.h: include config.h to avoid "redefinition of
`u_int32_t'". Patch by Norihiko Murase.
* src/search.c: explicitly include sys/types.h, because regex.h on
FreeBSD needs it and does not include it itself. Patch by Norihiko Murase.
* acinclude.m4: added EL_GETPW_R_DRAFT test and use AC_TRY_LINK instead
of AC_TRY_COMPILE. Suggested by Norihiko Murase.
* all: sync with upstream source.
2005-08-16 Jess Thrysoee
* version-info: 0:13:0
* all: sync with upstream source.
2005-08-05 Jess Thrysoee
* version-info: 0:12:0
* all: sync with upstream source.
2005-07-24 Jess Thrysoee
* version-info: 0:11:0
* histedit.h, histedit.c, readline.c, editline/readline.h: From
upstream; added remove_history().
2005-07-07 Jess Thrysoee
* version-info: 0:10:0
* history.c, key.c: From upstream source; Fix memory leaks found by
valgrind.
2005-06-28 Jess Thrysoee
* version-info: 0:9:0
* src/readline.c: getpwent_r is not POSIX, always use getpwent.
Reported by Gerrit P. Haase.
* src/Makefile.am: Added libtool -no-undefined. This is needed on Cygwin
to get a shared editline library. Should not affect other platforms.
Suggested by Gerrit P. Haase.
2005-06-15 Jess Thrysoee
* version-info: 0:8:0
* all: sync with upstream source.
2005-06-01 Jess Thrysoee
* version-info: 0:7:0
* all: sync with upstream source.
* src/readline.c, src/filecomplete.c: Solaris use POSIX draft versions
of getpwent_r, getpwnam_r and getpwuid_r which return 'struct passwd *'.
Define HAVE_GETPW_R_POSIX if these functions are (non draft) POSIX
compatible. Patch by Julien Torrès.
2005-05-28 Jess Thrysoee
* version-info: 0:6:0
* all: sync with upstream source.
2005-03-11 Jess Thrysoee
* version-info: 0:5:0
* all: sync with upstream source.
2004-12-07 Jess Thrysoee
* version-info: 0:4:0
* src/readline.c: d_namlen (in struct dirent) is not portable, always
use strlen. Patch by Scott Rankin.
2004-11-27 Jess Thrysoee
* version-info: 0:3:0
* src/history.c: bug #26785 fixed upstream, removed local patch.
2004-11-06 Jess Thrysoee
* version-info: 0:2:0
* all: sync with upstream source.
* doc/Makefile.am: If mdoc2man fails, remove empty file. Patch by
Darren Tucker.
2004-10-14 Jess Thrysoee
* version-info: 0:1:0
* doc/Makefile.am: 'make install' twice fails. Remove old links before
trying to link the man pages. Patch by Rick Richardson.
2004-09-28 Jess Thrysoee
* version-info: 0:0:0
* acinclude.m4 configure.ac src/Makefile.am: Adhere to
LibTools library interface versions recommendation.
http://www.gnu.org/software/libtool/manual.html#SEC32
* doc/Makefile.am: name all manpage links as el_* (e.g. el_history.3)
to avoid conflicts.
2004-09-08 Jess Thrysoee
* all: Initial package.

@ -1,229 +0,0 @@
Copyright (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.

@ -1,40 +0,0 @@
AUTOMAKE_OPTIONS = foreign
SUBDIRS = src examples doc
EXTRA_DIST = libedit.pc.in
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libedit.pc
## GENERATED BY SCRIPT - DO NOT EDIT BELOW
EXTRA_DIST += patches/README \
patches/00-vis.h.patch \
patches/01-term.c.patch \
patches/02-el_term.h.patch \
patches/03-unvis.c.patch \
patches/04-strlcpy.c.patch \
patches/05-strlcat.c.patch \
patches/06-readline.c.patch \
patches/07-sys.h.patch \
patches/08-el.h.patch \
patches/09-search.c.patch \
patches/10-readline.h.patch \
patches/11-el.c.patch \
patches/12-history.c.patch \
patches/13-vis.c.patch \
patches/14-fgetln.c.patch \
patches/15-filecomplete.c.patch \
patches/16-tc1.c.patch \
patches/17-editline.3.roff.patch \
patches/18-editrc.5.roff.patch \
patches/cvs_export.sh \
patches/patches_make.sh \
patches/patches_apply.sh \
patches/patches_check.sh \
patches/extra_dist_list.sh \
patches/update_version.sh \
patches/update_dist.sh \
patches/timestamp.cvsexport

@ -1 +0,0 @@
Thanks to the NetBSD Project maintainers of libedit!

@ -1,67 +0,0 @@
dnl
dnl read lib version from file (and trim trailing newline)
dnl
define([EL_RELEASE], [patsubst(esyscmd([. src/shlib_version; echo $major.$minor]), [
])])
dnl
dnl read cvsexport timestamp from file (and trim trailing newline)
dnl
dnl define([EL_TIMESTAMP_CVSEXPORT], [patsubst(esyscmd([cat patches/timestamp.cvsexport]), [
define([EL_TIMESTAMP_CVSEXPORT], [patsubst(esyscmd([date +"%Y%m%d"]), [
])])
dnl
dnl NetBSD use the -mdoc macro package for manpages, but e.g.
dnl AIX and Solaris only support the -man package.
dnl
AC_DEFUN([EL_MANTYPE],
[
MANTYPE=
TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb"
AC_PATH_PROGS(NROFF, nroff awf, /bin/false, $TestPath)
if ${NROFF} -mdoc ${srcdir}/doc/editrc.5.roff >/dev/null 2>&1; then
MANTYPE=mdoc
fi
AC_SUBST(MANTYPE)
])
dnl
dnl Check if getpwnam_r and getpwuid_r are POSIX.1 compatible
dnl POSIX draft version returns 'struct passwd *' (used on Solaris)
dnl NOTE: getpwent_r is not POSIX so we always use getpwent
dnl
AC_DEFUN([EL_GETPW_R_POSIX],
[
AC_MSG_CHECKING([whether getpwnam_r and getpwuid_r are posix like])
# The prototype for the POSIX version is:
# int getpwnam_r(char *, struct passwd *, char *, size_t, struct passwd **)
# int getpwuid_r(uid_t, struct passwd *, char *, size_t, struct passwd **);
AC_TRY_LINK([#include <stdlib.h>
#include <sys/types.h>
#include <pwd.h>],
[getpwnam_r(NULL, NULL, NULL, (size_t)0, NULL);
getpwuid_r((uid_t)0, NULL, NULL, (size_t)0, NULL);],
[AC_DEFINE([HAVE_GETPW_R_POSIX], 1, [Define to 1 if you have getpwnam_r and getpwuid_r that are POSIX.1 compatible.])
AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)])
])
AC_DEFUN([EL_GETPW_R_DRAFT],
[
AC_MSG_CHECKING([whether getpwnam_r and getpwuid_r are posix _draft_ like])
# The prototype for the POSIX draft version is:
# struct passwd *getpwuid_r(uid_t, struct passwd *, char *, int);
# struct passwd *getpwnam_r(char *, struct passwd *, char *, int);
AC_TRY_LINK([#include <stdlib.h>
#include <sys/types.h>
#include <pwd.h>],
[getpwnam_r(NULL, NULL, NULL, (size_t)0);
getpwuid_r((uid_t)0, NULL, NULL, (size_t)0);],
[AC_DEFINE([HAVE_GETPW_R_DRAFT], 1, [Define to 1 if you have getpwnam_r and getpwuid_r that are draft POSIX.1 versions.])
AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)])
])

@ -1,89 +0,0 @@
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_INIT(libedit, [EL_RELEASE],, libedit-[EL_TIMESTAMP_CVSEXPORT])
AC_CONFIG_SRCDIR([src/strlcat.c])
AC_CONFIG_HEADERS([config.h])
CFLAGS="$CFLAGS $CONFIGURE_CFLAGS"
CXXFLAGS="$CXXFLAGS $CONFIGURE_CXXFLAGS"
LDFLAGS="$LDFLAGS $CONFIGURE_LDFLAGS"
AM_INIT_AUTOMAKE
AC_PROG_LIBTOOL
# libtool -version-info
AC_SUBST(LT_VERSION, [0:26:0])
# AC_PROG_LIBTOOL runs AC_CANONICAL_HOST
case $host in
*-sun-*) AC_DEFINE([_SUNOS], [], [Solaris's term.h does horrid things.]);;
esac
# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
AC_PROG_LN_S
AC_PROG_AWK
EL_MANTYPE
AC_CHECK_LIB(tinfo, tgetent, [have_libtinfo="yes"], [have_libtinfo="no"])
if test "$have_libtinfo" == "yes" ; then
TINFO_LIBS="-ltinfo"
else
TINFO_LIBS=""
AC_CHECK_LIB(ncurses, tgetent,,
[AC_CHECK_LIB(curses, tgetent,,
[AC_MSG_ERROR([libtermcap, libcurses or libncurses are required!])] )] )
fi
AC_SUBST(TINFO_LIBS)
# Checks for header files.
AC_FUNC_ALLOCA
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS([fcntl.h limits.h malloc.h stdlib.h string.h sys/ioctl.h sys/param.h unistd.h curses.h ncurses.h sys/cdefs.h])
AC_CHECK_HEADER([termios.h], [], [AC_MSG_ERROR([termios.h is required!])],[])
## include curses.h to prevent "Present But Cannot Be Compiled"
AC_CHECK_HEADERS([term.h],,,
[[#if HAVE_CURSES_H
# include <curses.h>
#elif HAVE_NCURSES_H
# include <ncurses.h>
#endif
]])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_CHECK_TYPES([u_int32_t])
# Checks for library functions.
AC_FUNC_CLOSEDIR_VOID
AC_FUNC_FORK
AC_PROG_GCC_TRADITIONAL
## _AIX is offended by rpl_malloc and rpl_realloc
#AC_FUNC_MALLOC
#AC_FUNC_REALLOC
AC_TYPE_SIGNAL
AC_FUNC_STAT
AC_CHECK_FUNCS([endpwent isascii memchr memset re_comp regcomp strcasecmp strchr strlcat strlcpy strcspn strdup strerror strrchr strstr strtol issetugid])
EL_GETPW_R_POSIX
EL_GETPW_R_DRAFT
AH_BOTTOM([
#include <sys.h>
#define SCCSID
#undef LIBC_SCCS
])
AC_CONFIG_FILES([Makefile
libedit.pc
src/Makefile
doc/Makefile
examples/Makefile])
AC_OUTPUT

@ -1,4 +0,0 @@
#! /bin/sh
srcpath=$(dirname $0 2>/dev/null ) || srcpath="."
$srcpath/configure "$@" --disable-shared --with-pic

@ -1,31 +0,0 @@
EL_MANS = editline.3 editrc.5
man_MANS = $(EL_MANS)
EL_MAN_LINKS = el_init.3 el_end.3 el_reset.3 el_gets.3 el_getc.3 \
el_push.3 el_parse.3 el_set.3 el_get.3 el_source.3 \
el_resize.3 el_line.3 el_insertstr.3 el_deletestr.3 \
el_history_init.3 el_history_end.3 el_history.3 el_tok_init.3 \
el_tok_end.3 el_tok_reset.3 el_tok_line.3 el_tok_str.3
install-data-hook: $(EL_MAN_LINKS)
$(EL_MAN_LINKS):
(cd $(DESTDIR)$(man3dir) && rm -f $@ && $(LN_S) editline.3 $@)
$(EL_MANS):
if test "$(MANTYPE)" = "mdoc"; then\
cp $(srcdir)/$@.roff $@;\
else\
$(AWK) -f $(srcdir)/mdoc2man.awk $(srcdir)/$@.roff > $@ || rm -f $@;\
fi;
uninstall-local:
(cd $(DESTDIR)$(man3dir) && rm -f $(EL_MAN_LINKS))
CLEANFILES = $(EL_MANS)
EXTRA_DIST = editline.3.roff editrc.5.roff mdoc2man.awk
changelog.txt: ../ChangeLog
@sed 's/@/ (at)/g;s/</\&lt;/g;s/>/\&gt;/g;s/è/\&egrave;/g' $(srcdir)/$< > $@;

<
@ -1,826 +0,0 @@
.\" $NetBSD: editline.3,v 1.55 2007/01/12 16:31:13 christos Exp $
.\"
.\" Copyright (c) 1997-2003 The NetBSD Foundation, Inc.
.\" All rights reserved.
.\"
.\" This file was contributed to The NetBSD Foundation by Luke Mewburn.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. Neither the name of The NetBSD Foundation nor the names of its
.\" contributors may be used to endorse or promote products derived
.\" from this software without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd January 12, 2007
.Os
.Dt EDITLINE 3
.Sh NAME
.Nm editline ,
.Nm el_init ,
.Nm el_end ,
.Nm el_reset ,
.Nm el_gets ,
.Nm el_getc ,
.Nm el_push ,
.Nm el_parse ,
.Nm el_set ,
.Nm el_get ,
.Nm el_source ,
.Nm el_resize ,
.Nm el_line ,
.Nm el_insertstr ,
.Nm el_deletestr ,
.Nm history_init ,
.Nm history_end ,
.Nm history ,
.Nm tok_init ,
.Nm tok_end ,
.Nm tok_reset ,
.Nm tok_line ,
.Nm tok_str
.Nd line editor, history and tokenization functions
.Sh LIBRARY
.Lb libedit
.Sh SYNOPSIS
.In histedit.h
.Ft EditLine *
.Fn el_init "const char *prog" "FILE *fin" "FILE *fout" "FILE *ferr"
.Ft void
.Fn el_end "EditLine *e"
.Ft void
.Fn el_reset "EditLine *e"
.Ft const char *
.Fn el_gets "EditLine *e" "int *count"
.Ft int
.Fn el_getc "EditLine *e" "char *ch"
.Ft void
.Fn el_push "EditLine *e" "const char *str"
.Ft int
.Fn el_parse "EditLine *e" "int argc" "const char *argv[]"
.Ft int
.Fn el_set "EditLine *e" "int op" "..."
.Ft int
.Fn el_get "EditLine *e" "int op" "..."
.Ft int
.Fn el_source "EditLine *e" "const char *file"
.Ft void
.Fn el_resize "EditLine *e"
.Ft const LineInfo *
.Fn el_line "EditLine *e"
.Ft int
.Fn el_insertstr "EditLine *e" "const char *str"
.Ft void
.Fn el_deletestr "EditLine *e" "int count"
.Ft History *
.Fn history_init
.Ft void
.Fn history_end "History *h"
.Ft int
.Fn history "History *h" "HistEvent *ev" "int op" "..."
.Ft Tokenizer *
.Fn tok_init "const char *IFS"
.Ft void
.Fn tok_end "Tokenizer *t"
.Ft void
.Fn tok_reset "Tokenizer *t"
.Ft int
.Fn tok_line "Tokenizer *t" "const LineInfo *li" "int *argc" "const char **argv[]" "int *cursorc" "int *cursoro"
.Ft int
.Fn tok_str "Tokenizer *t" "const char *str" "int *argc" "const char **argv[]"
.Sh DESCRIPTION
The
.Nm
library provides generic line editing, history and tokenization functions,
similar to those found in
.Xr sh 1 .
.Pp
These functions are available in the
.Nm libedit
library (which needs the
.Nm libcurses
library).
Programs should be linked with
.Fl ledit
.Fl lcurses .
.Sh LINE EDITING FUNCTIONS
The line editing functions use a common data structure,
.Fa EditLine ,
which is created by
.Fn el_init
and freed by
.Fn el_end .
.Pp
The following functions are available:
.Bl -tag -width 4n
.It Fn el_init
Initialise the line editor, and return a data structure
to be used by all other line editing functions.
.Fa prog
is the name of the invoking program, used when reading the
.Xr editrc 5
file to determine which settings to use.
.Fa fin ,
.Fa fout
and
.Fa ferr
are the input, output, and error streams (respectively) to use.
In this documentation, references to
.Dq the tty
are actually to this input/output stream combination.
.It Fn el_end
Clean up and finish with
.Fa e ,
assumed to have been created with
.Fn el_init .
.It Fn el_reset
Reset the tty and the parser.
This should be called after an error which may have upset the tty's
state.
.It Fn el_gets
Read a line from the tty.
.Fa count
is modified to contain the number of characters read.
Returns the line read if successful, or
.Dv NULL
if no characters were read or if an error occurred.
.It Fn el_getc
Read a character from the tty.
.Fa ch
is modified to contain the character read.
Returns the number of characters read if successful, \-1 otherwise.
.It Fn el_push
Pushes
.Fa str
back onto the input stream.
This is used by the macro expansion mechanism.