mirror of
https://github.com/troglobit/editline.git
synced 2025-09-17 17:58:07 +08:00
Compare commits
17 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
2a3575495a | ||
![]() |
8aa36184e6 | ||
![]() |
0a8f2ef420 | ||
![]() |
8078ff69cc | ||
![]() |
6db7c7d440 | ||
![]() |
e02339c3ae | ||
![]() |
f66e8cc151 | ||
![]() |
782ce4a7a9 | ||
![]() |
059d97d7a9 | ||
![]() |
edc38768ff | ||
![]() |
59a2db7217 | ||
![]() |
ba005dc0d0 | ||
![]() |
a1002f6984 | ||
![]() |
7a0c292a82 | ||
![]() |
91398ceb34 | ||
![]() |
3dbeaa0637 | ||
![]() |
2f08585884 |
45
.gitignore
vendored
45
.gitignore
vendored
@@ -1,25 +1,24 @@
|
|||||||
Makefile
|
|
||||||
archive
|
|
||||||
autom4te.cache
|
|
||||||
config.h
|
|
||||||
config.log
|
|
||||||
config.status
|
|
||||||
libtool
|
|
||||||
examples/.deps
|
|
||||||
examples/Makefile
|
|
||||||
examples/cli
|
|
||||||
examples/cli.o
|
|
||||||
examples/testit
|
|
||||||
examples/testit.o
|
|
||||||
include/Makefile
|
|
||||||
man/Makefile
|
|
||||||
man/Makefile
|
|
||||||
src/.deps
|
|
||||||
src/Makefile
|
|
||||||
src/*.o
|
|
||||||
src/*.lo
|
|
||||||
src/libeditline.a
|
|
||||||
src/libeditline.la
|
|
||||||
stamp-h1
|
|
||||||
*~
|
*~
|
||||||
*/.libs/
|
*/.libs/
|
||||||
|
*.lo
|
||||||
|
*.o
|
||||||
|
.deps
|
||||||
|
Makefile
|
||||||
|
Makefile.in
|
||||||
|
aclocal.m4
|
||||||
|
archive
|
||||||
|
autom4te.cache
|
||||||
|
compile
|
||||||
|
config.guess
|
||||||
|
config.h
|
||||||
|
config.h.in
|
||||||
|
config.log
|
||||||
|
config.status
|
||||||
|
config.sub
|
||||||
|
configure
|
||||||
|
depcomp
|
||||||
|
install-sh
|
||||||
|
libtool
|
||||||
|
ltmain.sh
|
||||||
|
missing
|
||||||
|
stamp-h1
|
||||||
|
@@ -5,6 +5,11 @@ language: c
|
|||||||
# We don't need to install packages, use dockerized build, quicker
|
# We don't need to install packages, use dockerized build, quicker
|
||||||
sudo: false
|
sudo: false
|
||||||
|
|
||||||
|
# Test build with both GCC and Clang (LLVM)
|
||||||
|
compiler:
|
||||||
|
- gcc
|
||||||
|
- clang
|
||||||
|
|
||||||
env:
|
env:
|
||||||
global:
|
global:
|
||||||
# The next declaration is the encrypted COVERITY_SCAN_TOKEN, created
|
# The next declaration is the encrypted COVERITY_SCAN_TOKEN, created
|
||||||
@@ -19,7 +24,7 @@ addons:
|
|||||||
notification_email: troglobit@gmail.com
|
notification_email: troglobit@gmail.com
|
||||||
build_command_prepend: "./autogen.sh && ./configure --enable-sigstop --enable-terminal-bell"
|
build_command_prepend: "./autogen.sh && ./configure --enable-sigstop --enable-terminal-bell"
|
||||||
build_command: "make -j5"
|
build_command: "make -j5"
|
||||||
branch_pattern: master
|
branch_pattern: dev
|
||||||
|
|
||||||
# We don't store generated files (configure and Makefile) in GIT,
|
# We don't store generated files (configure and Makefile) in GIT,
|
||||||
# so we must customize the default build script to run ./autogen.sh
|
# so we must customize the default build script to run ./autogen.sh
|
||||||
|
25
ChangeLog.md
25
ChangeLog.md
@@ -3,6 +3,24 @@ Change Log
|
|||||||
|
|
||||||
All notable changes to the project are documented in this file.
|
All notable changes to the project are documented in this file.
|
||||||
|
|
||||||
|
|
||||||
|
[1.15.2][] - 2016-06-06
|
||||||
|
-----------------------
|
||||||
|
|
||||||
|
Bug fixes and minor feature creep in `pkg-config` support.
|
||||||
|
|
||||||
|
### Changes
|
||||||
|
- Prevent mangling of symbols when linking with C++. Patch courtesy of
|
||||||
|
Jakub Pawlowski
|
||||||
|
- Add `libeditline.pc` for `pkg-config`
|
||||||
|
|
||||||
|
### Fixes
|
||||||
|
- Do not assume a termcap library exists, check for `tgetent()` in
|
||||||
|
curses, ncurses, tinfo and termcap libraries
|
||||||
|
- Call `tty_flush()` when user calls `rl_forced_update_display()`
|
||||||
|
to prevent screen becoming garbled. Patch by Jakub Pawlowski
|
||||||
|
|
||||||
|
|
||||||
[1.15.1][] - 2015-11-16
|
[1.15.1][] - 2015-11-16
|
||||||
-----------------------
|
-----------------------
|
||||||
|
|
||||||
@@ -11,7 +29,7 @@ Bug fixes only.
|
|||||||
### Changes
|
### Changes
|
||||||
- Update README with origin of this version of editline
|
- Update README with origin of this version of editline
|
||||||
|
|
||||||
##¤ Fixes
|
### Fixes
|
||||||
- Fix build system, don't force automake v1.11, require at least v1.11
|
- Fix build system, don't force automake v1.11, require at least v1.11
|
||||||
- Fix build problem with examples using `--enable-termcap`
|
- Fix build problem with examples using `--enable-termcap`
|
||||||
|
|
||||||
@@ -136,8 +154,9 @@ Adaptations to Debian editline package.
|
|||||||
- First version, forked from Minix current 2008-06-06
|
- First version, forked from Minix current 2008-06-06
|
||||||
|
|
||||||
|
|
||||||
[UNRELEASED]: https://github.com/troglobit/finit/compare/1.15.0...HEAD
|
[UNRELEASED]: https://github.com/troglobit/finit/compare/1.15.1...HEAD
|
||||||
[1.15.0]: https://github.com/troglobit/finit/compare/1.15.0...1.15.1
|
[1.15.2]: https://github.com/troglobit/finit/compare/1.15.1...1.15.2
|
||||||
|
[1.15.1]: https://github.com/troglobit/finit/compare/1.15.0...1.15.1
|
||||||
[1.15.0]: https://github.com/troglobit/finit/compare/1.14.2...1.15.0
|
[1.15.0]: https://github.com/troglobit/finit/compare/1.14.2...1.15.0
|
||||||
[1.14.2]: https://github.com/troglobit/finit/compare/1.14.1...1.14.2
|
[1.14.2]: https://github.com/troglobit/finit/compare/1.14.1...1.14.2
|
||||||
[1.14.1]: https://github.com/troglobit/finit/compare/1.14.0...1.14.1
|
[1.14.1]: https://github.com/troglobit/finit/compare/1.14.0...1.14.1
|
||||||
|
42
Makefile.am
42
Makefile.am
@@ -1,4 +1,38 @@
|
|||||||
AUTOMAKE_OPTIONS = foreign
|
pkgconfigdir = $(libdir)/pkgconfig
|
||||||
doc_DATA = README LICENSE CHANGELOG
|
pkgconfig_DATA = libeditline.pc
|
||||||
EXTRA_DIST = LICENSE CHANGELOG INSTALL
|
doc_DATA = README LICENSE CHANGELOG
|
||||||
SUBDIRS = src include man examples
|
EXTRA_DIST = LICENSE CHANGELOG INSTALL
|
||||||
|
SUBDIRS = src include man examples
|
||||||
|
|
||||||
|
## Generate MD5 checksum file
|
||||||
|
MD5 = md5sum
|
||||||
|
md5-dist:
|
||||||
|
@for file in $(DIST_ARCHIVES); do \
|
||||||
|
$(MD5) $$file > $$file.md5; \
|
||||||
|
done
|
||||||
|
|
||||||
|
## Check if tagged in git
|
||||||
|
release-hook:
|
||||||
|
if [ ! `git tag | grep $(PACKAGE_VERSION)` ]; then \
|
||||||
|
echo; \
|
||||||
|
printf "\e[1m\e[41mCannot find release tag $(PACKAGE_VERSION)\e[0m\n"; \
|
||||||
|
printf "\e[1m\e[5mDo release anyway?\e[0m "; read yorn; \
|
||||||
|
if [ "$$yorn" != "y" -a "$$yorn" != "Y" ]; then \
|
||||||
|
printf "OK, aborting release.\n"; \
|
||||||
|
exit 1; \
|
||||||
|
fi; \
|
||||||
|
echo; \
|
||||||
|
else \
|
||||||
|
echo; \
|
||||||
|
printf "\e[1m\e[42mFound GIT release tag $(PACKAGE_VERSION)\e[0m\n"; \
|
||||||
|
printf "\e[1m\e[44m>>Remember to push tags!\e[0m\n"; \
|
||||||
|
echo; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
## Target to run when building a release
|
||||||
|
release: dist release-hook md5-dist
|
||||||
|
@for file in $(DIST_ARCHIVES); do \
|
||||||
|
printf "$$file \tDistribution tarball\n"; \
|
||||||
|
printf "$$file.md5\t"; cat $$file.md5 | cut -f1 -d' '; \
|
||||||
|
mv $$file* ../; \
|
||||||
|
done
|
||||||
|
@@ -147,8 +147,8 @@ This version of the editline library was forked from the [Minix 3][]
|
|||||||
source tree and is *not* related to the similarily named NetBSD version
|
source tree and is *not* related to the similarily named NetBSD version
|
||||||
that [Jess Thrysøe][jess] disitributes to the world outside BSD. The
|
that [Jess Thrysøe][jess] disitributes to the world outside BSD. The
|
||||||
libraries have much in common, but the latter is heavily refactored and
|
libraries have much in common, but the latter is heavily refactored and
|
||||||
also relies on ncurses, whereas this library only uses termios from the
|
also relies on libtermcap (usually supplied by ncurses), whereas this
|
||||||
standard C library.
|
library only uses termios from the standard C library.
|
||||||
|
|
||||||
Patches and bug fixes from the following forks, all based on the
|
Patches and bug fixes from the following forks, all based on the
|
||||||
original comp.sources.unix posting, have been merged:
|
original comp.sources.unix posting, have been merged:
|
||||||
|
34
configure.ac
34
configure.ac
@@ -1,26 +1,11 @@
|
|||||||
# Minix libeditline -*- Autoconf -*-
|
AC_INIT(editline, 1.15.2, https://github.com/troglobit/editline/issues)
|
||||||
#
|
AM_INIT_AUTOMAKE([1.11 foreign no-dist-gzip dist-xz])
|
||||||
# Copyright (c) 2008-2013 Joachim Nilsson <troglobit()gmail!com>
|
|
||||||
#
|
|
||||||
# Process this file with autoconf to produce a configure script.
|
|
||||||
#
|
|
||||||
# This file is free software; as a special exception the author gives
|
|
||||||
# unlimited permission to copy and/or distribute it, with or without
|
|
||||||
# modifications, as long as this notice is preserved.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful, but
|
|
||||||
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
|
|
||||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
|
|
||||||
AC_PREREQ(2.61)
|
|
||||||
AC_INIT(editline, 1.15.1, https://github.com/troglobit/editline/issues)
|
|
||||||
AM_INIT_AUTOMAKE([1.11 no-dist-gzip dist-xz])
|
|
||||||
AM_SILENT_RULES([yes])
|
AM_SILENT_RULES([yes])
|
||||||
|
|
||||||
AC_CONFIG_MACRO_DIR([m4])
|
AC_CONFIG_MACRO_DIR([m4])
|
||||||
AC_CONFIG_SRCDIR([src/editline.c])
|
AC_CONFIG_SRCDIR([src/editline.c])
|
||||||
AC_CONFIG_HEADER([config.h])
|
AC_CONFIG_HEADER([config.h])
|
||||||
AC_CONFIG_FILES([Makefile src/Makefile include/Makefile man/Makefile examples/Makefile])
|
AC_CONFIG_FILES([Makefile libeditline.pc src/Makefile include/Makefile man/Makefile examples/Makefile])
|
||||||
|
|
||||||
# Checks for programs.
|
# Checks for programs.
|
||||||
AC_PROG_CC
|
AC_PROG_CC
|
||||||
@@ -83,8 +68,15 @@ AC_ARG_ENABLE(termcap,
|
|||||||
[AS_HELP_STRING([--enable-termcap], [Use termcap library to query terminal size.])],
|
[AS_HELP_STRING([--enable-termcap], [Use termcap library to query terminal size.])],
|
||||||
AC_DEFINE([CONFIG_USE_TERMCAP], 1, [Define to use the termcap library for terminal size.]))
|
AC_DEFINE([CONFIG_USE_TERMCAP], 1, [Define to use the termcap library for terminal size.]))
|
||||||
|
|
||||||
AM_CONDITIONAL([USE_LIBTERMCAP], [test "$enable_termcap" != no])
|
# Check for a termcap compatible library if enabled
|
||||||
AM_CFLAGS="-std=gnu99 $inline_cflags -W -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration $nopointersign_cflags -Wshadow -Wcast-qual"
|
AS_IF([test "$enable_termcap" != no],
|
||||||
AC_SUBST(AM_CFLAGS)
|
AC_CHECK_LIB(termcap, tgetent, , [
|
||||||
|
AC_CHECK_LIB(tinfo, tgetent, , [
|
||||||
|
AC_CHECK_LIB(curses, tgetent, , [
|
||||||
|
AC_CHECK_LIB(ncurses, tgetent, , [
|
||||||
|
AC_MSG_ERROR([Cannot find a termcap capable library, try installing Ncurses.])])
|
||||||
|
])
|
||||||
|
])
|
||||||
|
]))
|
||||||
|
|
||||||
AC_OUTPUT
|
AC_OUTPUT
|
||||||
|
3
examples/.gitignore
vendored
Normal file
3
examples/.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
*.o
|
||||||
|
cli
|
||||||
|
testit
|
@@ -1,11 +1,4 @@
|
|||||||
AUTOMAKE_OPTIONS = foreign
|
|
||||||
|
|
||||||
noinst_PROGRAMS = testit cli
|
noinst_PROGRAMS = testit cli
|
||||||
LDADD = $(top_builddir)/src/libeditline.la
|
LDADD = $(top_builddir)/src/libeditline.la
|
||||||
AM_CFLAGS = -I$(top_srcdir)/src -I$(top_srcdir)/include
|
AM_CFLAGS = -I$(top_srcdir)/src -I$(top_srcdir)/include
|
||||||
AM_LDFLAGS = -static
|
AM_LDFLAGS = -static
|
||||||
|
|
||||||
if USE_LIBTERMCAP
|
|
||||||
LDADD += -ltermcap
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
@@ -1,4 +1,2 @@
|
|||||||
AUTOMAKE_OPTIONS = foreign
|
library_includedir = $(includedir)
|
||||||
|
|
||||||
library_includedir=$(includedir)
|
|
||||||
library_include_HEADERS = editline.h
|
library_include_HEADERS = editline.h
|
||||||
|
@@ -29,6 +29,10 @@
|
|||||||
#define ISMETA(x) ((x) & 0x80)
|
#define ISMETA(x) ((x) & 0x80)
|
||||||
#define UNMETA(x) ((x) & 0x7F)
|
#define UNMETA(x) ((x) & 0x7F)
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Command status codes. */
|
/* Command status codes. */
|
||||||
typedef enum {
|
typedef enum {
|
||||||
CSdone = 0, /* OK */
|
CSdone = 0, /* OK */
|
||||||
@@ -100,4 +104,8 @@ void rl_deprep_terminal(void);
|
|||||||
|
|
||||||
int rl_getc(void);
|
int rl_getc(void);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* __EDITLINE_H__ */
|
#endif /* __EDITLINE_H__ */
|
||||||
|
12
libeditline.pc.in
Normal file
12
libeditline.pc.in
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
prefix=@prefix@
|
||||||
|
exec_prefix=@exec_prefix@
|
||||||
|
libdir=@libdir@
|
||||||
|
includedir=@includedir@
|
||||||
|
|
||||||
|
Name: @PACKAGE@
|
||||||
|
Description: A small line editing library without termcap/curses
|
||||||
|
Version: @VERSION@
|
||||||
|
Requires:
|
||||||
|
Libs: -L${libdir} -leditline
|
||||||
|
Cflags: -I${includedir}
|
||||||
|
|
1
m4/.gitignore
vendored
Normal file
1
m4/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
*.m4
|
2
src/.gitignore
vendored
Normal file
2
src/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
libeditline.a
|
||||||
|
libeditline.la
|
@@ -1,3 +1,6 @@
|
|||||||
AUTOMAKE_OPTIONS = foreign
|
|
||||||
lib_LTLIBRARIES = libeditline.la
|
lib_LTLIBRARIES = libeditline.la
|
||||||
libeditline_la_SOURCES = editline.c editline.h complete.c sysunix.c unix.h
|
libeditline_la_SOURCES = editline.c editline.h complete.c sysunix.c unix.h
|
||||||
|
libeditline_la_CFLAGS = -std=gnu99
|
||||||
|
libeditline_la_CFLAGS += -W -Wall -Wundef -Wunused -Wstrict-prototypes
|
||||||
|
libeditline_la_CFLAGS += -Werror-implicit-function-declaration -Wshadow -Wcast-qual
|
||||||
|
libeditline_la_LDFLAGS = $(AM_LDFLAGS) -version-info 0:0:0
|
||||||
|
@@ -277,7 +277,6 @@ int rl_list_possib(char *token, char ***av)
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Local Variables:
|
* Local Variables:
|
||||||
* version-control: t
|
|
||||||
* indent-tabs-mode: t
|
* indent-tabs-mode: t
|
||||||
* c-file-style: "ellemtel"
|
* c-file-style: "ellemtel"
|
||||||
* c-basic-offset: 4
|
* c-basic-offset: 4
|
||||||
|
@@ -1170,6 +1170,7 @@ void rl_clear_message(void)
|
|||||||
void rl_forced_update_display()
|
void rl_forced_update_display()
|
||||||
{
|
{
|
||||||
redisplay();
|
redisplay();
|
||||||
|
tty_flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
char *readline(const char *prompt)
|
char *readline(const char *prompt)
|
||||||
@@ -1734,7 +1735,6 @@ el_status_t el_bind_key_in_metamap(int key, el_keymap_func_t function)
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Local Variables:
|
* Local Variables:
|
||||||
* version-control: t
|
|
||||||
* indent-tabs-mode: t
|
* indent-tabs-mode: t
|
||||||
* c-file-style: "ellemtel"
|
* c-file-style: "ellemtel"
|
||||||
* c-basic-offset: 4
|
* c-basic-offset: 4
|
||||||
|
@@ -57,7 +57,6 @@ void rl_add_slash(char *path, char *p)
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Local Variables:
|
* Local Variables:
|
||||||
* version-control: t
|
|
||||||
* indent-tabs-mode: t
|
* indent-tabs-mode: t
|
||||||
* c-file-style: "ellemtel"
|
* c-file-style: "ellemtel"
|
||||||
* c-basic-offset: 4
|
* c-basic-offset: 4
|
||||||
|
@@ -232,7 +232,6 @@ void rl_add_slash(char *path, char *p)
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Local Variables:
|
* Local Variables:
|
||||||
* version-control: t
|
|
||||||
* indent-tabs-mode: t
|
* indent-tabs-mode: t
|
||||||
* c-file-style: "ellemtel"
|
* c-file-style: "ellemtel"
|
||||||
* c-basic-offset: 4
|
* c-basic-offset: 4
|
||||||
|
Reference in New Issue
Block a user